1 // license:BSD-3-Clause
2 // copyright-holders:Chris Hardy
3 /***************************************************************************
4 
5 Namco early 8080-based games
6 
7 All these games run on the same hardware design, with minor differences.
8 
9 Gee Bee was the very first videogame released by Namco, and runs on a b&w board.
10 The year after, the design was upgraded to add color and a second sound channel;
11 however, the b&w board was not abandoned, and more games were written for it with
12 the only difference of a larger gfx ROM (losing the ability to choose full or half
13 brightness for each character).
14 
15 
16 Gee Bee memory map
17 Navarone, Kaitei, SOS are the same but CGROM is twice as large
18 
19 Address          Dir Data     Name      Description
20 ---------------- --- -------- --------- -----------------------
21 -000xxxxxxxxxxxx R   xxxxxxxx ROM2/ROM0 program ROM
22 -001xxxxxxxxxxxx R   xxxxxxxx ROM1      program ROM
23 -010--xxxxxxxxxx R/W xxxxxxxx VRAM      tile code
24 -011--xxxxxxxxxx R   xxxxxxxx CGROM     Character Generator ROM
25 -100----xxxxxxxx R/W xxxxxxxx RAM       work RAM
26 -101----------00*R   --xxxxxx SW READ 0 switch inputs bank #1 (coins, buttons)
27 -101----------01*R   --xxxxxx SW READ 1 switch inputs bank #2 (optional, only kaiteik uses it)
28 -101----------10*R   --xxxxxx SW READ 2 dip switches
29 -101----------11*R   xxxxxxxx VOL READ  paddle input (digital joystick is hacked in for the other games)
30 -110----------00*  W xxxxxxxx BHD       ball horizontal position
31 -110----------01*  W xxxxxxxx BVD       ball vertical position
32 -110----------10*  W -------- n.c.
33 -110----------11*  W ----xxxx SOUND     select frequency and wave shape for sound
34 -111---------000*  W -------x LAMP 1    player 1 start lamp
35 -111---------001*  W -------x LAMP 2    player 2 start lamp
36 -111---------010*  W -------x LAMP 3    serve lamp
37 -111---------011*  W -------x COUNTER   coin counter
38 -111---------100*  W -------x LOCK OUT COIL  coin lock out
39 -111---------101*  W -------x BGW       invert CGROM data
40 -111---------110*  W -------x BALL ON   ball enable
41 -111---------111*  W -------x INV       screen flip
42 
43 * = usually accessed using the in/out instructions
44 
45 Bomb Bee / Cutie Q memory map
46 Warp Warp is the same but A13 and A15 are swapped to make space for more program ROM.
47 
48 Address          Dir Data     Name      Description
49 ---------------- --- -------- --------- -----------------------
50 -00xxxxxxxxxxxxx R   xxxxxxxx ROM       program ROM
51 -01---xxxxxxxxxx R/W xxxxxxxx RAM       work RAM
52 -10-00xxxxxxxxxx R/W xxxxxxxx V-RAM 1   tile code
53 -10-01xxxxxxxxxx R/W xxxxxxxx V-RAM 2   tile color
54 -10-1xxxxxxxxxxx R   xxxxxxxx CGROM     Character Generator ROM
55 -11-------00-xxx R   -------x SW READ   switch inputs (coins, buttons)
56 -11-------01---- R   xxxxxxxx VOL READ  paddle input (digital joystick is hacked in for warpwarp)
57 -11-------10-xxx R   -------x DIP SW 1  dip switches bank #1
58 -11-------11-xxx R   -------x DIP SW 2  dip switches bank #2 (optional, not used by any game)
59 -11-------00--00   W xxxxxxxx BHD       ball horizontal position
60 -11-------00--01   W xxxxxxxx BVD       ball vertical position
61 -11-------00--10   W ----xxxx SOUND     select frequency and wave shape for sound channel #1
62 -11-------00--11   W --------    WATCH DOG RESET
63 -11-------01----   W --xxxxxx MUSIC 1   sound channel #2 frequency
64 -11-------10----   W --xxxxxx MUSIC 2   sound channel #2 shape
65 -11-------11-000   W -------x LAMP 1    player 1 start lamp
66 -11-------11-001   W -------x LAMP 2    player 2 start lamp
67 -11-------11-010   W -------x LAMP 3    serve lamp (not used by warp warp)
68 -11-------11-011   W -------x n.c.
69 -11-------11-100   W -------x LOCK OUT  coin lock out
70 -11-------11-101   W -------x COUNTER   coin counter
71 -11-------11-110   W -------x BALL ON   ball enable + irq enable
72 -11-------11-111   W -------x INV       screen flip
73 
74 
75 Notes:
76 - Warp Warp Easter egg:
77   - enter service mode
78   - keep B1 pressed and enter the following sequence:
79     2xR 6xD L 4xU
80   (c) 1981 NAMCO LTD. will be added at the bottom of the screen.
81 
82 - In the pinball games, there isn't a player 2 "serve" button - both players use
83   the same input. I think this is correct behaviour, because there is nothing in
84   the schematics suggesting otherwise (while there is a provision to switch from
85   one paddle to the other). The Bomb Bee flyer shows that the cocktail cabinet
86   did have one serve button per player, but I guess they were just wired together
87   on the same input.
88 
89 - The ball size changes from game to game. I have determined what I believe are
90   the correct sizes by checking how the games handle the ball position in
91   cocktail mode (the ball isn't automatically flipped by the hardware).
92 
93 - kaitein and kaitei are intriguing. The game is more or less the same, but the
94   code is radically different, and the gfx ROMs are arranged differently.
95   kaitein is by Namco and kaitei is by "K'K-TOKKI". kaitein does a ROM/RAM
96   test on startup, while kaitei jumps straight into the game. kaitein is
97   locked in cocktail mode, while kaitei has support for a cabinet dip
98   switch. The title screen in kaitein is nice and polished, while in kaitei
99   it's confused, with fishes going over the text. There are several other
100   differences.
101   The code in kaitei is longer (0x1800 bytes vs. just 0x1000 in kaitein) and
102   less efficient, while kaitein has some clever space optimizations.
103 
104   Kaitei (and SOS) is developed by Kazuharu Yoshioka of K.K.Tokki (Universal Tokki).
105   Namco acquired license for these games.
106 
107 - The coin counter doesn't work in kaitei. This might be the expected behaviour.
108 
109 - sos does a "coffee break" every 2000 points, showing a girl. The first times,
110   she wears a bikini. If the "nudity" switch is on, after 6000 points she's
111   topless and every 10000 points she's nude.
112 
113 - The only difference between 'warpwarpr' and 'warpwarpr2' is the copyright
114   string on the first screen (when the scores are displayed) :
115   * 'warpwarpr' : "(c) 1981 ROCK-OLA MFG.CORP."  (text stored at 0x33ff to 0x3417)
116   * 'warpwarp2' : "(c) 1981 ROCK-OLA MFG.CO."    (text stored at 0x33ff to 0x3415)
117   Note that the checksum at 0x37ff (used for checking ROM at 0x3000 to 0x37ff)
118   is different of course.
119 
120 - warpwarpr doesn't have an explicit Namco copyright notice, but in the default
121   high score table the names are NNN AAA MMM CCC OOO. warpwarp doesn't have an
122   high score table at all.
123 
124 - There are images/videos on the net of kaitei and geebee running in 3bpp
125   (aka 7 colors), this is assumed to be a homebrew repair or hack.
126   Update: Gee Bee definitely uses an overlay while kaitei actually outputs
127   colors depending on the monitor type used (color or b&w).
128   sos is the odd one: it seems to be running in a b&w environment.
129   Also the flyer shows the girl to be colorized purple, while the points
130   numbers are in cyan and text in red (and this arrangement doesn't
131   make much sense, different version maybe?).
132 
133 ***************************************************************************/
134 
135 #include "emu.h"
136 #include "includes/warpwarp.h"
137 
138 #include "cpu/i8085/i8085.h"
139 #include "screen.h"
140 #include "speaker.h"
141 
142 #include "geebee.lh"
143 #include "navarone.lh"
144 
145 #define MASTER_CLOCK        XTAL(18'432'000)
146 
machine_start()147 void warpwarp_state::machine_start()
148 {
149 	save_item(NAME(m_geebee_bgw));
150 	save_item(NAME(m_ball_on));
151 	save_item(NAME(m_ball_h));
152 	save_item(NAME(m_ball_v));
153 }
154 
155 /* Interrupt Gen */
WRITE_LINE_MEMBER(warpwarp_state::vblank_irq)156 WRITE_LINE_MEMBER(warpwarp_state::vblank_irq)
157 {
158 	if (state && m_ball_on)
159 		m_maincpu->set_input_line(0, ASSERT_LINE);
160 }
161 
162 /* B&W Games I/O */
geebee_in_r(offs_t offset)163 uint8_t warpwarp_state::geebee_in_r(offs_t offset)
164 {
165 	int res;
166 
167 	offset &= 3;
168 	res = m_ports[offset].read_safe(0);
169 	if (offset == 3)
170 	{
171 		res = (flip_screen() & 1) ? m_in2->read() : m_in1->read();  // read player 2 input in cocktail mode
172 		if (m_handle_joystick)
173 		{
174 			/* map digital two-way joystick to two fixed VOLIN values */
175 			if (res & 2) return 0x9f;
176 			if (res & 1) return 0x0f;
177 			return 0x60;
178 		}
179 	}
180 	return res;
181 }
182 
geebee_out6_w(offs_t offset,uint8_t data)183 void warpwarp_state::geebee_out6_w(offs_t offset, uint8_t data)
184 {
185 	switch (offset & 3)
186 	{
187 		case 0:
188 			m_ball_h = data;
189 			break;
190 		case 1:
191 			m_ball_v = data;
192 			break;
193 		case 2:
194 			/* n.c. */
195 			break;
196 		case 3:
197 			m_geebee_sound->sound_w(data);
198 			break;
199 	}
200 }
201 
WRITE_LINE_MEMBER(warpwarp_state::counter_w)202 WRITE_LINE_MEMBER(warpwarp_state::counter_w)
203 {
204 	machine().bookkeeping().coin_counter_w(0, state);
205 }
206 
WRITE_LINE_MEMBER(warpwarp_state::lock_out_w)207 WRITE_LINE_MEMBER(warpwarp_state::lock_out_w)
208 {
209 	machine().bookkeeping().coin_lockout_global_w(!state);
210 }
211 
WRITE_LINE_MEMBER(warpwarp_state::geebee_bgw_w)212 WRITE_LINE_MEMBER(warpwarp_state::geebee_bgw_w)
213 {
214 	m_geebee_bgw = state;
215 	machine().tilemap().mark_all_dirty();
216 }
217 
WRITE_LINE_MEMBER(warpwarp_state::ball_on_w)218 WRITE_LINE_MEMBER(warpwarp_state::ball_on_w)
219 {
220 	m_ball_on = state;
221 	if (!state)
222 		m_maincpu->set_input_line(0, CLEAR_LINE);
223 }
224 
WRITE_LINE_MEMBER(warpwarp_state::inv_w)225 WRITE_LINE_MEMBER(warpwarp_state::inv_w)
226 {
227 	flip_screen_set(state);
228 }
229 
230 
231 /* Color Games I/O */
232 
233 /* Read Switch Inputs */
warpwarp_sw_r(offs_t offset)234 uint8_t warpwarp_state::warpwarp_sw_r(offs_t offset)
235 {
236 	return (m_in0->read() >> (offset & 7)) & 1;
237 }
238 
239 /* Read Dipswitches */
warpwarp_dsw1_r(offs_t offset)240 uint8_t warpwarp_state::warpwarp_dsw1_r(offs_t offset)
241 {
242 	return (m_dsw1->read() >> (offset & 7)) & 1;
243 }
244 
245 /* Read mux Controller Inputs */
warpwarp_vol_r()246 uint8_t warpwarp_state::warpwarp_vol_r()
247 {
248 	int res;
249 
250 	res = (flip_screen() & 1) ?  m_volin2->read() : m_volin1->read();
251 	if (m_handle_joystick)
252 	{
253 		if (res & 1) return 0x0f;
254 		if (res & 2) return 0x3f;
255 		if (res & 4) return 0x6f;
256 		if (res & 8) return 0x9f;
257 		return 0xff;
258 	}
259 	return res;
260 }
261 
warpwarp_out0_w(offs_t offset,uint8_t data)262 void warpwarp_state::warpwarp_out0_w(offs_t offset, uint8_t data)
263 {
264 	switch (offset & 3)
265 	{
266 		case 0:
267 			m_ball_h = data;
268 			break;
269 		case 1:
270 			m_ball_v = data;
271 			break;
272 		case 2:
273 			m_warpwarp_sound->sound_w(data);
274 			break;
275 		case 3:
276 			m_watchdog->watchdog_reset();
277 			break;
278 	}
279 }
280 
281 
282 
geebee_map(address_map & map)283 void warpwarp_state::geebee_map(address_map &map)
284 {
285 	map(0x0000, 0x1fff).rom();
286 	map(0x2000, 0x23ff).mirror(0x400).ram().w(FUNC(warpwarp_state::geebee_videoram_w)).share("geebee_videoram"); // mirror used by kaitei due to a bug
287 	map(0x3000, 0x37ff).rom().region("gfx1", 0); // 3000-33ff in geebee
288 	map(0x4000, 0x40ff).ram();
289 	map(0x5000, 0x53ff).r(FUNC(warpwarp_state::geebee_in_r));
290 	map(0x6000, 0x6fff).w(FUNC(warpwarp_state::geebee_out6_w));
291 	map(0x7000, 0x7007).mirror(0x0ff8).w(m_latch, FUNC(ls259_device::write_d0));
292 }
293 
geebee_port_map(address_map & map)294 void warpwarp_state::geebee_port_map(address_map &map)
295 {
296 	map(0x50, 0x53).r(FUNC(warpwarp_state::geebee_in_r));
297 	map(0x60, 0x6f).w(FUNC(warpwarp_state::geebee_out6_w));
298 	map(0x70, 0x77).mirror(0x08).w(m_latch, FUNC(ls259_device::write_d0));
299 }
300 
301 
bombbee_map(address_map & map)302 void warpwarp_state::bombbee_map(address_map &map)
303 {
304 	map(0x0000, 0x1fff).rom();
305 	map(0x2000, 0x23ff).ram();
306 	map(0x4000, 0x47ff).ram().w(FUNC(warpwarp_state::warpwarp_videoram_w)).share("videoram");
307 	map(0x4800, 0x4fff).rom().region("gfx1", 0);
308 	map(0x6000, 0x600f).rw(FUNC(warpwarp_state::warpwarp_sw_r), FUNC(warpwarp_state::warpwarp_out0_w));
309 	map(0x6010, 0x601f).r(FUNC(warpwarp_state::warpwarp_vol_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music1_w));
310 	map(0x6020, 0x602f).r(FUNC(warpwarp_state::warpwarp_dsw1_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music2_w));
311 	map(0x6030, 0x6037).mirror(0x0008).w(m_latch, FUNC(ls259_device::write_d0));
312 }
313 
warpwarp_map(address_map & map)314 void warpwarp_state::warpwarp_map(address_map &map)
315 {
316 	map(0x0000, 0x3fff).rom();
317 	map(0x8000, 0x83ff).ram();
318 	map(0x4000, 0x47ff).ram().w(FUNC(warpwarp_state::warpwarp_videoram_w)).share("videoram");
319 	map(0x4800, 0x4fff).rom().region("gfx1", 0);
320 	map(0xc000, 0xc00f).rw(FUNC(warpwarp_state::warpwarp_sw_r), FUNC(warpwarp_state::warpwarp_out0_w));
321 	map(0xc010, 0xc01f).r(FUNC(warpwarp_state::warpwarp_vol_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music1_w));
322 	map(0xc020, 0xc02f).r(FUNC(warpwarp_state::warpwarp_dsw1_r)).w(m_warpwarp_sound, FUNC(warpwarp_sound_device::music2_w));
323 	map(0xc030, 0xc037).mirror(0x0008).w(m_latch, FUNC(ls259_device::write_d0));
324 }
325 
326 
327 
328 static INPUT_PORTS_START( geebee )
329 	PORT_START("SW0")
330 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1   )
331 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2   )
332 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1  )
333 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2  )
334 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
335 	PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
336 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
337 
338 	PORT_START("SW1")
339 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
340 
341 	PORT_START("DSW2")
342 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )  PORT_DIPLOCATION("DSW2:1")
343 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
344 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
345 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )    PORT_DIPLOCATION("DSW2:2")
346 	PORT_DIPSETTING(    0x00, "3" )
347 	PORT_DIPSETTING(    0x02, "5" )
348 	PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )  PORT_DIPLOCATION("DSW2:3,4")
349 	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
350 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
351 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
352 	PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
353 	PORT_DIPNAME( 0x30, 0x10, "Replay" )            PORT_DIPLOCATION("DSW2:5,6")    // awards 1 credit
354 	PORT_DIPSETTING(    0x10, "40k 80k" )           PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
355 	PORT_DIPSETTING(    0x20, "70k 140k" )          PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
356 	PORT_DIPSETTING(    0x30, "100k 200k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
357 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )     PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
358 	PORT_DIPSETTING(    0x10, "60k 120k" )          PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
359 	PORT_DIPSETTING(    0x20, "100k 200k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
360 	PORT_DIPSETTING(    0x30, "150k 300k" )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
361 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )     PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
362 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
363 
364 	PORT_START("IN1")
365 	PORT_BIT( 0xff, 0x58, IPT_PADDLE ) PORT_MINMAX(0x10,0xa0) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_CENTERDELTA(0) PORT_REVERSE
366 
367 	PORT_START("IN2")   /* Cocktail */
368 	PORT_BIT( 0xff, 0x58, IPT_PADDLE ) PORT_MINMAX(0x10,0xa0) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_CENTERDELTA(0) PORT_REVERSE PORT_COCKTAIL
369 INPUT_PORTS_END
370 
371 static INPUT_PORTS_START( geebeeb )
372 	PORT_INCLUDE( geebee )
373 
374 	PORT_MODIFY("DSW2")
375 	PORT_DIPNAME( 0x30, 0x10, "Replay" )        // awards 1 credit
376 	PORT_DIPSETTING(    0x10, "40k" )           PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
377 	PORT_DIPSETTING(    0x20, "70k" )           PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
378 	PORT_DIPSETTING(    0x30, "100k" )          PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
379 	PORT_DIPSETTING(    0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
380 	PORT_DIPSETTING(    0x10, "60k" )           PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
381 	PORT_DIPSETTING(    0x20, "100k" )          PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
382 	PORT_DIPSETTING(    0x30, "150k" )          PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
383 	PORT_DIPSETTING(    0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
384 INPUT_PORTS_END
385 
386 static INPUT_PORTS_START( navarone )
387 	PORT_START("SW0")
388 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1   )
389 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
390 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1  )
391 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2  )
392 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
393 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
394 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
395 
396 	PORT_START("SW1")
397 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
398 
399 	PORT_START("DSW2")
400 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("DSW2:1")
401 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
402 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
403 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )        PORT_DIPLOCATION("DSW2:2")
404 	PORT_DIPSETTING(    0x00, "2" )
405 	PORT_DIPSETTING(    0x02, "3" )
406 	PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DSW2:3,4")
407 	PORT_DIPSETTING(    0x04, "5000" )                  PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
408 	PORT_DIPSETTING(    0x08, "6000" )                  PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
409 	PORT_DIPSETTING(    0x0c, "7000" )                  PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
410 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
411 	PORT_DIPSETTING(    0x04, "6000" )                  PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
412 	PORT_DIPSETTING(    0x08, "7000" )                  PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
413 	PORT_DIPSETTING(    0x0c, "8000" )                  PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
414 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )         PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
415 	PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) )      PORT_DIPLOCATION("DSW2:5,6")
416 	PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
417 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )
418 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
419 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
420 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
421 
422 	PORT_START("IN1")   /* Fake input port to support digital joystick */
423 	PORT_BIT( 0x01, 0x00, IPT_JOYSTICK_RIGHT )
424 	PORT_BIT( 0x02, 0x00, IPT_JOYSTICK_LEFT )
425 
426 	PORT_START("IN2")   /* Fake input port to support digital joystick */
427 	PORT_BIT( 0x01, 0x00, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
428 	PORT_BIT( 0x02, 0x00, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
429 INPUT_PORTS_END
430 
431 static INPUT_PORTS_START( kaitei_config )
432 	PORT_START("CONFIG")
433 	PORT_CONFNAME( 0x01, 0x01, "Monitor Type" )
434 	PORT_CONFSETTING(    0x00, "Monochrome" )
435 	PORT_CONFSETTING(    0x01, "Color" )
436 INPUT_PORTS_END
437 
438 static INPUT_PORTS_START( kaitein )
439 	PORT_INCLUDE( kaitei_config )
440 
441 	PORT_START("SW0")
442 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
443 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_COCKTAIL
444 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_START1 )
445 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START2 )
446 	PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_BUTTON1 )
447 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_SERVICE1 )
448 	PORT_BIT( 0xc0, IP_ACTIVE_LOW,  IPT_UNUSED )
449 
450 	PORT_START("SW1")
451 	PORT_BIT( 0xff, IP_ACTIVE_LOW,  IPT_UNUSED )
452 
453 	PORT_START("DSW2")
454 	PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )        PORT_DIPLOCATION("DSW2:1,2")
455 	PORT_DIPSETTING(    0x00, "2" )
456 	PORT_DIPSETTING(    0x01, "3" )
457 	PORT_DIPSETTING(    0x02, "4" )
458 	PORT_DIPSETTING(    0x03, "5" )
459 	PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DSW2:3,4")
460 	PORT_DIPSETTING(    0x04, "2000" )
461 	PORT_DIPSETTING(    0x08, "4000" )
462 	PORT_DIPSETTING(    0x0c, "6000" )
463 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )
464 	PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) )      PORT_DIPLOCATION("DSW2:5,6")
465 	PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
466 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )
467 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
468 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
469 	PORT_BIT( 0xc0, IP_ACTIVE_LOW,  IPT_UNUSED )
470 
471 	PORT_START("IN1")   /* Fake input port to support digital joystick */
472 	PORT_BIT( 0x01, 0x00, IPT_JOYSTICK_RIGHT )
473 	PORT_BIT( 0x02, 0x00, IPT_JOYSTICK_LEFT )
474 
475 	PORT_START("IN2")   /* Fake input port to support digital joystick */
476 	PORT_BIT( 0x01, 0x00, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
477 	PORT_BIT( 0x02, 0x00, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
478 INPUT_PORTS_END
479 
480 static INPUT_PORTS_START( kaitei )
481 	PORT_INCLUDE( kaitei_config )
482 
483 	PORT_START("SW0")
484 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
485 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_START1 )
486 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START2 )
487 	PORT_BIT( 0xf2, 0xa0, IPT_UNKNOWN ) // game verifies these bits and freezes if they don't match
488 
489 	PORT_START("SW1")
490 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_RIGHT )
491 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT )
492 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_BUTTON1 )
493 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
494 	PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
495 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_COCKTAIL
496 	PORT_BIT( 0xc0, 0x80, IPT_UNKNOWN ) // game verifies these two bits and freezes if they don't match
497 
498 	PORT_START("DSW2")
499 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("DSW2:1")
500 	PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
501 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
502 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )        PORT_DIPLOCATION("DSW2:2,3")
503 	PORT_DIPSETTING(    0x06, "4" )
504 	PORT_DIPSETTING(    0x04, "5" )
505 	PORT_DIPSETTING(    0x02, "6" )
506 	PORT_DIPSETTING(    0x00, "7" )
507 	PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DSW2:4,5")
508 	PORT_DIPSETTING(    0x18, "4000" )
509 	PORT_DIPSETTING(    0x10, "6000" )
510 	PORT_DIPSETTING(    0x08, "8000" )
511 	PORT_DIPSETTING(    0x00, "10000" )
512 	PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "DSW2:6" )
513 	PORT_BIT( 0xc0, 0x80, IPT_UNKNOWN ) // game verifies these two bits and freezes if they don't match
514 
515 	PORT_START("IN1")
516 	PORT_BIT( 0x3f, 0x00, IPT_UNKNOWN )
517 	PORT_BIT( 0xc0, 0x80, IPT_UNKNOWN ) // game verifies these two bits and freezes if they don't match
518 
519 	PORT_START("IN2")
520 	PORT_BIT( 0x3f, 0x00, IPT_UNKNOWN )
521 	PORT_BIT( 0xc0, 0x80, IPT_UNKNOWN ) // game verifies these two bits and freezes if they don't match
522 INPUT_PORTS_END
523 
524 static INPUT_PORTS_START( sos )
525 	PORT_START("SW0")
526 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1   )
527 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
528 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1  )
529 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2  )
530 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
531 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1   )
532 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
533 
534 	PORT_START("SW1")
535 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
536 
537 	PORT_START("DSW2")
538 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )  PORT_DIPLOCATION("DSW2:1")
539 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
540 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
541 	PORT_DIPNAME( 0x06, 0x02, DEF_STR( Lives ) )    PORT_DIPLOCATION("DSW2:2,3")
542 	PORT_DIPSETTING(    0x00, "2" )
543 	PORT_DIPSETTING(    0x02, "3" )
544 	PORT_DIPSETTING(    0x04, "4" )
545 	PORT_DIPSETTING(    0x06, "5" )
546 	PORT_DIPNAME( 0x18, 0x08, DEF_STR( Coinage ) )  PORT_DIPLOCATION("DSW2:4,5")
547 	PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
548 	PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
549 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
550 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
551 	PORT_DIPNAME( 0x20, 0x20, "Nudity" )            PORT_DIPLOCATION("DSW2:6")
552 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
553 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
554 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
555 
556 	PORT_START("IN1")   /* Fake input port to support digital joystick */
557 	PORT_BIT( 0x01, 0x00, IPT_JOYSTICK_RIGHT )
558 	PORT_BIT( 0x02, 0x00, IPT_JOYSTICK_LEFT )
559 
560 	PORT_START("IN2")   /* Fake input port to support digital joystick */
561 	PORT_BIT( 0x01, 0x00, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
562 	PORT_BIT( 0x02, 0x00, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
563 INPUT_PORTS_END
564 
565 static INPUT_PORTS_START( bombbee )
566 	PORT_START("IN0")
567 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
568 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
569 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
570 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
571 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
572 	PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
573 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
574 	PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
575 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
576 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
577 
578 	PORT_START("DSW1")
579 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )  PORT_DIPLOCATION("DSW1:1,2")
580 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
581 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
582 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
583 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
584 	PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )    PORT_DIPLOCATION("DSW1:3,4")
585 	PORT_DIPSETTING(    0x00, "3" )
586 	PORT_DIPSETTING(    0x04, "4" )
587 //  PORT_DIPSETTING(    0x08, "4" ) // duplicated setting
588 	PORT_DIPSETTING(    0x0c, "5" )
589 	PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "DSW1:5" )
590 	PORT_DIPNAME( 0xe0, 0x00, "Replay" )            PORT_DIPLOCATION("DSW1:6,7,8") // awards 1 credit
591 	PORT_DIPSETTING(    0x00, "50000" )
592 	PORT_DIPSETTING(    0x20, "60000" )
593 	PORT_DIPSETTING(    0x40, "70000" )
594 	PORT_DIPSETTING(    0x60, "80000" )
595 	PORT_DIPSETTING(    0x80, "100000" )
596 	PORT_DIPSETTING(    0xa0, "120000" )
597 	PORT_DIPSETTING(    0xc0, "150000" )
598 	PORT_DIPSETTING(    0xe0, DEF_STR( None ) )
599 
600 	PORT_START("VOLIN1")    /* Mux input - player 1 controller - handled by warpwarp_vol_r */
601 	PORT_BIT( 0xff, 0x60, IPT_PADDLE ) PORT_MINMAX(0x14,0xac) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE
602 
603 	PORT_START("VOLIN2")    /* Mux input - player 2 controller - handled by warpwarp_vol_r */
604 	PORT_BIT( 0xff, 0x60, IPT_PADDLE ) PORT_MINMAX(0x14,0xac) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE PORT_COCKTAIL
605 INPUT_PORTS_END
606 
607 static INPUT_PORTS_START( cutieq )
608 	PORT_INCLUDE( bombbee )
609 
610 	PORT_MODIFY("DSW1")
611 	PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DSW1:6,7,8")
612 	PORT_DIPSETTING(    0x00, "50000" )
613 	PORT_DIPSETTING(    0x20, "60000" )
614 	PORT_DIPSETTING(    0x40, "80000" )
615 	PORT_DIPSETTING(    0x60, "100000" )
616 	PORT_DIPSETTING(    0x80, "120000" )
617 	PORT_DIPSETTING(    0xa0, "150000" )
618 	PORT_DIPSETTING(    0xc0, "200000" )
619 	PORT_DIPSETTING(    0xe0, DEF_STR( None ) )
620 INPUT_PORTS_END
621 
622 static INPUT_PORTS_START( warpwarp )
623 	PORT_START("IN0")
624 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
625 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
626 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
627 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
628 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
629 	PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
630 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
631 	PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
632 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
633 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
634 
635 	PORT_START("DSW1")
636 	PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) )      PORT_DIPLOCATION("DSW1:1,2")
637 	PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
638 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
639 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
640 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
641 	PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )        PORT_DIPLOCATION("DSW1:3,4")
642 	PORT_DIPSETTING(    0x00, "2" )
643 	PORT_DIPSETTING(    0x04, "3" )
644 	PORT_DIPSETTING(    0x08, "4" )
645 	PORT_DIPSETTING(    0x0c, "5" )
646 	PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("DSW1:5,6")
647 	PORT_DIPSETTING(    0x00, "8k 30k 30k+" )           PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
648 	PORT_DIPSETTING(    0x10, "10k 40k 40k+" )          PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
649 	PORT_DIPSETTING(    0x20, "15k 60k 60k+" )          PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
650 	PORT_DIPSETTING(0x30, DEF_STR( None ) )             PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
651 	PORT_DIPSETTING(    0x00, "30k" )                   PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
652 	PORT_DIPSETTING(    0x10, "40k" )                   PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
653 	PORT_DIPSETTING(    0x20, "60k" )                   PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
654 	PORT_DIPSETTING(    0x30, DEF_STR( None ) )         PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
655 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("DSW1:7")
656 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
657 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
658 	/* when level selection is On, press 1 to increase level */
659 	PORT_DIPNAME( 0x80, 0x80, "Level Selection (Cheat)")    PORT_DIPLOCATION("DSW1:8")
660 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
661 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
662 
663 	PORT_START("VOLIN1")    /* FAKE - input port to simulate an analog stick - handled by warpwarp_vol_r */
664 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
665 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
666 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
667 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
668 
669 	PORT_START("VOLIN2")    /* FAKE - input port to simulate an analog stick - handled by warpwarp_vol_r */
670 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
671 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
672 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
673 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
674 INPUT_PORTS_END
675 
676 /* has High Score Initials dip switch instead of rack test */
677 static INPUT_PORTS_START( warpwarpr )
678 	PORT_INCLUDE( warpwarp )
679 
680 	PORT_MODIFY("DSW1")
681 	PORT_DIPNAME( 0x80, 0x00, "High Score Initials" )   PORT_DIPLOCATION("DSW1:8")
682 	PORT_DIPSETTING(    0x80, DEF_STR( No ) )
683 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
684 INPUT_PORTS_END
685 
686 
687 
688 static const gfx_layout charlayout =
689 {
690 	8,8,
691 	RGN_FRAC(1,1),
692 	1,
693 	{ 0 },
694 	{ 0, 1, 2, 3, 4, 5, 6, 7 },
695 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
696 	8*8
697 };
698 
699 static GFXDECODE_START( gfx_1k )
700 	GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 4 )
701 GFXDECODE_END
702 
GFXDECODE_START(gfx_2k)703 static GFXDECODE_START( gfx_2k )
704 	GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 2 )
705 GFXDECODE_END
706 
707 static GFXDECODE_START( gfx_color )
708 	GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 256 )
709 GFXDECODE_END
710 
711 
712 
713 void warpwarp_state::geebee(machine_config &config)
714 {
715 	/* basic machine hardware */
716 	I8080(config, m_maincpu, MASTER_CLOCK/9); /* verified on pcb */
717 	m_maincpu->set_addrmap(AS_PROGRAM, &warpwarp_state::geebee_map);
718 	m_maincpu->set_addrmap(AS_IO, &warpwarp_state::geebee_port_map);
719 
720 	LS259(config, m_latch); // 5N
721 	m_latch->q_out_cb<0>().set_output("led0"); // LAMP 1
722 	m_latch->q_out_cb<1>().set_output("led1"); // LAMP 2
723 	m_latch->q_out_cb<2>().set_output("led2"); // LAMP 3
724 	m_latch->q_out_cb<3>().set(FUNC(warpwarp_state::counter_w));
725 	m_latch->q_out_cb<4>().set(FUNC(warpwarp_state::lock_out_w));
726 	m_latch->q_out_cb<5>().set(FUNC(warpwarp_state::geebee_bgw_w));
727 	m_latch->q_out_cb<6>().set(FUNC(warpwarp_state::ball_on_w));
728 	m_latch->q_out_cb<7>().set(FUNC(warpwarp_state::inv_w));
729 
730 	/* video hardware */
731 	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
732 	screen.set_raw(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224);
733 	screen.set_screen_update(FUNC(warpwarp_state::screen_update));
734 	screen.set_palette(m_palette);
735 	screen.screen_vblank().set(FUNC(warpwarp_state::vblank_irq));
736 
737 	GFXDECODE(config, m_gfxdecode, m_palette, gfx_1k);
738 	PALETTE(config, m_palette, FUNC(warpwarp_state::geebee_palette), 4*2);
739 
740 	MCFG_VIDEO_START_OVERRIDE(warpwarp_state,geebee)
741 
742 	/* sound hardware */
743 	SPEAKER(config, "mono").front_center();
744 
745 	GEEBEE_SOUND(config, m_geebee_sound, MASTER_CLOCK).add_route(ALL_OUTPUTS, "mono", 1.0);
746 }
747 
geebeeb(machine_config & config)748 void warpwarp_state::geebeeb(machine_config &config)
749 {
750 	geebee(config);
751 	m_latch->q_out_cb<4>().set_nop(); // remove coin lockout
752 }
753 
navarone(machine_config & config)754 void warpwarp_state::navarone(machine_config &config)
755 {
756 	geebee(config);
757 
758 	/* basic machine hardware */
759 	m_gfxdecode->set_info(gfx_2k);
760 	m_palette->set_entries(2*2);
761 	m_palette->set_init(FUNC(warpwarp_state::navarone_palette));
762 
763 	MCFG_VIDEO_START_OVERRIDE(warpwarp_state,navarone)
764 }
765 
sos(machine_config & config)766 void warpwarp_state::sos(machine_config &config)
767 {
768 	navarone(config);
769 	m_palette->set_init(FUNC(warpwarp_state::sos_palette));
770 }
771 
kaitei(machine_config & config)772 void warpwarp_state::kaitei(machine_config &config)
773 {
774 	geebee(config);
775 
776 	/* basic machine hardware */
777 	m_gfxdecode->set_info(gfx_1k);
778 	m_palette->set_entries(4*2+1);
779 
780 	MCFG_MACHINE_RESET_OVERRIDE(warpwarp_state,kaitei)
781 }
782 
783 
bombbee(machine_config & config)784 void warpwarp_state::bombbee(machine_config &config)
785 {
786 	/* basic machine hardware */
787 	I8080(config, m_maincpu, MASTER_CLOCK/9);
788 	m_maincpu->set_addrmap(AS_PROGRAM, &warpwarp_state::bombbee_map);
789 
790 	LS259(config, m_latch); // 6L on Warp Warp
791 	m_latch->q_out_cb<0>().set_output("led0"); // LAMP 1
792 	m_latch->q_out_cb<1>().set_output("led1"); // LAMP 2
793 	m_latch->q_out_cb<2>().set_output("led2"); // LAMP 3
794 	m_latch->q_out_cb<3>().set_nop(); // n.c.
795 	m_latch->q_out_cb<4>().set(FUNC(warpwarp_state::lock_out_w));
796 	m_latch->q_out_cb<5>().set(FUNC(warpwarp_state::counter_w));
797 	m_latch->q_out_cb<6>().set(FUNC(warpwarp_state::ball_on_w));
798 	m_latch->q_out_cb<7>().set(FUNC(warpwarp_state::inv_w));
799 
800 	WATCHDOG_TIMER(config, m_watchdog);
801 
802 	/* video hardware */
803 	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
804 	screen.set_raw(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224);
805 	screen.set_screen_update(FUNC(warpwarp_state::screen_update));
806 	screen.set_palette(m_palette);
807 	screen.screen_vblank().set(FUNC(warpwarp_state::vblank_irq));
808 
809 	GFXDECODE(config, m_gfxdecode, m_palette, gfx_color);
810 
811 	PALETTE(config, m_palette, FUNC(warpwarp_state::warpwarp_palette), 2*256+1);
812 	MCFG_VIDEO_START_OVERRIDE(warpwarp_state,warpwarp)
813 
814 	/* sound hardware */
815 	SPEAKER(config, "mono").front_center();
816 
817 	WARPWARP_SOUND(config, m_warpwarp_sound, MASTER_CLOCK).add_route(ALL_OUTPUTS, "mono", 1.0);
818 }
819 
warpwarp(machine_config & config)820 void warpwarp_state::warpwarp(machine_config &config)
821 {
822 	bombbee(config);
823 
824 	/* basic machine hardware */
825 	m_maincpu->set_addrmap(AS_PROGRAM, &warpwarp_state::warpwarp_map);
826 }
827 
828 
829 /***************************************************************************
830 
831   Game driver(s)
832 
833 ***************************************************************************/
834 
835 ROM_START( geebee )
836 	ROM_REGION( 0x10000, "maincpu", 0 )
837 	ROM_LOAD( "geebee.1k",    0x0000, 0x1000, CRC(8a5577e0) SHA1(356d33e19c6b4f519816ee4b65ff9b59d6c1b565) )
838 
839 	ROM_REGION( 0x800, "gfx1", 0 )
CRC(f257b21b)840 	ROM_LOAD( "geebee.3a",    0x0000, 0x0400, CRC(f257b21b) SHA1(c788fd923438f1bffbff9ff3cd4c5c8b547c0c14) )
841 	ROM_RELOAD(               0x0400, 0x0400 )
842 ROM_END
843 
844 ROM_START( geebeea )
845 	ROM_REGION( 0x10000, "maincpu", 0 )
846 	ROM_LOAD( "132",    0x0000, 0x0400, CRC(23252fc7) SHA1(433f0f435ff741a789942194356aaec53192608a) )
847 	ROM_LOAD( "133",    0x0400, 0x0400, CRC(0bc4d4ca) SHA1(46028ce1dbf46e49b921cfabec78cded914af358) )
848 	ROM_LOAD( "134",    0x0800, 0x0400, CRC(7899b4c1) SHA1(70f609f9873f1a4d9c8a90361c7519bdd24ad9ea) )
849 	ROM_LOAD( "135",    0x0c00, 0x0400, CRC(0b6e6fcb) SHA1(e7c3e8a13e3d2be6cfb6675fb57cc4a2fda6bec2) )
850 
851 	ROM_REGION( 0x800, "gfx1", 0 )
852 	ROM_LOAD( "a_136",  0x0000, 0x0400, CRC(bd01437d) SHA1(4324c68472f762a13f978e54b3c4a7984cc7195a) )
853 	ROM_RELOAD(         0x0400, 0x0400 )
854 ROM_END
855 
856 ROM_START( geebeeb )
857 	ROM_REGION( 0x10000, "maincpu", 0 )
858 	ROM_LOAD( "1.1m",    0x0000, 0x0400, CRC(23252fc7) SHA1(433f0f435ff741a789942194356aaec53192608a) )
859 	ROM_LOAD( "2.1p",    0x0400, 0x0400, CRC(0bc4d4ca) SHA1(46028ce1dbf46e49b921cfabec78cded914af358) )
860 	ROM_LOAD( "3.1s",    0x0800, 0x0400, CRC(7899b4c1) SHA1(70f609f9873f1a4d9c8a90361c7519bdd24ad9ea) )
861 	ROM_LOAD( "4.1t",    0x0c00, 0x0400, CRC(0b6e6fcb) SHA1(e7c3e8a13e3d2be6cfb6675fb57cc4a2fda6bec2) )
862 
863 	ROM_REGION( 0x800, "gfx1", 0 )
864 	ROM_LOAD( "geebee.3a",    0x0000, 0x0400, CRC(f257b21b) SHA1(c788fd923438f1bffbff9ff3cd4c5c8b547c0c14) )
865 	ROM_RELOAD(               0x0400, 0x0400 )
866 ROM_END
867 
868 ROM_START( geebeeg )
869 	ROM_REGION( 0x10000, "maincpu", 0 )
870 	ROM_LOAD( "geebee.1k",    0x0000, 0x1000, CRC(8a5577e0) SHA1(356d33e19c6b4f519816ee4b65ff9b59d6c1b565) )
871 
872 	ROM_REGION( 0x800, "gfx1", 0 )
873 	ROM_LOAD( "geebeeg.3a",   0x0000, 0x0400, CRC(a45932ba) SHA1(48f70742c42a9377f31fac3a1e43123751e57656) )
874 	ROM_RELOAD(               0x0400, 0x0400 )
875 ROM_END
876 
877 ROM_START( navarone )
878 	ROM_REGION( 0x10000, "maincpu", 0 )
879 	ROM_LOAD( "navalone.p1",  0x0000, 0x0800, CRC(5a32016b) SHA1(d856d069eba470a81341de0bf47eca2a629a69a6) )
880 	ROM_LOAD( "navalone.p2",  0x0800, 0x0800, CRC(b1c86fe3) SHA1(0293b742806c1517cb126443701115a3427fc60a) )
881 
882 	ROM_REGION( 0x800, "gfx1", 0 )
883 	ROM_LOAD( "navalone.chr", 0x0000, 0x0800, CRC(b26c6170) SHA1(ae0aec2b60e1fd3b212e311afb1c588b2b286433) )
884 ROM_END
885 
886 ROM_START( kaitein )
887 	ROM_REGION( 0x10000, "maincpu", 0 )
888 	ROM_LOAD( "kaitein.p1",   0x0000, 0x0800, CRC(d88e10ae) SHA1(76d6cd46b6e59e528e7a8fff9965375a1446a91d) )
889 	ROM_LOAD( "kaitein.p2",   0x0800, 0x0800, CRC(aa9b5763) SHA1(64a6c8f25b0510841dcce0b57505731aa0deeda7) )
890 
891 	ROM_REGION( 0x800, "gfx1", 0 )
892 	ROM_LOAD( "kaitein.chr",  0x0000, 0x0800, CRC(3125af4d) SHA1(9e6b161636665ee48d6bde2d5fc412fde382c687) )
893 ROM_END
894 
895 ROM_START( kaitei )
896 	ROM_REGION( 0x10000, "maincpu", 0 )
897 	ROM_LOAD( "kaitei_7.1k",  0x0000, 0x0800, CRC(32f70d48) SHA1(c5ae606df1d0e513daea909f5474309a176096c1) )
898 	ROM_RELOAD(               0x0800, 0x0800 )
899 	ROM_LOAD( "kaitei_1.1m",  0x1000, 0x0400, CRC(9a7ab3b9) SHA1(94a82ba66e51c8203ec61c9320edbddbb6462d33) )
900 	ROM_LOAD( "kaitei_2.1p",  0x1400, 0x0400, CRC(5eeb0fff) SHA1(91cb84a9af8e4df4e6c896e7655199328b7da30b) )
901 	ROM_LOAD( "kaitei_3.1s",  0x1800, 0x0400, CRC(5dff4df7) SHA1(c179c93a559a0d18db3092c842634de02f3f03ea) )
902 	ROM_LOAD( "kaitei_4.1t",  0x1c00, 0x0400, CRC(e5f303d6) SHA1(6dd57e0b17f51d101c6c5dbfeadb7418098cc440) )
903 
904 	ROM_REGION( 0x800, "gfx1", 0 )
905 	ROM_LOAD( "kaitei_5.bin", 0x0000, 0x0400, CRC(60fdb795) SHA1(723e635eed9937a28bee0b7978413984651ee87f) )
906 	ROM_LOAD( "kaitei_6.bin", 0x0400, 0x0400, CRC(21399ace) SHA1(0ad49be2c9bdab2f9dc41c7348d1d4b4b769e3c4) )
907 ROM_END
908 
909 ROM_START( sos )
910 	ROM_REGION( 0x10000, "maincpu", 0 )
911 	ROM_LOAD( "sos.p1",       0x0000, 0x0800, CRC(f70bdafb) SHA1(e71d552ccc9adad48225bdb4d62c31c5741a3e95) )
912 	ROM_LOAD( "sos.p2",       0x0800, 0x0800, CRC(58e9c480) SHA1(0eeb5982183d0e9f9dbae04839b604a0c22b420e) )
913 
914 	ROM_REGION( 0x800, "gfx1", 0 )
915 	ROM_LOAD( "sos.chr",      0x0000, 0x0800, CRC(66f983e4) SHA1(b3cf8bff4ac6b554d3fc06eeb8227b3b2a0dd554) )
916 ROM_END
917 
918 ROM_START( bombbee )
919 	ROM_REGION( 0x10000, "maincpu", 0 )
920 	ROM_LOAD( "bombbee.1k",   0x0000, 0x2000, CRC(9f8cd7af) SHA1(0d6e1ee5519660d1498eb7a093872ed5034423f2) )
921 
922 	ROM_REGION( 0x800, "gfx1", 0 )
923 	ROM_LOAD( "bombbee.4c",   0x0000, 0x0800, CRC(5f37d569) SHA1(d5e3fb4c5a1612a6e568c8970161b0290b88993f) )
924 ROM_END
925 
926 ROM_START( cutieq )
927 	ROM_REGION( 0x10000, "maincpu", 0 )
928 	ROM_LOAD( "cutieq.1k",    0x0000, 0x2000, CRC(6486cdca) SHA1(914c36487fba2dd57c3fd1f011b2225d2baac2bf) )
929 
930 	ROM_REGION( 0x800, "gfx1", 0 )
931 	ROM_LOAD( "cutieq.4c",    0x0000, 0x0800, CRC(0e1618c9) SHA1(456e9b3d6bae8b4af7778a38e4f40bb6736b0690) )
932 ROM_END
933 
934 ROM_START( warpwarp )
935 	ROM_REGION( 0x10000, "maincpu", 0 )
936 	ROM_LOAD( "ww1_prg1.s10", 0x0000, 0x1000, CRC(f5262f38) SHA1(1c64d0282b0a209390a548ceeaaf8b7b55e50896) )
937 	ROM_LOAD( "ww1_prg2.s8",  0x1000, 0x1000, CRC(de8355dd) SHA1(133d137711d79aaeb45cd3ee041c0be3b73e1b2f) )
938 	ROM_LOAD( "ww1_prg3.s4",  0x2000, 0x1000, CRC(bdd1dec5) SHA1(bb3d9d1500e31bb271a394facaec7adc3c987e5e) )
939 
940 	ROM_REGION( 0x800, "gfx1", 0 )
941 	ROM_LOAD( "ww1_chg1.s12", 0x0000, 0x0800, CRC(380994c8) SHA1(0cdf6a05db52c423365bff9c9df6d93ac885794e) )
942 ROM_END
943 
944 ROM_START( warpwarpr )
945 	ROM_REGION( 0x10000, "maincpu", 0 )
946 	ROM_LOAD( "g-09601.2r",   0x0000, 0x1000, CRC(916ffa35) SHA1(bca2087f8b78a128cdffc55db9814854b72daab5) )
947 	ROM_LOAD( "g-09602.2m",   0x1000, 0x1000, CRC(398bb87b) SHA1(74373336288dc13d59e6f7e7c718aa51d857b087) )
948 	ROM_LOAD( "g-09603.1p",   0x2000, 0x1000, CRC(6b962fc4) SHA1(0291d0c574a1048e52121ca57e01098bff04da40) )
949 	ROM_LOAD( "g-09613.1t",   0x3000, 0x0800, CRC(60a67e76) SHA1(af65e7bf16a5e69fee05c0134e3b8d5bca142402) )
950 
951 	ROM_REGION( 0x800, "gfx1", 0 )
952 	ROM_LOAD( "g-9611.4c",    0x0000, 0x0800, CRC(00e6a326) SHA1(67b7ab5b7b2c9a97d4d690d88561da48b86bc66e) )
953 ROM_END
954 
955 ROM_START( warpwarpr2 )
956 	ROM_REGION( 0x10000, "maincpu", 0 )
957 	ROM_LOAD( "g-09601.2r",   0x0000, 0x1000, CRC(916ffa35) SHA1(bca2087f8b78a128cdffc55db9814854b72daab5) )
958 	ROM_LOAD( "g-09602.2m",   0x1000, 0x1000, CRC(398bb87b) SHA1(74373336288dc13d59e6f7e7c718aa51d857b087) )
959 	ROM_LOAD( "g-09603.1p",   0x2000, 0x1000, CRC(6b962fc4) SHA1(0291d0c574a1048e52121ca57e01098bff04da40) )
960 	ROM_LOAD( "g-09612.1t",   0x3000, 0x0800, CRC(b91e9e79) SHA1(378323d83c550b3acabc83dba946ab089b9195cb) )
961 
962 	ROM_REGION( 0x800, "gfx1", 0 )
963 	ROM_LOAD( "g-9611.4c",    0x0000, 0x0800, CRC(00e6a326) SHA1(67b7ab5b7b2c9a97d4d690d88561da48b86bc66e) )
964 ROM_END
965 
966 
967 
968 void warpwarp_state::init_geebee()
969 {
970 	m_handle_joystick = 0;
971 
972 	m_ball_pen = 1;
973 	m_ball_sizex = 4;
974 	m_ball_sizey = 4;
975 }
976 
init_navarone()977 void warpwarp_state::init_navarone()
978 {
979 	m_handle_joystick = 1;
980 
981 	m_ball_pen = 1;
982 	m_ball_sizex = 4;
983 	m_ball_sizey = 4;
984 }
985 
init_kaitein()986 void warpwarp_state::init_kaitein()
987 {
988 	m_handle_joystick = 1;
989 
990 	m_ball_pen = 8;
991 	m_ball_sizex = 1;
992 	m_ball_sizey = 16;
993 }
994 
init_kaitei()995 void warpwarp_state::init_kaitei()
996 {
997 	m_handle_joystick = 0;
998 
999 	m_ball_pen = 8;
1000 	m_ball_sizex = 1;
1001 	m_ball_sizey = 16;
1002 }
1003 
init_sos()1004 void warpwarp_state::init_sos()
1005 {
1006 	m_handle_joystick = 1;
1007 
1008 	m_ball_pen = 0;
1009 	m_ball_sizex = 4;
1010 	m_ball_sizey = 2;
1011 }
1012 
init_bombbee()1013 void warpwarp_state::init_bombbee()
1014 {
1015 	m_handle_joystick = 0;
1016 
1017 	m_ball_pen = 0x200;
1018 	m_ball_sizex = 4;
1019 	m_ball_sizey = 4;
1020 }
1021 
init_warpwarp()1022 void warpwarp_state::init_warpwarp()
1023 {
1024 	m_handle_joystick = 1;
1025 
1026 	m_ball_pen = 0x200;
1027 	m_ball_sizex = 4;
1028 	m_ball_sizey = 4;
1029 }
1030 
1031 
1032 /* B & W games */
1033 GAMEL( 1978, geebee,     0,        geebee,   geebee,    warpwarp_state, init_geebee,   ROT90, "Namco", "Gee Bee (Japan)", MACHINE_SUPPORTS_SAVE, layout_geebee )
1034 GAMEL( 1978, geebeea,    geebee,   geebeeb,  geebeeb,   warpwarp_state, init_geebee,   ROT90, "Namco (Alca license)", "Gee Bee (UK)", MACHINE_SUPPORTS_SAVE, layout_geebee )
1035 GAMEL( 1978, geebeeb,    geebee,   geebeeb,  geebeeb,   warpwarp_state, init_geebee,   ROT90, "Namco (F.lli Bertolino license)", "Gee Bee (Europe)", MACHINE_SUPPORTS_SAVE, layout_geebee ) // Fratelli Bertolino
1036 GAMEL( 1978, geebeeg,    geebee,   geebee,   geebee,    warpwarp_state, init_geebee,   ROT90, "Namco (Gremlin license)", "Gee Bee (US)", MACHINE_SUPPORTS_SAVE, layout_geebee )
1037 
1038 GAME(  1979, sos,        0,        sos,      sos,       warpwarp_state, init_sos,      ROT90, "K.K. Tokki (Namco license)", "SOS Game", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
1039 GAMEL( 1980, navarone,   0,        navarone, navarone,  warpwarp_state, init_navarone, ROT90, "Namco", "Navarone", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_navarone )
1040 GAME(  1980, kaitein,    kaitei,   kaitei,   kaitein,   warpwarp_state, init_kaitein,  ROT90, "K.K. Tokki (Namco license)", "Kaitei Takara Sagashi (Namco license)", MACHINE_SUPPORTS_SAVE ) // pretty sure it didn't have a color overlay
1041 GAME(  1980, kaitei,     0,        kaitei,   kaitei,    warpwarp_state, init_kaitei,   ROT90, "K.K. Tokki", "Kaitei Takara Sagashi", MACHINE_SUPPORTS_SAVE ) // " - aka "Atrantis"
1042 
1043 /* Color games */
1044 GAME(  1979, bombbee,    0,        bombbee,  bombbee,   warpwarp_state, init_bombbee,  ROT90, "Namco", "Bomb Bee", MACHINE_SUPPORTS_SAVE )
1045 GAME(  1979, cutieq,     0,        bombbee,  cutieq,    warpwarp_state, init_bombbee,  ROT90, "Namco", "Cutie Q", MACHINE_SUPPORTS_SAVE )
1046 GAME(  1981, warpwarp,   0,        warpwarp, warpwarp,  warpwarp_state, init_warpwarp, ROT90, "Namco", "Warp & Warp", MACHINE_SUPPORTS_SAVE )
1047 GAME(  1981, warpwarpr,  warpwarp, warpwarp, warpwarpr, warpwarp_state, init_warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 1)", MACHINE_SUPPORTS_SAVE )
1048 GAME(  1981, warpwarpr2, warpwarp, warpwarp, warpwarpr, warpwarp_state, init_warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 2)", MACHINE_SUPPORTS_SAVE )
1049