Skip to content

Commit

Permalink
volt_reg: removed MCFG macro (nw)
Browse files Browse the repository at this point in the history
  • Loading branch information
Osso13 committed Feb 12, 2019
1 parent febaed1 commit a076b8d
Show file tree
Hide file tree
Showing 115 changed files with 851 additions and 793 deletions.
15 changes: 8 additions & 7 deletions src/devices/bus/a2bus/a2dx1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ DEFINE_DEVICE_TYPE(A2BUS_DX1, a2bus_dx1_device, "a2dx1", "Decillonix DX-1")
// device_add_mconfig - add device configuration
//-------------------------------------------------

MACHINE_CONFIG_START(a2bus_dx1_device::device_add_mconfig)
void a2bus_dx1_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "speaker").front_center();
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) // unknown DAC
MCFG_DEVICE_ADD("dacvol", DAC_8BIT_R2R, 0) // unknown DAC
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "dacvol", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
DAC_8BIT_R2R(config, m_dacvol, 0).add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT).add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "dacvol", 1.0, DAC_VREF_POS_INPUT);
}

//**************************************************************************
// LIVE DEVICE
Expand Down
27 changes: 14 additions & 13 deletions src/devices/bus/a2bus/pc_xporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@ void a2bus_pcxporter_device::pc_io(address_map &map)
// device_add_mconfig - add device configuration
//-------------------------------------------------

MACHINE_CONFIG_START(a2bus_pcxporter_device::device_add_mconfig)
MCFG_DEVICE_ADD(m_v30, V30, A2BUS_7M_CLOCK) // 7.16 MHz as per manual
MCFG_DEVICE_PROGRAM_MAP(pc_map)
MCFG_DEVICE_IO_MAP(pc_io)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("pic8259", pic8259_device, inta_cb)
MCFG_DEVICE_DISABLE()
void a2bus_pcxporter_device::device_add_mconfig(machine_config &config)
{
V30(config, m_v30, A2BUS_7M_CLOCK); // 7.16 MHz as per manual
m_v30->set_addrmap(AS_PROGRAM, &a2bus_pcxporter_device::pc_map);
m_v30->set_addrmap(AS_IO, &a2bus_pcxporter_device::pc_io);
m_v30->set_irq_acknowledge_callback("pic8259", FUNC(pic8259_device::inta_cb));
m_v30->set_disable();

PIT8253(config, m_pit8253);
m_pit8253->set_clk<0>(A2BUS_7M_CLOCK / 6.0); // heartbeat IRQ
Expand Down Expand Up @@ -163,18 +164,18 @@ MACHINE_CONFIG_START(a2bus_pcxporter_device::device_add_mconfig)
m_isabus->drq2_callback().set(m_dma8237, FUNC(am9517a_device::dreq2_w));
m_isabus->drq3_callback().set(m_dma8237, FUNC(am9517a_device::dreq3_w));

MCFG_DEVICE_ADD(m_pc_kbdc, PC_KBDC, 0)
MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE(*this, a2bus_pcxporter_device, keyboard_clock_w))
MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE(*this, a2bus_pcxporter_device, keyboard_data_w))
MCFG_PC_KBDC_SLOT_ADD("pc_kbdc", "kbd", pc_xt_keyboards, STR_KBD_KEYTRONIC_PC3270)
PC_KBDC(config, m_pc_kbdc, 0);
m_pc_kbdc->out_clock_cb().set(FUNC(a2bus_pcxporter_device::keyboard_clock_w));
m_pc_kbdc->out_data_cb().set(FUNC(a2bus_pcxporter_device::keyboard_data_w));
PC_KBDC_SLOT(config, "kbd", pc_xt_keyboards, STR_KBD_KEYTRONIC_PC3270).set_pc_kbdc_slot(m_pc_kbdc);

/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 1.00);

MCFG_DEVICE_ADD("isa1", ISA8_SLOT, 0, m_isabus, pc_isa8_cards, "cga", true) // FIXME: determine ISA bus clock
MCFG_DEVICE_ADD("isa2", ISA8_SLOT, 0, m_isabus, pc_isa8_cards, "fdc_xt", true)
MACHINE_CONFIG_END
ISA8_SLOT(config, "isa1", 0, m_isabus, pc_isa8_cards, "cga", true); // FIXME: determine ISA bus clock
ISA8_SLOT(config, "isa2", 0, m_isabus, pc_isa8_cards, "fdc_xt", true);
}

//**************************************************************************
// LIVE DEVICE
Expand Down
82 changes: 41 additions & 41 deletions src/devices/bus/coco/coco_multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,29 +96,6 @@ namespace
// construction/destruction
coco_multipak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;

virtual uint8_t* get_cart_base() override;
virtual uint32_t get_cart_size() override;

// these are only public so they can be in a MACHINE_CONFIG_START
// declaration; don't think about them as publically accessable
DECLARE_WRITE_LINE_MEMBER(multi_slot1_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot1_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot1_halt_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot2_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot2_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot2_halt_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot3_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot3_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot3_halt_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot4_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot4_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot4_halt_w);

virtual address_space &cartridge_space() override;
virtual ioport_constructor device_input_ports() const override;
INPUT_CHANGED_MEMBER( switch_changed );

protected:
Expand All @@ -129,6 +106,15 @@ namespace
virtual WRITE8_MEMBER(scs_write) override;
virtual void set_sound_enable(bool sound_enable) override;

// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;

virtual uint8_t* get_cart_base() override;
virtual uint32_t get_cart_size() override;

virtual address_space &cartridge_space() override;
virtual ioport_constructor device_input_ports() const override;

private:
// device references
required_device_array<cococart_slot_device, 4> m_slots;
Expand All @@ -149,6 +135,19 @@ namespace
DECLARE_READ8_MEMBER(ff7f_read);
DECLARE_WRITE8_MEMBER(ff7f_write);
void update_line(int slot_number, line ln);

DECLARE_WRITE_LINE_MEMBER(multi_slot1_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot1_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot1_halt_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot2_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot2_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot2_halt_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot3_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot3_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot3_halt_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot4_cart_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot4_nmi_w);
DECLARE_WRITE_LINE_MEMBER(multi_slot4_halt_w);
};
};

Expand Down Expand Up @@ -182,24 +181,25 @@ static void coco_cart_slot4(device_slot_interface &device)
}


MACHINE_CONFIG_START(coco_multipak_device::device_add_mconfig)
MCFG_COCO_CARTRIDGE_ADD(SLOT1_TAG, coco_cart_slot1_3, nullptr)
MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot1_cart_w))
MCFG_COCO_CARTRIDGE_NMI_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot1_nmi_w))
MCFG_COCO_CARTRIDGE_HALT_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot1_halt_w))
MCFG_COCO_CARTRIDGE_ADD(SLOT2_TAG, coco_cart_slot1_3, nullptr)
MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot2_cart_w))
MCFG_COCO_CARTRIDGE_NMI_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot2_nmi_w))
MCFG_COCO_CARTRIDGE_HALT_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot2_halt_w))
MCFG_COCO_CARTRIDGE_ADD(SLOT3_TAG, coco_cart_slot1_3, nullptr)
MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot3_cart_w))
MCFG_COCO_CARTRIDGE_NMI_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot3_nmi_w))
MCFG_COCO_CARTRIDGE_HALT_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot3_halt_w))
MCFG_COCO_CARTRIDGE_ADD(SLOT4_TAG, coco_cart_slot4, "fdcv11")
MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot4_cart_w))
MCFG_COCO_CARTRIDGE_NMI_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot4_nmi_w))
MCFG_COCO_CARTRIDGE_HALT_CB(WRITELINE(DEVICE_SELF, coco_multipak_device, multi_slot4_halt_w))
MACHINE_CONFIG_END
void coco_multipak_device::device_add_mconfig(machine_config &config)
{
COCOCART_SLOT(config, m_slots[0], DERIVED_CLOCK(1, 1), coco_cart_slot1_3, nullptr);
m_slots[0]->cart_callback().set(FUNC(coco_multipak_device::multi_slot1_cart_w));
m_slots[0]->nmi_callback().set(FUNC(coco_multipak_device::multi_slot1_nmi_w));
m_slots[0]->halt_callback().set(FUNC(coco_multipak_device::multi_slot1_halt_w));
COCOCART_SLOT(config, m_slots[1], DERIVED_CLOCK(1, 1), coco_cart_slot1_3, nullptr);
m_slots[1]->cart_callback().set(FUNC(coco_multipak_device::multi_slot2_cart_w));
m_slots[1]->nmi_callback().set(FUNC(coco_multipak_device::multi_slot2_nmi_w));
m_slots[1]->halt_callback().set(FUNC(coco_multipak_device::multi_slot2_halt_w));
COCOCART_SLOT(config, m_slots[2], DERIVED_CLOCK(1, 1), coco_cart_slot1_3, nullptr);
m_slots[2]->cart_callback().set(FUNC(coco_multipak_device::multi_slot3_cart_w));
m_slots[2]->nmi_callback().set(FUNC(coco_multipak_device::multi_slot3_nmi_w));
m_slots[2]->halt_callback().set(FUNC(coco_multipak_device::multi_slot3_halt_w));
COCOCART_SLOT(config, m_slots[3], DERIVED_CLOCK(1, 1), coco_cart_slot4, "fdcv11");
m_slots[3]->cart_callback().set(FUNC(coco_multipak_device::multi_slot4_cart_w));
m_slots[3]->nmi_callback().set(FUNC(coco_multipak_device::multi_slot4_nmi_w));
m_slots[3]->halt_callback().set(FUNC(coco_multipak_device::multi_slot4_halt_w));
}

INPUT_PORTS_START( coco_multipack )
PORT_START( SWITCH_CONFIG_TAG )
Expand Down
16 changes: 9 additions & 7 deletions src/devices/bus/coco/coco_orch90.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ namespace
// MACHINE AND ROM DECLARATIONS
//**************************************************************************

MACHINE_CONFIG_START(coco_orch90_device::device_add_mconfig)
void coco_orch90_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
MCFG_DEVICE_ADD("ldac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // ls374.ic5 + r7 (8x20k) + r9 (8x10k)
MCFG_DEVICE_ADD("rdac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // ls374.ic4 + r6 (8x20k) + r8 (8x10k)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ROUTE(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
DAC_8BIT_R2R(config, m_ldac, 0).add_route(ALL_OUTPUTS, "lspeaker", 0.5); // ls374.ic5 + r7 (8x20k) + r9 (8x10k)
DAC_8BIT_R2R(config, m_rdac, 0).add_route(ALL_OUTPUTS, "rspeaker", 0.5); // ls374.ic4 + r6 (8x20k) + r8 (8x10k)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.set_output(5.0);
vref.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT);
}


//**************************************************************************
Expand Down
21 changes: 0 additions & 21 deletions src/devices/bus/coco/cococart.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
// direct region update handler
typedef delegate<void (uint8_t *)> cococart_base_update_delegate;

#define MCFG_COCO_CARTRIDGE_CART_CB(_devcb) \
downcast<cococart_slot_device &>(*device).set_cart_callback(DEVCB_##_devcb);

#define MCFG_COCO_CARTRIDGE_NMI_CB(_devcb) \
downcast<cococart_slot_device &>(*device).set_nmi_callback(DEVCB_##_devcb);

#define MCFG_COCO_CARTRIDGE_HALT_CB(_devcb) \
downcast<cococart_slot_device &>(*device).set_halt_callback(DEVCB_##_devcb);


// ======================> cococart_slot_device
class device_cococart_interface;
Expand Down Expand Up @@ -72,9 +63,6 @@ class cococart_slot_device final : public device_t,
}
cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

template <class Object> devcb_base &set_cart_callback(Object &&cb) { return m_cart_callback.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_nmi_callback(Object &&cb) { return m_nmi_callback.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_halt_callback(Object &&cb) { return m_halt_callback.set_callback(std::forward<Object>(cb)); }
auto cart_callback() { return m_cart_callback.bind(); }
auto nmi_callback() { return m_nmi_callback.bind(); }
auto halt_callback() { return m_halt_callback.bind(); }
Expand Down Expand Up @@ -216,13 +204,4 @@ class device_cococart_interface : public device_slot_card_interface
device_cococart_host_interface * m_host;
};


/***************************************************************************
DEVICE CONFIGURATION MACROS
***************************************************************************/

#define MCFG_COCO_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, COCOCART_SLOT, DERIVED_CLOCK(1, 1)) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)

#endif // MAME_BUS_COCO_COCOCART_H
38 changes: 14 additions & 24 deletions src/devices/bus/ecbbus/ecbbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,6 @@
#define ECBBUS_TAG "ecbbus"



//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************

#define MCFG_ECBBUS_ADD() \
MCFG_DEVICE_ADD(ECBBUS_TAG, ECBBUS, 0)
#define MCFG_ECBBUS_SLOT_ADD(_num, _tag, _slot_intf, _def_slot) \
MCFG_DEVICE_ADD(_tag, ECBBUS_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
downcast<ecbbus_slot_device &>(*device).set_ecbbus_slot(ECBBUS_TAG, _num);


#define MCFG_ECBBUS_IRQ_CALLBACK(_write) \
downcast<ecbbus_device &>(*device).set_irq_wr_callback(DEVCB_##_write);

#define MCFG_ECBBUS_NMI_CALLBACK(_write) \
downcast<ecbbus_device &>(*device).set_nmi_wr_callback(DEVCB_##_write);



//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
Expand All @@ -90,6 +69,17 @@ class ecbbus_slot_device : public device_t,
{
public:
// construction/destruction
template <typename T>
ecbbus_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, int num, T &&opts, char const *dflt)
: ecbbus_slot_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
set_ecbbus_slot(ECBBUS_TAG, num);
}

ecbbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

// device-level overrides
Expand Down Expand Up @@ -121,10 +111,10 @@ class ecbbus_device : public device_t
{
public:
// construction/destruction
ecbbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
ecbbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);

template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_nmi_wr_callback(Object &&cb) { return m_write_nmi.set_callback(std::forward<Object>(cb)); }
auto irq_wr_callback() { return m_write_irq.bind(); }
auto nmi_wr_callback() { return m_write_nmi.bind(); }

void add_card(device_ecbbus_card_interface *card, int pos);

Expand Down
19 changes: 10 additions & 9 deletions src/devices/bus/lpci/southbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ static void pc_isa_onboard(device_slot_interface &device)
// device_add_mconfig - add device configuration
//-------------------------------------------------

MACHINE_CONFIG_START(southbridge_extended_device::device_add_mconfig)
void southbridge_extended_device::device_add_mconfig(machine_config &config)
{
southbridge_device::device_add_mconfig(config);

at_keyboard_controller_device &keybc(AT_KEYBOARD_CONTROLLER(config, "keybc", XTAL(12'000'000)));
Expand All @@ -526,20 +527,20 @@ MACHINE_CONFIG_START(southbridge_extended_device::device_add_mconfig)
keybc.kbd_clk().set("pc_kbdc", FUNC(pc_kbdc_device::clock_write_from_mb));
keybc.kbd_data().set("pc_kbdc", FUNC(pc_kbdc_device::data_write_from_mb));

MCFG_DEVICE_ADD("pc_kbdc", PC_KBDC, 0)
MCFG_PC_KBDC_OUT_CLOCK_CB(WRITELINE("keybc", at_keyboard_controller_device, kbd_clk_w))
MCFG_PC_KBDC_OUT_DATA_CB(WRITELINE("keybc", at_keyboard_controller_device, kbd_data_w))
MCFG_PC_KBDC_SLOT_ADD("pc_kbdc", "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL)
PC_KBDC(config, m_pc_kbdc, 0);
m_pc_kbdc->out_clock_cb().set(m_keybc, FUNC(at_keyboard_controller_device::kbd_clk_w));
m_pc_kbdc->out_data_cb().set(m_keybc, FUNC(at_keyboard_controller_device::kbd_data_w));
PC_KBDC_SLOT(config, "kbd", pc_at_keyboards, STR_KBD_MICROSOFT_NATURAL).set_pc_kbdc_slot(m_pc_kbdc);

ds12885_device &rtc(DS12885(config, "rtc"));
rtc.irq().set("pic8259_slave", FUNC(pic8259_device::ir0_w));
rtc.set_century_index(0x32);

// on board devices
MCFG_DEVICE_ADD("board1", ISA16_SLOT, 0, "isabus", pc_isa_onboard, "fdcsmc", true) // FIXME: determine ISA bus clock
MCFG_DEVICE_ADD("board2", ISA16_SLOT, 0, "isabus", pc_isa_onboard, "comat", true)
MCFG_DEVICE_ADD("board3", ISA16_SLOT, 0, "isabus", pc_isa_onboard, "lpt", true)
MACHINE_CONFIG_END
ISA16_SLOT(config, "board1", 0, "isabus", pc_isa_onboard, "fdcsmc", true); // FIXME: determine ISA bus clock
ISA16_SLOT(config, "board2", 0, "isabus", pc_isa_onboard, "comat", true);
ISA16_SLOT(config, "board3", 0, "isabus", pc_isa_onboard, "lpt", true);
}

southbridge_extended_device::southbridge_extended_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: southbridge_device(mconfig, type, tag, owner, clock),
Expand Down
20 changes: 15 additions & 5 deletions src/devices/bus/pc1512/mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,23 @@ class pc1512_mouse_port_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
pc1512_mouse_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <typename T>
pc1512_mouse_port_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
: pc1512_mouse_port_device(mconfig, tag, owner, 0)
{
option_reset();
opts(*this);
set_default_option(dflt);
set_fixed(false);
}

pc1512_mouse_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);

// static configuration helpers
template <class Object> devcb_base &set_x_wr_callback(Object &&cb) { return m_write_x.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_y_wr_callback(Object &&cb) { return m_write_y.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_m1_wr_callback(Object &&cb) { return m_write_m1.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_m2_wr_callback(Object &&cb) { return m_write_m2.set_callback(std::forward<Object>(cb)); }
auto x_wr_callback() { return m_write_x.bind(); }
auto y_wr_callback() { return m_write_y.bind(); }
auto m1_wr_callback() { return m_write_m1.bind(); }
auto m2_wr_callback() { return m_write_m2.bind(); }

// peripheral interface
void x_w(uint8_t data) { m_write_x(data); }
Expand Down
Loading

0 comments on commit a076b8d

Please sign in to comment.