From f256410ae9dade65ac2ab99add1f55ae569c2c78 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Sun, 21 Jul 2013 10:57:16 +0000 Subject: [PATCH] robocop2 (nw) --- src/mame/drivers/cninja.c | 15 ++++++++++----- src/mame/machine/deco146.c | 22 +--------------------- src/mame/machine/deco146.h | 2 +- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c index e546913cc44..e0fa4a0fa3c 100644 --- a/src/mame/drivers/cninja.c +++ b/src/mame/drivers/cninja.c @@ -310,9 +310,12 @@ static ADDRESS_MAP_START( robocop2_map, AS_PROGRAM, 16, cninja_state ) AM_RANGE(0x180000, 0x1807ff) AM_RAM AM_SHARE("spriteram") // AM_RANGE(0x18c000, 0x18c0ff) AM_WRITE(cninja_loopback_w) /* Protection writes */ - AM_RANGE(0x18c000, 0x18c7ff) AM_DEVREAD("ioprot", deco146_device,robocop2_prot_r) /* Protection device */ - AM_RANGE(0x18c064, 0x18c065) AM_WRITE(cninja_sound_w) - AM_RANGE(0x198000, 0x198001) AM_DEVWRITE("spriteram", buffered_spriteram16_device, write) /* DMA flag */ +// AM_RANGE(0x18c000, 0x18c7ff) AM_DEVREAD("ioprot", deco146_device,robocop2_prot_r) /* Protection device */ +// AM_RANGE(0x18c064, 0x18c065) AM_WRITE(cninja_sound_w) + AM_RANGE(0x18c000, 0x18ffff) AM_READWRITE(mutantf_protection_region_0_146_r,mutantf_protection_region_0_146_w)AM_SHARE("prot16ram") /* Protection device */ + + +AM_RANGE(0x198000, 0x198001) AM_DEVWRITE("spriteram", buffered_spriteram16_device, write) /* DMA flag */ AM_RANGE(0x1a8000, 0x1a9fff) AM_RAM_DEVWRITE("deco_common", decocomn_device, nonbuffered_palette_w) AM_SHARE("paletteram") AM_RANGE(0x1b0000, 0x1b0007) AM_READWRITE(cninja_irq_r, cninja_irq_w) AM_RANGE(0x1b8000, 0x1bbfff) AM_RAM AM_SHARE("ram") /* Main ram */ @@ -558,7 +561,7 @@ static INPUT_PORTS_START( cninjau ) INPUT_PORTS_END static INPUT_PORTS_START( robocop2 ) - PORT_START("IN0") + PORT_START("INPUTS") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) @@ -576,7 +579,7 @@ static INPUT_PORTS_START( robocop2 ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) - PORT_START("IN1") + PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -1191,6 +1194,8 @@ static MACHINE_CONFIG_START( robocop2, cninja_state ) decospr_device::set_pri_callback(*device, cninja_pri_callback); MCFG_DECO146_ADD("ioprot") + MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR + /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/machine/deco146.c b/src/mame/machine/deco146.c index 69c94bf9328..f572e3b63e5 100644 --- a/src/mame/machine/deco146.c +++ b/src/mame/machine/deco146.c @@ -1432,35 +1432,15 @@ void deco_146_base_device::device_reset() currently used by - Robocop 2 Lemmings - Dragon Gun* is this really 146? Captain America - Stadium Hero 96* not used for inputs, just some fixed return data based on the writes! ***************************************************************************************************** ***************************************************************************************************** ***************************************************************************************************** ****************************************************************************************************/ -// alt read addresses (same as nitroball if you reverse lnes) -READ16_MEMBER(deco_146_base_device::robocop2_prot_r) -{ - switch (offset << 1) - { - case 0x41a: /* Player 1 & 2 input ports */ - return ioport(":IN0")->read(); - case 0x320: /* Coins */ - return ioport(":IN1")->read(); - case 0x4e6: /* Dip switches */ - return ioport(":DSW")->read(); - case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */ - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space.device().safe_pc(), offset); - return 0x84; - } - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space.device().safe_pc(), offset); - return 0; -} + // alt read addresses (same as nitroball if you reverse lnes) /* Same as Robocop 2 protection chip */ diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h index 5b8bf08b9ed..6af81c2b972 100644 --- a/src/mame/machine/deco146.h +++ b/src/mame/machine/deco146.h @@ -56,7 +56,7 @@ public: // legacy stuff DECLARE_READ32_MEMBER(captaven_prot_r); DECLARE_READ16_MEMBER(lemmings_prot_r); - DECLARE_READ16_MEMBER(robocop2_prot_r); + deco146_port_read_cb m_port_a_r;