MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / Swap_PIF

Function Swap_PIF

Source/Core/SaveState.cpp:256–273  ·  view source on GitHub ↗

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..

Source from the content-addressed store, hash-verified

254// In revision >=715 we were byte swapping PIF RAM in a temp buffer, this broke compatibility with PJ64 saves
255// Now that is fixed this been added for compatibility reasons for any ss created within those revs..
256static void Swap_PIF()
257{
258 u8 * pPIFRam = (u8 *)g_pMemoryBuffers[MEM_PIF_RAM];
259
260 if(pPIFRam[0] & 0xC0)
261 {
262 printf("No need to swap\n");
263 return;
264 }
265
266 u8 temp[64];
267 memcpy( temp, pPIFRam, 64 );
268
269 for (u32 i = 0; i < 64; i++)
270 {
271 pPIFRam[i] = temp[ i ^ U8_TWIDDLE ];
272 }
273}
274
275bool SaveState_LoadFromFile( const char * filename )
276{

Callers 1

SaveState_LoadFromFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected