mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Decompiled start_menu.s
This commit is contained in:
parent
2ecbe252a2
commit
6cd590f4fd
@ -836,7 +836,7 @@ _080E24C6:
|
|||||||
adds r1, r4, 0
|
adds r1, r4, 0
|
||||||
adds r2, r7, 0
|
adds r2, r7, 0
|
||||||
movs r3, 0x11
|
movs r3, 0x11
|
||||||
bl sub_819A024
|
bl PrintPlayerNameOnWindow
|
||||||
adds r0, r6, 0
|
adds r0, r6, 0
|
||||||
mov r1, r8
|
mov r1, r8
|
||||||
movs r2, 0
|
movs r2, 0
|
||||||
|
2101
asm/start_menu.s
2101
asm/start_menu.s
File diff suppressed because it is too large
Load Diff
@ -382,6 +382,8 @@ extern const u8 SecretBase_RedCave1_Text_2751E1[];
|
|||||||
extern const u8 SecretBase_RedCave1_Text_2754F6[];
|
extern const u8 SecretBase_RedCave1_Text_2754F6[];
|
||||||
extern const u8 SecretBase_RedCave1_Text_2758CC[];
|
extern const u8 SecretBase_RedCave1_Text_2758CC[];
|
||||||
|
|
||||||
|
extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88[];
|
||||||
|
|
||||||
//field effects
|
//field effects
|
||||||
extern const u8 FieryPath_EventScript_2908FD[];
|
extern const u8 FieryPath_EventScript_2908FD[];
|
||||||
extern const u8 EventScript_290CAE[];
|
extern const u8 EventScript_290CAE[];
|
||||||
|
@ -55,4 +55,6 @@ void sub_81AAC50(void);
|
|||||||
void sub_81AAC70(void);
|
void sub_81AAC70(void);
|
||||||
void bag_menu_mail_related(void);
|
void bag_menu_mail_related(void);
|
||||||
|
|
||||||
|
void CB2_BagMenuFromStartMenu(void);
|
||||||
|
|
||||||
#endif //GUARD_item_menu_H
|
#endif //GUARD_item_menu_H
|
||||||
|
@ -257,6 +257,7 @@ void sub_800AAF4(void);
|
|||||||
void sub_800AF18(u32 status, u8 lastSendQueueCount, u8 lastRecvQueueCount, u8 unk_06);
|
void sub_800AF18(u32 status, u8 lastSendQueueCount, u8 lastRecvQueueCount, u8 unk_06);
|
||||||
void sub_800B348(void);
|
void sub_800B348(void);
|
||||||
void sub_800B3A4(u32 who);
|
void sub_800B3A4(u32 who);
|
||||||
|
bool32 sub_800A07C(void);
|
||||||
|
|
||||||
extern u16 gLinkPartnersHeldKeys[6];
|
extern u16 gLinkPartnersHeldKeys[6];
|
||||||
extern u32 gLinkDebugSeed;
|
extern u32 gLinkDebugSeed;
|
||||||
|
@ -21,5 +21,7 @@ void LoadSerializedGame(void);
|
|||||||
void LoadPlayerBag(void);
|
void LoadPlayerBag(void);
|
||||||
void SavePlayerBag(void);
|
void SavePlayerBag(void);
|
||||||
void SetSaveBlocksPointers(u16);
|
void SetSaveBlocksPointers(u16);
|
||||||
|
void sub_8076D5C(void);
|
||||||
|
void sav2_gender2_inplace_and_xFE(void);
|
||||||
|
|
||||||
#endif // GUARD_LOAD_SAVE_H
|
#endif // GUARD_LOAD_SAVE_H
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#ifndef GUARD_MENU_H
|
#ifndef GUARD_MENU_H
|
||||||
#define GUARD_MENU_H
|
#define GUARD_MENU_H
|
||||||
|
|
||||||
@ -27,8 +28,9 @@ void NewMenuHelpers_DrawDialogueFrame(u8, u8);
|
|||||||
void sub_819746C(u8 windowId, bool8 copyToVram);
|
void sub_819746C(u8 windowId, bool8 copyToVram);
|
||||||
void NewMenuHelpers_DrawStdWindowFrame(u8, u8);
|
void NewMenuHelpers_DrawStdWindowFrame(u8, u8);
|
||||||
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor);
|
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor);
|
||||||
|
void PrintPlayerNameOnWindow(u8, const u8*, u16, u16);
|
||||||
void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback);
|
void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback);
|
||||||
void sub_8197434(u8 a0, u8 a1);
|
void sub_8197434(u8 windowId, bool8 copyToVram);
|
||||||
void SetStandardWindowBorderStyle(u8 a0, u8 a1);
|
void SetStandardWindowBorderStyle(u8 a0, u8 a1);
|
||||||
void sub_8197930(void);
|
void sub_8197930(void);
|
||||||
u8 GetPlayerTextSpeed(void);
|
u8 GetPlayerTextSpeed(void);
|
||||||
@ -67,6 +69,16 @@ void AddItemMenuActionTextPrinters (u8, u8, u8, u8, u8, u8, u8, const struct Men
|
|||||||
void sub_8198DBC(u8, u8, u8, u8, u8, u8, u8, const struct MenuAction*, const u8*);
|
void sub_8198DBC(u8, u8, u8, u8, u8, u8, u8, const struct MenuAction*, const u8*);
|
||||||
u8 sub_8199944(u8, u8, u8, u8, u8);
|
u8 sub_8199944(u8, u8, u8, u8, u8);
|
||||||
u8 sub_8199134(s8, s8);
|
u8 sub_8199134(s8, s8);
|
||||||
|
u8 GetStartMenuWindowId(void);
|
||||||
void sub_819A2BC(u8, u8);
|
void sub_819A2BC(u8, u8);
|
||||||
|
u8 MoveMenuCursor(s8 cursorDelta);
|
||||||
|
void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 CopyToVram);
|
||||||
|
u8 sub_81979C4(u8 a1);
|
||||||
|
u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos);
|
||||||
|
void sub_819786C(u8 windowId, bool8 copyToVram);
|
||||||
|
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress);
|
||||||
|
void remove_start_menu_window_maybe(void);
|
||||||
|
void sub_8197948(u8 initialCursorPos);
|
||||||
|
void sub_819A344(u8 a0, u8 *dest, u8 color);
|
||||||
|
|
||||||
#endif // GUARD_MENU_H
|
#endif // GUARD_MENU_H
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef GUARD_START_MENU_H
|
#ifndef GUARD_START_MENU_H
|
||||||
#define GUARD_START_MENU_H
|
#define GUARD_START_MENU_H
|
||||||
|
|
||||||
|
extern bool8 (*gMenuCallback)(void); // Defined in sym_common.txt
|
||||||
|
|
||||||
void AppendToList(u8* list, u8* pos, u8 newEntry);
|
void AppendToList(u8* list, u8* pos, u8 newEntry);
|
||||||
|
|
||||||
#endif // GUARD_START_MENU_H
|
#endif // GUARD_START_MENU_H
|
||||||
|
@ -82,6 +82,12 @@
|
|||||||
#define TEXT_COLOR_TRANSPARENT 0x0
|
#define TEXT_COLOR_TRANSPARENT 0x0
|
||||||
#define TEXT_COLOR_WHITE 0x1
|
#define TEXT_COLOR_WHITE 0x1
|
||||||
#define TEXT_COLOR_DARK_GREY 0x2
|
#define TEXT_COLOR_DARK_GREY 0x2
|
||||||
|
// 0x3
|
||||||
|
#define TEXT_COLOR_RED 0x4
|
||||||
|
// 0x5
|
||||||
|
#define TEXT_COLOR_GREEN 0x6
|
||||||
|
// 0x7
|
||||||
|
#define TEXT_COLOR_BLUE 0x8
|
||||||
|
|
||||||
// battle placeholders are located in battle_message.h
|
// battle placeholders are located in battle_message.h
|
||||||
|
|
||||||
|
@ -107,7 +107,6 @@ SECTIONS {
|
|||||||
src/clock.o(.text);
|
src/clock.o(.text);
|
||||||
src/reset_rtc_screen.o(.text);
|
src/reset_rtc_screen.o(.text);
|
||||||
src/start_menu.o(.text);
|
src/start_menu.o(.text);
|
||||||
asm/start_menu.o(.text);
|
|
||||||
src/tileset_anims.o(.text);
|
src/tileset_anims.o(.text);
|
||||||
src/palette.o(.text);
|
src/palette.o(.text);
|
||||||
src/sound.o(.text);
|
src/sound.o(.text);
|
||||||
|
98
src/menu.c
98
src/menu.c
@ -25,11 +25,11 @@
|
|||||||
#define STD_WINDOW_PALETTE_NUM 14
|
#define STD_WINDOW_PALETTE_NUM 14
|
||||||
#define STD_WINDOW_BASE_TILE_NUM 0x214
|
#define STD_WINDOW_BASE_TILE_NUM 0x214
|
||||||
|
|
||||||
struct SomeUnkStruct_60F0D4
|
struct MoveMenuInfoIcon
|
||||||
{
|
{
|
||||||
u8 unk1;
|
u8 width;
|
||||||
u8 unk2;
|
u8 height;
|
||||||
u16 unk3;
|
u16 offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Menu
|
struct Menu
|
||||||
@ -48,7 +48,7 @@ struct Menu
|
|||||||
bool8 APressMuted;
|
bool8 APressMuted;
|
||||||
};
|
};
|
||||||
|
|
||||||
static EWRAM_DATA u8 gUnknown_0203CD8C = 0;
|
static EWRAM_DATA u8 gStartMenuWindowId = 0;
|
||||||
static EWRAM_DATA u8 gUnknown_0203CD8D = 0;
|
static EWRAM_DATA u8 gUnknown_0203CD8D = 0;
|
||||||
static EWRAM_DATA struct Menu gUnknown_0203CD90 = {0};
|
static EWRAM_DATA struct Menu gUnknown_0203CD90 = {0};
|
||||||
static EWRAM_DATA u16 gUnknown_0203CD9C = 0;
|
static EWRAM_DATA u16 gUnknown_0203CD9C = 0;
|
||||||
@ -76,34 +76,36 @@ static const struct WindowTemplate gUnknown_0860F0A8 =
|
|||||||
|
|
||||||
const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal");
|
const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal");
|
||||||
const u8 gUnknown_0860F0D0[] = { 15, 1, 2 };
|
const u8 gUnknown_0860F0D0[] = { 15, 1, 2 };
|
||||||
const struct SomeUnkStruct_60F0D4 gUnknown_0860F0D4[] =
|
|
||||||
{
|
// Table of move info icon offsets in graphics/interface_fr/menu.png
|
||||||
{ 12, 12, 0x00 },
|
const struct MoveMenuInfoIcon gMoveMenuInfoIcons[] =
|
||||||
{ 32, 12, 0x20 },
|
{ // { width, height, offset }
|
||||||
{ 32, 12, 0x64 },
|
{ 12, 12, 0x00 }, // Unused
|
||||||
{ 32, 12, 0x60 },
|
{ 32, 12, 0x20 }, // Normal icon
|
||||||
{ 32, 12, 0x80 },
|
{ 32, 12, 0x64 }, // Fight icon
|
||||||
{ 32, 12, 0x48 },
|
{ 32, 12, 0x60 }, // Flying icon
|
||||||
{ 32, 12, 0x44 },
|
{ 32, 12, 0x80 }, // Poison icon
|
||||||
{ 32, 12, 0x6C },
|
{ 32, 12, 0x48 }, // Ground icon
|
||||||
{ 32, 12, 0x68 },
|
{ 32, 12, 0x44 }, // Rock icon
|
||||||
{ 32, 12, 0x88 },
|
{ 32, 12, 0x6C }, // Bug icon
|
||||||
{ 32, 12, 0xA4 },
|
{ 32, 12, 0x68 }, // Ghost icon
|
||||||
{ 32, 12, 0x24 },
|
{ 32, 12, 0x88 }, // Steel icon
|
||||||
{ 32, 12, 0x28 },
|
{ 32, 12, 0xA4 }, // ??? (Mystery) icon
|
||||||
{ 32, 12, 0x2C },
|
{ 32, 12, 0x24 }, // Fire icon
|
||||||
{ 32, 12, 0x40 },
|
{ 32, 12, 0x28 }, // Water icon
|
||||||
{ 32, 12, 0x84 },
|
{ 32, 12, 0x2C }, // Grass icon
|
||||||
{ 32, 12, 0x4C },
|
{ 32, 12, 0x40 }, // Electric icon
|
||||||
{ 32, 12, 0xA0 },
|
{ 32, 12, 0x84 }, // Psychic icon
|
||||||
{ 32, 12, 0x8C },
|
{ 32, 12, 0x4C }, // Ice icon
|
||||||
{ 42, 12, 0xA8 },
|
{ 32, 12, 0xA0 }, // Dragon icon
|
||||||
{ 42, 12, 0xC0 },
|
{ 32, 12, 0x8C }, // Dark icon
|
||||||
{ 42, 12, 0xC8 },
|
{ 42, 12, 0xA8 }, // -Type- icon
|
||||||
{ 42, 12, 0xE0 },
|
{ 42, 12, 0xC0 }, // -Power- icon
|
||||||
{ 42, 12, 0xE8 },
|
{ 42, 12, 0xC8 }, // -Accuracy- icon
|
||||||
{ 8, 8, 0xAE },
|
{ 42, 12, 0xE0 }, // -PP- icon
|
||||||
{ 8, 8, 0xAF },
|
{ 42, 12, 0xE8 }, // -Effect- icon
|
||||||
|
{ 8, 8, 0xAE }, // Unused (Small white pokeball)
|
||||||
|
{ 8, 8, 0xAF }, // Unused (Small dark pokeball)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
@ -125,7 +127,7 @@ extern void task_free_buf_after_copying_tile_data_to_vram(u8 taskId);
|
|||||||
void sub_81971D0(void)
|
void sub_81971D0(void)
|
||||||
{
|
{
|
||||||
InitWindows(gUnknown_0860F098);
|
InitWindows(gUnknown_0860F098);
|
||||||
gUnknown_0203CD8C = 0xFF;
|
gStartMenuWindowId = 0xFF;
|
||||||
gUnknown_0203CD8D = 0xFF;
|
gUnknown_0203CD8D = 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,22 +473,22 @@ u8 GetPlayerTextSpeed(void)
|
|||||||
|
|
||||||
u8 sub_81979C4(u8 a1)
|
u8 sub_81979C4(u8 a1)
|
||||||
{
|
{
|
||||||
if (gUnknown_0203CD8C == 0xFF)
|
if (gStartMenuWindowId == 0xFF)
|
||||||
gUnknown_0203CD8C = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
|
gStartMenuWindowId = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
|
||||||
return gUnknown_0203CD8C;
|
return gStartMenuWindowId;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 GetStartMenuWindowId(void)
|
u8 GetStartMenuWindowId(void)
|
||||||
{
|
{
|
||||||
return gUnknown_0203CD8C;
|
return gStartMenuWindowId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove_start_menu_window_maybe(void)
|
void remove_start_menu_window_maybe(void)
|
||||||
{
|
{
|
||||||
if (gUnknown_0203CD8C != 0xFF)
|
if (gStartMenuWindowId != 0xFF)
|
||||||
{
|
{
|
||||||
RemoveWindow(gUnknown_0203CD8C);
|
RemoveWindow(gStartMenuWindowId);
|
||||||
gUnknown_0203CD8C = 0xFF;
|
gStartMenuWindowId = 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1988,7 +1990,7 @@ void sub_8199F74(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 spee
|
|||||||
AddTextPrinter(&printer, speed, callback);
|
AddTextPrinter(&printer, speed, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_819A024(u8 windowId, const u8 *src, u16 a2, u16 a3)
|
void PrintPlayerNameOnWindow(u8 windowId, const u8 *src, u16 x, u16 y)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (gSaveBlock2Ptr->playerName[count] != EOS)
|
while (gSaveBlock2Ptr->playerName[count] != EOS)
|
||||||
@ -1996,7 +1998,7 @@ void sub_819A024(u8 windowId, const u8 *src, u16 a2, u16 a3)
|
|||||||
|
|
||||||
StringExpandPlaceholders(gStringVar4, src);
|
StringExpandPlaceholders(gStringVar4, src);
|
||||||
|
|
||||||
PrintTextOnWindow(windowId, 1, gStringVar4, a2, a3, 0xFF, 0);
|
PrintTextOnWindow(windowId, 1, gStringVar4, x, y, 0xFF, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Screw this function, it's long and unreferenced and ugh
|
//Screw this function, it's long and unreferenced and ugh
|
||||||
@ -2364,22 +2366,22 @@ void sub_819A2BC(u8 palOffset, u8 palId)
|
|||||||
|
|
||||||
void blit_move_info_icon(u8 windowId, u8 iconId, u16 x, u16 y)
|
void blit_move_info_icon(u8 windowId, u8 iconId, u16 x, u16 y)
|
||||||
{
|
{
|
||||||
BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + gUnknown_0860F0D4[iconId].unk3 * 32, 0, 0, 128, 128, x, y, gUnknown_0860F0D4[iconId].unk1, gUnknown_0860F0D4[iconId].unk2);
|
BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + gMoveMenuInfoIcons[iconId].offset * 32, 0, 0, 128, 128, x, y, gMoveMenuInfoIcons[iconId].width, gMoveMenuInfoIcons[iconId].height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_819A344(u8 a0, u8 *a1, u8 a2)
|
void sub_819A344(u8 a0, u8 *dest, u8 color)
|
||||||
{
|
{
|
||||||
s32 curFlag;
|
s32 curFlag;
|
||||||
s32 flagCount;
|
s32 flagCount;
|
||||||
u8 *endOfString;
|
u8 *endOfString;
|
||||||
u8 *string = a1;
|
u8 *string = dest;
|
||||||
|
|
||||||
*(string++) = EXT_CTRL_CODE_BEGIN;
|
*(string++) = EXT_CTRL_CODE_BEGIN;
|
||||||
*(string++) = EXT_CTRL_CODE_COLOR;
|
*(string++) = EXT_CTRL_CODE_COLOR;
|
||||||
*(string++) = a2;
|
*(string++) = color;
|
||||||
*(string++) = EXT_CTRL_CODE_BEGIN;
|
*(string++) = EXT_CTRL_CODE_BEGIN;
|
||||||
*(string++) = EXT_CTRL_CODE_SHADOW;
|
*(string++) = EXT_CTRL_CODE_SHADOW;
|
||||||
*(string++) = a2 + 1;
|
*(string++) = color + 1;
|
||||||
|
|
||||||
switch (a0)
|
switch (a0)
|
||||||
{
|
{
|
||||||
|
1160
src/start_menu.c
1160
src/start_menu.c
File diff suppressed because it is too large
Load Diff
@ -70,7 +70,7 @@ gUnknown_03005DEC: @ 3005DEC
|
|||||||
gSelectedMapObject: @ 3005DF0
|
gSelectedMapObject: @ 3005DF0
|
||||||
.space 0x4
|
.space 0x4
|
||||||
|
|
||||||
gUnknown_03005DF4: @ 3005DF4
|
gMenuCallback: @ 3005DF4
|
||||||
.space 0x4
|
.space 0x4
|
||||||
|
|
||||||
.include "sound.o"
|
.include "sound.o"
|
||||||
|
Loading…
Reference in New Issue
Block a user