mirror of
https://github.com/dborth/snes9xgx.git
synced 2025-02-17 11:56:25 +01:00
fix several longstanding bugs
This commit is contained in:
parent
84aaefd004
commit
31691ff94f
@ -232,10 +232,9 @@ NGCFreezeGameAuto (int method, bool silent)
|
||||
|
||||
char filepath[1024];
|
||||
|
||||
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
||||
sprintf(filepath, "%s Auto.frz", Memory.ROMFilename);
|
||||
else
|
||||
sprintf(filepath, "%s/%s Auto.frz", GCSettings.SaveFolder, Memory.ROMFilename);
|
||||
if(!MakeFilePath(filepath, FILE_SNAPSHOT, method, Memory.ROMFilename, 0))
|
||||
return false;
|
||||
|
||||
return NGCFreezeGame(filepath, method, silent);
|
||||
}
|
||||
|
||||
@ -322,17 +321,20 @@ NGCUnfreezeGame (char * filepath, int method, bool silent)
|
||||
|
||||
if ( err!=Z_OK )
|
||||
{
|
||||
offset = 0;
|
||||
sprintf (msg, "Unzip error %s",zError(err));
|
||||
ErrorPrompt(msg);
|
||||
}
|
||||
else if ( DestBuffSize != decompressedsize )
|
||||
{
|
||||
offset = 0;
|
||||
ErrorPrompt("Unzipped size doesn't match expected size!");
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = SAVEBUFFERSIZE;
|
||||
memcpy (savebuffer, zipbuffer, SAVEBUFFERSIZE);
|
||||
offset = decompressedsize;
|
||||
memset(savebuffer, 0, SAVEBUFFERSIZE);
|
||||
memcpy (savebuffer, zipbuffer, decompressedsize);
|
||||
}
|
||||
free(zipbuffer);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ preparePrefsData (int method)
|
||||
createXMLController(btnmap[CTRL_PAD][CTRLR_NUNCHUK], "btnmap_pad_nunchuk", "SNES Pad - Nunchuk + Wiimote");
|
||||
createXMLController(btnmap[CTRL_SCOPE][CTRLR_GCPAD], "btnmap_scope_gcpad", "Superscope - GameCube Controller");
|
||||
createXMLController(btnmap[CTRL_SCOPE][CTRLR_WIIMOTE], "btnmap_scope_wiimote", "Superscope - Wiimote");
|
||||
createXMLController(btnmap[CTRL_MOUSE][CTRLR_GCPAD], "btnmap_mouse_gcpad", "MMouse - GameCube Controller");
|
||||
createXMLController(btnmap[CTRL_MOUSE][CTRLR_GCPAD], "btnmap_mouse_gcpad", "Mouse - GameCube Controller");
|
||||
createXMLController(btnmap[CTRL_MOUSE][CTRLR_WIIMOTE], "btnmap_mouse_wiimote", "Mouse - Wiimote");
|
||||
createXMLController(btnmap[CTRL_JUST][CTRLR_GCPAD], "btnmap_just_gcpad", "Justifier - GameCube Controller");
|
||||
createXMLController(btnmap[CTRL_JUST][CTRLR_WIIMOTE], "btnmap_just_wiimote", "Justifier - Wiimote");
|
||||
@ -188,10 +188,9 @@ preparePrefsData (int method)
|
||||
|
||||
mxmlDelete(xml);
|
||||
|
||||
return datasize;
|
||||
return datasize+offset;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* loadXMLSetting
|
||||
*
|
||||
|
@ -103,8 +103,8 @@ decodesavedata (int method, int readsize)
|
||||
// Check for sram comment
|
||||
memcpy (sramsavecomment, savebuffer+offset, 32);
|
||||
|
||||
// version 0xx found!
|
||||
if ( (strncmp (sramsavecomment, "Snes9x GX 0", 11) == 0) )
|
||||
// Snes9x GX save found!
|
||||
if ( (strncmp (sramsavecomment, "Snes9x GX", 9) == 0) )
|
||||
{
|
||||
// adjust offset
|
||||
if(method != METHOD_MC_SLOTA && method != METHOD_MC_SLOTB)
|
||||
@ -182,10 +182,9 @@ LoadSRAMAuto (int method, bool silent)
|
||||
|
||||
char filepath[1024];
|
||||
|
||||
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
||||
sprintf(filepath, "%s Auto.srm", Memory.ROMFilename);
|
||||
else
|
||||
sprintf(filepath, "%s/%s Auto.srm", GCSettings.SaveFolder, Memory.ROMFilename);
|
||||
if(!MakeFilePath(filepath, FILE_SRAM, method, Memory.ROMFilename, 0))
|
||||
return false;
|
||||
|
||||
return LoadSRAM(filepath, method, silent);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user