Compute the comparison size properly (transferSize is in u32, not in u8)

This commit is contained in:
Pierre Bourdon 2012-05-18 23:27:02 +02:00
parent 5a77cae2e3
commit b8d4d013f6
1 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
case XFMEM_SETVIEWPORT+4: case XFMEM_SETVIEWPORT+4:
case XFMEM_SETVIEWPORT+5: case XFMEM_SETVIEWPORT+5:
{ {
u8 size = std::min(transferSize, 6 * 4); u8 size = std::min(transferSize * 4, 6 * 4);
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size)) if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
{ {
VertexManager::Flush(); VertexManager::Flush();
@ -142,7 +142,7 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
case XFMEM_SETPROJECTION+5: case XFMEM_SETPROJECTION+5:
case XFMEM_SETPROJECTION+6: case XFMEM_SETPROJECTION+6:
{ {
u8 size = std::min(transferSize, 7 * 4); u8 size = std::min(transferSize * 4, 7 * 4);
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size)) if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
{ {
VertexManager::Flush(); VertexManager::Flush();
@ -167,7 +167,7 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
case XFMEM_SETTEXMTXINFO+6: case XFMEM_SETTEXMTXINFO+6:
case XFMEM_SETTEXMTXINFO+7: case XFMEM_SETTEXMTXINFO+7:
{ {
u8 size = std::min(transferSize, 8 * 4); u8 size = std::min(transferSize * 4, 8 * 4);
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size)) if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
{ {
VertexManager::Flush(); VertexManager::Flush();
@ -186,7 +186,7 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
case XFMEM_SETPOSMTXINFO+6: case XFMEM_SETPOSMTXINFO+6:
case XFMEM_SETPOSMTXINFO+7: case XFMEM_SETPOSMTXINFO+7:
{ {
u8 size = std::min(transferSize, 8 * 4); u8 size = std::min(transferSize * 4, 8 * 4);
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size)) if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
{ {
VertexManager::Flush(); VertexManager::Flush();