(MESS) Floppy WIP. (nw)

This commit is contained in:
Curt Coder 2014-02-11 18:26:03 +00:00
parent 127034e6c0
commit 37210e307f
2 changed files with 15 additions and 9 deletions

View File

@ -199,13 +199,11 @@ void c2040_fdc_t::checkpoint()
{ {
get_next_edge(machine().time()); get_next_edge(machine().time());
checkpoint_live = cur_live; 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() void c2040_fdc_t::rollback()
{ {
cur_live = checkpoint_live; 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); get_next_edge(cur_live.tm);
} }
@ -515,8 +513,11 @@ WRITE_LINE_MEMBER( c2040_fdc_t::rw_sel_w )
m_rw_sel = cur_live.rw_sel = state; m_rw_sel = cur_live.rw_sel = state;
checkpoint(); checkpoint();
if (LOG) logerror("%s RW SEL %u\n", machine().time().as_string(), state); if (LOG) logerror("%s RW SEL %u\n", machine().time().as_string(), state);
if (state) if (m_rw_sel) {
stop_writing(machine().time()); stop_writing(machine().time());
} else {
start_writing(machine().time());
}
live_run(); live_run();
} }
} }

View File

@ -303,12 +303,11 @@ 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, 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); !(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 syncpoint = true;
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); int sync = !((cur_live.shift_reg == 0x3ff) && cur_live.oe);
@ -524,6 +523,11 @@ WRITE_LINE_MEMBER( c64h156_device::oe_w )
{ {
live_sync(); live_sync();
m_oe = cur_live.oe = state; m_oe = cur_live.oe = state;
if (m_oe) {
stop_writing(machine().time());
} else {
start_writing(machine().time());
}
checkpoint(); checkpoint();
if (LOG) logerror("%s OE %u\n", machine().time().as_string(), state); if (LOG) logerror("%s OE %u\n", machine().time().as_string(), state);
live_run(); live_run();
@ -641,6 +645,7 @@ void c64h156_device::ds_w(int ds)
live_sync(); live_sync();
m_ds = cur_live.ds = ds; m_ds = cur_live.ds = ds;
checkpoint(); checkpoint();
if (LOG) logerror("%s DS %u\n", machine().time().as_string(), ds);
live_run(); live_run();
} }
} }