src/mess/formats/d81_dsk.c
| r7276 | r7277 | |
| 13 | 13 | PARAMETERS
|
| 14 | 14 | ***************************************************************************/
|
| 15 | 15 | |
| 16 | | #define LOG 0
|
| 17 | | |
| 18 | 16 | #define D81_SIZE 819200
|
| 19 | 17 | |
| 20 | 18 | /***************************************************************************
|
| r7276 | r7277 | |
| 71 | 69 | |
| 72 | 70 | UINT64 d81_translate_offset(floppy_image *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector)
|
| 73 | 71 | {
|
| 74 | | UINT64 offset = ((track * 20) + (!head * 10) + (sector - 1)) * 512;
|
| 72 | UINT64 offset = (track * 20) + (!head * 10) + sector;
|
| 75 | 73 | |
| 76 | | if (LOG) logerror("D81 offset %06x: track %u head %u sector %u\n", (UINT32)offset, track, head, sector);
|
| 77 | | |
| 78 | 74 | return offset;
|
| 79 | 75 | }
|
| 80 | 76 | |
| r7276 | r7277 | |
| 93 | 89 | FLOPPY_CONSTRUCT( d81_dsk_construct )
|
| 94 | 90 | -------------------------------------------------*/
|
| 95 | 91 | |
| 92 | /*
|
| 93 | PER TRACK ORGANIZATION:
|
| 94 | |
| 95 | Hex 4E written as a gap, with 10 sectors of data, with full gaps written for motor speed variation. |
| 96 | |
| 97 | PER SECTOR ORGANIZATION:
|
| 98 | |
| 99 | MFM Encoding
|
| 100 | 12 Bytes of Hex 00
|
| 101 | 3 Bytes of Hex A1 (Data Hex A1, Clock Hex 0A)
|
| 102 | 1 Byte of Hex FE (ID Address Mark)
|
| 103 | 1 Byte (Track Number)
|
| 104 | 1 Byte (Side Number)
|
| 105 | 1 Byte (Sector Number)
|
| 106 | 1 Byte (Sector Length, 02 for 512 Byte Sectors)
|
| 107 | 2 Bytes CRC (Cyclic Redundancy Check)
|
| 108 | 22 Bytes of Hex 22
|
| 109 | 12 Bytes of Hex 00
|
| 110 | 3 Bytes of Hex A1 (Data Hex A1, Clock Hex 0A)
|
| 111 | 1 Byte of Hex FB (Data Address Mark)
|
| 112 | 512 Bytes of Data
|
| 113 | 2 Bytes of CRC (Cyclic Redundancy Check)
|
| 114 | 38 Bytes of Hex 4E
|
| 115 | */
|
| 116 | |
| 96 | 117 | FLOPPY_CONSTRUCT( d81_dsk_construct )
|
| 97 | 118 | {
|
| 98 | 119 | struct basicdsk_geometry geometry;
|