Unverified Commit eb6dfb4b authored by Rafael Kitover's avatar Rafael Kitover
Browse files

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: default avatarRafael Kitover <rkitover@gmail.com>
parent 16dd5d40
...@@ -4843,6 +4843,8 @@ void gbEmulate(int ticksToStop) ...@@ -4843,6 +4843,8 @@ void gbEmulate(int ticksToStop)
if ((gbLcdTicksDelayed <= 0) && (gbLCDChangeHappened)) { if ((gbLcdTicksDelayed <= 0) && (gbLCDChangeHappened)) {
int framesToSkip = systemFrameSkip; int framesToSkip = systemFrameSkip;
#ifndef __LIBRETRO__
static bool speedup_throttle_set = false; static bool speedup_throttle_set = false;
static uint32_t last_throttle; static uint32_t last_throttle;
...@@ -4868,6 +4870,10 @@ void gbEmulate(int ticksToStop) ...@@ -4868,6 +4870,10 @@ void gbEmulate(int ticksToStop)
speedup_throttle_set = false; speedup_throttle_set = false;
} }
#else
if ((gbJoymask[0] >> 10) & 1)
framesToSkip = 9;
#endif
//gbLcdTicksDelayed = gbLcdTicks+1; //gbLcdTicksDelayed = gbLcdTicks+1;
gbLCDChangeHappened = false; gbLCDChangeHappened = false;
...@@ -4946,7 +4952,11 @@ void gbEmulate(int ticksToStop) ...@@ -4946,7 +4952,11 @@ void gbEmulate(int ticksToStop)
speedup = false; speedup = false;
#ifndef __LIBRETRO__
if (newmask & 1 && speedup_throttle == 0) if (newmask & 1 && speedup_throttle == 0)
#else
if (newmask & 1)
#endif
speedup = true; speedup = true;
gbCapture = (newmask & 2) ? true : false; gbCapture = (newmask & 2) ? true : false;
......
...@@ -3756,6 +3756,8 @@ void CPULoop(int ticks) ...@@ -3756,6 +3756,8 @@ void CPULoop(int ticks)
} }
} else { } else {
int framesToSkip = systemFrameSkip; int framesToSkip = systemFrameSkip;
#ifndef __LIBRETRO__
static bool speedup_throttle_set = false; static bool speedup_throttle_set = false;
static uint32_t last_throttle; static uint32_t last_throttle;
...@@ -3781,6 +3783,10 @@ void CPULoop(int ticks) ...@@ -3781,6 +3783,10 @@ void CPULoop(int ticks)
speedup_throttle_set = false; speedup_throttle_set = false;
} }
#else
if ((joy >> 10) & 1)
framesToSkip = 9;
#endif
if (DISPSTAT & 2) { if (DISPSTAT & 2) {
// if in H-Blank, leave it and move to drawing mode // if in H-Blank, leave it and move to drawing mode
...@@ -3814,7 +3820,11 @@ void CPULoop(int ticks) ...@@ -3814,7 +3820,11 @@ void CPULoop(int ticks)
speedup = false; speedup = false;
#ifndef __LIBRETRO__
if (ext & 1 && speedup_throttle == 0) if (ext & 1 && speedup_throttle == 0)
#else
if (ext & 1)
#endif
speedup = true; speedup = true;
capture = (ext & 2) ? true : false; capture = (ext & 2) ? true : false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment