Orig game reads uninitialized memory in xray

This commit is contained in:
Snesrev
2023-03-06 18:55:05 +01:00
parent 039c663141
commit 4e83a497df
2 changed files with 7 additions and 0 deletions

View File

@@ -282,6 +282,10 @@ void PatchBugs(uint32 mode, uint32 addr) {
} else if (FixBugHook(0xA7CEB2)) {
// Phantoon_Main forgots to reload x
g_cpu->x = cur_enemy_index;
} else if (FixBugHook(0x91CD44)) {
// Xray_SetupStage4_Func2 passes a bad value to Xray_HandleXrayedBlock
if (g_cpu->x == 0)
g_cpu->pc = 0xCD52;
}
}