mirror of https://github.com/snes9xgit/snes9x.git
Fix reset of NMI pending flag.
This commit is contained in:
parent
b9dd7021cf
commit
070d5e5dbf
2
cpu.cpp
2
cpu.cpp
|
@ -227,7 +227,7 @@ static void S9xSoftResetCPU (void)
|
|||
CPU.V_Counter = 0;
|
||||
CPU.Flags = CPU.Flags & (DEBUG_MODE_FLAG | TRACE_FLAG);
|
||||
CPU.PCBase = NULL;
|
||||
CPU.NMILine = FALSE;
|
||||
CPU.NMIPending = FALSE;
|
||||
CPU.IRQLine = FALSE;
|
||||
CPU.IRQTransition = FALSE;
|
||||
CPU.IRQLastState = FALSE;
|
||||
|
|
|
@ -209,11 +209,11 @@ void S9xMainLoop (void)
|
|||
{
|
||||
for (;;)
|
||||
{
|
||||
if (CPU.NMILine)
|
||||
if (CPU.NMIPending)
|
||||
{
|
||||
if (Timings.NMITriggerPos <= CPU.Cycles)
|
||||
{
|
||||
CPU.NMILine = FALSE;
|
||||
CPU.NMIPending = FALSE;
|
||||
Timings.NMITriggerPos = 0xffff;
|
||||
if (CPU.WaitingForInterrupt)
|
||||
{
|
||||
|
@ -439,8 +439,6 @@ void S9xDoHEventProcessing (void)
|
|||
|
||||
// FIXME: reading $4210 will wait 2 cycles, then perform reading, then wait 4 more cycles.
|
||||
Memory.FillRAM[0x4210] = Model->_5A22;
|
||||
CPU.NMILine = FALSE;
|
||||
Timings.NMITriggerPos = 0xffff;
|
||||
|
||||
ICPU.Frame++;
|
||||
PPU.HVBeamCounterLatched = 0;
|
||||
|
@ -507,7 +505,7 @@ void S9xDoHEventProcessing (void)
|
|||
{
|
||||
// FIXME: triggered at HC=6, checked just before the final CPU cycle,
|
||||
// then, when to call S9xOpcode_NMI()?
|
||||
CPU.NMILine = TRUE;
|
||||
CPU.NMIPending = TRUE;
|
||||
Timings.NMITriggerPos = 6 + 6;
|
||||
}
|
||||
|
||||
|
|
2
dma.cpp
2
dma.cpp
|
@ -1288,7 +1288,7 @@ bool8 S9xDoDMA (uint8 Channel)
|
|||
}
|
||||
}
|
||||
|
||||
if (CPU.NMILine && (Timings.NMITriggerPos != 0xffff))
|
||||
if (CPU.NMIPending && (Timings.NMITriggerPos != 0xffff))
|
||||
{
|
||||
Timings.NMITriggerPos = CPU.Cycles + Timings.NMIDMADelay;
|
||||
if (Timings.NMITriggerPos >= Timings.H_Max)
|
||||
|
|
2
ppu.cpp
2
ppu.cpp
|
@ -1513,7 +1513,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.NMILine = TRUE;
|
||||
CPU.NMIPending = TRUE;
|
||||
Timings.NMITriggerPos = CPU.Cycles + 6 + 6;
|
||||
}
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ static FreezeData SnapCPU[] =
|
|||
DELETED_INT_ENTRY(6, 7, WaitAddress, 4),
|
||||
DELETED_INT_ENTRY(6, 7, WaitCounter, 4),
|
||||
DELETED_INT_ENTRY(6, 7, PBPCAtOpcodeStart, 4),
|
||||
INT_ENTRY(7, NMILine),
|
||||
INT_ENTRY(7, NMIPending),
|
||||
INT_ENTRY(7, IRQLine),
|
||||
INT_ENTRY(7, IRQTransition),
|
||||
INT_ENTRY(7, IRQLastState),
|
||||
|
@ -1745,7 +1745,7 @@ int S9xUnfreezeFromStream (STREAM stream)
|
|||
{
|
||||
printf("Converting old snapshot version %d to %d\n...", version, SNAPSHOT_VERSION);
|
||||
|
||||
CPU.NMILine = (CPU.Flags & (1 << 7)) ? TRUE : FALSE;
|
||||
CPU.NMIPending = (CPU.Flags & (1 << 7)) ? TRUE : FALSE;
|
||||
CPU.IRQLine = (CPU.Flags & (1 << 11)) ? TRUE : FALSE;
|
||||
CPU.IRQTransition = FALSE;
|
||||
CPU.IRQLastState = FALSE;
|
||||
|
|
Loading…
Reference in New Issue