summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/slapshot.h
blob: d7815ce30c87d2d4a652aa5a81785e4d0d2e9e92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*************************************************************************

    Slapshot / Operation Wolf 3

*************************************************************************/

#include "audio/taitosnd.h"
#include "machine/taitoio.h"
#include "video/tc0360pri.h"
#include "video/tc0480scp.h"

struct slapshot_tempsprite
{
	int gfx;
	int code,color;
	int flipx,flipy;
	int x,y;
	int zoomx,zoomy;
	int primask;
};

class slapshot_state : public driver_device
{
public:
	enum
	{
		TIMER_SLAPSHOT_INTERRUPT6
	};

	slapshot_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_color_ram(*this,"color_ram"),
		m_spriteram(*this,"spriteram"),
		m_spriteext(*this,"spriteext"),
		m_maincpu(*this, "maincpu"),
		m_audiocpu(*this, "audiocpu"),
		m_tc0140syt(*this, "tc0140syt"),
		m_tc0480scp(*this, "tc0480scp"),
		m_tc0360pri(*this, "tc0360pri"),
		m_tc0640fio(*this, "tc0640fio"),
		m_gfxdecode(*this, "gfxdecode"),
		m_palette(*this, "palette") { }

	/* memory pointers */
	required_shared_ptr<UINT16> m_color_ram;
	required_shared_ptr<UINT16> m_spriteram;
	required_shared_ptr<UINT16> m_spriteext;
	UINT16 *    m_spriteram_buffered;
	UINT16 *    m_spriteram_delayed;
//  UINT16 *    m_paletteram;    // currently this uses generic palette handling

	/* video-related */
	struct      slapshot_tempsprite *m_spritelist;
	INT32       m_sprites_disabled;
	INT32       m_sprites_active_area;
	INT32       m_sprites_master_scrollx;
	INT32       m_sprites_master_scrolly;
	int         m_sprites_flipscreen;
	int         m_prepare_sprites;
	int         m_dislayer[5];

	UINT16      m_spritebank[8];

	/* misc */
	INT32      m_banknum;

	/* devices */
	required_device<cpu_device> m_maincpu;
	required_device<cpu_device> m_audiocpu;
	required_device<tc0140syt_device> m_tc0140syt;
	required_device<tc0480scp_device> m_tc0480scp;
	required_device<tc0360pri_device> m_tc0360pri;
	required_device<tc0640fio_device> m_tc0640fio;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<palette_device> m_palette;
	
	DECLARE_READ16_MEMBER(color_ram_word_r);
	DECLARE_WRITE16_MEMBER(color_ram_word_w);
	DECLARE_READ16_MEMBER(slapshot_service_input_r);
	DECLARE_READ16_MEMBER(opwolf3_adc_r);
	DECLARE_WRITE16_MEMBER(opwolf3_adc_req_w);
	DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
	DECLARE_WRITE16_MEMBER(slapshot_msb_sound_w);
	DECLARE_READ16_MEMBER(slapshot_msb_sound_r);
	DECLARE_DRIVER_INIT(slapshot);
	virtual void machine_start();
	virtual void video_start();
	UINT32 screen_update_slapshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	void screen_eof_taito_no_buffer(screen_device &screen, bool state);
	INTERRUPT_GEN_MEMBER(slapshot_interrupt);
	void reset_sound_region();
	void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int y_offset );
	void taito_handle_sprite_buffering(  );
	void taito_update_sprites_active_area(  );
	DECLARE_WRITE_LINE_MEMBER(irqhandler);

protected:
	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
};