src/mess/drivers/pasopia.c
| r8559 | r8560 | |
| 190 | 190 | { |
| 191 | 191 | res &= p7_vram[offset | 0x8000]; |
| 192 | 192 | attr_latch = p7_vram[offset | 0xc000]; |
| 193 | | i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7)); |
| 193 | i8255a_w(space->machine->device("ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7)); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | return res; |
| r8559 | r8560 | |
| 215 | 215 | p7_vram[offset | 0x8000] = (plane_reg & 4) ? data : 0xff; |
| 216 | 216 | attr_latch = attr_wrap ? attr_latch : attr_data; |
| 217 | 217 | p7_vram[offset | 0xc000] = attr_latch; |
| 218 | | i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7)); |
| 218 | i8255a_w(space->machine->device("ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7)); |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | } |
| r8559 | r8560 | |
| 327 | 327 | if(offset == 0) |
| 328 | 328 | { |
| 329 | 329 | addr_latch = data; |
| 330 | | mc6845_address_w(devtag_get_device(space->machine, "crtc"), 0,data); |
| 330 | mc6845_address_w(space->machine->device("crtc"), 0,data); |
| 331 | 331 | } |
| 332 | 332 | else |
| 333 | 333 | { |
| r8559 | r8560 | |
| 337 | 337 | else if(addr_latch == 0x0f) |
| 338 | 338 | cursor_addr = (cursor_addr & 0x3f00) | (data & 0xff); |
| 339 | 339 | |
| 340 | | mc6845_register_w(devtag_get_device(space->machine, "crtc"), 0,data); |
| 340 | mc6845_register_w(space->machine->device("crtc"), 0,data); |
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
| r8559 | r8560 | |
| 356 | 356 | |
| 357 | 357 | io_port = offset & 0xff; //trim down to 8-bit bus |
| 358 | 358 | |
| 359 | | if(io_port >= 0x08 && io_port <= 0x0b) { return i8255a_r(devtag_get_device(space->machine, "ppi8255_0"), (io_port-0x08) & 3); } |
| 360 | | else if(io_port >= 0x0c && io_port <= 0x0f) { return i8255a_r(devtag_get_device(space->machine, "ppi8255_1"), (io_port-0x0c) & 3); } |
| 359 | if(io_port >= 0x08 && io_port <= 0x0b) { return i8255a_r(space->machine->device("ppi8255_0"), (io_port-0x08) & 3); } |
| 360 | else if(io_port >= 0x0c && io_port <= 0x0f) { return i8255a_r(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3); } |
| 361 | 361 | // else if(io_port == 0x10 || io_port == 0x11) { M6845 read } |
| 362 | 362 | else if(io_port >= 0x18 && io_port <= 0x1b) { return pac2_r(space, io_port-0x1b); } |
| 363 | | else if(io_port >= 0x20 && io_port <= 0x23) { return i8255a_r(devtag_get_device(space->machine, "ppi8255_2"), (io_port-0x20) & 3); } |
| 364 | | else if(io_port >= 0x28 && io_port <= 0x2b) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), io_port-0x28); } |
| 365 | | else if(io_port >= 0x30 && io_port <= 0x33) { return z80pio_cd_ba_r(devtag_get_device(space->machine, "z80pio_0"), (io_port-0x30) & 3); } |
| 363 | else if(io_port >= 0x20 && io_port <= 0x23) { return i8255a_r(space->machine->device("ppi8255_2"), (io_port-0x20) & 3); } |
| 364 | else if(io_port >= 0x28 && io_port <= 0x2b) { return z80ctc_r(space->machine->device("ctc"), io_port-0x28); } |
| 365 | else if(io_port >= 0x30 && io_port <= 0x33) { return z80pio_cd_ba_r(space->machine->device("z80pio_0"), (io_port-0x30) & 3); } |
| 366 | 366 | // else if(io_port == 0x3a) { SN1 } |
| 367 | 367 | // else if(io_port == 0x3b) { SN2 } |
| 368 | 368 | // else if(io_port == 0x3c) { bankswitch } |
| r8559 | r8560 | |
| 388 | 388 | |
| 389 | 389 | io_port = offset & 0xff; //trim down to 8-bit bus |
| 390 | 390 | |
| 391 | | if(io_port >= 0x08 && io_port <= 0x0b) { i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), (io_port-0x08) & 3, data); } |
| 392 | | else if(io_port >= 0x0c && io_port <= 0x0f) { i8255a_w(devtag_get_device(space->machine, "ppi8255_1"), (io_port-0x0c) & 3, data); } |
| 391 | if(io_port >= 0x08 && io_port <= 0x0b) { i8255a_w(space->machine->device("ppi8255_0"), (io_port-0x08) & 3, data); } |
| 392 | else if(io_port >= 0x0c && io_port <= 0x0f) { i8255a_w(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3, data); } |
| 393 | 393 | else if(io_port >= 0x10 && io_port <= 0x11) { pasopia7_6845_w(space, io_port-0x10, data); } |
| 394 | 394 | else if(io_port >= 0x18 && io_port <= 0x1b) { pac2_w(space, io_port-0x1b, data); } |
| 395 | | else if(io_port >= 0x20 && io_port <= 0x23) { i8255a_w(devtag_get_device(space->machine, "ppi8255_2"), (io_port-0x20) & 3, data); } |
| 396 | | else if(io_port >= 0x28 && io_port <= 0x2b) { z80ctc_w(devtag_get_device(space->machine, "ctc"), io_port-0x28,data); } |
| 397 | | else if(io_port >= 0x30 && io_port <= 0x33) { z80pio_cd_ba_w(devtag_get_device(space->machine, "z80pio_0"), (io_port-0x30) & 3, data); } |
| 398 | | else if(io_port == 0x3a) { sn76496_w(devtag_get_device(space->machine, "sn1"), 0, data); } |
| 399 | | else if(io_port == 0x3b) { sn76496_w(devtag_get_device(space->machine, "sn2"), 0, data); } |
| 395 | else if(io_port >= 0x20 && io_port <= 0x23) { i8255a_w(space->machine->device("ppi8255_2"), (io_port-0x20) & 3, data); } |
| 396 | else if(io_port >= 0x28 && io_port <= 0x2b) { z80ctc_w(space->machine->device("ctc"), io_port-0x28,data); } |
| 397 | else if(io_port >= 0x30 && io_port <= 0x33) { z80pio_cd_ba_w(space->machine->device("z80pio_0"), (io_port-0x30) & 3, data); } |
| 398 | else if(io_port == 0x3a) { sn76496_w(space->machine->device("sn1"), 0, data); } |
| 399 | else if(io_port == 0x3b) { sn76496_w(space->machine->device("sn2"), 0, data); } |
| 400 | 400 | else if(io_port == 0x3c) { pasopia7_memory_ctrl_w(space,0, data); } |
| 401 | 401 | // else if(io_port >= 0xe0 && io_port <= 0xe6) { fdc } |
| 402 | 402 | else |
| r8559 | r8560 | |
| 556 | 556 | // printf("SYSTEM MISC %02x\n",data); |
| 557 | 557 | |
| 558 | 558 | // if(data & 1) |
| 559 | | // i8255a_w(devtag_get_device(device->machine, "ppi8255_2"), 1, 0); |
| 559 | // i8255a_w(device->machine->device("ppi8255_2"), 1, 0); |
| 560 | 560 | |
| 561 | 561 | } |
| 562 | 562 | |