diff --git a/trunk/desmume/src/GPU.h b/trunk/desmume/src/GPU.h index e2b277625..8d3992e06 100644 --- a/trunk/desmume/src/GPU.h +++ b/trunk/desmume/src/GPU.h @@ -510,7 +510,7 @@ static INLINE void GPU_ligne(Screen * screen, u16 l) if (gpu->sprEnable && gpu->dispOBJ) { // nothing else to display but sprites... - if(!gpu->nbBGActif) { + if(0==1 && !gpu->nbBGActif) { gpu->spriteRender(gpu, l, dst, sprPrio); return; } diff --git a/trunk/desmume/src/gtk-glade/callbacks.c b/trunk/desmume/src/gtk-glade/callbacks.c index 1525e8d88..7b98e80a3 100755 --- a/trunk/desmume/src/gtk-glade/callbacks.c +++ b/trunk/desmume/src/gtk-glade/callbacks.c @@ -127,6 +127,30 @@ void on_menu_pscreen_activate (GtkMenuItem *menuitem, gpointer user_data) { Wr void on_menu_quit_activate (GtkMenuItem *menuitem, gpointer user_data) { gtk_main_quit(); } +/* MENU SAVES ***** ***** ***** ***** */ + +void on_loadstate1_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(1); } +void on_loadstate2_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(2); } +void on_loadstate3_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(3); } +void on_loadstate4_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(4); } +void on_loadstate5_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(5); } +void on_loadstate6_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(6); } +void on_loadstate7_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(7); } +void on_loadstate8_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(8); } +void on_loadstate9_activate (GtkMenuItem *m, gpointer d) { loadstate_slot(9); } +void on_loadstate10_activate(GtkMenuItem *m, gpointer d) { loadstate_slot(10); } + +void on_savestate1_activate (GtkMenuItem *m, gpointer d) { savestate_slot(1); } +void on_savestate2_activate (GtkMenuItem *m, gpointer d) { savestate_slot(2); } +void on_savestate3_activate (GtkMenuItem *m, gpointer d) { savestate_slot(3); } +void on_savestate4_activate (GtkMenuItem *m, gpointer d) { savestate_slot(4); } +void on_savestate5_activate (GtkMenuItem *m, gpointer d) { savestate_slot(5); } +void on_savestate6_activate (GtkMenuItem *m, gpointer d) { savestate_slot(6); } +void on_savestate7_activate (GtkMenuItem *m, gpointer d) { savestate_slot(7); } +void on_savestate8_activate (GtkMenuItem *m, gpointer d) { savestate_slot(8); } +void on_savestate9_activate (GtkMenuItem *m, gpointer d) { savestate_slot(9); } +void on_savestate10_activate(GtkMenuItem *m, gpointer d) { savestate_slot(10); } + /* MENU EMULATION ***** ***** ***** ***** */ void on_menu_exec_activate (GtkMenuItem *menuitem, gpointer user_data) { desmume_resume(); } diff --git a/trunk/desmume/src/gtk-glade/callbacks.h b/trunk/desmume/src/gtk-glade/callbacks.h index f41598ee7..bc4dc209c 100755 --- a/trunk/desmume/src/gtk-glade/callbacks.h +++ b/trunk/desmume/src/gtk-glade/callbacks.h @@ -26,6 +26,32 @@ void on_menu_ouvrir_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menu_pscreen_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menu_quit_activate (GtkMenuItem *menuitem, gpointer user_data); +/* MENU SAVES */ +void on_loadstate1_activate (GtkMenuItem *, gpointer ); +void on_loadstate2_activate (GtkMenuItem *, gpointer ); +void on_loadstate3_activate (GtkMenuItem *, gpointer ); +void on_loadstate4_activate (GtkMenuItem *, gpointer ); +void on_loadstate5_activate (GtkMenuItem *, gpointer ); +void on_loadstate6_activate (GtkMenuItem *, gpointer ); +void on_loadstate7_activate (GtkMenuItem *, gpointer ); +void on_loadstate8_activate (GtkMenuItem *, gpointer ); +void on_loadstate9_activate (GtkMenuItem *, gpointer ); +void on_loadstate10_activate(GtkMenuItem *, gpointer ); + +void on_savestate1_activate (GtkMenuItem *, gpointer ); +void on_savestate2_activate (GtkMenuItem *, gpointer ); +void on_savestate3_activate (GtkMenuItem *, gpointer ); +void on_savestate4_activate (GtkMenuItem *, gpointer ); +void on_savestate5_activate (GtkMenuItem *, gpointer ); +void on_savestate6_activate (GtkMenuItem *, gpointer ); +void on_savestate7_activate (GtkMenuItem *, gpointer ); +void on_savestate8_activate (GtkMenuItem *, gpointer ); +void on_savestate9_activate (GtkMenuItem *, gpointer ); +void on_savestate10_activate(GtkMenuItem *, gpointer ); + + + + /* MENU EMULATION */ void on_menu_exec_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menu_pause_activate (GtkMenuItem *menuitem, gpointer user_data); diff --git a/trunk/desmume/src/gtk-glade/glade/DeSmuMe.glade b/trunk/desmume/src/gtk-glade/glade/DeSmuMe.glade index 1228921f7..15afbb31f 100755 --- a/trunk/desmume/src/gtk-glade/glade/DeSmuMe.glade +++ b/trunk/desmume/src/gtk-glade/glade/DeSmuMe.glade @@ -79,6 +79,265 @@ + + + True + _Saves + True + + + + + + + True + Load State + True + + + + + + + True + State 1 + True + False + + + + + + + + True + State 2 + True + False + + + + + + + + True + State 3 + True + False + + + + + + + + True + State 4 + True + False + + + + + + + + True + State 5 + True + False + + + + + + + + True + State 6 + True + False + + + + + + + + True + State 7 + True + False + + + + + + + + True + State 8 + True + False + + + + + + + + True + State 9 + True + False + + + + + + + + True + State 10 + True + False + + + + + + + + + + + + True + Save State + True + + + + + + + True + State 1 + True + False + + + + + + + + True + State 2 + True + False + + + + + + + + True + State 3 + True + False + + + + + + + + True + State 4 + True + False + + + + + + + + True + State 5 + True + False + + + + + + + + True + State 6 + True + False + + + + + + + + True + State 7 + True + False + + + + + + + + True + State 8 + True + False + + + + + + + + True + State 9 + True + False + + + + + + + + True + State 10 + True + False + + + + + + + + + + + + + True @@ -117,7 +376,7 @@ - + True gtk-refresh 1 @@ -154,7 +413,7 @@ True 0 True - True + False @@ -252,7 +511,7 @@ True 9 True - False + True fs0 @@ -276,7 +535,7 @@ True 1x True - True + False @@ -297,7 +556,7 @@ True 3x True - False + True size1x @@ -328,7 +587,7 @@ - + True gtk-preferences 1 @@ -349,7 +608,7 @@ - + True gtk-preferences 1 @@ -423,7 +682,7 @@ - + True gtk-properties 1 @@ -444,7 +703,7 @@ - + True gtk-properties 1 @@ -465,7 +724,7 @@ - + True gtk-properties 1 diff --git a/trunk/desmume/src/saves.c b/trunk/desmume/src/saves.c index 2ac83a9c4..d30b85df3 100644 --- a/trunk/desmume/src/saves.c +++ b/trunk/desmume/src/saves.c @@ -29,6 +29,26 @@ #define SAVESTATE_VERSION 010 +#ifndef MAX_PATH +#define MAX_PATH 256 +#endif + +void savestate_slot(int num) +{ + char filename[MAX_PATH]; + strcpy(filename, szRomBaseName); + sprintf(filename+strlen(filename), "%d.dst", num); + savestate_save(filename); +} + +void loadstate_slot(int num) +{ + char filename[MAX_PATH]; + strcpy(filename, szRomBaseName); + sprintf(filename+strlen(filename), "%d.dst", num); + savestate_load(filename); +} + u8 sram_read (u32 address) { address = address - SRAM_ADDRESS; diff --git a/trunk/desmume/src/saves.h b/trunk/desmume/src/saves.h index 4aa5ac455..d76a41824 100644 --- a/trunk/desmume/src/saves.h +++ b/trunk/desmume/src/saves.h @@ -37,6 +37,10 @@ extern "C" { int savestate_load (const char *file_name); int savestate_save (const char *file_name); + + void savestate_slot(int num); + void loadstate_slot(int num); + #ifdef __cplusplus } #endif diff --git a/trunk/desmume/src/windows/main.c b/trunk/desmume/src/windows/main.c index 876c80161..7d9168a7a 100644 --- a/trunk/desmume/src/windows/main.c +++ b/trunk/desmume/src/windows/main.c @@ -400,6 +400,20 @@ void NDS_UnPause() SPU_Pause(0); } +void StateSaveSlot(int num) +{ + NDS_Pause(); + savestate_slot + NDS_UnPause(); +} + +void StateLoadSlot(int num) +{ + NDS_Pause(); + loadstate_slot(num); + NDS_UnPause(); +} + BOOL LoadROM(char * filename) { NDS_Pause(); @@ -530,26 +544,6 @@ int WINAPI WinMain (HINSTANCE hThisInstance, return messages.wParam; } -void StateSaveSlot(int num) -{ - char filename[MAX_PATH]; - NDS_Pause(); - strcpy(filename, szRomBaseName); - sprintf(filename+strlen(filename), "%d.dst", num); - savestate_save(filename); - NDS_UnPause(); -} - -void StateLoadSlot(int num) -{ - char filename[MAX_PATH]; - NDS_Pause(); - strcpy(filename, szRomBaseName); - sprintf(filename+strlen(filename), "%d.dst", num); - savestate_load(filename); - NDS_UnPause(); -} - LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) // handle the messages