src/mess/machine/comx_eb.c
| r12095 | r12096 | |
| 156 | 156 | |
| 157 | 157 | void comx_eb_device::device_start() |
| 158 | 158 | { |
| 159 | | m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG); |
| 159 | m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG); |
| 160 | 160 | |
| 161 | | m_slot1 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT1_TAG)); |
| 162 | | m_slot2 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT2_TAG)); |
| 163 | | m_slot3 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT3_TAG)); |
| 164 | | m_slot4 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT4_TAG)); |
| 161 | m_slot[0] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT1_TAG)); |
| 162 | m_slot[1] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT2_TAG)); |
| 163 | m_slot[2] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT3_TAG)); |
| 164 | m_slot[3] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT4_TAG)); |
| 165 | 165 | m_owner = dynamic_cast<comx_expansion_slot_device *>(owner()); |
| 166 | 166 | |
| 167 | 167 | m_rom = subregion("e000")->base(); |
| r12095 | r12096 | |
| 185 | 185 | { |
| 186 | 186 | UINT8 data = 0; |
| 187 | 187 | |
| 188 | | if (offset >= 0xe000 && offset < 0xf000) |
| 188 | if (offset >= 0x1000 && offset < 0x1800) |
| 189 | 189 | { |
| 190 | data = m_rom[offset & 0x7ff]; |
| 191 | } |
| 192 | else if (offset >= 0xe000 && offset < 0xf000) |
| 193 | { |
| 190 | 194 | data = m_rom[offset & 0xfff]; |
| 191 | 195 | } |
| 196 | else |
| 197 | { |
| 198 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 199 | { |
| 200 | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 201 | { |
| 202 | data |= m_slot[slot]->comx_mrd_r(offset); |
| 203 | } |
| 204 | } |
| 205 | } |
| 192 | 206 | |
| 193 | 207 | return data; |
| 194 | 208 | } |
| r12095 | r12096 | |
| 200 | 214 | |
| 201 | 215 | void comx_eb_device::comx_q_w(int state) |
| 202 | 216 | { |
| 217 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 218 | { |
| 219 | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 220 | { |
| 221 | m_slot[slot]->comx_q_w(state); |
| 222 | } |
| 223 | } |
| 203 | 224 | } |
| 204 | 225 | |
| 205 | 226 | |
| r12095 | r12096 | |
| 209 | 230 | |
| 210 | 231 | void comx_eb_device::comx_mwr_w(offs_t offset, UINT8 data) |
| 211 | 232 | { |
| 233 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 234 | { |
| 235 | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 236 | { |
| 237 | m_slot[slot]->comx_mwr_w(offset, data); |
| 238 | } |
| 239 | } |
| 212 | 240 | } |
| 213 | 241 | |
| 214 | 242 | |
| r12095 | r12096 | |
| 218 | 246 | |
| 219 | 247 | UINT8 comx_eb_device::comx_io_r(offs_t offset) |
| 220 | 248 | { |
| 221 | | return 0; |
| 249 | UINT8 data = 0; |
| 250 | |
| 251 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 252 | { |
| 253 | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 254 | { |
| 255 | data |= m_slot[slot]->comx_io_r(offset); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | return data; |
| 222 | 260 | } |
| 223 | 261 | |
| 224 | 262 | |
| r12095 | r12096 | |
| 228 | 266 | |
| 229 | 267 | void comx_eb_device::comx_io_w(offs_t offset, UINT8 data) |
| 230 | 268 | { |
| 269 | if (offset == 1) |
| 270 | { |
| 271 | m_select = data; |
| 272 | } |
| 273 | |
| 274 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 275 | { |
| 276 | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 277 | { |
| 278 | m_slot[slot]->comx_io_w(offset, data); |
| 279 | } |
| 280 | } |
| 231 | 281 | } |
| 232 | 282 | |
| 233 | 283 | |
src/mess/machine/comx_eb.h
| r12095 | r12096 | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | //************************************************************************** |
| 30 | // CONSTANTS |
| 31 | //************************************************************************** |
| 32 | |
| 33 | #define MAX_EB_SLOTS 4 |
| 34 | |
| 35 | |
| 36 | |
| 37 | //************************************************************************** |
| 30 | 38 | // TYPE DEFINITIONS |
| 31 | 39 | //************************************************************************** |
| 32 | 40 | |
| r12095 | r12096 | |
| 63 | 71 | UINT8 *m_rom; // program ROM |
| 64 | 72 | |
| 65 | 73 | comx_expansion_slot_device *m_owner; |
| 74 | device_comx_expansion_card_interface *m_slot[MAX_EB_SLOTS]; |
| 66 | 75 | |
| 67 | | comx_expansion_slot_device *m_slot1; |
| 68 | | comx_expansion_slot_device *m_slot2; |
| 69 | | comx_expansion_slot_device *m_slot3; |
| 70 | | comx_expansion_slot_device *m_slot4; |
| 71 | | |
| 72 | | comx_expansion_slot_device *m_active; |
| 76 | UINT8 m_select; |
| 73 | 77 | }; |
| 74 | 78 | |
| 75 | 79 | |
src/mess/drivers/comx35.c
| r12095 | r12096 | |
| 382 | 382 | |
| 383 | 383 | // expansion bus |
| 384 | 384 | MCFG_COMX_EXPANSION_BUS_ADD(CDP1802_TAG, CDP1869_CPU_CLK_PAL, expansion_intf) |
| 385 | | MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, NULL) |
| 385 | MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, "fd") |
| 386 | 386 | |
| 387 | 387 | /* internal ram */ |
| 388 | 388 | MCFG_RAM_ADD(RAM_TAG) |
| r12095 | r12096 | |
| 411 | 411 | |
| 412 | 412 | // expansion bus |
| 413 | 413 | MCFG_COMX_EXPANSION_BUS_ADD(CDP1802_TAG, CDP1869_CPU_CLK_NTSC, expansion_intf) |
| 414 | | MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, NULL) |
| 414 | MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, "fd") |
| 415 | 415 | |
| 416 | 416 | /* internal ram */ |
| 417 | 417 | MCFG_RAM_ADD(RAM_TAG) |