From 076b0f7f7d9f68dfab6d8a7da5a12b5b2961340d Mon Sep 17 00:00:00 2001 From: David Haywood Date: Sun, 21 Jul 2013 10:16:46 +0000 Subject: [PATCH] pump stadium hero 96 through generic 146 code. --- src/mame/drivers/deco_mlc.c | 22 +++++++++++++++++++- src/mame/includes/deco_mlc.h | 5 +++++ src/mame/machine/deco146.c | 40 +++++++----------------------------- src/mame/machine/deco146.h | 7 ++++--- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c index 88ff823700a..000a651a8c8 100644 --- a/src/mame/drivers/deco_mlc.c +++ b/src/mame/drivers/deco_mlc.c @@ -272,6 +272,25 @@ WRITE32_MEMBER( deco_mlc_state::mlc_spriteram_w ) COMBINE_DATA(&m_mlc_spriteram[offset]); } } + +READ16_MEMBER( deco_mlc_state::sh96_protection_region_0_146_r ) +{ + int real_address = 0 + (offset *2); + int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; + UINT8 cs = 0; + UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + return data; +} + +WRITE16_MEMBER( deco_mlc_state::sh96_protection_region_0_146_w ) +{ + int real_address = 0 + (offset *2); + int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; + UINT8 cs = 0; + m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); +} + + /******************************************************************************/ static ADDRESS_MAP_START( decomlc_map, AS_PROGRAM, 32, deco_mlc_state ) @@ -294,7 +313,7 @@ static ADDRESS_MAP_START( decomlc_map, AS_PROGRAM, 32, deco_mlc_state ) AM_RANGE(0x044001c, 0x044001f) AM_READWRITE(mlc_44001c_r, mlc_44001c_w) AM_MIRROR(0xff000000) AM_RANGE(0x0500000, 0x0500003) AM_WRITE(avengrs_eprom_w) AM_MIRROR(0xff000000) AM_RANGE(0x0600000, 0x0600007) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0xff000000) AM_MIRROR(0xff000000) - AM_RANGE(0x070f000, 0x070ffff) AM_DEVREADWRITE("ioprot", deco146_device, stadhr96_prot_146_r, stadhr96_prot_146_w) AM_MIRROR(0xff000000) + AM_RANGE(0x070f000, 0x070ffff) AM_READWRITE16(sh96_protection_region_0_146_r, sh96_protection_region_0_146_w, 0xffff0000) AM_MIRROR(0xff000000) ADDRESS_MAP_END /******************************************************************************/ @@ -453,6 +472,7 @@ static MACHINE_CONFIG_START( mlc, deco_mlc_state ) MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc) MCFG_DECO146_ADD("ioprot") + MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/includes/deco_mlc.h b/src/mame/includes/deco_mlc.h index 0b3d24f7cc4..e4e5329a533 100644 --- a/src/mame/includes/deco_mlc.h +++ b/src/mame/includes/deco_mlc.h @@ -65,4 +65,9 @@ public: void descramble_sound( ); required_device m_maincpu; required_device m_eeprom; + + DECLARE_READ16_MEMBER( sh96_protection_region_0_146_r ); + DECLARE_WRITE16_MEMBER( sh96_protection_region_0_146_w ); }; + + diff --git a/src/mame/machine/deco146.c b/src/mame/machine/deco146.c index 6ef08855bce..d222994ec75 100644 --- a/src/mame/machine/deco146.c +++ b/src/mame/machine/deco146.c @@ -1314,7 +1314,14 @@ void deco_146_base_device::device_config_complete() +UINT16 deco_146_base_device::port_dummy_cb(int unused) +{ + return 0x00; +} +void deco_146_base_device::soundlatch_dummy(address_space &space, UINT16 data, UINT16 mem_mask) +{ +} UINT16 deco_146_base_device::port_a_default(int unused) { @@ -1508,39 +1515,6 @@ READ32_MEMBER(deco_146_base_device::dragngun_prot_r) } -READ32_MEMBER(deco_146_base_device::stadhr96_prot_146_r) -{ - /* - cpu #0 (PC=00041BD0): unmapped program memory dword write to 00708004 = 000F0000 & FFFFFFFF - cpu #0 (PC=00041BFC): unmapped program memory dword write to 0070F0C8 = 00028800 & FFFFFFFF - cpu #0 (PC=00041C08): unmapped program memory dword write to 0070F010 = 00081920 & FFFFFFFF - cpu #0 (PC=00041C14): unmapped program memory dword write to 0070F020 = 00040960 & FFFFFFFF - cpu #0 (PC=00041C20): unmapped program memory dword write to 0070F03C = 5A5A5A5A & FFFFFFFF - */ - offset<<=1; - - - if (offset==0x5c4) - return 0xaa55 << 16; - if (offset==0x7a4) - return 0x0001 << 16; // "2" makes OUT count to add by 2. - if (offset==0x53c) - return 0x0008 << 16; - if (offset==0x304) - return 0x0001 << 16; // Unknown, is either 0,1,2,3 - - printf("%08x: Read prot %08x\n", space.device().safe_pc(), offset); - - return 0; -} - -WRITE32_MEMBER(deco_146_base_device::stadhr96_prot_146_w) -{ - printf("%08x: Write prot %04x %08x\n", space.device().safe_pc(), offset, data); -} - - - const device_type DECO146PROT = &device_creator; // 104 will probably use this too, once we have real tables for it! diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h index c9883bd0fc5..9e7699359ae 100644 --- a/src/mame/machine/deco146.h +++ b/src/mame/machine/deco146.h @@ -18,6 +18,7 @@ typedef device_delegate