diff --git a/Source/Core/Core/Src/FifoPlayer/FifoAnalyzer.cpp b/Source/Core/Core/Src/FifoPlayer/FifoAnalyzer.cpp index f074b6d88b..383fcb555d 100644 --- a/Source/Core/Core/Src/FifoPlayer/FifoAnalyzer.cpp +++ b/Source/Core/Core/Src/FifoPlayer/FifoAnalyzer.cpp @@ -90,9 +90,9 @@ void GetTlutLoadData(u32 &tlutAddr, u32 &memAddr, u32 &tlutXferCount, BPMemory & // TODO - figure out a cleaner way. if (Core::g_CoreStartupParameter.bWii) - memAddr = bpmem.tmem_config.tlut_src << 5; + memAddr = bpMem.tmem_config.tlut_src << 5; else - memAddr = (bpmem.tmem_config.tlut_src & 0xFFFFF) << 5; + memAddr = (bpMem.tmem_config.tlut_src & 0xFFFFF) << 5; } void LoadCPReg(u32 subCmd, u32 value, CPMemory &cpMem) diff --git a/Source/Core/Core/Src/FifoPlayer/FifoDataFile.h b/Source/Core/Core/Src/FifoPlayer/FifoDataFile.h index a95a46c1fd..d1ae9ee886 100644 --- a/Source/Core/Core/Src/FifoPlayer/FifoDataFile.h +++ b/Source/Core/Core/Src/FifoPlayer/FifoDataFile.h @@ -33,7 +33,7 @@ struct MemoryUpdate TEXTURE_MAP = 0x01, XF_DATA = 0x02, VERTEX_STREAM = 0x04, - TLUT = 0x08 + TMEM = 0x08, }; u32 fifoPosition; diff --git a/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.cpp b/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.cpp index 1c0cd7abe1..a6467f0366 100644 --- a/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.cpp +++ b/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.cpp @@ -114,6 +114,8 @@ void FifoRecordAnalyzer::DecodeOpcode(u8 *data) if (bp.address == BPMEM_LOADTLUT1) ProcessLoadTlut1(); + if (bp.address == BPMEM_PRELOAD_MODE) + ProcessPreloadTexture(); } break; @@ -143,7 +145,16 @@ void FifoRecordAnalyzer::ProcessLoadTlut1() GetTlutLoadData(tlutMemAddr, memAddr, tlutXferCount, *m_BpMem); - FifoRecorder::GetInstance().WriteMemory(memAddr, tlutXferCount, MemoryUpdate::TLUT); + FifoRecorder::GetInstance().WriteMemory(memAddr, tlutXferCount, MemoryUpdate::TMEM); +} + +void FifoRecordAnalyzer::ProcessPreloadTexture() +{ + BPS_TmemConfig& tmem_cfg = m_BpMem->tmem_config; + u32 tmem_addr = tmem_cfg.preload_tmem_even * TMEM_LINE_SIZE; + u32 size = tmem_cfg.preload_tile_info.count * TMEM_LINE_SIZE; // TODO: Should this be half size for RGBA8 preloads? + + FifoRecorder::GetInstance().WriteMemory(tmem_cfg.preload_addr << 5, size, MemoryUpdate::TMEM); } void FifoRecordAnalyzer::ProcessLoadIndexedXf(u32 val, int array) diff --git a/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.h b/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.h index 0ffc279bf3..8ef3360ce7 100644 --- a/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.h +++ b/Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.h @@ -40,6 +40,7 @@ private: void DecodeOpcode(u8 *data); void ProcessLoadTlut1(); + void ProcessPreloadTexture(); void ProcessLoadIndexedXf(u32 val, int array); void ProcessVertexArrays(u8 *data, u8 vtxAttrGroup); void ProcessTexMaps();