mirror of
https://github.com/holub/mame
synced 2025-04-26 18:23:08 +03:00
srumbler.c: added save state support (nw)
This commit is contained in:
parent
6f7b1beca2
commit
40e6fb4387
@ -17,7 +17,7 @@
|
||||
#include "includes/srumbler.h"
|
||||
|
||||
|
||||
WRITE8_MEMBER(srumbler_state::srumbler_bankswitch_w)
|
||||
WRITE8_MEMBER(srumbler_state::bankswitch_w)
|
||||
{
|
||||
/*
|
||||
banking is controlled by two PROMs. 0000-4fff is mapped to the same
|
||||
@ -51,10 +51,10 @@ void srumbler_state::machine_start()
|
||||
}
|
||||
|
||||
/* initialize banked ROM pointers */
|
||||
srumbler_bankswitch_w(m_maincpu->space(AS_PROGRAM), 0, 0);
|
||||
bankswitch_w(m_maincpu->space(AS_PROGRAM), 0, 0);
|
||||
}
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::srumbler_interrupt)
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::interrupt)
|
||||
{
|
||||
int scanline = param;
|
||||
|
||||
@ -78,15 +78,15 @@ Ignore the warnings about writing to unmapped memory.
|
||||
static ADDRESS_MAP_START( srumbler_map, AS_PROGRAM, 8, srumbler_state )
|
||||
AM_RANGE(0x0000, 0x1dff) AM_RAM /* RAM (of 1 sort or another) */
|
||||
AM_RANGE(0x1e00, 0x1fff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(srumbler_background_w) AM_SHARE("backgroundram")
|
||||
AM_RANGE(0x4008, 0x4008) AM_READ_PORT("SYSTEM") AM_WRITE(srumbler_bankswitch_w)
|
||||
AM_RANGE(0x4009, 0x4009) AM_READ_PORT("P1") AM_WRITE(srumbler_4009_w)
|
||||
AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(background_w) AM_SHARE("backgroundram")
|
||||
AM_RANGE(0x4008, 0x4008) AM_READ_PORT("SYSTEM") AM_WRITE(bankswitch_w)
|
||||
AM_RANGE(0x4009, 0x4009) AM_READ_PORT("P1") AM_WRITE(_4009_w)
|
||||
AM_RANGE(0x400a, 0x400a) AM_READ_PORT("P2")
|
||||
AM_RANGE(0x400b, 0x400b) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x400c, 0x400c) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x400a, 0x400d) AM_WRITE(srumbler_scroll_w)
|
||||
AM_RANGE(0x400a, 0x400d) AM_WRITE(scroll_w)
|
||||
AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_byte_w)
|
||||
AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000") AM_WRITE(srumbler_foreground_w) AM_SHARE("foregroundram") /* Banked ROM */
|
||||
AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000") AM_WRITE(foreground_w) AM_SHARE("foregroundram") /* Banked ROM */
|
||||
AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("6000") /* Banked ROM */
|
||||
AM_RANGE(0x6000, 0x6fff) AM_WRITENOP /* Video RAM 2 ??? (not used) */
|
||||
AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("7000") /* Banked ROM */
|
||||
@ -242,7 +242,7 @@ static MACHINE_CONFIG_START( srumbler, srumbler_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M6809, 1500000) /* 1.5 MHz (?) */
|
||||
MCFG_CPU_PROGRAM_MAP(srumbler_map)
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", srumbler_state, srumbler_interrupt, "screen", 0, 1)
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", srumbler_state, interrupt, "screen", 0, 1)
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, 3000000) /* 3 MHz ??? */
|
||||
MCFG_CPU_PROGRAM_MAP(srumbler_sound_map)
|
||||
@ -257,7 +257,7 @@ static MACHINE_CONFIG_START( srumbler, srumbler_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(64*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(10*8, (64-10)*8-1, 1*8, 31*8-1 )
|
||||
MCFG_SCREEN_UPDATE_DRIVER(srumbler_state, screen_update_srumbler)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(srumbler_state, screen_update)
|
||||
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
@ -464,7 +464,7 @@ ROM_END
|
||||
|
||||
|
||||
|
||||
GAME( 1986, srumbler, 0, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 1)", 0 )
|
||||
GAME( 1986, srumbler2, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 2)", 0 )
|
||||
GAME( 1986, srumbler3, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom (Tecfri license)", "The Speed Rumbler (set 3)", 0 )
|
||||
GAME( 1986, rushcrsh, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "Rush & Crash (Japan)", 0 )
|
||||
GAME( 1986, srumbler, 0, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, srumbler2, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, srumbler3, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom (Tecfri license)", "The Speed Rumbler (set 3)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, rushcrsh, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "Rush & Crash (Japan)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -7,31 +7,37 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this,"maincpu"),
|
||||
m_spriteram(*this,"spriteram"),
|
||||
m_backgroundram(*this, "backgroundram"),
|
||||
m_foregroundram(*this, "foregroundram"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"){ }
|
||||
m_palette(*this, "palette"),
|
||||
m_backgroundram(*this, "backgroundram"),
|
||||
m_foregroundram(*this, "foregroundram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<buffered_spriteram8_device> m_spriteram;
|
||||
required_shared_ptr<UINT8> m_backgroundram;
|
||||
required_shared_ptr<UINT8> m_foregroundram;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
required_shared_ptr<UINT8> m_backgroundram;
|
||||
required_shared_ptr<UINT8> m_foregroundram;
|
||||
|
||||
tilemap_t *m_bg_tilemap;
|
||||
tilemap_t *m_fg_tilemap;
|
||||
int m_scroll[4];
|
||||
|
||||
DECLARE_WRITE8_MEMBER(srumbler_bankswitch_w);
|
||||
DECLARE_WRITE8_MEMBER(srumbler_foreground_w);
|
||||
DECLARE_WRITE8_MEMBER(srumbler_background_w);
|
||||
DECLARE_WRITE8_MEMBER(srumbler_4009_w);
|
||||
DECLARE_WRITE8_MEMBER(srumbler_scroll_w);
|
||||
DECLARE_WRITE8_MEMBER(bankswitch_w);
|
||||
DECLARE_WRITE8_MEMBER(foreground_w);
|
||||
DECLARE_WRITE8_MEMBER(background_w);
|
||||
DECLARE_WRITE8_MEMBER(_4009_w);
|
||||
DECLARE_WRITE8_MEMBER(scroll_w);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
|
||||
virtual void machine_start();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(srumbler_interrupt);
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
|
||||
video.c
|
||||
srumbler.c
|
||||
|
||||
Functions to emulate the video hardware of the machine.
|
||||
|
||||
@ -52,6 +52,8 @@ void srumbler_state::video_start()
|
||||
|
||||
m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
|
||||
m_bg_tilemap->set_transmask(1,0x07ff,0xf800); /* split type 1 has pens 0-10 transparent in front half */
|
||||
|
||||
save_item(NAME(m_scroll));
|
||||
}
|
||||
|
||||
|
||||
@ -62,20 +64,20 @@ void srumbler_state::video_start()
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
WRITE8_MEMBER(srumbler_state::srumbler_foreground_w)
|
||||
WRITE8_MEMBER(srumbler_state::foreground_w)
|
||||
{
|
||||
m_foregroundram[offset] = data;
|
||||
m_fg_tilemap->mark_tile_dirty(offset/2);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(srumbler_state::srumbler_background_w)
|
||||
WRITE8_MEMBER(srumbler_state::background_w)
|
||||
{
|
||||
m_backgroundram[offset] = data;
|
||||
m_bg_tilemap->mark_tile_dirty(offset/2);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(srumbler_state::srumbler_4009_w)
|
||||
WRITE8_MEMBER(srumbler_state::_4009_w)
|
||||
{
|
||||
/* bit 0 flips screen */
|
||||
flip_screen_set(data & 1);
|
||||
@ -88,7 +90,7 @@ WRITE8_MEMBER(srumbler_state::srumbler_4009_w)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(srumbler_state::srumbler_scroll_w)
|
||||
WRITE8_MEMBER(srumbler_state::scroll_w)
|
||||
{
|
||||
m_scroll[offset] = data;
|
||||
|
||||
@ -151,7 +153,7 @@ void srumbler_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
|
||||
}
|
||||
|
||||
|
||||
UINT32 srumbler_state::screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 srumbler_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
|
Loading…
Reference in New Issue
Block a user