Skip to content

Commit

Permalink
FifoPlayer: Support recording texture preloads
Browse files Browse the repository at this point in the history
  • Loading branch information
neobrain committed Jan 10, 2013
1 parent e7c883d commit 198d60c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/FifoPlayer/FifoAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/FifoPlayer/FifoDataFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct MemoryUpdate
TEXTURE_MAP = 0x01,
XF_DATA = 0x02,
VERTEX_STREAM = 0x04,
TLUT = 0x08
TMEM = 0x08,
};

u32 fifoPosition;
Expand Down
13 changes: 12 additions & 1 deletion Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ void FifoRecordAnalyzer::DecodeOpcode(u8 *data)

if (bp.address == BPMEM_LOADTLUT1)
ProcessLoadTlut1();
if (bp.address == BPMEM_PRELOAD_MODE)
ProcessPreloadTexture();
}
break;

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Src/FifoPlayer/FifoRecordAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class FifoRecordAnalyzer
void DecodeOpcode(u8 *data);

void ProcessLoadTlut1();
void ProcessPreloadTexture();
void ProcessLoadIndexedXf(u32 val, int array);
void ProcessVertexArrays(u8 *data, u8 vtxAttrGroup);
void ProcessTexMaps();
Expand Down

0 comments on commit 198d60c

Please sign in to comment.