Previous 199869 Revisions Next

r33648 Wednesday 3rd December, 2014 at 14:33:29 UTC by Curt Coder
(MESS) victor9k: Floppy WIP. (nw)
[src/lib/formats]flopimg.c
[src/mess/machine]victor9k_fdc.c victor9k_fdc.h

trunk/src/lib/formats/flopimg.c
r242159r242160
14661466         break;
14671467
14681468      case TRACK_ID_VICTOR_GCR5:
1469         gcr5_w(buffer, offset, 10, 1 + track + (head * 0x80));
1469         gcr5_w(buffer, offset, 10, track + (head * 0x80));
14701470         break;
14711471
14721472      case HEAD_ID:
trunk/src/mess/machine/victor9k_fdc.c
r242159r242160
1111
1212/*
1313
14   value   error description
15
16   01      no sync pulse detected
17   02      no header track
18   03      checksum error in header
19   04      not right track
20   05      not right sector
21   06      not a data block
22   07      data checksum error
23   08      sync too long
24   99      not a system disc
25
26*/
27
28/*
29
1430    TODO:
1531
16    - disk error 2 (cannot find block header?)
32   - communication error with SCP after loading boot sector
1733    - 8048 spindle speed control
1834    - read PLL
1935    - write logic
r242159r242160
3753#define M6522_5_TAG     "1k"
3854#define M6522_6_TAG     "1h"
3955
56#define GCR_DECODE(_e, _i) \
57    ((BIT(_e, 6) << 7) | (BIT(_i, 7) << 6) | (_e & 0x33) | (BIT(_e, 2) << 3) | (_i & 0x04))
4058
4159
4260//**************************************************************************
r242159r242160
209227   m_via4_irq(CLEAR_LINE),
210228   m_via5_irq(CLEAR_LINE),
211229   m_via6_irq(CLEAR_LINE),
212   m_syn(0),
213   m_lbrdy(1),
214230   m_period(attotime::from_nsec(2130))
215231{
216232   cur_live.tm = attotime::never;
r242159r242160
259275   save_item(NAME(m_via4_irq));
260276   save_item(NAME(m_via5_irq));
261277   save_item(NAME(m_via6_irq));
262   save_item(NAME(m_syn));
263   save_item(NAME(m_lbrdy));
264278}
265279
266280
r242159r242160
630644
631645   */
632646
633   UINT8 e = checkpoint_live.e;
634   UINT8 i = checkpoint_live.i;
635
636   return BIT(e, 6) << 7 | BIT(i, 7) << 6 | BIT(e, 5) << 5 | BIT(e, 4) << 4 | BIT(e, 2) << 3 | BIT(i, 1) << 2 | (e & 0x03);
647   return GCR_DECODE(checkpoint_live.e, checkpoint_live.i);
637648}
638649
639650WRITE8_MEMBER( victor_9000_fdc_t::via5_pb_w )
r242159r242160
886897   {
887898      live_sync();
888899      cur_live.lbrdy = 1;
889      if (LOG_VIA) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
890      m_lbrdy_cb(1);
891      checkpoint();
892      live_run();
900      cur_live.lbrdy_changed = true;
901      if (LOG_VIA) logerror("%s %s LBRDY 1 : %02x\n", machine().time().as_string(), machine().describe_context(), m_via5->read(space, offset));
902      live_delay(RUNNING_SYNCPOINT);
893903   }
894904
895905   return m_via5->read(space, offset);
r242159r242160
901911   {
902912      live_sync();
903913      cur_live.lbrdy = 1;
914      cur_live.lbrdy_changed = true;
904915      if (LOG_VIA) logerror("%s %s LBRDY 1\n", machine().time().as_string(), machine().describe_context());
905      m_lbrdy_cb(1);
906      checkpoint();
907      live_run();
916      live_delay(RUNNING_SYNCPOINT);
908917   }
909918
910919   m_via5->write(space, offset, data);
r242159r242160
10451054
10461055   cur_live.brdy = 1;
10471056   cur_live.lbrdy = 1;
1057   cur_live.lbrdy_changed = true;
10481058   cur_live.sync = 1;
10491059   cur_live.syn = 1;
1060   cur_live.syn_changed = true;
10501061   cur_live.gcr_err = 1;
10511062}
10521063
r242159r242160
10881099         // sync counter
10891100         if (sync) {
10901101            cur_live.sync_bit_counter = 0;
1091            cur_live.sync_byte_counter = 10;
1102            cur_live.sync_byte_counter = 9;
10921103         } else if (!cur_live.sync) {
10931104            cur_live.sync_bit_counter++;
10941105            if (cur_live.sync_bit_counter == 10) {
r242159r242160
11031114         // syn
11041115         int syn = !(cur_live.sync_byte_counter == 15);
11051116
1106         if (LOG) logerror("%s bit %u sync %u bc %u sbc %u sBC %u syn %u\n",cur_live.tm.as_string(),bit,sync,cur_live.bit_counter,cur_live.sync_bit_counter,cur_live.sync_byte_counter,syn);
1107
11081117         // GCR decoder
11091118         if (cur_live.drw) {
11101119            cur_live.i = cur_live.drw << 10 | cur_live.shift_reg;
r242159r242160
11141123
11151124         cur_live.e = m_gcr_rom->base()[cur_live.i];
11161125
1126         if (LOG) logerror("%s bit %u sync %u bc %u sbc %u sBC %u syn %u i %03x e %02x\n",cur_live.tm.as_string(),bit,sync,cur_live.bit_counter,cur_live.sync_bit_counter,cur_live.sync_byte_counter,syn,cur_live.i,cur_live.e);
1127
11171128         // byte ready
11181129         int brdy = !(cur_live.bit_counter == 9);
11191130
r242159r242160
11221133
11231134         if (brdy != cur_live.brdy) {
11241135            if (LOG) logerror("%s BRDY %u\n", cur_live.tm.as_string(),brdy);
1125            if (LOG && !brdy)
1136            if (!brdy)
11261137            {
1127               UINT8 e = cur_live.e;
1128               UINT8 i = cur_live.i;
1129
1130               UINT8 data = BIT(e, 6) << 7 | BIT(i, 7) << 6 | BIT(e, 5) << 5 | BIT(e, 4) << 4 | BIT(e, 2) << 3 | BIT(i, 1) << 2 | (e & 0x03);
1131               logerror("%s BRDY %02x\n",cur_live.tm.as_string(),data);
1138               cur_live.lbrdy = 0;
1139               cur_live.lbrdy_changed = true;
1140               if (LOG_VIA) logerror("%s LBRDY 0 : %02x\n", cur_live.tm.as_string(), GCR_DECODE(cur_live.e, cur_live.i));
11321141            }
11331142            cur_live.brdy = brdy;
1134            if (!brdy) cur_live.lbrdy = 0;
11351143            syncpoint = true;
11361144         }
11371145
r242159r242160
11441152         if (syn != cur_live.syn) {
11451153            if (LOG) logerror("%s SYN %u\n", cur_live.tm.as_string(),syn);
11461154            cur_live.syn = syn;
1155            cur_live.syn_changed = true;
11471156            syncpoint = true;
11481157         }
11491158
r242159r242160
11661175      }
11671176
11681177      case RUNNING_SYNCPOINT: {
1169         m_lbrdy_cb(cur_live.lbrdy);
1170         m_syn_cb(cur_live.syn);
1178         if (cur_live.lbrdy_changed) {
1179            m_lbrdy_cb(cur_live.lbrdy);
1180            cur_live.lbrdy_changed = false;
1181         }
11711182
1183         if (cur_live.syn_changed) {
1184            m_syn_cb(cur_live.syn);
1185            cur_live.syn_changed = false;
1186         }
1187
1188         m_via5->write_ca1(cur_live.brdy);
1189
11721190         cur_live.state = RUNNING;
11731191         checkpoint();
11741192         break;
trunk/src/mess/machine/victor9k_fdc.h
r242159r242160
136136      int sync_byte_counter;
137137      int brdy;
138138      int lbrdy;
139      bool lbrdy_changed;
139140      int sync;
140141      int syn;
142      bool syn_changed;
141143      int gcr_err;
142144
143145      // write
r242159r242160
204206   int m_via4_irq;
205207   int m_via5_irq;
206208   int m_via6_irq;
207   int m_syn;
208   int m_lbrdy;
209209
210210   attotime m_period;
211211


Previous 199869 Revisions Next


© 1997-2024 The MAME Team