mirror of
https://github.com/holub/mame
synced 2025-04-19 15:11:37 +03:00
specpls3: Mirror floppy drive select lines (fixes Batman: The Movie)
- Use device finder array for floppies (nw) - Reduce logging spam by using logmacro.h (nw)
This commit is contained in:
parent
67daf8d43a
commit
31fad1a57c
@ -115,8 +115,9 @@ uint8_t elwro800_state::nmi_r()
|
||||
|
||||
WRITE8_MEMBER(elwro800_state::elwro800jr_fdc_control_w)
|
||||
{
|
||||
m_upd765_0->get_device()->mon_w(!BIT(data, 0));
|
||||
m_upd765_1->get_device()->mon_w(!BIT(data, 1));
|
||||
for (int i = 0; i < 2; i++)
|
||||
if (m_flop[i]->get_device())
|
||||
m_flop[i]->get_device()->mon_w(!BIT(data, i));
|
||||
|
||||
m_upd765->tc_w(data & 0x04);
|
||||
|
||||
|
@ -158,6 +158,9 @@ http://www.z88forever.org.uk/zxplus3e/
|
||||
|
||||
#include "formats/tzx_cas.h"
|
||||
|
||||
#define VERBOSE 0
|
||||
#include "logmacro.h"
|
||||
|
||||
/****************************************************************************************************/
|
||||
/* Spectrum + 3 specific functions */
|
||||
/* This driver uses some of the spectrum_128 functions. The +3 is similar to a spectrum 128
|
||||
@ -200,12 +203,12 @@ void spectrum_state::spectrum_plus3_update_memory()
|
||||
{
|
||||
if (m_port_7ffd_data & 8)
|
||||
{
|
||||
logerror("+3 SCREEN 1: BLOCK 7\n");
|
||||
LOG("+3 SCREEN 1: BLOCK 7\n");
|
||||
m_screen_location = m_ram->pointer() + (7 << 14);
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("+3 SCREEN 0: BLOCK 5\n");
|
||||
LOG("+3 SCREEN 0: BLOCK 5\n");
|
||||
m_screen_location = m_ram->pointer() + (5 << 14);
|
||||
}
|
||||
|
||||
@ -216,7 +219,7 @@ void spectrum_state::spectrum_plus3_update_memory()
|
||||
unsigned char *ram_data = m_ram->pointer() + (ram_page<<14);
|
||||
membank("bank4")->set_base(ram_data);
|
||||
|
||||
logerror("RAM at 0xc000: %02x\n", ram_page);
|
||||
LOG("RAM at 0xc000: %02x\n", ram_page);
|
||||
|
||||
/* Reset memory between 0x4000 - 0xbfff in case extended paging was being used */
|
||||
/* Bank 5 in 0x4000 - 0x7fff */
|
||||
@ -241,7 +244,7 @@ void spectrum_state::spectrum_plus3_update_memory()
|
||||
ram_data = m_ram->pointer() + (memory_selection[3] << 14);
|
||||
membank("bank4")->set_base(ram_data);
|
||||
|
||||
logerror("extended memory paging: %02x\n", MemorySelection);
|
||||
LOG("extended memory paging: %02x\n", MemorySelection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,8 +318,9 @@ WRITE8_MEMBER( spectrum_state::spectrum_plus3_port_1ffd_w )
|
||||
/* D3 - Disk motor on/off */
|
||||
/* D4 - parallel port strobe */
|
||||
|
||||
m_upd765_0->get_device()->mon_w(!BIT(data, 3));
|
||||
m_upd765_1->get_device()->mon_w(!BIT(data, 3));
|
||||
for (auto &flop : m_flop)
|
||||
if (flop->get_device())
|
||||
flop->get_device()->mon_w(!BIT(data, 3));
|
||||
|
||||
m_port_1ffd_data = data;
|
||||
|
||||
@ -373,6 +377,15 @@ void spectrum_state::init_plus2()
|
||||
m_floppy = 0;
|
||||
}
|
||||
|
||||
void spectrum_state::plus3_us_w(uint8_t data)
|
||||
{
|
||||
// US1 is not connected, so US0 alone selects either drive
|
||||
floppy_image_device *flop = m_flop[data & 1]->get_device();
|
||||
m_upd765->set_floppy(flop);
|
||||
if (flop)
|
||||
flop->ds_w(data & 1);
|
||||
}
|
||||
|
||||
static void specpls3_floppies(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("3ssdd", FLOPPY_3_SSDD);
|
||||
@ -410,9 +423,10 @@ void spectrum_state::spectrum_plus3(machine_config &config)
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum_plus3 )
|
||||
|
||||
UPD765A(config, m_upd765, 4'000'000, true, true);
|
||||
FLOPPY_CONNECTOR(config, "upd765:0", specpls3_floppies, "3ssdd", floppy_image_device::default_floppy_formats);
|
||||
FLOPPY_CONNECTOR(config, "upd765:1", specpls3_floppies, "3ssdd", floppy_image_device::default_floppy_formats);
|
||||
UPD765A(config, m_upd765, 16_MHz_XTAL / 4, true, true); // clocked through SED9420
|
||||
m_upd765->us_wr_callback().set(FUNC(spectrum_state::plus3_us_w));
|
||||
FLOPPY_CONNECTOR(config, "upd765:0", specpls3_floppies, "3ssdd", floppy_image_device::default_floppy_formats); // internal drive
|
||||
FLOPPY_CONNECTOR(config, "upd765:1", specpls3_floppies, "3ssdd", floppy_image_device::default_floppy_formats); // external drive
|
||||
|
||||
SPECTRUM_EXPANSION_SLOT(config.replace(), m_exp, specpls3_expansion_devices, nullptr);
|
||||
m_exp->irq_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
|
||||
|
@ -77,8 +77,7 @@ public:
|
||||
m_exp(*this, "exp"),
|
||||
m_dock(*this, "dockslot"),
|
||||
m_upd765(*this, "upd765"),
|
||||
m_upd765_0(*this, "upd765:0"),
|
||||
m_upd765_1(*this, "upd765:1"),
|
||||
m_flop(*this, "upd765:%u", 0U),
|
||||
m_io_line0(*this, "LINE0"),
|
||||
m_io_line1(*this, "LINE1"),
|
||||
m_io_line2(*this, "LINE2"),
|
||||
@ -171,6 +170,7 @@ protected:
|
||||
DECLARE_READ8_MEMBER(spectrum_plus3_port_2ffd_r);
|
||||
DECLARE_WRITE8_MEMBER(spectrum_plus3_port_7ffd_w);
|
||||
DECLARE_WRITE8_MEMBER(spectrum_plus3_port_1ffd_w);
|
||||
void plus3_us_w(uint8_t data);
|
||||
|
||||
DECLARE_READ8_MEMBER(ts2068_port_f4_r);
|
||||
DECLARE_WRITE8_MEMBER(ts2068_port_f4_w);
|
||||
@ -234,8 +234,7 @@ protected:
|
||||
optional_device<spectrum_expansion_slot_device> m_exp;
|
||||
optional_device<generic_slot_device> m_dock;
|
||||
optional_device<upd765a_device> m_upd765;
|
||||
optional_device<floppy_connector> m_upd765_0;
|
||||
optional_device<floppy_connector> m_upd765_1;
|
||||
optional_device_array<floppy_connector, 2> m_flop;
|
||||
|
||||
// Regular spectrum ports; marked as optional because of other subclasses
|
||||
optional_ioport m_io_line0;
|
||||
|
Loading…
Reference in New Issue
Block a user