From de61430dae2056dfc60bd873332f56cfc35584c5 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sun, 6 Oct 2024 21:48:34 -0700 Subject: [PATCH] FifoPlayer: Set up additional BATs in Wii mode The light LIT fifolog from https://bugs.dolphin-emu.org/issues/13635 has position data at physical address 11ae3180. This works fine when using the memory viewer in physical mode, but the corresponding virtual address (91ae3180) previously didn't show anything in effective mode. It works fine now though. This shouldn't affect playback of fifologs as everything in there uses physical addresses; this only impacts the memory viewer. This logic was copied from CBoot::SetupBAT. --- Source/Core/Core/FifoPlayer/FifoPlayer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Core/Core/FifoPlayer/FifoPlayer.cpp b/Source/Core/Core/FifoPlayer/FifoPlayer.cpp index dcf50b4684..a7db428b00 100644 --- a/Source/Core/Core/FifoPlayer/FifoPlayer.cpp +++ b/Source/Core/Core/FifoPlayer/FifoPlayer.cpp @@ -639,6 +639,16 @@ void FifoPlayer::LoadMemory() ppc_state.spr[SPR_DBAT0L] = 0x00000002; ppc_state.spr[SPR_DBAT1U] = 0xc0001fff; ppc_state.spr[SPR_DBAT1L] = 0x0000002a; + if (m_File->GetIsWii()) + { + ppc_state.spr[SPR_IBAT4U] = 0x90001fff; + ppc_state.spr[SPR_IBAT4L] = 0x10000002; + ppc_state.spr[SPR_DBAT4U] = 0x90001fff; + ppc_state.spr[SPR_DBAT4L] = 0x10000002; + ppc_state.spr[SPR_DBAT5U] = 0xd0001fff; + ppc_state.spr[SPR_DBAT5L] = 0x1000002a; + HID4(ppc_state).SBE = 1; + } PowerPC::MSRUpdated(ppc_state);