From acb06e5a17f9c7a7e2ac1aa275d7e718199bcbe7 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 11 Nov 2016 17:24:45 +0100 Subject: [PATCH] Fixed a mistake in the operation of the FDC READ TRACK command. --- src/disc_86f.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/disc_86f.c b/src/disc_86f.c index dbbe49b80..5c09ff38a 100644 --- a/src/disc_86f.c +++ b/src/disc_86f.c @@ -1382,7 +1382,8 @@ void d86f_read_sector_id(int drive, int side, int match) if (d86f[drive].state == STATE_02_READ_ID) { /* READ TRACK command, we need some special handling here. */ - if (d86f[drive].last_sector.dword != fdc_get_read_track_sector().dword) + /* Code corrected: Only the C, H, and N portions of the sector ID are compared, the R portion (the sector number) is ignored. */ + if ((d86f[drive].last_sector.id.c != fdc_get_read_track_sector().id.c) || (d86f[drive].last_sector.id.h != fdc_get_read_track_sector().id.h) || (d86f[drive].last_sector.id.n != fdc_get_read_track_sector().id.n)) { d86f[drive].error_condition |= 4; /* Mark that the sector ID is not the one expected by the FDC. */ /* Make sure we use the sector size from the FDC. */