Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Aug 11, 2020
1 parent 8b365d0 commit 22430ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
30 changes: 1 addition & 29 deletions Source/Core/SaveState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,27 +251,6 @@ bool SaveState_SaveToFile( const char * filename )
return true;
}

// In revision >=715 we were byte swapping PIF RAM in a temp buffer, this broke compatibility with PJ64 saves
// Now that is fixed this been added for compatibility reasons for any ss created within those revs..
static void Swap_PIF()
{
u8 * pPIFRam = (u8 *)g_pMemoryBuffers[MEM_PIF_RAM];

if(pPIFRam[0] & 0xC0)
{
printf("No need to swap\n");
return;
}

u8 temp[64];
memcpy_neon( temp, pPIFRam, 64 );

for (u32 i = 0; i < 64; i++)
{
pPIFRam[i] = temp[ i ^ U8_TWIDDLE ];
}
}

bool SaveState_LoadFromFile( const char * filename )
{
SaveState_istream_gzip stream( filename );
Expand All @@ -283,9 +262,7 @@ bool SaveState_LoadFromFile( const char * filename )
stream >> value;
if(value != SAVESTATE_PROJECT64_MAGIC_NUMBER)
{
#ifdef DAEDALUS_DEBUG_CONSOLE
DBGConsole_Msg(0, "Wrong magic number - savestate could be damaged or not in Daedalus/Project64 format" );
#endif
return false;
}
stream >> gRamSize;
Expand All @@ -298,12 +275,8 @@ bool SaveState_LoadFromFile( const char * filename )
if(g_ROM.mRomID != new_rom_id)
{
//ToDo: Give Option to switch Roms to one listed in SaveState if available.
#ifdef DAEDALUS_DEBUG_CONSOLE
DBGConsole_Msg(0, "ROM name in savestate is different from the name of the currently loaded ROM: %x-%x-%02x, %x-%x-%02x\n",

g_ROM.mRomID.CRC[0], g_ROM.mRomID.CRC[1], g_ROM.mRomID.CountryID,
new_rom_id.CRC[0], new_rom_id.CRC[1], new_rom_id.CountryID);
#endif
g_ROM.mRomID.CRC[0], g_ROM.mRomID.CRC[1], g_ROM.mRomID.CountryID, new_rom_id.CRC[0], new_rom_id.CRC[1], new_rom_id.CountryID);
return false;
}

Expand Down Expand Up @@ -389,7 +362,6 @@ bool SaveState_LoadFromFile( const char * filename )
//stream.skip(0x40);

stream.read(g_pMemoryBuffers[MEM_PIF_RAM], 0x40);
Swap_PIF();

stream.read(g_pMemoryBuffers[MEM_RD_RAM], gRamSize);
stream.read_memory_buffer(MEM_SP_MEM); //, 0x84000000);
Expand Down
2 changes: 1 addition & 1 deletion Source/SysVita/Utility/IOVita.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ namespace IO
}
else
{
return nullptr;
return p_path;
}
}

Expand Down

0 comments on commit 22430ad

Please sign in to comment.