summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/megadrive/rom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/megadrive/rom.cpp')
-rw-r--r--src/devices/bus/megadrive/rom.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/devices/bus/megadrive/rom.cpp b/src/devices/bus/megadrive/rom.cpp
index ac54cfcc8fd..c6a8f592b3f 100644
--- a/src/devices/bus/megadrive/rom.cpp
+++ b/src/devices/bus/megadrive/rom.cpp
@@ -450,7 +450,7 @@ void md_rom_starodys_device::device_reset()
CART + SRAM
-------------------------------------------------*/
-READ16_MEMBER(md_rom_sram_device::read)
+uint16_t md_rom_sram_device::read(offs_t offset)
{
// since a lot of generic carts ends up here if loaded from fullpath
// we access nvram only if m_nvram_handlers_installed has been turned on
@@ -465,7 +465,7 @@ READ16_MEMBER(md_rom_sram_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_sram_device::write)
+void md_rom_sram_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
// since a lot of generic carts ends up here if loaded from fullpath
// we access nvram only if m_nvram_handlers_installed has been turned on
@@ -476,7 +476,7 @@ WRITE16_MEMBER(md_rom_sram_device::write)
}
}
-WRITE16_MEMBER(md_rom_sram_device::write_a13)
+void md_rom_sram_device::write_a13(offs_t offset, uint16_t data)
{
if (offset == 0xf0/2)
{
@@ -495,7 +495,7 @@ WRITE16_MEMBER(md_rom_sram_device::write_a13)
CART + FRAM [almost same as SRAM... merge common parts?]
-------------------------------------------------*/
-READ16_MEMBER(md_rom_fram_device::read)
+uint16_t md_rom_fram_device::read(offs_t offset)
{
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active)
return m_nvram[offset - m_nvram_start/2];
@@ -505,20 +505,20 @@ READ16_MEMBER(md_rom_fram_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_fram_device::write)
+void md_rom_fram_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active)
m_nvram[offset - m_nvram_start/2] = data;
}
-WRITE16_MEMBER(md_rom_fram_device::write_a13)
+void md_rom_fram_device::write_a13(offs_t offset, uint16_t data)
{
if (offset == 0xf0/2)
m_nvram_active = BIT(data, 0);
}
-READ16_MEMBER(md_rom_fram_device::read_a13)
+uint16_t md_rom_fram_device::read_a13(offs_t offset)
{
if (offset == 0xf0/2)
return m_nvram_active;
@@ -530,7 +530,7 @@ READ16_MEMBER(md_rom_fram_device::read_a13)
SUPER STREET FIGHTERS 2
-------------------------------------------------*/
-READ16_MEMBER(md_rom_ssf2_device::read)
+uint16_t md_rom_ssf2_device::read(offs_t offset)
{
if (offset < 0x400000/2)
return m_rom[offset];
@@ -539,7 +539,7 @@ READ16_MEMBER(md_rom_ssf2_device::read)
}
// I'm not very fond of the code below...
-WRITE16_MEMBER(md_rom_ssf2_device::write_a13)
+void md_rom_ssf2_device::write_a13(offs_t offset, uint16_t data)
{
if (offset >= 0xf0/2)
{
@@ -564,7 +564,7 @@ WRITE16_MEMBER(md_rom_ssf2_device::write_a13)
#define MD_ADDR_CM2IN1(a) (m_base == 0 ? ((a << 1) & 0x1fffff)/2 : (((a << 1) & 0x1fffff) + 0x200000)/2)
-READ16_MEMBER(md_rom_cm2in1_device::read)
+uint16_t md_rom_cm2in1_device::read(offs_t offset)
{
if (offset < 0x400000/2)
return m_rom[MD_ADDR_CM2IN1(offset)];
@@ -577,15 +577,15 @@ READ16_MEMBER(md_rom_cm2in1_device::read)
PIRATE MULTICARTS
-------------------------------------------------*/
-READ16_MEMBER(md_rom_mcpirate_device::read)
+uint16_t md_rom_mcpirate_device::read(offs_t offset)
{
if (offset < 0x400000/2)
return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom_size - 1))/2];
else
- return read(space, offset - 0x400000/2, 0xffff);
+ return read(offset - 0x400000/2);
}
-WRITE16_MEMBER(md_rom_mcpirate_device::write_a13)
+void md_rom_mcpirate_device::write_a13(offs_t offset, uint16_t data)
{
offset <<= 1;
if (offset < 0x40)
@@ -596,7 +596,7 @@ WRITE16_MEMBER(md_rom_mcpirate_device::write_a13)
A BUG'S LIFE
-------------------------------------------------*/
-READ16_MEMBER(md_rom_bugslife_device::read_a13)
+uint16_t md_rom_bugslife_device::read_a13(offs_t offset)
{
if (offset == 0x00/2) return 0x28;
if (offset == 0x02/2) return 0x01;
@@ -608,7 +608,7 @@ READ16_MEMBER(md_rom_bugslife_device::read_a13)
CHINESE FIGHTER 3
-------------------------------------------------*/
-READ16_MEMBER(md_rom_chinf3_device::read)
+uint16_t md_rom_chinf3_device::read(offs_t offset)
{
if (offset < 0x100000/2)
{
@@ -680,7 +680,7 @@ READ16_MEMBER(md_rom_chinf3_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_chinf3_device::write)
+void md_rom_chinf3_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= 0x600000/2 && offset < 0x700000/2)
{
@@ -701,7 +701,7 @@ WRITE16_MEMBER(md_rom_chinf3_device::write)
16 MAHJONG II
-------------------------------------------------*/
-READ16_MEMBER(md_rom_16mj2_device::read)
+uint16_t md_rom_16mj2_device::read(offs_t offset)
{
if (offset == 0x400004/2) return 0xc900;
@@ -716,7 +716,7 @@ READ16_MEMBER(md_rom_16mj2_device::read)
LINGHUAN DAOSHI SUPER MAGICIAN / ELF WOR
-------------------------------------------------*/
-READ16_MEMBER(md_rom_elfwor_device::read)
+uint16_t md_rom_elfwor_device::read(offs_t offset)
{
// It returns (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006).
// It is probably best to add handlers for all 4 addresses
@@ -736,7 +736,7 @@ READ16_MEMBER(md_rom_elfwor_device::read)
HUAN LE TAO QI SHU / SMART MOUSE
-------------------------------------------------*/
-READ16_MEMBER(md_rom_smouse_device::read)
+uint16_t md_rom_smouse_device::read(offs_t offset)
{
if (offset == 0x400000/2) return 0x5500;
if (offset == 0x400002/2) return 0x0f00;
@@ -754,7 +754,7 @@ READ16_MEMBER(md_rom_smouse_device::read)
YA SE CHUAN SHUO
-------------------------------------------------*/
-READ16_MEMBER(md_rom_yasech_device::read)
+uint16_t md_rom_yasech_device::read(offs_t offset)
{
if (offset == 0x400000/2) return 0x6300;
if (offset == 0x400002/2) return 0x9800;
@@ -772,7 +772,7 @@ READ16_MEMBER(md_rom_yasech_device::read)
KOF98
-------------------------------------------------*/
-READ16_MEMBER(md_rom_kof98_device::read)
+uint16_t md_rom_kof98_device::read(offs_t offset)
{
if (offset == 0x480000/2) return 0xaa00;
if (offset == 0x4800e0/2) return 0xaa00;
@@ -792,7 +792,7 @@ READ16_MEMBER(md_rom_kof98_device::read)
KOF 99
-------------------------------------------------*/
-READ16_MEMBER(md_rom_kof99_device::read_a13)
+uint16_t md_rom_kof99_device::read_a13(offs_t offset)
{
if (offset == 0x00/2) return 0x00; // startup protection check, chinese message if != 0
if (offset == 0x02/2) return 0x01; // write 02 to a13002.. shift right 1?
@@ -804,7 +804,7 @@ READ16_MEMBER(md_rom_kof99_device::read_a13)
LION KING 2
-------------------------------------------------*/
-READ16_MEMBER(md_rom_lion2_device::read)
+uint16_t md_rom_lion2_device::read(offs_t offset)
{
if (offset == 0x400002/2) return m_prot1_data;
if (offset == 0x400006/2) return m_prot2_data;
@@ -816,7 +816,7 @@ READ16_MEMBER(md_rom_lion2_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_lion2_device::write)
+void md_rom_lion2_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset == 0x400000/2) m_prot1_data = data;
if (offset == 0x400004/2) m_prot2_data = data;
@@ -828,7 +828,7 @@ WRITE16_MEMBER(md_rom_lion2_device::write)
#define MD_LION3_ADDR(a) (((offset << 1) | (m_bank << 15)) & (m_rom_size - 1))/2
-READ16_MEMBER(md_rom_lion3_device::read)
+uint16_t md_rom_lion3_device::read(offs_t offset)
{
if (offset < 0x100000/2)
return m_rom[MD_LION3_ADDR(offset)];
@@ -855,7 +855,7 @@ READ16_MEMBER(md_rom_lion3_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_lion3_device::write)
+void md_rom_lion3_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= 0x600000/2 && offset < 0x700000/2)
{
@@ -907,7 +907,7 @@ WRITE16_MEMBER(md_rom_lion3_device::write)
MA JIANG QING REN / MAHJONG LOVER
-------------------------------------------------*/
-READ16_MEMBER(md_rom_mjlov_device::read)
+uint16_t md_rom_mjlov_device::read(offs_t offset)
{
if (offset == 0x400000/2) return 0x9000;
if (offset == 0x401000/2) return 0xd300;
@@ -924,7 +924,7 @@ READ16_MEMBER(md_rom_mjlov_device::read)
CHAOJI MAJIANG CLUB
-------------------------------------------------*/
-READ16_MEMBER(md_rom_cjmjclub_device::read)
+uint16_t md_rom_cjmjclub_device::read(offs_t offset)
{
if (offset == 0x400000/2) return 0x9000;
if (offset == 0x400002/2) return 0xd300;
@@ -941,7 +941,7 @@ READ16_MEMBER(md_rom_cjmjclub_device::read)
SUPER BUBBLE BOBBLE MD
-------------------------------------------------*/
-READ16_MEMBER(md_rom_sbubl_device::read)
+uint16_t md_rom_sbubl_device::read(offs_t offset)
{
if (offset == 0x400000/2) return 0x5500;
if (offset == 0x400002/2) return 0x0f00;
@@ -957,7 +957,7 @@ READ16_MEMBER(md_rom_sbubl_device::read)
SOUL BLADE
-------------------------------------------------*/
-READ16_MEMBER(md_rom_soulb_device::read)
+uint16_t md_rom_soulb_device::read(offs_t offset)
{
if (offset == 0x400002/2) return 0x9800;
if (offset == 0x400004/2) return 0xc900;
@@ -976,7 +976,7 @@ READ16_MEMBER(md_rom_soulb_device::read)
#define MD_POKESTAD_ADDR(a) (((offset << 1) | (m_bank << 15)) & (m_rom_size - 1))/2
-READ16_MEMBER(md_rom_pokestad_device::read)
+uint16_t md_rom_pokestad_device::read(offs_t offset)
{
if (offset < 0x100000/2)
return m_rom[MD_POKESTAD_ADDR(offset)];
@@ -988,7 +988,7 @@ READ16_MEMBER(md_rom_pokestad_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_pokestad_device::write)
+void md_rom_pokestad_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= 0x700000/2 && offset < 0x800000/2)
m_bank = data & 0x7f;
@@ -998,7 +998,7 @@ WRITE16_MEMBER(md_rom_pokestad_device::write)
POKEMON ALT
-------------------------------------------------*/
-READ16_MEMBER(md_rom_pokea_device::read_a13)
+uint16_t md_rom_pokea_device::read_a13(offs_t offset)
{
if (offset == 0x00/2) return 0x14;
if (offset == 0x02/2) return 0x01;
@@ -1010,14 +1010,14 @@ READ16_MEMBER(md_rom_pokea_device::read_a13)
REALTEC
-------------------------------------------------*/
-READ16_MEMBER(md_rom_realtec_device::read)
+uint16_t md_rom_realtec_device::read(offs_t offset)
{
if (offset < (m_bank_size * 0x20000)) // two banks of same (variable) size at the bottom of the rom
return m_rom[MD_ADDR((offset + (m_bank_addr * 0x20000)/2))];
return m_rom[MD_ADDR(((offset & 0x1fff/2) + 0x7e000/2))]; // otherwise it accesses the final 8k of the image
}
-WRITE16_MEMBER(md_rom_realtec_device::write)
+void md_rom_realtec_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset == 0x400000/2)
{
@@ -1040,7 +1040,7 @@ WRITE16_MEMBER(md_rom_realtec_device::write)
RED CLIFF
-------------------------------------------------*/
-READ16_MEMBER(md_rom_redcl_device::read)
+uint16_t md_rom_redcl_device::read(offs_t offset)
{
if (offset == 0x400000/2) return 0x55 << 8;
if (offset == 0x400004/2) return 0xaa << 8;
@@ -1056,7 +1056,7 @@ READ16_MEMBER(md_rom_redcl_device::read)
ROCKMAN X3
-------------------------------------------------*/
-READ16_MEMBER(md_rom_rx3_device::read_a13)
+uint16_t md_rom_rx3_device::read_a13(offs_t offset)
{
if (offset == 0)
return 0x0c;
@@ -1068,7 +1068,7 @@ READ16_MEMBER(md_rom_rx3_device::read_a13)
SQUIRREL KING
-------------------------------------------------*/
-READ16_MEMBER(md_rom_squir_device::read)
+uint16_t md_rom_squir_device::read(offs_t offset)
{
if ((offset >= 0x400000/2) && (offset < 0x400008/2))
return m_latch;
@@ -1080,7 +1080,7 @@ READ16_MEMBER(md_rom_squir_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_squir_device::write)
+void md_rom_squir_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= 0x400000/2 && offset < 0x400008/2)
m_latch = data;
@@ -1090,7 +1090,7 @@ WRITE16_MEMBER(md_rom_squir_device::write)
SUPER MARIO BROS
-------------------------------------------------*/
-READ16_MEMBER(md_rom_smb_device::read_a13)
+uint16_t md_rom_smb_device::read_a13(offs_t offset)
{
if (offset == 0)
return 0x0c;
@@ -1102,7 +1102,7 @@ READ16_MEMBER(md_rom_smb_device::read_a13)
SUPER MARIO BROS 2
-------------------------------------------------*/
-READ16_MEMBER(md_rom_smb2_device::read_a13)
+uint16_t md_rom_smb2_device::read_a13(offs_t offset)
{
if (offset == 0)
return 0x0a;
@@ -1114,7 +1114,7 @@ READ16_MEMBER(md_rom_smb2_device::read_a13)
SUPER MARIO WORLD 64
-------------------------------------------------*/
-READ16_MEMBER(md_rom_smw64_device::read)
+uint16_t md_rom_smw64_device::read(offs_t offset)
{
// 0x000000-0x0fffff: lower 512KB ROM (up to 0x07ffff) + mirror
// 0x600000-0x6fffff: internal hardware (up to 0x67ffff) + mirror
@@ -1179,7 +1179,7 @@ READ16_MEMBER(md_rom_smw64_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_smw64_device::write)
+void md_rom_smw64_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
// 0x600000-0x6fffff: internal hardware (up to 0x67ffff) + mirror
// Namely,
@@ -1228,7 +1228,7 @@ WRITE16_MEMBER(md_rom_smw64_device::write)
TEKKEN SPECIAL
-------------------------------------------------*/
-READ16_MEMBER(md_rom_tekkensp_device::read)
+uint16_t md_rom_tekkensp_device::read(offs_t offset)
{
if (offset < 0x400000/2)
return m_rom[MD_ADDR(offset)];
@@ -1238,7 +1238,7 @@ READ16_MEMBER(md_rom_tekkensp_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_tekkensp_device::write)
+void md_rom_tekkensp_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset < 0x400000/2)
return;
@@ -1274,7 +1274,7 @@ WRITE16_MEMBER(md_rom_tekkensp_device::write)
TOP FIGHTER
-------------------------------------------------*/
-READ16_MEMBER(md_rom_topf_device::read)
+uint16_t md_rom_topf_device::read(offs_t offset)
{
//cpu #0 (PC=0004CBAE): unmapped program memory word read from 006A35D4 & 00FF -- wants regD7
if (offset == 0x645b44/2)
@@ -1329,7 +1329,7 @@ READ16_MEMBER(md_rom_topf_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_topf_device::write)
+void md_rom_topf_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= 0x700000/2 && offset < 0x800000/2)
{
@@ -1354,12 +1354,12 @@ WRITE16_MEMBER(md_rom_topf_device::write)
RADICA TV GAMES [to be split...]
-------------------------------------------------*/
-READ16_MEMBER(md_rom_radica_device::read)
+uint16_t md_rom_radica_device::read(offs_t offset)
{
return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom_size - 1))/2];
}
-READ16_MEMBER(md_rom_radica_device::read_a13)
+uint16_t md_rom_radica_device::read_a13(offs_t offset)
{
if (offset < 0x80)
m_bank = offset & 0x3f;
@@ -1377,7 +1377,7 @@ READ16_MEMBER(md_rom_radica_device::read_a13)
the end of ROM.
-------------------------------------------------*/
-READ16_MEMBER(md_rom_beggarp_device::read)
+uint16_t md_rom_beggarp_device::read(offs_t offset)
{
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active)
return m_nvram[offset & 0x3fff];
@@ -1390,7 +1390,7 @@ READ16_MEMBER(md_rom_beggarp_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_beggarp_device::write)
+void md_rom_beggarp_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= 0x0e00/2 && offset < 0x0f00/2)
m_mode = BIT(data, 7);
@@ -1400,7 +1400,7 @@ WRITE16_MEMBER(md_rom_beggarp_device::write)
}
// this works the same as in standard SRAM carts
-WRITE16_MEMBER(md_rom_beggarp_device::write_a13)
+void md_rom_beggarp_device::write_a13(offs_t offset, uint16_t data)
{
if (offset == 0xf0/2)
{
@@ -1424,7 +1424,7 @@ WRITE16_MEMBER(md_rom_beggarp_device::write_a13)
(i.e. mirror of first 128K)
-------------------------------------------------*/
-READ16_MEMBER(md_rom_wukong_device::read)
+uint16_t md_rom_wukong_device::read(offs_t offset)
{
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active)
return m_nvram[offset - m_nvram_start/2];
@@ -1438,7 +1438,7 @@ READ16_MEMBER(md_rom_wukong_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_wukong_device::write)
+void md_rom_wukong_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset < 0x100000/2) // it actually writes to 0xe00/2
m_mode = BIT(data, 7);
@@ -1448,7 +1448,7 @@ WRITE16_MEMBER(md_rom_wukong_device::write)
}
// this works the same as in standard SRAM carts
-WRITE16_MEMBER(md_rom_wukong_device::write_a13)
+void md_rom_wukong_device::write_a13(offs_t offset, uint16_t data)
{
if (offset == 0xf0/2)
{
@@ -1474,7 +1474,7 @@ WRITE16_MEMBER(md_rom_wukong_device::write_a13)
gives open bus
-------------------------------------------------*/
-READ16_MEMBER(md_rom_starodys_device::read)
+uint16_t md_rom_starodys_device::read(offs_t offset)
{
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active && m_ram_enable)
return m_nvram[offset & 0x3fff];
@@ -1494,7 +1494,7 @@ READ16_MEMBER(md_rom_starodys_device::read)
return 0xffff;
}
-WRITE16_MEMBER(md_rom_starodys_device::write)
+void md_rom_starodys_device::write(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (offset >= m_nvram_start/2 && offset <= m_nvram_end/2 && m_nvram_active && !m_nvram_readonly && m_ram_enable)
m_nvram[offset & 0x3fff] = data;
@@ -1536,13 +1536,13 @@ WRITE16_MEMBER(md_rom_starodys_device::write)
}
-READ16_MEMBER(md_rom_starodys_device::read_a13)
+uint16_t md_rom_starodys_device::read_a13(offs_t offset)
{
return m_base << 4;
}
// this works the same as in standard SRAM carts
-WRITE16_MEMBER(md_rom_starodys_device::write_a13)
+void md_rom_starodys_device::write_a13(offs_t offset, uint16_t data)
{
if (offset == 0xf0/2)
{