refactor save slot display; first example of hud operating in linux

This commit is contained in:
zeromus 2009-07-12 03:52:02 +00:00
parent dd05ece216
commit c87812a0db
6 changed files with 12 additions and 11 deletions

View File

@ -33,6 +33,8 @@
#include "movie.h" #include "movie.h"
#include "NDSSystem.h" #include "NDSSystem.h"
#include "mic.h" #include "mic.h"
#include "saves.h"
OSDCLASS *osd = NULL; OSDCLASS *osd = NULL;
HudStruct Hud; HudStruct Hud;
@ -169,16 +171,10 @@ static void TouchDisplay() {
static int yheight; static int yheight;
static int xpos; static int xpos;
static int previousslot; static int previousslot = 0;
static int fadecounter; static int fadecounter;
static char number[10]; static char number[10];
#ifdef WIN32
#include "main.h"
#else
int lastSaveState = 0;
#endif
static void DrawStateSlots(){ static void DrawStateSlots(){
aggDraw.hud->lineWidth(1.0); aggDraw.hud->lineWidth(1.0);

View File

@ -39,10 +39,12 @@
#include "readwrite.h" #include "readwrite.h"
#include "gfx3d.h" #include "gfx3d.h"
#include "movie.h" #include "movie.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#include "windows/main.h" #include "windows/main.h"
#endif #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 //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 //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; struct stat sbuf;
char filename[MAX_PATH]; char filename[MAX_PATH];
lastSaveState = num; //Set last savestate used
#ifdef WIN32 #ifdef WIN32
GetFullPathNoExt(STATES, filename, MAX_PATH); GetFullPathNoExt(STATES, filename, MAX_PATH);
#else #else
@ -511,6 +515,8 @@ void loadstate_slot(int num)
{ {
char filename[MAX_PATH]; char filename[MAX_PATH];
lastSaveState = num; //Set last savestate used
#ifdef WIN32 #ifdef WIN32
GetFullPathNoExt(STATES, filename, MAX_PATH); GetFullPathNoExt(STATES, filename, MAX_PATH);
#else #else

View File

@ -27,6 +27,8 @@
#define SRAM_SIZE 0x10000 #define SRAM_SIZE 0x10000
#define NB_STATES 10 #define NB_STATES 10
extern int lastSaveState;
typedef struct typedef struct
{ {
BOOL exists; BOOL exists;

View File

@ -152,7 +152,6 @@ void HK_StateSaveSlot(int num)
else else
savestate_slot(num); //Savestate savestate_slot(num); //Savestate
lastSaveState = num; //Set last savestate used
LoadSaveStateInfo(); LoadSaveStateInfo();
} }
} }

View File

@ -138,7 +138,6 @@ void wxTest() {
static BOOL OpenCore(const char* filename); 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---------- //----Recent ROMs menu globals----------
vector<string> RecentRoms; //The list of recent ROM filenames vector<string> RecentRoms; //The list of recent ROM filenames
const unsigned int MAX_RECENT_ROMS = 10; //To change the recent rom max, simply change this number const unsigned int MAX_RECENT_ROMS = 10; //To change the recent rom max, simply change this number

View File

@ -7,7 +7,6 @@ extern WINCLASS *MainWindow;
extern volatile BOOL execute, paused; extern volatile BOOL execute, paused;
void NDS_Pause(); void NDS_Pause();
void NDS_UnPause(); void NDS_UnPause();
extern unsigned int lastSaveState;
void LoadSaveStateInfo(); void LoadSaveStateInfo();
void Display(); void Display();
void Pause(); void Pause();