From 8b1bc128e5568a713bc280d78623fcb3f7805b2a Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 19 Feb 2018 20:34:33 +1100 Subject: backport lots of cleanup from WIP branch (nw) --- src/emu/drivers/empty.cpp | 7 +- src/mame/audio/wswan.h | 48 ++++---- src/mame/drivers/a6809.cpp | 12 +- src/mame/drivers/a7800.cpp | 98 +++++++++------- src/mame/drivers/accomm.cpp | 11 +- src/mame/drivers/ace.cpp | 33 +++--- src/mame/drivers/acrnsys1.cpp | 5 +- src/mame/drivers/acvirus.cpp | 13 ++- src/mame/drivers/albazc.cpp | 16 ++- src/mame/drivers/albazg.cpp | 46 ++++---- src/mame/drivers/aleisttl.cpp | 14 +-- src/mame/drivers/altair.cpp | 9 +- src/mame/drivers/altos2.cpp | 8 +- src/mame/drivers/altos486.cpp | 10 +- src/mame/drivers/altos5.cpp | 8 +- src/mame/drivers/altos8600.cpp | 17 +-- src/mame/drivers/arcadecl.cpp | 2 +- src/mame/drivers/aristmk5.cpp | 35 +++--- src/mame/drivers/aristmk6.cpp | 36 +++--- src/mame/drivers/atarig1.cpp | 4 +- src/mame/drivers/atarig42.cpp | 43 ++++--- src/mame/drivers/atarigt.cpp | 4 +- src/mame/drivers/atarigx2.cpp | 10 +- src/mame/drivers/atarisy1.cpp | 4 +- src/mame/drivers/atarisy2.cpp | 2 +- src/mame/drivers/att4425.cpp | 12 +- src/mame/drivers/badlands.cpp | 2 +- src/mame/drivers/banctec.cpp | 9 +- src/mame/drivers/batman.cpp | 15 +-- src/mame/drivers/beathead.cpp | 2 +- src/mame/drivers/big10.cpp | 15 ++- src/mame/drivers/blstroid.cpp | 8 +- src/mame/drivers/bowltry.cpp | 14 ++- src/mame/drivers/boxer.cpp | 45 ++++---- src/mame/drivers/caswin.cpp | 27 +++-- src/mame/drivers/clayshoo.cpp | 33 +++--- src/mame/drivers/cyberbal.cpp | 8 +- src/mame/drivers/cybstorm.cpp | 17 +-- src/mame/drivers/destroyr.cpp | 53 +++++---- src/mame/drivers/elektronmono.cpp | 12 +- src/mame/drivers/eprom.cpp | 57 +++------- src/mame/drivers/equites.cpp | 72 +++++++----- src/mame/drivers/exidy440.cpp | 14 +-- src/mame/drivers/firefox.cpp | 58 ++++++---- src/mame/drivers/flyball.cpp | 67 +++++------ src/mame/drivers/foodf.cpp | 11 +- src/mame/drivers/forte2.cpp | 18 +-- src/mame/drivers/gauntlet.cpp | 13 +-- src/mame/drivers/imds.cpp | 16 ++- src/mame/drivers/klax.cpp | 9 +- src/mame/drivers/lb186.cpp | 15 ++- src/mame/drivers/looping.cpp | 46 ++++---- src/mame/drivers/manohman.cpp | 14 ++- src/mame/drivers/mediagx.cpp | 148 ++++++++++++------------ src/mame/drivers/meijinsn.cpp | 42 +++---- src/mame/drivers/mgolf.cpp | 59 +++++----- src/mame/drivers/mpu2.cpp | 10 +- src/mame/drivers/mpu3.cpp | 112 +++++++++--------- src/mame/drivers/mpu5.cpp | 41 +++---- src/mame/drivers/offtwall.cpp | 21 +--- src/mame/drivers/patapata.cpp | 15 +-- src/mame/drivers/pengadvb.cpp | 36 +++--- src/mame/drivers/pofo.cpp | 48 ++++---- src/mame/drivers/quantum.cpp | 19 ++-- src/mame/drivers/quizshow.cpp | 42 +++---- src/mame/drivers/rampart.cpp | 8 +- src/mame/drivers/relief.cpp | 8 +- src/mame/drivers/rmhaihai.cpp | 79 ++++++++----- src/mame/drivers/rx78.cpp | 11 +- src/mame/drivers/sbrkout.cpp | 79 ++++++------- src/mame/drivers/sfkick.cpp | 27 +++-- src/mame/drivers/shougi.cpp | 23 ++-- src/mame/drivers/shuuz.cpp | 2 +- src/mame/drivers/skullxbo.cpp | 9 +- src/mame/drivers/stellafr.cpp | 6 +- src/mame/drivers/superslave.cpp | 11 +- src/mame/drivers/supertnk.cpp | 28 +++-- src/mame/drivers/sv8000.cpp | 10 +- src/mame/drivers/tamag1.cpp | 18 +-- src/mame/drivers/tempest.cpp | 36 +++--- src/mame/drivers/thunderj.cpp | 17 +-- src/mame/drivers/tomcat.cpp | 35 +++--- src/mame/drivers/toobin.cpp | 14 +-- src/mame/drivers/tourtabl.cpp | 14 ++- src/mame/drivers/unixpc.cpp | 39 ++++--- src/mame/drivers/vertigo.cpp | 10 +- src/mame/drivers/vindictr.cpp | 8 +- src/mame/drivers/wswan.cpp | 16 +-- src/mame/drivers/xybots.cpp | 14 +-- src/mame/includes/arcadia.h | 42 ++++--- src/mame/includes/atarig42.h | 83 +++++++++----- src/mame/includes/atarigx2.h | 61 +++++----- src/mame/includes/badlands.h | 3 +- src/mame/includes/batman.h | 40 ++++--- src/mame/includes/beathead.h | 60 +++++----- src/mame/includes/blstroid.h | 45 +++++--- src/mame/includes/bsktball.h | 58 ++++++---- src/mame/includes/canyon.h | 39 ++++--- src/mame/includes/carpolo.h | 29 +++-- src/mame/includes/ccastles.h | 80 +++++++------ src/mame/includes/cloak.h | 45 +++++--- src/mame/includes/cloud9.h | 70 +++++++----- src/mame/includes/copsnrob.h | 38 +++++-- src/mame/includes/cyberbal.h | 44 ++++--- src/mame/includes/cybstorm.h | 42 ++++--- src/mame/includes/dragrace.h | 46 +++++--- src/mame/includes/eprom.h | 60 +++++----- src/mame/includes/equites.h | 80 +++++++++---- src/mame/includes/exidy440.h | 114 +++++++++++-------- src/mame/includes/foodf.h | 48 +++++--- src/mame/includes/gauntlet.h | 82 +++++++------ src/mame/includes/gridlee.h | 61 ++++++---- src/mame/includes/irobot.h | 115 ++++++++++--------- src/mame/includes/jedi.h | 71 +++++++----- src/mame/includes/klax.h | 21 ++-- src/mame/includes/lynx.h | 217 ++++++++++++++++++----------------- src/mame/includes/metalmx.h | 53 +++++---- src/mame/includes/nitedrvr.h | 54 +++++---- src/mame/includes/offtwall.h | 51 +++++---- src/mame/includes/ohmygod.h | 49 ++++---- src/mame/includes/orbit.h | 8 +- src/mame/includes/pcw16.h | 78 +++++++------ src/mame/includes/pecom.h | 43 ++++--- src/mame/includes/poolshrk.h | 46 +++++--- src/mame/includes/rampart.h | 44 ++++--- src/mame/includes/relief.h | 50 ++++---- src/mame/includes/shuuz.h | 25 ++-- src/mame/includes/skullxbo.h | 49 ++++---- src/mame/includes/skydiver.h | 42 ++++--- src/mame/includes/skyraid.h | 42 ++++--- src/mame/includes/sprint8.h | 60 ++++++---- src/mame/includes/starshp1.h | 74 +++++++----- src/mame/includes/super6.h | 11 +- src/mame/includes/tank8.h | 59 ++++++---- src/mame/includes/thunderj.h | 40 ++++--- src/mame/includes/toobin.h | 52 +++++---- src/mame/includes/triplhnt.h | 67 ++++++----- src/mame/includes/ultratnk.h | 52 +++++---- src/mame/includes/vertigo.h | 195 ++++++++++++++++--------------- src/mame/includes/victory.h | 101 +++++++++------- src/mame/includes/videopin.h | 54 +++++---- src/mame/includes/vindictr.h | 46 +++++--- src/mame/includes/wrally.h | 9 +- src/mame/includes/wswan.h | 90 ++++++++------- src/mame/includes/xybots.h | 42 ++++--- src/mame/includes/z88.h | 36 +++--- src/mame/machine/atarigen.cpp | 2 +- src/mame/machine/atarigen.h | 14 ++- src/mame/machine/irobot.cpp | 6 +- src/mame/machine/wswan.cpp | 2 +- src/mame/video/atarigx2.cpp | 2 +- src/mame/video/cybstorm.cpp | 2 +- src/mame/video/equites.cpp | 24 ++-- src/mame/video/exidy440.cpp | 15 +-- src/mame/video/foodf.cpp | 2 +- src/mame/video/gauntlet.cpp | 2 +- src/mame/video/irobot.cpp | 8 +- src/mame/video/klax.cpp | 4 - src/mame/video/offtwall.cpp | 5 - src/mame/video/pecom.cpp | 4 +- src/mame/video/rampart.cpp | 2 +- src/mame/video/relief.cpp | 2 +- src/mame/video/skullxbo.cpp | 4 - src/mame/video/thunderj.cpp | 4 - src/mame/video/toobin.cpp | 2 +- src/mame/video/vertigo.cpp | 234 +++++++++++++++++++------------------- src/mame/video/victory.cpp | 35 +++--- src/mame/video/vindictr.cpp | 2 +- src/mame/video/xybots.cpp | 4 - 169 files changed, 3313 insertions(+), 2676 deletions(-) diff --git a/src/emu/drivers/empty.cpp b/src/emu/drivers/empty.cpp index 84b21ce1d0a..f99f4c7096a 100644 --- a/src/emu/drivers/empty.cpp +++ b/src/emu/drivers/empty.cpp @@ -22,6 +22,9 @@ public: // constructor using driver_device::driver_device; + void ___empty(machine_config &config); + +protected: virtual void machine_start() override { emulator_info::display_ui_chooser(machine()); @@ -32,8 +35,6 @@ public: bitmap.fill(rgb_t::black(), cliprect); return 0; } - - void ___empty(machine_config &config); }; @@ -68,4 +69,4 @@ ROM_END // GAME DRIVERS //************************************************************************** -GAME( 2007, ___empty, 0, ___empty, 0, empty_state, 0, ROT0, "MAME", "No Driver Loaded", MACHINE_NO_SOUND ) +GAME( 2007, ___empty, 0, ___empty, 0, empty_state, 0, ROT0, "MAME", "No Driver Loaded", MACHINE_NO_SOUND_HW ) diff --git a/src/mame/audio/wswan.h b/src/mame/audio/wswan.h index 96ea8a0b416..b2f5ffcc65b 100644 --- a/src/mame/audio/wswan.h +++ b/src/mame/audio/wswan.h @@ -16,27 +16,6 @@ // TYPE DEFINITIONS //************************************************************************** -struct CHAN -{ - CHAN() : - freq(0), - period(0), - pos(0), - vol_left(0), - vol_right(0), - on(0), - signal(0) { } - - uint16_t freq; /* frequency */ - uint32_t period; /* period */ - uint32_t pos; /* position */ - uint8_t vol_left; /* volume left */ - uint8_t vol_right; /* volume right */ - uint8_t on; /* on/off */ - int8_t signal; /* signal */ -}; - - // ======================> wswan_sound_device class wswan_sound_device : public device_t, @@ -44,9 +23,30 @@ class wswan_sound_device : public device_t, { public: wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - ~wswan_sound_device() { } + + DECLARE_WRITE8_MEMBER( port_w ); protected: + struct CHAN + { + CHAN() : + freq(0), + period(0), + pos(0), + vol_left(0), + vol_right(0), + on(0), + signal(0) { } + + uint16_t freq; /* frequency */ + uint32_t period; /* period */ + uint32_t pos; /* position */ + uint8_t vol_left; /* volume left */ + uint8_t vol_right; /* volume right */ + uint8_t on; /* on/off */ + int8_t signal; /* signal */ + }; + // device-level overrides virtual void device_start() override; virtual void device_reset() override; @@ -54,13 +54,9 @@ protected: // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; -public: - DECLARE_WRITE8_MEMBER( port_w ); - private: void wswan_ch_set_freq( CHAN *ch, uint16_t freq ); -private: sound_stream *m_channel; CHAN m_audio1; /* Audio channel 1 */ CHAN m_audio2; /* Audio channel 2 */ diff --git a/src/mame/drivers/a6809.cpp b/src/mame/drivers/a6809.cpp index bec0a062dd7..c8401402a86 100644 --- a/src/mame/drivers/a6809.cpp +++ b/src/mame/drivers/a6809.cpp @@ -74,6 +74,9 @@ public: , m_crtc(*this, "mc6845") { } + void a6809(machine_config &config); + +protected: void kbd_put(u8 data); DECLARE_READ8_MEMBER(videoram_r); DECLARE_WRITE8_MEMBER(a6809_address_w); @@ -82,13 +85,14 @@ public: DECLARE_MACHINE_RESET(a6809); TIMER_DEVICE_CALLBACK_MEMBER(a6809_c); TIMER_DEVICE_CALLBACK_MEMBER(a6809_p); - required_shared_ptr m_p_videoram; - uint16_t m_start_address; - uint16_t m_cursor_address; - void a6809(machine_config &config); + void a6809_io(address_map &map); void a6809_mem(address_map &map); + private: + required_shared_ptr m_p_videoram; + uint16_t m_start_address; + uint16_t m_cursor_address; uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; diff --git a/src/mame/drivers/a7800.cpp b/src/mame/drivers/a7800.cpp index d32eeb2ce3f..6c661f8243c 100644 --- a/src/mame/drivers/a7800.cpp +++ b/src/mame/drivers/a7800.cpp @@ -115,47 +115,48 @@ class a7800_state : public driver_device { public: - a7800_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_tia(*this, "tia"), - m_maria(*this, "maria"), - m_io_joysticks(*this, "joysticks"), - m_io_buttons(*this, "buttons"), - m_io_console_buttons(*this, "console_buttons"), - m_cart(*this, "cartslot"), - m_screen(*this, "screen"), - m_bios(*this, "maincpu") { } - - int m_lines; - int m_ispal; + a7800_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_tia(*this, "tia"), + m_maria(*this, "maria"), + m_io_joysticks(*this, "joysticks"), + m_io_buttons(*this, "buttons"), + m_io_console_buttons(*this, "console_buttons"), + m_cart(*this, "cartslot"), + m_screen(*this, "screen"), + m_bios(*this, "maincpu") + { + } - int m_ctrl_lock; - int m_ctrl_reg; - int m_maria_flag; - int m_p1_one_button; - int m_p2_one_button; - int m_bios_enabled; + void a7800_ntsc(machine_config &config); +protected: DECLARE_READ8_MEMBER(bios_or_cart_r); DECLARE_READ8_MEMBER(tia_r); DECLARE_WRITE8_MEMBER(tia_w); - DECLARE_DRIVER_INIT(a7800_pal); - DECLARE_DRIVER_INIT(a7800_ntsc); - virtual void machine_start() override; - virtual void machine_reset() override; DECLARE_PALETTE_INIT(a7800); - DECLARE_PALETTE_INIT(a7800p); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(maria_startdma); DECLARE_READ8_MEMBER(riot_joystick_r); DECLARE_READ8_MEMBER(riot_console_button_r); DECLARE_WRITE8_MEMBER(riot_button_pullup_w); - void a7800_ntsc(machine_config &config); - void a7800_pal(machine_config &config); + virtual void machine_start() override; + virtual void machine_reset() override; void a7800_mem(address_map &map); -protected: + + int m_lines; + int m_ispal; + + int m_ctrl_lock; + int m_ctrl_reg; + int m_maria_flag; + int m_p1_one_button; + int m_p2_one_button; + int m_bios_enabled; + +private: required_device m_maincpu; required_device m_tia; required_device m_maria; @@ -167,6 +168,24 @@ protected: required_region_ptr m_bios; }; +class a7800_ntsc_state : public a7800_state +{ +public: + using a7800_state::a7800_state; + DECLARE_DRIVER_INIT(a7800_ntsc); +}; + +class a7800_pal_state : public a7800_state +{ +public: + using a7800_state::a7800_state; + DECLARE_DRIVER_INIT(a7800_pal); + void a7800_pal(machine_config &config); + +protected: + DECLARE_PALETTE_INIT(a7800p); +}; + /*************************************************************************** MEMORY HANDLERS @@ -1293,7 +1312,7 @@ PALETTE_INIT_MEMBER(a7800_state, a7800) } -PALETTE_INIT_MEMBER(a7800_state,a7800p) +PALETTE_INIT_MEMBER(a7800_pal_state,a7800p) { palette.set_pen_colors(0, a7800p_palette, ARRAY_LENGTH(a7800p_palette)); } @@ -1392,8 +1411,9 @@ MACHINE_CONFIG_START(a7800_state::a7800_ntsc) MACHINE_CONFIG_END -MACHINE_CONFIG_START(a7800_state::a7800_pal) +MACHINE_CONFIG_START(a7800_pal_state::a7800_pal) a7800_ntsc(config); + /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") MCFG_CPU_CLOCK(CLK_PAL) @@ -1403,14 +1423,14 @@ MACHINE_CONFIG_START(a7800_state::a7800_pal) MCFG_SCREEN_RAW_PARAMS( 7093788, 454, 0, 320, 313, 35, 35 + 228 + 32 ) MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_INIT_OWNER(a7800_state, a7800p ) + MCFG_PALETTE_INIT_OWNER(a7800_pal_state, a7800p) /* devices */ MCFG_DEVICE_REMOVE("riot") MCFG_DEVICE_ADD("riot", MOS6532_NEW, CLK_PAL) - MCFG_MOS6530n_IN_PA_CB(READ8(a7800_state, riot_joystick_r)) - MCFG_MOS6530n_IN_PB_CB(READ8(a7800_state, riot_console_button_r)) - MCFG_MOS6530n_OUT_PB_CB(WRITE8(a7800_state, riot_button_pullup_w)) + MCFG_MOS6530n_IN_PA_CB(READ8(a7800_pal_state, riot_joystick_r)) + MCFG_MOS6530n_IN_PB_CB(READ8(a7800_pal_state, riot_console_button_r)) + MCFG_MOS6530n_OUT_PB_CB(WRITE8(a7800_pal_state, riot_button_pullup_w)) /* software lists */ MCFG_DEVICE_REMOVE("cart_list") @@ -1441,7 +1461,7 @@ ROM_END DRIVER INIT ***************************************************************************/ -DRIVER_INIT_MEMBER(a7800_state,a7800_ntsc) +DRIVER_INIT_MEMBER(a7800_ntsc_state, a7800_ntsc) { m_ispal = false; m_lines = 263; @@ -1450,7 +1470,7 @@ DRIVER_INIT_MEMBER(a7800_state,a7800_ntsc) } -DRIVER_INIT_MEMBER(a7800_state,a7800_pal) +DRIVER_INIT_MEMBER(a7800_pal_state, a7800_pal) { m_ispal = true; m_lines = 313; @@ -1463,6 +1483,6 @@ DRIVER_INIT_MEMBER(a7800_state,a7800_pal) GAME DRIVERS ***************************************************************************/ -/* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME */ -CONS( 1986, a7800, 0, 0, a7800_ntsc, a7800, a7800_state, a7800_ntsc, "Atari", "Atari 7800 (NTSC)" , 0) -CONS( 1986, a7800p, a7800, 0, a7800_pal, a7800, a7800_state, a7800_pal, "Atari", "Atari 7800 (PAL)" , 0) +// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS +CONS( 1986, a7800, 0, 0, a7800_ntsc, a7800, a7800_ntsc_state, a7800_ntsc, "Atari", "Atari 7800 (NTSC)", 0 ) +CONS( 1986, a7800p, a7800, 0, a7800_pal, a7800, a7800_pal_state, a7800_pal, "Atari", "Atari 7800 (PAL)", 0 ) diff --git a/src/mame/drivers/accomm.cpp b/src/mame/drivers/accomm.cpp index bbd85274544..c1571b33f07 100644 --- a/src/mame/drivers/accomm.cpp +++ b/src/mame/drivers/accomm.cpp @@ -57,9 +57,6 @@ public: m_ch00rom_enabled(true) { } - virtual void machine_reset() override; - virtual void machine_start() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(ch00switch_w); @@ -76,8 +73,12 @@ public: INTERRUPT_GEN_MEMBER(vbl_int); void accomm(machine_config &config); - void main_map(address_map &map); + protected: + virtual void machine_reset() override; + virtual void machine_start() override; + void main_map(address_map &map); + // devices required_device m_maincpu; required_device m_beeper; @@ -830,7 +831,7 @@ static INPUT_PORTS_START( accomm ) INPUT_PORTS_END MACHINE_CONFIG_START(accomm_state::accomm) - MCFG_CPU_ADD("maincpu", G65816, XTAL(16'000'000) / 8) + MCFG_CPU_ADD("maincpu", G65816, 16_MHz_XTAL / 8) MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", accomm_state, vbl_int) diff --git a/src/mame/drivers/ace.cpp b/src/mame/drivers/ace.cpp index 81d7c3f2db2..f083e017edb 100644 --- a/src/mame/drivers/ace.cpp +++ b/src/mame/drivers/ace.cpp @@ -45,14 +45,14 @@ A1 2101 2101 #include "ace.lh" -#define MASTER_CLOCK XTAL(18'000'000) +static constexpr XTAL MASTER_CLOCK = 18_MHz_XTAL; class aceal_state : public driver_device { public: - aceal_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + aceal_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_scoreram(*this, "scoreram"), m_ram2(*this, "ram2"), @@ -61,18 +61,9 @@ public: m_palette(*this, "palette") { } - required_device m_maincpu; - - /* video-related */ - required_shared_ptr m_scoreram; - required_shared_ptr m_ram2; - required_shared_ptr m_characterram; - required_device m_gfxdecode; - required_device m_palette; - - /* input-related */ - int m_objpos[8]; + void ace(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(ace_objpos_w); DECLARE_WRITE8_MEMBER(ace_characterram_w); DECLARE_WRITE8_MEMBER(ace_scoreram_w); @@ -82,8 +73,20 @@ public: virtual void video_start() override; uint32_t screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void ace_postload(); - void ace(machine_config &config); void main_map(address_map &map); + +private: + required_device m_maincpu; + + /* video-related */ + required_shared_ptr m_scoreram; + required_shared_ptr m_ram2; + required_shared_ptr m_characterram; + required_device m_gfxdecode; + required_device m_palette; + + /* input-related */ + int m_objpos[8]; }; diff --git a/src/mame/drivers/acrnsys1.cpp b/src/mame/drivers/acrnsys1.cpp index 629deb5dfe6..62623ef4900 100644 --- a/src/mame/drivers/acrnsys1.cpp +++ b/src/mame/drivers/acrnsys1.cpp @@ -69,13 +69,16 @@ public: m_digit(0) { } + void acrnsys1(machine_config &config); + +protected: DECLARE_READ8_MEMBER(ins8154_b1_port_a_r); DECLARE_WRITE8_MEMBER(ins8154_b1_port_a_w); DECLARE_WRITE8_MEMBER(acrnsys1_led_segment_w); TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_c); TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_p); - void acrnsys1(machine_config &config); void acrnsys1_map(address_map &map); + private: required_device m_maincpu; required_device m_ttl74145; diff --git a/src/mame/drivers/acvirus.cpp b/src/mame/drivers/acvirus.cpp index df0cad340b7..066612f4e7c 100644 --- a/src/mame/drivers/acvirus.cpp +++ b/src/mame/drivers/acvirus.cpp @@ -71,20 +71,23 @@ class acvirus_state : public driver_device { public: acvirus_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_rombank(*this, "rombank") { } - required_device m_maincpu; - required_memory_bank m_rombank; + DECLARE_DRIVER_INIT(virus); + void virus(machine_config &config); +protected: virtual void machine_start() override; virtual void machine_reset() override; - DECLARE_DRIVER_INIT(virus); - void virus(machine_config &config); void virus_map(address_map &map); + +private: + required_device m_maincpu; + required_memory_bank m_rombank; }; void acvirus_state::machine_start() diff --git a/src/mame/drivers/albazc.cpp b/src/mame/drivers/albazc.cpp index 1dc1c725220..1f38e6ae905 100644 --- a/src/mame/drivers/albazc.cpp +++ b/src/mame/drivers/albazc.cpp @@ -33,11 +33,10 @@ public: m_palette(*this, "palette"), m_hopper(*this, "hopper") { } + void hanaroku(machine_config &config); + +protected: /* video-related */ - required_shared_ptr m_spriteram1; - required_shared_ptr m_spriteram2; - required_shared_ptr m_spriteram3; - uint8_t m_flip_bit; DECLARE_WRITE8_MEMBER(hanaroku_out_0_w); DECLARE_WRITE8_MEMBER(hanaroku_out_1_w); DECLARE_WRITE8_MEMBER(hanaroku_out_2_w); @@ -46,12 +45,17 @@ public: DECLARE_PALETTE_INIT(albazc); uint32_t screen_update_hanaroku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void hanaroku_map(address_map &map); + +private: + required_shared_ptr m_spriteram1; + required_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram3; + uint8_t m_flip_bit; required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; required_device m_hopper; - void hanaroku(machine_config &config); - void hanaroku_map(address_map &map); }; diff --git a/src/mame/drivers/albazg.cpp b/src/mame/drivers/albazg.cpp index 53f985e38f7..32d4c811c42 100644 --- a/src/mame/drivers/albazg.cpp +++ b/src/mame/drivers/albazg.cpp @@ -49,26 +49,22 @@ PCB: class albazg_state : public driver_device { public: - albazg_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + albazg_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_cus_ram(*this, "cus_ram"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode") + { } - /* memory pointers */ - required_shared_ptr m_cus_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + virtual void yumefuda(machine_config &config); - /* video-related */ - tilemap_t *m_bg_tilemap; +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; - /* misc */ - uint8_t m_mux_data; - int m_bank; - uint8_t m_prot_lock; DECLARE_WRITE8_MEMBER(yumefuda_vram_w); DECLARE_WRITE8_MEMBER(yumefuda_cram_w); DECLARE_READ8_MEMBER(custom_ram_r); @@ -78,15 +74,27 @@ public: DECLARE_WRITE8_MEMBER(mux_w); DECLARE_WRITE8_MEMBER(yumefuda_output_w); TILE_GET_INFO_MEMBER(y_get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; uint32_t screen_update_yumefuda(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_gfxdecode; - void yumefuda(machine_config &config); + void main_map(address_map &map); void port_map(address_map &map); + +private: + /* memory pointers */ + required_shared_ptr m_cus_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + + /* video-related */ + tilemap_t *m_bg_tilemap; + + /* misc */ + uint8_t m_mux_data; + int m_bank; + uint8_t m_prot_lock; + + required_device m_maincpu; + required_device m_gfxdecode; }; TILE_GET_INFO_MEMBER(albazg_state::y_get_bg_tile_info) diff --git a/src/mame/drivers/aleisttl.cpp b/src/mame/drivers/aleisttl.cpp index 65b231f37ba..70b39323c27 100644 --- a/src/mame/drivers/aleisttl.cpp +++ b/src/mame/drivers/aleisttl.cpp @@ -50,20 +50,16 @@ class sburners_state : public driver_device { public: - sburners_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + sburners_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_video(*this, "fixfreq") { } - // devices - required_device m_maincpu; - required_device m_video; - void sburners(machine_config &config); -protected: +protected: // driver_device overrides virtual void machine_start() override; virtual void machine_reset() override; @@ -71,7 +67,9 @@ protected: virtual void video_start() override; private: - + // devices + required_device m_maincpu; + required_device m_video; }; diff --git a/src/mame/drivers/altair.cpp b/src/mame/drivers/altair.cpp index a28507f8267..a32fe3c74d2 100644 --- a/src/mame/drivers/altair.cpp +++ b/src/mame/drivers/altair.cpp @@ -41,13 +41,16 @@ public: , m_ram(*this, "ram") { } + void altair(machine_config &config); + +protected: DECLARE_QUICKLOAD_LOAD_MEMBER(altair); - void altair(machine_config &config); + virtual void machine_reset() override; void io_map(address_map &map); void mem_map(address_map &map); + private: - virtual void machine_reset() override; required_device m_maincpu; required_shared_ptr m_ram; }; @@ -95,7 +98,7 @@ void altair_state::machine_reset() MACHINE_CONFIG_START(altair_state::altair) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", I8080, XTAL(2'000'000)) + MCFG_CPU_ADD("maincpu", I8080, 2_MHz_XTAL) MCFG_CPU_PROGRAM_MAP(mem_map) MCFG_CPU_IO_MAP(io_map) diff --git a/src/mame/drivers/altos2.cpp b/src/mame/drivers/altos2.cpp index 928a602bc3e..e0c66578c87 100644 --- a/src/mame/drivers/altos2.cpp +++ b/src/mame/drivers/altos2.cpp @@ -36,16 +36,18 @@ public: , m_p_videoram(*this, "videoram") { } + void altos2(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(video_mode_w); u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void altos2(machine_config &config); + virtual void machine_reset() override; void io_map(address_map &map); void mem_map(address_map &map); -private: - virtual void machine_reset() override; +private: required_device m_maincpu; required_device m_novram; required_region_ptr m_p_chargen; diff --git a/src/mame/drivers/altos486.cpp b/src/mame/drivers/altos486.cpp index ff4589e7f51..ad0faa60891 100644 --- a/src/mame/drivers/altos486.cpp +++ b/src/mame/drivers/altos486.cpp @@ -24,10 +24,9 @@ public: m_rom(*this, "bios") { } - required_device m_maincpu; - required_shared_ptr m_ram; - required_memory_region m_rom; + void altos486(machine_config &config); +protected: DECLARE_READ8_MEMBER(read_rmx_ack); DECLARE_READ16_MEMBER(mmu_ram_r); @@ -36,10 +35,13 @@ public: DECLARE_WRITE16_MEMBER(mmu_io_w); DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_maincpu; + required_shared_ptr m_ram; + required_memory_region m_rom; + bool m_sys_mode; uint8_t m_prot[256]; uint16_t m_viol[16]; - void altos486(machine_config &config); void altos486_io(address_map &map); void altos486_mem(address_map &map); void altos486_z80_io(address_map &map); diff --git a/src/mame/drivers/altos5.cpp b/src/mame/drivers/altos5.cpp index 5316510cac0..3e106eb4777 100644 --- a/src/mame/drivers/altos5.cpp +++ b/src/mame/drivers/altos5.cpp @@ -35,6 +35,10 @@ public: , m_floppy1(*this, "fdc:1") { } + DECLARE_DRIVER_INIT(altos5); + void altos5(machine_config &config); + +protected: DECLARE_READ8_MEMBER(memory_read_byte); DECLARE_WRITE8_MEMBER(memory_write_byte); DECLARE_READ8_MEMBER(io_read_byte); @@ -44,13 +48,12 @@ public: DECLARE_WRITE8_MEMBER(port08_w); DECLARE_WRITE8_MEMBER(port09_w); DECLARE_WRITE8_MEMBER(port14_w); - DECLARE_DRIVER_INIT(altos5); DECLARE_WRITE_LINE_MEMBER(busreq_w); DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w); - void altos5(machine_config &config); void io_map(address_map &map); void mem_map(address_map &map); + private: uint8_t m_port08; uint8_t m_port09; @@ -69,6 +72,7 @@ private: required_device m_floppy1; }; + ADDRESS_MAP_START(altos5_state::mem_map) ADDRESS_MAP_UNMAP_HIGH AM_RANGE( 0x0000, 0x0fff ) AM_READ_BANK("bankr0") AM_WRITE_BANK("bankw0") diff --git a/src/mame/drivers/altos8600.cpp b/src/mame/drivers/altos8600.cpp index c518e5c14a6..46e7da2ab89 100644 --- a/src/mame/drivers/altos8600.cpp +++ b/src/mame/drivers/altos8600.cpp @@ -31,6 +31,10 @@ public: m_hdd(*this, "hdd"), m_bios(*this, "bios") {} + + void altos8600(machine_config &config); + +protected: DECLARE_READ16_MEMBER(cpuram_r); DECLARE_WRITE16_MEMBER(cpuram_w); DECLARE_READ16_MEMBER(stkram_r); @@ -66,7 +70,9 @@ public: DECLARE_WRITE_LINE_MEMBER(sintr1_w); DECLARE_WRITE8_MEMBER(ics_attn_w); IRQ_CALLBACK_MEMBER(inta); - void altos8600(machine_config &config); + + virtual void machine_start() override; + virtual void machine_reset() override; void code_mem(address_map &map); void cpu_io(address_map &map); void cpu_mem(address_map &map); @@ -74,9 +80,6 @@ public: void dmac_mem(address_map &map); void extra_mem(address_map &map); void stack_mem(address_map &map); -protected: - virtual void machine_start() override; - virtual void machine_reset() override; private: u16 xlate_r(address_space &space, offs_t offset, u16 mem_mask, int permbit); @@ -686,7 +689,7 @@ static SLOT_INTERFACE_START(altos8600_floppies) SLOT_INTERFACE_END MACHINE_CONFIG_START(altos8600_state::altos8600) - MCFG_CPU_ADD("maincpu", I8086, XTAL(5'000'000)) + MCFG_CPU_ADD("maincpu", I8086, 5_MHz_XTAL) MCFG_CPU_PROGRAM_MAP(cpu_mem) MCFG_CPU_IO_MAP(cpu_io) MCFG_CPU_OPCODES_MAP(code_mem) @@ -696,7 +699,7 @@ MACHINE_CONFIG_START(altos8600_state::altos8600) MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(altos8600_state, inta) MCFG_I8086_IF_HANDLER(WRITELINE(altos8600_state, cpuif_w)) - MCFG_CPU_ADD("dmac", I8089, XTAL(5'000'000)) + MCFG_CPU_ADD("dmac", I8089, 5_MHz_XTAL) MCFG_CPU_PROGRAM_MAP(dmac_mem) MCFG_CPU_IO_MAP(dmac_io) MCFG_I8089_DATA_WIDTH(16) @@ -720,7 +723,7 @@ MACHINE_CONFIG_START(altos8600_state::altos8600) MCFG_RAM_DEFAULT_SIZE("1M") //MCFG_RAM_EXTRA_OPTIONS("512K") - MCFG_DEVICE_ADD("uart8274", I8274_NEW, XTAL(16'000'000)/4) + MCFG_DEVICE_ADD("uart8274", I8274_NEW, 16_MHz_XTAL/4) MCFG_Z80SIO_OUT_TXDA_CB(DEVWRITELINE("rs232a", rs232_port_device, write_txd)) MCFG_Z80SIO_OUT_DTRA_CB(DEVWRITELINE("rs232a", rs232_port_device, write_dtr)) MCFG_Z80SIO_OUT_RTSA_CB(DEVWRITELINE("rs232a", rs232_port_device, write_rts)) diff --git a/src/mame/drivers/arcadecl.cpp b/src/mame/drivers/arcadecl.cpp index 7f636ee8a30..76421d14535 100644 --- a/src/mame/drivers/arcadecl.cpp +++ b/src/mame/drivers/arcadecl.cpp @@ -323,7 +323,7 @@ MACHINE_CONFIG_START(arcadecl_state::arcadecl) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", arcadecl_state, video_int_gen) MCFG_MACHINE_RESET_OVERRIDE(arcadecl_state,arcadecl) diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp index 91fef1130d4..56a1e7c6fa2 100644 --- a/src/mame/drivers/aristmk5.cpp +++ b/src/mame/drivers/aristmk5.cpp @@ -472,15 +472,15 @@ class aristmk5_state : public archimedes_state public: aristmk5_state(const machine_config &mconfig, device_type type, const char *tag) : archimedes_state(mconfig, type, tag) + , m_hopper(*this, "hopper") , m_eeprom(*this, "eeprom%d", 0) , m_rtc(*this, "rtc") , m_nvram(*this, "nvram") - , m_hopper(*this, "hopper") , m_sram(*this, "sram") , m_p1(*this, "P1") , m_p2(*this, "P2") , m_extra_ports(*this, "EXTRA") - { } + { } DECLARE_WRITE32_MEMBER(Ns5w48); DECLARE_READ32_MEMBER(Ns5x58); @@ -507,29 +507,37 @@ public: DECLARE_WRITE_LINE_MEMBER(uart_irq_callback); DECLARE_DRIVER_INIT(aristmk5); - virtual void machine_start() override; - virtual void machine_reset() override; - TIMER_CALLBACK_MEMBER(mk5_VSYNC_callback); - TIMER_CALLBACK_MEMBER(mk5_2KHz_callback); - TIMER_CALLBACK_MEMBER(spi_timer); + void aristmk5(machine_config &config); + void aristmk5_touch(machine_config &config); + void aristmk5_usa(machine_config &config); + void aristmk5_usa_touch(machine_config &config); INPUT_CHANGED_MEMBER(coin_start); CUSTOM_INPUT_MEMBER(coin_r); CUSTOM_INPUT_MEMBER(coin_usa_r); CUSTOM_INPUT_MEMBER(hopper_r); - void aristmk5(machine_config &config); - void aristmk5_touch(machine_config &config); - void aristmk5_usa_touch(machine_config &config); - void aristmk5_usa(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + TIMER_CALLBACK_MEMBER(mk5_VSYNC_callback); + TIMER_CALLBACK_MEMBER(mk5_2KHz_callback); + TIMER_CALLBACK_MEMBER(spi_timer); + void aristmk5_drame_map(address_map &map); void aristmk5_map(address_map &map); void aristmk5_usa_map(address_map &map); + + required_device m_hopper; + + uint8_t m_hopper_test; + uint64_t m_coin_start_cycles; + uint8_t m_coin_div; + private: required_device_array m_eeprom; required_device m_rtc; required_device m_nvram; - required_device m_hopper; required_memory_region m_sram; required_ioport m_p1; required_ioport m_p2; @@ -540,9 +548,6 @@ private: emu_timer * m_spi_timer; uint8_t m_sram_bank; uint8_t m_ldor_shift_reg; - uint8_t m_hopper_test; - uint64_t m_coin_start_cycles; - uint8_t m_coin_div; uint8_t m_spi_mux; uint8_t m_spi_latch; uint8_t m_spi_bits; diff --git a/src/mame/drivers/aristmk6.cpp b/src/mame/drivers/aristmk6.cpp index 5844aca7d36..84d3700e8f1 100644 --- a/src/mame/drivers/aristmk6.cpp +++ b/src/mame/drivers/aristmk6.cpp @@ -44,14 +44,9 @@ public: m_vram(*this, "vram") { } - u32 m_test_x,m_test_y,m_start_offs; - u8 m_type; + void aristmk6(machine_config &config); - u8 irl0pend, irl0en; - u8 irl1pend, irl1en; - u8 irl2pend, irl2en; // UARTs ? - u8 irl3pend0, irl3en0; - u8 irl3pend1, irl3en1; +protected: void testIrq(); DECLARE_READ8_MEMBER(irqpend_r); @@ -59,18 +54,31 @@ public: DECLARE_READ8_MEMBER(test_r); DECLARE_WRITE64_MEMBER(eeprom_w); DECLARE_READ64_MEMBER(hwver_r); + uint32_t screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual void video_start() override; virtual void machine_reset() override; - uint32_t screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void aristmk6_map(address_map &map); + void aristmk6_port(address_map &map); + +private: +#if 0 + u32 m_test_x,m_test_y,m_start_offs; + u8 m_type; +#endif + + u8 irl0pend, irl0en; + u8 irl1pend, irl1en; + u8 irl2pend, irl2en; // UARTs ? + u8 irl3pend0, irl3en0; + u8 irl3pend1, irl3en1; + required_device m_maincpu; required_device m_uart0; required_device m_uart1; required_device m_eeprom0; required_device m_palette; required_shared_ptr m_vram; - void aristmk6(machine_config &config); - void aristmk6_map(address_map &map); - void aristmk6_port(address_map &map); }; @@ -318,7 +326,7 @@ static INPUT_PORTS_START( aristmk6 ) INPUT_PORTS_END // ? -#define ARISTMK6_CPU_CLOCK XTAL(200'000'000) +static constexpr XTAL ARISTMK6_CPU_CLOCK = 200_MHz_XTAL; // ? MACHINE_CONFIG_START(aristmk6_state::aristmk6) @@ -340,8 +348,8 @@ MACHINE_CONFIG_START(aristmk6_state::aristmk6) MCFG_CPU_FORCE_NO_DRC() // MCFG_DEVICE_DISABLE() - MCFG_DEVICE_ADD( "uart0", NS16550, XTAL(8'000'000) ) - MCFG_DEVICE_ADD( "uart1", NS16550, XTAL(8'000'000) ) + MCFG_DEVICE_ADD( "uart0", NS16550, 8_MHz_XTAL ) + MCFG_DEVICE_ADD( "uart1", NS16550, 8_MHz_XTAL ) MCFG_EEPROM_SERIAL_93C56_ADD("eeprom0") MCFG_EEPROM_SERIAL_DEFAULT_VALUE(0xFF) diff --git a/src/mame/drivers/atarig1.cpp b/src/mame/drivers/atarig1.cpp index 5713e7a8daa..36eb9c85a0c 100644 --- a/src/mame/drivers/atarig1.cpp +++ b/src/mame/drivers/atarig1.cpp @@ -429,7 +429,7 @@ MACHINE_CONFIG_START(atarig1_state::atarig1) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarig1_state, video_int_gen) MCFG_MACHINE_START_OVERRIDE(atarig1_state,atarig1) MCFG_MACHINE_RESET_OVERRIDE(atarig1_state,atarig1) @@ -460,7 +460,7 @@ MACHINE_CONFIG_START(atarig1_state::atarig1) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(atarig1_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("IN0", 14) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/atarig42.cpp b/src/mame/drivers/atarig42.cpp index 3040e683320..3e639b4fdef 100644 --- a/src/mame/drivers/atarig42.cpp +++ b/src/mame/drivers/atarig42.cpp @@ -39,7 +39,7 @@ void atarig42_state::update_interrupts() } -MACHINE_START_MEMBER(atarig42_state,atarig42) +void atarig42_state::machine_start() { atarigen_state::machine_start(); @@ -51,7 +51,7 @@ MACHINE_START_MEMBER(atarig42_state,atarig42) } -MACHINE_RESET_MEMBER(atarig42_state,atarig42) +void atarig42_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 8); @@ -128,7 +128,7 @@ WRITE16_MEMBER(atarig42_state::mo_command_w) * *************************************/ -void atarig42_state::roadriot_sloop_tweak(int offset) +void atarig42_0x200_state::roadriot_sloop_tweak(int offset) { /* sequence 1: @@ -240,7 +240,7 @@ void atarig42_state::roadriot_sloop_tweak(int offset) } -READ16_MEMBER(atarig42_state::roadriot_sloop_data_r) +READ16_MEMBER(atarig42_0x200_state::roadriot_sloop_data_r) { roadriot_sloop_tweak(offset); if (offset < 0x78000/2) @@ -250,7 +250,7 @@ READ16_MEMBER(atarig42_state::roadriot_sloop_data_r) } -WRITE16_MEMBER(atarig42_state::roadriot_sloop_data_w) +WRITE16_MEMBER(atarig42_0x200_state::roadriot_sloop_data_w) { roadriot_sloop_tweak(offset); } @@ -263,7 +263,7 @@ WRITE16_MEMBER(atarig42_state::roadriot_sloop_data_w) * *************************************/ -void atarig42_state::guardians_sloop_tweak(int offset) +void atarig42_0x400_state::guardians_sloop_tweak(int offset) { uint32_t *last_accesses = m_last_accesses; @@ -297,7 +297,7 @@ void atarig42_state::guardians_sloop_tweak(int offset) } -READ16_MEMBER(atarig42_state::guardians_sloop_data_r) +READ16_MEMBER(atarig42_0x400_state::guardians_sloop_data_r) { guardians_sloop_tweak(offset); if (offset < 0x78000/2) @@ -307,7 +307,7 @@ READ16_MEMBER(atarig42_state::guardians_sloop_data_r) } -WRITE16_MEMBER(atarig42_state::guardians_sloop_data_w) +WRITE16_MEMBER(atarig42_0x400_state::guardians_sloop_data_w) { guardians_sloop_tweak(offset); } @@ -527,10 +527,7 @@ MACHINE_CONFIG_START(atarig42_state::atarig42) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) - - MCFG_MACHINE_START_OVERRIDE(atarig42_state,atarig42) - MCFG_MACHINE_RESET_OVERRIDE(atarig42_state,atarig42) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarig42_state, video_int_gen) MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -558,12 +555,12 @@ MACHINE_CONFIG_START(atarig42_state::atarig42) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(atarig42_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("IN2", 6) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END -MACHINE_CONFIG_START(atarig42_state::atarig42_0x200) +MACHINE_CONFIG_START(atarig42_0x200_state::atarig42_0x200) atarig42(config); MCFG_ATARIRLE_ADD("rle", modesc_0x200) @@ -571,7 +568,7 @@ MACHINE_CONFIG_START(atarig42_state::atarig42_0x200) MCFG_ASIC65_ADD("asic65", ASIC65_ROMBASED) MACHINE_CONFIG_END -MACHINE_CONFIG_START(atarig42_state::atarig42_0x400) +MACHINE_CONFIG_START(atarig42_0x400_state::atarig42_0x400) atarig42(config); MCFG_ATARIRLE_ADD("rle", modesc_0x400) @@ -826,12 +823,12 @@ ROM_END * *************************************/ -DRIVER_INIT_MEMBER(atarig42_state,roadriot) +DRIVER_INIT_MEMBER(atarig42_0x200_state,roadriot) { m_playfield_base = 0x400; address_space &main = m_maincpu->space(AS_PROGRAM); - main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::roadriot_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::roadriot_sloop_data_w),this)); + main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_0x200_state::roadriot_sloop_data_r),this), write16_delegate(FUNC(atarig42_0x200_state::roadriot_sloop_data_w),this)); m_sloop_base = (uint16_t *)memregion("maincpu")->base(); /* @@ -857,7 +854,7 @@ DRIVER_INIT_MEMBER(atarig42_state,roadriot) } -DRIVER_INIT_MEMBER(atarig42_state,guardian) +DRIVER_INIT_MEMBER(atarig42_0x400_state,guardian) { m_playfield_base = 0x000; @@ -866,7 +863,7 @@ DRIVER_INIT_MEMBER(atarig42_state,guardian) *(uint16_t *)&memregion("maincpu")->base()[0x80000] = 0x4E75; address_space &main = m_maincpu->space(AS_PROGRAM); - main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::guardians_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::guardians_sloop_data_w),this)); + main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_0x400_state::guardians_sloop_data_r),this), write16_delegate(FUNC(atarig42_0x400_state::guardians_sloop_data_w),this)); m_sloop_base = (uint16_t *)memregion("maincpu")->base(); /* @@ -899,7 +896,7 @@ DRIVER_INIT_MEMBER(atarig42_state,guardian) * *************************************/ -GAME( 1991, roadriot, 0, atarig42_0x200, roadriot, atarig42_state, roadriot, ROT0, "Atari Games", "Road Riot 4WD (set 1, 04 Dec 1991)", MACHINE_UNEMULATED_PROTECTION ) -GAME( 1991, roadriota, roadriot, atarig42_0x200, roadriot, atarig42_state, roadriot, ROT0, "Atari Games", "Road Riot 4WD (set 2, 13 Nov 1991)", MACHINE_UNEMULATED_PROTECTION ) -GAME( 1991, roadriotb, roadriot, atarig42_0x200, roadriot, atarig42_state, roadriot, ROT0, "Atari Games", "Road Riot 4WD (set 3, 04 Jun 1991)", MACHINE_UNEMULATED_PROTECTION ) -GAME( 1992, guardian, 0, atarig42_0x400, guardian, atarig42_state, guardian, ROT0, "Atari Games", "Guardians of the 'Hood", 0 ) +GAME( 1991, roadriot, 0, atarig42_0x200, roadriot, atarig42_0x200_state, roadriot, ROT0, "Atari Games", "Road Riot 4WD (set 1, 04 Dec 1991)", MACHINE_UNEMULATED_PROTECTION ) +GAME( 1991, roadriota, roadriot, atarig42_0x200, roadriot, atarig42_0x200_state, roadriot, ROT0, "Atari Games", "Road Riot 4WD (set 2, 13 Nov 1991)", MACHINE_UNEMULATED_PROTECTION ) +GAME( 1991, roadriotb, roadriot, atarig42_0x200, roadriot, atarig42_0x200_state, roadriot, ROT0, "Atari Games", "Road Riot 4WD (set 3, 04 Jun 1991)", MACHINE_UNEMULATED_PROTECTION ) +GAME( 1992, guardian, 0, atarig42_0x400, guardian, atarig42_0x400_state, guardian, ROT0, "Atari Games", "Guardians of the 'Hood", 0 ) diff --git a/src/mame/drivers/atarigt.cpp b/src/mame/drivers/atarigt.cpp index 0ee55dbfe97..2622f728e13 100644 --- a/src/mame/drivers/atarigt.cpp +++ b/src/mame/drivers/atarigt.cpp @@ -805,8 +805,8 @@ MACHINE_CONFIG_START(atarigt_state::atarigt) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68EC020, ATARI_CLOCK_50MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) - MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, scanline_int_gen, 250) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigt_state, video_int_gen) + MCFG_CPU_PERIODIC_INT_DRIVER(atarigt_state, scanline_int_gen, 250) MCFG_MACHINE_RESET_OVERRIDE(atarigt_state,atarigt) diff --git a/src/mame/drivers/atarigx2.cpp b/src/mame/drivers/atarigx2.cpp index f9818160131..9da879d7545 100644 --- a/src/mame/drivers/atarigx2.cpp +++ b/src/mame/drivers/atarigx2.cpp @@ -46,7 +46,7 @@ void atarigx2_state::update_interrupts() } -MACHINE_RESET_MEMBER(atarigx2_state,atarigx2) +void atarigx2_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 8); @@ -1499,9 +1499,7 @@ MACHINE_CONFIG_START(atarigx2_state::atarigx2) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68EC020, ATARI_CLOCK_14MHz) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) - - MCFG_MACHINE_RESET_OVERRIDE(atarigx2_state,atarigx2) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigx2_state, video_int_gen) MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -1522,12 +1520,10 @@ MACHINE_CONFIG_START(atarigx2_state::atarigx2) MCFG_SCREEN_UPDATE_DRIVER(atarigx2_state, screen_update_atarigx2) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(atarigx2_state,atarigx2) - /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_ATARI_JSA_IIIS_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_IIIS_ADD("jsa", WRITELINE(atarigx2_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("SERVICE", 6) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp index e9754b45066..f4ec8bbc643 100644 --- a/src/mame/drivers/atarisy1.cpp +++ b/src/mame/drivers/atarisy1.cpp @@ -730,7 +730,7 @@ MACHINE_CONFIG_START(atarisy1_state::atarisy1) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68010, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarisy1_state, video_int_gen) MCFG_CPU_ADD("audiocpu", M6502, ATARI_CLOCK_14MHz/8) MCFG_CPU_PROGRAM_MAP(sound_map) @@ -778,7 +778,7 @@ MACHINE_CONFIG_START(atarisy1_state::atarisy1) MCFG_VIDEO_START_OVERRIDE(atarisy1_state,atarisy1) /* sound hardware */ - MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarisy1_state, sound_int_write_line)) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4) diff --git a/src/mame/drivers/atarisy2.cpp b/src/mame/drivers/atarisy2.cpp index 627868cef7d..c00b6361661 100644 --- a/src/mame/drivers/atarisy2.cpp +++ b/src/mame/drivers/atarisy2.cpp @@ -1224,7 +1224,7 @@ MACHINE_CONFIG_START(atarisy2_state::atarisy2) MCFG_VIDEO_START_OVERRIDE(atarisy2_state,atarisy2) /* sound hardware */ - MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarisy2_state, sound_int_write_line)) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_YM2151_ADD("ymsnd", SOUND_CLOCK/4) MCFG_SOUND_ROUTE(0, "lspeaker", 0.60) diff --git a/src/mame/drivers/att4425.cpp b/src/mame/drivers/att4425.cpp index ac23737d76b..72ee85b3b7c 100644 --- a/src/mame/drivers/att4425.cpp +++ b/src/mame/drivers/att4425.cpp @@ -48,8 +48,11 @@ public: , m_p_videoram(*this, "videoram") , m_p_chargen(*this, "chargen") , m_screen(*this, SCREEN_TAG) - { } + { } + void att4425(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(port10_w); DECLARE_WRITE8_MEMBER(port14_w); DECLARE_READ8_MEMBER(port14_r); @@ -60,13 +63,12 @@ public: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void att4425(machine_config &config); - void att4425_io(address_map &map); - void att4425_mem(address_map &map); -private: virtual void machine_start() override; virtual void video_start() override; + void att4425_io(address_map &map); + void att4425_mem(address_map &map); +private: required_device m_maincpu; required_device m_i8251; required_device m_sio; diff --git a/src/mame/drivers/badlands.cpp b/src/mame/drivers/badlands.cpp index 9c5db2b03c0..b468905e2a5 100644 --- a/src/mame/drivers/badlands.cpp +++ b/src/mame/drivers/badlands.cpp @@ -487,7 +487,7 @@ MACHINE_CONFIG_START(badlands_state::badlands) MCFG_VIDEO_START_OVERRIDE(badlands_state,badlands) /* sound hardware */ - MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(badlands_state, sound_int_write_line)) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4) diff --git a/src/mame/drivers/banctec.cpp b/src/mame/drivers/banctec.cpp index c688652cb5c..f53a395c24c 100644 --- a/src/mame/drivers/banctec.cpp +++ b/src/mame/drivers/banctec.cpp @@ -33,17 +33,20 @@ public: , m_p_chargen(*this, "chargen") { } + void banctec(machine_config &config); + +protected: MC6845_UPDATE_ROW(crtc_update_row); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); DECLARE_WRITE8_MEMBER(videoram_w); - required_device m_palette; - void banctec(machine_config &config); + virtual void machine_reset() override; void banctec_mcu_mem(address_map &map); void banctec_mem(address_map &map); + private: + required_device m_palette; u8 m_video_address; - virtual void machine_reset() override; required_device m_maincpu; required_shared_ptr m_videoram; required_region_ptr m_p_chargen; diff --git a/src/mame/drivers/batman.cpp b/src/mame/drivers/batman.cpp index 1bb4beb73ab..698253cf746 100644 --- a/src/mame/drivers/batman.cpp +++ b/src/mame/drivers/batman.cpp @@ -42,7 +42,7 @@ void batman_state::update_interrupts() } -MACHINE_START_MEMBER(batman_state,batman) +void batman_state::machine_start() { atarigen_state::machine_start(); @@ -51,12 +51,6 @@ MACHINE_START_MEMBER(batman_state,batman) } -MACHINE_RESET_MEMBER(batman_state,batman) -{ - atarigen_state::machine_reset(); -} - - /************************************* * @@ -203,9 +197,6 @@ MACHINE_CONFIG_START(batman_state::batman) MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_MACHINE_START_OVERRIDE(batman_state,batman) - MCFG_MACHINE_RESET_OVERRIDE(batman_state,batman) - MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -216,7 +207,7 @@ MACHINE_CONFIG_START(batman_state::batman) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(atarigen_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(batman_state, scanline_int_write_line)) MCFG_ATARI_VAD_PLAYFIELD(batman_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(batman_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_ALPHA(batman_state, "gfxdecode", get_alpha_tile_info) @@ -235,7 +226,7 @@ MACHINE_CONFIG_START(batman_state::batman) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(batman_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("260010", 6) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/beathead.cpp b/src/mame/drivers/beathead.cpp index 673b4fa4e29..92e6bc1c307 100644 --- a/src/mame/drivers/beathead.cpp +++ b/src/mame/drivers/beathead.cpp @@ -388,7 +388,7 @@ MACHINE_CONFIG_START(beathead_state::beathead) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(beathead_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("IN2", 6) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/big10.cpp b/src/mame/drivers/big10.cpp index 63c30c81f59..fb39602ca3c 100644 --- a/src/mame/drivers/big10.cpp +++ b/src/mame/drivers/big10.cpp @@ -75,16 +75,21 @@ public: , m_in(*this, "IN%u", 1) { } - required_device m_v9938; - uint8_t m_mux_data; + void big10(machine_config &config); + +protected: + void main_io(address_map &map); + void main_map(address_map &map); + DECLARE_READ8_MEMBER(mux_r); DECLARE_WRITE8_MEMBER(mux_w); + +private: + required_device m_v9938; + uint8_t m_mux_data; required_device m_maincpu; required_device m_hopper; required_ioport_array<6> m_in; - void big10(machine_config &config); - void main_io(address_map &map); - void main_map(address_map &map); }; diff --git a/src/mame/drivers/blstroid.cpp b/src/mame/drivers/blstroid.cpp index cd05da11241..ba93ea5ec89 100644 --- a/src/mame/drivers/blstroid.cpp +++ b/src/mame/drivers/blstroid.cpp @@ -49,7 +49,7 @@ WRITE16_MEMBER(blstroid_state::blstroid_halt_until_hblank_0_w) } -MACHINE_RESET_MEMBER(blstroid_state,blstroid) +void blstroid_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 8); @@ -179,9 +179,7 @@ MACHINE_CONFIG_START(blstroid_state::blstroid) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) - - MCFG_MACHINE_RESET_OVERRIDE(blstroid_state,blstroid) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", blstroid_state, video_int_gen) MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -211,7 +209,7 @@ MACHINE_CONFIG_START(blstroid_state::blstroid) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(blstroid_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("IN0", 7) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) diff --git a/src/mame/drivers/bowltry.cpp b/src/mame/drivers/bowltry.cpp index b9b91a20127..f9fc85a75a6 100644 --- a/src/mame/drivers/bowltry.cpp +++ b/src/mame/drivers/bowltry.cpp @@ -38,11 +38,17 @@ class bowltry_state : public driver_device { public: bowltry_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") { } + void bowltry(machine_config &config); + +protected: + void bowltry_map(address_map &map); + uint32_t screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + int m_test_x; int m_test_y; int m_start_offs; @@ -52,11 +58,7 @@ public: uint16_t m_hack[2]; #endif -void bowltry(machine_config &config); -void bowltry_map(address_map &map); -protected: required_device m_maincpu; -public: }; #if HACK_ENABLED diff --git a/src/mame/drivers/boxer.cpp b/src/mame/drivers/boxer.cpp index 013e69853cd..c35a1484e2b 100644 --- a/src/mame/drivers/boxer.cpp +++ b/src/mame/drivers/boxer.cpp @@ -32,8 +32,8 @@ public: TIMER_PERIODIC }; - boxer_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + boxer_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_tile_ram(*this, "tile_ram"), m_sprite_ram(*this, "sprite_ram"), m_maincpu(*this, "maincpu"), @@ -41,22 +41,9 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette"){ } - /* memory pointers */ - required_shared_ptr m_tile_ram; - required_shared_ptr m_sprite_ram; - - /* misc */ - uint8_t m_pot_state; - uint8_t m_pot_latch; - emu_timer *m_pot_interrupt; - emu_timer *m_periodic_timer; - - /* devices */ - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; + void boxer(machine_config &config); +protected: DECLARE_READ8_MEMBER(input_r); DECLARE_READ8_MEMBER(misc_r); DECLARE_WRITE8_MEMBER(bell_w); @@ -65,18 +52,34 @@ public: DECLARE_WRITE8_MEMBER(irq_reset_w); DECLARE_WRITE8_MEMBER(crowd_w); DECLARE_WRITE8_MEMBER(led_w); - virtual void machine_start() override; - virtual void machine_reset() override; DECLARE_PALETTE_INIT(boxer); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(pot_interrupt); TIMER_CALLBACK_MEMBER(periodic_callback); void draw(bitmap_ind16 &bitmap, const rectangle &cliprect); - void boxer(machine_config &config); + virtual void machine_start() override; + virtual void machine_reset() override; void boxer_map(address_map &map); -protected: + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + +private: + /* memory pointers */ + required_shared_ptr m_tile_ram; + required_shared_ptr m_sprite_ram; + + /* misc */ + uint8_t m_pot_state; + uint8_t m_pot_latch; + emu_timer *m_pot_interrupt; + emu_timer *m_periodic_timer; + + /* devices */ + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; }; /************************************* diff --git a/src/mame/drivers/caswin.cpp b/src/mame/drivers/caswin.cpp index bdd3bdd3783..2ca39f0870f 100644 --- a/src/mame/drivers/caswin.cpp +++ b/src/mame/drivers/caswin.cpp @@ -78,16 +78,16 @@ TODO: class caswin_state : public driver_device { public: - caswin_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + caswin_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_sc0_vram(*this, "sc0_vram"), m_sc0_attr(*this, "sc0_attr"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_sc0_vram; - required_shared_ptr m_sc0_attr; - tilemap_t *m_sc0_tilemap; + void vvillage(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(sc0_vram_w); DECLARE_WRITE8_MEMBER(sc0_attr_w); DECLARE_WRITE8_MEMBER(vvillage_scroll_w); @@ -96,14 +96,19 @@ public: DECLARE_WRITE8_MEMBER(vvillage_output_w); DECLARE_WRITE8_MEMBER(vvillage_lamps_w); TILE_GET_INFO_MEMBER(get_sc0_tile_info); - virtual void video_start() override; DECLARE_PALETTE_INIT(caswin); uint32_t screen_update_vvillage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_gfxdecode; - void vvillage(machine_config &config); + + virtual void video_start() override; void vvillage_io(address_map &map); void vvillage_mem(address_map &map); + +private: + required_shared_ptr m_sc0_vram; + required_shared_ptr m_sc0_attr; + tilemap_t *m_sc0_tilemap; + required_device m_maincpu; + required_device m_gfxdecode; }; @@ -326,10 +331,10 @@ PALETTE_INIT_MEMBER(caswin_state, caswin) MACHINE_CONFIG_START(caswin_state::vvillage) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80,4000000) /* ? MHz */ + MCFG_CPU_ADD("maincpu", Z80, 4000000) /* ? MHz */ MCFG_CPU_PROGRAM_MAP(vvillage_mem) MCFG_CPU_IO_MAP(vvillage_io) - MCFG_CPU_VBLANK_INT_DRIVER("screen", caswin_state, irq0_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", caswin_state, irq0_line_hold) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/clayshoo.cpp b/src/mame/drivers/clayshoo.cpp index 384b851fa6d..b4c76b5a57c 100644 --- a/src/mame/drivers/clayshoo.cpp +++ b/src/mame/drivers/clayshoo.cpp @@ -29,29 +29,36 @@ public: clayshoo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu") + { } - /* memory pointers */ - required_shared_ptr m_videoram; + void clayshoo(machine_config &config); - /* misc */ - emu_timer *m_analog_timer_1, *m_analog_timer_2; - uint8_t m_input_port_select; - uint8_t m_analog_port_val; +protected: DECLARE_WRITE8_MEMBER(analog_reset_w); DECLARE_READ8_MEMBER(analog_r); DECLARE_WRITE8_MEMBER(input_port_select_w); DECLARE_READ8_MEMBER(input_port_r); - virtual void machine_start() override; - virtual void machine_reset() override; uint32_t screen_update_clayshoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(reset_analog_bit); - uint8_t difficulty_input_port_r( int bit ); - void create_analog_timers( ); - required_device m_maincpu; - void clayshoo(machine_config &config); + uint8_t difficulty_input_port_r(int bit); + void create_analog_timers(); + + virtual void machine_start() override; + virtual void machine_reset() override; void main_io_map(address_map &map); void main_map(address_map &map); + +private: + /* memory pointers */ + required_shared_ptr m_videoram; + + /* misc */ + emu_timer *m_analog_timer_1, *m_analog_timer_2; + uint8_t m_input_port_select; + uint8_t m_analog_port_val; + + required_device m_maincpu; }; diff --git a/src/mame/drivers/cyberbal.cpp b/src/mame/drivers/cyberbal.cpp index 4b0ee6b122f..34a404c5a21 100644 --- a/src/mame/drivers/cyberbal.cpp +++ b/src/mame/drivers/cyberbal.cpp @@ -407,7 +407,7 @@ MACHINE_CONFIG_START(cyberbal_state::cyberbal) MCFG_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(extra_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("lscreen", atarigen_state, video_int_gen) /* or is it "right?" */ + MCFG_DEVICE_VBLANK_INT_DRIVER("lscreen", cyberbal_state, video_int_gen) /* or is it "right?" */ MCFG_CPU_ADD("dac", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(sound_68k_map) @@ -460,7 +460,7 @@ MACHINE_CONFIG_START(cyberbal_state::cyberbal) MCFG_VIDEO_START_OVERRIDE(cyberbal_state,cyberbal) /* sound hardware */ - MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(cyberbal_state, sound_int_write_line)) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4) @@ -491,7 +491,7 @@ MACHINE_CONFIG_START(cyberbal_state::cyberbal2p) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(cyberbal2p_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cyberbal_state, video_int_gen) MCFG_MACHINE_START_OVERRIDE(cyberbal_state,cyberbal2p) MCFG_MACHINE_RESET_OVERRIDE(cyberbal_state,cyberbal2p) @@ -524,7 +524,7 @@ MACHINE_CONFIG_START(cyberbal_state::cyberbal2p) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(cyberbal_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("IN2", 15) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/cybstorm.cpp b/src/mame/drivers/cybstorm.cpp index cdfa781494a..d11b2907bae 100644 --- a/src/mame/drivers/cybstorm.cpp +++ b/src/mame/drivers/cybstorm.cpp @@ -36,18 +36,13 @@ void cybstorm_state::update_interrupts() } -MACHINE_START_MEMBER(cybstorm_state,cybstorm) +void cybstorm_state::machine_start() { atarigen_state::machine_start(); save_item(NAME(m_latch_data)); save_item(NAME(m_alpha_tile_bank)); } -MACHINE_RESET_MEMBER(cybstorm_state,cybstorm) -{ - atarigen_state::machine_reset(); -} - /************************************* @@ -237,9 +232,7 @@ MACHINE_CONFIG_START(cybstorm_state::round2) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68EC020, ATARI_CLOCK_14MHz) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) - - MCFG_MACHINE_RESET_OVERRIDE(cybstorm_state,cybstorm) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cybstorm_state, video_int_gen) MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -247,7 +240,7 @@ MACHINE_CONFIG_START(cybstorm_state::round2) MCFG_WATCHDOG_ADD("watchdog") /* video hardware */ - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(atarigen_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(cybstorm_state, scanline_int_write_line)) MCFG_ATARI_VAD_PLAYFIELD(cybstorm_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(cybstorm_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_ALPHA(cybstorm_state, "gfxdecode", get_alpha_tile_info) @@ -271,16 +264,16 @@ MACHINE_CONFIG_START(cybstorm_state::round2) MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240) MCFG_SCREEN_UPDATE_DRIVER(cybstorm_state, screen_update_cybstorm) - MCFG_VIDEO_START_OVERRIDE(cybstorm_state, cybstorm) MACHINE_CONFIG_END MACHINE_CONFIG_START(cybstorm_state::cybstorm) round2(config); + /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_ATARI_JSA_IIIS_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_IIIS_ADD("jsa", WRITELINE(cybstorm_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("9F0010", 22) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) diff --git a/src/mame/drivers/destroyr.cpp b/src/mame/drivers/destroyr.cpp index 635adb65108..f372cd7f8d9 100644 --- a/src/mame/drivers/destroyr.cpp +++ b/src/mame/drivers/destroyr.cpp @@ -30,8 +30,8 @@ public: TIMER_DESTROYR_FRAME }; - destroyr_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + destroyr_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_watchdog(*this, "watchdog"), m_gfxdecode(*this, "gfxdecode"), @@ -39,8 +39,33 @@ public: m_palette(*this, "palette"), m_alpha_num_ram(*this, "alpha_nuram"), m_major_obj_ram(*this, "major_obj_ram"), - m_minor_obj_ram(*this, "minor_obj_ram") { } + m_minor_obj_ram(*this, "minor_obj_ram") + { } + void destroyr(machine_config &config); + +protected: + DECLARE_WRITE8_MEMBER(misc_w); + DECLARE_WRITE8_MEMBER(cursor_load_w); + DECLARE_WRITE8_MEMBER(interrupt_ack_w); + DECLARE_WRITE_LINE_MEMBER(led0_w); + DECLARE_WRITE_LINE_MEMBER(led1_w); + DECLARE_READ8_MEMBER(input_r); + DECLARE_READ8_MEMBER(scanline_r); + + DECLARE_PALETTE_INIT(destroyr); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + TIMER_CALLBACK_MEMBER(dial_callback); + TIMER_CALLBACK_MEMBER(frame_callback); + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void destroyr_map(address_map &map); + +private: /* devices */ required_device m_maincpu; required_device m_watchdog; @@ -65,28 +90,6 @@ public: int m_noise; emu_timer *m_dial_timer; emu_timer *m_frame_timer; - - DECLARE_WRITE8_MEMBER(misc_w); - DECLARE_WRITE8_MEMBER(cursor_load_w); - DECLARE_WRITE8_MEMBER(interrupt_ack_w); - DECLARE_WRITE_LINE_MEMBER(led0_w); - DECLARE_WRITE_LINE_MEMBER(led1_w); - DECLARE_READ8_MEMBER(input_r); - DECLARE_READ8_MEMBER(scanline_r); - - virtual void machine_start() override; - virtual void machine_reset() override; - DECLARE_PALETTE_INIT(destroyr); - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - TIMER_CALLBACK_MEMBER(dial_callback); - TIMER_CALLBACK_MEMBER(frame_callback); - - void destroyr(machine_config &config); - void destroyr_map(address_map &map); -protected: - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; diff --git a/src/mame/drivers/elektronmono.cpp b/src/mame/drivers/elektronmono.cpp index 93d27b261aa..012e624b92c 100644 --- a/src/mame/drivers/elektronmono.cpp +++ b/src/mame/drivers/elektronmono.cpp @@ -118,19 +118,21 @@ class elekmono_state : public driver_device { public: - elekmono_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + elekmono_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - required_device m_maincpu; + void elektron(machine_config &config); +protected: virtual void machine_start() override; virtual void machine_reset() override; - DECLARE_DRIVER_INIT(elektron); - void elektron(machine_config &config); void elektron_map(address_map &map); + +private: + required_device m_maincpu; }; void elekmono_state::machine_start() diff --git a/src/mame/drivers/eprom.cpp b/src/mame/drivers/eprom.cpp index 86422a9c866..60ff51ba64d 100644 --- a/src/mame/drivers/eprom.cpp +++ b/src/mame/drivers/eprom.cpp @@ -51,13 +51,13 @@ void eprom_state::update_interrupts() m_maincpu->set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); } -MACHINE_START_MEMBER(eprom_state,eprom) +void eprom_state::machine_start() { atarigen_state::machine_start(); save_item(NAME(m_sync_data)); } -MACHINE_RESET_MEMBER(eprom_state,eprom) +void eprom_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 8); @@ -390,16 +390,13 @@ MACHINE_CONFIG_START(eprom_state::eprom) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", eprom_state, video_int_gen) MCFG_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(extra_map) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom) - MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom) - MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -427,7 +424,7 @@ MACHINE_CONFIG_START(eprom_state::eprom) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(eprom_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("260010", 1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_DEVICE_REMOVE("jsa:pokey") @@ -439,13 +436,10 @@ MACHINE_CONFIG_START(eprom_state::klaxp) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", eprom_state, video_int_gen) MCFG_QUANTUM_TIME(attotime::from_hz(600)) - MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom) - MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom) - MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -473,7 +467,7 @@ MACHINE_CONFIG_START(eprom_state::klaxp) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(eprom_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("260010", 1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -484,13 +478,10 @@ MACHINE_CONFIG_START(eprom_state::guts) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(guts_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", eprom_state, video_int_gen) MCFG_QUANTUM_TIME(attotime::from_hz(600)) - MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom) - MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom) - MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -518,7 +509,7 @@ MACHINE_CONFIG_START(eprom_state::guts) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(eprom_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("260010", 1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -731,36 +722,14 @@ ROM_END -/************************************* - * - * Driver initialization - * - *************************************/ - -DRIVER_INIT_MEMBER(eprom_state,eprom) -{ -} - - -DRIVER_INIT_MEMBER(eprom_state,klaxp) -{ -} - - -DRIVER_INIT_MEMBER(eprom_state,guts) -{ -} - - - /************************************* * * Game driver(s) * *************************************/ -GAME( 1989, eprom, 0, eprom, eprom, eprom_state, eprom, ROT0, "Atari Games", "Escape from the Planet of the Robot Monsters (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, eprom2, eprom, eprom, eprom, eprom_state, eprom, ROT0, "Atari Games", "Escape from the Planet of the Robot Monsters (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, klaxp1, klax, klaxp, klaxp, eprom_state, klaxp, ROT0, "Atari Games", "Klax (prototype set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, klaxp2, klax, klaxp, klaxp, eprom_state, klaxp, ROT0, "Atari Games", "Klax (prototype set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, guts, 0, guts, guts, eprom_state, guts, ROT0, "Atari Games", "Guts n' Glory (prototype)", 0 ) +GAME( 1989, eprom, 0, eprom, eprom, eprom_state, 0, ROT0, "Atari Games", "Escape from the Planet of the Robot Monsters (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, eprom2, eprom, eprom, eprom, eprom_state, 0, ROT0, "Atari Games", "Escape from the Planet of the Robot Monsters (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, klaxp1, klax, klaxp, klaxp, eprom_state, 0, ROT0, "Atari Games", "Klax (prototype set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, klaxp2, klax, klaxp, klaxp, eprom_state, 0, ROT0, "Atari Games", "Klax (prototype set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, guts, 0, guts, guts, eprom_state, 0, ROT0, "Atari Games", "Guts n' Glory (prototype)", 0 ) diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp index 3f4e606b93d..9fc9bcbeaba 100644 --- a/src/mame/drivers/equites.cpp +++ b/src/mame/drivers/equites.cpp @@ -569,7 +569,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(equites_state::equites_scanline) m_maincpu->set_input_line(2, HOLD_LINE); } -TIMER_DEVICE_CALLBACK_MEMBER(equites_state::splndrbt_scanline) +TIMER_DEVICE_CALLBACK_MEMBER(splndrbt_state::splndrbt_scanline) { int scanline = param; @@ -585,12 +585,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(equites_state::splndrbt_scanline) /******************************************************************************/ // CPU Handlers -CUSTOM_INPUT_MEMBER(equites_state::gekisou_unknown_bit_r) +CUSTOM_INPUT_MEMBER(gekisou_state::gekisou_unknown_bit_r) { return m_gekisou_unknown_bit; } -WRITE16_MEMBER(equites_state::gekisou_unknown_bit_w) +WRITE16_MEMBER(gekisou_state::gekisou_unknown_bit_w) { // data bit is A17 (offset) m_gekisou_unknown_bit = (offset == 0) ? 0 : 1;; @@ -657,14 +657,14 @@ ADDRESS_MAP_START(equites_state::equites_map) AM_RANGE(0x780000, 0x780001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w) ADDRESS_MAP_END -ADDRESS_MAP_START(equites_state::gekisou_map) +ADDRESS_MAP_START(gekisou_state::gekisou_map) AM_IMPORT_FROM( equites_map ) AM_RANGE(0x040000, 0x040fff) AM_RAM AM_SHARE("nvram") // mainram is battery-backed AM_RANGE(0x580000, 0x580001) AM_SELECT(0x020000) AM_WRITE(gekisou_unknown_bit_w) ADDRESS_MAP_END -ADDRESS_MAP_START(equites_state::splndrbt_map) +ADDRESS_MAP_START(splndrbt_state::splndrbt_map) ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x000000, 0x00ffff) AM_ROM AM_RANGE(0x040000, 0x040fff) AM_RAM @@ -781,7 +781,7 @@ static INPUT_PORTS_START( gekisou ) PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, equites_state, gekisou_unknown_bit_r, nullptr) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gekisou_state, gekisou_unknown_bit_r, nullptr) /* this is actually a variable resistor */ PORT_START(FRQ_ADJUSTER_TAG) @@ -1082,10 +1082,7 @@ MACHINE_CONFIG_END void equites_state::machine_start() { // zerofill - m_fg_char_bank = 0; m_bgcolor = 0; - m_splndrbt_bg_scrollx = 0; - m_splndrbt_bg_scrolly = 0; m_sound_prom_address = 0; m_dac_latch = 0; m_eq8155_port_b = 0; @@ -1097,13 +1094,9 @@ void equites_state::machine_start() m_cymvol = 0.0; m_hihatvol = 0.0; m_timer_count = 0; - m_gekisou_unknown_bit = 0; // register for savestates - save_item(NAME(m_fg_char_bank)); save_item(NAME(m_bgcolor)); - save_item(NAME(m_splndrbt_bg_scrollx)); - save_item(NAME(m_splndrbt_bg_scrolly)); save_item(NAME(m_sound_prom_address)); save_item(NAME(m_dac_latch)); save_item(NAME(m_eq8155_port_b)); @@ -1115,12 +1108,33 @@ void equites_state::machine_start() save_item(NAME(m_cymvol)); save_item(NAME(m_hihatvol)); save_item(NAME(m_timer_count)); - save_item(NAME(m_gekisou_unknown_bit)); m_adjuster_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(equites_state::equites_frq_adjuster_callback), this)); m_adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); } +void gekisou_state::machine_start() +{ + equites_state::machine_start(); + + m_gekisou_unknown_bit = 0; + + save_item(NAME(m_gekisou_unknown_bit)); +} + +void splndrbt_state::machine_start() +{ + equites_state::machine_start(); + + save_item(NAME(m_fg_char_bank)); + save_item(NAME(m_splndrbt_bg_scrollx)); + save_item(NAME(m_splndrbt_bg_scrolly)); + + m_fg_char_bank = 0; + m_splndrbt_bg_scrollx = 0; + m_splndrbt_bg_scrolly = 0; +} + void equites_state::machine_reset() { } @@ -1161,7 +1175,7 @@ MACHINE_CONFIG_START(equites_state::equites) MCFG_VIDEO_START_OVERRIDE(equites_state,equites) MACHINE_CONFIG_END -MACHINE_CONFIG_START(equites_state::gekisou) +MACHINE_CONFIG_START(gekisou_state::gekisou) equites(config); /* basic machine hardware */ @@ -1177,18 +1191,18 @@ MACHINE_CONFIG_START(equites_state::gekisou) MACHINE_CONFIG_END -MACHINE_CONFIG_START(equites_state::splndrbt) +MACHINE_CONFIG_START(splndrbt_state::splndrbt) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 24_MHz_XTAL/4) /* 68000P8 running at 6mhz, verified on pcb */ MCFG_CPU_PROGRAM_MAP(splndrbt_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", equites_state, splndrbt_scanline, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", splndrbt_state, splndrbt_scanline, "screen", 0, 1) MCFG_DEVICE_ADD("mainlatch", LS259, 0) MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(equites_state, flip_screen_w)) MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(equites_state, mcu_start_w)) MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(equites_state, mcu_switch_w)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(equites_state, splndrbt_selchar_w)) + MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(splndrbt_state, splndrbt_selchar_w)) common_sound(config); @@ -1200,18 +1214,18 @@ MACHINE_CONFIG_START(equites_state::splndrbt) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(equites_state, screen_update_splndrbt) + MCFG_SCREEN_UPDATE_DRIVER(splndrbt_state, screen_update_splndrbt) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", splndrbt) MCFG_PALETTE_ADD("palette", 0x280) MCFG_PALETTE_INDIRECT_ENTRIES(0x100) - MCFG_PALETTE_INIT_OWNER(equites_state,splndrbt) + MCFG_PALETTE_INIT_OWNER(splndrbt_state,splndrbt) - MCFG_VIDEO_START_OVERRIDE(equites_state,splndrbt) + MCFG_VIDEO_START_OVERRIDE(splndrbt_state,splndrbt) MACHINE_CONFIG_END -MACHINE_CONFIG_START(equites_state::hvoltage) +MACHINE_CONFIG_START(splndrbt_state::hvoltage) splndrbt(config); // mcu not dumped, so add simulated mcu @@ -1947,7 +1961,7 @@ DRIVER_INIT_MEMBER(equites_state,equites) unpack_region("gfx3"); } -DRIVER_INIT_MEMBER(equites_state,splndrbt) +DRIVER_INIT_MEMBER(splndrbt_state,splndrbt) { unpack_region("gfx3"); } @@ -1964,11 +1978,11 @@ GAME( 1984, equitess, equites, equites, equites, equites_state, equites, RO GAME( 1984, bullfgtr, 0, equites, bullfgtr, equites_state, equites, ROT90, "Alpha Denshi Co.", "Bull Fighter", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1984, bullfgtrs, bullfgtr, equites, bullfgtr, equites_state, equites, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1985, kouyakyu, 0, equites, kouyakyu, equites_state, equites, ROT0, "Alpha Denshi Co.", "The Koukou Yakyuu", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, gekisou, 0, gekisou, gekisou, equites_state, equites, ROT90, "Eastern Corp.", "Gekisou (Japan)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, gekisou, 0, gekisou, gekisou, gekisou_state, equites, ROT90, "Eastern Corp.", "Gekisou (Japan)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // Splendor Blast Hardware -GAME( 1985, splndrbt, 0, splndrbt, splndrbt, equites_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, splndrbta, splndrbt, splndrbt, splndrbt, equites_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, splndrbtb, splndrbt, splndrbt, splndrbt, equites_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 3)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, splndrbt2, 0, splndrbt, splndrbt, equites_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast II", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, hvoltage, 0, hvoltage, hvoltage, equites_state, splndrbt, ROT0, "Alpha Denshi Co.", "High Voltage", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, splndrbt, 0, splndrbt, splndrbt, splndrbt_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, splndrbta, splndrbt, splndrbt, splndrbt, splndrbt_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, splndrbtb, splndrbt, splndrbt, splndrbt, splndrbt_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 3)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, splndrbt2, 0, splndrbt, splndrbt, splndrbt_state, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast II", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, hvoltage, 0, hvoltage, hvoltage, splndrbt_state, splndrbt, ROT0, "Alpha Denshi Co.", "High Voltage", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/exidy440.cpp b/src/mame/drivers/exidy440.cpp index 21fdde6df95..1a107cd65d2 100644 --- a/src/mame/drivers/exidy440.cpp +++ b/src/mame/drivers/exidy440.cpp @@ -427,13 +427,13 @@ READ8_MEMBER(exidy440_state::claypign_protection_r) } -READ8_MEMBER(exidy440_state::topsecex_input_port_5_r) +READ8_MEMBER(topsecex_state::topsecex_input_port_5_r) { return (ioport("AN1")->read() & 1) ? 0x01 : 0x02; } -WRITE8_MEMBER(exidy440_state::topsecex_yscroll_w) +WRITE8_MEMBER(topsecex_state::topsecex_yscroll_w) { m_topsecex_yscroll = data; } @@ -1056,7 +1056,7 @@ MACHINE_CONFIG_START(exidy440_state::exidy440) MACHINE_CONFIG_END -MACHINE_CONFIG_START(exidy440_state::topsecex) +MACHINE_CONFIG_START(topsecex_state::topsecex) exidy440(config); /* basic machine hardware */ @@ -2053,16 +2053,16 @@ DRIVER_INIT_MEMBER(exidy440_state,claypign) } -DRIVER_INIT_MEMBER(exidy440_state,topsecex) +DRIVER_INIT_MEMBER(topsecex_state,topsecex) { DRIVER_INIT_CALL(exidy440); /* extra input ports and scrolling */ - m_maincpu->space(AS_PROGRAM).install_read_handler(0x2ec5, 0x2ec5, read8_delegate(FUNC(exidy440_state::topsecex_input_port_5_r),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x2ec5, 0x2ec5, read8_delegate(FUNC(topsecex_state::topsecex_input_port_5_r),this)); m_maincpu->space(AS_PROGRAM).install_read_port(0x2ec6, 0x2ec6, "AN0"); m_maincpu->space(AS_PROGRAM).install_read_port(0x2ec7, 0x2ec7, "IN4"); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x2ec1, 0x2ec1, write8_delegate(FUNC(exidy440_state::topsecex_yscroll_w),this)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x2ec1, 0x2ec1, write8_delegate(FUNC(topsecex_state::topsecex_yscroll_w),this)); } @@ -2126,7 +2126,7 @@ GAME( 1985, catch22, combat, exidy440, catch22, exidy440_state, exidy440, RO GAME( 1985, cracksht, 0, exidy440, cracksht, exidy440_state, exidy440, ROT0, "Exidy", "Crackshot (version 2.0)", 0 ) GAME( 1986, claypign, 0, exidy440, claypign, exidy440_state, claypign, ROT0, "Exidy", "Clay Pigeon (version 2.0)", 0 ) GAME( 1986, chiller, 0, exidy440, chiller, exidy440_state, exidy440, ROT0, "Exidy", "Chiller (version 3.0)", 0 ) -GAME( 1986, topsecex, 0, topsecex, topsecex, exidy440_state, topsecex, ROT0, "Exidy", "Top Secret (Exidy) (version 1.0)", 0 ) +GAME( 1986, topsecex, 0, topsecex, topsecex, topsecex_state, topsecex, ROT0, "Exidy", "Top Secret (Exidy) (version 1.0)", 0 ) GAME( 1987, hitnmiss, 0, exidy440, hitnmiss, exidy440_state, exidy440, ROT0, "Exidy", "Hit 'n Miss (version 3.0)", 0 ) GAME( 1987, hitnmiss2,hitnmiss, exidy440, hitnmiss, exidy440_state, exidy440, ROT0, "Exidy", "Hit 'n Miss (version 2.0)", 0 ) GAME( 1988, whodunit, 0, exidy440, whodunit, exidy440_state, exidy440, ROT0, "Exidy", "Who Dunit (version 9.0)", 0 ) diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp index aca384baf0d..a5c4a36964c 100644 --- a/src/mame/drivers/firefox.cpp +++ b/src/mame/drivers/firefox.cpp @@ -46,8 +46,8 @@ but requires a special level III player for proper control. Video: CAV. Audio: A class firefox_state : public driver_device { public: - firefox_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + firefox_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_laserdisc(*this, "laserdisc") , m_tileram(*this, "tileram"), m_spriteram(*this, "spriteram"), @@ -59,23 +59,14 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), - m_soundlatch2(*this, "soundlatch2") { } + m_soundlatch2(*this, "soundlatch2") + { } - required_device m_laserdisc; - required_shared_ptr m_tileram; - required_shared_ptr m_spriteram; - required_shared_ptr m_sprite_palette; - required_shared_ptr m_tile_palette; - int m_n_disc_lock; - int m_n_disc_data; - int m_n_disc_read_data; - x2212_device *m_nvram_1c; - x2212_device *m_nvram_1d; - tilemap_t *m_bgtiles; - int m_control_num; - uint8_t m_sound_to_main_flag; - uint8_t m_main_to_sound_flag; - int m_sprite_bank; + DECLARE_CUSTOM_INPUT_MEMBER(mainflag_r); + DECLARE_CUSTOM_INPUT_MEMBER(soundflag_r); + void firefox(machine_config &config); + +protected: DECLARE_READ8_MEMBER(firefox_disc_status_r); DECLARE_READ8_MEMBER(firefox_disc_data_r); DECLARE_WRITE8_MEMBER(firefox_disc_read_w); @@ -108,18 +99,27 @@ public: DECLARE_WRITE_LINE_MEMBER(led3_w); DECLARE_WRITE_LINE_MEMBER(coin_counter_right_w); DECLARE_WRITE_LINE_MEMBER(coin_counter_left_w); - DECLARE_CUSTOM_INPUT_MEMBER(mainflag_r); - DECLARE_CUSTOM_INPUT_MEMBER(soundflag_r); DECLARE_READ8_MEMBER(riot_porta_r); DECLARE_WRITE8_MEMBER(riot_porta_w); DECLARE_WRITE_LINE_MEMBER(riot_irq); TILE_GET_INFO_MEMBER(bgtile_get_info); - virtual void machine_start() override; - virtual void video_start() override; uint32_t screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(video_timer_callback); void set_rgba( int start, int index, unsigned char *palette_ram ); void firq_gen(phillips_22vp931_device &laserdisc, int state); + + virtual void machine_start() override; + virtual void video_start() override; + void audio_map(address_map &map); + void main_map(address_map &map); + +private: + required_device m_laserdisc; + required_shared_ptr m_tileram; + required_shared_ptr m_spriteram; + required_shared_ptr m_sprite_palette; + required_shared_ptr m_tile_palette; + required_device m_maincpu; required_device m_audiocpu; required_device m_gfxdecode; @@ -127,9 +127,17 @@ public: required_device m_palette; required_device m_soundlatch; required_device m_soundlatch2; - void firefox(machine_config &config); - void audio_map(address_map &map); - void main_map(address_map &map); + + int m_n_disc_lock; + int m_n_disc_data; + int m_n_disc_read_data; + x2212_device *m_nvram_1c; + x2212_device *m_nvram_1d; + tilemap_t *m_bgtiles; + int m_control_num; + uint8_t m_sound_to_main_flag; + uint8_t m_main_to_sound_flag; + int m_sprite_bank; }; diff --git a/src/mame/drivers/flyball.cpp b/src/mame/drivers/flyball.cpp index 0a27faa84fc..f976c1e8b07 100644 --- a/src/mame/drivers/flyball.cpp +++ b/src/mame/drivers/flyball.cpp @@ -23,8 +23,8 @@ TODO: #include "machine/74259.h" #include "screen.h" -#define MASTER_CLOCK XTAL(12'096'000) -#define PIXEL_CLOCK (MASTER_CLOCK / 2) +static constexpr XTAL MASTER_CLOCK = 12.096_MHz_XTAL; +static constexpr XTAL PIXEL_CLOCK = MASTER_CLOCK / 2; class flyball_state : public driver_device @@ -37,41 +37,19 @@ public: TIMER_QUARTER }; - flyball_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + flyball_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_outlatch(*this, "outlatch"), - m_playfield_ram(*this, "playfield_ram") { } + m_playfield_ram(*this, "playfield_ram") + { } - /* devices */ - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_outlatch; - - /* memory pointers */ - required_shared_ptr m_playfield_ram; - - /* video-related */ - tilemap_t *m_tmap; - uint8_t m_pitcher_vert; - uint8_t m_pitcher_horz; - uint8_t m_pitcher_pic; - uint8_t m_ball_vert; - uint8_t m_ball_horz; - - /* misc */ - uint8_t m_potmask; - uint8_t m_potsense; - - emu_timer *m_pot_assert_timer[64]; - emu_timer *m_pot_clear_timer; - emu_timer *m_quarter_timer; + void flyball(machine_config &config); +protected: DECLARE_READ8_MEMBER(input_r); DECLARE_READ8_MEMBER(scanline_r); DECLARE_READ8_MEMBER(potsense_r); @@ -97,10 +75,35 @@ public: TIMER_CALLBACK_MEMBER(joystick_callback); TIMER_CALLBACK_MEMBER(quarter_callback); - void flyball(machine_config &config); void flyball_map(address_map &map); -protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + +private: + /* devices */ + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_outlatch; + + /* memory pointers */ + required_shared_ptr m_playfield_ram; + + /* video-related */ + tilemap_t *m_tmap; + uint8_t m_pitcher_vert; + uint8_t m_pitcher_horz; + uint8_t m_pitcher_pic; + uint8_t m_ball_vert; + uint8_t m_ball_horz; + + /* misc */ + uint8_t m_potmask; + uint8_t m_potsense; + + emu_timer *m_pot_assert_timer[64]; + emu_timer *m_pot_clear_timer; + emu_timer *m_quarter_timer; }; diff --git a/src/mame/drivers/foodf.cpp b/src/mame/drivers/foodf.cpp index 83b270455d1..3a22246f7b9 100644 --- a/src/mame/drivers/foodf.cpp +++ b/src/mame/drivers/foodf.cpp @@ -138,14 +138,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(foodf_state::scanline_update_timer) } -MACHINE_START_MEMBER(foodf_state,foodf) +void foodf_state::machine_start() { atarigen_state::machine_start(); save_item(NAME(m_whichport)); } -MACHINE_RESET_MEMBER(foodf_state,foodf) +void foodf_state::machine_reset() { timer_device *scan_timer = machine().device("scan_timer"); scan_timer->adjust(m_screen->time_until_pos(0)); @@ -340,10 +340,7 @@ MACHINE_CONFIG_START(foodf_state::foodf) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) - - MCFG_MACHINE_START_OVERRIDE(foodf_state,foodf) - MCFG_MACHINE_RESET_OVERRIDE(foodf_state,foodf) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", foodf_state, video_int_gen) MCFG_X2212_ADD_AUTOSAVE("nvram") @@ -363,8 +360,6 @@ MACHINE_CONFIG_START(foodf_state::foodf) MCFG_SCREEN_UPDATE_DRIVER(foodf_state, screen_update_foodf) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(foodf_state,foodf) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/forte2.cpp b/src/mame/drivers/forte2.cpp index 1b15de7d167..ee0dfbc9a69 100644 --- a/src/mame/drivers/forte2.cpp +++ b/src/mame/drivers/forte2.cpp @@ -52,18 +52,22 @@ public: m_maincpu(*this, "maincpu") { } - required_device m_maincpu; - - uint8_t m_input_mask; - - DECLARE_READ8_MEMBER(forte2_ay8910_read_input); - DECLARE_WRITE8_MEMBER(forte2_ay8910_set_input_mask); DECLARE_DRIVER_INIT(pesadelo); + void pesadelo(machine_config &config); + +protected: virtual void machine_start() override; virtual void machine_reset() override; - void pesadelo(machine_config &config); void io_mem(address_map &map); void program_mem(address_map &map); + + DECLARE_READ8_MEMBER(forte2_ay8910_read_input); + DECLARE_WRITE8_MEMBER(forte2_ay8910_set_input_mask); + +private: + required_device m_maincpu; + + uint8_t m_input_mask; }; diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp index 8c2dfbc7470..baa131bdb67 100644 --- a/src/mame/drivers/gauntlet.cpp +++ b/src/mame/drivers/gauntlet.cpp @@ -158,14 +158,14 @@ void gauntlet_state::scanline_update(screen_device &screen, int scanline) } -MACHINE_START_MEMBER(gauntlet_state,gauntlet) +void gauntlet_state::machine_start() { atarigen_state::machine_start(); save_item(NAME(m_sound_reset_val)); } -MACHINE_RESET_MEMBER(gauntlet_state,gauntlet) +void gauntlet_state::machine_reset() { m_sound_reset_val = 1; @@ -491,14 +491,11 @@ MACHINE_CONFIG_START(gauntlet_state::gauntlet_base) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68010, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gauntlet_state, video_int_gen) MCFG_CPU_ADD("audiocpu", M6502, ATARI_CLOCK_14MHz/8) MCFG_CPU_PROGRAM_MAP(sound_map) - MCFG_MACHINE_START_OVERRIDE(gauntlet_state,gauntlet) - MCFG_MACHINE_RESET_OVERRIDE(gauntlet_state,gauntlet) - MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -523,10 +520,8 @@ MACHINE_CONFIG_START(gauntlet_state::gauntlet_base) MCFG_SCREEN_UPDATE_DRIVER(gauntlet_state, screen_update_gauntlet) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(gauntlet_state,gauntlet) - /* sound hardware */ - MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "audiocpu", WRITELINE(gauntlet_state, sound_int_write_line)) MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_YM2151_ADD("ymsnd", ATARI_CLOCK_14MHz/4) diff --git a/src/mame/drivers/imds.cpp b/src/mame/drivers/imds.cpp index 8aeee36492c..5ea17f04a02 100644 --- a/src/mame/drivers/imds.cpp +++ b/src/mame/drivers/imds.cpp @@ -26,23 +26,27 @@ real hardware. class imds_state : public driver_device { public: - imds_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + imds_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_terminal(*this, TERMINAL_TAG) { } - required_device m_maincpu; - required_device m_terminal; + void imds(machine_config &config); + +protected: DECLARE_READ8_MEMBER(term_r); DECLARE_READ8_MEMBER(term_status_r); void kbd_put(u8 data); uint8_t m_term_data; virtual void machine_reset() override; - void imds(machine_config &config); void imds_io(address_map &map); void imds_mem(address_map &map); + +private: + required_device m_maincpu; + required_device m_terminal; }; READ8_MEMBER( imds_state::term_status_r ) @@ -93,7 +97,7 @@ void imds_state::machine_reset() MACHINE_CONFIG_START(imds_state::imds) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", I8080, XTAL(4'000'000)) // no idea of clock. + MCFG_CPU_ADD("maincpu", I8080, 4_MHz_XTAL) // no idea of clock. MCFG_CPU_PROGRAM_MAP(imds_mem) MCFG_CPU_IO_MAP(imds_io) diff --git a/src/mame/drivers/klax.cpp b/src/mame/drivers/klax.cpp index 94cc87677a6..85cbfd53d50 100644 --- a/src/mame/drivers/klax.cpp +++ b/src/mame/drivers/klax.cpp @@ -65,7 +65,7 @@ WRITE16_MEMBER(klax_state::interrupt_ack_w) * *************************************/ -MACHINE_RESET_MEMBER(klax_state,klax) +void klax_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 32); @@ -196,9 +196,7 @@ MACHINE_CONFIG_START(klax_state::klax) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(klax_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) - - MCFG_MACHINE_RESET_OVERRIDE(klax_state,klax) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", klax_state, video_int_gen) MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -223,8 +221,6 @@ MACHINE_CONFIG_START(klax_state::klax) MCFG_SCREEN_UPDATE_DRIVER(klax_state, screen_update_klax) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(klax_state,klax) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -238,6 +234,7 @@ ADDRESS_MAP_END MACHINE_CONFIG_START(klax_state::klax2bl) klax(config); + MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(klax2bl_map) diff --git a/src/mame/drivers/lb186.cpp b/src/mame/drivers/lb186.cpp index 27eab5f7754..419ac7cccbe 100644 --- a/src/mame/drivers/lb186.cpp +++ b/src/mame/drivers/lb186.cpp @@ -23,19 +23,22 @@ public: { } - required_device m_maincpu; - required_device m_fdc; - required_device m_scsi; + void lb186(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(sio_out_w); DECLARE_WRITE8_MEMBER(drive_sel_w); DECLARE_READ8_MEMBER(scsi_dack_r); DECLARE_WRITE8_MEMBER(scsi_dack_w); DECLARE_FLOPPY_FORMATS( floppy_formats ); - void lb186(machine_config &config); static void ncr5380(device_t *device); void lb186_io(address_map &map); void lb186_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_fdc; + required_device m_scsi; }; WRITE8_MEMBER(lb186_state::scsi_dack_w) @@ -127,7 +130,7 @@ FLOPPY_FORMATS_MEMBER( lb186_state::floppy_formats ) FLOPPY_FORMATS_END MACHINE_CONFIG_START(lb186_state::lb186) - MCFG_CPU_ADD("maincpu", I80186, XTAL(16'000'000) / 2) + MCFG_CPU_ADD("maincpu", I80186, 16_MHz_XTAL / 2) MCFG_CPU_PROGRAM_MAP(lb186_map) MCFG_CPU_IO_MAP(lb186_io) @@ -142,7 +145,7 @@ MACHINE_CONFIG_START(lb186_state::lb186) MCFG_RS232_PORT_ADD("rs232_2", default_rs232_devices, nullptr) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("duart", scn2681_device, rx_b_w)) - MCFG_WD1772_ADD("fdc", XTAL(16'000'000)/2) + MCFG_WD1772_ADD("fdc", 16_MHz_XTAL / 2) MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, int2_w)) MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, drq0_w)) MCFG_FLOPPY_DRIVE_ADD("fdc:0", lb186_floppies, "525dd", lb186_state::floppy_formats) diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp index e4a64c63d1e..ed0db8e51dc 100644 --- a/src/mame/drivers/looping.cpp +++ b/src/mame/drivers/looping.cpp @@ -106,8 +106,8 @@ L056-6 9A " " VLI-8-4 7A " class looping_state : public driver_device { public: - looping_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + looping_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_spriteram(*this, "spriteram"), @@ -117,17 +117,13 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), - m_watchdog(*this, "watchdog") { } + m_watchdog(*this, "watchdog") + { } - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - uint8_t m_cop_port_l; - - /* tilemaps */ - tilemap_t * m_bg_tilemap; + DECLARE_DRIVER_INIT(looping); + void looping(machine_config &config); +protected: DECLARE_WRITE_LINE_MEMBER(flip_screen_x_w); DECLARE_WRITE_LINE_MEMBER(flip_screen_y_w); DECLARE_WRITE8_MEMBER(looping_videoram_w); @@ -151,15 +147,30 @@ public: DECLARE_WRITE8_MEMBER(looping_sound_sw); DECLARE_WRITE_LINE_MEMBER(ay_enable_w); DECLARE_WRITE_LINE_MEMBER(speech_enable_w); - DECLARE_DRIVER_INIT(looping); TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; DECLARE_PALETTE_INIT(looping); uint32_t screen_update_looping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(looping_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + void looping_io_map(address_map &map); + void looping_map(address_map &map); + void looping_sound_io_map(address_map &map); + void looping_sound_map(address_map &map); + +private: + /* memory pointers */ + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + uint8_t m_cop_port_l; + + /* tilemaps */ + tilemap_t * m_bg_tilemap; + required_device m_maincpu; required_device m_audiocpu; required_device m_dac; @@ -167,11 +178,6 @@ public: required_device m_palette; required_device m_soundlatch; required_device m_watchdog; - void looping(machine_config &config); - void looping_io_map(address_map &map); - void looping_map(address_map &map); - void looping_sound_io_map(address_map &map); - void looping_sound_map(address_map &map); }; diff --git a/src/mame/drivers/manohman.cpp b/src/mame/drivers/manohman.cpp index 01f943cc6aa..0e5d765a4b2 100644 --- a/src/mame/drivers/manohman.cpp +++ b/src/mame/drivers/manohman.cpp @@ -144,20 +144,22 @@ class manohman_state : public driver_device { public: - manohman_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + manohman_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_duart(*this, "duart"), m_pit(*this, "pit") { } - IRQ_CALLBACK_MEMBER(iack_handler); - void manohman(machine_config &config); - void mem_map(address_map &map); -private: + +protected: virtual void machine_start() override; + void mem_map(address_map &map); + + IRQ_CALLBACK_MEMBER(iack_handler); +private: required_device m_maincpu; required_device m_duart; required_device m_pit; diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp index 0b0a5a35c56..26412b7797e 100644 --- a/src/mame/drivers/mediagx.cpp +++ b/src/mame/drivers/mediagx.cpp @@ -99,8 +99,75 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_ports(*this, {"IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8"}) - { } + m_ports(*this, "IN%u", 0U) + { } + + DECLARE_DRIVER_INIT(a51site4); + void mediagx(machine_config &config); + +protected: + DECLARE_READ32_MEMBER(disp_ctrl_r); + DECLARE_WRITE32_MEMBER(disp_ctrl_w); + DECLARE_READ32_MEMBER(memory_ctrl_r); + DECLARE_WRITE32_MEMBER(memory_ctrl_w); + DECLARE_READ32_MEMBER(biu_ctrl_r); + DECLARE_WRITE32_MEMBER(biu_ctrl_w); + DECLARE_READ32_MEMBER(parallel_port_r); + DECLARE_WRITE32_MEMBER(parallel_port_w); + DECLARE_READ32_MEMBER(ad1847_r); + DECLARE_WRITE32_MEMBER(ad1847_w); + DECLARE_READ8_MEMBER(io20_r); + DECLARE_WRITE8_MEMBER(io20_w); + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + uint32_t screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_READ32_MEMBER(speedup0_r); + DECLARE_READ32_MEMBER(speedup1_r); + DECLARE_READ32_MEMBER(speedup2_r); + DECLARE_READ32_MEMBER(speedup3_r); + DECLARE_READ32_MEMBER(speedup4_r); + DECLARE_READ32_MEMBER(speedup5_r); + DECLARE_READ32_MEMBER(speedup6_r); + DECLARE_READ32_MEMBER(speedup7_r); + DECLARE_READ32_MEMBER(speedup8_r); + DECLARE_READ32_MEMBER(speedup9_r); + DECLARE_READ32_MEMBER(speedup10_r); + DECLARE_READ32_MEMBER(speedup11_r); + TIMER_DEVICE_CALLBACK_MEMBER(sound_timer_callback); + void draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y); + void draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cliprect); + void draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect); + void ad1847_reg_write(int reg, uint8_t data); + inline uint32_t generic_speedup(address_space &space, int idx); + void report_speedups(); + void install_speedups(const speedup_entry *entries, int count); + void init_mediagx(); + void mediagx_io(address_map &map); + void mediagx_map(address_map &map); + void ramdac_map(address_map &map); + +private: + static uint32_t cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) + { + mediagx_state *state = busdevice->machine().driver_data(); + + //osd_printf_debug("CX5510: PCI read %d, %02X, %08X\n", function, reg, mem_mask); + switch (reg) + { + case 0: return 0x00001078; + } + + return state->m_cx5510_regs[reg/4]; + } + + static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) + { + mediagx_state *state = busdevice->machine().driver_data(); + + //osd_printf_debug("CX5510: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask); + COMBINE_DATA(state->m_cx5510_regs + (reg/4)); + } required_device m_ide; required_shared_ptr m_main_ram; @@ -152,48 +219,8 @@ public: uint32_t m_speedup_hits[12]; int m_speedup_count; #endif - DECLARE_READ32_MEMBER(disp_ctrl_r); - DECLARE_WRITE32_MEMBER(disp_ctrl_w); - DECLARE_READ32_MEMBER(memory_ctrl_r); - DECLARE_WRITE32_MEMBER(memory_ctrl_w); - DECLARE_READ32_MEMBER(biu_ctrl_r); - DECLARE_WRITE32_MEMBER(biu_ctrl_w); - DECLARE_READ32_MEMBER(parallel_port_r); - DECLARE_WRITE32_MEMBER(parallel_port_w); - DECLARE_READ32_MEMBER(ad1847_r); - DECLARE_WRITE32_MEMBER(ad1847_w); - DECLARE_READ8_MEMBER(io20_r); - DECLARE_WRITE8_MEMBER(io20_w); - DECLARE_DRIVER_INIT(a51site4); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - DECLARE_READ32_MEMBER(speedup0_r); - DECLARE_READ32_MEMBER(speedup1_r); - DECLARE_READ32_MEMBER(speedup2_r); - DECLARE_READ32_MEMBER(speedup3_r); - DECLARE_READ32_MEMBER(speedup4_r); - DECLARE_READ32_MEMBER(speedup5_r); - DECLARE_READ32_MEMBER(speedup6_r); - DECLARE_READ32_MEMBER(speedup7_r); - DECLARE_READ32_MEMBER(speedup8_r); - DECLARE_READ32_MEMBER(speedup9_r); - DECLARE_READ32_MEMBER(speedup10_r); - DECLARE_READ32_MEMBER(speedup11_r); - TIMER_DEVICE_CALLBACK_MEMBER(sound_timer_callback); - void draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y); - void draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void ad1847_reg_write(int reg, uint8_t data); - inline uint32_t generic_speedup(address_space &space, int idx); - void report_speedups(); - void install_speedups(const speedup_entry *entries, int count); - void init_mediagx(); - void mediagx(machine_config &config); - void mediagx_io(address_map &map); - void mediagx_map(address_map &map); - void ramdac_map(address_map &map); + + static const read32_delegate s_speedup_handlers[]; }; // Display controller registers @@ -637,27 +664,6 @@ WRITE32_MEMBER(mediagx_state::parallel_port_w) } } -static uint32_t cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) -{ - mediagx_state *state = busdevice->machine().driver_data(); - - //osd_printf_debug("CX5510: PCI read %d, %02X, %08X\n", function, reg, mem_mask); - switch (reg) - { - case 0: return 0x00001078; - } - - return state->m_cx5510_regs[reg/4]; -} - -static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) -{ - mediagx_state *state = busdevice->machine().driver_data(); - - //osd_printf_debug("CX5510: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask); - COMBINE_DATA(state->m_cx5510_regs + (reg/4)); -} - /* Analog Devices AD1847 Stereo DAC */ TIMER_DEVICE_CALLBACK_MEMBER(mediagx_state::sound_timer_callback) @@ -947,11 +953,11 @@ READ32_MEMBER(mediagx_state::speedup9_r) { return generic_speedup(space, 9); } READ32_MEMBER(mediagx_state::speedup10_r) { return generic_speedup(space, 10); } READ32_MEMBER(mediagx_state::speedup11_r) { return generic_speedup(space, 11); } -static const struct { read32_delegate func; } speedup_handlers[] = +const read32_delegate mediagx_state::s_speedup_handlers[] { - { read32_delegate(FUNC(mediagx_state::speedup0_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup1_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup2_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup3_r),(mediagx_state*)nullptr) }, - { read32_delegate(FUNC(mediagx_state::speedup4_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup5_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup6_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup7_r),(mediagx_state*)nullptr) }, - { read32_delegate(FUNC(mediagx_state::speedup8_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup9_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup10_r),(mediagx_state*)nullptr) }, { read32_delegate(FUNC(mediagx_state::speedup11_r),(mediagx_state*)nullptr) } + { FUNC(mediagx_state::speedup0_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup1_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup2_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup3_r), (mediagx_state*)nullptr }, + { FUNC(mediagx_state::speedup4_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup5_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup6_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup7_r), (mediagx_state*)nullptr }, + { FUNC(mediagx_state::speedup8_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup9_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup10_r), (mediagx_state*)nullptr }, { FUNC(mediagx_state::speedup11_r), (mediagx_state*)nullptr } }; #ifdef MAME_DEBUG @@ -968,13 +974,13 @@ void mediagx_state::install_speedups(const speedup_entry *entries, int count) { int i; - assert(count < ARRAY_LENGTH(speedup_handlers)); + assert(count < ARRAY_LENGTH(s_speedup_handlers)); m_speedup_table = entries; m_speedup_count = count; for (i = 0; i < count; i++) { - read32_delegate func = speedup_handlers[i].func; + read32_delegate func = s_speedup_handlers[i]; func.late_bind(*this); m_maincpu->space(AS_PROGRAM).install_read_handler(entries[i].offset, entries[i].offset + 3, func); } diff --git a/src/mame/drivers/meijinsn.cpp b/src/mame/drivers/meijinsn.cpp index 5ccd9ccae50..7bc51aec904 100644 --- a/src/mame/drivers/meijinsn.cpp +++ b/src/mame/drivers/meijinsn.cpp @@ -73,43 +73,43 @@ SOFT PSG & VOICE BY M.C & S.H class meijinsn_state : public driver_device { public: - meijinsn_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + meijinsn_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this,"maincpu"), m_soundlatch(*this, "soundlatch"), m_videoram(*this, "videoram"), - m_shared_ram(*this, "shared_ram"){ } + m_shared_ram(*this, "shared_ram") + { } + void meijinsn(machine_config &config); + +protected: + DECLARE_WRITE16_MEMBER(sound_w); + DECLARE_READ16_MEMBER(alpha_mcu_r); + DECLARE_PALETTE_INIT(meijinsn); + uint32_t screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_DEVICE_CALLBACK_MEMBER(meijinsn_interrupt); + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + void meijinsn_map(address_map &map); + void meijinsn_sound_io_map(address_map &map); + void meijinsn_sound_map(address_map &map); + +private: required_device m_maincpu; required_device m_soundlatch; /* memory pointers */ required_shared_ptr m_videoram; required_shared_ptr m_shared_ram; - /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - uint8_t m_bg_bank; - /* misc */ uint8_t m_deposits1; uint8_t m_deposits2; uint8_t m_credits; uint8_t m_coinvalue; int m_mcu_latch; - - DECLARE_WRITE16_MEMBER(sound_w); - DECLARE_READ16_MEMBER(alpha_mcu_r); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - DECLARE_PALETTE_INIT(meijinsn); - uint32_t screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(meijinsn_interrupt); - void meijinsn(machine_config &config); - void meijinsn_map(address_map &map); - void meijinsn_sound_io_map(address_map &map); - void meijinsn_sound_map(address_map &map); }; diff --git a/src/mame/drivers/mgolf.cpp b/src/mame/drivers/mgolf.cpp index b8f8fcf5c97..f6a475553cd 100644 --- a/src/mame/drivers/mgolf.cpp +++ b/src/mame/drivers/mgolf.cpp @@ -18,33 +18,18 @@ public: TIMER_INTERRUPT }; - mgolf_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + mgolf_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_video_ram(*this, "video_ram") { } + m_video_ram(*this, "video_ram") + { } - /* devices */ - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - /* memory pointers */ - required_shared_ptr m_video_ram; - - /* video-related */ - tilemap_t* m_bg_tilemap; - - /* misc */ - uint8_t m_prev; - uint8_t m_mask; - attotime m_time_pushed; - attotime m_time_released; - emu_timer *m_interrupt_timer; + void mgolf(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(vram_w); DECLARE_READ8_MEMBER(wram_r); DECLARE_READ8_MEMBER(dial_r); @@ -53,22 +38,40 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; DECLARE_PALETTE_INIT(mgolf); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(interrupt_callback); - void update_plunger( ); + void update_plunger(); double calc_plunger_pos(); - void mgolf(machine_config &config); - void cpu_map(address_map &map); -protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void cpu_map(address_map &map); + +private: + /* devices */ + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + /* memory pointers */ + required_shared_ptr m_video_ram; + + /* video-related */ + tilemap_t* m_bg_tilemap; + + /* misc */ + uint8_t m_prev; + uint8_t m_mask; + attotime m_time_pushed; + attotime m_time_released; + emu_timer *m_interrupt_timer; }; diff --git a/src/mame/drivers/mpu2.cpp b/src/mame/drivers/mpu2.cpp index 79164189700..4ca37ff12ba 100644 --- a/src/mame/drivers/mpu2.cpp +++ b/src/mame/drivers/mpu2.cpp @@ -44,15 +44,17 @@ class mpu2_state : public driver_device { public: - mpu2_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + mpu2_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") { } void mpu2(machine_config &config); - void mpu2_basemap(address_map &map); + protected: + void mpu2_basemap(address_map &map); +private: // devices required_device m_maincpu; }; diff --git a/src/mame/drivers/mpu3.cpp b/src/mame/drivers/mpu3.cpp index b0c6f88d89d..bb624a363bc 100644 --- a/src/mame/drivers/mpu3.cpp +++ b/src/mame/drivers/mpu3.cpp @@ -181,49 +181,17 @@ public: mpu3_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_reel0(*this, "reel0") - , m_reel1(*this, "reel1") - , m_reel2(*this, "reel2") - , m_reel3(*this, "reel3") + , m_reels(*this, "reel%u", 0U) , m_meters(*this, "meters") , m_vfd(*this, "vfd") { } - int m_triac_ic3; - int m_triac_ic4; - int m_triac_ic5; - int m_ic3_data; - int m_IC11G1; - int m_IC11G2A; - int m_IC11G2B; - int m_IC11GC; - int m_IC11GB; - int m_IC11GA; - - int m_ic10_output; - int m_ic11_active; - int m_ic11_output; - int m_disp_func; - - int m_ic4_input_a; - int m_aux1_input; - int m_aux2_input; - int m_input_strobe; /* IC11 74LS138 A = CA2 IC3, B = CA2 IC4, C = CA2 IC5 */ - uint8_t m_lamp_strobe; - uint8_t m_led_strobe; - int m_signal_50hz; - - const mpu3_chr_table* m_current_chr_table; - int m_prot_col; - - int m_optic_pattern; + DECLARE_DRIVER_INIT(m3hprvpr); + void mpu3base(machine_config &config); - DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; } - DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; } - DECLARE_WRITE_LINE_MEMBER(reel2_optic_cb) { if (state) m_optic_pattern |= 0x04; else m_optic_pattern &= ~0x04; } - DECLARE_WRITE_LINE_MEMBER(reel3_optic_cb) { if (state) m_optic_pattern |= 0x08; else m_optic_pattern &= ~0x08; } +protected: + template DECLARE_WRITE_LINE_MEMBER(reel_optic_cb) { if (state) m_optic_pattern |= (1 << N); else m_optic_pattern &= ~(1 << N); } - emu_timer *m_ic21_timer; DECLARE_WRITE8_MEMBER(characteriser_w); DECLARE_READ8_MEMBER(characteriser_r); DECLARE_WRITE8_MEMBER(mpu3ptm_w); @@ -249,9 +217,6 @@ public: DECLARE_READ8_MEMBER(pia_ic6_portb_r); DECLARE_WRITE8_MEMBER(pia_ic6_porta_w); DECLARE_WRITE8_MEMBER(pia_ic6_portb_w); - DECLARE_DRIVER_INIT(m3hprvpr); - virtual void machine_start() override; - virtual void machine_reset() override; TIMER_CALLBACK_MEMBER(ic21_timeout); TIMER_DEVICE_CALLBACK_MEMBER(gen_50hz); TIMER_DEVICE_CALLBACK_MEMBER(ic10_callback); @@ -260,15 +225,46 @@ public: void ic21_output(int data); void ic21_setup(); void mpu3_config_common(); + + virtual void machine_start() override; + virtual void machine_reset() override; + void mpu3_basemap(address_map &map); + +private: + int m_triac_ic3; + int m_triac_ic4; + int m_triac_ic5; + int m_ic3_data; + int m_IC11G1; + int m_IC11G2A; + int m_IC11G2B; + int m_IC11GC; + int m_IC11GB; + int m_IC11GA; + + int m_ic10_output; + int m_ic11_active; + int m_disp_func; + + int m_ic4_input_a; + int m_aux1_input; + int m_aux2_input; + int m_input_strobe; /* IC11 74LS138 A = CA2 IC3, B = CA2 IC4, C = CA2 IC5 */ + uint8_t m_lamp_strobe; + uint8_t m_led_strobe; + int m_signal_50hz; + + const mpu3_chr_table* m_current_chr_table; + int m_prot_col; + + int m_optic_pattern; + + emu_timer *m_ic21_timer; + required_device m_maincpu; - required_device m_reel0; - required_device m_reel1; - required_device m_reel2; - required_device m_reel3; + required_device_array m_reels; required_device m_meters; optional_device m_vfd; - void mpu3base(machine_config &config); - void mpu3_basemap(address_map &map); }; #define DISPLAY_PORT 0 @@ -561,14 +557,14 @@ WRITE_LINE_MEMBER(mpu3_state::pia_ic4_cb2_w) WRITE8_MEMBER(mpu3_state::pia_ic5_porta_w) { LOG(("%s: IC5 PIA Port A Set to %2x (Reel)\n", machine().describe_context(),data)); - m_reel0->update( data & 0x03); - m_reel1->update((data>>2) & 0x03); - m_reel2->update((data>>4) & 0x03); - m_reel3->update((data>>6) & 0x03); - awp_draw_reel(machine(),"reel1", *m_reel0); - awp_draw_reel(machine(),"reel2", *m_reel1); - awp_draw_reel(machine(),"reel3", *m_reel2); - awp_draw_reel(machine(),"reel4", *m_reel3); + m_reels[0]->update( data & 0x03); + m_reels[1]->update((data>>2) & 0x03); + m_reels[2]->update((data>>4) & 0x03); + m_reels[3]->update((data>>6) & 0x03); + awp_draw_reel(machine(),"reel1", *m_reels[0]); + awp_draw_reel(machine(),"reel2", *m_reels[1]); + awp_draw_reel(machine(),"reel3", *m_reels[2]); + awp_draw_reel(machine(),"reel4", *m_reels[3]); } READ8_MEMBER(mpu3_state::pia_ic5_portb_r) @@ -896,13 +892,13 @@ MACHINE_CONFIG_START(mpu3_state::mpu3base) MCFG_PIA_IRQB_HANDLER(WRITELINE(mpu3_state, cpu0_irq)) MCFG_MPU3_REEL_ADD("reel0") - MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel0_optic_cb)) + MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel_optic_cb<0>)) MCFG_MPU3_REEL_ADD("reel1") - MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel1_optic_cb)) + MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel_optic_cb<1>)) MCFG_MPU3_REEL_ADD("reel2") - MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel2_optic_cb)) + MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel_optic_cb<2>)) MCFG_MPU3_REEL_ADD("reel3") - MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel3_optic_cb)) + MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel_optic_cb<3>)) MCFG_DEVICE_ADD("meters", METERS, 0) MCFG_METERS_NUMBER(8) diff --git a/src/mame/drivers/mpu5.cpp b/src/mame/drivers/mpu5.cpp index 15cfd7aadcd..6d92559866a 100644 --- a/src/mame/drivers/mpu5.cpp +++ b/src/mame/drivers/mpu5.cpp @@ -202,25 +202,14 @@ class mpu5_state : public driver_device { public: - mpu5_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + mpu5_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") { } - uint32_t* m_cpuregion; - std::unique_ptr m_mainram; - SEC sec; - uint8_t m_led_strobe_temp; - uint8_t m_led_strobe; - uint8_t m_pic_clk; - bool m_pic_transfer_in_progress; - uint8_t m_pic_bit1; - uint8_t m_pic_data; - uint8_t m_pic_clocked_bits; - uint8_t m_pic_stored_input; - uint8_t m_pic_output_bit; - uint8_t m_input_strobe; + void mpu5(machine_config &config); +protected: DECLARE_READ32_MEMBER(mpu5_mem_r); DECLARE_WRITE32_MEMBER(mpu5_mem_w); @@ -232,13 +221,27 @@ public: DECLARE_READ32_MEMBER(pic_r); DECLARE_WRITE32_MEMBER(pic_w); - void mpu5(machine_config &config); + virtual void machine_start() override; void mpu5_map(address_map &map); -protected: + +private: + uint32_t* m_cpuregion; + std::unique_ptr m_mainram; + SEC sec; + + uint8_t m_led_strobe_temp; + uint8_t m_led_strobe; + uint8_t m_pic_clk; + bool m_pic_transfer_in_progress; + uint8_t m_pic_bit1; + uint8_t m_pic_data; + uint8_t m_pic_clocked_bits; + uint8_t m_pic_stored_input; + uint8_t m_pic_output_bit; + uint8_t m_input_strobe; // devices required_device m_maincpu; - virtual void machine_start() override; }; READ8_MEMBER(mpu5_state::asic_r8) diff --git a/src/mame/drivers/offtwall.cpp b/src/mame/drivers/offtwall.cpp index 22ed1fdcb50..7f9c560e2f8 100644 --- a/src/mame/drivers/offtwall.cpp +++ b/src/mame/drivers/offtwall.cpp @@ -43,19 +43,6 @@ void offtwall_state::update_interrupts() -/************************************* - * - * Initialization - * - *************************************/ - -MACHINE_RESET_MEMBER(offtwall_state,offtwall) -{ - atarigen_state::machine_reset(); -} - - - /************************************* * * I/O handling @@ -367,8 +354,6 @@ MACHINE_CONFIG_START(offtwall_state::offtwall) MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_MACHINE_RESET_OVERRIDE(offtwall_state,offtwall) - MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -379,7 +364,7 @@ MACHINE_CONFIG_START(offtwall_state::offtwall) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(atarigen_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(offtwall_state, scanline_int_write_line)) MCFG_ATARI_VAD_PLAYFIELD(offtwall_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_MOB(offtwall_state::s_mob_config, "gfxdecode") @@ -391,12 +376,10 @@ MACHINE_CONFIG_START(offtwall_state::offtwall) MCFG_SCREEN_UPDATE_DRIVER(offtwall_state, screen_update_offtwall) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(offtwall_state,offtwall) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_III_ADD("jsa", WRITELINE(offtwall_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("260010", 6) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_DEVICE_REMOVE("jsa:oki1") diff --git a/src/mame/drivers/patapata.cpp b/src/mame/drivers/patapata.cpp index bfcd83c2fb0..55a901af0e8 100644 --- a/src/mame/drivers/patapata.cpp +++ b/src/mame/drivers/patapata.cpp @@ -31,8 +31,8 @@ maybe close to jalmah.cpp? class patapata_state : public driver_device { public: - patapata_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + patapata_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_bg_videoram(*this, "bg_videoram"), m_fg_videoram(*this, "fg_videoram"), m_vregs(*this, "videoregs"), @@ -40,6 +40,9 @@ public: m_gfxdecode(*this, "gfxdecode") { } + void patapata(machine_config &config); + +protected: DECLARE_WRITE16_MEMBER(bg_videoram_w); DECLARE_WRITE16_MEMBER(fg_videoram_w); DECLARE_WRITE8_MEMBER(flipscreen_w); @@ -48,9 +51,7 @@ public: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void patapata(machine_config &config); void main_map(address_map &map); -protected: virtual void video_start() override; private: @@ -284,7 +285,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(patapata_state::scanline) MACHINE_CONFIG_START(patapata_state::patapata) - MCFG_CPU_ADD("maincpu", M68000, XTAL(16'000'000)) // 16 MHz XTAL, 16 MHz CPU + MCFG_CPU_ADD("maincpu", M68000, 16_MHz_XTAL) // 16 MHz XTAL, 16 MHz CPU MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", patapata_state, irq4_line_hold) // 1 + 4 valid? (4 main VBL) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", patapata_state, scanline, "screen", 0, 1) @@ -304,10 +305,10 @@ MACHINE_CONFIG_START(patapata_state::patapata) MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_OKIM6295_ADD("oki1", XTAL(16'000'000) / 4, PIN7_LOW) // not verified + MCFG_OKIM6295_ADD("oki1", 16_MHz_XTAL / 4, PIN7_LOW) // not verified MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) - MCFG_OKIM6295_ADD("oki2", XTAL(16'000'000) / 4, PIN7_LOW) // not verified + MCFG_OKIM6295_ADD("oki2", 16_MHz_XTAL / 4, PIN7_LOW) // not verified MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) MCFG_DEVICE_ADD("nmk112", NMK112, 0) // or 212? difficult to read (maybe 212 is 2* 112?) diff --git a/src/mame/drivers/pengadvb.cpp b/src/mame/drivers/pengadvb.cpp index 4d19820ec14..ddfd39bc020 100644 --- a/src/mame/drivers/pengadvb.cpp +++ b/src/mame/drivers/pengadvb.cpp @@ -43,17 +43,16 @@ class pengadvb_state : public driver_device { public: pengadvb_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_page(*this, "page%u", 0U) + , m_bank(*this, "bank%u", 0U) { } - required_device m_maincpu; - - address_map_bank_device *m_page[4]; - memory_bank *m_bank[4]; - uint8_t m_primary_slot_reg; - uint8_t m_kb_matrix_row; + DECLARE_DRIVER_INIT(pengadvb); + void pengadvb(machine_config &config); +protected: DECLARE_READ8_MEMBER(mem_r); DECLARE_WRITE8_MEMBER(mem_w); DECLARE_WRITE8_MEMBER(megarom_bank_w); @@ -64,14 +63,20 @@ public: DECLARE_READ8_MEMBER(pengadvb_ppi_port_b_r); DECLARE_WRITE8_MEMBER(pengadvb_ppi_port_c_w); - DECLARE_DRIVER_INIT(pengadvb); virtual void machine_start() override; virtual void machine_reset() override; void pengadvb_decrypt(const char* region); - void pengadvb(machine_config &config); void bank_mem(address_map &map); void io_mem(address_map &map); void program_mem(address_map &map); + +private: + required_device m_maincpu; + required_device_array m_page; + required_memory_bank_array<4> m_bank; + + uint8_t m_primary_slot_reg; + uint8_t m_kb_matrix_row; }; @@ -296,17 +301,13 @@ void pengadvb_state::pengadvb_decrypt(const char* region) // data lines swap for (int i = 0; i < memsize; i++) - { mem[i] = bitswap<8>(mem[i],7,6,5,3,4,2,1,0); - } // address line swap std::vector buf(memsize); memcpy(&buf[0], mem, memsize); for (int i = 0; i < memsize; i++) - { mem[i] = buf[bitswap<24>(i,23,22,21,20,19,18,17,16,15,14,13,5,11,10,9,8,7,6,12,4,3,2,1,0)]; - } } DRIVER_INIT_MEMBER(pengadvb_state,pengadvb) @@ -315,15 +316,8 @@ DRIVER_INIT_MEMBER(pengadvb_state,pengadvb) pengadvb_decrypt("game"); // init banks - static const char * const pagenames[] = { "page0", "page1", "page2", "page3" }; - static const char * const banknames[] = { "bank0", "bank1", "bank2", "bank3" }; for (int i = 0; i < 4; i++) - { - m_page[i] = machine().device(pagenames[i]); - - m_bank[i] = membank(banknames[i]); m_bank[i]->configure_entries(0, 0x10, memregion("game")->base(), 0x2000); - } } diff --git a/src/mame/drivers/pofo.cpp b/src/mame/drivers/pofo.cpp index d055832545b..53c700382c9 100644 --- a/src/mame/drivers/pofo.cpp +++ b/src/mame/drivers/pofo.cpp @@ -90,22 +90,16 @@ public: m_keylatch(0xff) { } - required_device m_maincpu; - required_device m_lcdc; - required_device m_dtmf; - required_device m_ccm; - required_device m_exp; - required_device m_timer_tick; - required_device m_nvram; - required_device m_ram; - required_region_ptr m_rom; - required_region_ptr m_char_rom; - required_ioport_array<8> m_y; - required_ioport m_battery; + void portfolio(machine_config &config); +protected: virtual void machine_start() override; virtual void machine_reset() override; + void portfolio_io(address_map &map); + void portfolio_lcdc(address_map &map); + void portfolio_mem(address_map &map); + void check_interrupt(); void trigger_interrupt(int level); void scan_keyboard(); @@ -147,22 +141,32 @@ public: DECLARE_WRITE_LINE_MEMBER( eint_w ); DECLARE_WRITE_LINE_MEMBER( wake_w ); - uint8_t m_ip; - uint8_t m_ie; - uint16_t m_counter; - uint8_t m_keylatch; - int m_rom_b; - DECLARE_PALETTE_INIT(portfolio); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick); TIMER_DEVICE_CALLBACK_MEMBER(system_tick); TIMER_DEVICE_CALLBACK_MEMBER(counter_tick); DECLARE_READ8_MEMBER(hd61830_rd_r); IRQ_CALLBACK_MEMBER(portfolio_int_ack); - void portfolio(machine_config &config); - void portfolio_io(address_map &map); - void portfolio_lcdc(address_map &map); - void portfolio_mem(address_map &map); + +private: + required_device m_maincpu; + required_device m_lcdc; + required_device m_dtmf; + required_device m_ccm; + required_device m_exp; + required_device m_timer_tick; + required_device m_nvram; + required_device m_ram; + required_region_ptr m_rom; + required_region_ptr m_char_rom; + required_ioport_array<8> m_y; + required_ioport m_battery; + + uint8_t m_ip; + uint8_t m_ie; + uint16_t m_counter; + uint8_t m_keylatch; + int m_rom_b; }; diff --git a/src/mame/drivers/quantum.cpp b/src/mame/drivers/quantum.cpp index cbad8357780..976a737042a 100644 --- a/src/mame/drivers/quantum.cpp +++ b/src/mame/drivers/quantum.cpp @@ -63,24 +63,29 @@ NOTE: The Atari 136002-125 PROM in the sets below wasn't dumped from an actual class quantum_state : public driver_device { public: - quantum_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + quantum_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_avg(*this, "avg") { } + m_avg(*this, "avg") + { } + void quantum(machine_config &config); + +protected: DECLARE_READ16_MEMBER(trackball_r); DECLARE_WRITE16_MEMBER(led_w); DECLARE_READ8_MEMBER(input_1_r); DECLARE_READ8_MEMBER(input_2_r); + void main_map(address_map &map); + +private: required_device m_maincpu; required_device m_avg; - void quantum(machine_config &config); - void main_map(address_map &map); }; -#define MASTER_CLOCK (XTAL(12'096'000)) -#define CLOCK_3KHZ (MASTER_CLOCK / 4096) +static constexpr XTAL MASTER_CLOCK = 12.096_MHz_XTAL; +static constexpr XTAL CLOCK_3KHZ = MASTER_CLOCK / 4096; /************************************* diff --git a/src/mame/drivers/quizshow.cpp b/src/mame/drivers/quizshow.cpp index 5bc38a8f921..7d88b7b3978 100644 --- a/src/mame/drivers/quizshow.cpp +++ b/src/mame/drivers/quizshow.cpp @@ -39,8 +39,8 @@ TODO: class quizshow_state : public driver_device { public: - quizshow_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + quizshow_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_dac(*this, "dac"), m_main_ram(*this, "main_ram"), @@ -48,17 +48,15 @@ public: m_screen(*this, "screen") { } - required_device m_maincpu; - required_device m_dac; - required_shared_ptr m_main_ram; - required_device m_gfxdecode; - required_device m_screen; + DECLARE_CUSTOM_INPUT_MEMBER(tape_headpos_r); + DECLARE_INPUT_CHANGED_MEMBER(category_select); + DECLARE_DRIVER_INIT(quizshow); + void quizshow(machine_config &config); - tilemap_t *m_tilemap; - uint32_t m_clocks; - int m_blink_state; - int m_category_enable; - int m_tape_head_pos; +protected: + virtual void machine_reset() override; + virtual void video_start() override; + void mem_map(address_map &map); DECLARE_WRITE8_MEMBER(lamps1_w); DECLARE_WRITE8_MEMBER(lamps2_w); @@ -70,17 +68,23 @@ public: DECLARE_READ_LINE_MEMBER(tape_signal_r); DECLARE_WRITE_LINE_MEMBER(flag_output_w); DECLARE_WRITE8_MEMBER(main_ram_w); - DECLARE_CUSTOM_INPUT_MEMBER(tape_headpos_r); - DECLARE_INPUT_CHANGED_MEMBER(category_select); - DECLARE_DRIVER_INIT(quizshow); TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_reset() override; - virtual void video_start() override; DECLARE_PALETTE_INIT(quizshow); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(clock_timer_cb); - void quizshow(machine_config &config); - void mem_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_dac; + required_shared_ptr m_main_ram; + required_device m_gfxdecode; + required_device m_screen; + + tilemap_t *m_tilemap; + uint32_t m_clocks; + int m_blink_state; + int m_category_enable; + int m_tape_head_pos; }; diff --git a/src/mame/drivers/rampart.cpp b/src/mame/drivers/rampart.cpp index 3415aafec32..9ffb6401fd6 100644 --- a/src/mame/drivers/rampart.cpp +++ b/src/mame/drivers/rampart.cpp @@ -65,7 +65,7 @@ void rampart_state::scanline_update(screen_device &screen, int scanline) * *************************************/ -MACHINE_RESET_MEMBER(rampart_state,rampart) +void rampart_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 32); @@ -341,12 +341,10 @@ MACHINE_CONFIG_START(rampart_state::rampart) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", rampart_state, video_int_gen) MCFG_SLAPSTIC_ADD("slapstic", 118) - MCFG_MACHINE_RESET_OVERRIDE(rampart_state,rampart) - MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -370,8 +368,6 @@ MACHINE_CONFIG_START(rampart_state::rampart) MCFG_SCREEN_UPDATE_DRIVER(rampart_state, screen_update_rampart) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(rampart_state,rampart) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/relief.cpp b/src/mame/drivers/relief.cpp index 9dfdd86a3dd..fee92c40211 100644 --- a/src/mame/drivers/relief.cpp +++ b/src/mame/drivers/relief.cpp @@ -49,7 +49,7 @@ void relief_state::update_interrupts() * *************************************/ -MACHINE_RESET_MEMBER(relief_state,relief) +void relief_state::machine_reset() { atarigen_state::machine_reset(); @@ -273,8 +273,6 @@ MACHINE_CONFIG_START(relief_state::relief) MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_MACHINE_RESET_OVERRIDE(relief_state,relief) - MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -285,7 +283,7 @@ MACHINE_CONFIG_START(relief_state::relief) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(atarigen_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(relief_state, scanline_int_write_line)) MCFG_ATARI_VAD_PLAYFIELD(relief_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(relief_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_MOB(relief_state::s_mob_config, "gfxdecode") @@ -298,8 +296,6 @@ MACHINE_CONFIG_START(relief_state::relief) MCFG_SCREEN_UPDATE_DRIVER(relief_state, screen_update_relief) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(relief_state,relief) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/rmhaihai.cpp b/src/mame/drivers/rmhaihai.cpp index 09b84f648f5..45bb8e1865c 100644 --- a/src/mame/drivers/rmhaihai.cpp +++ b/src/mame/drivers/rmhaihai.cpp @@ -40,49 +40,69 @@ TODO: class rmhaihai_state : public driver_device { public: - rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_msm(*this, "msm"), m_gfxdecode(*this, "gfxdecode"), m_colorram(*this, "colorram"), m_videoram(*this, "videoram") { } - required_device m_maincpu; - required_device m_msm; - required_device m_gfxdecode; - - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - - tilemap_t *m_bg_tilemap; - int m_keyboard_cmd; - int m_gfxbank; + DECLARE_DRIVER_INIT(rmhaihai); + void rmhaihai(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(colorram_w); DECLARE_READ8_MEMBER(keyboard_r); DECLARE_WRITE8_MEMBER(keyboard_w); DECLARE_READ8_MEMBER(samples_r); DECLARE_WRITE8_MEMBER(ctrl_w); - DECLARE_WRITE8_MEMBER(themj_rombank_w); DECLARE_WRITE8_MEMBER(adpcm_w); - DECLARE_DRIVER_INIT(rmhaihai); virtual void video_start() override; - DECLARE_MACHINE_START(themj); - DECLARE_MACHINE_RESET(themj); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TILE_GET_INFO_MEMBER(get_bg_tile_info); - void themj(machine_config &config); - void rmhaisei(machine_config &config); - void rmhaihai(machine_config &config); + void rmhaihai_io_map(address_map &map); void rmhaihai_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_msm; + required_device m_gfxdecode; + + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + + tilemap_t *m_bg_tilemap; + int m_keyboard_cmd; + int m_gfxbank; +}; + + +class rmhaisei_state : public rmhaihai_state +{ +public: + using rmhaihai_state::rmhaihai_state; + void rmhaisei(machine_config &config); +}; + + +class themj_state : public rmhaihai_state +{ +public: + using rmhaihai_state::rmhaihai_state; + void themj(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; void themj_io_map(address_map &map); void themj_map(address_map &map); + DECLARE_WRITE8_MEMBER(themj_rombank_w); }; @@ -210,20 +230,20 @@ WRITE8_MEMBER(rmhaihai_state::ctrl_w) m_gfxbank = (data & 0x40) >> 6; /* rmhaisei only */ } -WRITE8_MEMBER(rmhaihai_state::themj_rombank_w) +WRITE8_MEMBER(themj_state::themj_rombank_w) { logerror("banksw %d\n", data & 0x03); membank("bank1")->set_entry(data & 0x03); membank("bank2")->set_entry(data & 0x03); } -MACHINE_START_MEMBER(rmhaihai_state,themj) +void themj_state::machine_start() { membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); membank("bank2")->configure_entries(0, 4, memregion("maincpu")->base() + 0x12000, 0x4000); } -MACHINE_RESET_MEMBER(rmhaihai_state,themj) +void themj_state::machine_reset() { membank("bank1")->set_entry(0); membank("bank2")->set_entry(0); @@ -255,7 +275,7 @@ ADDRESS_MAP_START(rmhaihai_state::rmhaihai_io_map) AM_RANGE(0xbc0c, 0xbc0c) AM_WRITENOP // ?? ADDRESS_MAP_END -ADDRESS_MAP_START(rmhaihai_state::themj_map) +ADDRESS_MAP_START(themj_state::themj_map) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") AM_RANGE(0xa000, 0xa7ff) AM_RAM @@ -265,7 +285,7 @@ ADDRESS_MAP_START(rmhaihai_state::themj_map) AM_RANGE(0xe000, 0xffff) AM_ROM ADDRESS_MAP_END -ADDRESS_MAP_START(rmhaihai_state::themj_io_map) +ADDRESS_MAP_START(themj_state::themj_io_map) AM_RANGE(0x0000, 0x7fff) AM_READ(samples_r) AM_RANGE(0x8000, 0x8000) AM_READ(keyboard_r) AM_WRITENOP // ?? AM_RANGE(0x8001, 0x8001) AM_READNOP AM_WRITE(keyboard_w) // ?? @@ -514,7 +534,7 @@ MACHINE_CONFIG_START(rmhaihai_state::rmhaihai) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END -MACHINE_CONFIG_START(rmhaihai_state::rmhaisei) +MACHINE_CONFIG_START(rmhaisei_state::rmhaisei) rmhaihai(config); /* basic machine hardware */ @@ -525,7 +545,7 @@ MACHINE_CONFIG_START(rmhaihai_state::rmhaisei) MCFG_PALETTE_ENTRIES(0x200) MACHINE_CONFIG_END -MACHINE_CONFIG_START(rmhaihai_state::themj) +MACHINE_CONFIG_START(themj_state::themj) rmhaihai(config); /* basic machine hardware */ @@ -534,9 +554,6 @@ MACHINE_CONFIG_START(rmhaihai_state::themj) MCFG_CPU_PROGRAM_MAP(themj_map) MCFG_CPU_IO_MAP(themj_io_map) - MCFG_MACHINE_START_OVERRIDE(rmhaihai_state,themj) - MCFG_MACHINE_RESET_OVERRIDE(rmhaihai_state,themj) - MCFG_DEVICE_REMOVE("nvram") /* video hardware */ @@ -743,5 +760,5 @@ GAME( 1985, rmhaihai, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, R GAME( 1985, rmhaihai2, rmhaihai, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan, older)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai [BET] (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, themj, 0, themj, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaisei_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, themj, 0, themj, rmhaihai, themj_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/rx78.cpp b/src/mame/drivers/rx78.cpp index 10d4bceb5c3..05d806feb06 100644 --- a/src/mame/drivers/rx78.cpp +++ b/src/mame/drivers/rx78.cpp @@ -82,8 +82,12 @@ public: , m_cart(*this, "cartslot") , m_ram(*this, RAM_TAG) , m_palette(*this, "palette") - { } + { } + DECLARE_DRIVER_INIT(rx78); + void rx78(machine_config &config); + +protected: DECLARE_READ8_MEMBER( key_r ); DECLARE_READ8_MEMBER( cass_r ); DECLARE_READ8_MEMBER( vram_r ); @@ -96,19 +100,18 @@ public: DECLARE_WRITE8_MEMBER( vdp_bg_reg_w ); DECLARE_WRITE8_MEMBER( vdp_pri_mask_w ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( rx78_cart ); - DECLARE_DRIVER_INIT(rx78); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void rx78(machine_config &config); + virtual void machine_reset() override; void rx78_io(address_map &map); void rx78_mem(address_map &map); + private: uint8_t m_vram_read_bank; uint8_t m_vram_write_bank; uint8_t m_pal_reg[7]; uint8_t m_pri_mask; uint8_t m_key_mux; - virtual void machine_reset() override; required_device m_maincpu; required_device m_cass; required_device m_cart; diff --git a/src/mame/drivers/sbrkout.cpp b/src/mame/drivers/sbrkout.cpp index 2122899aed0..17d265220f6 100644 --- a/src/mame/drivers/sbrkout.cpp +++ b/src/mame/drivers/sbrkout.cpp @@ -47,26 +47,22 @@ class sbrkout_state : public driver_device { public: - sbrkout_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + sbrkout_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_outlatch(*this, "outlatch"), m_dac(*this, "dac"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } - required_shared_ptr m_videoram; - emu_timer *m_scanline_timer; - emu_timer *m_pot_timer; - tilemap_t *m_bg_tilemap; - uint8_t m_sync2_value; - uint8_t m_pot_mask[2]; - uint8_t m_pot_trigger[2]; + void sbrkout(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(irq_ack_w); - DECLARE_READ8_MEMBER(switches_r); - DECLARE_READ8_MEMBER(sbrkoutct_switches_r); + virtual DECLARE_READ8_MEMBER(switches_r); DECLARE_WRITE_LINE_MEMBER(pot_mask1_w); DECLARE_WRITE_LINE_MEMBER(pot_mask2_w); DECLARE_WRITE8_MEMBER(output_latch_w); @@ -86,19 +82,34 @@ public: TIMER_CALLBACK_MEMBER(scanline_callback); TIMER_CALLBACK_MEMBER(pot_trigger_callback); void update_nmi_state(); + void main_map(address_map &map); + +private: + required_shared_ptr m_videoram; + emu_timer *m_scanline_timer; + emu_timer *m_pot_timer; + tilemap_t *m_bg_tilemap; + uint8_t m_sync2_value; + uint8_t m_pot_mask[2]; + uint8_t m_pot_trigger[2]; + required_device m_maincpu; required_device m_outlatch; required_device m_dac; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - void sbrkoutct(machine_config &config); - void sbrkout(machine_config &config); - void main_map(address_map &map); - void sbrkoutct_main_map(address_map &map); }; +class sbrkoutct_state : public sbrkout_state +{ +public: + using sbrkout_state::sbrkout_state; + void sbrkoutct(machine_config &config); +protected: + virtual DECLARE_READ8_MEMBER(switches_r) override; +}; /************************************* @@ -107,8 +118,8 @@ public: * *************************************/ -#define MAIN_CLOCK XTAL(12'096'000) -#define TIME_4V attotime::from_hz(MAIN_CLOCK/2/256/2/4) +static constexpr XTAL MAIN_CLOCK = 12.096_MHz_XTAL; +#define TIME_4V attotime::from_hz(MAIN_CLOCK/2/256/2/4) @@ -227,7 +238,7 @@ READ8_MEMBER(sbrkout_state::switches_r) return result; } -READ8_MEMBER(sbrkout_state::sbrkoutct_switches_r) +READ8_MEMBER(sbrkoutct_state::switches_r) { uint8_t result = 0xff; @@ -423,22 +434,6 @@ ADDRESS_MAP_START(sbrkout_state::main_map) AM_RANGE(0x2800, 0x3fff) AM_ROM ADDRESS_MAP_END -ADDRESS_MAP_START(sbrkout_state::sbrkoutct_main_map) - ADDRESS_MAP_GLOBAL_MASK(0x3fff) - AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x380) AM_RAMBANK("bank1") - AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(sbrkout_videoram_w) AM_SHARE("videoram") - AM_RANGE(0x0800, 0x083f) AM_READ(sbrkoutct_switches_r) - AM_RANGE(0x0840, 0x0840) AM_MIRROR(0x003f) AM_READ_PORT("COIN") - AM_RANGE(0x0880, 0x0880) AM_MIRROR(0x003f) AM_READ_PORT("START") - AM_RANGE(0x08c0, 0x08c0) AM_MIRROR(0x003f) AM_READ_PORT("SERVICE") - AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x03ff) AM_READ(sync_r) - AM_RANGE(0x0c00, 0x0c7f) AM_WRITE(output_latch_w) - AM_RANGE(0x0c80, 0x0c80) AM_MIRROR(0x007f) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) - AM_RANGE(0x0e00, 0x0e00) AM_MIRROR(0x007f) AM_WRITE(irq_ack_w) - AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x03ff) AM_READ(sync2_r) - AM_RANGE(0x2800, 0x3fff) AM_ROM -ADDRESS_MAP_END - /************************************* * @@ -617,13 +612,11 @@ MACHINE_CONFIG_START(sbrkout_state::sbrkout) MACHINE_CONFIG_END -MACHINE_CONFIG_START(sbrkout_state::sbrkoutct) +MACHINE_CONFIG_START(sbrkoutct_state::sbrkoutct) sbrkout(config); - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(sbrkoutct_main_map) MCFG_DEVICE_MODIFY("outlatch") - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(sbrkout_state, serve_2_led_w)) + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(sbrkoutct_state, serve_2_led_w)) MACHINE_CONFIG_END /************************************* @@ -720,7 +713,7 @@ ROM_END * *************************************/ -GAMEL( 1978, sbrkout, 0, sbrkout, sbrkout, sbrkout_state, 0, ROT270, "Atari", "Super Breakout (rev 04)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) -GAMEL( 1978, sbrkout3, sbrkout, sbrkout, sbrkout, sbrkout_state, 0, ROT270, "Atari", "Super Breakout (rev 03)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) -GAMEL( 1978, sbrkoutc, sbrkout, sbrkout, sbrkoutc, sbrkout_state, 0, ROT270, "Atari", "Super Breakout (Canyon and Vertical Breakout, prototype)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) -GAMEL( 1978, sbrkoutct, sbrkout, sbrkoutct, sbrkoutct, sbrkout_state, 0, ROT270, "Atari", "Super Breakout (Cocktail, prototype)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) +GAMEL( 1978, sbrkout, 0, sbrkout, sbrkout, sbrkout_state, 0, ROT270, "Atari", "Super Breakout (rev 04)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) +GAMEL( 1978, sbrkout3, sbrkout, sbrkout, sbrkout, sbrkout_state, 0, ROT270, "Atari", "Super Breakout (rev 03)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) +GAMEL( 1978, sbrkoutc, sbrkout, sbrkout, sbrkoutc, sbrkout_state, 0, ROT270, "Atari", "Super Breakout (Canyon and Vertical Breakout, prototype)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) +GAMEL( 1978, sbrkoutct, sbrkout, sbrkoutct, sbrkoutct, sbrkoutct_state, 0, ROT270, "Atari", "Super Breakout (Cocktail, prototype)", MACHINE_SUPPORTS_SAVE, layout_sbrkout ) diff --git a/src/mame/drivers/sfkick.cpp b/src/mame/drivers/sfkick.cpp index 1c795b255fc..547162c9e88 100644 --- a/src/mame/drivers/sfkick.cpp +++ b/src/mame/drivers/sfkick.cpp @@ -189,11 +189,10 @@ public: m_dsw2(*this, "DSW2") { } - std::unique_ptr m_main_mem; - int m_bank_cfg; - int m_bank[8]; - int m_input_mux; - required_device m_v9938; + DECLARE_DRIVER_INIT(sfkick); + void sfkick(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(page0_w); DECLARE_WRITE8_MEMBER(page1_w); DECLARE_WRITE8_MEMBER(page2_w); @@ -201,11 +200,22 @@ public: DECLARE_READ8_MEMBER(ppi_port_b_r); DECLARE_WRITE8_MEMBER(ppi_port_a_w); DECLARE_WRITE8_MEMBER(ppi_port_c_w); - DECLARE_DRIVER_INIT(sfkick); virtual void machine_reset() override; void sfkick_remap_banks(); void sfkick_bank_set(int num, int data); DECLARE_WRITE_LINE_MEMBER(irqhandler); + void sfkick_io_map(address_map &map); + void sfkick_map(address_map &map); + void sfkick_sound_io_map(address_map &map); + void sfkick_sound_map(address_map &map); + +private: + std::unique_ptr m_main_mem; + int m_bank_cfg; + int m_bank[8]; + int m_input_mux; + + required_device m_v9938; required_device m_maincpu; required_device m_soundcpu; required_memory_region m_region_bios; @@ -225,11 +235,6 @@ public: required_ioport m_dial; required_ioport m_dsw1; required_ioport m_dsw2; - void sfkick(machine_config &config); - void sfkick_io_map(address_map &map); - void sfkick_map(address_map &map); - void sfkick_sound_io_map(address_map &map); - void sfkick_sound_map(address_map &map); }; diff --git a/src/mame/drivers/shougi.cpp b/src/mame/drivers/shougi.cpp index 6fdfc7d6f09..ba0ed19d55c 100644 --- a/src/mame/drivers/shougi.cpp +++ b/src/mame/drivers/shougi.cpp @@ -99,16 +99,9 @@ public: m_videoram(*this, "videoram") { } - // devices/pointers - required_device m_maincpu; - required_device m_subcpu; - required_device m_alpha_8201; - - required_shared_ptr m_videoram; - - uint8_t m_nmi_enabled; - int m_r; + void shougi(machine_config &config); +protected: DECLARE_WRITE_LINE_MEMBER(nmi_enable_w); DECLARE_READ8_MEMBER(semaphore_r); @@ -118,10 +111,20 @@ public: INTERRUPT_GEN_MEMBER(vblank_nmi); virtual void machine_start() override; - void shougi(machine_config &config); void main_map(address_map &map); void readport_sub(address_map &map); void sub_map(address_map &map); + +private: + // devices/pointers + required_device m_maincpu; + required_device m_subcpu; + required_device m_alpha_8201; + + required_shared_ptr m_videoram; + + uint8_t m_nmi_enabled; + int m_r; }; diff --git a/src/mame/drivers/shuuz.cpp b/src/mame/drivers/shuuz.cpp index eec725c9243..c332b8a1f93 100644 --- a/src/mame/drivers/shuuz.cpp +++ b/src/mame/drivers/shuuz.cpp @@ -247,7 +247,7 @@ MACHINE_CONFIG_START(shuuz_state::shuuz) MCFG_PALETTE_ADD("palette", 1024) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(atarigen_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(shuuz_state, scanline_int_write_line)) MCFG_ATARI_VAD_PLAYFIELD(shuuz_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_MOB(shuuz_state::s_mob_config, "gfxdecode") diff --git a/src/mame/drivers/skullxbo.cpp b/src/mame/drivers/skullxbo.cpp index 693715b3417..09f25f2e513 100644 --- a/src/mame/drivers/skullxbo.cpp +++ b/src/mame/drivers/skullxbo.cpp @@ -72,7 +72,7 @@ WRITE16_MEMBER(skullxbo_state::skullxbo_halt_until_hblank_0_w) } -MACHINE_RESET_MEMBER(skullxbo_state,skullxbo) +void skullxbo_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 8); @@ -230,10 +230,9 @@ MACHINE_CONFIG_START(skullxbo_state::skullxbo) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", skullxbo_state, video_int_gen) MCFG_TIMER_DRIVER_ADD("scan_timer", skullxbo_state, scanline_timer) - MCFG_MACHINE_RESET_OVERRIDE(skullxbo_state,skullxbo) MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -258,12 +257,10 @@ MACHINE_CONFIG_START(skullxbo_state::skullxbo) MCFG_SCREEN_UPDATE_DRIVER(skullxbo_state, screen_update_skullxbo) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(skullxbo_state,skullxbo) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(skullxbo_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("FF5802", 7) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/stellafr.cpp b/src/mame/drivers/stellafr.cpp index b57bc552751..2bb4021fc21 100644 --- a/src/mame/drivers/stellafr.cpp +++ b/src/mame/drivers/stellafr.cpp @@ -26,6 +26,9 @@ public: m_duart(*this, "duart") { } + void stellafr(machine_config &config); + +protected: IRQ_CALLBACK_MEMBER(irq_ack); DECLARE_WRITE8_MEMBER(write_8000c1); DECLARE_READ8_MEMBER(read_800101); @@ -33,10 +36,9 @@ public: DECLARE_WRITE8_MEMBER(duart_output_w); DECLARE_WRITE8_MEMBER(ay8910_portb_w); - void stellafr(machine_config &config); void stellafr_map(address_map &map); -protected: +private: // devices required_device m_maincpu; required_device m_duart; diff --git a/src/mame/drivers/superslave.cpp b/src/mame/drivers/superslave.cpp index b411210f136..a0313fb90f8 100644 --- a/src/mame/drivers/superslave.cpp +++ b/src/mame/drivers/superslave.cpp @@ -59,6 +59,12 @@ public: , m_cmd(0x01) { } + void superslave(machine_config &config); + +protected: + void superslave_io(address_map &map); + void superslave_mem(address_map &map); + DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); DECLARE_WRITE8_MEMBER( baud_w ); @@ -66,9 +72,6 @@ public: DECLARE_READ8_MEMBER( status_r ); DECLARE_WRITE8_MEMBER( cmd_w ); - void superslave(machine_config &config); - void superslave_io(address_map &map); - void superslave_mem(address_map &map); private: required_device m_maincpu; required_device m_dbrg; @@ -348,7 +351,7 @@ static const z80_daisy_config superslave_daisy_chain[] = //************************************************************************** //------------------------------------------------- -// MACHINE_START( superslave ) +// machine_start() //------------------------------------------------- void superslave_state::machine_start() diff --git a/src/mame/drivers/supertnk.cpp b/src/mame/drivers/supertnk.cpp index 74a4787d196..77216c33162 100644 --- a/src/mame/drivers/supertnk.cpp +++ b/src/mame/drivers/supertnk.cpp @@ -114,13 +114,14 @@ class supertnk_state : public driver_device { public: supertnk_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") { } + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } - std::unique_ptr m_videoram[3]; - uint8_t m_rom_bank; - uint8_t m_bitplane_select; - pen_t m_pens[NUM_PENS]; + DECLARE_DRIVER_INIT(supertnk); + void supertnk(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(supertnk_bankswitch_0_w); DECLARE_WRITE8_MEMBER(supertnk_bankswitch_1_w); DECLARE_WRITE8_MEMBER(supertnk_interrupt_ack_w); @@ -128,16 +129,21 @@ public: DECLARE_READ8_MEMBER(supertnk_videoram_r); DECLARE_WRITE8_MEMBER(supertnk_bitplane_select_0_w); DECLARE_WRITE8_MEMBER(supertnk_bitplane_select_1_w); - DECLARE_DRIVER_INIT(supertnk); + uint32_t screen_update_supertnk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(supertnk_interrupt); + virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - uint32_t screen_update_supertnk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(supertnk_interrupt); - required_device m_maincpu; - void supertnk(machine_config &config); void supertnk_io_map(address_map &map); void supertnk_map(address_map &map); + +private: + std::unique_ptr m_videoram[3]; + uint8_t m_rom_bank; + uint8_t m_bitplane_select; + pen_t m_pens[NUM_PENS]; + required_device m_maincpu; }; diff --git a/src/mame/drivers/sv8000.cpp b/src/mame/drivers/sv8000.cpp index 3c292cb849a..df31e3143c5 100644 --- a/src/mame/drivers/sv8000.cpp +++ b/src/mame/drivers/sv8000.cpp @@ -51,6 +51,9 @@ public: , m_io_joy(*this, "JOY") { } + void sv8000(machine_config &config); + +protected: DECLARE_DEVICE_IMAGE_LOAD_MEMBER( cart ); DECLARE_READ8_MEMBER( ay_port_a_r ); @@ -67,13 +70,12 @@ public: DECLARE_READ8_MEMBER( mc6847_videoram_r ); - void sv8000(machine_config &config); - void sv8000_io(address_map &map); - void sv8000_mem(address_map &map); -private: virtual void machine_start() override; virtual void machine_reset() override; + void sv8000_io(address_map &map); + void sv8000_mem(address_map &map); +private: required_device m_maincpu; required_device m_s68047p; required_device m_cart; diff --git a/src/mame/drivers/tamag1.cpp b/src/mame/drivers/tamag1.cpp index 1e0631f387a..65eb6c80e35 100644 --- a/src/mame/drivers/tamag1.cpp +++ b/src/mame/drivers/tamag1.cpp @@ -20,25 +20,27 @@ class tamag1_state : public driver_device { public: - tamag1_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + tamag1_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_speaker(*this, "speaker"), m_out_x(*this, "%u.%u", 0U, 0U) { } - required_device m_maincpu; - required_device m_speaker; - output_finder<16, 40> m_out_x; + DECLARE_INPUT_CHANGED_MEMBER(input_changed); + void tama(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(speaker_w); DECLARE_PALETTE_INIT(tama); - DECLARE_INPUT_CHANGED_MEMBER(input_changed); E0C6S46_PIXEL_UPDATE(pixel_update); - void tama(machine_config &config); -protected: virtual void machine_start() override; + +private: + required_device m_maincpu; + required_device m_speaker; + output_finder<16, 40> m_out_x; }; void tamag1_state::machine_start() diff --git a/src/mame/drivers/tempest.cpp b/src/mame/drivers/tempest.cpp index df4a12e4777..5426037c77a 100644 --- a/src/mame/drivers/tempest.cpp +++ b/src/mame/drivers/tempest.cpp @@ -287,8 +287,8 @@ Note: Roms for Tempest Analog Vector-Generator PCB Assembly A037383-03 or A03738 #include "speaker.h" -#define MASTER_CLOCK (XTAL(12'096'000)) -#define CLOCK_3KHZ (MASTER_CLOCK / 4096) +static constexpr XTAL MASTER_CLOCK = 12.096_MHz_XTAL; +static constexpr XTAL CLOCK_3KHZ = MASTER_CLOCK / 4096; #define TEMPEST_KNOB_P1_TAG "KNOBP1" #define TEMPEST_KNOB_P2_TAG "KNOBP2" @@ -313,6 +313,24 @@ public: m_in2(*this, "IN2") { } + DECLARE_CUSTOM_INPUT_MEMBER(tempest_knob_r); + DECLARE_CUSTOM_INPUT_MEMBER(tempest_buttons_r); + DECLARE_CUSTOM_INPUT_MEMBER(clock_r); + void tempest(machine_config &config); + +protected: + DECLARE_WRITE8_MEMBER(wdclr_w); + DECLARE_WRITE8_MEMBER(tempest_led_w); + DECLARE_WRITE8_MEMBER(tempest_coin_w); + DECLARE_READ8_MEMBER(input_port_1_bit_r); + DECLARE_READ8_MEMBER(input_port_2_bit_r); + + DECLARE_READ8_MEMBER(rom_ae1f_r); + + virtual void machine_start() override; + void main_map(address_map &map); + +private: required_device m_maincpu; required_device m_mathbox; required_device m_watchdog; @@ -327,20 +345,6 @@ public: required_ioport m_in2; uint8_t m_player_select; - DECLARE_WRITE8_MEMBER(wdclr_w); - DECLARE_WRITE8_MEMBER(tempest_led_w); - DECLARE_WRITE8_MEMBER(tempest_coin_w); - DECLARE_CUSTOM_INPUT_MEMBER(tempest_knob_r); - DECLARE_CUSTOM_INPUT_MEMBER(tempest_buttons_r); - DECLARE_CUSTOM_INPUT_MEMBER(clock_r); - DECLARE_READ8_MEMBER(input_port_1_bit_r); - DECLARE_READ8_MEMBER(input_port_2_bit_r); - - DECLARE_READ8_MEMBER(rom_ae1f_r); - - virtual void machine_start() override; - void tempest(machine_config &config); - void main_map(address_map &map); }; diff --git a/src/mame/drivers/thunderj.cpp b/src/mame/drivers/thunderj.cpp index 79e582c77b1..3765a7a5b41 100644 --- a/src/mame/drivers/thunderj.cpp +++ b/src/mame/drivers/thunderj.cpp @@ -59,19 +59,13 @@ void thunderj_state::update_interrupts() } -MACHINE_START_MEMBER(thunderj_state,thunderj) +void thunderj_state::machine_start() { atarigen_state::machine_start(); save_item(NAME(m_alpha_tile_bank)); } -MACHINE_RESET_MEMBER(thunderj_state,thunderj) -{ - atarigen_state::machine_reset(); -} - - /************************************* * @@ -256,9 +250,6 @@ MACHINE_CONFIG_START(thunderj_state::thunderj) MCFG_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(extra_map) - MCFG_MACHINE_START_OVERRIDE(thunderj_state,thunderj) - MCFG_MACHINE_RESET_OVERRIDE(thunderj_state,thunderj) - MCFG_EEPROM_2816_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -272,7 +263,7 @@ MACHINE_CONFIG_START(thunderj_state::thunderj) MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) - MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(atarigen_state, scanline_int_write_line)) + MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(thunderj_state, scanline_int_write_line)) MCFG_ATARI_VAD_PLAYFIELD(thunderj_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(thunderj_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_ALPHA(thunderj_state, "gfxdecode", get_alpha_tile_info) @@ -286,12 +277,10 @@ MACHINE_CONFIG_START(thunderj_state::thunderj) MCFG_SCREEN_UPDATE_DRIVER(thunderj_state, screen_update_thunderj) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(thunderj_state,thunderj) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_II_ADD("jsa", WRITELINE(thunderj_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("260012", 1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END diff --git a/src/mame/drivers/tomcat.cpp b/src/mame/drivers/tomcat.cpp index 2dfb94c5302..64d3c50a89b 100644 --- a/src/mame/drivers/tomcat.cpp +++ b/src/mame/drivers/tomcat.cpp @@ -46,20 +46,18 @@ class tomcat_state : public driver_device { public: - tomcat_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + tomcat_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_tms(*this, "tms"), m_shared_ram(*this, "shared_ram"), m_maincpu(*this, "maincpu"), m_dsp(*this, "dsp"), - m_mainlatch(*this, "mainlatch") { } + m_mainlatch(*this, "mainlatch") + { } - required_device m_tms; - int m_control_num; - required_shared_ptr m_shared_ram; - uint8_t m_nvram[0x800]; - int m_dsp_BIO; - int m_dsp_idle; + void tomcat(machine_config &config); + +protected: DECLARE_WRITE16_MEMBER(tomcat_adcon_w); DECLARE_READ16_MEMBER(tomcat_adcread_r); DECLARE_READ16_MEMBER(tomcat_inputs_r); @@ -80,13 +78,20 @@ public: DECLARE_READ_LINE_MEMBER(dsp_BIO_r); DECLARE_WRITE8_MEMBER(soundlatches_w); virtual void machine_start() override; - required_device m_maincpu; - required_device m_dsp; - required_device m_mainlatch; - void tomcat(machine_config &config); void dsp_map(address_map &map); void sound_map(address_map &map); void tomcat_map(address_map &map); +private: + required_device m_tms; + int m_control_num; + required_shared_ptr m_shared_ram; + uint8_t m_nvram[0x800]; + int m_dsp_BIO; + int m_dsp_idle; + + required_device m_maincpu; + required_device m_dsp; + required_device m_mainlatch; }; @@ -324,12 +329,12 @@ void tomcat_state::machine_start() } MACHINE_CONFIG_START(tomcat_state::tomcat) - MCFG_CPU_ADD("maincpu", M68010, XTAL(12'000'000) / 2) + MCFG_CPU_ADD("maincpu", M68010, 12_MHz_XTAL / 2) MCFG_CPU_PROGRAM_MAP(tomcat_map) MCFG_CPU_PERIODIC_INT_DRIVER(tomcat_state, irq1_line_assert, 5*60) //MCFG_CPU_PERIODIC_INT_DRIVER(tomcat_state, irq1_line_assert, (double)XTAL(12'000'000) / 16 / 16 / 16 / 12) - MCFG_CPU_ADD("dsp", TMS32010, XTAL(16'000'000)) + MCFG_CPU_ADD("dsp", TMS32010, 16_MHz_XTAL) MCFG_CPU_PROGRAM_MAP( dsp_map) MCFG_TMS32010_BIO_IN_CB(READLINE(tomcat_state, dsp_BIO_r)) diff --git a/src/mame/drivers/toobin.cpp b/src/mame/drivers/toobin.cpp index cf630d1d1db..2d15371f2f7 100644 --- a/src/mame/drivers/toobin.cpp +++ b/src/mame/drivers/toobin.cpp @@ -27,7 +27,7 @@ #include "machine/watchdog.h" #include "speaker.h" -#define MASTER_CLOCK XTAL(32'000'000) +static constexpr XTAL MASTER_CLOCK = 32_MHz_XTAL; @@ -45,12 +45,6 @@ void toobin_state::update_interrupts() } -MACHINE_RESET_MEMBER(toobin_state,toobin) -{ - atarigen_state::machine_reset(); -} - - /************************************* * @@ -202,8 +196,6 @@ MACHINE_CONFIG_START(toobin_state::toobin) MCFG_CPU_ADD("maincpu", M68010, MASTER_CLOCK/4) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_MACHINE_RESET_OVERRIDE(toobin_state,toobin) - MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -224,12 +216,10 @@ MACHINE_CONFIG_START(toobin_state::toobin) MCFG_GFXDECODE_ADD("gfxdecode", "palette", toobin) MCFG_PALETTE_ADD("palette", 1024) - MCFG_VIDEO_START_OVERRIDE(toobin_state,toobin) - /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(toobin_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("FF9000", 12) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) diff --git a/src/mame/drivers/tourtabl.cpp b/src/mame/drivers/tourtabl.cpp index 4963e8cb0df..e1a0a8c300a 100644 --- a/src/mame/drivers/tourtabl.cpp +++ b/src/mame/drivers/tourtabl.cpp @@ -21,17 +21,21 @@ class tourtabl_state : public driver_device { public: - tourtabl_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") { } + tourtabl_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } - required_device m_maincpu; + void tourtabl(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(tourtabl_led_w); DECLARE_READ16_MEMBER(tourtabl_read_input_port); DECLARE_READ8_MEMBER(tourtabl_get_databus_contents); - void tourtabl(machine_config &config); void main_map(address_map &map); + +private: + required_device m_maincpu; }; diff --git a/src/mame/drivers/unixpc.cpp b/src/mame/drivers/unixpc.cpp index 5928a443939..a52392e00af 100644 --- a/src/mame/drivers/unixpc.cpp +++ b/src/mame/drivers/unixpc.cpp @@ -32,23 +32,20 @@ class unixpc_state : public driver_device { public: - unixpc_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_ram(*this, RAM_TAG), - m_wd2797(*this, "wd2797"), - m_floppy(*this, "wd2797:0:525dd"), - m_ramrombank(*this, "ramrombank"), - m_mapram(*this, "mapram"), - m_videoram(*this, "videoram") + unixpc_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_ram(*this, RAM_TAG), + m_wd2797(*this, "wd2797"), + m_floppy(*this, "wd2797:0:525dd"), + m_ramrombank(*this, "ramrombank"), + m_mapram(*this, "mapram"), + m_videoram(*this, "videoram") { } - required_device m_maincpu; - required_device m_ram; - required_device m_wd2797; - required_device m_floppy; - required_device m_ramrombank; + void unixpc(machine_config &config); +protected: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_start() override; @@ -72,13 +69,19 @@ public: DECLARE_WRITE_LINE_MEMBER( wd2797_intrq_w ); DECLARE_WRITE_LINE_MEMBER( wd2797_drq_w ); - required_shared_ptr m_mapram; - required_shared_ptr m_videoram; - - void unixpc(machine_config &config); void ramrombank_map(address_map &map); void unixpc_mem(address_map &map); + private: + required_device m_maincpu; + required_device m_ram; + required_device m_wd2797; + required_device m_floppy; + required_device m_ramrombank; + + required_shared_ptr m_mapram; + required_shared_ptr m_videoram; + uint16_t *m_ramptr; uint32_t m_ramsize; uint16_t m_diskdmasize; diff --git a/src/mame/drivers/vertigo.cpp b/src/mame/drivers/vertigo.cpp index a6c845c6d92..47339d6106a 100644 --- a/src/mame/drivers/vertigo.cpp +++ b/src/mame/drivers/vertigo.cpp @@ -125,24 +125,24 @@ INPUT_PORTS_END MACHINE_CONFIG_START(vertigo_state::vertigo) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(24'000'000) / 3) + MCFG_CPU_ADD("maincpu", M68000, 24_MHz_XTAL / 3) MCFG_CPU_PROGRAM_MAP(vertigo_map) MCFG_CPU_PERIODIC_INT_DRIVER(vertigo_state, vertigo_interrupt, 60) exidy440_audio(config); MCFG_DEVICE_ADD("pit", PIT8254, 0) - MCFG_PIT8253_CLK0(XTAL(24'000'000) / 100) + MCFG_PIT8253_CLK0(24_MHz_XTAL / 100) MCFG_PIT8253_OUT0_HANDLER(WRITELINE(vertigo_state, v_irq4_w)) - MCFG_PIT8253_CLK1(XTAL(24'000'000) / 100) + MCFG_PIT8253_CLK1(24_MHz_XTAL / 100) MCFG_PIT8253_OUT1_HANDLER(WRITELINE(vertigo_state, v_irq3_w)) - MCFG_PIT8253_CLK2(XTAL(24'000'000) / 100) + MCFG_PIT8253_CLK2(24_MHz_XTAL / 100) MCFG_DEVICE_ADD("74148", TTL74148, 0) MCFG_74148_OUTPUT_CB(vertigo_state, update_irq) /* motor controller */ - MCFG_CPU_ADD("motorcpu", M68705P3, XTAL(24'000'000) / 6) + MCFG_CPU_ADD("motorcpu", M68705P3, 24_MHz_XTAL / 6) MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/vindictr.cpp b/src/mame/drivers/vindictr.cpp index 4df95846ef7..822774feafc 100644 --- a/src/mame/drivers/vindictr.cpp +++ b/src/mame/drivers/vindictr.cpp @@ -42,7 +42,7 @@ void vindictr_state::update_interrupts() } -MACHINE_RESET_MEMBER(vindictr_state,vindictr) +void vindictr_state::machine_reset() { atarigen_state::machine_reset(); scanline_timer_reset(*m_screen, 8); @@ -188,8 +188,6 @@ MACHINE_CONFIG_START(vindictr_state::vindictr) MCFG_CPU_ADD("maincpu", M68010, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_MACHINE_RESET_OVERRIDE(vindictr_state,vindictr) - MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -212,12 +210,10 @@ MACHINE_CONFIG_START(vindictr_state::vindictr) MCFG_SCREEN_UPDATE_DRIVER(vindictr_state, screen_update_vindictr) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(vindictr_state,vindictr) - /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(vindictr_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("260010", 1) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) diff --git a/src/mame/drivers/wswan.cpp b/src/mame/drivers/wswan.cpp index 1a27586bce2..d60205c3ae1 100644 --- a/src/mame/drivers/wswan.cpp +++ b/src/mame/drivers/wswan.cpp @@ -49,7 +49,7 @@ ADDRESS_MAP_START(wswan_state::wswan_mem) AM_RANGE(0xf0000, 0xfffff) AM_READ(bios_r) ADDRESS_MAP_END -ADDRESS_MAP_START(wswan_state::wscolor_mem) +ADDRESS_MAP_START(wscolor_state::wscolor_mem) AM_RANGE(0x00000, 0x0ffff) AM_DEVREADWRITE("vdp", wswan_video_device, vram_r, vram_w) // 16kb RAM / 4 colour tiles, 16 colour tiles + palettes //AM_RANGE(0x10000, 0xeffff) // cart range, setup at machine_start AM_RANGE(0xf0000, 0xfffff) AM_READ(bios_r) @@ -91,7 +91,7 @@ PALETTE_INIT_MEMBER(wswan_state, wswan) } } -PALETTE_INIT_MEMBER(wswan_state, wscolor) +PALETTE_INIT_MEMBER(wscolor_state, wscolor) { for (int i = 0; i < 4096; i++) { @@ -154,18 +154,18 @@ MACHINE_CONFIG_START(wswan_state::wswan) MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("pc2_list","pockchalv2") MACHINE_CONFIG_END -MACHINE_CONFIG_START(wswan_state::wscolor) +MACHINE_CONFIG_START(wscolor_state::wscolor) wswan(config); + MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(wscolor_mem) - MCFG_MACHINE_START_OVERRIDE(wswan_state, wscolor) MCFG_DEVICE_MODIFY("vdp") MCFG_WSWAN_VIDEO_TYPE(VDP_TYPE_WSC) MCFG_PALETTE_MODIFY("palette") MCFG_PALETTE_ENTRIES(4096) - MCFG_PALETTE_INIT_OWNER(wswan_state, wscolor) + MCFG_PALETTE_INIT_OWNER(wscolor_state, wscolor) /* software lists */ MCFG_DEVICE_REMOVE("cart_list") @@ -190,6 +190,6 @@ ROM_START( wscolor ) // ROM_LOAD_OPTIONAL( "wsc_bios.bin", 0x0000, 0x0001, NO_DUMP ) ROM_END -/* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME*/ -CONS( 1999, wswan, 0, 0, wswan, wswan, wswan_state, 0, "Bandai", "WonderSwan", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -CONS( 2000, wscolor, wswan, 0, wscolor, wswan, wswan_state, 0, "Bandai", "WonderSwan Color", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME +CONS( 1999, wswan, 0, 0, wswan, wswan, wswan_state, 0, "Bandai", "WonderSwan", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +CONS( 2000, wscolor, wswan, 0, wscolor, wswan, wscolor_state, 0, "Bandai", "WonderSwan Color", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/xybots.cpp b/src/mame/drivers/xybots.cpp index f50d3c1cbbc..855435ebda8 100644 --- a/src/mame/drivers/xybots.cpp +++ b/src/mame/drivers/xybots.cpp @@ -42,12 +42,6 @@ void xybots_state::update_interrupts() } -MACHINE_RESET_MEMBER(xybots_state,xybots) -{ - atarigen_state::machine_reset(); -} - - /************************************* * @@ -185,12 +179,10 @@ MACHINE_CONFIG_START(xybots_state::xybots) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", xybots_state, video_int_gen) MCFG_SLAPSTIC_ADD("slapstic", 107) - MCFG_MACHINE_RESET_OVERRIDE(xybots_state,xybots) - MCFG_EEPROM_2804_ADD("eeprom") MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true) @@ -215,12 +207,10 @@ MACHINE_CONFIG_START(xybots_state::xybots) MCFG_SCREEN_UPDATE_DRIVER(xybots_state, screen_update_xybots) MCFG_SCREEN_PALETTE("palette") - MCFG_VIDEO_START_OVERRIDE(xybots_state,xybots) - /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(atarigen_state, sound_int_write_line)) + MCFG_ATARI_JSA_I_ADD("jsa", WRITELINE(xybots_state, sound_int_write_line)) MCFG_ATARI_JSA_TEST_PORT("FFE200", 8) MCFG_SOUND_ROUTE(0, "rspeaker", 1.0) MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) diff --git a/src/mame/includes/arcadia.h b/src/mame/includes/arcadia.h index eb03c399a66..46088c6d63f 100644 --- a/src/mame/includes/arcadia.h +++ b/src/mame/includes/arcadia.h @@ -5,10 +5,11 @@ * includes/arcadia.h * ****************************************************************************/ - #ifndef MAME_INCLUDES_ARCADIA_H #define MAME_INCLUDES_ARCADIA_H +#pragma once + #include "cpu/s2650/s2650.h" #include "audio/arcadia.h" @@ -30,8 +31,8 @@ class arcadia_state : public driver_device { public: - arcadia_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + arcadia_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_custom(*this, "custom"), m_panel(*this, "panel"), m_controller1_col1(*this, "controller1_col1"), @@ -47,11 +48,30 @@ public: m_cart(*this, "cartslot"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_screen(*this, "screen") { } + m_screen(*this, "screen") + { } + + DECLARE_DRIVER_INIT(arcadia); + void arcadia(machine_config &config); +protected: DECLARE_READ_LINE_MEMBER(vsync_r); DECLARE_READ8_MEMBER(video_r); DECLARE_WRITE8_MEMBER(video_w); + + virtual void machine_start() override; + virtual void video_start() override; + DECLARE_PALETTE_INIT(arcadia); + uint32_t screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(video_line); + void arcadia_mem(address_map &map); + + void draw_char(uint8_t *ch, int charcode, int y, int x); + void vh_draw_line(int y, uint8_t chars1[16]); + int sprite_collision(int n1, int n2); + void draw_sprites(); + +private: int m_line; int m_charline; int m_shift; @@ -96,16 +116,7 @@ public: } d; } m_reg; std::unique_ptr m_bitmap; - DECLARE_DRIVER_INIT(arcadia); - virtual void machine_start() override; - virtual void video_start() override; - DECLARE_PALETTE_INIT(arcadia); - uint32_t screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(video_line); - void arcadia(machine_config &config); - void arcadia_mem(address_map &map); -protected: required_device m_custom; required_ioport m_panel; required_ioport m_controller1_col1; @@ -118,14 +129,11 @@ protected: required_ioport m_controller2_extra; required_ioport m_joysticks; - void draw_char(uint8_t *ch, int charcode, int y, int x); - void vh_draw_line(int y, uint8_t chars1[16]); - int sprite_collision(int n1, int n2); - void draw_sprites(); required_device m_maincpu; required_device m_cart; required_device m_gfxdecode; required_device m_palette; required_device m_screen; }; + #endif // MAME_INCLUDES_ARCADIA_H diff --git a/src/mame/includes/atarig42.h b/src/mame/includes/atarig42.h index 27b4f5cd26b..0e3d0364640 100644 --- a/src/mame/includes/atarig42.h +++ b/src/mame/includes/atarig42.h @@ -5,6 +5,10 @@ Atari G42 hardware *************************************************************************/ +#ifndef MAME_INCLUDES_ATARIG42_H +#define MAME_INCLUDES_ATARIG42_H + +#pragma once #include "audio/atarijsa.h" #include "machine/atarigen.h" @@ -15,14 +19,33 @@ class atarig42_state : public atarigen_state { public: - atarig42_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_jsa(*this, "jsa"), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_rle(*this, "rle"), - m_asic65(*this, "asic65"), - m_mo_command(*this, "mo_command") { } + atarig42_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_jsa(*this, "jsa"), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_rle(*this, "rle"), + m_asic65(*this, "asic65"), + m_mo_command(*this, "mo_command") + { } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void update_interrupts() override; + virtual void scanline_update(screen_device &screen, int scanline) override; + DECLARE_READ16_MEMBER(special_port2_r); + DECLARE_WRITE16_MEMBER(a2d_select_w); + DECLARE_READ16_MEMBER(a2d_data_r); + DECLARE_WRITE16_MEMBER(io_latch_w); + DECLARE_WRITE16_MEMBER(mo_command_w); + TILE_GET_INFO_MEMBER(get_alpha_tile_info); + TILE_GET_INFO_MEMBER(get_playfield_tile_info); + TILEMAP_MAPPER_MEMBER(atarig42_playfield_scan); + DECLARE_VIDEO_START(atarig42); + uint32_t screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void atarig42(machine_config &config); + void main_map(address_map &map); required_device m_jsa; @@ -49,30 +72,32 @@ public: uint16_t * m_sloop_base; uint32_t m_last_accesses[8]; - virtual void update_interrupts() override; - virtual void scanline_update(screen_device &screen, int scanline) override; - DECLARE_READ16_MEMBER(special_port2_r); - DECLARE_WRITE16_MEMBER(a2d_select_w); - DECLARE_READ16_MEMBER(a2d_data_r); - DECLARE_WRITE16_MEMBER(io_latch_w); - DECLARE_WRITE16_MEMBER(mo_command_w); +}; + +class atarig42_0x200_state : public atarig42_state +{ +public: + using atarig42_state::atarig42_state; + DECLARE_DRIVER_INIT(roadriot); + void atarig42_0x200(machine_config &config); + +protected: DECLARE_READ16_MEMBER(roadriot_sloop_data_r); DECLARE_WRITE16_MEMBER(roadriot_sloop_data_w); - DECLARE_READ16_MEMBER(guardians_sloop_data_r); - DECLARE_WRITE16_MEMBER(guardians_sloop_data_w); void roadriot_sloop_tweak(int offset); - void guardians_sloop_tweak(int offset); - DECLARE_DRIVER_INIT(roadriot); +}; + +class atarig42_0x400_state : public atarig42_state +{ +public: + using atarig42_state::atarig42_state; DECLARE_DRIVER_INIT(guardian); - TILE_GET_INFO_MEMBER(get_alpha_tile_info); - TILE_GET_INFO_MEMBER(get_playfield_tile_info); - TILEMAP_MAPPER_MEMBER(atarig42_playfield_scan); - DECLARE_MACHINE_START(atarig42); - DECLARE_MACHINE_RESET(atarig42); - DECLARE_VIDEO_START(atarig42); - uint32_t screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void atarig42(machine_config &config); - void atarig42_0x200(machine_config &config); void atarig42_0x400(machine_config &config); - void main_map(address_map &map); + +protected: + DECLARE_READ16_MEMBER(guardians_sloop_data_r); + DECLARE_WRITE16_MEMBER(guardians_sloop_data_w); + void guardians_sloop_tweak(int offset); }; + +#endif // MAME_INCLUDES_ATARIG42_H diff --git a/src/mame/includes/atarigx2.h b/src/mame/includes/atarigx2.h index ed924edcf0e..3e0db334f50 100644 --- a/src/mame/includes/atarigx2.h +++ b/src/mame/includes/atarigx2.h @@ -5,6 +5,10 @@ Atari GX2 hardware *************************************************************************/ +#ifndef MAME_INCLUDES_ATARIGX2_H +#define MAME_INCLUDES_ATARIGX2_H + +#pragma once #include "audio/atarijsa.h" #include "machine/atarigen.h" @@ -25,6 +29,35 @@ public: , m_rle(*this, "rle") { } + DECLARE_DRIVER_INIT(spclords); + DECLARE_DRIVER_INIT(rrreveng); + DECLARE_DRIVER_INIT(motofren); + void atarigx2_0x200(machine_config &config); + void atarigx2_0x400(machine_config &config); + +protected: + virtual void machine_reset() override; + virtual void video_start() override; + virtual void update_interrupts() override; + virtual void scanline_update(screen_device &screen, int scanline) override; + DECLARE_READ32_MEMBER(special_port2_r); + DECLARE_READ32_MEMBER(special_port3_r); + DECLARE_READ32_MEMBER(a2d_data_r); + DECLARE_WRITE32_MEMBER(latch_w); + DECLARE_WRITE32_MEMBER(mo_command_w); + DECLARE_WRITE32_MEMBER(atarigx2_protection_w); + DECLARE_READ32_MEMBER(atarigx2_protection_r); + DECLARE_READ32_MEMBER(rrreveng_prot_r); + TILE_GET_INFO_MEMBER(get_alpha_tile_info); + TILE_GET_INFO_MEMBER(get_playfield_tile_info); + TILEMAP_MAPPER_MEMBER(atarigx2_playfield_scan); + uint32_t screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE16_MEMBER( atarigx2_mo_control_w ); + + void atarigx2(machine_config &config); + void main_map(address_map &map); + +private: uint16_t m_playfield_base; required_device m_jsa; @@ -46,30 +79,6 @@ public: uint16_t m_last_write; uint16_t m_last_write_offset; uint32_t m_protection_ram[0x1000]; - - virtual void update_interrupts() override; - virtual void scanline_update(screen_device &screen, int scanline) override; - DECLARE_READ32_MEMBER(special_port2_r); - DECLARE_READ32_MEMBER(special_port3_r); - DECLARE_READ32_MEMBER(a2d_data_r); - DECLARE_WRITE32_MEMBER(latch_w); - DECLARE_WRITE32_MEMBER(mo_command_w); - DECLARE_WRITE32_MEMBER(atarigx2_protection_w); - DECLARE_READ32_MEMBER(atarigx2_protection_r); - DECLARE_READ32_MEMBER(rrreveng_prot_r); - DECLARE_DRIVER_INIT(spclords); - DECLARE_DRIVER_INIT(rrreveng); - DECLARE_DRIVER_INIT(motofren); - TILE_GET_INFO_MEMBER(get_alpha_tile_info); - TILE_GET_INFO_MEMBER(get_playfield_tile_info); - TILEMAP_MAPPER_MEMBER(atarigx2_playfield_scan); - DECLARE_MACHINE_START(atarigx2); - DECLARE_MACHINE_RESET(atarigx2); - DECLARE_VIDEO_START(atarigx2); - uint32_t screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE16_MEMBER( atarigx2_mo_control_w ); - void atarigx2(machine_config &config); - void atarigx2_0x200(machine_config &config); - void atarigx2_0x400(machine_config &config); - void main_map(address_map &map); }; + +#endif // MAME_INCLUDES_ATARIGX2_H diff --git a/src/mame/includes/badlands.h b/src/mame/includes/badlands.h index f0210875e4d..fdc7229d77f 100644 --- a/src/mame/includes/badlands.h +++ b/src/mame/includes/badlands.h @@ -5,10 +5,11 @@ Atari Bad Lands hardware *************************************************************************/ - #ifndef MAME_INCLUDES_BADLANDS_H #define MAME_INCLUDES_BADLANDS_H +#pragma once + #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" #include "cpu/m6502/m6502.h" diff --git a/src/mame/includes/batman.h b/src/mame/includes/batman.h index c07af93c81f..1b8094ea01e 100644 --- a/src/mame/includes/batman.h +++ b/src/mame/includes/batman.h @@ -5,6 +5,10 @@ Atari Batman hardware *************************************************************************/ +#ifndef MAME_INCLUDES_BATMAN_H +#define MAME_INCLUDES_BATMAN_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -13,29 +17,35 @@ class batman_state : public atarigen_state { public: - batman_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_jsa(*this, "jsa"), - m_vad(*this, "vad") { } - - required_device m_jsa; - required_device m_vad; + batman_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_jsa(*this, "jsa"), + m_vad(*this, "vad") + { } - uint16_t m_latch_data; - uint8_t m_alpha_tile_bank; + DECLARE_DRIVER_INIT(batman); + void batman(machine_config &config); - virtual void update_interrupts() override; +protected: + virtual void machine_start() override; DECLARE_WRITE16_MEMBER(latch_w); - DECLARE_DRIVER_INIT(batman); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); TILE_GET_INFO_MEMBER(get_playfield2_tile_info); - DECLARE_MACHINE_START(batman); - DECLARE_MACHINE_RESET(batman); DECLARE_VIDEO_START(batman); uint32_t screen_update_batman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - void batman(machine_config &config); + virtual void update_interrupts() override; void main_map(address_map &map); + +private: + required_device m_jsa; + required_device m_vad; + + uint16_t m_latch_data; + uint8_t m_alpha_tile_bank; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_BATMAN_H diff --git a/src/mame/includes/beathead.h b/src/mame/includes/beathead.h index f51248e8989..b475a430a9a 100644 --- a/src/mame/includes/beathead.h +++ b/src/mame/includes/beathead.h @@ -5,6 +5,10 @@ Atari "Stella on Steroids" hardware ***************************************************************************/ +#ifndef MAME_INCLUDES_BEATHEAD_H +#define MAME_INCLUDES_BEATHEAD_H + +#pragma once #include "machine/atarigen.h" #include "machine/timer.h" @@ -14,8 +18,8 @@ class beathead_state : public atarigen_state { public: - beathead_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), + beathead_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), m_jsa(*this, "jsa"), m_nvram(*this, "nvram"), m_videoram(*this, "videoram"), @@ -25,12 +29,37 @@ public: m_rom_base(*this, "rom_base") { } - virtual void machine_reset() override; + void beathead(machine_config &config); +protected: + // in drivers/beathead.c + virtual void update_interrupts() override; + DECLARE_WRITE32_MEMBER( interrupt_control_w ); + DECLARE_READ32_MEMBER( interrupt_control_r ); + DECLARE_WRITE32_MEMBER( eeprom_data_w ); + DECLARE_WRITE32_MEMBER( eeprom_enable_w ); + DECLARE_WRITE32_MEMBER( sound_reset_w ); + DECLARE_WRITE32_MEMBER( coin_count_w ); + DECLARE_READ32_MEMBER( speedup_r ); + DECLARE_READ32_MEMBER( movie_speedup_r ); + + // in video/beathead.c + DECLARE_WRITE32_MEMBER( vram_transparent_w ); + DECLARE_WRITE32_MEMBER( vram_bulk_w ); + DECLARE_WRITE32_MEMBER( vram_latch_w ); + DECLARE_WRITE32_MEMBER( vram_copy_w ); + DECLARE_WRITE32_MEMBER( finescroll_w ); + DECLARE_READ32_MEMBER( hsync_ram_r ); + DECLARE_WRITE32_MEMBER( hsync_ram_w ); + TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback); + + virtual void machine_reset() override; virtual void video_start() override; + void main_map(address_map &map); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +private: required_device m_jsa; required_shared_ptr m_nvram; @@ -57,27 +86,6 @@ public: uint8_t m_irq_state[3]; uint8_t m_eeprom_enabled; - - // in drivers/beathead.c - virtual void update_interrupts() override; - DECLARE_WRITE32_MEMBER( interrupt_control_w ); - DECLARE_READ32_MEMBER( interrupt_control_r ); - DECLARE_WRITE32_MEMBER( eeprom_data_w ); - DECLARE_WRITE32_MEMBER( eeprom_enable_w ); - DECLARE_WRITE32_MEMBER( sound_reset_w ); - DECLARE_WRITE32_MEMBER( coin_count_w ); - DECLARE_READ32_MEMBER( speedup_r ); - DECLARE_READ32_MEMBER( movie_speedup_r ); - - // in video/beathead.c - DECLARE_WRITE32_MEMBER( vram_transparent_w ); - DECLARE_WRITE32_MEMBER( vram_bulk_w ); - DECLARE_WRITE32_MEMBER( vram_latch_w ); - DECLARE_WRITE32_MEMBER( vram_copy_w ); - DECLARE_WRITE32_MEMBER( finescroll_w ); - DECLARE_READ32_MEMBER( hsync_ram_r ); - DECLARE_WRITE32_MEMBER( hsync_ram_w ); - TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback); - void beathead(machine_config &config); - void main_map(address_map &map); }; + +#endif // MAME_INCLUDES_BEATHEAD_H diff --git a/src/mame/includes/blstroid.h b/src/mame/includes/blstroid.h index f07fb0c03db..4415268efe5 100644 --- a/src/mame/includes/blstroid.h +++ b/src/mame/includes/blstroid.h @@ -5,6 +5,10 @@ Atari Blasteroids hardware *************************************************************************/ +#ifndef MAME_INCLUDES_BLSTROID_H +#define MAME_INCLUDES_BLSTROID_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -19,35 +23,40 @@ public: TIMER_IRQ_ON }; - blstroid_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_playfield_tilemap(*this, "playfield"), - m_jsa(*this, "jsa"), - m_mob(*this, "mob"), - m_priorityram(*this, "priorityram") { } + blstroid_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_playfield_tilemap(*this, "playfield"), + m_jsa(*this, "jsa"), + m_mob(*this, "mob"), + m_priorityram(*this, "priorityram") + { } - required_device m_playfield_tilemap; - required_device m_jsa; - required_device m_mob; - required_shared_ptr m_priorityram; + DECLARE_DRIVER_INIT(blstroid); + void blstroid(machine_config &config); +protected: + virtual void machine_reset() override; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_WRITE16_MEMBER(blstroid_halt_until_hblank_0_w); - DECLARE_DRIVER_INIT(blstroid); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - DECLARE_MACHINE_START(blstroid); - DECLARE_MACHINE_RESET(blstroid); DECLARE_VIDEO_START(blstroid); uint32_t screen_update_blstroid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void main_map(address_map &map); + + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + +private: + required_device m_playfield_tilemap; + required_device m_jsa; + required_device m_mob; + required_shared_ptr m_priorityram; + emu_timer *m_irq_off_timer; emu_timer *m_irq_on_timer; static const atari_motion_objects_config s_mob_config; - - void blstroid(machine_config &config); - void main_map(address_map &map); -protected: - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; + +#endif // MAME_INCLUDES_BLSTROID_H diff --git a/src/mame/includes/bsktball.h b/src/mame/includes/bsktball.h index e1781d35fb8..5cd7e1c6f1e 100644 --- a/src/mame/includes/bsktball.h +++ b/src/mame/includes/bsktball.h @@ -5,6 +5,10 @@ Atari Basketball hardware *************************************************************************/ +#ifndef MAME_INCLUDES_BSKTBALL_H +#define MAME_INCLUDES_BSKTBALL_H + +#pragma once #include "machine/timer.h" #include "sound/discrete.h" @@ -19,15 +23,41 @@ class bsktball_state : public driver_device { public: - bsktball_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + bsktball_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_motion(*this, "motion"), m_discrete(*this, "discrete"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } + + void bsktball(machine_config &config); + +protected: + DECLARE_WRITE_LINE_MEMBER(nmion_w); + DECLARE_WRITE_LINE_MEMBER(ld1_w); + DECLARE_WRITE_LINE_MEMBER(ld2_w); + DECLARE_READ8_MEMBER(bsktball_in0_r); + DECLARE_WRITE_LINE_MEMBER(led1_w); + DECLARE_WRITE_LINE_MEMBER(led2_w); + DECLARE_WRITE8_MEMBER(bsktball_videoram_w); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + DECLARE_PALETTE_INIT(bsktball); + uint32_t screen_update_bsktball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_DEVICE_CALLBACK_MEMBER(bsktball_scanline); + DECLARE_WRITE8_MEMBER(bsktball_bounce_w); + DECLARE_WRITE8_MEMBER(bsktball_note_w); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + void main_map(address_map &map); +private: /* memory pointers */ required_shared_ptr m_videoram; required_shared_ptr m_motion; @@ -51,30 +81,14 @@ public: int m_last_p1_vert; int m_last_p2_horiz; int m_last_p2_vert; - DECLARE_WRITE_LINE_MEMBER(nmion_w); - DECLARE_WRITE_LINE_MEMBER(ld1_w); - DECLARE_WRITE_LINE_MEMBER(ld2_w); - DECLARE_READ8_MEMBER(bsktball_in0_r); - DECLARE_WRITE_LINE_MEMBER(led1_w); - DECLARE_WRITE_LINE_MEMBER(led2_w); - DECLARE_WRITE8_MEMBER(bsktball_videoram_w); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - DECLARE_PALETTE_INIT(bsktball); - uint32_t screen_update_bsktball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(bsktball_scanline); - DECLARE_WRITE8_MEMBER(bsktball_bounce_w); - DECLARE_WRITE8_MEMBER(bsktball_note_w); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); + required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - void bsktball(machine_config &config); - void main_map(address_map &map); }; /*----------- defined in audio/bsktball.c -----------*/ DISCRETE_SOUND_EXTERN( bsktball ); + +#endif // MAME_INCLUDES_BSKTBALL_H diff --git a/src/mame/includes/canyon.h b/src/mame/includes/canyon.h index 41a666c8bf3..ca24db765c0 100644 --- a/src/mame/includes/canyon.h +++ b/src/mame/includes/canyon.h @@ -5,6 +5,10 @@ Atari Canyon Bomber hardware *************************************************************************/ +#ifndef MAME_INCLUDES_CANYON_H +#define MAME_INCLUDES_CANYON_H + +#pragma once #include "machine/74259.h" #include "machine/watchdog.h" @@ -24,24 +28,20 @@ class canyon_state : public driver_device { public: - canyon_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + canyon_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_outlatch(*this, "outlatch"), m_discrete(*this, "discrete"), m_maincpu(*this, "maincpu"), m_watchdog(*this, "watchdog"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } - - /* memory pointers */ - required_shared_ptr m_videoram; + m_palette(*this, "palette") + { } - required_device m_outlatch; - required_device m_discrete; + void canyon(machine_config &config); - /* video-related */ - tilemap_t *m_bg_tilemap; +protected: DECLARE_READ8_MEMBER(canyon_switches_r); DECLARE_READ8_MEMBER(canyon_options_r); DECLARE_WRITE8_MEMBER(output_latch_w); @@ -49,21 +49,34 @@ public: DECLARE_WRITE_LINE_MEMBER(led2_w); DECLARE_WRITE8_MEMBER(canyon_videoram_w); TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void video_start() override; DECLARE_PALETTE_INIT(canyon); uint32_t screen_update_canyon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(canyon_motor_w); DECLARE_WRITE8_MEMBER(canyon_explode_w); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_bombs( bitmap_ind16 &bitmap, const rectangle &cliprect ); + + virtual void video_start() override; + void main_map(address_map &map); + +private: + /* memory pointers */ + required_shared_ptr m_videoram; + + required_device m_outlatch; + required_device m_discrete; + + /* video-related */ + tilemap_t *m_bg_tilemap; + required_device m_maincpu; required_device m_watchdog; required_device m_gfxdecode; required_device m_palette; - void canyon(machine_config &config); - void main_map(address_map &map); }; /*----------- defined in audio/canyon.c -----------*/ DISCRETE_SOUND_EXTERN( canyon ); + +#endif // MAME_INCLUDES_CANYON_H diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h index 49e818b161f..f9f43b8bb34 100644 --- a/src/mame/includes/carpolo.h +++ b/src/mame/includes/carpolo.h @@ -7,6 +7,10 @@ driver by Zsolt Vasvari ****************************************************************************/ +#ifndef MAME_INCLUDES_CARPOLO_H +#define MAME_INCLUDES_CARPOLO_H + +#pragma once #include "machine/6821pia.h" #include "machine/7474.h" @@ -16,8 +20,8 @@ class carpolo_state : public driver_device { public: - carpolo_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + carpolo_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_alpharam(*this, "alpharam"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), @@ -37,8 +41,17 @@ public: m_ttl7474_1a_2(*this, "7474_1a_2"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") - {} + { } + + DECLARE_DRIVER_INIT(carpolo); + void carpolo(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; +private: required_shared_ptr m_alpharam; required_shared_ptr m_spriteram; uint8_t m_ball_screen_collision_cause; @@ -75,6 +88,7 @@ public: std::unique_ptr m_sprite_goal_collision_bitmap1; std::unique_ptr m_sprite_goal_collision_bitmap2; std::unique_ptr m_sprite_border_collision_bitmap; + DECLARE_READ8_MEMBER(carpolo_ball_screen_collision_cause_r); DECLARE_READ8_MEMBER(carpolo_car_ball_collision_x_r); DECLARE_READ8_MEMBER(carpolo_car_ball_collision_y_r); @@ -89,10 +103,6 @@ public: DECLARE_WRITE8_MEMBER(carpolo_car_ball_interrupt_clear_w); DECLARE_WRITE8_MEMBER(carpolo_car_border_interrupt_clear_w); DECLARE_WRITE8_MEMBER(carpolo_timer_interrupt_clear_w); - DECLARE_DRIVER_INIT(carpolo); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; DECLARE_PALETTE_INIT(carpolo); uint32_t screen_update_carpolo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(screen_vblank_carpolo); @@ -130,6 +140,7 @@ public: int check_sprite_sprite_collision(int x1, int y1, int code1, int flipy1, int x2, int y2, int code2, int flipy2, int *col_x, int *col_y); - void carpolo(machine_config &config); - void main_map(address_map &map); + void main_map(address_map &map); }; + +#endif // MAME_INCLUDES_CARPOLO_H diff --git a/src/mame/includes/ccastles.h b/src/mame/includes/ccastles.h index 34c601bc64d..680a412426f 100644 --- a/src/mame/includes/ccastles.h +++ b/src/mame/includes/ccastles.h @@ -5,6 +5,10 @@ Atari Crystal Castles hardware *************************************************************************/ +#ifndef MAME_INCLUDES_CCASTLES_H +#define MAME_INCLUDES_CCASTLES_H + +#pragma once #include "cpu/m6502/m6502.h" #include "machine/x2212.h" @@ -13,17 +17,50 @@ class ccastles_state : public driver_device { public: - ccastles_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_nvram_4b(*this, "nvram_4b"), - m_nvram_4a(*this, "nvram_4a") , + ccastles_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_nvram_4b(*this, "nvram_4b"), + m_nvram_4a(*this, "nvram_4a") , m_videoram(*this, "videoram"), m_spriteram(*this, "spriteram"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette"){ } + m_palette(*this, "palette") + { } + + DECLARE_CUSTOM_INPUT_MEMBER(get_vblank); + void ccastles(machine_config &config); + +protected: + DECLARE_WRITE8_MEMBER(irq_ack_w); + DECLARE_WRITE8_MEMBER(led_w); + DECLARE_WRITE8_MEMBER(ccounter_w); + DECLARE_WRITE8_MEMBER(bankswitch_w); + DECLARE_READ8_MEMBER(leta_r); + DECLARE_WRITE8_MEMBER(nvram_recall_w); + DECLARE_WRITE8_MEMBER(nvram_store_w); + DECLARE_READ8_MEMBER(nvram_r); + DECLARE_WRITE8_MEMBER(nvram_w); + DECLARE_WRITE8_MEMBER(ccastles_hscroll_w); + DECLARE_WRITE8_MEMBER(ccastles_vscroll_w); + DECLARE_WRITE8_MEMBER(ccastles_video_control_w); + DECLARE_WRITE8_MEMBER(ccastles_paletteram_w); + DECLARE_WRITE8_MEMBER(ccastles_videoram_w); + DECLARE_READ8_MEMBER(ccastles_bitmode_r); + DECLARE_WRITE8_MEMBER(ccastles_bitmode_w); + DECLARE_WRITE8_MEMBER(ccastles_bitmode_addr_w); + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + uint32_t screen_update_ccastles(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_CALLBACK_MEMBER(clock_irq); + inline void ccastles_write_vram( uint16_t addr, uint8_t data, uint8_t bitmd, uint8_t pixba ); + inline void bitmode_autoinc( ); + inline void schedule_next_irq( int curscanline ); + void main_map(address_map &map); +private: /* devices */ required_device m_maincpu; required_device m_nvram_4b; @@ -55,33 +92,6 @@ public: emu_timer *m_irq_timer; uint8_t m_irq_state; uint8_t m_nvram_store[2]; - - DECLARE_WRITE8_MEMBER(irq_ack_w); - DECLARE_WRITE8_MEMBER(led_w); - DECLARE_WRITE8_MEMBER(ccounter_w); - DECLARE_WRITE8_MEMBER(bankswitch_w); - DECLARE_READ8_MEMBER(leta_r); - DECLARE_WRITE8_MEMBER(nvram_recall_w); - DECLARE_WRITE8_MEMBER(nvram_store_w); - DECLARE_READ8_MEMBER(nvram_r); - DECLARE_WRITE8_MEMBER(nvram_w); - DECLARE_WRITE8_MEMBER(ccastles_hscroll_w); - DECLARE_WRITE8_MEMBER(ccastles_vscroll_w); - DECLARE_WRITE8_MEMBER(ccastles_video_control_w); - DECLARE_WRITE8_MEMBER(ccastles_paletteram_w); - DECLARE_WRITE8_MEMBER(ccastles_videoram_w); - DECLARE_READ8_MEMBER(ccastles_bitmode_r); - DECLARE_WRITE8_MEMBER(ccastles_bitmode_w); - DECLARE_WRITE8_MEMBER(ccastles_bitmode_addr_w); - DECLARE_CUSTOM_INPUT_MEMBER(get_vblank); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_ccastles(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(clock_irq); - inline void ccastles_write_vram( uint16_t addr, uint8_t data, uint8_t bitmd, uint8_t pixba ); - inline void bitmode_autoinc( ); - inline void schedule_next_irq( int curscanline ); - void ccastles(machine_config &config); - void main_map(address_map &map); }; + +#endif // MAME_INCLUDES_CCASTLES_H diff --git a/src/mame/includes/cloak.h b/src/mame/includes/cloak.h index 8205ef9134d..2c796d4d2ec 100644 --- a/src/mame/includes/cloak.h +++ b/src/mame/includes/cloak.h @@ -5,6 +5,11 @@ Atari Cloak & Dagger hardware *************************************************************************/ +#ifndef MAME_INCLUDES_CLOAK_H +#define MAME_INCLUDES_CLOAK_H + +#pragma once + #include "screen.h" class cloak_state : public driver_device @@ -18,20 +23,12 @@ public: m_slave(*this, "slave"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - int m_nvram_enabled; - uint8_t m_bitmap_videoram_selected; - uint8_t m_bitmap_videoram_address_x; - uint8_t m_bitmap_videoram_address_y; - std::unique_ptr m_bitmap_videoram1; - std::unique_ptr m_bitmap_videoram2; - uint8_t *m_current_bitmap_videoram_accessed; - uint8_t *m_current_bitmap_videoram_displayed; - std::unique_ptr m_palette_ram; - tilemap_t *m_bg_tilemap; + void cloak(machine_config &config); + +protected: DECLARE_WRITE_LINE_MEMBER(start_led_1_w); DECLARE_WRITE_LINE_MEMBER(start_led_2_w); DECLARE_WRITE_LINE_MEMBER(coin_counter_l_w); @@ -54,12 +51,28 @@ public: void set_pen(int i); void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void master_map(address_map &map); + void slave_map(address_map &map); + +private: + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + int m_nvram_enabled; + uint8_t m_bitmap_videoram_selected; + uint8_t m_bitmap_videoram_address_x; + uint8_t m_bitmap_videoram_address_y; + std::unique_ptr m_bitmap_videoram1; + std::unique_ptr m_bitmap_videoram2; + uint8_t *m_current_bitmap_videoram_accessed; + uint8_t *m_current_bitmap_videoram_displayed; + std::unique_ptr m_palette_ram; + tilemap_t *m_bg_tilemap; + required_device m_maincpu; required_device m_slave; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - void cloak(machine_config &config); - void master_map(address_map &map); - void slave_map(address_map &map); }; + +#endif // MAME_INCLUDES_CLOAK_H diff --git a/src/mame/includes/cloud9.h b/src/mame/includes/cloud9.h index b886f300e10..fb27d68b45e 100644 --- a/src/mame/includes/cloud9.h +++ b/src/mame/includes/cloud9.h @@ -5,6 +5,10 @@ Atari Cloud 9 (prototype) hardware *************************************************************************/ +#ifndef MAME_INCLUDES_CLOUD9_H +#define MAME_INCLUDES_CLOUD9_H + +#pragma once #include "cpu/m6502/m6502.h" #include "machine/74259.h" @@ -14,17 +18,46 @@ class cloud9_state : public driver_device { public: - cloud9_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_nvram(*this, "nvram") , + cloud9_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_nvram(*this, "nvram") , m_spriteram(*this, "spriteram"), m_paletteram(*this, "paletteram"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_videolatch(*this, "videolatch") { } + m_videolatch(*this, "videolatch") + { } + + DECLARE_CUSTOM_INPUT_MEMBER(get_vblank); + void cloud9(machine_config &config); + +protected: + DECLARE_WRITE8_MEMBER(irq_ack_w); + DECLARE_WRITE_LINE_MEMBER(coin1_counter_w); + DECLARE_WRITE_LINE_MEMBER(coin2_counter_w); + DECLARE_WRITE_LINE_MEMBER(led1_w); + DECLARE_WRITE_LINE_MEMBER(led2_w); + DECLARE_READ8_MEMBER(leta_r); + DECLARE_WRITE8_MEMBER(nvram_recall_w); + DECLARE_WRITE8_MEMBER(nvram_store_w); + DECLARE_WRITE8_MEMBER(cloud9_paletteram_w); + DECLARE_WRITE8_MEMBER(cloud9_videoram_w); + DECLARE_READ8_MEMBER(cloud9_bitmode_r); + DECLARE_WRITE8_MEMBER(cloud9_bitmode_w); + DECLARE_WRITE8_MEMBER(cloud9_bitmode_addr_w); + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + uint32_t screen_update_cloud9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_CALLBACK_MEMBER(clock_irq); + inline void cloud9_write_vram( uint16_t addr, uint8_t data, uint8_t bitmd, uint8_t pixba ); + inline void bitmode_autoinc(); + inline void schedule_next_irq(int curscanline); + void cloud9_map(address_map &map); +private: /* devices */ required_device m_maincpu; required_device m_nvram; @@ -53,29 +86,6 @@ public: int m_vblank_end; emu_timer *m_irq_timer; uint8_t m_irq_state; - - DECLARE_WRITE8_MEMBER(irq_ack_w); - DECLARE_WRITE_LINE_MEMBER(coin1_counter_w); - DECLARE_WRITE_LINE_MEMBER(coin2_counter_w); - DECLARE_WRITE_LINE_MEMBER(led1_w); - DECLARE_WRITE_LINE_MEMBER(led2_w); - DECLARE_READ8_MEMBER(leta_r); - DECLARE_WRITE8_MEMBER(nvram_recall_w); - DECLARE_WRITE8_MEMBER(nvram_store_w); - DECLARE_WRITE8_MEMBER(cloud9_paletteram_w); - DECLARE_WRITE8_MEMBER(cloud9_videoram_w); - DECLARE_READ8_MEMBER(cloud9_bitmode_r); - DECLARE_WRITE8_MEMBER(cloud9_bitmode_w); - DECLARE_WRITE8_MEMBER(cloud9_bitmode_addr_w); - DECLARE_CUSTOM_INPUT_MEMBER(get_vblank); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_cloud9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(clock_irq); - inline void cloud9_write_vram( uint16_t addr, uint8_t data, uint8_t bitmd, uint8_t pixba ); - inline void bitmode_autoinc( ); - inline void schedule_next_irq(int curscanline); - void cloud9(machine_config &config); - void cloud9_map(address_map &map); }; + +#endif // MAME_INCLUDES_CLOUD9_H diff --git a/src/mame/includes/copsnrob.h b/src/mame/includes/copsnrob.h index 13657ac4120..117254dd4f3 100644 --- a/src/mame/includes/copsnrob.h +++ b/src/mame/includes/copsnrob.h @@ -5,6 +5,10 @@ Atari Cops'n Robbers hardware *************************************************************************/ +#ifndef MAME_INCLUDES_COPSNROB_H +#define MAME_INCLUDES_COPSNROB_H + +#pragma once #include "machine/74259.h" #include "sound/discrete.h" @@ -14,8 +18,8 @@ class copsnrob_state : public driver_device { public: - copsnrob_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + copsnrob_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_trucky(*this, "trucky"), m_truckram(*this, "truckram"), m_bulletsram(*this, "bulletsram"), @@ -26,8 +30,23 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } + + void copsnrob(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + void copsnrob_audio(machine_config &config); + void main_map(address_map &map); + + DECLARE_READ8_MEMBER(copsnrob_misc_r); + DECLARE_WRITE8_MEMBER(copsnrob_misc2_w); + DECLARE_WRITE_LINE_MEMBER(one_start_w); + uint32_t screen_update_copsnrob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +private: /* memory pointers */ required_shared_ptr m_trucky; required_shared_ptr m_truckram; @@ -36,20 +55,15 @@ public: required_shared_ptr m_cary; required_shared_ptr m_videoram; required_device m_discrete; + /* misc */ uint8_t m_misc; uint8_t m_ic_h3_data; - DECLARE_READ8_MEMBER(copsnrob_misc_r); - DECLARE_WRITE8_MEMBER(copsnrob_misc2_w); - DECLARE_WRITE_LINE_MEMBER(one_start_w); - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update_copsnrob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_device m_maincpu; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - void copsnrob(machine_config &config); - void copsnrob_audio(machine_config &config); - void main_map(address_map &map); }; + +#endif // MAME_INCLUDES_COPSNROB_H diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h index 907faee176d..a9b45cbe193 100644 --- a/src/mame/includes/cyberbal.h +++ b/src/mame/includes/cyberbal.h @@ -5,6 +5,10 @@ Atari Cyberball hardware *************************************************************************/ +#ifndef MAME_INCLUDES_CYBERBAL_H +#define MAME_INCLUDES_CYBERBAL_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -18,24 +22,25 @@ class cyberbal_state : public atarigen_state { public: - cyberbal_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_audiocpu(*this, "audiocpu"), - m_extracpu(*this, "extra"), - m_daccpu(*this, "dac"), - m_rdac(*this, "rdac"), - m_ldac(*this, "ldac"), - m_soundcomm(*this, "soundcomm"), - m_ymsnd(*this, "ymsnd"), - m_jsa(*this, "jsa"), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_mob(*this, "mob"), - m_playfield2_tilemap(*this, "playfield2"), - m_alpha2_tilemap(*this, "alpha2"), - m_mob2(*this, "mob2"), - m_lscreen(*this, "lscreen"), - m_rscreen(*this, "rscreen") { } + cyberbal_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_audiocpu(*this, "audiocpu"), + m_extracpu(*this, "extra"), + m_daccpu(*this, "dac"), + m_rdac(*this, "rdac"), + m_ldac(*this, "ldac"), + m_soundcomm(*this, "soundcomm"), + m_ymsnd(*this, "ymsnd"), + m_jsa(*this, "jsa"), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_mob(*this, "mob"), + m_playfield2_tilemap(*this, "playfield2"), + m_alpha2_tilemap(*this, "alpha2"), + m_mob2(*this, "mob2"), + m_lscreen(*this, "lscreen"), + m_rscreen(*this, "rscreen") + { } optional_device m_audiocpu; optional_device m_extracpu; @@ -104,9 +109,12 @@ public: void main_map(address_map &map); void sound_68k_map(address_map &map); void sound_map(address_map &map); + private: void video_start_common(int screens); void cyberbal_sound_reset(); uint32_t update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index); void update_sound_68k_interrupts(); }; + +#endif // MAME_INCLUDES_CYBERBAL_H diff --git a/src/mame/includes/cybstorm.h b/src/mame/includes/cybstorm.h index dd3f60066ba..f8699235027 100644 --- a/src/mame/includes/cybstorm.h +++ b/src/mame/includes/cybstorm.h @@ -5,6 +5,10 @@ Atari Cyberstorm hardware *************************************************************************/ +#ifndef MAME_INCLUDES_CYBSTORM_H +#define MAME_INCLUDES_CYBSTORM_H + +#pragma once #include "audio/atarijsa.h" #include "machine/atarigen.h" @@ -15,19 +19,18 @@ class cybstorm_state : public atarigen_state { public: cybstorm_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag) - , m_jsa(*this, "jsa") - , m_vad(*this, "vad") - , m_vadbank(*this, "vadbank") + : atarigen_state(mconfig, type, tag) + , m_jsa(*this, "jsa") + , m_vad(*this, "vad") + , m_vadbank(*this, "vadbank") { } - optional_device m_jsa; - required_device m_vad; - required_device m_vadbank; - - uint32_t m_latch_data; - uint8_t m_alpha_tile_bank; + DECLARE_DRIVER_INIT(cybstorm); + void cybstorm(machine_config &config); +protected: + virtual void machine_start() override; + virtual void video_start() override; virtual void update_interrupts() override; DECLARE_READ32_MEMBER(special_port1_r); @@ -38,16 +41,21 @@ public: TILE_GET_INFO_MEMBER(get_playfield2_tile_info); TILEMAP_MAPPER_MEMBER(playfield_scan); - DECLARE_DRIVER_INIT(cybstorm); - DECLARE_MACHINE_START(cybstorm); - DECLARE_MACHINE_RESET(cybstorm); - - DECLARE_VIDEO_START(cybstorm); uint32_t screen_update_cybstorm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - void cybstorm(machine_config &config); void round2(machine_config &config); void main_map(address_map &map); void vadbank_map(address_map &map); + +private: + optional_device m_jsa; + required_device m_vad; + required_device m_vadbank; + + uint32_t m_latch_data; + uint8_t m_alpha_tile_bank; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_CYBSTORM_H diff --git a/src/mame/includes/dragrace.h b/src/mame/includes/dragrace.h index 171c3c8ef2e..66fe39225ad 100644 --- a/src/mame/includes/dragrace.h +++ b/src/mame/includes/dragrace.h @@ -5,6 +5,10 @@ Atari Drag Race hardware *************************************************************************/ +#ifndef MAME_INCLUDES_DRAGRACE_H +#define MAME_INCLUDES_DRAGRACE_H + +#pragma once #include "machine/timer.h" #include "machine/watchdog.h" @@ -42,6 +46,28 @@ public: { } + void dragrace(machine_config &config); + +protected: + DECLARE_WRITE8_MEMBER(speed1_w); + DECLARE_WRITE8_MEMBER(speed2_w); + DECLARE_WRITE_LINE_MEMBER(p1_start_w); + DECLARE_WRITE_LINE_MEMBER(p2_start_w); + DECLARE_READ8_MEMBER(dragrace_input_r); + DECLARE_READ8_MEMBER(dragrace_steering_r); + DECLARE_READ8_MEMBER(dragrace_scanline_r); + TILE_GET_INFO_MEMBER(get_tile_info); + DECLARE_PALETTE_INIT(dragrace); + uint32_t screen_update_dragrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_DEVICE_CALLBACK_MEMBER(dragrace_frame_callback); + void dragrace_update_misc_flags( address_space &space ); + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + void dragrace_map(address_map &map); + +private: /* memory pointers */ required_shared_ptr m_playfield_ram; required_shared_ptr m_position_ram; @@ -58,25 +84,9 @@ public: required_device m_watchdog; required_device m_gfxdecode; required_device m_screen; - - DECLARE_WRITE8_MEMBER(speed1_w); - DECLARE_WRITE8_MEMBER(speed2_w); - DECLARE_WRITE_LINE_MEMBER(p1_start_w); - DECLARE_WRITE_LINE_MEMBER(p2_start_w); - DECLARE_READ8_MEMBER(dragrace_input_r); - DECLARE_READ8_MEMBER(dragrace_steering_r); - DECLARE_READ8_MEMBER(dragrace_scanline_r); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - DECLARE_PALETTE_INIT(dragrace); - uint32_t screen_update_dragrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(dragrace_frame_callback); - void dragrace_update_misc_flags( address_space &space ); - void dragrace(machine_config &config); - void dragrace_map(address_map &map); }; /*----------- defined in audio/dragrace.c -----------*/ DISCRETE_SOUND_EXTERN( dragrace ); + +#endif // MAME_INCLUDES_DRAGRACE_H diff --git a/src/mame/includes/eprom.h b/src/mame/includes/eprom.h index 115fd577a57..6cb77995af6 100644 --- a/src/mame/includes/eprom.h +++ b/src/mame/includes/eprom.h @@ -5,6 +5,10 @@ Atari Escape hardware *************************************************************************/ +#ifndef MAME_INCLUDES_EPROM_H +#define MAME_INCLUDES_EPROM_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -13,22 +17,22 @@ class eprom_state : public atarigen_state { public: - eprom_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_mob(*this, "mob"), - m_jsa(*this, "jsa"), - m_extra(*this, "extra") { } + eprom_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_mob(*this, "mob"), + m_jsa(*this, "jsa"), + m_extra(*this, "extra") + { } - required_device m_playfield_tilemap; - required_device m_alpha_tilemap; - required_device m_mob; - required_device m_jsa; - int m_screen_intensity; - int m_video_disable; - uint16_t m_sync_data; - int m_last_offset; + void guts(machine_config &config); + void eprom(machine_config &config); + void klaxp(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_READ16_MEMBER(special_port1_r); @@ -36,26 +40,30 @@ public: DECLARE_WRITE16_MEMBER(eprom_latch_w); DECLARE_READ16_MEMBER(sync_r); template DECLARE_WRITE16_MEMBER(sync_w); - DECLARE_DRIVER_INIT(klaxp); - DECLARE_DRIVER_INIT(guts); - DECLARE_DRIVER_INIT(eprom); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); TILE_GET_INFO_MEMBER(guts_get_playfield_tile_info); - DECLARE_MACHINE_START(eprom); - DECLARE_MACHINE_RESET(eprom); DECLARE_VIDEO_START(eprom); DECLARE_VIDEO_START(guts); uint32_t screen_update_eprom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_guts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void update_palette(); - optional_device m_extra; - static const atari_motion_objects_config s_mob_config; - static const atari_motion_objects_config s_guts_mob_config; - void guts(machine_config &config); - void eprom(machine_config &config); - void klaxp(machine_config &config); void extra_map(address_map &map); void guts_map(address_map &map); void main_map(address_map &map); + +private: + required_device m_playfield_tilemap; + required_device m_alpha_tilemap; + required_device m_mob; + required_device m_jsa; + int m_screen_intensity; + int m_video_disable; + uint16_t m_sync_data; + int m_last_offset; + optional_device m_extra; + static const atari_motion_objects_config s_mob_config; + static const atari_motion_objects_config s_guts_mob_config; }; + +#endif // MAME_INCLUDES_EPROM_H diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h index f4a0cc973ef..a4e132081c5 100644 --- a/src/mame/includes/equites.h +++ b/src/mame/includes/equites.h @@ -5,6 +5,10 @@ Equites, Splendor Blast driver *************************************************************************/ +#ifndef MAME_INCLUDES_EQUITES_H +#define MAME_INCLUDES_EQUITES_H + +#pragma once #include "machine/alpha8201.h" #include "machine/gen_latch.h" @@ -19,8 +23,8 @@ class equites_state : public driver_device { public: - equites_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + equites_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_bg_videoram(*this, "bg_videoram"), m_spriteram(*this, "spriteram"), m_spriteram_2(*this, "spriteram_2"), @@ -50,10 +54,7 @@ public: /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - int m_fg_char_bank; uint8_t m_bgcolor; - uint16_t m_splndrbt_bg_scrollx; - uint16_t m_splndrbt_bg_scrolly; /* misc */ int m_sound_prom_address; @@ -68,7 +69,6 @@ public: float m_cymvol; float m_hihatvol; int m_timer_count; - int m_gekisou_unknown_bit; /* devices */ required_device m_maincpu; @@ -91,7 +91,6 @@ public: DECLARE_WRITE8_MEMBER(equites_8155_porta_w); DECLARE_WRITE8_MEMBER(equites_8155_portb_w); DECLARE_WRITE8_MEMBER(equites_8155_portc_w); - DECLARE_WRITE16_MEMBER(gekisou_unknown_bit_w); DECLARE_READ16_MEMBER(equites_spriteram_kludge_r); DECLARE_WRITE8_MEMBER(mainlatch_w); DECLARE_READ8_MEMBER(mcu_ram_r); @@ -103,49 +102,80 @@ public: DECLARE_WRITE16_MEMBER(equites_bg_videoram_w); DECLARE_WRITE8_MEMBER(equites_bgcolor_w); DECLARE_WRITE16_MEMBER(equites_scrollreg_w); - DECLARE_WRITE_LINE_MEMBER(splndrbt_selchar_w); DECLARE_WRITE_LINE_MEMBER(flip_screen_w); - DECLARE_WRITE16_MEMBER(splndrbt_bg_scrollx_w); - DECLARE_WRITE16_MEMBER(splndrbt_bg_scrolly_w); - DECLARE_CUSTOM_INPUT_MEMBER(gekisou_unknown_bit_r); DECLARE_WRITE8_MEMBER(equites_8910porta_w); DECLARE_WRITE8_MEMBER(equites_8910portb_w); - DECLARE_DRIVER_INIT(splndrbt); DECLARE_DRIVER_INIT(equites); TILE_GET_INFO_MEMBER(equites_fg_info); - TILE_GET_INFO_MEMBER(splndrbt_fg_info); TILE_GET_INFO_MEMBER(equites_bg_info); - TILE_GET_INFO_MEMBER(splndrbt_bg_info); DECLARE_VIDEO_START(equites); DECLARE_PALETTE_INIT(equites); - DECLARE_VIDEO_START(splndrbt); - DECLARE_PALETTE_INIT(splndrbt); uint32_t screen_update_equites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(equites_8155_timer_pulse); TIMER_CALLBACK_MEMBER(equites_frq_adjuster_callback); TIMER_DEVICE_CALLBACK_MEMBER(equites_scanline); - TIMER_DEVICE_CALLBACK_MEMBER(splndrbt_scanline); DECLARE_WRITE_LINE_MEMBER(equites_msm5232_gate); void equites_draw_sprites_block(bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end); void equites_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void splndrbt_copy_bg(bitmap_ind16 &dst_bitmap, const rectangle &cliprect); void equites_update_dac(); void unpack_block(const char *region, int offset, int size); void unpack_region(const char *region); + void equites(machine_config &config); +protected: virtual void machine_start() override; virtual void machine_reset() override; void common_sound(machine_config &config); - void equites(machine_config &config); - void splndrbt(machine_config &config); - void gekisou(machine_config &config); - void hvoltage(machine_config &config); void equites_map(address_map &map); - void gekisou_map(address_map &map); void mcu_map(address_map &map); void sound_map(address_map &map); void sound_portmap(address_map &map); +}; + +class gekisou_state : public equites_state +{ +public: + using equites_state::equites_state; + DECLARE_CUSTOM_INPUT_MEMBER(gekisou_unknown_bit_r); + void gekisou(machine_config &config); + +protected: + virtual void machine_start() override; + void gekisou_map(address_map &map); + DECLARE_WRITE16_MEMBER(gekisou_unknown_bit_w); + +private: + int m_gekisou_unknown_bit; +}; + + +class splndrbt_state : public equites_state +{ +public: + using equites_state::equites_state; + DECLARE_DRIVER_INIT(splndrbt); + void splndrbt(machine_config &config); + void hvoltage(machine_config &config); + +protected: + virtual void machine_start() override; void splndrbt_map(address_map &map); + DECLARE_WRITE_LINE_MEMBER(splndrbt_selchar_w); + DECLARE_WRITE16_MEMBER(splndrbt_bg_scrollx_w); + DECLARE_WRITE16_MEMBER(splndrbt_bg_scrolly_w); + TILE_GET_INFO_MEMBER(splndrbt_fg_info); + TILE_GET_INFO_MEMBER(splndrbt_bg_info); + DECLARE_VIDEO_START(splndrbt); + DECLARE_PALETTE_INIT(splndrbt); + uint32_t screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_DEVICE_CALLBACK_MEMBER(splndrbt_scanline); + void splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void splndrbt_copy_bg(bitmap_ind16 &dst_bitmap, const rectangle &cliprect); + +private: + int m_fg_char_bank; + uint16_t m_splndrbt_bg_scrollx; + uint16_t m_splndrbt_bg_scrolly; }; + +#endif // MAME_INCLUDES_EQUITES_H diff --git a/src/mame/includes/exidy440.h b/src/mame/includes/exidy440.h index 5c28358ca14..7134faac3bc 100644 --- a/src/mame/includes/exidy440.h +++ b/src/mame/includes/exidy440.h @@ -5,6 +5,10 @@ Exidy 440 hardware *************************************************************************/ +#ifndef MAME_INCLUDES_EXIDY440_H +#define MAME_INCLUDES_EXIDY440_H + +#pragma once #include "audio/exidy440.h" #include "screen.h" @@ -15,40 +19,28 @@ class exidy440_state : public driver_device { public: - exidy440_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + exidy440_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_imageram(*this, "imageram"), m_spriteram(*this, "spriteram"), m_scanline(*this, "scanline"), m_maincpu(*this, "maincpu"), m_custom(*this, "custom"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } - - required_shared_ptr m_imageram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scanline; + m_palette(*this, "palette") + { } - required_device m_maincpu; - required_device m_custom; - required_device m_screen; - required_device m_palette; + DECLARE_CUSTOM_INPUT_MEMBER(firq_beam_r); + DECLARE_CUSTOM_INPUT_MEMBER(firq_vblank_r); + DECLARE_CUSTOM_INPUT_MEMBER(hitnmiss_button1_r); + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); + DECLARE_DRIVER_INIT(showdown); + DECLARE_DRIVER_INIT(yukon); + DECLARE_DRIVER_INIT(exidy440); + DECLARE_DRIVER_INIT(claypign); + void exidy440(machine_config &config); - uint8_t m_bank; - const uint8_t *m_showdown_bank_data[2]; - int8_t m_showdown_bank_select; - uint8_t m_showdown_bank_offset; - uint8_t m_firq_vblank; - uint8_t m_firq_beam; - uint8_t m_topsecex_yscroll; - uint8_t m_latched_x; - std::unique_ptr m_local_videoram; - std::unique_ptr m_local_paletteram; - uint8_t m_firq_enable; - uint8_t m_firq_select; - uint8_t m_palettebank_io; - uint8_t m_palettebank_vis; - emu_timer *m_collide_firq_timer; +protected: DECLARE_WRITE8_MEMBER(bankram_w); DECLARE_READ8_MEMBER(exidy440_input_port_3_r); DECLARE_READ8_MEMBER(sound_command_ack_r); @@ -57,8 +49,6 @@ public: DECLARE_WRITE8_MEMBER(exidy440_coin_counter_w); DECLARE_READ8_MEMBER(showdown_bank0_r); DECLARE_READ8_MEMBER(claypign_protection_r); - DECLARE_READ8_MEMBER(topsecex_input_port_5_r); - DECLARE_WRITE8_MEMBER(topsecex_yscroll_w); DECLARE_READ8_MEMBER(exidy440_videoram_r); DECLARE_WRITE8_MEMBER(exidy440_videoram_w); DECLARE_READ8_MEMBER(exidy440_paletteram_r); @@ -68,33 +58,67 @@ public: DECLARE_WRITE8_MEMBER(exidy440_spriteram_w); DECLARE_WRITE8_MEMBER(exidy440_control_w); DECLARE_WRITE8_MEMBER(exidy440_interrupt_clear_w); - DECLARE_CUSTOM_INPUT_MEMBER(firq_beam_r); - DECLARE_CUSTOM_INPUT_MEMBER(firq_vblank_r); - DECLARE_CUSTOM_INPUT_MEMBER(hitnmiss_button1_r); - DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - DECLARE_DRIVER_INIT(showdown); - DECLARE_DRIVER_INIT(topsecex); - DECLARE_DRIVER_INIT(yukon); - DECLARE_DRIVER_INIT(exidy440); - DECLARE_DRIVER_INIT(claypign); - virtual void machine_start() override; - virtual void machine_reset() override; - DECLARE_VIDEO_START(exidy440); - DECLARE_VIDEO_START(topsecex); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int scroll_offset, int check_collision); void update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int scroll_offset, int check_collision); uint32_t screen_update_exidy440(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(exidy440_vblank_interrupt); TIMER_CALLBACK_MEMBER(delayed_sound_command_w); TIMER_CALLBACK_MEMBER(beam_firq_callback); TIMER_CALLBACK_MEMBER(collide_firq_callback); void exidy440_update_firq(); void exidy440_bank_select(uint8_t bank); - void exidy440(machine_config &config); + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; void exidy440_video(machine_config &config); - void topsecex(machine_config &config); - void topsecex_video(machine_config &config); void exidy440_map(address_map &map); void exidy440_audio_map(address_map &map); + + required_shared_ptr m_imageram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scanline; + + required_device m_maincpu; + required_device m_custom; + required_device m_screen; + required_device m_palette; + +private: + uint8_t m_bank; + const uint8_t *m_showdown_bank_data[2]; + int8_t m_showdown_bank_select; + uint8_t m_showdown_bank_offset; + uint8_t m_firq_vblank; + uint8_t m_firq_beam; + uint8_t m_latched_x; + std::unique_ptr m_local_videoram; + std::unique_ptr m_local_paletteram; + uint8_t m_firq_enable; + uint8_t m_firq_select; + uint8_t m_palettebank_io; + uint8_t m_palettebank_vis; + emu_timer *m_collide_firq_timer; }; + + +class topsecex_state : public exidy440_state +{ +public: + using exidy440_state::exidy440_state; + DECLARE_DRIVER_INIT(topsecex); + void topsecex(machine_config &config); + +protected: + void topsecex_video(machine_config &config); + DECLARE_READ8_MEMBER(topsecex_input_port_5_r); + DECLARE_WRITE8_MEMBER(topsecex_yscroll_w); + uint32_t screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + virtual void video_start() override; + +private: + uint8_t m_topsecex_yscroll; +}; + +#endif // MAME_INCLUDES_EXIDY440_H diff --git a/src/mame/includes/foodf.h b/src/mame/includes/foodf.h index 8e15da171ae..b76869a0944 100644 --- a/src/mame/includes/foodf.h +++ b/src/mame/includes/foodf.h @@ -5,6 +5,10 @@ Atari Food Fight hardware *************************************************************************/ +#ifndef MAME_INCLUDES_FOODF_H +#define MAME_INCLUDES_FOODF_H + +#pragma once #include "machine/atarigen.h" #include "machine/timer.h" @@ -13,22 +17,19 @@ class foodf_state : public atarigen_state { public: - foodf_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_nvram(*this, "nvram"), - m_playfield_tilemap(*this, "playfield"), - m_spriteram(*this, "spriteram") { } - - required_device m_nvram; - required_device m_playfield_tilemap; + foodf_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_nvram(*this, "nvram"), + m_playfield_tilemap(*this, "playfield"), + m_spriteram(*this, "spriteram") + { } - double m_rweights[3]; - double m_gweights[3]; - double m_bweights[2]; - uint8_t m_playfield_flip; + void foodf(machine_config &config); - uint8_t m_whichport; - required_shared_ptr m_spriteram; +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(nvram_recall_w); DECLARE_WRITE8_MEMBER(digital_w); @@ -38,11 +39,22 @@ public: void foodf_set_flip(int flip); DECLARE_READ8_MEMBER(pot_r); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - DECLARE_MACHINE_START(foodf); - DECLARE_MACHINE_RESET(foodf); - DECLARE_VIDEO_START(foodf); uint32_t screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline_update_timer); - void foodf(machine_config &config); + void main_map(address_map &map); + +private: + required_device m_nvram; + required_device m_playfield_tilemap; + + double m_rweights[3]; + double m_gweights[3]; + double m_bweights[2]; + uint8_t m_playfield_flip; + + uint8_t m_whichport; + required_shared_ptr m_spriteram; }; + +#endif // MAME_INCLUDES_FOODF_H diff --git a/src/mame/includes/gauntlet.h b/src/mame/includes/gauntlet.h index a20f0d5c8b0..f092bc9824f 100644 --- a/src/mame/includes/gauntlet.h +++ b/src/mame/includes/gauntlet.h @@ -5,6 +5,10 @@ Atari Gauntlet hardware *************************************************************************/ +#ifndef MAME_INCLUDES_GAUNTLET_H +#define MAME_INCLUDES_GAUNTLET_H + +#pragma once #include "machine/atarigen.h" #include "machine/74259.h" @@ -16,33 +20,30 @@ class gauntlet_state : public atarigen_state { public: - gauntlet_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_audiocpu(*this, "audiocpu"), - m_soundcomm(*this, "soundcomm"), - m_ym2151(*this, "ymsnd"), - m_pokey(*this, "pokey"), - m_tms5220(*this, "tms"), - m_soundctl(*this, "soundctl"), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_mob(*this, "mob") { } - - required_device m_audiocpu; - required_device m_soundcomm; - required_device m_ym2151; - required_device m_pokey; - required_device m_tms5220; - required_device m_soundctl; + gauntlet_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_audiocpu(*this, "audiocpu"), + m_soundcomm(*this, "soundcomm"), + m_ym2151(*this, "ymsnd"), + m_pokey(*this, "pokey"), + m_tms5220(*this, "tms"), + m_soundctl(*this, "soundctl"), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_mob(*this, "mob") + { } - required_device m_playfield_tilemap; - required_device m_alpha_tilemap; - required_device m_mob; + DECLARE_DRIVER_INIT(gauntlet); + DECLARE_DRIVER_INIT(vindctr2); + void vindctr2(machine_config &config); + void gauntlet(machine_config &config); + void gaunt2p(machine_config &config); + void gauntlet2(machine_config &config); - uint16_t m_sound_reset_val; - uint8_t m_vindctr2_screen_refresh; - uint8_t m_playfield_tile_bank; - uint8_t m_playfield_color_bank; +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_WRITE16_MEMBER(sound_reset_w); @@ -53,23 +54,34 @@ public: DECLARE_WRITE8_MEMBER(mixer_w); void swap_memory(void *ptr1, void *ptr2, int bytes); void common_init(int vindctr2); - DECLARE_DRIVER_INIT(gauntlet); - DECLARE_DRIVER_INIT(vindctr2); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - DECLARE_MACHINE_START(gauntlet); - DECLARE_MACHINE_RESET(gauntlet); - DECLARE_VIDEO_START(gauntlet); uint32_t screen_update_gauntlet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER( gauntlet_xscroll_w ); DECLARE_WRITE16_MEMBER( gauntlet_yscroll_w ); - static const atari_motion_objects_config s_mob_config; void gauntlet_base(machine_config &config); - void vindctr2(machine_config &config); - void gauntlet(machine_config &config); - void gaunt2p(machine_config &config); - void gauntlet2(machine_config &config); void main_map(address_map &map); void sound_map(address_map &map); + +private: + required_device m_audiocpu; + required_device m_soundcomm; + required_device m_ym2151; + required_device m_pokey; + required_device m_tms5220; + required_device m_soundctl; + + required_device m_playfield_tilemap; + required_device m_alpha_tilemap; + required_device m_mob; + + uint16_t m_sound_reset_val; + uint8_t m_vindctr2_screen_refresh; + uint8_t m_playfield_tile_bank; + uint8_t m_playfield_color_bank; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_GAUNTLET_H diff --git a/src/mame/includes/gridlee.h b/src/mame/includes/gridlee.h index 3a134117855..413c3b6acb1 100644 --- a/src/mame/includes/gridlee.h +++ b/src/mame/includes/gridlee.h @@ -7,6 +7,10 @@ driver by Aaron Giles ***************************************************************************/ +#ifndef MAME_INCLUDES_GRIDLEE_H +#define MAME_INCLUDES_GRIDLEE_H + +#pragma once #include "sound/samples.h" #include "machine/74259.h" @@ -27,34 +31,19 @@ class gridlee_state : public driver_device { public: - gridlee_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + gridlee_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_latch(*this, "latch"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_device m_maincpu; - required_device m_latch; - required_device m_screen; - required_device m_palette; - - uint8_t m_last_analog_input[2]; - uint8_t m_last_analog_output[2]; - std::unique_ptr m_poly17; - uint8_t *m_rand17; - emu_timer *m_irq_off; - emu_timer *m_irq_timer; - emu_timer *m_firq_off; - emu_timer *m_firq_timer; - uint8_t m_cocktail_flip; - std::unique_ptr m_local_videoram; - uint8_t m_palettebank_vis; + void gridlee(machine_config &config); +protected: DECLARE_READ8_MEMBER(analog_port_r); DECLARE_READ8_MEMBER(random_num_r); DECLARE_WRITE8_MEMBER(latch_w); @@ -64,9 +53,6 @@ public: DECLARE_WRITE_LINE_MEMBER(cocktail_flip_w); DECLARE_WRITE8_MEMBER(gridlee_videoram_w); DECLARE_WRITE8_MEMBER(gridlee_palette_select_w); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; DECLARE_PALETTE_INIT(gridlee); uint32_t screen_update_gridlee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(irq_off_tick); @@ -75,8 +61,31 @@ public: TIMER_CALLBACK_MEMBER(firq_timer_tick); void expand_pixels(); void poly17_init(); - void gridlee(machine_config &config); void cpu1_map(address_map &map); + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_device m_maincpu; + required_device m_latch; + required_device m_screen; + required_device m_palette; + + uint8_t m_last_analog_input[2]; + uint8_t m_last_analog_output[2]; + std::unique_ptr m_poly17; + uint8_t *m_rand17; + emu_timer *m_irq_off; + emu_timer *m_irq_timer; + emu_timer *m_firq_off; + emu_timer *m_firq_timer; + uint8_t m_cocktail_flip; + std::unique_ptr m_local_videoram; + uint8_t m_palettebank_vis; }; @@ -112,3 +121,5 @@ private: }; DECLARE_DEVICE_TYPE(GRIDLEE, gridlee_sound_device) + +#endif // MAME_INCLUDES_GRIDLEE_H diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h index ffda13271ff..a4560f42dc7 100644 --- a/src/mame/includes/irobot.h +++ b/src/mame/includes/irobot.h @@ -5,39 +5,81 @@ Atari I, Robot hardware *************************************************************************/ +#ifndef MAME_INCLUDES_IROBOT_H +#define MAME_INCLUDES_IROBOT_H + +#pragma once #include "machine/timer.h" #include "screen.h" #define IR_TIMING 1 /* try to emulate MB and VG running time */ -struct irmb_ops -{ - const struct irmb_ops *nxtop; - uint32_t func; - uint32_t diradd; - uint32_t latchmask; - uint32_t *areg; - uint32_t *breg; - uint8_t cycles; - uint8_t diren; - uint8_t flags; - uint8_t ramsel; -}; - - class irobot_state : public driver_device { public: - irobot_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_nvram(*this, "nvram") , + struct irmb_ops + { + const struct irmb_ops *nxtop; + uint32_t func; + uint32_t diradd; + uint32_t latchmask; + uint32_t *areg; + uint32_t *breg; + uint8_t cycles; + uint8_t diren; + uint8_t flags; + uint8_t ramsel; + }; + + irobot_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_nvram(*this, "nvram") , m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } + + DECLARE_DRIVER_INIT(irobot); + + void irobot(machine_config &config); + +protected: + virtual void machine_reset() override; + virtual void video_start() override; + void irobot_map(address_map &map); + + DECLARE_WRITE8_MEMBER(irobot_nvram_w); + DECLARE_WRITE8_MEMBER(irobot_clearirq_w); + DECLARE_WRITE8_MEMBER(irobot_clearfirq_w); + DECLARE_READ8_MEMBER(irobot_sharedmem_r); + DECLARE_WRITE8_MEMBER(irobot_sharedmem_w); + DECLARE_WRITE8_MEMBER(irobot_statwr_w); + DECLARE_WRITE8_MEMBER(irobot_out0_w); + DECLARE_WRITE8_MEMBER(irobot_rom_banksel_w); + DECLARE_WRITE8_MEMBER(irobot_control_w); + DECLARE_READ8_MEMBER(irobot_control_r); + DECLARE_READ8_MEMBER(irobot_status_r); + DECLARE_WRITE8_MEMBER(irobot_paletteram_w); + DECLARE_READ8_MEMBER(quad_pokeyn_r); + DECLARE_WRITE8_MEMBER(quad_pokeyn_w); + DECLARE_PALETTE_INIT(irobot); + uint32_t screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_CALLBACK_MEMBER(scanline_callback); + TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback); + TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback); + void irobot_poly_clear(uint8_t *bitmap_base); + void irobot_poly_clear(); + void draw_line(uint8_t *polybitmap, int x1, int y1, int x2, int y2, int col); + void irobot_run_video(); + uint32_t irmb_din(const irmb_ops *curop); + void irmb_dout(const irmb_ops *curop, uint32_t d); + void load_oproms(); + void irmb_run(); +private: required_shared_ptr m_nvram; required_shared_ptr m_videoram; uint8_t m_vg_clear; @@ -70,40 +112,11 @@ public: int m_ir_ymin; int m_ir_xmax; int m_ir_ymax; - DECLARE_WRITE8_MEMBER(irobot_nvram_w); - DECLARE_WRITE8_MEMBER(irobot_clearirq_w); - DECLARE_WRITE8_MEMBER(irobot_clearfirq_w); - DECLARE_READ8_MEMBER(irobot_sharedmem_r); - DECLARE_WRITE8_MEMBER(irobot_sharedmem_w); - DECLARE_WRITE8_MEMBER(irobot_statwr_w); - DECLARE_WRITE8_MEMBER(irobot_out0_w); - DECLARE_WRITE8_MEMBER(irobot_rom_banksel_w); - DECLARE_WRITE8_MEMBER(irobot_control_w); - DECLARE_READ8_MEMBER(irobot_control_r); - DECLARE_READ8_MEMBER(irobot_status_r); - DECLARE_WRITE8_MEMBER(irobot_paletteram_w); - DECLARE_READ8_MEMBER(quad_pokeyn_r); - DECLARE_WRITE8_MEMBER(quad_pokeyn_w); - DECLARE_DRIVER_INIT(irobot); - virtual void machine_reset() override; - virtual void video_start() override; - DECLARE_PALETTE_INIT(irobot); - uint32_t screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(scanline_callback); - TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback); - TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback); - void _irobot_poly_clear(uint8_t *bitmap_base); - void irobot_poly_clear(); - void draw_line(uint8_t *polybitmap, int x1, int y1, int x2, int y2, int col); - void irobot_run_video(); - uint32_t irmb_din(const irmb_ops *curop); - void irmb_dout(const irmb_ops *curop, uint32_t d); - void load_oproms(); - void irmb_run(); + required_device m_maincpu; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - void irobot(machine_config &config); - void irobot_map(address_map &map); }; + +#endif // MAME_INCLUDES_IROBOT_H diff --git a/src/mame/includes/jedi.h b/src/mame/includes/jedi.h index 65bc928bbdb..ba12b49e08e 100644 --- a/src/mame/includes/jedi.h +++ b/src/mame/includes/jedi.h @@ -5,6 +5,10 @@ Atari Return of the Jedi hardware *************************************************************************/ +#ifndef MAME_INCLUDES_JEDI_H +#define MAME_INCLUDES_JEDI_H + +#pragma once #include "screen.h" @@ -21,8 +25,8 @@ class jedi_state : public driver_device { public: - jedi_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + jedi_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_nvram(*this, "nvram") , m_backgroundram(*this, "backgroundram"), m_paletteram(*this, "paletteram"), @@ -36,30 +40,10 @@ public: m_screen(*this, "screen") { } - required_shared_ptr m_nvram; - - /* machine state */ - uint8_t m_a2d_select; - uint8_t m_nvram_enabled; - emu_timer *m_interrupt_timer; - - /* video state */ - required_shared_ptr m_backgroundram; - required_shared_ptr m_paletteram; - required_shared_ptr m_foregroundram; - required_shared_ptr m_spriteram; - required_shared_ptr m_smoothing_table; - uint32_t m_vscroll; - uint32_t m_hscroll; - bool m_foreground_bank; - bool m_video_off; + DECLARE_CUSTOM_INPUT_MEMBER(jedi_audio_comm_stat_r); + void jedi(machine_config &config); - /* audio state */ - uint8_t m_audio_latch; - uint8_t m_audio_ack_latch; - required_shared_ptr m_audio_comm_stat; - required_shared_ptr m_speech_data; - uint8_t m_speech_strobe_state; +protected: DECLARE_WRITE8_MEMBER(main_irq_ack_w); DECLARE_WRITE8_MEMBER(rom_banksel_w); DECLARE_READ8_MEMBER(a2d_data_r); @@ -70,7 +54,6 @@ public: DECLARE_WRITE8_MEMBER(nvram_enable_w); DECLARE_WRITE8_MEMBER(jedi_vscroll_w); DECLARE_WRITE8_MEMBER(jedi_hscroll_w); - DECLARE_CUSTOM_INPUT_MEMBER(jedi_audio_comm_stat_r); DECLARE_WRITE8_MEMBER(irq_ack_w); DECLARE_WRITE_LINE_MEMBER(audio_reset_w); DECLARE_WRITE8_MEMBER(jedi_audio_latch_w); @@ -94,12 +77,40 @@ public: void do_pen_lookup(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_background_and_text(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_screen; - void jedi(machine_config &config); void jedi_audio(machine_config &config); void jedi_video(machine_config &config); void audio_map(address_map &map); void main_map(address_map &map); + +private: + required_shared_ptr m_nvram; + + /* machine state */ + uint8_t m_a2d_select; + uint8_t m_nvram_enabled; + emu_timer *m_interrupt_timer; + + /* video state */ + required_shared_ptr m_backgroundram; + required_shared_ptr m_paletteram; + required_shared_ptr m_foregroundram; + required_shared_ptr m_spriteram; + required_shared_ptr m_smoothing_table; + uint32_t m_vscroll; + uint32_t m_hscroll; + bool m_foreground_bank; + bool m_video_off; + + /* audio state */ + uint8_t m_audio_latch; + uint8_t m_audio_ack_latch; + required_shared_ptr m_audio_comm_stat; + required_shared_ptr m_speech_data; + uint8_t m_speech_strobe_state; + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_screen; }; + +#endif // MAME_INCLUDES_JEDI_H diff --git a/src/mame/includes/klax.h b/src/mame/includes/klax.h index a1682cc02a6..d17ef34aa69 100644 --- a/src/mame/includes/klax.h +++ b/src/mame/includes/klax.h @@ -5,6 +5,10 @@ Atari Klax hardware *************************************************************************/ +#ifndef MAME_INCLUDES_KLAX_H +#define MAME_INCLUDES_KLAX_H + +#pragma once #include "machine/atarigen.h" #include "video/atarimo.h" @@ -19,8 +23,11 @@ public: , m_p1(*this, "P1") { } - DECLARE_MACHINE_START(klax); - DECLARE_MACHINE_RESET(klax); + void klax(machine_config &config); + void klax2bl(machine_config &config); + +protected: + virtual void machine_reset() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -29,20 +36,20 @@ public: DECLARE_WRITE16_MEMBER(klax_latch_w); - DECLARE_VIDEO_START(klax); TILE_GET_INFO_MEMBER(get_playfield_tile_info); uint32_t screen_update_klax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - - void klax(machine_config &config); - void klax2bl(machine_config &config); void bootleg_sound_map(address_map &map); void klax2bl_map(address_map &map); void klax_map(address_map &map); + private: required_device m_playfield_tilemap; required_device m_mob; required_ioport m_p1; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_KLAX_H diff --git a/src/mame/includes/lynx.h b/src/mame/includes/lynx.h index 6ed055e9406..17e321cf868 100644 --- a/src/mame/includes/lynx.h +++ b/src/mame/includes/lynx.h @@ -5,10 +5,11 @@ * includes/lynx.h * ****************************************************************************/ - #ifndef MAME_INCLUDES_LYNX_H #define MAME_INCLUDES_LYNX_H +#pragma once + #include "audio/lynx.h" #include "imagedev/snapquik.h" #include "bus/generic/slot.h" @@ -18,86 +19,86 @@ #define LYNX_QUICKLOAD 1 -struct BLITTER -{ - // global - uint16_t screen; - uint16_t colbuf; - uint16_t colpos; // byte where value of collision is written - int16_t xoff, yoff; - // in command - int mode; - uint8_t spr_coll; - uint8_t spritenr; - int16_t x_pos,y_pos; - uint16_t width, height; // uint16 important for blue lightning - int16_t tilt_accumulator; - uint16_t height_accumulator, width_accumulator; - uint16_t width_offset, height_offset; - int16_t stretch, tilt; - uint8_t color[16]; // or stored - uint16_t bitmap; - int use_rle; - int line_color; - - uint8_t spr_ctl0; - uint8_t spr_ctl1; - uint16_t scb; - uint16_t scb_next; - uint8_t sprite_collide; - - int everon; - uint8_t fred; - int memory_accesses; - attotime time; - - int no_collide; - int vstretch; - int lefthanded; - int busy; -}; +#define NR_LYNX_TIMERS 8 -struct UART +class lynx_state : public driver_device { - uint8_t serctl; - uint8_t data_received, data_to_send, buffer; - int received; - int sending; - int buffer_loaded; -}; +public: + struct BLITTER + { + // global + uint16_t screen; + uint16_t colbuf; + uint16_t colpos; // byte where value of collision is written + int16_t xoff, yoff; + // in command + int mode; + uint8_t spr_coll; + uint8_t spritenr; + int16_t x_pos,y_pos; + uint16_t width, height; // uint16 important for blue lightning + int16_t tilt_accumulator; + uint16_t height_accumulator, width_accumulator; + uint16_t width_offset, height_offset; + int16_t stretch, tilt; + uint8_t color[16]; // or stored + uint16_t bitmap; + int use_rle; + int line_color; + + uint8_t spr_ctl0; + uint8_t spr_ctl1; + uint16_t scb; + uint16_t scb_next; + uint8_t sprite_collide; + + int everon; + uint8_t fred; + int memory_accesses; + attotime time; + + int no_collide; + int vstretch; + int lefthanded; + int busy; + }; -struct SUZY -{ - uint8_t data[0x100]; - uint8_t high; - int low; - int signed_math; - int accumulate; - int accumulate_overflow; -}; + struct UART + { + uint8_t serctl; + uint8_t data_received, data_to_send, buffer; + int received; + int sending; + int buffer_loaded; + }; -struct MIKEY -{ - uint8_t data[0x100]; - uint16_t disp_addr; - uint8_t vb_rest; -}; + struct SUZY + { + uint8_t data[0x100]; + uint8_t high; + int low; + int signed_math; + int accumulate; + int accumulate_overflow; + }; -struct LYNX_TIMER -{ - uint8_t bakup; - uint8_t cntrl1; - uint8_t cntrl2; - uint8_t counter; - emu_timer *timer; - int timer_active; -}; + struct MIKEY + { + uint8_t data[0x100]; + uint16_t disp_addr; + uint8_t vb_rest; + }; -#define NR_LYNX_TIMERS 8 + struct LYNX_TIMER + { + uint8_t bakup; + uint8_t cntrl1; + uint8_t cntrl2; + uint8_t counter; + emu_timer *timer; + int timer_active; + }; -class lynx_state : public driver_device -{ -public: enum { TIMER_BLITTER, @@ -106,8 +107,8 @@ public: TIMER_UART }; - lynx_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + lynx_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_mem_0000(*this, "mem_0000"), m_mem_fc00(*this, "mem_fc00"), m_mem_fd00(*this, "mem_fd00"), @@ -116,36 +117,11 @@ public: m_maincpu(*this, "maincpu"), m_sound(*this, "custom"), m_cart(*this, "cartslot"), - m_palette(*this, "palette") { } - - virtual void video_start() override; + m_palette(*this, "palette") + { } uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_mem_0000; - required_shared_ptr m_mem_fc00; - required_shared_ptr m_mem_fd00; - required_shared_ptr m_mem_fe00; - required_shared_ptr m_mem_fffa; - required_device m_maincpu; - required_device m_sound; - required_device m_cart; - required_device m_palette; - uint16_t m_granularity; - int m_sign_AB; - int m_sign_CD; - uint32_t m_lynx_palette[0x10]; - int m_rotate; - uint8_t m_memory_config; - - BLITTER m_blitter; - SUZY m_suzy; - MIKEY m_mikey; - UART m_uart; - LYNX_TIMER m_timer[NR_LYNX_TIMERS]; - - bitmap_ind16 m_bitmap; - bitmap_ind16 m_bitmap_temp; DECLARE_READ8_MEMBER(suzy_read); DECLARE_WRITE8_MEMBER(suzy_write); DECLARE_WRITE8_MEMBER(lynx_uart_w); @@ -158,8 +134,6 @@ public: void lynx_multiply(); uint8_t lynx_timer_read(int which, int offset); void lynx_timer_write(int which, int offset, uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; DECLARE_PALETTE_INIT(lynx); void sound_cb(); TIMER_CALLBACK_MEMBER(lynx_blitter_timer); @@ -183,11 +157,40 @@ public: void lynx_uart_reset(); image_verify_result lynx_verify_cart(char *header, int kind); DECLARE_QUICKLOAD_LOAD_MEMBER( lynx ); - void lynx(machine_config &config); - void lynx_mem(address_map &map); + protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void lynx_mem(address_map &map); + +private: + required_shared_ptr m_mem_0000; + required_shared_ptr m_mem_fc00; + required_shared_ptr m_mem_fd00; + required_shared_ptr m_mem_fe00; + required_shared_ptr m_mem_fffa; + required_device m_maincpu; + required_device m_sound; + required_device m_cart; + required_device m_palette; + uint16_t m_granularity; + int m_sign_AB; + int m_sign_CD; + uint32_t m_lynx_palette[0x10]; + int m_rotate; + uint8_t m_memory_config; + + BLITTER m_blitter; + SUZY m_suzy; + MIKEY m_mikey; + UART m_uart; + LYNX_TIMER m_timer[NR_LYNX_TIMERS]; + + bitmap_ind16 m_bitmap; + bitmap_ind16 m_bitmap_temp; }; diff --git a/src/mame/includes/metalmx.h b/src/mame/includes/metalmx.h index f9725703eca..ed8da93bc29 100644 --- a/src/mame/includes/metalmx.h +++ b/src/mame/includes/metalmx.h @@ -1,5 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Philip Bennett +#ifndef MAME_INCLUDES_METALMX_H +#define MAME_INCLUDES_METALMX_H + +#pragma once + #include "audio/cage.h" #include "cpu/adsp2100/adsp2100.h" @@ -10,29 +15,23 @@ class metalmx_state : public driver_device { public: - metalmx_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_gsp(*this, "gsp"), - m_adsp(*this, "adsp"), - m_dsp32c_1(*this, "dsp32c_1"), - m_dsp32c_2(*this, "dsp32c_2"), - m_cage(*this, "cage"), + metalmx_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gsp(*this, "gsp"), + m_adsp(*this, "adsp"), + m_dsp32c_1(*this, "dsp32c_1"), + m_dsp32c_2(*this, "dsp32c_2"), + m_cage(*this, "cage"), m_adsp_internal_program_ram(*this, "adsp_intprog"), m_gsp_dram(*this, "gsp_dram"), - m_gsp_vram(*this, "gsp_vram"){ } - - required_device m_maincpu; - required_device m_gsp; - required_device m_adsp; - required_device m_dsp32c_1; - required_device m_dsp32c_2; - required_device m_cage; + m_gsp_vram(*this, "gsp_vram") + { } - required_shared_ptr m_adsp_internal_program_ram; - required_shared_ptr m_gsp_dram; - required_shared_ptr m_gsp_vram; + DECLARE_DRIVER_INIT(metalmx); + void metalmx(machine_config &config); +protected: DECLARE_READ32_MEMBER(unk_r); DECLARE_READ32_MEMBER(watchdog_r); DECLARE_WRITE32_MEMBER(shifter_w); @@ -51,16 +50,28 @@ public: DECLARE_READ32_MEMBER(host_vram_r); DECLARE_WRITE32_MEMBER(host_vram_w); DECLARE_WRITE32_MEMBER(timer_w); - DECLARE_DRIVER_INIT(metalmx); DECLARE_WRITE8_MEMBER(cage_irq_callback); virtual void machine_reset() override; virtual void video_start() override; uint32_t screen_update_metalmx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void metalmx(machine_config &config); void adsp_data_map(address_map &map); void adsp_program_map(address_map &map); void dsp32c_1_map(address_map &map); void dsp32c_2_map(address_map &map); void gsp_map(address_map &map); void main_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_gsp; + required_device m_adsp; + required_device m_dsp32c_1; + required_device m_dsp32c_2; + required_device m_cage; + + required_shared_ptr m_adsp_internal_program_ram; + required_shared_ptr m_gsp_dram; + required_shared_ptr m_gsp_vram; }; + +#endif // MAME_INCLUDES_METALMX_H diff --git a/src/mame/includes/nitedrvr.h b/src/mame/includes/nitedrvr.h index 8e18e2d2330..c10615ad9a3 100644 --- a/src/mame/includes/nitedrvr.h +++ b/src/mame/includes/nitedrvr.h @@ -5,6 +5,10 @@ Atari Night Driver hardware *************************************************************************/ +#ifndef MAME_INCLUDES_NITEDRVR_H +#define MAME_INCLUDES_NITEDRVR_H + +#pragma once #include "machine/timer.h" #include "sound/discrete.h" @@ -21,15 +25,38 @@ class nitedrvr_state : public driver_device { public: - nitedrvr_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + nitedrvr_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_hvc(*this, "hvc"), m_maincpu(*this, "maincpu"), m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"){ } + m_palette(*this, "palette") + { } + + void nitedrvr(machine_config &config); + +protected: + DECLARE_READ8_MEMBER(nitedrvr_steering_reset_r); + DECLARE_WRITE8_MEMBER(nitedrvr_steering_reset_w); + DECLARE_READ8_MEMBER(nitedrvr_in0_r); + DECLARE_READ8_MEMBER(nitedrvr_in1_r); + DECLARE_WRITE8_MEMBER(nitedrvr_out0_w); + DECLARE_WRITE8_MEMBER(nitedrvr_out1_w); + DECLARE_WRITE8_MEMBER(nitedrvr_videoram_w); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + uint32_t screen_update_nitedrvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TIMER_DEVICE_CALLBACK_MEMBER(nitedrvr_crash_toggle_callback); + void draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect, int bx, int by, int ex, int ey); + void draw_roadway(bitmap_ind16 &bitmap, const rectangle &cliprect); + int nitedrvr_steering(); + void nitedrvr_map(address_map &map); +private: /* memory pointers */ required_shared_ptr m_videoram; required_shared_ptr m_hvc; @@ -53,26 +80,9 @@ public: required_device m_discrete; required_device m_gfxdecode; required_device m_palette; - - DECLARE_READ8_MEMBER(nitedrvr_steering_reset_r); - DECLARE_WRITE8_MEMBER(nitedrvr_steering_reset_w); - DECLARE_READ8_MEMBER(nitedrvr_in0_r); - DECLARE_READ8_MEMBER(nitedrvr_in1_r); - DECLARE_WRITE8_MEMBER(nitedrvr_out0_w); - DECLARE_WRITE8_MEMBER(nitedrvr_out1_w); - DECLARE_WRITE8_MEMBER(nitedrvr_videoram_w); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_nitedrvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(nitedrvr_crash_toggle_callback); - void draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect, int bx, int by, int ex, int ey); - void draw_roadway(bitmap_ind16 &bitmap, const rectangle &cliprect); - int nitedrvr_steering(); - void nitedrvr(machine_config &config); - void nitedrvr_map(address_map &map); }; /*----------- defined in audio/nitedrvr.c -----------*/ DISCRETE_SOUND_EXTERN( nitedrvr ); + +#endif // MAME_INCLUDES_NITEDRVR_H diff --git a/src/mame/includes/offtwall.h b/src/mame/includes/offtwall.h index a14a74710a8..7b414e3d3c2 100644 --- a/src/mame/includes/offtwall.h +++ b/src/mame/includes/offtwall.h @@ -5,6 +5,10 @@ Atari "Round" hardware *************************************************************************/ +#ifndef MAME_INCLUDES_OFFTWALL_H +#define MAME_INCLUDES_OFFTWALL_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -13,38 +17,43 @@ class offtwall_state : public atarigen_state { public: - offtwall_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_jsa(*this, "jsa"), - m_vad(*this, "vad"), - m_mainram(*this, "mainram"), - m_bankrom_base(*this, "bankrom_base") { } + offtwall_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_jsa(*this, "jsa"), + m_vad(*this, "vad"), + m_mainram(*this, "mainram"), + m_bankrom_base(*this, "bankrom_base") + { } - required_device m_jsa; - required_device m_vad; - required_shared_ptr m_mainram; + DECLARE_DRIVER_INIT(offtwall); + DECLARE_DRIVER_INIT(offtwalc); - uint16_t *m_bankswitch_base; - required_shared_ptr m_bankrom_base; - uint32_t m_bank_offset; + void offtwall(machine_config &config); - uint16_t *m_spritecache_count; - uint16_t *m_unknown_verify_base; +protected: virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(io_latch_w); DECLARE_READ16_MEMBER(bankswitch_r); DECLARE_READ16_MEMBER(bankrom_r); DECLARE_READ16_MEMBER(spritecache_count_r); DECLARE_READ16_MEMBER(unknown_verify_r); - DECLARE_DRIVER_INIT(offtwall); - DECLARE_DRIVER_INIT(offtwalc); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - DECLARE_MACHINE_START(offtwall); - DECLARE_MACHINE_RESET(offtwall); - DECLARE_VIDEO_START(offtwall); uint32_t screen_update_offtwall(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void main_map(address_map &map); + +private: + required_device m_jsa; + required_device m_vad; + required_shared_ptr m_mainram; + + uint16_t *m_bankswitch_base; + required_shared_ptr m_bankrom_base; + uint32_t m_bank_offset; + + uint16_t *m_spritecache_count; + uint16_t *m_unknown_verify_base; static const atari_motion_objects_config s_mob_config; - void offtwall(machine_config &config); - void main_map(address_map &map); }; + +#endif // MAME_INCLUDES_OFFTWALL_H diff --git a/src/mame/includes/ohmygod.h b/src/mame/includes/ohmygod.h index 7094947313b..e692940034d 100644 --- a/src/mame/includes/ohmygod.h +++ b/src/mame/includes/ohmygod.h @@ -5,19 +5,43 @@ Oh My God! *************************************************************************/ +#ifndef MAME_INCLUDES_OHMYGOD_H +#define MAME_INCLUDES_OHMYGOD_H + +#pragma once class ohmygod_state : public driver_device { public: - ohmygod_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + ohmygod_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } + + DECLARE_DRIVER_INIT(ohmygod); + DECLARE_DRIVER_INIT(naname); + void ohmygod(machine_config &config); +protected: + DECLARE_WRITE16_MEMBER(ohmygod_ctrl_w); + DECLARE_WRITE16_MEMBER(ohmygod_videoram_w); + DECLARE_WRITE16_MEMBER(ohmygod_spritebank_w); + DECLARE_WRITE16_MEMBER(ohmygod_scrollx_w); + DECLARE_WRITE16_MEMBER(ohmygod_scrolly_w); + TILE_GET_INFO_MEMBER(get_tile_info); + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + uint32_t screen_update_ohmygod(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); + void ohmygod_map(address_map &map); + void oki_map(address_map &map); +private: /* memory pointers */ required_shared_ptr m_videoram; required_shared_ptr m_spriteram; @@ -31,23 +55,10 @@ public: /* misc */ int m_adpcm_bank_shift; int m_sndbank; - DECLARE_WRITE16_MEMBER(ohmygod_ctrl_w); - DECLARE_WRITE16_MEMBER(ohmygod_videoram_w); - DECLARE_WRITE16_MEMBER(ohmygod_spritebank_w); - DECLARE_WRITE16_MEMBER(ohmygod_scrollx_w); - DECLARE_WRITE16_MEMBER(ohmygod_scrolly_w); - DECLARE_DRIVER_INIT(ohmygod); - DECLARE_DRIVER_INIT(naname); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_ohmygod(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); + required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - void ohmygod(machine_config &config); - void ohmygod_map(address_map &map); - void oki_map(address_map &map); }; + +#endif // MAME_INCLUDES_OHMYGOD_H diff --git a/src/mame/includes/orbit.h b/src/mame/includes/orbit.h index 3b922603902..c9312941f93 100644 --- a/src/mame/includes/orbit.h +++ b/src/mame/includes/orbit.h @@ -41,6 +41,9 @@ public: m_palette(*this, "palette") { } + void orbit(machine_config &config); + +protected: DECLARE_WRITE_LINE_MEMBER(coin_lockout_w); DECLARE_WRITE_LINE_MEMBER(heat_rst_led_w); DECLARE_WRITE_LINE_MEMBER(hyper_led_w); @@ -55,16 +58,15 @@ public: DECLARE_WRITE8_MEMBER(orbit_noise_amp_w); DECLARE_WRITE8_MEMBER(orbit_noise_rst_w); - void orbit(machine_config &config); - void orbit_map(address_map &map); -protected: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; + void orbit_map(address_map &map); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void update_misc_flags(address_space &space, uint8_t val); +private: /* memory pointers */ required_shared_ptr m_playfield_ram; required_shared_ptr m_sprite_ram; diff --git a/src/mame/includes/pcw16.h b/src/mame/includes/pcw16.h index 1d225a19cab..3f4b1497ccd 100644 --- a/src/mame/includes/pcw16.h +++ b/src/mame/includes/pcw16.h @@ -5,10 +5,11 @@ * includes/pcw16.h * ****************************************************************************/ - #ifndef MAME_INCLUDES_PCW16_H #define MAME_INCLUDES_PCW16_H +#pragma once + #include "cpu/z80/z80.h" #include "machine/upd765.h" /* FDC superio */ #include "machine/pc_lpt.h" /* PC-Parallel Port */ @@ -48,41 +49,9 @@ public: m_io_extra(*this, "EXTRA") { } - required_device m_maincpu; - required_device m_flash0; - required_device m_flash1; - required_device m_fdc; - required_device m_uart2; - required_device m_beeper; - required_device m_ram; - required_device m_keyboard; - required_memory_region m_region_rom; - required_ioport m_io_extra; + void pcw16(machine_config &config); - unsigned long m_interrupt_counter; - int m_banks[4]; - int m_4_bit_port; - int m_fdc_int_code; - int m_system_status; - char *m_mem_ptr[4]; - unsigned char m_keyboard_data_shift; - int m_keyboard_parity_table[256]; - int m_keyboard_bits; - int m_keyboard_bits_output; - int m_keyboard_state; - int m_keyboard_previous_state; - unsigned char m_rtc_seconds; - unsigned char m_rtc_minutes; - unsigned char m_rtc_hours; - unsigned char m_rtc_days_max; - unsigned char m_rtc_days; - unsigned char m_rtc_months; - unsigned char m_rtc_years; - unsigned char m_rtc_control; - unsigned char m_rtc_256ths_seconds; - int m_previous_fdc_int_state; - int m_colour_palette[16]; - int m_video_control; +protected: DECLARE_WRITE8_MEMBER(pcw16_palette_w); DECLARE_READ8_MEMBER(pcw16_bankhw_r); DECLARE_WRITE8_MEMBER(pcw16_bankhw_w); @@ -141,9 +110,46 @@ public: void pcw16_vh_decode_mode0(bitmap_ind16 &bitmap, int x, int y, unsigned char byte); void pcw16_vh_decode_mode1(bitmap_ind16 &bitmap, int x, int y, unsigned char byte); void pcw16_vh_decode_mode2(bitmap_ind16 &bitmap, int x, int y, unsigned char byte); - void pcw16(machine_config &config); + void pcw16_io(address_map &map); void pcw16_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_flash0; + required_device m_flash1; + required_device m_fdc; + required_device m_uart2; + required_device m_beeper; + required_device m_ram; + required_device m_keyboard; + required_memory_region m_region_rom; + required_ioport m_io_extra; + + unsigned long m_interrupt_counter; + int m_banks[4]; + int m_4_bit_port; + int m_fdc_int_code; + int m_system_status; + char *m_mem_ptr[4]; + unsigned char m_keyboard_data_shift; + int m_keyboard_parity_table[256]; + int m_keyboard_bits; + int m_keyboard_bits_output; + int m_keyboard_state; + int m_keyboard_previous_state; + unsigned char m_rtc_seconds; + unsigned char m_rtc_minutes; + unsigned char m_rtc_hours; + unsigned char m_rtc_days_max; + unsigned char m_rtc_days; + unsigned char m_rtc_months; + unsigned char m_rtc_years; + unsigned char m_rtc_control; + unsigned char m_rtc_256ths_seconds; + int m_previous_fdc_int_state; + int m_colour_palette[16]; + int m_video_control; }; #endif // MAME_INCLUDES_PCW16_H diff --git a/src/mame/includes/pecom.h b/src/mame/includes/pecom.h index bec69caea98..ddaa3daaac3 100644 --- a/src/mame/includes/pecom.h +++ b/src/mame/includes/pecom.h @@ -3,6 +3,8 @@ #ifndef MAME_INCLUDES_PECOM_H #define MAME_INCLUDES_PECOM_H +#pragma once + #include "cpu/cosmac/cosmac.h" #include "imagedev/cassette.h" #include "machine/ram.h" @@ -17,8 +19,8 @@ class pecom_state : public driver_device { public: - pecom_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + pecom_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_cdp1802(*this, CDP1802_TAG), m_cdp1869(*this, CDP1869_TAG), m_cassette(*this, "cassette"), @@ -27,18 +29,13 @@ public: m_bank2(*this, "bank2"), m_bank3(*this, "bank3"), m_bank4(*this, "bank4"), - m_io_cnt(*this, "CNT") { } - - required_device m_cdp1802; - required_device m_cdp1869; - - std::unique_ptr m_charram; /* character generator ROM */ - int m_reset; /* CPU mode */ - int m_dma; /* memory refresh DMA */ + m_io_cnt(*this, "CNT") + { } - /* timers */ - emu_timer *m_reset_timer; /* power on reset timer */ + DECLARE_INPUT_CHANGED_MEMBER(ef_w); + void pecom64(machine_config &config); +protected: DECLARE_READ8_MEMBER(pecom_cdp1869_charram_r); DECLARE_WRITE8_MEMBER(pecom_cdp1869_charram_w); DECLARE_READ8_MEMBER(pecom_cdp1869_pageram_r); @@ -46,10 +43,6 @@ public: DECLARE_WRITE8_MEMBER(pecom_bank_w); DECLARE_READ8_MEMBER(pecom_keyboard_r); DECLARE_WRITE8_MEMBER(pecom_cdp1869_w); - virtual void machine_start() override; - virtual void machine_reset() override; - DECLARE_VIDEO_START(pecom); - DECLARE_INPUT_CHANGED_MEMBER(ef_w); TIMER_CALLBACK_MEMBER(reset_tick); DECLARE_READ_LINE_MEMBER(clear_r); DECLARE_READ_LINE_MEMBER(ef2_r); @@ -59,12 +52,26 @@ public: CDP1869_CHAR_RAM_READ_MEMBER(pecom_char_ram_r); CDP1869_CHAR_RAM_WRITE_MEMBER(pecom_char_ram_w); CDP1869_PCB_READ_MEMBER(pecom_pcb_r); - void pecom64(machine_config &config); + + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; void pecom_video(machine_config &config); void cdp1869_page_ram(address_map &map); void pecom64_io(address_map &map); void pecom64_mem(address_map &map); -protected: + +private: + required_device m_cdp1802; + required_device m_cdp1869; + + std::unique_ptr m_charram; /* character generator ROM */ + int m_reset; /* CPU mode */ + int m_dma; /* memory refresh DMA */ + + /* timers */ + emu_timer *m_reset_timer; /* power on reset timer */ + required_device m_cassette; required_device m_ram; required_memory_bank m_bank1; diff --git a/src/mame/includes/poolshrk.h b/src/mame/includes/poolshrk.h index 87750e421c0..d2dccbd175f 100644 --- a/src/mame/includes/poolshrk.h +++ b/src/mame/includes/poolshrk.h @@ -5,6 +5,10 @@ Atari Pool Shark hardware *************************************************************************/ +#ifndef MAME_INCLUDES_POOLSHRK_H +#define MAME_INCLUDES_POOLSHRK_H + +#pragma once #include "machine/watchdog.h" #include "sound/discrete.h" @@ -14,8 +18,8 @@ class poolshrk_state : public driver_device { public: - poolshrk_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + poolshrk_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_watchdog(*this, "watchdog"), m_gfxdecode(*this, "gfxdecode"), @@ -23,21 +27,13 @@ public: m_discrete(*this, "discrete"), m_playfield_ram(*this, "playfield_ram"), m_hpos_ram(*this, "hpos_ram"), - m_vpos_ram(*this, "vpos_ram") { } + m_vpos_ram(*this, "vpos_ram") + { } - required_device m_maincpu; - required_device m_watchdog; - required_device m_gfxdecode; - required_device m_palette; - required_device m_discrete; - - required_shared_ptr m_playfield_ram; - required_shared_ptr m_hpos_ram; - required_shared_ptr m_vpos_ram; - - tilemap_t* m_bg_tilemap; - int m_da_latch; + DECLARE_DRIVER_INIT(poolshrk); + void poolshrk(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(da_latch_w); DECLARE_WRITE8_MEMBER(led_w); DECLARE_WRITE8_MEMBER(watchdog_w); @@ -50,15 +46,29 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); - DECLARE_DRIVER_INIT(poolshrk); - virtual void video_start() override; DECLARE_PALETTE_INIT(poolshrk); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void poolshrk(machine_config &config); + virtual void video_start() override; void poolshrk_cpu_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_watchdog; + required_device m_gfxdecode; + required_device m_palette; + required_device m_discrete; + + required_shared_ptr m_playfield_ram; + required_shared_ptr m_hpos_ram; + required_shared_ptr m_vpos_ram; + + tilemap_t* m_bg_tilemap; + int m_da_latch; }; /*----------- defined in audio/poolshrk.c -----------*/ DISCRETE_SOUND_EXTERN( poolshrk ); + +#endif // MAME_INCLUDES_POOLSHRK_H diff --git a/src/mame/includes/rampart.h b/src/mame/includes/rampart.h index 97989226612..5380deac1e2 100644 --- a/src/mame/includes/rampart.h +++ b/src/mame/includes/rampart.h @@ -5,6 +5,10 @@ Atari Rampart hardware *************************************************************************/ +#ifndef MAME_INCLUDES_RAMPART_H +#define MAME_INCLUDES_RAMPART_H + +#pragma once #include "machine/atarigen.h" #include "sound/okim6295.h" @@ -14,30 +18,36 @@ class rampart_state : public atarigen_state { public: - rampart_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_mob(*this, "mob"), - m_oki(*this, "oki"), - m_ym2413(*this, "ymsnd"), - m_bitmap(*this, "bitmap") { } - - required_device m_mob; - required_device m_oki; - required_device m_ym2413; + rampart_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_mob(*this, "mob"), + m_oki(*this, "oki"), + m_ym2413(*this, "ymsnd"), + m_bitmap(*this, "bitmap") + { } - required_shared_ptr m_bitmap; + DECLARE_DRIVER_INIT(rampart); + void rampart(machine_config &config); +protected: + virtual void machine_reset() override; + virtual void video_start() override; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_WRITE16_MEMBER(latch_w); - DECLARE_DRIVER_INIT(rampart); - DECLARE_MACHINE_START(rampart); - DECLARE_MACHINE_RESET(rampart); - DECLARE_VIDEO_START(rampart); uint32_t screen_update_rampart(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void rampart_bitmap_render(bitmap_ind16 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - void rampart(machine_config &config); void main_map(address_map &map); + +private: + required_device m_mob; + required_device m_oki; + required_device m_ym2413; + + required_shared_ptr m_bitmap; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_RAMPART_H diff --git a/src/mame/includes/relief.h b/src/mame/includes/relief.h index 9e34b00fdb9..5baff3d6c97 100644 --- a/src/mame/includes/relief.h +++ b/src/mame/includes/relief.h @@ -5,6 +5,10 @@ Atari "Round" hardware *************************************************************************/ +#ifndef MAME_INCLUDES_RELIEF_H +#define MAME_INCLUDES_RELIEF_H + +#pragma once #include "machine/atarigen.h" #include "video/atarimo.h" @@ -14,36 +18,42 @@ class relief_state : public atarigen_state { public: - relief_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_vad(*this, "vad"), - m_oki(*this, "oki"), - m_ym2413(*this, "ymsnd"), - m_okibank(*this, "okibank") - { } + relief_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_vad(*this, "vad"), + m_oki(*this, "oki"), + m_ym2413(*this, "ymsnd"), + m_okibank(*this, "okibank") + { } - required_device m_vad; - required_device m_oki; - required_device m_ym2413; - required_memory_bank m_okibank; + DECLARE_DRIVER_INIT(relief); + void relief(machine_config &config); - uint8_t m_ym2413_volume; - uint8_t m_overall_volume; - uint8_t m_adpcm_bank; +protected: + virtual void machine_reset() override; + virtual void video_start() override; virtual void update_interrupts() override; DECLARE_READ16_MEMBER(special_port2_r); DECLARE_WRITE16_MEMBER(audio_control_w); DECLARE_WRITE16_MEMBER(audio_volume_w); - DECLARE_DRIVER_INIT(relief); TILE_GET_INFO_MEMBER(get_playfield_tile_info); TILE_GET_INFO_MEMBER(get_playfield2_tile_info); - DECLARE_MACHINE_START(relief); - DECLARE_MACHINE_RESET(relief); - DECLARE_VIDEO_START(relief); uint32_t screen_update_relief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - void relief(machine_config &config); void main_map(address_map &map); void oki_map(address_map &map); + +private: + required_device m_vad; + required_device m_oki; + required_device m_ym2413; + required_memory_bank m_okibank; + + uint8_t m_ym2413_volume; + uint8_t m_overall_volume; + uint8_t m_adpcm_bank; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_RELIEF_H diff --git a/src/mame/includes/shuuz.h b/src/mame/includes/shuuz.h index 6c09c899af8..ec68e364145 100644 --- a/src/mame/includes/shuuz.h +++ b/src/mame/includes/shuuz.h @@ -5,6 +5,10 @@ Atari Shuuz hardware *************************************************************************/ +#ifndef MAME_INCLUDES_SHUUZ_H +#define MAME_INCLUDES_SHUUZ_H + +#pragma once #include "machine/atarigen.h" #include "video/atarimo.h" @@ -13,13 +17,13 @@ class shuuz_state : public atarigen_state { public: shuuz_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_vad(*this, "vad") { } - - required_device m_vad; + : atarigen_state(mconfig, type, tag) + , m_vad(*this, "vad") + { } - int m_cur[2]; + void shuuz(machine_config &config); +protected: virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(latch_w); @@ -32,7 +36,14 @@ public: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - void shuuz(machine_config &config); void main_map(address_map &map); + +private: + required_device m_vad; + + int m_cur[2]; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_SHUUZ_H diff --git a/src/mame/includes/skullxbo.h b/src/mame/includes/skullxbo.h index f04719a4d12..215ded21617 100644 --- a/src/mame/includes/skullxbo.h +++ b/src/mame/includes/skullxbo.h @@ -5,6 +5,10 @@ Atari Skull & Crossbones hardware *************************************************************************/ +#ifndef MAME_INCLUDES_SKULLXBO_H +#define MAME_INCLUDES_SKULLXBO_H + +#pragma once #include "machine/atarigen.h" #include "machine/timer.h" @@ -14,34 +18,29 @@ class skullxbo_state : public atarigen_state { public: - skullxbo_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_jsa(*this, "jsa"), - m_scanline_timer(*this, "scan_timer"), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_mob(*this, "mob"), - m_playfield_latch(-1) { } + skullxbo_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_jsa(*this, "jsa"), + m_scanline_timer(*this, "scan_timer"), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_mob(*this, "mob"), + m_playfield_latch(-1) + { } - required_device m_jsa; - required_device m_scanline_timer; - required_device m_playfield_tilemap; - required_device m_alpha_tilemap; - required_device m_mob; - int m_playfield_latch; + DECLARE_DRIVER_INIT(skullxbo); + void skullxbo(machine_config &config); +protected: + virtual void machine_reset() override; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_WRITE16_MEMBER(skullxbo_halt_until_hblank_0_w); DECLARE_WRITE16_MEMBER(skullxbo_mobwr_w); - DECLARE_DRIVER_INIT(skullxbo); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); WRITE16_MEMBER(playfield_latch_w); WRITE16_MEMBER(playfield_latched_w); - DECLARE_MACHINE_START(skullxbo); - DECLARE_MACHINE_RESET(skullxbo); - DECLARE_VIDEO_START(skullxbo); uint32_t screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer); void skullxbo_scanline_update(int scanline); @@ -49,7 +48,17 @@ public: DECLARE_WRITE16_MEMBER( skullxbo_yscroll_w ); DECLARE_WRITE16_MEMBER( skullxbo_mobmsb_w ); - static const atari_motion_objects_config s_mob_config; - void skullxbo(machine_config &config); void main_map(address_map &map); + +private: + required_device m_jsa; + required_device m_scanline_timer; + required_device m_playfield_tilemap; + required_device m_alpha_tilemap; + required_device m_mob; + int m_playfield_latch; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_SKULLXBO_H diff --git a/src/mame/includes/skydiver.h b/src/mame/includes/skydiver.h index d4075bba2ea..fa04ad4f9f2 100644 --- a/src/mame/includes/skydiver.h +++ b/src/mame/includes/skydiver.h @@ -5,6 +5,10 @@ Atari Skydiver hardware *************************************************************************/ +#ifndef MAME_INCLUDES_SKYDIVER_H +#define MAME_INCLUDES_SKYDIVER_H + +#pragma once #include "machine/74259.h" #include "machine/watchdog.h" @@ -26,29 +30,20 @@ class skydiver_state : public driver_device { public: - skydiver_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + skydiver_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_watchdog(*this, "watchdog"), m_latch3(*this, "latch3"), m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_videoram(*this, "videoram") { } - - required_device m_maincpu; - required_device m_watchdog; - required_device m_latch3; - required_device m_discrete; - required_device m_gfxdecode; - required_device m_palette; + m_videoram(*this, "videoram") + { } - required_shared_ptr m_videoram; - - int m_nmion; - tilemap_t *m_bg_tilemap; - int m_width; + void skydiver(machine_config &config); +protected: DECLARE_WRITE_LINE_MEMBER(nmion_w); DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_READ8_MEMBER(wram_r); @@ -77,9 +72,24 @@ public: void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(interrupt); - void skydiver(machine_config &config); void skydiver_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_watchdog; + required_device m_latch3; + required_device m_discrete; + required_device m_gfxdecode; + required_device m_palette; + + required_shared_ptr m_videoram; + + int m_nmion; + tilemap_t *m_bg_tilemap; + int m_width; }; /*----------- defined in audio/skydiver.c -----------*/ DISCRETE_SOUND_EXTERN( skydiver ); + +#endif // MAME_INCLUDES_SKYDIVER_H diff --git a/src/mame/includes/skyraid.h b/src/mame/includes/skyraid.h index e01b8ed7d54..4b16968ceb9 100644 --- a/src/mame/includes/skyraid.h +++ b/src/mame/includes/skyraid.h @@ -1,30 +1,29 @@ // license:BSD-3-Clause // copyright-holders:Stefan Jokisch +#ifndef MAME_INCLUDES_SKYRAID_H +#define MAME_INCLUDES_SKYRAID_H + +#pragma once + #include "sound/discrete.h" class skyraid_state : public driver_device { public: - skyraid_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + skyraid_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_pos_ram(*this, "pos_ram"), m_alpha_num_ram(*this, "alpha_num_ram"), m_obj_ram(*this, "obj_ram"), m_discrete(*this, "discrete"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } - - int m_analog_range; - int m_analog_offset; + m_palette(*this, "palette") + { } - int m_scroll; + void skyraid(machine_config &config); - required_shared_ptr m_pos_ram; - required_shared_ptr m_alpha_num_ram; - required_shared_ptr m_obj_ram; - required_device m_discrete; - bitmap_ind16 m_helper; +protected: DECLARE_READ8_MEMBER(skyraid_port_0_r); DECLARE_WRITE8_MEMBER(skyraid_range_w); DECLARE_WRITE8_MEMBER(skyraid_offset_w); @@ -38,12 +37,27 @@ public: void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_missiles(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_trapezoid(bitmap_ind16& dst, bitmap_ind16& src); + + void skyraid_map(address_map &map); + +private: + int m_analog_range; + int m_analog_offset; + + int m_scroll; + + required_shared_ptr m_pos_ram; + required_shared_ptr m_alpha_num_ram; + required_shared_ptr m_obj_ram; + required_device m_discrete; + bitmap_ind16 m_helper; + required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - void skyraid(machine_config &config); - void skyraid_map(address_map &map); }; /*----------- defined in audio/skyraid.c -----------*/ DISCRETE_SOUND_EXTERN( skyraid ); + +#endif // MAME_INCLUDES_SKYRAID_H diff --git a/src/mame/includes/sprint8.h b/src/mame/includes/sprint8.h index 70b03b0f328..f7ce8afc8ee 100644 --- a/src/mame/includes/sprint8.h +++ b/src/mame/includes/sprint8.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Stefan Jokisch +#ifndef MAME_INCLUDES_SPRINT8_H +#define MAME_INCLUDES_SPRINT8_H + +#pragma once #include "machine/74259.h" #include "machine/timer.h" @@ -19,32 +23,12 @@ public: m_video_ram(*this, "video_ram"), m_pos_h_ram(*this, "pos_h_ram"), m_pos_v_ram(*this, "pos_v_ram"), - m_pos_d_ram(*this, "pos_d_ram") { } - - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - required_device m_discrete; - - required_shared_ptr m_video_ram; - required_shared_ptr m_pos_h_ram; - required_shared_ptr m_pos_v_ram; - required_shared_ptr m_pos_d_ram; - - int m_steer_dir[8]; - int m_steer_flag[8]; - int m_collision_reset; - int m_collision_index; - uint8_t m_dial[8]; - int m_team; + m_pos_d_ram(*this, "pos_d_ram") + { } - tilemap_t* m_tilemap1; - tilemap_t* m_tilemap2; - bitmap_ind16 m_helper1; - bitmap_ind16 m_helper2; - emu_timer *m_collision_timer; + void sprint8(machine_config &config); +protected: DECLARE_READ8_MEMBER(collision_r); DECLARE_READ8_MEMBER(input_r); DECLARE_WRITE8_MEMBER(lockout_w); @@ -67,10 +51,36 @@ public: void set_pens(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void set_collision(int n); - void sprint8(machine_config &config); void sprint8_audio(machine_config &config); void sprint8_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_discrete; + + required_shared_ptr m_video_ram; + required_shared_ptr m_pos_h_ram; + required_shared_ptr m_pos_v_ram; + required_shared_ptr m_pos_d_ram; + + int m_steer_dir[8]; + int m_steer_flag[8]; + int m_collision_reset; + int m_collision_index; + uint8_t m_dial[8]; + int m_team; + + tilemap_t* m_tilemap1; + tilemap_t* m_tilemap2; + bitmap_ind16 m_helper1; + bitmap_ind16 m_helper2; + emu_timer *m_collision_timer; }; /*----------- defined in audio/sprint8.c -----------*/ DISCRETE_SOUND_EXTERN( sprint8 ); + +#endif // MAME_INCLUDES_SPRINT8_H diff --git a/src/mame/includes/starshp1.h b/src/mame/includes/starshp1.h index 2006c8ba674..6f4784d2807 100644 --- a/src/mame/includes/starshp1.h +++ b/src/mame/includes/starshp1.h @@ -25,6 +25,10 @@ * Horizontal Visible Area 384 (0x180) 768 (0x300) * Horizontal Blanking Time 128 (0x080) 256 (0x100) */ +#ifndef MAME_INCLUDES_STARSHP1_H +#define MAME_INCLUDES_STARSHP1_H + +#pragma once #include "sound/discrete.h" #include "screen.h" @@ -44,8 +48,8 @@ class starshp1_state : public driver_device { public: - starshp1_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + starshp1_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_playfield_ram(*this, "playfield_ram"), m_hpos_ram(*this, "hpos_ram"), m_vpos_ram(*this, "vpos_ram"), @@ -54,32 +58,14 @@ public: m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } - int m_analog_in_select; - int m_attract; - required_shared_ptr m_playfield_ram; - required_shared_ptr m_hpos_ram; - required_shared_ptr m_vpos_ram; - required_shared_ptr m_obj_ram; - int m_ship_explode; - int m_ship_picture; - int m_ship_hoffset; - int m_ship_voffset; - int m_ship_size; - int m_circle_hpos; - int m_circle_vpos; - int m_circle_size; - int m_circle_mod; - int m_circle_kill; - int m_phasor; - int m_collision_latch; - int m_starfield_kill; - int m_mux; - int m_inverse; - std::unique_ptr m_LSFR; - bitmap_ind16 m_helper; - tilemap_t *m_bg_tilemap; + DECLARE_CUSTOM_INPUT_MEMBER(starshp1_analog_r); + DECLARE_CUSTOM_INPUT_MEMBER(collision_latch_r); + void starshp1(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(starshp1_collision_reset_w); DECLARE_WRITE8_MEMBER(starshp1_analog_in_w); DECLARE_WRITE_LINE_MEMBER(ship_explode_w); @@ -93,8 +79,6 @@ public: DECLARE_WRITE8_MEMBER(starshp1_ssadd_w); DECLARE_WRITE8_MEMBER(starshp1_sspic_w); DECLARE_WRITE8_MEMBER(starshp1_playfield_w); - DECLARE_CUSTOM_INPUT_MEMBER(starshp1_analog_r); - DECLARE_CUSTOM_INPUT_MEMBER(collision_latch_r); DECLARE_WRITE_LINE_MEMBER(attract_w); DECLARE_WRITE_LINE_MEMBER(phasor_w); DECLARE_WRITE8_MEMBER(starshp1_analog_out_w); @@ -119,13 +103,39 @@ public: int spaceship_collision(bitmap_ind16 &bitmap, const rectangle &rect); int point_in_circle(int x, int y, int center_x, int center_y, int r); int circle_collision(const rectangle &rect); + void starshp1_map(address_map &map); + +private: + int m_analog_in_select; + int m_attract; + required_shared_ptr m_playfield_ram; + required_shared_ptr m_hpos_ram; + required_shared_ptr m_vpos_ram; + required_shared_ptr m_obj_ram; + int m_ship_explode; + int m_ship_picture; + int m_ship_hoffset; + int m_ship_voffset; + int m_ship_size; + int m_circle_hpos; + int m_circle_vpos; + int m_circle_size; + int m_circle_mod; + int m_circle_kill; + int m_phasor; + int m_collision_latch; + int m_starfield_kill; + int m_mux; + int m_inverse; + std::unique_ptr m_LSFR; + bitmap_ind16 m_helper; + tilemap_t *m_bg_tilemap; + required_device m_maincpu; required_device m_discrete; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - void starshp1(machine_config &config); - void starshp1_map(address_map &map); }; /*----------- defined in audio/starshp1.c -----------*/ @@ -143,3 +153,5 @@ DISCRETE_SOUND_EXTERN( starshp1 ); #define STARSHP1_KICKER NODE_08 #define STARSHP1_PHASOR_ON NODE_09 #define STARSHP1_ATTRACT NODE_10 + +#endif // MAME_INCLUDES_STARSHP1_H diff --git a/src/mame/includes/super6.h b/src/mame/includes/super6.h index ea55d0fc938..0963c5187f0 100644 --- a/src/mame/includes/super6.h +++ b/src/mame/includes/super6.h @@ -46,6 +46,12 @@ public: m_j7(*this, "J7") { } + void super6(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + DECLARE_READ8_MEMBER( fdc_r ); DECLARE_WRITE8_MEMBER( fdc_w ); DECLARE_WRITE8_MEMBER( s100_w ); @@ -61,15 +67,12 @@ public: DECLARE_READ8_MEMBER(io_read_byte); DECLARE_WRITE8_MEMBER(io_write_byte); - void super6(machine_config &config); void super6_io(address_map &map); void super6_mem(address_map &map); -protected: - virtual void machine_start() override; - virtual void machine_reset() override; void bankswitch(); +private: required_device m_maincpu; required_device m_ctc; required_device m_dart; diff --git a/src/mame/includes/tank8.h b/src/mame/includes/tank8.h index 0ae4bc03d91..9666cd6cde1 100644 --- a/src/mame/includes/tank8.h +++ b/src/mame/includes/tank8.h @@ -5,6 +5,10 @@ Atari tank8 hardware *************************************************************************/ +#ifndef MAME_INCLUDES_TANK8_H +#define MAME_INCLUDES_TANK8_H + +#pragma once #include "sound/discrete.h" #include "screen.h" @@ -34,8 +38,8 @@ public: TIMER_COLLISION }; - tank8_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + tank8_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), @@ -45,27 +49,13 @@ public: m_pos_h_ram(*this, "pos_h_ram"), m_pos_v_ram(*this, "pos_v_ram"), m_pos_d_ram(*this, "pos_d_ram"), - m_team(*this, "team") { } - - required_device m_maincpu; - required_device m_discrete; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - required_shared_ptr m_video_ram; - required_shared_ptr m_pos_h_ram; - required_shared_ptr m_pos_v_ram; - required_shared_ptr m_pos_d_ram; - required_shared_ptr m_team; + m_team(*this, "team") + { } - int m_collision_index; - tilemap_t *m_tilemap; - bitmap_ind16 m_helper1; - bitmap_ind16 m_helper2; - bitmap_ind16 m_helper3; - emu_timer *m_collision_timer; + DECLARE_DRIVER_INIT(decode); + void tank8(machine_config &config); +protected: DECLARE_READ8_MEMBER(collision_r); DECLARE_WRITE8_MEMBER(lockout_w); DECLARE_WRITE8_MEMBER(int_reset_w); @@ -79,7 +69,6 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); - DECLARE_DRIVER_INIT(decode); virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(tank8); @@ -93,12 +82,32 @@ public: void draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect); void set_collision(int index); - void tank8(machine_config &config); - void tank8_cpu_map(address_map &map); -protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void tank8_cpu_map(address_map &map); + +private: + required_device m_maincpu; + required_device m_discrete; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + required_shared_ptr m_video_ram; + required_shared_ptr m_pos_h_ram; + required_shared_ptr m_pos_v_ram; + required_shared_ptr m_pos_d_ram; + required_shared_ptr m_team; + + int m_collision_index; + tilemap_t *m_tilemap; + bitmap_ind16 m_helper1; + bitmap_ind16 m_helper2; + bitmap_ind16 m_helper3; + emu_timer *m_collision_timer; }; /*----------- defined in audio/tank8.c -----------*/ DISCRETE_SOUND_EXTERN( tank8 ); + +#endif // MAME_INCLUDES_TANK8_H diff --git a/src/mame/includes/thunderj.h b/src/mame/includes/thunderj.h index f450952994e..1c871e076c2 100644 --- a/src/mame/includes/thunderj.h +++ b/src/mame/includes/thunderj.h @@ -5,6 +5,10 @@ Atari ThunderJaws hardware *************************************************************************/ +#ifndef MAME_INCLUDES_THUNDERJ_H +#define MAME_INCLUDES_THUNDERJ_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -13,31 +17,37 @@ class thunderj_state : public atarigen_state { public: - thunderj_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_jsa(*this, "jsa"), - m_vad(*this, "vad"), - m_extra(*this, "extra") { } + thunderj_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_jsa(*this, "jsa"), + m_vad(*this, "vad"), + m_extra(*this, "extra") + { } - required_device m_jsa; - required_device m_vad; - required_device m_extra; + DECLARE_DRIVER_INIT(thunderj); + void thunderj(machine_config &config); - uint8_t m_alpha_tile_bank; +protected: + virtual void machine_start() override; virtual void update_interrupts() override; DECLARE_READ16_MEMBER(special_port2_r); DECLARE_WRITE16_MEMBER(latch_w); - DECLARE_DRIVER_INIT(thunderj); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); TILE_GET_INFO_MEMBER(get_playfield2_tile_info); - DECLARE_MACHINE_START(thunderj); - DECLARE_MACHINE_RESET(thunderj); - DECLARE_VIDEO_START(thunderj); uint32_t screen_update_thunderj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - void thunderj(machine_config &config); void extra_map(address_map &map); void main_map(address_map &map); + +private: + required_device m_jsa; + required_device m_vad; + required_device m_extra; + + uint8_t m_alpha_tile_bank; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_THUNDERJ_H diff --git a/src/mame/includes/toobin.h b/src/mame/includes/toobin.h index b40887fc854..43b530497c8 100644 --- a/src/mame/includes/toobin.h +++ b/src/mame/includes/toobin.h @@ -5,6 +5,10 @@ Atari Toobin' hardware *************************************************************************/ +#ifndef MAME_INCLUDES_TOOBIN_H +#define MAME_INCLUDES_TOOBIN_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -13,24 +17,19 @@ class toobin_state : public atarigen_state { public: - toobin_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_jsa(*this, "jsa"), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_mob(*this, "mob"), - m_interrupt_scan(*this, "interrupt_scan") { } - - required_device m_jsa; - required_device m_playfield_tilemap; - required_device m_alpha_tilemap; - required_device m_mob; - - required_shared_ptr m_interrupt_scan; + toobin_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_jsa(*this, "jsa"), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_mob(*this, "mob"), + m_interrupt_scan(*this, "interrupt_scan") + { } - double m_brightness; - bitmap_ind16 m_pfbitmap; + void toobin(machine_config &config); +protected: + virtual void video_start() override; virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(interrupt_scan_w); @@ -43,13 +42,22 @@ public: TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - DECLARE_MACHINE_START(toobin); - DECLARE_MACHINE_RESET(toobin); - DECLARE_VIDEO_START(toobin); - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - static const atari_motion_objects_config s_mob_config; - void toobin(machine_config &config); void main_map(address_map &map); + +private: + required_device m_jsa; + required_device m_playfield_tilemap; + required_device m_alpha_tilemap; + required_device m_mob; + + required_shared_ptr m_interrupt_scan; + + double m_brightness; + bitmap_ind16 m_pfbitmap; + + static const atari_motion_objects_config s_mob_config; }; + +#endif // MAME_INCLUDES_TOOBIN_H diff --git a/src/mame/includes/triplhnt.h b/src/mame/includes/triplhnt.h index a8577afb061..bab6e60d32e 100644 --- a/src/mame/includes/triplhnt.h +++ b/src/mame/includes/triplhnt.h @@ -5,6 +5,10 @@ Atari Triple Hunt hardware *************************************************************************/ +#ifndef MAME_INCLUDES_TRIPLHNT_H +#define MAME_INCLUDES_TRIPLHNT_H + +#pragma once #include "machine/74259.h" #include "machine/watchdog.h" @@ -29,8 +33,8 @@ public: TIMER_HIT }; - triplhnt_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + triplhnt_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_latch(*this, "latch"), m_watchdog(*this, "watchdog"), @@ -43,8 +47,37 @@ public: m_vpos_ram(*this, "vpos_ram"), m_hpos_ram(*this, "hpos_ram"), m_orga_ram(*this, "orga_ram"), - m_code_ram(*this, "code_ram") { } + m_code_ram(*this, "code_ram") + { } + + DECLARE_DRIVER_INIT(triplhnt); + void triplhnt(machine_config &config); + +protected: + DECLARE_WRITE_LINE_MEMBER(ram_2_w); + DECLARE_WRITE_LINE_MEMBER(sprite_zoom_w); + DECLARE_WRITE_LINE_MEMBER(sprite_bank_w); + DECLARE_WRITE_LINE_MEMBER(lamp1_w); + DECLARE_WRITE_LINE_MEMBER(coin_lockout_w); + DECLARE_WRITE_LINE_MEMBER(tape_control_w); + + DECLARE_READ8_MEMBER(cmos_r); + DECLARE_READ8_MEMBER(input_port_4_r); + DECLARE_READ8_MEMBER(misc_r); + DECLARE_READ8_MEMBER(da_latch_r); + + TILE_GET_INFO_MEMBER(get_tile_info); + virtual void video_start() override; + DECLARE_PALETTE_INIT(triplhnt); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void set_collision(int code); + + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void triplhnt_map(address_map &map); +private: required_device m_maincpu; required_device m_latch; required_device m_watchdog; @@ -69,34 +102,10 @@ public: bitmap_ind16 m_helper; emu_timer *m_hit_timer; tilemap_t* m_bg_tilemap; - - DECLARE_WRITE_LINE_MEMBER(ram_2_w); - DECLARE_WRITE_LINE_MEMBER(sprite_zoom_w); - DECLARE_WRITE_LINE_MEMBER(sprite_bank_w); - DECLARE_WRITE_LINE_MEMBER(lamp1_w); - DECLARE_WRITE_LINE_MEMBER(coin_lockout_w); - DECLARE_WRITE_LINE_MEMBER(tape_control_w); - - DECLARE_READ8_MEMBER(cmos_r); - DECLARE_READ8_MEMBER(input_port_4_r); - DECLARE_READ8_MEMBER(misc_r); - DECLARE_READ8_MEMBER(da_latch_r); - - DECLARE_DRIVER_INIT(triplhnt); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void video_start() override; - DECLARE_PALETTE_INIT(triplhnt); - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void set_collision(int code); - - void triplhnt(machine_config &config); - void triplhnt_map(address_map &map); -protected: - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; /*----------- defined in audio/triplhnt.cpp -----------*/ DISCRETE_SOUND_EXTERN( triplhnt ); extern const char *const triplhnt_sample_names[]; + +#endif // MAME_INCLUDES_TRIPLHNT_H diff --git a/src/mame/includes/ultratnk.h b/src/mame/includes/ultratnk.h index c07a808fc37..21d566c7999 100644 --- a/src/mame/includes/ultratnk.h +++ b/src/mame/includes/ultratnk.h @@ -5,6 +5,10 @@ Atari Ultra Tank hardware *************************************************************************/ +#ifndef MAME_INCLUDES_ULTRATNK_H +#define MAME_INCLUDES_ULTRATNK_H + +#pragma once #include "machine/watchdog.h" #include "sound/discrete.h" @@ -18,31 +22,22 @@ public: TIMER_NMI }; - ultratnk_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + ultratnk_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_watchdog(*this, "watchdog"), m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_videoram(*this, "videoram") { } + m_videoram(*this, "videoram") + { } - required_device m_maincpu; - required_device m_watchdog; - required_device m_discrete; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - required_shared_ptr m_videoram; - - int m_da_latch; - int m_collision[4]; - tilemap_t* m_playfield; - bitmap_ind16 m_helper; - emu_timer *m_nmi_timer; + DECLARE_CUSTOM_INPUT_MEMBER(get_collision); + DECLARE_CUSTOM_INPUT_MEMBER(get_joystick); + void ultratnk(machine_config &config); +protected: DECLARE_READ8_MEMBER(wram_r); DECLARE_READ8_MEMBER(analog_r); DECLARE_READ8_MEMBER(coin_r); @@ -55,8 +50,6 @@ public: DECLARE_WRITE_LINE_MEMBER(led_2_w); DECLARE_WRITE_LINE_MEMBER(lockout_w); DECLARE_WRITE8_MEMBER(video_ram_w); - DECLARE_CUSTOM_INPUT_MEMBER(get_collision); - DECLARE_CUSTOM_INPUT_MEMBER(get_joystick); DECLARE_WRITE8_MEMBER(attract_w); DECLARE_WRITE8_MEMBER(explosion_w); @@ -70,8 +63,23 @@ public: DECLARE_WRITE_LINE_MEMBER(screen_vblank); TIMER_CALLBACK_MEMBER(nmi_callback); - void ultratnk(machine_config &config); - void ultratnk_cpu_map(address_map &map); -protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void ultratnk_cpu_map(address_map &map); + + required_device m_maincpu; + required_device m_watchdog; + required_device m_discrete; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + required_shared_ptr m_videoram; + + int m_da_latch; + int m_collision[4]; + tilemap_t* m_playfield; + bitmap_ind16 m_helper; + emu_timer *m_nmi_timer; }; + +#endif // MAME_INCLUDES_ULTRATNK_H diff --git a/src/mame/includes/vertigo.h b/src/mame/includes/vertigo.h index 14b23a503e7..c0231170895 100644 --- a/src/mame/includes/vertigo.h +++ b/src/mame/includes/vertigo.h @@ -5,6 +5,10 @@ Exidy Vertigo hardware *************************************************************************/ +#ifndef MAME_INCLUDES_VERTIGO_H +#define MAME_INCLUDES_VERTIGO_H + +#pragma once #include "audio/exidy440.h" #include "machine/74148.h" @@ -18,96 +22,23 @@ #define MC_LENGTH 512 -struct am2901 -{ - uint32_t ram[16]; /* internal ram */ - uint32_t d; /* direct data D input */ - uint32_t q; /* Q register */ - uint32_t f; /* F ALU result */ - uint32_t y; /* Y output */ -}; - -class vector_generator -{ -public: - uint32_t sreg; /* shift register */ - uint32_t l1; /* latch 1 adder operand only */ - uint32_t l2; /* latch 2 adder operand only */ - uint32_t c_v; /* vertical position counter */ - uint32_t c_h; /* horizontal position counter */ - uint32_t c_l; /* length counter */ - uint32_t adder_s; /* slope generator result and B input */ - uint32_t adder_a; /* slope generator A input */ - uint32_t color; /* color */ - uint32_t intensity; /* intensity */ - uint32_t brez; /* h/v-counters enable */ - uint32_t vfin; /* drawing yes/no */ - uint32_t hud1; /* h-counter up or down (stored in L1) */ - uint32_t hud2; /* h-counter up or down (stored in L2) */ - uint32_t vud1; /* v-counter up or down (stored in L1) */ - uint32_t vud2; /* v-counter up or down (stored in L2) */ - uint32_t hc1; /* use h- or v-counter in L1 mode */ - uint32_t ven; /* vector intensity enable */ -}; - -struct microcode -{ - uint32_t x; - uint32_t a; - uint32_t b; - uint32_t inst; - uint32_t dest; - uint32_t cn; - uint32_t mreq; - uint32_t rsel; - uint32_t rwrite; - uint32_t of; - uint32_t iif; - uint32_t oa; - uint32_t jpos; - uint32_t jmp; - uint32_t jcon; - uint32_t ma; -}; - -struct vproc -{ - uint16_t sram[64]; /* external sram */ - uint16_t ramlatch; /* latch between 2901 and sram */ - uint16_t rom_adr; /* vector ROM/RAM address latch */ - uint32_t pc; /* program counter */ - uint32_t ret; /* return address */ - -}; - class vertigo_state : public driver_device { public: - vertigo_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_custom(*this, "custom"), - m_ttl74148(*this, "74148"), - m_vector(*this, "vector"), - m_vectorram(*this, "vectorram") + vertigo_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_custom(*this, "custom"), + m_ttl74148(*this, "74148"), + m_vector(*this, "vector"), + m_vectorram(*this, "vectorram") { } - required_device m_maincpu; - required_device m_audiocpu; - required_device m_custom; - required_device m_ttl74148; - required_device m_vector; - required_shared_ptr m_vectorram; - attotime m_irq4_time; - uint8_t m_irq_state; - uint8_t m_adc_result; - vproc m_vs; - am2901 m_bsp; - vector_generator m_vgen; - uint16_t *m_vectorrom; - microcode m_mc[MC_LENGTH]; + void vertigo(machine_config &config); + +protected: DECLARE_READ16_MEMBER(vertigo_io_convert); DECLARE_READ16_MEMBER(vertigo_io_adc); DECLARE_READ16_MEMBER(vertigo_coin_r); @@ -115,23 +46,103 @@ public: DECLARE_WRITE16_MEMBER(vertigo_audio_w); DECLARE_READ16_MEMBER(vertigo_sio_r); DECLARE_WRITE16_MEMBER(vertigo_motor_w); - virtual void machine_start() override; - virtual void machine_reset() override; INTERRUPT_GEN_MEMBER(vertigo_interrupt); TIMER_CALLBACK_MEMBER(sound_command_w); DECLARE_WRITE_LINE_MEMBER(v_irq4_w); DECLARE_WRITE_LINE_MEMBER(v_irq3_w); TTL74148_OUTPUT_CB(update_irq); + virtual void machine_start() override; + virtual void machine_reset() override; void exidy440_audio(machine_config &config); + void vertigo_map(address_map &map); + void vertigo_motor(address_map &map); + void exidy440_audio_map(address_map &map); + +private: + struct am2901 + { + uint32_t ram[16]; /* internal ram */ + uint32_t d; /* direct data D input */ + uint32_t q; /* Q register */ + uint32_t f; /* F ALU result */ + uint32_t y; /* Y output */ + }; + + class vector_generator + { + public: + uint32_t sreg; /* shift register */ + uint32_t l1; /* latch 1 adder operand only */ + uint32_t l2; /* latch 2 adder operand only */ + uint32_t c_v; /* vertical position counter */ + uint32_t c_h; /* horizontal position counter */ + uint32_t c_l; /* length counter */ + uint32_t adder_s; /* slope generator result and B input */ + uint32_t adder_a; /* slope generator A input */ + uint32_t color; /* color */ + uint32_t intensity; /* intensity */ + uint32_t brez; /* h/v-counters enable */ + uint32_t vfin; /* drawing yes/no */ + uint32_t hud1; /* h-counter up or down (stored in L1) */ + uint32_t hud2; /* h-counter up or down (stored in L2) */ + uint32_t vud1; /* v-counter up or down (stored in L1) */ + uint32_t vud2; /* v-counter up or down (stored in L2) */ + uint32_t hc1; /* use h- or v-counter in L1 mode */ + uint32_t ven; /* vector intensity enable */ + }; + + struct microcode + { + uint32_t x; + uint32_t a; + uint32_t b; + uint32_t inst; + uint32_t dest; + uint32_t cn; + uint32_t mreq; + uint32_t rsel; + uint32_t rwrite; + uint32_t of; + uint32_t iif; + uint32_t oa; + uint32_t jpos; + uint32_t jmp; + uint32_t jcon; + uint32_t ma; + }; + + struct vproc + { + uint16_t sram[64]; /* external sram */ + uint16_t ramlatch; /* latch between 2901 and sram */ + uint16_t rom_adr; /* vector ROM/RAM address latch */ + uint32_t pc; /* program counter */ + uint32_t ret; /* return address */ + + }; + + void am2901x4(am2901 &bsp, microcode const &mc); + void vertigo_vgen(vector_generator &vg); void vertigo_vproc_init(); void vertigo_vproc_reset(); - void am2901x4 (am2901 *bsp, microcode *mc); - void vertigo_vgen (vector_generator *vg); void vertigo_vproc(int cycles, int irq4); void update_irq_encoder(int line, int state); - void vertigo(machine_config &config); - void vertigo_map(address_map &map); - void vertigo_motor(address_map &map); - void exidy440_audio_map(address_map &map); + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_custom; + required_device m_ttl74148; + required_device m_vector; + required_shared_ptr m_vectorram; + attotime m_irq4_time; + uint8_t m_irq_state; + uint8_t m_adc_result; + vproc m_vs; + am2901 m_bsp; + vector_generator m_vgen; + uint16_t *m_vectorrom; + microcode m_mc[MC_LENGTH]; }; + +#endif // MAME_INCLUDES_VERTIGO_H diff --git a/src/mame/includes/victory.h b/src/mame/includes/victory.h index c69f17c440e..0db8f44943c 100644 --- a/src/mame/includes/victory.h +++ b/src/mame/includes/victory.h @@ -5,6 +5,10 @@ Victory system ****************************************************************************/ +#ifndef MAME_INCLUDES_VICTORY_H +#define MAME_INCLUDES_VICTORY_H + +#pragma once #include "screen.h" @@ -20,63 +24,27 @@ #define VICTORY_VBSTART (0x100) -/* microcode state */ -struct micro_t -{ - uint16_t i; - uint16_t pc; - uint8_t r,g,b; - uint8_t xp,yp; - uint8_t cmd,cmdlo; - emu_timer * timer; - uint8_t timer_active; - attotime endtime; -}; - class victory_state : public driver_device { public: - victory_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + victory_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_videoram(*this, "videoram"), - m_charram(*this, "charram") { } - - required_device m_maincpu; - required_device m_screen; - required_device m_palette; + m_charram(*this, "charram") + { + } - required_shared_ptr m_videoram; - required_shared_ptr m_charram; - - uint16_t m_paletteram[0x40]; - std::unique_ptr m_bgbitmap; - std::unique_ptr m_fgbitmap; - std::unique_ptr m_rram; - std::unique_ptr m_gram; - std::unique_ptr m_bram; - uint8_t m_vblank_irq; - uint8_t m_fgcoll; - uint8_t m_fgcollx; - uint8_t m_fgcolly; - uint8_t m_bgcoll; - uint8_t m_bgcollx; - uint8_t m_bgcolly; - uint8_t m_scrollx; - uint8_t m_scrolly; - uint8_t m_video_control; - struct micro_t m_micro; - emu_timer *m_bgcoll_irq_timer; + void victory(machine_config &config); +protected: DECLARE_WRITE8_MEMBER(lamp_control_w); DECLARE_WRITE8_MEMBER(paletteram_w); DECLARE_READ8_MEMBER(video_control_r); DECLARE_WRITE8_MEMBER(video_control_w); - virtual void video_start() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_interrupt); @@ -92,9 +60,54 @@ public: int command7(); void update_background(); void update_foreground(); - void victory(machine_config &config); + + virtual void video_start() override; void victory_audio(machine_config &config); void main_io_map(address_map &map); void main_map(address_map &map); void victory_audio_map(address_map &map); + +private: + /* microcode state */ + struct micro_t + { + uint16_t i; + uint16_t pc; + uint8_t r,g,b; + uint8_t xp,yp; + uint8_t cmd,cmdlo; + emu_timer * timer; + uint8_t timer_active; + attotime endtime; + + void count_states(int states); + }; + + required_device m_maincpu; + required_device m_screen; + required_device m_palette; + + required_shared_ptr m_videoram; + required_shared_ptr m_charram; + + uint16_t m_paletteram[0x40]; + std::unique_ptr m_bgbitmap; + std::unique_ptr m_fgbitmap; + std::unique_ptr m_rram; + std::unique_ptr m_gram; + std::unique_ptr m_bram; + uint8_t m_vblank_irq; + uint8_t m_fgcoll; + uint8_t m_fgcollx; + uint8_t m_fgcolly; + uint8_t m_bgcoll; + uint8_t m_bgcollx; + uint8_t m_bgcolly; + uint8_t m_scrollx; + uint8_t m_scrolly; + uint8_t m_video_control; + micro_t m_micro; + emu_timer *m_bgcoll_irq_timer; }; + +#endif // MAME_INCLUDES_VICTORY_H diff --git a/src/mame/includes/videopin.h b/src/mame/includes/videopin.h index e8023c9b155..2ae279b8a07 100644 --- a/src/mame/includes/videopin.h +++ b/src/mame/includes/videopin.h @@ -5,6 +5,10 @@ Atari Video Pinball hardware *************************************************************************/ +#ifndef MAME_INCLUDES_VIDEOPIN_H +#define MAME_INCLUDES_VIDEOPIN_H + +#pragma once #include "sound/discrete.h" #include "screen.h" @@ -26,32 +30,19 @@ public: TIMER_INTERRUPT }; - videopin_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + videopin_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_video_ram(*this, "video_ram") { } + m_video_ram(*this, "video_ram") + { } - required_device m_maincpu; - required_device m_discrete; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - required_shared_ptr m_video_ram; - - attotime m_time_pushed; - attotime m_time_released; - uint8_t m_prev; - uint8_t m_mask; - int m_ball_x; - int m_ball_y; - tilemap_t* m_bg_tilemap; - emu_timer *m_interrupt_timer; + void videopin(machine_config &config); +protected: DECLARE_READ8_MEMBER(misc_r); DECLARE_WRITE8_MEMBER(led_w); DECLARE_WRITE8_MEMBER(ball_w); @@ -66,6 +57,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + void main_map(address_map &map); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -73,11 +66,26 @@ public: void update_plunger(); double calc_plunger_pos(); - void videopin(machine_config &config); - void main_map(address_map &map); -protected: - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; +private: + required_device m_maincpu; + required_device m_discrete; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + required_shared_ptr m_video_ram; + + attotime m_time_pushed; + attotime m_time_released; + uint8_t m_prev; + uint8_t m_mask; + int m_ball_x; + int m_ball_y; + tilemap_t* m_bg_tilemap; + emu_timer *m_interrupt_timer; }; /*----------- defined in audio/videopin.c -----------*/ DISCRETE_SOUND_EXTERN( videopin ); + +#endif // MAME_INCLUDES_VIDEOPIN_H diff --git a/src/mame/includes/vindictr.h b/src/mame/includes/vindictr.h index 958ebffbe75..92173ef0977 100644 --- a/src/mame/includes/vindictr.h +++ b/src/mame/includes/vindictr.h @@ -5,6 +5,10 @@ Atari Vindicators hardware *************************************************************************/ +#ifndef MAME_INCLUDES_VINDICTR_H +#define MAME_INCLUDES_VINDICTR_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -13,33 +17,39 @@ class vindictr_state : public atarigen_state { public: - vindictr_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_mob(*this, "mob"), - m_jsa(*this, "jsa") { } + vindictr_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_mob(*this, "mob"), + m_jsa(*this, "jsa") + { } - required_device m_playfield_tilemap; - required_device m_alpha_tilemap; - required_device m_mob; - required_device m_jsa; - uint8_t m_playfield_tile_bank; - uint16_t m_playfield_xscroll; - uint16_t m_playfield_yscroll; + DECLARE_DRIVER_INIT(vindictr); + void vindictr(machine_config &config); + +protected: + virtual void machine_reset() override; + virtual void video_start() override; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_READ16_MEMBER(port1_r); - DECLARE_DRIVER_INIT(vindictr); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - DECLARE_MACHINE_START(vindictr); - DECLARE_MACHINE_RESET(vindictr); - DECLARE_VIDEO_START(vindictr); uint32_t screen_update_vindictr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER( vindictr_paletteram_w ); static const atari_motion_objects_config s_mob_config; - void vindictr(machine_config &config); void main_map(address_map &map); + +private: + required_device m_playfield_tilemap; + required_device m_alpha_tilemap; + required_device m_mob; + required_device m_jsa; + uint8_t m_playfield_tile_bank; + uint16_t m_playfield_xscroll; + uint16_t m_playfield_yscroll; }; + +#endif // MAME_INCLUDES_VINDICTR_H diff --git a/src/mame/includes/wrally.h b/src/mame/includes/wrally.h index e670b047a81..3966cfe93b6 100644 --- a/src/mame/includes/wrally.h +++ b/src/mame/includes/wrally.h @@ -24,6 +24,9 @@ public: { } + void wrally(machine_config &config); + +protected: DECLARE_READ8_MEMBER(shareram_r); DECLARE_WRITE8_MEMBER(shareram_w); DECLARE_WRITE16_MEMBER(vram_w); @@ -39,13 +42,11 @@ public: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void wrally(machine_config &config); + virtual void machine_start() override; + virtual void video_start() override; void mcu_hostmem_map(address_map &map); void oki_map(address_map &map); void wrally_map(address_map &map); -protected: - virtual void machine_start() override; - virtual void video_start() override; void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); diff --git a/src/mame/includes/wswan.h b/src/mame/includes/wswan.h index c256d1eaf31..79f09e2a345 100644 --- a/src/mame/includes/wswan.h +++ b/src/mame/includes/wswan.h @@ -5,10 +5,11 @@ * includes/wswan.h * ****************************************************************************/ - #ifndef MAME_INCLUDES_WSWAN_H #define MAME_INCLUDES_WSWAN_H +#pragma once + #define WSWAN_TYPE_MONO 0 #define WSWAN_TYPE_COLOR 1 @@ -22,19 +23,11 @@ #include "bus/wswan/rom.h" -struct SoundDMA -{ - uint32_t source; /* Source address */ - uint16_t size; /* Size */ - uint8_t enable; /* Enabled */ -}; - - class wswan_state : public driver_device { public: - wswan_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + wswan_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_vdp(*this, "vdp"), m_sound(*this, "custom"), @@ -44,36 +37,8 @@ public: m_buttons(*this, "BUTTONS") { } - required_device m_maincpu; - required_device m_vdp; - required_device m_sound; - required_device m_cart; - DECLARE_READ8_MEMBER(bios_r); - DECLARE_READ8_MEMBER(port_r); - DECLARE_WRITE8_MEMBER(port_w); - - uint8_t m_ws_portram[256]; - uint8_t m_internal_eeprom[INTERNAL_EEPROM_SIZE]; - uint8_t m_system_type; - SoundDMA m_sound_dma; - std::unique_ptr m_ws_bios_bank; - uint8_t m_bios_disabled; - uint8_t m_rotate; - - void set_irq_line(int irq); - void dma_sound_cb(); - void common_start(); - virtual void machine_start() override; - virtual void machine_reset() override; - DECLARE_PALETTE_INIT(wswan); - DECLARE_MACHINE_START(wscolor); - DECLARE_PALETTE_INIT(wscolor); - - void wscolor(machine_config &config); void wswan(machine_config &config); - void wscolor_mem(address_map &map); - void wswan_io(address_map &map); - void wswan_mem(address_map &map); + protected: /* Interrupt flags */ static const uint8_t WSWAN_IFLAG_STX = 0x01; @@ -95,14 +60,59 @@ protected: static const uint8_t WSWAN_INT_VBL = 6; static const uint8_t WSWAN_INT_HBLTMR = 7; + struct SoundDMA + { + uint32_t source; /* Source address */ + uint16_t size; /* Size */ + uint8_t enable; /* Enabled */ + }; + + required_device m_maincpu; + required_device m_vdp; + required_device m_sound; + required_device m_cart; + + uint8_t m_ws_portram[256]; + uint8_t m_internal_eeprom[INTERNAL_EEPROM_SIZE]; + uint8_t m_system_type; + SoundDMA m_sound_dma; + std::unique_ptr m_ws_bios_bank; + uint8_t m_bios_disabled; + uint8_t m_rotate; + required_ioport m_cursx; required_ioport m_cursy; required_ioport m_buttons; + DECLARE_READ8_MEMBER(bios_r); + DECLARE_READ8_MEMBER(port_r); + DECLARE_WRITE8_MEMBER(port_w); + + void set_irq_line(int irq); + void dma_sound_cb(); + void common_start(); + virtual void machine_start() override; + virtual void machine_reset() override; + DECLARE_PALETTE_INIT(wswan); + + void wswan_io(address_map &map); + void wswan_mem(address_map &map); + void register_save(); void handle_irqs(); void clear_irq_line(int irq); }; +class wscolor_state : public wswan_state +{ +public: + using wswan_state::wswan_state; + void wscolor(machine_config &config); + +protected: + virtual void machine_start() override; + void wscolor_mem(address_map &map); + DECLARE_PALETTE_INIT(wscolor); +}; #endif // MAME_INCLUDES_WSWAN_H diff --git a/src/mame/includes/xybots.h b/src/mame/includes/xybots.h index 6c81d8b4e26..f0fa2a0ccc6 100644 --- a/src/mame/includes/xybots.h +++ b/src/mame/includes/xybots.h @@ -5,6 +5,10 @@ Atari Xybots hardware *************************************************************************/ +#ifndef MAME_INCLUDES_XYBOTS_H +#define MAME_INCLUDES_XYBOTS_H + +#pragma once #include "machine/atarigen.h" #include "audio/atarijsa.h" @@ -13,30 +17,34 @@ class xybots_state : public atarigen_state { public: - xybots_state(const machine_config &mconfig, device_type type, const char *tag) - : atarigen_state(mconfig, type, tag), - m_jsa(*this, "jsa"), - m_playfield_tilemap(*this, "playfield"), - m_alpha_tilemap(*this, "alpha"), - m_mob(*this, "mob") { } + xybots_state(const machine_config &mconfig, device_type type, const char *tag) : + atarigen_state(mconfig, type, tag), + m_jsa(*this, "jsa"), + m_playfield_tilemap(*this, "playfield"), + m_alpha_tilemap(*this, "alpha"), + m_mob(*this, "mob") + { } - required_device m_jsa; - required_device m_playfield_tilemap; - required_device m_alpha_tilemap; - required_device m_mob; + DECLARE_DRIVER_INIT(xybots); + void xybots(machine_config &config); - uint16_t m_h256; +protected: virtual void update_interrupts() override; DECLARE_READ16_MEMBER(special_port1_r); - DECLARE_DRIVER_INIT(xybots); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - DECLARE_MACHINE_START(xybots); - DECLARE_MACHINE_RESET(xybots); - DECLARE_VIDEO_START(xybots); uint32_t screen_update_xybots(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void main_map(address_map &map); + +private: + required_device m_jsa; + required_device m_playfield_tilemap; + required_device m_alpha_tilemap; + required_device m_mob; + + uint16_t m_h256; static const atari_motion_objects_config s_mob_config; - void xybots(machine_config &config); - void main_map(address_map &map); }; + +#endif // MAME_INCLUDES_XYBOTS_H diff --git a/src/mame/includes/z88.h b/src/mame/includes/z88.h index c1f3e4d3f7a..5697cf90672 100644 --- a/src/mame/includes/z88.h +++ b/src/mame/includes/z88.h @@ -35,15 +35,6 @@ #define Z88_SCR_HW_CURS (Z88_SCR_HW_HRS|Z88_SCR_HW_FLS|Z88_SCR_HW_REV) #define Z88_SCR_HW_NULL (Z88_SCR_HW_HRS|Z88_SCR_HW_GRY|Z88_SCR_HW_REV) -enum -{ - Z88_BANK_ROM = 1, - Z88_BANK_RAM, - Z88_BANK_CART, - Z88_BANK_UNMAP -}; - - class z88_state : public driver_device { public: @@ -54,9 +45,16 @@ public: m_palette(*this, "palette") { } - required_device m_maincpu; - required_device m_ram; - required_device m_palette; + void z88(machine_config &config); + +protected: + enum + { + Z88_BANK_ROM = 1, + Z88_BANK_RAM, + Z88_BANK_CART, + Z88_BANK_UNMAP + }; virtual void machine_start() override; virtual void machine_reset() override; @@ -81,6 +79,16 @@ public: void vh_render_6x8(bitmap_ind16 &bitmap, int x, int y, uint16_t pen0, uint16_t pen1, uint8_t *gfx); void vh_render_line(bitmap_ind16 &bitmap, int x, int y, uint16_t pen); + DECLARE_PALETTE_INIT(z88); + + void z88_io(address_map &map); + void z88_mem(address_map &map); + +private: + required_device m_maincpu; + required_device m_ram; + required_device m_palette; + struct { uint8_t slot; @@ -91,10 +99,6 @@ public: uint8_t * m_bios; uint8_t * m_ram_base; z88cart_slot_device * m_carts[4]; - DECLARE_PALETTE_INIT(z88); - void z88(machine_config &config); - void z88_io(address_map &map); - void z88_mem(address_map &map); }; #endif /* MAME_INCLUDES_Z88_H */ diff --git a/src/mame/machine/atarigen.cpp b/src/mame/machine/atarigen.cpp index dab8bf74575..e4ec35a73c8 100644 --- a/src/mame/machine/atarigen.cpp +++ b/src/mame/machine/atarigen.cpp @@ -28,7 +28,7 @@ INLINE FUNCTIONS ***************************************************************************/ -inline const atarigen_screen_timer *get_screen_timer(screen_device &screen) +inline const atarigen_screen_timer *atarigen_state::get_screen_timer(screen_device &screen) { atarigen_state *state = screen.machine().driver_data(); int i; diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h index caea246c8f0..7289eca9f32 100644 --- a/src/mame/machine/atarigen.h +++ b/src/mame/machine/atarigen.h @@ -262,6 +262,7 @@ public: // construction/destruction atarigen_state(const machine_config &mconfig, device_type type, const char *tag); +protected: // users must call through to these virtual void machine_start() override; virtual void machine_reset() override; @@ -319,16 +320,16 @@ public: optional_shared_ptr m_yscroll; /* internal state */ - uint8_t m_slapstic_num; - uint16_t * m_slapstic; - uint8_t m_slapstic_bank; - std::vector m_slapstic_bank0; + uint8_t m_slapstic_num; + uint16_t * m_slapstic; + uint8_t m_slapstic_bank; + std::vector m_slapstic_bank0; offs_t m_slapstic_last_pc; offs_t m_slapstic_last_address; offs_t m_slapstic_base; offs_t m_slapstic_mirror; - uint32_t m_scanlines_per_callback; + uint32_t m_scanlines_per_callback; atarigen_screen_timer m_screen_timer[2]; @@ -339,6 +340,9 @@ public: optional_device m_palette; optional_shared_ptr m_generic_paletteram_16; optional_device m_slapstic_device; + +private: + static const atarigen_screen_timer *get_screen_timer(screen_device &screen); }; diff --git a/src/mame/machine/irobot.cpp b/src/mame/machine/irobot.cpp index ba19a5a2f9a..22ae2d49169 100644 --- a/src/mame/machine/irobot.cpp +++ b/src/mame/machine/irobot.cpp @@ -278,7 +278,7 @@ READ8_MEMBER(irobot_state::irobot_status_r) #if DISASSEMBLE_MB_ROM -static void disassemble_instruction(irmb_ops *op); +static void disassemble_instruction(irobot_state::irmb_ops const *op); #endif @@ -820,7 +820,7 @@ default: case 0x3f: IXOR(irmb_din(curop), 0); bre #if DISASSEMBLE_MB_ROM -static void disassemble_instruction(irmb_ops *op) +static void disassemble_instruction(irobot_state::irmb_ops const *op) { int lp; @@ -969,4 +969,4 @@ static void disassemble_instruction(irmb_ops *op) if (op->jtype == 5) logerror("\n"); } } -#endif +#endif // DISASSEMBLE_MB_ROM diff --git a/src/mame/machine/wswan.cpp b/src/mame/machine/wswan.cpp index 96d95c8d21d..ad8508a6747 100644 --- a/src/mame/machine/wswan.cpp +++ b/src/mame/machine/wswan.cpp @@ -199,7 +199,7 @@ void wswan_state::machine_start() m_system_type = TYPE_WSWAN; } -MACHINE_START_MEMBER(wswan_state, wscolor) +void wscolor_state::machine_start() { common_start(); m_system_type = TYPE_WSC; diff --git a/src/mame/video/atarigx2.cpp b/src/mame/video/atarigx2.cpp index db1d7b79a31..3159d1980a5 100644 --- a/src/mame/video/atarigx2.cpp +++ b/src/mame/video/atarigx2.cpp @@ -67,7 +67,7 @@ TILEMAP_MAPPER_MEMBER(atarigx2_state::atarigx2_playfield_scan) * *************************************/ -VIDEO_START_MEMBER(atarigx2_state,atarigx2) +void atarigx2_state::video_start() { /* blend the playfields and free the temporary one */ blend_gfx(0, 2, 0x0f, 0x30); diff --git a/src/mame/video/cybstorm.cpp b/src/mame/video/cybstorm.cpp index 4fd35dac607..4cedc1d9482 100644 --- a/src/mame/video/cybstorm.cpp +++ b/src/mame/video/cybstorm.cpp @@ -96,7 +96,7 @@ const atari_motion_objects_config cybstorm_state::s_mob_config = 0, /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(cybstorm_state,cybstorm) +void cybstorm_state::video_start() { /* motion objects have 256 color granularity */ m_gfxdecode->gfx(1)->set_granularity(256); diff --git a/src/mame/video/equites.cpp b/src/mame/video/equites.cpp index 5e2b5cd62b0..66e366a9632 100644 --- a/src/mame/video/equites.cpp +++ b/src/mame/video/equites.cpp @@ -36,7 +36,7 @@ PALETTE_INIT_MEMBER(equites_state,equites) palette.set_pen_indirect(i + 0x100, color_prom[i]); } -PALETTE_INIT_MEMBER(equites_state,splndrbt) +PALETTE_INIT_MEMBER(splndrbt_state,splndrbt) { const uint8_t *color_prom = memregion("proms")->base(); int i; @@ -78,7 +78,7 @@ TILE_GET_INFO_MEMBER(equites_state::equites_fg_info) tileinfo.flags |= TILE_FORCE_LAYER0; } -TILE_GET_INFO_MEMBER(equites_state::splndrbt_fg_info) +TILE_GET_INFO_MEMBER(splndrbt_state::splndrbt_fg_info) { int tile = m_fg_videoram[2 * tile_index] + (m_fg_char_bank << 8); int color = m_fg_videoram[2 * tile_index + 1] & 0x3f; @@ -98,7 +98,7 @@ TILE_GET_INFO_MEMBER(equites_state::equites_bg_info) SET_TILE_INFO_MEMBER(1, tile, color, TILE_FLIPXY(fxy)); } -TILE_GET_INFO_MEMBER(equites_state::splndrbt_bg_info) +TILE_GET_INFO_MEMBER(splndrbt_state::splndrbt_bg_info) { int data = m_bg_videoram[tile_index]; int tile = data & 0x1ff; @@ -130,18 +130,18 @@ VIDEO_START_MEMBER(equites_state,equites) m_bg_tilemap->set_scrolldx(0, -10); } -VIDEO_START_MEMBER(equites_state,splndrbt) +VIDEO_START_MEMBER(splndrbt_state,splndrbt) { assert(m_screen->format() == BITMAP_FORMAT_IND16); m_fg_videoram = std::make_unique(0x800); save_pointer(NAME(m_fg_videoram.get()), 0x800); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(equites_state::splndrbt_fg_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(splndrbt_state::splndrbt_fg_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32); m_fg_tilemap->set_transparent_pen(0); m_fg_tilemap->set_scrolldx(8, -8); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(equites_state::splndrbt_bg_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(splndrbt_state::splndrbt_bg_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); m_bg_tilemap->configure_groups(*m_gfxdecode->gfx(1), 0x10); } @@ -187,7 +187,7 @@ WRITE16_MEMBER(equites_state::equites_scrollreg_w) m_bg_tilemap->set_scrollx(0, data >> 8); } -WRITE_LINE_MEMBER(equites_state::splndrbt_selchar_w) +WRITE_LINE_MEMBER(splndrbt_state::splndrbt_selchar_w) { // select active char map m_fg_char_bank = (state == 0) ? 0 : 1; @@ -199,12 +199,12 @@ WRITE_LINE_MEMBER(equites_state::flip_screen_w) flip_screen_set(state); } -WRITE16_MEMBER(equites_state::splndrbt_bg_scrollx_w) +WRITE16_MEMBER(splndrbt_state::splndrbt_bg_scrollx_w) { COMBINE_DATA(&m_splndrbt_bg_scrollx); } -WRITE16_MEMBER(equites_state::splndrbt_bg_scrolly_w) +WRITE16_MEMBER(splndrbt_state::splndrbt_bg_scrolly_w) { COMBINE_DATA(&m_splndrbt_bg_scrolly); } @@ -288,7 +288,7 @@ Also, note that sprites are 30x30, not 32x32. 03020303 03030303 03030303 03030303 */ -void equites_state::splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +void splndrbt_state::splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { const uint8_t * const xrom = memregion("user2")->base(); const uint8_t * const yrom = xrom + 0x100; @@ -362,7 +362,7 @@ void equites_state::splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle } -void equites_state::splndrbt_copy_bg(bitmap_ind16 &dst_bitmap, const rectangle &cliprect) +void splndrbt_state::splndrbt_copy_bg(bitmap_ind16 &dst_bitmap, const rectangle &cliprect) { bitmap_ind16 &src_bitmap = m_bg_tilemap->pixmap(); bitmap_ind8 &flags_bitmap = m_bg_tilemap->flagsmap(); @@ -429,7 +429,7 @@ uint32_t equites_state::screen_update_equites(screen_device &screen, bitmap_ind1 return 0; } -uint32_t equites_state::screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t splndrbt_state::screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_bgcolor, cliprect); diff --git a/src/mame/video/exidy440.cpp b/src/mame/video/exidy440.cpp index 84f6fa7d063..710cb8f0f9d 100644 --- a/src/mame/video/exidy440.cpp +++ b/src/mame/video/exidy440.cpp @@ -33,7 +33,7 @@ * *************************************/ -VIDEO_START_MEMBER(exidy440_state,exidy440) +void exidy440_state::video_start() { /* reset the system */ m_firq_enable = 0; @@ -55,9 +55,9 @@ VIDEO_START_MEMBER(exidy440_state,exidy440) } -VIDEO_START_MEMBER(exidy440_state,topsecex) +void topsecex_state::video_start() { - VIDEO_START_CALL_MEMBER(exidy440); + exidy440_state::video_start(); m_topsecex_yscroll = 0; } @@ -441,7 +441,7 @@ uint32_t exidy440_state::screen_update_exidy440(screen_device &screen, bitmap_in } -uint32_t exidy440_state::screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t topsecex_state::screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* redraw the screen */ update_screen(screen, bitmap, cliprect, m_topsecex_yscroll, false); @@ -458,7 +458,6 @@ uint32_t exidy440_state::screen_update_topsecex(screen_device &screen, bitmap_in *************************************/ MACHINE_CONFIG_START(exidy440_state::exidy440_video) - MCFG_VIDEO_START_OVERRIDE(exidy440_state,exidy440) MCFG_PALETTE_ADD("palette", 256) MCFG_SCREEN_ADD("screen", RASTER) @@ -469,11 +468,9 @@ MACHINE_CONFIG_START(exidy440_state::exidy440_video) MACHINE_CONFIG_END -MACHINE_CONFIG_START(exidy440_state::topsecex_video) - MCFG_VIDEO_START_OVERRIDE(exidy440_state,topsecex) - +MACHINE_CONFIG_START(topsecex_state::topsecex_video) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VIDEO_ATTRIBUTES(0) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, TOPSECEX_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(exidy440_state, screen_update_topsecex) + MCFG_SCREEN_UPDATE_DRIVER(topsecex_state, screen_update_topsecex) MACHINE_CONFIG_END diff --git a/src/mame/video/foodf.cpp b/src/mame/video/foodf.cpp index 2fed0782160..4025a3ced60 100644 --- a/src/mame/video/foodf.cpp +++ b/src/mame/video/foodf.cpp @@ -33,7 +33,7 @@ TILE_GET_INFO_MEMBER(foodf_state::get_playfield_tile_info) * *************************************/ -VIDEO_START_MEMBER(foodf_state,foodf) +void foodf_state::video_start() { static const int resistances[3] = { 1000, 470, 220 }; diff --git a/src/mame/video/gauntlet.cpp b/src/mame/video/gauntlet.cpp index 6518aeac69c..b003e45522b 100644 --- a/src/mame/video/gauntlet.cpp +++ b/src/mame/video/gauntlet.cpp @@ -79,7 +79,7 @@ const atari_motion_objects_config gauntlet_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(gauntlet_state,gauntlet) +void gauntlet_state::video_start() { /* modify the motion object code lookup table to account for the code XOR */ std::vector &codelookup = m_mob->code_lookup(); diff --git a/src/mame/video/irobot.cpp b/src/mame/video/irobot.cpp index 8201279ed83..cdeef307727 100644 --- a/src/mame/video/irobot.cpp +++ b/src/mame/video/irobot.cpp @@ -78,7 +78,7 @@ WRITE8_MEMBER(irobot_state::irobot_paletteram_w) } -void irobot_state::_irobot_poly_clear(uint8_t *bitmap_base) +void irobot_state::irobot_poly_clear(uint8_t *bitmap_base) { memset(bitmap_base, 0, BITMAP_WIDTH * m_screen->height()); } @@ -86,7 +86,7 @@ void irobot_state::_irobot_poly_clear(uint8_t *bitmap_base) void irobot_state::irobot_poly_clear() { uint8_t *bitmap_base = m_bufsel ? m_polybitmap2.get() : m_polybitmap1.get(); - _irobot_poly_clear(bitmap_base); + irobot_poly_clear(bitmap_base); } @@ -103,8 +103,8 @@ void irobot_state::video_start() m_polybitmap2 = std::make_unique(BITMAP_WIDTH * height); /* clear the bitmaps so we start with valid palette look-up values for drawing */ - _irobot_poly_clear(m_polybitmap1.get()); - _irobot_poly_clear(m_polybitmap2.get()); + irobot_poly_clear(m_polybitmap1.get()); + irobot_poly_clear(m_polybitmap2.get()); /* Set clipping */ m_ir_xmin = m_ir_ymin = 0; diff --git a/src/mame/video/klax.cpp b/src/mame/video/klax.cpp index 94544abc92f..b8a3129a35c 100644 --- a/src/mame/video/klax.cpp +++ b/src/mame/video/klax.cpp @@ -69,10 +69,6 @@ const atari_motion_objects_config klax_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(klax_state,klax) -{ -} - /************************************* diff --git a/src/mame/video/offtwall.cpp b/src/mame/video/offtwall.cpp index 9276f738cac..1bdd845059f 100644 --- a/src/mame/video/offtwall.cpp +++ b/src/mame/video/offtwall.cpp @@ -69,11 +69,6 @@ const atari_motion_objects_config offtwall_state::s_mob_config = }; -VIDEO_START_MEMBER(offtwall_state,offtwall) -{ -} - - /************************************* * diff --git a/src/mame/video/pecom.cpp b/src/mame/video/pecom.cpp index bcf8347facc..175d906deb8 100644 --- a/src/mame/video/pecom.cpp +++ b/src/mame/video/pecom.cpp @@ -79,7 +79,7 @@ WRITE_LINE_MEMBER(pecom_state::pecom_prd_w) m_dma = !m_dma; } -VIDEO_START_MEMBER(pecom_state,pecom) +void pecom_state::video_start() { /* allocate memory */ m_charram = std::make_unique(PECOM_CHAR_RAM_SIZE); @@ -93,8 +93,6 @@ VIDEO_START_MEMBER(pecom_state,pecom) MACHINE_CONFIG_START(pecom_state::pecom_video) MCFG_CDP1869_SCREEN_PAL_ADD(CDP1869_TAG, SCREEN_TAG, cdp1869_device::DOT_CLK_PAL) - MCFG_VIDEO_START_OVERRIDE(pecom_state,pecom) - MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_CDP1869_ADD(CDP1869_TAG, cdp1869_device::DOT_CLK_PAL, cdp1869_page_ram) diff --git a/src/mame/video/rampart.cpp b/src/mame/video/rampart.cpp index 806cecc5bc3..d4ea5e1a2d0 100644 --- a/src/mame/video/rampart.cpp +++ b/src/mame/video/rampart.cpp @@ -51,7 +51,7 @@ const atari_motion_objects_config rampart_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(rampart_state,rampart) +void rampart_state::video_start() { /* set the intial scroll offset */ m_mob->set_xscroll(-12); diff --git a/src/mame/video/relief.cpp b/src/mame/video/relief.cpp index 2b4f7432355..e5d64c94d22 100644 --- a/src/mame/video/relief.cpp +++ b/src/mame/video/relief.cpp @@ -79,7 +79,7 @@ const atari_motion_objects_config relief_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(relief_state,relief) +void relief_state::video_start() { /* MOs are 5bpp but with a 4-bit color granularity */ m_gfxdecode->gfx(1)->set_granularity(16); diff --git a/src/mame/video/skullxbo.cpp b/src/mame/video/skullxbo.cpp index 45b4f839d7d..8ebc443e31a 100644 --- a/src/mame/video/skullxbo.cpp +++ b/src/mame/video/skullxbo.cpp @@ -78,10 +78,6 @@ const atari_motion_objects_config skullxbo_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(skullxbo_state,skullxbo) -{ -} - /************************************* diff --git a/src/mame/video/thunderj.cpp b/src/mame/video/thunderj.cpp index 940333496b3..b2a5e3506fc 100644 --- a/src/mame/video/thunderj.cpp +++ b/src/mame/video/thunderj.cpp @@ -91,10 +91,6 @@ const atari_motion_objects_config thunderj_state::s_mob_config = 0, /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(thunderj_state,thunderj) -{ -} - /************************************* diff --git a/src/mame/video/toobin.cpp b/src/mame/video/toobin.cpp index e895cfbb662..d16fce21cd1 100644 --- a/src/mame/video/toobin.cpp +++ b/src/mame/video/toobin.cpp @@ -78,7 +78,7 @@ const atari_motion_objects_config toobin_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(toobin_state,toobin) +void toobin_state::video_start() { /* allocate a playfield bitmap for rendering */ m_screen->register_screen_bitmap(m_pfbitmap); diff --git a/src/mame/video/vertigo.cpp b/src/mame/video/vertigo.cpp index a51b34f15c4..a0185729dae 100644 --- a/src/mame/video/vertigo.cpp +++ b/src/mame/video/vertigo.cpp @@ -195,117 +195,117 @@ void vertigo_state::vertigo_vproc_reset() * ********************************************/ -void vertigo_state::am2901x4 (am2901 *bsp, microcode *mc) +void vertigo_state::am2901x4(am2901 &bsp, microcode const &mc) { - switch (mc->inst) + switch (mc.inst) { - case 000: bsp->f = ADD(bsp->ram[mc->a], bsp->q, mc->cn); break; - case 001: bsp->f = ADD(bsp->ram[mc->a], bsp->ram[mc->b], mc->cn); break; - case 002: bsp->f = ADD(0, bsp->q, mc->cn); break; - case 003: bsp->f = ADD(0, bsp->ram[mc->b], mc->cn); break; - case 004: bsp->f = ADD(0, bsp->ram[mc->a], mc->cn); break; - case 005: bsp->f = ADD(bsp->d, bsp->ram[mc->a], mc->cn); break; - case 006: bsp->f = ADD(bsp->d, bsp->q, mc->cn); break; - case 007: bsp->f = ADD(bsp->d, 0, mc->cn); break; - - case 010: bsp->f = SUBR(bsp->ram[mc->a], bsp->q, mc->cn); break; - case 011: bsp->f = SUBR(bsp->ram[mc->a], bsp->ram[mc->b], mc->cn); break; - case 012: bsp->f = SUBR(0, bsp->q, mc->cn); break; - case 013: bsp->f = SUBR(0, bsp->ram[mc->b], mc->cn); break; - case 014: bsp->f = SUBR(0, bsp->ram[mc->a], mc->cn); break; - case 015: bsp->f = SUBR(bsp->d, bsp->ram[mc->a], mc->cn); break; - case 016: bsp->f = SUBR(bsp->d, bsp->q, mc->cn); break; - case 017: bsp->f = SUBR(bsp->d, 0, mc->cn); break; - - case 020: bsp->f = SUBS(bsp->ram[mc->a], bsp->q, mc->cn); break; - case 021: bsp->f = SUBS(bsp->ram[mc->a], bsp->ram[mc->b], mc->cn); break; - case 022: bsp->f = SUBS(0, bsp->q, mc->cn); break; - case 023: bsp->f = SUBS(0, bsp->ram[mc->b], mc->cn); break; - case 024: bsp->f = SUBS(0, bsp->ram[mc->a], mc->cn); break; - case 025: bsp->f = SUBS(bsp->d, bsp->ram[mc->a], mc->cn); break; - case 026: bsp->f = SUBS(bsp->d, bsp->q, mc->cn); break; - case 027: bsp->f = SUBS(bsp->d, 0, mc->cn); break; - - case 030: bsp->f = OR(bsp->ram[mc->a], bsp->q); break; - case 031: bsp->f = OR(bsp->ram[mc->a], bsp->ram[mc->b]); break; - case 032: bsp->f = OR(0, bsp->q); break; - case 033: bsp->f = OR(0, bsp->ram[mc->b]); break; - case 034: bsp->f = OR(0, bsp->ram[mc->a]); break; - case 035: bsp->f = OR(bsp->d, bsp->ram[mc->a]); break; - case 036: bsp->f = OR(bsp->d, bsp->q); break; - case 037: bsp->f = OR(bsp->d, 0); break; - - case 040: bsp->f = AND(bsp->ram[mc->a], bsp->q); break; - case 041: bsp->f = AND(bsp->ram[mc->a], bsp->ram[mc->b]); break; - case 042: bsp->f = AND(0, bsp->q); break; - case 043: bsp->f = AND(0, bsp->ram[mc->b]); break; - case 044: bsp->f = AND(0, bsp->ram[mc->a]); break; - case 045: bsp->f = AND(bsp->d, bsp->ram[mc->a]); break; - case 046: bsp->f = AND(bsp->d, bsp->q); break; - case 047: bsp->f = AND(bsp->d, 0); break; - - case 050: bsp->f = NOTRS(bsp->ram[mc->a], bsp->q); break; - case 051: bsp->f = NOTRS(bsp->ram[mc->a], bsp->ram[mc->b]); break; - case 052: bsp->f = NOTRS(0, bsp->q); break; - case 053: bsp->f = NOTRS(0, bsp->ram[mc->b]); break; - case 054: bsp->f = NOTRS(0, bsp->ram[mc->a]); break; - case 055: bsp->f = NOTRS(bsp->d, bsp->ram[mc->a]); break; - case 056: bsp->f = NOTRS(bsp->d, bsp->q); break; - case 057: bsp->f = NOTRS(bsp->d, 0); break; - - case 060: bsp->f = EXOR(bsp->ram[mc->a], bsp->q); break; - case 061: bsp->f = EXOR(bsp->ram[mc->a], bsp->ram[mc->b]); break; - case 062: bsp->f = EXOR(0, bsp->q); break; - case 063: bsp->f = EXOR(0, bsp->ram[mc->b]); break; - case 064: bsp->f = EXOR(0, bsp->ram[mc->a]); break; - case 065: bsp->f = EXOR(bsp->d, bsp->ram[mc->a]); break; - case 066: bsp->f = EXOR(bsp->d, bsp->q); break; - case 067: bsp->f = EXOR(bsp->d, 0); break; - - case 070: bsp->f = EXNOR(bsp->ram[mc->a], bsp->q); break; - case 071: bsp->f = EXNOR(bsp->ram[mc->a], bsp->ram[mc->b]); break; - case 072: bsp->f = EXNOR(0, bsp->q); break; - case 073: bsp->f = EXNOR(0, bsp->ram[mc->b]); break; - case 074: bsp->f = EXNOR(0, bsp->ram[mc->a]); break; - case 075: bsp->f = EXNOR(bsp->d, bsp->ram[mc->a]); break; - case 076: bsp->f = EXNOR(bsp->d, bsp->q); break; - case 077: bsp->f = EXNOR(bsp->d, 0); break; + case 000: bsp.f = ADD(bsp.ram[mc.a], bsp.q, mc.cn); break; + case 001: bsp.f = ADD(bsp.ram[mc.a], bsp.ram[mc.b], mc.cn); break; + case 002: bsp.f = ADD(0, bsp.q, mc.cn); break; + case 003: bsp.f = ADD(0, bsp.ram[mc.b], mc.cn); break; + case 004: bsp.f = ADD(0, bsp.ram[mc.a], mc.cn); break; + case 005: bsp.f = ADD(bsp.d, bsp.ram[mc.a], mc.cn); break; + case 006: bsp.f = ADD(bsp.d, bsp.q, mc.cn); break; + case 007: bsp.f = ADD(bsp.d, 0, mc.cn); break; + + case 010: bsp.f = SUBR(bsp.ram[mc.a], bsp.q, mc.cn); break; + case 011: bsp.f = SUBR(bsp.ram[mc.a], bsp.ram[mc.b], mc.cn); break; + case 012: bsp.f = SUBR(0, bsp.q, mc.cn); break; + case 013: bsp.f = SUBR(0, bsp.ram[mc.b], mc.cn); break; + case 014: bsp.f = SUBR(0, bsp.ram[mc.a], mc.cn); break; + case 015: bsp.f = SUBR(bsp.d, bsp.ram[mc.a], mc.cn); break; + case 016: bsp.f = SUBR(bsp.d, bsp.q, mc.cn); break; + case 017: bsp.f = SUBR(bsp.d, 0, mc.cn); break; + + case 020: bsp.f = SUBS(bsp.ram[mc.a], bsp.q, mc.cn); break; + case 021: bsp.f = SUBS(bsp.ram[mc.a], bsp.ram[mc.b], mc.cn); break; + case 022: bsp.f = SUBS(0, bsp.q, mc.cn); break; + case 023: bsp.f = SUBS(0, bsp.ram[mc.b], mc.cn); break; + case 024: bsp.f = SUBS(0, bsp.ram[mc.a], mc.cn); break; + case 025: bsp.f = SUBS(bsp.d, bsp.ram[mc.a], mc.cn); break; + case 026: bsp.f = SUBS(bsp.d, bsp.q, mc.cn); break; + case 027: bsp.f = SUBS(bsp.d, 0, mc.cn); break; + + case 030: bsp.f = OR(bsp.ram[mc.a], bsp.q); break; + case 031: bsp.f = OR(bsp.ram[mc.a], bsp.ram[mc.b]); break; + case 032: bsp.f = OR(0, bsp.q); break; + case 033: bsp.f = OR(0, bsp.ram[mc.b]); break; + case 034: bsp.f = OR(0, bsp.ram[mc.a]); break; + case 035: bsp.f = OR(bsp.d, bsp.ram[mc.a]); break; + case 036: bsp.f = OR(bsp.d, bsp.q); break; + case 037: bsp.f = OR(bsp.d, 0); break; + + case 040: bsp.f = AND(bsp.ram[mc.a], bsp.q); break; + case 041: bsp.f = AND(bsp.ram[mc.a], bsp.ram[mc.b]); break; + case 042: bsp.f = AND(0, bsp.q); break; + case 043: bsp.f = AND(0, bsp.ram[mc.b]); break; + case 044: bsp.f = AND(0, bsp.ram[mc.a]); break; + case 045: bsp.f = AND(bsp.d, bsp.ram[mc.a]); break; + case 046: bsp.f = AND(bsp.d, bsp.q); break; + case 047: bsp.f = AND(bsp.d, 0); break; + + case 050: bsp.f = NOTRS(bsp.ram[mc.a], bsp.q); break; + case 051: bsp.f = NOTRS(bsp.ram[mc.a], bsp.ram[mc.b]); break; + case 052: bsp.f = NOTRS(0, bsp.q); break; + case 053: bsp.f = NOTRS(0, bsp.ram[mc.b]); break; + case 054: bsp.f = NOTRS(0, bsp.ram[mc.a]); break; + case 055: bsp.f = NOTRS(bsp.d, bsp.ram[mc.a]); break; + case 056: bsp.f = NOTRS(bsp.d, bsp.q); break; + case 057: bsp.f = NOTRS(bsp.d, 0); break; + + case 060: bsp.f = EXOR(bsp.ram[mc.a], bsp.q); break; + case 061: bsp.f = EXOR(bsp.ram[mc.a], bsp.ram[mc.b]); break; + case 062: bsp.f = EXOR(0, bsp.q); break; + case 063: bsp.f = EXOR(0, bsp.ram[mc.b]); break; + case 064: bsp.f = EXOR(0, bsp.ram[mc.a]); break; + case 065: bsp.f = EXOR(bsp.d, bsp.ram[mc.a]); break; + case 066: bsp.f = EXOR(bsp.d, bsp.q); break; + case 067: bsp.f = EXOR(bsp.d, 0); break; + + case 070: bsp.f = EXNOR(bsp.ram[mc.a], bsp.q); break; + case 071: bsp.f = EXNOR(bsp.ram[mc.a], bsp.ram[mc.b]); break; + case 072: bsp.f = EXNOR(0, bsp.q); break; + case 073: bsp.f = EXNOR(0, bsp.ram[mc.b]); break; + case 074: bsp.f = EXNOR(0, bsp.ram[mc.a]); break; + case 075: bsp.f = EXNOR(bsp.d, bsp.ram[mc.a]); break; + case 076: bsp.f = EXNOR(bsp.d, bsp.q); break; + case 077: bsp.f = EXNOR(bsp.d, 0); break; } - switch (mc->dest) + switch (mc.dest) { case QREG: - bsp->q = bsp->f; - bsp->y = bsp->f; + bsp.q = bsp.f; + bsp.y = bsp.f; break; case NOP: - bsp->y = bsp->f; + bsp.y = bsp.f; break; case RAMA: - bsp->y = bsp->ram[mc->a]; - bsp->ram[mc->b] = bsp->f; + bsp.y = bsp.ram[mc.a]; + bsp.ram[mc.b] = bsp.f; break; case RAMF: - bsp->y = bsp->f; - bsp->ram[mc->b] = bsp->f; + bsp.y = bsp.f; + bsp.ram[mc.b] = bsp.f; break; case RAMQD: - bsp->y = bsp->f; - bsp->q = (bsp->q >> 1) & 0x7fff; /* Q3 is low */ - bsp->ram[mc->b] = (bsp->f >> 1) | 0x8000; /* IN3 is high! */ + bsp.y = bsp.f; + bsp.q = (bsp.q >> 1) & 0x7fff; /* Q3 is low */ + bsp.ram[mc.b] = (bsp.f >> 1) | 0x8000; /* IN3 is high! */ break; case RAMD: - bsp->y = bsp->f; - bsp->ram[mc->b] = (bsp->f >> 1) | 0x8000; /* IN3 is high! */ + bsp.y = bsp.f; + bsp.ram[mc.b] = (bsp.f >> 1) | 0x8000; /* IN3 is high! */ break; case RAMQU: - bsp->y = bsp->f; - bsp->ram[mc->b] = (bsp->f << 1) & 0xffff; - bsp->q = (bsp->q << 1) & 0xffff; + bsp.y = bsp.f; + bsp.ram[mc.b] = (bsp.f << 1) & 0xffff; + bsp.q = (bsp.q << 1) & 0xffff; break; case RAMU: - bsp->y = bsp->f; - bsp->ram[mc->b] = (bsp->f << 1) & 0xffff; + bsp.y = bsp.f; + bsp.ram[mc.b] = (bsp.f << 1) & 0xffff; break; } } @@ -322,56 +322,56 @@ void vertigo_state::am2901x4 (am2901 *bsp, microcode *mc) * ********************************************/ -void vertigo_state::vertigo_vgen (vector_generator *vg) +void vertigo_state::vertigo_vgen(vector_generator &vg) { - if (vg->c_l & 0x800) + if (vg.c_l & 0x800) { - vg->vfin = 1; - vg->c_l = (vg->c_l+1) & 0xfff; + vg.vfin = 1; + vg.c_l = (vg.c_l+1) & 0xfff; - if ((vg->c_l & 0x800) == 0) + if ((vg.c_l & 0x800) == 0) { - vg->brez = 0; - vg->vfin = 0; + vg.brez = 0; + vg.vfin = 0; } - if (vg->brez) /* H/V counter enabled */ + if (vg.brez) /* H/V counter enabled */ { /* Depending on MSB of adder only one or both counters are de-/incremented. This is all defined by the shift register which is latched in bits 12-15 of L1/L2. */ - if (vg->adder_s & 0x800) + if (vg.adder_s & 0x800) { - if (vg->hc1) - vg->c_h += vg->hud1? -1: 1; + if (vg.hc1) + vg.c_h += vg.hud1? -1: 1; else - vg->c_v += vg->vud1? -1: 1; - vg->adder_a = vg->l1; + vg.c_v += vg.vud1? -1: 1; + vg.adder_a = vg.l1; } else { - vg->c_h += vg->hud2? -1: 1; - vg->c_v += vg->vud2? -1: 1; - vg->adder_a = vg->l2; + vg.c_h += vg.hud2? -1: 1; + vg.c_v += vg.vud2? -1: 1; + vg.adder_a = vg.l2; } /* H/V counters are 12 bit */ - vg->c_v &= 0xfff; - vg->c_h &= 0xfff; + vg.c_v &= 0xfff; + vg.c_h &= 0xfff; } - vg->adder_s = (vg->adder_s + vg->adder_a) & 0xfff; + vg.adder_s = (vg.adder_s + vg.adder_a) & 0xfff; } - if (vg->brez ^ vg->ven) + if (vg.brez ^ vg.ven) { - if (vg->brez) - V_ADDPOINT (vg->c_h, vg->c_v, 0, 0); + if (vg.brez) + V_ADDPOINT (vg.c_h, vg.c_v, 0, 0); else - V_ADDPOINT (vg->c_h, vg->c_v, vg->color, vg->intensity); - vg->ven = vg->brez; + V_ADDPOINT (vg.c_h, vg.c_v, vg.color, vg.intensity); + vg.ven = vg.brez; } } @@ -427,7 +427,7 @@ void vertigo_state::vertigo_vproc(int cycles, int irq4) } } - am2901x4 (&m_bsp, cmc); + am2901x4(m_bsp, *cmc); /* Store data */ switch (cmc->oa) @@ -490,7 +490,7 @@ void vertigo_state::vertigo_vproc(int cycles, int irq4) break; } - vertigo_vgen (&m_vgen); + vertigo_vgen(m_vgen); /* Microcode program flow */ switch (cmc->jcon) diff --git a/src/mame/video/victory.cpp b/src/mame/video/victory.cpp index 19a86d83c08..4c81a3b5053 100644 --- a/src/mame/video/victory.cpp +++ b/src/mame/video/victory.cpp @@ -511,24 +511,25 @@ Registers: * *************************************/ -static inline void count_states(struct micro_t µ, int states) +inline void victory_state::micro_t::count_states(int states) { - attotime state_time = MICRO_STATE_CLOCK_PERIOD * states; + attotime const state_time = MICRO_STATE_CLOCK_PERIOD * states; - if (!micro.timer) + if (!timer) { - micro.timer->adjust(attotime::never); - micro.timer_active = 1; - micro.endtime = state_time; + // FIXME: how is dereferencing the timer when it's null supposed to be a good idea? + timer->adjust(attotime::never); + timer_active = 1; + endtime = state_time; } - else if (micro.timer->elapsed() > micro.endtime) + else if (timer->elapsed() > endtime) { - micro.timer->adjust(attotime::never); - micro.timer_active = 1; - micro.endtime = state_time; + timer->adjust(attotime::never); + timer_active = 1; + endtime = state_time; } else - micro.endtime += state_time; + endtime += state_time; } @@ -560,7 +561,7 @@ int victory_state::command2() if (micro.cmd & 0x40) m_rram[addr] = micro.r; - count_states(micro, 3); + micro.count_states(3); return 0; } @@ -667,7 +668,7 @@ int victory_state::command3() } } - count_states(micro, 3 + (2 + 2 * ycount) * xcount); + micro.count_states(3 + (2 + 2 * ycount) * xcount); return micro.cmd & 0x80; } @@ -704,7 +705,7 @@ int victory_state::command4() if (LOG_MICROCODE) logerror("================= EXECUTE BEGIN\n"); - count_states(micro, 4); + micro.count_states(4); micro.pc = micro.yp << 1; do @@ -869,7 +870,7 @@ int victory_state::command5() micro.xp = x; - count_states(micro, 3 + 2 * (0x100 - (micro.i & 0xff))); + micro.count_states(3 + 2 * (0x100 - (micro.i & 0xff))); return micro.cmd & 0x80; } @@ -919,7 +920,7 @@ int victory_state::command6() m_rram[daddr] = m_rram[saddr]; } - count_states(micro, 3 + 2 * (64 - (micro.r & 31) * 2)); + micro.count_states(3 + 2 * (64 - (micro.r & 31) * 2)); return micro.cmd & 0x80; } @@ -999,7 +1000,7 @@ int victory_state::command7() if (m_fgcoll) update_irq(); } - count_states(micro, 4); + micro.count_states(4); return micro.cmd & 0x80; } diff --git a/src/mame/video/vindictr.cpp b/src/mame/video/vindictr.cpp index 1575a10c134..810700c2e83 100644 --- a/src/mame/video/vindictr.cpp +++ b/src/mame/video/vindictr.cpp @@ -77,7 +77,7 @@ const atari_motion_objects_config vindictr_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(vindictr_state,vindictr) +void vindictr_state::video_start() { /* save states */ save_item(NAME(m_playfield_tile_bank)); diff --git a/src/mame/video/xybots.cpp b/src/mame/video/xybots.cpp index f0eec960268..6502f0f6256 100644 --- a/src/mame/video/xybots.cpp +++ b/src/mame/video/xybots.cpp @@ -79,10 +79,6 @@ const atari_motion_objects_config xybots_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(xybots_state,xybots) -{ -} - /************************************* -- cgit v1.2.3