diff options
-rw-r--r-- | src/devices/bus/hp9845_io/98034.cpp | 12 | ||||
-rw-r--r-- | src/devices/bus/hp9845_io/98035.cpp | 13 | ||||
-rw-r--r-- | src/devices/cpu/mc68hc11/mc68hc11.h | 15 | ||||
-rw-r--r-- | src/devices/cpu/mips/ps2vu.cpp | 7 | ||||
-rw-r--r-- | src/devices/cpu/mn10200/mn10200.cpp | 39 | ||||
-rw-r--r-- | src/devices/cpu/mn10200/mn10200.h | 23 | ||||
-rw-r--r-- | src/devices/cpu/nanoprocessor/nanoprocessor.h | 23 | ||||
-rw-r--r-- | src/mame/audio/taito_zm.cpp | 15 | ||||
-rw-r--r-- | src/mame/drivers/30test.cpp | 23 | ||||
-rw-r--r-- | src/mame/drivers/alphasma.cpp | 10 | ||||
-rw-r--r-- | src/mame/drivers/hitpoker.cpp | 30 | ||||
-rw-r--r-- | src/mame/drivers/skeetsht.cpp | 26 | ||||
-rw-r--r-- | src/mame/drivers/taitojc.cpp | 60 |
13 files changed, 136 insertions, 160 deletions
diff --git a/src/devices/bus/hp9845_io/98034.cpp b/src/devices/bus/hp9845_io/98034.cpp index 77c8933aa15..b82935a9762 100644 --- a/src/devices/bus/hp9845_io/98034.cpp +++ b/src/devices/bus/hp9845_io/98034.cpp @@ -366,12 +366,12 @@ const tiny_rom_entry *hp98034_io_card_device::device_rom_region() const MACHINE_CONFIG_START(hp98034_io_card_device::device_add_mconfig) // Clock for NP is generated by a RC oscillator. Manual says its typical frequency // is around 2 MHz. - MCFG_DEVICE_ADD("np" , HP_NANOPROCESSOR , 2000000) - MCFG_DEVICE_PROGRAM_MAP(np_program_map) - MCFG_DEVICE_IO_MAP(np_io_map) - MCFG_HP_NANO_DC_CHANGED(WRITE8(*this, hp98034_io_card_device , dc_w)) - MCFG_HP_NANO_READ_DC_CB(READ8(*this, hp98034_io_card_device , dc_r)) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(hp98034_io_card_device , irq_callback) + HP_NANOPROCESSOR(config, m_cpu, 2000000); + m_cpu->set_addrmap(AS_PROGRAM, &hp98034_io_card_device::np_program_map); + m_cpu->set_addrmap(AS_IO, &hp98034_io_card_device::np_io_map); + m_cpu->dc_changed().set(FUNC(hp98034_io_card_device::dc_w)); + m_cpu->read_dc().set(FUNC(hp98034_io_card_device::dc_r)); + m_cpu->set_irq_acknowledge_callback(FUNC(hp98034_io_card_device::irq_callback)); MCFG_IEEE488_SLOT_ADD("ieee_dev" , 0 , hp_ieee488_devices , nullptr) MCFG_IEEE488_SLOT_ADD("ieee_rem" , 0 , remote488_devices , nullptr) diff --git a/src/devices/bus/hp9845_io/98035.cpp b/src/devices/bus/hp9845_io/98035.cpp index 2779651ba5b..a91be580774 100644 --- a/src/devices/bus/hp9845_io/98035.cpp +++ b/src/devices/bus/hp9845_io/98035.cpp @@ -756,12 +756,13 @@ const tiny_rom_entry *hp98035_io_card_device::device_rom_region() const return ROM_NAME(hp98035); } -MACHINE_CONFIG_START(hp98035_io_card_device::device_add_mconfig) - MCFG_DEVICE_ADD("np" , HP_NANOPROCESSOR , XTAL(1'000'000)) - MCFG_DEVICE_PROGRAM_MAP(np_program_map) - MCFG_DEVICE_IO_MAP(np_io_map) - MCFG_HP_NANO_DC_CHANGED(WRITE8(*this, hp98035_io_card_device , dc_w)) -MACHINE_CONFIG_END +void hp98035_io_card_device::device_add_mconfig(machine_config &config) +{ + HP_NANOPROCESSOR(config, m_cpu, XTAL(1'000'000)); + m_cpu->set_addrmap(AS_PROGRAM, &hp98035_io_card_device::np_program_map); + m_cpu->set_addrmap(AS_IO, &hp98035_io_card_device::np_io_map); + m_cpu->dc_changed().set(FUNC(hp98035_io_card_device::dc_w)); +} // device type definition DEFINE_DEVICE_TYPE(HP98035_IO_CARD, hp98035_io_card_device, "hp98035", "HP98035 card") diff --git a/src/devices/cpu/mc68hc11/mc68hc11.h b/src/devices/cpu/mc68hc11/mc68hc11.h index df8b05a4b27..c24417676f7 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.h +++ b/src/devices/cpu/mc68hc11/mc68hc11.h @@ -28,22 +28,21 @@ #define MC68HC11_IRQ_LINE 0 #define MC68HC11_TOC1_LINE 1 - DECLARE_DEVICE_TYPE(MC68HC11, mc68hc11_cpu_device) - -#define MCFG_MC68HC11_CONFIG(_has_extended_io, _internal_ram_size, _init_value) \ - downcast<mc68hc11_cpu_device &>(*device).set_has_extended_io(_has_extended_io); \ - downcast<mc68hc11_cpu_device &>(*device).set_internal_ram_size(_internal_ram_size); \ - downcast<mc68hc11_cpu_device &>(*device).set_init_value(_init_value); - - class mc68hc11_cpu_device : public cpu_device { public: // construction/destruction mc68hc11_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void set_config(int has_extended_io, int internal_ram_size, int init_value) + { + set_has_extended_io(has_extended_io); + set_internal_ram_size(internal_ram_size); + set_init_value(init_value); + } + // I/O enable flag void set_has_extended_io(int has_extended_io) { m_has_extended_io = has_extended_io; } void set_internal_ram_size(int internal_ram_size) { m_internal_ram_size = internal_ram_size; } diff --git a/src/devices/cpu/mips/ps2vu.cpp b/src/devices/cpu/mips/ps2vu.cpp index 6f3803b92a0..1587c92dd3a 100644 --- a/src/devices/cpu/mips/ps2vu.cpp +++ b/src/devices/cpu/mips/ps2vu.cpp @@ -68,9 +68,10 @@ sonyvu1_device::sonyvu1_device(const machine_config &mconfig, const char *tag, d { } -MACHINE_CONFIG_START(sonyvu1_device::device_add_mconfig) - MCFG_DEVICE_ADD(m_vif, SONYPS2_VIF1, 294912000/2, m_gs, DEVICE_SELF) -MACHINE_CONFIG_END +void sonyvu1_device::device_add_mconfig(machine_config &config) +{ + SONYPS2_VIF1(config, m_vif, 294912000/2, m_gs, DEVICE_SELF); +} ps2_vif1_device* sonyvu1_device::interface() { diff --git a/src/devices/cpu/mn10200/mn10200.cpp b/src/devices/cpu/mn10200/mn10200.cpp index dae5d25f4ec..e7ce80e751e 100644 --- a/src/devices/cpu/mn10200/mn10200.cpp +++ b/src/devices/cpu/mn10200/mn10200.cpp @@ -49,9 +49,10 @@ void mn10200_device::mn1020012a_internal_map(address_map &map) mn10200_device::mn10200_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, program), m_program(nullptr) - , m_read_port0(*this), m_read_port1(*this), m_read_port2(*this), m_read_port3(*this), m_read_port4(*this) - , m_write_port0(*this), m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this), m_cycles(0), m_pc(0), m_psw(0), m_mdr(0), m_nmicr(0), m_iagr(0), - m_extmdl(0), m_extmdh(0), m_possible_irq(false), m_pplul(0), m_ppluh(0), m_p3md(0), m_p4(0) + , m_read_port{{*this}, {*this}, {*this}, {*this}, {*this}} + , m_write_port{{*this}, {*this}, {*this}, {*this}, {*this}} + , m_cycles(0), m_pc(0), m_psw(0), m_mdr(0), m_nmicr(0), m_iagr(0) + , m_extmdl(0), m_extmdh(0), m_possible_irq(false), m_pplul(0), m_ppluh(0), m_p3md(0), m_p4(0) { } // device definitions @@ -123,17 +124,11 @@ void mn10200_device::device_start() m_program = &space(AS_PROGRAM); // resolve callbacks - m_read_port0.resolve_safe(0xff); - m_read_port1.resolve_safe(0xff); - m_read_port2.resolve_safe(0xff); - m_read_port3.resolve_safe(0xff); - m_read_port4.resolve_safe(0xff); - - m_write_port0.resolve_safe(); - m_write_port1.resolve_safe(); - m_write_port2.resolve_safe(); - m_write_port3.resolve_safe(); - m_write_port4.resolve_safe(); + for (int i = 0; i < 5; i++) + { + m_read_port[i].resolve_safe(0xff); + m_write_port[i].resolve_safe(); + } // init and register for savestates save_item(NAME(m_pc)); @@ -2075,19 +2070,19 @@ WRITE8_MEMBER(mn10200_device::io_control_w) // outputs case 0x3c0: m_port[0].out = data; - m_write_port0(MN10200_PORT0, m_port[0].out | (m_port[0].dir ^ 0xff), 0xff); + m_write_port[0](MN10200_PORT0, m_port[0].out | (m_port[0].dir ^ 0xff), 0xff); break; case 0x264: m_port[1].out = data; - m_write_port1(MN10200_PORT1, m_port[1].out | (m_port[1].dir ^ 0xff), 0xff); + m_write_port[1](MN10200_PORT1, m_port[1].out | (m_port[1].dir ^ 0xff), 0xff); break; case 0x3c2: m_port[2].out = data & 0x0f; - m_write_port2(MN10200_PORT2, m_port[2].out | (m_port[2].dir ^ 0x0f), 0xff); + m_write_port[2](MN10200_PORT2, m_port[2].out | (m_port[2].dir ^ 0x0f), 0xff); break; case 0x3c3: m_port[3].out = data & 0x1f; - m_write_port3(MN10200_PORT3, m_port[3].out | (m_port[3].dir ^ 0x1f), 0xff); + m_write_port[3](MN10200_PORT3, m_port[3].out | (m_port[3].dir ^ 0x1f), 0xff); break; // directions (0=input, 1=output) @@ -2218,13 +2213,13 @@ READ8_MEMBER(mn10200_device::io_control_r) // inputs case 0x3d0: - return m_read_port0(MN10200_PORT0, 0xff) | m_port[0].dir; + return m_read_port[0](MN10200_PORT0, 0xff) | m_port[0].dir; case 0x3d1: - return m_read_port1(MN10200_PORT1, 0xff) | m_port[1].dir; + return m_read_port[1](MN10200_PORT1, 0xff) | m_port[1].dir; case 0x3d2: - return (m_read_port2(MN10200_PORT2, 0xff) & 0x0f) | m_port[2].dir; + return (m_read_port[2](MN10200_PORT2, 0xff) & 0x0f) | m_port[2].dir; case 0x3d3: - return (m_read_port3(MN10200_PORT3, 0xff) & 0x1f) | m_port[3].dir; + return (m_read_port[3](MN10200_PORT3, 0xff) & 0x1f) | m_port[3].dir; // directions (0=input, 1=output) case 0x3e0: diff --git a/src/devices/cpu/mn10200/mn10200.h b/src/devices/cpu/mn10200/mn10200.h index 8fd12ef5118..46ba6acd8d8 100644 --- a/src/devices/cpu/mn10200/mn10200.h +++ b/src/devices/cpu/mn10200/mn10200.h @@ -13,12 +13,6 @@ #pragma once -// port setup -#define MCFG_MN10200_READ_PORT_CB(X, _devcb) \ - downcast<mn10200_device &>(*device).set_read_port##X##_callback(DEVCB_##_devcb); -#define MCFG_MN10200_WRITE_PORT_CB(X, _devcb) \ - downcast<mn10200_device &>(*device).set_write_port##X##_callback(DEVCB_##_devcb); - enum { MN10200_PORT0 = 0, @@ -43,17 +37,8 @@ class mn10200_device : public cpu_device { public: // configuration helpers - template <class Object> devcb_base &set_read_port0_callback(Object &&cb) { return m_read_port0.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_read_port1_callback(Object &&cb) { return m_read_port1.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_read_port2_callback(Object &&cb) { return m_read_port2.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_read_port3_callback(Object &&cb) { return m_read_port3.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_read_port4_callback(Object &&cb) { return m_read_port4.set_callback(std::forward<Object>(cb)); } - - template <class Object> devcb_base &set_write_port0_callback(Object &&cb) { return m_write_port0.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_port1_callback(Object &&cb) { return m_write_port1.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_port2_callback(Object &&cb) { return m_write_port2.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_port3_callback(Object &&cb) { return m_write_port3.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_write_port4_callback(Object &&cb) { return m_write_port4.set_callback(std::forward<Object>(cb)); } + template <std::size_t Port> auto read_port() { return m_read_port[Port].bind(); } + template <std::size_t Port> auto write_port() { return m_write_port[Port].bind(); } DECLARE_READ8_MEMBER(io_control_r); DECLARE_WRITE8_MEMBER(io_control_w); @@ -95,8 +80,8 @@ private: address_space *m_program; // i/o handlers - devcb_read8 m_read_port0, m_read_port1, m_read_port2, m_read_port3, m_read_port4; - devcb_write8 m_write_port0, m_write_port1, m_write_port2, m_write_port3, m_write_port4; + devcb_read8 m_read_port[5]; + devcb_write8 m_write_port[5]; int m_cycles; diff --git a/src/devices/cpu/nanoprocessor/nanoprocessor.h b/src/devices/cpu/nanoprocessor/nanoprocessor.h index 42f43c60e01..df846b5b1f2 100644 --- a/src/devices/cpu/nanoprocessor/nanoprocessor.h +++ b/src/devices/cpu/nanoprocessor/nanoprocessor.h @@ -57,25 +57,20 @@ constexpr unsigned HP_NANO_IE_DC = 7; // DC line used as interrupt enable/mask (DC7) -// DC changed callback -// The callback receives a 8-bit word holding the state of all DC lines. -// DC0 is in bit 0, DC1 in bit 1 and so on. -// Keep in mind that DC7 usually masks the interrupt signal. -#define MCFG_HP_NANO_DC_CHANGED(_devcb) \ - downcast<hp_nanoprocessor_device &>(*device).set_dc_changed_func(DEVCB_##_devcb); - -// Callback to read the input state of DC lines -// All lines that are not in input are to be reported at "1" -#define MCFG_HP_NANO_READ_DC_CB(_devcb) \ - downcast<hp_nanoprocessor_device &>(*device).set_read_dc_func(DEVCB_##_devcb); - class hp_nanoprocessor_device : public cpu_device { public: hp_nanoprocessor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - template <class Object> devcb_base &set_dc_changed_func(Object &&cb) { return m_dc_changed_func.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_read_dc_func(Object &&cb) { return m_read_dc_func.set_callback(std::forward<Object>(cb)); } + // DC changed callback + // The callback receives a 8-bit word holding the state of all DC lines. + // DC0 is in bit 0, DC1 in bit 1 and so on. + // Keep in mind that DC7 usually masks the interrupt signal. + auto dc_changed() { return m_dc_changed_func.bind(); } + + // Callback to read the input state of DC lines + // All lines that are not in input are to be reported at "1" + auto read_dc() { return m_read_dc_func.bind(); } // device_execute_interface overrides virtual uint32_t execute_min_cycles() const override { return 2; } diff --git a/src/mame/audio/taito_zm.cpp b/src/mame/audio/taito_zm.cpp index 1931cb42e10..d4a29135dae 100644 --- a/src/mame/audio/taito_zm.cpp +++ b/src/mame/audio/taito_zm.cpp @@ -183,14 +183,15 @@ WRITE16_MEMBER(taito_zoom_device::reg_address_w) ***************************************************************************/ -MACHINE_CONFIG_START(taito_zoom_device::device_add_mconfig) +void taito_zoom_device::device_add_mconfig(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("mn10200", MN1020012A, XTAL(25'000'000)/2) - MCFG_MN10200_READ_PORT_CB(1, READ8(DEVICE_SELF, taito_zoom_device, tms_ctrl_r)) - MCFG_MN10200_WRITE_PORT_CB(1, WRITE8(DEVICE_SELF, taito_zoom_device, tms_ctrl_w)) - MCFG_DEVICE_PROGRAM_MAP(taitozoom_mn_map) + MN1020012A(config, m_soundcpu, XTAL(25'000'000)/2); + m_soundcpu->read_port<1>().set(FUNC(taito_zoom_device::tms_ctrl_r)); + m_soundcpu->write_port<1>().set(FUNC(taito_zoom_device::tms_ctrl_w)); + m_soundcpu->set_addrmap(AS_PROGRAM, &taito_zoom_device::taitozoom_mn_map); - MCFG_QUANTUM_TIME(attotime::from_hz(60000)) + config.m_minimum_quantum = attotime::from_hz(60000); TMS57002(config, m_tms57002, XTAL(25'000'000)/2); //m_tms57002->empty_callback().set_inputline(m_soundcpu, MN10200_IRQ1, m_tms57002->empty_r()); /*.invert();*/ @@ -205,4 +206,4 @@ MACHINE_CONFIG_START(taito_zoom_device::device_add_mconfig) m_zsg2->add_route(1, *m_tms57002, 0.5, 1); // chorus effect m_zsg2->add_route(2, *m_tms57002, 1.0, 2); // left direct m_zsg2->add_route(3, *m_tms57002, 1.0, 3); // right direct -MACHINE_CONFIG_END +} diff --git a/src/mame/drivers/30test.cpp b/src/mame/drivers/30test.cpp index 9023528e734..a707ed17e12 100644 --- a/src/mame/drivers/30test.cpp +++ b/src/mame/drivers/30test.cpp @@ -69,7 +69,7 @@ protected: virtual void machine_start() override; private: - required_device<cpu_device> m_maincpu; + required_device<mc68hc11_cpu_device> m_maincpu; required_device<okim6295_device> m_oki; output_finder<72> m_digits; output_finder<8> m_lamps; @@ -253,23 +253,22 @@ void namco_30test_state::machine_start() save_item(NAME(m_oki_bank)); } -MACHINE_CONFIG_START(namco_30test_state::_30test) - +void namco_30test_state::_30test(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", MC68HC11,MAIN_CLOCK/4) - MCFG_DEVICE_PROGRAM_MAP(namco_30test_map) - MCFG_DEVICE_IO_MAP(namco_30test_io) - MCFG_MC68HC11_CONFIG( 0, 768, 0x00 ) + MC68HC11(config, m_maincpu, MAIN_CLOCK/4); + m_maincpu->set_addrmap(AS_PROGRAM, &namco_30test_state::namco_30test_map); + m_maincpu->set_addrmap(AS_IO, &namco_30test_state::namco_30test_io); + m_maincpu->set_config(0, 768, 0x00); - - /* no video! */ + /* no video hardware */ /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -MACHINE_CONFIG_END + OKIM6295(config, m_oki, 1056000, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); +} /*************************************************************************** diff --git a/src/mame/drivers/alphasma.cpp b/src/mame/drivers/alphasma.cpp index c6b6613d4a0..64d1557ffcd 100644 --- a/src/mame/drivers/alphasma.cpp +++ b/src/mame/drivers/alphasma.cpp @@ -41,7 +41,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(kb_irq); protected: - required_device<cpu_device> m_maincpu; + required_device<mc68hc11_cpu_device> m_maincpu; required_device<hd44780_device> m_lcdc0; required_device<hd44780_device> m_lcdc1; required_device<nvram_device> m_nvram; @@ -433,10 +433,10 @@ void alphasmart_state::machine_reset() MACHINE_CONFIG_START(alphasmart_state::alphasmart) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", MC68HC11, XTAL(8'000'000)/2) // MC68HC11D0, XTAL is 8 Mhz, unknown divider - MCFG_DEVICE_PROGRAM_MAP(alphasmart_mem) - MCFG_DEVICE_IO_MAP(alphasmart_io) - MCFG_MC68HC11_CONFIG(0, 192, 0x00) + MC68HC11(config, m_maincpu, XTAL(8'000'000)/2); // MC68HC11D0, XTAL is 8 Mhz, unknown divider + m_maincpu->set_addrmap(AS_PROGRAM, &alphasmart_state::alphasmart_mem); + m_maincpu->set_addrmap(AS_IO, &alphasmart_state::alphasmart_io); + m_maincpu->set_config(0, 192, 0x00); MCFG_KS0066_F05_ADD("ks0066_0") MCFG_HD44780_LCD_SIZE(2, 40) diff --git a/src/mame/drivers/hitpoker.cpp b/src/mame/drivers/hitpoker.cpp index 63938f2fe45..6d0a110629f 100644 --- a/src/mame/drivers/hitpoker.cpp +++ b/src/mame/drivers/hitpoker.cpp @@ -94,7 +94,7 @@ private: DECLARE_READ8_MEMBER(irq_clear_r); virtual void video_start() override; uint32_t screen_update_hitpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; + required_device<mc68hc11_cpu_device> m_maincpu; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; void hitpoker_io(address_map &map); @@ -463,21 +463,21 @@ static GFXDECODE_START( gfx_hitpoker ) GFXDECODE_END MACHINE_CONFIG_START(hitpoker_state::hitpoker) - MCFG_DEVICE_ADD("maincpu", MC68HC11,1000000) - MCFG_DEVICE_PROGRAM_MAP(hitpoker_map) - MCFG_DEVICE_IO_MAP(hitpoker_io) - MCFG_MC68HC11_CONFIG(0, 0x100, 0x01) + MC68HC11(config, m_maincpu, 1000000); + m_maincpu->set_addrmap(AS_PROGRAM, &hitpoker_state::hitpoker_map); + m_maincpu->set_addrmap(AS_IO, &hitpoker_state::hitpoker_io); + m_maincpu->set_config(0, 0x100, 0x01); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate - MCFG_SCREEN_SIZE(648, 480) //setted by the CRTC - MCFG_SCREEN_VISIBLE_AREA(0, 648-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(hitpoker_state, screen_update_hitpoker) - MCFG_SCREEN_PALETTE("palette") + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate + screen.set_size(648, 480); //setted by the CRTC + screen.set_visarea(0, 648-1, 0, 240-1); + screen.set_screen_update(FUNC(hitpoker_state::screen_update_hitpoker)); + screen.set_palette(m_palette); h46505_device &crtc(H46505(config, "crtc", CRTC_CLOCK/2)); /* hand tuned to get ~60 fps */ crtc.set_screen("screen"); @@ -485,8 +485,8 @@ MACHINE_CONFIG_START(hitpoker_state::hitpoker) crtc.set_char_width(8); crtc.out_vsync_callback().set(FUNC(hitpoker_state::hitpoker_irq)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_hitpoker) - MCFG_PALETTE_ADD("palette", 0x800) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_hitpoker); + PALETTE(config, m_palette, 0x800); SPEAKER(config, "mono").front_center(); @@ -494,7 +494,7 @@ MACHINE_CONFIG_START(hitpoker_state::hitpoker) aysnd.port_a_read_callback().set_ioport("DSW1"); aysnd.port_b_read_callback().set_ioport("DSW2"); aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); -MACHINE_CONFIG_END +} void hitpoker_state::init_hitpoker() { diff --git a/src/mame/drivers/skeetsht.cpp b/src/mame/drivers/skeetsht.cpp index 474b92dccf8..32b80cf0063 100644 --- a/src/mame/drivers/skeetsht.cpp +++ b/src/mame/drivers/skeetsht.cpp @@ -60,7 +60,7 @@ private: TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update); virtual void machine_reset() override; virtual void video_start() override; - required_device<cpu_device> m_68hc11; + required_device<mc68hc11_cpu_device> m_68hc11; required_device<ay8910_device> m_ay; required_device<tms34010_device> m_tms; void hc11_io_map(address_map &map); @@ -236,12 +236,12 @@ INPUT_PORTS_END * *************************************/ -MACHINE_CONFIG_START(skeetsht_state::skeetsht) - - MCFG_DEVICE_ADD("68hc11", MC68HC11, 4000000) // ? - MCFG_DEVICE_PROGRAM_MAP(hc11_pgm_map) - MCFG_DEVICE_IO_MAP(hc11_io_map) - MCFG_MC68HC11_CONFIG( 0, 0x100, 0x01 ) // And 512 bytes EEPROM? (68HC11A1) +void skeetsht_state::skeetsht(machine_config &config) +{ + MC68HC11(config, m_68hc11, 4000000); // ? + m_68hc11->set_addrmap(AS_PROGRAM, &skeetsht_state::hc11_pgm_map); + m_68hc11->set_addrmap(AS_IO, &skeetsht_state::hc11_io_map); + m_68hc11->set_config(0, 0x100, 0x01); // And 512 bytes EEPROM? (68HC11A1) TMS34010(config, m_tms, 48000000); m_tms->set_addrmap(AS_PROGRAM, &skeetsht_state::tms_program_map); @@ -251,17 +251,17 @@ MACHINE_CONFIG_START(skeetsht_state::skeetsht) m_tms->set_scanline_rgb32_callback(FUNC(skeetsht_state::scanline_update)); m_tms->output_int().set(FUNC(skeetsht_state::tms_irq)); - MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) - - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(48000000 / 8, 156*4, 0, 100*4, 328, 0, 300) // FIXME - MCFG_SCREEN_UPDATE_DEVICE("tms", tms34010_device, tms340x0_rgb32) + TLC34076(config, m_tlc34076, 0); + m_tlc34076->set_bits(tlc34076_device::TLC34076_6_BIT); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(48000000 / 8, 156*4, 0, 100*4, 328, 0, 300); // FIXME + screen.set_screen_update("tms", FUNC(tms34010_device::tms340x0_rgb32)); SPEAKER(config, "mono").front_center(); AY8910(config, m_ay, 2000000).add_route(ALL_OUTPUTS, "mono", 0.50); // ? -MACHINE_CONFIG_END +} /************************************* diff --git a/src/mame/drivers/taitojc.cpp b/src/mame/drivers/taitojc.cpp index bc20523d409..600f58cf1fb 100644 --- a/src/mame/drivers/taitojc.cpp +++ b/src/mame/drivers/taitojc.cpp @@ -1077,23 +1077,23 @@ void taitojc_state::machine_start() } -MACHINE_CONFIG_START(taitojc_state::taitojc) - +void taitojc_state::taitojc(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68040, XTAL(10'000'000)*2) // 20MHz, clock source = CY7C991 - MCFG_DEVICE_PROGRAM_MAP(taitojc_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", taitojc_state, taitojc_vblank) + M68040(config, m_maincpu, XTAL(10'000'000)*2); // 20MHz, clock source = CY7C991 + m_maincpu->set_addrmap(AS_PROGRAM, &taitojc_state::taitojc_map); + m_maincpu->set_vblank_int("screen", FUNC(taitojc_state::taitojc_vblank)); - MCFG_DEVICE_ADD("sub", MC68HC11, XTAL(16'000'000)/2) // 8MHz, MC68HC11M0 - MCFG_DEVICE_PROGRAM_MAP(hc11_pgm_map) - MCFG_DEVICE_IO_MAP(hc11_io_map) - MCFG_MC68HC11_CONFIG( 1, 1280, 0x00 ) + mc68hc11_cpu_device &sub(MC68HC11(config, "sub", XTAL(16'000'000)/2)); // 8MHz, MC68HC11M0 + sub.set_addrmap(AS_PROGRAM, &taitojc_state::hc11_pgm_map); + sub.set_addrmap(AS_IO, &taitojc_state::hc11_io_map); + sub.set_config(1, 1280, 0x00); - MCFG_DEVICE_ADD("dsp", TMS32051, XTAL(10'000'000)*4) // 40MHz, clock source = CY7C991 - MCFG_DEVICE_PROGRAM_MAP(tms_program_map) - MCFG_DEVICE_DATA_MAP(tms_data_map) + TMS32051(config, m_dsp, XTAL(10'000'000)*4); // 40MHz, clock source = CY7C991 + m_dsp->set_addrmap(AS_PROGRAM, &taitojc_state::tms_program_map); + m_dsp->set_addrmap(AS_DATA, &taitojc_state::tms_data_map); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) + config.m_minimum_quantum = attotime::from_hz(6000); EEPROM_93C46_16BIT(config, "eeprom"); @@ -1105,38 +1105,38 @@ MACHINE_CONFIG_START(taitojc_state::taitojc) m_tc0640fio->write_4_callback().set(FUNC(taitojc_state::coin_control_w)); m_tc0640fio->read_7_callback().set_ioport("BUTTONS"); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfxdecode_device::empty) + GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode_device::empty); /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(taitojc_state, screen_update_taitojc) - MCFG_SCREEN_PALETTE("palette") + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + m_screen->set_screen_update(FUNC(taitojc_state::screen_update_taitojc)); + m_screen->set_palette(m_palette); - MCFG_PALETTE_ADD("palette", 32768) + PALETTE(config, m_palette, 32768); - MCFG_DEVICE_ADD("tc0780fpa", TC0780FPA, 0) + TC0780FPA(config, m_tc0780fpa, 0); /* sound hardware */ - MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0) -MACHINE_CONFIG_END + TAITO_EN(config, "taito_en", 0); +} -MACHINE_CONFIG_START(taitojc_state::dendego) +void taitojc_state::dendego(machine_config &config) +{ taitojc(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(dendego_map) + m_maincpu->set_addrmap(AS_PROGRAM, &taitojc_state::dendego_map); /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_UPDATE_DRIVER(taitojc_state, screen_update_dendego) + m_screen->set_screen_update(FUNC(taitojc_state::screen_update_dendego)); /* sound hardware */ SPEAKER(config, "vibration").subwoofer(); - MCFG_DEVICE_ADD("oki", OKIM6295, 1056000, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "vibration", 0.20) -MACHINE_CONFIG_END + + /* clock frequency & pin 7 not verified */ + OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "vibration", 0.20); +} |