warpwarp.c: added save state support (nw)

This commit is contained in:
Ivan Vangelista 2015-06-22 18:36:44 +02:00
parent 2766fc3357
commit 2484b10e0c
6 changed files with 50 additions and 53 deletions

View File

@ -29,15 +29,6 @@ geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const ch
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void geebee_sound_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup

View File

@ -40,15 +40,7 @@ warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, cons
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void warpwarp_sound_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup

View File

@ -15,7 +15,6 @@ public:
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
// sound stream update overrides
@ -59,7 +58,6 @@ public:
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
// sound stream update overrides

View File

@ -135,6 +135,13 @@ Notes:
#define MASTER_CLOCK XTAL_18_432MHz
void warpwarp_state::machine_start()
{
save_item(NAME(m_geebee_bgw));
save_item(NAME(m_ball_on));
save_item(NAME(m_ball_h));
save_item(NAME(m_ball_v));
}
/* Interrupt Gen */
INTERRUPT_GEN_MEMBER(warpwarp_state::vblank_irq)
@ -733,7 +740,7 @@ static MACHINE_CONFIG_START( geebee, warpwarp_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224)
MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update_geebee)
MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 1k)
@ -770,7 +777,7 @@ static MACHINE_CONFIG_START( bombbee, warpwarp_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224)
MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update_geebee)
MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", color)
@ -986,18 +993,18 @@ DRIVER_INIT_MEMBER(warpwarp_state,warpwarp)
/* B & W games */
GAMEL(1978, geebee, 0, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco", "Gee Bee (Japan)", 0, layout_geebee )
GAMEL(1978, geebeeb, geebee, geebee, geebeeb, warpwarp_state, geebee, ROT90, "Namco (F.lli Bertolino license)", "Gee Bee (Europe)", 0, layout_geebee ) // Fratelli Bertolino
GAMEL(1978, geebeeg, geebee, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco (Gremlin license)", "Gee Bee (US)", 0, layout_geebee )
GAMEL(1978, geebee, 0, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco", "Gee Bee (Japan)", GAME_SUPPORTS_SAVE, layout_geebee )
GAMEL(1978, geebeeb, geebee, geebee, geebeeb, warpwarp_state, geebee, ROT90, "Namco (F.lli Bertolino license)", "Gee Bee (Europe)", GAME_SUPPORTS_SAVE, layout_geebee ) // Fratelli Bertolino
GAMEL(1978, geebeeg, geebee, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco (Gremlin license)", "Gee Bee (US)", GAME_SUPPORTS_SAVE, layout_geebee )
GAMEL(1980, navarone, 0, navarone, navarone, warpwarp_state, navarone, ROT90, "Namco", "Navarone", GAME_IMPERFECT_SOUND, layout_navarone )
GAME( 1980, kaitein, kaitei, navarone, kaitein, warpwarp_state, kaitein, ROT90, "K.K. Tokki (Namco license)", "Kaitei Takara Sagashi (Namco license)", 0 ) // pretty sure it didn't have a color overlay
GAME( 1980, kaitei, 0, navarone, kaitei, warpwarp_state, kaitei, ROT90, "K.K. Tokki", "Kaitei Takara Sagashi", 0 ) // "
GAME( 1980, sos, 0, navarone, sos, warpwarp_state, sos, ROT90, "Namco", "SOS", GAME_IMPERFECT_SOUND ) // developed by Shoei?
GAMEL(1980, navarone, 0, navarone, navarone, warpwarp_state, navarone, ROT90, "Namco", "Navarone", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_navarone )
GAME( 1980, kaitein, kaitei, navarone, kaitein, warpwarp_state, kaitein, ROT90, "K.K. Tokki (Namco license)", "Kaitei Takara Sagashi (Namco license)", GAME_SUPPORTS_SAVE ) // pretty sure it didn't have a color overlay
GAME( 1980, kaitei, 0, navarone, kaitei, warpwarp_state, kaitei, ROT90, "K.K. Tokki", "Kaitei Takara Sagashi", GAME_SUPPORTS_SAVE ) // "
GAME( 1980, sos, 0, navarone, sos, warpwarp_state, sos, ROT90, "Namco", "SOS", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // developed by Shoei?
/* Color games */
GAME( 1979, bombbee, 0, bombbee, bombbee, warpwarp_state, bombbee, ROT90, "Namco", "Bomb Bee", 0 )
GAME( 1979, cutieq, 0, bombbee, cutieq, warpwarp_state, bombbee, ROT90, "Namco", "Cutie Q", 0 )
GAME( 1981, warpwarp, 0, warpwarp, warpwarp, warpwarp_state, warpwarp, ROT90, "Namco", "Warp & Warp", 0 )
GAME( 1981, warpwarpr, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 1)", 0 )
GAME( 1981, warpwarpr2, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 2)", 0 )
GAME( 1979, bombbee, 0, bombbee, bombbee, warpwarp_state, bombbee, ROT90, "Namco", "Bomb Bee", GAME_SUPPORTS_SAVE )
GAME( 1979, cutieq, 0, bombbee, cutieq, warpwarp_state, bombbee, ROT90, "Namco", "Cutie Q", GAME_SUPPORTS_SAVE )
GAME( 1981, warpwarp, 0, warpwarp, warpwarp, warpwarp_state, warpwarp, ROT90, "Namco", "Warp & Warp", GAME_SUPPORTS_SAVE )
GAME( 1981, warpwarpr, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 1)", GAME_SUPPORTS_SAVE )
GAME( 1981, warpwarpr2, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 2)", GAME_SUPPORTS_SAVE )

View File

@ -8,19 +8,20 @@ public:
warpwarp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_warpwarp_sound(*this, "warpwarp_custom"),
m_geebee_sound(*this, "geebee_custom"),
m_geebee_videoram(*this, "geebee_videoram"),
m_videoram(*this, "videoram"),
m_gfxdecode(*this, "gfxdecode")
m_videoram(*this, "videoram")
{ }
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
optional_device<warpwarp_sound_device> m_warpwarp_sound;
optional_device<geebee_sound_device> m_geebee_sound;
optional_shared_ptr<UINT8> m_geebee_videoram;
optional_shared_ptr<UINT8> m_videoram;
required_device<gfxdecode_device> m_gfxdecode;
int m_geebee_bgw;
int m_ball_on;
int m_ball_h;
@ -30,16 +31,22 @@ public:
int m_ball_sizey;
int m_handle_joystick;
tilemap_t *m_bg_tilemap;
DECLARE_READ8_MEMBER(geebee_in_r);
DECLARE_WRITE8_MEMBER(geebee_out6_w);
DECLARE_WRITE8_MEMBER(geebee_out7_w);
// warpwarp and bombbee
DECLARE_READ8_MEMBER(warpwarp_sw_r);
DECLARE_WRITE8_MEMBER(warpwarp_out0_w);
DECLARE_WRITE8_MEMBER(warpwarp_out3_w);
DECLARE_WRITE8_MEMBER(geebee_videoram_w);
DECLARE_WRITE8_MEMBER(warpwarp_videoram_w);
DECLARE_READ8_MEMBER(warpwarp_dsw1_r);
DECLARE_READ8_MEMBER(warpwarp_vol_r);
//geebee and navarone
DECLARE_READ8_MEMBER(geebee_in_r);
DECLARE_WRITE8_MEMBER(geebee_out6_w);
DECLARE_WRITE8_MEMBER(geebee_out7_w);
DECLARE_WRITE8_MEMBER(geebee_videoram_w);
virtual void machine_start();
DECLARE_DRIVER_INIT(navarone);
DECLARE_DRIVER_INIT(geebee);
DECLARE_DRIVER_INIT(kaitein);
@ -47,18 +54,21 @@ public:
DECLARE_DRIVER_INIT(sos);
DECLARE_DRIVER_INIT(kaitei);
DECLARE_DRIVER_INIT(bombbee);
TILEMAP_MAPPER_MEMBER(tilemap_scan);
TILE_GET_INFO_MEMBER(geebee_get_tile_info);
TILE_GET_INFO_MEMBER(navarone_get_tile_info);
TILE_GET_INFO_MEMBER(warpwarp_get_tile_info);
DECLARE_VIDEO_START(geebee);
DECLARE_PALETTE_INIT(geebee);
DECLARE_VIDEO_START(warpwarp);
DECLARE_PALETTE_INIT(warpwarp);
DECLARE_VIDEO_START(navarone);
DECLARE_PALETTE_INIT(navarone);
UINT32 screen_update_geebee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq);
inline void geebee_plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen);
TILEMAP_MAPPER_MEMBER(tilemap_scan);
TILE_GET_INFO_MEMBER(geebee_get_tile_info);
TILE_GET_INFO_MEMBER(navarone_get_tile_info);
TILE_GET_INFO_MEMBER(warpwarp_get_tile_info);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
inline void plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen);
void draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect,pen_t pen);
INTERRUPT_GEN_MEMBER(vblank_irq);
};

View File

@ -2,7 +2,7 @@
// copyright-holders:Chris Hardy
/***************************************************************************
video.c
warpwarp.c
Functions to emulate the video hardware of the machine.
@ -63,7 +63,6 @@ PALETTE_INIT_MEMBER(warpwarp_state,navarone)
PALETTE_INIT_MEMBER(warpwarp_state,warpwarp)
{
int i;
static const int resistances_tiles_rg[] = { 1600, 820, 390 };
static const int resistances_tiles_b[] = { 820, 390 };
static const int resistance_ball[] = { 220 };
@ -75,7 +74,7 @@ PALETTE_INIT_MEMBER(warpwarp_state,warpwarp)
2, resistances_tiles_b, weights_tiles_b, 150, 0,
1, resistance_ball, weight_ball, 150, 0);
for (i = 0; i < 0x100; i++)
for (int i = 0; i < 0x100; i++)
{
int bit0, bit1, bit2;
int r,g,b;
@ -206,7 +205,7 @@ WRITE8_MEMBER(warpwarp_state::warpwarp_videoram_w)
***************************************************************************/
inline void warpwarp_state::geebee_plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen)
inline void warpwarp_state::plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen)
{
if (cliprect.contains(x, y))
bitmap.pix16(y, x) = pen;
@ -229,11 +228,11 @@ void warpwarp_state::draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect,p
for (i = m_ball_sizey;i > 0;i--)
for (j = m_ball_sizex;j > 0;j--)
geebee_plot(bitmap, cliprect, x-j, y-i, pen);
plot(bitmap, cliprect, x-j, y-i, pen);
}
}
UINT32 warpwarp_state::screen_update_geebee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
UINT32 warpwarp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);