diff options
Diffstat (limited to 'src/emu/bus/c64')
-rw-r--r-- | src/emu/bus/c64/16kb.c | 39 | ||||
-rw-r--r-- | src/emu/bus/c64/16kb.h | 8 | ||||
-rw-r--r-- | src/emu/bus/c64/dela_ep256.c | 75 | ||||
-rw-r--r-- | src/emu/bus/c64/dela_ep256.h | 8 | ||||
-rw-r--r-- | src/emu/bus/c64/dela_ep64.c | 36 | ||||
-rw-r--r-- | src/emu/bus/c64/dela_ep64.h | 7 | ||||
-rw-r--r-- | src/emu/bus/c64/dela_ep7x8.c | 76 | ||||
-rw-r--r-- | src/emu/bus/c64/dela_ep7x8.h | 12 | ||||
-rw-r--r-- | src/emu/bus/c64/reu.c | 29 | ||||
-rw-r--r-- | src/emu/bus/c64/reu.h | 6 | ||||
-rw-r--r-- | src/emu/bus/c64/rex_ep256.c | 75 | ||||
-rw-r--r-- | src/emu/bus/c64/rex_ep256.h | 10 |
12 files changed, 133 insertions, 248 deletions
diff --git a/src/emu/bus/c64/16kb.c b/src/emu/bus/c64/16kb.c index 2e05459f4bd..74a4830df6d 100644 --- a/src/emu/bus/c64/16kb.c +++ b/src/emu/bus/c64/16kb.c @@ -21,38 +21,15 @@ const device_type C64_16KB = &device_creator<c64_16kb_cartridge_device>; //------------------------------------------------- -// ROM( c64_16kb ) -//------------------------------------------------- - -ROM_START( c64_16kb ) - ROM_REGION( 0x2000, "roml", 0 ) - ROM_CART_LOAD( "roml", 0x0000, 0x2000, ROM_MIRROR ) - - ROM_REGION( 0x2000, "romh", 0 ) - ROM_CART_LOAD( "romh", 0x0000, 0x2000, ROM_MIRROR ) -ROM_END - - -//------------------------------------------------- -// rom_region - device-specific ROM region -//------------------------------------------------- - -const rom_entry *c64_16kb_cartridge_device::device_rom_region() const -{ - return ROM_NAME( c64_16kb ); -} - - -//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c64_16kb ) //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( c64_16kb ) - MCFG_CARTSLOT_ADD("roml") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,80") + MCFG_GENERIC_CARTSLOT_ADD("roml", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("rom,bin,80") - MCFG_CARTSLOT_ADD("romh") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a0,e0") + MCFG_GENERIC_CARTSLOT_ADD("romh", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("rom,bin,a0,e0") MACHINE_CONFIG_END @@ -103,8 +80,8 @@ c64_16kb_cartridge_device::c64_16kb_cartridge_device(const machine_config &mconf device_t(mconfig, C64_16KB, "C64 16KB EPROM cartridge", tag, owner, clock, "c64_16kb", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_sw1(*this, "SW1"), - m_rom_low(*this, "roml"), - m_rom_high(*this, "romh") + m_low(*this, "roml"), + m_high(*this, "romh") { } @@ -139,11 +116,11 @@ UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, U { if (!roml) { - data = m_rom_low->base()[offset & 0x1fff]; + data = m_low->read_rom(space, offset & 0x1fff); } else if (!romh) { - data = m_rom_high->base()[offset & 0x1fff]; + data = m_high->read_rom(space, offset & 0x1fff); } return data; diff --git a/src/emu/bus/c64/16kb.h b/src/emu/bus/c64/16kb.h index 3e0e16a5d9d..039521616e3 100644 --- a/src/emu/bus/c64/16kb.h +++ b/src/emu/bus/c64/16kb.h @@ -16,7 +16,8 @@ #include "emu.h" -#include "imagedev/cartslot.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "exp.h" @@ -35,7 +36,6 @@ public: c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides - virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; virtual ioport_constructor device_input_ports() const; @@ -49,8 +49,8 @@ protected: private: required_ioport m_sw1; - required_memory_region m_rom_low; - required_memory_region m_rom_high; + required_device<generic_slot_device> m_low; + required_device<generic_slot_device> m_high; }; diff --git a/src/emu/bus/c64/dela_ep256.c b/src/emu/bus/c64/dela_ep256.c index 0020806afdb..9a9e6748c11 100644 --- a/src/emu/bus/c64/dela_ep256.c +++ b/src/emu/bus/c64/dela_ep256.c @@ -21,53 +21,26 @@ const device_type C64_DELA_EP256 = &device_creator<c64_dela_ep256_cartridge_devi //------------------------------------------------- -// ROM( c64_dela_ep256 ) -//------------------------------------------------- - -ROM_START( c64_dela_ep256 ) - ROM_REGION( 0x40000, "eprom", 0 ) - ROM_CART_LOAD( "rom1", 0x00000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom2", 0x08000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom3", 0x10000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom4", 0x18000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom5", 0x20000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom6", 0x28000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom7", 0x30000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom8", 0x38000, 0x08000, ROM_MIRROR ) -ROM_END - - -//------------------------------------------------- -// rom_region - device-specific ROM region -//------------------------------------------------- - -const rom_entry *c64_dela_ep256_cartridge_device::device_rom_region() const -{ - return ROM_NAME( c64_dela_ep256 ); -} - - -//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c64_dela_ep256 ) //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( c64_dela_ep256 ) - MCFG_CARTSLOT_ADD("rom1") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom2") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom3") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom4") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom5") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom6") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom7") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom8") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") + MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom8", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") MACHINE_CONFIG_END @@ -93,9 +66,14 @@ machine_config_constructor c64_dela_ep256_cartridge_device::device_mconfig_addit c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, C64_DELA_EP256, "C64 Dela 256KB EPROM cartridge", tag, owner, clock, "delep256", __FILE__), - device_c64_expansion_card_interface(mconfig, *this), - m_eprom(*this, "eprom") + device_c64_expansion_card_interface(mconfig, *this) { + for (int i = 0; i < 8; i++) + { + char str[6]; + sprintf(str, "rom%i", i + 1); + m_eproms[i] = subdevice<generic_slot_device>(str); + } } @@ -108,6 +86,7 @@ void c64_dela_ep256_cartridge_device::device_start() // state saving save_item(NAME(m_bank)); save_item(NAME(m_reset)); + save_item(NAME(m_socket)); } @@ -120,6 +99,7 @@ void c64_dela_ep256_cartridge_device::device_reset() m_reset = 1; m_bank = 0; m_exrom = 0; + m_socket = 0; } @@ -138,7 +118,7 @@ UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t off else { offs_t addr = (m_bank << 13) | (offset & 0x1fff); - data = m_eprom->base()[addr]; + data = m_eproms[m_socket]->read_rom(space, addr); } } @@ -171,7 +151,8 @@ void c64_dela_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offs m_reset = 0; - m_bank = ((data & 0x07) << 2) | ((data >> 4) & 0x03); + m_socket = data & 0x07; + m_bank = (data >> 4) & 0x03; m_exrom = BIT(data, 7); } diff --git a/src/emu/bus/c64/dela_ep256.h b/src/emu/bus/c64/dela_ep256.h index bba52a07ab2..d5ac6fe9ff2 100644 --- a/src/emu/bus/c64/dela_ep256.h +++ b/src/emu/bus/c64/dela_ep256.h @@ -17,7 +17,8 @@ #include "emu.h" #include "exp.h" -#include "imagedev/cartslot.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" @@ -35,7 +36,6 @@ public: c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides - virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; protected: @@ -48,9 +48,9 @@ protected: virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); private: - required_memory_region m_eprom; + generic_slot_device *m_eproms[8]; - UINT8 m_bank; + UINT8 m_bank, m_socket; int m_reset; }; diff --git a/src/emu/bus/c64/dela_ep64.c b/src/emu/bus/c64/dela_ep64.c index cdc2a86a4d4..e19010af95d 100644 --- a/src/emu/bus/c64/dela_ep64.c +++ b/src/emu/bus/c64/dela_ep64.c @@ -21,35 +21,14 @@ const device_type C64_DELA_EP64 = &device_creator<c64_dela_ep64_cartridge_device //------------------------------------------------- -// ROM( c64_dela_ep64 ) -//------------------------------------------------- - -ROM_START( c64_dela_ep64 ) - ROM_REGION( 0x10000, "eprom", 0 ) - ROM_CART_LOAD( "rom1", 0x0000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom2", 0x8000, 0x08000, ROM_MIRROR ) -ROM_END - - -//------------------------------------------------- -// rom_region - device-specific ROM region -//------------------------------------------------- - -const rom_entry *c64_dela_ep64_cartridge_device::device_rom_region() const -{ - return ROM_NAME( c64_dela_ep64 ); -} - - -//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c64_dela_ep64 ) //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( c64_dela_ep64 ) - MCFG_CARTSLOT_ADD("rom1") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom2") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") + MCFG_GENERIC_SOCKET_ADD("eprom1", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("rom,bin") + MCFG_GENERIC_SOCKET_ADD("eprom2", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("rom,bin") MACHINE_CONFIG_END @@ -75,7 +54,8 @@ machine_config_constructor c64_dela_ep64_cartridge_device::device_mconfig_additi c64_dela_ep64_cartridge_device::c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, C64_DELA_EP64, "C64 Rex 64KB EPROM cartridge", tag, owner, clock, "c64_dela_ep64", __FILE__), device_c64_expansion_card_interface(mconfig, *this), - m_eprom(*this, "eprom") + m_eprom1(*this, "eprom1"), + m_eprom2(*this, "eprom2") { } @@ -124,8 +104,8 @@ UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offs offs_t addr = (m_bank << 13) | (offset & 0x1fff); if (!m_rom0_ce) data |= m_roml[offset & 0x1fff]; - if (!m_rom1_ce) data |= m_eprom->base()[0x0000 + addr]; - if (!m_rom2_ce) data |= m_eprom->base()[0x8000 + addr]; + if (!m_rom1_ce) data |= m_eprom1->read_rom(space, addr); + if (!m_rom2_ce) data |= m_eprom2->read_rom(space, addr); } } diff --git a/src/emu/bus/c64/dela_ep64.h b/src/emu/bus/c64/dela_ep64.h index b3d82b5aed7..7f522f6ce23 100644 --- a/src/emu/bus/c64/dela_ep64.h +++ b/src/emu/bus/c64/dela_ep64.h @@ -16,7 +16,8 @@ #include "emu.h" -#include "imagedev/cartslot.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "exp.h" @@ -35,7 +36,6 @@ public: c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides - virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; protected: @@ -48,7 +48,8 @@ protected: virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); private: - required_memory_region m_eprom; + required_device<generic_slot_device> m_eprom1; + required_device<generic_slot_device> m_eprom2; UINT8 m_bank; int m_reset; diff --git a/src/emu/bus/c64/dela_ep7x8.c b/src/emu/bus/c64/dela_ep7x8.c index 3e9802db0f4..be11389a4d6 100644 --- a/src/emu/bus/c64/dela_ep7x8.c +++ b/src/emu/bus/c64/dela_ep7x8.c @@ -21,50 +21,24 @@ const device_type C64_DELA_EP7X8 = &device_creator<c64_dela_ep7x8_cartridge_devi //------------------------------------------------- -// ROM( c64_dela_ep7x8 ) -//------------------------------------------------- - -ROM_START( c64_dela_ep7x8 ) - ROM_REGION( 0x10000, "eprom", 0 ) - ROM_CART_LOAD( "rom1", 0x2000, 0x2000, ROM_MIRROR ) - ROM_CART_LOAD( "rom2", 0x4000, 0x2000, ROM_MIRROR ) - ROM_CART_LOAD( "rom3", 0x6000, 0x2000, ROM_MIRROR ) - ROM_CART_LOAD( "rom4", 0x8000, 0x2000, ROM_MIRROR ) - ROM_CART_LOAD( "rom5", 0xa000, 0x2000, ROM_MIRROR ) - ROM_CART_LOAD( "rom6", 0xc000, 0x2000, ROM_MIRROR ) - ROM_CART_LOAD( "rom7", 0xe000, 0x2000, ROM_MIRROR ) -ROM_END - - -//------------------------------------------------- -// rom_region - device-specific ROM region -//------------------------------------------------- - -const rom_entry *c64_dela_ep7x8_cartridge_device::device_rom_region() const -{ - return ROM_NAME( c64_dela_ep7x8 ); -} - - -//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 ) //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 ) - MCFG_CARTSLOT_ADD("rom1") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom2") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom3") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom4") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom5") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom6") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom7") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") + MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") MACHINE_CONFIG_END @@ -90,7 +64,13 @@ machine_config_constructor c64_dela_ep7x8_cartridge_device::device_mconfig_addit c64_dela_ep7x8_cartridge_device::c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, C64_DELA_EP7X8, "C64 Dela 7x8KB EPROM cartridge", tag, owner, clock, "ep7x8", __FILE__), device_c64_expansion_card_interface(mconfig, *this), - m_eprom(*this, "eprom") + m_eprom1(*this, "rom1"), + m_eprom2(*this, "rom2"), + m_eprom3(*this, "rom3"), + m_eprom4(*this, "rom4"), + m_eprom5(*this, "rom5"), + m_eprom6(*this, "rom6"), + m_eprom7(*this, "rom7") { } @@ -128,13 +108,13 @@ UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t off offs_t addr = offset & 0x1fff; if (!BIT(m_bank, 0)) data |= m_roml[addr]; - if (!BIT(m_bank, 1)) data |= m_eprom->base()[0x2000 + addr]; - if (!BIT(m_bank, 2)) data |= m_eprom->base()[0x4000 + addr]; - if (!BIT(m_bank, 3)) data |= m_eprom->base()[0x6000 + addr]; - if (!BIT(m_bank, 4)) data |= m_eprom->base()[0x8000 + addr]; - if (!BIT(m_bank, 5)) data |= m_eprom->base()[0xa000 + addr]; - if (!BIT(m_bank, 6)) data |= m_eprom->base()[0xc000 + addr]; - if (!BIT(m_bank, 7)) data |= m_eprom->base()[0xe000 + addr]; + if (!BIT(m_bank, 1)) data |= m_eprom1->read_rom(space, addr); + if (!BIT(m_bank, 2)) data |= m_eprom2->read_rom(space, addr); + if (!BIT(m_bank, 3)) data |= m_eprom3->read_rom(space, addr); + if (!BIT(m_bank, 4)) data |= m_eprom4->read_rom(space, addr); + if (!BIT(m_bank, 5)) data |= m_eprom5->read_rom(space, addr); + if (!BIT(m_bank, 6)) data |= m_eprom6->read_rom(space, addr); + if (!BIT(m_bank, 7)) data |= m_eprom7->read_rom(space, addr); } return data; diff --git a/src/emu/bus/c64/dela_ep7x8.h b/src/emu/bus/c64/dela_ep7x8.h index ebf48e2e221..ca4e019c9f4 100644 --- a/src/emu/bus/c64/dela_ep7x8.h +++ b/src/emu/bus/c64/dela_ep7x8.h @@ -16,7 +16,8 @@ #include "emu.h" -#include "imagedev/cartslot.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "exp.h" @@ -35,7 +36,6 @@ public: c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides - virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; protected: @@ -48,7 +48,13 @@ protected: virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); private: - required_memory_region m_eprom; + required_device<generic_slot_device> m_eprom1; + required_device<generic_slot_device> m_eprom2; + required_device<generic_slot_device> m_eprom3; + required_device<generic_slot_device> m_eprom4; + required_device<generic_slot_device> m_eprom5; + required_device<generic_slot_device> m_eprom6; + required_device<generic_slot_device> m_eprom7; UINT8 m_bank; }; diff --git a/src/emu/bus/c64/reu.c b/src/emu/bus/c64/reu.c index 67723fd0885..3d2f412bf92 100644 --- a/src/emu/bus/c64/reu.c +++ b/src/emu/bus/c64/reu.c @@ -20,7 +20,6 @@ #define MOS8726R1_TAG "u1" - //************************************************************************** // DEVICE DEFINITIONS //************************************************************************** @@ -31,34 +30,14 @@ const device_type C64_REU1764 = &device_creator<c64_reu1764_cartridge_device>; //------------------------------------------------- -// ROM( c64_reu ) -//------------------------------------------------- - -ROM_START( c64_reu ) - ROM_REGION( 0x8000, "roml", 0 ) - ROM_CART_LOAD( "rom", 0x0000, 0x8000, ROM_MIRROR ) -ROM_END - - -//------------------------------------------------- -// rom_region - device-specific ROM region -//------------------------------------------------- - -const rom_entry *c64_reu_cartridge_device::device_rom_region() const -{ - return ROM_NAME( c64_reu ); -} - - -//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c64_reu ) //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( c64_reu ) MCFG_MOS8726_ADD(MOS8726R1_TAG) - MCFG_CARTSLOT_ADD("rom") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") + MCFG_GENERIC_SOCKET_ADD("rom", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") MACHINE_CONFIG_END @@ -86,7 +65,7 @@ c64_reu_cartridge_device::c64_reu_cartridge_device(const machine_config &mconfig device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_c64_expansion_card_interface(mconfig, *this), m_dmac(*this, MOS8726R1_TAG), - m_rom(*this, "rom"), + m_eprom(*this, "rom"), m_ram(*this, "ram"), m_variant(variant), m_jp1(jp1), @@ -137,7 +116,7 @@ UINT8 c64_reu_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UI { if (!m_dmac->romsel_r(roml, romh)) { - data = m_roml[offset & 0x7fff]; + data = m_eprom->read_rom(space, offset & 0x7fff); } else if (!io2) { diff --git a/src/emu/bus/c64/reu.h b/src/emu/bus/c64/reu.h index a2918891268..4d8454d40d5 100644 --- a/src/emu/bus/c64/reu.h +++ b/src/emu/bus/c64/reu.h @@ -16,7 +16,8 @@ #include "emu.h" -#include "imagedev/cartslot.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "exp.h" #include "machine/mos8726.h" @@ -36,7 +37,6 @@ public: c64_reu_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, int jp1, size_t ram_size, const char *shortname, const char *source); // optional information overrides - virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; protected: @@ -56,7 +56,7 @@ protected: virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); required_device<mos8726_device> m_dmac; - required_memory_region m_rom; + required_device<generic_slot_device> m_eprom; optional_shared_ptr<UINT8> m_ram; int m_variant; diff --git a/src/emu/bus/c64/rex_ep256.c b/src/emu/bus/c64/rex_ep256.c index 829d491b40b..d190713de97 100644 --- a/src/emu/bus/c64/rex_ep256.c +++ b/src/emu/bus/c64/rex_ep256.c @@ -21,53 +21,26 @@ const device_type C64_REX_EP256 = &device_creator<c64_rex_ep256_cartridge_device //------------------------------------------------- -// ROM( c64_rex_ep256 ) -//------------------------------------------------- - -ROM_START( c64_rex_ep256 ) - ROM_REGION( 0x40000, "eprom", 0 ) - ROM_CART_LOAD( "rom1", 0x00000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom2", 0x08000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom3", 0x10000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom4", 0x18000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom5", 0x20000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom6", 0x28000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom7", 0x30000, 0x08000, ROM_MIRROR ) - ROM_CART_LOAD( "rom8", 0x38000, 0x08000, ROM_MIRROR ) -ROM_END - - -//------------------------------------------------- -// rom_region - device-specific ROM region -//------------------------------------------------- - -const rom_entry *c64_rex_ep256_cartridge_device::device_rom_region() const -{ - return ROM_NAME( c64_rex_ep256 ); -} - - -//------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c64_rex_ep256 ) //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( c64_rex_ep256 ) - MCFG_CARTSLOT_ADD("rom1") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom2") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom3") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom4") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom5") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom6") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom7") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") - MCFG_CARTSLOT_ADD("rom8") - MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") + MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") + MCFG_GENERIC_SOCKET_ADD("rom8", generic_linear_slot, NULL) + MCFG_GENERIC_EXTENSIONS("bin,rom") MACHINE_CONFIG_END @@ -93,9 +66,14 @@ machine_config_constructor c64_rex_ep256_cartridge_device::device_mconfig_additi c64_rex_ep256_cartridge_device::c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, C64_REX_EP256, "C64 Rex 256KB EPROM cartridge", tag, owner, clock, "rexep256", __FILE__), - device_c64_expansion_card_interface(mconfig, *this), - m_eprom(*this, "eprom") + device_c64_expansion_card_interface(mconfig, *this) { + for (int i = 0; i < 8; i++) + { + char str[6]; + sprintf(str, "rom%i", i + 1); + m_eproms[i] = subdevice<generic_slot_device>(str); + } } @@ -108,6 +86,7 @@ void c64_rex_ep256_cartridge_device::device_start() // state saving save_item(NAME(m_bank)); save_item(NAME(m_reset)); + save_item(NAME(m_socket)); } @@ -120,6 +99,7 @@ void c64_rex_ep256_cartridge_device::device_reset() m_exrom = 0; m_reset = 1; m_bank = 0; + m_socket = 0; } @@ -138,7 +118,7 @@ UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offs else { offs_t addr = (m_bank << 13) | (offset & 0x1fff); - data = m_eprom->base()[addr]; + data = m_eproms[m_socket]->read_rom(space, addr); } } else if (!io2) @@ -182,6 +162,7 @@ void c64_rex_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offse m_reset = 0; - m_bank = ((data & 0x07) << 2) | ((data >> 5) & 0x03); + m_socket = data & 0x07; + m_bank = (data >> 5) & 0x03; } } diff --git a/src/emu/bus/c64/rex_ep256.h b/src/emu/bus/c64/rex_ep256.h index f60d0f19518..e69c8c2fba2 100644 --- a/src/emu/bus/c64/rex_ep256.h +++ b/src/emu/bus/c64/rex_ep256.h @@ -16,7 +16,8 @@ #include "emu.h" -#include "imagedev/cartslot.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "exp.h" @@ -35,7 +36,6 @@ public: c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); // optional information overrides - virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; protected: @@ -48,9 +48,9 @@ protected: virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); private: - required_memory_region m_eprom; - - UINT8 m_bank; + generic_slot_device *m_eproms[8]; + + UINT8 m_bank, m_socket; int m_reset; }; |