Previous 199869 Revisions Next

r33180 Monday 3rd November, 2014 at 20:53:00 UTC by Curt Coder
(MESS) victor9k: Floppy WIP. (nw)
[src/lib/formats]victor9k_dsk.c
[src/mess/machine]victor9k_fdc.c victor9k_fdc.h

trunk/src/lib/formats/victor9k_dsk.c
r241691r241692
8787
8888const UINT32 victor9k_format::cell_size[] =
8989{
90   0
90   1789, 1896, 2009, 2130, 2272, 2428, 2613, 2847, 2961
9191};
9292
9393const int victor9k_format::sectors_per_track[2][80] =
trunk/src/mess/machine/victor9k_fdc.c
r241691r241692
887887   cur_live.shift_reg = 0;
888888   cur_live.shift_reg_write = 0;
889889   cur_live.bit_counter = 0;
890   cur_live.sync_bit_counter = 0;
891   cur_live.sync_byte_counter = 0;
890892
891893   cur_live.drive = m_drive;
892894   cur_live.side = m_side;
r241691r241692
10071009   cur_live.brdy = 1;
10081010   cur_live.lbrdy = 1;
10091011   cur_live.sync = 1;
1012   cur_live.syn = 1;
10101013   cur_live.gcr_err = 1;
10111014}
10121015
r241691r241692
10451048            }
10461049         }
10471050
1051         // sync counter
1052         if (sync) {
1053            cur_live.sync_bit_counter = 0;
1054            cur_live.sync_byte_counter = 10;
1055         } else if (!cur_live.sync) {
1056            cur_live.sync_bit_counter++;
1057            if (cur_live.sync_bit_counter == 10) {
1058               cur_live.sync_bit_counter = 0;
1059               cur_live.sync_byte_counter++;
1060               if (cur_live.sync_byte_counter == 16) {
1061                  cur_live.sync_byte_counter = 0;
1062               }
1063            }
1064         }
1065
1066         // syn
1067         int syn = !(cur_live.sync_byte_counter == 15);
1068
10481069         // GCR decoder
10491070         if (cur_live.drw) {
10501071            cur_live.i = cur_live.drw << 10 | cur_live.shift_reg;
10511072         } else {
1052            cur_live.i = 0x300 | ((cur_live.wd & 0xf0) << 1) | cur_live.wrsync << 4 | (cur_live.wd & 0x0f);
1073            cur_live.i = cur_live.drw << 10 | ((cur_live.wd & 0xf0) << 1) | cur_live.wrsync << 4 | (cur_live.wd & 0x0f);
10531074         }
10541075
10551076         cur_live.e = m_gcr_rom->base()[cur_live.i];
10561077
10571078         // byte ready
1058         int brdy = cur_live.bit_counter == 9;
1079         int brdy = !(cur_live.bit_counter == 9);
10591080
10601081         // GCR error
10611082         int gcr_err = !(brdy || BIT(cur_live.e, 3));
r241691r241692
10731094            syncpoint = true;
10741095         }
10751096
1097         if (syn != cur_live.syn) {
1098            if (LOG) logerror("%s SYN %u\n", cur_live.tm.as_string(),syn);
1099            cur_live.syn = syn;
1100            syncpoint = true;
1101         }
1102
10761103         if (gcr_err != cur_live.gcr_err) {
10771104            if (LOG) logerror("%s GCR ERR %u\n", cur_live.tm.as_string(),gcr_err);
10781105            cur_live.gcr_err = gcr_err;
r241691r241692
10931120
10941121      case RUNNING_SYNCPOINT: {
10951122         m_lbrdy_cb(cur_live.lbrdy);
1123         m_syn_cb(cur_live.syn);
10961124
10971125         cur_live.state = RUNNING;
10981126         checkpoint();
trunk/src/mess/machine/victor9k_fdc.h
r241691r241692
125125      attotime edge;
126126      UINT16 shift_reg;
127127      int bit_counter;
128      int sync_bit_counter;
129      int sync_byte_counter;
128130      int brdy;
129131      int lbrdy;
130132      int sync;
133      int syn;
131134      int gcr_err;
132135
133136      // write
r241691r241692
137140      int write_position;
138141      UINT8 wd;
139142      int wrsync;
140      int syn;
141143      int gcr_data;
142144      int erase;
143145   };


Previous 199869 Revisions Next


© 1997-2024 The MAME Team