mirror of
https://github.com/holub/mame
synced 2025-06-27 22:54:42 +03:00
(MESS) Floppy WIP. (nw)
This commit is contained in:
parent
127034e6c0
commit
37210e307f
@ -199,13 +199,11 @@ void c2040_fdc_t::checkpoint()
|
||||
{
|
||||
get_next_edge(machine().time());
|
||||
checkpoint_live = cur_live;
|
||||
if (LOG) logerror("---- checkpoint rw=%u mode=%u\n", checkpoint_live.rw_sel, checkpoint_live.mode_sel);
|
||||
}
|
||||
|
||||
void c2040_fdc_t::rollback()
|
||||
{
|
||||
cur_live = checkpoint_live;
|
||||
if (LOG) logerror("---- rollback rw=%u mode=%u\n", cur_live.rw_sel, cur_live.mode_sel);
|
||||
get_next_edge(cur_live.tm);
|
||||
}
|
||||
|
||||
@ -386,7 +384,7 @@ void c2040_fdc_t::live_run(attotime limit)
|
||||
|
||||
cur_live.shift_reg_write = BIT(e,7)<<9 | BIT(e,6)<<8 | BIT(i,7)<<7 | BIT(e,5)<<6 | BIT(e,4)<<5 | BIT(e,3)<<4 | BIT(e,2)<<3 | BIT(i,2)<<2 | (e & 0x03);
|
||||
|
||||
if(LOG) logerror("%s load write shift register %03x\n",cur_live.tm.as_string(),cur_live.shift_reg_write);
|
||||
if (LOG) logerror("%s load write shift register %03x\n",cur_live.tm.as_string(),cur_live.shift_reg_write);
|
||||
} else if (BIT(cell_counter, 1) && !BIT(cur_live.cell_counter, 1)) {
|
||||
// clock write shift register
|
||||
cur_live.shift_reg_write <<= 1;
|
||||
@ -515,8 +513,11 @@ WRITE_LINE_MEMBER( c2040_fdc_t::rw_sel_w )
|
||||
m_rw_sel = cur_live.rw_sel = state;
|
||||
checkpoint();
|
||||
if (LOG) logerror("%s RW SEL %u\n", machine().time().as_string(), state);
|
||||
if (state)
|
||||
if (m_rw_sel) {
|
||||
stop_writing(machine().time());
|
||||
} else {
|
||||
start_writing(machine().time());
|
||||
}
|
||||
live_run();
|
||||
}
|
||||
}
|
||||
|
@ -303,14 +303,13 @@ void c64h156_device::live_run(attotime limit)
|
||||
if (LOG) logerror("%s read bit %u (%u) >> %03x, oe=%u soe=%u sync=%u byte=%u\n", cur_live.tm.as_string(), cur_live.bit_counter,
|
||||
!(BIT(cur_live.cell_counter, 3) || BIT(cur_live.cell_counter, 2)), cur_live.shift_reg, cur_live.oe, cur_live.soe, cur_live.sync, cur_live.byte);
|
||||
|
||||
// write bit
|
||||
if (!cur_live.oe) {
|
||||
write_next_bit(BIT(cur_live.shift_reg_write, 7), limit);
|
||||
}
|
||||
|
||||
syncpoint = true;
|
||||
}
|
||||
|
||||
if (BIT(cell_counter, 1) && !BIT(cur_live.cell_counter, 1) && !cur_live.oe) {
|
||||
write_next_bit(BIT(cur_live.shift_reg_write, 7), limit);
|
||||
}
|
||||
|
||||
int sync = !((cur_live.shift_reg == 0x3ff) && cur_live.oe);
|
||||
|
||||
if (!sync) {
|
||||
@ -524,6 +523,11 @@ WRITE_LINE_MEMBER( c64h156_device::oe_w )
|
||||
{
|
||||
live_sync();
|
||||
m_oe = cur_live.oe = state;
|
||||
if (m_oe) {
|
||||
stop_writing(machine().time());
|
||||
} else {
|
||||
start_writing(machine().time());
|
||||
}
|
||||
checkpoint();
|
||||
if (LOG) logerror("%s OE %u\n", machine().time().as_string(), state);
|
||||
live_run();
|
||||
@ -641,6 +645,7 @@ void c64h156_device::ds_w(int ds)
|
||||
live_sync();
|
||||
m_ds = cur_live.ds = ds;
|
||||
checkpoint();
|
||||
if (LOG) logerror("%s DS %u\n", machine().time().as_string(), ds);
|
||||
live_run();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user