ZXHawk: Better detect maskable interrupt used as a tape trap
This commit is contained in:
parent
0ae1910259
commit
76904df015
|
@ -193,6 +193,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
if (_currentDataBlockIndex >= _dataBlocks.Count)
|
||||
{
|
||||
// end of tape reached. Rewind to beginning
|
||||
AutoStopTape();
|
||||
RTZ();
|
||||
return;
|
||||
}
|
||||
|
@ -736,6 +737,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
_machine.Spectrum.OSD_TapePlayingAuto();
|
||||
}
|
||||
|
||||
public int MaskableInterruptCount = 0;
|
||||
|
||||
private void MonitorFrame()
|
||||
{
|
||||
if (_tapeIsPlaying && _machine.Spectrum.Settings.AutoLoadTape)
|
||||
|
@ -770,7 +773,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
AutoStopTape();
|
||||
_lastCycle = _cpu.TotalExecutedCycles;
|
||||
|
||||
MonitorReset();
|
||||
//MonitorReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -807,6 +810,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
result &= ~TAPE_BIT;
|
||||
}
|
||||
|
||||
if (!TapeIsPlaying)
|
||||
{
|
||||
MonitorRead();
|
||||
}
|
||||
|
||||
MonitorRead();
|
||||
|
||||
/*
|
||||
|
|
|
@ -207,8 +207,18 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
}
|
||||
|
||||
// THE 'MASKABLE INTERRUPT' ROUTINE
|
||||
// This is sometimes used when the tape is to be stopped
|
||||
//
|
||||
if (addr == 56)
|
||||
{
|
||||
TapeDevice.MaskableInterruptCount++;
|
||||
|
||||
if (TapeDevice.MaskableInterruptCount > 20)
|
||||
{
|
||||
TapeDevice.MaskableInterruptCount = 0;
|
||||
TapeDevice.AutoStopTape();
|
||||
}
|
||||
|
||||
//TapeDevice?.AutoStopTape();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
|
||||
switch (divisor)
|
||||
{
|
||||
case 0: return ROM0[index];
|
||||
case 0:
|
||||
TestForTapeTraps(addr % 0x4000);
|
||||
return ROM0[index];
|
||||
case 1: return RAM0[index];
|
||||
case 2: return RAM1[index];
|
||||
case 3: return RAM2[index];
|
||||
|
|
Loading…
Reference in New Issue