src/mess/machine/nubus.c
| r12587 | r12588 | |
| 139 | 139 | m_device_list.append(*card); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler) |
| 143 | { |
| 144 | m_maincpu = machine().device(m_cputag); |
| 145 | int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; |
| 146 | switch(buswidth) |
| 147 | { |
| 148 | case 32: |
| 149 | m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff); |
| 150 | break; |
| 151 | case 64: |
| 152 | m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, U64(0xffffffffffffffff)); |
| 153 | break; |
| 154 | default: |
| 155 | fatalerror("NUBUS: Bus width %d not supported", buswidth); |
| 156 | break; |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler) |
| 161 | { |
| 162 | m_maincpu = machine().device(m_cputag); |
| 163 | int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; |
| 164 | switch(buswidth) |
| 165 | { |
| 166 | case 32: |
| 167 | m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff); |
| 168 | break; |
| 169 | case 64: |
| 170 | m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, U64(0xffffffffffffffff)); |
| 171 | break; |
| 172 | default: |
| 173 | fatalerror("NUBUS: Bus width %d not supported", buswidth); |
| 174 | break; |
| 175 | } |
| 176 | } |
| 177 | |
| 142 | 178 | void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler) |
| 143 | 179 | { |
| 144 | 180 | m_maincpu = machine().device(m_cputag); |
| r12587 | r12588 | |
| 339 | 375 | romlen *= 2; |
| 340 | 376 | break; |
| 341 | 377 | |
| 378 | case 0xa5: // lanes 0, 2 |
| 379 | newrom = (UINT8 *)malloc(romlen*2); |
| 380 | memset(newrom, 0, romlen*2); |
| 381 | for (int i = 0; i < romlen/2; i++) |
| 382 | { |
| 383 | newrom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)]; |
| 384 | newrom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)+1]; |
| 385 | } |
| 386 | romlen *= 2; |
| 387 | break; |
| 388 | |
| 342 | 389 | case 0x3c: // lanes 2,3 |
| 343 | 390 | newrom = (UINT8 *)malloc(romlen*2); |
| 344 | 391 | memset(newrom, 0, romlen*2); |
| r12587 | r12588 | |
| 370 | 417 | strcpy(bankname, "rom_"); |
| 371 | 418 | strcat(bankname, m_nubus_slottag); |
| 372 | 419 | addr -= romlen; |
| 373 | | // printf("Installing ROM at %x\n", addr); |
| 420 | // printf("Installing ROM at %x, length %x\n", addr, romlen); |
| 374 | 421 | m_nubus->install_bank(addr, addr+romlen-1, 0, 0, bankname, newrom); |
| 375 | 422 | } |
| 376 | 423 | |
src/mess/machine/nubus.h
| r12587 | r12588 | |
| 91 | 91 | static void static_set_cputag(device_t &device, const char *tag); |
| 92 | 92 | |
| 93 | 93 | void add_nubus_card(device_nubus_card_interface *card); |
| 94 | void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); |
| 95 | void install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler); |
| 94 | 96 | void install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler); |
| 95 | 97 | void install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data); |
| 96 | 98 | void set_irq_line(int slot, int state); |