Minor cleanup before pushing

This commit is contained in:
Phlosioneer
2019-03-08 02:10:44 -05:00
parent 69aec91577
commit af182d6f16
3 changed files with 34 additions and 59 deletions
+4 -4
View File
@@ -25,10 +25,10 @@ struct UnknownStruct_81D1ED4
u8 unk356[0x22]; u8 unk356[0x22];
}; };
bool8 sub_81D1C44(u8 a0); bool8 sub_81D1C44(u8 count);
u8 sub_81D1C84(u8 a0); u8 sub_81D1C84(u8 a0);
u8 sub_81D1DC0(struct PlayerPCItemPageStruct *a0); u8 sub_81D1DC0(struct PlayerPCItemPageStruct *page);
void sub_81D1E90(struct PlayerPCItemPageStruct *a0); void sub_81D1E90(struct PlayerPCItemPageStruct *page);
void sub_81D1EC0(void); void sub_81D1EC0(void);
void sub_81D1D04(u8 a0); void sub_81D1D04(u8 a0);
void DrawLevelUpWindowPg1(u16 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); void DrawLevelUpWindowPg1(u16 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5);
@@ -42,7 +42,7 @@ void sub_81D3464(void *arg0);
void sub_81D3480(void *arg0, u8 arg1); void sub_81D3480(void *arg0, u8 arg1);
void sub_81D2754(struct UnknownStruct_81D1ED4 *arg0, struct UnknownSubStruct_81D1ED4 *arg1); void sub_81D2754(struct UnknownStruct_81D1ED4 *arg0, struct UnknownSubStruct_81D1ED4 *arg1);
void sub_81D1F84(struct UnknownStruct_81D1ED4 *arg0, struct UnknownSubStruct_81D1ED4 arg1[4][5], struct UnknownSubStruct_81D1ED4 arg2[4][5]); void sub_81D1F84(struct UnknownStruct_81D1ED4 *arg0, struct UnknownSubStruct_81D1ED4 arg1[4][5], struct UnknownSubStruct_81D1ED4 arg2[4][5]);
void MoveRelearnerPrintText(u8 *text); void MoveRelearnerPrintText(u8 *str);
bool16 MoveRelearnerRunTextPrinters(void); bool16 MoveRelearnerRunTextPrinters(void);
void MoveRelearnerCreateYesNoMenu(void); void MoveRelearnerCreateYesNoMenu(void);
u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices); u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices);
+29 -54
View File
@@ -21,22 +21,18 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "gba/io_reg.h" #include "gba/io_reg.h"
#define WINDOW_UNK_0 0
#define WINDOW_UNK_1 1
#define WINDOW_UNK_2 2
EWRAM_DATA static u8 sUnknown_0203CF48[3] = {0}; EWRAM_DATA static u8 sUnknown_0203CF48[3] = {0};
EWRAM_DATA static struct ListMenuItem *sUnknown_0203CF4C = NULL; EWRAM_DATA static struct ListMenuItem *sUnknown_0203CF4C = NULL;
void sub_81D1E7C(s32 itemIndex, bool8 onInit, struct ListMenu *list); static void sub_81D1E7C(s32 itemIndex, bool8 onInit, struct ListMenu *list);
void sub_81D24A4(struct UnknownStruct_81D1ED4 *a0); static void sub_81D24A4(struct UnknownStruct_81D1ED4 *a0);
void sub_81D2634(struct UnknownStruct_81D1ED4 *a0); static void sub_81D2634(struct UnknownStruct_81D1ED4 *a0);
void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list); static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list);
extern void nullsub_79(void); static void nullsub_79(void);
static const struct WindowTemplate sUnknown_086253E8[] = static const struct WindowTemplate sUnknown_086253E8[] =
{ {
[WINDOW_UNK_0] = { {
.bg = 0, .bg = 0,
.tilemapLeft = 1, .tilemapLeft = 1,
.tilemapTop = 1, .tilemapTop = 1,
@@ -45,7 +41,7 @@ static const struct WindowTemplate sUnknown_086253E8[] =
.paletteNum = 0xF, .paletteNum = 0xF,
.baseBlock = 0x8 .baseBlock = 0x8
}, },
[WINDOW_UNK_1] = { {
.bg = 0, .bg = 0,
.tilemapLeft = 21, .tilemapLeft = 21,
.tilemapTop = 1, .tilemapTop = 1,
@@ -54,7 +50,7 @@ static const struct WindowTemplate sUnknown_086253E8[] =
.paletteNum = 0xF, .paletteNum = 0xF,
.baseBlock = 0x18 .baseBlock = 0x18
}, },
[WINDOW_UNK_2] = { {
.bg = 0, .bg = 0,
.tilemapLeft = 1, .tilemapLeft = 1,
.tilemapTop = 1, .tilemapTop = 1,
@@ -119,7 +115,7 @@ static const u8 sUnknown_08625410[] =
}; };
const struct WindowTemplate gMoveRelearnerWindowTemplates[] = static const struct WindowTemplate sMoveRelearnerWindowTemplates[] =
{ {
{ {
.bg = 1, .bg = 1,
@@ -169,7 +165,7 @@ const struct WindowTemplate gMoveRelearnerWindowTemplates[] =
DUMMY_WIN_TEMPLATE DUMMY_WIN_TEMPLATE
}; };
const struct WindowTemplate gMoveRelearnerYesNoMenuTemplate = static const struct WindowTemplate sMoveRelearnerYesNoMenuTemplate =
{ {
.bg = 0, .bg = 0,
.tilemapLeft = 22, .tilemapLeft = 22,
@@ -181,7 +177,7 @@ const struct WindowTemplate gMoveRelearnerYesNoMenuTemplate =
}; };
const struct ListMenuTemplate gMoveRelearnerMovesListTemplate = static const struct ListMenuTemplate sMoveRelearnerMovesListTemplate =
{ {
.items = NULL, .items = NULL,
.moveCursorFunc = MoveRelearnerCursorCallback, .moveCursorFunc = MoveRelearnerCursorCallback,
@@ -228,16 +224,16 @@ u8 sub_81D1C84(u8 a0)
u8 windowId = sUnknown_0203CF48[a0]; u8 windowId = sUnknown_0203CF48[a0];
if (windowId == 0xFF) if (windowId == 0xFF)
{ {
if (a0 == WINDOW_UNK_2) if (a0 == 2)
{ {
u32 v1; u32 v1;
u32 v2; u32 v2;
s32 v3; s32 v3;
template = sUnknown_086253E8[WINDOW_UNK_2]; template = sUnknown_086253E8[2];
v3 = GetMaxWidthInMenuTable(&gMailboxMailOptions[0], 4); v3 = GetMaxWidthInMenuTable(&gMailboxMailOptions[0], 4);
template.width = v3; template.width = v3;
sUnknown_0203CF48[WINDOW_UNK_2] = AddWindow(&template); sUnknown_0203CF48[2] = AddWindow(&template);
} }
else else
{ {
@@ -256,12 +252,12 @@ void sub_81D1D04(u8 a0)
sUnknown_0203CF48[a0] = 0xFF; sUnknown_0203CF48[a0] = 0xFF;
} }
u8 sub_81D1D34(u8 a0) static u8 sub_81D1D34(u8 a0)
{ {
return sUnknown_0203CF48[a0]; return sUnknown_0203CF48[a0];
} }
void sub_81D1D44(u8 windowId, s32 itemId, u8 y) static void sub_81D1D44(u8 windowId, s32 itemId, u8 y)
{ {
u8 buffer[30]; u8 buffer[30];
u16 length; u16 length;
@@ -310,7 +306,7 @@ u8 sub_81D1DC0(struct PlayerPCItemPageStruct *page)
return ListMenuInit(&gMultiuseListMenuTemplate, page->itemsAbove, page->cursorPos); return ListMenuInit(&gMultiuseListMenuTemplate, page->itemsAbove, page->cursorPos);
} }
void sub_81D1E7C(s32 itemIndex, bool8 onInit, struct ListMenu *list) static void sub_81D1E7C(s32 itemIndex, bool8 onInit, struct ListMenu *list)
{ {
if (onInit != TRUE) if (onInit != TRUE)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
@@ -355,27 +351,6 @@ void sub_81D1ED4(struct UnknownStruct_81D1ED4 *a0)
NAKED NAKED
void sub_81D1F84(struct UnknownStruct_81D1ED4 *arg0, struct UnknownSubStruct_81D1ED4 arg1[4][5], struct UnknownSubStruct_81D1ED4 arg2[4][5]) void sub_81D1F84(struct UnknownStruct_81D1ED4 *arg0, struct UnknownSubStruct_81D1ED4 arg1[4][5], struct UnknownSubStruct_81D1ED4 arg2[4][5])
{ {
/*
u16 j;
u16 i;
s16 v1;
s16 v2;
for (j = 0; j < 5; j++)
{
v1 = arg1[0][j].unk0;
v2 = (arg2[0][j].unk0 - v1) / 10;
for (i = 0; i < 9; i++)
{
arg0->unk64[i][j].unk0 = v1 + ((v1 << 1) & 1);
}
for (i = 0; i < 9; i++)
{
}
}
*/
asm(".syntax unified\n\ asm(".syntax unified\n\
push {r4-r7,lr}\n\ push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\
@@ -723,7 +698,7 @@ void sub_81D2230(struct UnknownStruct_81D1ED4 *arg0)
} }
NAKED NAKED
void sub_81D2278(void *a0, void *a1, u16 *a2, u16 *a3, u8 a38, u32 a3C) static void sub_81D2278(void *a0, void *a1, u16 *a2, u16 *a3, u8 a38, u32 a3C)
{ {
#ifdef NONMATCHING #ifdef NONMATCHING
// a0 => sp0 // a0 => sp0
@@ -1072,7 +1047,7 @@ _081D2494:\n\
} }
NAKED NAKED
void sub_81D24A4(struct UnknownStruct_81D1ED4 *a0) static void sub_81D24A4(struct UnknownStruct_81D1ED4 *a0)
{ {
asm(".syntax unified\n\ asm(".syntax unified\n\
push {r4-r7,lr}\n\ push {r4-r7,lr}\n\
@@ -1286,7 +1261,7 @@ _081D2620:\n\
} }
NAKED NAKED
void sub_81D2634(struct UnknownStruct_81D1ED4 *a0) static void sub_81D2634(struct UnknownStruct_81D1ED4 *a0)
{ {
asm(".syntax unified\n\ asm(".syntax unified\n\
push {r4-r6,lr}\n\ push {r4-r6,lr}\n\
@@ -1599,7 +1574,7 @@ void InitMoveRelearnerWindows(bool8 useContextWindow)
{ {
u8 i; u8 i;
InitWindows(gMoveRelearnerWindowTemplates); InitWindows(sMoveRelearnerWindowTemplates);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
LoadUserWindowBorderGfx(0, 1, 0xE0); LoadUserWindowBorderGfx(0, 1, 0xE0);
LoadPalette(gUnknown_0860F074, 0xF0, 0x20); LoadPalette(gUnknown_0860F074, 0xF0, 0x20);
@@ -1627,14 +1602,14 @@ void InitMoveRelearnerWindows(bool8 useContextWindow)
schedule_bg_copy_tilemap_to_vram(1); schedule_bg_copy_tilemap_to_vram(1);
} }
void nullsub_79(void) static void nullsub_79(void)
{ {
} }
u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices) u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices)
{ {
gMultiuseListMenuTemplate = gMoveRelearnerMovesListTemplate; gMultiuseListMenuTemplate = sMoveRelearnerMovesListTemplate;
gMultiuseListMenuTemplate.totalItems = numChoices; gMultiuseListMenuTemplate.totalItems = numChoices;
gMultiuseListMenuTemplate.items = items; gMultiuseListMenuTemplate.items = items;
@@ -1650,7 +1625,7 @@ u8 LoadMoveRelearnerMovesList(const struct ListMenuItem *items, u16 numChoices)
} }
NAKED NAKED
void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove) static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove)
{ {
// Two small issues, and a few renamed registers. // Two small issues, and a few renamed registers.
#ifdef NONMATCHING #ifdef NONMATCHING
@@ -1928,7 +1903,7 @@ _081D2AB6:\n\
} }
NAKED NAKED
void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove) static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove)
{ {
#ifdef NONMATCHING #ifdef NONMATCHING
//u8 offset; //u8 offset;
@@ -2089,7 +2064,7 @@ _081D2BB8:\n\
#endif #endif
} }
void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list) static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list)
{ {
if (onInit != TRUE) if (onInit != TRUE)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
@@ -2097,14 +2072,14 @@ void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *l
MoveRelearnerMenuLoadContestMoveDescription(itemIndex); MoveRelearnerMenuLoadContestMoveDescription(itemIndex);
} }
void MoveRelearnerPrintText(u8 *text) void MoveRelearnerPrintText(u8 *str)
{ {
u8 speed; u8 speed;
FillWindowPixelBuffer(3, 0x11); FillWindowPixelBuffer(3, 0x11);
gTextFlags.canABSpeedUpPrint = TRUE; gTextFlags.canABSpeedUpPrint = TRUE;
speed = GetPlayerTextSpeedDelay(); speed = GetPlayerTextSpeedDelay();
AddTextPrinterParameterized2(3, 1, text, speed, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, 3); AddTextPrinterParameterized2(3, 1, str, speed, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, 3);
} }
bool16 MoveRelearnerRunTextPrinters(void) bool16 MoveRelearnerRunTextPrinters(void)
@@ -2115,5 +2090,5 @@ bool16 MoveRelearnerRunTextPrinters(void)
void MoveRelearnerCreateYesNoMenu(void) void MoveRelearnerCreateYesNoMenu(void)
{ {
CreateYesNoMenu(&gMoveRelearnerYesNoMenuTemplate, 1, 0xE, 0); CreateYesNoMenu(&sMoveRelearnerYesNoMenuTemplate, 1, 0xE, 0);
} }
+1 -1
View File
@@ -37,7 +37,7 @@
* - Creates moveDisplayArrowTask to listen to right/left buttons. * - Creates moveDisplayArrowTask to listen to right/left buttons.
* - Creates moveListScrollArrowTask to listen to up/down buttons. * - Creates moveListScrollArrowTask to listen to up/down buttons.
* - Whenever the selected move changes (and once on init), the MoveRelearnerCursorCallback * - Whenever the selected move changes (and once on init), the MoveRelearnerCursorCallback
* is called (see gMoveRelearnerMovesListTemplate). That callback will reload the contest * is called (see sMoveRelearnerMovesListTemplate). That callback will reload the contest
* display and battle display windows for the new move. Both are always loaded in * display and battle display windows for the new move. Both are always loaded in
* memory, but only the currently active one is copied to VRAM. The exception to this * memory, but only the currently active one is copied to VRAM. The exception to this
* is the appeal and jam hearts, which are sprites. MoveRelearnerShowHideHearts is called * is the appeal and jam hearts, which are sprites. MoveRelearnerShowHideHearts is called