mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
trs80: used array of floppy drives
This commit is contained in:
parent
62b9a513bc
commit
3bc9169926
@ -603,10 +603,10 @@ void lnw80_state::lnw80(machine_config &config)
|
||||
FD1771(config, m_fdc, 4_MHz_XTAL / 4);
|
||||
m_fdc->intrq_wr_callback().set(FUNC(lnw80_state::intrq_w));
|
||||
|
||||
FLOPPY_CONNECTOR(config, "fdc:0", lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:1", lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:2", lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:3", lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[0], lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[1], lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[2], lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[3], lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true);
|
||||
|
||||
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
||||
m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7));
|
||||
|
@ -372,10 +372,10 @@ void radionic_state::radionic(machine_config &config)
|
||||
FD1771(config, m_fdc, 4_MHz_XTAL / 4);
|
||||
m_fdc->intrq_wr_callback().set(FUNC(radionic_state::intrq_w));
|
||||
|
||||
FLOPPY_CONNECTOR(config, "fdc:0", radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:1", radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:2", radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:3", radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[0], radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[1], radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[2], radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[3], radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true);
|
||||
|
||||
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
||||
m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7));
|
||||
|
@ -460,10 +460,10 @@ void trs80_state::model1(machine_config &config) // model I, level II
|
||||
FD1771(config, m_fdc, 4_MHz_XTAL / 4);
|
||||
m_fdc->intrq_wr_callback().set(FUNC(trs80_state::intrq_w));
|
||||
|
||||
FLOPPY_CONNECTOR(config, "fdc:0", trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:1", trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:2", trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:3", trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[0], trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[1], trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[2], trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[3], trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true);
|
||||
|
||||
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
||||
m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7));
|
||||
|
@ -384,8 +384,8 @@ void trs80m3_state::model3(machine_config &config)
|
||||
m_fdc->drq_wr_callback().set(FUNC(trs80m3_state::drq_w));
|
||||
|
||||
// Internal drives
|
||||
FLOPPY_CONNECTOR(config, "fdc:0", trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, "fdc:1", trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[0], trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true);
|
||||
FLOPPY_CONNECTOR(config, m_floppy[1], trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true);
|
||||
|
||||
CENTRONICS(config, m_centronics, centronics_devices, "printer");
|
||||
m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7));
|
||||
|
@ -41,15 +41,12 @@ public:
|
||||
, m_uart(*this, "uart")
|
||||
, m_uart_clock(*this, "uart_clock")
|
||||
, m_fdc(*this, "fdc")
|
||||
, m_floppy0(*this, "fdc:0")
|
||||
, m_floppy1(*this, "fdc:1")
|
||||
, m_floppy2(*this, "fdc:2")
|
||||
, m_floppy3(*this, "fdc:3")
|
||||
, m_floppy(*this, "flop%u", 0U)
|
||||
, m_speaker(*this, "speaker")
|
||||
, m_cassette(*this, "cassette")
|
||||
, m_io_baud(*this, "BAUD")
|
||||
, m_io_config(*this, "CONFIG")
|
||||
, m_io_keyboard(*this, "LINE%u", 0)
|
||||
, m_io_keyboard(*this, "LINE%u", 0U)
|
||||
{ }
|
||||
|
||||
void sys80(machine_config &config);
|
||||
@ -99,7 +96,7 @@ protected:
|
||||
double m_old_cassette_val;
|
||||
uint8_t m_size_store;
|
||||
uint16_t m_timeout;
|
||||
floppy_image_device *m_floppy;
|
||||
floppy_image_device *m_fdd;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_memory_region m_region_maincpu;
|
||||
required_region_ptr<u8> m_p_chargen;
|
||||
@ -110,10 +107,7 @@ protected:
|
||||
optional_device<ay31015_device> m_uart;
|
||||
optional_device<clock_device> m_uart_clock;
|
||||
optional_device<fd1771_device> m_fdc;
|
||||
optional_device<floppy_connector> m_floppy0;
|
||||
optional_device<floppy_connector> m_floppy1;
|
||||
optional_device<floppy_connector> m_floppy2;
|
||||
optional_device<floppy_connector> m_floppy3;
|
||||
optional_device_array<floppy_connector, 4> m_floppy;
|
||||
required_device<speaker_sound_device> m_speaker;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
optional_ioport m_io_baud;
|
||||
|
@ -41,12 +41,11 @@ public:
|
||||
, m_uart(*this, "uart")
|
||||
, m_brg(*this, "brg")
|
||||
, m_fdc(*this, "fdc")
|
||||
, m_floppy0(*this, "fdc:0")
|
||||
, m_floppy1(*this, "fdc:1")
|
||||
, m_floppy(*this, "fdc%u", 0U)
|
||||
, m_speaker(*this, "speaker")
|
||||
, m_cassette(*this, "cassette")
|
||||
, m_io_config(*this, "CONFIG")
|
||||
, m_io_keyboard(*this, "LINE%u", 0)
|
||||
, m_io_keyboard(*this, "LINE%u", 0U)
|
||||
, m_mainram(*this, RAM_TAG)
|
||||
, m_m4_bank(*this, "m4_banked_mem")
|
||||
, m_m4p_bank(*this, "m4p_banked_mem")
|
||||
@ -130,7 +129,7 @@ private:
|
||||
bool m_wait;
|
||||
bool m_drq_off;
|
||||
bool m_intrq_off;
|
||||
floppy_image_device *m_floppy;
|
||||
floppy_image_device *m_fdd;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_memory_region m_region_maincpu;
|
||||
required_region_ptr<u8> m_p_chargen;
|
||||
@ -142,8 +141,7 @@ private:
|
||||
optional_device<ay31015_device> m_uart;
|
||||
optional_device<com8116_device> m_brg;
|
||||
optional_device<fd1793_device> m_fdc;
|
||||
optional_device<floppy_connector> m_floppy0;
|
||||
optional_device<floppy_connector> m_floppy1;
|
||||
optional_device_array<floppy_connector, 2> m_floppy;
|
||||
required_device<speaker_sound_device> m_speaker;
|
||||
optional_device<cassette_image_device> m_cassette;
|
||||
optional_ioport m_io_config;
|
||||
|
@ -203,8 +203,8 @@ INTERRUPT_GEN_MEMBER(trs80_state::rtc_interrupt)
|
||||
// {
|
||||
// m_timeout--;
|
||||
// if (m_timeout == 0)
|
||||
// if (m_floppy)
|
||||
// m_floppy->mon_w(1); // motor off
|
||||
// if (m_fdd)
|
||||
// m_fdd->mon_w(1); // motor off
|
||||
// }
|
||||
}
|
||||
|
||||
@ -279,19 +279,18 @@ uint8_t trs80_state::irq_status_r()
|
||||
|
||||
void trs80_state::motor_w(uint8_t data)
|
||||
{
|
||||
m_floppy = nullptr;
|
||||
m_fdd = nullptr;
|
||||
|
||||
if (BIT(data, 0)) m_floppy = m_floppy0->get_device();
|
||||
if (BIT(data, 1)) m_floppy = m_floppy1->get_device();
|
||||
if (BIT(data, 2)) m_floppy = m_floppy2->get_device();
|
||||
if (BIT(data, 3)) m_floppy = m_floppy3->get_device();
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
if (BIT(data, i))
|
||||
m_fdd = m_floppy[i]->get_device();
|
||||
|
||||
m_fdc->set_floppy(m_floppy);
|
||||
m_fdc->set_floppy(m_fdd);
|
||||
|
||||
if (m_floppy)
|
||||
if (m_fdd)
|
||||
{
|
||||
m_floppy->mon_w(0);
|
||||
m_floppy->ss_w(BIT(data, 4));
|
||||
m_fdd->mon_w(0);
|
||||
m_fdd->ss_w(BIT(data, 4));
|
||||
m_timeout = 200;
|
||||
}
|
||||
|
||||
|
@ -389,17 +389,17 @@ void trs80m3_state::port_f4_w(uint8_t data)
|
||||
m_wait = false;
|
||||
}
|
||||
|
||||
m_floppy = nullptr;
|
||||
m_fdd = nullptr;
|
||||
|
||||
if (BIT(data, 0)) m_floppy = m_floppy0->get_device();
|
||||
if (BIT(data, 1)) m_floppy = m_floppy1->get_device();
|
||||
if (BIT(data, 0)) m_fdd = m_floppy[0]->get_device();
|
||||
if (BIT(data, 1)) m_fdd = m_floppy[1]->get_device();
|
||||
|
||||
m_fdc->set_floppy(m_floppy);
|
||||
m_fdc->set_floppy(m_fdd);
|
||||
|
||||
if (m_floppy)
|
||||
if (m_fdd)
|
||||
{
|
||||
m_floppy->mon_w(0);
|
||||
m_floppy->ss_w(BIT(data, 4));
|
||||
m_fdd->mon_w(0);
|
||||
m_fdd->ss_w(BIT(data, 4));
|
||||
m_timeout = 1600;
|
||||
}
|
||||
|
||||
@ -443,8 +443,8 @@ INTERRUPT_GEN_MEMBER(trs80m3_state::rtc_interrupt)
|
||||
{
|
||||
m_timeout--;
|
||||
if (m_timeout == 0)
|
||||
if (m_floppy)
|
||||
m_floppy->mon_w(1); // motor off
|
||||
if (m_fdd)
|
||||
m_fdd->mon_w(1); // motor off
|
||||
}
|
||||
// Also, if cpu is in wait, unlock it and trigger NMI
|
||||
// Don't, it breaks disk loading
|
||||
@ -625,7 +625,7 @@ void trs80m3_state::machine_reset()
|
||||
if (m_model4 & 6)
|
||||
port_84_w(0); // 4 & 4P - switch in devices
|
||||
|
||||
m_floppy = nullptr;
|
||||
m_fdd = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user