diff options
author | dheu <gwimminus@gmail.com> | 2019-07-08 19:58:36 +0800 |
---|---|---|
committer | dheu <gwimminus@gmail.com> | 2019-07-08 19:58:36 +0800 |
commit | 56b5fffe9d1252b6c94180dd5d49c7ebafede30c (patch) | |
tree | 18b3552467d496a84f4ab6f4d821c7ddd85779d3 | |
parent | 23a05eb6ac4118cb928d095a4f0c649d5f0bd3b0 (diff) |
fix: move/rename declarations
-rw-r--r-- | asm/overworld.s | 6 | ||||
-rw-r--r-- | asm/pokedex.s | 6 | ||||
-rw-r--r-- | asm/trainer_card.s | 4 | ||||
-rw-r--r-- | data/specials.inc | 2 | ||||
-rw-r--r-- | include/overworld.h | 1 | ||||
-rw-r--r-- | include/pokedex.h | 1 | ||||
-rw-r--r-- | src/diploma.c | 21 |
7 files changed, 21 insertions, 20 deletions
diff --git a/asm/overworld.s b/asm/overworld.s index aacb22510..cf4e4810e 100644 --- a/asm/overworld.s +++ b/asm/overworld.s @@ -3799,8 +3799,8 @@ _080568F4: .4byte gFieldCallback _080568F8: .4byte FieldCallback_ReturnToEventScript2 thumb_func_end c2_exit_to_overworld_1_continue_scripts_restart_music - thumb_func_start sub_80568FC -sub_80568FC: @ 80568FC + thumb_func_start CB2_Overworld +CB2_Overworld: @ 80568FC push {lr} bl sub_80569BC ldr r1, _08056910 @ =gFieldCallback @@ -3812,7 +3812,7 @@ sub_80568FC: @ 80568FC .align 2, 0 _08056910: .4byte gFieldCallback _08056914: .4byte sub_807DF7C - thumb_func_end sub_80568FC + thumb_func_end CB2_Overworld thumb_func_start sub_8056918 sub_8056918: @ 8056918 diff --git a/asm/pokedex.s b/asm/pokedex.s index 279270fbb..69ca5adcf 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -220,8 +220,8 @@ _08088F7C: bx r1 thumb_func_end sub_8088F58 - thumb_func_start sub_8088F84 -sub_8088F84: @ 8088F84 + thumb_func_start HasAllKantoMons +HasAllKantoMons: @ 8088F84 push {r4,r5,lr} movs r0, 0 _08088F88: @@ -277,6 +277,6 @@ _08088FE8: pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_8088F84 + thumb_func_end HasAllKantoMons .align 2, 0 @ Don't pad with nop. diff --git a/asm/trainer_card.s b/asm/trainer_card.s index 502d47c89..e8a591264 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -1070,7 +1070,7 @@ _080898BE: adds r0, 0x1 strb r0, [r5, 0x1] _080898CE: - bl sub_8088F84 + bl HasAllKantoMons lsls r0, 16 cmp r0, 0 beq _080898DE @@ -1117,7 +1117,7 @@ _08089918: _0808991C: bl sub_8088F58 strb r0, [r5, 0x3] - bl sub_8088F84 + bl HasAllKantoMons adds r6, r5, 0 adds r6, 0x4D strb r0, [r6] diff --git a/data/specials.inc b/data/specials.inc index e6cec1766..60cb46144 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -441,7 +441,7 @@ gSpecials:: @ 815FD60 def_special sub_8147594 def_special sub_80CD034 def_special sub_815D834 - def_special sub_8088F84 + def_special HasAllKantoMons def_special sub_80CD074 def_special sub_80CD098 def_special sub_811B15C diff --git a/include/overworld.h b/include/overworld.h index bab4797ff..4c6f3de8b 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -105,6 +105,7 @@ extern bool8 (* gFieldCallback2)(void); void SetLastHealLocationWarp(u8 healLocaionId); void sub_8055864(u8 mapGroup, u8 mapNum); +void CB2_Overworld(void); void CB2_NewGame(void); bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType); void Overworld_ResetStateAfterTeleport(void); diff --git a/include/pokedex.h b/include/pokedex.h index b389bf821..69839b3b4 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -8,6 +8,7 @@ void CopyMonCategoryText(u16 species, u8 *dst); u16 GetPokedexHeightWeight(u16 dexNum, u8 data); u16 GetNationalPokedexCount(u8); u16 GetHoennPokedexCount(u8); +bool16 HasAllKantoMons(void); u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality); enum diff --git a/src/diploma.c b/src/diploma.c index 1c3755526..2fade0dcf 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -4,6 +4,7 @@ #include "gpu_regs.h" #include "window.h" #include "main.h" +#include "overworld.h" #include "scanline_effect.h" #include "task.h" #include "unk_text_util.h" @@ -12,15 +13,13 @@ #include "bg.h" #include "sound.h" #include "malloc.h" +#include "pokedex.h" #include "sprite.h" #include "palette.h" #include "new_menu_helpers.h" #include "menu.h" #include "diploma.h" -void sub_80568FC(void); -u16 sub_8088F84(void); - static void DiplomaBgInit(void); static void DiplomaPrintText(void); static u8 DiplomaLoadGfx(void); @@ -102,7 +101,7 @@ static void Task_DiplomaInit(u8 taskId) CopyToBgTilemapBuffer(1, gUnknown_84154E8, 0, 0); break; case 4: - if (sub_8088F84()) + if (HasAllKantoMons()) { SetGpuReg(REG_OFFSET_BG1HOFS, 0x80 << 1); } @@ -165,7 +164,7 @@ static void Task_DiplomaReturnToOverworld(u8 taskId) DestroyTask(taskId); FreeAllWindowBuffers(); FREE_AND_SET_NULL(gDiploma); - SetMainCallback2(sub_80568FC); + SetMainCallback2(CB2_Overworld); } static void DiplomaBgInit(void) @@ -232,10 +231,10 @@ static u8 DiplomaLoadGfx(void) static void DiplomaPrintText(void) { u8 arr[160]; - uintptr_t len; + u32 width; UnkTextUtil_Reset(); UnkTextUtil_SetPtrI(0, gSaveBlock2Ptr->playerName); - if (sub_8088F84()) + if (HasAllKantoMons()) { UnkTextUtil_SetPtrI(1, gUnknown_841B68F); } @@ -245,11 +244,11 @@ static void DiplomaPrintText(void) } FillWindowPixelBuffer(0, 0); UnkTextUtil_StringExpandPlaceholders(arr, gUnknown_841B60E); - len = (uintptr_t)GetStringWidth(2, arr, -1); - AddTextPrinterParameterized3(0, 2, 0x78 - (len / 2), 4, gUnknown_8415A04, -1, arr); + width = GetStringWidth(2, arr, -1); + AddTextPrinterParameterized3(0, 2, 0x78 - (width / 2), 4, gUnknown_8415A04, -1, arr); UnkTextUtil_StringExpandPlaceholders(arr, gUnknown_841B619); - len = (uintptr_t)GetStringWidth(2, arr, -1); - AddTextPrinterParameterized3(0, 0x2, 0x78 - (len / 2), 0x1E, gUnknown_8415A04, -1, arr); + width = GetStringWidth(2, arr, -1); + AddTextPrinterParameterized3(0, 0x2, 0x78 - (width / 2), 0x1E, gUnknown_8415A04, -1, arr); AddTextPrinterParameterized3(0, 0x2, 0x78, 0x69, gUnknown_8415A04, 0, gUnknown_841B684); PutWindowTilemap(0); } |