src/mess/drivers/pc98.c
| r6129 | r6130 | |
| 8 | 8 | |
| 9 | 9 | TODO: |
| 10 | 10 | - remove the A20 line hack |
| 11 | | - Understand what's going on at bp f9064 (memo: bp f9064, do eip=1182) |
| 11 | - Understand what's going on at bp f8dfa (memo: bp f8dfa, do eip=dff) |
| 12 | 12 | |
| 13 | 13 | ======================================================================================== |
| 14 | 14 | |
| r6129 | r6130 | |
| 401 | 401 | crtc_cmd_w(space,0,data); |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | static UINT8 rom_bank; |
| 405 | |
| 404 | 406 | static WRITE8_HANDLER( ems_sel_w ) |
| 405 | 407 | { |
| 406 | 408 | // printf("%02x %02x\n",offset,data); |
| r6129 | r6130 | |
| 410 | 412 | UINT8 *ROM = memory_region(space->machine, "cpudata"); |
| 411 | 413 | |
| 412 | 414 | if(data == 0x00 || data == 0x10) |
| 415 | { |
| 416 | rom_bank = 1; |
| 413 | 417 | memory_set_bankptr(space->machine, 1, &ROM[0x20000]); |
| 418 | } |
| 414 | 419 | |
| 415 | 420 | if(data == 0x02 || data == 0x12) |
| 421 | { |
| 422 | rom_bank = 0; |
| 416 | 423 | memory_set_bankptr(space->machine, 1, &ROM[0x00000]); |
| 424 | } |
| 417 | 425 | } |
| 418 | 426 | |
| 419 | 427 | if(offset == 3) |
| r6129 | r6130 | |
| 426 | 434 | } |
| 427 | 435 | } |
| 428 | 436 | |
| 437 | static WRITE8_HANDLER( rom_bank_w ) |
| 438 | { |
| 439 | UINT8 *ROM = memory_region(space->machine, "cpudata"); |
| 440 | |
| 441 | // printf("%08x %04x %08x\n",ROM[offset+(rom_bank*0x20000/4)],offset+(rom_bank*0x20000/4),data); |
| 442 | |
| 443 | /* NOP any attempt to write on ROM (TODO: why it's overwriting here anyway? Doesn't make sense...) */ |
| 444 | if((rom_bank == 0 && offset < 0x8000) || (rom_bank == 1 && offset < 0x18000)) |
| 445 | ROM[offset+(rom_bank*0x20000)] = data; |
| 446 | } |
| 447 | |
| 429 | 448 | static READ8_HANDLER( port_70_r ) |
| 430 | 449 | { |
| 431 | 450 | if(offset & 1) |
| r6129 | r6130 | |
| 543 | 562 | AM_RANGE(0x00080000, 0x0009ffff) AM_READWRITE(wram_bank_r,wram_bank_w) |
| 544 | 563 | AM_RANGE(0x000a0000, 0x000a3fff) AM_RAM AM_BASE(&pc9801_vram) //vram + attr |
| 545 | 564 | AM_RANGE(0x000a4000, 0x000a4fff) AM_RAM //cg window |
| 565 | AM_RANGE(0x000a5000, 0x000a7fff) AM_RAM //??? (presumably another work ram bank) |
| 546 | 566 | AM_RANGE(0x000a8000, 0x000bffff) AM_READWRITE(gfx_bitmap_ram_r,gfx_bitmap_ram_w) |
| 547 | 567 | AM_RANGE(0x000c0000, 0x000dffff) AM_READWRITE(wram_ide_r,wram_ide_w) |
| 548 | | AM_RANGE(0x000e0000, 0x000fffff) AM_ROMBANK(1) |
| 549 | | AM_RANGE(0xfffe0000, 0xffffffff) AM_ROMBANK(1) |
| 568 | AM_RANGE(0x000e0000, 0x000fffff) AM_ROMBANK(1) AM_WRITE8(rom_bank_w,0xffffffff) |
| 569 | AM_RANGE(0xfffe0000, 0xffffffff) AM_ROMBANK(1) AM_WRITE8(rom_bank_w,0xffffffff) |
| 550 | 570 | ADDRESS_MAP_END |
| 551 | 571 | |
| 552 | 572 | |
| r6129 | r6130 | |
| 619 | 639 | memory_set_bankptr(machine, 1, &ROM[0x20000]); |
| 620 | 640 | |
| 621 | 641 | wram_bank = 0; |
| 642 | rom_bank = 1; |
| 622 | 643 | } |
| 623 | 644 | |
| 624 | 645 | static MACHINE_RESET(pc9821) |
| r6129 | r6130 | |
| 634 | 655 | memory_set_bankptr(machine, 1, &ROM[0x20000]); |
| 635 | 656 | |
| 636 | 657 | wram_bank = 0; |
| 658 | rom_bank = 1; |
| 637 | 659 | } |
| 638 | 660 | |
| 639 | 661 | /************************************************************* |
| r6129 | r6130 | |
| 736 | 758 | DEVCB_HANDLER(pc98_portc_w) /* Port C write */ |
| 737 | 759 | }; |
| 738 | 760 | |
| 761 | |
| 762 | static READ8_DEVICE_HANDLER( printer_porta_r ) |
| 763 | { |
| 764 | printf("PPI2 Port A read\n"); |
| 765 | return 0x00; |
| 766 | } |
| 767 | |
| 768 | static READ8_DEVICE_HANDLER( printer_portb_r ) |
| 769 | { |
| 770 | // printf("PPI2 Port B read\n"); |
| 771 | return 0xb4; |
| 772 | } |
| 773 | |
| 774 | static READ8_DEVICE_HANDLER( printer_portc_r ) |
| 775 | { |
| 776 | printf("PPI2 Port C read\n"); |
| 777 | return 0x00; |
| 778 | } |
| 779 | |
| 780 | |
| 739 | 781 | static const ppi8255_interface printer_intf = |
| 740 | 782 | { |
| 741 | | DEVCB_NULL, /* Port A read */ |
| 742 | | DEVCB_NULL, /* Port B read */ |
| 743 | | DEVCB_NULL, /* Port C read */ |
| 783 | DEVCB_HANDLER(printer_porta_r), /* Port A read */ |
| 784 | DEVCB_HANDLER(printer_portb_r), /* Port B read */ |
| 785 | DEVCB_HANDLER(printer_portc_r), /* Port C read */ |
| 744 | 786 | DEVCB_NULL, /* Port A write */ |
| 745 | 787 | DEVCB_NULL, /* Port B write */ |
| 746 | 788 | DEVCB_NULL /* Port C write */ |