pump stadium hero 96 through generic 146 code.

This commit is contained in:
David Haywood 2013-07-21 10:16:46 +00:00
parent 7f348409f9
commit 076b0f7f7d
4 changed files with 37 additions and 37 deletions

View File

@ -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")

View File

@ -65,4 +65,9 @@ public:
void descramble_sound( );
required_device<cpu_device> m_maincpu;
required_device<eeprom_device> m_eeprom;
DECLARE_READ16_MEMBER( sh96_protection_region_0_146_r );
DECLARE_WRITE16_MEMBER( sh96_protection_region_0_146_w );
};

View File

@ -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<deco146_device>;
// 104 will probably use this too, once we have real tables for it!

View File

@ -18,6 +18,7 @@ typedef device_delegate<void (address_space &space, UINT16 data, UINT16 mem_mask
#define MCFG_DECO146_SET_SOUNDLATCH_CALLBACK( _class, _method) \
deco_146_base_device::set_soundlatch_cb(*device, deco146_port_write_cb(&_class::_method, #_class "::" #_method, NULL, (_class *)0));
// there are some standard ways the chip gets hooked up, so have them here ready to use
#define MCFG_DECO146_SET_INTERFACE_SCRAMBLE( a9,a8,a7,a6,a5,a4,a3,a2,a1,a0 ) \
deco_146_base_device::set_interface_scramble(*device, a9,a8,a7,a6,a5,a4,a3,a2,a1,a0);
@ -57,8 +58,7 @@ public:
DECLARE_READ32_MEMBER(captaven_prot_r);
DECLARE_READ16_MEMBER(lemmings_prot_r);
DECLARE_READ16_MEMBER(robocop2_prot_r);
DECLARE_READ32_MEMBER(stadhr96_prot_146_r);
DECLARE_WRITE32_MEMBER(stadhr96_prot_146_w);
deco146_port_read_cb m_port_a_r;
deco146_port_read_cb m_port_b_r;
@ -68,8 +68,9 @@ public:
UINT16 port_a_default(int unused);
UINT16 port_b_default(int unused);
UINT16 port_c_default(int unused);
UINT16 port_dummy_cb(int unused);
void soundlatch_default(address_space &space, UINT16 data, UINT16 mem_mask);
void soundlatch_dummy(address_space &space, UINT16 data, UINT16 mem_mask);
UINT8 m_bankswitch_swap_read_address;
UINT16 m_magic_read_address_xor;