src/mess/machine/sym1.c
| r3701 | r3702 | |
| 19 | 19 | #include "machine/6532riot.h" |
| 20 | 20 | #include "machine/74145.h" |
| 21 | 21 | #include "sound/speaker.h" |
| 22 | #include "deprecat.h" |
| 22 | 23 | |
| 23 | | |
| 24 | 24 | #define LED_REFRESH_DELAY ATTOTIME_IN_USEC(70) |
| 25 | 25 | |
| 26 | 26 | |
| r3701 | r3702 | |
| 198 | 198 | { |
| 199 | 199 | logerror("SYM1 VIA2 W 0x%02x\n", data); |
| 200 | 200 | |
| 201 | | memory_install_write8_handler(space, 0xa600, 0xa67f, 0, 0, |
| 201 | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0xa600, 0xa67f, 0, 0, |
| 202 | 202 | ((input_port_read(space->machine, "WP") & 0x01) && !(data & 0x01)) ? SMH_NOP : SMH_BANK5); |
| 203 | 203 | |
| 204 | | memory_install_write8_handler(space, 0x0400, 0x07ff, 0, 0, |
| 204 | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0x0400, 0x07ff, 0, 0, |
| 205 | 205 | ((input_port_read(space->machine, "WP") & 0x02) && !(data & 0x02)) ? SMH_NOP : SMH_BANK2); |
| 206 | 206 | |
| 207 | | memory_install_write8_handler(space, 0x0800, 0x0bff, 0, 0, |
| 207 | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0x0800, 0x0bff, 0, 0, |
| 208 | 208 | ((input_port_read(space->machine, "WP") & 0x04) && !(data & 0x04)) ? SMH_NOP : SMH_BANK3); |
| 209 | 209 | |
| 210 | | memory_install_write8_handler(space, 0x0c00, 0x0fff, 0, 0, |
| 210 | memory_install_write8_handler(cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0x0c00, 0x0fff, 0, 0, |
| 211 | 211 | ((input_port_read(space->machine, "WP") & 0x08) && !(data & 0x08)) ? SMH_NOP : SMH_BANK4); |
| 212 | 212 | } |
| 213 | 213 | |
| r3701 | r3702 | |
| 277 | 277 | /* wipe expansion memory banks that are not installed */ |
| 278 | 278 | if (mess_ram_size < 4*1024) |
| 279 | 279 | { |
| 280 | | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 281 | | memory_install_readwrite8_handler(space, |
| 280 | memory_install_readwrite8_handler(cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ), |
| 282 | 281 | mess_ram_size, 0x0fff, 0, 0, SMH_NOP, SMH_NOP); |
| 283 | 282 | } |
| 284 | 283 | |
| r3701 | r3702 | |
| 297 | 296 | |
| 298 | 297 | MACHINE_RESET( sym1 ) |
| 299 | 298 | { |
| 300 | | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 301 | | |
| 302 | 299 | via_reset(); |
| 303 | 300 | ttl74145_reset(0); |
| 304 | 301 | |
| 305 | 302 | /* make 0xf800 to 0xffff point to the last half of the monitor ROM |
| 306 | 303 | so that the CPU can find its reset vectors */ |
| 307 | | memory_install_readwrite8_handler(space, |
| 304 | memory_install_readwrite8_handler(cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ), |
| 308 | 305 | 0xf800, 0xffff, 0, 0, SMH_BANK1, SMH_NOP); |
| 309 | 306 | memory_set_bankptr(machine, 1, sym1_monitor + 0x800); |
| 307 | cpu_reset(cputag_get_cpu(machine, "main")); |
| 310 | 308 | } |