From eb6dfb4bfaaad1b70b63d982a67bed2229f129b5 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 3 Feb 2019 15:28:26 -0800 Subject: [PATCH] fix libretro build broken in 16dd5d40 #339 Conditionally compile out the code for the feature implemented in 16dd5d40 (which is the throttle and frame skip configuration for the speedup button) for libretro, and use the old behavior of skipping 9 frames. Affects GBA.cpp and GB.cpp . Signed-off-by: Rafael Kitover --- src/gb/GB.cpp | 10 ++++++++++ src/gba/GBA.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/gb/GB.cpp b/src/gb/GB.cpp index ef21cbaa..827f0283 100644 --- a/src/gb/GB.cpp +++ b/src/gb/GB.cpp @@ -4843,6 +4843,8 @@ void gbEmulate(int ticksToStop) if ((gbLcdTicksDelayed <= 0) && (gbLCDChangeHappened)) { int framesToSkip = systemFrameSkip; + +#ifndef __LIBRETRO__ static bool speedup_throttle_set = false; static uint32_t last_throttle; @@ -4868,6 +4870,10 @@ void gbEmulate(int ticksToStop) speedup_throttle_set = false; } +#else + if ((gbJoymask[0] >> 10) & 1) + framesToSkip = 9; +#endif //gbLcdTicksDelayed = gbLcdTicks+1; gbLCDChangeHappened = false; @@ -4946,7 +4952,11 @@ void gbEmulate(int ticksToStop) speedup = false; +#ifndef __LIBRETRO__ if (newmask & 1 && speedup_throttle == 0) +#else + if (newmask & 1) +#endif speedup = true; gbCapture = (newmask & 2) ? true : false; diff --git a/src/gba/GBA.cpp b/src/gba/GBA.cpp index 4d82165c..eb90a2aa 100644 --- a/src/gba/GBA.cpp +++ b/src/gba/GBA.cpp @@ -3756,6 +3756,8 @@ void CPULoop(int ticks) } } else { int framesToSkip = systemFrameSkip; + +#ifndef __LIBRETRO__ static bool speedup_throttle_set = false; static uint32_t last_throttle; @@ -3781,6 +3783,10 @@ void CPULoop(int ticks) speedup_throttle_set = false; } +#else + if ((joy >> 10) & 1) + framesToSkip = 9; +#endif if (DISPSTAT & 2) { // if in H-Blank, leave it and move to drawing mode @@ -3814,7 +3820,11 @@ void CPULoop(int ticks) speedup = false; +#ifndef __LIBRETRO__ if (ext & 1 && speedup_throttle == 0) +#else + if (ext & 1) +#endif speedup = true; capture = (ext & 2) ? true : false;