mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
FifoDataFile: Stop ignoring size
The size variable started to be unused when I created std::array variants of ReadArray, but we should follow it in case any files have fewer registers stored than they should (otherwise the remaining registers would end up with garbage data from later in the fifolog). Though, there probably aren't many fifologs where this is relevant.
This commit is contained in:
parent
a720596771
commit
0e23dfbb25
@ -285,19 +285,19 @@ std::unique_ptr<FifoDataFile> FifoDataFile::Load(const std::string& filename, bo
|
|||||||
|
|
||||||
u32 size = std::min<u32>(BP_MEM_SIZE, header.bpMemSize);
|
u32 size = std::min<u32>(BP_MEM_SIZE, header.bpMemSize);
|
||||||
file.Seek(header.bpMemOffset, File::SeekOrigin::Begin);
|
file.Seek(header.bpMemOffset, File::SeekOrigin::Begin);
|
||||||
file.ReadArray(&dataFile->m_BPMem);
|
file.ReadArray(dataFile->m_BPMem.data(), size);
|
||||||
|
|
||||||
size = std::min<u32>(CP_MEM_SIZE, header.cpMemSize);
|
size = std::min<u32>(CP_MEM_SIZE, header.cpMemSize);
|
||||||
file.Seek(header.cpMemOffset, File::SeekOrigin::Begin);
|
file.Seek(header.cpMemOffset, File::SeekOrigin::Begin);
|
||||||
file.ReadArray(&dataFile->m_CPMem);
|
file.ReadArray(dataFile->m_CPMem.data(), size);
|
||||||
|
|
||||||
size = std::min<u32>(XF_MEM_SIZE, header.xfMemSize);
|
size = std::min<u32>(XF_MEM_SIZE, header.xfMemSize);
|
||||||
file.Seek(header.xfMemOffset, File::SeekOrigin::Begin);
|
file.Seek(header.xfMemOffset, File::SeekOrigin::Begin);
|
||||||
file.ReadArray(&dataFile->m_XFMem);
|
file.ReadArray(dataFile->m_XFMem.data(), size);
|
||||||
|
|
||||||
size = std::min<u32>(XF_REGS_SIZE, header.xfRegsSize);
|
size = std::min<u32>(XF_REGS_SIZE, header.xfRegsSize);
|
||||||
file.Seek(header.xfRegsOffset, File::SeekOrigin::Begin);
|
file.Seek(header.xfRegsOffset, File::SeekOrigin::Begin);
|
||||||
file.ReadArray(&dataFile->m_XFRegs);
|
file.ReadArray(dataFile->m_XFRegs.data(), size);
|
||||||
|
|
||||||
// Texture memory saving was added in version 4.
|
// Texture memory saving was added in version 4.
|
||||||
dataFile->m_TexMem.fill(0);
|
dataFile->m_TexMem.fill(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user