Skip to content

Commit

Permalink
FifoPlayer: reduce XF_REGS_SIZE to what we know
Browse files Browse the repository at this point in the history
This avoids out-of-bounds warnings when replaying FIFO captures.

The value of XF_REGS_SIZE is written into the DFF header and we only
read the min of XF_REGS_SIZE and the header value, so this change is
backward compatible and doesn't break forward compatibility for old
Dolphin versions either.
  • Loading branch information
Tilka committed Oct 8, 2018
1 parent feaa466 commit 9c71364
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/Core/Core/FifoPlayer/FifoDataFile.h
Expand Up @@ -9,6 +9,7 @@
#include <vector> #include <vector>


#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "VideoCommon/XFMemory.h"


namespace File namespace File
{ {
Expand Down Expand Up @@ -50,9 +51,10 @@ class FifoDataFile
BP_MEM_SIZE = 256, BP_MEM_SIZE = 256,
CP_MEM_SIZE = 256, CP_MEM_SIZE = 256,
XF_MEM_SIZE = 4096, XF_MEM_SIZE = 4096,
XF_REGS_SIZE = 96, XF_REGS_SIZE = 88,
TEX_MEM_SIZE = 1024 * 1024, TEX_MEM_SIZE = 1024 * 1024,
}; };
static_assert((XF_MEM_SIZE + XF_REGS_SIZE) * sizeof(u32) == sizeof(XFMemory));


FifoDataFile(); FifoDataFile();
~FifoDataFile(); ~FifoDataFile();
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/XFMemory.h
Expand Up @@ -288,6 +288,7 @@ struct XFMemory
u32 unk9[8]; // 0x1048 - 0x104f u32 unk9[8]; // 0x1048 - 0x104f
PostMtxInfo postMtxInfo[8]; // 0x1050 - 0x1057 PostMtxInfo postMtxInfo[8]; // 0x1050 - 0x1057
}; };
static_assert(sizeof(XFMemory) == sizeof(u32) * 0x1058);


extern XFMemory xfmem; extern XFMemory xfmem;


Expand Down

0 comments on commit 9c71364

Please sign in to comment.