trunk/src/lib/formats/victor9k_dsk.c
r241687 | r241688 | |
2 | 2 | // copyright-holders:Curt Coder |
3 | 3 | /********************************************************************* |
4 | 4 | |
5 | | formats/victor9k_dsk.c |
| 5 | formats/victor9k_dsk.c |
6 | 6 | |
7 | | Victor 9000 sector disk image format |
| 7 | Victor 9000 sector disk image format |
8 | 8 | |
9 | 9 | *********************************************************************/ |
10 | 10 | |
11 | 11 | /* |
12 | 12 | |
13 | | Sector format |
14 | | ------------- |
| 13 | Sector format |
| 14 | ------------- |
15 | 15 | |
16 | | Header sync |
17 | | Sector header (header ID, track ID, sector ID, and checksum) |
18 | | Gap 1 |
19 | | Data Sync |
20 | | Data field (data sync, data ID, data bytes, and checksum) |
21 | | Gap 2 |
| 16 | Header sync |
| 17 | Sector header (header ID, track ID, sector ID, and checksum) |
| 18 | Gap 1 |
| 19 | Data Sync |
| 20 | Data field (data sync, data ID, data bytes, and checksum) |
| 21 | Gap 2 |
22 | 22 | |
23 | | Track format |
24 | | ------------ |
| 23 | Track format |
| 24 | ------------ |
25 | 25 | |
26 | | ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL |
27 | | NUMBER TRACKS TRACKS PER TRACK PERIOD (MS) |
| 26 | ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL RPM |
| 27 | NUMBER TRACKS TRACKS PER TRACK PERIOD (MS) |
28 | 28 | |
29 | | 0 0-3 unused 19 237.9 |
30 | | 1 4-15 0-7 18 224.5 |
31 | | 2 16-26 8-18 17 212.2 |
32 | | 3 27-37 19-29 16 199.9 |
33 | | 4 38-48 30-40 15 187.6 |
34 | | 5 49-59 41-51 14 175.3 |
35 | | 6 60-70 52-62 13 163.0 |
36 | | 7 71-79 63-74 12 149.6 |
37 | | 8 unused 75-79 11 144.0 |
| 29 | 0 0-3 unused 19 237.9 252 |
| 30 | 1 4-15 0-7 18 224.5 267 |
| 31 | 2 16-26 8-18 17 212.2 283 |
| 32 | 3 27-37 19-29 16 199.9 300 |
| 33 | 4 38-48 30-40 15 187.6 320 |
| 34 | 5 49-59 41-51 14 175.3 342 |
| 35 | 6 60-70 52-62 13 163.0 368 |
| 36 | 7 71-79 63-74 12 149.6 401 |
| 37 | 8 unused 75-79 11 144.0 417 |
38 | 38 | |
39 | 39 | */ |
40 | 40 | |
r241687 | r241688 | |
47 | 47 | |
48 | 48 | const char *victor9k_format::name() const |
49 | 49 | { |
50 | | return "victor9k"; |
| 50 | return "victor9k"; |
51 | 51 | } |
52 | 52 | |
53 | 53 | const char *victor9k_format::description() const |
54 | 54 | { |
55 | | return "Victor 9000 disk image"; |
| 55 | return "Victor 9000 disk image"; |
56 | 56 | } |
57 | 57 | |
58 | 58 | const char *victor9k_format::extensions() const |
59 | 59 | { |
60 | | return "img"; |
| 60 | return "img"; |
61 | 61 | } |
62 | 62 | |
63 | 63 | int victor9k_format::identify(io_generic *io, UINT32 form_factor) |
64 | 64 | { |
65 | | return 0; |
| 65 | return 0; |
66 | 66 | } |
67 | 67 | |
68 | 68 | bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) |
69 | 69 | { |
70 | | return false; |
| 70 | return false; |
71 | 71 | } |
72 | 72 | |
73 | 73 | bool victor9k_format::supports_save() const |
74 | 74 | { |
75 | | return false; |
| 75 | return false; |
76 | 76 | } |
77 | 77 | |
78 | 78 | const victor9k_format::format victor9k_format::formats[] = { |
79 | | { // |
80 | | floppy_image::FF_525, floppy_image::SSDD, 80, 1, 256 |
81 | | }, |
82 | | { // |
83 | | floppy_image::FF_525, floppy_image::DSDD, 80, 2, 256 |
84 | | }, |
85 | | {} |
| 79 | { // |
| 80 | floppy_image::FF_525, floppy_image::SSDD, 80, 1, 512 |
| 81 | }, |
| 82 | { // |
| 83 | floppy_image::FF_525, floppy_image::DSDD, 80, 2, 512 |
| 84 | }, |
| 85 | {} |
86 | 86 | }; |
87 | 87 | |
88 | 88 | const UINT32 victor9k_format::cell_size[] = |
89 | 89 | { |
90 | | 0 |
| 90 | 0 |
91 | 91 | }; |
92 | 92 | |
93 | | const int victor9k_format::sectors_per_track[] = |
| 93 | const int victor9k_format::sectors_per_track[2][80] = |
94 | 94 | { |
95 | | 0 |
| 95 | { |
| 96 | 19, 19, 19, 19, |
| 97 | 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, |
| 98 | 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
| 99 | 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, |
| 100 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
| 101 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
| 102 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 103 | 12, 12, 12, 12, 12, 12, 12, 12, 12 |
| 104 | }, |
| 105 | { |
| 106 | 18, 18, 18, 18, 18, 18, 18, 18, |
| 107 | 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
| 108 | 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, |
| 109 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
| 110 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
| 111 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 112 | 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, |
| 113 | 11, 11, 11, 11, 11 |
| 114 | } |
96 | 115 | }; |
97 | 116 | |
98 | | const int victor9k_format::speed_zone[] = |
| 117 | const int victor9k_format::speed_zone[2][80] = |
99 | 118 | { |
100 | | 0 |
| 119 | { |
| 120 | 0, 0, 0, 0, |
| 121 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 122 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 123 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 124 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, |
| 125 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 126 | 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
| 127 | 7, 7, 7, 7, 7, 7, 7, 7, 7 |
| 128 | }, |
| 129 | { |
| 130 | 1, 1, 1, 1, 1, 1, 1, 1, |
| 131 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 132 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 133 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, |
| 134 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 135 | 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, |
| 136 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
| 137 | 8, 8, 8, 8, 8 |
| 138 | } |
101 | 139 | }; |
102 | 140 | |
103 | 141 | const floppy_format_type FLOPPY_VICTOR_9000_FORMAT = &floppy_image_format_creator<victor9k_format>; |
trunk/src/mess/machine/victor9k_fdc.c
r241687 | r241688 | |
17 | 17 | - spindle speed |
18 | 18 | - stepper |
19 | 19 | - read PLL |
20 | | - TACH0/1 |
21 | 20 | - write logic |
22 | 21 | |
23 | 22 | */ |
r241687 | r241688 | |
109 | 108 | m_via4->write_ca1(m_ds0); |
110 | 109 | } |
111 | 110 | |
| 111 | void victor_9000_fdc_t::index0_cb(floppy_image_device *device, int state) |
| 112 | { |
| 113 | m_tach0 = state; |
| 114 | } |
| 115 | |
112 | 116 | void victor_9000_fdc_t::ready1_cb(floppy_image_device *device, int state) |
113 | 117 | { |
114 | 118 | m_rdy1 = state; |
r241687 | r241688 | |
132 | 136 | m_via4->write_cb1(m_ds1); |
133 | 137 | } |
134 | 138 | |
| 139 | void victor_9000_fdc_t::index1_cb(floppy_image_device *device, int state) |
| 140 | { |
| 141 | m_tach1 = state; |
| 142 | } |
| 143 | |
135 | 144 | static SLOT_INTERFACE_START( victor9k_floppies ) |
136 | | SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) |
| 145 | SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD ) // Tandon TM100-3 with custom electronics |
| 146 | SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // Tandon TM100-4 with custom electronics |
137 | 147 | SLOT_INTERFACE_END |
138 | 148 | |
139 | 149 | FLOPPY_FORMATS_MEMBER( victor_9000_fdc_t::floppy_formats ) |
r241687 | r241688 | |
246 | 256 | void victor_9000_fdc_t::device_start() |
247 | 257 | { |
248 | 258 | // allocate timer |
249 | | t_gen = timer_alloc(TM_GEN); |
250 | | t_tach0 = timer_alloc(TM_TACH0); |
251 | | t_tach1 = timer_alloc(TM_TACH1); |
| 259 | t_gen = timer_alloc(0); |
252 | 260 | |
253 | 261 | // state saving |
254 | 262 | save_item(NAME(m_da)); |
r241687 | r241688 | |
302 | 310 | m_floppy0->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready0_cb), this)); |
303 | 311 | m_floppy0->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load0_cb), this)); |
304 | 312 | m_floppy0->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload0_cb), this)); |
| 313 | m_floppy0->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(victor_9000_fdc_t::index0_cb), this)); |
305 | 314 | m_floppy1->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready1_cb), this)); |
306 | 315 | m_floppy1->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load1_cb), this)); |
307 | 316 | m_floppy1->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload1_cb), this)); |
| 317 | m_floppy1->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(victor_9000_fdc_t::index1_cb), this)); |
308 | 318 | } |
309 | 319 | |
310 | 320 | |
r241687 | r241688 | |
314 | 324 | |
315 | 325 | void victor_9000_fdc_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
316 | 326 | { |
317 | | switch (id) |
318 | | { |
319 | | case TM_GEN: |
320 | | live_sync(); |
321 | | live_run(); |
322 | | |
323 | | case TM_TACH0: |
324 | | // TODO |
325 | | break; |
326 | | |
327 | | case TM_TACH1: |
328 | | // TODO |
329 | | break; |
330 | | } |
| 327 | live_sync(); |
| 328 | live_run(); |
331 | 329 | } |
332 | 330 | |
333 | 331 | |
r241687 | r241688 | |
482 | 480 | if (m_sel0) m_da0 = m_da; |
483 | 481 | m_floppy0->mon_w(m_mtr0); |
484 | 482 | m_floppy0->set_rpm(300); // TODO |
485 | | t_tach0->adjust(attotime::never); // TODO |
486 | 483 | |
487 | 484 | if (m_sel1) m_da1 = m_da; |
488 | 485 | m_floppy1->mon_w(m_mtr1); |
489 | 486 | m_floppy1->set_rpm(300); // TODO |
490 | | t_tach1->adjust(attotime::never); // TODO |
491 | 487 | } |
492 | 488 | |
493 | 489 | |