summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2019-03-31 12:11:41 +0900
committer cam900 <dbtlrchl@naver.com>2019-03-31 12:11:41 +0900
commitfa34d8cd31518d9affaafe315ac5987b9a79fde6 (patch)
tree40cc60a57cc7f709a51c94d41246172aaa148631
parentd684b0d0f36883f0110a1b3f7a0af43863436247 (diff)
deco146.cpp : Simplify handlers, Reduce some unnecessary lines
-rw-r--r--src/mame/drivers/boogwing.cpp2
-rw-r--r--src/mame/drivers/cninja.cpp8
-rw-r--r--src/mame/drivers/dblewing.cpp2
-rw-r--r--src/mame/drivers/deco32.cpp4
-rw-r--r--src/mame/drivers/deco_mlc.cpp2
-rw-r--r--src/mame/drivers/dietgo.cpp2
-rw-r--r--src/mame/drivers/dreambal.cpp2
-rw-r--r--src/mame/drivers/funkyjet.cpp2
-rw-r--r--src/mame/drivers/lemmings.cpp2
-rw-r--r--src/mame/drivers/pktgaldx.cpp2
-rw-r--r--src/mame/drivers/rohga.cpp2
-rw-r--r--src/mame/drivers/sshangha.cpp4
-rw-r--r--src/mame/machine/deco146.cpp20
-rw-r--r--src/mame/machine/deco146.h6
14 files changed, 24 insertions, 36 deletions
diff --git a/src/mame/drivers/boogwing.cpp b/src/mame/drivers/boogwing.cpp
index 177c93873d8..9e6b2a8f006 100644
--- a/src/mame/drivers/boogwing.cpp
+++ b/src/mame/drivers/boogwing.cpp
@@ -112,7 +112,7 @@ WRITE16_MEMBER( boogwing_state::boogwing_protection_region_0_104_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco104->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco104->write_data( deco146_addr, data, mem_mask, cs );
}
WRITE16_MEMBER( boogwing_state::priority_w )
diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp
index a2b6418ac47..e3b80fb429e 100644
--- a/src/mame/drivers/cninja.cpp
+++ b/src/mame/drivers/cninja.cpp
@@ -77,7 +77,7 @@ WRITE16_MEMBER( cninja_state::cninja_protection_region_0_104_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_ioprot->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_ioprot->write_data( deco146_addr, data, mem_mask, cs );
}
READ16_MEMBER(cninja_state::cninjabl2_sprite_dma_r)
@@ -159,7 +159,7 @@ WRITE16_MEMBER( cninja_state::edrandy_protection_region_8_146_w )
int real_address = 0x1a0000 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_ioprot->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_ioprot->write_data( deco146_addr, data, mem_mask, cs );
}
READ16_MEMBER( cninja_state::edrandy_protection_region_6_146_r )
@@ -186,7 +186,7 @@ WRITE16_MEMBER( cninja_state::edrandy_protection_region_6_146_w )
int real_address = 0x198000 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_ioprot->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_ioprot->write_data( deco146_addr, data, mem_mask, cs );
}
void cninja_state::edrandy_map(address_map &map)
@@ -268,7 +268,7 @@ WRITE16_MEMBER( cninja_state::mutantf_protection_region_0_146_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_ioprot->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_ioprot->write_data( deco146_addr, data, mem_mask, cs );
}
READ16_MEMBER( cninja_state::mutantf_71_r )
diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp
index c38f2a3f567..819b40f0201 100644
--- a/src/mame/drivers/dblewing.cpp
+++ b/src/mame/drivers/dblewing.cpp
@@ -168,7 +168,7 @@ WRITE16_MEMBER( dblewing_state::wf_protection_region_0_104_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco104->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco104->write_data( deco146_addr, data, mem_mask, cs );
}
WRITE_LINE_MEMBER( dblewing_state::soundlatch_irq_w )
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp
index 7d20995e28a..75237bc39ef 100644
--- a/src/mame/drivers/deco32.cpp
+++ b/src/mame/drivers/deco32.cpp
@@ -709,7 +709,7 @@ WRITE16_MEMBER( deco32_state::ioprot_w )
offs_t deco146_addr = bitswap<32>(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_t cs = 0;
- m_ioprot->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_ioprot->write_data( deco146_addr, data, mem_mask, cs );
}
@@ -788,7 +788,7 @@ WRITE_LINE_MEMBER( nslasher_state::tattass_sound_irq_w )
{
if (state)
{
- uint8_t data = m_ioprot->soundlatch_r(machine().dummy_space(), 0);
+ uint8_t data = m_ioprot->soundlatch_r();
// Swap bits 0 and 3 to correct for design error from BSMT schematic
data = bitswap<8>(data, 7, 6, 5, 4, 0, 2, 1, 3);
m_decobsmt->bsmt_comms_w(machine().dummy_space(), 0, data);
diff --git a/src/mame/drivers/deco_mlc.cpp b/src/mame/drivers/deco_mlc.cpp
index b3639af5000..d8801dc5e11 100644
--- a/src/mame/drivers/deco_mlc.cpp
+++ b/src/mame/drivers/deco_mlc.cpp
@@ -288,7 +288,7 @@ WRITE16_MEMBER( deco_mlc_state::sh96_protection_region_0_146_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco146->write_data( deco146_addr, data, mem_mask, cs );
}
diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp
index 656aa5e8d18..5b2d2167a51 100644
--- a/src/mame/drivers/dietgo.cpp
+++ b/src/mame/drivers/dietgo.cpp
@@ -48,7 +48,7 @@ WRITE16_MEMBER( dietgo_state::dietgo_protection_region_0_104_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco104->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco104->write_data( deco146_addr, data, mem_mask, cs );
}
diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp
index 6040f329c5f..371ceae12b5 100644
--- a/src/mame/drivers/dreambal.cpp
+++ b/src/mame/drivers/dreambal.cpp
@@ -112,7 +112,7 @@ WRITE16_MEMBER( dreambal_state::dreambal_protection_region_0_104_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco104->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco104->write_data( deco146_addr, data, mem_mask, cs );
}
void dreambal_state::dreambal_map(address_map &map)
diff --git a/src/mame/drivers/funkyjet.cpp b/src/mame/drivers/funkyjet.cpp
index 00d81fe3716..3a538d9c7d9 100644
--- a/src/mame/drivers/funkyjet.cpp
+++ b/src/mame/drivers/funkyjet.cpp
@@ -125,7 +125,7 @@ WRITE16_MEMBER( funkyjet_state::funkyjet_protection_region_0_146_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, /* note, same bitswap as fghthist */ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) & 0x7fff;
uint8_t cs = 0;
- m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco146->write_data( deco146_addr, data, mem_mask, cs );
}
diff --git a/src/mame/drivers/lemmings.cpp b/src/mame/drivers/lemmings.cpp
index 1d845cab76d..5b7a75070b1 100644
--- a/src/mame/drivers/lemmings.cpp
+++ b/src/mame/drivers/lemmings.cpp
@@ -57,7 +57,7 @@ WRITE16_MEMBER( lemmings_state::lem_protection_region_0_146_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco146->write_data( deco146_addr, data, mem_mask, cs );
}
diff --git a/src/mame/drivers/pktgaldx.cpp b/src/mame/drivers/pktgaldx.cpp
index 1c757dc4336..00e244d5ee2 100644
--- a/src/mame/drivers/pktgaldx.cpp
+++ b/src/mame/drivers/pktgaldx.cpp
@@ -88,7 +88,7 @@ WRITE16_MEMBER( pktgaldx_state::pktgaldx_protection_region_f_104_w )
{
int real_address = 0 + (offset *2);
uint8_t cs = 0;
- m_deco104->write_data( space, real_address&0x7fff, data, mem_mask, cs );
+ m_deco104->write_data( real_address&0x7fff, data, mem_mask, cs );
}
WRITE_LINE_MEMBER( pktgaldx_state::vblank_w )
diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp
index 00b983b2e0a..4667d3e6e50 100644
--- a/src/mame/drivers/rohga.cpp
+++ b/src/mame/drivers/rohga.cpp
@@ -155,7 +155,7 @@ WRITE16_MEMBER( rohga_state::ioprot_w )
int real_address = 0 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_ioprot->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_ioprot->write_data( deco146_addr, data, mem_mask, cs );
}
diff --git a/src/mame/drivers/sshangha.cpp b/src/mame/drivers/sshangha.cpp
index f69005d99a4..3550995dc79 100644
--- a/src/mame/drivers/sshangha.cpp
+++ b/src/mame/drivers/sshangha.cpp
@@ -134,7 +134,7 @@ WRITE16_MEMBER( sshangha_state::sshangha_protection_region_d_146_w )
int real_address = 0x3f4000 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco146->write_data( deco146_addr, data, mem_mask, cs );
}
READ16_MEMBER( sshangha_state::sshangha_protection_region_8_146_r )
@@ -151,7 +151,7 @@ WRITE16_MEMBER( sshangha_state::sshangha_protection_region_8_146_w )
int real_address = 0x3e0000 + (offset *2);
int deco146_addr = bitswap<32>(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_t cs = 0;
- m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
+ m_deco146->write_data( deco146_addr, data, mem_mask, cs );
}
/*
diff --git a/src/mame/machine/deco146.cpp b/src/mame/machine/deco146.cpp
index 4aa055f76e9..5a8afab01c9 100644
--- a/src/mame/machine/deco146.cpp
+++ b/src/mame/machine/deco146.cpp
@@ -1136,11 +1136,10 @@ inline uint16_t reorder(uint16_t input, uint8_t const *weights)
}
-
/* there are probably less dumb ways of doing the CS logic, it could be hooked up
more like the system16 mapper chips */
-void deco_146_base_device::write_data(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags)
+void deco_146_base_device::write_data(uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags)
{
address = bitswap<16>(address>>1, 15,14,13,12,11,10, m_external_addrswap[9],m_external_addrswap[8] ,m_external_addrswap[7],m_external_addrswap[6],m_external_addrswap[5],m_external_addrswap[4],m_external_addrswap[3],m_external_addrswap[2],m_external_addrswap[1],m_external_addrswap[0]) << 1;
@@ -1177,7 +1176,7 @@ void deco_146_base_device::write_data(address_space &space, uint16_t address, 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(space, real_address, data, mem_mask);
+ write_protport(real_address, data, mem_mask);
}
else
{
@@ -1193,10 +1192,6 @@ void deco_146_base_device::write_data(address_space &space, uint16_t address, ui
}
-
-
-
-
uint16_t deco_146_base_device::read_protport(uint16_t address, uint16_t mem_mask)
{
// if we read the last written address immediately after then ignore all other logic and just return what was written unmodified
@@ -1214,11 +1209,6 @@ uint16_t deco_146_base_device::read_protport(uint16_t address, uint16_t mem_mask
int location = 0;
uint16_t realret = read_data_getloc(address, location);
-
-
-
-
-
if (location == m_bankswitch_swap_read_address) // this has a special meaning
{
// logerror("(bankswitch) %04x %04x\n", address, mem_mask);
@@ -1239,7 +1229,7 @@ TIMER_CALLBACK_MEMBER(deco_146_base_device::write_soundlatch)
m_soundlatch_irq_cb(ASSERT_LINE);
}
-void deco_146_base_device::write_protport(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask)
+void deco_146_base_device::write_protport(uint16_t address, uint16_t data, uint16_t mem_mask)
{
m_latchaddr = address;
m_latchdata = data;
@@ -1270,7 +1260,6 @@ void deco_146_base_device::write_protport(address_space &space, uint16_t address
}
-
uint16_t deco_146_base_device::read_data(uint16_t address, uint16_t mem_mask, uint8_t &csflags)
{
address = bitswap<16>(address>>1, 15,14,13,12,11,10, m_external_addrswap[9],m_external_addrswap[8] ,m_external_addrswap[7],m_external_addrswap[6],m_external_addrswap[5],m_external_addrswap[4],m_external_addrswap[3],m_external_addrswap[2],m_external_addrswap[1],m_external_addrswap[0]) << 1;
@@ -1316,7 +1305,7 @@ uint16_t deco_146_base_device::read_data(uint16_t address, uint16_t mem_mask, ui
return retdata;
}
-READ8_MEMBER( deco_146_base_device::soundlatch_r )
+u8 deco_146_base_device::soundlatch_r()
{
m_soundlatch_irq_cb(CLEAR_LINE);
return m_soundlatch;
@@ -1430,7 +1419,6 @@ uint16_t deco_146_base_device::read_data_getloc(uint16_t address, int& location)
}
-
DEFINE_DEVICE_TYPE(DECO146PROT, deco146_device, "deco146", "DECO 146 Protection")
diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h
index 98ce422948a..64bdaf9c2f5 100644
--- a/src/mame/machine/deco146.h
+++ b/src/mame/machine/deco146.h
@@ -50,7 +50,7 @@ struct deco146port_xx
class deco_146_base_device : public device_t
{
public:
- void write_data(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags);
+ void write_data(uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags);
uint16_t read_data(uint16_t address, uint16_t mem_mask, uint8_t &csflags);
auto port_a_cb() { return m_port_a_r.bind(); }
@@ -77,7 +77,7 @@ public:
auto soundlatch_irq_cb() { return m_soundlatch_irq_cb.bind(); }
- DECLARE_READ8_MEMBER( soundlatch_r );
+ u8 soundlatch_r();
devcb_read16 m_port_a_r;
devcb_read16 m_port_b_r;
@@ -101,7 +101,7 @@ protected:
virtual void device_reset() override;
uint16_t read_protport(uint16_t address, uint16_t mem_mask);
- virtual void write_protport(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask);
+ virtual void write_protport(uint16_t address, uint16_t data, uint16_t mem_mask);
virtual uint16_t read_data_getloc(uint16_t address, int& location);
uint16_t m_rambank0[0x80];