Skip to content

Commit

Permalink
advanced: forgot to change the vsh->buttons.pad.Buttons to the local …
Browse files Browse the repository at this point in the history
…var pad
  • Loading branch information
pyroesp committed Jul 28, 2023
1 parent a124791 commit 6faf973
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions extras/menus/advancedvsh/advanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,15 @@ int submenu_ctrl(u32 button_on) {

void subbutton_func(vsh_Menu *vsh) {
int res;
// copy pad from the vsh struct in case it can change during the function
SceCtrlData pad = vsh->buttons.pad;
// calculate new_buttons_on from old_pad and pad
u32 new_buttons_on = ~vsh->buttons.old_pad.Buttons & vsh->buttons.pad.Buttons;

// submenu control
switch(vsh->status.submenu_mode) {
case 0:
if ((vsh->buttons.pad.Buttons & ALL_CTRL) == 0)
if ((pad.Buttons & ALL_CTRL) == 0)
vsh->status.submenu_mode = 1;
break;
case 1:
Expand All @@ -524,10 +526,10 @@ void subbutton_func(vsh_Menu *vsh) {
break;
case 2: // exit waiting
// exit submenu
if ((vsh->buttons.pad.Buttons & ALL_CTRL) == 0)
if ((pad.Buttons & ALL_CTRL) == 0)
vsh->status.sub_stop_flag = sub_stop_stock;
break;
}

// copy pad to oldpad
scePaf_memcpy(&vsh->buttons.old_pad, &pad, sizeof(SceCtrlData));
}

0 comments on commit 6faf973

Please sign in to comment.