From 462d66c5497826cdc37853de9e45e4c99c877a04 Mon Sep 17 00:00:00 2001 From: Asnivor Date: Tue, 1 May 2018 13:42:21 +0100 Subject: [PATCH] ZXHawk: UPD ReadDiagnostic fix (more Alkatraz protected games now load) --- .../SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs index 197d761907..2446067b72 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs @@ -1313,7 +1313,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // read the whole track for (int i = 0; i < track.Sectors.Length; i++) { - if (secCount > ActiveCommandParams.EOT) + if (secCount >= ActiveCommandParams.EOT) { break; } @@ -2821,7 +2821,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { // interrupt has been raised for this drive // acknowledge - ActiveDrive.SeekStatus = SEEK_INTACKNOWLEDGED; + ActiveDrive.SeekStatus = SEEK_IDLE;// SEEK_INTACKNOWLEDGED; // result length 2 ResLength = 2; @@ -2832,6 +2832,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // second byte is the current track id ResBuffer[1] = ActiveDrive.CurrentTrackID; } + /* else if (ActiveDrive.SeekStatus == SEEK_INTACKNOWLEDGED) { // DriveA interrupt has already been acknowledged @@ -2841,6 +2842,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum Status0 = 192; ResBuffer[0] = Status0; } + */ else if (ActiveDrive.SeekStatus == SEEK_IDLE) { // SIS with no interrupt