mirror of
https://github.com/holub/mame
synced 2025-06-22 20:38:50 +03:00
Merge pull request #5468 from 68bit/wd_fdc_sso_callback
wd_fdc: add a SSO callback.
This commit is contained in:
commit
021de5d9fb
@ -85,6 +85,7 @@ wd_fdc_device_base::wd_fdc_device_base(const machine_config &mconfig, device_typ
|
|||||||
drq_cb(*this),
|
drq_cb(*this),
|
||||||
hld_cb(*this),
|
hld_cb(*this),
|
||||||
enp_cb(*this),
|
enp_cb(*this),
|
||||||
|
sso_cb(*this),
|
||||||
ready_cb(*this), // actually output by the drive, not by the FDC
|
ready_cb(*this), // actually output by the drive, not by the FDC
|
||||||
enmf_cb(*this)
|
enmf_cb(*this)
|
||||||
{
|
{
|
||||||
@ -108,6 +109,7 @@ void wd_fdc_device_base::device_start()
|
|||||||
drq_cb.resolve();
|
drq_cb.resolve();
|
||||||
hld_cb.resolve();
|
hld_cb.resolve();
|
||||||
enp_cb.resolve();
|
enp_cb.resolve();
|
||||||
|
sso_cb.resolve();
|
||||||
ready_cb.resolve();
|
ready_cb.resolve();
|
||||||
enmf_cb.resolve();
|
enmf_cb.resolve();
|
||||||
|
|
||||||
@ -475,8 +477,8 @@ void wd_fdc_device_base::read_sector_start()
|
|||||||
main_state = READ_SECTOR;
|
main_state = READ_SECTOR;
|
||||||
status &= ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM);
|
status &= ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM);
|
||||||
drop_drq();
|
drop_drq();
|
||||||
if(side_control && floppy)
|
if(side_control)
|
||||||
floppy->ss_w((command & 0x02) ? 1 : 0);
|
update_sso();
|
||||||
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
||||||
status_type_1 = false;
|
status_type_1 = false;
|
||||||
read_sector_continue();
|
read_sector_continue();
|
||||||
@ -576,8 +578,8 @@ void wd_fdc_device_base::read_track_start()
|
|||||||
main_state = READ_TRACK;
|
main_state = READ_TRACK;
|
||||||
status &= ~(S_LOST|S_RNF);
|
status &= ~(S_LOST|S_RNF);
|
||||||
drop_drq();
|
drop_drq();
|
||||||
if(side_control && floppy)
|
if(side_control)
|
||||||
floppy->ss_w((command & 0x02) ? 1 : 0);
|
update_sso();
|
||||||
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
||||||
status_type_1 = false;
|
status_type_1 = false;
|
||||||
read_track_continue();
|
read_track_continue();
|
||||||
@ -655,8 +657,8 @@ void wd_fdc_device_base::read_id_start()
|
|||||||
main_state = READ_ID;
|
main_state = READ_ID;
|
||||||
status &= ~(S_WP|S_DDM|S_LOST|S_RNF);
|
status &= ~(S_WP|S_DDM|S_LOST|S_RNF);
|
||||||
drop_drq();
|
drop_drq();
|
||||||
if(side_control && floppy)
|
if(side_control)
|
||||||
floppy->ss_w((command & 0x02) ? 1 : 0);
|
update_sso();
|
||||||
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
||||||
status_type_1 = false;
|
status_type_1 = false;
|
||||||
read_id_continue();
|
read_id_continue();
|
||||||
@ -732,8 +734,8 @@ void wd_fdc_device_base::write_track_start()
|
|||||||
main_state = WRITE_TRACK;
|
main_state = WRITE_TRACK;
|
||||||
status &= ~(S_WP|S_DDM|S_LOST|S_RNF);
|
status &= ~(S_WP|S_DDM|S_LOST|S_RNF);
|
||||||
drop_drq();
|
drop_drq();
|
||||||
if(side_control && floppy)
|
if(side_control)
|
||||||
floppy->ss_w((command & 0x02) ? 1 : 0);
|
update_sso();
|
||||||
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
||||||
status_type_1 = false;
|
status_type_1 = false;
|
||||||
|
|
||||||
@ -843,8 +845,8 @@ void wd_fdc_device_base::write_sector_start()
|
|||||||
main_state = WRITE_SECTOR;
|
main_state = WRITE_SECTOR;
|
||||||
status &= ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM);
|
status &= ~(S_CRC|S_LOST|S_RNF|S_WP|S_DDM);
|
||||||
drop_drq();
|
drop_drq();
|
||||||
if(side_control && floppy)
|
if(side_control)
|
||||||
floppy->ss_w((command & 0x02) ? 1 : 0);
|
update_sso();
|
||||||
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
sub_state = motor_control ? SPINUP : SPINUP_DONE;
|
||||||
status_type_1 = false;
|
status_type_1 = false;
|
||||||
write_sector_continue();
|
write_sector_continue();
|
||||||
@ -2206,6 +2208,31 @@ void wd_fdc_device_base::drop_drq()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wd_fdc_device_base::update_sso()
|
||||||
|
{
|
||||||
|
// The 'side_control' flag is interpreted as meaning that the FDC has
|
||||||
|
// a SSO output feature, not that it necessarily controls the floppy.
|
||||||
|
if(!side_control)
|
||||||
|
return;
|
||||||
|
|
||||||
|
uint8_t side = (command & 0x02) ? 1 : 0;
|
||||||
|
|
||||||
|
// If a SSO callback is defined then it is assumed that this callback
|
||||||
|
// will update the floppy side if that is the connection. There are
|
||||||
|
// some machines that use the SSO output for other purposes.
|
||||||
|
if(!sso_cb.isnull()) {
|
||||||
|
sso_cb(side);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If a SSO callback is not defined then assume that the machine
|
||||||
|
// intended the driver to update the floppy side which appears to be
|
||||||
|
// the case in most cases.
|
||||||
|
if(floppy) {
|
||||||
|
floppy->ss_w((command & 0x02) ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int wd_fdc_device_base::calc_sector_size(uint8_t size, uint8_t command) const
|
int wd_fdc_device_base::calc_sector_size(uint8_t size, uint8_t command) const
|
||||||
{
|
{
|
||||||
return 128 << (size & 3);
|
return 128 << (size & 3);
|
||||||
|
@ -53,6 +53,7 @@ public:
|
|||||||
auto drq_wr_callback() { return drq_cb.bind(); }
|
auto drq_wr_callback() { return drq_cb.bind(); }
|
||||||
auto hld_wr_callback() { return hld_cb.bind(); }
|
auto hld_wr_callback() { return hld_cb.bind(); }
|
||||||
auto enp_wr_callback() { return enp_cb.bind(); }
|
auto enp_wr_callback() { return enp_cb.bind(); }
|
||||||
|
auto sso_wr_callback() { return sso_cb.bind(); }
|
||||||
auto ready_wr_callback() { return ready_cb.bind(); }
|
auto ready_wr_callback() { return ready_cb.bind(); }
|
||||||
auto enmf_rd_callback() { return enmf_cb.bind(); }
|
auto enmf_rd_callback() { return enmf_cb.bind(); }
|
||||||
|
|
||||||
@ -291,7 +292,7 @@ private:
|
|||||||
|
|
||||||
live_info cur_live, checkpoint_live;
|
live_info cur_live, checkpoint_live;
|
||||||
|
|
||||||
devcb_write_line intrq_cb, drq_cb, hld_cb, enp_cb, ready_cb;
|
devcb_write_line intrq_cb, drq_cb, hld_cb, enp_cb, sso_cb, ready_cb;
|
||||||
devcb_read_line enmf_cb;
|
devcb_read_line enmf_cb;
|
||||||
|
|
||||||
uint8_t format_last_byte;
|
uint8_t format_last_byte;
|
||||||
@ -355,6 +356,8 @@ private:
|
|||||||
|
|
||||||
void drop_drq();
|
void drop_drq();
|
||||||
void set_drq();
|
void set_drq();
|
||||||
|
|
||||||
|
void update_sso();
|
||||||
};
|
};
|
||||||
|
|
||||||
class wd_fdc_analog_device_base : public wd_fdc_device_base {
|
class wd_fdc_analog_device_base : public wd_fdc_device_base {
|
||||||
|
Loading…
Reference in New Issue
Block a user