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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
|
// license:BSD-3-Clause
// copyright-holders:hap
// thanks-to:Sean Riddle
/***************************************************************************
** subclass of hh_sm510_state (includes/hh_sm510.h, drivers/hh_sm510.cpp) **
Tiger R-Zone driver
This is a backwards console, the heart of the machine is the cartridge.
The console houses the controller, speaker, power, backlight, and a
polarizer filter for the screen. The cartridge has the MCU, optional
sound ROM, and the LCD screen in a translucent window.
Console family:
1995: R-Zone HeadGear: Wearable headset, controller is separate,
red-on-black screen is reflected in front of the right eye.
1996: R-Zone SuperScreen: Handheld console, inverted filter(aka black
LCD segments), optional background sheet as with standalone handhelds.
1997: R-Zone X.P.G - Xtreme Pocket Game: Handheld version of HeadGear.
1997: R-Zone DataZone: PDA with a built-in SuperScreen.
TODO:
- softwarelist? it's impossible right now due to SVG initialization
- support for SuperScreen. SVG colors will need to be inverted, or maybe
with artwork or HLSL?
- add DataZone, will get its own driver
***************************************************************************/
#include "emu.h"
#include "includes/hh_sm510.h"
#include "machine/timer.h"
#include "screen.h"
#include "speaker.h"
// internal artwork
#include "rzone.lh"
namespace {
class rzone_state : public hh_sm510_state
{
public:
rzone_state(const machine_config &mconfig, device_type type, const char *tag) :
hh_sm510_state(mconfig, type, tag),
m_led_out(*this, "led"),
m_led_off(*this, "led_off")
{ }
void rzbatfor(machine_config &config);
void rztoshden(machine_config &config);
void rzindy500(machine_config &config);
protected:
virtual void machine_start() override;
private:
output_finder<> m_led_out;
required_device<timer_device> m_led_off;
int m_led_pin = 0;
int m_sctrl = 0;
int m_sclock = 0;
TIMER_DEVICE_CALLBACK_MEMBER(led_off_callback) { m_led_out = m_led_pin ? 1 : 0; }
DECLARE_WRITE_LINE_MEMBER(led_w);
DECLARE_WRITE_LINE_MEMBER(audio_w);
DECLARE_WRITE_LINE_MEMBER(sctrl_w);
DECLARE_WRITE_LINE_MEMBER(sclock_w);
DECLARE_READ_LINE_MEMBER(sdata_r);
void t1_write_r(u8 data);
void t1_write_s(u8 data);
virtual u8 input_r() override;
void t2_update_audio();
void t2_write_r(u8 data);
void t2_write_s(u8 data);
};
// machine start
void rzone_state::machine_start()
{
hh_sm510_state::machine_start();
// resolve handlers
m_led_out.resolve();
// register for savestates
save_item(NAME(m_led_pin));
save_item(NAME(m_sctrl));
save_item(NAME(m_sclock));
}
/***************************************************************************
I/O
***************************************************************************/
// console
WRITE_LINE_MEMBER(rzone_state::led_w)
{
// LED: enable backlight
if (state)
m_led_out = 1;
// delay led off to prevent flickering
if (!state && m_led_pin)
m_led_off->adjust(attotime::from_msec(30));
m_led_pin = state;
}
WRITE_LINE_MEMBER(rzone_state::audio_w)
{
// Audio: speaker out
m_speaker->level_w(state ? 1 : 0);
}
WRITE_LINE_MEMBER(rzone_state::sctrl_w)
{
// SCTRL: 74165 SH/LD: reload inputs while low
if (!state || !m_sctrl)
m_inp_mux = m_inputs[0]->read();
m_sctrl = state;
}
WRITE_LINE_MEMBER(rzone_state::sclock_w)
{
// SCLOCK: 74165 CLK: shift inputs on rising edge when 74165 SH/LD is high
if (m_sctrl && !m_sclock && state)
m_inp_mux >>= 1;
m_sclock = state;
}
READ_LINE_MEMBER(rzone_state::sdata_r)
{
// SDATA: 74165 Q
sctrl_w(m_sctrl); // reload inputs if needed
return m_inp_mux & 1;
}
// cartridge type 1: simple SM510
void rzone_state::t1_write_r(u8 data)
{
// R1: Audio
audio_w(data & 1);
// R2: SCTRL
sctrl_w(data >> 1 & 1);
}
void rzone_state::t1_write_s(u8 data)
{
// S1: LED
led_w(data & 1);
// S2: SCLOCK
sclock_w(data >> 1 & 1);
}
u8 rzone_state::input_r()
{
// K1: SDATA
return sdata_r();
}
// cartridge type 2: simple SM512, 2 audio lines
void rzone_state::t2_update_audio()
{
audio_w((m_s >> 2 & 1) | (m_r & 1));
}
void rzone_state::t2_write_r(u8 data)
{
// R: Audio
m_r = data;
t2_update_audio();
}
void rzone_state::t2_write_s(u8 data)
{
// S1: SCTRL
sctrl_w(data & 1);
// S2: SCLOCK
sclock_w(data >> 1 & 1);
// S3: Audio
m_s = data;
t2_update_audio();
// S4: LED
led_w(data >> 3 & 1);
}
/***************************************************************************
Inputs
***************************************************************************/
static INPUT_PORTS_START( rzone )
PORT_START("IN.0")
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_POWER_ON ) PORT_CHANGED_CB(input_changed)
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_CB(input_changed)
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_CB(input_changed)
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_CB(input_changed)
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_CB(input_changed)
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_CB(input_changed) // A
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CHANGED_CB(input_changed) // B
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CHANGED_CB(input_changed) // C
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CHANGED_CB(input_changed) // D
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_VOLUME_DOWN ) PORT_CHANGED_CB(input_changed) PORT_NAME("Sound")
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_CHANGED_CB(input_changed)
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_CHANGED_CB(input_changed)
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CHANGED_CB(input_changed) PORT_NAME("Pause")
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START ) PORT_CHANGED_CB(input_changed)
INPUT_PORTS_END
/***************************************************************************
Machine Configs
***************************************************************************/
void rzone_state::rzbatfor(machine_config &config)
{
// basic machine hardware
SM512(config, m_maincpu); // no external XTAL
m_maincpu->write_segs().set(FUNC(rzone_state::sm510_lcd_segment_w));
m_maincpu->read_k().set(FUNC(rzone_state::input_r));
m_maincpu->write_s().set(FUNC(rzone_state::t2_write_s));
m_maincpu->write_r().set(FUNC(rzone_state::t2_write_r));
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1368, 1080);
screen.set_visarea_full();
TIMER(config, m_led_off).configure_generic(FUNC(rzone_state::led_off_callback));
config.set_default_layout(layout_rzone);
// sound hardware
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
}
void rzone_state::rztoshden(machine_config &config)
{
// basic machine hardware
SM510(config, m_maincpu);
m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT);
m_maincpu->write_segs().set(FUNC(rzone_state::sm510_lcd_segment_w));
m_maincpu->read_k().set(FUNC(rzone_state::input_r));
m_maincpu->write_s().set(FUNC(rzone_state::t1_write_s));
m_maincpu->write_r().set(FUNC(rzone_state::t1_write_r));
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1392, 1080);
screen.set_visarea_full();
TIMER(config, m_led_off).configure_generic(FUNC(rzone_state::led_off_callback));
config.set_default_layout(layout_rzone);
// sound hardware
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
}
void rzone_state::rzindy500(machine_config &config)
{
// basic machine hardware
SM510(config, m_maincpu); // no external XTAL
m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); // confirmed
m_maincpu->write_segs().set(FUNC(rzone_state::sm510_lcd_segment_w));
m_maincpu->read_k().set(FUNC(rzone_state::input_r));
m_maincpu->write_s().set(FUNC(rzone_state::t1_write_s));
m_maincpu->write_r().set(FUNC(rzone_state::t1_write_r));
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG));
screen.set_refresh_hz(60);
screen.set_size(1425, 1080);
screen.set_visarea_full();
TIMER(config, m_led_off).configure_generic(FUNC(rzone_state::led_off_callback));
config.set_default_layout(layout_rzone);
// sound hardware
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
}
/***************************************************************************
ROM Definitions
***************************************************************************/
ROM_START( rzbatfor )
ROM_REGION( 0x1000, "maincpu", 0 ) // model 71-231, SM512 under epoxy (die label KMN1202) (not the same game as the standalone Tiger handheld)
ROM_LOAD( "12_02.program", 0x0000, 0x1000, CRC(27abdb52) SHA1(b356ff80b628244da588b4748404b78d7a57eccd) )
ROM_REGION( 0x100, "maincpu:melody", 0 )
ROM_LOAD( "12_02.melody", 0x000, 0x100, CRC(d794746c) SHA1(f0706c5100c090c65fcb2d768b5a5b4a55b29e04) )
ROM_REGION( 652556, "screen", 0)
ROM_LOAD( "rzbatfor.svg", 0, 652556, CRC(4d850489) SHA1(31a2a1e9209c0f77dbc268cddbfa4a67478734a7) )
ROM_END
ROM_START( rztoshden )
ROM_REGION( 0x1000, "maincpu", 0 ) // model 71-241, SM510 under epoxy (die label ML4)
ROM_LOAD( "ml4", 0x0000, 0x1000, CRC(282c641f) SHA1(f94e4a17ffe90adcc6046070034be9b777f72288) )
ROM_REGION( 857474, "screen", 0)
ROM_LOAD( "rztoshden.svg", 0, 857474, CRC(e4340f84) SHA1(4f040d3c7dc06d66b4f06942e610a64c11e5cd4d) )
ROM_END
ROM_START( rzindy500 )
ROM_REGION( 0x1000, "maincpu", 0 ) // model 71-312, SM510 under epoxy (die label KMS10 22)
ROM_LOAD( "10_22", 0x0000, 0x1000, CRC(99a746d0) SHA1(64264499d45a566fa9a0801c20e7fa27eac18da6) )
ROM_REGION( 533411, "screen", 0)
ROM_LOAD( "rzindy500.svg", 0, 533411, CRC(cfc85677) SHA1(014b9123d81fba1488b4a22a6b6fd0c09e22c1ea) )
ROM_END
} // anonymous namespace
/***************************************************************************
Drivers
***************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
CONS( 1995, rzbatfor, 0, 0, rzbatfor, rzone, rzone_state, empty_init, "Tiger Electronics", "R-Zone: Batman Forever", MACHINE_SUPPORTS_SAVE )
CONS( 1996, rztoshden, 0, 0, rztoshden, rzone, rzone_state, empty_init, "Tiger Electronics (licensed from Takara)", "R-Zone: Battle Arena Toshinden", MACHINE_SUPPORTS_SAVE )
CONS( 1996, rzindy500, 0, 0, rzindy500, rzone, rzone_state, empty_init, "Tiger Electronics (licensed from Sega)", "R-Zone: Indy 500", MACHINE_SUPPORTS_SAVE )
|