From 6f4b95d5db28c819ee939b227213da947185895e Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 26 Aug 2025 13:51:56 +0200 Subject: [PATCH] give better names to funcs --- asm/include/overlay_11_022ECD24.inc | 4 +- asm/include/overlay_11_022EE5E4.inc | 2 +- asm/overlay_11_022ECD24.s | 8 ++-- asm/overlay_11_022EE5E4.s | 64 ++++++++++++++--------------- include/ground_bg.h | 4 +- src/ground_bg.c | 18 ++++---- 6 files changed, 49 insertions(+), 51 deletions(-) diff --git a/asm/include/overlay_11_022ECD24.inc b/asm/include/overlay_11_022ECD24.inc index e130dab6..3fa39e35 100644 --- a/asm/include/overlay_11_022ECD24.inc +++ b/asm/include/overlay_11_022ECD24.inc @@ -10,8 +10,8 @@ .public PointsToZero .public UnloadFile .public ZInit8 -.public ov11_022EBC18 -.public ov11_022EBFC8 +.public GroundBg_Init +.public GroundBg_CloseOpenedFiles .public ov11_022EC08C .public ov11_022EE620 .public ov11_022EE8CC diff --git a/asm/include/overlay_11_022EE5E4.inc b/asm/include/overlay_11_022EE5E4.inc index d39a76e5..ba94e995 100644 --- a/asm/include/overlay_11_022EE5E4.inc +++ b/asm/include/overlay_11_022EE5E4.inc @@ -312,7 +312,7 @@ .public ov11_022EB2F4 .public ov11_022EB3C8 .public ov11_022EBAA0 -.public ov11_022EBC18 +.public GroundBg_Init .public ov11_022EBEAC .public ov11_022EC240 .public ov11_022EC27C diff --git a/asm/overlay_11_022ECD24.s b/asm/overlay_11_022ECD24.s index c4d86559..096d37ed 100644 --- a/asm/overlay_11_022ECD24.s +++ b/asm/overlay_11_022ECD24.s @@ -21,7 +21,7 @@ ov11_022ED69C: ; 0x022ED69C mov r0, #0 b _022EDCFC _022ED6CC: - bl ov11_022EBFC8 + bl GroundBg_CloseOpenedFiles ldr r0, [sb, #0x174] add r1, sl, #0x100 str r0, [sp, #8] @@ -736,7 +736,7 @@ ov11_022EE0C8: ; 0x022EE0C8 sub sp, sp, #0xc ldr r1, _022EE12C ; =ov11_02320C28 mov r4, r0 - bl ov11_022EBC18 + bl GroundBg_Init mov r0, r4 bl ov11_022EC08C mov r2, #5 @@ -812,7 +812,7 @@ ov11_022EE198: ; 0x022EE198 mov r4, r1 ldr r1, _022EE204 ; =ov11_02320C28 mov r5, r0 - bl ov11_022EBC18 + bl GroundBg_Init mov r0, r5 bl ov11_022EC08C mov r2, #6 @@ -881,7 +881,7 @@ ov11_022EE268: ; 0x022EE268 sub sp, sp, #0xc ldr r1, _022EE2C4 ; =ov11_02320C28 mov r4, r0 - bl ov11_022EBC18 + bl GroundBg_Init mov r0, r4 bl ov11_022EC08C mov r2, #5 diff --git a/asm/overlay_11_022EE5E4.s b/asm/overlay_11_022EE5E4.s index 175f3376..b2aec71f 100644 --- a/asm/overlay_11_022EE5E4.s +++ b/asm/overlay_11_022EE5E4.s @@ -3852,7 +3852,7 @@ ov11_022F12C0: ; 0x022F12C0 bne _022F134C ldr r0, [r2] ldr r1, _022F153C ; =ov11_02320CD8 - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _022F1538 ; =GROUND_STATE_MAP mvn r1, #0 ldr r0, [r0] @@ -3894,7 +3894,7 @@ _022F1370: ; jump table _022F13A4: ldr r0, [r2] ldr r1, _022F1544 ; =ov11_02320CF4 - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #0 bl ov11_022EF53C mov r0, #2 @@ -3930,7 +3930,7 @@ _022F1414: ldr r0, _022F1538 ; =GROUND_STATE_MAP ldr r1, _022F154C ; =ov11_02320D10 ldr r0, [r0] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #0 bl ov11_022EF53C mov r0, #1 @@ -3951,7 +3951,7 @@ _022F146C: ldr r0, _022F1538 ; =GROUND_STATE_MAP ldr r1, _022F153C ; =ov11_02320CD8 ldr r0, [r0] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #0 bl ov11_022EF53C mov r0, #1 @@ -4044,7 +4044,7 @@ GetSpecialLayoutBackground: ; 0x022F155C ldr r0, _022F16F4 ; =GROUND_STATE_MAP ldr r1, _022F16F8 ; =ov11_02320CD8 ldr r0, [r0] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _022F16F4 ; =GROUND_STATE_MAP mvn r1, #0 ldr r0, [r0] @@ -4081,7 +4081,7 @@ _022F1644: ldr r0, _022F16F4 ; =GROUND_STATE_MAP ldr r1, _022F1708 ; =ov11_02320D10 ldr r0, [r0] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #0 bl ov11_022EF53C mov r0, #1 @@ -5284,7 +5284,7 @@ _022F2548: ldr r0, _022F2598 ; =ov11_02324CC8 ldrne r1, _022F25A0 ; =ov11_0232105C ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _022F2598 ; =ov11_02324CC8 mvn r1, #0 ldr r0, [r0, #4] @@ -38790,7 +38790,7 @@ ov11_0230DE84: ; 0x0230DE84 ldr r2, _0230DEF0 ; =ov11_02324DC8 ldr r1, _0230DEF4 ; =ov11_02323228 str r0, [r2] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _0230DEF0 ; =ov11_02324DC8 ldr r1, [r0, #4] ldr r0, [r0] @@ -39164,7 +39164,7 @@ ov11_0230E344: ; 0x0230E344 ldr r2, _0230E3D8 ; =ov11_02324DD4 ldr r1, _0230E3DC ; =ov11_02323268 str r0, [r2] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _0230E3D8 ; =ov11_02324DD4 ldr r1, _0230E3E0 ; =ov11_023232A8 ldr r0, [r0] @@ -39560,7 +39560,7 @@ _0230E854: ldr r2, _0230E8C0 ; =ov11_02324DDC ldr r1, _0230E8C8 ; =ov11_023232BC str r0, [r2] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _0230E8C0 ; =ov11_02324DDC ldr r1, _0230E8CC ; =ov11_023232FC ldr r0, [r0] @@ -41334,7 +41334,7 @@ ov11_02310074: ; 0x02310074 bne _02310108 ldr r0, [r2, #4] ldr r1, _02310324 ; =ov11_02323394 - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _0231031C ; =WORLD_MAP_MODE mvn r1, #0 ldr r0, [r0, #4] @@ -41371,7 +41371,7 @@ _0231012C: ; jump table _02310160: ldr r0, [r2, #4] ldr r1, _0231032C ; =ov11_023233B0 - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C b _023101B8 @@ -41390,7 +41390,7 @@ _023101A0: ldr r0, _0231031C ; =WORLD_MAP_MODE ldr r1, _02310324 ; =ov11_02323394 ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_023128C0 _023101B8: @@ -42048,7 +42048,7 @@ ov11_02310A58: ; 0x02310A58 ldr r2, _02310AC0 ; =ov11_02324DF0 ldr r1, _02310AC4 ; =ov11_0232376C str r0, [r2, #4] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _02310AC0 ; =ov11_02324DF0 ldr r1, _02310AC8 ; =ov11_02323818 ldr r0, [r0, #4] @@ -42565,7 +42565,7 @@ ov11_02311074: ; 0x02311074 bne _0231110C ldr r0, [r2, #4] ldr r1, _02311274 ; =ov11_02323920 - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _0231126C ; =ov11_02324DF8 mvn r1, #0 ldr r0, [r0, #4] @@ -42603,14 +42603,14 @@ _02311130: ; jump table _02311164: ldr r0, [r2, #4] ldr r1, _0231127C ; =ov11_0232393C - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C b _023111D4 _0231117C: ldr r0, [r2, #4] ldr r1, _02311280 ; =ov11_02323958 - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_023128C0 b _023111D4 @@ -42629,7 +42629,7 @@ _023111BC: ldr r0, _0231126C ; =ov11_02324DF8 ldr r1, _02311274 ; =ov11_02323920 ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_023128C0 _023111D4: @@ -42997,7 +42997,7 @@ ov11_023115F4: ; 0x023115F4 cmp r4, r1 bne _02311684 ldr r1, _023117AC ; =ov11_02323A04 - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _023117A4 ; =ov11_02324E00 mvn r1, #0 ldr r0, [r0, #4] @@ -43032,7 +43032,7 @@ _023116CC: ldr r0, _023117A4 ; =ov11_02324E00 ldr r1, _023117B0 ; =ov11_02323A20 ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C b _02311750 @@ -43040,7 +43040,7 @@ _023116E8: ldr r0, _023117A4 ; =ov11_02324E00 ldr r1, _023117B4 ; =ov11_02323A3C ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C mov r0, #1 @@ -43060,7 +43060,7 @@ _02311730: ldr r0, _023117A4 ; =ov11_02324E00 ldr r1, _023117AC ; =ov11_02323A04 ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C mov r0, #1 @@ -43397,7 +43397,7 @@ ov11_02311AF4: ; 0x02311AF4 cmp r4, r1 bne _02311B84 ldr r1, _02311CAC ; =ov11_02323AE8 - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _02311CA4 ; =ov11_02324E08 mvn r1, #0 ldr r0, [r0, #4] @@ -43432,7 +43432,7 @@ _02311BCC: ldr r0, _02311CA4 ; =ov11_02324E08 ldr r1, _02311CB0 ; =ov11_02323B04 ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C b _02311C50 @@ -43440,7 +43440,7 @@ _02311BE8: ldr r0, _02311CA4 ; =ov11_02324E08 ldr r1, _02311CB4 ; =ov11_02323B20 ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C mov r0, #1 @@ -43460,7 +43460,7 @@ _02311C30: ldr r0, _02311CA4 ; =ov11_02324E08 ldr r1, _02311CAC ; =ov11_02323AE8 ldr r0, [r0, #4] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C mov r0, #1 @@ -43847,7 +43847,7 @@ ov11_02312100: ; 0x02312100 ldr r2, _02312164 ; =ov11_02324E10 ldr r1, _02312168 ; =ov11_02323B7C str r0, [r2] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _02312164 ; =ov11_02324E10 ldr r1, _0231216C ; =ov11_02323BBC ldr r0, [r0] @@ -44268,7 +44268,7 @@ ov11_02312540: ; 0x02312540 bne _023125D4 ldr r0, [r2] ldr r1, _02312718 ; =ov11_02323C38 - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _02312710 ; =ov11_02324E18 mvn r1, #0 ldr r0, [r0] @@ -44303,7 +44303,7 @@ _023125F8: ; jump table _02312624: ldr r0, [r2] ldr r1, _02312720 ; =ov11_02323C54 - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_022EF53C b _0231267C @@ -44327,7 +44327,7 @@ _02312664: ldr r0, _02312710 ; =ov11_02324E18 ldr r1, _02312718 ; =ov11_02323C38 ldr r0, [r0] - bl ov11_022EBC18 + bl GroundBg_Init mov r0, #1 bl ov11_023128C0 _0231267C: @@ -44547,7 +44547,7 @@ _0231291C: ldr r2, _02312974 ; =ov11_02324E20 ldr r1, _02312978 ; =ov11_02323CD0 str r0, [r2] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _02312974 ; =ov11_02324E20 mvn r1, #0 ldr r0, [r0] @@ -49103,7 +49103,7 @@ _023167E0: ldr r2, _02316838 ; =ov11_02324E78 ldr r1, _02316844 ; =ov11_02324BDC str r0, [r2, #4] - bl ov11_022EBC18 + bl GroundBg_Init ldr r0, _02316838 ; =ov11_02324E78 ldr r1, _02316848 ; =ov11_02324C1C ldr r0, [r0, #4] diff --git a/include/ground_bg.h b/include/ground_bg.h index cee84136..6459724f 100644 --- a/include/ground_bg.h +++ b/include/ground_bg.h @@ -244,10 +244,10 @@ typedef struct GroundBg } GroundBg; void LoadBackgroundAttributes(struct bg_list_entry* entry, int bgId); -void ov11_022EBC18(GroundBg *groundBg, const SubStruct_52C *a1); +void GroundBg_Init(GroundBg *groundBg, const SubStruct_52C *a1); void ov11_022EBEAC(GroundBg *groundBg); void ov11_022EBF60(GroundBg *groundBg); -void ov11_022EBFC8(GroundBg *groundBg); +void GroundBg_CloseOpenedFiles(GroundBg *groundBg); void ov11_022EC08C(GroundBg *groundBg); void ov11_022EC240(GroundBg *groundBg, s32 bgId); void ov11_022EC27C(GroundBg *groundBg, s32 bgId); diff --git a/src/ground_bg.c b/src/ground_bg.c index ece8e0b6..d7f50dbd 100644 --- a/src/ground_bg.c +++ b/src/ground_bg.c @@ -104,15 +104,13 @@ void LoadBackgroundAttributes(struct bg_list_entry* entry, int bgId) void ov11_022EBF60(GroundBg *groundBg); void *sub_0200B500(void *unk); -void ov11_022EBFC8(GroundBg *groundBg); // Close Opened Files ? void sub_02063600(struct UnkGroundBg_1A0 *); void sub_0206367C(struct UnkGroundBg_1A0 *); void sub_020635C8(struct UnkGroundBg_194 *); void sub_020635D8(struct UnkGroundBg_194 *); void ov11_022EE620(GroundBg *groundBg, s32 a1); -// GroundBg_Init? -void ov11_022EBC18(GroundBg *groundBg, const SubStruct_52C *a1) +void GroundBg_Init(GroundBg *groundBg, const SubStruct_52C *a1) { SubStruct_0 *unk0Ptr; s32 id, unk0Id, unk3E0Id; @@ -206,7 +204,7 @@ void ov11_022EBEAC(GroundBg *groundBg) { s32 i; - ov11_022EBFC8(groundBg); + GroundBg_CloseOpenedFiles(groundBg); TRY_FREE_AND_SET_NULL(groundBg->unk2D8); for (i = 0; i < NUM_LAYERS; i++) { @@ -247,7 +245,7 @@ void ov11_022EBF60(GroundBg *groundBg) ZInit8(&groundBg->bmaFile); } -void ov11_022EBFC8(GroundBg *groundBg) +void GroundBg_CloseOpenedFiles(GroundBg *groundBg) { s32 i; if (groundBg->newUnk0 == 3) { @@ -277,7 +275,7 @@ void ov11_022EC08C(GroundBg *groundBg) s32 unk0Id, unk3E0Id; struct UnkStruct_2324CBC_Sub98 *unkSubPtr; - ov11_022EBFC8(groundBg); + GroundBg_CloseOpenedFiles(groundBg); groundBg->newUnk0 = 0; groundBg->unk1C0 = 0; groundBg->unk1BE = -1; @@ -377,7 +375,7 @@ void ov11_022EC27C(GroundBg *groundBg, s32 bgId) ov11_022EC08C(groundBg); return; } - ov11_022EBFC8(groundBg); + GroundBg_CloseOpenedFiles(groundBg); groundBg->newUnk0 = 1; groundBg->unk1C0 = 0; groundBg->unk1BE = bgId; @@ -785,7 +783,7 @@ asm void ov11_022EC27C(GroundBg *groundBg, s32 bgId) bl ov11_022EC08C b _022ECCF4 _022EC2BC: - bl ov11_022EBFC8 + bl GroundBg_CloseOpenedFiles mov r0, #1 strh r0, [r10] mov r0, #0 @@ -1561,7 +1559,7 @@ void LoadMapType10(GroundBg *groundBg, s32 bgId, const DungeonLocation *dungLoc, } ov11_022EC27C(groundBg, bgId); - ov11_022EBFC8(groundBg); + GroundBg_CloseOpenedFiles(groundBg); groundBg->newUnk0 = 2; groundBg->unk1C0 = 0; groundBg->unk1BE = bgId; @@ -1725,7 +1723,7 @@ void LoadMapType11(GroundBg *groundBg, s32 bgId, const DungeonLocation *dungLoc, return; } - ov11_022EBFC8(groundBg); + GroundBg_CloseOpenedFiles(groundBg); groundBg->newUnk0 = 2; groundBg->unk1C0 = 0; groundBg->unk1BE = bgId;