src/mess/drivers/scorpion.c
| r10086 | r10087 | |
| 183 | 183 | |
| 184 | 184 | /* rom 0=zx128, 1=zx48, 2 = service monitor, 3=tr-dos */ |
| 185 | 185 | |
| 186 | | static UINT8 *ram_0000; |
| 187 | | static UINT8 ram_disabled_by_beta; |
| 188 | | |
| 189 | 186 | static void scorpion_update_memory(running_machine *machine) |
| 190 | 187 | { |
| 191 | 188 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| r10086 | r10087 | |
| 197 | 194 | |
| 198 | 195 | if ((state->port_1ffd_data & 0x01)==0x01) |
| 199 | 196 | { |
| 200 | | ram_0000 = messram+(8<<14); |
| 197 | state->ram_0000 = messram+(8<<14); |
| 201 | 198 | memory_set_bankptr(machine, "bank1", messram+(8<<14)); |
| 202 | 199 | logerror("RAM\n"); |
| 203 | 200 | } |
| r10086 | r10087 | |
| 221 | 218 | { |
| 222 | 219 | spectrum_state *state = space->machine->driver_data<spectrum_state>(); |
| 223 | 220 | |
| 224 | | if ( ! ram_0000 ) |
| 221 | if ( ! state->ram_0000 ) |
| 225 | 222 | return; |
| 226 | 223 | |
| 227 | 224 | if ((state->port_1ffd_data & 0x01)==0x01) |
| 228 | 225 | { |
| 229 | | if ( ! ram_disabled_by_beta ) |
| 230 | | ram_0000[offset] = data; |
| 226 | if ( ! state->ram_disabled_by_beta ) |
| 227 | state->ram_0000[offset] = data; |
| 231 | 228 | } |
| 232 | 229 | } |
| 233 | 230 | |
| r10086 | r10087 | |
| 239 | 236 | UINT16 pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPCBASE); |
| 240 | 237 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 241 | 238 | |
| 242 | | ram_disabled_by_beta = 0; |
| 239 | state->ram_disabled_by_beta = 0; |
| 243 | 240 | if (betadisk_is_active(beta)) |
| 244 | 241 | { |
| 245 | 242 | if (pc >= 0x4000) |
| 246 | 243 | { |
| 247 | 244 | state->ROMSelection = ((state->port_7ffd_data>>4) & 0x01) ? 1 : 0; |
| 248 | 245 | betadisk_disable(beta); |
| 249 | | ram_disabled_by_beta = 1; |
| 246 | state->ram_disabled_by_beta = 1; |
| 250 | 247 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14)); |
| 251 | 248 | } |
| 252 | 249 | } |
| r10086 | r10087 | |
| 257 | 254 | } |
| 258 | 255 | if((address>=0x0000) && (address<=0x3fff)) |
| 259 | 256 | { |
| 260 | | ram_disabled_by_beta = 1; |
| 257 | state->ram_disabled_by_beta = 1; |
| 261 | 258 | direct.explicit_configure(0x0000, 0x3fff, 0x3fff, space->machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14)); |
| 262 | 259 | memory_set_bankptr(machine, "bank1", space->machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14)); |
| 263 | 260 | return ~0; |
| r10086 | r10087 | |
| 326 | 323 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 327 | 324 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 328 | 325 | |
| 329 | | ram_0000 = NULL; |
| 326 | state->ram_0000 = NULL; |
| 330 | 327 | memory_install_read_bank(space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 331 | 328 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, scorpion_0000_w); |
| 332 | 329 | |
src/mess/drivers/atm.c
| r10086 | r10087 | |
| 24 | 24 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 25 | 25 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 26 | 26 | UINT16 pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPCBASE); |
| 27 | | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 28 | 27 | |
| 29 | 28 | if (beta->started() && betadisk_is_active(beta)) |
| 30 | 29 | { |
| r10086 | r10087 | |
| 32 | 31 | { |
| 33 | 32 | state->ROMSelection = ((state->port_7ffd_data>>4) & 0x01) ? 1 : 0; |
| 34 | 33 | betadisk_disable(beta); |
| 35 | | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 36 | 34 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14)); |
| 37 | 35 | } |
| 38 | 36 | } |
| r10086 | r10087 | |
| 45 | 43 | } |
| 46 | 44 | if((address>=0x0000) && (address<=0x3fff)) |
| 47 | 45 | { |
| 48 | | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 49 | 46 | if (state->ROMSelection == 3) { |
| 50 | 47 | direct.explicit_configure(0x0000, 0x3fff, 0x3fff, machine->region("maincpu")->base() + 0x018000); |
| 51 | 48 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x018000); |
| r10086 | r10087 | |
| 122 | 119 | betadisk_enable(beta); |
| 123 | 120 | betadisk_clear_status(beta); |
| 124 | 121 | } |
| 125 | | // This causes severe slowdown (5fps vs 750fps) removed until rewritten |
| 126 | | //space->set_direct_update_handler(direct_update_delegate_create_static(atm_direct, *machine)); |
| 122 | space->set_direct_update_handler(direct_update_delegate_create_static(atm_direct, *machine)); |
| 127 | 123 | |
| 128 | 124 | memset(messram,0,128*1024); |
| 129 | 125 | |
src/mess/drivers/pentagon.c
| r10086 | r10087 | |
| 14 | 14 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 15 | 15 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 16 | 16 | UINT16 pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPCBASE); |
| 17 | | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 18 | 17 | |
| 19 | 18 | if (beta->started() && betadisk_is_active(beta)) |
| 20 | 19 | { |
| r10086 | r10087 | |
| 22 | 21 | { |
| 23 | 22 | state->ROMSelection = ((state->port_7ffd_data>>4) & 0x01) ? 1 : 0; |
| 24 | 23 | betadisk_disable(beta); |
| 25 | | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 26 | 24 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14)); |
| 27 | 25 | } |
| 28 | 26 | } else if (((pc & 0xff00) == 0x3d00) && (state->ROMSelection==1)) |
| r10086 | r10087 | |
| 34 | 32 | } |
| 35 | 33 | if((address>=0x0000) && (address<=0x3fff)) |
| 36 | 34 | { |
| 37 | | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 38 | 35 | if (state->ROMSelection == 3) { |
| 39 | 36 | if (beta->started()) { |
| 40 | 37 | direct.explicit_configure(0x0000, 0x3fff, 0x3fff, machine->region("beta:beta")->base()); |
| r10086 | r10087 | |
| 117 | 114 | betadisk_enable(beta); |
| 118 | 115 | betadisk_clear_status(beta); |
| 119 | 116 | } |
| 120 | | // This causes severe slowdown (5fps vs >1000fps) removed until rewritten |
| 121 | | //space->set_direct_update_handler(direct_update_delegate_create_static(pentagon_direct, *machine)); |
| 117 | space->set_direct_update_handler(direct_update_delegate_create_static(pentagon_direct, *machine)); |
| 122 | 118 | |
| 123 | 119 | memset(messram,0,128*1024); |
| 124 | 120 | |