mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
bus\hp80_io: removed MCFG macros (nw)
This commit is contained in:
parent
181d116285
commit
e13cb27bd5
@ -13,16 +13,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define MCFG_HP80_IO_SLOT_ADD(_tag , _idx) \
|
|
||||||
MCFG_DEVICE_ADD(_tag, HP80_IO_SLOT, 0) \
|
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(hp80_io_slot_devices, nullptr, false) \
|
|
||||||
downcast<hp80_io_slot_device &>(*device).set_slot_no(_idx);
|
|
||||||
|
|
||||||
#define MCFG_HP80_IO_IRL_CB(_devcb) \
|
|
||||||
downcast<hp80_io_slot_device &>(*device).set_irl_cb_func(DEVCB_##_devcb);
|
|
||||||
|
|
||||||
#define MCFG_HP80_IO_HALT_CB(_devcb) \
|
|
||||||
downcast<hp80_io_slot_device &>(*device).set_halt_cb_func(DEVCB_##_devcb);
|
|
||||||
|
|
||||||
#define HP80_IO_FIRST_SC 3 // Lowest SC used by I/O cards
|
#define HP80_IO_FIRST_SC 3 // Lowest SC used by I/O cards
|
||||||
|
|
||||||
@ -38,11 +28,22 @@
|
|||||||
PORT_CONFSETTING(6 , "9")\
|
PORT_CONFSETTING(6 , "9")\
|
||||||
PORT_CONFSETTING(7 , "10")
|
PORT_CONFSETTING(7 , "10")
|
||||||
|
|
||||||
|
void hp80_io_slot_devices(device_slot_interface &device);
|
||||||
|
|
||||||
class hp80_io_slot_device : public device_t,
|
class hp80_io_slot_device : public device_t,
|
||||||
public device_slot_interface
|
public device_slot_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
|
hp80_io_slot_device(machine_config const &mconfig, char const *tag, device_t *owner)
|
||||||
|
: hp80_io_slot_device(mconfig, tag, owner, (uint32_t)0)
|
||||||
|
{
|
||||||
|
option_reset();
|
||||||
|
hp80_io_slot_devices(*this);
|
||||||
|
set_default_option(nullptr);
|
||||||
|
set_fixed(false);
|
||||||
|
}
|
||||||
|
|
||||||
hp80_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
hp80_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
virtual ~hp80_io_slot_device();
|
virtual ~hp80_io_slot_device();
|
||||||
|
|
||||||
@ -53,8 +54,8 @@ public:
|
|||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
|
|
||||||
// Callback setups
|
// Callback setups
|
||||||
template <class Object> devcb_base &set_irl_cb_func(Object &&cb) { return m_irl_cb_func.set_callback(std::forward<Object>(cb)); }
|
auto irl_cb() { return m_irl_cb_func.bind(); }
|
||||||
template <class Object> devcb_base &set_halt_cb_func(Object &&cb) { return m_halt_cb_func.set_callback(std::forward<Object>(cb)); }
|
auto halt_cb() { return m_halt_cb_func.bind(); }
|
||||||
|
|
||||||
// SC getter
|
// SC getter
|
||||||
uint8_t get_sc() const;
|
uint8_t get_sc() const;
|
||||||
@ -102,6 +103,4 @@ protected:
|
|||||||
// device type definition
|
// device type definition
|
||||||
DECLARE_DEVICE_TYPE(HP80_IO_SLOT, hp80_io_slot_device)
|
DECLARE_DEVICE_TYPE(HP80_IO_SLOT, hp80_io_slot_device)
|
||||||
|
|
||||||
void hp80_io_slot_devices(device_slot_interface &device);
|
|
||||||
|
|
||||||
#endif // MAME_BUS_HP80_IO_HP80_IO_H
|
#endif // MAME_BUS_HP80_IO_HP80_IO_H
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
// Size of optional ROMs (8k)
|
// Size of optional ROMs (8k)
|
||||||
static constexpr offs_t HP80_OPTROM_SIZE = 0x2000;
|
static constexpr offs_t HP80_OPTROM_SIZE = 0x2000;
|
||||||
|
|
||||||
|
void hp80_optrom_slot_devices(device_slot_interface &device);
|
||||||
|
|
||||||
class hp80_optrom_cart_device : public device_t,
|
class hp80_optrom_cart_device : public device_t,
|
||||||
public device_slot_card_interface
|
public device_slot_card_interface
|
||||||
{
|
{
|
||||||
@ -38,6 +40,15 @@ class hp80_optrom_slot_device : public device_t,
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
|
hp80_optrom_slot_device(machine_config const &mconfig, char const *tag, device_t *owner)
|
||||||
|
: hp80_optrom_slot_device(mconfig, tag, owner, (uint32_t)0)
|
||||||
|
{
|
||||||
|
option_reset();
|
||||||
|
hp80_optrom_slot_devices(*this);
|
||||||
|
set_default_option(nullptr);
|
||||||
|
set_fixed(false);
|
||||||
|
}
|
||||||
|
|
||||||
hp80_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
hp80_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
virtual ~hp80_optrom_slot_device();
|
virtual ~hp80_optrom_slot_device();
|
||||||
|
|
||||||
@ -72,6 +83,4 @@ protected:
|
|||||||
DECLARE_DEVICE_TYPE(HP80_OPTROM_SLOT, hp80_optrom_slot_device)
|
DECLARE_DEVICE_TYPE(HP80_OPTROM_SLOT, hp80_optrom_slot_device)
|
||||||
DECLARE_DEVICE_TYPE(HP80_OPTROM_CART, hp80_optrom_cart_device)
|
DECLARE_DEVICE_TYPE(HP80_OPTROM_CART, hp80_optrom_cart_device)
|
||||||
|
|
||||||
void hp80_optrom_slot_devices(device_slot_interface &device);
|
|
||||||
|
|
||||||
#endif // MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
|
#endif // MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
|
||||||
|
@ -1331,17 +1331,18 @@ void hp85_state::rombank_mem_map(address_map &map)
|
|||||||
map(0x0000, 0x1fff).rom();
|
map(0x0000, 0x1fff).rom();
|
||||||
}
|
}
|
||||||
|
|
||||||
MACHINE_CONFIG_START(hp85_state::hp85)
|
void hp85_state::hp85(machine_config &config)
|
||||||
MCFG_DEVICE_ADD("cpu" , HP_CAPRICORN , MASTER_CLOCK / 16)
|
{
|
||||||
MCFG_DEVICE_PROGRAM_MAP(cpu_mem_map)
|
HP_CAPRICORN(config, m_cpu, MASTER_CLOCK / 16);
|
||||||
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(hp85_state , irq_callback)
|
m_cpu->set_addrmap(AS_PROGRAM, &hp85_state::cpu_mem_map);
|
||||||
|
m_cpu->set_irq_acknowledge_callback(FUNC(hp85_state::irq_callback));
|
||||||
|
|
||||||
ADDRESS_MAP_BANK(config, "rombank").set_map(&hp85_state::rombank_mem_map).set_options(ENDIANNESS_LITTLE, 8, 21, HP80_OPTROM_SIZE);
|
ADDRESS_MAP_BANK(config, "rombank").set_map(&hp85_state::rombank_mem_map).set_options(ENDIANNESS_LITTLE, 8, 21, HP80_OPTROM_SIZE);
|
||||||
|
|
||||||
MCFG_SCREEN_ADD("screen" , RASTER)
|
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||||
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK / 2 , 312 , 0 , 256 , 256 , 0 , 192)
|
m_screen->set_raw(MASTER_CLOCK / 2 , 312 , 0 , 256 , 256 , 0 , 192);
|
||||||
MCFG_SCREEN_UPDATE_DRIVER(hp85_state , screen_update)
|
m_screen->set_screen_update(FUNC(hp85_state::screen_update));
|
||||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, hp85_state, vblank_w))
|
m_screen->screen_vblank().set(FUNC(hp85_state::vblank_w));
|
||||||
PALETTE(config, m_palette, palette_device::MONOCHROME);
|
PALETTE(config, m_palette, palette_device::MONOCHROME);
|
||||||
TIMER(config, m_vm_timer).configure_generic(FUNC(hp85_state::vm_timer));
|
TIMER(config, m_vm_timer).configure_generic(FUNC(hp85_state::vm_timer));
|
||||||
|
|
||||||
@ -1362,42 +1363,36 @@ MACHINE_CONFIG_START(hp85_state::hp85)
|
|||||||
BEEP(config, m_beep, MASTER_CLOCK / 8192).add_route(ALL_OUTPUTS, "mono", 0.5, AUTO_ALLOC_INPUT, 0);
|
BEEP(config, m_beep, MASTER_CLOCK / 8192).add_route(ALL_OUTPUTS, "mono", 0.5, AUTO_ALLOC_INPUT, 0);
|
||||||
|
|
||||||
// Tape drive
|
// Tape drive
|
||||||
MCFG_DEVICE_ADD("tape" , HP_1MA6 , 0)
|
HP_1MA6(config, "tape", 0);
|
||||||
|
|
||||||
// Optional ROMs
|
// Optional ROMs
|
||||||
MCFG_DEVICE_ADD("drawer1", HP80_OPTROM_SLOT, 0)
|
HP80_OPTROM_SLOT(config, m_rom_drawers[0]);
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_devices, NULL, false)
|
HP80_OPTROM_SLOT(config, m_rom_drawers[1]);
|
||||||
MCFG_DEVICE_ADD("drawer2", HP80_OPTROM_SLOT, 0)
|
HP80_OPTROM_SLOT(config, m_rom_drawers[2]);
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_devices, NULL, false)
|
HP80_OPTROM_SLOT(config, m_rom_drawers[3]);
|
||||||
MCFG_DEVICE_ADD("drawer3", HP80_OPTROM_SLOT, 0)
|
HP80_OPTROM_SLOT(config, m_rom_drawers[4]);
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_devices, NULL, false)
|
HP80_OPTROM_SLOT(config, m_rom_drawers[5]);
|
||||||
MCFG_DEVICE_ADD("drawer4", HP80_OPTROM_SLOT, 0)
|
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_devices, NULL, false)
|
|
||||||
MCFG_DEVICE_ADD("drawer5", HP80_OPTROM_SLOT, 0)
|
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_devices, NULL, false)
|
|
||||||
MCFG_DEVICE_ADD("drawer6", HP80_OPTROM_SLOT, 0)
|
|
||||||
MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_devices, NULL, false)
|
|
||||||
|
|
||||||
// I/O slots
|
// I/O slots
|
||||||
MCFG_HP80_IO_SLOT_ADD("slot1" , 0)
|
HP80_IO_SLOT(config, m_io_slots[0]).set_slot_no(0);
|
||||||
MCFG_HP80_IO_IRL_CB(WRITE8(*this, hp85_state , irl_w))
|
m_io_slots[0]->irl_cb().set(FUNC(hp85_state::irl_w));
|
||||||
MCFG_HP80_IO_HALT_CB(WRITE8(*this, hp85_state , halt_w))
|
m_io_slots[0]->halt_cb().set(FUNC(hp85_state::halt_w));
|
||||||
MCFG_HP80_IO_SLOT_ADD("slot2" , 1)
|
HP80_IO_SLOT(config, m_io_slots[1]).set_slot_no(1);
|
||||||
MCFG_HP80_IO_IRL_CB(WRITE8(*this, hp85_state , irl_w))
|
m_io_slots[1]->irl_cb().set(FUNC(hp85_state::irl_w));
|
||||||
MCFG_HP80_IO_HALT_CB(WRITE8(*this, hp85_state , halt_w))
|
m_io_slots[1]->halt_cb().set(FUNC(hp85_state::halt_w));
|
||||||
MCFG_HP80_IO_SLOT_ADD("slot3" , 2)
|
HP80_IO_SLOT(config, m_io_slots[2]).set_slot_no(2);
|
||||||
MCFG_HP80_IO_IRL_CB(WRITE8(*this, hp85_state , irl_w))
|
m_io_slots[2]->irl_cb().set(FUNC(hp85_state::irl_w));
|
||||||
MCFG_HP80_IO_HALT_CB(WRITE8(*this, hp85_state , halt_w))
|
m_io_slots[2]->halt_cb().set(FUNC(hp85_state::halt_w));
|
||||||
MCFG_HP80_IO_SLOT_ADD("slot4" , 3)
|
HP80_IO_SLOT(config, m_io_slots[3]).set_slot_no(3);
|
||||||
MCFG_HP80_IO_IRL_CB(WRITE8(*this, hp85_state , irl_w))
|
m_io_slots[3]->irl_cb().set(FUNC(hp85_state::irl_w));
|
||||||
MCFG_HP80_IO_HALT_CB(WRITE8(*this, hp85_state , halt_w))
|
m_io_slots[3]->halt_cb().set(FUNC(hp85_state::halt_w));
|
||||||
|
|
||||||
// Printer output
|
// Printer output
|
||||||
BITBANGER(config, m_prt_graph_out, 0);
|
BITBANGER(config, m_prt_graph_out, 0);
|
||||||
BITBANGER(config, m_prt_alpha_out, 0);
|
BITBANGER(config, m_prt_alpha_out, 0);
|
||||||
|
|
||||||
SOFTWARE_LIST(config, "optrom_list").set_original("hp85_rom");
|
SOFTWARE_LIST(config, "optrom_list").set_original("hp85_rom");
|
||||||
MACHINE_CONFIG_END
|
}
|
||||||
|
|
||||||
ROM_START(hp85)
|
ROM_START(hp85)
|
||||||
ROM_REGION(0x6000 , "cpu" , 0)
|
ROM_REGION(0x6000 , "cpu" , 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user