From 0a5fed2ecec3c9e3cac23b769896548c28cc6091 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 6 Nov 2019 01:07:27 +1100 Subject: loose ends: (nw) * mm5740 X pins are numbered starting from 1, also fix typo in pinout comment (Y10, not Y0) * make more members protected/private as appropriate * got rid of one more video start override in a clean way --- src/devices/machine/mm5740.h | 4 +-- src/mame/audio/seibu.h | 6 ++-- src/mame/drivers/goodejan.cpp | 7 ++-- src/mame/drivers/h19.cpp | 18 +++++----- src/mame/drivers/nmk16.cpp | 10 +++--- src/mame/drivers/raiden.cpp | 24 ++++++------- src/mame/drivers/sengokmj.cpp | 9 ++--- src/mame/includes/bloodbro.h | 18 ++++++---- src/mame/includes/dcon.h | 2 +- src/mame/includes/legionna.h | 67 +++++++++++++++++++------------------ src/mame/includes/nmk16.h | 6 ++-- src/mame/includes/raiden.h | 78 ++++++++++++++++++++++++++++--------------- src/mame/video/raiden.cpp | 20 +++-------- 13 files changed, 148 insertions(+), 121 deletions(-) diff --git a/src/devices/machine/mm5740.h b/src/devices/machine/mm5740.h index 1896f568e4c..23da18ddda7 100644 --- a/src/devices/machine/mm5740.h +++ b/src/devices/machine/mm5740.h @@ -24,7 +24,7 @@ Repeat 16 | | 25 Y3 Key Bounce Mask 17 | | 24 Y2 Vgg 18 | | 23 Y1 - Control 19 | | 22 Y0 + Control 19 | | 22 Y10 Shift Lock I/O 20 |_____________| 21 Shift Name Pin No. Function @@ -94,7 +94,7 @@ public: // public interface uint16_t b_r(); - template auto x_cb() { return m_read_x[N].bind(); } + template auto x_cb() { return m_read_x[N - 1].bind(); } auto shift_cb() { return m_read_shift.bind(); } auto control_cb() { return m_read_control.bind(); } auto data_ready_cb() { return m_write_data_ready.bind(); } diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h index e45ff65a1ea..496ec89a84e 100644 --- a/src/mame/audio/seibu.h +++ b/src/mame/audio/seibu.h @@ -35,6 +35,8 @@ class seibu_sound_common { public: virtual ~seibu_sound_common() = default; + +protected: void seibu_sound_map(address_map &map); }; @@ -42,7 +44,7 @@ class seibu_sound_device : public device_t { public: seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - ~seibu_sound_device() {} + ~seibu_sound_device() { } // configuration template void set_rom_tag(T &&tag) { m_sound_rom.set_tag(std::forward(tag)); } @@ -131,7 +133,7 @@ class seibu_adpcm_device : public device_t, { public: seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - ~seibu_adpcm_device() {} + ~seibu_adpcm_device() { } void decrypt(); void adr_w(offs_t offset, u8 data); diff --git a/src/mame/drivers/goodejan.cpp b/src/mame/drivers/goodejan.cpp index 2518d3465ad..205710e4f29 100644 --- a/src/mame/drivers/goodejan.cpp +++ b/src/mame/drivers/goodejan.cpp @@ -83,7 +83,7 @@ Secret menu hack [totmejan only] (I couldn't find official way to enter, so it's #include "tilemap.h" -class goodejan_state : public driver_device, public seibu_sound_common +class goodejan_state : public driver_device, protected seibu_sound_common { public: goodejan_state(const machine_config &mconfig, device_type type, const char *tag) : @@ -102,6 +102,9 @@ public: void totmejan(machine_config &config); void goodejan(machine_config &config); +protected: + virtual void video_start() override; + private: required_device m_maincpu; required_device m_gfxdecode; @@ -143,8 +146,8 @@ private: void seibucrtc_sc0bank_w(uint16_t data); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); - virtual void video_start() override; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void common_io_map(address_map &map); void goodejan_io_map(address_map &map); void goodejan_map(address_map &map); diff --git a/src/mame/drivers/h19.cpp b/src/mame/drivers/h19.cpp index 4f6f6e3a36c..a4e1ca9ecab 100644 --- a/src/mame/drivers/h19.cpp +++ b/src/mame/drivers/h19.cpp @@ -548,15 +548,15 @@ void h19_state::h19(machine_config &config) uart.out_int_callback().set_inputline("maincpu", INPUT_LINE_IRQ0); MM5740(config, m_mm5740, MM5740_CLOCK); - m_mm5740->x_cb<0>().set_ioport("X1"); - m_mm5740->x_cb<1>().set_ioport("X2"); - m_mm5740->x_cb<2>().set_ioport("X3"); - m_mm5740->x_cb<3>().set_ioport("X4"); - m_mm5740->x_cb<4>().set_ioport("X5"); - m_mm5740->x_cb<5>().set_ioport("X6"); - m_mm5740->x_cb<6>().set_ioport("X7"); - m_mm5740->x_cb<7>().set_ioport("X8"); - m_mm5740->x_cb<8>().set_ioport("X9"); + m_mm5740->x_cb<1>().set_ioport("X1"); + m_mm5740->x_cb<2>().set_ioport("X2"); + m_mm5740->x_cb<3>().set_ioport("X3"); + m_mm5740->x_cb<4>().set_ioport("X4"); + m_mm5740->x_cb<5>().set_ioport("X5"); + m_mm5740->x_cb<6>().set_ioport("X6"); + m_mm5740->x_cb<7>().set_ioport("X7"); + m_mm5740->x_cb<8>().set_ioport("X8"); + m_mm5740->x_cb<9>().set_ioport("X9"); m_mm5740->shift_cb().set(FUNC(h19_state::mm5740_shift_r)); m_mm5740->control_cb().set(FUNC(h19_state::mm5740_control_r)); m_mm5740->data_ready_cb().set(FUNC(h19_state::mm5740_data_ready_w)); diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp index 07b0f040057..cea9eef8943 100644 --- a/src/mame/drivers/nmk16.cpp +++ b/src/mame/drivers/nmk16.cpp @@ -452,7 +452,7 @@ void nmk16_tomagic_state::tomagic_sound_map(address_map &map) void nmk16_tomagic_state::tomagic_sound_io_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(nmk16_state::macross2_sound_bank_w)); + map(0x00, 0x00).w(FUNC(nmk16_tomagic_state::macross2_sound_bank_w)); map(0x02, 0x03).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); map(0x06, 0x06).r(m_soundlatch, FUNC(generic_latch_8_device::read)); } @@ -4217,7 +4217,7 @@ void nmk16_state::mustangb(machine_config &config) set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 14318180/4); - m_audiocpu->set_addrmap(AS_PROGRAM, &seibu_sound_common::seibu_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::seibu_sound_map); m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); /* video hardware */ @@ -4394,7 +4394,7 @@ void nmk16_state::tdragonb(machine_config &config) /* bootleg using Raiden so set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 14318180/4); - m_audiocpu->set_addrmap(AS_PROGRAM, &seibu_sound_common::seibu_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::seibu_sound_map); m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); /* video hardware */ @@ -4973,11 +4973,11 @@ void nmk16_tomagic_state::tomagic(machine_config &config) /* video hardware */ set_hacky_screen_hires(config); m_spritegen->set_colpri_callback(FUNC(nmk16_tomagic_state::get_colour_4bit)); - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); + m_screen->set_screen_update(FUNC(nmk16_tomagic_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); - MCFG_VIDEO_START_OVERRIDE(nmk16_state,gunnail) + MCFG_VIDEO_START_OVERRIDE(nmk16_tomagic_state,gunnail) /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/raiden.cpp b/src/mame/drivers/raiden.cpp index 7b578816954..40da2c3927f 100644 --- a/src/mame/drivers/raiden.cpp +++ b/src/mame/drivers/raiden.cpp @@ -148,7 +148,7 @@ void raiden_state::raidenu_sub_map(address_map &map) /******************************************************************************/ -void raiden_state::raidenb_main_map(address_map &map) +void raidenb_state::raidenb_main_map(address_map &map) { map(0x00000, 0x06fff).ram(); map(0x07000, 0x07fff).ram().share("spriteram"); @@ -156,8 +156,8 @@ void raiden_state::raidenb_main_map(address_map &map) map(0x0b000, 0x0b001).portr("P1_P2"); map(0x0b002, 0x0b003).portr("DSW"); map(0x0b004, 0x0b005).nopw(); // watchdog? - map(0x0b006, 0x0b006).w(FUNC(raiden_state::raidenb_control_w)); - map(0x0c000, 0x0c7ff).w(FUNC(raiden_state::raiden_text_w)).share("videoram"); + map(0x0b006, 0x0b006).w(FUNC(raidenb_state::raidenb_control_w)); + map(0x0c000, 0x0c7ff).w(FUNC(raidenb_state::raiden_text_w)).share("videoram"); map(0x0d000, 0x0d00d).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff); map(0x0d040, 0x0d08f).rw("crtc", FUNC(seibu_crtc_device::read), FUNC(seibu_crtc_device::write)); map(0xa0000, 0xfffff).rom(); @@ -400,7 +400,7 @@ void raiden_state::raidenu(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &raiden_state::raidenu_sub_map); } -WRITE16_MEMBER( raiden_state::raidenb_layer_scroll_w ) +WRITE16_MEMBER( raidenb_state::raidenb_layer_scroll_w ) { COMBINE_DATA(&m_raidenb_scroll_ram[offset]); } @@ -412,21 +412,19 @@ void raiden_state::raidenkb(machine_config &config) m_subcpu->set_clock(XTAL(32'000'000) / 4); // Xtal and clock verified } -void raiden_state::raidenb(machine_config &config) +void raidenb_state::raidenb(machine_config &config) { raiden(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &raiden_state::raidenb_main_map); + m_maincpu->set_addrmap(AS_PROGRAM, &raidenb_state::raidenb_main_map); /* video hardware */ - MCFG_VIDEO_START_OVERRIDE(raiden_state,raidenb) - seibu_crtc_device &crtc(SEIBU_CRTC(config, "crtc", 0)); - crtc.layer_en_callback().set(FUNC(raiden_state::raidenb_layer_enable_w)); - crtc.layer_scroll_callback().set(FUNC(raiden_state::raidenb_layer_scroll_w)); + crtc.layer_en_callback().set(FUNC(raidenb_state::raidenb_layer_enable_w)); + crtc.layer_scroll_callback().set(FUNC(raidenb_state::raidenb_layer_scroll_w)); - subdevice("screen")->set_screen_update(FUNC(raiden_state::screen_update_raidenb)); + subdevice("screen")->set_screen_update(FUNC(raidenb_state::screen_update_raidenb)); } @@ -859,5 +857,5 @@ GAME( 1990, raidenkb, raiden, raidenkb, raiden, raiden_state, init_raiden, ROT GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, empty_init, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 2)", MACHINE_SUPPORTS_SAVE ) /* Alternate hardware. Main, Sub & Sound CPU code not encrypted. It also sports Seibu custom CRTC. */ -GAME( 1990, raidenb, raiden, raidenb, raiden, raiden_state, empty_init, ROT270, "Seibu Kaihatsu", "Raiden (set 3)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, raidenub, raiden, raidenb, raiden, raiden_state, empty_init, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, raidenb, raiden, raidenb, raiden, raidenb_state, empty_init, ROT270, "Seibu Kaihatsu", "Raiden (set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, raidenub, raiden, raidenb, raiden, raidenb_state, empty_init, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 3)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sengokmj.cpp b/src/mame/drivers/sengokmj.cpp index 8fcd5b60fde..d9e9b868b4d 100644 --- a/src/mame/drivers/sengokmj.cpp +++ b/src/mame/drivers/sengokmj.cpp @@ -67,7 +67,7 @@ RSSENGO2.72 chr. #include "tilemap.h" -class sengokmj_state : public driver_device, public seibu_sound_common +class sengokmj_state : public driver_device, protected seibu_sound_common { public: sengokmj_state(const machine_config &mconfig, device_type type, const char *tag) : @@ -84,6 +84,10 @@ public: void sengokmj(machine_config &config); +protected: + virtual void machine_start() override; + virtual void video_start() override; + private: required_device m_maincpu; required_device m_gfxdecode; @@ -123,9 +127,6 @@ private: DECLARE_WRITE_LINE_MEMBER(vblank_irq); - virtual void machine_start() override; - virtual void video_start() override; - void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/bloodbro.h b/src/mame/includes/bloodbro.h index ea83cb37be6..5b109a4953d 100644 --- a/src/mame/includes/bloodbro.h +++ b/src/mame/includes/bloodbro.h @@ -11,7 +11,7 @@ #include "screen.h" #include "tilemap.h" -class bloodbro_state : public driver_device, public seibu_sound_common +class bloodbro_state : public driver_device, protected seibu_sound_common { public: bloodbro_state(const machine_config &mconfig, device_type type, const char *tag) : @@ -29,6 +29,16 @@ public: m_txvideoram(*this, "txvideoram") { } + void init_weststry(); + + void bloodbro(machine_config &config); + void skysmash(machine_config &config); + void weststry(machine_config &config); + +protected: + virtual void video_start() override; + +private: required_device m_maincpu; required_device m_gfxdecode; required_device m_screen; @@ -68,18 +78,12 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info); - virtual void video_start() override; - uint32_t screen_update_bloodbro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_weststry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_skysmash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void bloodbro_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void weststry_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void init_weststry(); - void bloodbro(machine_config &config); - void skysmash(machine_config &config); - void weststry(machine_config &config); void bloodbro_map(address_map &map); void common_map(address_map &map); void skysmash_map(address_map &map); diff --git a/src/mame/includes/dcon.h b/src/mame/includes/dcon.h index 54ef3c3bf05..5636bf8ad02 100644 --- a/src/mame/includes/dcon.h +++ b/src/mame/includes/dcon.h @@ -9,7 +9,7 @@ #include "emupal.h" #include "tilemap.h" -class dcon_state : public driver_device, public seibu_sound_common +class dcon_state : public driver_device, protected seibu_sound_common { public: dcon_state(const machine_config &mconfig, device_type type, const char *tag) : diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h index b2e3267444c..f265210dc18 100644 --- a/src/mame/includes/legionna.h +++ b/src/mame/includes/legionna.h @@ -15,7 +15,7 @@ #include -class legionna_state : public driver_device, public seibu_sound_common +class legionna_state : public driver_device, protected seibu_sound_common { public: legionna_state(const machine_config &mconfig, device_type type, const char *tag) @@ -54,29 +54,6 @@ public: void init_olysoc92(); private: - required_shared_ptr m_spriteram; - optional_shared_ptr m_swappal; - std::unique_ptr m_back_data; - std::unique_ptr m_fore_data; - std::unique_ptr m_mid_data; - std::unique_ptr m_textram; - std::unique_ptr m_scrollram16; - std::unique_ptr m_paletteram; - u16 m_layer_disable; - std::unique_ptr m_layer_config; - int m_sprite_xoffs; - int m_sprite_yoffs; - tilemap_t *m_background_layer; - tilemap_t *m_foreground_layer; - tilemap_t *m_midground_layer; - tilemap_t *m_text_layer; - bool m_has_extended_banking; - bool m_has_extended_priority; - u16 m_sprite_pri_mask[4]; - u16 m_back_gfx_bank; - u16 m_fore_gfx_bank; - u16 m_mid_gfx_bank; - u16 m_scrollvals[6]; void tilemap_enable_w(offs_t offset, u16 data, u16 mem_mask = ~0); void tile_scroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); void tile_scroll_base_w(offs_t offset, u16 data); @@ -112,14 +89,7 @@ private: void descramble_legionnaire_gfx(u8* src); void common_video_start(bool split, bool has_extended_banking, bool has_extended_priority); void common_video_allocate_ptr(); - required_device m_maincpu; - required_device m_audiocpu; - optional_device m_seibu_sound; - required_device m_oki; - required_device m_gfxdecode; - required_device m_palette; - required_device m_crtc; - optional_device m_raiden2cop; + void cupsoc_map(address_map &map); void cupsocs_map(address_map &map); void denjinmk_map(address_map &map); @@ -129,6 +99,39 @@ private: void legionna_cop_map(address_map &map); void legionna_map(address_map &map); void godzilla_sound_io_map(address_map &map); + + required_shared_ptr m_spriteram; + optional_shared_ptr m_swappal; + std::unique_ptr m_back_data; + std::unique_ptr m_fore_data; + std::unique_ptr m_mid_data; + std::unique_ptr m_textram; + std::unique_ptr m_scrollram16; + std::unique_ptr m_paletteram; + u16 m_layer_disable; + std::unique_ptr m_layer_config; + int m_sprite_xoffs; + int m_sprite_yoffs; + tilemap_t *m_background_layer; + tilemap_t *m_foreground_layer; + tilemap_t *m_midground_layer; + tilemap_t *m_text_layer; + bool m_has_extended_banking; + bool m_has_extended_priority; + u16 m_sprite_pri_mask[4]; + u16 m_back_gfx_bank; + u16 m_fore_gfx_bank; + u16 m_mid_gfx_bank; + u16 m_scrollvals[6]; + + required_device m_maincpu; + required_device m_audiocpu; + optional_device m_seibu_sound; + required_device m_oki; + required_device m_gfxdecode; + required_device m_palette; + required_device m_crtc; + optional_device m_raiden2cop; }; #endif // MAME_INCLUDES_LEGIONNA_H diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h index 0a4531547f8..0f4036024da 100644 --- a/src/mame/includes/nmk16.h +++ b/src/mame/includes/nmk16.h @@ -16,7 +16,7 @@ #include "screen.h" #include "tilemap.h" -class nmk16_state : public driver_device, public seibu_sound_common +class nmk16_state : public driver_device, protected seibu_sound_common { public: nmk16_state(const machine_config &mconfig, device_type type, const char *tag) : @@ -82,6 +82,7 @@ public: void init_gunnailb(); void init_bjtwin(); +protected: DECLARE_VIDEO_START(gunnail); TIMER_DEVICE_CALLBACK_MEMBER(nmk16_scanline); u32 screen_update_macross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -92,7 +93,6 @@ public: void macross2_sound_bank_w(u8 data); -protected: required_device m_maincpu; optional_device m_audiocpu; optional_device_array m_oki; @@ -247,6 +247,7 @@ public: void redhawkb(machine_config &config); void stagger1(machine_config &config); void spec2k(machine_config &config); + void init_bubl2000(); void init_grdnstrm(); void init_grdnstrmau(); @@ -288,6 +289,7 @@ public: {} void tomagic(machine_config &config); + void init_tomagic(); private: diff --git a/src/mame/includes/raiden.h b/src/mame/includes/raiden.h index 613875b7925..b72aa108c1c 100644 --- a/src/mame/includes/raiden.h +++ b/src/mame/includes/raiden.h @@ -15,14 +15,14 @@ #include "emupal.h" #include "tilemap.h" -class raiden_state : public driver_device, public seibu_sound_common +class raiden_state : public driver_device, protected seibu_sound_common { public: raiden_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_subcpu(*this, "sub"), m_seibu_sound(*this, "seibu_sound"), + m_subcpu(*this, "sub"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_spriteram(*this, "spriteram"), @@ -33,9 +33,31 @@ public: m_fore_data(*this, "fore_data") { } + void raidene(machine_config &config); + void raiden(machine_config &config); + void raidenkb(machine_config &config); + void raidenu(machine_config &config); + + void init_raiden(); + +protected: required_device m_maincpu; - required_device m_subcpu; required_device m_seibu_sound; + + uint8_t m_bg_layer_enabled; + uint8_t m_fg_layer_enabled; + uint8_t m_tx_layer_enabled; + uint8_t m_sp_layer_enabled; + uint8_t m_flipscreen; + + virtual void video_start() override; + + uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *scrollregs); + + DECLARE_WRITE16_MEMBER(raiden_text_w); + +private: + required_device m_subcpu; required_device m_gfxdecode; required_device m_palette; required_device m_spriteram; @@ -49,50 +71,52 @@ public: tilemap_t *m_bg_layer; tilemap_t *m_fg_layer; tilemap_t *m_tx_layer; - uint8_t m_bg_layer_enabled; - uint8_t m_fg_layer_enabled; - uint8_t m_tx_layer_enabled; - uint8_t m_sp_layer_enabled; - uint8_t m_flipscreen; - uint16_t m_raidenb_scroll_ram[6]; DECLARE_WRITE16_MEMBER(raiden_background_w); DECLARE_WRITE16_MEMBER(raiden_foreground_w); - DECLARE_WRITE16_MEMBER(raiden_text_w); DECLARE_WRITE8_MEMBER(raiden_control_w); - DECLARE_WRITE8_MEMBER(raidenb_control_w); - DECLARE_WRITE16_MEMBER(raidenb_layer_enable_w); - DECLARE_WRITE16_MEMBER(raidenb_layer_scroll_w); - void init_raiden(); TILE_GET_INFO_MEMBER(get_back_tile_info); TILE_GET_INFO_MEMBER(get_fore_tile_info); TILE_GET_INFO_MEMBER(get_text_tile_info); - virtual void video_start() override; - DECLARE_VIDEO_START(raidenb); - - uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *scrollregs); uint32_t screen_update_raiden(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(vblank_irq); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri_mask); void common_decrypt(); - void raidene(machine_config &config); - void raidenb(machine_config &config); - void raiden(machine_config &config); - void raidenkb(machine_config &config); - void raidenu(machine_config &config); + void main_map(address_map &map); - void raiden_sound_decrypted_opcodes_map(address_map &map); + void sub_map(address_map &map); void raiden_sound_map(address_map &map); - void raidenb_main_map(address_map &map); + void raiden_sound_decrypted_opcodes_map(address_map &map); void raidenu_main_map(address_map &map); void raidenu_sub_map(address_map &map); void sei80bu_encrypted_full_map(address_map &map); - void sub_map(address_map &map); +}; + + +class raidenb_state : public raiden_state +{ +public: + using raiden_state::raiden_state; + + void raidenb(machine_config &config); + +protected: + virtual void video_start() override; + +private: + uint16_t m_raidenb_scroll_ram[6]; + + uint32_t screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + DECLARE_WRITE8_MEMBER(raidenb_control_w); + DECLARE_WRITE16_MEMBER(raidenb_layer_enable_w); + DECLARE_WRITE16_MEMBER(raidenb_layer_scroll_w); + + void raidenb_main_map(address_map &map); }; #endif // MAME_INCLUDES_RAIDEN_H diff --git a/src/mame/video/raiden.cpp b/src/mame/video/raiden.cpp index 430d4ea1cf7..593ceeee287 100644 --- a/src/mame/video/raiden.cpp +++ b/src/mame/video/raiden.cpp @@ -52,7 +52,7 @@ WRITE8_MEMBER(raiden_state::raiden_control_w) machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); } -WRITE8_MEMBER(raiden_state::raidenb_control_w) +WRITE8_MEMBER(raidenb_state::raidenb_control_w) { // d1: flipscreen // d2: toggles, maybe spriteram bank? (for buffering) @@ -64,7 +64,7 @@ WRITE8_MEMBER(raiden_state::raidenb_control_w) machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); } -WRITE16_MEMBER(raiden_state::raidenb_layer_enable_w) +WRITE16_MEMBER(raidenb_state::raidenb_layer_enable_w) { // d0: back layer disable // d1: fore layer disable @@ -187,7 +187,7 @@ uint32_t raiden_state::screen_update_raiden(screen_device &screen, bitmap_ind16 return screen_update_common(screen, bitmap, cliprect, scrollregs); } -uint32_t raiden_state::screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t raidenb_state::screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update_common(screen, bitmap, cliprect, m_raidenb_scroll_ram); } @@ -238,19 +238,9 @@ void raiden_state::video_start() save_item(NAME(m_flipscreen)); } -VIDEO_START_MEMBER(raiden_state,raidenb) +void raidenb_state::video_start() { - m_bg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raiden_state::get_back_tile_info)), TILEMAP_SCAN_COLS, 16,16, 32,32); - m_fg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raiden_state::get_fore_tile_info)), TILEMAP_SCAN_COLS, 16,16, 32,32); - m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raiden_state::get_text_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 32,32); - - m_fg_layer->set_transparent_pen(15); - m_tx_layer->set_transparent_pen(15); + raiden_state::video_start(); - save_item(NAME(m_bg_layer_enabled)); - save_item(NAME(m_fg_layer_enabled)); - save_item(NAME(m_tx_layer_enabled)); - save_item(NAME(m_sp_layer_enabled)); - save_item(NAME(m_flipscreen)); save_item(NAME(m_raidenb_scroll_ram)); } -- cgit v1.2.3