diff options
author | Jaedyn Draper | 2012-12-27 23:19:47 -0800 |
---|---|---|
committer | Jaedyn Draper | 2012-12-27 23:19:47 -0800 |
commit | 3fff289e60df73b25c483807f5cf73c011804117 (patch) | |
tree | d8a44c6256c2a7652b028525054e0e55d756ff15 /source/cpuexec.cpp | |
parent | 74211924afc184870627c90ce522c4c5743761db (diff) | |
parent | c01a2a42168695233ecc69c4a60ed918e7701fb9 (diff) | |
download | snes9x2005-3fff289e60df73b25c483807f5cf73c011804117.tar.gz snes9x2005-3fff289e60df73b25c483807f5cf73c011804117.tar.bz2 snes9x2005-3fff289e60df73b25c483807f5cf73c011804117.zip |
Merge pull request #26 from Nebuleon/master
Merge to CATSFC 1.10+
Diffstat (limited to 'source/cpuexec.cpp')
-rw-r--r-- | source/cpuexec.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/cpuexec.cpp b/source/cpuexec.cpp index 21b1574..66bb8da 100644 --- a/source/cpuexec.cpp +++ b/source/cpuexec.cpp @@ -105,6 +105,10 @@ #include "sa1.h" #include "spc7110.h" +#ifdef SYNC_JOYPAD_AT_HBLANK +#include "display.h" +#endif + extern void S9xProcessSound (unsigned int); void S9xMainLoop (void) @@ -167,9 +171,9 @@ void S9xMainLoop (void) DO_HBLANK_CHECK(); } - Registers.PC = CPU.PC - CPU.PCBase; + ICPU.Registers.PC = CPU.PC - CPU.PCBase; S9xPackStatus (); - APURegisters.PC = IAPU.PC - IAPU.RAM; + IAPU.Registers.PC = IAPU.PC - IAPU.RAM; S9xAPUPackStatus (); if (CPU.Flags & SCAN_KEYS_FLAG) { @@ -226,6 +230,16 @@ void S9xDoHBlankProcessing () switch (CPU.WhichEvent) { case HBLANK_START_EVENT: +#ifdef SYNC_JOYPAD_AT_HBLANK + // Re-get the controls every hblank. A resolution algorithm in + // ppu.cpp will determine with greater accuracy whether a key was + // pressed or released during the frame. + uint32 i; + for (i = 0; i < 5; i++) + { + IPPU.JoypadsAtHBlanks [i][CPU.V_Counter] = S9xReadJoypad (i); + } +#endif if (IPPU.HDMA && CPU.V_Counter <= PPU.ScreenHeight) IPPU.HDMA = S9xDoHDMA (IPPU.HDMA); |