ncr5390: better command length logic (nw)

This commit is contained in:
Patrick Mackinlay 2019-01-23 17:10:52 +07:00
parent 931db1a1b3
commit 6bbd1270ee
2 changed files with 4 additions and 10 deletions

View File

@ -430,8 +430,8 @@ void ncr5390_device::step(bool timeout)
break;
}
// "with atn" variants have a message byte before the command descriptor
command_length = (c == CD_SELECT) ? derive_msg_size(fifo[0]) : 1;
command_length = fifo_pos + tcounter;
logerror("command_length %d\n", command_length);
state = DISC_SEL_ARBITRATION;
step(false);
break;
@ -465,7 +465,6 @@ void ncr5390_device::step(bool timeout)
seq = 1;
function_bus_complete();
} else {
command_length = derive_msg_size(fifo[0]);
state = DISC_SEL_WAIT_REQ;
}
break;
@ -850,6 +849,8 @@ void ncr5390_device::start_command()
// clear transfer count zero flag when counter is reloaded
status &= ~S_TC0;
}
else
tcounter = 0;
switch(c) {
case CM_NOP:
@ -973,12 +974,6 @@ bool ncr5390_device::check_valid_command(uint8_t cmd)
return false;
}
int ncr5390_device::derive_msg_size(uint8_t msg_id)
{
const static int sizes[8] = { 6, 10, 6, 6, 6, 12, 6, 10 };
return sizes[msg_id >> 5];
}
void ncr5390_device::arbitrate()
{
state = (state & STATE_MASK) | (ARB_COMPLETE << SUB_SHIFT);

View File

@ -212,7 +212,6 @@ protected:
void start_command();
void step(bool timeout);
virtual bool check_valid_command(uint8_t cmd);
int derive_msg_size(uint8_t msg_id);
void function_complete();
void function_bus_complete();
void bus_complete();