upd765: Implemented DUMPREG command.

This commit is contained in:
mahlemiut 2012-10-12 05:40:40 +00:00
parent d5dc343296
commit 4a61a594ed
2 changed files with 23 additions and 0 deletions

View file

@ -971,6 +971,9 @@ int upd765_family_device::check_command()
case 0x0d:
return command_pos == 6 ? C_FORMAT_TRACK : C_INCOMPLETE;
case 0x0e:
return command_pos == 2 ? C_DUMP_REG : C_INCOMPLETE;
case 0x0f:
return command_pos == 3 ? C_SEEK : C_INCOMPLETE;
@ -1001,9 +1004,26 @@ void upd765_family_device::start_command(int cmd)
command[1], command[2], command[3]);
// byte 1 is ignored, byte 3 is precompensation-related
fifocfg = command[2];
precomp = command[3];
main_phase = PHASE_CMD;
break;
case C_DUMP_REG:
main_phase = PHASE_RESULT;
result[0] = flopi[0].pcn;
result[1] = flopi[1].pcn;
result[2] = flopi[2].pcn;
result[3] = flopi[3].pcn;
result[4] = (spec & 0xff00) >> 8;
result[5] = (spec & 0x00ff);
result[6] = sector_size;
result[7] = locked ? 0x80 : 0x00;
result[7] |= (perpmode & 0x30);
result[8] = fifocfg;
result[9] = precomp;
result_pos = 10;
break;
case C_FORMAT_TRACK:
format_track_start(flopi[command[1] & 3]);
break;
@ -1018,6 +1038,7 @@ void upd765_family_device::start_command(int cmd)
case C_PERPENDICULAR:
logerror("%s: command perpendicular\n", tag());
perpmode = command[1];
main_phase = PHASE_CMD;
break;

View file

@ -292,6 +292,7 @@ protected:
UINT8 dor, dsr, msr, fifo[16], command[16], result[16];
UINT8 st0, st1, st2, st3;
UINT8 fifocfg, dor_reset;
UINT8 precomp, perpmode;
UINT16 spec;
int sector_size;
int cur_rate;
@ -303,6 +304,7 @@ protected:
enum {
C_CONFIGURE,
C_DUMP_REG,
C_FORMAT_TRACK,
C_LOCK,
C_PERPENDICULAR,