aboutsummaryrefslogtreecommitdiff
path: root/source/cpuexec.c
diff options
context:
space:
mode:
authoraliaspider2014-11-03 11:11:05 +0100
committeraliaspider2014-11-03 11:11:05 +0100
commit7077e9821593b2c9b78830c4cc5055c6a79cdd69 (patch)
tree615195d3db586f5542eddd0cbd17e46e816f954b /source/cpuexec.c
parent3564bfe8134ce6e1294a59212484e9ee487ab4f5 (diff)
downloadsnes9x2005-7077e9821593b2c9b78830c4cc5055c6a79cdd69.tar.gz
snes9x2005-7077e9821593b2c9b78830c4cc5055c6a79cdd69.tar.bz2
snes9x2005-7077e9821593b2c9b78830c4cc5055c6a79cdd69.zip
can build with USE_BLARGG_APU enabled, still not working.
Diffstat (limited to 'source/cpuexec.c')
-rw-r--r--source/cpuexec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/cpuexec.c b/source/cpuexec.c
index 2c1b67a..ce2d5c3 100644
--- a/source/cpuexec.c
+++ b/source/cpuexec.c
@@ -612,6 +612,8 @@ void S9xDoHBlankProcessing_SFX()
if (CPU.V_Counter >= FIRST_VISIBLE_LINE &&
CPU.V_Counter < PPU.ScreenHeight + FIRST_VISIBLE_LINE)
RenderLine(CPU.V_Counter - FIRST_VISIBLE_LINE);
+
+#ifndef USE_BLARGG_APU
// Use TimerErrorCounter to skip update of SPC700 timers once
// every 128 updates. Needed because this section of code is called
// once every emulated 63.5 microseconds, which coresponds to
@@ -665,6 +667,7 @@ void S9xDoHBlankProcessing_SFX()
}
}
}
+#endif // #ifndef USE_BLARGG_APU
break;
case HTIMER_BEFORE_EVENT:
@@ -700,6 +703,7 @@ void S9xDoHBlankProcessing_NoSFX()
case HBLANK_END_EVENT:
+#ifndef USE_BLARGG_APU
#ifndef STORM
if (Settings.SoundSync)
S9xGenerateSound();
@@ -715,6 +719,11 @@ void S9xDoHBlankProcessing_NoSFX()
}
else
APU.Cycles = 0;
+#else
+ S9xAPUExecute();
+ CPU.Cycles -= Settings.H_Max;
+ S9xAPUSetReferenceTime(CPU.Cycles);
+#endif
CPU.NextEvent = -1;
ICPU.Scanline++;
@@ -804,6 +813,7 @@ void S9xDoHBlankProcessing_NoSFX()
// if (IAPU.TimerErrorCounter >= )
// IAPU.TimerErrorCounter = 0;
// else
+#ifndef USE_BLARGG_APU
{
if (APU.TimerEnabled [2])
{
@@ -848,6 +858,7 @@ void S9xDoHBlankProcessing_NoSFX()
}
}
}
+#endif
break;
case HTIMER_BEFORE_EVENT: