Small Misc Clean (#1751)

* Fix z64item comment

* titleCtxt -> titleCtx

* combine gfx buffers bss into 1 file
This commit is contained in:
Derek Hensley 2024-12-01 02:01:42 -08:00 committed by GitHub
parent 009708773e
commit a8dbb5ac27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 24 additions and 29 deletions

View File

@ -432,7 +432,7 @@ typedef struct ActorContext {
/* 0x0A0 */ Actor* lensActors[LENS_ACTOR_MAX]; // Draws up to LENS_ACTOR_MAX number of invisible actors
/* 0x120 */ Attention attention;
/* 0x1B8 */ ActorContextSceneFlags sceneFlags;
/* 0x1E4 */ TitleCardContext titleCtxt;
/* 0x1E4 */ TitleCardContext titleCtx;
/* 0x1F4 */ PlayerImpact playerImpact;
/* 0x208 */ UNK_TYPE1 unk_208[0x4];
/* 0x20C */ ActorSharedMemoryEntry actorSharedMemory[8];

View File

@ -322,7 +322,7 @@ typedef enum ItemId {
/* 0xAE */ ITEM_MAP_POINT_STONE_TOWER,
// Remaining map points are unique to owl warps
/* 0xAF */ ITEM_MAP_POINT_GREAT_BAY_COAST,
/* 0xBO */ ITEM_MAP_POINT_SOUTHERN_SWAMP,
/* 0xB0 */ ITEM_MAP_POINT_SOUTHERN_SWAMP,
/* 0xB1 */ ITEM_MAP_POINT_MOUNTAIN_VILLAGE,
/* 0xB2 */ ITEM_MAP_POINT_MILK_ROAD,
/* 0xB3 */ ITEM_MAP_POINT_ZORA_CAPE,

4
spec
View File

@ -790,9 +790,7 @@ endseg
beginseg
name "buffers"
flags NOLOAD
include "$(BUILD_DIR)/src/buffers/gfxyield.o"
include "$(BUILD_DIR)/src/buffers/gfxstack.o"
include "$(BUILD_DIR)/src/buffers/gfxpools.o"
include "$(BUILD_DIR)/src/buffers/gfxbuffers.o"
include "$(BUILD_DIR)/src/buffers/audio_heap.o"
endseg

8
src/buffers/gfxbuffers.c Normal file
View File

@ -0,0 +1,8 @@
#include "prevent_bss_reordering.h"
#include "buffers.h"
u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE] ALIGNED(16);
STACK(gGfxSPTaskStack, 0x400) ALIGNED(16);
GfxPool gGfxPools[2] ALIGNED(16);

View File

@ -1,3 +0,0 @@
#include "buffers.h"
GfxPool gGfxPools[2] ALIGNED(16);

View File

@ -1,3 +0,0 @@
#include "buffers.h"
STACK(gGfxSPTaskStack, 0x400) ALIGNED(16);

View File

@ -1,3 +0,0 @@
#include "buffers.h"
u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE] ALIGNED(16);

View File

@ -978,7 +978,7 @@ void TitleCard_Draw(GameState* gameState, TitleCardContext* titleCtx) {
// unused
s32 func_800B6434(PlayState* play, TitleCardContext* titleCtx) {
if ((play->actorCtx.titleCtxt.delayTimer != 0) || (play->actorCtx.titleCtxt.alpha != 0)) {
if ((play->actorCtx.titleCtx.delayTimer != 0) || (play->actorCtx.titleCtx.alpha != 0)) {
titleCtx->durationTimer = 0;
titleCtx->delayTimer = 0;
return false;
@ -2499,7 +2499,7 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* acto
actorCtx->sceneFlags.collectible[0] = cycleFlags->collectible;
actorCtx->sceneFlags.clearedRoom = cycleFlags->clearedRoom;
TitleCard_ContextInit(&play->state, &actorCtx->titleCtxt);
TitleCard_ContextInit(&play->state, &actorCtx->titleCtx);
Actor_InitPlayerImpact(play);
actorCtx->absoluteSpace = NULL;
@ -2759,7 +2759,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
Attention_Update(&actorCtx->attention, player, actor, play);
}
TitleCard_Update(&play->state, &actorCtx->titleCtxt);
TitleCard_Update(&play->state, &actorCtx->titleCtx);
Actor_UpdatePlayerImpact(play);
DynaPoly_UpdateBgActorTransforms(play, &play->colCtx.dyna);
}
@ -3130,7 +3130,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
Lights_DrawGlow(play);
}
TitleCard_Draw(&play->state, &actorCtx->titleCtxt);
TitleCard_Draw(&play->state, &actorCtx->titleCtx);
CLOSE_DISPS(play->state.gfxCtx);
}

View File

@ -1121,7 +1121,7 @@ void Boss01_IntroCutscene(Boss01* this, PlayState* play) {
}
if (this->cutsceneTimer == 50) {
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt,
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtx,
Lib_SegmentedToVirtual(&gOdolwaTitleCardTex), 160, 180, 128, 40);
}

View File

@ -2215,7 +2215,7 @@ void func_809DEAC4(Boss02* this, PlayState* play) {
}
if (this->unk_1D1C == (u32)(KREG(92) + 125)) {
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt,
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtx,
Lib_SegmentedToVirtual(gTwinmoldTitleCardTex), 160, 180, 128, 40);
}

View File

@ -1319,7 +1319,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_JUMP_LEV_OLD - SFX_FLAG);
if (this->csTimer == 30) {
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt,
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtx,
Lib_SegmentedToVirtual(gGyorgTitleCardTex), 160, 180, 128, 40);
}

View File

@ -1763,7 +1763,7 @@ void BossHakugin_IntroCutsceneWakeUp(BossHakugin* this, PlayState* play) {
}
if (Animation_OnFrame(&this->skelAnime, 65.0f)) {
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&gGohtTitleCardTex),
TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtx, Lib_SegmentedToVirtual(&gGohtTitleCardTex),
160, 180, 128, 40);
}

View File

@ -94,9 +94,6 @@ def discard_decomped_files(files_spec, include_files):
if file == "":
file = f"{type}_{offset:08X}"
include = True
# flg_set_table is not in the spec, and buffers has its own section, just add them
elif file == "flg_set_table" or "buffers" in file:
include = True
else:
include = False
i = seg_start

View File

@ -519,8 +519,7 @@
0x801AE3A0 : "z_effect_soft_sprite",
0x801AE3B0 : "z_effect_soft_sprite_old_init",
0x801AE4A0 : "z_effect_soft_sprite_dlftbls",
0x801AE8F0 : "flg_set_table",
0x801AEC70 : "flg_set",
0x801AE8F0 : "flg_set",
0x801AEC80 : "z_actor",
0x801AEFD0 : "z_actor_dlftbls",
0x801B4620 : "z_bgcheck",
@ -754,8 +753,8 @@
0x80200BE0 : "session_config",
0x80208E90 : "jpegdecoder",
0x80208EA0 : "gfxbuffers",
0x8024A4C0 : "buffer_audio_heap",
0x803824C0 : "buffer_system_heap",
0x8024A4C0 : "audio_heap",
0x803824C0 : "system_heap",
0x80780000 : "framebuffer_hi",
},
],

View File

@ -1306,6 +1306,7 @@ wordReplace = {
"play->actorCtx.attention.unk4C": "play->actorCtx.attention.lockOnIndex",
"play->actorCtx.attention.unk50": "play->actorCtx.attention.lockOnTriangleSets",
"play->actorCtx.attention.unk8C": "play->actorCtx.attention.nextTarget",
"play->actorCtx.titleCtxt": "play->actorCtx.titleCtx",
"play->doorCtx.transitionActorList": "play->transitionActors.list",
"play->nextEntranceIndex": "play->nextEntrance",
"play->sceneNum": "play->sceneId",
@ -1338,6 +1339,7 @@ wordReplace = {
"actorCtx.unk_1F4.timer": "actorCtx.playerImpact.timer",
"actorCtx.unk_1F4.unk_04": "actorCtx.playerImpact.dist",
"actorCtx.unk_1F4.unk_08": "actorCtx.playerImpact.pos",
"actorCtx->titleCtxt": "actorCtx->titleCtx",
"gSaveContext.unk_3DC8": "gSaveContext.timerOsTime",
"gSaveContext.unk_3DD0": "gSaveContext.timerStates",