X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fmenu.c;h=d3e16a42fd4f0ea2250e7281759134c9f456f9ae;hp=5fe86adeca6639d872fb9eeb56b89e2ba7723dbf;hb=89c0de4234815e0fa9e8399b940ecec6c89a062b;hpb=9fe27e257939224d5a85975dee39f63f50b7e3dc diff --git a/frontend/menu.c b/frontend/menu.c index 5fe86ade..d3e16a42 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -13,6 +13,9 @@ #include #include #include +#include +#include +#include #include "main.h" #include "menu.h" @@ -34,6 +37,8 @@ #include "../plugins/dfinput/main.h" #include "revision.h" +#define REARMED_BIRTHDAY_TIME 1293306830 /* 25 Dec 2010 */ + #define array_size(x) (sizeof(x) / sizeof(x[0])) typedef enum @@ -124,10 +129,30 @@ void emu_make_path(char *buff, const char *end, int size) printf("Warning: path truncated: %s\n", buff); } -static int emu_check_save_file(int slot) +static int emu_check_save_file(int slot, int *time) { - int ret = emu_check_state(slot); - return ret == 0 ? 1 : 0; + char fname[MAXPATHLEN]; + struct stat status; + int ret; + + ret = emu_check_state(slot); + if (ret != 0 || time == NULL) + return ret == 0 ? 1 : 0; + + ret = get_state_filename(fname, sizeof(fname), slot); + if (ret != 0) + return 1; + + ret = stat(fname, &status); + if (ret != 0) + return 1; + + if (status.st_mtime < REARMED_BIRTHDAY_TIME) + return 1; // probably bad rtc like on some Caanoos + + *time = status.st_mtime; + + return 1; } static int emu_save_load_game(int load, int unused) @@ -258,6 +283,7 @@ static const struct { CE_INTVAL_V(frameskip, 3), CE_INTVAL_P(gpu_peops.iUseDither), CE_INTVAL_P(gpu_peops.dwActFixes), + CE_INTVAL_P(gpu_unai.lineskip), CE_INTVAL_P(gpu_unai.abe_hack), CE_INTVAL_P(gpu_unai.no_light), CE_INTVAL_P(gpu_unai.no_blend), @@ -1166,6 +1192,7 @@ static int menu_loop_gfx_options(int id, int keys) static menu_entry e_menu_plugin_gpu_unai[] = { + mee_onoff ("Skip every 2nd line", 0, pl_rearmed_cbs.gpu_unai.lineskip, 1), mee_onoff ("Abe's Odyssey hack", 0, pl_rearmed_cbs.gpu_unai.abe_hack, 1), mee_onoff ("Disable lighting", 0, pl_rearmed_cbs.gpu_unai.no_light, 1), mee_onoff ("Disable blending", 0, pl_rearmed_cbs.gpu_unai.no_blend, 1),