sync with FCEUX

This commit is contained in:
dborth 2009-11-16 00:22:36 +00:00
parent 6659e2bd03
commit 0429fe4d03
6 changed files with 17 additions and 5 deletions

View File

@ -1245,7 +1245,7 @@ static void iNESPower(void)
all of the iNES mapper code... */
IRQCount=IRQLatch=IRQa=0;
if(head.ROM_type&2)
memset(GameMemBlock+8192,0,sizeof(GameMemBlock)-8192);
memset(GameMemBlock+8192,0,GAME_MEM_BLOCK_SIZE-8192);
else
memset(GameMemBlock,0,GAME_MEM_BLOCK_SIZE);

View File

@ -1,6 +1,8 @@
#ifndef _ZAPPER_H_
#define _ZAPPER_H_
#include "../types.h"
struct ZAPPER
{
uint32 mzx,mzy,mzb;

View File

@ -689,7 +689,7 @@ void FCEUI_StopMovie()
#endif
}
static void poweron(bool shouldDisableBatteryLoading)
void poweron(bool shouldDisableBatteryLoading)
{
//// make a for-movie-recording power-on clear the game's save data, too
//extern char lastLoadedGameName [2048];

View File

@ -9,6 +9,7 @@
#include "input/zapper.h"
#include "utils/guid.h"
#include "utils/md5.h"
struct FCEUFILE;
@ -272,4 +273,7 @@ void LoadSubtitles(MovieData);
void ProcessSubtitles(void);
void FCEU_DisplaySubtitles(char *format, ...);
void poweron(bool shouldDisableBatteryLoading);
#endif //__MOVIE_H_

View File

@ -80,6 +80,9 @@ bool redoLS = false; //This will be true if a backupstate was loaded, meaning
bool internalSaveLoad = false;
bool backupSavestates = true;
bool compressSavestates = true; //By default FCEUX compresses savestates when a movie is inactive.
#define SFMDATA_SIZE (64)
static SFORMAT SFMDATA[SFMDATA_SIZE];
static int SFEXINDEX;
@ -422,7 +425,7 @@ bool FCEUSS_SaveMS(std::ostream* outstream, int compressionLevel)
int error = Z_OK;
uint8* cbuf = (uint8*)ms.buf();
uLongf comprlen = -1;
if(compressionLevel != Z_NO_COMPRESSION)
if(compressionLevel != Z_NO_COMPRESSION && compressSavestates)
{
//worst case compression.
//zlib says "0.1% larger than sourceLen plus 12 bytes"
@ -468,7 +471,7 @@ void FCEUSS_Save(const char *fname)
strcpy(fn, FCEU_MakeFName(FCEUMKF_STATE,CurrentState,0).c_str());
//backup existing savestate first
if (CheckFileExists(fn))
if (CheckFileExists(fn) && backupSavestates) //adelikat: If the files exists and we are allowed to make backup savestates
{
CreateBackupSaveState(fn); //Make a backup of previous savestate before overwriting it
strcpy(lastSavestateMade,fn); //Remember what the last savestate filename was (for undoing later)
@ -900,7 +903,7 @@ void FCEUI_LoadState(const char *fname)
information expected in newer save states, desynchronization won't occur(at least not
from this ;)).
*/
BackupLoadState(); //Backup the current state before loading a new one
if (backupSavestates) BackupLoadState(); //If allowed, backup the current state before loading a new one
if (!movie_readonly && autoMovieBackup && freshMovie) //If auto-backup is on, movie has not been altered this session and the movie is in read+write mode
{

View File

@ -73,4 +73,7 @@ extern bool redoSS; //redo savestate flag
extern char lastLoadstateMade[2048]; //Filename of last state loaded
extern bool undoLS; //undo loadstate flag
extern bool redoLS; //redo savestate flag
extern bool backupSavestates; //Whether or not to make backups, true by default
bool CheckBackupSaveStateExist(); //Checks if backupsavestate exists
extern bool compressSavestates; //Whether or not to compress non-movie savestates (by default, yes)