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