mirror of
https://github.com/dborth/fceugx.git
synced 2024-11-01 06:55:05 +01:00
FDS saving works now!
This commit is contained in:
parent
219e471f83
commit
6ee208a9c3
@ -41,8 +41,8 @@
|
||||
#include "video.h"
|
||||
|
||||
|
||||
static void (*SPreSave)(void);
|
||||
static void (*SPostSave)(void);
|
||||
void (*SPreSave)(void);
|
||||
void (*SPostSave)(void);
|
||||
|
||||
static int SaveStateStatus[10];
|
||||
static int StateShow;
|
||||
|
@ -221,6 +221,9 @@ int GCSaveChunk(int chunkid, SFORMAT *sf) {
|
||||
* It uses memory for it's I/O and has an added CHNK block.
|
||||
* The file is terminated with CHNK length of 0.
|
||||
****************************************************************************/
|
||||
extern void (*SPreSave)(void);
|
||||
extern void (*SPostSave)(void);
|
||||
|
||||
int GCFCEUSS_Save()
|
||||
{
|
||||
int totalsize = 0;
|
||||
@ -244,6 +247,7 @@ int GCFCEUSS_Save()
|
||||
|
||||
/*** And Comments ***/
|
||||
strncpy (Comment[1],romFilename,31); // we only have 32 chars to work with!
|
||||
Comment[1][31] = 0;
|
||||
memfwrite(&Comment[0], 64);
|
||||
totalsize += 64;
|
||||
|
||||
@ -255,8 +259,15 @@ int GCFCEUSS_Save()
|
||||
totalsize += GCSaveChunk(3, FCEUPPU_STATEINFO);
|
||||
totalsize += GCSaveChunk(4, FCEUCTRL_STATEINFO);
|
||||
totalsize += GCSaveChunk(5, FCEUSND_STATEINFO);
|
||||
|
||||
if(nesGameType == 4) // FDS
|
||||
SPreSave();
|
||||
|
||||
totalsize += GCSaveChunk(0x10, SFMDATA);
|
||||
|
||||
if(nesGameType == 4) // FDS
|
||||
SPostSave();
|
||||
|
||||
/*** Add terminating CHNK ***/
|
||||
memfwrite(&chunk,4);
|
||||
memfwrite(&zero,4);
|
||||
@ -270,13 +281,6 @@ int GCFCEUSS_Save()
|
||||
|
||||
bool SaveState (int method, bool silent)
|
||||
{
|
||||
if(nesGameType == 4)
|
||||
{
|
||||
if(!silent)
|
||||
WaitPrompt((char *)"Saving is not available for FDS games!");
|
||||
return false;
|
||||
}
|
||||
|
||||
ShowAction ((char*) "Saving...");
|
||||
|
||||
if(method == METHOD_AUTO)
|
||||
@ -326,13 +330,6 @@ bool SaveState (int method, bool silent)
|
||||
|
||||
bool LoadState (int method, bool silent)
|
||||
{
|
||||
if(nesGameType == 4)
|
||||
{
|
||||
if(!silent)
|
||||
WaitPrompt((char *)"Saving is not available for FDS games!");
|
||||
return false;
|
||||
}
|
||||
|
||||
ShowAction ((char*) "Loading...");
|
||||
|
||||
if(method == METHOD_AUTO)
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#define SAVEBUFFERSIZE (64 * 1024)
|
||||
#define SAVEBUFFERSIZE (512 * 1024)
|
||||
#define MAXJOLIET 255
|
||||
#define MAXDISPLAY 54
|
||||
|
||||
|
@ -241,6 +241,10 @@ PreferencesMenu ()
|
||||
GCSettings.SaveMethod++;
|
||||
if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
|
||||
GCSettings.SaveMethod++;
|
||||
prefmenu[6][0] = '\0';
|
||||
#else
|
||||
sprintf (prefmenu[6], "Verify MC Saves %s",
|
||||
GCSettings.VerifySaves == true ? " ON" : "OFF");
|
||||
#endif
|
||||
|
||||
// correct load/save methods out of bounds
|
||||
@ -279,9 +283,6 @@ PreferencesMenu ()
|
||||
else if (GCSettings.AutoSave == 2) sprintf (prefmenu[5],"Auto Save STATE");
|
||||
else if (GCSettings.AutoSave == 3) sprintf (prefmenu[5],"Auto Save BOTH");
|
||||
|
||||
sprintf (prefmenu[6], "Verify MC Saves %s",
|
||||
GCSettings.VerifySaves == true ? " ON" : "OFF");
|
||||
|
||||
ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16, -1);
|
||||
|
||||
switch (ret)
|
||||
@ -354,6 +355,13 @@ GameMenu ()
|
||||
|
||||
while (quit == 0)
|
||||
{
|
||||
// disable RAM saving/loading for FDS games
|
||||
if(nesGameType == 4)
|
||||
{
|
||||
gamemenu[3][0] = '\0';
|
||||
gamemenu[4][0] = '\0';
|
||||
}
|
||||
|
||||
// disable RAM/STATE saving/loading if AUTO is on
|
||||
if (GCSettings.AutoLoad == 1) // Auto Load RAM
|
||||
gamemenu[3][0] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user