From 27fa30b43ca0a8d60860f1cc78f57c7be495903a Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Wed, 13 Jun 2018 22:49:26 +0800 Subject: [PATCH] Libretro: Disable cheats by default, update to bios loading Minor rework on how bios is loaded when CPUInit is called, removes a few conditions. Disable cheats by default. This is automatically re-enabled when enabling and applying cheats. Should save a few cycles during runtime if cheats are not needed. --- src/libretro/UtilRetro.cpp | 2 +- src/libretro/libretro.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libretro/UtilRetro.cpp b/src/libretro/UtilRetro.cpp index a9daa0f4..f2e13e71 100644 --- a/src/libretro/UtilRetro.cpp +++ b/src/libretro/UtilRetro.cpp @@ -29,7 +29,7 @@ int cpuSaveType = 0; int skipSaveGameBattery = 0; int skipSaveGameCheats = 0; int useBios = 0; -int cheatsEnabled = 1; +int cheatsEnabled = 0; int layerSettings = 0xff00; int layerEnable = 0xff00; bool speedup = false; diff --git a/src/libretro/libretro.cpp b/src/libretro/libretro.cpp index 3400117a..54f1f39d 100644 --- a/src/libretro/libretro.cpp +++ b/src/libretro/libretro.cpp @@ -475,10 +475,7 @@ static void gba_init(void) soundInit(); soundSetSampleRate(32000); - if (usebios && biosfile[0]) - CPUInit(biosfile, true); - else - CPUInit(0, false); + CPUInit(biosfile, usebios); CPUReset(); @@ -654,6 +651,7 @@ bool retro_unserialize(const void* data, size_t size) void retro_cheat_reset(void) { + cheatsEnabled = 1; cheatsDeleteAll(false); }