summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/snes/upd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/snes/upd.cpp')
-rw-r--r--src/devices/bus/snes/upd.cpp170
1 files changed, 91 insertions, 79 deletions
diff --git a/src/devices/bus/snes/upd.cpp b/src/devices/bus/snes/upd.cpp
index 462ab0faf98..70396938e89 100644
--- a/src/devices/bus/snes/upd.cpp
+++ b/src/devices/bus/snes/upd.cpp
@@ -97,12 +97,12 @@ void sns_rom_setadsp_device::device_start()
// Lo-ROM
// DSP dump contains prg at offset 0 and data at offset 0x2000
-READ32_MEMBER( sns_rom20_necdsp_device::necdsp_prg_r )
+uint32_t sns_rom20_necdsp_device::necdsp_prg_r(offs_t offset)
{
return get_prg(&m_bios[0], offset);
}
-READ16_MEMBER( sns_rom20_necdsp_device::necdsp_data_r )
+uint16_t sns_rom20_necdsp_device::necdsp_data_r(offs_t offset)
{
return get_data(&m_bios[0], offset + 0x2000/2);
}
@@ -132,20 +132,21 @@ void sns_rom20_necdsp_device::dsp_data_map_lorom(address_map &map)
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(sns_rom20_necdsp_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_lorom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_lorom)
-MACHINE_CONFIG_END
+void sns_rom20_necdsp_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom20_necdsp_device::dsp_prg_map_lorom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom20_necdsp_device::dsp_data_map_lorom);
+}
-READ8_MEMBER( sns_rom20_necdsp_device::chip_read )
+uint8_t sns_rom20_necdsp_device::chip_read(offs_t offset)
{
offset &= 0x7fff;
return m_upd7725->snesdsp_read(offset < 0x4000);
}
-WRITE8_MEMBER( sns_rom20_necdsp_device::chip_write )
+void sns_rom20_necdsp_device::chip_write(offs_t offset, uint8_t data)
{
offset &= 0x7fff;
m_upd7725->snesdsp_write(offset < 0x4000, data);
@@ -155,12 +156,12 @@ WRITE8_MEMBER( sns_rom20_necdsp_device::chip_write )
// Hi-ROM
// DSP dump contains prg at offset 0 and data at offset 0x2000
-READ32_MEMBER( sns_rom21_necdsp_device::necdsp_prg_r )
+uint32_t sns_rom21_necdsp_device::necdsp_prg_r(offs_t offset)
{
return get_prg(&m_bios[0], offset);
}
-READ16_MEMBER( sns_rom21_necdsp_device::necdsp_data_r )
+uint16_t sns_rom21_necdsp_device::necdsp_data_r(offs_t offset)
{
return get_data(&m_bios[0], offset + 0x2000/2);
}
@@ -189,20 +190,21 @@ void sns_rom21_necdsp_device::dsp_data_map_hirom(address_map &map)
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(sns_rom21_necdsp_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_hirom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_hirom)
-MACHINE_CONFIG_END
+void sns_rom21_necdsp_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom21_necdsp_device::dsp_prg_map_hirom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom21_necdsp_device::dsp_data_map_hirom);
+}
-READ8_MEMBER( sns_rom21_necdsp_device::chip_read )
+uint8_t sns_rom21_necdsp_device::chip_read(offs_t offset)
{
offset &= 0x1fff;
return m_upd7725->snesdsp_read(offset < 0x1000);
}
-WRITE8_MEMBER( sns_rom21_necdsp_device::chip_write )
+void sns_rom21_necdsp_device::chip_write(offs_t offset, uint8_t data)
{
offset &= 0x1fff;
m_upd7725->snesdsp_write(offset < 0x1000, data);
@@ -215,7 +217,7 @@ WRITE8_MEMBER( sns_rom21_necdsp_device::chip_write )
// same as above but additional read/write handling for the add-on chip
-READ8_MEMBER( sns_rom_setadsp_device::chip_read )
+uint8_t sns_rom_setadsp_device::chip_read(offs_t offset)
{
if (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)
m_upd96050->snesdsp_read((offset & 0x01) ? false : true);
@@ -234,7 +236,7 @@ READ8_MEMBER( sns_rom_setadsp_device::chip_read )
}
-WRITE8_MEMBER( sns_rom_setadsp_device::chip_write )
+void sns_rom_setadsp_device::chip_write(offs_t offset, uint8_t data)
{
if (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)
{
@@ -265,12 +267,12 @@ WRITE8_MEMBER( sns_rom_setadsp_device::chip_write )
// DSP dump contains prg at offset 0 and data at offset 0x10000
-READ32_MEMBER( sns_rom_setadsp_device::setadsp_prg_r )
+uint32_t sns_rom_setadsp_device::setadsp_prg_r(offs_t offset)
{
return get_prg(&m_bios[0], offset);
}
-READ16_MEMBER( sns_rom_setadsp_device::setadsp_data_r )
+uint16_t sns_rom_setadsp_device::setadsp_data_r(offs_t offset)
{
return get_data(&m_bios[0], offset + 0x10000/2);
}
@@ -300,18 +302,20 @@ void sns_rom_setadsp_device::st01x_data_map(address_map &map)
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(sns_rom_seta10dsp_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD96050, 10000000)
- MCFG_DEVICE_PROGRAM_MAP(st01x_prg_map)
- MCFG_DEVICE_DATA_MAP(st01x_data_map)
-MACHINE_CONFIG_END
+void sns_rom_seta10dsp_device::device_add_mconfig(machine_config &config)
+{
+ UPD96050(config, m_upd96050, 10000000);
+ m_upd96050->set_addrmap(AS_PROGRAM, &sns_rom_seta10dsp_device::st01x_prg_map);
+ m_upd96050->set_addrmap(AS_DATA, &sns_rom_seta10dsp_device::st01x_data_map);
+}
-MACHINE_CONFIG_START(sns_rom_seta11dsp_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD96050, 15000000)
- MCFG_DEVICE_PROGRAM_MAP(st01x_prg_map)
- MCFG_DEVICE_DATA_MAP(st01x_data_map)
-MACHINE_CONFIG_END
+void sns_rom_seta11dsp_device::device_add_mconfig(machine_config &config)
+{
+ UPD96050(config, m_upd96050, 15000000);
+ m_upd96050->set_addrmap(AS_PROGRAM, &sns_rom_seta11dsp_device::st01x_prg_map);
+ m_upd96050->set_addrmap(AS_DATA, &sns_rom_seta11dsp_device::st01x_data_map);
+}
// To make faster DSP access to its internal rom, let's install read banks and map m_bios there with correct byte order
@@ -411,53 +415,61 @@ sns_rom_seta11dsp_legacy_device::sns_rom_seta11dsp_legacy_device(const machine_c
}
-MACHINE_CONFIG_START(sns_rom20_necdsp1_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_lorom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_lorom)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sns_rom20_necdsp1b_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_lorom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_lorom)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sns_rom20_necdsp2_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_lorom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_lorom)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sns_rom20_necdsp3_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_lorom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_lorom)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sns_rom20_necdsp4_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_lorom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_lorom)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sns_rom21_necdsp1_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD7725, 8000000)
- MCFG_DEVICE_PROGRAM_MAP(dsp_prg_map_hirom)
- MCFG_DEVICE_DATA_MAP(dsp_data_map_hirom)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sns_rom_seta10dsp_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD96050, 10000000)
- MCFG_DEVICE_PROGRAM_MAP(st01x_prg_map)
- MCFG_DEVICE_DATA_MAP(st01x_data_map)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sns_rom_seta11dsp_legacy_device::device_add_mconfig)
- MCFG_DEVICE_ADD("dsp", UPD96050, 15000000)
- MCFG_DEVICE_PROGRAM_MAP(st01x_prg_map)
- MCFG_DEVICE_DATA_MAP(st01x_data_map)
-MACHINE_CONFIG_END
+void sns_rom20_necdsp1_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom20_necdsp1_legacy_device::dsp_prg_map_lorom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom20_necdsp1_legacy_device::dsp_data_map_lorom);
+}
+
+void sns_rom20_necdsp1b_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom20_necdsp1b_legacy_device::dsp_prg_map_lorom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom20_necdsp1b_legacy_device::dsp_data_map_lorom);
+}
+
+void sns_rom20_necdsp2_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom20_necdsp2_legacy_device::dsp_prg_map_lorom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom20_necdsp2_legacy_device::dsp_data_map_lorom);
+}
+
+void sns_rom20_necdsp3_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom20_necdsp3_legacy_device::dsp_prg_map_lorom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom20_necdsp3_legacy_device::dsp_data_map_lorom);
+}
+
+void sns_rom20_necdsp4_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom20_necdsp4_legacy_device::dsp_prg_map_lorom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom20_necdsp4_legacy_device::dsp_data_map_lorom);
+}
+
+void sns_rom21_necdsp1_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD7725(config, m_upd7725, 8000000);
+ m_upd7725->set_addrmap(AS_PROGRAM, &sns_rom21_necdsp1_legacy_device::dsp_prg_map_hirom);
+ m_upd7725->set_addrmap(AS_DATA, &sns_rom21_necdsp1_legacy_device::dsp_data_map_hirom);
+}
+
+void sns_rom_seta10dsp_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD96050(config, m_upd96050, 10000000);
+ m_upd96050->set_addrmap(AS_PROGRAM, &sns_rom_seta10dsp_legacy_device::st01x_prg_map);
+ m_upd96050->set_addrmap(AS_DATA, &sns_rom_seta10dsp_legacy_device::st01x_data_map);
+}
+
+void sns_rom_seta11dsp_legacy_device::device_add_mconfig(machine_config &config)
+{
+ UPD96050(config, m_upd96050, 15000000);
+ m_upd96050->set_addrmap(AS_PROGRAM, &sns_rom_seta11dsp_legacy_device::st01x_prg_map);
+ m_upd96050->set_addrmap(AS_DATA, &sns_rom_seta11dsp_legacy_device::st01x_data_map);
+}
ROM_START( snes_dsp1 )