mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
starcrus.c, tapatune.c: added / enabled save state support (nw)
This commit is contained in:
parent
c4ee2e159e
commit
0049dee886
@ -22,18 +22,18 @@ static ADDRESS_MAP_START( starcrus_map, AS_PROGRAM, 8, starcrus_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( starcrus_io_map, AS_IO, 8, starcrus_state )
|
||||
AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(starcrus_s1_x_w)
|
||||
AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_WRITE(starcrus_s1_y_w)
|
||||
AM_RANGE(0x02, 0x02) AM_READWRITE(starcrus_coll_det_r, starcrus_s2_x_w)
|
||||
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(starcrus_s2_y_w)
|
||||
AM_RANGE(0x04, 0x04) AM_WRITE(starcrus_p1_x_w)
|
||||
AM_RANGE(0x05, 0x05) AM_WRITE(starcrus_p1_y_w)
|
||||
AM_RANGE(0x06, 0x06) AM_WRITE(starcrus_p2_x_w)
|
||||
AM_RANGE(0x07, 0x07) AM_WRITE(starcrus_p2_y_w)
|
||||
AM_RANGE(0x08, 0x08) AM_WRITE(starcrus_ship_parm_1_w)
|
||||
AM_RANGE(0x09, 0x09) AM_WRITE(starcrus_ship_parm_2_w)
|
||||
AM_RANGE(0x0a, 0x0a) AM_WRITE(starcrus_proj_parm_1_w)
|
||||
AM_RANGE(0x0b, 0x0b) AM_WRITE(starcrus_proj_parm_2_w)
|
||||
AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(s1_x_w)
|
||||
AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_WRITE(s1_y_w)
|
||||
AM_RANGE(0x02, 0x02) AM_READWRITE(coll_det_r, s2_x_w)
|
||||
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(s2_y_w)
|
||||
AM_RANGE(0x04, 0x04) AM_WRITE(p1_x_w)
|
||||
AM_RANGE(0x05, 0x05) AM_WRITE(p1_y_w)
|
||||
AM_RANGE(0x06, 0x06) AM_WRITE(p2_x_w)
|
||||
AM_RANGE(0x07, 0x07) AM_WRITE(p2_y_w)
|
||||
AM_RANGE(0x08, 0x08) AM_WRITE(ship_parm_1_w)
|
||||
AM_RANGE(0x09, 0x09) AM_WRITE(ship_parm_2_w)
|
||||
AM_RANGE(0x0a, 0x0a) AM_WRITE(proj_parm_1_w)
|
||||
AM_RANGE(0x0b, 0x0b) AM_WRITE(proj_parm_2_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ static MACHINE_CONFIG_START( starcrus, starcrus_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
|
||||
MCFG_SCREEN_SIZE(32*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(starcrus_state, screen_update_starcrus)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(starcrus_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", starcrus)
|
||||
@ -189,4 +189,4 @@ ROM_START( starcrus )
|
||||
ROM_END
|
||||
|
||||
|
||||
GAME( 1977, starcrus, 0, starcrus, starcrus, driver_device, 0, ROT0, "RamTek", "Star Cruiser", GAME_IMPERFECT_SOUND )
|
||||
GAME( 1977, starcrus, 0, starcrus, starcrus, driver_device, 0, ROT0, "RamTek", "Star Cruiser", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
|
||||
|
@ -54,14 +54,15 @@ class tapatune_state : public driver_device
|
||||
public:
|
||||
tapatune_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videocpu(*this, "videocpu"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_videocpu(*this, "videocpu"),
|
||||
m_bsmt(*this, "bsmt"),
|
||||
m_videoram(*this, "videoram") {}
|
||||
|
||||
optional_device<cpu_device> m_videocpu;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_videocpu;
|
||||
required_device<bsmt2000_device> m_bsmt;
|
||||
|
||||
optional_shared_ptr<UINT16> m_videoram;
|
||||
|
||||
UINT8 m_paletteram[0x300];
|
||||
@ -589,5 +590,5 @@ ROM_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
GAME(1994, tapatune, 0, tapatune, tapatune, driver_device, 0, ROT0, "Moloney Manufacturing Inc. / Creative Electronics and Software", "Tap a Tune", 0 )
|
||||
GAME(1994, srockbwl, 0, tapatune_base, tapatune, driver_device, 0, ROT0, "Bromley", "Super Rock and Bowl (V1.1)", GAME_IS_SKELETON_MECHANICAL )
|
||||
GAME(1994, tapatune, 0, tapatune, tapatune, driver_device, 0, ROT0, "Moloney Manufacturing Inc. / Creative Electronics and Software", "Tap a Tune", GAME_SUPPORTS_SAVE )
|
||||
GAME(1994, srockbwl, 0, tapatune_base, tapatune, driver_device, 0, ROT0, "Bromley", "Super Rock and Bowl (V1.1)", GAME_IS_SKELETON_MECHANICAL | GAME_SUPPORTS_SAVE )
|
||||
|
@ -11,6 +11,11 @@ public:
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<samples_device> m_samples;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
bitmap_ind16 *m_ship1_vid;
|
||||
bitmap_ind16 *m_ship2_vid;
|
||||
bitmap_ind16 *m_proj1_vid;
|
||||
@ -43,27 +48,26 @@ public:
|
||||
int m_explode_sound_playing;
|
||||
int m_launch1_sound_playing;
|
||||
int m_launch2_sound_playing;
|
||||
DECLARE_WRITE8_MEMBER(starcrus_s1_x_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_s1_y_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_s2_x_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_s2_y_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_p1_x_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_p1_y_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_p2_x_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_p2_y_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_ship_parm_1_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_ship_parm_2_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_proj_parm_1_w);
|
||||
DECLARE_WRITE8_MEMBER(starcrus_proj_parm_2_w);
|
||||
DECLARE_READ8_MEMBER(starcrus_coll_det_r);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(s1_x_w);
|
||||
DECLARE_WRITE8_MEMBER(s1_y_w);
|
||||
DECLARE_WRITE8_MEMBER(s2_x_w);
|
||||
DECLARE_WRITE8_MEMBER(s2_y_w);
|
||||
DECLARE_WRITE8_MEMBER(p1_x_w);
|
||||
DECLARE_WRITE8_MEMBER(p1_y_w);
|
||||
DECLARE_WRITE8_MEMBER(p2_x_w);
|
||||
DECLARE_WRITE8_MEMBER(p2_y_w);
|
||||
DECLARE_WRITE8_MEMBER(ship_parm_1_w);
|
||||
DECLARE_WRITE8_MEMBER(ship_parm_2_w);
|
||||
DECLARE_WRITE8_MEMBER(proj_parm_1_w);
|
||||
DECLARE_WRITE8_MEMBER(proj_parm_2_w);
|
||||
DECLARE_READ8_MEMBER(coll_det_r);
|
||||
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_starcrus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
int collision_check_s1s2();
|
||||
int collision_check_p1p2();
|
||||
int collision_check_s1p1p2();
|
||||
int collision_check_s2p1p2();
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<samples_device> m_samples;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
@ -10,14 +10,14 @@
|
||||
/* The collision detection techniques use in this driver
|
||||
are well explained in the comments in the sprint2 driver */
|
||||
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_s1_x_w){ m_s1_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_s1_y_w){ m_s1_y = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_s2_x_w){ m_s2_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_s2_y_w){ m_s2_y = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_p1_x_w){ m_p1_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_p1_y_w){ m_p1_y = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_p2_x_w){ m_p2_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_p2_y_w){ m_p2_y = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::s1_x_w){ m_s1_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::s1_y_w){ m_s1_y = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::s2_x_w){ m_s2_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::s2_y_w){ m_s2_y = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::p1_x_w){ m_p1_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::p1_y_w){ m_p1_y = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::p2_x_w){ m_p2_x = data^0xff; }
|
||||
WRITE8_MEMBER(starcrus_state::p2_y_w){ m_p2_y = data^0xff; }
|
||||
|
||||
void starcrus_state::video_start()
|
||||
{
|
||||
@ -26,9 +26,33 @@ void starcrus_state::video_start()
|
||||
|
||||
m_proj1_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
|
||||
m_proj2_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
|
||||
|
||||
save_item(NAME(m_s1_x));
|
||||
save_item(NAME(m_s1_y));
|
||||
save_item(NAME(m_s2_x));
|
||||
save_item(NAME(m_s2_y));
|
||||
save_item(NAME(m_p1_x));
|
||||
save_item(NAME(m_p1_y));
|
||||
save_item(NAME(m_p2_x));
|
||||
save_item(NAME(m_p2_y));
|
||||
save_item(NAME(m_p1_sprite));
|
||||
save_item(NAME(m_p2_sprite));
|
||||
save_item(NAME(m_s1_sprite));
|
||||
save_item(NAME(m_s2_sprite));
|
||||
save_item(NAME(m_engine1_on));
|
||||
save_item(NAME(m_engine2_on));
|
||||
save_item(NAME(m_explode1_on));
|
||||
save_item(NAME(m_explode2_on));
|
||||
save_item(NAME(m_launch1_on));
|
||||
save_item(NAME(m_launch2_on));
|
||||
save_item(NAME(m_collision_reg));
|
||||
save_item(NAME(m_engine_sound_playing));
|
||||
save_item(NAME(m_explode_sound_playing));
|
||||
save_item(NAME(m_launch1_sound_playing));
|
||||
save_item(NAME(m_launch2_sound_playing));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_1_w)
|
||||
WRITE8_MEMBER(starcrus_state::ship_parm_1_w)
|
||||
{
|
||||
m_s1_sprite = data&0x1f;
|
||||
m_engine1_on = ((data&0x20)>>5)^0x01;
|
||||
@ -51,7 +75,7 @@ WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_1_w)
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_2_w)
|
||||
WRITE8_MEMBER(starcrus_state::ship_parm_2_w)
|
||||
{
|
||||
m_s2_sprite = data&0x1f;
|
||||
set_led_status(machine(), 2,~data & 0x80); /* game over lamp */
|
||||
@ -77,7 +101,7 @@ WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_2_w)
|
||||
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_proj_parm_1_w)
|
||||
WRITE8_MEMBER(starcrus_state::proj_parm_1_w)
|
||||
{
|
||||
m_p1_sprite = data&0x0f;
|
||||
m_launch1_on = ((data&0x20)>>5)^0x01;
|
||||
@ -114,7 +138,7 @@ WRITE8_MEMBER(starcrus_state::starcrus_proj_parm_1_w)
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(starcrus_state::starcrus_proj_parm_2_w)
|
||||
WRITE8_MEMBER(starcrus_state::proj_parm_2_w)
|
||||
{
|
||||
m_p2_sprite = data&0x0f;
|
||||
m_launch2_on = ((data&0x20)>>5)^0x01;
|
||||
@ -390,7 +414,7 @@ int starcrus_state::collision_check_s2p1p2()
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT32 starcrus_state::screen_update_starcrus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 starcrus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
@ -465,7 +489,7 @@ UINT32 starcrus_state::screen_update_starcrus(screen_device &screen, bitmap_ind1
|
||||
return 0;
|
||||
}
|
||||
|
||||
READ8_MEMBER(starcrus_state::starcrus_coll_det_r)
|
||||
READ8_MEMBER(starcrus_state::coll_det_r)
|
||||
{
|
||||
return m_collision_reg ^ 0xff;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user