FifoPlayer: Save/restore texture memory state for fifo logs

This commit is contained in:
Stenzek
2017-01-03 17:31:16 +10:00
parent 438989668e
commit 5f3c878ba2
5 changed files with 21 additions and 3 deletions

View File

@ -25,6 +25,10 @@
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/CommandProcessor.h"
// We need to include TextureDecoder.h for the texMem array.
// TODO: Move texMem somewhere else so this isn't an issue.
#include "VideoCommon/TextureDecoder.h"
bool IsPlayingBackFifologWithBrokenEFBCopies = false;
FifoPlayer::~FifoPlayer()
@ -127,6 +131,7 @@ int FifoPlayer::AdvanceFrame()
// GPU is the same for each playback loop.
m_CurrentFrame = m_FrameRangeStart;
LoadRegisters();
LoadTextureMemory();
FlushWGP();
}
@ -420,6 +425,7 @@ void FifoPlayer::LoadMemory()
SetupFifo();
LoadRegisters();
LoadTextureMemory();
FlushWGP();
}
@ -460,6 +466,13 @@ void FifoPlayer::LoadRegisters()
LoadXFReg(i, regs[i]);
}
void FifoPlayer::LoadTextureMemory()
{
static_assert(static_cast<size_t>(TMEM_SIZE) == static_cast<size_t>(FifoDataFile::TEX_MEM_SIZE),
"TMEM_SIZE matches the size of texture memory in FifoDataFile");
std::memcpy(texMem, m_File->GetTexMem(), FifoDataFile::TEX_MEM_SIZE);
}
void FifoPlayer::WriteCP(u32 address, u16 value)
{
PowerPC::Write_U16(value, 0xCC000000 | address);