mirror of
https://github.com/MiSTer-devel/Main_MiSTer.git
synced 2026-04-12 03:04:02 +00:00
PSX: Persistent noreset.txt state until core is reset or reloaded. (#1046)
Co-authored-by: Bemjo <Bemjo@users.noreply.github.com>
This commit is contained in:
1
menu.cpp
1
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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user