Просмотр исходного кода

Add better floppy MODE page support

Michael McMaster 6 лет назад
Родитель
Сommit
8f4a50365d
2 измененных файлов с 37 добавлено и 0 удалено
  1. 1 0
      lib/SCSI2SD/CHANGELOG
  2. 36 0
      lib/SCSI2SD/src/firmware/mode.c

+ 1 - 0
lib/SCSI2SD/CHANGELOG

@@ -1,5 +1,6 @@
 2019XXXX
 	- Port XEBEC support from v5 firmware
+	- Add Flexible Disk Drive Geometry SCSI MODE page
 
 20181011		6.2.1
 	- Fix bug in USB disk interface with disks over 4GB

+ 36 - 0
lib/SCSI2SD/src/firmware/mode.c

@@ -120,6 +120,35 @@ static const uint8_t RigidDiskDriveGeometry[] =
 0x00, 0x00 // Reserved
 };
 
+static const uint8_t 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_t RigidDiskDriveGeometry_SCSI1[] =
 {
 0x04, // Page code
@@ -421,6 +450,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)