From 9d8d6d1f18e82470814247d89e8927a3f481e9f1 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Mon, 12 Aug 2019 00:32:33 +0800 Subject: [PATCH] NeoGeo: fix backup save/load. Move CD indexes to 1 and 2. --- menu.cpp | 2 +- support/neogeo/loader.cpp | 4 ++-- user_io.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/menu.cpp b/menu.cpp index fda9638..8c046ec 100644 --- a/menu.cpp +++ b/menu.cpp @@ -1607,7 +1607,7 @@ void HandleUI(void) // ElectronAsh. strcpy(SelectedPath + strlen(SelectedPath) - 3, "CUE"); printf("Checking for presence of CUE file %s\n", SelectedPath); - if (user_io_file_mount(SelectedPath, 1)) + if (user_io_file_mount(SelectedPath, 2)) { printf("CUE file found and mounted.\n"); parse_cue_file(); diff --git a/support/neogeo/loader.cpp b/support/neogeo/loader.cpp index f24ed24..231a068 100644 --- a/support/neogeo/loader.cpp +++ b/support/neogeo/loader.cpp @@ -984,11 +984,11 @@ int neogeo_romset_tx(char* name) printf("Enabled sprite gfx gap hack for kizuna\n"); set_config(3 << 28, 0xF << 28); } + notify_conf(); FileGenerateSavePath((system_type & 2) ? "ngcd" : name, (char*)full_path); - user_io_file_mount((char*)full_path, 2, 1); + user_io_file_mount((char*)full_path, 0, 1); - notify_conf(); user_io_8bit_set_status(0, 1); // Release reset return 1; diff --git a/user_io.cpp b/user_io.cpp index ccbe463..09bc3fc 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -1701,8 +1701,8 @@ int cue_pt = 0; char cue_getch() { static uint8_t buf[512]; - if (!(cue_pt & 0x1ff)) FileReadSec(&sd_image[1], buf); - if (cue_pt >= sd_image[1].size) return 0; + if (!(cue_pt & 0x1ff)) FileReadSec(&sd_image[2], buf); + if (cue_pt >= sd_image[2].size) return 0; return buf[(cue_pt++) & 0x1ff]; } @@ -2158,7 +2158,7 @@ void user_io_poll() //printf("SD RD %d on %d, WIDE=%d\n", lba, disk, fio_size); int done = 0; - if (is_neogeo_core()) + if (disk && is_neogeo_core()) { uint32_t offset = 0;