Skip to content

Commit ed95bfb

Browse files
committed
Set the debug mode variable at boot
This variable should be set, so that backtrace screens can appear before the title sequence begins.
1 parent a694965 commit ed95bfb

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

ttyd-tools/rel/include/global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,6 @@ void initMenuVars();
718718
void assignCheatButtonCombo(uint32_t cheat);
719719
void assignDisplayButtonCombo(uint32_t display);
720720
void initArtAttackAssemblyOverwrites();
721-
void initAssemblyOverwrites();
721+
void initAddressOverwrites();
722722

723723
}

ttyd-tools/rel/source/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void initArtAttackAssemblyOverwrites()
425425
StartArtAttackHitboxes, BranchArtAttackHitboxes);
426426
}
427427

428-
void initAssemblyOverwrites()
428+
void initAddressOverwrites()
429429
{
430430
#ifdef TTYD_US
431431
void *PreventPreBattleSoftlockAddress = reinterpret_cast<void *>(0x800465CC);
@@ -546,6 +546,13 @@ void initAssemblyOverwrites()
546546
*reinterpret_cast<uint32_t *>(BacktraceScreenPPCHaltBranchAddress) = 0x3B400000; // li r26,0
547547
*reinterpret_cast<uint32_t *>(BacktraceScreenEndBranchAddress) = 0x4BFFFDD4; // b -0x22C
548548
#endif
549+
550+
// Set the initial value for the debug mode variable, to allow backtrace screens before the title sequence begins
551+
uint32_t tempTitleMainAddress = *reinterpret_cast<uint32_t *>(titleMainAddress);
552+
if (tempTitleMainAddress != 0)
553+
{
554+
*reinterpret_cast<int32_t *>(tempTitleMainAddress + 0x30) = -1;
555+
}
549556
}
550557

551558
void Mod::run()

ttyd-tools/rel/source/mod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void Mod::init()
3636
gMod = this;
3737
initMenuVars();
3838
initArtAttackAssemblyOverwrites();
39-
initAssemblyOverwrites();
39+
initAddressOverwrites();
4040
actionCommandsTimingsInit();
4141

4242
mPFN_makeKey_trampoline = patch::hookFunction(ttyd::system::makeKey, []()

0 commit comments

Comments
 (0)