hp9845: re-implemented cmd 18 in TACO driver

This commit is contained in:
fulivi 2016-07-05 11:37:19 +02:00
parent ae64748f91
commit 35a95022ff

View File

@ -1377,35 +1377,32 @@ void hp_taco_device::cmd_fsm(void)
break; break;
case CMD_SCAN_RECORDS: case CMD_SCAN_RECORDS:
// It's probably more correct to implement this to alternate between next data and next gap by using different if (m_cmd_state == CMD_PH0 || m_cmd_state == CMD_PH2) {
// FSM states. It times out sooner if the record being searched for doesn't exist on tape. With the current // PH0 and PH2
// implementation it has to wait until a hole is reached at either end of the tape. if (m_cmd_state == CMD_PH2) {
if (m_cmd_state == CMD_PH0) { m_tach_reg++;
// PH0 if (m_tach_reg == 0) {
// All gaps found, bail out
cmd_duration = attotime::zero;
m_cmd_state = CMD_END;
break;
}
}
if (next_data(m_rd_it , m_tape_pos , true)) { if (next_data(m_rd_it , m_tape_pos , true)) {
cmd_duration = time_to_target(farthest_end(m_rd_it)); cmd_duration = time_to_target(farthest_end(m_rd_it));
} }
// Set T/O for data // Set T/O for data
set_data_timeout(true); set_data_timeout(true);
m_cmd_state = CMD_PH1; m_cmd_state = CMD_PH1;
} else { } else if (m_cmd_state == CMD_PH1) {
// PH1 // PH1
tape_pos_t target = m_tape_pos; tape_pos_t target = m_tape_pos;
// Tach. register is incremented at each gap. Command ends when this register goes positive (b15 = 0). if (next_n_gap(target, 1, min_gap_size())) {
unsigned n_gaps; LOG_0(("Gap @%d (%u to go)\n" , target , 0x10000U - m_tach_reg));
if (BIT(m_tach_reg , 15)) {
n_gaps = 0x10000U - m_tach_reg;
m_tach_reg = 0;
} else {
n_gaps = 1;
m_tach_reg++;
}
if (next_n_gap(target, n_gaps, min_gap_size())) {
LOG_0(("%u gaps @%d\n" , n_gaps, target));
cmd_duration = time_to_target(target); cmd_duration = time_to_target(target);
} }
m_timeout_timer->reset(); m_timeout_timer->reset();
m_cmd_state = CMD_END; m_cmd_state = CMD_PH2;
} }
break; break;
@ -1420,8 +1417,7 @@ void hp_taco_device::cmd_fsm(void)
if (next_data(m_rd_it , m_tape_pos , true)) { if (next_data(m_rd_it , m_tape_pos , true)) {
cmd_duration = time_to_target(farthest_end(m_rd_it)); cmd_duration = time_to_target(farthest_end(m_rd_it));
} }
// Set T/O for data // Apparently this cmd doesn't set no-data T/O
set_data_timeout(true);
m_cmd_state = CMD_END; m_cmd_state = CMD_END;
} }
break; break;