ADDED new function "Load Game -> Do not change cheat list"
This commit is contained in:
parent
817c6a43dc
commit
644ea117dc
|
@ -2667,6 +2667,27 @@ void cheatsReadGame(gzFile file, int version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// skip the cheat list data
|
||||||
|
void cheatsReadGameSkip( gzFile file, int version )
|
||||||
|
{
|
||||||
|
int nCheats = 0;
|
||||||
|
nCheats = utilReadInt( file );
|
||||||
|
|
||||||
|
if( version >= 9 ) {
|
||||||
|
utilGzSeek( file, sizeof( cheatsList ), SEEK_CUR );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool firstCodeBreaker = true;
|
||||||
|
|
||||||
|
for( int i = 0; i < nCheats; i++ ) {
|
||||||
|
if( version < 9 ) {
|
||||||
|
utilGzSeek( file, ( 7 * sizeof(int) ) + ( 52 * sizeof(char) ), SEEK_CUR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void cheatsSaveCheatList(const char *file)
|
void cheatsSaveCheatList(const char *file)
|
||||||
{
|
{
|
||||||
if(cheatsNumber == 0)
|
if(cheatsNumber == 0)
|
||||||
|
|
|
@ -25,6 +25,7 @@ void cheatsEnable(int number);
|
||||||
void cheatsDisable(int number);
|
void cheatsDisable(int number);
|
||||||
void cheatsSaveGame(gzFile file);
|
void cheatsSaveGame(gzFile file);
|
||||||
void cheatsReadGame(gzFile file, int version);
|
void cheatsReadGame(gzFile file, int version);
|
||||||
|
void cheatsReadGameSkip(gzFile file, int version);
|
||||||
void cheatsSaveCheatList(const char *file);
|
void cheatsSaveCheatList(const char *file);
|
||||||
bool cheatsLoadCheatList(const char *file);
|
bool cheatsLoadCheatList(const char *file);
|
||||||
void cheatsWriteMemory(u32 address, u32 value);
|
void cheatsWriteMemory(u32 address, u32 value);
|
||||||
|
|
|
@ -33,6 +33,7 @@ int cpuSaveType = 0;
|
||||||
bool cheatsEnabled = true;
|
bool cheatsEnabled = true;
|
||||||
bool mirroringEnable = false;
|
bool mirroringEnable = false;
|
||||||
bool skipSaveGameBattery = false;
|
bool skipSaveGameBattery = false;
|
||||||
|
bool skipSaveGameCheats = false;
|
||||||
|
|
||||||
// this is an optional hack to change the backdrop/background color:
|
// this is an optional hack to change the backdrop/background color:
|
||||||
// -1: disabled
|
// -1: disabled
|
||||||
|
|
|
@ -41,7 +41,8 @@ extern bool speedHack;
|
||||||
extern int cpuSaveType;
|
extern int cpuSaveType;
|
||||||
extern bool cheatsEnabled;
|
extern bool cheatsEnabled;
|
||||||
extern bool mirroringEnable;
|
extern bool mirroringEnable;
|
||||||
extern bool skipSaveGameBattery;
|
extern bool skipSaveGameBattery; // skip battery data when reading save states
|
||||||
|
extern bool skipSaveGameCheats; // skip cheat list data when reading save states
|
||||||
extern int customBackdropColor;
|
extern int customBackdropColor;
|
||||||
|
|
||||||
extern u8 *bios;
|
extern u8 *bios;
|
||||||
|
|
|
@ -740,8 +740,13 @@ static bool CPUReadState(gzFile gzFile)
|
||||||
soundReadGame(gzFile, version);
|
soundReadGame(gzFile, version);
|
||||||
|
|
||||||
if(version > SAVE_GAME_VERSION_1) {
|
if(version > SAVE_GAME_VERSION_1) {
|
||||||
|
if(skipSaveGameCheats) {
|
||||||
|
// skip cheats list data
|
||||||
|
cheatsReadGameSkip(gzFile, version);
|
||||||
|
} else {
|
||||||
cheatsReadGame(gzFile, version);
|
cheatsReadGame(gzFile, version);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(version > SAVE_GAME_VERSION_6) {
|
if(version > SAVE_GAME_VERSION_6) {
|
||||||
rtcReadGame(gzFile);
|
rtcReadGame(gzFile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3852,7 +3852,11 @@ static bool gbReadSaveState(gzFile gzFile)
|
||||||
systemDrawScreen();
|
systemDrawScreen();
|
||||||
|
|
||||||
if(version > GBSAVE_GAME_VERSION_1)
|
if(version > GBSAVE_GAME_VERSION_1)
|
||||||
|
if( skipSaveGameCheats ) {
|
||||||
|
gbCheatsReadGameSkip(gzFile, version);
|
||||||
|
} else {
|
||||||
gbCheatsReadGame(gzFile, version);
|
gbCheatsReadGame(gzFile, version);
|
||||||
|
}
|
||||||
|
|
||||||
if (version<11)
|
if (version<11)
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,6 +73,35 @@ void gbCheatsReadGame(gzFile gzFile, int version)
|
||||||
gbCheatUpdateMap();
|
gbCheatUpdateMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void gbCheatsReadGameSkip(gzFile gzFile, int version)
|
||||||
|
{
|
||||||
|
if( version <= 8 ) {
|
||||||
|
int gbGgOn = utilReadInt( gzFile );
|
||||||
|
if( gbGgOn ) {
|
||||||
|
int n = utilReadInt( gzFile );
|
||||||
|
if( n > 0 ) {
|
||||||
|
utilGzSeek( gzFile, n * sizeof(gbXxCheat), SEEK_CUR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int gbGsOn = utilReadInt( gzFile );
|
||||||
|
if( gbGsOn ) {
|
||||||
|
int n = utilReadInt(gzFile);
|
||||||
|
if( n > 0 ) {
|
||||||
|
utilGzSeek( gzFile, n * sizeof(gbXxCheat), SEEK_CUR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int n = utilReadInt( gzFile );
|
||||||
|
|
||||||
|
if( n > 0 ) {
|
||||||
|
utilGzSeek( gzFile, n * sizeof(gbCheat), SEEK_CUR );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void gbCheatsSaveCheatList(const char *file)
|
void gbCheatsSaveCheatList(const char *file)
|
||||||
{
|
{
|
||||||
if(gbCheatNumber == 0)
|
if(gbCheatNumber == 0)
|
||||||
|
|
|
@ -20,6 +20,7 @@ struct gbCheat {
|
||||||
|
|
||||||
void gbCheatsSaveGame(gzFile);
|
void gbCheatsSaveGame(gzFile);
|
||||||
void gbCheatsReadGame(gzFile, int);
|
void gbCheatsReadGame(gzFile, int);
|
||||||
|
void gbCheatsReadGameSkip(gzFile, int);
|
||||||
void gbCheatsSaveCheatList(const char *);
|
void gbCheatsSaveCheatList(const char *);
|
||||||
bool gbCheatsLoadCheatList(const char *);
|
bool gbCheatsLoadCheatList(const char *);
|
||||||
bool gbCheatReadGSCodeFile(const char *);
|
bool gbCheatReadGSCodeFile(const char *);
|
||||||
|
|
|
@ -11,6 +11,7 @@ extern bool useBios;
|
||||||
extern bool skipBios;
|
extern bool skipBios;
|
||||||
extern u8 *bios;
|
extern u8 *bios;
|
||||||
extern bool skipSaveGameBattery;
|
extern bool skipSaveGameBattery;
|
||||||
|
extern bool skipSaveGameCheats;
|
||||||
|
|
||||||
extern u8 *gbRom;
|
extern u8 *gbRom;
|
||||||
extern u8 *gbRam;
|
extern u8 *gbRam;
|
||||||
|
|
|
@ -386,8 +386,13 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
|
||||||
ON_COMMAND(ID_PIXELFILTER_MULTI, &MainWnd::OnPixelfilterMultiThreading)
|
ON_COMMAND(ID_PIXELFILTER_MULTI, &MainWnd::OnPixelfilterMultiThreading)
|
||||||
ON_UPDATE_COMMAND_UI(ID_PIXELFILTER_MULTI, &MainWnd::OnUpdatePixelfilterMultiThreading)
|
ON_UPDATE_COMMAND_UI(ID_PIXELFILTER_MULTI, &MainWnd::OnUpdatePixelfilterMultiThreading)
|
||||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_SELECT_PLUGIN, &MainWnd::OnUpdateOptionsSelectPlugin)
|
ON_UPDATE_COMMAND_UI(ID_OPTIONS_SELECT_PLUGIN, &MainWnd::OnUpdateOptionsSelectPlugin)
|
||||||
|
|
||||||
ON_COMMAND(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnLoadgameDonotchangebatterysave)
|
ON_COMMAND(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnLoadgameDonotchangebatterysave)
|
||||||
ON_UPDATE_COMMAND_UI(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnUpdateLoadgameDonotchangebatterysave)
|
ON_UPDATE_COMMAND_UI(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnUpdateLoadgameDonotchangebatterysave)
|
||||||
|
|
||||||
|
ON_COMMAND(ID_LOADGAME_DONOTCHANGECHEATLIST, &MainWnd::OnLoadgameDonotchangecheatlist)
|
||||||
|
ON_UPDATE_COMMAND_UI(ID_LOADGAME_DONOTCHANGECHEATLIST, &MainWnd::OnUpdateLoadgameDonotchangecheatlist)
|
||||||
|
|
||||||
ON_COMMAND(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnOutputapiXaudio2config)
|
ON_COMMAND(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnOutputapiXaudio2config)
|
||||||
ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnUpdateOutputapiXaudio2config)
|
ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnUpdateOutputapiXaudio2config)
|
||||||
ON_WM_ENTERSIZEMOVE()
|
ON_WM_ENTERSIZEMOVE()
|
||||||
|
|
|
@ -355,8 +355,11 @@ protected:
|
||||||
afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint point);
|
afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint point);
|
||||||
afx_msg void OnUpdatePixelfilterMultiThreading(CCmdUI *pCmdUI);
|
afx_msg void OnUpdatePixelfilterMultiThreading(CCmdUI *pCmdUI);
|
||||||
afx_msg void OnUpdateOptionsSelectPlugin(CCmdUI *pCmdUI);
|
afx_msg void OnUpdateOptionsSelectPlugin(CCmdUI *pCmdUI);
|
||||||
|
|
||||||
afx_msg void OnLoadgameDonotchangebatterysave();
|
afx_msg void OnLoadgameDonotchangebatterysave();
|
||||||
afx_msg void OnUpdateLoadgameDonotchangebatterysave(CCmdUI *pCmdUI);
|
afx_msg void OnUpdateLoadgameDonotchangebatterysave(CCmdUI *pCmdUI);
|
||||||
|
afx_msg void OnLoadgameDonotchangecheatlist();
|
||||||
|
afx_msg void OnUpdateLoadgameDonotchangecheatlist(CCmdUI *pCmdUI);
|
||||||
|
|
||||||
afx_msg void OnEnterSizeMove();
|
afx_msg void OnEnterSizeMove();
|
||||||
|
|
||||||
|
|
|
@ -877,11 +877,20 @@ void MainWnd::OnUpdateFileLoadgameAutoloadmostrecent(CCmdUI* pCmdUI)
|
||||||
|
|
||||||
void MainWnd::OnLoadgameDonotchangebatterysave()
|
void MainWnd::OnLoadgameDonotchangebatterysave()
|
||||||
{
|
{
|
||||||
theApp.winSkipSaveGameBattery = !theApp.winSkipSaveGameBattery;
|
skipSaveGameBattery = !skipSaveGameBattery;
|
||||||
skipSaveGameBattery = theApp.winSkipSaveGameBattery;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWnd::OnUpdateLoadgameDonotchangebatterysave(CCmdUI *pCmdUI)
|
void MainWnd::OnUpdateLoadgameDonotchangebatterysave(CCmdUI *pCmdUI)
|
||||||
{
|
{
|
||||||
pCmdUI->SetCheck(theApp.winSkipSaveGameBattery);
|
pCmdUI->SetCheck(skipSaveGameBattery);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWnd::OnLoadgameDonotchangecheatlist()
|
||||||
|
{
|
||||||
|
skipSaveGameCheats = !skipSaveGameCheats;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWnd::OnUpdateLoadgameDonotchangecheatlist(CCmdUI *pCmdUI)
|
||||||
|
{
|
||||||
|
pCmdUI->SetCheck(skipSaveGameCheats);
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,7 +309,6 @@ VBA::VBA()
|
||||||
wasPaused = false;
|
wasPaused = false;
|
||||||
frameskipadjust = 0;
|
frameskipadjust = 0;
|
||||||
autoLoadMostRecent = false;
|
autoLoadMostRecent = false;
|
||||||
winSkipSaveGameBattery = false;
|
|
||||||
maxScale = 0;
|
maxScale = 0;
|
||||||
romSize = 0;
|
romSize = 0;
|
||||||
lastWindowed = VIDEO_3X;
|
lastWindowed = VIDEO_3X;
|
||||||
|
@ -1716,11 +1715,11 @@ void VBA::loadSettings()
|
||||||
if(joypadDefault < 0 || joypadDefault > 3)
|
if(joypadDefault < 0 || joypadDefault > 3)
|
||||||
joypadDefault = 0;
|
joypadDefault = 0;
|
||||||
|
|
||||||
autoLoadMostRecent = regQueryDwordValue("autoLoadMostRecent", false) ? true :
|
autoLoadMostRecent = ( 1 == regQueryDwordValue("autoLoadMostRecent", 0) ) ? true : false;
|
||||||
false;
|
|
||||||
|
|
||||||
winSkipSaveGameBattery = regQueryDwordValue("winSkipSaveGameBattery", false) ? true : false;
|
skipSaveGameBattery = ( 1 == regQueryDwordValue("skipSaveGameBattery", 0) ) ? true : false;
|
||||||
skipSaveGameBattery = theApp.winSkipSaveGameBattery;
|
|
||||||
|
skipSaveGameCheats = ( 1 == regQueryDwordValue("skipSaveGameCheats", 0) ) ? true : false;
|
||||||
|
|
||||||
cheatsEnabled = regQueryDwordValue("cheatsEnabled", false) ? true : false;
|
cheatsEnabled = regQueryDwordValue("cheatsEnabled", false) ? true : false;
|
||||||
|
|
||||||
|
@ -2633,7 +2632,8 @@ void VBA::saveSettings()
|
||||||
|
|
||||||
regSetDwordValue("joypadDefault", joypadDefault);
|
regSetDwordValue("joypadDefault", joypadDefault);
|
||||||
regSetDwordValue("autoLoadMostRecent", autoLoadMostRecent);
|
regSetDwordValue("autoLoadMostRecent", autoLoadMostRecent);
|
||||||
regSetDwordValue("winSkipSaveGameBattery", winSkipSaveGameBattery);
|
regSetDwordValue("skipSaveGameBattery", skipSaveGameBattery);
|
||||||
|
regSetDwordValue("skipSaveGameCheats", skipSaveGameCheats);
|
||||||
regSetDwordValue("cheatsEnabled", cheatsEnabled);
|
regSetDwordValue("cheatsEnabled", cheatsEnabled);
|
||||||
regSetDwordValue("maxScale", maxScale);
|
regSetDwordValue("maxScale", maxScale);
|
||||||
regSetDwordValue("throttle", throttle);
|
regSetDwordValue("throttle", throttle);
|
||||||
|
|
|
@ -179,7 +179,6 @@ class VBA : public CWinApp
|
||||||
bool wasPaused;
|
bool wasPaused;
|
||||||
int frameskipadjust;
|
int frameskipadjust;
|
||||||
bool autoLoadMostRecent;
|
bool autoLoadMostRecent;
|
||||||
bool winSkipSaveGameBattery;
|
|
||||||
int maxScale;
|
int maxScale;
|
||||||
int romSize;
|
int romSize;
|
||||||
VIDEO_SIZE lastWindowed;
|
VIDEO_SIZE lastWindowed;
|
||||||
|
|
|
@ -1632,7 +1632,6 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "Most recent", ID_FILE_LOADGAME_MOSTRECENT
|
MENUITEM "Most recent", ID_FILE_LOADGAME_MOSTRECENT
|
||||||
MENUITEM "Auto load most recent", ID_FILE_LOADGAME_AUTOLOADMOSTRECENT
|
MENUITEM "Auto load most recent", ID_FILE_LOADGAME_AUTOLOADMOSTRECENT
|
||||||
MENUITEM "Do not change battery save", ID_LOADGAME_DONOTCHANGEBATTERYSAVE
|
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Slot #1", ID_FILE_LOADGAME_SLOT1
|
MENUITEM "Slot #1", ID_FILE_LOADGAME_SLOT1
|
||||||
MENUITEM "Slot #2", ID_FILE_LOADGAME_SLOT2
|
MENUITEM "Slot #2", ID_FILE_LOADGAME_SLOT2
|
||||||
|
@ -1644,6 +1643,9 @@ BEGIN
|
||||||
MENUITEM "Slot #8", ID_FILE_LOADGAME_SLOT8
|
MENUITEM "Slot #8", ID_FILE_LOADGAME_SLOT8
|
||||||
MENUITEM "Slot #9", ID_FILE_LOADGAME_SLOT9
|
MENUITEM "Slot #9", ID_FILE_LOADGAME_SLOT9
|
||||||
MENUITEM "Slot #10", ID_FILE_LOADGAME_SLOT10
|
MENUITEM "Slot #10", ID_FILE_LOADGAME_SLOT10
|
||||||
|
MENUITEM SEPARATOR
|
||||||
|
MENUITEM "Do not change battery save", ID_LOADGAME_DONOTCHANGEBATTERYSAVE
|
||||||
|
MENUITEM "Do not change cheat list", ID_LOADGAME_DONOTCHANGECHEATLIST
|
||||||
END
|
END
|
||||||
POPUP "Save Game"
|
POPUP "Save Game"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
|
@ -392,7 +392,6 @@
|
||||||
#define IDC_MAP_VIEW_ZOOM 1138
|
#define IDC_MAP_VIEW_ZOOM 1138
|
||||||
#define IDS_MOVIE_PLAY 1138
|
#define IDS_MOVIE_PLAY 1138
|
||||||
#define IDC_VIEWER 1140
|
#define IDC_VIEWER 1140
|
||||||
#define IDC_SAVE_BG2 1140
|
|
||||||
#define IDC_CHANGE_BACKDROP 1140
|
#define IDC_CHANGE_BACKDROP 1140
|
||||||
#define IDC_ADDRESSES 1141
|
#define IDC_ADDRESSES 1141
|
||||||
#define IDC_GO 1143
|
#define IDC_GO 1143
|
||||||
|
@ -870,13 +869,14 @@
|
||||||
#define ID_FILE_OPEN_GBA 40366
|
#define ID_FILE_OPEN_GBA 40366
|
||||||
#define ID_FILE_QUICKOPENROM 40367
|
#define ID_FILE_QUICKOPENROM 40367
|
||||||
#define ID_OPTIONS_VIDEO_LAYERS_RESET 40368
|
#define ID_OPTIONS_VIDEO_LAYERS_RESET 40368
|
||||||
|
#define ID_LOADGAME_DONOTCHANGECHEATLIST 40370
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 165
|
#define _APS_NEXT_RESOURCE_VALUE 165
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40370
|
#define _APS_NEXT_COMMAND_VALUE 40371
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1297
|
#define _APS_NEXT_CONTROL_VALUE 1297
|
||||||
#define _APS_NEXT_SYMED_VALUE 103
|
#define _APS_NEXT_SYMED_VALUE 103
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue