diff --git a/desmume/src/GPU_osd.cpp b/desmume/src/GPU_osd.cpp index e37c3255a..d801ebfd0 100644 --- a/desmume/src/GPU_osd.cpp +++ b/desmume/src/GPU_osd.cpp @@ -33,6 +33,8 @@ #include "movie.h" #include "NDSSystem.h" #include "mic.h" +#include "saves.h" + OSDCLASS *osd = NULL; HudStruct Hud; @@ -169,16 +171,10 @@ static void TouchDisplay() { static int yheight; static int xpos; -static int previousslot; +static int previousslot = 0; static int fadecounter; static char number[10]; -#ifdef WIN32 -#include "main.h" -#else -int lastSaveState = 0; -#endif - static void DrawStateSlots(){ aggDraw.hud->lineWidth(1.0); @@ -422,4 +418,4 @@ void OSDCLASS::addFixed(u16 x, u16 y, const char *fmt, ...) void OSDCLASS::border(bool enabled) { //render51.setTextBoxBorder(enabled); -} \ No newline at end of file +} diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index 90b011c10..c2ca05d15 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -39,10 +39,12 @@ #include "readwrite.h" #include "gfx3d.h" #include "movie.h" + #ifdef _MSC_VER #include "windows/main.h" #endif +int lastSaveState = 0; //Keeps track of last savestate used for quick save/load functions //void*v is actually a void** which will be indirected before reading //since this isnt supported right now, it is declared in here to make things compile @@ -481,6 +483,8 @@ void savestate_slot(int num) struct stat sbuf; char filename[MAX_PATH]; + lastSaveState = num; //Set last savestate used + #ifdef WIN32 GetFullPathNoExt(STATES, filename, MAX_PATH); #else @@ -511,6 +515,8 @@ void loadstate_slot(int num) { char filename[MAX_PATH]; + lastSaveState = num; //Set last savestate used + #ifdef WIN32 GetFullPathNoExt(STATES, filename, MAX_PATH); #else diff --git a/desmume/src/saves.h b/desmume/src/saves.h index bd827d7f6..9a25cb3ea 100644 --- a/desmume/src/saves.h +++ b/desmume/src/saves.h @@ -27,6 +27,8 @@ #define SRAM_SIZE 0x10000 #define NB_STATES 10 +extern int lastSaveState; + typedef struct { BOOL exists; diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index 3ea1e68ac..e262cc404 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -152,7 +152,6 @@ void HK_StateSaveSlot(int num) else savestate_slot(num); //Savestate - lastSaveState = num; //Set last savestate used LoadSaveStateInfo(); } } diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 7a4534e25..155883f17 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -138,7 +138,6 @@ void wxTest() { static BOOL OpenCore(const char* filename); -unsigned int lastSaveState = 0; //Keeps track of last savestate used for quick save/load functions //----Recent ROMs menu globals---------- vector RecentRoms; //The list of recent ROM filenames const unsigned int MAX_RECENT_ROMS = 10; //To change the recent rom max, simply change this number diff --git a/desmume/src/windows/main.h b/desmume/src/windows/main.h index 4396346fd..1ff526d05 100644 --- a/desmume/src/windows/main.h +++ b/desmume/src/windows/main.h @@ -7,7 +7,6 @@ extern WINCLASS *MainWindow; extern volatile BOOL execute, paused; void NDS_Pause(); void NDS_UnPause(); -extern unsigned int lastSaveState; void LoadSaveStateInfo(); void Display(); void Pause();