Previous 199869 Revisions Next

r33203 Tuesday 4th November, 2014 at 21:37:05 UTC by Curt Coder
(MESS) victor9k: Floppy WIP. (nw)
[src/lib/formats]victor9k_dsk.c victor9k_dsk.h
[src/mess/drivers]victor9k.c
[src/mess/machine]victor9k_fdc.c victor9k_fdc.h

trunk/src/lib/formats/victor9k_dsk.c
r241714r241715
3636   7           71-79       63-74       12          149.6        401
3737   8           unused      75-79       11          144.0        417
3838
39   Interleave factor 3
40
3941*/
4042
4143#include "emu.h"
r241714r241715
6062   return "img";
6163}
6264
65int victor9k_format::find_size(io_generic *io, UINT32 form_factor)
66{
67   UINT64 size = io_generic_size(io);
68   for(int i=0; formats[i].sector_count; i++) {
69      const format &f = formats[i];
70      if(size == (UINT32) f.sector_count*f.sector_base_size*f.head_count)
71         return i;
72   }
73   return -1;
74}
75
6376int victor9k_format::identify(io_generic *io, UINT32 form_factor)
6477{
78   int type = find_size(io, form_factor);
79
80   if (type != -1)
81      return 50;
82
6583   return 0;
6684}
6785
86floppy_image_format_t::desc_e* victor9k_format::get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2)
87{
88   static floppy_image_format_t::desc_e desc[] = {
89      /* 00 */ { SECTOR_LOOP_START, 0, -1 },
90      /* 01 */ {   RAWBYTE, 0xff, 5 },
91      /* 02 */ {   GCR5, 0x08, 1 },
92      /* 03 */ {   CRC, 1 },
93      /* 04 */ {   CRC_CBM_START, 1 },
94      /* 05 */ {     SECTOR_ID_GCR5 },
95      /* 06 */ {     TRACK_ID_DOS2_GCR5 },
96      /* 07 */ {     GCR5, id2, 1 },
97      /* 08 */ {     GCR5, id1, 1 },
98      /* 09 */ {   CRC_END, 1 },
99      /* 10 */ {   GCR5, 0x0f, 2 },
100      /* 11 */ {   RAWBYTE, 0x55, f.gap_1 },
101      /* 12 */ {   RAWBYTE, 0xff, 5 },
102      /* 13 */ {   GCR5, 0x07, 1 },
103      /* 14 */ {   CRC_CBM_START, 2 },
104      /* 15 */ {     SECTOR_DATA_GCR5, -1 },
105      /* 16 */ {   CRC_END, 2 },
106      /* 17 */ {   CRC, 2 },
107      /* 18 */ {   GCR5, 0x00, 2 },
108      /* 19 */ {   RAWBYTE, 0x55, gap_2 },
109      /* 20 */ { SECTOR_LOOP_END },
110      /* 21 */ { RAWBYTE, 0x55, 0 },
111      /* 22 */ { RAWBITS, 0x5555, 0 },
112      /* 23 */ { END }
113   };
114
115   current_size = 40 + (1+1+4+2)*10 + (f.gap_1)*8 + 40 + (1+f.sector_base_size+1+2)*10 + gap_2*8;
116
117   current_size *= sector_count;
118   return desc;
119}
120
121void victor9k_format::build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, desc_s *sectors, int sector_count) const
122{
123   for (int i = 0; i < sector_count; i++) {
124      sectors[i].data = sectdata + sect_offs;
125      sectors[i].size = f.sector_base_size;
126      sectors[i].sector_id = i;
127
128      sect_offs += sectors[i].size;
129   }
130}
131
68132bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
69133{
70   return false;
134   int type = find_size(io, form_factor);
135   if(type == -1)
136      return false;
137
138   const format &f = formats[type];
139
140   UINT64 size = io_generic_size(io);
141   dynamic_buffer img;
142   img.resize(size);
143
144   io_generic_read(io, img, 0, size);
145
146   int track_offset = 0;
147
148   UINT8 id1 = 0xde, id2 = 0xad; // TODO
149
150   for (int head = 0; head < f.head_count; head++) {
151      for (int track = 0; track < f.track_count; track++) {
152         int current_size = 0;
153         int total_size = 200000000./cell_size[speed_zone[head][track]];
154         int sector_count = sectors_per_track[head][track];
155         int track_size = sector_count*f.sector_base_size;
156
157         floppy_image_format_t::desc_e *desc = get_sector_desc(f, current_size, sector_count, id1, id2, f.gap_2);
158
159         int remaining_size = total_size - current_size;
160         if(remaining_size < 0)
161            throw emu_fatalerror("victor9k_format: Incorrect track layout, max_size=%d, current_size=%d", total_size, current_size);
162
163         // Fixup the end gap
164         desc[21].p2 = remaining_size / 8;
165         desc[22].p2 = remaining_size & 7;
166         desc[22].p1 >>= remaining_size & 0x01;
167
168         desc_s sectors[40];
169
170         build_sector_description(f, img, track_offset, sectors, sector_count);
171         generate_track(desc, track, head, sectors, sector_count, total_size, image);
172
173         track_offset += track_size;
174      }
175   }
176
177   image->set_variant(f.variant);
178
179   return true;
71180}
72181
73182bool victor9k_format::supports_save() const
r241714r241715
77186
78187const victor9k_format::format victor9k_format::formats[] = {
79188   { //
80      floppy_image::FF_525, floppy_image::SSDD, 80, 1, 512
189      floppy_image::FF_525, floppy_image::SSDD, 1224, 80, 1, 512, 9, 8
81190   },
82191   { //
83      floppy_image::FF_525, floppy_image::DSDD, 80, 2, 512
192      floppy_image::FF_525, floppy_image::DSDD, 2448, 80, 2, 512, 9, 8
84193   },
85194   {}
86195};
trunk/src/lib/formats/victor9k_dsk.h
r241714r241715
1919      UINT32 form_factor;      // See floppy_image for possible values
2020      UINT32 variant;          // See floppy_image for possible values
2121
22      UINT16 sector_count;
2223      UINT8 track_count;
2324      UINT8 head_count;
2425      UINT16 sector_base_size;
26      UINT8 gap_1;
27      UINT8 gap_2;
2528   };
2629
2730   victor9k_format();
r241714r241715
3033   virtual const char *description() const;
3134   virtual const char *extensions() const;
3235
36   int find_size(io_generic *io, UINT32 form_factor);
3337   virtual int identify(io_generic *io, UINT32 form_factor);
38   floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2);
39   void build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, desc_s *sectors, int sector_count) const;
3440   virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
3541   virtual bool supports_save() const;
3642
trunk/src/mess/drivers/victor9k.c
r241714r241715
3838
3939static ADDRESS_MAP_START( victor9k_mem, AS_PROGRAM, 8, victor9k_state )
4040//  AM_RANGE(0x00000, 0xdffff) AM_RAM
41   AM_RANGE(0x20000, 0xdffff) AM_NOP
4142   AM_RANGE(0xe0000, 0xe0001) AM_DEVREADWRITE(I8259A_TAG, pic8259_device, read, write)
4243   AM_RANGE(0xe0020, 0xe0023) AM_DEVREADWRITE(I8253_TAG, pit8253_device, read, write)
4344   AM_RANGE(0xe0040, 0xe0043) AM_DEVREADWRITE(UPD7201_TAG, upd7201_device, cd_ba_r, cd_ba_w)
44   AM_RANGE(0xe8000, 0xe8000) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, status_r, address_w)
45   AM_RANGE(0xe8001, 0xe8001) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, register_r, register_w)
46   AM_RANGE(0xe8020, 0xe802f) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write)
47   AM_RANGE(0xe8040, 0xe804f) AM_DEVREADWRITE(M6522_2_TAG, via6522_device, read, write)
48   AM_RANGE(0xe8060, 0xe8061) AM_DEVREADWRITE(MC6852_TAG, mc6852_device, read, write)
49   AM_RANGE(0xe8080, 0xe808f) AM_DEVREADWRITE(M6522_3_TAG, via6522_device, read, write)
50   AM_RANGE(0xe80a0, 0xe80af) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs5_r, cs5_w)
51   AM_RANGE(0xe80c0, 0xe80cf) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs6_r, cs6_w)
52   AM_RANGE(0xe80e0, 0xe80ef) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs7_r, cs7_w)
45   AM_RANGE(0xe8000, 0xe8000) AM_MIRROR(0x7f00) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, status_r, address_w)
46   AM_RANGE(0xe8001, 0xe8001) AM_MIRROR(0x7f00) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, register_r, register_w)
47   AM_RANGE(0xe8020, 0xe802f) AM_MIRROR(0x7f00) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write)
48   AM_RANGE(0xe8040, 0xe804f) AM_MIRROR(0x7f00) AM_DEVREADWRITE(M6522_2_TAG, via6522_device, read, write)
49   AM_RANGE(0xe8060, 0xe8061) AM_MIRROR(0x7f00) AM_DEVREADWRITE(MC6852_TAG, mc6852_device, read, write)
50   AM_RANGE(0xe8080, 0xe808f) AM_MIRROR(0x7f00) AM_DEVREADWRITE(M6522_3_TAG, via6522_device, read, write)
51   AM_RANGE(0xe80a0, 0xe80af) AM_MIRROR(0x7f00) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs5_r, cs5_w)
52   AM_RANGE(0xe80c0, 0xe80cf) AM_MIRROR(0x7f00) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs6_r, cs6_w)
53   AM_RANGE(0xe80e0, 0xe80ef) AM_MIRROR(0x7f00) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs7_r, cs7_w)
5354   AM_RANGE(0xf0000, 0xf0fff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("video_ram")
5455   AM_RANGE(0xfe000, 0xfffff) AM_ROM AM_REGION(I8088_TAG, 0)
5556ADDRESS_MAP_END
trunk/src/mess/machine/victor9k_fdc.c
r241714r241715
1515
1616   - floppy format
1717   - spindle speed
18   - stepper
1918    - read PLL
2019    - write logic
2120
r241714r241715
2928//  MACROS / CONSTANTS
3029//**************************************************************************
3130
32#define LOG 0
31#define LOG 1
3332
3433#define I8048_TAG       "5d"
3534#define M6522_4_TAG     "1f"
r241714r241715
8584//  SLOT_INTERFACE( victor9k_floppies )
8685//-------------------------------------------------
8786
88void victor_9000_fdc_t::ready0_cb(floppy_image_device *device, int state)
89{
90   m_rdy0 = state;
91
92   m_via5->write_ca2(m_rdy0);
93}
94
9587int victor_9000_fdc_t::load0_cb(floppy_image_device *device)
9688{
97   m_ds0 = 0;
89   m_via4->write_ca1(0);
9890
99   m_via4->write_ca1(m_ds0);
100
10191   return IMAGE_INIT_PASS;
10292}
10393
10494void victor_9000_fdc_t::unload0_cb(floppy_image_device *device)
10595{
106   m_ds0 = 1;
107
108   m_via4->write_ca1(m_ds0);
96   m_via4->write_ca1(1);
10997}
11098
111void victor_9000_fdc_t::index0_cb(floppy_image_device *device, int state)
112{
113   m_tach0 = state;
114}
115
116void victor_9000_fdc_t::ready1_cb(floppy_image_device *device, int state)
117{
118   m_rdy1 = state;
119
120   m_via5->write_cb2(m_rdy1);
121}
122
12399int victor_9000_fdc_t::load1_cb(floppy_image_device *device)
124100{
125   m_ds1 = 0;
101   m_via4->write_cb1(0);
126102
127   m_via4->write_cb1(m_ds1);
128
129103   return IMAGE_INIT_PASS;
130104}
131105
132106void victor_9000_fdc_t::unload1_cb(floppy_image_device *device)
133107{
134   m_ds1 = 1;
135
136   m_via4->write_cb1(m_ds1);
108   m_via4->write_cb1(1);
137109}
138110
139void victor_9000_fdc_t::index1_cb(floppy_image_device *device, int state)
140{
141   m_tach1 = state;
142}
143
144111static SLOT_INTERFACE_START( victor9k_floppies )
145112   SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD ) // Tandon TM100-3 with custom electronics
146113   SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // Tandon TM100-4 with custom electronics
r241714r241715
215182   m_via6(*this, M6522_6_TAG),
216183   m_floppy0(*this, I8048_TAG":0:525qd"),
217184   m_floppy1(*this, I8048_TAG":1:525qd"),
185   m_rom(*this, I8048_TAG),
218186   m_gcr_rom(*this, "gcr"),
219187   m_da(0),
220188   m_da0(0),
221189   m_da1(0),
190   m_start0(1),
191   m_stop0(1),
192   m_start1(1),
193   m_stop1(1),
222194   m_sel0(0),
223195   m_sel1(0),
224196   m_tach0(0),
225197   m_tach1(0),
226198   m_rdy0(0),
227199   m_rdy1(0),
228   m_ds0(1),
229   m_ds1(1),
230200   m_l0ms(0),
231201   m_l1ms(0),
232202   m_st0(0),
r241714r241715
256226void victor_9000_fdc_t::device_start()
257227{
258228   // allocate timer
259   t_gen = timer_alloc(0);
229   t_gen = timer_alloc(TM_GEN);
230   t_tach0 = timer_alloc(TM_TACH0);
231   t_tach1 = timer_alloc(TM_TACH1);
260232
261233   // state saving
262234   save_item(NAME(m_da));
263235   save_item(NAME(m_da0));
264236   save_item(NAME(m_da1));
237   save_item(NAME(m_start0));
238   save_item(NAME(m_stop0));
239   save_item(NAME(m_start1));
240   save_item(NAME(m_stop1));
265241   save_item(NAME(m_sel0));
266242   save_item(NAME(m_sel1));
267243   save_item(NAME(m_tach0));
268244   save_item(NAME(m_tach1));
269245   save_item(NAME(m_rdy0));
270246   save_item(NAME(m_rdy1));
271   save_item(NAME(m_ds0));
272   save_item(NAME(m_ds1));
273247   save_item(NAME(m_l0ms));
274248   save_item(NAME(m_l1ms));
275249   save_item(NAME(m_st0));
r241714r241715
307281   m_via6->reset();
308282
309283   // set floppy callbacks
310   m_floppy0->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready0_cb), this));
311284   m_floppy0->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load0_cb), this));
312285   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));
314   m_floppy1->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready1_cb), this));
286
315287   m_floppy1->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load1_cb), this));
316288   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));
318289}
319290
320291
r241714r241715
324295
325296void victor_9000_fdc_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
326297{
327   live_sync();
328   live_run();
298   switch (id)
299   {
300   case TM_GEN:
301      live_sync();
302      live_run();
303      break;
304
305   case TM_TACH0:
306      m_tach0 = 1;
307      break;
308
309   case TM_TACH1:
310      m_tach1 = 1;
311      break;
312   }
329313}
330314
331315
r241714r241715
360344
361345READ8_MEMBER( victor_9000_fdc_t::floppy_p2_r )
362346{
363   /*
364
365       bit     description
366
367       0
368       1
369       2
370       3
371       4
372       5
373       6       RDY0
374       7       RDY1
375
376   */
377
378   UINT8 data = 0;
379
380   data |= m_rdy0 << 6;
381   data |= m_rdy1 << 7;
382
383   return data;
347   return m_p2; // TODO needed because of ORL/ANL P2, should be in mcs48.c
384348}
385349
386350
r241714r241715
400364       3       STOP1
401365       4       SEL1
402366       5       SEL0
403       6
404       7
367       6       RDY0
368       7       RDY1
405369
406370   */
407371
372   m_p2 = data;
373
408374   bool sync = false;
409375
410   int mtr0 = m_mtr0;
411   if ((data & 0x03) == 0x01) mtr0 = 0;
412   if ((data & 0x03) == 0x02) mtr0 = 1;
413   if (m_mtr0 != mtr0) sync = true;
376   int start0 = BIT(data, 0);
377   if (m_start0 != start0) sync = true;
414378
415   int mtr1 = m_mtr1;
416   if ((data & 0x0c) == 0x04) mtr1 = 0;
417   if ((data & 0x0c) == 0x08) mtr1 = 1;
418   if (m_mtr1 != mtr1) sync = true;
379   int stop0 = BIT(data, 1);
380   if (m_stop0 != stop0) sync = true;
419381
382   int start1 = BIT(data, 2);
383   if (m_start1 != start1) sync = true;
384
385   int stop1 = BIT(data, 3);
386   if (m_stop1 != stop1) sync = true;
387
420388   int sel0 = BIT(data, 5);
421389   if (m_sel0 != sel0) sync = true;
422390
423391   int sel1 = BIT(data, 4);
424392   if (m_sel1 != sel1) sync = true;
425393
394   m_rdy0 = BIT(data, 6);
395   m_rdy1 = BIT(data, 7);
396
397   if (LOG) logerror("%s %s START0/STOP0/SEL0/RDY0 %u/%u/%u/%u START1/STOP1/SEL1/RDY1 %u/%u/%u/%u\n", machine().time().as_string(), machine().describe_context(), start0, stop0, sel0, m_rdy0, start1, stop1, sel1, m_rdy1);
398
426399   if (sync)
427400   {
428401      live_sync();
429402
430      m_mtr0 = mtr0;
431      m_mtr1 = mtr1;
403      m_start0 = start0;
404      m_stop0 = stop0;
432405      m_sel0 = sel0;
406      update_spindle_motor(m_floppy0, t_tach0, m_start0, m_stop0, m_sel0, m_da0);
407
408      m_start1 = start1;
409      m_stop1 = stop1;
433410      m_sel1 = sel1;
411      update_spindle_motor(m_floppy1, t_tach1, m_start1, m_stop1, m_sel1, m_da1);
434412
435      if (LOG) logerror("%s MTR0 %u MTR1 %u SEL0 %u SEL1 %u\n", machine().time().as_string(), m_mtr0, m_mtr1, m_sel0, m_sel1);
436
437      update_spindle_motor();
438413      checkpoint();
439414
440      if (!m_mtr0 || !m_mtr1) {
415      if (!m_floppy0->mon_r() || !m_floppy1->mon_r()) {
441416         if(cur_live.state == IDLE) {
442417            live_start();
443418         }
r241714r241715
456431
457432READ8_MEMBER( victor_9000_fdc_t::tach0_r )
458433{
459   return m_tach0;
434   int tach0 = m_tach0;
435
436   m_tach0 = 0;
437
438   return tach0;
460439}
461440
462441
r241714r241715
466445
467446READ8_MEMBER( victor_9000_fdc_t::tach1_r )
468447{
469   return m_tach1;
448   int tach1 = m_tach1;
449
450   m_tach1 = 0;
451
452   return tach1;
470453}
471454
472455
473456void victor_9000_fdc_t::update_stepper_motor(floppy_image_device *floppy, int stp, int old_st, int st)
474457{
475   // TODO
458   if (stp) return;
459
460   int tracks = 0;
461
462   switch (old_st)
463   {
464   case   6: if (st == 0xa) tracks++; else if (st ==   5) tracks--; break;
465   case   5: if (st ==   6) tracks++; else if (st ==   9) tracks--; break;
466   case   9: if (st ==   5) tracks++; else if (st == 0xa) tracks--; break;
467   case 0xa: if (st ==   9) tracks++; else if (st ==   6) tracks--; break;
468   }
469
470   if (tracks == -1)
471   {
472      floppy->dir_w(1);
473      floppy->stp_w(1);
474      floppy->stp_w(0);
475   }
476   else if (tracks == 1)
477   {
478      floppy->dir_w(0);
479      floppy->stp_w(1);
480      floppy->stp_w(0);
481   }
476482}
477483
478void victor_9000_fdc_t::update_spindle_motor()
484void victor_9000_fdc_t::update_spindle_motor(floppy_image_device *floppy, emu_timer *t_tach, bool start, bool stop, bool sel, UINT8 &da)
479485{
480   if (m_sel0) m_da0 = m_da;
481   m_floppy0->mon_w(m_mtr0);
482   m_floppy0->set_rpm(300); // TODO
486   if (!start && !stop && floppy->mon_r()) {
487      if (LOG) logerror("%s: motor start\n", floppy->tag());
488      floppy->mon_w(0);
489   } else if (stop && !floppy->mon_r()) {
490      if (LOG) logerror("%s: motor stop\n", floppy->tag());
491      floppy->mon_w(1);
492   }
483493
484   if (m_sel1) m_da1 = m_da;
485   m_floppy1->mon_w(m_mtr1);
486   m_floppy1->set_rpm(300); // TODO
494   if (sel) {
495      da = m_da;
496   }
497
498   floppy->set_rpm(300); // TODO
499   t_tach->adjust(attotime::from_hz(5)); // TODO
487500}
488501
489502
r241714r241715
497510   {
498511      live_sync();
499512      m_da = data;
500      update_spindle_motor();
513      if (LOG) logerror("%s %s DA %02x\n", machine().time().as_string(), machine().describe_context(), data);
514      update_spindle_motor(m_floppy0, t_tach0, m_start0, m_stop0, m_sel0, m_da0);
515      update_spindle_motor(m_floppy1, t_tach1, m_start1, m_stop1, m_sel1, m_da1);
501516      checkpoint();
502517      live_run();
503518   }
r241714r241715
529544      live_sync();
530545      update_stepper_motor(m_floppy0, m_stp0, st0, m_st0);
531546      m_st0 = st0;
547      if (LOG) logerror("%s %s L0MS %01x ST0 %01x\n", machine().time().as_string(), machine().describe_context(), m_l0ms, st0);
532548      checkpoint();
533549      live_run();
534550   }
r241714r241715
560576      live_sync();
561577      update_stepper_motor(m_floppy1, m_stp1, st1, m_st1);
562578      m_st1 = st1;
579      if (LOG) logerror("%s %s L1MS %01x ST1 %01x\n", machine().time().as_string(), machine().describe_context(), m_l1ms, st1);
563580      checkpoint();
564581      live_run();
565582   }
r241714r241715
627644   if (m_wd != data)
628645   {
629646      live_sync();
630      m_wd = data;
631      cur_live.wd = data;
647      m_wd = cur_live.wd = data;
648      if (LOG) logerror("%s %s WD %02x\n", machine().time().as_string(), machine().describe_context(), data);
632649      checkpoint();
633650      live_run();
634651   }
r241714r241715
659676
660677   */
661678
679   if (LOG) logerror("%s %s TRK0D0 %u TRK0D1 %u\n", machine().time().as_string(), machine().describe_context(), m_floppy0->trk00_r(),m_floppy1->trk00_r());
680
662681   UINT8 data = 0;
663682
664683   // track 0 drive A sense
r241714r241715
721740      m_drive = drive;
722741      cur_live.drive = drive;
723742
743      if (LOG) logerror("%s %s SIDE %u DRIVE %u\n", machine().time().as_string(), machine().describe_context(), side, drive);
744
724745      checkpoint();
725746      live_run();
726747   }
r241714r241715
752773   data |= m_rdy1 << 1;
753774
754775   // door B sense
755   data |= m_ds1 << 3;
776   data |= (m_floppy1->exists() ? 0 : 1) << 3;
756777
757778   // door A sense
758   data |= m_ds0 << 4;
779   data |= (m_floppy0->exists() ? 0 : 1) << 4;
759780
760781   // single/double sided
761782   data |= (m_drive ? m_floppy1->twosid_r() : m_floppy0->twosid_r()) << 5;
r241714r241715
804825      m_stp1 = stp1;
805826      update_stepper_motor(m_floppy1, m_stp1, m_st1, m_st1);
806827
828      if (LOG) logerror("%s %s STP0 %u STP1 %u\n", machine().time().as_string(), machine().describe_context(), stp0, stp1);
829
807830      checkpoint();
808831      live_run();
809832   }
r241714r241715
816839      live_sync();
817840      m_drw = cur_live.drw = state;
818841      checkpoint();
819      if (LOG) logerror("%s DRW %u\n", machine().time().as_string(), state);
842      if (LOG) logerror("%s %s DRW %u\n", machine().time().as_string(), machine().describe_context(), state);
820843      if (state) {
821844         stop_writing(machine().time());
822845      } else {
r241714r241715
833856      live_sync();
834857      m_erase = cur_live.erase = state;
835858      checkpoint();
836      if (LOG) logerror("%s ERASE %u\n", machine().time().as_string(), state);
859      if (LOG) logerror("%s %s ERASE %u\n", machine().time().as_string(), machine().describe_context(), state);
837860      live_run();
838861   }
839862}
r241714r241715
851874   {
852875      live_sync();
853876      cur_live.lbrdy = 1;
877      if (LOG) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
854878      m_lbrdy_cb(1);
855879      checkpoint();
856880      live_run();
r241714r241715
865889   {
866890      live_sync();
867891      cur_live.lbrdy = 1;
892      if (LOG) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
868893      m_lbrdy_cb(1);
869894      checkpoint();
870895      live_run();
trunk/src/mess/machine/victor9k_fdc.h
r241714r241715
9999private:
100100   enum
101101   {
102      TM_GEN,
103      TM_TACH0,
104      TM_TACH1
105   };
106
107   enum
108   {
102109      LED_A = 0,
103110      LED_B
104111   };
r241714r241715
154161   required_device<via6522_device> m_via6;
155162   required_device<floppy_image_device> m_floppy0;
156163   required_device<floppy_image_device> m_floppy1;
164   required_memory_region m_rom;
157165   required_memory_region m_gcr_rom;
158166
159167   void update_stepper_motor(floppy_image_device *floppy, int stp, int old_st, int st);
160   void update_spindle_motor();
168   void update_spindle_motor(floppy_image_device *floppy, emu_timer *t_tach, bool start, bool stop, bool sel, UINT8 &da);
161169
162   void ready0_cb(floppy_image_device *, int device);
163170   int load0_cb(floppy_image_device *device);
164171   void unload0_cb(floppy_image_device *device);
165   void index0_cb(floppy_image_device *device, int state);
166   void ready1_cb(floppy_image_device *, int device);
172
167173   int load1_cb(floppy_image_device *device);
168174   void unload1_cb(floppy_image_device *device);
169   void index1_cb(floppy_image_device *device, int state);
170175
176   UINT8 m_p2;
177
171178   /* floppy state */
172179   UINT8 m_da;
173180   UINT8 m_da0;
174181   UINT8 m_da1;
175   int m_mtr0;
176   int m_mtr1;
182   int m_start0;
183   int m_stop0;
184   int m_start1;
185   int m_stop1;
177186   int m_sel0;
178187   int m_sel1;
179188   int m_tach0;
180189   int m_tach1;
181190   int m_rdy0;
182191   int m_rdy1;
183   int m_ds0;
184   int m_ds1;
185192   UINT8 m_l0ms;
186193   UINT8 m_l1ms;
187194   int m_st0;
r241714r241715
204211   attotime m_period;
205212
206213   live_info cur_live, checkpoint_live;
207   emu_timer *t_gen;
214   emu_timer *t_gen, *t_tach0, *t_tach1;
208215
209216   floppy_image_device* get_floppy();
210217   void live_start();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team