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) {
if (next_data(m_rd_it , m_tape_pos , true)) { // All gaps found, bail out
cmd_duration = time_to_target(farthest_end(m_rd_it)); cmd_duration = attotime::zero;
m_cmd_state = CMD_END;
break;
} }
// Set T/O for data }
set_data_timeout(true); if (next_data(m_rd_it , m_tape_pos , true)) {
m_cmd_state = CMD_PH1; cmd_duration = time_to_target(farthest_end(m_rd_it));
} else { }
// PH1 // Set T/O for data
tape_pos_t target = m_tape_pos; set_data_timeout(true);
// Tach. register is incremented at each gap. Command ends when this register goes positive (b15 = 0). m_cmd_state = CMD_PH1;
unsigned n_gaps; } else if (m_cmd_state == CMD_PH1) {
if (BIT(m_tach_reg , 15)) { // PH1
n_gaps = 0x10000U - m_tach_reg; tape_pos_t target = m_tape_pos;
m_tach_reg = 0; if (next_n_gap(target, 1, min_gap_size())) {
} else { LOG_0(("Gap @%d (%u to go)\n" , target , 0x10000U - m_tach_reg));
n_gaps = 1; cmd_duration = time_to_target(target);
m_tach_reg++; }
} m_timeout_timer->reset();
if (next_n_gap(target, n_gaps, min_gap_size())) { m_cmd_state = CMD_PH2;
LOG_0(("%u gaps @%d\n" , n_gaps, target));
cmd_duration = time_to_target(target);
}
m_timeout_timer->reset();
m_cmd_state = CMD_END;
} }
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;