mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
upd765: special case i82072 drive busy bit handling (nw)
Fixes http://mametesters.org/view.php?id=6689.
This commit is contained in:
parent
d958e620a2
commit
d7dc7f668b
@ -1421,11 +1421,10 @@ void upd765_family_device::command_end(floppy_info &fi, bool data_completion)
|
|||||||
for(int i=0; i != result_pos; i++)
|
for(int i=0; i != result_pos; i++)
|
||||||
LOG(" %02x", result[i]);
|
LOG(" %02x", result[i]);
|
||||||
LOG("\n");
|
LOG("\n");
|
||||||
fi.sub_state = IDLE;
|
fi.main_state = fi.sub_state = IDLE;
|
||||||
if(data_completion) {
|
if(data_completion)
|
||||||
fi.main_state = IDLE;
|
|
||||||
data_irq = true;
|
data_irq = true;
|
||||||
} else {
|
else {
|
||||||
other_irq = true;
|
other_irq = true;
|
||||||
fi.st0_filled = true;
|
fi.st0_filled = true;
|
||||||
}
|
}
|
||||||
@ -2602,6 +2601,36 @@ void i82072_device::execute_command(int cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Intel datasheet says that the drive busy bits in the MSR are supposed to remain
|
||||||
|
* set after a seek or recalibrate until a sense interrupt status status command is
|
||||||
|
* executed. The InterPro 2000 diagnostic routine goes further, and tests the drive
|
||||||
|
* status bits before and after the first sense interrupt status result byte is read,
|
||||||
|
* and expects the drive busy bit to clear only after.
|
||||||
|
*
|
||||||
|
* The Amstrad CPC6128 uses a upd765a and seems to expect the busy bits to be cleared
|
||||||
|
* immediately after the seek/recalibrate interrupt is generated.
|
||||||
|
*
|
||||||
|
* Special casing the i82072 here seems the only way to reconcile this apparently
|
||||||
|
* different behaviour for now.
|
||||||
|
*/
|
||||||
|
void i82072_device::command_end(floppy_info &fi, bool data_completion)
|
||||||
|
{
|
||||||
|
LOG("command done (%s) -", data_completion ? "data" : "seek");
|
||||||
|
for(int i=0; i != result_pos; i++)
|
||||||
|
LOG(" %02x", result[i]);
|
||||||
|
LOG("\n");
|
||||||
|
fi.sub_state = IDLE;
|
||||||
|
if(data_completion) {
|
||||||
|
fi.main_state = IDLE;
|
||||||
|
data_irq = true;
|
||||||
|
} else {
|
||||||
|
other_irq = true;
|
||||||
|
fi.st0_filled = true;
|
||||||
|
}
|
||||||
|
check_irq();
|
||||||
|
}
|
||||||
|
|
||||||
void i82072_device::motor_control(int fid, bool start_motor)
|
void i82072_device::motor_control(int fid, bool start_motor)
|
||||||
{
|
{
|
||||||
// check if motor control is enabled
|
// check if motor control is enabled
|
||||||
|
@ -386,7 +386,7 @@ protected:
|
|||||||
virtual int check_command();
|
virtual int check_command();
|
||||||
virtual void start_command(int cmd);
|
virtual void start_command(int cmd);
|
||||||
virtual void execute_command(int cmd);
|
virtual void execute_command(int cmd);
|
||||||
void command_end(floppy_info &fi, bool data_completion);
|
virtual void command_end(floppy_info &fi, bool data_completion);
|
||||||
|
|
||||||
void recalibrate_start(floppy_info &fi);
|
void recalibrate_start(floppy_info &fi);
|
||||||
void seek_start(floppy_info &fi);
|
void seek_start(floppy_info &fi);
|
||||||
@ -469,6 +469,7 @@ protected:
|
|||||||
virtual int check_command() override;
|
virtual int check_command() override;
|
||||||
virtual void start_command(int cmd) override;
|
virtual void start_command(int cmd) override;
|
||||||
virtual void execute_command(int cmd) override;
|
virtual void execute_command(int cmd) override;
|
||||||
|
virtual void command_end(floppy_info &fi, bool data_completion) override;
|
||||||
virtual void index_callback(floppy_image_device *floppy, int state) override;
|
virtual void index_callback(floppy_image_device *floppy, int state) override;
|
||||||
|
|
||||||
void motor_control(int fid, bool start_motor);
|
void motor_control(int fid, bool start_motor);
|
||||||
|
Loading…
Reference in New Issue
Block a user