src/mess/video/pc_vga.c
| r3624 | r3625 | |
| 414 | 414 | |
| 415 | 415 | static WRITE8_HANDLER(vga_text_w) |
| 416 | 416 | { |
| 417 | | vga_dirty_w(machine, ((offset&~1)<<1)|(offset&1),data); |
| 417 | vga_dirty_w(space, ((offset&~1)<<1)|(offset&1),data); |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | INLINE UINT8 ega_bitplane_to_packed(UINT8 *latch, int number) |
| r3624 | r3625 | |
| 500 | 500 | static WRITE8_HANDLER(vga_ega_w) |
| 501 | 501 | { |
| 502 | 502 | if (vga.sequencer.data[2]&1) |
| 503 | | vga_dirty_w(machine, offset<<2, vga_latch_write(0,data)); |
| 503 | vga_dirty_w(space, offset<<2, vga_latch_write(0,data)); |
| 504 | 504 | if (vga.sequencer.data[2]&2) |
| 505 | | vga_dirty_w(machine, (offset<<2)+1, vga_latch_write(1,data)); |
| 505 | vga_dirty_w(space, (offset<<2)+1, vga_latch_write(1,data)); |
| 506 | 506 | if (vga.sequencer.data[2]&4) |
| 507 | | vga_dirty_font_w(machine, (offset<<2)+2, vga_latch_write(2,data)); |
| 507 | vga_dirty_font_w(space, (offset<<2)+2, vga_latch_write(2,data)); |
| 508 | 508 | if (vga.sequencer.data[2]&8) |
| 509 | | vga_dirty_w(machine, (offset<<2)+3, vga_latch_write(3,data)); |
| 509 | vga_dirty_w(space, (offset<<2)+3, vga_latch_write(3,data)); |
| 510 | 510 | if ((offset==0xffff)&&(data==0)) vga.log=1; |
| 511 | 511 | } |
| 512 | 512 | |
| r3624 | r3625 | |
| 520 | 520 | |
| 521 | 521 | static WRITE8_HANDLER(vga_vga_w) |
| 522 | 522 | { |
| 523 | | vga_dirty_font_w(machine, ((offset&~3)<<2)|(offset&3),data); |
| 523 | vga_dirty_font_w(space, ((offset&~3)<<2)|(offset&3),data); |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | | static READ64_HANDLER( vga_text64_r ) { return read64be_with_read8_handler(vga_text_r, machine, offset, mem_mask); } |
| 527 | | static READ64_HANDLER( vga_vga64_r ) { return read64be_with_read8_handler(vga_vga_r, machine, offset, mem_mask); } |
| 528 | | static WRITE64_HANDLER( vga_text64_w ) { write64be_with_write8_handler(vga_text_w, machine, offset, data, mem_mask); } |
| 529 | | static WRITE64_HANDLER( vga_vga64_w ) { write64be_with_write8_handler(vga_vga_w, machine, offset, data, mem_mask); } |
| 526 | static READ64_HANDLER( vga_text64_r ) { return read64be_with_read8_handler(vga_text_r, space, offset, mem_mask); } |
| 527 | static READ64_HANDLER( vga_vga64_r ) { return read64be_with_read8_handler(vga_vga_r, space, offset, mem_mask); } |
| 528 | static WRITE64_HANDLER( vga_text64_w ) { write64be_with_write8_handler(vga_text_w, space, offset, data, mem_mask); } |
| 529 | static WRITE64_HANDLER( vga_vga64_w ) { write64be_with_write8_handler(vga_vga_w, space, offset, data, mem_mask); } |
| 530 | 530 | |
| 531 | 531 | static void vga_cpu_interface(running_machine *machine) |
| 532 | 532 | { |
| 533 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 533 | 534 | static int sequencer, gc; |
| 534 | | read8_machine_func read_handler; |
| 535 | | write8_machine_func write_handler; |
| 536 | | read64_machine_func read_handler64; |
| 537 | | write64_machine_func write_handler64; |
| 535 | read8_space_func read_handler; |
| 536 | write8_space_func write_handler; |
| 537 | read64_space_func read_handler64; |
| 538 | write64_space_func write_handler64; |
| 538 | 539 | UINT8 sel; |
| 539 | 540 | int buswidth; |
| 540 | 541 | |
| r3624 | r3625 | |
| 575 | 576 | case 0x00: |
| 576 | 577 | if (vga.vga_intf.vga_memory_bank != 0) |
| 577 | 578 | { |
| 578 | | read_handler = (read8_machine_func) (FPTR)vga.vga_intf.vga_memory_bank; |
| 579 | | write_handler = (write8_machine_func) (FPTR)vga.vga_intf.vga_memory_bank; |
| 579 | read_handler = (read8_space_func) (FPTR)vga.vga_intf.vga_memory_bank; |
| 580 | write_handler = (write8_space_func) (FPTR)vga.vga_intf.vga_memory_bank; |
| 580 | 581 | } |
| 581 | 582 | else |
| 582 | 583 | { |
| r3624 | r3625 | |
| 586 | 587 | vga.vga_intf.map_vga_memory(0xA0000, 0xBFFFF, read_handler, write_handler); |
| 587 | 588 | |
| 588 | 589 | if (vga.vga_intf.vga_memory_bank != 0) |
| 589 | | memory_set_bankptr(vga.vga_intf.vga_memory_bank, vga.memory); |
| 590 | memory_set_bankptr(machine,vga.vga_intf.vga_memory_bank, vga.memory); |
| 590 | 591 | break; |
| 591 | 592 | case 0x04: |
| 592 | 593 | vga.vga_intf.map_vga_memory(0xA0000, 0xAFFFF, read_handler, write_handler); |
| r3624 | r3625 | |
| 600 | 601 | } |
| 601 | 602 | } |
| 602 | 603 | |
| 603 | | buswidth = cputype_databus_width(machine->config->cpu[0].type, ADDRESS_SPACE_PROGRAM); |
| 604 | buswidth = cpu_get_databus_width(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 604 | 605 | switch(buswidth) |
| 605 | 606 | { |
| 606 | 607 | case 8: |
| 607 | 608 | sel = vga.gc.data[6] & 0x0c; |
| 608 | 609 | if (sel) |
| 609 | 610 | { |
| 610 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler : SMH_NOP); |
| 611 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler : SMH_NOP); |
| 612 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler : SMH_NOP); |
| 613 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler : SMH_NOP); |
| 614 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler : SMH_NOP); |
| 615 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler : SMH_NOP); |
| 611 | memory_install_read8_handler(space, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler : SMH_NOP); |
| 612 | memory_install_read8_handler(space, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler : SMH_NOP); |
| 613 | memory_install_read8_handler(space, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler : SMH_NOP); |
| 614 | memory_install_write8_handler(space, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler : SMH_NOP); |
| 615 | memory_install_write8_handler(space, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler : SMH_NOP); |
| 616 | memory_install_write8_handler(space, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler : SMH_NOP); |
| 616 | 617 | } |
| 617 | 618 | else |
| 618 | 619 | { |
| 619 | | memory_set_bankptr(1, vga.memory); |
| 620 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 621 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 620 | memory_set_bankptr(machine,1, vga.memory); |
| 621 | memory_install_read8_handler(space, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 622 | memory_install_write8_handler(space, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 622 | 623 | } |
| 623 | 624 | break; |
| 624 | 625 | |
| r3624 | r3625 | |
| 626 | 627 | sel = vga.gc.data[6] & 0x0c; |
| 627 | 628 | if (sel) |
| 628 | 629 | { |
| 629 | | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler64 : SMH_NOP); |
| 630 | | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler64 : SMH_NOP); |
| 631 | | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler64 : SMH_NOP); |
| 632 | | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler64 : SMH_NOP); |
| 633 | | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler64 : SMH_NOP); |
| 634 | | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler64 : SMH_NOP); |
| 630 | memory_install_read64_handler(space, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? read_handler64 : SMH_NOP); |
| 631 | memory_install_read64_handler(space, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? read_handler64 : SMH_NOP); |
| 632 | memory_install_read64_handler(space, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? read_handler64 : SMH_NOP); |
| 633 | memory_install_write64_handler(space, 0xa0000, 0xaffff, 0, 0, (sel == 0x04) ? write_handler64 : SMH_NOP); |
| 634 | memory_install_write64_handler(space, 0xb0000, 0xb7fff, 0, 0, (sel == 0x08) ? write_handler64 : SMH_NOP); |
| 635 | memory_install_write64_handler(space, 0xb8000, 0xbffff, 0, 0, (sel == 0x0C) ? write_handler64 : SMH_NOP); |
| 635 | 636 | } |
| 636 | 637 | else |
| 637 | 638 | { |
| 638 | | memory_set_bankptr(1, vga.memory); |
| 639 | | memory_install_read64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 640 | | memory_install_write64_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 639 | memory_set_bankptr(machine,1, vga.memory); |
| 640 | memory_install_read64_handler(space, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 641 | memory_install_write64_handler(space, 0xa0000, 0xbffff, 0, 0, SMH_BANK1 ); |
| 641 | 642 | } |
| 642 | 643 | break; |
| 643 | 644 | |
| r3624 | r3625 | |
| 756 | 757 | { |
| 757 | 758 | UINT8 data = 0xff; |
| 758 | 759 | if (CRTC_PORT_ADDR==0x3b0) |
| 759 | | data=vga_crtc_r(machine, offset); |
| 760 | data=vga_crtc_r(space, offset); |
| 760 | 761 | return data; |
| 761 | 762 | } |
| 762 | 763 | |
| r3624 | r3625 | |
| 794 | 795 | switch ((vga.miscellaneous_output>>2)&3) |
| 795 | 796 | { |
| 796 | 797 | case 3: |
| 797 | | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x01) |
| 798 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(space, 0) & 0x01) |
| 798 | 799 | data |= 0x10; |
| 799 | 800 | break; |
| 800 | 801 | case 2: |
| 801 | | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x02) |
| 802 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(space, 0) & 0x02) |
| 802 | 803 | data |= 0x10; |
| 803 | 804 | break; |
| 804 | 805 | case 1: |
| 805 | | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x04) |
| 806 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(space, 0) & 0x04) |
| 806 | 807 | data |= 0x10; |
| 807 | 808 | break; |
| 808 | 809 | case 0: |
| 809 | | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(machine, 0) & 0x08) |
| 810 | if (vga.vga_intf.read_dipswitch && vga.vga_intf.read_dipswitch(space, 0) & 0x08) |
| 810 | 811 | data |= 0x10; |
| 811 | 812 | break; |
| 812 | 813 | } |
| r3624 | r3625 | |
| 888 | 889 | { |
| 889 | 890 | UINT8 data = 0xff; |
| 890 | 891 | if (CRTC_PORT_ADDR == 0x3d0) |
| 891 | | data = vga_crtc_r(machine, offset); |
| 892 | data = vga_crtc_r(space, offset); |
| 892 | 893 | return data; |
| 893 | 894 | } |
| 894 | 895 | |
| r3624 | r3625 | |
| 898 | 899 | logerror("vga_port_03b0_w(): port=0x%04x data=0x%02x\n", offset + 0x3b0, data); |
| 899 | 900 | |
| 900 | 901 | if (CRTC_PORT_ADDR == 0x3b0) |
| 901 | | vga_crtc_w(machine, offset, data); |
| 902 | vga_crtc_w(space, offset, data); |
| 902 | 903 | } |
| 903 | 904 | |
| 904 | 905 | WRITE8_HANDLER(vga_port_03c0_w) |
| r3624 | r3625 | |
| 939 | 940 | if (vga.sequencer.index < vga.svga_intf.seq_regcount) |
| 940 | 941 | { |
| 941 | 942 | vga.sequencer.data[vga.sequencer.index] = data; |
| 942 | | vga_cpu_interface(machine); |
| 943 | vga_cpu_interface(space->machine); |
| 943 | 944 | |
| 944 | 945 | if (vga.sequencer.index == 0) |
| 945 | 946 | vga.monitor.start_time = timer_get_time(); |
| r3624 | r3625 | |
| 1004 | 1005 | if (vga.gc.index < vga.svga_intf.gc_regcount) |
| 1005 | 1006 | { |
| 1006 | 1007 | vga.gc.data[vga.gc.index] = data; |
| 1007 | | vga_cpu_interface(machine); |
| 1008 | vga_cpu_interface(space->machine); |
| 1008 | 1009 | } |
| 1009 | 1010 | break; |
| 1010 | 1011 | } |
| r3624 | r3625 | |
| 1018 | 1019 | logerror("vga_port_03d0_w(): port=0x%04x data=0x%02x\n", offset + 0x3d0, data); |
| 1019 | 1020 | |
| 1020 | 1021 | if (CRTC_PORT_ADDR == 0x3d0) |
| 1021 | | vga_crtc_w(machine, offset, data); |
| 1022 | vga_crtc_w(space, offset, data); |
| 1022 | 1023 | } |
| 1023 | 1024 | |
| 1024 | 1025 | |
| 1025 | 1026 | |
| 1026 | 1027 | READ8_HANDLER( paradise_ega_03c0_r ) |
| 1027 | 1028 | { |
| 1028 | | UINT8 data = vga_port_03c0_r(machine, offset); |
| 1029 | UINT8 data = vga_port_03c0_r(space, offset); |
| 1029 | 1030 | |
| 1030 | 1031 | if (offset == 2) |
| 1031 | 1032 | { |
| 1032 | 1033 | if ( (vga.feature_control&3)==2 ) { |
| 1033 | | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(machine, 0)&0xc0)>>1); |
| 1034 | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(space, 0)&0xc0)>>1); |
| 1034 | 1035 | } else if ((vga.feature_control&3)==1 ) { |
| 1035 | | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(machine, 0)&0x30)<<1); |
| 1036 | data=(data&~0x60)|((vga.vga_intf.read_dipswitch(space, 0)&0x30)<<1); |
| 1036 | 1037 | } |
| 1037 | 1038 | } |
| 1038 | 1039 | return data; |
| r3624 | r3625 | |
| 1078 | 1079 | |
| 1079 | 1080 | |
| 1080 | 1081 | |
| 1081 | | static READ64_HANDLER( vga_port64be_03b0_r ) { return read64be_with_read8_handler(vga_port_03b0_r, machine, offset, mem_mask); } |
| 1082 | | static READ64_HANDLER( vga_port64be_03c0_r ) { return read64be_with_read8_handler(vga_port_03c0_r, machine, offset, mem_mask); } |
| 1083 | | static READ64_HANDLER( vga_port64be_03d0_r ) { return read64be_with_read8_handler(vga_port_03d0_r, machine, offset, mem_mask); } |
| 1082 | static READ64_HANDLER( vga_port64be_03b0_r ) { return read64be_with_read8_handler(vga_port_03b0_r, space, offset, mem_mask); } |
| 1083 | static READ64_HANDLER( vga_port64be_03c0_r ) { return read64be_with_read8_handler(vga_port_03c0_r, space, offset, mem_mask); } |
| 1084 | static READ64_HANDLER( vga_port64be_03d0_r ) { return read64be_with_read8_handler(vga_port_03d0_r, space, offset, mem_mask); } |
| 1084 | 1085 | |
| 1085 | | static WRITE64_HANDLER( vga_port64be_03b0_w ) { write64be_with_write8_handler(vga_port_03b0_w, machine, offset, data, mem_mask); } |
| 1086 | | static WRITE64_HANDLER( vga_port64be_03c0_w ) { write64be_with_write8_handler(vga_port_03c0_w, machine, offset, data, mem_mask); } |
| 1087 | | static WRITE64_HANDLER( vga_port64be_03d0_w ) { write64be_with_write8_handler(vga_port_03d0_w, machine, offset, data, mem_mask); } |
| 1086 | static WRITE64_HANDLER( vga_port64be_03b0_w ) { write64be_with_write8_handler(vga_port_03b0_w, space, offset, data, mem_mask); } |
| 1087 | static WRITE64_HANDLER( vga_port64be_03c0_w ) { write64be_with_write8_handler(vga_port_03c0_w, space, offset, data, mem_mask); } |
| 1088 | static WRITE64_HANDLER( vga_port64be_03d0_w ) { write64be_with_write8_handler(vga_port_03d0_w, space, offset, data, mem_mask); } |
| 1088 | 1089 | |
| 1089 | 1090 | |
| 1090 | 1091 | |
| 1091 | 1092 | void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf) |
| 1092 | 1093 | { |
| 1093 | 1094 | int i, j, k, mask, buswidth; |
| 1095 | const address_space *spacevga; |
| 1094 | 1096 | |
| 1095 | 1097 | memset(&vga, 0, sizeof(vga)); |
| 1096 | 1098 | |
| r3624 | r3625 | |
| 1135 | 1137 | memset(vga.crtc.data, '\0', vga.svga_intf.crtc_regcount); |
| 1136 | 1138 | memset(vga.gc.data, '\0', vga.svga_intf.gc_regcount); |
| 1137 | 1139 | |
| 1138 | | buswidth = cputype_databus_width(machine->config->cpu[0].type, ADDRESS_SPACE_PROGRAM); |
| 1140 | buswidth = cpu_get_databus_width(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1141 | spacevga =cpu_get_address_space(machine->cpu[0],vga.vga_intf.port_addressspace); |
| 1139 | 1142 | switch(buswidth) |
| 1140 | 1143 | { |
| 1141 | 1144 | case 8: |
| 1142 | | memory_install_read8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_r ); |
| 1143 | | memory_install_read8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_r ); |
| 1144 | | memory_install_read8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_r ); |
| 1145 | memory_install_read8_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_r ); |
| 1146 | memory_install_read8_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_r ); |
| 1147 | memory_install_read8_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_r ); |
| 1145 | 1148 | |
| 1146 | | memory_install_write8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_w ); |
| 1147 | | memory_install_write8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_w ); |
| 1148 | | memory_install_write8_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_w ); |
| 1149 | memory_install_write8_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port_03b0_w ); |
| 1150 | memory_install_write8_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port_03c0_w ); |
| 1151 | memory_install_write8_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port_03d0_w ); |
| 1149 | 1152 | break; |
| 1150 | 1153 | |
| 1151 | 1154 | case 64: |
| 1152 | | memory_install_read64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_r ); |
| 1153 | | memory_install_read64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_r ); |
| 1154 | | memory_install_read64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_r ); |
| 1155 | memory_install_read64_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_r ); |
| 1156 | memory_install_read64_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_r ); |
| 1157 | memory_install_read64_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_r ); |
| 1155 | 1158 | |
| 1156 | | memory_install_write64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_w ); |
| 1157 | | memory_install_write64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_w ); |
| 1158 | | memory_install_write64_handler(machine, 0, vga.vga_intf.port_addressspace, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_w ); |
| 1159 | memory_install_write64_handler(spacevga, vga.vga_intf.port_offset + 0x3b0, vga.vga_intf.port_offset + 0x3bf, 0, 0, vga_port64be_03b0_w ); |
| 1160 | memory_install_write64_handler(spacevga, vga.vga_intf.port_offset + 0x3c0, vga.vga_intf.port_offset + 0x3cf, 0, 0, vga_port64be_03c0_w ); |
| 1161 | memory_install_write64_handler(spacevga, vga.vga_intf.port_offset + 0x3d0, vga.vga_intf.port_offset + 0x3df, 0, 0, vga_port64be_03d0_w ); |
| 1159 | 1162 | break; |
| 1160 | 1163 | } |
| 1161 | 1164 | |
| r3624 | r3625 | |
| 1473 | 1476 | |
| 1474 | 1477 | |
| 1475 | 1478 | |
| 1476 | | READ16_HANDLER( vga_port16le_03b0_r ) { return read16le_with_read8_handler(vga_port_03b0_r, machine, offset, mem_mask); } |
| 1477 | | READ16_HANDLER( vga_port16le_03c0_r ) { return read16le_with_read8_handler(vga_port_03c0_r, machine, offset, mem_mask); } |
| 1478 | | READ16_HANDLER( vga_port16le_03d0_r ) { return read16le_with_read8_handler(vga_port_03d0_r, machine, offset, mem_mask); } |
| 1479 | | WRITE16_HANDLER( vga_port16le_03b0_w ) { write16le_with_write8_handler(vga_port_03b0_w, machine, offset, data, mem_mask); } |
| 1480 | | WRITE16_HANDLER( vga_port16le_03c0_w ) { write16le_with_write8_handler(vga_port_03c0_w, machine, offset, data, mem_mask); } |
| 1481 | | WRITE16_HANDLER( vga_port16le_03d0_w ) { write16le_with_write8_handler(vga_port_03d0_w, machine, offset, data, mem_mask); } |
| 1479 | READ16_HANDLER( vga_port16le_03b0_r ) { return read16le_with_read8_handler(vga_port_03b0_r, space, offset, mem_mask); } |
| 1480 | READ16_HANDLER( vga_port16le_03c0_r ) { return read16le_with_read8_handler(vga_port_03c0_r, space, offset, mem_mask); } |
| 1481 | READ16_HANDLER( vga_port16le_03d0_r ) { return read16le_with_read8_handler(vga_port_03d0_r, space, offset, mem_mask); } |
| 1482 | WRITE16_HANDLER( vga_port16le_03b0_w ) { write16le_with_write8_handler(vga_port_03b0_w, space, offset, data, mem_mask); } |
| 1483 | WRITE16_HANDLER( vga_port16le_03c0_w ) { write16le_with_write8_handler(vga_port_03c0_w, space, offset, data, mem_mask); } |
| 1484 | WRITE16_HANDLER( vga_port16le_03d0_w ) { write16le_with_write8_handler(vga_port_03d0_w, space, offset, data, mem_mask); } |
| 1482 | 1485 | |
| 1483 | | READ16_HANDLER( paradise_ega16le_03c0_r ) { return read16le_with_read8_handler(paradise_ega_03c0_r, machine, offset, mem_mask); } |
| 1486 | READ16_HANDLER( paradise_ega16le_03c0_r ) { return read16le_with_read8_handler(paradise_ega_03c0_r, space, offset, mem_mask); } |
src/mess/video/crtc_ega.c
| r3624 | r3625 | |
| 158 | 158 | { |
| 159 | 159 | crtc_ega_t *crtc_ega = get_safe_token(device); |
| 160 | 160 | |
| 161 | | if (LOG) logerror("CRTC_EGA PC %04x: reg 0x%02x = 0x%02x\n", activecpu_get_pc(), crtc_ega->register_address_latch, data); |
| 161 | if (LOG) logerror("CRTC_EGA PC %04x: reg 0x%02x = 0x%02x\n", cpu_get_pc(device->machine->cpu[0]), crtc_ega->register_address_latch, data); |
| 162 | 162 | |
| 163 | 163 | switch (crtc_ega->register_address_latch) |
| 164 | 164 | { |
| r3624 | r3625 | |
| 681 | 681 | static void common_start(const device_config *device, int device_type) |
| 682 | 682 | { |
| 683 | 683 | crtc_ega_t *crtc_ega = get_safe_token(device); |
| 684 | | char unique_tag[30]; |
| 685 | 684 | |
| 686 | 685 | /* validate arguments */ |
| 687 | 686 | assert(device != NULL); |
| r3624 | r3625 | |
| 724 | 723 | crtc_ega->light_pen_latch_timer = timer_alloc(light_pen_latch_timer_cb, (void *)device); |
| 725 | 724 | |
| 726 | 725 | /* register for state saving */ |
| 727 | | state_save_combine_module_and_tag(unique_tag, device_tags[device_type], device->tag); |
| 728 | 726 | |
| 729 | 727 | state_save_register_postload(device->machine, crtc_ega_state_save_postload, crtc_ega); |
| 730 | 728 | |
| 731 | | state_save_register_item(unique_tag, 0, crtc_ega->clock); |
| 732 | | state_save_register_item(unique_tag, 0, crtc_ega->hpixels_per_column); |
| 733 | | state_save_register_item(unique_tag, 0, crtc_ega->register_address_latch); |
| 734 | | state_save_register_item(unique_tag, 0, crtc_ega->horiz_char_total); |
| 735 | | state_save_register_item(unique_tag, 0, crtc_ega->horiz_disp); |
| 736 | | state_save_register_item(unique_tag, 0, crtc_ega->horiz_blank_start); |
| 737 | | state_save_register_item(unique_tag, 0, crtc_ega->mode_control); |
| 738 | | state_save_register_item(unique_tag, 0, crtc_ega->cursor_start_ras); |
| 739 | | state_save_register_item(unique_tag, 0, crtc_ega->cursor_end_ras); |
| 740 | | state_save_register_item(unique_tag, 0, crtc_ega->disp_start_addr); |
| 741 | | state_save_register_item(unique_tag, 0, crtc_ega->cursor_addr); |
| 742 | | state_save_register_item(unique_tag, 0, crtc_ega->light_pen_addr); |
| 743 | | state_save_register_item(unique_tag, 0, crtc_ega->light_pen_latched); |
| 744 | | state_save_register_item(unique_tag, 0, crtc_ega->cursor_state); |
| 745 | | state_save_register_item(unique_tag, 0, crtc_ega->cursor_blink_count); |
| 746 | | state_save_register_item(unique_tag, 0, crtc_ega->horiz_blank_end); |
| 747 | | state_save_register_item(unique_tag, 0, crtc_ega->ena_vert_access); |
| 748 | | state_save_register_item(unique_tag, 0, crtc_ega->de_skew); |
| 749 | | state_save_register_item(unique_tag, 0, crtc_ega->horiz_retr_start); |
| 750 | | state_save_register_item(unique_tag, 0, crtc_ega->horiz_retr_end); |
| 751 | | state_save_register_item(unique_tag, 0, crtc_ega->horiz_retr_skew); |
| 752 | | state_save_register_item(unique_tag, 0, crtc_ega->vert_total); |
| 753 | | state_save_register_item(unique_tag, 0, crtc_ega->preset_row_scan); |
| 754 | | state_save_register_item(unique_tag, 0, crtc_ega->byte_panning); |
| 755 | | state_save_register_item(unique_tag, 0, crtc_ega->max_ras_addr); |
| 756 | | state_save_register_item(unique_tag, 0, crtc_ega->scan_doubling); |
| 757 | | state_save_register_item(unique_tag, 0, crtc_ega->cursor_disable); |
| 758 | | state_save_register_item(unique_tag, 0, crtc_ega->cursor_skew); |
| 759 | | state_save_register_item(unique_tag, 0, crtc_ega->vert_retr_start); |
| 760 | | state_save_register_item(unique_tag, 0, crtc_ega->vert_retr_end); |
| 761 | | state_save_register_item(unique_tag, 0, crtc_ega->protect); |
| 762 | | state_save_register_item(unique_tag, 0, crtc_ega->bandwidth); |
| 763 | | state_save_register_item(unique_tag, 0, crtc_ega->vert_disp_end); |
| 764 | | state_save_register_item(unique_tag, 0, crtc_ega->offset); |
| 765 | | state_save_register_item(unique_tag, 0, crtc_ega->underline_loc); |
| 766 | | state_save_register_item(unique_tag, 0, crtc_ega->vert_blank_start); |
| 767 | | state_save_register_item(unique_tag, 0, crtc_ega->vert_blank_end); |
| 768 | | state_save_register_item(unique_tag, 0, crtc_ega->line_compare); |
| 729 | state_save_register_item(device->tag, NULL, 0, crtc_ega->clock); |
| 730 | state_save_register_item(device->tag, NULL, 0, crtc_ega->hpixels_per_column); |
| 731 | state_save_register_item(device->tag, NULL, 0, crtc_ega->register_address_latch); |
| 732 | state_save_register_item(device->tag, NULL, 0, crtc_ega->horiz_char_total); |
| 733 | state_save_register_item(device->tag, NULL, 0, crtc_ega->horiz_disp); |
| 734 | state_save_register_item(device->tag, NULL, 0, crtc_ega->horiz_blank_start); |
| 735 | state_save_register_item(device->tag, NULL, 0, crtc_ega->mode_control); |
| 736 | state_save_register_item(device->tag, NULL, 0, crtc_ega->cursor_start_ras); |
| 737 | state_save_register_item(device->tag, NULL, 0, crtc_ega->cursor_end_ras); |
| 738 | state_save_register_item(device->tag, NULL, 0, crtc_ega->disp_start_addr); |
| 739 | state_save_register_item(device->tag, NULL, 0, crtc_ega->cursor_addr); |
| 740 | state_save_register_item(device->tag, NULL, 0, crtc_ega->light_pen_addr); |
| 741 | state_save_register_item(device->tag, NULL, 0, crtc_ega->light_pen_latched); |
| 742 | state_save_register_item(device->tag, NULL, 0, crtc_ega->cursor_state); |
| 743 | state_save_register_item(device->tag, NULL, 0, crtc_ega->cursor_blink_count); |
| 744 | state_save_register_item(device->tag, NULL, 0, crtc_ega->horiz_blank_end); |
| 745 | state_save_register_item(device->tag, NULL, 0, crtc_ega->ena_vert_access); |
| 746 | state_save_register_item(device->tag, NULL, 0, crtc_ega->de_skew); |
| 747 | state_save_register_item(device->tag, NULL, 0, crtc_ega->horiz_retr_start); |
| 748 | state_save_register_item(device->tag, NULL, 0, crtc_ega->horiz_retr_end); |
| 749 | state_save_register_item(device->tag, NULL, 0, crtc_ega->horiz_retr_skew); |
| 750 | state_save_register_item(device->tag, NULL, 0, crtc_ega->vert_total); |
| 751 | state_save_register_item(device->tag, NULL, 0, crtc_ega->preset_row_scan); |
| 752 | state_save_register_item(device->tag, NULL, 0, crtc_ega->byte_panning); |
| 753 | state_save_register_item(device->tag, NULL, 0, crtc_ega->max_ras_addr); |
| 754 | state_save_register_item(device->tag, NULL, 0, crtc_ega->scan_doubling); |
| 755 | state_save_register_item(device->tag, NULL, 0, crtc_ega->cursor_disable); |
| 756 | state_save_register_item(device->tag, NULL, 0, crtc_ega->cursor_skew); |
| 757 | state_save_register_item(device->tag, NULL, 0, crtc_ega->vert_retr_start); |
| 758 | state_save_register_item(device->tag, NULL, 0, crtc_ega->vert_retr_end); |
| 759 | state_save_register_item(device->tag, NULL, 0, crtc_ega->protect); |
| 760 | state_save_register_item(device->tag, NULL, 0, crtc_ega->bandwidth); |
| 761 | state_save_register_item(device->tag, NULL, 0, crtc_ega->vert_disp_end); |
| 762 | state_save_register_item(device->tag, NULL, 0, crtc_ega->offset); |
| 763 | state_save_register_item(device->tag, NULL, 0, crtc_ega->underline_loc); |
| 764 | state_save_register_item(device->tag, NULL, 0, crtc_ega->vert_blank_start); |
| 765 | state_save_register_item(device->tag, NULL, 0, crtc_ega->vert_blank_end); |
| 766 | state_save_register_item(device->tag, NULL, 0, crtc_ega->line_compare); |
| 769 | 767 | } |
| 770 | 768 | |
| 771 | 769 | |
src/mess/video/pc_cga.c
| r3624 | r3625 | |
| 446 | 446 | |
| 447 | 447 | cga.chr_gen = memory_region( machine, "gfx1" ) + 0x1000; |
| 448 | 448 | |
| 449 | | state_save_register_item("pccga", 0, cga.mode_control); |
| 450 | | state_save_register_item("pccga", 0, cga.color_select); |
| 451 | | state_save_register_item("pccga", 0, cga.status); |
| 452 | | state_save_register_item("pccga", 0, cga.plantronics); |
| 449 | state_save_register_item("pccga", NULL, 0, cga.mode_control); |
| 450 | state_save_register_item("pccga", NULL, 0, cga.color_select); |
| 451 | state_save_register_item("pccga", NULL, 0, cga.status); |
| 452 | state_save_register_item("pccga", NULL, 0, cga.plantronics); |
| 453 | 453 | |
| 454 | 454 | cga.config_input_port = input_port_by_tag(machine->portconfig, "pcvideo_cga_config" ); |
| 455 | 455 | |
| r3624 | r3625 | |
| 461 | 461 | static VIDEO_START( pc_cga ) |
| 462 | 462 | { |
| 463 | 463 | int buswidth; |
| 464 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 465 | const address_space *spaceio = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO); |
| 464 | 466 | |
| 465 | 467 | /* Changed video RAM size to full 32k, for cards which support the |
| 466 | 468 | * Plantronics chipset. |
| 467 | 469 | * TODO: Cards which don't support Plantronics should repeat at |
| 468 | 470 | * BC000h */ |
| 469 | | buswidth = cputype_databus_width(machine->config->cpu[0].type, ADDRESS_SPACE_PROGRAM); |
| 471 | buswidth = cpu_get_databus_width(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 470 | 472 | switch(buswidth) |
| 471 | 473 | { |
| 472 | 474 | case 8: |
| 473 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); |
| 474 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram_w ); |
| 475 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga8_r ); |
| 476 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga8_w ); |
| 475 | memory_install_read8_handler(space, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); |
| 476 | memory_install_write8_handler(space, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram_w ); |
| 477 | memory_install_read8_handler(spaceio, 0x3d0, 0x3df, 0, 0, pc_cga8_r ); |
| 478 | memory_install_write8_handler(spaceio, 0x3d0, 0x3df, 0, 0, pc_cga8_w ); |
| 477 | 479 | break; |
| 478 | 480 | |
| 479 | 481 | case 16: |
| 480 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); |
| 481 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram16le_w ); |
| 482 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga16le_r ); |
| 483 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga16le_w ); |
| 482 | memory_install_read16_handler(space, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); |
| 483 | memory_install_write16_handler(space, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram16le_w ); |
| 484 | memory_install_read16_handler(spaceio, 0x3d0, 0x3df, 0, 0, pc_cga16le_r ); |
| 485 | memory_install_write16_handler(spaceio, 0x3d0, 0x3df, 0, 0, pc_cga16le_w ); |
| 484 | 486 | break; |
| 485 | 487 | |
| 486 | 488 | case 32: |
| 487 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); |
| 488 | | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram32_w ); |
| 489 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga32le_r ); |
| 490 | | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3df, 0, 0, pc_cga32le_w ); |
| 489 | memory_install_read32_handler(space, 0xb8000, 0xbbfff, 0, 0x04000, SMH_BANK11 ); |
| 490 | memory_install_write32_handler(space, 0xb8000, 0xbbfff, 0, 0x04000, pc_video_videoram32_w ); |
| 491 | memory_install_read32_handler(spaceio, 0x3d0, 0x3df, 0, 0, pc_cga32le_r ); |
| 492 | memory_install_write32_handler(spaceio, 0x3d0, 0x3df, 0, 0, pc_cga32le_w ); |
| 491 | 493 | break; |
| 492 | 494 | |
| 493 | 495 | default: |
| r3624 | r3625 | |
| 499 | 501 | |
| 500 | 502 | videoram = auto_malloc(videoram_size); |
| 501 | 503 | |
| 502 | | memory_set_bankptr(11, videoram); |
| 504 | memory_set_bankptr(machine,11, videoram); |
| 503 | 505 | |
| 504 | 506 | internal_pc_cga_video_start(machine, M6845_PERSONALITY_GENUINE); |
| 505 | 507 | |
| r3624 | r3625 | |
| 1182 | 1184 | |
| 1183 | 1185 | static READ8_HANDLER( pc_cga8_r ) |
| 1184 | 1186 | { |
| 1185 | | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1187 | device_config *devconf = (device_config *) device_list_find_by_tag(space->machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1186 | 1188 | int data = 0xff; |
| 1187 | 1189 | switch( offset ) |
| 1188 | 1190 | { |
| r3624 | r3625 | |
| 1207 | 1209 | |
| 1208 | 1210 | switch(offset) { |
| 1209 | 1211 | case 0: case 2: case 4: case 6: |
| 1210 | | devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1212 | devconf = (device_config *) device_list_find_by_tag(space->machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1211 | 1213 | mc6845_address_w( devconf, offset, data ); |
| 1212 | 1214 | break; |
| 1213 | 1215 | case 1: case 3: case 5: case 7: |
| 1214 | | devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1216 | devconf = (device_config *) device_list_find_by_tag(space->machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1215 | 1217 | mc6845_register_w( devconf, offset, data ); |
| 1216 | 1218 | break; |
| 1217 | 1219 | case 8: |
| 1218 | | pc_cga_mode_control_w(machine, data); |
| 1220 | pc_cga_mode_control_w(space->machine, data); |
| 1219 | 1221 | break; |
| 1220 | 1222 | case 9: |
| 1221 | 1223 | pc_cga_color_select_w(data); |
| r3624 | r3625 | |
| 1228 | 1230 | |
| 1229 | 1231 | |
| 1230 | 1232 | |
| 1231 | | static READ16_HANDLER( pc_cga16le_r ) { return read16le_with_read8_handler(pc_cga8_r,machine, offset, mem_mask); } |
| 1232 | | static WRITE16_HANDLER( pc_cga16le_w ) { write16le_with_write8_handler(pc_cga8_w, machine, offset, data, mem_mask); } |
| 1233 | | static READ32_HANDLER( pc_cga32le_r ) { return read32le_with_read8_handler(pc_cga8_r, machine, offset, mem_mask); } |
| 1234 | | static WRITE32_HANDLER( pc_cga32le_w ) { write32le_with_write8_handler(pc_cga8_w, machine, offset, data, mem_mask); } |
| 1233 | static READ16_HANDLER( pc_cga16le_r ) { return read16le_with_read8_handler(pc_cga8_r,space, offset, mem_mask); } |
| 1234 | static WRITE16_HANDLER( pc_cga16le_w ) { write16le_with_write8_handler(pc_cga8_w, space, offset, data, mem_mask); } |
| 1235 | static READ32_HANDLER( pc_cga32le_r ) { return read32le_with_read8_handler(pc_cga8_r, space, offset, mem_mask); } |
| 1236 | static WRITE32_HANDLER( pc_cga32le_w ) { write32le_with_write8_handler(pc_cga8_w, space, offset, data, mem_mask); } |
| 1235 | 1237 | |
| 1236 | 1238 | |
| 1237 | 1239 | /* Old plantronics rendering code, leaving it uncommented until we have re-implemented it */ |
| r3624 | r3625 | |
| 1472 | 1474 | |
| 1473 | 1475 | static WRITE8_HANDLER ( pc1512_w ) |
| 1474 | 1476 | { |
| 1475 | | device_config *devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1477 | device_config *devconf = (device_config *) device_list_find_by_tag(space->machine->config->devicelist, MC6845, CGA_MC6845_NAME); |
| 1476 | 1478 | |
| 1477 | 1479 | switch (offset) |
| 1478 | 1480 | { |
| r3624 | r3625 | |
| 1501 | 1503 | } |
| 1502 | 1504 | else |
| 1503 | 1505 | { |
| 1504 | | memory_set_bankptr(1, videoram + videoram_offset[0]); |
| 1506 | memory_set_bankptr(space->machine,1, videoram + videoram_offset[0]); |
| 1505 | 1507 | } |
| 1506 | 1508 | cga.mode_control = data; |
| 1507 | 1509 | switch( cga.mode_control & 0x3F ) |
| r3624 | r3625 | |
| 1559 | 1561 | pc1512.read = data; |
| 1560 | 1562 | if ( ( cga.mode_control & 0x12 ) == 0x12 ) |
| 1561 | 1563 | { |
| 1562 | | memory_set_bankptr(1, videoram + videoram_offset[data & 3]); |
| 1564 | memory_set_bankptr(space->machine,1, videoram + videoram_offset[data & 3]); |
| 1563 | 1565 | } |
| 1564 | 1566 | break; |
| 1565 | 1567 | |
| 1566 | 1568 | default: |
| 1567 | | pc_cga8_w(machine, offset,data); |
| 1569 | pc_cga8_w(space, offset,data); |
| 1568 | 1570 | break; |
| 1569 | 1571 | } |
| 1570 | 1572 | } |
| r3624 | r3625 | |
| 1584 | 1586 | break; |
| 1585 | 1587 | |
| 1586 | 1588 | default: |
| 1587 | | data = pc_cga8_r(machine, offset); |
| 1589 | data = pc_cga8_r(space, offset); |
| 1588 | 1590 | break; |
| 1589 | 1591 | } |
| 1590 | 1592 | return data; |
| r3624 | r3625 | |
| 1612 | 1614 | |
| 1613 | 1615 | |
| 1614 | 1616 | |
| 1615 | | READ16_HANDLER ( pc1512_16le_r ) { return read16le_with_read8_handler(pc1512_r, machine, offset, mem_mask); } |
| 1616 | | WRITE16_HANDLER ( pc1512_16le_w ) { write16le_with_write8_handler(pc1512_w, machine, offset, data, mem_mask); } |
| 1617 | | WRITE16_HANDLER ( pc1512_videoram16le_w ) { write16le_with_write8_handler(pc1512_videoram_w, machine, offset, data, mem_mask); } |
| 1617 | READ16_HANDLER ( pc1512_16le_r ) { return read16le_with_read8_handler(pc1512_r, space, offset, mem_mask); } |
| 1618 | WRITE16_HANDLER ( pc1512_16le_w ) { write16le_with_write8_handler(pc1512_w, space, offset, data, mem_mask); } |
| 1619 | WRITE16_HANDLER ( pc1512_videoram16le_w ) { write16le_with_write8_handler(pc1512_videoram_w, space, offset, data, mem_mask); } |
| 1618 | 1620 | |
| 1619 | 1621 | |
| 1620 | 1622 | |
| r3624 | r3625 | |
| 1622 | 1624 | { |
| 1623 | 1625 | videoram_size = 0x10000; |
| 1624 | 1626 | videoram = auto_malloc( videoram_size ); |
| 1625 | | memory_set_bankptr(1,videoram + videoram_offset[0]); |
| 1627 | memory_set_bankptr(machine,1,videoram + videoram_offset[0]); |
| 1626 | 1628 | |
| 1627 | 1629 | memset( &pc1512, 0, sizeof ( pc1512 ) ); |
| 1628 | 1630 | pc1512.write = 0xf; |
src/mess/video/pc_ega.c
| r3624 | r3625 | |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | |
| 545 | | static void pc_ega_install_banks( void ) |
| 545 | static void pc_ega_install_banks( running_machine *machine ) |
| 546 | 546 | { |
| 547 | 547 | switch ( ega.graphics_controller.data[6] & 0x0c ) |
| 548 | 548 | { |
| r3624 | r3625 | |
| 567 | 567 | ega.videoram_b8000 = ega.videoram; |
| 568 | 568 | break; |
| 569 | 569 | } |
| 570 | | memory_set_bankptr( 11, ega.videoram_a0000 ? ega.videoram_a0000 : ega.videoram_nothing ); |
| 571 | | memory_set_bankptr( 12, ega.videoram_b0000 ? ega.videoram_b0000 : ega.videoram_nothing ); |
| 572 | | memory_set_bankptr( 13, ega.videoram_b8000 ? ega.videoram_b8000 : ega.videoram_nothing ); |
| 570 | memory_set_bankptr(machine, 11, ega.videoram_a0000 ? ega.videoram_a0000 : ega.videoram_nothing ); |
| 571 | memory_set_bankptr(machine, 12, ega.videoram_b0000 ? ega.videoram_b0000 : ega.videoram_nothing ); |
| 572 | memory_set_bankptr(machine, 13, ega.videoram_b8000 ? ega.videoram_b8000 : ega.videoram_nothing ); |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | |
| 576 | 576 | static VIDEO_START( pc_ega ) |
| 577 | 577 | { |
| 578 | 578 | int buswidth; |
| 579 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 580 | const address_space *spaceio = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO); |
| 579 | 581 | |
| 580 | | buswidth = cputype_databus_width(machine->config->cpu[0].type, ADDRESS_SPACE_PROGRAM); |
| 582 | buswidth = cpu_get_databus_width(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 581 | 583 | switch(buswidth) |
| 582 | 584 | { |
| 583 | 585 | case 8: |
| 584 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 585 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 586 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 587 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram_w ); |
| 588 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega8_3b0_r ); |
| 589 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega8_3b0_w ); |
| 590 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega8_3c0_r ); |
| 591 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega8_3c0_w ); |
| 592 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3db, 0, 0, pc_ega8_3d0_r ); |
| 593 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3db, 0, 0, pc_ega8_3d0_w ); |
| 586 | memory_install_read8_handler(space, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 587 | memory_install_read8_handler(space, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 588 | memory_install_read8_handler(space, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 589 | memory_install_write8_handler(space, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram_w ); |
| 590 | memory_install_read8_handler(spaceio, 0x3b0, 0x3bb, 0, 0, pc_ega8_3b0_r ); |
| 591 | memory_install_write8_handler(spaceio, 0x3b0, 0x3bb, 0, 0, pc_ega8_3b0_w ); |
| 592 | memory_install_read8_handler(spaceio, 0x3c0, 0x3cf, 0, 0, pc_ega8_3c0_r ); |
| 593 | memory_install_write8_handler(spaceio, 0x3c0, 0x3cf, 0, 0, pc_ega8_3c0_w ); |
| 594 | memory_install_read8_handler(spaceio, 0x3d0, 0x3db, 0, 0, pc_ega8_3d0_r ); |
| 595 | memory_install_write8_handler(spaceio, 0x3d0, 0x3db, 0, 0, pc_ega8_3d0_w ); |
| 594 | 596 | break; |
| 595 | 597 | |
| 596 | 598 | case 16: |
| 597 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 598 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 599 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 600 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram16le_w ); |
| 601 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega16le_3b0_r ); |
| 602 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega16le_3b0_w ); |
| 603 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega16le_3c0_r ); |
| 604 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega16le_3c0_w ); |
| 605 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3db, 0, 0, pc_ega16le_3d0_r ); |
| 606 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3db, 0, 0, pc_ega16le_3d0_w ); |
| 599 | memory_install_read16_handler(space, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 600 | memory_install_read16_handler(space, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 601 | memory_install_read16_handler(space, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 602 | memory_install_write16_handler(space, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram16le_w ); |
| 603 | memory_install_read16_handler(spaceio, 0x3b0, 0x3bb, 0, 0, pc_ega16le_3b0_r ); |
| 604 | memory_install_write16_handler(spaceio, 0x3b0, 0x3bb, 0, 0, pc_ega16le_3b0_w ); |
| 605 | memory_install_read16_handler(spaceio, 0x3c0, 0x3cf, 0, 0, pc_ega16le_3c0_r ); |
| 606 | memory_install_write16_handler(spaceio, 0x3c0, 0x3cf, 0, 0, pc_ega16le_3c0_w ); |
| 607 | memory_install_read16_handler(spaceio, 0x3d0, 0x3db, 0, 0, pc_ega16le_3d0_r ); |
| 608 | memory_install_write16_handler(spaceio, 0x3d0, 0x3db, 0, 0, pc_ega16le_3d0_w ); |
| 607 | 609 | break; |
| 608 | 610 | |
| 609 | 611 | case 32: |
| 610 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 611 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 612 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 613 | | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram32le_w ); |
| 614 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega32le_3b0_r ); |
| 615 | | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3b0, 0x3bb, 0, 0, pc_ega32le_3b0_w ); |
| 616 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega32le_3c0_r ); |
| 617 | | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3c0, 0x3cf, 0, 0, pc_ega32le_3c0_w ); |
| 618 | | memory_install_read32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3db, 0, 0, pc_ega32le_3d0_r ); |
| 619 | | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_IO, 0x3d0, 0x3db, 0, 0, pc_ega32le_3d0_w ); |
| 612 | memory_install_read32_handler(space, 0xa0000, 0xaffff, 0, 0, SMH_BANK11 ); |
| 613 | memory_install_read32_handler(space, 0xb0000, 0xb7fff, 0, 0, SMH_BANK12 ); |
| 614 | memory_install_read32_handler(space, 0xb8000, 0xbffff, 0, 0, SMH_BANK13 ); |
| 615 | memory_install_write32_handler(space, 0xa0000, 0xbffff, 0, 0, pc_ega_videoram32le_w ); |
| 616 | memory_install_read32_handler(spaceio, 0x3b0, 0x3bb, 0, 0, pc_ega32le_3b0_r ); |
| 617 | memory_install_write32_handler(spaceio, 0x3b0, 0x3bb, 0, 0, pc_ega32le_3b0_w ); |
| 618 | memory_install_read32_handler(spaceio, 0x3c0, 0x3cf, 0, 0, pc_ega32le_3c0_r ); |
| 619 | memory_install_write32_handler(spaceio, 0x3c0, 0x3cf, 0, 0, pc_ega32le_3c0_w ); |
| 620 | memory_install_read32_handler(spaceio, 0x3d0, 0x3db, 0, 0, pc_ega32le_3d0_r ); |
| 621 | memory_install_write32_handler(spaceio, 0x3d0, 0x3db, 0, 0, pc_ega32le_3d0_w ); |
| 620 | 622 | break; |
| 621 | 623 | |
| 622 | 624 | default: |
| r3624 | r3625 | |
| 633 | 635 | |
| 634 | 636 | ega.videoram_nothing = ega.videoram + ( 256 * 1024 ); |
| 635 | 637 | |
| 636 | | pc_ega_install_banks(); |
| 638 | pc_ega_install_banks(machine); |
| 637 | 639 | |
| 638 | 640 | ega.crtc_ega = device_list_find_by_tag(machine->config->devicelist, CRTC_EGA, EGA_CRTC_NAME); |
| 639 | 641 | ega.update_row = NULL; |
| r3624 | r3625 | |
| 860 | 862 | |
| 861 | 863 | static READ8_HANDLER( pc_ega8_3b0_r ) |
| 862 | 864 | { |
| 863 | | return ( ega.misc_output & 0x01 ) ? 0xFF : pc_ega8_3X0_r( machine, offset ); |
| 865 | return ( ega.misc_output & 0x01 ) ? 0xFF : pc_ega8_3X0_r( space, offset ); |
| 864 | 866 | } |
| 865 | 867 | |
| 866 | 868 | |
| 867 | 869 | static READ8_HANDLER( pc_ega8_3d0_r ) |
| 868 | 870 | { |
| 869 | | return ( ega.misc_output & 0x01 ) ? pc_ega8_3X0_r( machine, offset ) : 0xFF; |
| 871 | return ( ega.misc_output & 0x01 ) ? pc_ega8_3X0_r( space, offset ) : 0xFF; |
| 870 | 872 | } |
| 871 | 873 | |
| 872 | 874 | |
| r3624 | r3625 | |
| 874 | 876 | { |
| 875 | 877 | if ( ! ( ega.misc_output & 0x01 ) ) |
| 876 | 878 | { |
| 877 | | pc_ega8_3X0_w( machine, offset, data ); |
| 879 | pc_ega8_3X0_w( space, offset, data ); |
| 878 | 880 | } |
| 879 | 881 | } |
| 880 | 882 | |
| r3624 | r3625 | |
| 883 | 885 | { |
| 884 | 886 | if ( ega.misc_output & 0x01 ) |
| 885 | 887 | { |
| 886 | | pc_ega8_3X0_w( machine, offset, data ); |
| 888 | pc_ega8_3X0_w( space, offset, data ); |
| 887 | 889 | } |
| 888 | 890 | } |
| 889 | 891 | |
| r3624 | r3625 | |
| 1022 | 1024 | { |
| 1023 | 1025 | case 0x06: /* GR06 */ |
| 1024 | 1026 | pc_ega_change_mode( ega.crtc_ega ); |
| 1025 | | pc_ega_install_banks(); |
| 1027 | pc_ega_install_banks(space->machine); |
| 1026 | 1028 | break; |
| 1027 | 1029 | } |
| 1028 | 1030 | break; |
| 1029 | 1031 | } |
| 1030 | 1032 | } |
| 1031 | 1033 | |
| 1032 | | static READ16_HANDLER( pc_ega16le_3b0_r ) { return read16le_with_read8_handler(pc_ega8_3b0_r,machine, offset, mem_mask); } |
| 1033 | | static WRITE16_HANDLER( pc_ega16le_3b0_w ) { write16le_with_write8_handler(pc_ega8_3b0_w, machine, offset, data, mem_mask); } |
| 1034 | | static READ32_HANDLER( pc_ega32le_3b0_r ) { return read32le_with_read8_handler(pc_ega8_3b0_r, machine, offset, mem_mask); } |
| 1035 | | static WRITE32_HANDLER( pc_ega32le_3b0_w ) { write32le_with_write8_handler(pc_ega8_3b0_w, machine, offset, data, mem_mask); } |
| 1034 | static READ16_HANDLER( pc_ega16le_3b0_r ) { return read16le_with_read8_handler(pc_ega8_3b0_r,space, offset, mem_mask); } |
| 1035 | static WRITE16_HANDLER( pc_ega16le_3b0_w ) { write16le_with_write8_handler(pc_ega8_3b0_w, space, offset, data, mem_mask); } |
| 1036 | static READ32_HANDLER( pc_ega32le_3b0_r ) { return read32le_with_read8_handler(pc_ega8_3b0_r, space, offset, mem_mask); } |
| 1037 | static WRITE32_HANDLER( pc_ega32le_3b0_w ) { write32le_with_write8_handler(pc_ega8_3b0_w, space, offset, data, mem_mask); } |
| 1036 | 1038 | |
| 1037 | | static READ16_HANDLER( pc_ega16le_3c0_r ) { return read16le_with_read8_handler(pc_ega8_3c0_r,machine, offset, mem_mask); } |
| 1038 | | static WRITE16_HANDLER( pc_ega16le_3c0_w ) { write16le_with_write8_handler(pc_ega8_3c0_w, machine, offset, data, mem_mask); } |
| 1039 | | static READ32_HANDLER( pc_ega32le_3c0_r ) { return read32le_with_read8_handler(pc_ega8_3c0_r, machine, offset, mem_mask); } |
| 1040 | | static WRITE32_HANDLER( pc_ega32le_3c0_w ) { write32le_with_write8_handler(pc_ega8_3c0_w, machine, offset, data, mem_mask); } |
| 1039 | static READ16_HANDLER( pc_ega16le_3c0_r ) { return read16le_with_read8_handler(pc_ega8_3c0_r,space, offset, mem_mask); } |
| 1040 | static WRITE16_HANDLER( pc_ega16le_3c0_w ) { write16le_with_write8_handler(pc_ega8_3c0_w, space, offset, data, mem_mask); } |
| 1041 | static READ32_HANDLER( pc_ega32le_3c0_r ) { return read32le_with_read8_handler(pc_ega8_3c0_r, space, offset, mem_mask); } |
| 1042 | static WRITE32_HANDLER( pc_ega32le_3c0_w ) { write32le_with_write8_handler(pc_ega8_3c0_w, space, offset, data, mem_mask); } |
| 1041 | 1043 | |
| 1042 | | static READ16_HANDLER( pc_ega16le_3d0_r ) { return read16le_with_read8_handler(pc_ega8_3d0_r,machine, offset, mem_mask); } |
| 1043 | | static WRITE16_HANDLER( pc_ega16le_3d0_w ) { write16le_with_write8_handler(pc_ega8_3d0_w, machine, offset, data, mem_mask); } |
| 1044 | | static READ32_HANDLER( pc_ega32le_3d0_r ) { return read32le_with_read8_handler(pc_ega8_3d0_r, machine, offset, mem_mask); } |
| 1045 | | static WRITE32_HANDLER( pc_ega32le_3d0_w ) { write32le_with_write8_handler(pc_ega8_3d0_w, machine, offset, data, mem_mask); } |
| 1044 | static READ16_HANDLER( pc_ega16le_3d0_r ) { return read16le_with_read8_handler(pc_ega8_3d0_r,space, offset, mem_mask); } |
| 1045 | static WRITE16_HANDLER( pc_ega16le_3d0_w ) { write16le_with_write8_handler(pc_ega8_3d0_w, space, offset, data, mem_mask); } |
| 1046 | static READ32_HANDLER( pc_ega32le_3d0_r ) { return read32le_with_read8_handler(pc_ega8_3d0_r, space, offset, mem_mask); } |
| 1047 | static WRITE32_HANDLER( pc_ega32le_3d0_w ) { write32le_with_write8_handler(pc_ega8_3d0_w, space, offset, data, mem_mask); } |
| 1046 | 1048 | |
| 1047 | 1049 | static WRITE8_HANDLER( pc_ega_videoram_w ) |
| 1048 | 1050 | { |
| r3624 | r3625 | |
| 1070 | 1072 | } |
| 1071 | 1073 | } |
| 1072 | 1074 | |
| 1073 | | static WRITE16_HANDLER( pc_ega_videoram16le_w ) { write16le_with_write8_handler(pc_ega_videoram_w, machine, offset, data, mem_mask); } |
| 1074 | | static WRITE32_HANDLER( pc_ega_videoram32le_w ) { write32le_with_write8_handler(pc_ega_videoram_w, machine, offset, data, mem_mask); } |
| 1075 | static WRITE16_HANDLER( pc_ega_videoram16le_w ) { write16le_with_write8_handler(pc_ega_videoram_w, space, offset, data, mem_mask); } |
| 1076 | static WRITE32_HANDLER( pc_ega_videoram32le_w ) { write32le_with_write8_handler(pc_ega_videoram_w, space, offset, data, mem_mask); } |
| 1075 | 1077 | |
src/mess/messdriv.c
| r3624 | r3625 | |
| 216 | 216 | //128u4 DRIVER( z88 ) /* */ |
| 217 | 217 | |
| 218 | 218 | /* AMSTRAD */ |
| 219 | | //128u4 DRIVER( cpc464 ) /* Amstrad (Schneider in Germany) 1984 */ |
| 220 | | //128u4 DRIVER( cpc664 ) /* Amstrad (Schneider in Germany) 1985 */ |
| 221 | | //128u4 DRIVER( cpc6128 ) /* Amstrad (Schneider in Germany) 1985 */ |
| 222 | | //128u4 DRIVER( cpc6128s ) /* Amstrad (Schneider in Germany) 1985 */ |
| 223 | | //128u4 DRIVER( cpc6128f ) /* Amstrad (Schneider in Germany) 1985 (AZERTY) */ |
| 224 | | //128u4 DRIVER( cpc464p ) /* Amstrad CPC464 Plus - 1990 */ |
| 225 | | //128u4 DRIVER( cpc6128p ) /* Amstrad CPC6128 Plus - 1990 */ |
| 226 | | //128u4 DRIVER( gx4000 ) /* Amstrad GX4000 - 1990 */ |
| 227 | | //128u4 DRIVER( kccomp ) /* VEB KC compact */ |
| 228 | | //128u4 DRIVER( al520ex ) /* Patisonic Aleste 520EX (1993) */ |
| 229 | | //128u4 DRIVER( pcw8256 ) /* 198? PCW8256 */ |
| 230 | | //128u4 DRIVER( pcw8512 ) /* 198? PCW8512 */ |
| 231 | | //128u4 DRIVER( pcw9256 ) /* 198? PCW9256 */ |
| 232 | | //128u4 DRIVER( pcw9512 ) /* 198? PCW9512 (+) */ |
| 233 | | //128u4 DRIVER( pcw10 ) /* 198? PCW10 */ |
| 234 | | //128u4 DRIVER( pcw16 ) /* 1995 PCW16 */ |
| 235 | | //128u4 DRIVER( nc100 ) /* 19?? NC100 */ |
| 236 | | //128u4 DRIVER( nc200 ) /* 19?? NC200 */ |
| 219 | DRIVER( cpc464 ) /* Amstrad (Schneider in Germany) 1984 */ |
| 220 | DRIVER( cpc664 ) /* Amstrad (Schneider in Germany) 1985 */ |
| 221 | DRIVER( cpc6128 ) /* Amstrad (Schneider in Germany) 1985 */ |
| 222 | DRIVER( cpc6128s ) /* Amstrad (Schneider in Germany) 1985 */ |
| 223 | DRIVER( cpc6128f ) /* Amstrad (Schneider in Germany) 1985 (AZERTY) */ |
| 224 | DRIVER( cpc464p ) /* Amstrad CPC464 Plus - 1990 */ |
| 225 | DRIVER( cpc6128p ) /* Amstrad CPC6128 Plus - 1990 */ |
| 226 | DRIVER( gx4000 ) /* Amstrad GX4000 - 1990 */ |
| 227 | DRIVER( kccomp ) /* VEB KC compact */ |
| 228 | DRIVER( al520ex ) /* Patisonic Aleste 520EX (1993) */ |
| 229 | DRIVER( pcw8256 ) /* 198? PCW8256 */ |
| 230 | DRIVER( pcw8512 ) /* 198? PCW8512 */ |
| 231 | DRIVER( pcw9256 ) /* 198? PCW9256 */ |
| 232 | DRIVER( pcw9512 ) /* 198? PCW9512 (+) */ |
| 233 | DRIVER( pcw10 ) /* 198? PCW10 */ |
| 234 | DRIVER( pcw16 ) /* 1995 PCW16 */ |
| 235 | DRIVER( nc100 ) /* 19?? NC100 */ |
| 236 | DRIVER( nc200 ) /* 19?? NC200 */ |
| 237 | 237 | |
| 238 | 238 | /* APPLE */ |
| 239 | 239 | //128u4 DRIVER( apple1 ) /* Jul 1976 Apple 1 */ |
| r3624 | r3625 | |
| 665 | 665 | //128u4 DRIVER( sb2m600b ) /* 1979 Superboard II */ |
| 666 | 666 | |
| 667 | 667 | /* ASCII & MICROSOFT */ |
| 668 | | //128u4 DRIVER( msx ) /* 1983 MSX */ |
| 669 | | //128u4 DRIVER( ax170 ) |
| 670 | | //128u4 DRIVER( canonv10 ) |
| 671 | | //128u4 DRIVER( canonv20 ) |
| 672 | | //128u4 DRIVER( dpc100 ) /* 1984 MSX Korea */ |
| 673 | | //128u4 DRIVER( dpc180 ) /* 1984 MSX Korea */ |
| 674 | | //128u4 DRIVER( dpc200 ) /* 1984 MSX Korea */ |
| 675 | | //128u4 DRIVER( gsfc200 ) |
| 676 | | //128u4 DRIVER( expert10 ) /* 1983 MSX Brazil */ |
| 677 | | //128u4 DRIVER( expert11 ) /* 1984 MSX Brazil */ |
| 678 | | //128u4 DRIVER( expert13 ) /* 1984 MSX Brazil */ |
| 679 | | //128u4 DRIVER( expertdp ) /* 1985 MSX Brazil */ |
| 680 | | //128u4 DRIVER( expertpl ) /* 1984 MSX Brazil */ |
| 681 | | //128u4 DRIVER( jvchc7gb ) |
| 682 | | //128u4 DRIVER( mlf80 ) |
| 683 | | //128u4 DRIVER( mlfx1 ) |
| 684 | | //128u4 DRIVER( cf1200 ) /* 1984 MSX Japan */ |
| 685 | | //128u4 DRIVER( cf2000 ) /* 1983 MSX Japan */ |
| 686 | | //128u4 DRIVER( cf2700 ) /* 1984 MSX Japan */ |
| 687 | | //128u4 DRIVER( cf3000 ) /* 1984 MSX Japan */ |
| 688 | | //128u4 DRIVER( cf3300 ) /* 1985 MSX Japan */ |
| 689 | | //128u4 DRIVER( fs1300 ) /* 1985 MSX Japan */ |
| 690 | | //128u4 DRIVER( fs4000 ) /* 1985 MSX Japan */ |
| 691 | | //128u4 DRIVER( nms801 ) |
| 692 | | //128u4 DRIVER( vg802000 ) |
| 693 | | //128u4 DRIVER( vg802020 ) /* 1985 MSX */ |
| 694 | | //128u4 DRIVER( piopx7 ) |
| 695 | | //128u4 DRIVER( mpc100 ) |
| 696 | | //128u4 DRIVER( hotbit11 ) /* 1985 MSX Brazil */ |
| 697 | | //128u4 DRIVER( hotbit12 ) /* 1985 MSX Brazil */ |
| 698 | | //128u4 DRIVER( hotbi13b ) /* 1985 MSX Brazil */ |
| 699 | | //128u4 DRIVER( hotbi13p ) /* 1985 MSX Brazil */ |
| 700 | | //128u4 DRIVER( hotbit20 ) /* 1986 MSX2 Brazil */ |
| 701 | | //128u4 DRIVER( hb201 ) /* 1985 MSX Japan */ |
| 702 | | //128u4 DRIVER( hb201p ) /* 1985 MSX */ |
| 703 | | //128u4 DRIVER( hb501p ) /* 1984 MSX */ |
| 704 | | //128u4 DRIVER( hb55d ) /* 1983 MSX Germany */ |
| 705 | | //128u4 DRIVER( hb55p ) /* 1983 MSX */ |
| 706 | | //128u4 DRIVER( hb75d ) /* 1983 MSX Germany */ |
| 707 | | //128u4 DRIVER( hb75p ) /* 1983 MSX */ |
| 708 | | //128u4 DRIVER( svi728 ) /* 1985 MSX */ |
| 709 | | //128u4 DRIVER( svi738 ) /* 1985 MSX */ |
| 710 | | //128u4 DRIVER( svi738sw ) /* 1985 MSX */ |
| 711 | | //128u4 DRIVER( tadpc200 ) |
| 712 | | //128u4 DRIVER( tadpc20a ) |
| 713 | | //128u4 DRIVER( hx10 ) /* 1984 MSX */ |
| 714 | | //128u4 DRIVER( hx10s ) /* 1984 MSX */ |
| 715 | | //128u4 DRIVER( hx20 ) /* 1984 MSX */ |
| 716 | | //128u4 DRIVER( cx5m ) |
| 717 | | //128u4 DRIVER( cx5m128 ) |
| 718 | | //128u4 DRIVER( cx5m2 ) |
| 719 | | //128u4 DRIVER( yis303 ) |
| 720 | | //128u4 DRIVER( yis503 ) |
| 721 | | //128u4 DRIVER( yis503ii ) |
| 722 | | //128u4 DRIVER( yis503m ) |
| 723 | | //128u4 DRIVER( yc64 ) |
| 668 | DRIVER( msx ) /* 1983 MSX */ |
| 669 | DRIVER( ax170 ) |
| 670 | DRIVER( canonv10 ) |
| 671 | DRIVER( canonv20 ) |
| 672 | DRIVER( dpc100 ) /* 1984 MSX Korea */ |
| 673 | DRIVER( dpc180 ) /* 1984 MSX Korea */ |
| 674 | DRIVER( dpc200 ) /* 1984 MSX Korea */ |
| 675 | DRIVER( gsfc200 ) |
| 676 | DRIVER( expert10 ) /* 1983 MSX Brazil */ |
| 677 | DRIVER( expert11 ) /* 1984 MSX Brazil */ |
| 678 | DRIVER( expert13 ) /* 1984 MSX Brazil */ |
| 679 | DRIVER( expertdp ) /* 1985 MSX Brazil */ |
| 680 | DRIVER( expertpl ) /* 1984 MSX Brazil */ |
| 681 | DRIVER( jvchc7gb ) |
| 682 | DRIVER( mlf80 ) |
| 683 | DRIVER( mlfx1 ) |
| 684 | DRIVER( cf1200 ) /* 1984 MSX Japan */ |
| 685 | DRIVER( cf2000 ) /* 1983 MSX Japan */ |
| 686 | DRIVER( cf2700 ) /* 1984 MSX Japan */ |
| 687 | DRIVER( cf3000 ) /* 1984 MSX Japan */ |
| 688 | DRIVER( cf3300 ) /* 1985 MSX Japan */ |
| 689 | DRIVER( fs1300 ) /* 1985 MSX Japan */ |
| 690 | DRIVER( fs4000 ) /* 1985 MSX Japan */ |
| 691 | DRIVER( nms801 ) |
| 692 | DRIVER( vg802000 ) |
| 693 | DRIVER( vg802020 ) /* 1985 MSX */ |
| 694 | DRIVER( piopx7 ) |
| 695 | DRIVER( mpc100 ) |
| 696 | DRIVER( hotbit11 ) /* 1985 MSX Brazil */ |
| 697 | DRIVER( hotbit12 ) /* 1985 MSX Brazil */ |
| 698 | DRIVER( hotbi13b ) /* 1985 MSX Brazil */ |
| 699 | DRIVER( hotbi13p ) /* 1985 MSX Brazil */ |
| 700 | DRIVER( hotbit20 ) /* 1986 MSX2 Brazil */ |
| 701 | DRIVER( hb201 ) /* 1985 MSX Japan */ |
| 702 | DRIVER( hb201p ) /* 1985 MSX */ |
| 703 | DRIVER( hb501p ) /* 1984 MSX */ |
| 704 | DRIVER( hb55d ) /* 1983 MSX Germany */ |
| 705 | DRIVER( hb55p ) /* 1983 MSX */ |
| 706 | DRIVER( hb75d ) /* 1983 MSX Germany */ |
| 707 | DRIVER( hb75p ) /* 1983 MSX */ |
| 708 | DRIVER( svi728 ) /* 1985 MSX */ |
| 709 | DRIVER( svi738 ) /* 1985 MSX */ |
| 710 | DRIVER( svi738sw ) /* 1985 MSX */ |
| 711 | DRIVER( tadpc200 ) |
| 712 | DRIVER( tadpc20a ) |
| 713 | DRIVER( hx10 ) /* 1984 MSX */ |
| 714 | DRIVER( hx10s ) /* 1984 MSX */ |
| 715 | DRIVER( hx20 ) /* 1984 MSX */ |
| 716 | DRIVER( cx5m ) |
| 717 | DRIVER( cx5m128 ) |
| 718 | DRIVER( cx5m2 ) |
| 719 | DRIVER( yis303 ) |
| 720 | DRIVER( yis503 ) |
| 721 | DRIVER( yis503ii ) |
| 722 | DRIVER( yis503m ) |
| 723 | DRIVER( yc64 ) |
| 724 | 724 | |
| 725 | 725 | |
| 726 | | //128u4 DRIVER( msx2 ) /* 1985 MSX2 */ |
| 727 | | //128u4 DRIVER( ax350 ) |
| 728 | | //128u4 DRIVER( ax370 ) |
| 729 | | //128u4 DRIVER( hbf9p ) /* 1985 MSX2 */ |
| 730 | | //128u4 DRIVER( hbf9s ) /* 1985 MSX2 */ |
| 731 | | //128u4 DRIVER( hbf500p ) /* 1985 MSX2 */ |
| 732 | | //128u4 DRIVER( hbf700d ) /* 1985 MSX2 Germany */ |
| 733 | | //128u4 DRIVER( hbf700f ) /* 1985 MSX2 */ |
| 734 | | //128u4 DRIVER( hbf700p ) /* 1985 MSX2 */ |
| 735 | | //128u4 DRIVER( hbf700s ) /* 1985 MSX2 Spain */ |
| 736 | | //128u4 DRIVER( hbg900ap ) /* 1986 MSX2 */ |
| 737 | | //128u4 DRIVER( hbg900p ) /* 1986 MSX2 */ |
| 738 | | //128u4 DRIVER( nms8220 ) /* 1986 MSX2 */ |
| 739 | | //128u4 DRIVER( nms8220a ) /* 1986 MSX2 */ |
| 740 | | //128u4 DRIVER( vg8230 ) /* 1986 MSX2 */ |
| 741 | | //128u4 DRIVER( vg8235 ) /* 1986 MSX2 */ |
| 742 | | //128u4 DRIVER( vg8235f) /* 1986 MSX2 */ |
| 743 | | //128u4 DRIVER( vg8240) /* 1986 MSX2 */ |
| 744 | | //128u4 DRIVER( nms8245 ) /* 1986 MSX2 */ |
| 745 | | //128u4 DRIVER( nms8245f) /* 1986 MSX2 */ |
| 746 | | //128u4 DRIVER( nms8250 ) /* 1986 MSX2 */ |
| 747 | | //128u4 DRIVER( nms8255 ) /* 1986 MSX2 */ |
| 748 | | //128u4 DRIVER( nms8280 ) /* 1986 MSX2 */ |
| 749 | | //128u4 DRIVER( nms8280g) /* 1986 MSX2 */ |
| 750 | | //128u4 DRIVER( tpc310) /* 1986 MSX2 */ |
| 751 | | //128u4 DRIVER( hx23) /* 1986 MSX2 */ |
| 752 | | //128u4 DRIVER( hx23f) /* 1986 MSX2 */ |
| 753 | | //128u4 DRIVER( cx7m) /* 1986 MSX2 */ |
| 754 | | //128u4 DRIVER( cx7m128) /* 1986 MSX2 */ |
| 755 | | //128u4 DRIVER( fs5500 ) /* 1985 MSX2 Japan */ |
| 756 | | //128u4 DRIVER( fs4500 ) /* 1986 MSX2 Japan */ |
| 757 | | //128u4 DRIVER( fs4700 ) /* 1986 MSX2 Japan */ |
| 758 | | //128u4 DRIVER( fs5000 ) /* 1986 MSX2 Japan */ |
| 759 | | //128u4 DRIVER( fs4600 ) /* 1986 MSX2 Japan */ |
| 760 | | //128u4 DRIVER( fsa1 ) /* 1986 MSX2 Japan */ |
| 761 | | //128u4 DRIVER( fsa1a ) /* 1986 MSX2 Japan */ |
| 762 | | //128u4 DRIVER( fsa1mk2 ) /* 1987 MSX2 Japan */ |
| 763 | | //128u4 DRIVER( fsa1f ) /* 1987 MSX2 Japan */ |
| 764 | | //128u4 DRIVER( fsa1fm ) /* 1988 MSX2 Japan */ |
| 765 | | //128u4 DRIVER( hbf500 ) /* 1986 MSX2 Japan */ |
| 766 | | //128u4 DRIVER( hbf900 ) /* 1986 MSX2 Japan */ |
| 767 | | //128u4 DRIVER( hbf900a ) /* 1986 MSX2 Japan */ |
| 768 | | //128u4 DRIVER( hbf1 ) /* 1986 MSX2 Japan */ |
| 769 | | //128u4 DRIVER( hbf12 ) /* 1987 MSX2 Japan */ |
| 770 | | //128u4 DRIVER( hbf1xd ) /* 1987 MSX2 Japan */ |
| 771 | | //128u4 DRIVER( hbf1xdm2 ) /* 1988 MSX2 Japan */ |
| 772 | | //128u4 DRIVER( phc23 ) /* 1986 MSX2 Japan */ |
| 773 | | //128u4 DRIVER( cpc300 ) /* 1986 MSX2 Korea */ |
| 774 | | //128u4 DRIVER( cpc300e ) /* 1986 MSX2 Korea */ |
| 775 | | //128u4 DRIVER( cpc400 ) /* 1986 MSX2 Korea */ |
| 776 | | //128u4 DRIVER( cpc400s ) /* 1986 MSX2 Korea */ |
| 777 | | //128u4 DRIVER( expert20 )/* 1986 MSX2 Korea */ |
| 778 | | |
| 779 | | //128u4 DRIVER( msx2p ) /* 1988 MSX2+ Japan */ |
| 780 | | //128u4 DRIVER( fsa1fx ) /* 1988 MSX2+ Japan */ |
| 781 | | //128u4 DRIVER( fsa1wx ) /* 1988 MSX2+ Japan */ |
| 782 | | //128u4 DRIVER( fsa1wxa ) /* 1988 MSX2+ Japan */ |
| 783 | | //128u4 DRIVER( fsa1wsx ) /* 1989 MSX2+ Japan */ |
| 784 | | //128u4 DRIVER( hbf1xdj ) /* 1988 MSX2+ Japan */ |
| 785 | | //128u4 DRIVER( hbf1xv ) /* 1989 MSX2+ Japan */ |
| 786 | | //128u4 DRIVER( phc70fd ) /* 1988 MSX2+ Japan */ |
| 787 | | //128u4 DRIVER( phc70fd2 ) /* 1988 MSX2+ Japan */ |
| 788 | | //128u4 DRIVER( phc35j ) /* 1989 MSX2+ Japan */ |
| 726 | DRIVER( msx2 ) /* 1985 MSX2 */ |
| 727 | DRIVER( ax350 ) |
| 728 | DRIVER( ax370 ) |
| 729 | DRIVER( hbf9p ) /* 1985 MSX2 */ |
| 730 | DRIVER( hbf9s ) /* 1985 MSX2 */ |
| 731 | DRIVER( hbf500p ) /* 1985 MSX2 */ |
| 732 | DRIVER( hbf700d ) /* 1985 MSX2 Germany */ |
| 733 | DRIVER( hbf700f ) /* 1985 MSX2 */ |
| 734 | DRIVER( hbf700p ) /* 1985 MSX2 */ |
| 735 | DRIVER( hbf700s ) /* 1985 MSX2 Spain */ |
| 736 | DRIVER( hbg900ap ) /* 1986 MSX2 */ |
| 737 | DRIVER( hbg900p ) /* 1986 MSX2 */ |
| 738 | DRIVER( nms8220 ) /* 1986 MSX2 */ |
| 739 | DRIVER( nms8220a ) /* 1986 MSX2 */ |
| 740 | DRIVER( vg8230 ) /* 1986 MSX2 */ |
| 741 | DRIVER( vg8235 ) /* 1986 MSX2 */ |
| 742 | DRIVER( vg8235f) /* 1986 MSX2 */ |
| 743 | DRIVER( vg8240) /* 1986 MSX2 */ |
| 744 | DRIVER( nms8245 ) /* 1986 MSX2 */ |
| 745 | DRIVER( nms8245f) /* 1986 MSX2 */ |
| 746 | DRIVER( nms8250 ) /* 1986 MSX2 */ |
| 747 | DRIVER( nms8255 ) /* 1986 MSX2 */ |
| 748 | DRIVER( nms8280 ) /* 1986 MSX2 */ |
| 749 | DRIVER( nms8280g) /* 1986 MSX2 */ |
| 750 | DRIVER( tpc310) /* 1986 MSX2 */ |
| 751 | DRIVER( hx23) /* 1986 MSX2 */ |
| 752 | DRIVER( hx23f) /* 1986 MSX2 */ |
| 753 | DRIVER( cx7m) /* 1986 MSX2 */ |
| 754 | DRIVER( cx7m128) /* 1986 MSX2 */ |
| 755 | DRIVER( fs5500 ) /* 1985 MSX2 Japan */ |
| 756 | DRIVER( fs4500 ) /* 1986 MSX2 Japan */ |
| 757 | DRIVER( fs4700 ) /* 1986 MSX2 Japan */ |
| 758 | DRIVER( fs5000 ) /* 1986 MSX2 Japan */ |
| 759 | DRIVER( fs4600 ) /* 1986 MSX2 Japan */ |
| 760 | DRIVER( fsa1 ) /* 1986 MSX2 Japan */ |
| 761 | DRIVER( fsa1a ) /* 1986 MSX2 Japan */ |
| 762 | DRIVER( fsa1mk2 ) /* 1987 MSX2 Japan */ |
| 763 | DRIVER( fsa1f ) /* 1987 MSX2 Japan */ |
| 764 | DRIVER( fsa1fm ) /* 1988 MSX2 Japan */ |
| 765 | DRIVER( hbf500 ) /* 1986 MSX2 Japan */ |
| 766 | DRIVER( hbf900 ) /* 1986 MSX2 Japan */ |
| 767 | DRIVER( hbf900a ) /* 1986 MSX2 Japan */ |
| 768 | DRIVER( hbf1 ) /* 1986 MSX2 Japan */ |
| 769 | DRIVER( hbf12 ) /* 1987 MSX2 Japan */ |
| 770 | DRIVER( hbf1xd ) /* 1987 MSX2 Japan */ |
| 771 | DRIVER( hbf1xdm2 ) /* 1988 MSX2 Japan */ |
| 772 | DRIVER( phc23 ) /* 1986 MSX2 Japan */ |
| 773 | DRIVER( cpc300 ) /* 1986 MSX2 Korea */ |
| 774 | DRIVER( cpc300e ) /* 1986 MSX2 Korea */ |
| 775 | DRIVER( cpc400 ) /* 1986 MSX2 Korea */ |
| 776 | DRIVER( cpc400s ) /* 1986 MSX2 Korea */ |
| 777 | DRIVER( expert20 )/* 1986 MSX2 Korea */ |
| 789 | 778 | |
| 779 | DRIVER( msx2p ) /* 1988 MSX2+ Japan */ |
| 780 | DRIVER( fsa1fx ) /* 1988 MSX2+ Japan */ |
| 781 | DRIVER( fsa1wx ) /* 1988 MSX2+ Japan */ |
| 782 | DRIVER( fsa1wxa ) /* 1988 MSX2+ Japan */ |
| 783 | DRIVER( fsa1wsx ) /* 1989 MSX2+ Japan */ |
| 784 | DRIVER( hbf1xdj ) /* 1988 MSX2+ Japan */ |
| 785 | DRIVER( hbf1xv ) /* 1989 MSX2+ Japan */ |
| 786 | DRIVER( phc70fd ) /* 1988 MSX2+ Japan */ |
| 787 | DRIVER( phc70fd2 ) /* 1988 MSX2+ Japan */ |
| 788 | DRIVER( phc35j ) /* 1989 MSX2+ Japan */ |
| 790 | 789 | |
| 790 | |
| 791 | 791 | /* NASCOM MICROCOMPUTERS */ |
| 792 | 792 | //128u4 DRIVER( nascom1 ) /* 1978 Nascom 1 */ |
| 793 | 793 | //128u4 DRIVER( nascom2 ) /* 1979 Nascom 2 */ |
src/mess/machine/msx_slot.c
| r3624 | r3625 | |
| 28 | 28 | |
| 29 | 29 | static void msx_cpu_setbank (running_machine *machine, int page, UINT8 *mem) |
| 30 | 30 | { |
| 31 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 31 | 32 | switch (page) { |
| 32 | 33 | case 1: |
| 33 | 34 | case 2: |
| 34 | 35 | case 3: |
| 35 | | memory_set_bankptr (page, mem); |
| 36 | memory_set_bankptr (machine,page, mem); |
| 36 | 37 | break; |
| 37 | 38 | case 4: |
| 38 | | memory_set_bankptr (4, mem); |
| 39 | | memory_set_bankptr (5, mem + 0x1ff8); |
| 40 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7ff8, 0x7fff, 0, 0, SMH_BANK5); |
| 39 | memory_set_bankptr (machine,4, mem); |
| 40 | memory_set_bankptr (machine,5, mem + 0x1ff8); |
| 41 | memory_install_read8_handler(space, 0x7ff8, 0x7fff, 0, 0, SMH_BANK5); |
| 41 | 42 | break; |
| 42 | 43 | case 5: |
| 43 | | memory_set_bankptr (6, mem); |
| 44 | | memory_set_bankptr (7, mem + 0x1800); |
| 45 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9fff, 0, 0, SMH_BANK7); |
| 44 | memory_set_bankptr (machine,6, mem); |
| 45 | memory_set_bankptr (machine,7, mem + 0x1800); |
| 46 | memory_install_read8_handler(space, 0x9800, 0x9fff, 0, 0, SMH_BANK7); |
| 46 | 47 | break; |
| 47 | 48 | case 6: |
| 48 | | memory_set_bankptr (8, mem); |
| 49 | | memory_set_bankptr (9, mem + 0x1800); |
| 50 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb800, 0xbfff, 0, 0, SMH_BANK9); |
| 49 | memory_set_bankptr (machine,8, mem); |
| 50 | memory_set_bankptr (machine,9, mem + 0x1800); |
| 51 | memory_install_read8_handler(space, 0xb800, 0xbfff, 0, 0, SMH_BANK9); |
| 51 | 52 | break; |
| 52 | 53 | case 7: |
| 53 | | memory_set_bankptr (10, mem); |
| 54 | memory_set_bankptr (machine,10, mem); |
| 54 | 55 | break; |
| 55 | 56 | case 8: |
| 56 | | memory_set_bankptr (11, mem); |
| 57 | memory_set_bankptr (machine,11, mem); |
| 57 | 58 | msx1.top_page = mem; |
| 58 | 59 | break; |
| 59 | 60 | } |
| r3624 | r3625 | |
| 339 | 340 | return 0xff; |
| 340 | 341 | } |
| 341 | 342 | else { |
| 342 | | return k051649_waveform_r (machine, offset & 0x7f); |
| 343 | return k051649_waveform_r (space, offset & 0x7f); |
| 343 | 344 | } |
| 344 | 345 | } |
| 345 | 346 | |
| r3624 | r3625 | |
| 357 | 358 | case 2: |
| 358 | 359 | msx_cpu_setbank (machine, 5, state->mem + state->banks[2] * 0x2000); |
| 359 | 360 | msx_cpu_setbank (machine, 6, state->mem + state->banks[3] * 0x2000); |
| 360 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9fff, 0, 0, |
| 361 | memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9800, 0x9fff, 0, 0, |
| 361 | 362 | state->cart.scc.active ? konami_scc_bank5 : SMH_BANK7); |
| 362 | 363 | break; |
| 363 | 364 | case 3: |
| r3624 | r3625 | |
| 368 | 369 | |
| 369 | 370 | MSX_SLOT_WRITE(konami_scc) |
| 370 | 371 | { |
| 372 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 371 | 373 | if (addr >= 0x5000 && addr < 0x5800) { |
| 372 | 374 | state->banks[0] = val & state->bank_mask; |
| 373 | 375 | slot_konami_scc_map (machine, state, 1); |
| r3624 | r3625 | |
| 394 | 396 | int offset = addr & 0xff; |
| 395 | 397 | |
| 396 | 398 | if (offset < 0x80) { |
| 397 | | k051649_waveform_w (machine, offset, val); |
| 399 | k051649_waveform_w (space, offset, val); |
| 398 | 400 | } |
| 399 | 401 | else if (offset < 0xa0) { |
| 400 | 402 | offset &= 0xf; |
| 401 | 403 | if (offset < 0xa) { |
| 402 | | k051649_frequency_w (machine, offset, val); |
| 404 | k051649_frequency_w (space, offset, val); |
| 403 | 405 | } |
| 404 | 406 | else if (offset < 0xf) { |
| 405 | | k051649_volume_w (machine, offset - 0xa, val); |
| 407 | k051649_volume_w (space, offset - 0xa, val); |
| 406 | 408 | } |
| 407 | 409 | else { |
| 408 | | k051649_keyonoff_w (machine, 0, val); |
| 410 | k051649_keyonoff_w (space, 0, val); |
| 409 | 411 | } |
| 410 | 412 | } |
| 411 | 413 | #if 0 |
| r3624 | r3625 | |
| 1131 | 1133 | static READ8_HANDLER (msx_diskrom_page1_r) |
| 1132 | 1134 | { |
| 1133 | 1135 | switch (offset) { |
| 1134 | | case 0: return wd17xx_status_r (machine, 0); |
| 1135 | | case 1: return wd17xx_track_r (machine, 0); |
| 1136 | | case 2: return wd17xx_sector_r (machine, 0); |
| 1137 | | case 3: return wd17xx_data_r (machine, 0); |
| 1136 | case 0: return wd17xx_status_r (space, 0); |
| 1137 | case 1: return wd17xx_track_r (space, 0); |
| 1138 | case 2: return wd17xx_sector_r (space, 0); |
| 1139 | case 3: return wd17xx_data_r (space, 0); |
| 1138 | 1140 | case 7: return msx1.dsk_stat; |
| 1139 | 1141 | default: |
| 1140 | 1142 | return msx1.state[1]->mem[offset + 0x3ff8]; |
| r3624 | r3625 | |
| 1146 | 1148 | if (offset >= 0x7f8) { |
| 1147 | 1149 | switch (offset) { |
| 1148 | 1150 | case 0x7f8: |
| 1149 | | return wd17xx_status_r (machine, 0); |
| 1151 | return wd17xx_status_r (space, 0); |
| 1150 | 1152 | case 0x7f9: |
| 1151 | | return wd17xx_track_r (machine, 0); |
| 1153 | return wd17xx_track_r (space, 0); |
| 1152 | 1154 | case 0x7fa: |
| 1153 | | return wd17xx_sector_r (machine, 0); |
| 1155 | return wd17xx_sector_r (space, 0); |
| 1154 | 1156 | case 0x7fb: |
| 1155 | | return wd17xx_data_r (machine, 0); |
| 1157 | return wd17xx_data_r (space, 0); |
| 1156 | 1158 | case 0x7ff: |
| 1157 | 1159 | return msx1.dsk_stat; |
| 1158 | 1160 | default: |
| r3624 | r3625 | |
| 1166 | 1168 | |
| 1167 | 1169 | MSX_SLOT_MAP(diskrom) |
| 1168 | 1170 | { |
| 1171 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1169 | 1172 | switch (page) { |
| 1170 | 1173 | case 0: |
| 1171 | 1174 | msx_cpu_setbank (machine, 1, msx1.empty); |
| r3624 | r3625 | |
| 1174 | 1177 | case 1: |
| 1175 | 1178 | msx_cpu_setbank (machine, 3, state->mem); |
| 1176 | 1179 | msx_cpu_setbank (machine, 4, state->mem + 0x2000); |
| 1177 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7ff8, 0x7fff, 0, 0, msx_diskrom_page1_r); |
| 1180 | memory_install_read8_handler(space, 0x7ff8, 0x7fff, 0, 0, msx_diskrom_page1_r); |
| 1178 | 1181 | break; |
| 1179 | 1182 | case 2: |
| 1180 | 1183 | msx_cpu_setbank (machine, 5, msx1.empty); |
| 1181 | 1184 | msx_cpu_setbank (machine, 6, msx1.empty); |
| 1182 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb800, 0xbfff, 0, 0, msx_diskrom_page2_r); |
| 1185 | memory_install_read8_handler(space, 0xb800, 0xbfff, 0, 0, msx_diskrom_page2_r); |
| 1183 | 1186 | break; |
| 1184 | 1187 | case 3: |
| 1185 | 1188 | msx_cpu_setbank (machine, 7, msx1.empty); |
| r3624 | r3625 | |
| 1190 | 1193 | |
| 1191 | 1194 | MSX_SLOT_WRITE(diskrom) |
| 1192 | 1195 | { |
| 1196 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1193 | 1197 | if (addr >= 0xa000 && addr < 0xc000) { |
| 1194 | 1198 | addr -= 0x4000; |
| 1195 | 1199 | } |
| 1196 | 1200 | switch (addr) { |
| 1197 | 1201 | case 0x7ff8: |
| 1198 | | wd17xx_command_w (machine, 0, val); |
| 1202 | wd17xx_command_w (space, 0, val); |
| 1199 | 1203 | break; |
| 1200 | 1204 | case 0x7ff9: |
| 1201 | | wd17xx_track_w (machine, 0, val); |
| 1205 | wd17xx_track_w (space, 0, val); |
| 1202 | 1206 | break; |
| 1203 | 1207 | case 0x7ffa: |
| 1204 | | wd17xx_sector_w (machine, 0, val); |
| 1208 | wd17xx_sector_w (space, 0, val); |
| 1205 | 1209 | break; |
| 1206 | 1210 | case 0x7ffb: |
| 1207 | | wd17xx_data_w (machine, 0, val); |
| 1211 | wd17xx_data_w (space, 0, val); |
| 1208 | 1212 | break; |
| 1209 | 1213 | case 0x7ffc: |
| 1210 | 1214 | wd17xx_set_side (val & 1); |
| r3624 | r3625 | |
| 1242 | 1246 | static READ8_HANDLER (msx_diskrom2_page1_r) |
| 1243 | 1247 | { |
| 1244 | 1248 | switch (offset) { |
| 1245 | | case 0: return wd17xx_status_r(machine, 0); |
| 1246 | | case 1: return wd17xx_track_r(machine, 0); |
| 1247 | | case 2: return wd17xx_sector_r(machine, 0); |
| 1248 | | case 3: return wd17xx_data_r(machine, 0); |
| 1249 | case 0: return wd17xx_status_r(space, 0); |
| 1250 | case 1: return wd17xx_track_r(space, 0); |
| 1251 | case 2: return wd17xx_sector_r(space, 0); |
| 1252 | case 3: return wd17xx_data_r(space, 0); |
| 1249 | 1253 | case 4: return msx1.dsk_stat; |
| 1250 | 1254 | default: |
| 1251 | 1255 | return msx1.state[1]->mem[offset + 0x3ff8]; |
| r3624 | r3625 | |
| 1257 | 1261 | if (offset >= 0x7b8) { |
| 1258 | 1262 | switch (offset) { |
| 1259 | 1263 | case 0x7b8: |
| 1260 | | return wd17xx_status_r (machine, 0); |
| 1264 | return wd17xx_status_r (space, 0); |
| 1261 | 1265 | case 0x7b9: |
| 1262 | | return wd17xx_track_r (machine, 0); |
| 1266 | return wd17xx_track_r (space, 0); |
| 1263 | 1267 | case 0x7ba: |
| 1264 | | return wd17xx_sector_r (machine, 0); |
| 1268 | return wd17xx_sector_r (space, 0); |
| 1265 | 1269 | case 0x7bb: |
| 1266 | | return wd17xx_data_r (machine, 0); |
| 1270 | return wd17xx_data_r (space, 0); |
| 1267 | 1271 | case 0x7bc: |
| 1268 | 1272 | return msx1.dsk_stat; |
| 1269 | 1273 | default: |
| r3624 | r3625 | |
| 1277 | 1281 | |
| 1278 | 1282 | MSX_SLOT_MAP(diskrom2) |
| 1279 | 1283 | { |
| 1284 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1280 | 1285 | switch (page) { |
| 1281 | 1286 | case 0: |
| 1282 | 1287 | msx_cpu_setbank (machine, 1, msx1.empty); |
| r3624 | r3625 | |
| 1285 | 1290 | case 1: |
| 1286 | 1291 | msx_cpu_setbank (machine, 3, state->mem); |
| 1287 | 1292 | msx_cpu_setbank (machine, 4, state->mem + 0x2000); |
| 1288 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7fb8, 0x7fbc, 0, 0, msx_diskrom2_page1_r); |
| 1293 | memory_install_read8_handler(space, 0x7fb8, 0x7fbc, 0, 0, msx_diskrom2_page1_r); |
| 1289 | 1294 | break; |
| 1290 | 1295 | case 2: |
| 1291 | 1296 | msx_cpu_setbank (machine, 5, msx1.empty); |
| 1292 | 1297 | msx_cpu_setbank (machine, 6, msx1.empty); |
| 1293 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb800, 0xbfbc, 0, 0, msx_diskrom2_page2_r); |
| 1298 | memory_install_read8_handler(space, 0xb800, 0xbfbc, 0, 0, msx_diskrom2_page2_r); |
| 1294 | 1299 | break; |
| 1295 | 1300 | case 3: |
| 1296 | 1301 | msx_cpu_setbank (machine, 7, msx1.empty); |
| r3624 | r3625 | |
| 1300 | 1305 | |
| 1301 | 1306 | MSX_SLOT_WRITE(diskrom2) |
| 1302 | 1307 | { |
| 1308 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1303 | 1309 | if (addr >= 0xa000 && addr < 0xc000) { |
| 1304 | 1310 | addr -= 0x4000; |
| 1305 | 1311 | } |
| 1306 | 1312 | switch (addr) { |
| 1307 | 1313 | case 0x7fb8: |
| 1308 | | wd17xx_command_w (machine, 0, val); |
| 1314 | wd17xx_command_w (space, 0, val); |
| 1309 | 1315 | break; |
| 1310 | 1316 | case 0x7fb9: |
| 1311 | | wd17xx_track_w (machine, 0, val); |
| 1317 | wd17xx_track_w (space, 0, val); |
| 1312 | 1318 | break; |
| 1313 | 1319 | case 0x7fba: |
| 1314 | | wd17xx_sector_w (machine, 0, val); |
| 1320 | wd17xx_sector_w (space, 0, val); |
| 1315 | 1321 | break; |
| 1316 | 1322 | case 0x7fbb: |
| 1317 | | wd17xx_data_w (machine, 0, val); |
| 1323 | wd17xx_data_w (space, 0, val); |
| 1318 | 1324 | break; |
| 1319 | 1325 | case 0x7fbc: |
| 1320 | 1326 | wd17xx_set_side (val & 1); |
| r3624 | r3625 | |
| 1521 | 1527 | |
| 1522 | 1528 | MSX_SLOT_WRITE(fmpac) |
| 1523 | 1529 | { |
| 1530 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1524 | 1531 | int i, data; |
| 1525 | 1532 | |
| 1526 | 1533 | if (addr >= 0x4000 && addr < 0x6000 && state->cart.fmpac.sram_support) { |
| r3624 | r3625 | |
| 1536 | 1543 | switch (addr) { |
| 1537 | 1544 | case 0x7ff4: |
| 1538 | 1545 | if (state->cart.fmpac.opll_active) { |
| 1539 | | ym2413_register_port_0_w (machine, 0, val); |
| 1546 | ym2413_register_port_0_w (space, 0, val); |
| 1540 | 1547 | } |
| 1541 | 1548 | break; |
| 1542 | 1549 | case 0x7ff5: |
| 1543 | 1550 | if (state->cart.fmpac.opll_active) { |
| 1544 | | ym2413_data_port_0_w (machine, 0, val); |
| 1551 | ym2413_data_port_0_w (space, 0, val); |
| 1545 | 1552 | } |
| 1546 | 1553 | break; |
| 1547 | 1554 | case 0x7ff6: |
| r3624 | r3625 | |
| 1984 | 1991 | reg = offset & 0xff; |
| 1985 | 1992 | |
| 1986 | 1993 | if (reg < 0x80) { |
| 1987 | | return k051649_waveform_r (machine, reg); |
| 1994 | return k051649_waveform_r (space, reg); |
| 1988 | 1995 | } |
| 1989 | 1996 | else if (reg < 0xa0) { |
| 1990 | 1997 | /* nothing */ |
| 1991 | 1998 | } |
| 1992 | 1999 | else if (reg < 0xc0) { |
| 1993 | 2000 | /* read wave 5 */ |
| 1994 | | return k051649_waveform_r (machine, 0x80 + (reg & 0x1f)); |
| 2001 | return k051649_waveform_r (space, 0x80 + (reg & 0x1f)); |
| 1995 | 2002 | } |
| 1996 | 2003 | #if 0 |
| 1997 | 2004 | else if (reg < 0xe0) { |
| r3624 | r3625 | |
| 2014 | 2021 | reg = offset & 0xff; |
| 2015 | 2022 | |
| 2016 | 2023 | if (reg < 0xa0) { |
| 2017 | | return k051649_waveform_r (machine, reg); |
| 2024 | return k051649_waveform_r (space, reg); |
| 2018 | 2025 | } |
| 2019 | 2026 | #if 0 |
| 2020 | 2027 | else if (reg >= 0xc0 && reg < 0xe0) { |
| r3624 | r3625 | |
| 2027 | 2034 | |
| 2028 | 2035 | MSX_SLOT_MAP(soundcartridge) |
| 2029 | 2036 | { |
| 2037 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 2030 | 2038 | switch (page) { |
| 2031 | 2039 | case 0: |
| 2032 | 2040 | msx_cpu_setbank (machine, 1, state->mem + state->banks[2] * 0x2000); |
| r3624 | r3625 | |
| 2039 | 2047 | case 2: |
| 2040 | 2048 | msx_cpu_setbank (machine, 5, state->mem + state->banks[2] * 0x2000); |
| 2041 | 2049 | msx_cpu_setbank (machine, 6, state->mem + state->banks[3] * 0x2000); |
| 2042 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9800, 0x9fff, 0, 0, |
| 2050 | memory_install_read8_handler(space, 0x9800, 0x9fff, 0, 0, |
| 2043 | 2051 | state->cart.sccp.scc_active ? soundcartridge_scc : SMH_BANK7); |
| 2044 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb800, 0xbfff, 0, 0, |
| 2052 | memory_install_read8_handler(space, 0xb800, 0xbfff, 0, 0, |
| 2045 | 2053 | state->cart.sccp.sccp_active ? soundcartridge_sccp : SMH_BANK9); |
| 2046 | 2054 | break; |
| 2047 | 2055 | case 3: |
| r3624 | r3625 | |
| 2053 | 2061 | |
| 2054 | 2062 | MSX_SLOT_WRITE(soundcartridge) |
| 2055 | 2063 | { |
| 2064 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 2056 | 2065 | int i; |
| 2057 | 2066 | |
| 2058 | 2067 | if (addr < 0x4000) { |
| r3624 | r3625 | |
| 2103 | 2112 | int offset = addr & 0xff; |
| 2104 | 2113 | |
| 2105 | 2114 | if (offset < 0x80) { |
| 2106 | | k051649_waveform_w (machine, offset, val); |
| 2115 | k051649_waveform_w (space, offset, val); |
| 2107 | 2116 | } |
| 2108 | 2117 | else if (offset < 0xa0) { |
| 2109 | 2118 | offset &= 0xf; |
| 2110 | 2119 | |
| 2111 | 2120 | if (offset < 0xa) { |
| 2112 | | k051649_frequency_w (machine, offset, val); |
| 2121 | k051649_frequency_w (space, offset, val); |
| 2113 | 2122 | } |
| 2114 | 2123 | else if (offset < 0x0f) { |
| 2115 | | k051649_volume_w (machine, offset - 0xa, val); |
| 2124 | k051649_volume_w (space, offset - 0xa, val); |
| 2116 | 2125 | } |
| 2117 | 2126 | else if (offset == 0x0f) { |
| 2118 | | k051649_keyonoff_w (machine, 0, val); |
| 2127 | k051649_keyonoff_w (space, 0, val); |
| 2119 | 2128 | } |
| 2120 | 2129 | } |
| 2121 | 2130 | #if 0 |
| r3624 | r3625 | |
| 2143 | 2152 | int offset = addr & 0xff; |
| 2144 | 2153 | |
| 2145 | 2154 | if (offset < 0xa0) { |
| 2146 | | k052539_waveform_w (machine, offset, val); |
| 2155 | k052539_waveform_w (space, offset, val); |
| 2147 | 2156 | } |
| 2148 | 2157 | else if (offset < 0xc0) { |
| 2149 | 2158 | offset &= 0x0f; |
| 2150 | 2159 | |
| 2151 | 2160 | if (offset < 0x0a) { |
| 2152 | | k051649_frequency_w (machine, offset, val); |
| 2161 | k051649_frequency_w (space, offset, val); |
| 2153 | 2162 | } |
| 2154 | 2163 | else if (offset < 0x0f) { |
| 2155 | | k051649_volume_w (machine, offset - 0x0a, val); |
| 2164 | k051649_volume_w (space, offset - 0x0a, val); |
| 2156 | 2165 | } |
| 2157 | 2166 | else if (offset == 0x0f) { |
| 2158 | | k051649_keyonoff_w (machine, 0, val); |
| 2167 | k051649_keyonoff_w (space, 0, val); |
| 2159 | 2168 | } |
| 2160 | 2169 | } |
| 2161 | 2170 | #if 0 |
src/mess/machine/msx.c
| r3624 | r3625 | |
| 278 | 278 | |
| 279 | 279 | void msx_vdp_interrupt(running_machine *machine, int i) |
| 280 | 280 | { |
| 281 | | cpunum_set_input_line (machine, 0, 0, (i ? HOLD_LINE : CLEAR_LINE)); |
| 281 | cpu_set_input_line (machine->cpu[0], 0, (i ? HOLD_LINE : CLEAR_LINE)); |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | static void msx_ch_reset_core (running_machine *machine) |
| r3624 | r3625 | |
| 355 | 355 | msx1.cart_state[i] = cart_state[i]; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | | cpunum_set_input_line_vector (0, 0, 0xff); |
| 358 | cpu_set_input_line_vector (machine->cpu[0], 0, 0xff); |
| 359 | 359 | |
| 360 | 360 | msx_memory_init (machine); |
| 361 | 361 | |
| r3624 | r3625 | |
| 365 | 365 | UINT8 *table = auto_malloc (0x100); |
| 366 | 366 | const UINT8 *old_table; |
| 367 | 367 | |
| 368 | | old_table = cpunum_get_info_ptr (0, |
| 368 | old_table = cpu_get_info_ptr (machine->cpu[0], |
| 369 | 369 | CPUINFO_PTR_Z80_CYCLE_TABLE + z80_cycle_table[i]); |
| 370 | 370 | memcpy (table, old_table, 0x100); |
| 371 | 371 | |
| r3624 | r3625 | |
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | | cpunum_set_info_ptr (0, |
| 386 | cpu_set_info_ptr (machine->cpu[0], |
| 387 | 387 | CPUINFO_PTR_Z80_CYCLE_TABLE + z80_cycle_table[i], |
| 388 | 388 | (void*)table); |
| 389 | 389 | } |
| r3624 | r3625 | |
| 402 | 402 | |
| 403 | 403 | INTERRUPT_GEN( msx2_interrupt ) |
| 404 | 404 | { |
| 405 | | v9938_set_sprite_limit(0, input_port_read(machine, "DSW") & 0x20); |
| 406 | | v9938_set_resolution(0, input_port_read(machine, "DSW") & 0x03); |
| 405 | v9938_set_sprite_limit(0, input_port_read(device->machine, "DSW") & 0x20); |
| 406 | v9938_set_resolution(0, input_port_read(device->machine, "DSW") & 0x03); |
| 407 | 407 | v9938_interrupt(0); |
| 408 | 408 | } |
| 409 | 409 | |
| r3624 | r3625 | |
| 413 | 413 | |
| 414 | 414 | for (i=0; i<2; i++) |
| 415 | 415 | { |
| 416 | | msx1.mouse[i] = input_port_read(machine, i ? "MOUSE1" : "MOUSE0"); |
| 416 | msx1.mouse[i] = input_port_read(device->machine, i ? "MOUSE1" : "MOUSE0"); |
| 417 | 417 | msx1.mouse_stat[i] = -1; |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | | TMS9928A_set_spriteslimit (input_port_read(machine, "DSW") & 0x20); |
| 421 | | TMS9928A_interrupt(machine); |
| 420 | TMS9928A_set_spriteslimit (input_port_read(device->machine, "DSW") & 0x20); |
| 421 | TMS9928A_interrupt(device->machine); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | /* |
| r3624 | r3625 | |
| 427 | 427 | |
| 428 | 428 | READ8_HANDLER ( msx_psg_r ) |
| 429 | 429 | { |
| 430 | | return ay8910_read_port_0_r (machine, offset); |
| 430 | return ay8910_read_port_0_r (space, offset); |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | WRITE8_HANDLER ( msx_psg_w ) |
| 434 | 434 | { |
| 435 | 435 | if (offset & 0x01) |
| 436 | | ay8910_write_port_0_w (machine, offset, data); |
| 436 | ay8910_write_port_0_w (space, offset, data); |
| 437 | 437 | else |
| 438 | | ay8910_control_port_0_w (machine, offset, data); |
| 438 | ay8910_control_port_0_w (space, offset, data); |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | static const device_config *cassette_device_image(running_machine *machine) |
| r3624 | r3625 | |
| 452 | 452 | { |
| 453 | 453 | int data, inp; |
| 454 | 454 | |
| 455 | | data = (cassette_input(cassette_device_image(machine)) > 0.0038 ? 0x80 : 0); |
| 455 | data = (cassette_input(cassette_device_image(space->machine)) > 0.0038 ? 0x80 : 0); |
| 456 | 456 | |
| 457 | | if ( (msx1.psg_b ^ input_port_read(machine, "DSW") ) & 0x40) |
| 457 | if ( (msx1.psg_b ^ input_port_read(space->machine, "DSW") ) & 0x40) |
| 458 | 458 | { |
| 459 | 459 | /* game port 2 */ |
| 460 | | inp = input_port_read(machine, "JOY1") & 0x7f; |
| 460 | inp = input_port_read(space->machine, "JOY1") & 0x7f; |
| 461 | 461 | #if 0 |
| 462 | 462 | if ( !(inp & 0x80) ) |
| 463 | 463 | { |
| r3624 | r3625 | |
| 482 | 482 | else |
| 483 | 483 | { |
| 484 | 484 | /* game port 1 */ |
| 485 | | inp = input_port_read(machine, "JOY0") & 0x7f; |
| 485 | inp = input_port_read(space->machine, "JOY0") & 0x7f; |
| 486 | 486 | #if 0 |
| 487 | 487 | if ( !(inp & 0x80) ) |
| 488 | 488 | { |
| r3624 | r3625 | |
| 537 | 537 | |
| 538 | 538 | WRITE8_HANDLER ( msx_printer_w ) |
| 539 | 539 | { |
| 540 | | if (input_port_read(machine, "DSW") & 0x80) |
| 540 | if (input_port_read(space->machine, "DSW") & 0x80) |
| 541 | 541 | { |
| 542 | 542 | /* SIMPL emulation */ |
| 543 | 543 | if (offset == 1) |
| r3624 | r3625 | |
| 553 | 553 | { |
| 554 | 554 | if ((msx1.prn_strobe & 2) && !(data & 2)) |
| 555 | 555 | { |
| 556 | | printer_output(printer_image(machine), msx1.prn_data); |
| 556 | printer_output(printer_image(space->machine), msx1.prn_data); |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | msx1.prn_strobe = data; |
| r3624 | r3625 | |
| 563 | 563 | |
| 564 | 564 | READ8_HANDLER ( msx_printer_r ) |
| 565 | 565 | { |
| 566 | | if (offset == 0 && ! (input_port_read(machine, "DSW") & 0x80) && |
| 567 | | printer_is_ready(printer_image(machine)) ) |
| 566 | if (offset == 0 && ! (input_port_read(space->machine, "DSW") & 0x80) && |
| 567 | printer_is_ready(printer_image(space->machine)) ) |
| 568 | 568 | return 253; |
| 569 | 569 | |
| 570 | 570 | return 0xff; |
| r3624 | r3625 | |
| 575 | 575 | if (msx1.opll_active) { |
| 576 | 576 | |
| 577 | 577 | if (offset == 1) { |
| 578 | | ym2413_data_port_0_w (machine, 0, data); |
| 578 | ym2413_data_port_0_w (space, 0, data); |
| 579 | 579 | } |
| 580 | 580 | else { |
| 581 | | ym2413_register_port_0_w (machine, 0, data); |
| 581 | ym2413_register_port_0_w (space, 0, data); |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | } |
| r3624 | r3625 | |
| 594 | 594 | |
| 595 | 595 | WRITE8_HANDLER (msx_rtc_reg_w) |
| 596 | 596 | { |
| 597 | | tc8521_w(machine, msx1.rtc_latch, data); |
| 597 | tc8521_w(space, msx1.rtc_latch, data); |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | READ8_HANDLER (msx_rtc_reg_r) |
| 601 | 601 | { |
| 602 | | return tc8521_r(machine, msx1.rtc_latch); |
| 602 | return tc8521_r(space, msx1.rtc_latch); |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | NVRAM_HANDLER( msx2 ) |
| r3624 | r3625 | |
| 967 | 967 | { |
| 968 | 968 | msx1.superloadrunner_bank = data; |
| 969 | 969 | if (msx1.slot[2]->slot_type == SLOT_SUPERLOADRUNNER) { |
| 970 | | msx1.slot[2]->map (machine, msx1.state[2], 2); |
| 970 | msx1.slot[2]->map (space->machine, msx1.state[2], 2); |
| 971 | 971 | } |
| 972 | | msx_page0_w(machine, -1, data); |
| 972 | msx_page0_w(space, -1, data); |
| 973 | 973 | } |
| 974 | 974 | |
| 975 | 975 | WRITE8_HANDLER (msx_page0_w) |
| r3624 | r3625 | |
| 981 | 981 | msx1.ram_pages[0][offset] = data; |
| 982 | 982 | break; |
| 983 | 983 | case MSX_MEM_HANDLER: |
| 984 | | msx1.slot[0]->write (machine, msx1.state[0], offset, data); |
| 984 | msx1.slot[0]->write (space->machine, msx1.state[0], offset, data); |
| 985 | 985 | } |
| 986 | 986 | } |
| 987 | 987 | |
| r3624 | r3625 | |
| 992 | 992 | msx1.ram_pages[1][offset] = data; |
| 993 | 993 | break; |
| 994 | 994 | case MSX_MEM_HANDLER: |
| 995 | | msx1.slot[1]->write (machine, msx1.state[1], 0x4000 + offset, data); |
| 995 | msx1.slot[1]->write (space->machine, msx1.state[1], 0x4000 + offset, data); |
| 996 | 996 | } |
| 997 | 997 | } |
| 998 | 998 | |
| r3624 | r3625 | |
| 1003 | 1003 | msx1.ram_pages[2][offset] = data; |
| 1004 | 1004 | break; |
| 1005 | 1005 | case MSX_MEM_HANDLER: |
| 1006 | | msx1.slot[2]->write (machine, msx1.state[2], 0x8000 + offset, data); |
| 1006 | msx1.slot[2]->write (space->machine, msx1.state[2], 0x8000 + offset, data); |
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| r3624 | r3625 | |
| 1014 | 1014 | msx1.ram_pages[3][offset] = data; |
| 1015 | 1015 | break; |
| 1016 | 1016 | case MSX_MEM_HANDLER: |
| 1017 | | msx1.slot[3]->write (machine, msx1.state[3], 0xc000 + offset, data); |
| 1017 | msx1.slot[3]->write (space->machine, msx1.state[3], 0xc000 + offset, data); |
| 1018 | 1018 | } |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| r3624 | r3625 | |
| 1027 | 1027 | logerror ("write to secondary slot %d select: %02x\n", slot, data); |
| 1028 | 1028 | |
| 1029 | 1029 | msx1.secondary_slot[slot] = data; |
| 1030 | | msx_memory_map_all (machine); |
| 1030 | msx_memory_map_all (space->machine); |
| 1031 | 1031 | } |
| 1032 | 1032 | else { |
| 1033 | | msx_page3_w(machine, 0x3fff, data); |
| 1033 | msx_page3_w(space, 0x3fff, data); |
| 1034 | 1034 | } |
| 1035 | 1035 | } |
| 1036 | 1036 | |
| r3624 | r3625 | |
| 1051 | 1051 | { |
| 1052 | 1052 | msx1.ram_mapper[offset] = data; |
| 1053 | 1053 | if (msx1.slot[offset]->slot_type == SLOT_RAM_MM) { |
| 1054 | | msx1.slot[offset]->map (machine, msx1.state[offset], offset); |
| 1054 | msx1.slot[offset]->map (space->machine, msx1.state[offset], offset); |
| 1055 | 1055 | } |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| r3624 | r3625 | |
| 1065 | 1065 | msx1.korean90in1_bank = data; |
| 1066 | 1066 | if (msx1.slot[1]->slot_type == SLOT_KOREAN_90IN1) |
| 1067 | 1067 | { |
| 1068 | | msx1.slot[1]->map (machine, msx1.state[1], 1); |
| 1068 | msx1.slot[1]->map (space->machine, msx1.state[1], 1); |
| 1069 | 1069 | } |
| 1070 | 1070 | if (msx1.slot[2]->slot_type == SLOT_KOREAN_90IN1) |
| 1071 | 1071 | { |
| 1072 | | msx1.slot[2]->map (machine, msx1.state[2], 2); |
| 1072 | msx1.slot[2]->map (space->machine, msx1.state[2], 2); |
| 1073 | 1073 | } |
| 1074 | 1074 | } |
| 1075 | 1075 | |
src/mess/drivers/amstrad.c
| r3624 | r3625 | |
| 242 | 242 | |
| 243 | 243 | static void update_psg(running_machine *machine) |
| 244 | 244 | { |
| 245 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 246 | |
| 245 | 247 | if(aleste_mode & 0x20) // RTC selected |
| 246 | 248 | { |
| 247 | 249 | switch(aleste_rtc_function) |
| 248 | 250 | { |
| 249 | 251 | case 0x02: // AS |
| 250 | | mc146818_port_w(machine, 0,ppi_port_outputs[amstrad_ppi_PortA]); |
| 252 | mc146818_port_w(space, 0,ppi_port_outputs[amstrad_ppi_PortA]); |
| 251 | 253 | break; |
| 252 | 254 | case 0x04: // DS write |
| 253 | | mc146818_port_w(machine, 1,ppi_port_outputs[amstrad_ppi_PortA]); |
| 255 | mc146818_port_w(space, 1,ppi_port_outputs[amstrad_ppi_PortA]); |
| 254 | 256 | break; |
| 255 | 257 | case 0x05: // DS read |
| 256 | | ppi_port_inputs[amstrad_ppi_PortA] = mc146818_port_r(machine, 1); |
| 258 | ppi_port_inputs[amstrad_ppi_PortA] = mc146818_port_r(space, 1); |
| 257 | 259 | break; |
| 258 | 260 | } |
| 259 | 261 | return; |
| r3624 | r3625 | |
| 265 | 267 | } break; |
| 266 | 268 | case 1: |
| 267 | 269 | {/* b6 = 1 ? : Read from selected PSG register and make the register data available to PPI Port A */ |
| 268 | | ppi_port_inputs[amstrad_ppi_PortA] = ay8910_read_port_0_r(machine, 0); |
| 270 | ppi_port_inputs[amstrad_ppi_PortA] = ay8910_read_port_0_r(space, 0); |
| 269 | 271 | } |
| 270 | 272 | break; |
| 271 | 273 | case 2: |
| 272 | 274 | {/* b7 = 1 ? : Write to selected PSG register and write data to PPI Port A */ |
| 273 | | ay8910_write_port_0_w(machine, 0, ppi_port_outputs[amstrad_ppi_PortA]); |
| 275 | ay8910_write_port_0_w(space, 0, ppi_port_outputs[amstrad_ppi_PortA]); |
| 274 | 276 | } |
| 275 | 277 | break; |
| 276 | 278 | case 3: |
| 277 | 279 | {/* b6 and b7 = 1 ? : The register will now be selected and the user can read from or write to it. The register will remain selected until another is chosen.*/ |
| 278 | | ay8910_control_port_0_w(machine, 0, ppi_port_outputs[amstrad_ppi_PortA]); |
| 280 | ay8910_control_port_0_w(space, 0, ppi_port_outputs[amstrad_ppi_PortA]); |
| 279 | 281 | prev_reg = ppi_port_outputs[amstrad_ppi_PortA]; |
| 280 | 282 | } |
| 281 | 283 | break; |
| r3624 | r3625 | |
| 478 | 480 | else |
| 479 | 481 | BankBase = AmstradCPC_RamBanks[0]; |
| 480 | 482 | } |
| 481 | | memory_set_bankptr(1, BankBase); |
| 482 | | memory_set_bankptr(2, BankBase+0x02000); |
| 483 | memory_set_bankptr(machine,1, BankBase); |
| 484 | memory_set_bankptr(machine,2, BankBase+0x02000); |
| 483 | 485 | } |
| 484 | 486 | else // CPC+/GX4000 |
| 485 | 487 | { |
| r3624 | r3625 | |
| 490 | 492 | |
| 491 | 493 | if(AmstradCPC_RamBanks[0] != NULL) |
| 492 | 494 | { |
| 493 | | memory_set_bankptr(1, AmstradCPC_RamBanks[0]); |
| 494 | | memory_set_bankptr(2, AmstradCPC_RamBanks[0]+0x2000); |
| 495 | | memory_set_bankptr(3, AmstradCPC_RamBanks[1]); |
| 496 | | memory_set_bankptr(4, AmstradCPC_RamBanks[1]+0x2000); |
| 497 | | memory_set_bankptr(5, AmstradCPC_RamBanks[2]); |
| 498 | | memory_set_bankptr(6, AmstradCPC_RamBanks[2]+0x2000); |
| 495 | memory_set_bankptr(machine,1, AmstradCPC_RamBanks[0]); |
| 496 | memory_set_bankptr(machine,2, AmstradCPC_RamBanks[0]+0x2000); |
| 497 | memory_set_bankptr(machine,3, AmstradCPC_RamBanks[1]); |
| 498 | memory_set_bankptr(machine,4, AmstradCPC_RamBanks[1]+0x2000); |
| 499 | memory_set_bankptr(machine,5, AmstradCPC_RamBanks[2]); |
| 500 | memory_set_bankptr(machine,6, AmstradCPC_RamBanks[2]+0x2000); |
| 499 | 501 | } |
| 500 | 502 | |
| 501 | 503 | if ((amstrad_GateArray_ModeAndRomConfiguration & (1<<2)) == 0) |
| r3624 | r3625 | |
| 513 | 515 | { |
| 514 | 516 | case 0: |
| 515 | 517 | // logerror("L-ROM: located at &0000\n"); |
| 516 | | memory_set_bankptr(1, BankBase); |
| 517 | | memory_set_bankptr(2, BankBase+0x02000); |
| 518 | memory_set_bankptr(machine,1, BankBase); |
| 519 | memory_set_bankptr(machine,2, BankBase+0x02000); |
| 518 | 520 | break; |
| 519 | 521 | case 1: |
| 520 | 522 | // logerror("L-ROM: located at &4000\n"); |
| 521 | | memory_set_bankptr(3, BankBase); |
| 522 | | memory_set_bankptr(4, BankBase+0x02000); |
| 523 | memory_set_bankptr(machine,3, BankBase); |
| 524 | memory_set_bankptr(machine,4, BankBase+0x02000); |
| 523 | 525 | break; |
| 524 | 526 | case 2: |
| 525 | 527 | // logerror("L-ROM: located at &8000\n"); |
| 526 | | memory_set_bankptr(5, BankBase); |
| 527 | | memory_set_bankptr(6, BankBase+0x02000); |
| 528 | memory_set_bankptr(machine,5, BankBase); |
| 529 | memory_set_bankptr(machine,6, BankBase+0x02000); |
| 528 | 530 | break; |
| 529 | 531 | case 3: |
| 530 | 532 | // logerror("L-ROM: located at &0000, ASIC registers enabled\n"); |
| 531 | | memory_set_bankptr(1, BankBase); |
| 532 | | memory_set_bankptr(2, BankBase+0x02000); |
| 533 | memory_set_bankptr(machine,1, BankBase); |
| 534 | memory_set_bankptr(machine,2, BankBase+0x02000); |
| 533 | 535 | break; |
| 534 | 536 | } |
| 535 | 537 | } |
| r3624 | r3625 | |
| 557 | 559 | |
| 558 | 560 | if (BankBase) |
| 559 | 561 | { |
| 560 | | memory_set_bankptr(7, BankBase); |
| 561 | | memory_set_bankptr(8, BankBase+0x2000); |
| 562 | memory_set_bankptr(machine,7, BankBase); |
| 563 | memory_set_bankptr(machine,8, BankBase+0x2000); |
| 562 | 564 | } |
| 563 | 565 | } |
| 564 | 566 | |
| 565 | 567 | static void AmstradCPC_SetLowerRom(running_machine *machine, int Data) |
| 566 | 568 | { |
| 569 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 567 | 570 | if(amstrad_plus_asic_enabled != 0) |
| 568 | 571 | { |
| 569 | 572 | amstrad_plus_lower = Data & 0x07; // only lower 8 cart banks available for lower ROM |
| 570 | 573 | amstrad_plus_lower_addr = (Data & 0x18) >> 3; // address of lower ROM area |
| 571 | 574 | if(amstrad_plus_lower_addr == 3) |
| 572 | 575 | { |
| 573 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_r); |
| 574 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_r); |
| 575 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_w); |
| 576 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_w); |
| 576 | memory_install_read8_handler(space, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_r); |
| 577 | memory_install_read8_handler(space, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_r); |
| 578 | memory_install_write8_handler(space, 0x4000, 0x5fff, 0, 0, amstrad_plus_asic_4000_w); |
| 579 | memory_install_write8_handler(space, 0x6000, 0x7fff, 0, 0, amstrad_plus_asic_6000_w); |
| 577 | 580 | amstrad_plus_asic_regpage = 1; // enable ASIC registers |
| 578 | 581 | } |
| 579 | 582 | else |
| 580 | 583 | { |
| 581 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK3); |
| 582 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK4); |
| 583 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK11); |
| 584 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK12); |
| 584 | memory_install_read8_handler(space, 0x4000, 0x5fff, 0, 0, SMH_BANK3); |
| 585 | memory_install_read8_handler(space, 0x6000, 0x7fff, 0, 0, SMH_BANK4); |
| 586 | memory_install_write8_handler(space, 0x4000, 0x5fff, 0, 0, SMH_BANK11); |
| 587 | memory_install_write8_handler(space, 0x6000, 0x7fff, 0, 0, SMH_BANK12); |
| 585 | 588 | amstrad_plus_asic_regpage = 0; // disable ASIC registers |
| 586 | 589 | } |
| 587 | 590 | // logerror("SYS: Secondary ROM select (lower ROM) - data = %02x - cart bank %i, addr %i\n",Data,amstrad_plus_lower,amstrad_plus_lower_addr); |
| r3624 | r3625 | |
| 702 | 705 | b = (amstrad_plus_asic_ram[offset+0x1fff] & 0x0f) << 4; |
| 703 | 706 | offset--; |
| 704 | 707 | } |
| 705 | | amstrad_plus_setspritecolour(machine, (offset - 0x422), r, g, b); |
| 708 | amstrad_plus_setspritecolour(space->machine, (offset - 0x422), r, g, b); |
| 706 | 709 | } |
| 707 | 710 | if(offset == 0x0800) // Programmable raster interrupt |
| 708 | 711 | { |
| r3624 | r3625 | |
| 730 | 733 | if(amstrad_plus_asic_enabled != 0) |
| 731 | 734 | { |
| 732 | 735 | vector = (data & 0xf8) + (amstrad_plus_irq_cause); |
| 733 | | cpunum_set_input_line_vector(0, 0, vector); |
| 736 | cpu_set_input_line_vector(space->machine->cpu[0], 0, vector); |
| 734 | 737 | logerror("ASIC: IM 2 vector write %02x, data = &%02x\n",vector,data); |
| 735 | 738 | } |
| 736 | 739 | amstrad_plus_dma_clear = data & 0x01; |
| r3624 | r3625 | |
| 774 | 777 | if(data & 0x40) |
| 775 | 778 | { |
| 776 | 779 | logerror("ASIC: DMA 0 IRQ acknowledge\n"); |
| 777 | | cpunum_set_input_line(machine, 0,0,CLEAR_LINE); |
| 780 | cpu_set_input_line(space->machine->cpu[0],0,CLEAR_LINE); |
| 778 | 781 | amstrad_plus_irq_cause = 0x06; |
| 779 | 782 | amstrad_plus_asic_ram[0x2c0f] &= ~0x40; |
| 780 | 783 | } |
| 781 | 784 | if(data & 0x20) |
| 782 | 785 | { |
| 783 | 786 | logerror("ASIC: DMA 1 IRQ acknowledge\n"); |
| 784 | | cpunum_set_input_line(machine, 0,0,CLEAR_LINE); |
| 787 | cpu_set_input_line(space->machine->cpu[0],0,CLEAR_LINE); |
| 785 | 788 | amstrad_plus_irq_cause = 0x06; |
| 786 | 789 | amstrad_plus_asic_ram[0x2c0f] &= ~0x20; |
| 787 | 790 | } |
| 788 | 791 | if(data & 0x10) |
| 789 | 792 | { |
| 790 | 793 | logerror("ASIC: DMA 2 IRQ acknowledge\n"); |
| 791 | | cpunum_set_input_line(machine, 0,0,CLEAR_LINE); |
| 794 | cpu_set_input_line(space->machine->cpu[0],0,CLEAR_LINE); |
| 792 | 795 | amstrad_plus_irq_cause = 0x06; |
| 793 | 796 | amstrad_plus_asic_ram[0x2c0f] &= ~0x10; |
| 794 | 797 | } |
| r3624 | r3625 | |
| 819 | 822 | // Analogue ports |
| 820 | 823 | if(offset == 0x0808) |
| 821 | 824 | { |
| 822 | | return (input_port_read(machine, "analog1") & 0x3f); |
| 825 | return (input_port_read(space->machine, "analog1") & 0x3f); |
| 823 | 826 | } |
| 824 | 827 | if(offset == 0x0809) |
| 825 | 828 | { |
| 826 | | return (input_port_read(machine, "analog2") & 0x3f); |
| 829 | return (input_port_read(space->machine, "analog2") & 0x3f); |
| 827 | 830 | } |
| 828 | 831 | if(offset == 0x080a) |
| 829 | 832 | { |
| 830 | | return (input_port_read(machine, "analog3") & 0x3f); |
| 833 | return (input_port_read(space->machine, "analog3") & 0x3f); |
| 831 | 834 | } |
| 832 | 835 | if(offset == 0x080b) |
| 833 | 836 | { |
| 834 | | return (input_port_read(machine, "analog4") & 0x3f); |
| 837 | return (input_port_read(space->machine, "analog4") & 0x3f); |
| 835 | 838 | } |
| 836 | 839 | if(offset == 0x080c || offset == 0x080e) |
| 837 | 840 | { |
| r3624 | r3625 | |
| 875 | 878 | { |
| 876 | 879 | if(aleste_mode & 0x04) |
| 877 | 880 | { |
| 878 | | memory_set_bankptr(3, Aleste_RamBanks[1]); |
| 879 | | memory_set_bankptr(4, Aleste_RamBanks[1]+0x2000); |
| 881 | memory_set_bankptr(machine,3, Aleste_RamBanks[1]); |
| 882 | memory_set_bankptr(machine,4, Aleste_RamBanks[1]+0x2000); |
| 880 | 883 | /* bank 2 - 0x08000..0x0bfff */ |
| 881 | | memory_set_bankptr(5, Aleste_RamBanks[2]); |
| 882 | | memory_set_bankptr(6, Aleste_RamBanks[2]+0x2000); |
| 884 | memory_set_bankptr(machine,5, Aleste_RamBanks[2]); |
| 885 | memory_set_bankptr(machine,6, Aleste_RamBanks[2]+0x2000); |
| 883 | 886 | } |
| 884 | 887 | else |
| 885 | 888 | { |
| 886 | | memory_set_bankptr(3, AmstradCPC_RamBanks[1]); |
| 887 | | memory_set_bankptr(4, AmstradCPC_RamBanks[1]+0x2000); |
| 889 | memory_set_bankptr(machine,3, AmstradCPC_RamBanks[1]); |
| 890 | memory_set_bankptr(machine,4, AmstradCPC_RamBanks[1]+0x2000); |
| 888 | 891 | /* bank 2 - 0x08000..0x0bfff */ |
| 889 | | memory_set_bankptr(5, AmstradCPC_RamBanks[2]); |
| 890 | | memory_set_bankptr(6, AmstradCPC_RamBanks[2]+0x2000); |
| 892 | memory_set_bankptr(machine,5, AmstradCPC_RamBanks[2]); |
| 893 | memory_set_bankptr(machine,6, AmstradCPC_RamBanks[2]+0x2000); |
| 891 | 894 | } |
| 892 | 895 | } |
| 893 | 896 | else |
| r3624 | r3625 | |
| 897 | 900 | /* other banks */ |
| 898 | 901 | if(aleste_mode & 0x04) |
| 899 | 902 | { |
| 900 | | memory_set_bankptr(9, Aleste_RamBanks[0]); |
| 901 | | memory_set_bankptr(10, Aleste_RamBanks[0]+0x2000); |
| 902 | | memory_set_bankptr(11, Aleste_RamBanks[1]); |
| 903 | | memory_set_bankptr(12, Aleste_RamBanks[1]+0x2000); |
| 904 | | memory_set_bankptr(13, Aleste_RamBanks[2]); |
| 905 | | memory_set_bankptr(14, Aleste_RamBanks[2]+0x2000); |
| 906 | | memory_set_bankptr(15, Aleste_RamBanks[3]); |
| 907 | | memory_set_bankptr(16, Aleste_RamBanks[3]+0x2000); |
| 903 | memory_set_bankptr(machine,9, Aleste_RamBanks[0]); |
| 904 | memory_set_bankptr(machine,10, Aleste_RamBanks[0]+0x2000); |
| 905 | memory_set_bankptr(machine,11, Aleste_RamBanks[1]); |
| 906 | memory_set_bankptr(machine,12, Aleste_RamBanks[1]+0x2000); |
| 907 | memory_set_bankptr(machine,13, Aleste_RamBanks[2]); |
| 908 | memory_set_bankptr(machine,14, Aleste_RamBanks[2]+0x2000); |
| 909 | memory_set_bankptr(machine,15, Aleste_RamBanks[3]); |
| 910 | memory_set_bankptr(machine,16, Aleste_RamBanks[3]+0x2000); |
| 908 | 911 | } |
| 909 | 912 | else |
| 910 | 913 | { |
| 911 | | memory_set_bankptr(9, AmstradCPC_RamBanks[0]); |
| 912 | | memory_set_bankptr(10, AmstradCPC_RamBanks[0]+0x2000); |
| 913 | | memory_set_bankptr(11, AmstradCPC_RamBanks[1]); |
| 914 | | memory_set_bankptr(12, AmstradCPC_RamBanks[1]+0x2000); |
| 915 | | memory_set_bankptr(13, AmstradCPC_RamBanks[2]); |
| 916 | | memory_set_bankptr(14, AmstradCPC_RamBanks[2]+0x2000); |
| 917 | | memory_set_bankptr(15, AmstradCPC_RamBanks[3]); |
| 918 | | memory_set_bankptr(16, AmstradCPC_RamBanks[3]+0x2000); |
| 914 | memory_set_bankptr(machine,9, AmstradCPC_RamBanks[0]); |
| 915 | memory_set_bankptr(machine,10, AmstradCPC_RamBanks[0]+0x2000); |
| 916 | memory_set_bankptr(machine,11, AmstradCPC_RamBanks[1]); |
| 917 | memory_set_bankptr(machine,12, AmstradCPC_RamBanks[1]+0x2000); |
| 918 | memory_set_bankptr(machine,13, AmstradCPC_RamBanks[2]); |
| 919 | memory_set_bankptr(machine,14, AmstradCPC_RamBanks[2]+0x2000); |
| 920 | memory_set_bankptr(machine,15, AmstradCPC_RamBanks[3]); |
| 921 | memory_set_bankptr(machine,16, AmstradCPC_RamBanks[3]+0x2000); |
| 919 | 922 | } |
| 920 | 923 | |
| 921 | 924 | /* multiface hardware enabled? */ |
| r3624 | r3625 | |
| 1071 | 1074 | then the interrupt request is cleared and the 6-bit counter is reset to "0". */ |
| 1072 | 1075 | if ((amstrad_GateArray_ModeAndRomConfiguration & (1<<4)) != 0) { |
| 1073 | 1076 | amstrad_CRTC_HS_Counter = 0; |
| 1074 | | cpunum_set_input_line(machine, 0,0, CLEAR_LINE); |
| 1077 | cpu_set_input_line(machine->cpu[0],0, CLEAR_LINE); |
| 1075 | 1078 | |
| 1076 | 1079 | } |
| 1077 | 1080 | /* b3b2 != 0 then change the state of upper or lower rom area and rethink memory */ |
| r3624 | r3625 | |
| 1127 | 1130 | switch(page) |
| 1128 | 1131 | { |
| 1129 | 1132 | case 0: /* 0x0000 - 0x3fff */ |
| 1130 | | memory_set_bankptr(1,mess_ram+ramptr); |
| 1131 | | memory_set_bankptr(2,mess_ram+ramptr+0x2000); |
| 1132 | | memory_set_bankptr(9,mess_ram+ramptr); |
| 1133 | | memory_set_bankptr(10,mess_ram+ramptr+0x2000); |
| 1133 | memory_set_bankptr(machine,1,mess_ram+ramptr); |
| 1134 | memory_set_bankptr(machine,2,mess_ram+ramptr+0x2000); |
| 1135 | memory_set_bankptr(machine,9,mess_ram+ramptr); |
| 1136 | memory_set_bankptr(machine,10,mess_ram+ramptr+0x2000); |
| 1134 | 1137 | Aleste_RamBanks[0] = mess_ram+ramptr; |
| 1135 | 1138 | aleste_active_page[0] = data; |
| 1136 | 1139 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0x0000\n",ramptr,rampage); |
| 1137 | 1140 | break; |
| 1138 | 1141 | case 1: /* 0x4000 - 0x7fff */ |
| 1139 | | memory_set_bankptr(3,mess_ram+ramptr); |
| 1140 | | memory_set_bankptr(4,mess_ram+ramptr+0x2000); |
| 1141 | | memory_set_bankptr(11,mess_ram+ramptr); |
| 1142 | | memory_set_bankptr(12,mess_ram+ramptr+0x2000); |
| 1142 | memory_set_bankptr(machine,3,mess_ram+ramptr); |
| 1143 | memory_set_bankptr(machine,4,mess_ram+ramptr+0x2000); |
| 1144 | memory_set_bankptr(machine,11,mess_ram+ramptr); |
| 1145 | memory_set_bankptr(machine,12,mess_ram+ramptr+0x2000); |
| 1143 | 1146 | Aleste_RamBanks[1] = mess_ram+ramptr; |
| 1144 | 1147 | aleste_active_page[1] = data; |
| 1145 | 1148 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0x4000\n",ramptr,rampage); |
| 1146 | 1149 | break; |
| 1147 | 1150 | case 2: /* 0x8000 - 0xbfff */ |
| 1148 | | memory_set_bankptr(5,mess_ram+ramptr); |
| 1149 | | memory_set_bankptr(6,mess_ram+ramptr+0x2000); |
| 1150 | | memory_set_bankptr(13,mess_ram+ramptr); |
| 1151 | | memory_set_bankptr(14,mess_ram+ramptr+0x2000); |
| 1151 | memory_set_bankptr(machine,5,mess_ram+ramptr); |
| 1152 | memory_set_bankptr(machine,6,mess_ram+ramptr+0x2000); |
| 1153 | memory_set_bankptr(machine,13,mess_ram+ramptr); |
| 1154 | memory_set_bankptr(machine,14,mess_ram+ramptr+0x2000); |
| 1152 | 1155 | Aleste_RamBanks[2] = mess_ram+ramptr; |
| 1153 | 1156 | aleste_active_page[2] = data; |
| 1154 | 1157 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0x8000\n",ramptr,rampage); |
| 1155 | 1158 | break; |
| 1156 | 1159 | case 3: /* 0xc000 - 0xffff */ |
| 1157 | | memory_set_bankptr(7,mess_ram+ramptr); |
| 1158 | | memory_set_bankptr(8,mess_ram+ramptr+0x2000); |
| 1159 | | memory_set_bankptr(15,mess_ram+ramptr); |
| 1160 | | memory_set_bankptr(16,mess_ram+ramptr+0x2000); |
| 1160 | memory_set_bankptr(machine,7,mess_ram+ramptr); |
| 1161 | memory_set_bankptr(machine,8,mess_ram+ramptr+0x2000); |
| 1162 | memory_set_bankptr(machine,15,mess_ram+ramptr); |
| 1163 | memory_set_bankptr(machine,16,mess_ram+ramptr+0x2000); |
| 1161 | 1164 | Aleste_RamBanks[3] = mess_ram+ramptr; |
| 1162 | 1165 | aleste_active_page[3] = data; |
| 1163 | 1166 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0xc000\n",ramptr,rampage); |
| r3624 | r3625 | |
| 1244 | 1247 | m6845_personality_t crtc_type; |
| 1245 | 1248 | int page; |
| 1246 | 1249 | |
| 1247 | | crtc_type = input_port_read_safe(machine, "crtc", 0); |
| 1250 | crtc_type = input_port_read_safe(space->machine, "crtc", 0); |
| 1248 | 1251 | m6845_set_personality(crtc_type); |
| 1249 | 1252 | |
| 1250 | 1253 | if(aleste_mode & 0x04) |
| r3624 | r3625 | |
| 1294 | 1297 | if ((offset & (1<<11)) == 0) |
| 1295 | 1298 | { |
| 1296 | 1299 | if (r1r0 < 0x03 ) |
| 1297 | | data = ppi8255_r((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), r1r0); |
| 1300 | data = ppi8255_r((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), r1r0); |
| 1298 | 1301 | } |
| 1299 | 1302 | /* if b10 = 0 : Expansion Peripherals Read selected |
| 1300 | 1303 | |
| r3624 | r3625 | |
| 1321 | 1324 | int b8b0 = ((offset & (1<<8)) >> (8 - 1)) | (offset & (0x01)); |
| 1322 | 1325 | switch (b8b0) { |
| 1323 | 1326 | case 0x02: { |
| 1324 | | data = nec765_status_r(machine, 0); |
| 1327 | data = nec765_status_r(space, 0); |
| 1325 | 1328 | } break; |
| 1326 | 1329 | case 0x03: { |
| 1327 | | data = nec765_data_r(machine, 0); |
| 1330 | data = nec765_data_r(space, 0); |
| 1328 | 1331 | } break; |
| 1329 | 1332 | default: { |
| 1330 | 1333 | } break; |
| r3624 | r3625 | |
| 1342 | 1345 | { |
| 1343 | 1346 | if(aleste_mode & 0x04) // Aleste mode |
| 1344 | 1347 | { |
| 1345 | | aleste_msx_mapper(machine, offset,data); |
| 1348 | aleste_msx_mapper(space->machine, offset,data); |
| 1346 | 1349 | } |
| 1347 | 1350 | else |
| 1348 | 1351 | { |
| 1349 | 1352 | /* if b15 = 0 and b14 = 1 : Gate-Array Write Selected*/ |
| 1350 | 1353 | if ((offset & (1<<14)) != 0) |
| 1351 | | amstrad_GateArray_write(machine, data); |
| 1354 | amstrad_GateArray_write(space->machine, data); |
| 1352 | 1355 | /* if b15 = 0 : RAM Configuration Write Selected*/ |
| 1353 | | AmstradCPC_GA_SetRamConfiguration(machine); |
| 1356 | AmstradCPC_GA_SetRamConfiguration(space->machine); |
| 1354 | 1357 | } |
| 1355 | 1358 | } |
| 1356 | 1359 | /*The Gate-Array and CRTC can't be selected simultaneously, which would otherwise cause potential display corruption.*/ |
| r3624 | r3625 | |
| 1359 | 1362 | switch ((offset & 0x0300) >> 8) { // r1r0 |
| 1360 | 1363 | case 0x00: {/* Select internal 6845 register Write Only */ |
| 1361 | 1364 | #ifdef AMSTRAD_VIDEO_EVENT_LIST |
| 1362 | | EventList_AddItemOffset(machine, (EVENT_LIST_CODE_CRTC_INDEX_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen))); |
| 1365 | EventList_AddItemOffset(space->machine, (EVENT_LIST_CODE_CRTC_INDEX_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen))); |
| 1363 | 1366 | #endif |
| 1364 | 1367 | m6845_address_w(0,data); |
| 1365 | 1368 | if(amstrad_system_type != SYSTEM_CPC) |
| r3624 | r3625 | |
| 1368 | 1371 | } break; |
| 1369 | 1372 | case 0x01: {/* Write to selected internal 6845 register Write Only */ |
| 1370 | 1373 | #ifdef AMSTRAD_VIDEO_EVENT_LIST |
| 1371 | | EventList_AddItemOffset(machine, (EVENT_LIST_CODE_CRTC_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen))); |
| 1374 | EventList_AddItemOffset(space->machine, (EVENT_LIST_CODE_CRTC_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen))); |
| 1372 | 1375 | #endif |
| 1373 | 1376 | // logerror("m6845 register (%02d : %04x)\n", selected_m6845_address, (data&0x3F)); |
| 1374 | 1377 | m6845_register_w(0,data); |
| r3624 | r3625 | |
| 1383 | 1386 | { |
| 1384 | 1387 | if (previous_amstrad_UpperRom_data != (data & 0xff)) |
| 1385 | 1388 | { |
| 1386 | | AmstradCPC_SetUpperRom(machine, data); |
| 1389 | AmstradCPC_SetUpperRom(space->machine, data); |
| 1387 | 1390 | } |
| 1388 | 1391 | previous_amstrad_UpperRom_data = (data & 0xff); |
| 1389 | 1392 | } |
| r3624 | r3625 | |
| 1400 | 1403 | /* check for only one transition */ |
| 1401 | 1404 | if ((data & (1<<7)) == 0) { |
| 1402 | 1405 | /* output data to printer */ |
| 1403 | | printer_output(printer_device(machine), data & 0x07f); |
| 1406 | printer_output(printer_device(space->machine), data & 0x07f); |
| 1404 | 1407 | } |
| 1405 | 1408 | } |
| 1406 | 1409 | previous_printer_data_byte = data; |
| r3624 | r3625 | |
| 1415 | 1418 | */ |
| 1416 | 1419 | if ((offset & (1<<11)) == 0) { |
| 1417 | 1420 | unsigned int Index = ((offset & 0x0300) >> 8); |
| 1418 | | ppi8255_w((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), Index, data); |
| 1421 | ppi8255_w((device_config*)device_list_find_by_tag( space->machine->config->devicelist, PPI8255, "ppi8255" ), Index, data); |
| 1419 | 1422 | } |
| 1420 | 1423 | /* if b10 = 0 : Expansion Peripherals Write selected */ |
| 1421 | 1424 | if ((offset & (1<<10)) == 0) { |
| r3624 | r3625 | |
| 1453 | 1456 | break; |
| 1454 | 1457 | |
| 1455 | 1458 | case 0x03: /* Write Data register of FDC */ |
| 1456 | | nec765_data_w(machine, 0,data); |
| 1459 | nec765_data_w(space, 0,data); |
| 1457 | 1460 | break; |
| 1458 | 1461 | default: |
| 1459 | 1462 | break; |
| r3624 | r3625 | |
| 1480 | 1483 | rect.min_x = rect.min_y = 0; |
| 1481 | 1484 | rect.max_x = (ALESTE_SCREEN_WIDTH-32) - 1; |
| 1482 | 1485 | rect.max_y = (AMSTRAD_SCREEN_HEIGHT-40) - 1; |
| 1483 | | video_screen_configure(machine->primary_screen,800,312,&rect,HZ_TO_ATTOSECONDS(AMSTRAD_FPS)); |
| 1486 | video_screen_configure(space->machine->primary_screen,800,312,&rect,HZ_TO_ATTOSECONDS(AMSTRAD_FPS)); |
| 1484 | 1487 | } |
| 1485 | 1488 | else |
| 1486 | 1489 | { |
| r3624 | r3625 | |
| 1488 | 1491 | rect.min_x = rect.min_y = 0; |
| 1489 | 1492 | rect.max_x = (AMSTRAD_SCREEN_WIDTH-32) - 1; |
| 1490 | 1493 | rect.max_y = (AMSTRAD_SCREEN_HEIGHT-40) - 1; |
| 1491 | | video_screen_configure(machine->primary_screen,800,312,&rect,HZ_TO_ATTOSECONDS(AMSTRAD_FPS)); |
| 1494 | video_screen_configure(space->machine->primary_screen,800,312,&rect,HZ_TO_ATTOSECONDS(AMSTRAD_FPS)); |
| 1492 | 1495 | } |
| 1493 | 1496 | } |
| 1494 | | multiface_io_write(machine, offset,data); |
| 1497 | multiface_io_write(space, offset,data); |
| 1495 | 1498 | } |
| 1496 | 1499 | |
| 1497 | 1500 | // Handler for checking the ASIC unlocking sequence |
| r3624 | r3625 | |
| 1543 | 1546 | |
| 1544 | 1547 | |
| 1545 | 1548 | /* used to setup computer if a snapshot was specified */ |
| 1546 | | static OPBASE_HANDLER( amstrad_multiface_opbaseoverride ) |
| 1549 | static DIRECT_UPDATE_HANDLER( amstrad_multiface_directoverride ) |
| 1547 | 1550 | { |
| 1548 | 1551 | int pc; |
| 1549 | 1552 | |
| 1550 | | pc = activecpu_get_pc(); |
| 1553 | pc = cpu_get_pc(space->machine->cpu[0]); |
| 1551 | 1554 | |
| 1552 | 1555 | /* there are two places where CALL &0065 can be found |
| 1553 | 1556 | in the multiface rom. At this address there is a RET. |
| r3624 | r3625 | |
| 1576 | 1579 | multiface_flags &= ~(MULTIFACE_VISIBLE|MULTIFACE_STOP_BUTTON_PRESSED); |
| 1577 | 1580 | |
| 1578 | 1581 | /* clear op base override */ |
| 1579 | | memory_set_opbase_handler(0,0); |
| 1582 | memory_set_direct_update_handler(0,0); |
| 1580 | 1583 | } |
| 1581 | 1584 | |
| 1582 | 1585 | return pc; |
| r3624 | r3625 | |
| 1639 | 1642 | multiface_rethink_memory(machine); |
| 1640 | 1643 | |
| 1641 | 1644 | /* pulse the nmi line */ |
| 1642 | | cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); |
| 1645 | cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE); |
| 1643 | 1646 | |
| 1644 | 1647 | /* initialise 0065 override to monitor calls to 0065 */ |
| 1645 | | memory_set_opbase_handler(0,amstrad_multiface_opbaseoverride); |
| 1648 | memory_set_direct_update_handler(0,amstrad_multiface_directoverride); |
| 1646 | 1649 | } |
| 1647 | 1650 | |
| 1648 | 1651 | } |
| r3624 | r3625 | |
| 1664 | 1667 | { |
| 1665 | 1668 | |
| 1666 | 1669 | /* set bank addressess */ |
| 1667 | | memory_set_bankptr(1, multiface_rom); |
| 1668 | | memory_set_bankptr(2, multiface_ram); |
| 1669 | | memory_set_bankptr(9, multiface_rom); |
| 1670 | | memory_set_bankptr(10, multiface_ram); |
| 1670 | memory_set_bankptr(machine,1, multiface_rom); |
| 1671 | memory_set_bankptr(machine,2, multiface_ram); |
| 1672 | memory_set_bankptr(machine,9, multiface_rom); |
| 1673 | memory_set_bankptr(machine,10, multiface_ram); |
| 1671 | 1674 | } |
| 1672 | 1675 | } |
| 1673 | 1676 | |
| r3624 | r3625 | |
| 1675 | 1678 | static WRITE8_HANDLER(multiface_io_write) |
| 1676 | 1679 | { |
| 1677 | 1680 | /* multiface hardware enabled? */ |
| 1678 | | if (!multiface_hardware_enabled(machine)) |
| 1681 | if (!multiface_hardware_enabled(space->machine)) |
| 1679 | 1682 | return; |
| 1680 | 1683 | |
| 1681 | 1684 | /* visible? */ |
| r3624 | r3625 | |
| 1684 | 1687 | if (offset==0x0fee8) |
| 1685 | 1688 | { |
| 1686 | 1689 | multiface_flags |= MULTIFACE_RAM_ROM_ENABLED; |
| 1687 | | amstrad_rethinkMemory(machine); |
| 1690 | amstrad_rethinkMemory(space->machine); |
| 1688 | 1691 | } |
| 1689 | 1692 | |
| 1690 | 1693 | if (offset==0x0feea) |
| 1691 | 1694 | { |
| 1692 | 1695 | multiface_flags &= ~MULTIFACE_RAM_ROM_ENABLED; |
| 1693 | | amstrad_rethinkMemory(machine); |
| 1696 | amstrad_rethinkMemory(space->machine); |
| 1694 | 1697 | } |
| 1695 | 1698 | } |
| 1696 | 1699 | |
| r3624 | r3625 | |
| 1810 | 1813 | amstrad_plus_asic_ram[0x2c0f] &= ~0x80; // not a raster interrupt, so this bit is reset |
| 1811 | 1814 | return (amstrad_plus_asic_ram[0x2805] & 0xf8) | amstrad_plus_irq_cause; |
| 1812 | 1815 | } |
| 1813 | | cpunum_set_input_line(machine, 0,0, CLEAR_LINE); |
| 1816 | cpu_set_input_line(device->machine->cpu[0],0, CLEAR_LINE); |
| 1814 | 1817 | amstrad_CRTC_HS_Counter &= 0x1F; |
| 1815 | 1818 | if(amstrad_plus_asic_enabled != 0) |
| 1816 | 1819 | { |
| r3624 | r3625 | |
| 2000 | 2003 | |
| 2001 | 2004 | static void amstrad_common_init(running_machine *machine) |
| 2002 | 2005 | { |
| 2006 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 2007 | |
| 2003 | 2008 | aleste_mode = 0; |
| 2004 | 2009 | |
| 2005 | 2010 | amstrad_GateArray_ModeAndRomConfiguration = 0; |
| r3624 | r3625 | |
| 2007 | 2012 | amstrad_CRTC_HS_Counter = 2; |
| 2008 | 2013 | previous_amstrad_UpperRom_data = 0xff; |
| 2009 | 2014 | |
| 2010 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK1); |
| 2011 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK2); |
| 2015 | memory_install_read8_handler(space, 0x0000, 0x1fff, 0, 0, SMH_BANK1); |
| 2016 | memory_install_read8_handler(space, 0x2000, 0x3fff, 0, 0, SMH_BANK2); |
| 2012 | 2017 | |
| 2013 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK3); |
| 2014 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK4); |
| 2018 | memory_install_read8_handler(space, 0x4000, 0x5fff, 0, 0, SMH_BANK3); |
| 2019 | memory_install_read8_handler(space, 0x6000, 0x7fff, 0, 0, SMH_BANK4); |
| 2015 | 2020 | |
| 2016 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK5); |
| 2017 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK6); |
| 2021 | memory_install_read8_handler(space, 0x8000, 0x9fff, 0, 0, SMH_BANK5); |
| 2022 | memory_install_read8_handler(space, 0xa000, 0xbfff, 0, 0, SMH_BANK6); |
| 2018 | 2023 | |
| 2019 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK7); |
| 2020 | | memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK8); |
| 2024 | memory_install_read8_handler(space, 0xc000, 0xdfff, 0, 0, SMH_BANK7); |
| 2025 | memory_install_read8_handler(space, 0xe000, 0xffff, 0, 0, SMH_BANK8); |
| 2021 | 2026 | |
| 2022 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0, SMH_BANK9); |
| 2023 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, SMH_BANK10); |
| 2027 | memory_install_write8_handler(space, 0x0000, 0x1fff, 0, 0, SMH_BANK9); |
| 2028 | memory_install_write8_handler(space, 0x2000, 0x3fff, 0, 0, SMH_BANK10); |
| 2024 | 2029 | |
| 2025 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x5fff, 0, 0, SMH_BANK11); |
| 2026 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x7fff, 0, 0, SMH_BANK12); |
| 2030 | memory_install_write8_handler(space, 0x4000, 0x5fff, 0, 0, SMH_BANK11); |
| 2031 | memory_install_write8_handler(space, 0x6000, 0x7fff, 0, 0, SMH_BANK12); |
| 2027 | 2032 | |
| 2028 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x9fff, 0, 0, SMH_BANK13); |
| 2029 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, SMH_BANK14); |
| 2033 | memory_install_write8_handler(space, 0x8000, 0x9fff, 0, 0, SMH_BANK13); |
| 2034 | memory_install_write8_handler(space, 0xa000, 0xbfff, 0, 0, SMH_BANK14); |
| 2030 | 2035 | |
| 2031 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, SMH_BANK15); |
| 2032 | | memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, SMH_BANK16); |
| 2036 | memory_install_write8_handler(space, 0xc000, 0xdfff, 0, 0, SMH_BANK15); |
| 2037 | memory_install_write8_handler(space, 0xe000, 0xffff, 0, 0, SMH_BANK16); |
| 2033 | 2038 | |
| 2034 | | cpunum_reset(0); |
| 2039 | cpu_reset(space->machine->cpu[0]); |
| 2035 | 2040 | if(amstrad_system_type == SYSTEM_CPC) |
| 2036 | | cpunum_set_input_line_vector(0, 0,0xff); |
| 2041 | cpu_set_input_line_vector(machine->cpu[0], 0,0xff); |
| 2037 | 2042 | else |
| 2038 | | cpunum_set_input_line_vector(0, 0,0x00); |
| 2043 | cpu_set_input_line_vector(machine->cpu[0], 0,0x00); |
| 2039 | 2044 | |
| 2040 | 2045 | if(amstrad_system_type != SYSTEM_GX4000) |
| 2041 | 2046 | { |
| r3624 | r3625 | |
| 2061 | 2066 | |
| 2062 | 2067 | /* Using the cool code Juergen has provided, I will override |
| 2063 | 2068 | the timing tables with the values for the amstrad */ |
| 2064 | | cpunum_set_info_ptr(0,CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_op, (void*)amstrad_cycle_table_op); |
| 2065 | | cpunum_set_info_ptr(0,CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_cb, (void*)amstrad_cycle_table_cb); |
| 2066 | | cpunum_set_info_ptr(0,CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ed, (void*)amstrad_cycle_table_ed); |
| 2067 | | cpunum_set_info_ptr(0,CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xy, (void*)amstrad_cycle_table_xy); |
| 2068 | | cpunum_set_info_ptr(0,CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xycb, (void*)amstrad_cycle_table_xycb); |
| 2069 | | cpunum_set_info_ptr(0,CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ex, (void*)amstrad_cycle_table_ex); |
| 2069 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_op, (void*)amstrad_cycle_table_op); |
| 2070 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_cb, (void*)amstrad_cycle_table_cb); |
| 2071 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ed, (void*)amstrad_cycle_table_ed); |
| 2072 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xy, (void*)amstrad_cycle_table_xy); |
| 2073 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_xycb, (void*)amstrad_cycle_table_xycb); |
| 2074 | cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_Z80_CYCLE_TABLE+Z80_TABLE_ex, (void*)amstrad_cycle_table_ex); |
| 2070 | 2075 | |
| 2071 | 2076 | /* Juergen is a cool dude! */ |
| 2072 | | cpunum_set_irq_callback(0, amstrad_cpu_acknowledge_int); |
| 2077 | cpu_set_irq_callback(machine->cpu[0], amstrad_cpu_acknowledge_int); |
| 2073 | 2078 | } |
| 2074 | 2079 | |
| 2075 | 2080 | static MACHINE_RESET( amstrad ) |
| r3624 | r3625 | |
| 2292 | 2297 | return 0xff; |
| 2293 | 2298 | amstrad_keyboard_line = 0xFF; |
| 2294 | 2299 | |
| 2295 | | return input_port_read_safe(machine, keynames[amstrad_read_keyboard_line], 0) & 0xFF; |
| 2300 | return input_port_read_safe(space->machine, keynames[amstrad_read_keyboard_line], 0) & 0xFF; |
| 2296 | 2301 | } |
| 2297 | 2302 | } |
| 2298 | 2303 | |