summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/starcrus.h
blob: 3de1b75301f1d1fd89e7f7c48c6371b2fcf15e2f (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
// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo
#include "sound/samples.h"
class starcrus_state : public driver_device
{
public:
	starcrus_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag) ,
		m_maincpu(*this, "maincpu"),
		m_samples(*this, "samples"),
		m_gfxdecode(*this, "gfxdecode"),
		m_palette(*this, "palette") { }

	required_device<cpu_device> m_maincpu;
	required_device<samples_device> m_samples;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<palette_device> m_palette;

	std::unique_ptr<bitmap_ind16> m_ship1_vid;
	std::unique_ptr<bitmap_ind16> m_ship2_vid;
	std::unique_ptr<bitmap_ind16> m_proj1_vid;
	std::unique_ptr<bitmap_ind16> m_proj2_vid;

	int m_s1_x;
	int m_s1_y;
	int m_s2_x;
	int m_s2_y;
	int m_p1_x;
	int m_p1_y;
	int m_p2_x;
	int m_p2_y;

	int m_p1_sprite;
	int m_p2_sprite;
	int m_s1_sprite;
	int m_s2_sprite;

	int m_engine1_on;
	int m_engine2_on;
	int m_explode1_on;
	int m_explode2_on;
	int m_launch1_on;
	int m_launch2_on;

	int m_collision_reg;

	int m_engine_sound_playing;
	int m_explode_sound_playing;
	int m_launch1_sound_playing;
	int m_launch2_sound_playing;

	DECLARE_WRITE8_MEMBER(s1_x_w);
	DECLARE_WRITE8_MEMBER(s1_y_w);
	DECLARE_WRITE8_MEMBER(s2_x_w);
	DECLARE_WRITE8_MEMBER(s2_y_w);
	DECLARE_WRITE8_MEMBER(p1_x_w);
	DECLARE_WRITE8_MEMBER(p1_y_w);
	DECLARE_WRITE8_MEMBER(p2_x_w);
	DECLARE_WRITE8_MEMBER(p2_y_w);
	DECLARE_WRITE8_MEMBER(ship_parm_1_w);
	DECLARE_WRITE8_MEMBER(ship_parm_2_w);
	DECLARE_WRITE8_MEMBER(proj_parm_1_w);
	DECLARE_WRITE8_MEMBER(proj_parm_2_w);
	DECLARE_READ8_MEMBER(coll_det_r);

	virtual void video_start() override;

	UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	int collision_check_s1s2();
	int collision_check_p1p2();
	int collision_check_s1p1p2();
	int collision_check_s2p1p2();
};