summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2015-06-17 17:22:49 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2015-06-17 17:22:49 +0200
commit28af65c01cb79064289f5223eb466a22c8f75c3c (patch)
tree02e859b4dceed7d418fbcf0b880a3276eb33eaa2
parenta7556c3dcefb6575ec80bc468d9306ed7b01eb98 (diff)
cclimber.c: added save state support (nw)
-rw-r--r--src/mame/audio/cclimber.c4
-rw-r--r--src/mame/drivers/cclimber.c76
-rw-r--r--src/mame/includes/cclimber.h39
-rw-r--r--src/mame/video/cclimber.c2
4 files changed, 71 insertions, 50 deletions
diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c
index 80108dddb91..ce8d11832ea 100644
--- a/src/mame/audio/cclimber.c
+++ b/src/mame/audio/cclimber.c
@@ -14,6 +14,7 @@ SAMPLES_START_CB_MEMBER( cclimber_audio_device::sh_start )
{
if (machine().root_device().memregion("samples")->base())
m_sample_buf = auto_alloc_array(machine(), INT16, 2 * machine().root_device().memregion("samples")->bytes());
+ save_pointer(NAME(m_sample_buf), 2 * machine().root_device().memregion("samples")->bytes());
}
MACHINE_CONFIG_FRAGMENT( cclimber_audio )
@@ -58,6 +59,9 @@ cclimber_audio_device::cclimber_audio_device(const machine_config &mconfig, cons
void cclimber_audio_device::device_start()
{
+ save_item(NAME(m_sample_num));
+ save_item(NAME(m_sample_freq));
+ save_item(NAME(m_sample_volume));
}
//-------------------------------------------------
diff --git a/src/mame/drivers/cclimber.c b/src/mame/drivers/cclimber.c
index cec97aea9aa..d0d4b25363e 100644
--- a/src/mame/drivers/cclimber.c
+++ b/src/mame/drivers/cclimber.c
@@ -216,6 +216,11 @@ Dip location verified from manual for: cclimber, guzzler, swimmer
#define MASTER_CLOCK XTAL_18_432MHz
+void cclimber_state::machine_start()
+{
+ save_item(NAME(m_nmi_mask));
+}
+
WRITE8_MEMBER(cclimber_state::swimmer_sh_soundlatch_w)
{
soundlatch_byte_w(space,offset,data);
@@ -2362,12 +2367,17 @@ ROM_END
DRIVER_INIT_MEMBER(cclimber_state,yamato)
{
yamato_decode(machine(),"maincpu");
+
+ save_item(NAME(m_yamato_p0));
+ save_item(NAME(m_yamato_p1));
}
DRIVER_INIT_MEMBER(cclimber_state,toprollr)
{
toprollr_decode(machine(), "maincpu", "user1");
+
+ save_item(NAME(m_toprollr_rombank));
}
DRIVER_INIT_MEMBER(cclimber_state,dking)
@@ -2385,56 +2395,56 @@ DRIVER_INIT_MEMBER(cclimber_state,dking)
}
-GAME( 1980, cclimber, 0, cclimber, cclimber, cclimber_state, cclimber, ROT0, "Nichibutsu", "Crazy Climber (US)", 0 )
-GAME( 1980, cclimberj, cclimber, cclimber, cclimberj, cclimber_state,cclimberj,ROT0, "Nichibutsu", "Crazy Climber (Japan)", 0 )
-GAME( 1980, ccboot, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 1)", 0 )
-GAME( 1980, ccboot2, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 2)", 0 )
-GAME( 1980, ccbootmr, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg (Model Racing)", "Crazy Climber (Model Racing bootleg)", 0 )
-GAME( 1980, cclimbroper, cclimber, cclimber, cclimber, driver_device, 0, ROT0, "bootleg (Operamatic)", "Crazy Climber (Spanish, Operamatic bootleg)", 0 )
+GAME( 1980, cclimber, 0, cclimber, cclimber, cclimber_state, cclimber, ROT0, "Nichibutsu", "Crazy Climber (US)", GAME_SUPPORTS_SAVE )
+GAME( 1980, cclimberj, cclimber, cclimber, cclimberj, cclimber_state,cclimberj,ROT0, "Nichibutsu", "Crazy Climber (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1980, ccboot, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1980, ccboot2, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1980, ccbootmr, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg (Model Racing)", "Crazy Climber (Model Racing bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1980, cclimbroper, cclimber, cclimber, cclimber, driver_device, 0, ROT0, "bootleg (Operamatic)", "Crazy Climber (Spanish, Operamatic bootleg)", GAME_SUPPORTS_SAVE )
/* these sets have ugly colours, no extra attract screen, and no graphics for the extra attract screen in the BG roms
- there is a Falcon logo in the text roms which is unused
- does the code to display the extra screen still exist in the roms? */
-GAME( 1981, ckong, 0, cclimber, ckong, driver_device, 0, ROT270, "Kyoei / Falcon", "Crazy Kong", 0 ) // on a Falcon FCK-01 PCB, but doesn't display any Falcon copyright
-GAME( 1981, ckongalc, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Alca)", "Crazy Kong (Alca bootleg)", 0 )
-GAME( 1981, monkeyd, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Monkey Donkey", 0 )
-GAME( 1981, dking, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey King", 0 ) // supposedly, possibly by Hafasonic?
-GAME( 1981, ckongdks, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey Kong (Spanish Crazy Kong bootleg)", 0 )
+GAME( 1981, ckong, 0, cclimber, ckong, driver_device, 0, ROT270, "Kyoei / Falcon", "Crazy Kong", GAME_SUPPORTS_SAVE ) // on a Falcon FCK-01 PCB, but doesn't display any Falcon copyright
+GAME( 1981, ckongalc, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Alca)", "Crazy Kong (Alca bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, monkeyd, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Monkey Donkey", GAME_SUPPORTS_SAVE )
+GAME( 1981, dking, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey King", GAME_SUPPORTS_SAVE ) // supposedly, possibly by Hafasonic?
+GAME( 1981, ckongdks, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey Kong (Spanish Crazy Kong bootleg)", GAME_SUPPORTS_SAVE )
/* these sets have correct colours, and also contain the graphics used for the extra attract screen in the BG roms, but it is unused
- the Falcon logo in the text roms is still unused
- does the code to display the extra screen still exist in the roms? */
-GAME( 1981, ckongo, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Orca)", "Crazy Kong (Orca bootleg)", 0 )
-GAME( 1981, bigkong, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Big Kong", 0 )
+GAME( 1981, ckongo, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Orca)", "Crazy Kong (Orca bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, bigkong, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Big Kong", GAME_SUPPORTS_SAVE )
/* these sets have correct colours, and the extra attract screen, they also make use of the Falcon logo, some sets hack out the Falcon
text on the extra screen */
-GAME( 1981, ckongpt2, 0, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 1)", 0 )
-GAME( 1981, ckongpt2a, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 2)", 0 )
-GAME( 1981, ckongpt2j, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (Japan)", 0 )
-GAME( 1981, ckongpt2jeu, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Jeutel)", "Crazy Kong Part II (Jeutel bootleg)", 0 )
-GAME( 1981, ckongpt2b, ckongpt2, cclimber, ckongb, cclimber_state, ckongb, ROT270, "bootleg", "Crazy Kong Part II (alternative levels)", 0 )
+GAME( 1981, ckongpt2, 0, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2a, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2j, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2jeu, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Jeutel)", "Crazy Kong Part II (Jeutel bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2b, ckongpt2, cclimber, ckongb, cclimber_state, ckongb, ROT270, "bootleg", "Crazy Kong Part II (alternative levels)", GAME_SUPPORTS_SAVE )
// see bagman.c for parent
-GAME( 1981, bagmanf, bagman, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Bagman (bootleg on Crazy Kong hardware)", GAME_NOT_WORKING )
+GAME( 1981, bagmanf, bagman, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Bagman (bootleg on Crazy Kong hardware)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
-GAME( 1981, rpatrol, 0, cclimber, rpatrol, driver_device, 0, ROT0, "Orca", "River Patrol (Orca)", 0 )
-GAME( 1981, rpatrolb, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "bootleg", "River Patrol (bootleg)", 0 )
-GAME( 1981, silvland, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "Falcon", "Silver Land", 0 )
+GAME( 1981, rpatrol, 0, cclimber, rpatrol, driver_device, 0, ROT0, "Orca", "River Patrol (Orca)", GAME_SUPPORTS_SAVE )
+GAME( 1981, rpatrolb, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "bootleg", "River Patrol (bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, silvland, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "Falcon", "Silver Land", GAME_SUPPORTS_SAVE )
// see pacman.c for parent
-GAME( 1985, cannonb, cannonbp, cannonb, cannonb, cclimber_state, cannonb, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 1, buggy)" , GAME_IMPERFECT_GRAPHICS ) // bootleggers missed protection after bonus game
-GAME( 1985, cannonb2, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (TV Game Gruenberg)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 2, buggy)", 0 ) // bootleggers missed protection after bonus game
-GAME( 1985, cannonb3, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 3, no bonus game)", 0 ) // the bonus game is patched out, thus avoiding the protection issue
+GAME( 1985, cannonb, cannonbp, cannonb, cannonb, cclimber_state, cannonb, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 1, buggy)" , GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // bootleggers missed protection after bonus game
+GAME( 1985, cannonb2, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (TV Game Gruenberg)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 2, buggy)", GAME_SUPPORTS_SAVE ) // bootleggers missed protection after bonus game
+GAME( 1985, cannonb3, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 3, no bonus game)", GAME_SUPPORTS_SAVE ) // the bonus game is patched out, thus avoiding the protection issue
-GAME( 1982, swimmer, 0, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 1)", 0 )
-GAME( 1982, swimmera, swimmer, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 2)", 0 )
-GAME( 1982, swimmerb, swimmer, swimmer, swimmerb, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 3)", 0 )
+GAME( 1982, swimmer, 0, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1982, swimmera, swimmer, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1982, swimmerb, swimmer, swimmer, swimmerb, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 3)", GAME_SUPPORTS_SAVE )
-GAME( 1983, guzzler, 0, swimmer, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler", 0 )
-GAME( 1983, guzzlers, guzzler, swimmer, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler (Swimmer Conversion)", 0 )
+GAME( 1983, guzzler, 0, swimmer, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler", GAME_SUPPORTS_SAVE )
+GAME( 1983, guzzlers, guzzler, swimmer, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler (Swimmer Conversion)", GAME_SUPPORTS_SAVE )
-GAME( 1983, yamato, 0, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1983, yamato2, yamato, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (World?)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1983, yamato, 0, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1983, yamato2, yamato, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (World?)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
-GAME( 1983, toprollr, 0, toprollr, toprollr, cclimber_state, toprollr, ROT90, "Jaleco", "Top Roller", GAME_IMPERFECT_COLORS )
+GAME( 1983, toprollr, 0, toprollr, toprollr, cclimber_state, toprollr, ROT90, "Jaleco", "Top Roller", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/includes/cclimber.h b/src/mame/includes/cclimber.h
index 9939d71fe13..f7e32e48e00 100644
--- a/src/mame/includes/cclimber.h
+++ b/src/mame/includes/cclimber.h
@@ -5,6 +5,10 @@ class cclimber_state : public driver_device
public:
cclimber_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_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
m_bigsprite_videoram(*this, "bigspriteram"),
m_videoram(*this, "videoram"),
m_column_scroll(*this, "column_scroll"),
@@ -16,11 +20,12 @@ public:
m_swimmer_palettebank(*this, "palettebank"),
m_swimmer_background_color(*this, "bgcolor"),
m_toprollr_bg_videoram(*this, "bg_videoram"),
- m_toprollr_bg_coloram(*this, "bg_coloram"),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_toprollr_bg_coloram(*this, "bg_coloram") { }
+
+ required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_bigsprite_videoram;
required_shared_ptr<UINT8> m_videoram;
@@ -42,6 +47,7 @@ public:
tilemap_t *m_pf_tilemap;
tilemap_t *m_bs_tilemap;
tilemap_t *m_toproller_bg_tilemap;
+
DECLARE_WRITE8_MEMBER(swimmer_sh_soundlatch_w);
DECLARE_WRITE8_MEMBER(yamato_p0_w);
DECLARE_WRITE8_MEMBER(yamato_p1_w);
@@ -51,6 +57,8 @@ public:
DECLARE_WRITE8_MEMBER(nmi_mask_w);
DECLARE_WRITE8_MEMBER(cclimber_colorram_w);
DECLARE_WRITE8_MEMBER(cannonb_flip_screen_w);
+
+ virtual void machine_start();
DECLARE_DRIVER_INIT(cclimber);
DECLARE_DRIVER_INIT(yamato);
DECLARE_DRIVER_INIT(ckongb);
@@ -59,12 +67,6 @@ public:
DECLARE_DRIVER_INIT(cannonb2);
DECLARE_DRIVER_INIT(cannonb);
DECLARE_DRIVER_INIT(dking);
- TILE_GET_INFO_MEMBER(cclimber_get_pf_tile_info);
- TILE_GET_INFO_MEMBER(swimmer_get_pf_tile_info);
- TILE_GET_INFO_MEMBER(toprollr_get_pf_tile_info);
- TILE_GET_INFO_MEMBER(cclimber_get_bs_tile_info);
- TILE_GET_INFO_MEMBER(toprollr_get_bs_tile_info);
- TILE_GET_INFO_MEMBER(toproller_get_bg_tile_info);
DECLARE_MACHINE_RESET(cclimber);
DECLARE_VIDEO_START(cclimber);
DECLARE_PALETTE_INIT(cclimber);
@@ -73,11 +75,18 @@ public:
DECLARE_PALETTE_INIT(yamato);
DECLARE_VIDEO_START(toprollr);
DECLARE_PALETTE_INIT(toprollr);
+
+ TILE_GET_INFO_MEMBER(cclimber_get_pf_tile_info);
+ TILE_GET_INFO_MEMBER(swimmer_get_pf_tile_info);
+ TILE_GET_INFO_MEMBER(toprollr_get_pf_tile_info);
+ TILE_GET_INFO_MEMBER(cclimber_get_bs_tile_info);
+ TILE_GET_INFO_MEMBER(toprollr_get_bs_tile_info);
+ TILE_GET_INFO_MEMBER(toproller_get_bg_tile_info);
+
UINT32 screen_update_cclimber(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(vblank_irq);
void swimmer_set_background_pen();
void draw_playfield(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void cclimber_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -87,8 +96,6 @@ public:
void swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx);
void cclimber_decode(const UINT8 convtable[8][16]);
void cannonb_patch();
- required_device<cpu_device> m_maincpu;
- optional_device<cpu_device> m_audiocpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+
+ INTERRUPT_GEN_MEMBER(vblank_irq);
};
diff --git a/src/mame/video/cclimber.c b/src/mame/video/cclimber.c
index 80c614148aa..f8574855a67 100644
--- a/src/mame/video/cclimber.c
+++ b/src/mame/video/cclimber.c
@@ -2,7 +2,7 @@
// copyright-holders:Nicola Salmoria
/***************************************************************************
- video.c
+ cclimber.c
Functions to emulate the video hardware of the machine.