mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-11 03:25:46 -05:00
more work on menu input
This commit is contained in:
6092
asm/code_8012A18.s
6092
asm/code_8012A18.s
File diff suppressed because it is too large
Load Diff
6025
asm/code_80130A8.s
Normal file
6025
asm/code_80130A8.s
Normal file
File diff suppressed because it is too large
Load Diff
@@ -90,6 +90,8 @@ SECTIONS {
|
||||
src/code_8012A18.o(.text);
|
||||
src/more_input.o(.text);
|
||||
asm/code_8012A18.o(.text);
|
||||
src/menu_input.o(.text);
|
||||
asm/code_80130A8.o(.text);
|
||||
src/code_8012A18_1.o(.text);
|
||||
src/felicity_bank.o(.text);
|
||||
asm/felicity_bank.o(.text);
|
||||
|
||||
56
src/menu_input.c
Normal file
56
src/menu_input.c
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "global.h"
|
||||
#include "menu.h"
|
||||
|
||||
extern void PlayMenuSoundEffect(u32);
|
||||
extern s32 GetKeyPress(u32 *);
|
||||
extern u32 sub_80137A8(u32 *);
|
||||
extern void sub_8012EBC(void *);
|
||||
|
||||
u8 sub_80130A8(struct MenuStruct *param_1) {
|
||||
int keyPress;
|
||||
int index;
|
||||
int menuAction;
|
||||
u8 *ptr;
|
||||
u32 unused; // needed for matching
|
||||
struct MenuItem *menuItem;
|
||||
|
||||
ptr = ¶m_1->unk4C;
|
||||
if (*ptr != 0) {
|
||||
keyPress = GetKeyPress(¶m_1->unk14);
|
||||
|
||||
switch(keyPress)
|
||||
{
|
||||
// A_BUTTON
|
||||
case 1:
|
||||
index = sub_80137A8(¶m_1->unk14);
|
||||
menuItem = ¶m_1->menuItems[index];
|
||||
param_1->menuAction = menuItem->menuAction;
|
||||
unused = 0;
|
||||
*ptr = 0;
|
||||
param_1->unk38 = 0;
|
||||
PlayMenuSoundEffect(0);
|
||||
break;
|
||||
// B_BUTTON
|
||||
case 2:
|
||||
if(menuAction = param_1->menuItems[param_1->unk2E].menuAction, -1 < menuAction) {
|
||||
param_1->menuAction = menuAction;
|
||||
unused = 0;
|
||||
*ptr = 0;
|
||||
PlayMenuSoundEffect(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
sub_8012EBC(param_1);
|
||||
return param_1->unk4C;
|
||||
}
|
||||
|
||||
bool8 sub_8013114(struct MenuStruct *param_1, s32 *menuAction){
|
||||
if(param_1->unk4C != 0){
|
||||
return TRUE;
|
||||
}
|
||||
if (menuAction != NULL){
|
||||
*menuAction = param_1->menuAction;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
Reference in New Issue
Block a user