Previous 199869 Revisions Next

r33222 Wednesday 5th November, 2014 at 19:24:26 UTC by Curt Coder
(MESS) victor9k: Floppy WIP. (nw)
[src/lib/formats]flopimg.c flopimg.h victor9k_dsk.c victor9k_dsk.h
[src/mess/drivers]victor9k.c
[src/mess/machine]victor9k_fdc.c victor9k_fdc.h

trunk/src/lib/formats/flopimg.c
r241733r241734
10711071      type == CRC_CBM_START ||
10721072      type == CRC_MACHEAD_START ||
10731073      type == CRC_FCS_START ||
1074      type == CRC_VICTOR_HDR_START ||
1075      type == CRC_VICTOR_DATA_START ||
10741076      type == CRC_END ||
10751077      type == SECTOR_LOOP_START ||
10761078      type == SECTOR_LOOP_END ||
r241733r241734
11121114      case CRC_FCS_START:
11131115         crcs[desc[i].p1].type = CRC_FCS;
11141116         break;
1117      case CRC_VICTOR_HDR_START:
1118         crcs[desc[i].p1].type = CRC_VICTOR_HDR;
1119         break;
1120      case CRC_VICTOR_DATA_START:
1121         crcs[desc[i].p1].type = CRC_VICTOR_DATA;
1122         break;
11151123      }
11161124
11171125   for(int i=0; desc[i].type != END; i++)
r241733r241734
11311139   case CRC_CBM: return 10;
11321140   case CRC_MACHEAD: return 8;
11331141   case CRC_FCS: return 20;
1142   case CRC_VICTOR_HDR: return 10;
1143   case CRC_VICTOR_DATA: return 20;
11341144   default: return 0;
11351145   }
11361146}
r241733r241734
12711281   // TODO
12721282}
12731283
1284void floppy_image_format_t::fixup_crc_victor_header(UINT32 *buffer, const gen_crc_info *crc)
1285{
1286   UINT8 v = 0;
1287   for(int o = crc->start; o < crc->end; o+=10) {
1288      v += ((gcr5bw_tb[bitn_r(buffer, o, 5)] << 4) | gcr5bw_tb[bitn_r(buffer, o+5, 5)]);
1289   }
1290   int offset = crc->write;
1291   gcr5_w(buffer, offset, 10, v);
1292}
1293
1294void floppy_image_format_t::fixup_crc_victor_data(UINT32 *buffer, const gen_crc_info *crc)
1295{
1296   UINT16 v = 0;
1297   for(int o = crc->start; o < crc->end; o+=10) {
1298      v += ((gcr5bw_tb[bitn_r(buffer, o, 5)] << 4) | gcr5bw_tb[bitn_r(buffer, o+5, 5)]);
1299   }
1300   int offset = crc->write;
1301   gcr5_w(buffer, offset, 10, v & 0xff);
1302   gcr5_w(buffer, offset, 10, v >> 8);
1303}
1304
12741305void floppy_image_format_t::fixup_crcs(UINT32 *buffer, gen_crc_info *crcs)
12751306{
12761307   for(int i=0; i != MAX_CRC_COUNT; i++)
12771308      if(crcs[i].write != -1) {
12781309         switch(crcs[i].type) {
1279         case CRC_AMIGA:   fixup_crc_amiga(buffer, crcs+i); break;
1280         case CRC_CBM:     fixup_crc_cbm(buffer, crcs+i); break;
1281         case CRC_CCITT:   fixup_crc_ccitt(buffer, crcs+i); break;
1282         case CRC_CCITT_FM:fixup_crc_ccitt_fm(buffer, crcs+i); break;
1283         case CRC_MACHEAD: fixup_crc_machead(buffer, crcs+i); break;
1284         case CRC_FCS:     fixup_crc_fcs(buffer, crcs+i); break;
1310         case CRC_AMIGA:         fixup_crc_amiga(buffer, crcs+i); break;
1311         case CRC_CBM:         fixup_crc_cbm(buffer, crcs+i); break;
1312         case CRC_CCITT:         fixup_crc_ccitt(buffer, crcs+i); break;
1313         case CRC_CCITT_FM:      fixup_crc_ccitt_fm(buffer, crcs+i); break;
1314         case CRC_MACHEAD:      fixup_crc_machead(buffer, crcs+i); break;
1315         case CRC_FCS:         fixup_crc_fcs(buffer, crcs+i); break;
1316         case CRC_VICTOR_HDR:   fixup_crc_victor_header(buffer, crcs+i); break;
1317         case CRC_VICTOR_DATA:   fixup_crc_victor_data(buffer, crcs+i); break;
12851318         }
12861319         if(crcs[i].fixup_mfm_clock) {
12871320            int offset = crcs[i].write + crc_cells_size(crcs[i].type);
r241733r241734
14031436         raw_w(buffer, offset, desc[index].p2, desc[index].p1);
14041437         break;
14051438
1439      case SYNC_GCR5:
1440         for(int i=0; i<desc[index].p1; i++)
1441            raw_w(buffer, offset, 10, 0xffff);
1442         break;
1443
14061444      case TRACK_ID:
14071445         mfm_w(buffer, offset, 8, track);
14081446         break;
r241733r241734
14271465         _8n1_w(buffer, offset, 8, track);
14281466         break;
14291467
1468      case TRACK_ID_VICTOR_GCR5:
1469         gcr5_w(buffer, offset, 10, 1 + track + (head * 0x80));
1470         break;
1471
14301472      case HEAD_ID:
14311473         mfm_w(buffer, offset, 8, head);
14321474         break;
r241733r241734
15361578      case CRC_CCITT_FM_START:
15371579      case CRC_MACHEAD_START:
15381580      case CRC_FCS_START:
1581      case CRC_VICTOR_HDR_START:
1582      case CRC_VICTOR_DATA_START:
15391583         crcs[desc[index].p1].start = offset;
15401584         break;
15411585
trunk/src/lib/formats/flopimg.h
r241733r241734
307307      RAW,                    //!< One 16 bits word in p1 to be written raw, msb first, repeated p2 times
308308      RAWBYTE,                //!< One 8 bit byte in p1 to be written raw, msb first, repeated p2 times
309309      RAWBITS,                //!< A value of p2 bits in p1 to be copied as-is, msb first
310      SYNC_GCR5,              //!< gcr5 sync byte
310311      TRACK_ID,               //!< Track id byte, mfm-encoded
311312      TRACK_ID_FM,            //!< Track id byte, fm-encoded
312313      TRACK_ID_DOS2_GCR5,     //!< Track id byte, gcr5-encoded
313314      TRACK_ID_DOS25_GCR5,    //!< Track id byte, gcr5-encoded
314315      TRACK_ID_GCR6,          //!< Track id low 6 bits, gcr6-encoded
315316      TRACK_ID_8N1,           //!< Track id byte, 8N1-encoded
317      TRACK_ID_VICTOR_GCR5,   //!< Track id byte, gcr5-encoded
316318      HEAD_ID,                //!< Head id byte, mfm-encoded
317319      HEAD_ID_FM,             //!< Head id byte, fm-encoded
318320      HEAD_ID_SWAP,           //!< Head id byte swapped (0->1, 1->0), mfm-encoded
r241733r241734
346348      CRC_CBM_START,          //!< Start a CBM checksum calculation (xor of original data values, gcr5-encoded), p1 = crc id
347349      CRC_MACHEAD_START,      //!< Start of the mac gcr6 sector header checksum calculation (xor of pre-encode 6-bits values, gcr6-encoded)
348350      CRC_FCS_START,          //!< Start a Compucolor File Control System checksum calculation, p1 = crc id
351      CRC_VICTOR_HDR_START,   //!< Start a Victor 9000 checksum calculation, p1 = crc id
352      CRC_VICTOR_DATA_START,   //!< Start a Victor 9000 checksum calculation, p1 = crc id
349353      CRC_END,                //!< End the checksum, p1 = crc id
350354      CRC,                    //!< Write a checksum in the apporpriate format, p1 = crc id
351355
r241733r241734
565569   UINT8 sbyte_mfm_r(const UINT8 *bitstream, int &pos, int track_size);
566570
567571private:
568   enum { CRC_NONE, CRC_AMIGA, CRC_CBM, CRC_CCITT, CRC_CCITT_FM, CRC_MACHEAD, CRC_FCS };
572   enum { CRC_NONE, CRC_AMIGA, CRC_CBM, CRC_CCITT, CRC_CCITT_FM, CRC_MACHEAD, CRC_FCS, CRC_VICTOR_HDR, CRC_VICTOR_DATA };
569573   enum { MAX_CRC_COUNT = 64 };
570574
571575   //! Holds data used internally for generating CRCs.
r241733r241734
587591   void fixup_crc_ccitt_fm(UINT32 *buffer, const gen_crc_info *crc);
588592   void fixup_crc_machead(UINT32 *buffer, const gen_crc_info *crc);
589593   void fixup_crc_fcs(UINT32 *buffer, const gen_crc_info *crc);
594   void fixup_crc_victor_header(UINT32 *buffer, const gen_crc_info *crc);
595   void fixup_crc_victor_data(UINT32 *buffer, const gen_crc_info *crc);
590596   void fixup_crcs(UINT32 *buffer, gen_crc_info *crcs);
591597   void collect_crcs(const desc_e *desc, gen_crc_info *crcs);
592598
trunk/src/lib/formats/victor9k_dsk.c
r241733r241734
3737   8           unused      75-79       11          144.0        417
3838
3939   Interleave factor 3
40   cell 2.13 usec
4041
4142*/
4243
r241733r241734
8384   return 0;
8485}
8586
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)
87floppy_image_format_t::desc_e* victor9k_format::get_sector_desc(const format &f, int &current_size, int sector_count)
8788{
8889   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 }
90      /* 00 */ { SECTOR_INTERLEAVE_SKEW, 0, 0},
91      /* 01 */ { SECTOR_LOOP_START, 0, -1 },
92      /* 02 */ {   SYNC_GCR5, 6 },
93      /* 03 */ {   GCR5, 0x07, 1 },
94      /* 04 */ {   CRC_VICTOR_HDR_START, 1 },
95      /* 05 */ {     TRACK_ID_VICTOR_GCR5 },
96      /* 06 */ {     SECTOR_ID_GCR5 },
97      /* 07 */ {   CRC_END, 1 },
98      /* 08 */ {   CRC, 1 },
99      /* 09 */ {   RAWBYTE, 0x55, 8 },
100      /* 10 */ {   SYNC_GCR5, 5 },
101      /* 11 */ {   GCR5, 0x08, 1 },
102      /* 12 */ {   CRC_VICTOR_DATA_START, 2 },
103      /* 13 */ {     SECTOR_DATA_GCR5, -1 },
104      /* 14 */ {   CRC_END, 2 },
105      /* 15 */ {   CRC, 2 },
106      /* 16 */ {   RAWBYTE, 0x55, 8 },
107      /* 17 */ { SECTOR_LOOP_END },
108      /* 18 */ { RAWBYTE, 0x55, 0 },
109      /* 19 */ { RAWBITS, 0x5555, 0 },
110      /* 20 */ { END }
113111   };
114112
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;
113   current_size = 60 + (1+1+1+1)*10 + 8*8 + 50 + (1+f.sector_base_size+2)*10 + 8*8;
116114
117115   current_size *= sector_count;
118116   return desc;
r241733r241734
145143
146144   int track_offset = 0;
147145
148   UINT8 id1 = 0xde, id2 = 0xad; // TODO
149
150146   for (int head = 0; head < f.head_count; head++) {
151147      for (int track = 0; track < f.track_count; track++) {
152148         int current_size = 0;
r241733r241734
154150         int sector_count = sectors_per_track[head][track];
155151         int track_size = sector_count*f.sector_base_size;
156152
157         floppy_image_format_t::desc_e *desc = get_sector_desc(f, current_size, sector_count, id1, id2, f.gap_2);
153         floppy_image_format_t::desc_e *desc = get_sector_desc(f, current_size, sector_count);
158154
159155         int remaining_size = total_size - current_size;
160156         if(remaining_size < 0)
161157            throw emu_fatalerror("victor9k_format: Incorrect track layout, max_size=%d, current_size=%d", total_size, current_size);
162158
163159         // 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;
160         desc[18].p2 = remaining_size / 8;
161         desc[19].p2 = remaining_size & 7;
162         desc[19].p1 >>= remaining_size & 0x01;
167163
168164         desc_s sectors[40];
169165
r241733r241734
184180   return false;
185181}
186182
183int victor9k_format::get_rpm(int head, int track)
184{
185   return rpm[speed_zone[head][track]];
186}
187
187188const victor9k_format::format victor9k_format::formats[] = {
188189   { //
189      floppy_image::FF_525, floppy_image::SSDD, 1224, 80, 1, 512, 9, 8
190      floppy_image::FF_525, floppy_image::SSDD, 1224, 80, 1, 512
190191   },
191192   { //
192      floppy_image::FF_525, floppy_image::DSDD, 2448, 80, 2, 512, 9, 8
193      floppy_image::FF_525, floppy_image::DSDD, 2448, 80, 2, 512
193194   },
194195   {}
195196};
196197
197const UINT32 victor9k_format::cell_size[] =
198const UINT32 victor9k_format::cell_size[9] =
198199{
199200   1789, 1896, 2009, 2130, 2272, 2428, 2613, 2847, 2961
200201};
r241733r241734
247248   }
248249};
249250
251const int victor9k_format::rpm[9] =
252{
253   252, 267, 283, 300, 320, 342, 368, 401, 417
254};
255
250256const floppy_format_type FLOPPY_VICTOR_9000_FORMAT = &floppy_image_format_creator<victor9k_format>;
trunk/src/lib/formats/victor9k_dsk.h
r241733r241734
2323      UINT8 track_count;
2424      UINT8 head_count;
2525      UINT16 sector_base_size;
26      UINT8 gap_1;
27      UINT8 gap_2;
2826   };
2927
3028   victor9k_format();
r241733r241734
3533
3634   int find_size(io_generic *io, UINT32 form_factor);
3735   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);
36   floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count);
3937   void build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, desc_s *sectors, int sector_count) const;
4038   virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
4139   virtual bool supports_save() const;
4240
41   static int get_rpm(int head, int track);
42
4343protected:
4444   static const format formats[];
4545
46   static const UINT32 cell_size[];
46   static const UINT32 cell_size[9];
4747   static const int sectors_per_track[2][80];
4848   static const int speed_zone[2][80];
49   static const int rpm[9];
4950};
5051
5152extern const floppy_format_type FLOPPY_VICTOR_9000_FORMAT;
trunk/src/mess/drivers/victor9k.c
r241733r241734
510510
511511   MCFG_DEVICE_ADD(FDC_TAG, VICTOR_9000_FDC, 0)
512512   MCFG_VICTOR_9000_FDC_IRQ_CB(WRITELINE(victor9k_state, fdc_irq_w))
513   MCFG_VICTOR_9000_FDC_SYN_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir0_w))
513   MCFG_VICTOR_9000_FDC_SYN_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir0_w)) MCFG_DEVCB_XOR(1)
514514   MCFG_VICTOR_9000_FDC_LBRDY_CB(INPUTLINE(I8088_TAG, INPUT_LINE_TEST))
515515
516516   // internal ram
trunk/src/mess/machine/victor9k_fdc.c
r241733r241734
1313
1414    TODO:
1515
16   - floppy format
17   - spindle speed
16   - disk error 8 (sync missing?)
17   - 8048 spindle speed control
1818    - read PLL
1919    - write logic
2020
r241733r241734
2929//**************************************************************************
3030
3131#define LOG 1
32#define LOG_VIA 1
33#define LOG_SCP 0
3234
3335#define I8048_TAG       "5d"
3436#define M6522_4_TAG     "1f"
r241733r241734
182184   m_via6(*this, M6522_6_TAG),
183185   m_floppy0(*this, I8048_TAG":0:525qd"),
184186   m_floppy1(*this, I8048_TAG":1:525qd"),
185   m_rom(*this, I8048_TAG),
186187   m_gcr_rom(*this, "gcr"),
187188   m_da(0),
188189   m_da0(0),
r241733r241734
209210   m_via5_irq(CLEAR_LINE),
210211   m_via6_irq(CLEAR_LINE),
211212   m_syn(0),
212   m_lbrdy(1)
213   m_lbrdy(1),
214   m_period(attotime::from_nsec(21300))
213215{
214216   cur_live.tm = attotime::never;
215217   cur_live.state = IDLE;
r241733r241734
303305      break;
304306
305307   case TM_TACH0:
306      m_tach0 = 1;
308      // TODO
307309      break;
308310
309311   case TM_TACH1:
310      m_tach1 = 1;
312      // TODO
311313      break;
312314   }
313315}
r241733r241734
391393   int sel1 = BIT(data, 4);
392394   if (m_sel1 != sel1) sync = true;
393395
394   m_rdy0 = BIT(data, 6);
395   m_rdy1 = BIT(data, 7);
396   //m_rdy0 = BIT(data, 6);
397   //m_via5->write_ca2(m_rdy0);
396398
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);
399   //m_rdy1 = BIT(data, 7);
400   //m_via5->write_cb2(m_rdy1);
398401
402   if (LOG_SCP) 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);
403
399404   if (sync)
400405   {
401406      live_sync();
r241733r241734
403408      m_start0 = start0;
404409      m_stop0 = stop0;
405410      m_sel0 = sel0;
406      update_spindle_motor(m_floppy0, t_tach0, m_start0, m_stop0, m_sel0, m_da0);
411      //update_spindle_motor(m_floppy0, t_tach0, m_start0, m_stop0, m_sel0, m_da0);
407412
408413      m_start1 = start1;
409414      m_stop1 = stop1;
410415      m_sel1 = sel1;
411      update_spindle_motor(m_floppy1, t_tach1, m_start1, m_stop1, m_sel1, m_da1);
416      //update_spindle_motor(m_floppy1, t_tach1, m_start1, m_stop1, m_sel1, m_da1);
412417
413418      checkpoint();
414419
r241733r241734
431436
432437READ8_MEMBER( victor_9000_fdc_t::tach0_r )
433438{
434   int tach0 = m_tach0;
435
436   m_tach0 = 0;
437
438   return tach0;
439   return m_tach0;
439440}
440441
441442
r241733r241734
445446
446447READ8_MEMBER( victor_9000_fdc_t::tach1_r )
447448{
448   int tach1 = m_tach1;
449
450   m_tach1 = 0;
451
452   return tach1;
449   return m_tach1;
453450}
454451
455452
r241733r241734
483480
484481void victor_9000_fdc_t::update_spindle_motor(floppy_image_device *floppy, emu_timer *t_tach, bool start, bool stop, bool sel, UINT8 &da)
485482{
486   if (!start && !stop && floppy->mon_r()) {
487      if (LOG) logerror("%s: motor start\n", floppy->tag());
483   if (start && !stop && floppy->mon_r()) {
484      if (LOG_SCP) logerror("%s: motor start\n", floppy->tag());
488485      floppy->mon_w(0);
489486   } else if (stop && !floppy->mon_r()) {
490      if (LOG) logerror("%s: motor stop\n", floppy->tag());
487      if (LOG_SCP) logerror("%s: motor stop\n", floppy->tag());
491488      floppy->mon_w(1);
492489   }
493490
494491   if (sel) {
495492      da = m_da;
496493   }
497
498   floppy->set_rpm(300); // TODO
499   t_tach->adjust(attotime::from_hz(5)); // TODO
500494}
501495
502496
r241733r241734
506500
507501WRITE8_MEMBER( victor_9000_fdc_t::da_w )
508502{
503   if (LOG_SCP) logerror("%s %s DA %02x\n", machine().time().as_string(), machine().describe_context(), data);
504
509505   if (m_da != data)
510506   {
511507      live_sync();
512508      m_da = data;
513      if (LOG) logerror("%s %s DA %02x\n", machine().time().as_string(), machine().describe_context(), data);
514509      update_spindle_motor(m_floppy0, t_tach0, m_start0, m_stop0, m_sel0, m_da0);
515510      update_spindle_motor(m_floppy1, t_tach1, m_start1, m_stop1, m_sel1, m_da1);
516511      checkpoint();
r241733r241734
537532
538533   m_l0ms = data & 0x0f;
539534
535   { // HACK to bypass SCP
536      m_floppy0->mon_w((m_l0ms == 0xf) ? 1 : 0);
537      m_floppy0->set_rpm(victor9k_format::get_rpm(m_side, m_floppy0->get_cyl()));
538      m_rdy0 = (m_l0ms == 0xf) ? 0 : 1;
539      m_via5->write_ca2(m_rdy0);
540   }
541
540542   UINT8 st0 = data >> 4;
541543
544   if (LOG_VIA) logerror("%s %s L0MS %01x ST0 %01x\n", machine().time().as_string(), machine().describe_context(), m_l0ms, st0);
545
542546   if (m_st0 != st0)
543547   {
544548      live_sync();
545549      update_stepper_motor(m_floppy0, m_stp0, st0, m_st0);
546550      m_st0 = st0;
547      if (LOG) logerror("%s %s L0MS %01x ST0 %01x\n", machine().time().as_string(), machine().describe_context(), m_l0ms, st0);
548551      checkpoint();
549552      live_run();
550553   }
r241733r241734
569572
570573   m_l1ms = data & 0x0f;
571574
575   { // HACK to bypass SCP
576      m_floppy1->mon_w((m_l1ms == 0xf) ? 1 : 0);
577      m_floppy1->set_rpm(victor9k_format::get_rpm(m_side, m_floppy1->get_cyl()));
578      m_rdy1 = (m_l1ms == 0xf) ? 0 : 1;
579      m_via5->write_cb2(m_rdy1);
580   }
581
572582   UINT8 st1 = data >> 4;
573583
584   if (LOG_VIA) logerror("%s %s L1MS %01x ST1 %01x\n", machine().time().as_string(), machine().describe_context(), m_l1ms, st1);
585
574586   if (m_st1 != st1)
575587   {
576588      live_sync();
577589      update_stepper_motor(m_floppy1, m_stp1, st1, m_st1);
578590      m_st1 = st1;
579      if (LOG) logerror("%s %s L1MS %01x ST1 %01x\n", machine().time().as_string(), machine().describe_context(), m_l1ms, st1);
580591      checkpoint();
581592      live_run();
582593   }
r241733r241734
590601      m_wrsync = state;
591602      cur_live.wrsync = state;
592603      checkpoint();
604      if (LOG_VIA) logerror("%s %s ERASE %u\n", machine().time().as_string(), machine().describe_context(), state);
593605      live_run();
594606   }
595607}
r241733r241734
645657   {
646658      live_sync();
647659      m_wd = cur_live.wd = data;
648      if (LOG) logerror("%s %s WD %02x\n", machine().time().as_string(), machine().describe_context(), data);
660      if (LOG_VIA) logerror("%s %s WD %02x\n", machine().time().as_string(), machine().describe_context(), data);
649661      checkpoint();
650662      live_run();
651663   }
r241733r241734
676688
677689   */
678690
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());
691   if (LOG_VIA) logerror("%s %s TRK0D0 %u TRK0D1 %u SYNC %u\n", machine().time().as_string(), machine().describe_context(), m_floppy0->trk00_r(), m_floppy1->trk00_r(), checkpoint_live.sync);
680692
681693   UINT8 data = 0;
682694
r241733r241734
740752      m_drive = drive;
741753      cur_live.drive = drive;
742754
743      if (LOG) logerror("%s %s SIDE %u DRIVE %u\n", machine().time().as_string(), machine().describe_context(), side, drive);
755      if (LOG_VIA) logerror("%s %s SIDE %u DRIVE %u\n", machine().time().as_string(), machine().describe_context(), side, drive);
744756
745757      checkpoint();
746758      live_run();
r241733r241734
825837      m_stp1 = stp1;
826838      update_stepper_motor(m_floppy1, m_stp1, m_st1, m_st1);
827839
828      if (LOG) logerror("%s %s STP0 %u STP1 %u\n", machine().time().as_string(), machine().describe_context(), stp0, stp1);
840      if (LOG_VIA) logerror("%s %s STP0 %u STP1 %u\n", machine().time().as_string(), machine().describe_context(), stp0, stp1);
829841
830842      checkpoint();
831843      live_run();
r241733r241734
839851      live_sync();
840852      m_drw = cur_live.drw = state;
841853      checkpoint();
842      if (LOG) logerror("%s %s DRW %u\n", machine().time().as_string(), machine().describe_context(), state);
854      if (LOG_VIA) logerror("%s %s DRW %u\n", machine().time().as_string(), machine().describe_context(), state);
843855      if (state) {
844856         stop_writing(machine().time());
845857      } else {
r241733r241734
856868      live_sync();
857869      m_erase = cur_live.erase = state;
858870      checkpoint();
859      if (LOG) logerror("%s %s ERASE %u\n", machine().time().as_string(), machine().describe_context(), state);
871      if (LOG_VIA) logerror("%s %s ERASE %u\n", machine().time().as_string(), machine().describe_context(), state);
860872      live_run();
861873   }
862874}
r241733r241734
874886   {
875887      live_sync();
876888      cur_live.lbrdy = 1;
877      if (LOG) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
889      if (LOG_VIA) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
878890      m_lbrdy_cb(1);
879891      checkpoint();
880892      live_run();
r241733r241734
889901   {
890902      live_sync();
891903      cur_live.lbrdy = 1;
892      if (LOG) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
904      if (LOG_VIA) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
893905      m_lbrdy_cb(1);
894906      checkpoint();
895907      live_run();
r241733r241734
11571169
11581170void victor_9000_fdc_t::get_next_edge(const attotime &when)
11591171{
1160   // TODO
1172   floppy_image_device *floppy = get_floppy();
1173
1174   cur_live.edge = floppy ? floppy->get_next_transition(when) : attotime::never;
11611175}
11621176
11631177int victor_9000_fdc_t::get_next_bit(attotime &tm, const attotime &limit)
11641178{
1165   return -1; // TODO
1179   attotime next = tm + m_period;
1180
1181   int bit = (cur_live.edge.is_never() || cur_live.edge >= next) ? 0 : 1;
1182
1183   if (bit) {
1184      get_next_edge(next);
1185   }
1186
1187   return bit;
11661188}
trunk/src/mess/machine/victor9k_fdc.h
r241733r241734
161161   required_device<via6522_device> m_via6;
162162   required_device<floppy_image_device> m_floppy0;
163163   required_device<floppy_image_device> m_floppy1;
164   required_memory_region m_rom;
165164   required_memory_region m_gcr_rom;
166165
167166   void update_stepper_motor(floppy_image_device *floppy, int stp, int old_st, int st);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team