diff --git a/menu.cpp b/menu.cpp index 70eb396..554e285 100644 --- a/menu.cpp +++ b/menu.cpp @@ -2349,6 +2349,7 @@ void HandleUI(void) if (is_pce() && !bit) pcecd_reset(); if (is_saturn() && !bit) saturn_reset(); if (is_n64() && !bit) n64_reset(); + if (is_psx() && !bit) psx_reset(); user_io_status_set(opt, 1, ex); user_io_status_set(opt, 0, ex); diff --git a/support/psx/psx.cpp b/support/psx/psx.cpp index d4f6acd..e7e33a0 100644 --- a/support/psx/psx.cpp +++ b/support/psx/psx.cpp @@ -18,6 +18,7 @@ static char buf[1024]; static uint8_t *chd_hunkbuf = NULL; static int chd_hunknum; +static int noreset = 0; static int sgets(char *out, int sz, char **in) { @@ -710,12 +711,12 @@ void psx_mount_cd(int f_index, int s_index, const char *filename) if (!same_game) { - reset = 1; - if (old_len) + if (!noreset && old_len) { strcat(last_dir, "/noreset.txt"); - reset = !FileExists(last_dir); + noreset = FileExists(last_dir); } + reset = !noreset; strcpy(last_dir, filename); char *p = strrchr(last_dir, '/'); @@ -798,3 +799,8 @@ void psx_poll() { spi_uio_cmd(UIO_CD_GET); } + +void psx_reset() +{ + noreset = 0; +} \ No newline at end of file diff --git a/support/psx/psx.h b/support/psx/psx.h index 2ea5445..c68f7ff 100644 --- a/support/psx/psx.h +++ b/support/psx/psx.h @@ -7,5 +7,6 @@ void psx_read_cd(uint8_t *buffer, int lba, int cnt); int psx_chd_hunksize(); const char* psx_get_game_id(); void psx_poll(); +void psx_reset(); #endif