diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-12-06 20:50:08 +0100 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-12-06 20:50:08 +0100 |
commit | 55c8bf8e0e07aad1d1efff6c920be3bbb03bc68a (patch) | |
tree | 871c1bf13cb5150377f887e14d66ac713442d84e | |
parent | 2f43a53ee80b7fa5dbb413002bab4c991450a72e (diff) |
-z8000, tmpz84c015: Removed MCFG macros. [Ryan Holtz]
(nw) -tumbleb: Fixed compile.
-rw-r--r-- | src/devices/bus/msx_cart/bm_012.cpp | 16 | ||||
-rw-r--r-- | src/devices/cpu/z80/tmpz84c015.h | 107 | ||||
-rw-r--r-- | src/devices/cpu/z8000/z8000.h | 5 | ||||
-rw-r--r-- | src/mame/drivers/ddenlovr.cpp | 637 | ||||
-rw-r--r-- | src/mame/drivers/dynax.cpp | 15 | ||||
-rw-r--r-- | src/mame/drivers/royalmah.cpp | 16 | ||||
-rw-r--r-- | src/mame/drivers/tumbleb.cpp | 10 | ||||
-rw-r--r-- | src/mame/machine/m24_z8000.cpp | 17 | ||||
-rw-r--r-- | src/mame/video/midtunit.cpp | 35 |
9 files changed, 378 insertions, 480 deletions
diff --git a/src/devices/bus/msx_cart/bm_012.cpp b/src/devices/bus/msx_cart/bm_012.cpp index dd4154a137f..db354b1e65c 100644 --- a/src/devices/bus/msx_cart/bm_012.cpp +++ b/src/devices/bus/msx_cart/bm_012.cpp @@ -48,16 +48,16 @@ MACHINE_CONFIG_START(msx_cart_bm_012_device::device_add_mconfig) // - PIO // - CGC // - WDT - MCFG_DEVICE_ADD("tmpz84c015af", TMPZ84C015, XTAL(12'000'000)/2) /* 6 MHz */ - MCFG_DEVICE_PROGRAM_MAP(bm_012_memory_map) + TMPZ84C015(config, m_tmpz84c015af, XTAL(12'000'000)/2); /* 6 MHz */ + m_tmpz84c015af->set_addrmap(AS_PROGRAM, &msx_cart_bm_012_device::bm_012_memory_map); // PIO callbacks - MCFG_TMPZ84C015_IN_PA_CB(READ8("bm012_pio", z80pio_device, pa_r)) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8("bm012_pio", z80pio_device, pa_w)) - MCFG_TMPZ84C015_IN_PB_CB(READ8("bm012_pio", z80pio_device, pb_r)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8("bm012_pio", z80pio_device, pb_w)) - MCFG_TMPZ84C015_OUT_BRDY_CB(WRITELINE("bm012_pio", z80pio_device, strobe_b)) + m_tmpz84c015af->in_pa_callback().set("bm012_pio", FUNC(z80pio_device::pa_r)); + m_tmpz84c015af->out_pa_callback().set("bm012_pio", FUNC(z80pio_device::pa_w)); + m_tmpz84c015af->in_pb_callback().set("bm012_pio", FUNC(z80pio_device::pb_r)); + m_tmpz84c015af->out_pb_callback().set("bm012_pio", FUNC(z80pio_device::pb_w)); + m_tmpz84c015af->out_brdy_callback().set("bm012_pio", FUNC(z80pio_device::strobe_b)); // SIO callbacks - MCFG_TMPZ84C015_OUT_TXDA_CB(WRITELINE("mdout", midi_port_device, write_txd)) + m_tmpz84c015af->out_txda_callback().set("mdout", FUNC(midi_port_device::write_txd)); // Sony CXK5864BSP-10L (8KB ram) // Sharp LH0081A Z80A-PIO-0 - For communicating between the MSX and the TMP diff --git a/src/devices/cpu/z80/tmpz84c015.h b/src/devices/cpu/z80/tmpz84c015.h index 93b4d897c16..3089284d66f 100644 --- a/src/devices/cpu/z80/tmpz84c015.h +++ b/src/devices/cpu/z80/tmpz84c015.h @@ -19,88 +19,6 @@ /*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -// SIO callbacks -#define MCFG_TMPZ84C015_OUT_TXDA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_txda_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_DTRA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_dtra_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_RTSA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_rtsa_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_WRDYA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_wrdya_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_SYNCA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_synca_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_TXDB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_txdb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_DTRB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_dtrb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_RTSB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_rtsb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_WRDYB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_wrdyb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_SYNCB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_syncb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_RXDRQA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_rxdrqa_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_TXDRQA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_txdrqa_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_RXDRQB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_rxdrqb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_TXDRQB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_txdrqb_callback(DEVCB_##_devcb); - - -// CTC callbacks -#define MCFG_TMPZ84C015_ZC0_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_zc_callback<0>(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_ZC1_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_zc_callback<1>(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_ZC2_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_zc_callback<2>(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_ZC3_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_zc_callback<3>(DEVCB_##_devcb); - - -// PIO callbacks -#define MCFG_TMPZ84C015_IN_PA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_in_pa_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_PA_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_pa_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_ARDY_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_ardy_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_IN_PB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_in_pb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_PB_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_pb_callback(DEVCB_##_devcb); - -#define MCFG_TMPZ84C015_OUT_BRDY_CB(_devcb) \ - downcast<tmpz84c015_device &>(*device).set_out_brdy_callback(DEVCB_##_devcb); - - -/*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ @@ -110,50 +28,33 @@ public: tmpz84c015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); // configuration helpers - template<class Object> devcb_base &set_out_txda_callback(Object &&cb) { return m_out_txda_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_dtra_callback(Object &&cb) { return m_out_dtra_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_rtsa_callback(Object &&cb) { return m_out_rtsa_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_wrdya_callback(Object &&cb) { return m_out_wrdya_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_synca_callback(Object &&cb) { return m_out_synca_cb.set_callback(std::forward<Object>(cb)); } + + // SIO callbacks auto out_txda_callback() { return m_out_txda_cb.bind(); } auto out_dtra_callback() { return m_out_dtra_cb.bind(); } auto out_rtsa_callback() { return m_out_rtsa_cb.bind(); } auto out_wrdya_callback() { return m_out_wrdya_cb.bind(); } auto out_synca_callback() { return m_out_synca_cb.bind(); } - template<class Object> devcb_base &set_out_txdb_callback(Object &&cb) { return m_out_txdb_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_dtrb_callback(Object &&cb) { return m_out_dtrb_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_rtsb_callback(Object &&cb) { return m_out_rtsb_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_wrdyb_callback(Object &&cb) { return m_out_wrdyb_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_syncb_callback(Object &&cb) { return m_out_syncb_cb.set_callback(std::forward<Object>(cb)); } auto out_txdb_callback() { return m_out_txdb_cb.bind(); } auto out_dtrb_callback() { return m_out_dtrb_cb.bind(); } auto out_rtsb_callback() { return m_out_rtsb_cb.bind(); } auto out_wrdyb_callback() { return m_out_wrdyb_cb.bind(); } auto out_syncb_callback() { return m_out_syncb_cb.bind(); } - template<class Object> devcb_base &set_out_rxdrqa_callback(Object &&cb) { return m_out_rxdrqa_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_txdrqa_callback(Object &&cb) { return m_out_txdrqa_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_rxdrqb_callback(Object &&cb) { return m_out_rxdrqb_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_txdrqb_callback(Object &&cb) { return m_out_txdrqb_cb.set_callback(std::forward<Object>(cb)); } auto out_rxdrqa_callback() { return m_out_rxdrqa_cb.bind(); } auto out_txdrqa_callback() { return m_out_txdrqa_cb.bind(); } auto out_rxdrqb_callback() { return m_out_rxdrqb_cb.bind(); } auto out_txdrqb_callback() { return m_out_txdrqb_cb.bind(); } - template<unsigned N, class Object> devcb_base &set_zc_callback(Object &&cb) { return m_zc_cb[N].set_callback(std::forward<Object>(cb)); } + // CTC callbacks template<unsigned N> auto zc_callback() { return m_zc_cb[N].bind(); } - template<class Object> devcb_base &set_in_pa_callback(Object &&cb) { return m_in_pa_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_pa_callback(Object &&cb) { return m_out_pa_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_ardy_callback(Object &&cb) { return m_out_ardy_cb.set_callback(std::forward<Object>(cb)); } + // PIO callbacks auto in_pa_callback() { return m_in_pa_cb.bind(); } auto out_pa_callback() { return m_out_pa_cb.bind(); } auto out_ardy_callback() { return m_out_ardy_cb.bind(); } - template<class Object> devcb_base &set_in_pb_callback(Object &&cb) { return m_in_pb_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_pb_callback(Object &&cb) { return m_out_pb_cb.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_out_brdy_callback(Object &&cb) { return m_out_brdy_cb.set_callback(std::forward<Object>(cb)); } auto in_pb_callback() { return m_in_pb_cb.bind(); } auto out_pb_callback() { return m_out_pb_cb.bind(); } auto out_brdy_callback() { return m_out_brdy_cb.bind(); } diff --git a/src/devices/cpu/z8000/z8000.h b/src/devices/cpu/z8000/z8000.h index 1bd2311c6ed..cbf7fc2a4be 100644 --- a/src/devices/cpu/z8000/z8000.h +++ b/src/devices/cpu/z8000/z8000.h @@ -29,9 +29,6 @@ enum #define Z8000_SYSCALL 0x0200 /* system call (lsb is vector) */ #define Z8000_HALT 0x0100 /* halted flag */ -#define MCFG_Z8000_MO(_devcb) \ - downcast<z8002_device &>(*device).set_mo_callback(DEVCB_##_devcb); - class z8002_device : public cpu_device, public z8000_disassembler::config { public: @@ -39,7 +36,7 @@ public: z8002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~z8002_device(); - template <class Object> devcb_base &set_mo_callback(Object &&cb) { return m_mo_out.set_callback(std::forward<Object>(cb)); } + auto mo() { return m_mo_out.bind(); } DECLARE_WRITE_LINE_MEMBER(mi_w) { m_mi = state; } // XXX: this has to apply in the middle of an insn for now protected: diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index 3774e4dee4b..45c5f6c94a3 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -160,15 +160,12 @@ static const int ddenlovr_commands[8] = { BLIT_NEXT, BLIT_LINE, BLIT_COP static const int hanakanz_commands[8] = { BLIT_NEXT, BLIT_CHANGE_PEN, BLIT_CHANGE_NUM, BLIT_UNKNOWN, BLIT_SKIP, BLIT_COPY, BLIT_LINE, BLIT_STOP }; static const int mjflove_commands[8] = { BLIT_STOP, BLIT_CHANGE_PEN, BLIT_CHANGE_NUM, BLIT_UNKNOWN, BLIT_SKIP, BLIT_COPY, BLIT_LINE, BLIT_NEXT }; -// TODO: make this a proper device callback once the blitter becomes a device -#define MCFG_DDENLOVR_BLITTER_IRQ(_class, _func) \ - set_blitter_irq(write_line_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr)); - class ddenlovr_state : public dynax_state { public: ddenlovr_state(const machine_config &mconfig, device_type type, const char *tag) : dynax_state(mconfig, type, tag) + , m_blitter_irq_handler(*this) , m_protection1(*this, "protection1") , m_protection2(*this, "protection2") , m_soundlatch(*this, "soundlatch") @@ -219,8 +216,14 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(nettoqc_special_r); DECLARE_CUSTOM_INPUT_MEMBER(mjflove_blitter_r); +protected: + virtual void device_resolve_objects() override + { + m_blitter_irq_handler.resolve_safe(); + } + private: - void set_blitter_irq(write_line_delegate &&handler) { m_blitter_irq_handler = std::move(handler); } + auto blitter_irq() { return m_blitter_irq_handler.bind(); } DECLARE_MACHINE_START(ddenlovr); DECLARE_MACHINE_RESET(ddenlovr); @@ -479,7 +482,7 @@ private: void sryudens_portmap(address_map &map); void ultrchmp_map(address_map &map); - write_line_delegate m_blitter_irq_handler; + devcb_write_line m_blitter_irq_handler; optional_shared_ptr<uint16_t> m_protection1; optional_shared_ptr<uint16_t> m_protection2; @@ -542,8 +545,6 @@ private: VIDEO_START_MEMBER(ddenlovr_state,ddenlovr) { - m_blitter_irq_handler.bind_relative_to(*this); - for (int i = 0; i < 8; i++) { m_ddenlovr_pixmap[i] = std::make_unique<uint8_t[]>(512 * 512); @@ -4356,10 +4357,10 @@ void dynax_state::htengoku_banked_map(address_map &map) MACHINE_CONFIG_START(ddenlovr_state::htengoku) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",Z80,20000000 / 4) - MCFG_DEVICE_PROGRAM_MAP(htengoku_mem_map) - MCFG_DEVICE_IO_MAP(htengoku_io_map) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("mainirq", rst_pos_buffer_device, inta_cb) // IM 0 needs an opcode on the data bus + Z80(config, m_maincpu, 20000000 / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::htengoku_mem_map); + m_maincpu->set_addrmap(AS_IO, &ddenlovr_state::htengoku_io_map); + m_maincpu->set_irq_acknowledge_callback("mainirq", FUNC(rst_pos_buffer_device::inta_cb)); // IM 0 needs an opcode on the data bus ADDRESS_MAP_BANK(config, m_bankdev, 0); m_bankdev->set_addrmap(0, &ddenlovr_state::htengoku_banked_map); @@ -4397,7 +4398,7 @@ MACHINE_CONFIG_START(ddenlovr_state::htengoku) m_blitter->scrolly_cb().set(FUNC(dynax_state::dynax_blit_scrolly_w)); m_blitter->ready_cb().set(FUNC(dynax_state::sprtmtch_blitter_irq_w)); - MCFG_PALETTE_ADD("palette", 16*256) + PALETTE(config, m_palette, 16*256); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,htengoku) @@ -4412,8 +4413,8 @@ MACHINE_CONFIG_START(ddenlovr_state::htengoku) YM2413(config, "ym2413", 3579545).add_route(ALL_OUTPUTS, "mono", 1.0); /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("mainirq", rst_pos_buffer_device, rst1_w)) + msm6242_device &rtc(MSM6242(config, "rtc", XTAL(32'768))); + rtc.out_int_handler().set("mainirq", FUNC(rst_pos_buffer_device::rst1_w)); MACHINE_CONFIG_END @@ -9635,71 +9636,71 @@ MACHINE_RESET_MEMBER(ddenlovr_state,ddenlovr) MACHINE_START_MEMBER(ddenlovr_state,rongrong) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 0x20, &ROM[0x010000], 0x8000); - membank("bank2")->configure_entries(0, 8, &ROM[0x110000], 0x1000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 0x20, &rom[0x010000], 0x8000); + membank("bank2")->configure_entries(0, 8, &rom[0x110000], 0x1000); MACHINE_START_CALL_MEMBER(ddenlovr); } MACHINE_START_MEMBER(ddenlovr_state,mmpanic) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 8, &rom[0x10000], 0x8000); MACHINE_START_CALL_MEMBER(ddenlovr); } MACHINE_START_MEMBER(ddenlovr_state,funkyfig) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); - membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 0x10, &rom[0x10000], 0x8000); + membank("bank2")->configure_entries(0, 8, &rom[0x90000], 0x1000); MACHINE_START_CALL_MEMBER(ddenlovr); } MACHINE_START_MEMBER(ddenlovr_state,hanakanz) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); - membank("bank2")->configure_entries(0, 0x10, &ROM[0x90000], 0x1000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 0x10, &rom[0x10000], 0x8000); + membank("bank2")->configure_entries(0, 0x10, &rom[0x90000], 0x1000); MACHINE_START_CALL_MEMBER(ddenlovr); } MACHINE_START_MEMBER(ddenlovr_state,mjmyster) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); - membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 8, &rom[0x10000], 0x8000); + membank("bank2")->configure_entries(0, 8, &rom[0x90000], 0x1000); MACHINE_START_CALL_MEMBER(ddenlovr); } MACHINE_START_MEMBER(ddenlovr_state,hparadis) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); - membank("bank2")->configure_entries(0, 8, &ROM[0x50000], 0x1000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 8, &rom[0x10000], 0x8000); + membank("bank2")->configure_entries(0, 8, &rom[0x50000], 0x1000); MACHINE_START_CALL_MEMBER(ddenlovr); } MACHINE_START_MEMBER(ddenlovr_state,mjflove) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); - membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 0x10, &rom[0x10000], 0x8000); + membank("bank2")->configure_entries(0, 8, &rom[0x90000], 0x1000); MACHINE_START_CALL_MEMBER(ddenlovr); } MACHINE_START_MEMBER(ddenlovr_state,sryudens) { - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); - membank("bank2")->configure_entries(0, 0x10, &ROM[0x90000], 0x1000); + uint8_t *rom = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 0x10, &rom[0x10000], 0x8000); + membank("bank2")->configure_entries(0, 0x10, &rom[0x90000], 0x1000); MACHINE_START_CALL_MEMBER(ddenlovr); } @@ -9717,8 +9718,8 @@ WRITE_LINE_MEMBER(ddenlovr_state::ddenlovr_irq) MACHINE_CONFIG_START(ddenlovr_state::ddenlovr) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",M68000, XTAL(24'000'000) / 2) - MCFG_DEVICE_PROGRAM_MAP(ddenlovr_map) + M68000(config, m_maincpu, XTAL(24'000'000) / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::ddenlovr_map); LS259(config, m_mainlatch); m_mainlatch->q_out_cb<1>().set(FUNC(ddenlovr_state::ddenlovr_blitter_irq_ack_w)); @@ -9729,19 +9730,19 @@ MACHINE_CONFIG_START(ddenlovr_state::ddenlovr) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(336, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-16+5-1) - MCFG_SCREEN_UPDATE_DRIVER(ddenlovr_state, screen_update_ddenlovr) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, ddenlovr_state, ddenlovr_irq)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(336, 256); + m_screen->set_visarea(0, 336-1, 5, 256-16+5-1); + m_screen->set_screen_update(FUNC(ddenlovr_state::screen_update_ddenlovr)); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(ddenlovr_state::ddenlovr_irq)); - MCFG_PALETTE_ADD("palette", 0x100) + PALETTE(config, m_palette, 0x100); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, ddenlovr_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::ddenlovr_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,ddenlovr) @@ -9752,50 +9753,49 @@ MACHINE_CONFIG_START(ddenlovr_state::ddenlovr) YMZ284(config, "aysnd", XTAL(28'636'363) / 16).add_route(ALL_OUTPUTS, "mono", 0.30); // or /8 ? - MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(28'636'363) / 28, okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + okim6295_device &oki(OKIM6295(config, "oki", XTAL(28'636'363) / 28, okim6295_device::PIN7_HIGH)); + oki.add_route(ALL_OUTPUTS, "mono", 0.80); /* devices */ - MCFG_DEVICE_ADD("rtc", RTC72421, XTAL(32'768)) // internal oscillator + RTC72421(config, "rtc", XTAL(32'768)); // internal oscillator MACHINE_CONFIG_END MACHINE_CONFIG_START(ddenlovr_state::ddenlovj) ddenlovr(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ddenlovj_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::ddenlovj_map); m_mainlatch->q_out_cb<1>().set_nop(); m_mainlatch->q_out_cb<4>().set_nop(); m_mainlatch->q_out_cb<5>().set(FUNC(ddenlovr_state::ddenlovr_blitter_irq_ack_w)); - MCFG_DEVICE_REPLACE("rtc", RTC62421, XTAL(32'768)) // internal oscillator + RTC62421(config.replace(), "rtc", XTAL(32'768)); // internal oscillator MACHINE_CONFIG_END -MACHINE_CONFIG_START(ddenlovr_state::ddenlovrk) +void ddenlovr_state::ddenlovrk(machine_config &config) +{ ddenlovr(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ddenlovrk_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::ddenlovrk_map); +} -MACHINE_CONFIG_START(ddenlovr_state::akamaru) +void ddenlovr_state::akamaru(machine_config &config) +{ ddenlovr(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(akamaru_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::akamaru_map); m_mainlatch->q_out_cb<2>().set(FUNC(ddenlovr_state::akamaru_dsw2_sel_w)); m_mainlatch->q_out_cb<3>().set(FUNC(ddenlovr_state::akamaru_dsw1_sel_w)); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(ddenlovr_state::quiz365) +void ddenlovr_state::quiz365(machine_config &config) +{ ddenlovj(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(quiz365_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::quiz365_map); // 7D has wire mod connecting to sample ROM at 1F m_mainlatch->q_out_cb<1>().set(FUNC(ddenlovr_state::quiz365_oki_bank1_w)); @@ -9806,28 +9806,28 @@ MACHINE_CONFIG_START(ddenlovr_state::quiz365) aysnd.port_a_read_callback().set(FUNC(ddenlovr_state::quiz365_input_r)); aysnd.port_b_write_callback().set(FUNC(ddenlovr_state::ddenlovr_select_w)); - MCFG_DEVICE_REPLACE("rtc", MSM6242, XTAL(32'768)) -MACHINE_CONFIG_END + MSM6242(config.replace(), "rtc", XTAL(32'768)); +} -MACHINE_CONFIG_START(ddenlovr_state::nettoqc) +void ddenlovr_state::nettoqc(machine_config &config) +{ ddenlovj(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(nettoqc_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::nettoqc_map); +} -MACHINE_CONFIG_START(ddenlovr_state::ultrchmp) +void ddenlovr_state::ultrchmp(machine_config &config) +{ ddenlovr(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(ultrchmp_map) + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::ultrchmp_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mjflove) -MACHINE_CONFIG_END +} /*************************************************************************** Rong Rong @@ -9841,14 +9841,14 @@ MACHINE_CONFIG_END 0xfc is from the 6242RTC */ -MACHINE_CONFIG_START(ddenlovr_state::quizchq) - +void ddenlovr_state::quizchq(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", TMPZ84C015, XTAL(16'000'000)/2) /* Verified */ - MCFG_DEVICE_PROGRAM_MAP(quizchq_map) - MCFG_DEVICE_IO_MAP(quizchq_portmap) - MCFG_TMPZ84C015_IN_PA_CB(READ8(*this, ddenlovr_state, rongrong_input_r)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, rongrong_select_w)) + tmpz84c015_device &maincpu(TMPZ84C015(config, "maincpu", XTAL(16'000'000)/2)); /* Verified */ + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::quizchq_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::quizchq_portmap); + maincpu.in_pa_callback().set(FUNC(ddenlovr_state::rongrong_input_r)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::rongrong_select_w)); // bit 5 of 0x1b (SIO CTSB?) = blitter busy MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,rongrong) @@ -9862,35 +9862,37 @@ MACHINE_CONFIG_START(ddenlovr_state::quizchq) m_screen->set_visarea(0, 336-1, 5, 256-16+5-1); m_screen->set_screen_update(FUNC(ddenlovr_state::screen_update_ddenlovr)); m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_palette("palette"); + m_screen->set_palette(m_palette); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::strobe_a)).invert(); - MCFG_PALETTE_ADD("palette", 0x100) + PALETTE(config, m_palette, 0x100); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, rongrong_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::rongrong_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,ddenlovr) /* sound hardware */ SPEAKER(config, "mono").front_center(); - YM2413(config, "ym2413", XTAL(28'636'363) / 8).add_route(ALL_OUTPUTS, "mono", 1.50); // 3.579545Mhz, verified + // 3.579545Mhz, verified + YM2413(config, "ym2413", XTAL(28'636'363) / 8).add_route(ALL_OUTPUTS, "mono", 1.50); - MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(28'636'363)/28, okim6295_device::PIN7_HIGH) // clock frequency verified 1.022MHz, pin 7 verified high - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + // clock frequency verified 1.022MHz, pin 7 verified high + OKIM6295(config, m_oki, XTAL(28'636'363)/28, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "mono", 1.00); /* devices */ MSM6242(config, "rtc", 32.768_kHz_XTAL).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg2)).invert(); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(ddenlovr_state::rongrong) +void ddenlovr_state::rongrong(machine_config &config) +{ quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(rongrong_map) - MCFG_DEVICE_IO_MAP(rongrong_portmap) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::rongrong_map); + m_maincpu->set_addrmap(AS_IO, &ddenlovr_state::rongrong_portmap); +} /*************************************************************************** @@ -9927,34 +9929,34 @@ WRITE_LINE_MEMBER(ddenlovr_state::mmpanic_rtc_irq) m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xdf); // RST 18, clock } -MACHINE_CONFIG_START(ddenlovr_state::mmpanic) - +void ddenlovr_state::mmpanic(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", Z80, 8000000) - MCFG_DEVICE_PROGRAM_MAP(mmpanic_map) - MCFG_DEVICE_IO_MAP(mmpanic_portmap) + Z80(config, m_maincpu, 8000000); + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::mmpanic_map); + m_maincpu->set_addrmap(AS_IO, &ddenlovr_state::mmpanic_portmap); - MCFG_DEVICE_ADD("soundcpu", Z80, 3579545) - MCFG_DEVICE_PROGRAM_MAP(mmpanic_sound_map) - MCFG_DEVICE_IO_MAP(mmpanic_sound_portmap) + Z80(config, m_soundcpu, 3579545); + m_soundcpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::mmpanic_sound_map); + m_soundcpu->set_addrmap(AS_IO, &ddenlovr_state::mmpanic_sound_portmap); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mmpanic) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(336, 256+22) - MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-16+5-1) - MCFG_SCREEN_UPDATE_DRIVER(ddenlovr_state, screen_update_ddenlovr) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, ddenlovr_state, mmpanic_irq)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(336, 256+22); + m_screen->set_visarea(0, 336-1, 5, 256-16+5-1); + m_screen->set_screen_update(FUNC(ddenlovr_state::screen_update_ddenlovr)); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(ddenlovr_state::mmpanic_irq)); - MCFG_PALETTE_ADD("palette", 0x100) + PALETTE(config, m_palette, 0x100); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mmpanic_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mmpanic_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mmpanic) // extra layers @@ -9968,13 +9970,13 @@ MACHINE_CONFIG_START(ddenlovr_state::mmpanic) AY8910(config, "aysnd", 3579545).add_route(ALL_OUTPUTS, "mono", 0.30); - MCFG_DEVICE_ADD("oki", OKIM6295, 1022720, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + OKIM6295(config, m_oki, 1022720, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki->add_route(ALL_OUTPUTS, "mono", 0.80); /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, ddenlovr_state, mmpanic_rtc_irq)) -MACHINE_CONFIG_END + msm6242_device &rtc(MSM6242(config, "rtc", XTAL(32'768))); + rtc.out_int_handler().set(FUNC(ddenlovr_state::mmpanic_rtc_irq)); +} /*************************************************************************** @@ -10017,28 +10019,28 @@ WRITE_LINE_MEMBER(ddenlovr_state::hanakanz_rtc_irq) m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xe2); } -MACHINE_CONFIG_START(ddenlovr_state::hanakanz) - +void ddenlovr_state::hanakanz(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",Z80,8000000) // KL5C80A12 - MCFG_DEVICE_PROGRAM_MAP(hanakanz_map) - MCFG_DEVICE_IO_MAP(hanakanz_portmap) + Z80(config, m_maincpu, 8000000); // KL5C80A12 + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::hanakanz_map); + m_maincpu->set_addrmap(AS_IO, &ddenlovr_state::hanakanz_portmap); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(336, 256+22) - MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-11-1) - MCFG_SCREEN_UPDATE_DRIVER(ddenlovr_state, screen_update_ddenlovr) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, ddenlovr_state, hanakanz_irq)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(336, 256+22); + m_screen->set_visarea(0, 336-1, 5, 256-11-1); + m_screen->set_screen_update(FUNC(ddenlovr_state::screen_update_ddenlovr)); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(ddenlovr_state::hanakanz_irq)); - MCFG_PALETTE_ADD("palette", 0x200) + PALETTE(config, m_palette, 0x200); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,hanakanz) // blitter commands in the roms are shuffled around @@ -10047,44 +10049,44 @@ MACHINE_CONFIG_START(ddenlovr_state::hanakanz) YM2413(config, "ym2413", 3579545).add_route(ALL_OUTPUTS, "mono", 0.80); - MCFG_DEVICE_ADD("oki", OKIM6295, 1022720, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + OKIM6295(config, m_oki, 1022720, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified + m_oki->add_route(ALL_OUTPUTS, "mono", 0.80); /* devices */ - MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, ddenlovr_state, hanakanz_rtc_irq)) -MACHINE_CONFIG_END + msm6242_device &rtc(MSM6242(config, "rtc", XTAL(32'768))); + rtc.out_int_handler().set(FUNC(ddenlovr_state::hanakanz_rtc_irq)); +} -MACHINE_CONFIG_START(ddenlovr_state::hkagerou) +void ddenlovr_state::hkagerou(machine_config &config) +{ hanakanz(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(hkagerou_portmap) -MACHINE_CONFIG_END - -MACHINE_CONFIG_START(ddenlovr_state::kotbinyo) + m_maincpu->set_addrmap(AS_IO, &ddenlovr_state::hkagerou_portmap); +} +void ddenlovr_state::kotbinyo(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu",Z80, XTAL(20'000'000) / 2) // !! KL5C80A12CFP @ 10MHz? (actually 4 times faster than Z80) !! - MCFG_DEVICE_PROGRAM_MAP(hanakanz_map) - MCFG_DEVICE_IO_MAP(kotbinyo_portmap) + Z80(config, m_maincpu, XTAL(20'000'000) / 2); // !! KL5C80A12CFP @ 10MHz? (actually 4 times faster than Z80) !! + m_maincpu->set_addrmap(AS_PROGRAM, &ddenlovr_state::hanakanz_map); + m_maincpu->set_addrmap(AS_IO, &kotbinyo_portmap); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_REFRESH_RATE(60.1656) // HSync 15.1015kHz - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(336, 256+22) - MCFG_SCREEN_VISIBLE_AREA(0, 336-1-1, 1+4, 256-15-1+4) - MCFG_SCREEN_UPDATE_DRIVER(ddenlovr_state, screen_update_ddenlovr) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, ddenlovr_state, hanakanz_irq)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60.1656); // HSync 15.1015kHz + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(336, 256+22); + m_screen->set_visarea(0, 336-1-1, 1+4, 256-15-1+4); + m_screen->set_screen_update(FUNC(ddenlovr_state::screen_update_ddenlovr)); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_palette("palette"); + m_screen->screen_vblank().set(FUNC(ddenlovr_state::hanakanz_irq)); - MCFG_PALETTE_ADD("palette", 0x200) + PALETTE(config, m_palette, 0x200); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,hanakanz) // blitter commands in the roms are shuffled around @@ -10093,30 +10095,29 @@ MACHINE_CONFIG_START(ddenlovr_state::kotbinyo) YM2413(config, "ym2413", XTAL(28'375'160) / 8).add_route(ALL_OUTPUTS, "mono", 0.80); - MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(28'375'160) / 28, okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + OKIM6295(config, m_oki, XTAL(28'375'160) / 28, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "mono", 0.80); /* devices */ // MCFG_DEVICE_ADD("rtc", MSM6242, XTAL(32'768)) // MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(*this, ddenlovr_state, hanakanz_rtc_irq)) -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(ddenlovr_state::kotbinsp) +void ddenlovr_state::kotbinsp(machine_config &config) +{ kotbinyo(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(kotbinsp_portmap) - -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_IO, &ddenlovr_state::kotbinsp_portmap); +} -MACHINE_CONFIG_START(ddenlovr_state::mjreach1) +void ddenlovr_state::mjreach1(machine_config &config) +{ hanakanz(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(mjreach1_portmap) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_IO, &ddenlovr_state::mjreach1_portmap); +} /*************************************************************************** @@ -10128,24 +10129,23 @@ MACHINE_CONFIG_END 0xf8 is vblank 0xfa is from the 6242RTC */ -MACHINE_CONFIG_START(ddenlovr_state::mjchuuka) +void ddenlovr_state::mjchuuka(machine_config &config) +{ hanakanz(config); /* basic machine hardware */ - MCFG_DEVICE_REPLACE("maincpu", TMPZ84C015, 8000000) - MCFG_DEVICE_PROGRAM_MAP(hanakanz_map) - MCFG_DEVICE_IO_MAP(mjchuuka_portmap) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, hanakanz_rombank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mjchuuka_oki_bank_w)) + tmpz84c015_device &tmpz(TMPZ84C015(config.replace(), m_maincpu, 8000000)); + tmpz.set_addrmap(AS_PROGRAM, &ddenlovr_state::hanakanz_map); + tmpz.set_addrmap(AS_IO, &mjchuuka_portmap); + tmpz.out_pa_callback().set(FUNC(ddenlovr_state::hanakanz_rombank_w)); + tmpz.out_pb_callback().set(FUNC(ddenlovr_state::mjchuuka_oki_bank_w)); - MCFG_DEVICE_MODIFY("screen") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) + m_screen->screen_vblank().set("maincpu", FUNC(tmpz84c015_device::trg0)); - MCFG_DEVICE_MODIFY("rtc") - MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE("maincpu", tmpz84c015_device, trg1)) + subdevice<msm6242_device>("rtc")->out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); AY8910(config, "aysnd", 1789772).add_route(ALL_OUTPUTS, "mono", 1.0); -MACHINE_CONFIG_END +} WRITE_LINE_MEMBER(ddenlovr_state::funkyfig_sound_irq) @@ -10154,13 +10154,14 @@ WRITE_LINE_MEMBER(ddenlovr_state::funkyfig_sound_irq) m_soundcpu->set_input_line(0, HOLD_LINE); // NMI by main cpu } -MACHINE_CONFIG_START(ddenlovr_state::funkyfig) +void ddenlovr_state::funkyfig(machine_config &config) +{ mmpanic(config); - MCFG_DEVICE_REPLACE("maincpu", TMPZ84C015, 8000000) - MCFG_DEVICE_PROGRAM_MAP(funkyfig_map) - MCFG_DEVICE_IO_MAP(funkyfig_portmap) - MCFG_TMPZ84C015_IN_PA_CB(READ8(*this, ddenlovr_state, funkyfig_dsw_r)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, funkyfig_rombank_w)) + tmpz84c015_device &tmpz(TMPZ84C015(config.replace(), m_maincpu, 8000000)); + tmpz.set_addrmap(AS_PROGRAM, &ddenlovr_state::funkyfig_map); + tmpz.set_addrmap(AS_IO, &ddenlovr_state::funkyfig_portmap); + tmpz.in_pa_callback().set(FUNC(ddenlovr_state::funkyfig_dsw_r)); + tmpz.out_pb_callback().set(FUNC(ddenlovr_state::funkyfig_rombank_w)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,funkyfig) @@ -10169,45 +10170,44 @@ MACHINE_CONFIG_START(ddenlovr_state::funkyfig) subdevice<msm6242_device>("rtc")->out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)).invert(); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, funkyfig_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::funkyfig_blitter_irq)); - MCFG_DEVICE_MODIFY("soundcpu") - MCFG_DEVICE_IO_MAP(funkyfig_sound_portmap) + m_soundcpu->set_addrmap(AS_IO, &ddenlovr_state::funkyfig_sound_portmap); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,ddenlovr) // no extra layers? -MACHINE_CONFIG_END +} /*************************************************************************** Mahjong Super Dai Chuuka Ken ***************************************************************************/ -MACHINE_CONFIG_START(ddenlovr_state::mjschuka) - +void ddenlovr_state::mjschuka(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", TMPZ84C015, XTAL(16'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(mjmyster_map) - MCFG_DEVICE_IO_MAP(mjschuka_portmap) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, sryudens_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mjflove_rombank_w)) + tmpz84c015_device &tmpz(TMPZ84C015(config, "maincpu", XTAL(16'000'000)/2)); + tmpz.set_addrmap(AS_PROGRAM, &ddenlovr_state::mjmyster_map); + tmpz.set_addrmap(AS_IO, &ddenlovr_state::mjschuka_portmap); + tmpz.out_pa_callback().set(FUNC(ddenlovr_state::sryudens_rambank_w)); + tmpz.out_pb_callback().set(FUNC(ddenlovr_state::mjflove_rombank_w)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) /* video hardware */ - MCFG_SCREEN_ADD(m_screen, RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(336, 256+22) - MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-11-1) - MCFG_SCREEN_UPDATE_DRIVER(ddenlovr_state, screen_update_ddenlovr) - MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) - MCFG_SCREEN_PALETTE("palette") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(336, 256+22); + m_screen->set_visarea(0, 336-1, 5, 256-11-1); + m_screen->set_screen_update(FUNC(ddenlovr_state::screen_update_ddenlovr)); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set("maincpu", FUNC(tmpz84c015_device::trg0)); - MCFG_PALETTE_ADD("palette", 0x200) + PALETTE(config, m_palette, 0x200); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjmyster_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mjflove) // blitter commands in the roms are shuffled around @@ -10218,12 +10218,12 @@ MACHINE_CONFIG_START(ddenlovr_state::mjschuka) AY8910(config, "aysnd", XTAL(28'636'363) / 8).add_route(ALL_OUTPUTS, "mono", 0.30); - MCFG_DEVICE_ADD("oki", OKIM6295, XTAL(28'636'363) / 28, okim6295_device::PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) + OKIM6295(config, m_oki, XTAL(28'636'363) / 28, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "mono", 0.80); /* devices */ RTC62421(config, "rtc", 32.768_kHz_XTAL).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::pa7_w)).invert(); // internal oscillator -MACHINE_CONFIG_END +} /*************************************************************************** @@ -10237,30 +10237,30 @@ MACHINE_CONFIG_END NMI triggered by the RTC */ -MACHINE_CONFIG_START(ddenlovr_state::mjmyster) +void ddenlovr_state::mjmyster(machine_config &config) +{ quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(mjmyster_map) - MCFG_DEVICE_IO_MAP(mjmyster_portmap) - MCFG_TMPZ84C015_IN_PA_CB(CONSTANT(0)) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mmpanic_rombank_w)) + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::mjmyster_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); + maincpu.in_pa_callback().set_constant(0); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mmpanic_rombank_w)); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); - MCFG_DEVICE_MODIFY("rtc") - MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI)) + subdevice<msm6242_device>("rtc")->out_int_handler().set_inputline("maincpu", INPUT_LINE_NMI); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjmyster_blitter_irq)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjmyster) ay8910_device &aysnd(AY8910(config, "aysnd", 3579545)); aysnd.port_b_write_callback().set(FUNC(ddenlovr_state::ddenlovr_select_w)); aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); -MACHINE_CONFIG_END +} /*************************************************************************** Hanafuda Hana Ginga @@ -10274,23 +10274,23 @@ MACHINE_CONFIG_END */ -MACHINE_CONFIG_START(ddenlovr_state::hginga) +void ddenlovr_state::hginga(machine_config &config) +{ quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(hginga_map) - MCFG_DEVICE_IO_MAP(hginga_portmap) - MCFG_TMPZ84C015_IN_PA_CB(CONSTANT(0)) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, hginga_rombank_w)) + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::hginga_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::hginga_portmap); + maincpu.in_pa_callback().set_constant(0); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::hginga_rombank_w)); - MCFG_DEVICE_MODIFY("screen") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) + m_screen->screen_vblank().set("maincpu", FUNC(tmpz84c015_device::trg0)); subdevice<msm6242_device>("rtc")->out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::pa7_w)).invert(); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjmyster_blitter_irq)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjmyster) @@ -10298,25 +10298,25 @@ MACHINE_CONFIG_START(ddenlovr_state::hginga) aysnd.port_a_read_callback().set(FUNC(ddenlovr_state::hginga_dsw_r)); aysnd.port_b_write_callback().set(FUNC(ddenlovr_state::ddenlovr_select_w)); aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(ddenlovr_state::hgokou) +void ddenlovr_state::hgokou(machine_config &config) +{ quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(hgokou_map) - MCFG_DEVICE_IO_MAP(hgokou_portmap) - MCFG_TMPZ84C015_IN_PA_CB(CONSTANT(0)) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, hginga_rombank_w)) + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::hgokou_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::hgokou_portmap); + maincpu.in_pa_callback().set_constant(0); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::hginga_rombank_w)); - MCFG_DEVICE_MODIFY("screen") - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("maincpu", tmpz84c015_device, trg0)) + m_screen->screen_vblank().set("maincpu", FUNC(tmpz84c015_device::trg0)); subdevice<msm6242_device>("rtc")->out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::pa7_w)).invert(); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjmyster_blitter_irq)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjmyster) @@ -10324,79 +10324,78 @@ MACHINE_CONFIG_START(ddenlovr_state::hgokou) aysnd.port_a_read_callback().set(FUNC(ddenlovr_state::hginga_dsw_r)); aysnd.port_b_write_callback().set(FUNC(ddenlovr_state::ddenlovr_select_w)); aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(ddenlovr_state::hgokbang) +void ddenlovr_state::hgokbang(machine_config &config) +{ hgokou(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(hgokbang_portmap) -MACHINE_CONFIG_END + subdevice<tmpz84c015_device>("maincpu")->set_addrmap(AS_IO, &ddenlovr_state::hgokbang_portmap); +} -MACHINE_CONFIG_START(ddenlovr_state::mjmywrld) +void ddenlovr_state::mjmywrld(machine_config &config) +{ mjmyster(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(hginga_map) - MCFG_DEVICE_IO_MAP(mjmywrld_portmap) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, hginga_rombank_w)) -MACHINE_CONFIG_END + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::hginga_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmywrld_portmap); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::hginga_rombank_w)); +} -MACHINE_CONFIG_START(ddenlovr_state::mjmyuniv) +void ddenlovr_state::mjmyuniv(machine_config &config) +{ quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(mjmyster_map) - MCFG_DEVICE_IO_MAP(mjmyster_portmap) - MCFG_TMPZ84C015_IN_PA_CB(CONSTANT(0)) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mmpanic_rombank_w)) + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::mjmyster_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); + maincpu.in_pa_callback().set_constant(0); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mmpanic_rombank_w)); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjmyster) - MCFG_DEVICE_MODIFY("rtc") - MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI)) + subdevice<msm6242_device>("rtc")->out_int_handler().set_inputline("maincpu", INPUT_LINE_NMI); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjmyster_blitter_irq)); ay8910_device &aysnd(AY8910(config, "aysnd", 1789772)); aysnd.port_b_write_callback().set(FUNC(ddenlovr_state::ddenlovr_select_w)); aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); -MACHINE_CONFIG_END +} -MACHINE_CONFIG_START(ddenlovr_state::mjmyornt) +void ddenlovr_state::mjmyornt(machine_config &config) +{ quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(quizchq_map) - MCFG_DEVICE_IO_MAP(mjmyster_portmap) - MCFG_TMPZ84C015_IN_PA_CB(CONSTANT(0)) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, mjmyster_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mmpanic_rombank_w)) + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::quizchq_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); + maincpu.in_pa_callback().set_constant(0); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mmpanic_rombank_w)); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); - - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 4, 256-16+4-1) + m_screen->set_visarea(0, 336-1, 4, 256-16+4-1); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjmyster) - MCFG_DEVICE_MODIFY("rtc") - MCFG_MSM6242_OUT_INT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI)) + subdevice<msm6242_device>("rtc")->out_int_handler().set_inputline("maincpu", INPUT_LINE_NMI); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjmyster_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjmyster_blitter_irq)); ay8910_device &aysnd(AY8910(config, "aysnd", 1789772)); aysnd.port_b_write_callback().set(FUNC(ddenlovr_state::ddenlovr_select_w)); aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); -MACHINE_CONFIG_END +} WRITE_LINE_MEMBER(ddenlovr_state::mjflove_irq) @@ -10424,15 +10423,16 @@ WRITE_LINE_MEMBER(ddenlovr_state::mjflove_blitter_irq) } -MACHINE_CONFIG_START(ddenlovr_state::mjflove) +void ddenlovr_state::mjflove(machine_config &config) +{ quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(rongrong_map) - MCFG_DEVICE_IO_MAP(mjflove_portmap) - MCFG_TMPZ84C015_IN_PA_CB(IOPORT("DSW2")) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, hanakanz_keyb_w)) + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::rongrong_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjflove_portmap); + maincpu.in_pa_callback().set_ioport("DSW2"); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::hanakanz_keyb_w)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjflove) @@ -10441,22 +10441,22 @@ MACHINE_CONFIG_START(ddenlovr_state::mjflove) RTC72421(config.replace(), "rtc", 32.768_kHz_XTAL).out_int_handler().set(FUNC(ddenlovr_state::mjflove_rtc_irq)); - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjflove_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjflove_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mjflove) // blitter commands in the roms are shuffled around AY8910(config, "aysnd", 28636363/8).add_route(ALL_OUTPUTS, "mono", 0.30); -MACHINE_CONFIG_END +} MACHINE_CONFIG_START(ddenlovr_state::hparadis) quizchq(config); /* basic machine hardware */ - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(hparadis_map) - MCFG_DEVICE_IO_MAP(hparadis_portmap) - MCFG_TMPZ84C015_IN_PA_CB(READ8(*this, ddenlovr_state, hparadis_dsw_r)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, hparadis_select_w)) + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::hparadis_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::hparadis_portmap); + maincpu.in_pa_callback().set(FUNC(ddenlovr_state::hparadis_dsw_r)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::hparadis_select_w)); // the RTC seems unused MCFG_DEVICE_REMOVE("rtc") @@ -10464,8 +10464,6 @@ MACHINE_CONFIG_START(ddenlovr_state::hparadis) MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hparadis) MACHINE_CONFIG_END - - MACHINE_CONFIG_START(ddenlovr_state::jongtei) /* basic machine hardware */ @@ -10489,7 +10487,7 @@ MACHINE_CONFIG_START(ddenlovr_state::jongtei) MCFG_PALETTE_ADD("palette", 0x200) - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjflove_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjflove_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,hanakanz) // blitter commands in the roms are shuffled around @@ -10523,11 +10521,11 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(ddenlovr_state::sryudens) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", TMPZ84C015, XTAL(16'000'000) / 2) // ? - MCFG_DEVICE_PROGRAM_MAP(sryudens_map) - MCFG_DEVICE_IO_MAP(sryudens_portmap) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, sryudens_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mjflove_rombank_w)) + tmpz84c015_device &maincpu(TMPZ84C015(config, m_maincpu, XTAL(16'000'000) / 2)); // ? + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::sryudens_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::sryudens_portmap); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::sryudens_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjflove_rombank_w)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,sryudens) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) @@ -10545,7 +10543,7 @@ MACHINE_CONFIG_START(ddenlovr_state::sryudens) MCFG_PALETTE_ADD("palette", 0x100) - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjflove_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjflove_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mjflove) // blitter commands in the roms are shuffled around @@ -10572,11 +10570,11 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(ddenlovr_state::janshinp) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", TMPZ84C015, XTAL(16'000'000) / 2) - MCFG_DEVICE_PROGRAM_MAP(janshinp_map) - MCFG_DEVICE_IO_MAP(janshinp_portmap) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, sryudens_rambank_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, mjflove_rombank_w)) + tmpz84c015_device &maincpu(TMPZ84C015(config, m_maincpu, XTAL(16'000'000) / 2)); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::janshinp_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::janshinp_portmap); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::sryudens_rambank_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjflove_rombank_w)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hanakanz) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) @@ -10594,7 +10592,7 @@ MACHINE_CONFIG_START(ddenlovr_state::janshinp) MCFG_PALETTE_ADD("palette", 0x100) - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, mjflove_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::mjflove_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,ddenlovr) @@ -10614,11 +10612,12 @@ MACHINE_CONFIG_START(ddenlovr_state::janshinp) MACHINE_CONFIG_END // Same PCB as janshinp -MACHINE_CONFIG_START(ddenlovr_state::dtoyoken) +void ddenlovr_state::dtoyoken(machine_config &config) +{ janshinp(config); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mjflove) // blitter commands in the roms are shuffled around -MACHINE_CONFIG_END +} /*************************************************************************** @@ -10642,11 +10641,11 @@ MACHINE_START_MEMBER(ddenlovr_state,seljan2) MACHINE_CONFIG_START(ddenlovr_state::seljan2) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", TMPZ84C015, XTAL(16'000'000) / 2) - MCFG_DEVICE_PROGRAM_MAP(seljan2_map) - MCFG_DEVICE_IO_MAP(seljan2_portmap) - MCFG_TMPZ84C015_OUT_PA_CB(WRITE8(*this, ddenlovr_state, hanakanz_keyb_w)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, ddenlovr_state, sryudens_coincounter_w)) + tmpz84c015_device &maincpu(TMPZ84C015(config, m_maincpu, XTAL(16'000'000) / 2)); + maincpu.set_addrmap(AS_PROGRAM, &ddenlovr_state::seljan2_map); + maincpu.set_addrmap(AS_IO, &ddenlovr_state::seljan2_portmap); + maincpu.out_pa_callback().set(FUNC(ddenlovr_state::hanakanz_keyb_w)); + maincpu.out_pb_callback().set(FUNC(ddenlovr_state::sryudens_coincounter_w)); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,seljan2) MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr) @@ -10664,7 +10663,7 @@ MACHINE_CONFIG_START(ddenlovr_state::seljan2) MCFG_PALETTE_ADD("palette", 0x100) - MCFG_DDENLOVR_BLITTER_IRQ(ddenlovr_state, seljan2_blitter_irq) + blitter_irq().set(FUNC(ddenlovr_state::seljan2_blitter_irq)); MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mjflove) // blitter commands in the roms are shuffled around diff --git a/src/mame/drivers/dynax.cpp b/src/mame/drivers/dynax.cpp index 79b0799f77f..d1514c1291e 100644 --- a/src/mame/drivers/dynax.cpp +++ b/src/mame/drivers/dynax.cpp @@ -4775,9 +4775,9 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(dynax_state::mjelctrn) hnoridur(config); - MCFG_DEVICE_REPLACE("maincpu", TMPZ84C015, XTAL(22'000'000) / 4) - MCFG_DEVICE_PROGRAM_MAP(nanajign_mem_map) - MCFG_DEVICE_IO_MAP(mjelctrn_io_map) + TMPZ84C015(config.replace(), m_maincpu, XTAL(22'000'000) / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &dynax_state::nanajign_mem_map); + m_maincpu->set_addrmap(AS_IO, &dynax_state::mjelctrn_io_map); MCFG_DEVICE_MODIFY("bankdev") MCFG_DEVICE_PROGRAM_MAP(mjelctrn_banked_map) @@ -4800,10 +4800,11 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(dynax_state::mjembase) mjelctrn(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_IO_MAP(mjembase_io_map) - MCFG_TMPZ84C015_IN_PA_CB(IOPORT("DSW1")) - MCFG_TMPZ84C015_IN_PB_CB(IOPORT("DSW2")) + + tmpz84c015_device &maincpu(*subdevice<tmpz84c015_device>("maincpu")); + maincpu.set_addrmap(AS_IO, &dynax_state::mjembase_io_map); + maincpu.in_pa_callback().set_ioport("DSW1"); + maincpu.in_pb_callback().set_ioport("DSW2"); // 13C m_mainlatch->q_out_cb<3>().set(FUNC(dynax_state::coincounter_0_w)); diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp index 09139626784..166826417a1 100644 --- a/src/mame/drivers/royalmah.cpp +++ b/src/mame/drivers/royalmah.cpp @@ -3652,15 +3652,15 @@ MACHINE_CONFIG_START(royalmah_state::mjderngr) MCFG_PALETTE_INIT_OWNER(royalmah_state,mjderngr) MACHINE_CONFIG_END -MACHINE_CONFIG_START(royalmah_state::janptr96) +void royalmah_state::janptr96(machine_config &config) +{ mjderngr(config); - MCFG_DEVICE_REMOVE("maincpu") - MCFG_DEVICE_ADD("maincpu", TMPZ84C015, XTAL(16'000'000)/2) /* 8 MHz? */ - MCFG_DEVICE_PROGRAM_MAP(janptr96_map) - MCFG_DEVICE_IO_MAP(janptr96_iomap) - MCFG_TMPZ84C015_IN_PA_CB(READ8(*this, royalmah_state, janptr96_dsw_r)) - MCFG_TMPZ84C015_OUT_PB_CB(WRITE8(*this, royalmah_state, janptr96_dswsel_w)) + tmpz84c015_device &maincpu(TMPZ84C015(config.replace(), "maincpu", XTAL(16'000'000)/2)); /* 8 MHz? */ + maincpu.set_addrmap(AS_PROGRAM, &royalmah_state::janptr96_map); + maincpu.set_addrmap(AS_IO, &royalmah_state::janptr96_iomap); + maincpu.in_pa_callback().set(FUNC(royalmah_state::janptr96_dsw_r)); + maincpu.out_pb_callback().set(FUNC(royalmah_state::janptr96_dswsel_w)); // internal CTC channels 0 & 1 have falling edge triggers screen_device &screen(*subdevice<screen_device>("screen")); @@ -3669,7 +3669,7 @@ MACHINE_CONFIG_START(royalmah_state::janptr96) /* devices */ MSM6242(config, m_rtc, 32.768_kHz_XTAL).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)).invert(); -MACHINE_CONFIG_END +} MACHINE_CONFIG_START(royalmah_state::mjifb) diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp index 1b29370b02f..1ce3e9cfc78 100644 --- a/src/mame/drivers/tumbleb.cpp +++ b/src/mame/drivers/tumbleb.cpp @@ -2233,11 +2233,11 @@ MACHINE_CONFIG_START(tumbleb_state::magipur) MCFG_SCREEN_UPDATE_DRIVER(tumbleb_state, screen_update_fncywld) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_ISBOOTLEG(true) - MCFG_DECO_SPRITE_TRANSPEN(15) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + DECO_SPRITE(config, m_sprgen, 0); + m_sprgen->set_gfx_region(3); + m_sprgen->set_is_bootleg(true); + m_sprgen->set_transpen(15); + m_sprgen->set_gfxdecode_tag(m_gfxdecode); MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fncywld) MCFG_PALETTE_ADD("palette", 0x800) diff --git a/src/mame/machine/m24_z8000.cpp b/src/mame/machine/m24_z8000.cpp index 1a89c3d9943..99d8b78428a 100644 --- a/src/mame/machine/m24_z8000.cpp +++ b/src/mame/machine/m24_z8000.cpp @@ -68,13 +68,14 @@ void m24_z8000_device::z8000_io(address_map &map) map(0x80c1, 0x80c1).rw(FUNC(m24_z8000_device::handshake_r), FUNC(m24_z8000_device::handshake_w)); } -MACHINE_CONFIG_START(m24_z8000_device::device_add_mconfig) - MCFG_DEVICE_ADD("z8000", Z8001, XTAL(8'000'000)/2) - MCFG_DEVICE_PROGRAM_MAP(z8000_prog) - MCFG_DEVICE_DATA_MAP(z8000_data) - MCFG_DEVICE_IO_MAP(z8000_io) - MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(m24_z8000_device, int_cb) - MCFG_Z8000_MO(WRITELINE(*this, m24_z8000_device, mo_w)) +void m24_z8000_device::device_add_mconfig(machine_config &config) +{ + Z8001(config, m_z8000, XTAL(8'000'000)/2); + m_z8000->set_addrmap(AS_PROGRAM, &m24_z8000_device::z8000_prog); + m_z8000->set_addrmap(AS_DATA, &m24_z8000_device::z8000_data); + m_z8000->set_addrmap(AS_IO, &m24_z8000_device::z8000_io); + m_z8000->set_irq_acknowledge_callback(FUNC(m24_z8000_device::int_cb)); + m_z8000->mo().set(FUNC(m24_z8000_device::mo_w)); pit8253_device &pit8253(PIT8253(config, "pit8253", 0)); pit8253.set_clk<0>(19660000/15); //8251 @@ -85,7 +86,7 @@ MACHINE_CONFIG_START(m24_z8000_device::device_add_mconfig) pit8253.out_handler<2>().set(FUNC(m24_z8000_device::timer_irq_w)); I8251(config, "i8251", 0); -MACHINE_CONFIG_END +} const uint8_t m24_z8000_device::pmem_table[16][4] = {{0, 1, 2, 3}, {1, 2, 3, 255}, {4, 5, 6, 7}, {46, 40, 41, 42}, diff --git a/src/mame/video/midtunit.cpp b/src/mame/video/midtunit.cpp index 1f402c47745..465a9616e22 100644 --- a/src/mame/video/midtunit.cpp +++ b/src/mame/video/midtunit.cpp @@ -632,24 +632,6 @@ WRITE16_MEMBER(midtunit_video_device::midtunit_dma_w) /* determine the offset */ uint32_t gfxoffset = m_dma_register[DMA_OFFSETLO] | (m_dma_register[DMA_OFFSETHI] << 16); -if (LOG_DMA) -{ - if (machine().input().code_pressed(KEYCODE_L)) - { - logerror("DMA command %04X: (bpp=%d skip=%d xflip=%d yflip=%d preskip=%d postskip=%d)\n", - command, (command >> 12) & 7, (command >> 7) & 1, (command >> 4) & 1, (command >> 5) & 1, (command >> 8) & 3, (command >> 10) & 3); - logerror(" offset=%08X pos=(%d,%d) w=%d h=%d clip=(%d,%d)-(%d,%d)\n", gfxoffset, m_dma_register[DMA_XSTART], m_dma_register[DMA_YSTART], - m_dma_register[DMA_WIDTH], m_dma_register[DMA_HEIGHT], m_dma_register[DMA_LEFTCLIP], m_dma_register[DMA_TOPCLIP], m_dma_register[DMA_RIGHTCLIP], m_dma_register[DMA_BOTCLIP]); - logerror(" offset=%08X pos=(%d,%d) w=%d h=%d clip=(%d,%d)-(%d,%d)\n", gfxoffset, m_dma_state.xpos, m_dma_state.ypos, - m_dma_state.width, m_dma_state.height, m_dma_state.leftclip, m_dma_state.topclip, m_dma_state.rightclip, m_dma_state.botclip); - logerror(" palette=%04X color=%04X lskip=%02X rskip=%02X xstep=%04X ystep=%04X test=%04X config=%04X\n", - m_dma_register[DMA_PALETTE], m_dma_register[DMA_COLOR], - m_dma_register[DMA_LRSKIP] >> 8, m_dma_register[DMA_LRSKIP] & 0xff, - m_dma_register[DMA_SCALE_X], m_dma_register[DMA_SCALE_Y], m_dma_register[DMA_UNKNOWN_E], - m_dma_register[DMA_CONFIG]); - logerror("----\n"); - } -} /* special case: drawing mode C doesn't need to know about any pixel data */ if ((command & 0x0f) == 0x0c) gfxoffset = 0; @@ -667,6 +649,23 @@ if (LOG_DMA) goto skipdma; } + if (LOG_DMA || DEBUG_MIDTUNIT_BLITTER) + { + if (machine().input().code_pressed(KEYCODE_COLON)) + { + logerror("DMA command %04X: (bpp=%d skip=%d xflip=%d yflip=%d preskip=%d postskip=%d)\n", + command, (command >> 12) & 7, (command >> 7) & 1, (command >> 4) & 1, (command >> 5) & 1, (command >> 8) & 3, (command >> 10) & 3); + logerror(" offset=%08X pos=(%d,%d) w=%d h=%d clip=(%d,%d)-(%d,%d)\n", gfxoffset, m_dma_state.xpos, m_dma_state.ypos, + m_dma_state.width, m_dma_state.height, m_dma_state.leftclip, m_dma_state.topclip, m_dma_state.rightclip, m_dma_state.botclip); + logerror(" palette=%04X color=%04X lskip=%02X rskip=%02X xstep=%04X ystep=%04X test=%04X config=%04X\n", + m_dma_register[DMA_PALETTE], m_dma_register[DMA_COLOR], + m_dma_register[DMA_LRSKIP] >> 8, m_dma_register[DMA_LRSKIP] & 0xff, + m_dma_register[DMA_SCALE_X], m_dma_register[DMA_SCALE_Y], m_dma_register[DMA_UNKNOWN_E], + m_dma_register[DMA_CONFIG]); + logerror("----\n"); + } + } + /* there seems to be two types of behavior for the DMA chip */ /* for MK1 and MK2, the upper byte of the LRSKIP is the */ /* starting skip value, and the lower byte is the ending */ |