From 1db4dcd963af85a0e8333271aa9ad5756dfa414e Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 2 Feb 2015 20:22:52 +0100 Subject: [PATCH] raiden.c: added save state support (nw) --- src/mame/audio/seibu.c | 5 +++++ src/mame/drivers/raiden.c | 14 +++++++------- src/mame/includes/raiden.h | 16 +++++++++++----- src/mame/video/raiden.c | 13 +++++++++++++ 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c index 55dbe1e28e0..8551fe1fcbb 100644 --- a/src/mame/audio/seibu.c +++ b/src/mame/audio/seibu.c @@ -489,6 +489,11 @@ void seibu_adpcm_device::device_start() m_stream = machine().sound().stream_alloc(*this, 0, 1, clock()); m_base = machine().root_device().memregion(m_rom_tag)->base(); m_adpcm.reset(); + + save_item(NAME(m_current)); + save_item(NAME(m_end)); + save_item(NAME(m_nibble)); + save_item(NAME(m_playing)); } // "decrypt" is a bit flowery here, as it's probably just line-swapping to diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c index 4ab09257ac4..7802aed44de 100644 --- a/src/mame/drivers/raiden.c +++ b/src/mame/drivers/raiden.c @@ -631,16 +631,16 @@ DRIVER_INIT_MEMBER(raiden_state,raidenu) /***************************************************************************/ /* Same PCB, differ by region byte(s) */ -GAME( 1990, raiden, 0, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 1)", 0 ) -GAME( 1990, raidena, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 2)", 0 ) -GAME( 1990, raidenu, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 1)", 0 ) -GAME( 1990, raident, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", 0 ) +GAME( 1990, raiden, 0, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, raidena, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1990, raidenu, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, raident, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", GAME_SUPPORTS_SAVE ) /* Same as above, but the sound CPU code is not encrypted */ -GAME( 1990, raidenk, raiden, raiden, raiden, raiden_state, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", 0 ) +GAME( 1990, raidenk, raiden, raiden, raiden, raiden_state, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", GAME_SUPPORTS_SAVE ) /* Alternate hardware; SEI8904 + SEI9008 PCBs. Main & Sub CPU code not encrypted */ -GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, raidenu, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 2)", 0 ) +GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, raidenu, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 2)", GAME_SUPPORTS_SAVE ) /* Alternate hardware. Main, Sub & Sound CPU code not encrypted - could possibly be a bootleg?? It also sports Seibu custom CRTC. */ -GAME( 1990, raidenb, raiden, raidenb, raiden, driver_device, 0, ROT270, "Seibu Kaihatsu", "Raiden (set 3)", 0 ) +GAME( 1990, raidenb, raiden, raidenb, raiden, driver_device, 0, ROT270, "Seibu Kaihatsu", "Raiden (set 3)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/raiden.h b/src/mame/includes/raiden.h index 59e04362d4f..f8a701126b2 100644 --- a/src/mame/includes/raiden.h +++ b/src/mame/includes/raiden.h @@ -14,26 +14,27 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_seibu_sound(*this, "seibu_sound"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_spriteram(*this, "spriteram"), m_shared_ram(*this, "shared_ram"), m_videoram(*this, "videoram"), m_scroll_ram(*this, "scroll_ram"), m_back_data(*this, "back_data"), - m_fore_data(*this, "fore_data"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_fore_data(*this, "fore_data") { } required_device m_maincpu; required_device m_seibu_sound; + required_device m_gfxdecode; + required_device m_palette; required_device m_spriteram; + required_shared_ptr m_shared_ram; required_shared_ptr m_videoram; optional_shared_ptr m_scroll_ram; required_shared_ptr m_back_data; required_shared_ptr m_fore_data; - required_device m_gfxdecode; - required_device m_palette; tilemap_t *m_bg_layer; tilemap_t *m_fg_layer; @@ -55,15 +56,20 @@ public: DECLARE_DRIVER_INIT(raidenu); DECLARE_DRIVER_INIT(raidenk); DECLARE_DRIVER_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(); DECLARE_VIDEO_START(raidenb); + UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *scrollregs); UINT32 screen_update_raiden(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(raiden_interrupt); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri_mask); void common_decrypt(); }; diff --git a/src/mame/video/raiden.c b/src/mame/video/raiden.c index 3d975604359..b8eb5dbfdae 100644 --- a/src/mame/video/raiden.c +++ b/src/mame/video/raiden.c @@ -228,6 +228,12 @@ void raiden_state::video_start() m_fg_layer->set_transparent_pen(15); m_tx_layer->set_transparent_pen(15); + + 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)); } VIDEO_START_MEMBER(raiden_state,raidenb) @@ -238,4 +244,11 @@ VIDEO_START_MEMBER(raiden_state,raidenb) m_fg_layer->set_transparent_pen(15); m_tx_layer->set_transparent_pen(15); + + 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)); }