From 105bbba8885a54e6f1d1d3d85a134df2ebda1a1b Mon Sep 17 00:00:00 2001 From: Zach Bacon Date: Tue, 21 Mar 2017 21:52:28 -0400 Subject: [PATCH] Almost there, just a few more blocks to go. --- src/gba/Cheats.h | 4 ++++ src/gba/GBA-arm.cpp | 4 ++++ src/gba/GBA-thumb.cpp | 4 ++++ src/gba/GBA.cpp | 4 ++++ src/libretro/UtilRetro.cpp | 22 ++++++++++++++++++++++ src/libretro/UtilRetro.h | 18 ++++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 src/libretro/UtilRetro.h diff --git a/src/gba/Cheats.h b/src/gba/Cheats.h index 0c6f5f2b..fc85a24f 100644 --- a/src/gba/Cheats.h +++ b/src/gba/Cheats.h @@ -1,7 +1,11 @@ #ifndef CHEATS_H #define CHEATS_H +#ifndef __LIBRETRO__ #include "../common/ConfigManager.h" +#else +#include "../src/libretro/Utilretro.h" +#endif struct CheatsData { int code; diff --git a/src/gba/GBA-arm.cpp b/src/gba/GBA-arm.cpp index de6674f0..6c4db570 100644 --- a/src/gba/GBA-arm.cpp +++ b/src/gba/GBA-arm.cpp @@ -7,7 +7,11 @@ #include "../NLS.h" #include "../System.h" #include "../Util.h" +#ifndef __LIBRETRO__ #include "../common/ConfigManager.h" +#else +#include "../src/libretro/Utilretro.h" +#endif #include "Cheats.h" #include "EEprom.h" #include "Flash.h" diff --git a/src/gba/GBA-thumb.cpp b/src/gba/GBA-thumb.cpp index e9853c29..4dc9f3ea 100644 --- a/src/gba/GBA-thumb.cpp +++ b/src/gba/GBA-thumb.cpp @@ -10,7 +10,11 @@ #include "../NLS.h" #include "../System.h" #include "../Util.h" +#ifndef __LIBRETRO__ #include "../common/ConfigManager.h" +#else +#include "../src/libretro/Utilretro.h" +#endif #include "Cheats.h" #include "EEprom.h" #include "Flash.h" diff --git a/src/gba/GBA.cpp b/src/gba/GBA.cpp index b41985d9..67ae4644 100644 --- a/src/gba/GBA.cpp +++ b/src/gba/GBA.cpp @@ -10,7 +10,11 @@ #include "../NLS.h" #include "../System.h" #include "../Util.h" +#ifndef __LIBRETRO__ #include "../common/ConfigManager.h" +#else +#include "../src/libretro/Utilretro.h" +#endif #include "../common/Port.h" #include "Cheats.h" #include "EEprom.h" diff --git a/src/libretro/UtilRetro.cpp b/src/libretro/UtilRetro.cpp index 7f3e41db..7c7fc43d 100644 --- a/src/libretro/UtilRetro.cpp +++ b/src/libretro/UtilRetro.cpp @@ -14,6 +14,8 @@ #include "gb/gbGlobals.h" #include "gba/gbafilter.h" +#include "UtilRetro.h" + #ifndef _MSC_VER #include #define _stricmp strcasecmp @@ -24,6 +26,26 @@ extern int systemRedShift; extern int systemGreenShift; extern int systemBlueShift; +// Because Configmanager was introduced, this has to be done. + +const char* loadDotCodeFile; +const char* saveDotCodeFile; + +int cheatsEnabled = true; +int saveType = 0; +int rtcEnabled; +int frameSkip = 1; +bool speedup = false; +bool cpuIsMultiBoot = false; +bool parseDebug = true; +int layerSettings = 0xff00; +int layerEnable = 0xff00; +bool speedHack = false; +int cpuSaveType = 0; +bool mirroringEnable = true; +bool skipSaveGameBattery = false; +bool skipSaveGameCheats = false; + extern uint16_t systemColorMap16[0x10000]; extern uint32_t systemColorMap32[0x10000]; diff --git a/src/libretro/UtilRetro.h b/src/libretro/UtilRetro.h new file mode 100644 index 00000000..b2b2199a --- /dev/null +++ b/src/libretro/UtilRetro.h @@ -0,0 +1,18 @@ +extern bool speedup; +extern int cheatsEnabled; +extern int useBios; +extern int skipBios; +extern int synchronize; +extern int cpuDisableSfx; +extern bool cpuIsMultiBoot; +extern bool parseDebug; +extern bool speedHack; +extern bool mirroringEnable; +extern int rtcEnabled; + +extern const char *loadDotCodeFile; +extern const char *saveDotCodeFile; + +extern bool skipSaveGameBattery; +extern bool skipSaveGameCheats; +#define MAX_CHEATS 100