1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Match retail code data sizes (#1741)

* Match retail audio data

* Fix various small code data problems

* Disable terminal colors in debug builds

* Match z_actor_dlftbls.c .rodata

* Use _3 for unused nameString macro parameter

* Move sDebugCutsceneScriptBuf to be in-function static

* Comment on actor name being NULL

* Split out padding the fault_drawer.bss.s
This commit is contained in:
cadmic 2024-02-26 23:23:19 -08:00 committed by GitHub
parent c3faefc061
commit c6e3ef4570
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 79 additions and 13 deletions

View file

@ -102,11 +102,11 @@ FaultDrawer sFaultDrawerDefault = {
#ifndef NON_MATCHING
// TODO: match .bss (has reordering issues)
extern FaultDrawer sFaultDrawer;
extern char D_8016B6BC[0x24];
extern char D_8016B6C0[0x20];
#else
// Non-matching version for struct shiftability
FaultDrawer sFaultDrawer;
char D_8016B6BC[0x24];
char D_8016B6C0[0x20];
#endif
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {

View file

@ -6,10 +6,11 @@ VisCvg sVisCvg;
VisZBuf sVisZBuf;
VisMono sVisMono;
ViMode sViMode;
#if OOT_DEBUG
FaultClient sGameFaultClient;
u16 sLastButtonPressed;
#if OOT_DEBUG
void GameState_FaultPrint(void) {
static char sBtnChars[] = "ABZSuldr*+LRudlr";
s32 i;

View file

@ -14,8 +14,13 @@ OSTime sGraphPrevUpdateEndTime;
*/
OSTime sGraphPrevTaskTimeStart;
#if OOT_DEBUG
FaultClient sGraphFaultClient;
#endif
CfbInfo sGraphCfbInfos[3];
#if OOT_DEBUG
FaultClient sGraphUcodeFaultClient;
UCodeInfo D_8012D230[3] = {
@ -30,7 +35,6 @@ UCodeInfo D_8012D248[3] = {
{ UCODE_S2DEX, gspS2DEX2d_fifoTextStart },
};
#if OOT_DEBUG
void Graph_FaultClient(void) {
void* nextFb = osViGetNextFramebuffer();
void* newFb = (SysCfb_GetFbPtr(0) != nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1);

View file

@ -45,14 +45,14 @@
#define RDP_DONE_MSG 668
#define NOTIFY_MSG 670 // original name: ENTRY_MSG
vs32 sSchedDebugPrintfEnabled = false;
OSTime sRSPGfxTimeStart;
OSTime sRSPAudioTimeStart;
OSTime sRSPOtherTimeStart;
OSTime sRDPTimeStart;
#if OOT_DEBUG
vs32 sSchedDebugPrintfEnabled = false;
#define SCHED_DEBUG_PRINTF \
if (sSchedDebugPrintfEnabled) \
PRINTF

View file

@ -23,6 +23,8 @@
#undef DEFINE_ACTOR_UNSET
// Actor Overlay Table definition
#if OOT_DEBUG
#define DEFINE_ACTOR(name, _1, allocType, nameString) \
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
(uintptr_t)_ovl_##name##SegmentRomEnd, \
@ -37,6 +39,24 @@
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, nameString) \
{ 0, 0, NULL, NULL, NULL, &name##_InitVars, nameString, allocType, 0 },
#else
// Actor name is set to NULL in retail builds
#define DEFINE_ACTOR(name, _1, allocType, _3) \
{ (uintptr_t)_ovl_##name##SegmentRomStart, \
(uintptr_t)_ovl_##name##SegmentRomEnd, \
_ovl_##name##SegmentStart, \
_ovl_##name##SegmentEnd, \
NULL, \
&name##_InitVars, \
NULL, \
allocType, \
0 },
#define DEFINE_ACTOR_INTERNAL(name, _1, allocType, _3) { 0, 0, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0 },
#endif
#define DEFINE_ACTOR_UNSET(_0) { 0 },
ActorOverlay gActorOverlayTable[] = {

View file

@ -29,6 +29,7 @@ Color_RGBA8 sDebugCamTextColors[] = {
{ 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN
};
#if OOT_DEBUG
InputCombo sRegGroupInputCombos[REG_GROUPS] = {
{ BTN_L, BTN_CUP }, // REG
{ BTN_L, BTN_CLEFT }, // SREG
@ -93,6 +94,7 @@ char sRegGroupChars[REG_GROUPS] = {
'k', // kREG
'b', // bREG
};
#endif
void Regs_Init(void) {
s32 i;

View file

@ -10,9 +10,12 @@ TransitionTile sTransitionTile;
s32 gTransitionTileState;
VisMono sPlayVisMono;
Color_RGBA8_u32 gVisMonoColor;
#if OOT_DEBUG
FaultClient D_801614B8;
#endif
s16 sTransitionFillTimer;
u64 sDebugCutsceneScriptBuf[0xA00];
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
@ -451,7 +454,10 @@ void Play_Init(GameState* thisx) {
AnimationContext_Update(this, &this->animationCtx);
gSaveContext.respawnFlag = 0;
if (OOT_DEBUG && R_USE_DEBUG_CUTSCENE) {
#if OOT_DEBUG
if (R_USE_DEBUG_CUTSCENE) {
static u64 sDebugCutsceneScriptBuf[0xA00];
gDebugCutsceneScript = sDebugCutsceneScriptBuf;
PRINTF("\nkawauso_data=[%x]", gDebugCutsceneScript);
@ -459,6 +465,7 @@ void Play_Init(GameState* thisx) {
// Presumably the ROM was larger at a previous point in development when this debug feature was used.
DmaMgr_DmaRomToRam(0x03FEB000, gDebugCutsceneScript, sizeof(sDebugCutsceneScriptBuf));
}
#endif
}
void Play_Update(PlayState* this) {