src/mess/machine/sym1.c
| r3691 | r3692 | |
| 123 | 123 | |
| 124 | 124 | static void sym1_riot_a_w(const device_config *device, UINT8 newdata, UINT8 data) |
| 125 | 125 | { |
| 126 | | logerror("%x: riot_a_w 0x%02x\n", activecpu_get_pc(), data); |
| 126 | logerror("%x: riot_a_w 0x%02x\n", cpu_get_pc( device->machine->activecpu ), data); |
| 127 | 127 | |
| 128 | 128 | /* save for later use */ |
| 129 | 129 | riot_port_a = data; |
| r3691 | r3692 | |
| 132 | 132 | |
| 133 | 133 | static void sym1_riot_b_w(const device_config *device, UINT8 newdata, UINT8 data) |
| 134 | 134 | { |
| 135 | | logerror("%x: riot_b_w 0x%02x\n", activecpu_get_pc(), data); |
| 135 | logerror("%x: riot_b_w 0x%02x\n", cpu_get_pc( device->machine->activecpu ), data); |
| 136 | 136 | |
| 137 | 137 | /* save for later use */ |
| 138 | 138 | riot_port_b = data; |
| 139 | 139 | |
| 140 | 140 | /* first 4 pins are connected to the 74145 */ |
| 141 | | ttl74145_0_w(device->machine, 0, data & 0x0f); |
| 141 | ttl74145_0_w( cpu_get_address_space( device->machine->cpu[0], ADDRESS_SPACE_PROGRAM ), 0, data & 0x0f); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| r3691 | r3692 | |
| 185 | 185 | |
| 186 | 186 | static WRITE8_HANDLER( sym1_via0_b_w ) |
| 187 | 187 | { |
| 188 | | logerror("%x: via0_b_w 0x%02x\n", activecpu_get_pc(), data); |
| 188 | logerror("%x: via0_b_w 0x%02x\n", cpu_get_pc( space->cpu ), data); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
| r3691 | r3692 | |
| 198 | 198 | { |
| 199 | 199 | logerror("SYM1 VIA2 W 0x%02x\n", data); |
| 200 | 200 | |
| 201 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa600, 0xa67f, 0, 0, |
| 202 | | ((input_port_read(machine, "WP") & 0x01) && !(data & 0x01)) ? SMH_NOP : SMH_BANK5); |
| 201 | memory_install_write8_handler(space, 0xa600, 0xa67f, 0, 0, |
| 202 | ((input_port_read(space->machine, "WP") & 0x01) && !(data & 0x01)) ? SMH_NOP : SMH_BANK5); |
| 203 | 203 | |
| 204 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400, 0x07ff, 0, 0, |
| 205 | | ((input_port_read(machine, "WP") & 0x02) && !(data & 0x02)) ? SMH_NOP : SMH_BANK2); |
| 204 | memory_install_write8_handler(space, 0x0400, 0x07ff, 0, 0, |
| 205 | ((input_port_read(space->machine, "WP") & 0x02) && !(data & 0x02)) ? SMH_NOP : SMH_BANK2); |
| 206 | 206 | |
| 207 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0800, 0x0bff, 0, 0, |
| 208 | | ((input_port_read(machine, "WP") & 0x04) && !(data & 0x04)) ? SMH_NOP : SMH_BANK3); |
| 207 | memory_install_write8_handler(space, 0x0800, 0x0bff, 0, 0, |
| 208 | ((input_port_read(space->machine, "WP") & 0x04) && !(data & 0x04)) ? SMH_NOP : SMH_BANK3); |
| 209 | 209 | |
| 210 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c00, 0x0fff, 0, 0, |
| 211 | | ((input_port_read(machine, "WP") & 0x08) && !(data & 0x08)) ? SMH_NOP : SMH_BANK4); |
| 210 | memory_install_write8_handler(space, 0x0c00, 0x0fff, 0, 0, |
| 211 | ((input_port_read(space->machine, "WP") & 0x08) && !(data & 0x08)) ? SMH_NOP : SMH_BANK4); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| r3691 | r3692 | |
| 277 | 277 | /* wipe expansion memory banks that are not installed */ |
| 278 | 278 | if (mess_ram_size < 4*1024) |
| 279 | 279 | { |
| 280 | | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, |
| 280 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 281 | memory_install_readwrite8_handler(space, |
| 281 | 282 | mess_ram_size, 0x0fff, 0, 0, SMH_NOP, SMH_NOP); |
| 282 | 283 | } |
| 283 | 284 | |
| r3691 | r3692 | |
| 296 | 297 | |
| 297 | 298 | MACHINE_RESET( sym1 ) |
| 298 | 299 | { |
| 300 | const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 301 | |
| 299 | 302 | via_reset(); |
| 300 | 303 | ttl74145_reset(0); |
| 301 | 304 | |
| 302 | 305 | /* make 0xf800 to 0xffff point to the last half of the monitor ROM |
| 303 | 306 | so that the CPU can find its reset vectors */ |
| 304 | | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, |
| 307 | memory_install_readwrite8_handler(space, |
| 305 | 308 | 0xf800, 0xffff, 0, 0, SMH_BANK1, SMH_NOP); |
| 306 | 309 | memory_set_bankptr(machine, 1, sym1_monitor + 0x800); |
| 307 | 310 | } |