if (currentConfig.EmuOpt & EOPT_EN_SRAM)\r
emu_save_load_game(1, 1);\r
\r
+ // state autoload?\r
+ if (g_autostateld_opt) {\r
+ int time, newest = 0, newest_slot = -1;\r
+ int slot;\r
+\r
+ for (slot = 0; slot < 10; slot++) {\r
+ if (emu_check_save_file(slot, &time)) {\r
+ if (time > newest) {\r
+ newest = time;\r
+ newest_slot = slot;\r
+ }\r
+ }\r
+ }\r
+\r
+ if (newest_slot >= 0) {\r
+ lprintf("autoload slot %d\n", newest_slot);\r
+ state_slot = newest_slot;\r
+ emu_save_load_game(1, 0);\r
+ }\r
+ else {\r
+ lprintf("no save to autoload.\n");\r
+ }\r
+ }\r
+\r
retval = 1;\r
out:\r
if (menu_romload_started)\r
}\r
}\r
\r
-static int try_ropen_file(const char *fname)\r
+static int try_ropen_file(const char *fname, int *time)\r
{\r
+ struct stat st;\r
FILE *f;\r
\r
f = fopen(fname, "rb");\r
if (f) {\r
+ if (time != NULL) {\r
+ *time = 0;\r
+ if (fstat(fileno(f), &st) == 0)\r
+ *time = (int)st.st_mtime;\r
+ }\r
fclose(f);\r
return 1;\r
}\r
return 0;\r
}\r
\r
-char *emu_get_save_fname(int load, int is_sram, int slot)\r
+char *emu_get_save_fname(int load, int is_sram, int slot, int *time)\r
{\r
char *saveFname = static_buff;\r
char ext[16];\r
if (!load)\r
return saveFname;\r
\r
- if (try_ropen_file(saveFname))\r
+ if (try_ropen_file(saveFname, time))\r
return saveFname;\r
\r
romfname_ext(saveFname, sizeof(static_buff), NULL, ext);\r
- if (try_ropen_file(saveFname))\r
+ if (try_ropen_file(saveFname, time))\r
return saveFname;\r
}\r
else\r
}\r
else {\r
romfname_ext(saveFname, sizeof(static_buff), "mds" PATH_SEP, ext);\r
- if (try_ropen_file(saveFname))\r
+ if (try_ropen_file(saveFname, time))\r
return saveFname;\r
\r
romfname_ext(saveFname, sizeof(static_buff), NULL, ext);\r
- if (try_ropen_file(saveFname))\r
+ if (try_ropen_file(saveFname, time))\r
return saveFname;\r
\r
// try the other ext\r
strcat(ext, ext_othr);\r
\r
romfname_ext(saveFname, sizeof(static_buff), "mds"PATH_SEP, ext);\r
- if (try_ropen_file(saveFname))\r
+ if (try_ropen_file(saveFname, time))\r
return saveFname;\r
}\r
}\r
\r
int emu_check_save_file(int slot, int *time)\r
{\r
- return emu_get_save_fname(1, 0, slot) ? 1 : 0;\r
+ return emu_get_save_fname(1, 0, slot, time) ? 1 : 0;\r
}\r
\r
int emu_save_load_game(int load, int sram)\r
char *saveFname;\r
\r
// make save filename\r
- saveFname = emu_get_save_fname(load, sram, state_slot);\r
+ saveFname = emu_get_save_fname(load, sram, state_slot, NULL);\r
if (saveFname == NULL) {\r
if (!sram)\r
emu_status_msg(load ? "LOAD FAILED (missing file)" : "SAVE FAILED");\r
int emu_read_config(const char *rom_fname, int no_defaults);
int emu_write_config(int game);
-char *emu_get_save_fname(int load, int is_sram, int slot);
+char *emu_get_save_fname(int load, int is_sram, int slot, int *time);
int emu_check_save_file(int slot, int *time);
void emu_text_out8 (int x, int y, const char *text);
const char *fname;
void *tmp_state;
- fname = emu_get_save_fname(1, 0, slot);
+ fname = emu_get_save_fname(1, 0, slot, NULL);
if (!fname)
return;
static menu_entry e_menu_hidden[] =
{
mee_onoff("Accurate sprites", MA_OPT_ACC_SPRITES, PicoOpt, 0x080),
+ mee_onoff("autoload savestates", MA_OPT_AUTOLOAD_SAVE, g_autostateld_opt, 1),
mee_end,
};
MA_OPT_ROTATION, /* uiq */
MA_OPT_TEARING_FIX, /* wiz */
MA_OPT_VOUT_MODE,
+ MA_OPT_AUTOLOAD_SAVE,
MA_OPT2_GAMMA,
MA_OPT2_A_SN_GAMMA,
MA_OPT2_DBLBUFF, /* giz */
-Subproject commit 7ceadd9993ea84078e9d74d79215419e06496f90
+Subproject commit 9089665ca1260c338c4239583f59de981bc80c1c
{ KEY_D, IN_BINDTYPE_PLAYER12, GBTN_C },\r
{ KEY_ENTER, IN_BINDTYPE_PLAYER12, GBTN_START },\r
{ KEY_F, IN_BINDTYPE_EMU, PEVB_FF },\r
- { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU },\r
+ { KEY_BACKSPACE,IN_BINDTYPE_EMU, PEVB_FF },\r
+ { KEY_BACKSLASH,IN_BINDTYPE_EMU, PEVB_MENU },\r
{ KEY_SPACE, IN_BINDTYPE_EMU, PEVB_MENU },\r
- /* Pandora */\r
+ { KEY_LEFTCTRL, IN_BINDTYPE_EMU, PEVB_MENU },\r
{ KEY_HOME, IN_BINDTYPE_PLAYER12, GBTN_A },\r
{ KEY_PAGEDOWN, IN_BINDTYPE_PLAYER12, GBTN_B },\r
{ KEY_END, IN_BINDTYPE_PLAYER12, GBTN_C },\r
{ KEY_LEFTALT, IN_BINDTYPE_PLAYER12, GBTN_START },\r
- { KEY_RIGHTSHIFT,IN_BINDTYPE_EMU, PEVB_STATE_SAVE },\r
- { KEY_RIGHTCTRL, IN_BINDTYPE_EMU, PEVB_STATE_LOAD },\r
- { KEY_LEFTCTRL, IN_BINDTYPE_EMU, PEVB_MENU },\r
+ { KEY_1, IN_BINDTYPE_EMU, PEVB_STATE_SAVE },\r
+ { KEY_2, IN_BINDTYPE_EMU, PEVB_STATE_LOAD },\r
+ { KEY_3, IN_BINDTYPE_EMU, PEVB_SSLOT_PREV },\r
+ { KEY_4, IN_BINDTYPE_EMU, PEVB_SSLOT_NEXT },\r
+ { KEY_5, IN_BINDTYPE_EMU, PEVB_PICO_PPREV },\r
+ { KEY_6, IN_BINDTYPE_EMU, PEVB_PICO_PNEXT },\r
+ { KEY_7, IN_BINDTYPE_EMU, PEVB_PICO_SWINP },\r
{ 0, 0, 0 }\r
};\r
\r