Previous 199869 Revisions Next

r35097 Tuesday 17th February, 2015 at 20:24:41 UTC by Osso
shootout.c: added save state support, removed a couple of sound trampolines (nw)
[src/mame/drivers]shootout.c
[src/mame/includes]shootout.h
[src/mame/video]shootout.c

trunk/src/mame/drivers/shootout.c
r243608r243609
4242
4343/*******************************************************************************/
4444
45WRITE8_MEMBER(shootout_state::shootout_bankswitch_w)
45WRITE8_MEMBER(shootout_state::bankswitch_w)
4646{
4747   membank("bank1")->set_entry(data & 0x0f);
4848}
r243608r243609
5353   m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
5454}
5555
56WRITE8_MEMBER(shootout_state::shootout_flipscreen_w)
56WRITE8_MEMBER(shootout_state::flipscreen_w)
5757{
5858   flip_screen_set(data & 0x01);
5959}
6060
61WRITE8_MEMBER(shootout_state::shootout_coin_counter_w)
61WRITE8_MEMBER(shootout_state::coincounter_w)
6262{
6363   coin_counter_w(machine(), 0, data);
6464}
r243608r243609
6767
6868static ADDRESS_MAP_START( shootout_map, AS_PROGRAM, 8, shootout_state )
6969   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)
7373   AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW2") AM_WRITE(sound_cpu_command_w)
7474   AM_RANGE(0x1004, 0x17ff) AM_RAM
7575   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")
7878   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
7979   AM_RANGE(0x8000, 0xffff) AM_ROM
8080ADDRESS_MAP_END
r243608r243609
8585   AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1")
8686   AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2")
8787   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)
8989   AM_RANGE(0x2000, 0x21ff) AM_RAM AM_SHARE("spriteram")
9090   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")
9393   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
9494   AM_RANGE(0x8000, 0xffff) AM_ROM
9595ADDRESS_MAP_END
r243608r243609
229229   GFXDECODE_ENTRY( "gfx3", 0, tile_layout,   0,        16 ) /* tiles */
230230GFXDECODE_END
231231
232WRITE_LINE_MEMBER(shootout_state::shootout_snd_irq)
233{
234   m_audiocpu->set_input_line(0, state);
235}
236232
237WRITE_LINE_MEMBER(shootout_state::shootout_snd2_irq)
238{
239   m_maincpu->set_input_line(0, state);
240}
241233
242234static MACHINE_CONFIG_START( shootout, shootout_state )
243235
r243608r243609
265257   MCFG_SPEAKER_STANDARD_MONO("mono")
266258
267259   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))
269261   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
270262MACHINE_CONFIG_END
271263
r243608r243609
293285   MCFG_SPEAKER_STANDARD_MONO("mono")
294286
295287   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))
299291   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
300292MACHINE_CONFIG_END
301293
r243608r243609
398390}
399391
400392
401GAME( 1985, shootout,  0,        shootout, shootout, shootout_state, shootout, ROT0, "Data East USA", "Shoot Out (US)", 0)
402GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", 0 )
403GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", 0 )
393GAME( 1985, shootout,  0,        shootout, shootout, shootout_state, shootout, ROT0, "Data East USA", "Shoot Out (US)", GAME_SUPPORTS_SAVE )
394GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", GAME_SUPPORTS_SAVE )
395GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/shootout.h
r243608r243609
33public:
44   shootout_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_spriteram(*this, "spriteram"),
7      m_textram(*this, "textram"),
8      m_videoram(*this, "videoram"),
96      m_maincpu(*this, "maincpu"),
107      m_audiocpu(*this, "audiocpu"),
118      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")  { }
1313
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
1619   required_shared_ptr<UINT8> m_spriteram;
1720   required_shared_ptr<UINT8> m_textram;
1821   required_shared_ptr<UINT8> m_videoram;
22
23   tilemap_t *m_background;
24   tilemap_t *m_foreground;
1925   int m_bFlicker;
20   DECLARE_WRITE8_MEMBER(shootout_bankswitch_w);
26   
27   DECLARE_WRITE8_MEMBER(bankswitch_w);
2128   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
2634   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
35   
2736   DECLARE_DRIVER_INIT(shootout);
37   virtual void video_start();
38   DECLARE_PALETTE_INIT(shootout);
39   
2840   TILE_GET_INFO_MEMBER(get_bg_tile_info);
2941   TILE_GET_INFO_MEMBER(get_fg_tile_info);
30   virtual void video_start();
31   DECLARE_PALETTE_INIT(shootout);
42   
3243   UINT32 screen_update_shootout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3344   UINT32 screen_update_shootouj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3445   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;
4146};
trunk/src/mame/video/shootout.c
r243608r243609
6363         0);
6464}
6565
66WRITE8_MEMBER(shootout_state::shootout_videoram_w)
66WRITE8_MEMBER(shootout_state::videoram_w)
6767{
6868   m_videoram[offset] = data;
6969   m_background->mark_tile_dirty(offset&0x3ff );
7070}
7171
72WRITE8_MEMBER(shootout_state::shootout_textram_w)
72WRITE8_MEMBER(shootout_state::textram_w)
7373{
7474   m_textram[offset] = data;
7575   m_foreground->mark_tile_dirty(offset&0x3ff );
r243608r243609
8080   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);
8181   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);
8282   m_foreground->set_transparent_pen(0 );
83   
84   save_item(NAME(m_bFlicker));
8385}
8486
8587void shootout_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits )
8688{
87   UINT8 *spriteram = m_spriteram;
8889   gfx_element *gfx = m_gfxdecode->gfx(1);
89   const UINT8 *source = spriteram+127*4;
90   const UINT8 *source = m_spriteram+127*4;
9091   int count;
9192
9293   m_bFlicker = !m_bFlicker;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team