diff options
Diffstat (limited to 'src/mame/drivers/megasys1.cpp')
-rw-r--r-- | src/mame/drivers/megasys1.cpp | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/src/mame/drivers/megasys1.cpp b/src/mame/drivers/megasys1.cpp index 16d13878d9c..163c0395f5b 100644 --- a/src/mame/drivers/megasys1.cpp +++ b/src/mame/drivers/megasys1.cpp @@ -264,14 +264,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(megasys1_state::megasys1B_scanline) in that order. */ -READ16_MEMBER(megasys1_state::ip_select_r) // FROM MCU +u16 megasys1_state::ip_select_r() // FROM MCU { return m_ip_latched; } -WRITE16_MEMBER(megasys1_state::ip_select_w) // TO MCU +void megasys1_state::ip_select_w(u16 data) // TO MCU { int i; @@ -362,7 +362,7 @@ void megasys1_state::megasys1B_monkelf_map(address_map &map) #define INTERRUPT_NUM_C INTERRUPT_NUM_B #define interrupt_C interrupt_B -WRITE16_MEMBER(megasys1_state::ram_w) +void megasys1_state::ram_w(offs_t offset, u16 data) { // DON'T use COMBINE_DATA // byte writes end up mirroring in both bytes of the word like nmk16.cpp @@ -1639,7 +1639,7 @@ INPUT_PORTS_END /* Read the input ports, through a protection device */ -READ16_MEMBER(megasys1_state::protection_peekaboo_r) +u16 megasys1_state::protection_peekaboo_r() { switch (m_protection_val) { @@ -1650,7 +1650,7 @@ READ16_MEMBER(megasys1_state::protection_peekaboo_r) } } -WRITE16_MEMBER(megasys1_state::protection_peekaboo_w) +void megasys1_state::protection_peekaboo_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_protection_val); @@ -4644,7 +4644,7 @@ void megasys1_state::init_64street() save_item(NAME(m_sprite_bank)); } -READ16_MEMBER(megasys1_state::megasys1A_mcu_hs_r) +u16 megasys1_state::megasys1A_mcu_hs_r(offs_t offset, u16 mem_mask) { if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0)) { @@ -4657,7 +4657,7 @@ READ16_MEMBER(megasys1_state::megasys1A_mcu_hs_r) return m_rom_maincpu[offset]; } -WRITE16_MEMBER(megasys1_state::megasys1A_mcu_hs_w) +void megasys1_state::megasys1A_mcu_hs_w(offs_t offset, u16 data, u16 mem_mask) { // following is hachoo, other games differs slightly // R 0x5f0, if bit 0 == 0 then skips hs seq (debug?) @@ -4683,8 +4683,8 @@ WRITE16_MEMBER(megasys1_state::megasys1A_mcu_hs_w) void megasys1_state::init_astyanax() { astyanax_rom_decode(machine(), "maincpu"); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_r))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16s_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16s_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_w))); m_mcu_hs = 0; memset(m_mcu_hs_ram, 0, sizeof(m_mcu_hs_ram)); @@ -4791,7 +4791,7 @@ void megasys1_state::init_hayaosi1() save_item(NAME(m_ip_latched)); } -READ16_MEMBER(megasys1_state::iganinju_mcu_hs_r) +u16 megasys1_state::iganinju_mcu_hs_r(offs_t offset, u16 mem_mask) { if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0)) { @@ -4804,7 +4804,7 @@ READ16_MEMBER(megasys1_state::iganinju_mcu_hs_r) return m_rom_maincpu[offset]; } -WRITE16_MEMBER(megasys1_state::iganinju_mcu_hs_w) +void megasys1_state::iganinju_mcu_hs_w(offs_t offset, u16 data, u16 mem_mask) { // [0/2]: 0x0000 // [2/2]: 0x0055 @@ -4828,8 +4828,8 @@ void megasys1_state::init_iganinju() { phantasm_rom_decode(machine(), "maincpu"); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(*this, FUNC(megasys1_state::iganinju_mcu_hs_r))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x2f000, 0x2f009, write16_delegate(*this, FUNC(megasys1_state::iganinju_mcu_hs_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16s_delegate(*this, FUNC(megasys1_state::iganinju_mcu_hs_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x2f000, 0x2f009, write16s_delegate(*this, FUNC(megasys1_state::iganinju_mcu_hs_w))); //m_rom_maincpu[0x00006e/2] = 0x0420; // the only game that does // not like lev 3 interrupts @@ -4847,8 +4847,8 @@ void megasys1_state::init_jitsupro() jitsupro_gfx_unmangle("scroll0"); // Gfx jitsupro_gfx_unmangle("sprites"); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_r))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16s_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16s_delegate(*this, FUNC(megasys1_state::megasys1A_mcu_hs_w))); m_mcu_hs = 0; memset(m_mcu_hs_ram, 0, sizeof(m_mcu_hs_ram)); @@ -4864,7 +4864,8 @@ void megasys1_state::init_peekaboo() m_okibank->configure_entry(7, &ROM[0x20000]); m_okibank->configure_entries(0, 7, &ROM[0x20000], 0x20000); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x100000, 0x100001, read16_delegate(*this, FUNC(megasys1_state::protection_peekaboo_r)), write16_delegate(*this, FUNC(megasys1_state::protection_peekaboo_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x100000, 0x100001, read16smo_delegate(*this, FUNC(megasys1_state::protection_peekaboo_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x100000, 0x100001, write16s_delegate(*this, FUNC(megasys1_state::protection_peekaboo_w))); save_item(NAME(m_protection_val)); } @@ -4901,12 +4902,12 @@ void megasys1_state::init_rittam() astyanax_rom_decode(machine(), "maincpu"); } -READ16_MEMBER(megasys1_state::soldamj_spriteram16_r) +u16 megasys1_state::soldamj_spriteram16_r(offs_t offset) { return m_spriteram[offset]; } -WRITE16_MEMBER(megasys1_state::soldamj_spriteram16_w) +void megasys1_state::soldamj_spriteram16_w(offs_t offset, u16 data, u16 mem_mask) { if (offset < 0x800/2) COMBINE_DATA(&m_spriteram[offset]); } @@ -4915,18 +4916,20 @@ void megasys1_state::init_soldamj() { astyanax_rom_decode(machine(), "maincpu"); /* Sprite RAM is mirrored */ - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x8c000, 0x8cfff, read16_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_r)), write16_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x8c000, 0x8cfff, read16sm_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x8c000, 0x8cfff, write16s_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_w))); } void megasys1_state::init_soldam() { phantasm_rom_decode(machine(), "maincpu"); /* Sprite RAM is mirrored */ - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x8c000, 0x8cfff, read16_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_r)), write16_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x8c000, 0x8cfff, read16sm_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x8c000, 0x8cfff, write16s_delegate(*this, FUNC(megasys1_state::soldamj_spriteram16_w))); } -READ16_MEMBER(megasys1_state::stdragon_mcu_hs_r) +u16 megasys1_state::stdragon_mcu_hs_r(offs_t offset, u16 mem_mask) { if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0)) { @@ -4939,7 +4942,7 @@ READ16_MEMBER(megasys1_state::stdragon_mcu_hs_r) return m_rom_maincpu[offset]; } -WRITE16_MEMBER(megasys1_state::stdragon_mcu_hs_w) +void megasys1_state::stdragon_mcu_hs_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_mcu_hs_ram[offset]); @@ -4956,8 +4959,8 @@ WRITE16_MEMBER(megasys1_state::stdragon_mcu_hs_w) void megasys1_state::init_stdragon() { phantasm_rom_decode(machine(), "maincpu"); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_r))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x23ff0, 0x23ff9, write16_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16s_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x23ff0, 0x23ff9, write16s_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_w))); m_mcu_hs = 0; memset(m_mcu_hs_ram, 0, sizeof(m_mcu_hs_ram)); @@ -4973,8 +4976,8 @@ void megasys1_state::init_stdragona() stdragona_gfx_unmangle("scroll0"); stdragona_gfx_unmangle("sprites"); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_r))); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x23ff0, 0x23ff9, write16_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_w))); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16s_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_r))); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x23ff0, 0x23ff9, write16s_delegate(*this, FUNC(megasys1_state::stdragon_mcu_hs_w))); m_mcu_hs = 0; memset(m_mcu_hs_ram, 0, sizeof(m_mcu_hs_ram)); |