trunk/src/mame/drivers/srumbler.c
| r244704 | r244705 | |
| 17 | 17 | #include "includes/srumbler.h" |
| 18 | 18 | |
| 19 | 19 | |
| 20 | | WRITE8_MEMBER(srumbler_state::srumbler_bankswitch_w) |
| 20 | WRITE8_MEMBER(srumbler_state::bankswitch_w) |
| 21 | 21 | { |
| 22 | 22 | /* |
| 23 | 23 | banking is controlled by two PROMs. 0000-4fff is mapped to the same |
| r244704 | r244705 | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /* 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); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | | TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::srumbler_interrupt) |
| 57 | TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::interrupt) |
| 58 | 58 | { |
| 59 | 59 | int scanline = param; |
| 60 | 60 | |
| r244704 | r244705 | |
| 78 | 78 | static ADDRESS_MAP_START( srumbler_map, AS_PROGRAM, 8, srumbler_state ) |
| 79 | 79 | AM_RANGE(0x0000, 0x1dff) AM_RAM /* RAM (of 1 sort or another) */ |
| 80 | 80 | 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) |
| 84 | 84 | AM_RANGE(0x400a, 0x400a) AM_READ_PORT("P2") |
| 85 | 85 | AM_RANGE(0x400b, 0x400b) AM_READ_PORT("DSW1") |
| 86 | 86 | 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) |
| 88 | 88 | 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 */ |
| 90 | 90 | AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("6000") /* Banked ROM */ |
| 91 | 91 | AM_RANGE(0x6000, 0x6fff) AM_WRITENOP /* Video RAM 2 ??? (not used) */ |
| 92 | 92 | AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("7000") /* Banked ROM */ |
| r244704 | r244705 | |
| 242 | 242 | /* basic machine hardware */ |
| 243 | 243 | MCFG_CPU_ADD("maincpu", M6809, 1500000) /* 1.5 MHz (?) */ |
| 244 | 244 | 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) |
| 246 | 246 | |
| 247 | 247 | MCFG_CPU_ADD("audiocpu", Z80, 3000000) /* 3 MHz ??? */ |
| 248 | 248 | MCFG_CPU_PROGRAM_MAP(srumbler_sound_map) |
| r244704 | r244705 | |
| 257 | 257 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 258 | 258 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 259 | 259 | 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) |
| 261 | 261 | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising) |
| 262 | 262 | MCFG_SCREEN_PALETTE("palette") |
| 263 | 263 | |
| r244704 | r244705 | |
| 464 | 464 | |
| 465 | 465 | |
| 466 | 466 | |
| 467 | | GAME( 1986, srumbler, 0, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 1)", 0 ) |
| 468 | | GAME( 1986, srumbler2, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 2)", 0 ) |
| 469 | | GAME( 1986, srumbler3, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom (Tecfri license)", "The Speed Rumbler (set 3)", 0 ) |
| 470 | | GAME( 1986, rushcrsh, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "Rush & Crash (Japan)", 0 ) |
| 467 | GAME( 1986, srumbler, 0, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 1)", GAME_SUPPORTS_SAVE ) |
| 468 | GAME( 1986, srumbler2, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "The Speed Rumbler (set 2)", GAME_SUPPORTS_SAVE ) |
| 469 | GAME( 1986, srumbler3, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom (Tecfri license)", "The Speed Rumbler (set 3)", GAME_SUPPORTS_SAVE ) |
| 470 | GAME( 1986, rushcrsh, srumbler, srumbler, srumbler, driver_device, 0, ROT270, "Capcom", "Rush & Crash (Japan)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/srumbler.h
| r244704 | r244705 | |
| 7 | 7 | : driver_device(mconfig, type, tag), |
| 8 | 8 | m_maincpu(*this,"maincpu"), |
| 9 | 9 | m_spriteram(*this,"spriteram"), |
| 10 | m_gfxdecode(*this, "gfxdecode"), |
| 11 | m_palette(*this, "palette"), |
| 10 | 12 | m_backgroundram(*this, "backgroundram"), |
| 11 | | m_foregroundram(*this, "foregroundram"), |
| 12 | | m_gfxdecode(*this, "gfxdecode"), |
| 13 | | m_palette(*this, "palette"){ } |
| 13 | m_foregroundram(*this, "foregroundram") { } |
| 14 | 14 | |
| 15 | 15 | required_device<cpu_device> m_maincpu; |
| 16 | 16 | required_device<buffered_spriteram8_device> m_spriteram; |
| 17 | required_device<gfxdecode_device> m_gfxdecode; |
| 18 | required_device<palette_device> m_palette; |
| 19 | |
| 17 | 20 | required_shared_ptr<UINT8> m_backgroundram; |
| 18 | 21 | required_shared_ptr<UINT8> m_foregroundram; |
| 19 | | required_device<gfxdecode_device> m_gfxdecode; |
| 20 | | required_device<palette_device> m_palette; |
| 22 | |
| 21 | 23 | tilemap_t *m_bg_tilemap; |
| 22 | 24 | tilemap_t *m_fg_tilemap; |
| 23 | 25 | int m_scroll[4]; |
| 24 | 26 | |
| 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 | |
| 30 | 33 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 31 | 34 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 35 | |
| 32 | 36 | virtual void machine_start(); |
| 33 | 37 | 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); |
| 36 | 40 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 41 | |
| 42 | TIMER_DEVICE_CALLBACK_MEMBER(interrupt); |
| 37 | 43 | }; |
trunk/src/mame/video/srumbler.c
| r244704 | r244705 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | video.c |
| 3 | srumbler.c |
| 4 | 4 | |
| 5 | 5 | Functions to emulate the video hardware of the machine. |
| 6 | 6 | |
| r244704 | r244705 | |
| 52 | 52 | |
| 53 | 53 | m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */ |
| 54 | 54 | 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)); |
| 55 | 57 | } |
| 56 | 58 | |
| 57 | 59 | |
| r244704 | r244705 | |
| 62 | 64 | |
| 63 | 65 | ***************************************************************************/ |
| 64 | 66 | |
| 65 | | WRITE8_MEMBER(srumbler_state::srumbler_foreground_w) |
| 67 | WRITE8_MEMBER(srumbler_state::foreground_w) |
| 66 | 68 | { |
| 67 | 69 | m_foregroundram[offset] = data; |
| 68 | 70 | m_fg_tilemap->mark_tile_dirty(offset/2); |
| 69 | 71 | } |
| 70 | 72 | |
| 71 | | WRITE8_MEMBER(srumbler_state::srumbler_background_w) |
| 73 | WRITE8_MEMBER(srumbler_state::background_w) |
| 72 | 74 | { |
| 73 | 75 | m_backgroundram[offset] = data; |
| 74 | 76 | m_bg_tilemap->mark_tile_dirty(offset/2); |
| 75 | 77 | } |
| 76 | 78 | |
| 77 | 79 | |
| 78 | | WRITE8_MEMBER(srumbler_state::srumbler_4009_w) |
| 80 | WRITE8_MEMBER(srumbler_state::_4009_w) |
| 79 | 81 | { |
| 80 | 82 | /* bit 0 flips screen */ |
| 81 | 83 | flip_screen_set(data & 1); |
| r244704 | r244705 | |
| 88 | 90 | } |
| 89 | 91 | |
| 90 | 92 | |
| 91 | | WRITE8_MEMBER(srumbler_state::srumbler_scroll_w) |
| 93 | WRITE8_MEMBER(srumbler_state::scroll_w) |
| 92 | 94 | { |
| 93 | 95 | m_scroll[offset] = data; |
| 94 | 96 | |
| r244704 | r244705 | |
| 151 | 153 | } |
| 152 | 154 | |
| 153 | 155 | |
| 154 | | UINT32 srumbler_state::screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 156 | UINT32 srumbler_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 155 | 157 | { |
| 156 | 158 | m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0); |
| 157 | 159 | draw_sprites(bitmap,cliprect); |