Fix Chou Aniki. Remove hack.

This commit is contained in:
Brandon Wright 2019-03-09 17:16:54 -06:00
parent 28a62e9bf2
commit e854a759f8
5 changed files with 14 additions and 11 deletions

View File

@ -24,9 +24,14 @@ void S9xMainLoop (void)
#define CHECK_FOR_IRQ_CHANGE() \
if (Timings.IRQFlagChanging) \
{ \
if (Timings.IRQFlagChanging == IRQ_CLEAR_FLAG) \
if (Timings.IRQFlagChanging & IRQ_TRIGGER_NMI) \
{ \
CPU.NMIPending = TRUE; \
Timings.NMITriggerPos = CPU.Cycles + 6; \
} \
if (Timings.IRQFlagChanging & IRQ_CLEAR_FLAG) \
ClearIRQ(); \
else if (Timings.IRQFlagChanging == IRQ_SET_FLAG) \
else if (Timings.IRQFlagChanging & IRQ_SET_FLAG) \
SetIRQ(); \
Timings.IRQFlagChanging = IRQ_NONE; \
}

View File

@ -1452,7 +1452,7 @@ static void Op58 (void)
AddCycles(ONE_CYCLE);
#ifndef SA1_OPCODES
Timings.IRQFlagChanging = IRQ_CLEAR_FLAG;
Timings.IRQFlagChanging |= IRQ_CLEAR_FLAG;
#else
ClearIRQ();
#endif
@ -1464,7 +1464,7 @@ static void Op78 (void)
AddCycles(ONE_CYCLE);
#ifndef SA1_OPCODES
Timings.IRQFlagChanging = IRQ_SET_FLAG;
Timings.IRQFlagChanging |= IRQ_SET_FLAG;
#else
SetIRQ();
#endif

View File

@ -3614,8 +3614,6 @@ void CMemory::ApplyROMFixes (void)
{
//if (match_id("AVCJ")) // Rendering Ranger R2
// Timings.APUSpeedup = 2;
if (match_id("AANJ")) // Chou Aniki
Timings.APUSpeedup = -3;
if (match_na("CIRCUIT USA"))
Timings.APUSpeedup = 3;

View File

@ -1403,8 +1403,7 @@ void S9xSetCPU (uint8 Byte, uint16 Address)
{
// FIXME: triggered at HC+=6, checked just before the final CPU cycle,
// then, when to call S9xOpcode_NMI()?
CPU.NMIPending = TRUE;
Timings.NMITriggerPos = CPU.Cycles + 6 + 6;
Timings.IRQFlagChanging |= IRQ_TRIGGER_NMI;
#ifdef DEBUGGER
if (Settings.TraceHCEvent)

View File

@ -157,9 +157,10 @@ enum
enum
{
IRQ_NONE = 0,
IRQ_SET_FLAG = 1,
IRQ_CLEAR_FLAG = 2
IRQ_NONE = 0x0,
IRQ_SET_FLAG = 0x1,
IRQ_CLEAR_FLAG = 0x2,
IRQ_TRIGGER_NMI = 0x4
};
struct STimings