From 795f7a171db557c625fb72bca997bc8c75d9c49a Mon Sep 17 00:00:00 2001 From: sorgelig Date: Sun, 26 Apr 2020 21:47:57 +0800 Subject: [PATCH] pcecd: fix the cheats. --- cheats.cpp | 4 +++- menu.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cheats.cpp b/cheats.cpp index 14fca17..e914829 100644 --- a/cheats.cpp +++ b/cheats.cpp @@ -15,6 +15,7 @@ #include "miniz_zip.h" #include "osd.h" #include "cheats.h" +#include "support.h" struct cheat_rec_t { @@ -110,9 +111,10 @@ void cheats_init(const char *rom_path, uint32_t romcrc) const char *rom_name = strrchr(rom_path, '/'); if (rom_name) { - sprintf(cheat_zip, "%s/cheats/%s%s", getRootDir(), CoreName, rom_name); + sprintf(cheat_zip, "%s/cheats/%s%s%s", getRootDir(), CoreName, pcecd_using_cd() ? "CD" : "", rom_name); char *p = strrchr(cheat_zip, '.'); if (p) *p = 0; + if(pcecd_using_cd()) strcat(cheat_zip, " []"); strcat(cheat_zip, ".zip"); if (!mz_zip_reader_init_file(&_z, cheat_zip, 0)) diff --git a/menu.cpp b/menu.cpp index 270198f..924c7b1 100644 --- a/menu.cpp +++ b/menu.cpp @@ -1744,7 +1744,7 @@ void HandleUI(void) } user_io_store_filename(SelectedPath); user_io_file_tx(SelectedPath, user_io_ext_idx(SelectedPath, fs_pFileExt) << 6 | ioctl_index, opensave); - if (user_io_use_cheats()) cheats_init(SelectedPath, pcecd_using_cd() ? 0 : user_io_get_file_crc()); + if (user_io_use_cheats()) cheats_init(SelectedPath, user_io_get_file_crc()); menustate = MENU_NONE1; } @@ -1771,6 +1771,7 @@ void HandleUI(void) else if (is_pce()) { pcecd_set_image(ioctl_index, SelectedPath); + cheats_init(SelectedPath, 0); } else {