Skip to content

Commit

Permalink
make vsh menu x/o buttons behave like the xmb
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 6, 2023
1 parent 7e86b21 commit 93211d6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
6 changes: 2 additions & 4 deletions extras/menus/advancedvsh/advanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ int submenu_setup(void) {
int submenu_ctrl(u32 button_on) {
int direction;

if ((button_on & PSP_CTRL_SELECT) || (button_on & PSP_CTRL_HOME)) {
if ((button_on & PSP_CTRL_SELECT) || (button_on & PSP_CTRL_HOME) || button_decline(button_on)) {
submenu_sel = SUBMENU_GO_BACK;
return 1;
}
Expand All @@ -381,9 +381,7 @@ int submenu_ctrl(u32 button_on) {

if(button_on & PSP_CTRL_LEFT)
direction = -1;
if(button_on & PSP_CTRL_CROSS)
direction = 0;
if(button_on & PSP_CTRL_CIRCLE)
if(button_accept(button_on))
direction = 0;
if(button_on & PSP_CTRL_RIGHT)
direction = 1;
Expand Down
9 changes: 9 additions & 0 deletions extras/menus/advancedvsh/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
#include "color.h"
#include "registry.h"

int button_accept(u32 button){
vsh_Menu* vsh = vsh_menu_pointer();
return (vsh->status.swap_xo && (button & PSP_CTRL_CROSS)) || (!vsh->status.swap_xo && (button & PSP_CTRL_CIRCLE));
}

int button_decline(u32 button){
vsh_Menu* vsh = vsh_menu_pointer();
return (vsh->status.swap_xo && (button & PSP_CTRL_CIRCLE)) || (!vsh->status.swap_xo && (button & PSP_CTRL_CROSS));
}

void config_load(vsh_Menu *vsh) {
int is_pandora;
Expand Down
6 changes: 2 additions & 4 deletions extras/menus/advancedvsh/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int menu_setup(void) {
int menu_ctrl(u32 button_on) {
int direction;

if((button_on & PSP_CTRL_SELECT) || (button_on & PSP_CTRL_HOME)) {
if((button_on & PSP_CTRL_SELECT) || (button_on & PSP_CTRL_HOME) || button_decline(button_on)) {
menu_sel = TMENU_EXIT;
return 1;
}
Expand All @@ -244,9 +244,7 @@ int menu_ctrl(u32 button_on) {

if(button_on & PSP_CTRL_LEFT)
direction = -1;
if(button_on & PSP_CTRL_CROSS)
direction = 0;
if(button_on & PSP_CTRL_CIRCLE)
if(button_accept(button_on))
direction = 0;
if(button_on & PSP_CTRL_RIGHT)
direction = 1;
Expand Down
2 changes: 1 addition & 1 deletion extras/menus/advancedvsh/vsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ vsh_Menu *g_vsh_menu = &vsh_menu;


vsh_Menu* vsh_menu_pointer(void) {
return (vsh_Menu*)&vsh_menu;
return g_vsh_menu;
}

0 comments on commit 93211d6

Please sign in to comment.