define some menu data in C

This commit is contained in:
YamaArashi 2017-01-05 04:24:19 -08:00
parent 3d412c4502
commit 9b0872d1b8
5 changed files with 67 additions and 52 deletions

View File

@ -3,24 +3,6 @@
.section .rodata
.align 2
gStartMenuItems:: @ 8376D24
.4byte SystemText_Pokedex, StartMenu_PokedexCallback
.4byte SystemText_Pokemon, StartMenu_PokemonCallback
.4byte SystemText_BAG, StartMenu_BagCallback
.4byte SystemText_Pokenav, StartMenu_PokenavCallback
.4byte SystemText_Player, StartMenu_PlayerCallback
.4byte SystemText_Save, StartMenu_SaveCallback
.4byte SystemText_Option, StartMenu_OptionCallback
.4byte SystemText_Exit, StartMenu_ExitCallback
.4byte SystemText_Retire, StartMenu_RetireCallback
.4byte SystemText_Player, StartMenu_PlayerLinkCallback
.align 2
gMenuYesNoItems:: @ 8376D74
.4byte OtherText_Yes, 0
.4byte OtherText_No, 0
.align 2
TilesetAnimTiles_General_0_1: @ 8376D84
.incbin "data/tilesets/primary/general/anim/0/1.4bpp"
@ -23077,23 +23059,23 @@ gSystemText_LR:: @ 842C465
gSystemText_LA:: @ 842C46B
.string "{PALETTE 15}L=A$"
SystemText_Pokedex:
SystemText_Pokedex::
.string "POKéDEX$"
SystemText_Pokemon:
SystemText_Pokemon::
.string "POKéMON$"
SystemText_BAG:
SystemText_BAG::
.string "BAG$"
SystemText_Pokenav:
SystemText_Pokenav::
.string "POKéNAV$"
SystemText_Player:
SystemText_Player::
.string "{PLAYER}$"
SystemText_Save:
SystemText_Save::
.string "SAVE$"
SystemText_Option:
SystemText_Option::
.string "OPTION$"
SystemText_Exit:
SystemText_Exit::
.string "EXIT$"
SystemText_Retire: @ safari zone?
SystemText_Retire:: @ safari zone?
.string "RETIRE$"
gOtherText_SafariStock:: @ 842C4A9

View File

@ -5,16 +5,6 @@
void CreateStartMenuTask(void (*func)(u8));
void sub_80712B4(u8 taskId);
void sub_8071310(void);
u8 StartMenu_PokedexCallback(void);
u8 StartMenu_PokemonCallback(void);
u8 StartMenu_BagCallback(void);
u8 StartMenu_PokenavCallback(void);
u8 StartMenu_PlayerCallback(void);
u8 StartMenu_SaveCallback(void);
u8 StartMenu_OptionCallback(void);
u8 StartMenu_ExitCallback(void);
u8 StartMenu_RetireCallback(void);
u8 StartMenu_PlayerLinkCallback(void);
void InitSaveDialog(void);
void sub_8071B28(void);

View File

@ -318,6 +318,8 @@ SECTIONS {
data/field_tasks.o(.rodata);
data/reset_rtc_screen.o(.rodata);
data/party_menu.o(.rodata);
src/start_menu.o(.rodata);
src/menu.o(.rodata);
data/data_83760F0.o(.rodata);
src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata);

View File

@ -22,6 +22,9 @@ struct Menu
u8 columnXCoords[8];
};
extern u8 OtherText_Yes[];
extern u8 OtherText_No[];
static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16);
static void InitMenuWindowInternal(const struct WindowConfig *, u16);
static bool8 sub_80723D4(void);
@ -41,7 +44,11 @@ EWRAM_DATA u16 gMenuTextWindowTileOffset = 0;
EWRAM_DATA u16 gMenuTextWindowContentTileOffset = 0;
EWRAM_DATA u16 gMenuMessageBoxContentTileOffset = 0;
extern const struct MenuAction gMenuYesNoItems[];
const struct MenuAction gMenuYesNoItems[] =
{
{ OtherText_Yes, NULL },
{ OtherText_No, NULL },
};
void CloseMenu(void)
{

View File

@ -51,7 +51,6 @@ extern u16 gSaveFileStatus;
extern u16 gScriptResult;
extern u8 (*gCallback_03004AE8)(void);
extern u8 gUnknown_03004860;
extern struct MenuItem gStartMenuItems[];
extern u8 gNumSafariBalls;
EWRAM_DATA static u8 sStartMenuCursorPos = 0;
@ -67,6 +66,41 @@ extern u8 gSaveText_ThereIsAlreadyAFile[];
extern u8 gSaveText_ThereIsADifferentFile[];
extern u8 gSaveText_WouldYouLikeToSave[];
extern u8 gOtherText_SafariStock[];
extern u8 SystemText_Pokedex[];
extern u8 SystemText_Pokemon[];
extern u8 SystemText_BAG[];
extern u8 SystemText_Pokenav[];
extern u8 SystemText_Player[];
extern u8 SystemText_Save[];
extern u8 SystemText_Option[];
extern u8 SystemText_Exit[];
extern u8 SystemText_Retire[];
extern u8 SystemText_Player[];
static u8 StartMenu_PokedexCallback(void);
static u8 StartMenu_PokemonCallback(void);
static u8 StartMenu_BagCallback(void);
static u8 StartMenu_PokenavCallback(void);
static u8 StartMenu_PlayerCallback(void);
static u8 StartMenu_SaveCallback(void);
static u8 StartMenu_OptionCallback(void);
static u8 StartMenu_ExitCallback(void);
static u8 StartMenu_RetireCallback(void);
static u8 StartMenu_PlayerLinkCallback(void);
static const struct MenuItem sStartMenuItems[] =
{
{ SystemText_Pokedex, StartMenu_PokedexCallback },
{ SystemText_Pokemon, StartMenu_PokemonCallback },
{ SystemText_BAG, StartMenu_BagCallback },
{ SystemText_Pokenav, StartMenu_PokenavCallback },
{ SystemText_Player, StartMenu_PlayerCallback },
{ SystemText_Save, StartMenu_SaveCallback },
{ SystemText_Option, StartMenu_OptionCallback },
{ SystemText_Exit, StartMenu_ExitCallback },
{ SystemText_Retire, StartMenu_RetireCallback },
{ SystemText_Player, StartMenu_PlayerLinkCallback },
};
//Private functions
static void BuildStartMenuActions(void);
@ -180,7 +214,7 @@ static bool32 PrintStartMenuItemsMultistep(s16 *index, u32 n)
do
{
MenuPrint(gStartMenuItems[sCurrentStartMenuActions[_index]].text, 23, 2 + _index * 2);
MenuPrint(sStartMenuItems[sCurrentStartMenuActions[_index]].text, 23, 2 + _index * 2);
_index++;
if(_index >= sNumStartMenuActions)
{
@ -303,12 +337,12 @@ static u8 StartMenu_InputProcessCallback(void)
if(gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
if(gStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].callback == StartMenu_PokedexCallback)
if(sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].callback == StartMenu_PokedexCallback)
{
if(GetNationalPokedexCount(0) == 0)
return 0;
}
gCallback_03004AE8 = gStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].callback;
gCallback_03004AE8 = sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].callback;
if(gCallback_03004AE8 != StartMenu_SaveCallback &&
gCallback_03004AE8 != StartMenu_ExitCallback &&
gCallback_03004AE8 != StartMenu_RetireCallback)
@ -324,7 +358,7 @@ static u8 StartMenu_InputProcessCallback(void)
}
//When player selects POKEDEX
u8 StartMenu_PokedexCallback(void)
static u8 StartMenu_PokedexCallback(void)
{
if(!gPaletteFade.active)
{
@ -337,7 +371,7 @@ u8 StartMenu_PokedexCallback(void)
}
//When player selects POKEMON
u8 StartMenu_PokemonCallback(void)
static u8 StartMenu_PokemonCallback(void)
{
if(!gPaletteFade.active)
{
@ -349,7 +383,7 @@ u8 StartMenu_PokemonCallback(void)
}
//When player selects BAG
u8 StartMenu_BagCallback(void)
static u8 StartMenu_BagCallback(void)
{
if(!gPaletteFade.active)
{
@ -361,7 +395,7 @@ u8 StartMenu_BagCallback(void)
}
//When player selects POKENAV
u8 StartMenu_PokenavCallback(void)
static u8 StartMenu_PokenavCallback(void)
{
if(!gPaletteFade.active)
{
@ -373,7 +407,7 @@ u8 StartMenu_PokenavCallback(void)
}
//When player selects his/her name
u8 StartMenu_PlayerCallback(void)
static u8 StartMenu_PlayerCallback(void)
{
if(!gPaletteFade.active)
{
@ -385,7 +419,7 @@ u8 StartMenu_PlayerCallback(void)
}
//When player selects SAVE
u8 StartMenu_SaveCallback(void)
static u8 StartMenu_SaveCallback(void)
{
sub_8072DEC();
gCallback_03004AE8 = SaveCallback1;
@ -393,7 +427,7 @@ u8 StartMenu_SaveCallback(void)
}
//When player selects OPTION
u8 StartMenu_OptionCallback(void)
static u8 StartMenu_OptionCallback(void)
{
if(!gPaletteFade.active)
{
@ -406,14 +440,14 @@ u8 StartMenu_OptionCallback(void)
}
//When player selects EXIT
u8 StartMenu_ExitCallback(void)
static u8 StartMenu_ExitCallback(void)
{
CloseMenu();
return 1;
}
//When player selects RETIRE
u8 StartMenu_RetireCallback(void)
static u8 StartMenu_RetireCallback(void)
{
CloseMenu();
SafariZoneRetirePrompt();
@ -421,7 +455,7 @@ u8 StartMenu_RetireCallback(void)
}
//When player selects their name in multiplayer mode
u8 StartMenu_PlayerLinkCallback(void)
static u8 StartMenu_PlayerLinkCallback(void)
{
if(!gPaletteFade.active)
{