trunk/src/mame/drivers/shootout.c
| r243608 | r243609 | |
| 42 | 42 | |
| 43 | 43 | /*******************************************************************************/ |
| 44 | 44 | |
| 45 | | WRITE8_MEMBER(shootout_state::shootout_bankswitch_w) |
| 45 | WRITE8_MEMBER(shootout_state::bankswitch_w) |
| 46 | 46 | { |
| 47 | 47 | membank("bank1")->set_entry(data & 0x0f); |
| 48 | 48 | } |
| r243608 | r243609 | |
| 53 | 53 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | | WRITE8_MEMBER(shootout_state::shootout_flipscreen_w) |
| 56 | WRITE8_MEMBER(shootout_state::flipscreen_w) |
| 57 | 57 | { |
| 58 | 58 | flip_screen_set(data & 0x01); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | | WRITE8_MEMBER(shootout_state::shootout_coin_counter_w) |
| 61 | WRITE8_MEMBER(shootout_state::coincounter_w) |
| 62 | 62 | { |
| 63 | 63 | coin_counter_w(machine(), 0, data); |
| 64 | 64 | } |
| r243608 | r243609 | |
| 67 | 67 | |
| 68 | 68 | static ADDRESS_MAP_START( shootout_map, AS_PROGRAM, 8, shootout_state ) |
| 69 | 69 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 70 | | AM_RANGE(0x1000, 0x1000) AM_READ_PORT("DSW1") AM_WRITE(shootout_bankswitch_w) |
| 71 | | AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1") AM_WRITE(shootout_flipscreen_w) |
| 72 | | AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2") AM_WRITE(shootout_coin_counter_w) |
| 70 | AM_RANGE(0x1000, 0x1000) AM_READ_PORT("DSW1") AM_WRITE(bankswitch_w) |
| 71 | AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1") AM_WRITE(flipscreen_w) |
| 72 | AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2") AM_WRITE(coincounter_w) |
| 73 | 73 | AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW2") AM_WRITE(sound_cpu_command_w) |
| 74 | 74 | AM_RANGE(0x1004, 0x17ff) AM_RAM |
| 75 | 75 | AM_RANGE(0x1800, 0x19ff) AM_RAM AM_SHARE("spriteram") |
| 76 | | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(shootout_textram_w) AM_SHARE("textram") |
| 77 | | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(shootout_videoram_w) AM_SHARE("videoram") |
| 76 | AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(textram_w) AM_SHARE("textram") |
| 77 | AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 78 | 78 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 79 | 79 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 80 | 80 | ADDRESS_MAP_END |
| r243608 | r243609 | |
| 85 | 85 | AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1") |
| 86 | 86 | AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2") |
| 87 | 87 | AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW2") |
| 88 | | AM_RANGE(0x1800, 0x1800) AM_WRITE(shootout_coin_counter_w) |
| 88 | AM_RANGE(0x1800, 0x1800) AM_WRITE(coincounter_w) |
| 89 | 89 | AM_RANGE(0x2000, 0x21ff) AM_RAM AM_SHARE("spriteram") |
| 90 | 90 | AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) |
| 91 | | AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(shootout_textram_w) AM_SHARE("textram") |
| 92 | | AM_RANGE(0x3800, 0x3fff) AM_RAM_WRITE(shootout_videoram_w) AM_SHARE("videoram") |
| 91 | AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(textram_w) AM_SHARE("textram") |
| 92 | AM_RANGE(0x3800, 0x3fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 93 | 93 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
| 94 | 94 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 95 | 95 | ADDRESS_MAP_END |
| r243608 | r243609 | |
| 229 | 229 | GFXDECODE_ENTRY( "gfx3", 0, tile_layout, 0, 16 ) /* tiles */ |
| 230 | 230 | GFXDECODE_END |
| 231 | 231 | |
| 232 | | WRITE_LINE_MEMBER(shootout_state::shootout_snd_irq) |
| 233 | | { |
| 234 | | m_audiocpu->set_input_line(0, state); |
| 235 | | } |
| 236 | 232 | |
| 237 | | WRITE_LINE_MEMBER(shootout_state::shootout_snd2_irq) |
| 238 | | { |
| 239 | | m_maincpu->set_input_line(0, state); |
| 240 | | } |
| 241 | 233 | |
| 242 | 234 | static MACHINE_CONFIG_START( shootout, shootout_state ) |
| 243 | 235 | |
| r243608 | r243609 | |
| 265 | 257 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 266 | 258 | |
| 267 | 259 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| 268 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(shootout_state, shootout_snd_irq)) |
| 260 | MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6502_IRQ_LINE)) |
| 269 | 261 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 270 | 262 | MACHINE_CONFIG_END |
| 271 | 263 | |
| r243608 | r243609 | |
| 293 | 285 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 294 | 286 | |
| 295 | 287 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| 296 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(shootout_state, shootout_snd2_irq)) |
| 297 | | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(shootout_state, shootout_bankswitch_w)) |
| 298 | | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(shootout_state, shootout_flipscreen_w)) |
| 288 | MCFG_YM2203_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) |
| 289 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(shootout_state, bankswitch_w)) |
| 290 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(shootout_state, flipscreen_w)) |
| 299 | 291 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 300 | 292 | MACHINE_CONFIG_END |
| 301 | 293 | |
| r243608 | r243609 | |
| 398 | 390 | } |
| 399 | 391 | |
| 400 | 392 | |
| 401 | | GAME( 1985, shootout, 0, shootout, shootout, shootout_state, shootout, ROT0, "Data East USA", "Shoot Out (US)", 0) |
| 402 | | GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", 0 ) |
| 403 | | GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", 0 ) |
| 393 | GAME( 1985, shootout, 0, shootout, shootout, shootout_state, shootout, ROT0, "Data East USA", "Shoot Out (US)", GAME_SUPPORTS_SAVE ) |
| 394 | GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", GAME_SUPPORTS_SAVE ) |
| 395 | GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/shootout.h
| r243608 | r243609 | |
| 3 | 3 | public: |
| 4 | 4 | shootout_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | | m_spriteram(*this, "spriteram"), |
| 7 | | m_textram(*this, "textram"), |
| 8 | | m_videoram(*this, "videoram"), |
| 9 | 6 | m_maincpu(*this, "maincpu"), |
| 10 | 7 | m_audiocpu(*this, "audiocpu"), |
| 11 | 8 | m_gfxdecode(*this, "gfxdecode"), |
| 12 | | m_palette(*this, "palette") { } |
| 9 | m_palette(*this, "palette"), |
| 10 | m_spriteram(*this, "spriteram"), |
| 11 | m_textram(*this, "textram"), |
| 12 | m_videoram(*this, "videoram") { } |
| 13 | 13 | |
| 14 | | tilemap_t *m_background; |
| 15 | | tilemap_t *m_foreground; |
| 14 | required_device<cpu_device> m_maincpu; |
| 15 | optional_device<cpu_device> m_audiocpu; |
| 16 | required_device<gfxdecode_device> m_gfxdecode; |
| 17 | required_device<palette_device> m_palette; |
| 18 | |
| 16 | 19 | required_shared_ptr<UINT8> m_spriteram; |
| 17 | 20 | required_shared_ptr<UINT8> m_textram; |
| 18 | 21 | required_shared_ptr<UINT8> m_videoram; |
| 22 | |
| 23 | tilemap_t *m_background; |
| 24 | tilemap_t *m_foreground; |
| 19 | 25 | int m_bFlicker; |
| 20 | | DECLARE_WRITE8_MEMBER(shootout_bankswitch_w); |
| 26 | |
| 27 | DECLARE_WRITE8_MEMBER(bankswitch_w); |
| 21 | 28 | DECLARE_WRITE8_MEMBER(sound_cpu_command_w); |
| 22 | | DECLARE_WRITE8_MEMBER(shootout_flipscreen_w); |
| 23 | | DECLARE_WRITE8_MEMBER(shootout_coin_counter_w); |
| 24 | | DECLARE_WRITE8_MEMBER(shootout_videoram_w); |
| 25 | | DECLARE_WRITE8_MEMBER(shootout_textram_w); |
| 29 | DECLARE_WRITE8_MEMBER(flipscreen_w); |
| 30 | DECLARE_WRITE8_MEMBER(coincounter_w); |
| 31 | DECLARE_WRITE8_MEMBER(videoram_w); |
| 32 | DECLARE_WRITE8_MEMBER(textram_w); |
| 33 | |
| 26 | 34 | DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); |
| 35 | |
| 27 | 36 | DECLARE_DRIVER_INIT(shootout); |
| 37 | virtual void video_start(); |
| 38 | DECLARE_PALETTE_INIT(shootout); |
| 39 | |
| 28 | 40 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 29 | 41 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 30 | | virtual void video_start(); |
| 31 | | DECLARE_PALETTE_INIT(shootout); |
| 42 | |
| 32 | 43 | UINT32 screen_update_shootout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 33 | 44 | UINT32 screen_update_shootouj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 34 | 45 | void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits ); |
| 35 | | DECLARE_WRITE_LINE_MEMBER(shootout_snd_irq); |
| 36 | | DECLARE_WRITE_LINE_MEMBER(shootout_snd2_irq); |
| 37 | | required_device<cpu_device> m_maincpu; |
| 38 | | optional_device<cpu_device> m_audiocpu; |
| 39 | | required_device<gfxdecode_device> m_gfxdecode; |
| 40 | | required_device<palette_device> m_palette; |
| 41 | 46 | }; |
trunk/src/mame/video/shootout.c
| r243608 | r243609 | |
| 63 | 63 | 0); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | | WRITE8_MEMBER(shootout_state::shootout_videoram_w) |
| 66 | WRITE8_MEMBER(shootout_state::videoram_w) |
| 67 | 67 | { |
| 68 | 68 | m_videoram[offset] = data; |
| 69 | 69 | m_background->mark_tile_dirty(offset&0x3ff ); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | | WRITE8_MEMBER(shootout_state::shootout_textram_w) |
| 72 | WRITE8_MEMBER(shootout_state::textram_w) |
| 73 | 73 | { |
| 74 | 74 | m_textram[offset] = data; |
| 75 | 75 | m_foreground->mark_tile_dirty(offset&0x3ff ); |
| r243608 | r243609 | |
| 80 | 80 | m_background = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(shootout_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 81 | 81 | m_foreground = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(shootout_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 82 | 82 | m_foreground->set_transparent_pen(0 ); |
| 83 | |
| 84 | save_item(NAME(m_bFlicker)); |
| 83 | 85 | } |
| 84 | 86 | |
| 85 | 87 | void shootout_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits ) |
| 86 | 88 | { |
| 87 | | UINT8 *spriteram = m_spriteram; |
| 88 | 89 | gfx_element *gfx = m_gfxdecode->gfx(1); |
| 89 | | const UINT8 *source = spriteram+127*4; |
| 90 | const UINT8 *source = m_spriteram+127*4; |
| 90 | 91 | int count; |
| 91 | 92 | |
| 92 | 93 | m_bFlicker = !m_bFlicker; |