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:
Bemjo
2025-10-14 08:01:01 -06:00
committed by GitHub
parent 75f567e96d
commit 4e2e950237
3 changed files with 11 additions and 3 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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