src/mess/drivers/scorpion.c
| r15286 | r15287 | |
| 162 | 162 | : spectrum_state(mconfig, type, tag) { } |
| 163 | 163 | |
| 164 | 164 | DECLARE_DIRECT_UPDATE_MEMBER(scorpion_direct); |
| 165 | DECLARE_WRITE8_MEMBER(scorpion_0000_w); |
| 166 | DECLARE_WRITE8_MEMBER(scorpion_port_7ffd_w); |
| 167 | DECLARE_WRITE8_MEMBER(scorpion_port_1ffd_w); |
| 165 | 168 | }; |
| 166 | 169 | |
| 167 | 170 | /****************************************************************************************************/ |
| r15286 | r15287 | |
| 223 | 226 | |
| 224 | 227 | } |
| 225 | 228 | |
| 226 | | static WRITE8_HANDLER( scorpion_0000_w ) |
| 229 | WRITE8_MEMBER(scorpion_state::scorpion_0000_w) |
| 227 | 230 | { |
| 228 | | scorpion_state *state = space->machine().driver_data<scorpion_state>(); |
| 229 | | |
| 230 | | if ( ! state->m_ram_0000 ) |
| 231 | if ( ! m_ram_0000 ) |
| 231 | 232 | return; |
| 232 | 233 | |
| 233 | | if ((state->m_port_1ffd_data & 0x01)==0x01) |
| 234 | if ((m_port_1ffd_data & 0x01)==0x01) |
| 234 | 235 | { |
| 235 | | if ( ! state->m_ram_disabled_by_beta ) |
| 236 | | state->m_ram_0000[offset] = data; |
| 236 | if ( ! m_ram_disabled_by_beta ) |
| 237 | m_ram_0000[offset] = data; |
| 237 | 238 | } |
| 238 | 239 | } |
| 239 | 240 | |
| r15286 | r15287 | |
| 281 | 282 | } |
| 282 | 283 | } |
| 283 | 284 | |
| 284 | | static WRITE8_HANDLER(scorpion_port_7ffd_w) |
| 285 | WRITE8_MEMBER(scorpion_state::scorpion_port_7ffd_w) |
| 285 | 286 | { |
| 286 | | spectrum_state *state = space->machine().driver_data<spectrum_state>(); |
| 287 | | |
| 288 | 287 | /* disable paging */ |
| 289 | | if (state->m_port_7ffd_data & 0x20) |
| 288 | if (m_port_7ffd_data & 0x20) |
| 290 | 289 | return; |
| 291 | 290 | |
| 292 | 291 | /* store new state */ |
| 293 | | state->m_port_7ffd_data = data; |
| 292 | m_port_7ffd_data = data; |
| 294 | 293 | |
| 295 | 294 | /* update memory */ |
| 296 | | scorpion_update_memory(space->machine()); |
| 295 | scorpion_update_memory(machine()); |
| 297 | 296 | } |
| 298 | 297 | |
| 299 | | static WRITE8_HANDLER(scorpion_port_1ffd_w) |
| 298 | WRITE8_MEMBER(scorpion_state::scorpion_port_1ffd_w) |
| 300 | 299 | { |
| 301 | | spectrum_state *state = space->machine().driver_data<spectrum_state>(); |
| 302 | | |
| 303 | 300 | /* if paging not disabled */ |
| 304 | | if ((state->m_port_7ffd_data & 0x20)==0) |
| 301 | if ((m_port_7ffd_data & 0x20)==0) |
| 305 | 302 | { |
| 306 | | state->m_port_1ffd_data = data; |
| 307 | | scorpion_update_memory(space->machine()); |
| 303 | m_port_1ffd_data = data; |
| 304 | scorpion_update_memory(machine()); |
| 308 | 305 | } |
| 309 | 306 | } |
| 310 | 307 | |
| r15286 | r15287 | |
| 316 | 313 | AM_RANGE(0x007f, 0x007f) AM_DEVREADWRITE_LEGACY(BETA_DISK_TAG, betadisk_data_r,betadisk_data_w) AM_MIRROR(0xff00) |
| 317 | 314 | AM_RANGE(0x00fe, 0x00fe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xff00) AM_MASK(0xffff) |
| 318 | 315 | AM_RANGE(0x00ff, 0x00ff) AM_DEVREADWRITE_LEGACY(BETA_DISK_TAG, betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00) |
| 319 | | AM_RANGE(0x4000, 0x4000) AM_WRITE_LEGACY(scorpion_port_7ffd_w) AM_MIRROR(0x3ffd) |
| 316 | AM_RANGE(0x4000, 0x4000) AM_WRITE(scorpion_port_7ffd_w) AM_MIRROR(0x3ffd) |
| 320 | 317 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd) |
| 321 | 318 | AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd) |
| 322 | | AM_RANGE(0x1000, 0x1000) AM_WRITE_LEGACY(scorpion_port_1ffd_w) AM_MIRROR(0x0ffd) |
| 319 | AM_RANGE(0x1000, 0x1000) AM_WRITE(scorpion_port_1ffd_w) AM_MIRROR(0x0ffd) |
| 323 | 320 | ADDRESS_MAP_END |
| 324 | 321 | |
| 325 | 322 | |
| r15286 | r15287 | |
| 332 | 329 | |
| 333 | 330 | state->m_ram_0000 = NULL; |
| 334 | 331 | space->install_read_bank(0x0000, 0x3fff, "bank1"); |
| 335 | | space->install_legacy_write_handler(0x0000, 0x3fff, FUNC(scorpion_0000_w)); |
| 332 | space->install_write_handler(0x0000, 0x3fff, write8_delegate(FUNC(scorpion_state::scorpion_0000_w),state)); |
| 336 | 333 | |
| 337 | 334 | betadisk_disable(beta); |
| 338 | 335 | betadisk_clear_status(beta); |
src/mess/drivers/pentagon.c
| r15286 | r15287 | |
| 16 | 16 | : spectrum_state(mconfig, type, tag) { } |
| 17 | 17 | |
| 18 | 18 | DECLARE_DIRECT_UPDATE_MEMBER(pentagon_direct); |
| 19 | DECLARE_WRITE8_MEMBER(pentagon_port_7ffd_w); |
| 19 | 20 | }; |
| 20 | 21 | |
| 21 | 22 | DIRECT_UPDATE_MEMBER(pentagon_state::pentagon_direct) |
| r15286 | r15287 | |
| 80 | 81 | state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x010000 + (state->m_ROMSelection<<14)); |
| 81 | 82 | } |
| 82 | 83 | |
| 83 | | static WRITE8_HANDLER(pentagon_port_7ffd_w) |
| 84 | WRITE8_MEMBER(pentagon_state::pentagon_port_7ffd_w) |
| 84 | 85 | { |
| 85 | | spectrum_state *state = space->machine().driver_data<spectrum_state>(); |
| 86 | | |
| 87 | 86 | /* disable paging */ |
| 88 | | if (state->m_port_7ffd_data & 0x20) |
| 87 | if (m_port_7ffd_data & 0x20) |
| 89 | 88 | return; |
| 90 | 89 | |
| 91 | 90 | /* store new state */ |
| 92 | | state->m_port_7ffd_data = data; |
| 91 | m_port_7ffd_data = data; |
| 93 | 92 | |
| 94 | 93 | /* update memory */ |
| 95 | | pentagon_update_memory(space->machine()); |
| 94 | pentagon_update_memory(machine()); |
| 96 | 95 | } |
| 97 | 96 | |
| 98 | 97 | static ADDRESS_MAP_START (pentagon_io, AS_IO, 8, pentagon_state ) |
| r15286 | r15287 | |
| 103 | 102 | AM_RANGE(0x007f, 0x007f) AM_DEVREADWRITE_LEGACY(BETA_DISK_TAG, betadisk_data_r,betadisk_data_w) AM_MIRROR(0xff00) |
| 104 | 103 | AM_RANGE(0x00fe, 0x00fe) AM_READWRITE(spectrum_port_fe_r,spectrum_port_fe_w) AM_MIRROR(0xff00) AM_MASK(0xffff) |
| 105 | 104 | AM_RANGE(0x00ff, 0x00ff) AM_DEVREADWRITE_LEGACY(BETA_DISK_TAG, betadisk_state_r, betadisk_param_w) AM_MIRROR(0xff00) |
| 106 | | AM_RANGE(0x4000, 0x4000) AM_WRITE_LEGACY(pentagon_port_7ffd_w) AM_MIRROR(0x3ffd) |
| 105 | AM_RANGE(0x4000, 0x4000) AM_WRITE(pentagon_port_7ffd_w) AM_MIRROR(0x3ffd) |
| 107 | 106 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay8912", ay8910_data_w) AM_MIRROR(0x3ffd) |
| 108 | 107 | AM_RANGE(0xc000, 0xc000) AM_DEVREADWRITE_LEGACY("ay8912", ay8910_r, ay8910_address_w) AM_MIRROR(0x3ffd) |
| 109 | 108 | ADDRESS_MAP_END |