summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/cinemat.h
blob: 2841726dd986e90150954a1679969afd371dc947 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/*************************************************************************

    Cinematronics vector hardware

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

#include "cpu/ccpu/ccpu.h"
#include "machine/74259.h"
#include "sound/ay8910.h"
#include "sound/samples.h"
#include "video/vector.h"
#include "screen.h"

class cinemat_state : public driver_device
{
public:
	cinemat_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_ay1(*this, "ay1")
		, m_outlatch(*this, "outlatch")
		, m_samples(*this, "samples")
		, m_vector(*this, "vector")
		, m_screen(*this, "screen")
		, m_rambase(*this, "rambase")
		, m_inputs(*this, "INPUTS")
		, m_switches(*this, "SWITCHES")
		, m_gear_input(*this, "GEAR")
		, m_wheel(*this, "WHEEL")
		, m_analog_x(*this, "ANALOGX")
		, m_analog_y(*this, "ANALOGY")
		, m_led(*this, "led")
		, m_pressed(*this, "pressed%u", 0U)
	{ }

	required_device<ccpu_cpu_device> m_maincpu;
	optional_device<ay8910_device> m_ay1;
	required_device<ls259_device> m_outlatch;
	optional_device<samples_device> m_samples;
	required_device<vector_device> m_vector;
	required_device<screen_device> m_screen;
	optional_shared_ptr<uint16_t> m_rambase;

	required_ioport m_inputs;
	required_ioport m_switches;
	optional_ioport m_gear_input;
	optional_ioport m_wheel;
	optional_ioport m_analog_x;
	optional_ioport m_analog_y;

	output_finder<> m_led;
	output_finder<10> m_pressed;

	uint32_t m_current_shift;
	uint32_t m_last_shift;
	uint32_t m_last_shift2;
	uint32_t m_current_pitch;
	uint32_t m_last_frame;
	uint8_t m_sound_fifo[16];
	uint8_t m_sound_fifo_in;
	uint8_t m_sound_fifo_out;
	uint8_t m_last_portb_write;
	float m_target_volume;
	float m_current_volume;
	uint8_t m_coin_detected;
	uint8_t m_coin_last_reset;
	uint8_t m_mux_select;
	int m_gear;
	int m_color_mode;
	rgb_t m_vector_color;
	int16_t m_lastx;
	int16_t m_lasty;
	uint8_t m_last_control;
	int m_qb3_lastx;
	int m_qb3_lasty;
	DECLARE_READ8_MEMBER(inputs_r);
	DECLARE_READ8_MEMBER(switches_r);
	DECLARE_READ8_MEMBER(coin_input_r);
	WRITE_LINE_MEMBER(coin_reset_w);
	WRITE_LINE_MEMBER(mux_select_w);
	DECLARE_READ8_MEMBER(speedfrk_wheel_r);
	DECLARE_READ8_MEMBER(speedfrk_gear_r);
	DECLARE_READ8_MEMBER(sundance_inputs_r);
	DECLARE_READ8_MEMBER(boxingb_dial_r);
	DECLARE_READ8_MEMBER(qb3_frame_r);
	DECLARE_WRITE8_MEMBER(qb3_ram_bank_w);
	DECLARE_WRITE_LINE_MEMBER(vector_control_w);
	DECLARE_READ8_MEMBER(joystick_read);
	DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
	void init_speedfrk();
	void init_boxingb();
	void init_sundance();
	void init_qb3();
	virtual void machine_start() override;
	virtual void machine_reset() override;
	virtual void sound_start() override;
	virtual void sound_reset() override;
	virtual void video_start() override;
	DECLARE_SOUND_RESET(demon);
	DECLARE_SOUND_RESET(qb3);
	DECLARE_VIDEO_START(cinemat_16level);
	DECLARE_VIDEO_START(cinemat_64level);
	DECLARE_VIDEO_START(cinemat_color);
	DECLARE_VIDEO_START(cinemat_qb3color);
	uint32_t screen_update_cinemat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	uint32_t screen_update_spacewar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	DECLARE_READ8_MEMBER(sound_porta_r);
	DECLARE_READ8_MEMBER(sound_portb_r);
	DECLARE_WRITE8_MEMBER(sound_portb_w);
	DECLARE_WRITE8_MEMBER(sound_output_w);
	TIMER_CALLBACK_MEMBER(synced_sound_w);
	void cinemat_vector_callback(int16_t sx, int16_t sy, int16_t ex, int16_t ey, uint8_t shift);
	DECLARE_WRITE_LINE_MEMBER(spacewar_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(spacewar_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(spacewar_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(spacewar_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(spacewar_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(barrier_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(barrier_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(barrier_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(speedfrk_start_led_w);
	DECLARE_WRITE_LINE_MEMBER(speedfrk_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(speedfrk_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(starhawk_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(starhawk_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(starhawk_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(starhawk_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(starhawk_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(starhawk_sound7_w);
	DECLARE_WRITE_LINE_MEMBER(sundance_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(sundance_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(sundance_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(sundance_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(sundance_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(sundance_sound7_w);
	DECLARE_WRITE_LINE_MEMBER(tailg_sound_w);
	DECLARE_WRITE_LINE_MEMBER(warrior_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(warrior_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(warrior_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(warrior_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(warrior_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(armora_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(armora_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(armora_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(armora_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(armora_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(ripoff_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(ripoff_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(ripoff_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(ripoff_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(ripoff_sound7_w);
	DECLARE_WRITE_LINE_MEMBER(starcas_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(starcas_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(starcas_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(starcas_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(starcas_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(solarq_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(solarq_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(solarq_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(boxingb_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(boxingb_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(boxingb_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(boxingb_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(boxingb_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(wotw_sound0_w);
	DECLARE_WRITE_LINE_MEMBER(wotw_sound1_w);
	DECLARE_WRITE_LINE_MEMBER(wotw_sound2_w);
	DECLARE_WRITE_LINE_MEMBER(wotw_sound3_w);
	DECLARE_WRITE_LINE_MEMBER(wotw_sound4_w);
	DECLARE_WRITE_LINE_MEMBER(demon_sound4_w);
	DECLARE_WRITE8_MEMBER(qb3_sound_fifo_w);
	void cinemat_nojmi_4k(machine_config &config);
	void cinemat_jmi_4k(machine_config &config);
	void cinemat_nojmi_8k(machine_config &config);
	void cinemat_jmi_8k(machine_config &config);
	void cinemat_jmi_16k(machine_config &config);
	void cinemat_jmi_32k(machine_config &config);
	void qb3(machine_config &config);
	void ripoff(machine_config &config);
	void demon(machine_config &config);
	void wotwc(machine_config &config);
	void wotw(machine_config &config);
	void boxingb(machine_config &config);
	void speedfrk(machine_config &config);
	void sundance(machine_config &config);
	void starcas(machine_config &config);
	void spacewar(machine_config &config);
	void solarq(machine_config &config);
	void tailg(machine_config &config);
	void warrior(machine_config &config);
	void starhawk(machine_config &config);
	void barrier(machine_config &config);
	void armora(machine_config &config);
	void spacewar_sound(machine_config &config);
	void barrier_sound(machine_config &config);
	void speedfrk_sound(machine_config &config);
	void starhawk_sound(machine_config &config);
	void sundance_sound(machine_config &config);
	void tailg_sound(machine_config &config);
	void warrior_sound(machine_config &config);
	void armora_sound(machine_config &config);
	void ripoff_sound(machine_config &config);
	void starcas_sound(machine_config &config);
	void solarq_sound(machine_config &config);
	void boxingb_sound(machine_config &config);
	void wotw_sound(machine_config &config);
	void demon_sound(machine_config &config);
	void qb3_sound(machine_config &config);
	void data_map(address_map &map);
	void data_map_qb3(address_map &map);
	void demon_sound_map(address_map &map);
	void demon_sound_ports(address_map &map);
	void io_map(address_map &map);
	void io_map_qb3(address_map &map);
	void program_map_16k(address_map &map);
	void program_map_32k(address_map &map);
	void program_map_4k(address_map &map);
	void program_map_8k(address_map &map);
};