RSP: User crc32 for crc of imem

This commit is contained in:
zilmar 2024-06-27 16:25:13 +09:30
parent 96a4c2c926
commit 661ec98bb3
4 changed files with 14 additions and 13 deletions

View File

@ -46,6 +46,9 @@
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\3rdParty\zlib\zlib.vcxproj">
<Project>{731bd205-2826-4631-b7af-117658e88dbc}</Project>
</ProjectReference>
<ProjectReference Include="..\..\Common\Common.vcxproj">
<Project>{b4a4b994-9111-42b1-93c2-6f1ca8bc4421}</Project>
</ProjectReference>

View File

@ -38,7 +38,7 @@ void InitializeRspSetting(void)
RegisterSetting(Set_Flags, Data_DWORD_General, "Check Flag Usage", NULL, Compiler.bFlags, NULL);
RegisterSetting(Set_AlignVector, Data_DWORD_General, "Assume Vector loads align", NULL, Compiler.bAlignVector, NULL);
RegisterSetting(Set_JumpTableSize, Data_DWORD_Game, "JumpTableSize", NULL, 0x800, NULL);
RegisterSetting(Set_JumpTableSize, Data_DWORD_Game, "JumpTableSize", NULL, 0x1000, NULL);
RegisterSetting(Set_Mfc0Count, Data_DWORD_Game, "Mfc0Count", NULL, 0x0, NULL);
RegisterSetting(Set_SemaphoreExit, Data_DWORD_Game, "SemaphoreExit", NULL, 0x0, NULL);

View File

@ -5,6 +5,7 @@
#include <Settings/Settings.h>
#include <stdio.h>
#include <string.h>
#include <zlib/zlib.h>
enum
{
@ -78,9 +79,7 @@ void ResetJumpTables(void)
void SetJumpTable(uint32_t End)
{
uint32_t CRC, count;
CRC = 0;
uint32_t CRC = crc32(0L, Z_NULL, 0);
if (End < 0x800)
{
End = 0x800;
@ -91,17 +90,13 @@ void SetJumpTable(uint32_t End)
End = 0x800;
}
for (count = 0; count < End; count += 0x40)
CRC = crc32(CRC, RSPInfo.IMEM, End);
for (uint32_t i = 0; i < NoOfMaps; i++)
{
CRC += *(uint32_t *)(RSPInfo.IMEM + count);
}
for (count = 0; count < NoOfMaps; count++)
{
if (CRC == MapsCRC[count])
if (CRC == MapsCRC[i])
{
JumpTable = (void **)(JumpTables + count * 0x1000);
Table = count;
JumpTable = (void **)(JumpTables + i * 0x1000);
Table = i;
return;
}
}

View File

@ -58,6 +58,9 @@
<ClInclude Include="Rsp.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\3rdParty\zlib\zlib.vcxproj">
<Project>{731bd205-2826-4631-b7af-117658e88dbc}</Project>
</ProjectReference>
<ProjectReference Include="..\Common\Common.vcxproj">
<Project>{b4a4b994-9111-42b1-93c2-6f1ca8bc4421}</Project>
</ProjectReference>