mirror of
https://github.com/holub/mame
synced 2025-05-22 13:48:55 +03:00
(MESS) victor9k: Floppy WIP. (nw)
This commit is contained in:
parent
e3680d1c8f
commit
af8b0eedcd
@ -87,7 +87,7 @@ const victor9k_format::format victor9k_format::formats[] = {
|
||||
|
||||
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] =
|
||||
|
@ -887,6 +887,8 @@ void victor_9000_fdc_t::live_start()
|
||||
cur_live.shift_reg = 0;
|
||||
cur_live.shift_reg_write = 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.side = m_side;
|
||||
@ -1007,6 +1009,7 @@ void victor_9000_fdc_t::live_abort()
|
||||
cur_live.brdy = 1;
|
||||
cur_live.lbrdy = 1;
|
||||
cur_live.sync = 1;
|
||||
cur_live.syn = 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
|
||||
if (cur_live.drw) {
|
||||
cur_live.i = cur_live.drw << 10 | cur_live.shift_reg;
|
||||
} 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];
|
||||
|
||||
// byte ready
|
||||
int brdy = cur_live.bit_counter == 9;
|
||||
int brdy = !(cur_live.bit_counter == 9);
|
||||
|
||||
// GCR error
|
||||
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;
|
||||
}
|
||||
|
||||
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 (LOG) logerror("%s GCR ERR %u\n", cur_live.tm.as_string(),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: {
|
||||
m_lbrdy_cb(cur_live.lbrdy);
|
||||
m_syn_cb(cur_live.syn);
|
||||
|
||||
cur_live.state = RUNNING;
|
||||
checkpoint();
|
||||
|
@ -125,9 +125,12 @@ private:
|
||||
attotime edge;
|
||||
UINT16 shift_reg;
|
||||
int bit_counter;
|
||||
int sync_bit_counter;
|
||||
int sync_byte_counter;
|
||||
int brdy;
|
||||
int lbrdy;
|
||||
int sync;
|
||||
int syn;
|
||||
int gcr_err;
|
||||
|
||||
// write
|
||||
@ -137,7 +140,6 @@ private:
|
||||
int write_position;
|
||||
UINT8 wd;
|
||||
int wrsync;
|
||||
int syn;
|
||||
int gcr_data;
|
||||
int erase;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user