From 3b4a7605c5f331f68993bc491f426b9af4cf69ce Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Sat, 2 Mar 2019 15:37:17 +1000 Subject: [PATCH] Add better floppy MODE page support --- CHANGELOG | 4 ++++ software/SCSI2SD/src/mode.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 81ed2cc..aa3cd6a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2019XXXX 4.9.X + - Improve XEBEC controller support + - Add Flexible Disk Drive Geometry SCSI MODE page + 20180926 4.8.1 - Fix bug when writing with multiple SCSI devices on the chain diff --git a/software/SCSI2SD/src/mode.c b/software/SCSI2SD/src/mode.c index f9d529a..95d00e9 100755 --- a/software/SCSI2SD/src/mode.c +++ b/software/SCSI2SD/src/mode.c @@ -120,6 +120,35 @@ static const uint8 RigidDiskDriveGeometry[] = 0x00, 0x00 // Reserved }; +static const uint8 FlexibleDiskDriveGeometry[] = +{ +0x05, // Page code +0x1E, // Page length +0x01, 0xF4, // Transfer Rate (500kbits) +0x01, // heads +18, // sectors per track +0x20,0x00, // bytes per sector +0x00, 80, // Cylinders +0x00, 0x80, // Write-precomp +0x00, 0x80, // reduced current, +0x00, 0x00, // Drive step rate +0x00, // pulse width +0x00, 0x00, // Head settle delay +0x00, // motor on delay +0x00, // motor off delay +0x00, +0x00, +0x00, +0x00, +0x00, +0x00, +0x00, +0x00, +0x00, +0x00, +0x00 +}; + static const uint8 RigidDiskDriveGeometry_SCSI1[] = { 0x04, // Page code @@ -439,6 +468,13 @@ static void doModeSense( } } + if (pageCode == 0x05 || pageCode == 0x3F) + { + pageFound = 1; + pageIn(pc, idx, FlexibleDiskDriveGeometry, sizeof(FlexibleDiskDriveGeometry)); + idx += sizeof(FlexibleDiskDriveGeometry); + } + // DON'T output the following pages for SCSI1 hosts. They get upset when // we have more data to send than the allocation length provided. // (ie. Try not to output any more pages below this comment)