FifoPlayer: Support recording texture preloads

This commit is contained in:
NeoBrainX 2013-01-09 11:16:35 +01:00
parent e7c883d6be
commit 198d60c569
4 changed files with 16 additions and 4 deletions

View File

@ -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)

View File

@ -33,7 +33,7 @@ struct MemoryUpdate
TEXTURE_MAP = 0x01,
XF_DATA = 0x02,
VERTEX_STREAM = 0x04,
TLUT = 0x08
TMEM = 0x08,
};
u32 fifoPosition;

View File

@ -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)

View File

@ -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();