mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
temp until I have time to do it better (nw)
This commit is contained in:
parent
bba01405e6
commit
9e12a48a8c
@ -228,7 +228,7 @@ WRITE16_MEMBER( cninja_state::sshangha_protection_region_8_146_w )
|
||||
int real_address = 0x1a0000 + (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( deco146_addr, data, mem_mask, cs );
|
||||
m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
|
||||
}
|
||||
|
||||
READ16_MEMBER( cninja_state::sshangha_protection_region_6_146_r )
|
||||
@ -258,7 +258,7 @@ WRITE16_MEMBER( cninja_state::sshangha_protection_region_6_146_w )
|
||||
int real_address = 0x198000 + (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( deco146_addr, data, mem_mask, cs );
|
||||
m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( edrandy_map, AS_PROGRAM, 16, cninja_state )
|
||||
@ -347,7 +347,7 @@ WRITE16_MEMBER( cninja_state::mutantf_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( deco146_addr, data, mem_mask, cs );
|
||||
m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,7 +165,7 @@ WRITE16_MEMBER( sshangha_state::sshangha_protection_region_d_146_w )
|
||||
int real_address = 0x3f4000 + (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( deco146_addr, data, mem_mask, cs );
|
||||
m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
|
||||
}
|
||||
|
||||
READ16_MEMBER( sshangha_state::sshangha_protection_region_8_146_r )
|
||||
@ -182,7 +182,7 @@ WRITE16_MEMBER( sshangha_state::sshangha_protection_region_8_146_w )
|
||||
int real_address = 0x3e0000 + (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( deco146_addr, data, mem_mask, cs );
|
||||
m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1091,7 +1091,7 @@ UINT16 reorder(UINT16 input, UINT8 *weights)
|
||||
/* there are probably less dumb ways of doing the CS logic, it could be hooked up
|
||||
more like the system16 mapper chips */
|
||||
|
||||
void deco146_device::write_data(UINT16 address, UINT16 data, UINT16 mem_mask, UINT8 &csflags)
|
||||
void deco146_device::write_data(address_space &space, UINT16 address, UINT16 data, UINT16 mem_mask, UINT8 &csflags)
|
||||
{
|
||||
csflags = 0;
|
||||
int upper_addr_bits = (address & 0x7800) >> 11;
|
||||
@ -1126,7 +1126,7 @@ void deco146_device::write_data(UINT16 address, UINT16 data, UINT16 mem_mask, UI
|
||||
if (i==0) // the first cs is our internal protection area
|
||||
{
|
||||
logerror("write matches cs table (protection) %01x %04x %04x %04x\n", i, real_address, data, mem_mask);
|
||||
write_protport(real_address, data, mem_mask);
|
||||
write_protport(space, real_address, data, mem_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1156,6 +1156,13 @@ UINT16 deco146_device::read_input_c_callback(void)
|
||||
return ioport(":DSW")->read();
|
||||
}
|
||||
|
||||
void deco146_device::soundlatch_write_callback(address_space &space, UINT16 data, UINT16 mem_mask)
|
||||
{
|
||||
driver_device *drvstate = machine().driver_data<driver_device>();
|
||||
drvstate->soundlatch_byte_w(space, 0, data & 0xff);
|
||||
cpu_device* cpudev = (cpu_device*)machine().device(":audiocpu");
|
||||
if (cpudev) cpudev->set_input_line(0, HOLD_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1252,7 +1259,7 @@ UINT16 deco146_device::read_protport(UINT16 address, UINT16 mem_mask)
|
||||
return realret;
|
||||
}
|
||||
|
||||
void deco146_device::write_protport(UINT16 address, UINT16 data, UINT16 mem_mask)
|
||||
void deco146_device::write_protport(address_space &space, UINT16 address, UINT16 data, UINT16 mem_mask)
|
||||
{
|
||||
m_latchaddr = address;
|
||||
m_latchdata = data;
|
||||
@ -1272,6 +1279,7 @@ void deco146_device::write_protport(UINT16 address, UINT16 data, UINT16 mem_mask
|
||||
{
|
||||
logerror("LOAD SOUND LATCH %04x %04x\n", data, mem_mask);
|
||||
COMBINE_DATA(&m_soundlatch);
|
||||
soundlatch_write_callback(space, data, mem_mask);
|
||||
}
|
||||
|
||||
// always store
|
||||
|
@ -10,7 +10,7 @@ class deco146_device : public device_t
|
||||
public:
|
||||
deco146_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
void write_data(UINT16 address, UINT16 data, UINT16 mem_mask, UINT8 &csflags);
|
||||
void write_data(address_space &space, UINT16 address, UINT16 data, UINT16 mem_mask, UINT8 &csflags);
|
||||
UINT16 read_data(UINT16 address, UINT16 mem_mask, UINT8 &csflags);
|
||||
|
||||
protected:
|
||||
@ -19,16 +19,18 @@ protected:
|
||||
virtual void device_reset();
|
||||
|
||||
UINT16 read_protport(UINT16 address, UINT16 mem_mask);
|
||||
void write_protport(UINT16 address, UINT16 data, UINT16 mem_mask);
|
||||
void write_protport(address_space &space, UINT16 address, UINT16 data, UINT16 mem_mask);
|
||||
|
||||
UINT16 m_rambank0[0x80];
|
||||
UINT16 m_rambank1[0x80];
|
||||
|
||||
UINT16* m_current_rambank;
|
||||
|
||||
// set these up as actual callbacks!
|
||||
UINT16 read_input_a_callback(void);
|
||||
UINT16 read_input_b_callback(void);
|
||||
UINT16 read_input_c_callback(void);
|
||||
void soundlatch_write_callback(address_space &space, UINT16 data, UINT16 mem_mask);
|
||||
|
||||
UINT16 m_nand;
|
||||
UINT16 m_xor;
|
||||
|
Loading…
Reference in New Issue
Block a user