src/mess/machine/comxexp.h
| r15813 | r15814 | |
| 79 | 79 | }; |
| 80 | 80 | |
| 81 | 81 | |
| 82 | | // ======================> device_comx_expansion_card_interface |
| 82 | // ======================> comx_expansion_slot_device |
| 83 | 83 | |
| 84 | | // class representing interface-specific live comx_expansion card |
| 85 | | class device_comx_expansion_card_interface : public device_slot_card_interface |
| 86 | | { |
| 87 | | public: |
| 88 | | // construction/destruction |
| 89 | | device_comx_expansion_card_interface(const machine_config &mconfig, device_t &device); |
| 90 | | virtual ~device_comx_expansion_card_interface(); |
| 84 | class device_comx_expansion_card_interface; |
| 91 | 85 | |
| 92 | | // signals |
| 93 | | virtual void comx_ds_w(int state) { }; |
| 94 | | virtual void comx_q_w(int state) { }; |
| 95 | | |
| 96 | | // memory access |
| 97 | | virtual UINT8 comx_mrd_r(offs_t offset, int *extrom) { return 0; }; |
| 98 | | virtual void comx_mwr_w(offs_t offset, UINT8 data) { }; |
| 99 | | |
| 100 | | // I/O access |
| 101 | | virtual UINT8 comx_io_r(offs_t offset) { return 0; }; |
| 102 | | virtual void comx_io_w(offs_t offset, UINT8 data) { }; |
| 103 | | |
| 104 | | // video |
| 105 | | virtual UINT32 comx_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return false; } |
| 106 | | }; |
| 107 | | |
| 108 | | |
| 109 | | // ======================> comx_expansion_slot_device |
| 110 | | |
| 111 | 86 | class comx_expansion_slot_device : public device_t, |
| 112 | 87 | public comx_expansion_slot_interface, |
| 113 | 88 | public device_slot_interface |
| r15813 | r15814 | |
| 148 | 123 | }; |
| 149 | 124 | |
| 150 | 125 | |
| 126 | // ======================> device_comx_expansion_card_interface |
| 127 | |
| 128 | // class representing interface-specific live comx_expansion card |
| 129 | class device_comx_expansion_card_interface : public device_slot_card_interface |
| 130 | { |
| 131 | friend class comx_expansion_slot_device; |
| 132 | |
| 133 | public: |
| 134 | // construction/destruction |
| 135 | device_comx_expansion_card_interface(const machine_config &mconfig, device_t &device); |
| 136 | virtual ~device_comx_expansion_card_interface(); |
| 137 | |
| 138 | protected: |
| 139 | // signals |
| 140 | virtual void comx_ds_w(int state) { }; |
| 141 | virtual void comx_q_w(int state) { }; |
| 142 | |
| 143 | // memory access |
| 144 | virtual UINT8 comx_mrd_r(offs_t offset, int *extrom) { return 0; }; |
| 145 | virtual void comx_mwr_w(offs_t offset, UINT8 data) { }; |
| 146 | |
| 147 | // I/O access |
| 148 | virtual UINT8 comx_io_r(offs_t offset) { return 0; }; |
| 149 | virtual void comx_io_w(offs_t offset, UINT8 data) { }; |
| 150 | |
| 151 | // video |
| 152 | virtual UINT32 comx_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return false; } |
| 153 | |
| 154 | comx_expansion_slot_device *m_slot; |
| 155 | }; |
| 156 | |
| 157 | |
| 151 | 158 | // device type definition |
| 152 | 159 | extern const device_type COMX_EXPANSION_SLOT; |
| 153 | 160 | |
src/mess/machine/comx_eb.c
| r15813 | r15814 | |
| 75 | 75 | |
| 76 | 76 | ROM_START( comx_eb ) |
| 77 | 77 | ROM_REGION( 0x1000, "e000", 0 ) |
| 78 | | ROM_LOAD( "expansion.e5", 0x0000, 0x1000, CRC(52cb44e2) SHA1(3f9a3d9940b36d4fee5eca9f1359c99d7ed545b9) ) |
| 79 | | |
| 80 | | ROM_REGION( 0x1000, "fm31", 0 ) |
| 81 | | ROM_LOAD( "f&m.expansion.3.1.e5", 0x0000, 0x1000, CRC(818ca2ef) SHA1(ea000097622e7fd472d53e7899e3c83773433045) ) |
| 82 | | |
| 83 | | ROM_REGION( 0x1000, "fm32", 0 ) |
| 84 | | ROM_LOAD( "f&m.expansion.3.2.e5", 0x0000, 0x1000, CRC(0f0fc960) SHA1(eb6b6e7bc9e761d13554482025d8cb5e260c0619) ) |
| 78 | ROM_SYSTEM_BIOS( 0, "comx", "Original" ) |
| 79 | ROMX_LOAD( "expansion.e5", 0x0000, 0x1000, CRC(52cb44e2) SHA1(3f9a3d9940b36d4fee5eca9f1359c99d7ed545b9), ROM_BIOS(1) ) |
| 80 | ROM_SYSTEM_BIOS( 1, "fm31", "F&M 3.1" ) |
| 81 | ROMX_LOAD( "f&m.expansion.3.1.e5", 0x0000, 0x1000, CRC(818ca2ef) SHA1(ea000097622e7fd472d53e7899e3c83773433045), ROM_BIOS(2) ) |
| 82 | ROM_SYSTEM_BIOS( 2, "fm32", "F&M 3.2" ) |
| 83 | ROMX_LOAD( "f&m.expansion.3.2.e5", 0x0000, 0x1000, CRC(0f0fc960) SHA1(eb6b6e7bc9e761d13554482025d8cb5e260c0619), ROM_BIOS(3) ) |
| 85 | 84 | ROM_END |
| 86 | 85 | |
| 87 | 86 | |
| r15813 | r15814 | |
| 180 | 179 | |
| 181 | 180 | for (slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 182 | 181 | { |
| 183 | | if (!strcmp(tag, m_slot[slot]->tag())) break; |
| 182 | if (!strcmp(tag, m_expansion_slot[slot]->tag())) break; |
| 184 | 183 | } |
| 185 | 184 | |
| 186 | 185 | assert(slot < MAX_EB_SLOTS); |
| r15813 | r15814 | |
| 194 | 193 | irq |= m_int[slot]; |
| 195 | 194 | } |
| 196 | 195 | |
| 197 | | m_owner_slot->int_w(irq); |
| 196 | m_slot->int_w(irq); |
| 198 | 197 | } |
| 199 | 198 | |
| 200 | 199 | |
| r15813 | r15814 | |
| 208 | 207 | |
| 209 | 208 | for (slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 210 | 209 | { |
| 211 | | if (!strcmp(tag, m_slot[slot]->tag())) break; |
| 210 | if (!strcmp(tag, m_expansion_slot[slot]->tag())) break; |
| 212 | 211 | } |
| 213 | 212 | |
| 214 | 213 | assert(slot < MAX_EB_SLOTS); |
| r15813 | r15814 | |
| 222 | 221 | ef4 |= m_ef4[slot]; |
| 223 | 222 | } |
| 224 | 223 | |
| 225 | | m_owner_slot->ef4_w(ef4); |
| 224 | m_slot->ef4_w(ef4); |
| 226 | 225 | } |
| 227 | 226 | |
| 228 | 227 | |
| r15813 | r15814 | |
| 249 | 248 | |
| 250 | 249 | void comx_eb_device::device_start() |
| 251 | 250 | { |
| 252 | | m_owner_slot = dynamic_cast<comx_expansion_slot_device *>(owner()); |
| 251 | m_expansion_slot[0] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT1_TAG)); |
| 252 | m_expansion_slot[1] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT2_TAG)); |
| 253 | m_expansion_slot[2] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT3_TAG)); |
| 254 | m_expansion_slot[3] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT4_TAG)); |
| 253 | 255 | |
| 254 | | m_slot[0] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT1_TAG)); |
| 255 | | m_slot[1] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT2_TAG)); |
| 256 | | m_slot[2] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT3_TAG)); |
| 257 | | m_slot[3] = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT4_TAG)); |
| 258 | | |
| 259 | 256 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 260 | 257 | { |
| 261 | 258 | m_int[slot] = CLEAR_LINE; |
| r15813 | r15814 | |
| 283 | 280 | { |
| 284 | 281 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 285 | 282 | { |
| 286 | | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 283 | if (BIT(m_select, slot) && m_expansion_slot[slot] != NULL) |
| 287 | 284 | { |
| 288 | | m_slot[slot]->q_w(state); |
| 285 | m_expansion_slot[slot]->q_w(state); |
| 289 | 286 | } |
| 290 | 287 | } |
| 291 | 288 | } |
| r15813 | r15814 | |
| 312 | 309 | { |
| 313 | 310 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 314 | 311 | { |
| 315 | | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 312 | if (BIT(m_select, slot) && m_expansion_slot[slot] != NULL) |
| 316 | 313 | { |
| 317 | | data |= m_slot[slot]->mrd_r(offset, extrom); |
| 314 | data |= m_expansion_slot[slot]->mrd_r(offset, extrom); |
| 318 | 315 | } |
| 319 | 316 | } |
| 320 | 317 | } |
| r15813 | r15814 | |
| 331 | 328 | { |
| 332 | 329 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 333 | 330 | { |
| 334 | | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 331 | if (BIT(m_select, slot) && m_expansion_slot[slot] != NULL) |
| 335 | 332 | { |
| 336 | | m_slot[slot]->mwr_w(offset, data); |
| 333 | m_expansion_slot[slot]->mwr_w(offset, data); |
| 337 | 334 | } |
| 338 | 335 | } |
| 339 | 336 | } |
| r15813 | r15814 | |
| 349 | 346 | |
| 350 | 347 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 351 | 348 | { |
| 352 | | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 349 | if (BIT(m_select, slot) && m_expansion_slot[slot] != NULL) |
| 353 | 350 | { |
| 354 | | data |= m_slot[slot]->io_r(offset); |
| 351 | data |= m_expansion_slot[slot]->io_r(offset); |
| 355 | 352 | } |
| 356 | 353 | } |
| 357 | 354 | |
| r15813 | r15814 | |
| 371 | 368 | |
| 372 | 369 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 373 | 370 | { |
| 374 | | if (m_slot[slot] != NULL) |
| 371 | if (m_expansion_slot[slot] != NULL) |
| 375 | 372 | { |
| 376 | | m_slot[slot]->ds_w(BIT(m_select, slot)); |
| 373 | m_expansion_slot[slot]->ds_w(BIT(m_select, slot)); |
| 377 | 374 | } |
| 378 | 375 | } |
| 379 | 376 | } |
| 380 | 377 | |
| 381 | 378 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 382 | 379 | { |
| 383 | | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 380 | if (BIT(m_select, slot) && m_expansion_slot[slot] != NULL) |
| 384 | 381 | { |
| 385 | | m_slot[slot]->io_w(offset, data); |
| 382 | m_expansion_slot[slot]->io_w(offset, data); |
| 386 | 383 | } |
| 387 | 384 | } |
| 388 | 385 | } |
| r15813 | r15814 | |
| 398 | 395 | |
| 399 | 396 | for (int slot = 0; slot < MAX_EB_SLOTS; slot++) |
| 400 | 397 | { |
| 401 | | if (BIT(m_select, slot) && m_slot[slot] != NULL) |
| 398 | if (BIT(m_select, slot) && m_expansion_slot[slot] != NULL) |
| 402 | 399 | { |
| 403 | | m_slot[slot]->screen_update(screen, bitmap, cliprect); |
| 400 | m_expansion_slot[slot]->screen_update(screen, bitmap, cliprect); |
| 404 | 401 | } |
| 405 | 402 | } |
| 406 | 403 | |