trunk/src/emu/bus/c64/dela_ep256.c
| r32639 | r32640 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | //------------------------------------------------- |
| 24 | | // ROM( c64_dela_ep256 ) |
| 25 | | //------------------------------------------------- |
| 26 | | |
| 27 | | ROM_START( c64_dela_ep256 ) |
| 28 | | ROM_REGION( 0x40000, "eprom", 0 ) |
| 29 | | ROM_CART_LOAD( "rom1", 0x00000, 0x08000, ROM_MIRROR ) |
| 30 | | ROM_CART_LOAD( "rom2", 0x08000, 0x08000, ROM_MIRROR ) |
| 31 | | ROM_CART_LOAD( "rom3", 0x10000, 0x08000, ROM_MIRROR ) |
| 32 | | ROM_CART_LOAD( "rom4", 0x18000, 0x08000, ROM_MIRROR ) |
| 33 | | ROM_CART_LOAD( "rom5", 0x20000, 0x08000, ROM_MIRROR ) |
| 34 | | ROM_CART_LOAD( "rom6", 0x28000, 0x08000, ROM_MIRROR ) |
| 35 | | ROM_CART_LOAD( "rom7", 0x30000, 0x08000, ROM_MIRROR ) |
| 36 | | ROM_CART_LOAD( "rom8", 0x38000, 0x08000, ROM_MIRROR ) |
| 37 | | ROM_END |
| 38 | | |
| 39 | | |
| 40 | | //------------------------------------------------- |
| 41 | | // rom_region - device-specific ROM region |
| 42 | | //------------------------------------------------- |
| 43 | | |
| 44 | | const rom_entry *c64_dela_ep256_cartridge_device::device_rom_region() const |
| 45 | | { |
| 46 | | return ROM_NAME( c64_dela_ep256 ); |
| 47 | | } |
| 48 | | |
| 49 | | |
| 50 | | //------------------------------------------------- |
| 51 | 24 | // MACHINE_CONFIG_FRAGMENT( c64_dela_ep256 ) |
| 52 | 25 | //------------------------------------------------- |
| 53 | 26 | |
| 54 | 27 | static MACHINE_CONFIG_FRAGMENT( c64_dela_ep256 ) |
| 55 | | MCFG_CARTSLOT_ADD("rom1") |
| 56 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 57 | | MCFG_CARTSLOT_ADD("rom2") |
| 58 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 59 | | MCFG_CARTSLOT_ADD("rom3") |
| 60 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 61 | | MCFG_CARTSLOT_ADD("rom4") |
| 62 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 63 | | MCFG_CARTSLOT_ADD("rom5") |
| 64 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 65 | | MCFG_CARTSLOT_ADD("rom6") |
| 66 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 67 | | MCFG_CARTSLOT_ADD("rom7") |
| 68 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 69 | | MCFG_CARTSLOT_ADD("rom8") |
| 70 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 28 | MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL) |
| 29 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 30 | MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL) |
| 31 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 32 | MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL) |
| 33 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 34 | MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL) |
| 35 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 36 | MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL) |
| 37 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 38 | MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL) |
| 39 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 40 | MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL) |
| 41 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 42 | MCFG_GENERIC_SOCKET_ADD("rom8", generic_linear_slot, NULL) |
| 43 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 71 | 44 | MACHINE_CONFIG_END |
| 72 | 45 | |
| 73 | 46 | |
| r32639 | r32640 | |
| 93 | 66 | |
| 94 | 67 | c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 95 | 68 | device_t(mconfig, C64_DELA_EP256, "C64 Dela 256KB EPROM cartridge", tag, owner, clock, "delep256", __FILE__), |
| 96 | | device_c64_expansion_card_interface(mconfig, *this), |
| 97 | | m_eprom(*this, "eprom") |
| 69 | device_c64_expansion_card_interface(mconfig, *this) |
| 98 | 70 | { |
| 71 | for (int i = 0; i < 8; i++) |
| 72 | { |
| 73 | char str[6]; |
| 74 | sprintf(str, "rom%i", i + 1); |
| 75 | m_eproms[i] = subdevice<generic_slot_device>(str); |
| 76 | } |
| 99 | 77 | } |
| 100 | 78 | |
| 101 | 79 | |
| r32639 | r32640 | |
| 108 | 86 | // state saving |
| 109 | 87 | save_item(NAME(m_bank)); |
| 110 | 88 | save_item(NAME(m_reset)); |
| 89 | save_item(NAME(m_socket)); |
| 111 | 90 | } |
| 112 | 91 | |
| 113 | 92 | |
| r32639 | r32640 | |
| 120 | 99 | m_reset = 1; |
| 121 | 100 | m_bank = 0; |
| 122 | 101 | m_exrom = 0; |
| 102 | m_socket = 0; |
| 123 | 103 | } |
| 124 | 104 | |
| 125 | 105 | |
| r32639 | r32640 | |
| 138 | 118 | else |
| 139 | 119 | { |
| 140 | 120 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
| 141 | | data = m_eprom->base()[addr]; |
| 121 | data = m_eproms[m_socket]->read_rom(space, addr); |
| 142 | 122 | } |
| 143 | 123 | } |
| 144 | 124 | |
| r32639 | r32640 | |
| 171 | 151 | |
| 172 | 152 | m_reset = 0; |
| 173 | 153 | |
| 174 | | m_bank = ((data & 0x07) << 2) | ((data >> 4) & 0x03); |
| 154 | m_socket = data & 0x07; |
| 155 | m_bank = (data >> 4) & 0x03; |
| 175 | 156 | |
| 176 | 157 | m_exrom = BIT(data, 7); |
| 177 | 158 | } |
trunk/src/emu/bus/c64/dela_ep7x8.c
| r32639 | r32640 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | //------------------------------------------------- |
| 24 | | // ROM( c64_dela_ep7x8 ) |
| 25 | | //------------------------------------------------- |
| 26 | | |
| 27 | | ROM_START( c64_dela_ep7x8 ) |
| 28 | | ROM_REGION( 0x10000, "eprom", 0 ) |
| 29 | | ROM_CART_LOAD( "rom1", 0x2000, 0x2000, ROM_MIRROR ) |
| 30 | | ROM_CART_LOAD( "rom2", 0x4000, 0x2000, ROM_MIRROR ) |
| 31 | | ROM_CART_LOAD( "rom3", 0x6000, 0x2000, ROM_MIRROR ) |
| 32 | | ROM_CART_LOAD( "rom4", 0x8000, 0x2000, ROM_MIRROR ) |
| 33 | | ROM_CART_LOAD( "rom5", 0xa000, 0x2000, ROM_MIRROR ) |
| 34 | | ROM_CART_LOAD( "rom6", 0xc000, 0x2000, ROM_MIRROR ) |
| 35 | | ROM_CART_LOAD( "rom7", 0xe000, 0x2000, ROM_MIRROR ) |
| 36 | | ROM_END |
| 37 | | |
| 38 | | |
| 39 | | //------------------------------------------------- |
| 40 | | // rom_region - device-specific ROM region |
| 41 | | //------------------------------------------------- |
| 42 | | |
| 43 | | const rom_entry *c64_dela_ep7x8_cartridge_device::device_rom_region() const |
| 44 | | { |
| 45 | | return ROM_NAME( c64_dela_ep7x8 ); |
| 46 | | } |
| 47 | | |
| 48 | | |
| 49 | | //------------------------------------------------- |
| 50 | 24 | // MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 ) |
| 51 | 25 | //------------------------------------------------- |
| 52 | 26 | |
| 53 | 27 | static MACHINE_CONFIG_FRAGMENT( c64_dela_ep7x8 ) |
| 54 | | MCFG_CARTSLOT_ADD("rom1") |
| 55 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 56 | | MCFG_CARTSLOT_ADD("rom2") |
| 57 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 58 | | MCFG_CARTSLOT_ADD("rom3") |
| 59 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 60 | | MCFG_CARTSLOT_ADD("rom4") |
| 61 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 62 | | MCFG_CARTSLOT_ADD("rom5") |
| 63 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 64 | | MCFG_CARTSLOT_ADD("rom6") |
| 65 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 66 | | MCFG_CARTSLOT_ADD("rom7") |
| 67 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 28 | MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL) |
| 29 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 30 | MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL) |
| 31 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 32 | MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL) |
| 33 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 34 | MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL) |
| 35 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 36 | MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL) |
| 37 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 38 | MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL) |
| 39 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 40 | MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL) |
| 41 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 68 | 42 | MACHINE_CONFIG_END |
| 69 | 43 | |
| 70 | 44 | |
| r32639 | r32640 | |
| 90 | 64 | c64_dela_ep7x8_cartridge_device::c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 91 | 65 | device_t(mconfig, C64_DELA_EP7X8, "C64 Dela 7x8KB EPROM cartridge", tag, owner, clock, "ep7x8", __FILE__), |
| 92 | 66 | device_c64_expansion_card_interface(mconfig, *this), |
| 93 | | m_eprom(*this, "eprom") |
| 67 | m_eprom1(*this, "rom1"), |
| 68 | m_eprom2(*this, "rom2"), |
| 69 | m_eprom3(*this, "rom3"), |
| 70 | m_eprom4(*this, "rom4"), |
| 71 | m_eprom5(*this, "rom5"), |
| 72 | m_eprom6(*this, "rom6"), |
| 73 | m_eprom7(*this, "rom7") |
| 94 | 74 | { |
| 95 | 75 | } |
| 96 | 76 | |
| r32639 | r32640 | |
| 128 | 108 | offs_t addr = offset & 0x1fff; |
| 129 | 109 | |
| 130 | 110 | if (!BIT(m_bank, 0)) data |= m_roml[addr]; |
| 131 | | if (!BIT(m_bank, 1)) data |= m_eprom->base()[0x2000 + addr]; |
| 132 | | if (!BIT(m_bank, 2)) data |= m_eprom->base()[0x4000 + addr]; |
| 133 | | if (!BIT(m_bank, 3)) data |= m_eprom->base()[0x6000 + addr]; |
| 134 | | if (!BIT(m_bank, 4)) data |= m_eprom->base()[0x8000 + addr]; |
| 135 | | if (!BIT(m_bank, 5)) data |= m_eprom->base()[0xa000 + addr]; |
| 136 | | if (!BIT(m_bank, 6)) data |= m_eprom->base()[0xc000 + addr]; |
| 137 | | if (!BIT(m_bank, 7)) data |= m_eprom->base()[0xe000 + addr]; |
| 111 | if (!BIT(m_bank, 1)) data |= m_eprom1->read_rom(space, addr); |
| 112 | if (!BIT(m_bank, 2)) data |= m_eprom2->read_rom(space, addr); |
| 113 | if (!BIT(m_bank, 3)) data |= m_eprom3->read_rom(space, addr); |
| 114 | if (!BIT(m_bank, 4)) data |= m_eprom4->read_rom(space, addr); |
| 115 | if (!BIT(m_bank, 5)) data |= m_eprom5->read_rom(space, addr); |
| 116 | if (!BIT(m_bank, 6)) data |= m_eprom6->read_rom(space, addr); |
| 117 | if (!BIT(m_bank, 7)) data |= m_eprom7->read_rom(space, addr); |
| 138 | 118 | } |
| 139 | 119 | |
| 140 | 120 | return data; |
trunk/src/emu/bus/c64/dela_ep64.c
| r32639 | r32640 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | //------------------------------------------------- |
| 24 | | // ROM( c64_dela_ep64 ) |
| 25 | | //------------------------------------------------- |
| 26 | | |
| 27 | | ROM_START( c64_dela_ep64 ) |
| 28 | | ROM_REGION( 0x10000, "eprom", 0 ) |
| 29 | | ROM_CART_LOAD( "rom1", 0x0000, 0x08000, ROM_MIRROR ) |
| 30 | | ROM_CART_LOAD( "rom2", 0x8000, 0x08000, ROM_MIRROR ) |
| 31 | | ROM_END |
| 32 | | |
| 33 | | |
| 34 | | //------------------------------------------------- |
| 35 | | // rom_region - device-specific ROM region |
| 36 | | //------------------------------------------------- |
| 37 | | |
| 38 | | const rom_entry *c64_dela_ep64_cartridge_device::device_rom_region() const |
| 39 | | { |
| 40 | | return ROM_NAME( c64_dela_ep64 ); |
| 41 | | } |
| 42 | | |
| 43 | | |
| 44 | | //------------------------------------------------- |
| 45 | 24 | // MACHINE_CONFIG_FRAGMENT( c64_dela_ep64 ) |
| 46 | 25 | //------------------------------------------------- |
| 47 | 26 | |
| 48 | 27 | static MACHINE_CONFIG_FRAGMENT( c64_dela_ep64 ) |
| 49 | | MCFG_CARTSLOT_ADD("rom1") |
| 50 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 51 | | MCFG_CARTSLOT_ADD("rom2") |
| 52 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 28 | MCFG_GENERIC_SOCKET_ADD("eprom1", generic_linear_slot, NULL) |
| 29 | MCFG_GENERIC_EXTENSIONS("rom,bin") |
| 30 | MCFG_GENERIC_SOCKET_ADD("eprom2", generic_linear_slot, NULL) |
| 31 | MCFG_GENERIC_EXTENSIONS("rom,bin") |
| 53 | 32 | MACHINE_CONFIG_END |
| 54 | 33 | |
| 55 | 34 | |
| r32639 | r32640 | |
| 75 | 54 | c64_dela_ep64_cartridge_device::c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 76 | 55 | device_t(mconfig, C64_DELA_EP64, "C64 Rex 64KB EPROM cartridge", tag, owner, clock, "c64_dela_ep64", __FILE__), |
| 77 | 56 | device_c64_expansion_card_interface(mconfig, *this), |
| 78 | | m_eprom(*this, "eprom") |
| 57 | m_eprom1(*this, "eprom1"), |
| 58 | m_eprom2(*this, "eprom2") |
| 79 | 59 | { |
| 80 | 60 | } |
| 81 | 61 | |
| r32639 | r32640 | |
| 124 | 104 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
| 125 | 105 | |
| 126 | 106 | if (!m_rom0_ce) data |= m_roml[offset & 0x1fff]; |
| 127 | | if (!m_rom1_ce) data |= m_eprom->base()[0x0000 + addr]; |
| 128 | | if (!m_rom2_ce) data |= m_eprom->base()[0x8000 + addr]; |
| 107 | if (!m_rom1_ce) data |= m_eprom1->read_rom(space, addr); |
| 108 | if (!m_rom2_ce) data |= m_eprom2->read_rom(space, addr); |
| 129 | 109 | } |
| 130 | 110 | } |
| 131 | 111 | |
trunk/src/emu/bus/c64/dela_ep7x8.h
| r32639 | r32640 | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | #include "emu.h" |
| 19 | | #include "imagedev/cartslot.h" |
| 19 | #include "bus/generic/slot.h" |
| 20 | #include "bus/generic/carts.h" |
| 20 | 21 | #include "exp.h" |
| 21 | 22 | |
| 22 | 23 | |
| r32639 | r32640 | |
| 35 | 36 | c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 36 | 37 | |
| 37 | 38 | // optional information overrides |
| 38 | | virtual const rom_entry *device_rom_region() const; |
| 39 | 39 | virtual machine_config_constructor device_mconfig_additions() const; |
| 40 | 40 | |
| 41 | 41 | protected: |
| r32639 | r32640 | |
| 48 | 48 | 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); |
| 49 | 49 | |
| 50 | 50 | private: |
| 51 | | required_memory_region m_eprom; |
| 51 | required_device<generic_slot_device> m_eprom1; |
| 52 | required_device<generic_slot_device> m_eprom2; |
| 53 | required_device<generic_slot_device> m_eprom3; |
| 54 | required_device<generic_slot_device> m_eprom4; |
| 55 | required_device<generic_slot_device> m_eprom5; |
| 56 | required_device<generic_slot_device> m_eprom6; |
| 57 | required_device<generic_slot_device> m_eprom7; |
| 52 | 58 | |
| 53 | 59 | UINT8 m_bank; |
| 54 | 60 | }; |
trunk/src/emu/bus/c64/reu.c
| r32639 | r32640 | |
| 20 | 20 | #define MOS8726R1_TAG "u1" |
| 21 | 21 | |
| 22 | 22 | |
| 23 | | |
| 24 | 23 | //************************************************************************** |
| 25 | 24 | // DEVICE DEFINITIONS |
| 26 | 25 | //************************************************************************** |
| r32639 | r32640 | |
| 31 | 30 | |
| 32 | 31 | |
| 33 | 32 | //------------------------------------------------- |
| 34 | | // ROM( c64_reu ) |
| 35 | | //------------------------------------------------- |
| 36 | | |
| 37 | | ROM_START( c64_reu ) |
| 38 | | ROM_REGION( 0x8000, "roml", 0 ) |
| 39 | | ROM_CART_LOAD( "rom", 0x0000, 0x8000, ROM_MIRROR ) |
| 40 | | ROM_END |
| 41 | | |
| 42 | | |
| 43 | | //------------------------------------------------- |
| 44 | | // rom_region - device-specific ROM region |
| 45 | | //------------------------------------------------- |
| 46 | | |
| 47 | | const rom_entry *c64_reu_cartridge_device::device_rom_region() const |
| 48 | | { |
| 49 | | return ROM_NAME( c64_reu ); |
| 50 | | } |
| 51 | | |
| 52 | | |
| 53 | | //------------------------------------------------- |
| 54 | 33 | // MACHINE_CONFIG_FRAGMENT( c64_reu ) |
| 55 | 34 | //------------------------------------------------- |
| 56 | 35 | |
| 57 | 36 | static MACHINE_CONFIG_FRAGMENT( c64_reu ) |
| 58 | 37 | MCFG_MOS8726_ADD(MOS8726R1_TAG) |
| 59 | 38 | |
| 60 | | MCFG_CARTSLOT_ADD("rom") |
| 61 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 39 | MCFG_GENERIC_SOCKET_ADD("rom", generic_linear_slot, NULL) |
| 40 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 62 | 41 | MACHINE_CONFIG_END |
| 63 | 42 | |
| 64 | 43 | |
| r32639 | r32640 | |
| 86 | 65 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 87 | 66 | device_c64_expansion_card_interface(mconfig, *this), |
| 88 | 67 | m_dmac(*this, MOS8726R1_TAG), |
| 89 | | m_rom(*this, "rom"), |
| 68 | m_eprom(*this, "rom"), |
| 90 | 69 | m_ram(*this, "ram"), |
| 91 | 70 | m_variant(variant), |
| 92 | 71 | m_jp1(jp1), |
| r32639 | r32640 | |
| 137 | 116 | { |
| 138 | 117 | if (!m_dmac->romsel_r(roml, romh)) |
| 139 | 118 | { |
| 140 | | data = m_roml[offset & 0x7fff]; |
| 119 | data = m_eprom->read_rom(space, offset & 0x7fff); |
| 141 | 120 | } |
| 142 | 121 | else if (!io2) |
| 143 | 122 | { |
trunk/src/emu/bus/c64/reu.h
| r32639 | r32640 | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | #include "emu.h" |
| 19 | | #include "imagedev/cartslot.h" |
| 19 | #include "bus/generic/slot.h" |
| 20 | #include "bus/generic/carts.h" |
| 20 | 21 | #include "exp.h" |
| 21 | 22 | #include "machine/mos8726.h" |
| 22 | 23 | |
| r32639 | r32640 | |
| 36 | 37 | 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); |
| 37 | 38 | |
| 38 | 39 | // optional information overrides |
| 39 | | virtual const rom_entry *device_rom_region() const; |
| 40 | 40 | virtual machine_config_constructor device_mconfig_additions() const; |
| 41 | 41 | |
| 42 | 42 | protected: |
| r32639 | r32640 | |
| 56 | 56 | 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); |
| 57 | 57 | |
| 58 | 58 | required_device<mos8726_device> m_dmac; |
| 59 | | required_memory_region m_rom; |
| 59 | required_device<generic_slot_device> m_eprom; |
| 60 | 60 | optional_shared_ptr<UINT8> m_ram; |
| 61 | 61 | |
| 62 | 62 | int m_variant; |
trunk/src/emu/bus/c64/16kb.c
| r32639 | r32640 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | //------------------------------------------------- |
| 24 | | // ROM( c64_16kb ) |
| 25 | | //------------------------------------------------- |
| 26 | | |
| 27 | | ROM_START( c64_16kb ) |
| 28 | | ROM_REGION( 0x2000, "roml", 0 ) |
| 29 | | ROM_CART_LOAD( "roml", 0x0000, 0x2000, ROM_MIRROR ) |
| 30 | | |
| 31 | | ROM_REGION( 0x2000, "romh", 0 ) |
| 32 | | ROM_CART_LOAD( "romh", 0x0000, 0x2000, ROM_MIRROR ) |
| 33 | | ROM_END |
| 34 | | |
| 35 | | |
| 36 | | //------------------------------------------------- |
| 37 | | // rom_region - device-specific ROM region |
| 38 | | //------------------------------------------------- |
| 39 | | |
| 40 | | const rom_entry *c64_16kb_cartridge_device::device_rom_region() const |
| 41 | | { |
| 42 | | return ROM_NAME( c64_16kb ); |
| 43 | | } |
| 44 | | |
| 45 | | |
| 46 | | //------------------------------------------------- |
| 47 | 24 | // MACHINE_CONFIG_FRAGMENT( c64_16kb ) |
| 48 | 25 | //------------------------------------------------- |
| 49 | 26 | |
| 50 | 27 | static MACHINE_CONFIG_FRAGMENT( c64_16kb ) |
| 51 | | MCFG_CARTSLOT_ADD("roml") |
| 52 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,80") |
| 28 | MCFG_GENERIC_CARTSLOT_ADD("roml", generic_linear_slot, NULL) |
| 29 | MCFG_GENERIC_EXTENSIONS("rom,bin,80") |
| 53 | 30 | |
| 54 | | MCFG_CARTSLOT_ADD("romh") |
| 55 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a0,e0") |
| 31 | MCFG_GENERIC_CARTSLOT_ADD("romh", generic_linear_slot, NULL) |
| 32 | MCFG_GENERIC_EXTENSIONS("rom,bin,a0,e0") |
| 56 | 33 | MACHINE_CONFIG_END |
| 57 | 34 | |
| 58 | 35 | |
| r32639 | r32640 | |
| 103 | 80 | device_t(mconfig, C64_16KB, "C64 16KB EPROM cartridge", tag, owner, clock, "c64_16kb", __FILE__), |
| 104 | 81 | device_c64_expansion_card_interface(mconfig, *this), |
| 105 | 82 | m_sw1(*this, "SW1"), |
| 106 | | m_rom_low(*this, "roml"), |
| 107 | | m_rom_high(*this, "romh") |
| 83 | m_low(*this, "roml"), |
| 84 | m_high(*this, "romh") |
| 108 | 85 | { |
| 109 | 86 | } |
| 110 | 87 | |
| r32639 | r32640 | |
| 139 | 116 | { |
| 140 | 117 | if (!roml) |
| 141 | 118 | { |
| 142 | | data = m_rom_low->base()[offset & 0x1fff]; |
| 119 | data = m_low->read_rom(space, offset & 0x1fff); |
| 143 | 120 | } |
| 144 | 121 | else if (!romh) |
| 145 | 122 | { |
| 146 | | data = m_rom_high->base()[offset & 0x1fff]; |
| 123 | data = m_high->read_rom(space, offset & 0x1fff); |
| 147 | 124 | } |
| 148 | 125 | |
| 149 | 126 | return data; |
trunk/src/emu/bus/c64/rex_ep256.c
| r32639 | r32640 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | //------------------------------------------------- |
| 24 | | // ROM( c64_rex_ep256 ) |
| 25 | | //------------------------------------------------- |
| 26 | | |
| 27 | | ROM_START( c64_rex_ep256 ) |
| 28 | | ROM_REGION( 0x40000, "eprom", 0 ) |
| 29 | | ROM_CART_LOAD( "rom1", 0x00000, 0x08000, ROM_MIRROR ) |
| 30 | | ROM_CART_LOAD( "rom2", 0x08000, 0x08000, ROM_MIRROR ) |
| 31 | | ROM_CART_LOAD( "rom3", 0x10000, 0x08000, ROM_MIRROR ) |
| 32 | | ROM_CART_LOAD( "rom4", 0x18000, 0x08000, ROM_MIRROR ) |
| 33 | | ROM_CART_LOAD( "rom5", 0x20000, 0x08000, ROM_MIRROR ) |
| 34 | | ROM_CART_LOAD( "rom6", 0x28000, 0x08000, ROM_MIRROR ) |
| 35 | | ROM_CART_LOAD( "rom7", 0x30000, 0x08000, ROM_MIRROR ) |
| 36 | | ROM_CART_LOAD( "rom8", 0x38000, 0x08000, ROM_MIRROR ) |
| 37 | | ROM_END |
| 38 | | |
| 39 | | |
| 40 | | //------------------------------------------------- |
| 41 | | // rom_region - device-specific ROM region |
| 42 | | //------------------------------------------------- |
| 43 | | |
| 44 | | const rom_entry *c64_rex_ep256_cartridge_device::device_rom_region() const |
| 45 | | { |
| 46 | | return ROM_NAME( c64_rex_ep256 ); |
| 47 | | } |
| 48 | | |
| 49 | | |
| 50 | | //------------------------------------------------- |
| 51 | 24 | // MACHINE_CONFIG_FRAGMENT( c64_rex_ep256 ) |
| 52 | 25 | //------------------------------------------------- |
| 53 | 26 | |
| 54 | 27 | static MACHINE_CONFIG_FRAGMENT( c64_rex_ep256 ) |
| 55 | | MCFG_CARTSLOT_ADD("rom1") |
| 56 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 57 | | MCFG_CARTSLOT_ADD("rom2") |
| 58 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 59 | | MCFG_CARTSLOT_ADD("rom3") |
| 60 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 61 | | MCFG_CARTSLOT_ADD("rom4") |
| 62 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 63 | | MCFG_CARTSLOT_ADD("rom5") |
| 64 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 65 | | MCFG_CARTSLOT_ADD("rom6") |
| 66 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 67 | | MCFG_CARTSLOT_ADD("rom7") |
| 68 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 69 | | MCFG_CARTSLOT_ADD("rom8") |
| 70 | | MCFG_CARTSLOT_EXTENSION_LIST("rom,bin") |
| 28 | MCFG_GENERIC_SOCKET_ADD("rom1", generic_linear_slot, NULL) |
| 29 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 30 | MCFG_GENERIC_SOCKET_ADD("rom2", generic_linear_slot, NULL) |
| 31 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 32 | MCFG_GENERIC_SOCKET_ADD("rom3", generic_linear_slot, NULL) |
| 33 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 34 | MCFG_GENERIC_SOCKET_ADD("rom4", generic_linear_slot, NULL) |
| 35 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 36 | MCFG_GENERIC_SOCKET_ADD("rom5", generic_linear_slot, NULL) |
| 37 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 38 | MCFG_GENERIC_SOCKET_ADD("rom6", generic_linear_slot, NULL) |
| 39 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 40 | MCFG_GENERIC_SOCKET_ADD("rom7", generic_linear_slot, NULL) |
| 41 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 42 | MCFG_GENERIC_SOCKET_ADD("rom8", generic_linear_slot, NULL) |
| 43 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 71 | 44 | MACHINE_CONFIG_END |
| 72 | 45 | |
| 73 | 46 | |
| r32639 | r32640 | |
| 93 | 66 | |
| 94 | 67 | c64_rex_ep256_cartridge_device::c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 95 | 68 | device_t(mconfig, C64_REX_EP256, "C64 Rex 256KB EPROM cartridge", tag, owner, clock, "rexep256", __FILE__), |
| 96 | | device_c64_expansion_card_interface(mconfig, *this), |
| 97 | | m_eprom(*this, "eprom") |
| 69 | device_c64_expansion_card_interface(mconfig, *this) |
| 98 | 70 | { |
| 71 | for (int i = 0; i < 8; i++) |
| 72 | { |
| 73 | char str[6]; |
| 74 | sprintf(str, "rom%i", i + 1); |
| 75 | m_eproms[i] = subdevice<generic_slot_device>(str); |
| 76 | } |
| 99 | 77 | } |
| 100 | 78 | |
| 101 | 79 | |
| r32639 | r32640 | |
| 108 | 86 | // state saving |
| 109 | 87 | save_item(NAME(m_bank)); |
| 110 | 88 | save_item(NAME(m_reset)); |
| 89 | save_item(NAME(m_socket)); |
| 111 | 90 | } |
| 112 | 91 | |
| 113 | 92 | |
| r32639 | r32640 | |
| 120 | 99 | m_exrom = 0; |
| 121 | 100 | m_reset = 1; |
| 122 | 101 | m_bank = 0; |
| 102 | m_socket = 0; |
| 123 | 103 | } |
| 124 | 104 | |
| 125 | 105 | |
| r32639 | r32640 | |
| 138 | 118 | else |
| 139 | 119 | { |
| 140 | 120 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
| 141 | | data = m_eprom->base()[addr]; |
| 121 | data = m_eproms[m_socket]->read_rom(space, addr); |
| 142 | 122 | } |
| 143 | 123 | } |
| 144 | 124 | else if (!io2) |
| r32639 | r32640 | |
| 182 | 162 | |
| 183 | 163 | m_reset = 0; |
| 184 | 164 | |
| 185 | | m_bank = ((data & 0x07) << 2) | ((data >> 5) & 0x03); |
| 165 | m_socket = data & 0x07; |
| 166 | m_bank = (data >> 5) & 0x03; |
| 186 | 167 | } |
| 187 | 168 | } |