273
static WRITE16_HANDLER( midres_sound_w )
273
WRITE16_MEMBER(dec0_state::midres_sound_w)
275
275
if (ACCESSING_BITS_0_7)
277
soundlatch_w(space, 0, data & 0xff);
278
cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
277
soundlatch_byte_w(space, 0, data & 0xff);
278
cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
282
282
/******************************************************************************/
284
static ADDRESS_MAP_START( dec0_map, AS_PROGRAM, 16 )
284
static ADDRESS_MAP_START( dec0_map, AS_PROGRAM, 16, dec0_state )
285
285
AM_RANGE(0x000000, 0x05ffff) AM_ROM
286
AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_0_w) /* text layer */
287
AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_1_w)
288
AM_RANGE(0x242000, 0x24207f) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
289
AM_RANGE(0x242400, 0x2427ff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
286
AM_RANGE(0x240000, 0x240007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w) /* text layer */
287
AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
288
AM_RANGE(0x242000, 0x24207f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
289
AM_RANGE(0x242400, 0x2427ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
290
290
AM_RANGE(0x242800, 0x243fff) AM_RAM /* Robocop only */
291
AM_RANGE(0x244000, 0x245fff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
293
AM_RANGE(0x246000, 0x246007) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_0_w) /* first tile layer */
294
AM_RANGE(0x246010, 0x246017) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_1_w)
295
AM_RANGE(0x248000, 0x24807f) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
296
AM_RANGE(0x248400, 0x2487ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
297
AM_RANGE(0x24a000, 0x24a7ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
299
AM_RANGE(0x24c000, 0x24c007) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_0_w) /* second tile layer */
300
AM_RANGE(0x24c010, 0x24c017) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_1_w)
301
AM_RANGE(0x24c800, 0x24c87f) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
302
AM_RANGE(0x24cc00, 0x24cfff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
303
AM_RANGE(0x24d000, 0x24d7ff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
291
AM_RANGE(0x244000, 0x245fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
293
AM_RANGE(0x246000, 0x246007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w) /* first tile layer */
294
AM_RANGE(0x246010, 0x246017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
295
AM_RANGE(0x248000, 0x24807f) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
296
AM_RANGE(0x248400, 0x2487ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
297
AM_RANGE(0x24a000, 0x24a7ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
299
AM_RANGE(0x24c000, 0x24c007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w) /* second tile layer */
300
AM_RANGE(0x24c010, 0x24c017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
301
AM_RANGE(0x24c800, 0x24c87f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
302
AM_RANGE(0x24cc00, 0x24cfff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
303
AM_RANGE(0x24d000, 0x24d7ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
305
305
AM_RANGE(0x300000, 0x30001f) AM_READ(dec0_rotary_r)
306
306
AM_RANGE(0x30c000, 0x30c00b) AM_READ(dec0_controls_r)
307
307
AM_RANGE(0x30c010, 0x30c01f) AM_WRITE(dec0_control_w) /* Priority, sound, etc. */
308
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(dec0_paletteram_rg_w) AM_BASE_GENERIC(paletteram)
309
AM_RANGE(0x314000, 0x3147ff) AM_RAM_WRITE(dec0_paletteram_b_w) AM_BASE_GENERIC(paletteram2)
310
AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_BASE_MEMBER(dec0_state, m_ram) /* Main ram */
311
AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_BASE_MEMBER(dec0_state, m_spriteram) /* Sprites */
308
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(dec0_paletteram_rg_w) AM_SHARE("paletteram")
309
AM_RANGE(0x314000, 0x3147ff) AM_RAM_WRITE(dec0_paletteram_b_w) AM_SHARE("paletteram2")
310
AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_SHARE("ram") /* Main ram */
311
AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_SHARE("spriteram") /* Sprites */
314
static ADDRESS_MAP_START( robocop_sub_map, AS_PROGRAM, 8 )
314
static ADDRESS_MAP_START( robocop_sub_map, AS_PROGRAM, 8, dec0_state )
315
315
AM_RANGE(0x000000, 0x00ffff) AM_ROM
316
316
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAM /* Main ram */
317
AM_RANGE(0x1f2000, 0x1f3fff) AM_RAM AM_BASE_MEMBER(dec0_state, m_robocop_shared_ram) /* Shared ram */
318
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
317
AM_RANGE(0x1f2000, 0x1f3fff) AM_RAM AM_SHARE("robocop_shared") /* Shared ram */
318
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
321
static ADDRESS_MAP_START( hippodrm_sub_map, AS_PROGRAM, 8 )
321
static ADDRESS_MAP_START( hippodrm_sub_map, AS_PROGRAM, 8, dec0_state )
322
322
AM_RANGE(0x000000, 0x00ffff) AM_ROM
323
323
AM_RANGE(0x180000, 0x1800ff) AM_READWRITE(hippodrm_shared_r, hippodrm_shared_w)
324
AM_RANGE(0x1a0000, 0x1a0007) AM_DEVWRITE("tilegen3", deco_bac06_pf_control0_8bit_packed_w)
325
AM_RANGE(0x1a0010, 0x1a001f) AM_DEVWRITE("tilegen3", deco_bac06_pf_control1_8bit_swap_w)
326
AM_RANGE(0x1a1000, 0x1a17ff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
324
AM_RANGE(0x1a0000, 0x1a0007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control0_8bit_packed_w)
325
AM_RANGE(0x1a0010, 0x1a001f) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control1_8bit_swap_w)
326
AM_RANGE(0x1a1000, 0x1a17ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
327
327
AM_RANGE(0x1d0000, 0x1d00ff) AM_READWRITE(hippodrm_prot_r, hippodrm_prot_w)
328
328
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") /* Main ram */
329
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
329
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
330
330
AM_RANGE(0x1ff402, 0x1ff403) AM_READ_PORT("VBLANK")
335
READ16_HANDLER( slyspy_controls_r )
335
READ16_MEMBER(dec0_state::slyspy_controls_r)
337
337
switch (offset<<1)
339
339
case 0: /* Dip Switches */
340
return input_port_read(space->machine(), "DSW");
340
return ioport("DSW")->read();
342
342
case 2: /* Player 1 & Player 2 joysticks & fire buttons */
343
return input_port_read(space->machine(), "INPUTS");
343
return ioport("INPUTS")->read();
345
345
case 4: /* Credits */
346
return input_port_read(space->machine(), "SYSTEM");
346
return ioport("SYSTEM")->read();
349
349
logerror("Unknown control read at 30c000 %d\n", offset);
353
READ16_HANDLER( slyspy_protection_r )
353
READ16_MEMBER(dec0_state::slyspy_protection_r)
355
355
/* These values are for Boulderdash, I have no idea what they do in Slyspy */
356
356
switch (offset<<1) {
498
static ADDRESS_MAP_START( slyspy_map, AS_PROGRAM, 16 )
496
static ADDRESS_MAP_START( slyspy_map, AS_PROGRAM, 16, dec0_state )
499
497
AM_RANGE(0x000000, 0x05ffff) AM_ROM
501
499
/* The location of p1 & pf2 can change in the 240000 - 24ffff region according to protection */
503
501
/* Pf3 is unaffected by protection */
504
AM_RANGE(0x300000, 0x300007) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_0_w)
505
AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_1_w)
506
AM_RANGE(0x300800, 0x30087f) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
507
AM_RANGE(0x300c00, 0x300fff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
508
AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
502
AM_RANGE(0x300000, 0x300007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w)
503
AM_RANGE(0x300010, 0x300017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
504
AM_RANGE(0x300800, 0x30087f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
505
AM_RANGE(0x300c00, 0x300fff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
506
AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
510
AM_RANGE(0x304000, 0x307fff) AM_RAM AM_BASE_MEMBER(dec0_state, m_ram) /* Sly spy main ram */
511
AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_BASE_MEMBER(dec0_state, m_spriteram) /* Sprites */
512
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
508
AM_RANGE(0x304000, 0x307fff) AM_RAM AM_SHARE("ram") /* Sly spy main ram */
509
AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_SHARE("spriteram") /* Sprites */
510
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
513
511
AM_RANGE(0x314000, 0x314003) AM_WRITE(slyspy_control_w)
514
512
AM_RANGE(0x314008, 0x31400f) AM_READ(slyspy_controls_r)
515
513
AM_RANGE(0x31c000, 0x31c00f) AM_READ(slyspy_protection_r) AM_WRITENOP
519
static ADDRESS_MAP_START( midres_map, AS_PROGRAM, 16 )
517
static ADDRESS_MAP_START( midres_map, AS_PROGRAM, 16, dec0_state )
520
518
AM_RANGE(0x000000, 0x07ffff) AM_ROM
521
AM_RANGE(0x100000, 0x103fff) AM_RAM AM_BASE_MEMBER(dec0_state, m_ram)
522
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_MEMBER(dec0_state, m_spriteram)
523
AM_RANGE(0x140000, 0x1407ff) AM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
519
AM_RANGE(0x100000, 0x103fff) AM_RAM AM_SHARE("ram")
520
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_SHARE("spriteram")
521
AM_RANGE(0x140000, 0x1407ff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
524
522
AM_RANGE(0x160000, 0x160001) AM_WRITE(dec0_priority_w)
525
523
AM_RANGE(0x180000, 0x18000f) AM_READ(midres_controls_r)
526
524
AM_RANGE(0x180008, 0x18000f) AM_WRITENOP /* ?? watchdog ?? */
527
525
AM_RANGE(0x1a0000, 0x1a0001) AM_WRITE(midres_sound_w)
529
AM_RANGE(0x200000, 0x200007) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_0_w)
530
AM_RANGE(0x200010, 0x200017) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_1_w)
531
AM_RANGE(0x220000, 0x2207ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
532
AM_RANGE(0x220800, 0x220fff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w) /* mirror address used in end sequence */
533
AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
534
AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
536
AM_RANGE(0x280000, 0x280007) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_0_w)
537
AM_RANGE(0x280010, 0x280017) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_1_w)
538
AM_RANGE(0x2a0000, 0x2a07ff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
539
AM_RANGE(0x2c0000, 0x2c007f) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
540
AM_RANGE(0x2c0400, 0x2c07ff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
542
AM_RANGE(0x300000, 0x300007) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_0_w)
543
AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_1_w)
544
AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
545
AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
546
AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
527
AM_RANGE(0x200000, 0x200007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w)
528
AM_RANGE(0x200010, 0x200017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
529
AM_RANGE(0x220000, 0x2207ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
530
AM_RANGE(0x220800, 0x220fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w) /* mirror address used in end sequence */
531
AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
532
AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
534
AM_RANGE(0x280000, 0x280007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w)
535
AM_RANGE(0x280010, 0x280017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
536
AM_RANGE(0x2a0000, 0x2a07ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
537
AM_RANGE(0x2c0000, 0x2c007f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
538
AM_RANGE(0x2c0400, 0x2c07ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
540
AM_RANGE(0x300000, 0x300007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)
541
AM_RANGE(0x300010, 0x300017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
542
AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
543
AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
544
AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
548
546
AM_RANGE(0x320000, 0x321fff) AM_RAM
551
549
/******************************************************************************/
553
static ADDRESS_MAP_START( dec0_s_map, AS_PROGRAM, 8 )
551
static ADDRESS_MAP_START( dec0_s_map, AS_PROGRAM, 8, dec0_state )
554
552
AM_RANGE(0x0000, 0x05ff) AM_RAM
555
AM_RANGE(0x0800, 0x0801) AM_DEVWRITE("ym1", ym2203_w)
556
AM_RANGE(0x1000, 0x1001) AM_DEVWRITE("ym2", ym3812_w)
557
AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)
558
AM_RANGE(0x3800, 0x3800) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
553
AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
554
AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3812_w)
555
AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r)
556
AM_RANGE(0x3800, 0x3800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
559
557
AM_RANGE(0x8000, 0xffff) AM_ROM
562
560
/* Physical memory map (21 bits) */
563
static ADDRESS_MAP_START( slyspy_s_map, AS_PROGRAM, 8 )
561
static ADDRESS_MAP_START( slyspy_s_map, AS_PROGRAM, 8, dec0_state )
564
562
AM_RANGE(0x000000, 0x00ffff) AM_ROM
565
AM_RANGE(0x090000, 0x090001) AM_DEVWRITE("ym2", ym3812_w)
563
AM_RANGE(0x090000, 0x090001) AM_DEVWRITE_LEGACY("ym2", ym3812_w)
566
564
AM_RANGE(0x0a0000, 0x0a0001) AM_READNOP /* Protection counter */
567
AM_RANGE(0x0b0000, 0x0b0001) AM_DEVWRITE("ym1", ym2203_w)
568
AM_RANGE(0x0e0000, 0x0e0001) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
569
AM_RANGE(0x0f0000, 0x0f0001) AM_READ(soundlatch_r)
565
AM_RANGE(0x0b0000, 0x0b0001) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
566
AM_RANGE(0x0e0000, 0x0e0001) AM_DEVREADWRITE("oki", okim6295_device, read, write)
567
AM_RANGE(0x0f0000, 0x0f0001) AM_READ(soundlatch_byte_r)
570
568
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8")
571
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
569
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
574
static ADDRESS_MAP_START( midres_s_map, AS_PROGRAM, 8 )
572
static ADDRESS_MAP_START( midres_s_map, AS_PROGRAM, 8, dec0_state )
575
573
AM_RANGE(0x000000, 0x00ffff) AM_ROM
576
AM_RANGE(0x108000, 0x108001) AM_DEVWRITE("ym2", ym3812_w)
577
AM_RANGE(0x118000, 0x118001) AM_DEVWRITE("ym1", ym2203_w)
578
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
579
AM_RANGE(0x138000, 0x138001) AM_READ(soundlatch_r)
574
AM_RANGE(0x108000, 0x108001) AM_DEVWRITE_LEGACY("ym2", ym3812_w)
575
AM_RANGE(0x118000, 0x118001) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
576
AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki", okim6295_device, read, write)
577
AM_RANGE(0x138000, 0x138001) AM_READ(soundlatch_byte_r)
580
578
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8")
581
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
579
AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE_LEGACY(h6280_irq_status_w)
588
static ADDRESS_MAP_START( secretab_map, AS_PROGRAM, 16 )
586
static ADDRESS_MAP_START( secretab_map, AS_PROGRAM, 16, dec0_state )
589
587
AM_RANGE(0x000000, 0x05ffff) AM_ROM
590
AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_0_w)
591
AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_1_w)
592
AM_RANGE(0x246000, 0x247fff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
593
// AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
594
// AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
588
AM_RANGE(0x240000, 0x240007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w)
589
AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
590
AM_RANGE(0x246000, 0x247fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
591
// AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
592
// AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
596
// AM_RANGE(0x200000, 0x300007) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_0_w)
597
// AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_1_w)
598
AM_RANGE(0x24e000, 0x24ffff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
599
// AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
600
// AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
594
// AM_RANGE(0x200000, 0x300007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)
595
// AM_RANGE(0x300010, 0x300017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
596
AM_RANGE(0x24e000, 0x24ffff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
597
// AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
598
// AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
602
600
AM_RANGE(0x314008, 0x31400f) AM_READ(slyspy_controls_r)
603
601
// AM_RANGE(0x314000, 0x314003) AM_WRITE(slyspy_control_w)
605
AM_RANGE(0x300000, 0x300007) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_0_w)
606
AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_1_w)
607
AM_RANGE(0x300800, 0x30087f) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
608
AM_RANGE(0x300c00, 0x300fff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
609
AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
610
AM_RANGE(0x301800, 0x307fff) AM_RAM AM_BASE_MEMBER(dec0_state, m_ram) /* Sly spy main ram */
611
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
612
AM_RANGE(0xb08000, 0xb087ff) AM_RAM AM_BASE_MEMBER(dec0_state, m_spriteram) /* Sprites */
603
AM_RANGE(0x300000, 0x300007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w)
604
AM_RANGE(0x300010, 0x300017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
605
AM_RANGE(0x300800, 0x30087f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
606
AM_RANGE(0x300c00, 0x300fff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
607
AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
608
AM_RANGE(0x301800, 0x307fff) AM_RAM AM_SHARE("ram") /* Sly spy main ram */
609
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
610
AM_RANGE(0xb08000, 0xb087ff) AM_RAM AM_SHARE("spriteram") /* Sprites */
616
static ADDRESS_MAP_START( automat_map, AS_PROGRAM, 16 )
614
static ADDRESS_MAP_START( automat_map, AS_PROGRAM, 16, dec0_state )
617
615
AM_RANGE(0x000000, 0x05ffff) AM_ROM
619
AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_0_w) /* text layer */
620
AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_pf_control_1_w)
621
AM_RANGE(0x242000, 0x24207f) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
622
AM_RANGE(0x242400, 0x2427ff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
617
AM_RANGE(0x240000, 0x240007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w) /* text layer */
618
AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
619
AM_RANGE(0x242000, 0x24207f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
620
AM_RANGE(0x242400, 0x2427ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
623
621
AM_RANGE(0x242800, 0x243fff) AM_RAM /* Robocop only */
624
AM_RANGE(0x244000, 0x245fff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
626
AM_RANGE(0x246000, 0x246007) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_0_w) /* first tile layer */
627
AM_RANGE(0x246010, 0x246017) AM_DEVWRITE("tilegen2", deco_bac06_pf_control_1_w)
628
AM_RANGE(0x248000, 0x24807f) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
629
AM_RANGE(0x248400, 0x2487ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
630
AM_RANGE(0x24a000, 0x24a7ff) AM_DEVREADWRITE("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
632
AM_RANGE(0x24c000, 0x24c007) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_0_w) /* second tile layer */
633
AM_RANGE(0x24c010, 0x24c017) AM_DEVWRITE("tilegen3", deco_bac06_pf_control_1_w)
634
AM_RANGE(0x24c800, 0x24c87f) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
635
AM_RANGE(0x24cc00, 0x24cfff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
636
AM_RANGE(0x24d000, 0x24d7ff) AM_DEVREADWRITE("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
622
AM_RANGE(0x244000, 0x245fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
624
AM_RANGE(0x246000, 0x246007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w) /* first tile layer */
625
AM_RANGE(0x246010, 0x246017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
626
AM_RANGE(0x248000, 0x24807f) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
627
AM_RANGE(0x248400, 0x2487ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
628
AM_RANGE(0x24a000, 0x24a7ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
630
AM_RANGE(0x24c000, 0x24c007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w) /* second tile layer */
631
AM_RANGE(0x24c010, 0x24c017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
632
AM_RANGE(0x24c800, 0x24c87f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
633
AM_RANGE(0x24cc00, 0x24cfff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
634
AM_RANGE(0x24d000, 0x24d7ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
638
636
AM_RANGE(0x300000, 0x30001f) AM_READ(dec0_rotary_r)
639
637
AM_RANGE(0x30c000, 0x30c00b) AM_READ(dec0_controls_r)
640
638
AM_RANGE(0x30c000, 0x30c01f) AM_WRITE(automat_control_w) /* Priority, sound, etc. */
641
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
639
AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
642
640
AM_RANGE(0x314000, 0x3147ff) AM_RAM
643
641
AM_RANGE(0x400008, 0x400009) AM_WRITE(dec0_priority_w) // NEW
644
AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_BASE_MEMBER(dec0_state, m_ram) /* Main ram */
645
AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_BASE_MEMBER(dec0_state, m_spriteram) /* Sprites */
642
AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_SHARE("ram") /* Main ram */
643
AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_SHARE("spriteram") /* Sprites */
648
static WRITE8_HANDLER( automat_adpcm_w )
646
WRITE8_MEMBER(dec0_state::automat_adpcm_w)
650
dec0_state *state = space->machine().driver_data<dec0_state>();
651
state->m_automat_adpcm_byte = data;
648
m_automat_adpcm_byte = data;
654
static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8 )
651
static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8, dec0_state )
655
652
AM_RANGE(0xc000, 0xc7ff) AM_RAM
656
// AM_RANGE(0xc800, 0xc800) AM_WRITE(ym2203_control_port_0_w)
657
// AM_RANGE(0xc801, 0xc801) AM_WRITE(ym2203_write_port_0_w)
658
AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r)
659
// AM_RANGE(0xd000, 0xd000) AM_WRITE(ym2203_control_port_1_w)
660
// AM_RANGE(0xd001, 0xd001) AM_WRITE(ym2203_write_port_1_w)
653
// AM_RANGE(0xc800, 0xc800) AM_WRITE_LEGACY(ym2203_control_port_0_w)
654
// AM_RANGE(0xc801, 0xc801) AM_WRITE_LEGACY(ym2203_write_port_0_w)
655
AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r)
656
// AM_RANGE(0xd000, 0xd000) AM_WRITE_LEGACY(ym2203_control_port_1_w)
657
// AM_RANGE(0xd001, 0xd001) AM_WRITE_LEGACY(ym2203_write_port_1_w)
661
658
AM_RANGE(0xf000, 0xf000) AM_WRITE(automat_adpcm_w)
662
659
AM_RANGE(0x0000, 0xffff) AM_ROM
665
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8 )
662
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, dec0_state )
666
663
ADDRESS_MAP_UNMAP_HIGH
667
664
AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(dec0_mcu_port_r, dec0_mcu_port_w)
1877
1874
ROM_LOAD( "eg08.2c", 0x0000, 0x10000, CRC(92f2c916) SHA1(38b4ed81edcc2069b096591bdc5baab8b9edfa9a) ) // different to baddudes
1877
ROM_START( drgninjab )
1878
ROM_REGION( 0x60000, "maincpu", 0 ) /* 6*64k for 68000 code, middle 0x20000 unused */
1879
ROM_LOAD16_BYTE( "n-12.d2", 0x00000, 0x10000, CRC(5a70eb52) SHA1(26fd48ea71cd5196e3907eebcf1234f44a3d7dba) )
1880
ROM_LOAD16_BYTE( "n-11.a2", 0x00001, 0x10000, CRC(3887eb92) SHA1(a8650ce128927955497540d7c6fbd23516afdb24) )
1881
ROM_LOAD16_BYTE( "eg06.6c", 0x40000, 0x10000, CRC(2b81faf7) SHA1(6d10c29f5ee06856843d83e77ba24c2b6e00a9cb) )
1882
ROM_LOAD16_BYTE( "eg03.6a", 0x40001, 0x10000, CRC(c52c2e9d) SHA1(399f2b7df9d558c8f33bf1a7c8048c62e0f54cec) )
1884
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
1885
ROM_LOAD( "eg07.8a", 0x8000, 0x8000, CRC(001d2f51) SHA1(f186671f0450ccf9201577a5caf0efc490c6645e) )
1887
ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 microcontroller */
1888
ROM_LOAD( "i8751", 0x0000, 0x1000, NO_DUMP )
1890
/* various graphic and sound roms also differ when compared to baddudes */
1892
ROM_REGION( 0x10000, "gfx1", 0 ) /* chars */
1893
//ROM_LOAD( "drgninja.25", 0x00000, 0x08000, CRC(6791bc20) SHA1(7240b2688cda04ee9ea331472a84fbffc85b8e90) )
1894
// the rom below was found on a genuine 'dragonninja' pcb, compared to the other ROM it has the 'bad dudes' (unused) logo
1895
// partially erased, and a bad pixel on the left arrow character. Is the other rom a cleaned up hack, or from a bootleg,
1896
// or did Data East actually clean it up on a later PCB?
1897
ROM_LOAD( "eg25.15j", 0x00000, 0x08000, CRC(dd557b19) SHA1(ce1e76aeb7e147f373bb48dbc1becc1601953499) ) // different to baddudes
1898
ROM_LOAD( "eg26.16j", 0x08000, 0x08000, CRC(5d75fc8f) SHA1(92947dd78bfe8067fb5f645fa1ef212e48b69c70) ) // different to baddudes
1900
ROM_REGION( 0x40000, "gfx2", 0 ) /* tiles */
1901
ROM_LOAD( "eg18.14d", 0x00000, 0x10000, CRC(05cfc3e5) SHA1(a0163921c77dc9706463a402c3dd45ec4341cd21) )
1902
ROM_LOAD( "eg20.17d", 0x10000, 0x10000, CRC(e11e988f) SHA1(0c59f0d8d1abe414c7e1ebd49d454179fed2cd00) )
1903
ROM_LOAD( "eg22.14f", 0x20000, 0x10000, CRC(b893d880) SHA1(99e228174677f2e3e96154f77bfa9bf0f1c0a6a5) )
1904
ROM_LOAD( "eg24.17f", 0x30000, 0x10000, CRC(6f226dda) SHA1(65ebb16a292c57d49c135fce7ed7537146226eb5) )
1906
ROM_REGION( 0x20000, "gfx3", 0 ) /* tiles */
1907
ROM_LOAD( "eg30.9j", 0x08000, 0x08000, CRC(2438e67e) SHA1(5f143aeb83606a2c64d0b31bfee38156d231dcc9) )
1908
ROM_CONTINUE( 0x00000, 0x08000 ) /* the two halves are swapped */
1909
ROM_LOAD( "eg28.9f", 0x18000, 0x08000, CRC(5c692ab3) SHA1(4c58ff50833f869575f1a15c776fbf1429944fab) )
1910
ROM_CONTINUE( 0x10000, 0x08000 )
1912
ROM_REGION( 0x80000, "gfx4", 0 ) /* sprites */
1913
ROM_LOAD( "eg15.16c", 0x00000, 0x10000, CRC(5617d67f) SHA1(8f684de27ae79c4d35720706cdd2733af0e0a9cc) ) // different to baddudes
1914
ROM_LOAD( "eg16.17c", 0x10000, 0x08000, CRC(17e42633) SHA1(405f5296a741901677cca978a1b287d894eb1e54) )
1915
ROM_LOAD( "eg11.16a", 0x20000, 0x10000, CRC(ba83e8d8) SHA1(63092a5d0da0c9228a72a83b43a67a47b1388724) ) // different to baddudes
1916
ROM_LOAD( "eg12.17a", 0x30000, 0x08000, CRC(fea2a134) SHA1(525dd5f48993db1fe1e3c095442884178f75e8e0) )
1917
ROM_LOAD( "eg13.13c", 0x40000, 0x10000, CRC(fd91e08e) SHA1(8998f020791c8830e963096dc7b8fcb430d041d4) ) // different to baddudes
1918
ROM_LOAD( "eg14.14c", 0x50000, 0x08000, CRC(e83c760a) SHA1(d08db381658b8b3288c5eaa9048a906126e0f712) )
1919
ROM_LOAD( "eg09.13a", 0x60000, 0x10000, CRC(601b7b23) SHA1(c1c665614f1377bc47720382b25c965266a2593f)) // different to baddudes
1920
ROM_LOAD( "eg10.14a", 0x70000, 0x08000, CRC(eeee8a1a) SHA1(2bf8378ff38f6a7c7cbd4cbd489de25cb1f0fe71) )
1922
ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
1923
ROM_LOAD( "eg08.2c", 0x0000, 0x10000, CRC(92f2c916) SHA1(38b4ed81edcc2069b096591bdc5baab8b9edfa9a) ) // different to baddudes
1880
1926
ROM_START( birdtry )
1881
1927
ROM_REGION( 0x60000, "maincpu", 0 ) /* 6*64k for 68000 code */
1882
1928
ROM_LOAD16_BYTE( "ek-04.bin", 0x00000, 0x10000, CRC(5f0f4686) SHA1(5eea74f5626339ebd50e623029f21f1cd0f93135) )