From 0490b53f5cc9a36c1c70279765ba0c16cd39367e Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 17 Feb 2015 21:24:41 +0100 Subject: shootout.c: added save state support, removed a couple of sound trampolines (nw) --- src/mame/drivers/shootout.c | 44 ++++++++++++++++++-------------------------- src/mame/includes/shootout.h | 43 ++++++++++++++++++++++++------------------- src/mame/video/shootout.c | 9 +++++---- 3 files changed, 47 insertions(+), 49 deletions(-) diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c index ad29e5ed565..d0e9ca901d0 100644 --- a/src/mame/drivers/shootout.c +++ b/src/mame/drivers/shootout.c @@ -42,7 +42,7 @@ /*******************************************************************************/ -WRITE8_MEMBER(shootout_state::shootout_bankswitch_w) +WRITE8_MEMBER(shootout_state::bankswitch_w) { membank("bank1")->set_entry(data & 0x0f); } @@ -53,12 +53,12 @@ WRITE8_MEMBER(shootout_state::sound_cpu_command_w) m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); } -WRITE8_MEMBER(shootout_state::shootout_flipscreen_w) +WRITE8_MEMBER(shootout_state::flipscreen_w) { flip_screen_set(data & 0x01); } -WRITE8_MEMBER(shootout_state::shootout_coin_counter_w) +WRITE8_MEMBER(shootout_state::coincounter_w) { coin_counter_w(machine(), 0, data); } @@ -67,14 +67,14 @@ WRITE8_MEMBER(shootout_state::shootout_coin_counter_w) static ADDRESS_MAP_START( shootout_map, AS_PROGRAM, 8, shootout_state ) AM_RANGE(0x0000, 0x0fff) AM_RAM - AM_RANGE(0x1000, 0x1000) AM_READ_PORT("DSW1") AM_WRITE(shootout_bankswitch_w) - AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1") AM_WRITE(shootout_flipscreen_w) - AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2") AM_WRITE(shootout_coin_counter_w) + AM_RANGE(0x1000, 0x1000) AM_READ_PORT("DSW1") AM_WRITE(bankswitch_w) + AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1") AM_WRITE(flipscreen_w) + AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2") AM_WRITE(coincounter_w) AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW2") AM_WRITE(sound_cpu_command_w) AM_RANGE(0x1004, 0x17ff) AM_RAM AM_RANGE(0x1800, 0x19ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(shootout_textram_w) AM_SHARE("textram") - AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(shootout_videoram_w) AM_SHARE("videoram") + AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(textram_w) AM_SHARE("textram") + AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") AM_RANGE(0x8000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -85,11 +85,11 @@ static ADDRESS_MAP_START( shootouj_map, AS_PROGRAM, 8, shootout_state ) AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1") AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2") AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW2") - AM_RANGE(0x1800, 0x1800) AM_WRITE(shootout_coin_counter_w) + AM_RANGE(0x1800, 0x1800) AM_WRITE(coincounter_w) AM_RANGE(0x2000, 0x21ff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) - AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(shootout_textram_w) AM_SHARE("textram") - AM_RANGE(0x3800, 0x3fff) AM_RAM_WRITE(shootout_videoram_w) AM_SHARE("videoram") + AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(textram_w) AM_SHARE("textram") + AM_RANGE(0x3800, 0x3fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") AM_RANGE(0x8000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -229,15 +229,7 @@ static GFXDECODE_START( shootout ) GFXDECODE_ENTRY( "gfx3", 0, tile_layout, 0, 16 ) /* tiles */ GFXDECODE_END -WRITE_LINE_MEMBER(shootout_state::shootout_snd_irq) -{ - m_audiocpu->set_input_line(0, state); -} -WRITE_LINE_MEMBER(shootout_state::shootout_snd2_irq) -{ - m_maincpu->set_input_line(0, state); -} static MACHINE_CONFIG_START( shootout, shootout_state ) @@ -265,7 +257,7 @@ static MACHINE_CONFIG_START( shootout, shootout_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) - MCFG_YM2203_IRQ_HANDLER(WRITELINE(shootout_state, shootout_snd_irq)) + MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6502_IRQ_LINE)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END @@ -293,9 +285,9 @@ static MACHINE_CONFIG_START( shootouj, shootout_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) - MCFG_YM2203_IRQ_HANDLER(WRITELINE(shootout_state, shootout_snd2_irq)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(shootout_state, shootout_bankswitch_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(shootout_state, shootout_flipscreen_w)) + MCFG_YM2203_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(shootout_state, bankswitch_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(shootout_state, flipscreen_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END @@ -398,6 +390,6 @@ DRIVER_INIT_MEMBER(shootout_state,shootout) } -GAME( 1985, shootout, 0, shootout, shootout, shootout_state, shootout, ROT0, "Data East USA", "Shoot Out (US)", 0) -GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", 0 ) -GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", 0 ) +GAME( 1985, shootout, 0, shootout, shootout, shootout_state, shootout, ROT0, "Data East USA", "Shoot Out (US)", GAME_SUPPORTS_SAVE ) +GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/shootout.h b/src/mame/includes/shootout.h index 181c839d8cc..3d8f3552ac2 100644 --- a/src/mame/includes/shootout.h +++ b/src/mame/includes/shootout.h @@ -3,39 +3,44 @@ class shootout_state : public driver_device public: shootout_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_textram(*this, "textram"), - m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_spriteram(*this, "spriteram"), + m_textram(*this, "textram"), + m_videoram(*this, "videoram") { } + + required_device m_maincpu; + optional_device m_audiocpu; + required_device m_gfxdecode; + required_device m_palette; - tilemap_t *m_background; - tilemap_t *m_foreground; required_shared_ptr m_spriteram; required_shared_ptr m_textram; required_shared_ptr m_videoram; + + tilemap_t *m_background; + tilemap_t *m_foreground; int m_bFlicker; - DECLARE_WRITE8_MEMBER(shootout_bankswitch_w); + + DECLARE_WRITE8_MEMBER(bankswitch_w); DECLARE_WRITE8_MEMBER(sound_cpu_command_w); - DECLARE_WRITE8_MEMBER(shootout_flipscreen_w); - DECLARE_WRITE8_MEMBER(shootout_coin_counter_w); - DECLARE_WRITE8_MEMBER(shootout_videoram_w); - DECLARE_WRITE8_MEMBER(shootout_textram_w); + DECLARE_WRITE8_MEMBER(flipscreen_w); + DECLARE_WRITE8_MEMBER(coincounter_w); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_WRITE8_MEMBER(textram_w); + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); + DECLARE_DRIVER_INIT(shootout); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void video_start(); DECLARE_PALETTE_INIT(shootout); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + UINT32 screen_update_shootout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_shootouj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits ); - DECLARE_WRITE_LINE_MEMBER(shootout_snd_irq); - DECLARE_WRITE_LINE_MEMBER(shootout_snd2_irq); - required_device m_maincpu; - optional_device m_audiocpu; - required_device m_gfxdecode; - required_device m_palette; }; diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c index 8c6c27a285e..8f5f31c9b2f 100644 --- a/src/mame/video/shootout.c +++ b/src/mame/video/shootout.c @@ -63,13 +63,13 @@ TILE_GET_INFO_MEMBER(shootout_state::get_fg_tile_info) 0); } -WRITE8_MEMBER(shootout_state::shootout_videoram_w) +WRITE8_MEMBER(shootout_state::videoram_w) { m_videoram[offset] = data; m_background->mark_tile_dirty(offset&0x3ff ); } -WRITE8_MEMBER(shootout_state::shootout_textram_w) +WRITE8_MEMBER(shootout_state::textram_w) { m_textram[offset] = data; m_foreground->mark_tile_dirty(offset&0x3ff ); @@ -80,13 +80,14 @@ void shootout_state::video_start() m_background = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(shootout_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_foreground = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(shootout_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_foreground->set_transparent_pen(0 ); + + save_item(NAME(m_bFlicker)); } void shootout_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits ) { - UINT8 *spriteram = m_spriteram; gfx_element *gfx = m_gfxdecode->gfx(1); - const UINT8 *source = spriteram+127*4; + const UINT8 *source = m_spriteram+127*4; int count; m_bFlicker = !m_bFlicker; -- cgit v1.2.3