(MESS) victor9k: Floppy WIP. (nw)

This commit is contained in:
Curt Coder 2014-11-03 22:52:52 +02:00
parent e3680d1c8f
commit af8b0eedcd
3 changed files with 34 additions and 4 deletions

View File

@ -87,7 +87,7 @@ const victor9k_format::format victor9k_format::formats[] = {
const UINT32 victor9k_format::cell_size[] = const UINT32 victor9k_format::cell_size[] =
{ {
0 1789, 1896, 2009, 2130, 2272, 2428, 2613, 2847, 2961
}; };
const int victor9k_format::sectors_per_track[2][80] = const int victor9k_format::sectors_per_track[2][80] =

View File

@ -887,6 +887,8 @@ void victor_9000_fdc_t::live_start()
cur_live.shift_reg = 0; cur_live.shift_reg = 0;
cur_live.shift_reg_write = 0; cur_live.shift_reg_write = 0;
cur_live.bit_counter = 0; cur_live.bit_counter = 0;
cur_live.sync_bit_counter = 0;
cur_live.sync_byte_counter = 0;
cur_live.drive = m_drive; cur_live.drive = m_drive;
cur_live.side = m_side; cur_live.side = m_side;
@ -1007,6 +1009,7 @@ void victor_9000_fdc_t::live_abort()
cur_live.brdy = 1; cur_live.brdy = 1;
cur_live.lbrdy = 1; cur_live.lbrdy = 1;
cur_live.sync = 1; cur_live.sync = 1;
cur_live.syn = 1;
cur_live.gcr_err = 1; cur_live.gcr_err = 1;
} }
@ -1045,17 +1048,35 @@ void victor_9000_fdc_t::live_run(const attotime &limit)
} }
} }
// sync counter
if (sync) {
cur_live.sync_bit_counter = 0;
cur_live.sync_byte_counter = 10;
} else if (!cur_live.sync) {
cur_live.sync_bit_counter++;
if (cur_live.sync_bit_counter == 10) {
cur_live.sync_bit_counter = 0;
cur_live.sync_byte_counter++;
if (cur_live.sync_byte_counter == 16) {
cur_live.sync_byte_counter = 0;
}
}
}
// syn
int syn = !(cur_live.sync_byte_counter == 15);
// GCR decoder // GCR decoder
if (cur_live.drw) { if (cur_live.drw) {
cur_live.i = cur_live.drw << 10 | cur_live.shift_reg; cur_live.i = cur_live.drw << 10 | cur_live.shift_reg;
} else { } else {
cur_live.i = 0x300 | ((cur_live.wd & 0xf0) << 1) | cur_live.wrsync << 4 | (cur_live.wd & 0x0f); cur_live.i = cur_live.drw << 10 | ((cur_live.wd & 0xf0) << 1) | cur_live.wrsync << 4 | (cur_live.wd & 0x0f);
} }
cur_live.e = m_gcr_rom->base()[cur_live.i]; cur_live.e = m_gcr_rom->base()[cur_live.i];
// byte ready // byte ready
int brdy = cur_live.bit_counter == 9; int brdy = !(cur_live.bit_counter == 9);
// GCR error // GCR error
int gcr_err = !(brdy || BIT(cur_live.e, 3)); int gcr_err = !(brdy || BIT(cur_live.e, 3));
@ -1073,6 +1094,12 @@ void victor_9000_fdc_t::live_run(const attotime &limit)
syncpoint = true; syncpoint = true;
} }
if (syn != cur_live.syn) {
if (LOG) logerror("%s SYN %u\n", cur_live.tm.as_string(),syn);
cur_live.syn = syn;
syncpoint = true;
}
if (gcr_err != cur_live.gcr_err) { if (gcr_err != cur_live.gcr_err) {
if (LOG) logerror("%s GCR ERR %u\n", cur_live.tm.as_string(),gcr_err); if (LOG) logerror("%s GCR ERR %u\n", cur_live.tm.as_string(),gcr_err);
cur_live.gcr_err = gcr_err; cur_live.gcr_err = gcr_err;
@ -1093,6 +1120,7 @@ void victor_9000_fdc_t::live_run(const attotime &limit)
case RUNNING_SYNCPOINT: { case RUNNING_SYNCPOINT: {
m_lbrdy_cb(cur_live.lbrdy); m_lbrdy_cb(cur_live.lbrdy);
m_syn_cb(cur_live.syn);
cur_live.state = RUNNING; cur_live.state = RUNNING;
checkpoint(); checkpoint();

View File

@ -125,9 +125,12 @@ private:
attotime edge; attotime edge;
UINT16 shift_reg; UINT16 shift_reg;
int bit_counter; int bit_counter;
int sync_bit_counter;
int sync_byte_counter;
int brdy; int brdy;
int lbrdy; int lbrdy;
int sync; int sync;
int syn;
int gcr_err; int gcr_err;
// write // write
@ -137,7 +140,6 @@ private:
int write_position; int write_position;
UINT8 wd; UINT8 wd;
int wrsync; int wrsync;
int syn;
int gcr_data; int gcr_data;
int erase; int erase;
}; };