Previous 199869 Revisions Next

r33176 Monday 3rd November, 2014 at 20:00:29 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
r241687r241688
22// copyright-holders:Curt Coder
33/*********************************************************************
44
5    formats/victor9k_dsk.c
5   formats/victor9k_dsk.c
66
7    Victor 9000 sector disk image format
7   Victor 9000 sector disk image format
88
99*********************************************************************/
1010
1111/*
1212
13    Sector format
14    -------------
13   Sector format
14   -------------
1515
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
2222
23    Track format
24    ------------
23   Track format
24   ------------
2525
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)
2828
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
3838
3939*/
4040
r241687r241688
4747
4848const char *victor9k_format::name() const
4949{
50    return "victor9k";
50   return "victor9k";
5151}
5252
5353const char *victor9k_format::description() const
5454{
55    return "Victor 9000 disk image";
55   return "Victor 9000 disk image";
5656}
5757
5858const char *victor9k_format::extensions() const
5959{
60    return "img";
60   return "img";
6161}
6262
6363int victor9k_format::identify(io_generic *io, UINT32 form_factor)
6464{
65    return 0;
65   return 0;
6666}
6767
6868bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
6969{
70    return false;
70   return false;
7171}
7272
7373bool victor9k_format::supports_save() const
7474{
75    return false;
75   return false;
7676}
7777
7878const 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   {}
8686};
8787
8888const UINT32 victor9k_format::cell_size[] =
8989{
90    0
90   0
9191};
9292
93const int victor9k_format::sectors_per_track[] =
93const int victor9k_format::sectors_per_track[2][80] =
9494{
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   }
96115};
97116
98const int victor9k_format::speed_zone[] =
117const int victor9k_format::speed_zone[2][80] =
99118{
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   }
101139};
102140
103141const floppy_format_type FLOPPY_VICTOR_9000_FORMAT = &floppy_image_format_creator<victor9k_format>;
trunk/src/lib/formats/victor9k_dsk.h
r241687r241688
3838   static const format formats[];
3939
4040   static const UINT32 cell_size[];
41   static const int sectors_per_track[];
42   static const int speed_zone[];
41   static const int sectors_per_track[2][80];
42   static const int speed_zone[2][80];
4343};
4444
4545extern const floppy_format_type FLOPPY_VICTOR_9000_FORMAT;
trunk/src/mess/drivers/victor9k.c
r241687r241688
509509
510510   MCFG_DEVICE_ADD(FDC_TAG, VICTOR_9000_FDC, 0)
511511   MCFG_VICTOR_9000_FDC_IRQ_CB(WRITELINE(victor9k_state, fdc_irq_w))
512   MCFG_VICTOR_9000_FDC_SYN_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir0_w))
513   MCFG_VICTOR_9000_FDC_LBRDY_CB(INPUTLINE(I8088_TAG, INPUT_LINE_TEST))
512514
513515   // internal ram
514516   MCFG_RAM_ADD(RAM_TAG)
trunk/src/mess/machine/victor9k_fdc.c
r241687r241688
1717   - spindle speed
1818   - stepper
1919    - read PLL
20    - TACH0/1
2120    - write logic
2221
2322*/
r241687r241688
109108   m_via4->write_ca1(m_ds0);
110109}
111110
111void victor_9000_fdc_t::index0_cb(floppy_image_device *device, int state)
112{
113   m_tach0 = state;
114}
115
112116void victor_9000_fdc_t::ready1_cb(floppy_image_device *device, int state)
113117{
114118   m_rdy1 = state;
r241687r241688
132136   m_via4->write_cb1(m_ds1);
133137}
134138
139void victor_9000_fdc_t::index1_cb(floppy_image_device *device, int state)
140{
141   m_tach1 = state;
142}
143
135144static 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
137147SLOT_INTERFACE_END
138148
139149FLOPPY_FORMATS_MEMBER( victor_9000_fdc_t::floppy_formats )
r241687r241688
246256void victor_9000_fdc_t::device_start()
247257{
248258   // 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);
252260
253261   // state saving
254262   save_item(NAME(m_da));
r241687r241688
302310   m_floppy0->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready0_cb), this));
303311   m_floppy0->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load0_cb), this));
304312   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));
305314   m_floppy1->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready1_cb), this));
306315   m_floppy1->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load1_cb), this));
307316   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));
308318}
309319
310320
r241687r241688
314324
315325void victor_9000_fdc_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
316326{
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();
331329}
332330
333331
r241687r241688
482480   if (m_sel0) m_da0 = m_da;
483481   m_floppy0->mon_w(m_mtr0);
484482   m_floppy0->set_rpm(300); // TODO
485   t_tach0->adjust(attotime::never); // TODO
486483
487484   if (m_sel1) m_da1 = m_da;
488485   m_floppy1->mon_w(m_mtr1);
489486   m_floppy1->set_rpm(300); // TODO
490   t_tach1->adjust(attotime::never); // TODO
491487}
492488
493489
trunk/src/mess/machine/victor9k_fdc.h
r241687r241688
9999private:
100100   enum
101101   {
102      TM_GEN,
103      TM_TACH0,
104      TM_TACH1
105   };
106
107   enum
108   {
109102      LED_A = 0,
110103      LED_B
111104   };
r241687r241688
167160   void ready0_cb(floppy_image_device *, int device);
168161   int load0_cb(floppy_image_device *device);
169162   void unload0_cb(floppy_image_device *device);
163   void index0_cb(floppy_image_device *device, int state);
170164   void ready1_cb(floppy_image_device *, int device);
171165   int load1_cb(floppy_image_device *device);
172166   void unload1_cb(floppy_image_device *device);
167   void index1_cb(floppy_image_device *device, int state);
173168
174169   /* floppy state */
175170   UINT8 m_da;
r241687r241688
207202   attotime m_period;
208203
209204   live_info cur_live, checkpoint_live;
210   emu_timer *t_gen, *t_tach0, *t_tach1;
205   emu_timer *t_gen;
211206
212207   floppy_image_device* get_floppy();
213208   void live_start();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team