From 8b5260063f75dbaa29636f34ec05774d692cf569 Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Mon, 6 May 2024 15:26:01 -0700 Subject: `ac_structure` OK with some minor documentation (#183) * Partial progress * `func_809E7F94_jp` OK * Do some more DMA functions * Fix build * Finally make `func_809E823C_jp` work properly * Finish DMA functions * Use ALIGN16 * Make the size for `mSc_secure_exchange_keep_bank` more obviously related to what follows * Fix build after merge * aSTR_setupActor_proc OK * aSTR_init_clip_area OK * Import data to C * Lots of cleanup * Use enum values in actors * StructureActor-ify the structures * Move `setupInfo_table` inside the function and name it * Name `aSTR_get_pal_segment` from context clues * Use all the names I can from DnM+ * Try (and fail) to import BSS into C * Match bss * Make bss sizes more "correct" * Use ARRAY_COUNT to define DMA length * A lot fewer hardcoded numbers * Lots of misc cleanup * A huge amount of names and cleanup * Get this PR-ready * Forgot some booleans * Name a lot of stuff after digging into the object files * Remove magic numbers for bss array size * Respond to review --- src/code/m_actor.c | 10 +++++----- src/code/m_npc_walk.c | 1 + src/code/m_scene.c | 6 +++--- src/code/m_start_data_init.c | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'src/code') diff --git a/src/code/m_actor.c b/src/code/m_actor.c index 2fe38e2..0ed22bb 100644 --- a/src/code/m_actor.c +++ b/src/code/m_actor.c @@ -599,7 +599,7 @@ void actor_free_check(ActorOverlay* overlayEntry, u16 fgName) { break; case FGNAME_F000_5: - common_data.clip.unk_08C->unk_08(); + common_data.clip.structureClip->freeOverlayAreaProc(overlayEntry); break; default: @@ -634,8 +634,8 @@ s32 func_80057940_jp(ActorProfile** profileP, ActorOverlay* overlayEntry, const break; case FGNAME_F000_5: - if (common_data.clip.unk_08C != NULL) { - common_data.clip.unk_08C->unk_4(overlayEntry, overlaySize); + if (common_data.clip.structureClip != NULL) { + common_data.clip.structureClip->getOverlayAreaProc(overlayEntry, overlaySize); } break; @@ -745,7 +745,7 @@ s32 Actor_malloc_actor_class(Actor** actorP, ActorProfile* profile, ActorOverlay break; case FGNAME_F000_5: - *actorP = common_data.clip.unk_08C->unk_0C(); + *actorP = common_data.clip.structureClip->getActorAreaProc(); break; default: @@ -957,7 +957,7 @@ Actor* Actor_info_delete(ActorInfo* actorInfo, Actor* actor, Game_Play* game_pla break; case FGNAME_F000_5: - common_data.clip.unk_08C->unk_10(actor); + common_data.clip.structureClip->freeActorAreaProc(actor); break; default: diff --git a/src/code/m_npc_walk.c b/src/code/m_npc_walk.c index e784332..40ee911 100644 --- a/src/code/m_npc_walk.c +++ b/src/code/m_npc_walk.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "m_npc_walk.h" #include "m_common_data.h" #include "m_npc.h" diff --git a/src/code/m_scene.c b/src/code/m_scene.c index 3f27d44..d3be1c9 100644 --- a/src/code/m_scene.c +++ b/src/code/m_scene.c @@ -385,9 +385,9 @@ void mSc_dmacopy_all_exchange_bank(ObjectExchangeBank* exchange) { bank++; } - if (common_data.clip.unk_08C != NULL) { - if (common_data.clip.unk_08C->unk_A4 != NULL) { - common_data.clip.unk_08C->unk_A4(exchange); + if (common_data.clip.structureClip != NULL) { + if (common_data.clip.structureClip->unk_A4 != NULL) { + common_data.clip.structureClip->unk_A4(exchange); } } if (common_data.clip.unk_040 != NULL) { diff --git a/src/code/m_start_data_init.c b/src/code/m_start_data_init.c index b936e89..9709b55 100644 --- a/src/code/m_start_data_init.c +++ b/src/code/m_start_data_init.c @@ -240,9 +240,9 @@ s32 mSDI_StartInitNew(Game* game2, s32 playerNumber, s32 mallocFlag) { lbRTC_TimeCopy(&common_data.unk_0F8A4, &mTM_rtcTime_clear_code); for (i = 0; i < PLAYER_NUM; i++) { - common_data.homes[i].unk_022 &= (u16)~0xC0; - common_data.homes[i].unk_022 &= 0xCF; - common_data.homes[i].unk_022 &= 0xF7; + common_data.homes[i].unk_022.unk_22_0 = 0; + common_data.homes[i].unk_022.unk_22_2 = 0; + common_data.homes[i].unk_022.unk_22_4 = 0; common_data.homes[i].unk_024 = i; } -- cgit v1.2.3