mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
adam, bw2, cbm2, newbrain, pet, plus4, pofo, vic10, vic20: Eliminate bus tag macros and legacy lookups; use finder arrays in some places
This commit is contained in:
parent
cf01398c86
commit
87894e9c99
@ -14,14 +14,6 @@
|
||||
#include "softlist_dev.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define ADAM_LEFT_EXPANSION_SLOT_TAG "slot1"
|
||||
#define ADAM_CENTER_EXPANSION_SLOT_TAG "slot2"
|
||||
#define ADAM_RIGHT_EXPANSION_SLOT_TAG "slot3"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -42,13 +42,6 @@
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define BW2_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -76,15 +76,6 @@ cbm2_expansion_slot_device::cbm2_expansion_slot_device(const machine_config &mco
|
||||
void cbm2_expansion_slot_device::device_start()
|
||||
{
|
||||
m_card = get_card_device();
|
||||
|
||||
// inherit bus clock
|
||||
// FIXME: this should be unnecessary as slots pass DERIVED_CLOCK(1, 1) through by default
|
||||
if (clock() == 0)
|
||||
{
|
||||
cbm2_expansion_slot_device *root = machine().device<cbm2_expansion_slot_device>(CBM2_EXPANSION_SLOT_TAG);
|
||||
assert(root);
|
||||
set_unscaled_clock(root->clock());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,13 +33,6 @@
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define CBM2_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -113,7 +113,7 @@ newbrain_eim_device::newbrain_eim_device(const machine_config &mconfig, const ch
|
||||
device_newbrain_expansion_slot_interface(mconfig, *this),
|
||||
m_ctc(*this, Z80CTC_TAG),
|
||||
m_acia(*this, MC6850_TAG),
|
||||
m_exp(*this, NEWBRAIN_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_rom(*this, "eim"),
|
||||
m_ram(*this, RAM_TAG)
|
||||
{
|
||||
|
@ -42,13 +42,6 @@
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define NEWBRAIN_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -135,11 +135,8 @@ newbrain_fdc_device::newbrain_fdc_device(const machine_config &mconfig, const ch
|
||||
device_newbrain_expansion_slot_interface(mconfig, *this),
|
||||
m_maincpu(*this, Z80_TAG),
|
||||
m_fdc(*this, UPD765_TAG),
|
||||
m_floppy0(*this, UPD765_TAG ":0"),
|
||||
m_floppy1(*this, UPD765_TAG ":1"),
|
||||
m_floppy2(*this, UPD765_TAG ":2"),
|
||||
m_floppy3(*this, UPD765_TAG ":3"),
|
||||
m_exp(*this, NEWBRAIN_EXPANSION_SLOT_TAG)
|
||||
m_floppy(*this, UPD765_TAG ":%u", 0U),
|
||||
m_exp(*this, "exp")
|
||||
{
|
||||
}
|
||||
|
||||
@ -224,10 +221,9 @@ void newbrain_fdc_device::iorq_w(offs_t offset, uint8_t data, bool &prtov)
|
||||
|
||||
void newbrain_fdc_device::moton(int state)
|
||||
{
|
||||
if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(!state);
|
||||
if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(!state);
|
||||
if (m_floppy2->get_device()) m_floppy2->get_device()->mon_w(!state);
|
||||
if (m_floppy3->get_device()) m_floppy3->get_device()->mon_w(!state);
|
||||
for (auto &floppy : m_floppy)
|
||||
if (floppy->get_device())
|
||||
floppy->get_device()->mon_w(!state);
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,10 +57,7 @@ private:
|
||||
|
||||
required_device<z80_device> m_maincpu;
|
||||
required_device<upd765a_device> m_fdc;
|
||||
required_device<floppy_connector> m_floppy0;
|
||||
required_device<floppy_connector> m_floppy1;
|
||||
required_device<floppy_connector> m_floppy2;
|
||||
required_device<floppy_connector> m_floppy3;
|
||||
required_device_array<floppy_connector, 4> m_floppy;
|
||||
required_device<newbrain_expansion_slot_device> m_exp;
|
||||
|
||||
void moton(int state);
|
||||
|
@ -16,13 +16,6 @@
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define PET_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -368,7 +368,7 @@ void c1551_device::device_add_mconfig(machine_config &config)
|
||||
connector.set_fixed(true);
|
||||
connector.set_formats(c1551_device::floppy_formats);
|
||||
|
||||
PLUS4_EXPANSION_SLOT(config, m_exp, 0);
|
||||
PLUS4_EXPANSION_SLOT(config, m_exp, DERIVED_CLOCK(1, 1));
|
||||
m_exp->irq_wr_callback().set(DEVICE_SELF_OWNER, FUNC(plus4_expansion_slot_device::irq_w));
|
||||
m_exp->cd_rd_callback().set(DEVICE_SELF_OWNER, FUNC(plus4_expansion_slot_device::dma_cd_r));
|
||||
m_exp->cd_wr_callback().set(DEVICE_SELF_OWNER, FUNC(plus4_expansion_slot_device::dma_cd_w));
|
||||
@ -417,7 +417,7 @@ c1551_device::c1551_device(const machine_config &mconfig, const char *tag, devic
|
||||
, m_ga(*this, C64H156_TAG)
|
||||
, m_pla(*this, PLA_TAG)
|
||||
, m_floppy(*this, C64H156_TAG":0:525ssqd")
|
||||
, m_exp(*this, PLUS4_EXPANSION_SLOT_TAG)
|
||||
, m_exp(*this, "exp")
|
||||
, m_jp1(*this, "JP1")
|
||||
, m_leds(*this, "led%u", 0U)
|
||||
, m_tcbm_data(0xff)
|
||||
|
@ -90,15 +90,6 @@ void plus4_expansion_slot_device::device_start()
|
||||
m_read_dma_cd.resolve_safe(0xff);
|
||||
m_write_dma_cd.resolve_safe();
|
||||
m_write_aec.resolve_safe();
|
||||
|
||||
// inherit bus clock
|
||||
// FIXME: this should be unnecessary as slots pass DERIVED_CLOCK(1, 1) through by default
|
||||
if (clock() == 0)
|
||||
{
|
||||
plus4_expansion_slot_device *root = machine().device<plus4_expansion_slot_device>(PLUS4_EXPANSION_SLOT_TAG);
|
||||
assert(root);
|
||||
set_unscaled_clock(root->clock());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,13 +42,6 @@
|
||||
#include "softlist_dev.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define PLUS4_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -47,13 +47,6 @@
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define PORTFOLIO_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -100,7 +100,7 @@ pofo_hpc104_device::pofo_hpc104_device(const machine_config &mconfig, device_typ
|
||||
device_portfolio_expansion_slot_interface(mconfig, *this),
|
||||
device_nvram_interface(mconfig, *this),
|
||||
m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_B_TAG),
|
||||
m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_nvram(*this, "nvram", 0x40000, ENDIANNESS_LITTLE),
|
||||
m_io_sw1(*this, "SW1")
|
||||
{
|
||||
|
@ -79,15 +79,6 @@ void vic10_expansion_slot_device::device_start()
|
||||
m_write_res.resolve_safe();
|
||||
m_write_cnt.resolve_safe();
|
||||
m_write_sp.resolve_safe();
|
||||
|
||||
// inherit bus clock
|
||||
// FIXME: this should be unnecessary as slots pass DERIVED_CLOCK(1, 1) through by default
|
||||
if (clock() == 0)
|
||||
{
|
||||
vic10_expansion_slot_device *root = machine().device<vic10_expansion_slot_device>(VIC10_EXPANSION_SLOT_TAG);
|
||||
assert(root);
|
||||
set_unscaled_clock(root->clock());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,14 +40,6 @@
|
||||
#include "formats/cbm_crt.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define VIC10_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -39,14 +39,6 @@
|
||||
#include "softlist_dev.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define VIC20_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -39,13 +39,6 @@
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
#define VIP_EXPANSION_SLOT_TAG "exp"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
@ -458,9 +458,9 @@ uint8_t adam_state::mreq_r(offs_t offset)
|
||||
}
|
||||
|
||||
data = m_cart->bd_r(offset & 0x7fff, data, cs1, cs2, cs3, cs4);
|
||||
data = m_slot1->bd_r(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
data = m_slot2->bd_r(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
data = m_slot3->bd_r(offset, data, 1, 1, 1, cas1, cas2);
|
||||
data = m_slot[0]->bd_r(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
data = m_slot[1]->bd_r(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
data = m_slot[2]->bd_r(offset, data, 1, 1, 1, cas1, cas2);
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -516,9 +516,9 @@ void adam_state::mreq_w(offs_t offset, uint8_t data)
|
||||
m_ram->pointer()[offset] = data;
|
||||
}
|
||||
|
||||
m_slot1->bd_w(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
m_slot2->bd_w(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
m_slot3->bd_w(offset, data, 1, 1, 1, cas1, cas2);
|
||||
m_slot[0]->bd_w(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
m_slot[1]->bd_w(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
m_slot[2]->bd_w(offset, data, 1, 1, 1, cas1, cas2);
|
||||
}
|
||||
|
||||
|
||||
@ -557,9 +557,9 @@ uint8_t adam_state::iorq_r(offs_t offset)
|
||||
break;
|
||||
}
|
||||
|
||||
data = m_slot1->bd_r(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
data = m_slot2->bd_r(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
data = m_slot3->bd_r(offset, data, 1, 1, 1, cas1, cas2);
|
||||
data = m_slot[0]->bd_r(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
data = m_slot[1]->bd_r(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
data = m_slot[2]->bd_r(offset, data, 1, 1, 1, cas1, cas2);
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -609,9 +609,9 @@ void adam_state::iorq_w(offs_t offset, uint8_t data)
|
||||
break;
|
||||
}
|
||||
|
||||
m_slot1->bd_w(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
m_slot2->bd_w(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
m_slot3->bd_w(offset, data, 1, 1, 1, cas1, cas2);
|
||||
m_slot[0]->bd_w(offset & 0xff, data, 1, biorq, 1, 1, 1);
|
||||
m_slot[1]->bd_w(offset, data, bmreq, biorq, aux_rom_cs, 1, cas2);
|
||||
m_slot[2]->bd_w(offset, data, 1, 1, 1, cas1, cas2);
|
||||
}
|
||||
|
||||
|
||||
@ -1076,11 +1076,11 @@ void adam_state::adam(machine_config &config)
|
||||
ADAMNET_SLOT(config, "net15", m_adamnet, adamnet_devices, nullptr);
|
||||
|
||||
COLECOVISION_CARTRIDGE_SLOT(config, m_cart, colecovision_cartridges, nullptr);
|
||||
ADAM_EXPANSION_SLOT(config, m_slot1, XTAL(7'159'090)/2, adam_slot1_devices, "adamlink");
|
||||
m_slot1->irq().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
|
||||
ADAM_EXPANSION_SLOT(config, m_slot2, XTAL(7'159'090)/2, adam_slot2_devices, nullptr);
|
||||
m_slot2->irq().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
|
||||
ADAM_EXPANSION_SLOT(config, m_slot3, XTAL(7'159'090)/2, adam_slot3_devices, "ram");
|
||||
ADAM_EXPANSION_SLOT(config, m_slot[0], XTAL(7'159'090)/2, adam_slot1_devices, "adamlink"); // left
|
||||
m_slot[0]->irq().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
|
||||
ADAM_EXPANSION_SLOT(config, m_slot[1], XTAL(7'159'090)/2, adam_slot2_devices, nullptr); // center
|
||||
m_slot[1]->irq().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
|
||||
ADAM_EXPANSION_SLOT(config, m_slot[2], XTAL(7'159'090)/2, adam_slot3_devices, "ram"); // right
|
||||
|
||||
COLECOVISION_CONTROL_PORT(config, m_joy1, colecovision_control_port_devices, "hand");
|
||||
m_joy1->irq().set(FUNC(adam_state::joy1_irq_w));
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
m_ieee2(*this, DS75161A_TAG),
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG),
|
||||
m_exp(*this, CBM2_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_user(*this, USER_PORT_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
|
@ -202,7 +202,7 @@ public:
|
||||
m_palette(*this, "palette"),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
m_cassette2(*this, PET_DATASSETTE_PORT2_TAG),
|
||||
m_exp(*this, PET_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_user(*this, PET_USER_PORT_TAG),
|
||||
m_speaker(*this, "speaker"),
|
||||
m_cart_9000(*this, "cart_9000"),
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
m_iec(*this, CBM_IEC_TAG),
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG),
|
||||
m_exp(*this, PLUS4_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_user(*this, PET_USER_PORT_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
m_keyboard(*this, "keyboard"),
|
||||
m_dtmf(*this, PCD3311T_TAG),
|
||||
m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_A_TAG),
|
||||
m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_timer_tick(*this, TIMER_TICK_TAG),
|
||||
m_nvram(*this, "nvram"),
|
||||
m_ram(*this, "ram"),
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
m_cia(*this, MOS6526_TAG),
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG),
|
||||
m_exp(*this, VIC10_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_LITTLE),
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
m_vic(*this, VIC_TAG),
|
||||
m_iec(*this, CBM_IEC_TAG),
|
||||
m_joy(*this, CONTROL1_TAG),
|
||||
m_exp(*this, VIC20_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_user(*this, PET_USER_PORT_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
|
@ -35,9 +35,7 @@ public:
|
||||
m_psg(*this, SN76489A_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_adamnet(*this, "adamnet"),
|
||||
m_slot1(*this, ADAM_LEFT_EXPANSION_SLOT_TAG),
|
||||
m_slot2(*this, ADAM_CENTER_EXPANSION_SLOT_TAG),
|
||||
m_slot3(*this, ADAM_RIGHT_EXPANSION_SLOT_TAG),
|
||||
m_slot(*this, "slot%u", 1U),
|
||||
m_cart(*this, COLECOVISION_CARTRIDGE_SLOT_TAG),
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG),
|
||||
@ -57,9 +55,7 @@ public:
|
||||
required_device<sn76489a_device> m_psg;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<adamnet_device> m_adamnet;
|
||||
required_device<adam_expansion_slot_device> m_slot1;
|
||||
required_device<adam_expansion_slot_device> m_slot2;
|
||||
required_device<adam_expansion_slot_device> m_slot3;
|
||||
required_device_array<adam_expansion_slot_device, 3> m_slot;
|
||||
required_device<colecovision_cartridge_slot_device> m_cart;
|
||||
required_device<colecovision_control_port_device> m_joy1;
|
||||
required_device<colecovision_control_port_device> m_joy2;
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
m_lcdc(*this, MSM6255_TAG),
|
||||
m_pit(*this, "ic6"),
|
||||
m_centronics(*this, CENTRONICS_TAG),
|
||||
m_exp(*this, BW2_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_floppy0(*this, WD2797_TAG":0"),
|
||||
m_floppy1(*this, WD2797_TAG":1"),
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
m_maincpu(*this, Z80_TAG),
|
||||
m_cop(*this, COP420_TAG),
|
||||
m_palette(*this, "palette"),
|
||||
m_exp(*this, NEWBRAIN_EXPANSION_SLOT_TAG),
|
||||
m_exp(*this, "exp"),
|
||||
m_cassette1(*this, "cassette1"),
|
||||
m_cassette2(*this, "cassette2"),
|
||||
m_rs232_v24(*this, RS232_V24_TAG),
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
, m_cassette(*this, "cassette")
|
||||
, m_beeper(*this, DISCRETE_TAG)
|
||||
, m_byteio(*this, VIP_BYTEIO_PORT_TAG)
|
||||
, m_exp(*this, VIP_EXPANSION_SLOT_TAG)
|
||||
, m_exp(*this, "exp")
|
||||
, m_ram(*this, RAM_TAG)
|
||||
, m_rom(*this, CDP1802_TAG)
|
||||
, m_chip8(*this, "chip8")
|
||||
|
Loading…
Reference in New Issue
Block a user