151
151
/* B&W Games I/O */
152
static READ8_HANDLER( geebee_in_r )
152
READ8_MEMBER(warpwarp_state::geebee_in_r)
154
warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
156
155
static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" }; // "IN1" & "IN2" are read separately when offset==3
159
res = input_port_read_safe(space->machine(), portnames[offset], 0);
158
res = ioport(portnames[offset])->read_safe(0);
162
res = input_port_read(space->machine(), (flip_screen_get(space->machine()) & 1) ? "IN2" : "IN1"); // read player 2 input in cocktail mode
163
if (state->m_handle_joystick)
161
res = ioport((flip_screen() & 1) ? "IN2" : "IN1")->read(); // read player 2 input in cocktail mode
162
if (m_handle_joystick)
165
164
/* map digital two-way joystick to two fixed VOLIN values */
166
165
if (res & 2) return 0x9f;
174
static WRITE8_HANDLER( geebee_out6_w )
173
WRITE8_MEMBER(warpwarp_state::geebee_out6_w)
176
warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
177
175
switch (offset & 3)
180
state->m_ball_h = data;
183
state->m_ball_v = data;
189
geebee_sound_w(space->machine().device("geebee"),0,data);
187
geebee_sound_w(machine().device("geebee"),0,data);
194
static WRITE8_HANDLER( geebee_out7_w )
192
WRITE8_MEMBER(warpwarp_state::geebee_out7_w)
196
warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
197
194
switch (offset & 7)
200
set_led_status(space->machine(), 0,data & 1);
197
set_led_status(machine(), 0,data & 1);
203
set_led_status(space->machine(), 1,data & 1);
200
set_led_status(machine(), 1,data & 1);
206
set_led_status(space->machine(), 2,data & 1);
203
set_led_status(machine(), 2,data & 1);
209
coin_counter_w(space->machine(), 0,data & 1);
206
coin_counter_w(machine(), 0,data & 1);
212
if (strcmp(space->machine().system().name, "geebeeb"))
213
coin_lockout_global_w(space->machine(), ~data & 1);
209
if (strcmp(machine().system().name, "geebeeb"))
210
coin_lockout_global_w(machine(), ~data & 1);
216
if( state->m_geebee_bgw != (data & 1) )
217
space->machine().tilemap().mark_all_dirty();
218
state->m_geebee_bgw = data & 1;
213
if( m_geebee_bgw != (data & 1) )
214
machine().tilemap().mark_all_dirty();
215
m_geebee_bgw = data & 1;
221
state->m_ball_on = data & 1;
218
m_ball_on = data & 1;
223
cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
220
cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
226
flip_screen_set(space->machine(), data & 1);
223
flip_screen_set(data & 1);
232
229
/* Color Games I/O */
234
231
/* Read Switch Inputs */
235
static READ8_HANDLER( warpwarp_sw_r )
232
READ8_MEMBER(warpwarp_state::warpwarp_sw_r)
237
return (input_port_read(space->machine(), "IN0") >> (offset & 7)) & 1;
234
return (ioport("IN0")->read() >> (offset & 7)) & 1;
240
237
/* Read Dipswitches */
241
238
static READ8_DEVICE_HANDLER( warpwarp_dsw1_r )
243
return (input_port_read(device->machine(), "DSW1") >> (offset & 7)) & 1;
240
return (device->machine().root_device().ioport("DSW1")->read() >> (offset & 7)) & 1;
246
243
/* Read mux Controller Inputs */
284
static WRITE8_HANDLER( warpwarp_out3_w )
280
WRITE8_MEMBER(warpwarp_state::warpwarp_out3_w)
286
warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
287
282
switch (offset & 7)
290
set_led_status(space->machine(), 0,data & 1);
285
set_led_status(machine(), 0,data & 1);
293
set_led_status(space->machine(), 1,data & 1);
288
set_led_status(machine(), 1,data & 1);
296
set_led_status(space->machine(), 2,data & 1);
291
set_led_status(machine(), 2,data & 1);
302
coin_lockout_global_w(space->machine(), ~data & 1);
297
coin_lockout_global_w(machine(), ~data & 1);
305
coin_counter_w(space->machine(), 0,data & 1);
300
coin_counter_w(machine(), 0,data & 1);
308
state->m_ball_on = data & 1;
303
m_ball_on = data & 1;
310
cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
305
cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
313
flip_screen_set(space->machine(), data & 1);
308
flip_screen_set(data & 1);
320
static ADDRESS_MAP_START( geebee_map, AS_PROGRAM, 8 )
315
static ADDRESS_MAP_START( geebee_map, AS_PROGRAM, 8, warpwarp_state )
321
316
AM_RANGE(0x0000, 0x1fff) AM_ROM
322
AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x400) AM_RAM_WRITE(geebee_videoram_w) AM_BASE_MEMBER(warpwarp_state, m_geebee_videoram) // mirror used by kaitei due to a bug
317
AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x400) AM_RAM_WRITE(geebee_videoram_w) AM_SHARE("geebee_videoram") // mirror used by kaitei due to a bug
323
318
AM_RANGE(0x3000, 0x37ff) AM_ROM AM_REGION("gfx1", 0) // 3000-33ff in geebee
324
319
AM_RANGE(0x4000, 0x40ff) AM_RAM
325
320
AM_RANGE(0x5000, 0x53ff) AM_READ(geebee_in_r)
327
322
AM_RANGE(0x7000, 0x7fff) AM_WRITE(geebee_out7_w)
330
static ADDRESS_MAP_START( geebee_port_map, AS_IO, 8 )
325
static ADDRESS_MAP_START( geebee_port_map, AS_IO, 8, warpwarp_state )
331
326
AM_RANGE(0x50, 0x53) AM_READ(geebee_in_r)
332
327
AM_RANGE(0x60, 0x6f) AM_WRITE(geebee_out6_w)
333
328
AM_RANGE(0x70, 0x7f) AM_WRITE(geebee_out7_w)
337
static ADDRESS_MAP_START( bombbee_map, AS_PROGRAM, 8 )
332
static ADDRESS_MAP_START( bombbee_map, AS_PROGRAM, 8, warpwarp_state )
338
333
AM_RANGE(0x0000, 0x1fff) AM_ROM
339
334
AM_RANGE(0x2000, 0x23ff) AM_RAM
340
AM_RANGE(0x4000, 0x47ff) AM_RAM_WRITE(warpwarp_videoram_w) AM_BASE_MEMBER(warpwarp_state, m_videoram)
335
AM_RANGE(0x4000, 0x47ff) AM_RAM_WRITE(warpwarp_videoram_w) AM_SHARE("videoram")
341
336
AM_RANGE(0x4800, 0x4fff) AM_ROM AM_REGION("gfx1", 0)
342
337
AM_RANGE(0x6000, 0x600f) AM_READWRITE(warpwarp_sw_r, warpwarp_out0_w)
343
AM_RANGE(0x6010, 0x601f) AM_DEVREADWRITE("warpwarp", warpwarp_vol_r, warpwarp_music1_w)
344
AM_RANGE(0x6020, 0x602f) AM_DEVREADWRITE("warpwarp", warpwarp_dsw1_r, warpwarp_music2_w)
338
AM_RANGE(0x6010, 0x601f) AM_DEVREADWRITE_LEGACY("warpwarp", warpwarp_vol_r, warpwarp_music1_w)
339
AM_RANGE(0x6020, 0x602f) AM_DEVREADWRITE_LEGACY("warpwarp", warpwarp_dsw1_r, warpwarp_music2_w)
345
340
AM_RANGE(0x6030, 0x603f) AM_WRITE(warpwarp_out3_w)
348
static ADDRESS_MAP_START( warpwarp_map, AS_PROGRAM, 8 )
343
static ADDRESS_MAP_START( warpwarp_map, AS_PROGRAM, 8, warpwarp_state )
349
344
AM_RANGE(0x0000, 0x3fff) AM_ROM
350
345
AM_RANGE(0x8000, 0x83ff) AM_RAM
351
AM_RANGE(0x4000, 0x47ff) AM_RAM_WRITE(warpwarp_videoram_w) AM_BASE_MEMBER(warpwarp_state, m_videoram)
346
AM_RANGE(0x4000, 0x47ff) AM_RAM_WRITE(warpwarp_videoram_w) AM_SHARE("videoram")
352
347
AM_RANGE(0x4800, 0x4fff) AM_ROM AM_REGION("gfx1", 0)
353
348
AM_RANGE(0xc000, 0xc00f) AM_READWRITE(warpwarp_sw_r, warpwarp_out0_w)
354
AM_RANGE(0xc010, 0xc01f) AM_DEVREADWRITE("warpwarp", warpwarp_vol_r, warpwarp_music1_w)
355
AM_RANGE(0xc020, 0xc02f) AM_DEVREADWRITE("warpwarp", warpwarp_dsw1_r, warpwarp_music2_w)
349
AM_RANGE(0xc010, 0xc01f) AM_DEVREADWRITE_LEGACY("warpwarp", warpwarp_vol_r, warpwarp_music1_w)
350
AM_RANGE(0xc020, 0xc02f) AM_DEVREADWRITE_LEGACY("warpwarp", warpwarp_dsw1_r, warpwarp_music2_w)
356
351
AM_RANGE(0xc030, 0xc03f) AM_WRITE(warpwarp_out3_w)
384
379
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
385
380
PORT_DIPSETTING( 0x0c, DEF_STR( Free_Play ) )
386
381
PORT_DIPNAME( 0x30, 0x10, "Replay" ) PORT_DIPLOCATION("DSW2:5,6") // awards 1 credit
387
PORT_DIPSETTING( 0x10, "40k 80k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
388
PORT_DIPSETTING( 0x20, "70k 140k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
389
PORT_DIPSETTING( 0x30, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
390
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
391
PORT_DIPSETTING( 0x10, "60k 120k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
392
PORT_DIPSETTING( 0x20, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
393
PORT_DIPSETTING( 0x30, "150k 300k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
394
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
382
PORT_DIPSETTING( 0x10, "40k 80k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
383
PORT_DIPSETTING( 0x20, "70k 140k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
384
PORT_DIPSETTING( 0x30, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
385
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
386
PORT_DIPSETTING( 0x10, "60k 120k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
387
PORT_DIPSETTING( 0x20, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
388
PORT_DIPSETTING( 0x30, "150k 300k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
389
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
395
390
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
397
392
PORT_START("IN1")
407
402
PORT_MODIFY("DSW2")
408
403
PORT_DIPNAME( 0x30, 0x10, "Replay" ) // awards 1 credit
409
PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
410
PORT_DIPSETTING( 0x20, "70k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
411
PORT_DIPSETTING( 0x30, "100k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
412
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
413
PORT_DIPSETTING( 0x10, "60k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
414
PORT_DIPSETTING( 0x20, "100k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
415
PORT_DIPSETTING( 0x30, "150k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
416
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
404
PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
405
PORT_DIPSETTING( 0x20, "70k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
406
PORT_DIPSETTING( 0x30, "100k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
407
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
408
PORT_DIPSETTING( 0x10, "60k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
409
PORT_DIPSETTING( 0x20, "100k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
410
PORT_DIPSETTING( 0x30, "150k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
411
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
419
414
static INPUT_PORTS_START( navarone )
437
432
PORT_DIPSETTING( 0x00, "2" )
438
433
PORT_DIPSETTING( 0x02, "3" )
439
434
PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:3,4")
440
PORT_DIPSETTING( 0x04, "5000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
441
PORT_DIPSETTING( 0x08, "6000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
442
PORT_DIPSETTING( 0x0c, "7000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
443
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
444
PORT_DIPSETTING( 0x04, "6000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
445
PORT_DIPSETTING( 0x08, "7000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
446
PORT_DIPSETTING( 0x0c, "8000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
447
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
435
PORT_DIPSETTING( 0x04, "5000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
436
PORT_DIPSETTING( 0x08, "6000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
437
PORT_DIPSETTING( 0x0c, "7000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
438
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
439
PORT_DIPSETTING( 0x04, "6000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
440
PORT_DIPSETTING( 0x08, "7000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
441
PORT_DIPSETTING( 0x0c, "8000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
442
PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
448
443
PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW2:5,6")
449
444
PORT_DIPSETTING( 0x30, DEF_STR( 2C_1C ) )
450
445
PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) )
666
661
PORT_DIPSETTING( 0x08, "4" )
667
662
PORT_DIPSETTING( 0x0c, "5" )
668
663
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW1:5,6")
669
PORT_DIPSETTING( 0x00, "8k 30k 30k+" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
670
PORT_DIPSETTING( 0x10, "10k 40k 40k+" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
671
PORT_DIPSETTING( 0x20, "15k 60k 60k+" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
672
PORT_DIPSETTING(0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
673
PORT_DIPSETTING( 0x00, "30k" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
674
PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
675
PORT_DIPSETTING( 0x20, "60k" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
676
PORT_DIPSETTING( 0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
664
PORT_DIPSETTING( 0x00, "8k 30k 30k+" ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
665
PORT_DIPSETTING( 0x10, "10k 40k 40k+" ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
666
PORT_DIPSETTING( 0x20, "15k 60k 60k+" ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
667
PORT_DIPSETTING(0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
668
PORT_DIPSETTING( 0x00, "30k" ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
669
PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
670
PORT_DIPSETTING( 0x20, "60k" ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
671
PORT_DIPSETTING( 0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
677
672
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:7")
678
673
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
679
674
PORT_DIPSETTING( 0x00, DEF_STR( On ) )