Previous 199869 Revisions Next

r36193 Monday 2nd March, 2015 at 18:18:34 UTC by Osso
srumbler.c: added save state support (nw)
[src/mame/drivers]srumbler.c
[src/mame/includes]srumbler.h
[src/mame/video]srumbler.c

trunk/src/mame/drivers/srumbler.c
r244704r244705
1717#include "includes/srumbler.h"
1818
1919
20WRITE8_MEMBER(srumbler_state::srumbler_bankswitch_w)
20WRITE8_MEMBER(srumbler_state::bankswitch_w)
2121{
2222   /*
2323     banking is controlled by two PROMs. 0000-4fff is mapped to the same
r244704r244705
5151   }
5252
5353    /* initialize banked ROM pointers */
54   srumbler_bankswitch_w(m_maincpu->space(AS_PROGRAM), 0, 0);
54   bankswitch_w(m_maincpu->space(AS_PROGRAM), 0, 0);
5555}
5656
57TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::srumbler_interrupt)
57TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::interrupt)
5858{
5959   int scanline = param;
6060
r244704r244705
7878static ADDRESS_MAP_START( srumbler_map, AS_PROGRAM, 8, srumbler_state )
7979   AM_RANGE(0x0000, 0x1dff) AM_RAM  /* RAM (of 1 sort or another) */
8080   AM_RANGE(0x1e00, 0x1fff) AM_RAM AM_SHARE("spriteram")
81   AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(srumbler_background_w) AM_SHARE("backgroundram")
82   AM_RANGE(0x4008, 0x4008) AM_READ_PORT("SYSTEM") AM_WRITE(srumbler_bankswitch_w)
83   AM_RANGE(0x4009, 0x4009) AM_READ_PORT("P1") AM_WRITE(srumbler_4009_w)
81   AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(background_w) AM_SHARE("backgroundram")
82   AM_RANGE(0x4008, 0x4008) AM_READ_PORT("SYSTEM") AM_WRITE(bankswitch_w)
83   AM_RANGE(0x4009, 0x4009) AM_READ_PORT("P1") AM_WRITE(_4009_w)
8484   AM_RANGE(0x400a, 0x400a) AM_READ_PORT("P2")
8585   AM_RANGE(0x400b, 0x400b) AM_READ_PORT("DSW1")
8686   AM_RANGE(0x400c, 0x400c) AM_READ_PORT("DSW2")
87   AM_RANGE(0x400a, 0x400d) AM_WRITE(srumbler_scroll_w)
87   AM_RANGE(0x400a, 0x400d) AM_WRITE(scroll_w)
8888   AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_byte_w)
89   AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000") AM_WRITE(srumbler_foreground_w) AM_SHARE("foregroundram") /* Banked ROM */
89   AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000") AM_WRITE(foreground_w) AM_SHARE("foregroundram") /* Banked ROM */
9090   AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("6000") /* Banked ROM */
9191   AM_RANGE(0x6000, 0x6fff) AM_WRITENOP        /* Video RAM 2 ??? (not used) */
9292   AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("7000") /* Banked ROM */
r244704r244705
242242   /* basic machine hardware */
243243   MCFG_CPU_ADD("maincpu", M6809, 1500000)        /* 1.5 MHz (?) */
244244   MCFG_CPU_PROGRAM_MAP(srumbler_map)
245   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", srumbler_state, srumbler_interrupt, "screen", 0, 1)
245   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", srumbler_state, interrupt, "screen", 0, 1)
246246
247247   MCFG_CPU_ADD("audiocpu", Z80, 3000000)        /* 3 MHz ??? */
248248   MCFG_CPU_PROGRAM_MAP(srumbler_sound_map)
r244704r244705
257257   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
258258   MCFG_SCREEN_SIZE(64*8, 32*8)
259259   MCFG_SCREEN_VISIBLE_AREA(10*8, (64-10)*8-1, 1*8, 31*8-1 )
260   MCFG_SCREEN_UPDATE_DRIVER(srumbler_state, screen_update_srumbler)
260   MCFG_SCREEN_UPDATE_DRIVER(srumbler_state, screen_update)
261261   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
262262   MCFG_SCREEN_PALETTE("palette")
263263
r244704r244705
464464
465465
466466
467GAME( 1986, srumbler,  0,        srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 1)", 0 )
468GAME( 1986, srumbler2, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 2)", 0 )
469GAME( 1986, srumbler3, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom (Tecfri license)", "The Speed Rumbler (set 3)", 0 )
470GAME( 1986, rushcrsh,  srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "Rush & Crash (Japan)", 0 )
467GAME( 1986, srumbler,  0,        srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 1)", GAME_SUPPORTS_SAVE )
468GAME( 1986, srumbler2, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 2)", GAME_SUPPORTS_SAVE )
469GAME( 1986, srumbler3, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom (Tecfri license)", "The Speed Rumbler (set 3)", GAME_SUPPORTS_SAVE )
470GAME( 1986, rushcrsh,  srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "Rush & Crash (Japan)", GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/srumbler.h
r244704r244705
77      : driver_device(mconfig, type, tag),
88      m_maincpu(*this,"maincpu"),
99      m_spriteram(*this,"spriteram"),
10      m_gfxdecode(*this, "gfxdecode"),
11      m_palette(*this, "palette"),
1012      m_backgroundram(*this, "backgroundram"),
11      m_foregroundram(*this, "foregroundram"),
12      m_gfxdecode(*this, "gfxdecode"),
13      m_palette(*this, "palette"){ }
13      m_foregroundram(*this, "foregroundram") { }
1414
1515   required_device<cpu_device> m_maincpu;
1616   required_device<buffered_spriteram8_device> m_spriteram;
17   required_device<gfxdecode_device> m_gfxdecode;
18   required_device<palette_device> m_palette;
19
1720   required_shared_ptr<UINT8> m_backgroundram;
1821   required_shared_ptr<UINT8> m_foregroundram;
19   required_device<gfxdecode_device> m_gfxdecode;
20   required_device<palette_device> m_palette;
22
2123   tilemap_t *m_bg_tilemap;
2224   tilemap_t *m_fg_tilemap;
2325   int m_scroll[4];
2426
25   DECLARE_WRITE8_MEMBER(srumbler_bankswitch_w);
26   DECLARE_WRITE8_MEMBER(srumbler_foreground_w);
27   DECLARE_WRITE8_MEMBER(srumbler_background_w);
28   DECLARE_WRITE8_MEMBER(srumbler_4009_w);
29   DECLARE_WRITE8_MEMBER(srumbler_scroll_w);
27   DECLARE_WRITE8_MEMBER(bankswitch_w);
28   DECLARE_WRITE8_MEMBER(foreground_w);
29   DECLARE_WRITE8_MEMBER(background_w);
30   DECLARE_WRITE8_MEMBER(_4009_w);
31   DECLARE_WRITE8_MEMBER(scroll_w);
32   
3033   TILE_GET_INFO_MEMBER(get_fg_tile_info);
3134   TILE_GET_INFO_MEMBER(get_bg_tile_info);
35   
3236   virtual void machine_start();
3337   virtual void video_start();
34   UINT32 screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   TIMER_DEVICE_CALLBACK_MEMBER(srumbler_interrupt);
38   
39   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3640   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
41   
42   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
3743};
trunk/src/mame/video/srumbler.c
r244704r244705
11/***************************************************************************
22
3  video.c
3  srumbler.c
44
55  Functions to emulate the video hardware of the machine.
66
r244704r244705
5252
5353   m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
5454   m_bg_tilemap->set_transmask(1,0x07ff,0xf800); /* split type 1 has pens 0-10 transparent in front half */
55   
56   save_item(NAME(m_scroll));
5557}
5658
5759
r244704r244705
6264
6365***************************************************************************/
6466
65WRITE8_MEMBER(srumbler_state::srumbler_foreground_w)
67WRITE8_MEMBER(srumbler_state::foreground_w)
6668{
6769   m_foregroundram[offset] = data;
6870   m_fg_tilemap->mark_tile_dirty(offset/2);
6971}
7072
71WRITE8_MEMBER(srumbler_state::srumbler_background_w)
73WRITE8_MEMBER(srumbler_state::background_w)
7274{
7375   m_backgroundram[offset] = data;
7476   m_bg_tilemap->mark_tile_dirty(offset/2);
7577}
7678
7779
78WRITE8_MEMBER(srumbler_state::srumbler_4009_w)
80WRITE8_MEMBER(srumbler_state::_4009_w)
7981{
8082   /* bit 0 flips screen */
8183   flip_screen_set(data & 1);
r244704r244705
8890}
8991
9092
91WRITE8_MEMBER(srumbler_state::srumbler_scroll_w)
93WRITE8_MEMBER(srumbler_state::scroll_w)
9294{
9395   m_scroll[offset] = data;
9496
r244704r244705
151153}
152154
153155
154UINT32 srumbler_state::screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
156UINT32 srumbler_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
155157{
156158   m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
157159   draw_sprites(bitmap,cliprect);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team