summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/cps1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/cps1.cpp')
-rw-r--r--src/mame/drivers/cps1.cpp78
1 files changed, 40 insertions, 38 deletions
diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp
index 859d0d752a1..0c0df44b4a4 100644
--- a/src/mame/drivers/cps1.cpp
+++ b/src/mame/drivers/cps1.cpp
@@ -255,50 +255,50 @@ Stephh's log (2006.09.20) :
-READ16_MEMBER(cps_state::cps1_dsw_r)
+uint16_t cps_state::cps1_dsw_r(offs_t offset)
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
int in = ioport(dswname[offset])->read();
return (in << 8) | 0xff;
}
-READ16_MEMBER(cps_state::cps1_hack_dsw_r)
+uint16_t cps_state::cps1_hack_dsw_r(offs_t offset)
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
int in = ioport(dswname[offset])->read();
return (in << 8) | in;
}
-READ16_MEMBER(cps_state::cps1_in1_r)
+uint16_t cps_state::cps1_in1_r()
{
int in = ioport("IN1")->read();
return (in << 8) | in;
}
-READ16_MEMBER(cps_state::cps1_in2_r)
+uint16_t cps_state::cps1_in2_r()
{
int in = ioport("IN2")->read();
return (in << 8) | in;
}
-READ16_MEMBER(cps_state::cps1_in3_r)
+uint16_t cps_state::cps1_in3_r()
{
int in = ioport("IN3")->read();
return (in << 8) | in;
}
-WRITE8_MEMBER(cps_state::cps1_snd_bankswitch_w)
+void cps_state::cps1_snd_bankswitch_w(uint8_t data)
{
membank("bank1")->set_entry(data & 0x01);
}
-WRITE8_MEMBER(cps_state::cps1_oki_pin7_w)
+void cps_state::cps1_oki_pin7_w(uint8_t data)
{
m_oki->set_pin7(data & 1);
}
-WRITE16_MEMBER(cps_state::cps1_soundlatch_w)
+void cps_state::cps1_soundlatch_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
m_soundlatch->write(data & 0xff);
@@ -306,13 +306,13 @@ WRITE16_MEMBER(cps_state::cps1_soundlatch_w)
m_soundlatch->write(data >> 8);
}
-WRITE16_MEMBER(cps_state::cps1_soundlatch2_w)
+void cps_state::cps1_soundlatch2_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
m_soundlatch2->write(data & 0xff);
}
-WRITE16_MEMBER(cps_state::cps1_coinctrl_w)
+void cps_state::cps1_coinctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_8_15)
{
@@ -325,7 +325,7 @@ WRITE16_MEMBER(cps_state::cps1_coinctrl_w)
}
}
-WRITE16_MEMBER(cps_state::cpsq_coinctrl2_w)
+void cps_state::cpsq_coinctrl2_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
{
@@ -382,7 +382,7 @@ void cps_state::cpu_space_map(address_map &map)
*
********************************************************************/
-READ16_MEMBER(cps_state::qsound_rom_r)
+uint16_t cps_state::qsound_rom_r(offs_t offset)
{
if (memregion("user1") != nullptr)
{
@@ -396,29 +396,29 @@ READ16_MEMBER(cps_state::qsound_rom_r)
}
}
-READ16_MEMBER(cps_state::qsound_sharedram1_r)
+uint16_t cps_state::qsound_sharedram1_r(offs_t offset)
{
return m_qsound_sharedram1[offset] | 0xff00;
}
-WRITE16_MEMBER(cps_state::qsound_sharedram1_w)
+void cps_state::qsound_sharedram1_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
m_qsound_sharedram1[offset] = data;
}
-READ16_MEMBER(cps_state::qsound_sharedram2_r)
+uint16_t cps_state::qsound_sharedram2_r(offs_t offset)
{
return m_qsound_sharedram2[offset] | 0xff00;
}
-WRITE16_MEMBER(cps_state::qsound_sharedram2_w)
+void cps_state::qsound_sharedram2_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
m_qsound_sharedram2[offset] = data;
}
-WRITE8_MEMBER(cps_state::qsound_banksw_w)
+void cps_state::qsound_banksw_w(uint8_t data)
{
/* Z80 bank register for music note data. It's odd that it isn't encrypted though. */
int bank = data & 0x0f;
@@ -13503,7 +13503,7 @@ ROM_START( sfzbch )
ROM_END
-READ16_MEMBER(cps_state::sf2rb_prot_r)
+uint16_t cps_state::sf2rb_prot_r(offs_t offset)
{
switch (offset)
{
@@ -13519,12 +13519,12 @@ READ16_MEMBER(cps_state::sf2rb_prot_r)
void cps_state::init_sf2rb()
{
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x2fffff, read16_delegate(*this, FUNC(cps_state::sf2rb_prot_r)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x2fffff, read16sm_delegate(*this, FUNC(cps_state::sf2rb_prot_r)));
init_cps1();
}
-READ16_MEMBER(cps_state::sf2rb2_prot_r)
+uint16_t cps_state::sf2rb2_prot_r(offs_t offset)
{
switch (offset)
{
@@ -13540,7 +13540,7 @@ READ16_MEMBER(cps_state::sf2rb2_prot_r)
void cps_state::init_sf2rb2()
{
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x2fffff, read16_delegate(*this, FUNC(cps_state::sf2rb2_prot_r)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x200000, 0x2fffff, read16sm_delegate(*this, FUNC(cps_state::sf2rb2_prot_r)));
init_cps1();
}
@@ -13550,7 +13550,8 @@ void cps_state::init_sf2ee()
/* This specific revision of SF2 has the CPS-B custom mapped at a different address. */
/* The mapping is handled by the PAL IOB2 on the B-board */
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x800140, 0x80017f);
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x8001c0, 0x8001ff, read16_delegate(*this, FUNC(cps_state::cps1_cps_b_r)), write16_delegate(*this, FUNC(cps_state::cps1_cps_b_w)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x8001c0, 0x8001ff, read16sm_delegate(*this, FUNC(cps_state::cps1_cps_b_r)));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x8001c0, 0x8001ff, write16s_delegate(*this, FUNC(cps_state::cps1_cps_b_w)));
init_cps1();
}
@@ -13558,7 +13559,8 @@ void cps_state::init_sf2ee()
void cps_state::init_sf2thndr()
{
/* This particular hack uses a modified B-board PAL which mirrors the CPS-B registers at an alternate address */
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x8001c0, 0x8001ff, read16_delegate(*this, FUNC(cps_state::cps1_cps_b_r)), write16_delegate(*this, FUNC(cps_state::cps1_cps_b_w)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x8001c0, 0x8001ff, read16sm_delegate(*this, FUNC(cps_state::cps1_cps_b_r)));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x8001c0, 0x8001ff, write16s_delegate(*this, FUNC(cps_state::cps1_cps_b_w)));
init_cps1();
}
@@ -13566,7 +13568,7 @@ void cps_state::init_sf2thndr()
void cps_state::init_sf2hack()
{
/* some SF2 hacks have some inputs wired to the LSB instead of MSB */
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x800018, 0x80001f, read16_delegate(*this, FUNC(cps_state::cps1_hack_dsw_r)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x800018, 0x80001f, read16sm_delegate(*this, FUNC(cps_state::cps1_hack_dsw_r)));
init_cps1();
}
@@ -13593,7 +13595,7 @@ void cps_state::init_sf2rk()
}
}
-READ16_MEMBER(cps_state::sf2dongb_prot_r)
+uint16_t cps_state::sf2dongb_prot_r(offs_t offset)
{
switch (offset)
{
@@ -13608,12 +13610,12 @@ READ16_MEMBER(cps_state::sf2dongb_prot_r)
void cps_state::init_sf2dongb()
{
// There is a hacked up Altera EP910PC-30 DIP in the 5f socket instead of a 4th EPROM
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x180000, 0x1fffff, read16_delegate(*this, FUNC(cps_state::sf2dongb_prot_r)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x180000, 0x1fffff, read16sm_delegate(*this, FUNC(cps_state::sf2dongb_prot_r)));
init_cps1();
}
-READ16_MEMBER(cps_state::sf2ceblp_prot_r)
+uint16_t cps_state::sf2ceblp_prot_r()
{
if (sf2ceblp_prot == 0x0)
return 0x1992;
@@ -13622,7 +13624,7 @@ READ16_MEMBER(cps_state::sf2ceblp_prot_r)
return 0xffff;
}
-WRITE16_MEMBER(cps_state::sf2ceblp_prot_w)
+void cps_state::sf2ceblp_prot_w(uint16_t data)
{
sf2ceblp_prot = data;
}
@@ -13630,8 +13632,8 @@ WRITE16_MEMBER(cps_state::sf2ceblp_prot_w)
void cps_state::init_sf2ceblp()
{
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x5762b0, 0x5762b1, write16_delegate(*this, FUNC(cps_state::sf2ceblp_prot_w)));
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x57A2b0, 0x57A2b1, read16_delegate(*this, FUNC(cps_state::sf2ceblp_prot_r)));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x5762b0, 0x5762b1, write16smo_delegate(*this, FUNC(cps_state::sf2ceblp_prot_w)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x57A2b0, 0x57A2b1, read16smo_delegate(*this, FUNC(cps_state::sf2ceblp_prot_r)));
init_cps1();
}
@@ -13730,7 +13732,7 @@ void cps_state::init_pang3()
init_pang3b();
}
-READ16_MEMBER(cps_state::ganbare_ram_r)
+uint16_t cps_state::ganbare_ram_r(offs_t offset, uint16_t mem_mask)
{
uint16_t result = 0xffff;
@@ -13742,7 +13744,7 @@ READ16_MEMBER(cps_state::ganbare_ram_r)
return result;
}
-WRITE16_MEMBER(cps_state::ganbare_ram_w)
+void cps_state::ganbare_ram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_mainram[offset]);
@@ -13755,10 +13757,10 @@ void cps_state::init_ganbare()
init_cps1();
/* ram is shared between the CPS work ram and the timekeeper ram */
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xff0000, 0xffffff, read16_delegate(*this, FUNC(cps_state::ganbare_ram_r)), write16_delegate(*this, FUNC(cps_state::ganbare_ram_w)));
+ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xff0000, 0xffffff, read16s_delegate(*this, FUNC(cps_state::ganbare_ram_r)), write16s_delegate(*this, FUNC(cps_state::ganbare_ram_w)));
}
-READ16_MEMBER(cps_state::dinohunt_sound_r)
+uint16_t cps_state::dinohunt_sound_r()
{
/*TODO: understand what's really going on here. According to MT05805;
"I think that the values written are only qsound leftovers (after a lot of 0xFF values,
@@ -13769,19 +13771,19 @@ READ16_MEMBER(cps_state::dinohunt_sound_r)
void cps_state::init_dinohunt()
{
// is this shared with the new sound hw?
- m_maincpu->space(AS_PROGRAM).install_read_handler(0xf18000, 0xf19fff, read16_delegate(*this, FUNC(cps_state::dinohunt_sound_r)));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0xf18000, 0xf19fff, read16smo_delegate(*this, FUNC(cps_state::dinohunt_sound_r)));
m_maincpu->space(AS_PROGRAM).install_read_port(0xfc0000, 0xfc0001, "IN2"); ;
// the ym2151 doesn't seem to be used. Is it actually on the PCB?
init_cps1();
}
-WRITE16_MEMBER( cps_state::sf2m3_layer_w )
+void cps_state::sf2m3_layer_w(offs_t offset, uint16_t data)
{
- cps1_cps_b_w(space,0x0a,data);
+ cps1_cps_b_w(0x0a,data);
}
-WRITE16_MEMBER(cps_state::varthb2_cps_a_w)
+void cps_state::varthb2_cps_a_w(offs_t offset, uint16_t data)
{
// cps-a regs are updated as normal by original code,
// but bootleg code ignores them and uses these regions instead: