aboutsummaryrefslogtreecommitdiff
path: root/source/cpuexec.c
diff options
context:
space:
mode:
authoraliaspider2014-11-02 11:44:50 +0100
committeraliaspider2014-11-02 11:44:50 +0100
commit3564bfe8134ce6e1294a59212484e9ee487ab4f5 (patch)
tree40377a14f396f377946c7ee4dad4d22fa470d441 /source/cpuexec.c
parent4446c4cbf34cb8c16d255d2a498245a97dcdadc3 (diff)
downloadsnes9x2005-3564bfe8134ce6e1294a59212484e9ee487ab4f5.tar.gz
snes9x2005-3564bfe8134ce6e1294a59212484e9ee487ab4f5.tar.bz2
snes9x2005-3564bfe8134ce6e1294a59212484e9ee487ab4f5.zip
start hooking up blargg's apu implementation to use as a reference.
(not yet working)
Diffstat (limited to 'source/cpuexec.c')
-rw-r--r--source/cpuexec.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/cpuexec.c b/source/cpuexec.c
index ccd38ff..2c1b67a 100644
--- a/source/cpuexec.c
+++ b/source/cpuexec.c
@@ -203,8 +203,10 @@ void S9xMainLoop_SA1_SFX(void)
ICPU.Registers.PC = CPU.PC - CPU.PCBase;
S9xPackStatus();
+#ifndef USE_BLARGG_APU
IAPU.Registers.PC = IAPU.PC - IAPU.RAM;
S9xAPUPackStatus();
+#endif
if (CPU.Flags & SCAN_KEYS_FLAG)
{
S9xSyncSpeed();
@@ -287,8 +289,10 @@ void S9xMainLoop_SA1_NoSFX(void)
ICPU.Registers.PC = CPU.PC - CPU.PCBase;
S9xPackStatus();
+#ifndef USE_BLARGG_APU
IAPU.Registers.PC = IAPU.PC - IAPU.RAM;
S9xAPUPackStatus();
+#endif
if (CPU.Flags & SCAN_KEYS_FLAG)
{
S9xSyncSpeed();
@@ -360,8 +364,10 @@ void S9xMainLoop_NoSA1_SFX(void)
ICPU.Registers.PC = CPU.PC - CPU.PCBase;
S9xPackStatus();
+#ifndef USE_BLARGG_APU
IAPU.Registers.PC = IAPU.PC - IAPU.RAM;
S9xAPUPackStatus();
+#endif
if (CPU.Flags & SCAN_KEYS_FLAG)
{
S9xSyncSpeed();
@@ -442,8 +448,10 @@ void S9xMainLoop_NoSA1_NoSFX(void)
ICPU.Registers.PC = CPU.PC - CPU.PCBase;
S9xPackStatus();
+#ifndef USE_BLARGG_APU
IAPU.Registers.PC = IAPU.PC - IAPU.RAM;
S9xAPUPackStatus();
+#endif
if (CPU.Flags & SCAN_KEYS_FLAG)
{
S9xSyncSpeed();
@@ -504,6 +512,7 @@ void S9xDoHBlankProcessing_SFX()
case HBLANK_END_EVENT:
S9xSuperFXExec();
+#ifndef USE_BLARGG_APU
#ifndef STORM
if (Settings.SoundSync)
S9xGenerateSound();
@@ -519,7 +528,11 @@ void S9xDoHBlankProcessing_SFX()
}
else
APU.Cycles = 0;
-
+#else
+ S9xAPUExecute();
+ CPU.Cycles -= Settings.H_Max;
+ S9xAPUSetReferenceTime(CPU.Cycles);
+#endif
CPU.NextEvent = -1;
ICPU.Scanline++;