src/mess/machine/vc1541.c
| r3273 | r3274 | |
| 114 | 114 | the variants supported by Vice in the enum) |
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | | |
| 118 | | #include <assert.h> |
| 119 | | #include <stdio.h> |
| 120 | | |
| 121 | 117 | #include "driver.h" |
| 122 | 118 | #include "deprecat.h" |
| 123 | 119 | #include "image.h" |
| 124 | 120 | #include "cpu/m6502/m6502.h" |
| 125 | 121 | #include "machine/6522via.h" |
| 126 | 122 | |
| 127 | | #include "includes/cbmdrive.h" |
| 128 | 123 | #include "machine/tpi6525.h" |
| 129 | 124 | |
| 130 | 125 | #include "includes/vc1541.h" |
| r3273 | r3274 | |
| 141 | 136 | } \ |
| 142 | 137 | } |
| 143 | 138 | |
| 139 | #define D64_MAX_TRACKS 35 |
| 144 | 140 | |
| 141 | static const int d64_sectors_per_track[] = |
| 142 | { |
| 143 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
| 144 | 19, 19, 19, 19, 19, 19, 19, |
| 145 | 18, 18, 18, 18, 18, 18, |
| 146 | 17, 17, 17, 17, 17 |
| 147 | }; |
| 148 | |
| 149 | static int d64_offset[D64_MAX_TRACKS]; /* offset of begin of track in d64 file */ |
| 150 | |
| 151 | /* calculates offset to beginning of d64 file for sector beginning */ |
| 152 | static int d64_tracksector2offset (int track, int sector) |
| 153 | { |
| 154 | return d64_offset[track - 1] + sector * 256; |
| 155 | } |
| 156 | |
| 157 | |
| 158 | #define D64_TRACK_ID1 (d64_tracksector2offset(18,0)+162) |
| 159 | #define D64_TRACK_ID2 (d64_tracksector2offset(18,0)+163) |
| 160 | |
| 145 | 161 | /* |
| 146 | 162 | * only for testing at the moment |
| 147 | 163 | */ |
| r3273 | r3274 | |
| 243 | 259 | */ |
| 244 | 260 | static const int bin_2_gcr[] = |
| 245 | 261 | { |
| 246 | | 0xa, 0xb, 0x12, 0x13, 0xe, 0xf, 0x16, 0x17, |
| 247 | | 9, 0x19, 0x1a, 0x1b, 0xd, 0x1d, 0x1e, 0x15 |
| 262 | 0x0a, 0x0b, 0x12, 0x13, 0x0e, 0x0f, 0x16, 0x17, |
| 263 | 0x09, 0x19, 0x1a, 0x1b, 0x0d, 0x1d, 0x1e, 0x15 |
| 248 | 264 | }; |
| 249 | 265 | |
| 250 | 266 | #if 0 |
src/mess/machine/cbmdrive.c
| r3273 | r3274 | |
| 58 | 58 | |
| 59 | 59 | #define D64_MAX_TRACKS 35 |
| 60 | 60 | |
| 61 | | const int d64_sectors_per_track[] = |
| 61 | static const int d64_sectors_per_track[] = |
| 62 | 62 | { |
| 63 | 63 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
| 64 | 64 | 19, 19, 19, 19, 19, 19, 19, |
| r3273 | r3274 | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /* calculates offset to beginning of d64 file for sector beginning */ |
| 82 | | int d64_tracksector2offset (int track, int sector) |
| 82 | static int d64_tracksector2offset (int track, int sector) |
| 83 | 83 | { |
| 84 | 84 | return d64_offset[track - 1] + sector * 256; |
| 85 | 85 | } |