From f45b2b5babac1770080a9b2ffb555268783af931 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Wed, 9 Feb 2022 21:14:47 +0800 Subject: [PATCH] PSX: highlight current save file in browser. --- menu.cpp | 4 ++-- menu.h | 4 ++-- support/psx/psx.cpp | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/menu.cpp b/menu.cpp index f8a4425..5921c6d 100644 --- a/menu.cpp +++ b/menu.cpp @@ -299,12 +299,12 @@ static char Selected_F[16][1024] = {}; static char Selected_S[16][1024] = {}; static char Selected_tmp[1024] = {}; -void StoreIdx_F(int idx, char *path) +void StoreIdx_F(int idx, const char *path) { strcpy(Selected_F[idx], path); } -void StoreIdx_S(int idx, char *path) +void StoreIdx_S(int idx, const char *path) { strcpy(Selected_S[idx], path); } diff --git a/menu.h b/menu.h index c57a855..19a5960 100644 --- a/menu.h +++ b/menu.h @@ -26,7 +26,7 @@ void open_joystick_setup(); int menu_lightgun_cb(int idx, uint16_t type, uint16_t code, int value); int menu_allow_cfg_switch(); -void StoreIdx_F(int idx, char *path); -void StoreIdx_S(int idx, char *path); +void StoreIdx_F(int idx, const char *path); +void StoreIdx_S(int idx, const char *path); #endif diff --git a/support/psx/psx.cpp b/support/psx/psx.cpp index c2003f2..4ecd533 100644 --- a/support/psx/psx.cpp +++ b/support/psx/psx.cpp @@ -188,11 +188,16 @@ static void psx_mount_save(const char *filename) if (FileExists(buf)) { user_io_file_mount(buf, 2); + StoreIdx_S(2, buf); mounted = 1; } } - if(!mounted) user_io_file_mount("", 2); + if (!mounted) + { + user_io_file_mount("", 2); + StoreIdx_S(2, ""); + } user_io_set_download(0); }