diff options
author | Ivan Vangelista <mesgnet@yahoo.it> | 2020-11-28 17:13:32 +0100 |
---|---|---|
committer | Ivan Vangelista <mesgnet@yahoo.it> | 2020-11-28 17:13:32 +0100 |
commit | c02a51c9313459843b1e21fa1e839ee3f25c4c9a (patch) | |
tree | ef312f0105ddb49d2fdb88f11173cbb371fa5fb6 | |
parent | a8979690ad91d7231cc8a01b626812a4c53b1e4c (diff) |
astrohome, fromance, hyprduel, pipedrm, playmark, powerbal: removed MACHINE_*_MEMBER macros
-rw-r--r-- | src/mame/drivers/astrohome.cpp | 17 | ||||
-rw-r--r-- | src/mame/drivers/fromance.cpp | 21 | ||||
-rw-r--r-- | src/mame/drivers/hyprduel.cpp | 18 | ||||
-rw-r--r-- | src/mame/drivers/pipedrm.cpp | 176 | ||||
-rw-r--r-- | src/mame/drivers/playmark.cpp | 25 | ||||
-rw-r--r-- | src/mame/drivers/powerbal.cpp | 22 | ||||
-rw-r--r-- | src/mame/includes/astrocde.h | 1 | ||||
-rw-r--r-- | src/mame/includes/fromance.h | 30 | ||||
-rw-r--r-- | src/mame/includes/playmark.h | 5 | ||||
-rw-r--r-- | src/mame/video/fromance.cpp | 30 |
10 files changed, 170 insertions, 175 deletions
diff --git a/src/mame/drivers/astrohome.cpp b/src/mame/drivers/astrohome.cpp index b9d05c6f639..1f8a83e4c96 100644 --- a/src/mame/drivers/astrohome.cpp +++ b/src/mame/drivers/astrohome.cpp @@ -24,6 +24,8 @@ #include "speaker.h" +namespace { + class astrocde_home_state : public astrocde_state { public: @@ -38,9 +40,13 @@ public: void astrocde(machine_config &config); + void init_astrocde(); + +protected: + virtual void machine_start() override; + private: uint8_t inputs_r(offs_t offset); - DECLARE_MACHINE_START(astrocde); void astrocade_io(address_map &map); void astrocade_mem(address_map &map); @@ -187,8 +193,6 @@ void astrocde_home_state::astrocde(machine_config &config) config.set_perfect_quantum(m_maincpu); - MCFG_MACHINE_START_OVERRIDE(astrocde_home_state, astrocde) - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(ASTROCADE_CLOCK, 455, 0, 352, 262, 0, 240); @@ -256,12 +260,12 @@ ROM_END * *************************************/ -void astrocde_state::init_astrocde() +void astrocde_home_state::init_astrocde() { m_video_config = AC_SOUND_PRESENT; } -MACHINE_START_MEMBER(astrocde_home_state, astrocde) +void astrocde_home_state::machine_start() { if (m_cart->exists()) m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x3fff, read8sm_delegate(*m_cart, FUNC(astrocade_cart_slot_device::read_rom))); @@ -275,6 +279,9 @@ MACHINE_START_MEMBER(astrocde_home_state, astrocde) } } +} // Anonymous namespace + + /************************************* * * Driver definitions diff --git a/src/mame/drivers/fromance.cpp b/src/mame/drivers/fromance.cpp index 08ec8b8e00d..3e266d3ee60 100644 --- a/src/mame/drivers/fromance.cpp +++ b/src/mame/drivers/fromance.cpp @@ -126,7 +126,7 @@ uint8_t fromance_state::fromance_busycheck_sub_r() void fromance_state::fromance_rombank_w(uint8_t data) { - membank("bank1")->set_entry(data); + m_rombank->set_entry(data); } @@ -261,7 +261,7 @@ void fromance_state::fromance_main_map(address_map &map) void fromance_state::nekkyoku_sub_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x8000, 0xbfff).bankr(m_rombank); map(0xc000, 0xefff).rw(FUNC(fromance_state::fromance_videoram_r), FUNC(fromance_state::fromance_videoram_w)); map(0xf000, 0xf7ff).ram(); map(0xf800, 0xffff).rw(FUNC(fromance_state::fromance_paletteram_r), FUNC(fromance_state::fromance_paletteram_w)); @@ -270,7 +270,7 @@ void fromance_state::nekkyoku_sub_map(address_map &map) void fromance_state::fromance_sub_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x8000, 0xbfff).bankr(m_rombank); map(0xc000, 0xc7ff).ram(); map(0xc800, 0xcfff).rw(FUNC(fromance_state::fromance_paletteram_r), FUNC(fromance_state::fromance_paletteram_w)); map(0xd000, 0xffff).rw(FUNC(fromance_state::fromance_videoram_r), FUNC(fromance_state::fromance_videoram_w)); @@ -864,11 +864,11 @@ GFXDECODE_END * *************************************/ -MACHINE_START_MEMBER(fromance_state,fromance) +void fromance_state::machine_start() { uint8_t *ROM = memregion("sub")->base(); - membank("bank1")->configure_entries(0, 0x100, &ROM[0x10000], 0x4000); + m_rombank->configure_entries(0, 0x100, &ROM[0x10000], 0x4000); save_item(NAME(m_portselect)); @@ -879,7 +879,7 @@ MACHINE_START_MEMBER(fromance_state,fromance) /* video-related elements are saved in video_start */ } -MACHINE_RESET_MEMBER(fromance_state,fromance) +void fromance_state::machine_reset() { m_portselect = 0; @@ -914,9 +914,6 @@ void fromance_state::nekkyoku(machine_config &config) GENERIC_LATCH_8(config, m_sublatch); m_sublatch->set_separate_acknowledge(true); - MCFG_MACHINE_START_OVERRIDE(fromance_state,fromance) - MCFG_MACHINE_RESET_OVERRIDE(fromance_state,fromance) - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -958,9 +955,6 @@ void fromance_state::idolmj(machine_config &config) GENERIC_LATCH_8(config, m_sublatch); m_sublatch->set_separate_acknowledge(true); - MCFG_MACHINE_START_OVERRIDE(fromance_state,fromance) - MCFG_MACHINE_RESET_OVERRIDE(fromance_state,fromance) - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -1003,9 +997,6 @@ void fromance_state::fromance(machine_config &config) GENERIC_LATCH_8(config, m_sublatch); m_sublatch->set_separate_acknowledge(true); - MCFG_MACHINE_START_OVERRIDE(fromance_state,fromance) - MCFG_MACHINE_RESET_OVERRIDE(fromance_state,fromance) - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); diff --git a/src/mame/drivers/hyprduel.cpp b/src/mame/drivers/hyprduel.cpp index 8a0ec1f7ba5..320c6e318c7 100644 --- a/src/mame/drivers/hyprduel.cpp +++ b/src/mame/drivers/hyprduel.cpp @@ -49,6 +49,8 @@ fix comms so it boots, it's a bit of a hack for hyperduel at the moment ;-) #include "speaker.h" +namespace { + #define RASTER_LINES 262 #define FIRST_VISIBLE_LINE 0 #define LAST_VISIBLE_LINE 223 @@ -71,6 +73,10 @@ public: void init_magerror(); void init_hyprduel(); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: uint8_t irq_cause_r(); void irq_cause_w(uint8_t data); @@ -79,8 +85,6 @@ private: void hyprduel_cpusync_trigger1_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t hyprduel_cpusync_trigger2_r(offs_t offset); void hyprduel_cpusync_trigger2_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - DECLARE_MACHINE_START(hyprduel); - DECLARE_MACHINE_START(magerror); TIMER_CALLBACK_MEMBER(vblank_end_callback); DECLARE_WRITE_LINE_MEMBER(vdp_blit_end_w); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); @@ -92,8 +96,6 @@ private: void magerror_map(address_map &map); void magerror_map2(address_map &map); - virtual void machine_reset() override; - /* memory pointers */ required_shared_ptr<uint16_t> m_irq_enable; required_shared_ptr_array<uint16_t, 3> m_sharedram; @@ -424,7 +426,7 @@ void hyprduel_state::machine_reset() *m_irq_enable = 0xff; } -MACHINE_START_MEMBER(hyprduel_state,hyprduel) +void hyprduel_state::machine_start() { save_item(NAME(m_blitter_bit)); save_item(NAME(m_requested_int)); @@ -461,8 +463,6 @@ void hyprduel_state::hyprduel(machine_config &config) M68000(config, m_subcpu, 20000000/2); /* 10MHz */ m_subcpu->set_addrmap(AS_PROGRAM, &hyprduel_state::hyprduel_map2); - MCFG_MACHINE_START_OVERRIDE(hyprduel_state,hyprduel) - /* video hardware */ i4220_config(config); @@ -489,8 +489,6 @@ void hyprduel_state::magerror(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &hyprduel_state::magerror_map2); m_subcpu->set_periodic_int(FUNC(hyprduel_state::irq1_line_hold), attotime::from_hz(968)); /* tempo? */ - MCFG_MACHINE_START_OVERRIDE(hyprduel_state,hyprduel) - /* video hardware */ i4220_config(config); @@ -568,6 +566,8 @@ void hyprduel_state::init_magerror() m_int_num = 0x01; } +} // Anonymous namespace + GAME( 1993, hyprduel, 0, hyprduel, hyprduel, hyprduel_state, init_hyprduel, ROT0, "Technosoft", "Hyper Duel (Japan set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1993, hyprduel2, hyprduel, hyprduel, hyprduel, hyprduel_state, init_hyprduel, ROT0, "Technosoft", "Hyper Duel (Japan set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/pipedrm.cpp b/src/mame/drivers/pipedrm.cpp index da4d940bda0..b595e36505a 100644 --- a/src/mame/drivers/pipedrm.cpp +++ b/src/mame/drivers/pipedrm.cpp @@ -172,35 +172,67 @@ Added Multiple Coin Feature: #include "speaker.h" -class pipedrm_state : public fromance_state +namespace { + +class hatris_state : public fromance_state { public: - pipedrm_state(const machine_config &mconfig, device_type type, const char *tag) : + hatris_state(const machine_config &mconfig, device_type type, const char *tag) : fromance_state(mconfig, type, tag), - m_soundlatch(*this, "soundlatch") + m_soundlatch(*this, "soundlatch"), + m_soundbank(*this, "sounbank") { } - void pipedrm(machine_config &config); void hatris(machine_config &config); - void init_pipedrm(); void init_hatris(); -private: +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + required_device<generic_latch_8_device> m_soundlatch; + required_memory_bank m_soundbank; - DECLARE_MACHINE_START(pipedrm); - DECLARE_MACHINE_RESET(pipedrm); - void pipedrm_bankswitch_w(uint8_t data); - void sound_bankswitch_w(uint8_t data); - uint8_t pending_command_r(); - void hatris_sound_portmap(address_map &map); + void sound_portmap(address_map &map); void main_map(address_map &map); void main_portmap(address_map &map); void sound_map(address_map &map); - void sound_portmap(address_map &map); + +private: + void bankswitch_w(uint8_t data); + uint8_t pending_command_r(); }; +class pipedrm_state : public hatris_state +{ +public: + pipedrm_state(const machine_config &mconfig, device_type type, const char *tag) : + hatris_state(mconfig, type, tag), + m_spr_old(*this, "vsystem_spr_old"), + m_spriteram(nullptr), + m_spriteram_size(0) + { } + + void pipedrm(machine_config &config); + + void init_pipedrm(); + +protected: + virtual void video_start() override; + +private: + required_device<vsystem_spr2_device> m_spr_old; + + uint8_t *m_spriteram; + u32 m_spriteram_size; + + void sound_bankswitch_w(uint8_t data); + + void sound_portmap(address_map &map); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; /************************************* * @@ -208,7 +240,7 @@ private: * *************************************/ -void pipedrm_state::pipedrm_bankswitch_w(uint8_t data) +void hatris_state::bankswitch_w(uint8_t data) { /* Bit layout: @@ -222,7 +254,7 @@ void pipedrm_state::pipedrm_bankswitch_w(uint8_t data) */ /* set the memory bank on the Z80 using the low 3 bits */ - membank("bank1")->set_entry(data & 0x7); + m_rombank->set_entry(data & 0x7); /* map to the fromance gfx register */ fromance_gfxreg_w(((data >> 6) & 0x01) | /* flipscreen */ @@ -232,7 +264,7 @@ void pipedrm_state::pipedrm_bankswitch_w(uint8_t data) void pipedrm_state::sound_bankswitch_w(uint8_t data) { - membank("bank2")->set_entry(data & 0x01); + m_soundbank->set_entry(data & 0x01); } @@ -242,7 +274,7 @@ void pipedrm_state::sound_bankswitch_w(uint8_t data) * *************************************/ -uint8_t pipedrm_state::pending_command_r() +uint8_t hatris_state::pending_command_r() { return m_soundlatch->pending_r(); } @@ -250,31 +282,68 @@ uint8_t pipedrm_state::pending_command_r() /************************************* * + * Video + * + *************************************/ + +void pipedrm_state::video_start() +{ + VIDEO_START_CALL_MEMBER(fromance); + m_scrolly_ofs = 0x00; +} + +void hatris_state::video_start() +{ + VIDEO_START_CALL_MEMBER(fromance); + m_scrollx_ofs = 0xB9; + m_scrolly_ofs = 0x00; +} + +uint32_t pipedrm_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint8_t* sram = m_spriteram; + + /* there seems to be no logical mapping for the X scroll register -- maybe it's gone */ + m_bg_tilemap->set_scrolly(0, m_scrolly[1]); + m_fg_tilemap->set_scrolly(0, m_scrolly[0]); + + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + m_spr_old->turbofrc_draw_sprites((uint16_t*)sram, m_spriteram_size, 0, bitmap, cliprect, screen.priority(), 0); + m_spr_old->turbofrc_draw_sprites((uint16_t*)sram, m_spriteram_size, 0, bitmap, cliprect, screen.priority(), 1); + return 0; +} + + + +/************************************* + * * Main CPU memory handlers * *************************************/ -void pipedrm_state::main_map(address_map &map) +void hatris_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x9fff).ram(); - map(0xa000, 0xbfff).bankr("bank1"); + map(0xa000, 0xbfff).bankr(m_rombank); map(0xc000, 0xcfff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); - map(0xd000, 0xffff).rw(FUNC(pipedrm_state::fromance_videoram_r), FUNC(pipedrm_state::fromance_videoram_w)).share("videoram"); + map(0xd000, 0xffff).rw(FUNC(hatris_state::fromance_videoram_r), FUNC(hatris_state::fromance_videoram_w)); } -void pipedrm_state::main_portmap(address_map &map) +void hatris_state::main_portmap(address_map &map) { map.global_mask(0xff); map(0x10, 0x11).w(m_gga, FUNC(vsystem_gga_device::write)); map(0x20, 0x20).portr("P1").w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x21, 0x21).portr("P2").w(FUNC(pipedrm_state::pipedrm_bankswitch_w)); - map(0x22, 0x25).w(FUNC(pipedrm_state::fromance_scroll_w)); + map(0x21, 0x21).portr("P2").w(FUNC(hatris_state::bankswitch_w)); + map(0x22, 0x25).w(FUNC(hatris_state::fromance_scroll_w)); map(0x22, 0x22).portr("DSW1"); map(0x23, 0x23).portr("DSW2"); map(0x24, 0x24).portr("SYSTEM"); - map(0x25, 0x25).r(FUNC(pipedrm_state::pending_command_r)); + map(0x25, 0x25).r(FUNC(hatris_state::pending_command_r)); } @@ -285,11 +354,11 @@ void pipedrm_state::main_portmap(address_map &map) * *************************************/ -void pipedrm_state::sound_map(address_map &map) +void hatris_state::sound_map(address_map &map) { map(0x0000, 0x77ff).rom(); map(0x7800, 0x7fff).ram(); - map(0x8000, 0xffff).bankr("bank2"); + map(0x8000, 0xffff).bankr(m_soundbank); } @@ -303,12 +372,12 @@ void pipedrm_state::sound_portmap(address_map &map) } -void pipedrm_state::hatris_sound_portmap(address_map &map) +void hatris_state::sound_portmap(address_map &map) { map.global_mask(0xff); map(0x00, 0x03).mirror(0x08).rw("ymsnd", FUNC(ym2608_device::read), FUNC(ym2608_device::write)); map(0x04, 0x04).r(m_soundlatch, FUNC(generic_latch_8_device::read)); - map(0x05, 0x05).r(FUNC(pipedrm_state::pending_command_r)).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w)); + map(0x05, 0x05).r(FUNC(hatris_state::pending_command_r)).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w)); } @@ -550,20 +619,20 @@ GFXDECODE_END * *************************************/ -MACHINE_START_MEMBER(pipedrm_state,pipedrm) +void hatris_state::machine_start() { /* initialize main Z80 bank */ - membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x2000); - membank("bank1")->set_entry(0); + m_rombank->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x2000); + m_rombank->set_entry(0); /* initialize sound bank */ - membank("bank2")->configure_entries(0, 2, memregion("sub")->base() + 0x10000, 0x8000); - membank("bank2")->set_entry(0); + m_soundbank->configure_entries(0, 2, memregion("sub")->base() + 0x10000, 0x8000); + m_soundbank->set_entry(0); /* video-related elements are saved in video_start */ } -MACHINE_RESET_MEMBER(pipedrm_state,pipedrm) +void hatris_state::machine_reset() { m_flipscreen_old = -1; m_scrollx_ofs = 0x159; @@ -590,23 +659,20 @@ void pipedrm_state::pipedrm(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &pipedrm_state::sound_map); m_subcpu->set_addrmap(AS_IO, &pipedrm_state::sound_portmap); - MCFG_MACHINE_START_OVERRIDE(pipedrm_state,pipedrm) - MCFG_MACHINE_RESET_OVERRIDE(pipedrm_state,pipedrm) - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ m_screen->set_size(44*8, 30*8); m_screen->set_visarea(0*8, 44*8-1, 0*8, 30*8-1); - m_screen->set_screen_update(FUNC(pipedrm_state::screen_update_pipedrm)); + m_screen->set_screen_update(FUNC(pipedrm_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_pipedrm); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); VSYSTEM_GGA(config, m_gga, XTAL(14'318'181) / 2); // divider not verified - m_gga->write_cb().set(FUNC(fromance_state::fromance_gga_data_w)); + m_gga->write_cb().set(FUNC(pipedrm_state::fromance_gga_data_w)); VSYSTEM_SPR2(config, m_spr_old, 0); m_spr_old->set_gfx_region(2); @@ -614,8 +680,6 @@ void pipedrm_state::pipedrm(machine_config &config) m_spr_old->set_pritype(3); m_spr_old->set_gfxdecode_tag(m_gfxdecode); - MCFG_VIDEO_START_OVERRIDE(pipedrm_state,pipedrm) - /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -630,20 +694,17 @@ void pipedrm_state::pipedrm(machine_config &config) ymsnd.add_route(2, "mono", 1.0); } -void pipedrm_state::hatris(machine_config &config) +void hatris_state::hatris(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 12000000/2); - m_maincpu->set_addrmap(AS_PROGRAM, &pipedrm_state::main_map); - m_maincpu->set_addrmap(AS_IO, &pipedrm_state::main_portmap); - m_maincpu->set_vblank_int("screen", FUNC(pipedrm_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &hatris_state::main_map); + m_maincpu->set_addrmap(AS_IO, &hatris_state::main_portmap); + m_maincpu->set_vblank_int("screen", FUNC(hatris_state::irq0_line_hold)); Z80(config, m_subcpu, 14318000/4); - m_subcpu->set_addrmap(AS_PROGRAM, &pipedrm_state::sound_map); - m_subcpu->set_addrmap(AS_IO, &pipedrm_state::hatris_sound_portmap); - - MCFG_MACHINE_START_OVERRIDE(pipedrm_state,pipedrm) - MCFG_MACHINE_RESET_OVERRIDE(pipedrm_state,pipedrm) + m_subcpu->set_addrmap(AS_PROGRAM, &hatris_state::sound_map); + m_subcpu->set_addrmap(AS_IO, &hatris_state::sound_portmap); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -651,16 +712,14 @@ void pipedrm_state::hatris(machine_config &config) m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ m_screen->set_size(44*8, 30*8); m_screen->set_visarea(0*8, 44*8-1, 0*8, 30*8-1); - m_screen->set_screen_update(FUNC(pipedrm_state::screen_update_fromance)); + m_screen->set_screen_update(FUNC(hatris_state::screen_update_fromance)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_hatris); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); VSYSTEM_GGA(config, m_gga, XTAL(14'318'181) / 2); // divider not verified - m_gga->write_cb().set(FUNC(fromance_state::fromance_gga_data_w)); - - MCFG_VIDEO_START_OVERRIDE(pipedrm_state,hatris) + m_gga->write_cb().set(FUNC(hatris_state::fromance_gga_data_w)); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -887,11 +946,12 @@ void pipedrm_state::init_pipedrm() } -void pipedrm_state::init_hatris() +void hatris_state::init_hatris() { - m_maincpu->space(AS_IO).install_write_handler(0x21, 0x21, write8smo_delegate(*this, FUNC(pipedrm_state::fromance_gfxreg_w))); + m_maincpu->space(AS_IO).install_write_handler(0x21, 0x21, write8smo_delegate(*this, FUNC(hatris_state::fromance_gfxreg_w))); } +} // Anonymous namespace /************************************* @@ -904,5 +964,5 @@ GAME( 1990, pipedrm, 0, pipedrm, pipedrm, pipedrm_state, init_pipedrm, RO GAME( 1990, pipedrmu, pipedrm, pipedrm, pipedrm, pipedrm_state, init_pipedrm, ROT0, "Video System Co.", "Pipe Dream (US)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, pipedrmj, pipedrm, pipedrm, pipedrm, pipedrm_state, init_pipedrm, ROT0, "Video System Co.", "Pipe Dream (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, pipedrmt, pipedrm, pipedrm, pipedrm, pipedrm_state, init_pipedrm, ROT0, "Video System Co.", "Pipe Dream (Taiwan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, hatris, 0, hatris, hatris, pipedrm_state, init_hatris, ROT0, "Video System Co.", "Hatris (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, hatrisj, hatris, hatris, hatris, pipedrm_state, init_hatris, ROT0, "Video System Co.", "Hatris (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, hatris, 0, hatris, hatris, hatris_state, init_hatris, ROT0, "Video System Co.", "Hatris (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, hatrisj, hatris, hatris, hatris, hatris_state, init_hatris, ROT0, "Video System Co.", "Hatris (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/playmark.cpp b/src/mame/drivers/playmark.cpp index 4eb6efbb0b7..62f25ba6699 100644 --- a/src/mame/drivers/playmark.cpp +++ b/src/mame/drivers/playmark.cpp @@ -1033,7 +1033,7 @@ void playmark_state::configure_oki_banks() } } -MACHINE_START_MEMBER(playmark_state,playmark) +void playmark_state::machine_start() { save_item(NAME(m_bgscrollx)); save_item(NAME(m_bgscrolly)); @@ -1054,7 +1054,7 @@ MACHINE_START_MEMBER(playmark_state,playmark) -MACHINE_RESET_MEMBER(playmark_state,playmark) +void playmark_state::machine_reset() { m_bgscrollx = 0; m_bgscrolly = 0; @@ -1085,9 +1085,6 @@ void playmark_state::bigtwin(machine_config &config) m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r)); m_audiocpu->write_c().set(FUNC(playmark_state::playmark_snd_control_w)); - MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark) - MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); @@ -1124,9 +1121,6 @@ void playmark_state::bigtwinb(machine_config &config) m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r)); m_audiocpu->write_c().set(FUNC(playmark_state::playmark_snd_control_w)); - MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark) - MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); @@ -1166,9 +1160,6 @@ void playmark_state::wbeachvl(machine_config &config) EEPROM_93C46_16BIT(config, "eeprom").default_value(0); - MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark) - MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); @@ -1205,9 +1196,6 @@ void playmark_state::excelsr(machine_config &config) m_audiocpu->read_c().set(FUNC(playmark_state::playmark_snd_flag_r)); m_audiocpu->write_c().set(FUNC(playmark_state::playmark_snd_control_w)); - MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark) - MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); @@ -1245,9 +1233,6 @@ void playmark_state::hrdtimes(machine_config &config) m_audiocpu->write_c().set(FUNC(playmark_state::hrdtimes_snd_control_w)); m_audiocpu->set_disable(); /* Internal code is not dumped yet */ - MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark) - MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); @@ -1286,9 +1271,6 @@ void playmark_state::hotmind(machine_config &config) EEPROM_93C46_16BIT(config, "eeprom").default_value(0); - MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark) - MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); @@ -1330,9 +1312,6 @@ void playmark_state::luckboomh(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_MACHINE_START_OVERRIDE(playmark_state,playmark) - MCFG_MACHINE_RESET_OVERRIDE(playmark_state,playmark) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); diff --git a/src/mame/drivers/powerbal.cpp b/src/mame/drivers/powerbal.cpp index f797e54311b..7099e1bbeeb 100644 --- a/src/mame/drivers/powerbal.cpp +++ b/src/mame/drivers/powerbal.cpp @@ -26,6 +26,8 @@ Magic Sticks: #include "tilemap.h" +namespace { + class powerbal_state : public playmark_state { public: @@ -40,14 +42,15 @@ public: void powerbal(machine_config &config); void atombjt(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; private: int m_tilebank; int m_bg_yoffset; TILE_GET_INFO_MEMBER(powerbal_get_bg_tile_info); - DECLARE_MACHINE_START(powerbal); - DECLARE_MACHINE_RESET(powerbal); DECLARE_VIDEO_START(powerbal); DECLARE_VIDEO_START(atombjt); uint32_t screen_update_powerbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -616,12 +619,12 @@ GFXDECODE_END -MACHINE_START_MEMBER(powerbal_state,powerbal) +void powerbal_state::machine_start() { save_item(NAME(m_tilebank)); } -MACHINE_RESET_MEMBER(powerbal_state,powerbal) +void powerbal_state::machine_reset() { m_tilebank = 0; configure_oki_banks(); @@ -634,9 +637,6 @@ void powerbal_state::powerbal(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &powerbal_state::powerbal_main_map); m_maincpu->set_vblank_int("screen", FUNC(powerbal_state::irq2_line_hold)); - MCFG_MACHINE_START_OVERRIDE(powerbal_state,powerbal) - MCFG_MACHINE_RESET_OVERRIDE(powerbal_state,powerbal) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(61); @@ -668,9 +668,6 @@ void powerbal_state::magicstk(machine_config &config) EEPROM_93C46_16BIT(config, "eeprom").default_value(0); - MCFG_MACHINE_START_OVERRIDE(powerbal_state,powerbal) - MCFG_MACHINE_RESET_OVERRIDE(powerbal_state,powerbal) - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(61); @@ -867,6 +864,9 @@ void powerbal_state::init_magicstk() m_yoffset = -5; } +} // Anonymous namespace + + /************************* * Game Drivers * *************************/ @@ -875,4 +875,4 @@ void powerbal_state::init_magicstk() GAME( 1994, powerbal, 0, powerbal, powerbal, powerbal_state, init_powerbal, ROT0, "Playmark", "Power Balls", MACHINE_SUPPORTS_SAVE ) GAME( 1995, magicstk, 0, magicstk, magicstk, powerbal_state, init_magicstk, ROT0, "Playmark", "Magic Sticks", MACHINE_SUPPORTS_SAVE ) GAME( 1995, hotminda, hotmind, magicstk, hotminda, powerbal_state, init_magicstk, ROT0, "Playmark", "Hot Mind (adjustable prize)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, atombjt, bjtwin, atombjt, atombjt, powerbal_state, empty_init, ROT270, "bootleg (Kyon K.)", "Atom (bootleg of Bombjack Twin)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // some non-trivial mods to the gfx and sound hw wrt nmk16 hw original, does this really support flip screen? +GAME( 1993, atombjt, bjtwin, atombjt, atombjt, powerbal_state, empty_init, ROT270, "bootleg (Kyon K.)", "Atom (bootleg of Bombjack Twin)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // some non-trivial mods to the gfx and sound hw wrt nmk16 hw original, does this really support flip screen? diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h index 2535970886e..fe42331227b 100644 --- a/src/mame/includes/astrocde.h +++ b/src/mame/includes/astrocde.h @@ -141,7 +141,6 @@ public: void init_demndrgn(); void init_ebases(); void init_gorf(); - void init_astrocde(); void astrocade_palette(palette_device &palette) const; DECLARE_VIDEO_START(profpac); void profpac_palette(palette_device &palette) const; diff --git a/src/mame/includes/fromance.h b/src/mame/includes/fromance.h index c8b2f4a651e..4882cd897f0 100644 --- a/src/mame/includes/fromance.h +++ b/src/mame/includes/fromance.h @@ -28,14 +28,11 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_subcpu(*this, "sub"), - m_spriteram(nullptr), - m_spriteram_size(0), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_gga(*this, "gga"), - m_spr_old(*this, "vsystem_spr_old"), - m_videoram(*this, "videoram"), + m_rombank(*this, "rombank"), m_sublatch(*this, "sublatch"), m_msm(*this, "msm") { } @@ -46,23 +43,24 @@ public: void init_common(); - void fromance_gga_data_w(offs_t offset, uint8_t data); - protected: + virtual void machine_start() override; + virtual void machine_reset() override; + DECLARE_VIDEO_START(fromance); + required_device<cpu_device> m_maincpu; required_device<cpu_device> m_subcpu; - uint8_t *m_spriteram; - u32 m_spriteram_size; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; required_device<vsystem_gga_device> m_gga; - optional_device<vsystem_spr2_device> m_spr_old; // only used by pipe dream, split this state up and clean things... + required_memory_bank m_rombank; void fromance_gfxreg_w(uint8_t data); uint8_t fromance_videoram_r(offs_t offset); void fromance_videoram_w(offs_t offset, uint8_t data); void fromance_scroll_w(offs_t offset, uint8_t data); + void fromance_gga_data_w(offs_t offset, uint8_t data); uint32_t m_scrolly_ofs; uint32_t m_scrollx_ofs; @@ -73,23 +71,16 @@ protected: uint8_t m_flipscreen_old; uint8_t m_selected_videoram; uint8_t m_selected_paletteram; - - DECLARE_VIDEO_START(hatris); - DECLARE_VIDEO_START(pipedrm); + tilemap_t *m_bg_tilemap; + tilemap_t *m_fg_tilemap; uint32_t screen_update_fromance(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_pipedrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: - /* memory pointers (used by pipedrm) */ - optional_shared_ptr<uint8_t> m_videoram; - optional_device<generic_latch_8_device> m_sublatch; optional_device<msm5205_device> m_msm; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; std::unique_ptr<uint8_t[]> m_local_videoram[2]; std::unique_ptr<uint8_t[]> m_local_paletteram; @@ -116,10 +107,7 @@ private: TILE_GET_INFO_MEMBER(get_fromance_fg_tile_info); TILE_GET_INFO_MEMBER(get_nekkyoku_bg_tile_info); TILE_GET_INFO_MEMBER(get_nekkyoku_fg_tile_info); - DECLARE_MACHINE_START(fromance); - DECLARE_MACHINE_RESET(fromance); DECLARE_VIDEO_START(nekkyoku); - DECLARE_VIDEO_START(fromance); TIMER_CALLBACK_MEMBER(crtc_interrupt_gen); inline void get_fromance_tile_info(tile_data &tileinfo, int tile_index, int layer); inline void get_nekkyoku_tile_info(tile_data &tileinfo, int tile_index, int layer); diff --git a/src/mame/includes/playmark.h b/src/mame/includes/playmark.h index e0bc0d5035d..9a89b15c2ce 100644 --- a/src/mame/includes/playmark.h +++ b/src/mame/includes/playmark.h @@ -46,6 +46,9 @@ public: void init_pic_decode(); protected: + virtual void machine_start() override; + virtual void machine_reset() override; + /* memory pointers */ optional_shared_ptr<uint16_t> m_bgvideoram; required_shared_ptr<uint16_t> m_videoram1; @@ -115,8 +118,6 @@ protected: TILE_GET_INFO_MEMBER(bigtwinb_get_tx_tile_info); TILE_GET_INFO_MEMBER(hrdtimes_get_fg_tile_info); TILE_GET_INFO_MEMBER(hrdtimes_get_bg_tile_info); - DECLARE_MACHINE_START(playmark); - DECLARE_MACHINE_RESET(playmark); DECLARE_VIDEO_START(bigtwin); DECLARE_VIDEO_START(bigtwinb); DECLARE_VIDEO_START(wbeachvl); diff --git a/src/mame/video/fromance.cpp b/src/mame/video/fromance.cpp index 605469344a4..902f2c4cf1a 100644 --- a/src/mame/video/fromance.cpp +++ b/src/mame/video/fromance.cpp @@ -103,19 +103,6 @@ VIDEO_START_MEMBER(fromance_state,nekkyoku) init_common(); } -VIDEO_START_MEMBER(fromance_state,pipedrm) -{ - VIDEO_START_CALL_MEMBER(fromance); - m_scrolly_ofs = 0x00; -} - -VIDEO_START_MEMBER(fromance_state,hatris) -{ - VIDEO_START_CALL_MEMBER(fromance); - m_scrollx_ofs = 0xB9; - m_scrolly_ofs = 0x00; -} - /************************************* * * Graphics control register @@ -314,20 +301,3 @@ uint32_t fromance_state::screen_update_fromance(screen_device &screen, bitmap_in m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } - - -uint32_t fromance_state::screen_update_pipedrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t* sram = m_spriteram; - - /* there seems to be no logical mapping for the X scroll register -- maybe it's gone */ - m_bg_tilemap->set_scrolly(0, m_scrolly[1]); - m_fg_tilemap->set_scrolly(0, m_scrolly[0]); - - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - m_spr_old->turbofrc_draw_sprites((uint16_t*)sram, m_spriteram_size, 0, bitmap, cliprect, screen.priority(), 0); - m_spr_old->turbofrc_draw_sprites((uint16_t*)sram, m_spriteram_size, 0, bitmap, cliprect, screen.priority(), 1); - return 0; -} |