2006-07-29 05:46:15 +00:00
|
|
|
/* FCE Ultra - NES/Famicom Emulator
|
|
|
|
*
|
|
|
|
* Copyright notice for this file:
|
|
|
|
* Copyright (C) 2002 Xodnizel
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-08-04 22:33:16 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2006-07-29 05:46:15 +00:00
|
|
|
*/
|
|
|
|
|
2008-05-22 07:43:48 +00:00
|
|
|
enum ENUM_SSLOADPARAMS
|
|
|
|
{
|
|
|
|
SSLOADPARAM_NOBACKUP,
|
|
|
|
SSLOADPARAM_BACKUP,
|
|
|
|
};
|
|
|
|
|
2008-08-12 03:28:51 +00:00
|
|
|
void FCEUSS_Save(const char *);
|
|
|
|
bool FCEUSS_Load(const char *);
|
2008-06-03 05:01:07 +00:00
|
|
|
|
|
|
|
//zlib values: 0 (none) through 9 (max) or -1 (default)
|
2010-05-17 21:02:38 +00:00
|
|
|
bool FCEUSS_SaveMS(EMUFILE* outstream, int compressionLevel);
|
2008-06-03 05:01:07 +00:00
|
|
|
|
2010-05-17 21:02:38 +00:00
|
|
|
bool FCEUSS_LoadFP(EMUFILE* is, ENUM_SSLOADPARAMS params);
|
2006-07-29 05:46:15 +00:00
|
|
|
|
|
|
|
extern int CurrentState;
|
|
|
|
void FCEUSS_CheckStates(void);
|
|
|
|
|
2008-06-06 06:34:39 +00:00
|
|
|
struct SFORMAT
|
|
|
|
{
|
|
|
|
//a void* to the data or a void** to the data
|
|
|
|
void *v;
|
2006-07-29 05:46:15 +00:00
|
|
|
|
2008-06-06 06:34:39 +00:00
|
|
|
//size, plus flags
|
|
|
|
uint32 s;
|
2008-05-22 07:43:48 +00:00
|
|
|
|
2008-06-06 06:34:39 +00:00
|
|
|
//a string description of the element
|
|
|
|
char *desc;
|
|
|
|
};
|
2008-05-22 07:43:48 +00:00
|
|
|
|
2006-07-29 05:46:15 +00:00
|
|
|
void ResetExState(void (*PreSave)(void),void (*PostSave)(void));
|
|
|
|
void AddExState(void *v, uint32 s, int type, char *desc);
|
|
|
|
|
2008-06-06 06:34:39 +00:00
|
|
|
//indicates that the value is a multibyte integer that needs to be put in the correct byte order
|
2006-07-29 05:46:15 +00:00
|
|
|
#define FCEUSTATE_RLSB 0x80000000
|
|
|
|
|
2008-06-06 06:34:39 +00:00
|
|
|
//void*v is actually a void** which will be indirected before reading
|
|
|
|
#define FCEUSTATE_INDIRECT 0x40000000
|
|
|
|
|
|
|
|
//all FCEUSTATE flags together so that we can mask them out and get the size
|
|
|
|
#define FCEUSTATE_FLAGS (FCEUSTATE_RLSB|FCEUSTATE_INDIRECT)
|
|
|
|
|
2006-07-29 05:46:15 +00:00
|
|
|
void FCEU_DrawSaveStates(uint8 *XBuf);
|
|
|
|
|
2008-12-23 03:54:31 +00:00
|
|
|
void CreateBackupSaveState(const char *fname); //backsup a savestate before overwriting it with a new one
|
2008-12-23 22:44:04 +00:00
|
|
|
void BackupLoadState(); //Makes a backup savestate before any loadstate
|
|
|
|
void LoadBackup(); //Loads the backupsavestate
|
2008-12-24 00:38:47 +00:00
|
|
|
void RedoLoadState(); //reloads a loadstate if backupsavestate was run
|
2008-12-23 22:44:04 +00:00
|
|
|
void SwapSaveState(); //Swaps a savestate with its backup state
|
2008-12-24 00:38:47 +00:00
|
|
|
|
|
|
|
extern char lastSavestateMade[2048]; //Filename of last savestate used
|
2008-12-23 22:44:04 +00:00
|
|
|
extern bool undoSS; //undo savestate flag
|
|
|
|
extern bool redoSS; //redo savestate flag
|
2008-12-24 00:38:47 +00:00
|
|
|
extern char lastLoadstateMade[2048]; //Filename of last state loaded
|
|
|
|
extern bool undoLS; //undo loadstate flag
|
|
|
|
extern bool redoLS; //redo savestate flag
|
2009-11-13 04:21:24 +00:00
|
|
|
extern bool backupSavestates; //Whether or not to make backups, true by default
|
2009-10-19 03:37:38 +00:00
|
|
|
bool CheckBackupSaveStateExist(); //Checks if backupsavestate exists
|
2009-11-13 05:35:32 +00:00
|
|
|
|
|
|
|
extern bool compressSavestates; //Whether or not to compress non-movie savestates (by default, yes)
|