diff options
| author | Harley Travis <harleytravis123@outlook.com> | 2026-05-24 20:05:49 -0500 |
|---|---|---|
| committer | Harley Travis <harleytravis123@outlook.com> | 2026-05-24 20:05:49 -0500 |
| commit | bcb86a8d430c602a89ca2cf5798fe8e5ca3647ee (patch) | |
| tree | 4304fb29055caa184f36d20bc8541aeb37bdfafa | |
| parent | 4cfd66ec457ad44a2fc50c61a7f718bc2b0a6c42 (diff) | |
Update KFloppyA.HH
I completed the flag definitions for the ST2 and ST3 registers, and
updated the copyright notice accordingly. I also broke some long
comments down into multiple lines to keep the line length to 80 columns
or less.
| -rw-r--r-- | KFloppyA.HH | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/KFloppyA.HH b/KFloppyA.HH index 29bb7e3..6eb4321 100644 --- a/KFloppyA.HH +++ b/KFloppyA.HH @@ -1,5 +1,5 @@ /* - Copyright (C) 2025 Harley Travis <yoshi128k@gmail.com>. + Copyright (C) 2026 Harley Travis <yoshi128k@gmail.com>. This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the Copying.TXT file for more details. @@ -60,7 +60,8 @@ // other DOR flags #define FDC_DOR_DMA 0x08 // DMA2/IRQ6 On/Off -#define FDC_DOR_REST 0x04 // Controller Reset: this is active low; 1 = normal, 0 = reset +#define FDC_DOR_REST 0x04 // Controller Reset: this is active low; + // 1 = normal, 0 = reset // DOR drive select (DOR & 0x03): selects drive 0-3 @@ -86,20 +87,52 @@ */ #define FDC_ST0_SEEK_END 0x20 // Seek End: seek/calibration completed -#define FDC_ST0_UNIT_CHK 0x10 // Unit Check: drive encountered a fault or recalibration failed +#define FDC_ST0_UNIT_CHK 0x10 // Unit Check: drive encountered a fault + // or recalibration failed #define FDC_ST0_NOT_RDY 0x08 // Not Ready: self-explanatory #define FDC_ST0_HEAD 0x04 // Active Head // ST0 unit select (ST0 & 0x03): same fmt as DOR drive select // Status Register 1 (ST1) flags -#define FDC_ST1_END_CYL 0x80 // End of Cylinder: set when sector count > sectors on track +#define FDC_ST1_END_CYL 0x80 // End of Cylinder: + // set when sector count > sectors on track // 0x40 is unused -#define FDC_ST1_DATA_ERR 0x20 // Data Error: set when an error is detected in a sector's data or ID fields -#define FDC_ST1_TIMEOUT 0x10 // Timeout: set when a data overrun occurs (i.e. the system is not reading data fast enough) +#define FDC_ST1_DATA_ERR 0x20 // Data Error: set when an error is + // detected in a sector's data or ID fields +#define FDC_ST1_TIMEOUT 0x10 // Timeout: set when a data overrun or + // underrun occurs (i.e. the system is not + // reading data fast enough) // 0x08 is unused -#define FDC_ST1_NO_DATA 0x04 // No Data: set when either a sector cannot be read, or an ID cannot be successfully read, or if the sector sequence cannot be determined -#define FDC_ST1_NO_WRITE 0x02 // Not Writable: set when attempting to write to a write-protected disk -#define FDC_ST1_NO_ID 0x01 // No Addr. Mark: set when an ID/(deleted) data address mark cannot be found. +#define FDC_ST1_NO_DATA 0x04 // No Data: set when either a sector cannot + // be read, or an ID cannot be successfully + // read, or if the sector sequence cannot + // be determined +#define FDC_ST1_NO_WRITE 0x02 // Not Writable: set when attempting to + // write to a write-protected disk +#define FDC_ST1_NO_ID 0x01 // No Addr. Mark: set when an ID/(deleted) + // data address mark cannot be found. // Status Register 2 (ST2) flags +// 0x80 is unused +#define FDC_ST2_DEL_ADDR_MRK 0x40 // Deleted Addr. Mark: set when a deleted + // DAM or valid DAM is detected during RS + // or RDS, respectively +#define FDC_ST2_CRC_ERR 0x20 // CRC Error: self explanatory +#define FDC_ST2_WRONG_CYL 0x10 // Wrong cyl.: set when the ctrlr cyl does + // not match that in the ID addr mrk +// 0x08 and 0x04 are unused +#define FDC_ST2_BAD_CYL 0x02 // Bad Cylinder: set when track addr in + // sector does not match that on the ctrlr + // and equals 0xFF (meaning it is bad) +#define FDC_ST2_MISSING_DATA 0x01 // Missing Data: set when no DAM or DDAM + // can be found + +// Status Register 3 (ST3) flags +// 0x80 is unused +#define FDC_ST3_W_PROT 0x40 // Write Protected: self explanatory +// 0x20 is unused +#define FDC_ST3_TRK_0 0x10 // Track 0: ditto +// 0x08 is unused +#define FDC_ST3_HEAD_ADDR 0x04 // Head Address: ditto +// 0x02 and 0x01 are drive select |
