src/mess/machine/vc1541.c
| r4769 | r4770 | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | #define VERBOSE_LEVEL 0 |
| 149 | | #define DBG_LOG(N,M,A) \ |
| 149 | #define DBG_LOG(MACHINE,N,M,A) \ |
| 150 | 150 | do { \ |
| 151 | 151 | if(VERBOSE_LEVEL >= N) \ |
| 152 | 152 | { \ |
| 153 | 153 | if( M ) \ |
| 154 | | logerror("%11.6f: %-24s", attotime_to_double(timer_get_time(machine)), (char*) M ); \ |
| 154 | logerror("%11.6f: %-24s", attotime_to_double(timer_get_time(MACHINE)), (char*) M ); \ |
| 155 | 155 | logerror A; \ |
| 156 | 156 | } \ |
| 157 | 157 | } while (0) |
| r4769 | r4770 | |
| 184 | 184 | communications is a priority over the clean up of this part */ |
| 185 | 185 | typedef struct |
| 186 | 186 | { |
| 187 | | int cpunumber; |
| 187 | const char *cputag; |
| 188 | 188 | int type; |
| 189 | 189 | union { |
| 190 | 190 | struct { |
| r4769 | r4770 | |
| 297 | 297 | |
| 298 | 298 | static const int max_tracks_per_format[] = |
| 299 | 299 | { |
| 300 | | D64_MAX_TRACKS, |
| 301 | | D64_MAX_TRACKS, |
| 302 | | D64_40T_MAX_TRACKS, |
| 303 | | D64_40T_MAX_TRACKS, |
| 304 | | D64_MAX_TRACKS, |
| 305 | | D71_MAX_TRACKS, |
| 306 | | D71_MAX_TRACKS, |
| 307 | | D81_MAX_TRACKS, |
| 308 | | D80_MAX_TRACKS, |
| 309 | | D82_MAX_TRACKS, |
| 310 | | 0 /* Still to add support for .g64 */ |
| 300 | D64_MAX_TRACKS, |
| 301 | D64_MAX_TRACKS, |
| 302 | D64_40T_MAX_TRACKS, |
| 303 | D64_40T_MAX_TRACKS, |
| 304 | D64_MAX_TRACKS, |
| 305 | D71_MAX_TRACKS, |
| 306 | D71_MAX_TRACKS, |
| 307 | D81_MAX_TRACKS, |
| 308 | D80_MAX_TRACKS, |
| 309 | D82_MAX_TRACKS, |
| 310 | 0 /* Still to add support for .g64 */ |
| 311 | 311 | }; |
| 312 | 312 | |
| 313 | 313 | static int image_offset[IMAGE_MAX_TRACKS] = { 0 }; |
| r4769 | r4770 | |
| 576 | 576 | |
| 577 | 577 | static ADDRESS_MAP_START( _1541_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 578 | 578 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 579 | | AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("via6522_2", via_r, via_w) /* 0 and 1 used in vc20 */ |
| 580 | | AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP) /* for debugger */ |
| 581 | | AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("via6522_3", via_r, via_w) |
| 582 | | AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP) /* for debugger */ |
| 579 | AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w) /* 0 and 1 used in vc20 */ // IEC Bus |
| 580 | // AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP) /* for debugger */ |
| 581 | AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w) // Drive |
| 582 | // AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP) /* for debugger */ |
| 583 | 583 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 584 | 584 | ADDRESS_MAP_END |
| 585 | 585 | |
| 586 | 586 | |
| 587 | 587 | static ADDRESS_MAP_START( dolphin_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 588 | 588 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 589 | | AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("via6522_2", via_r, via_w) /* 0 and 1 used in vc20 */ |
| 590 | | AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("via6522_3", via_r, via_w) |
| 589 | AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w) /* 0 and 1 used in vc20 */ |
| 590 | AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w) |
| 591 | 591 | AM_RANGE(0x8000, 0x9fff) AM_RAM |
| 592 | 592 | AM_RANGE(0xa000, 0xffff) AM_ROM |
| 593 | 593 | ADDRESS_MAP_END |
| r4769 | r4770 | |
| 604 | 604 | |
| 605 | 605 | if (drive->type == type_1541) |
| 606 | 606 | { |
| 607 | | const device_config *via_3 = devtag_get_device(machine, "via6522_3"); |
| 607 | const device_config *via_3 = devtag_get_device(machine, "_1541_via_1"); |
| 608 | 608 | |
| 609 | | cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_SET_OVERFLOW, 1); |
| 609 | cputag_set_input_line(machine, drive->cputag, M6502_SET_OVERFLOW, 1); |
| 610 | 610 | via_ca1_w(via_3, 0, 1); |
| 611 | 611 | } |
| 612 | 612 | |
| r4769 | r4770 | |
| 642 | 642 | |
| 643 | 643 | if (drive->type == type_1541) |
| 644 | 644 | { |
| 645 | | const device_config *via_3 = devtag_get_device(machine, "via6522_3"); |
| 646 | | cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_SET_OVERFLOW, 0); |
| 645 | const device_config *via_3 = devtag_get_device(machine, "_1541_via_1"); |
| 646 | cputag_set_input_line(machine, drive->cputag, M6502_SET_OVERFLOW, 0); |
| 647 | 647 | via_ca1_w(via_3, 0, 0); |
| 648 | 648 | } |
| 649 | 649 | |
| r4769 | r4770 | |
| 667 | 667 | * irq to m6502 irq connected (or with second via irq) |
| 668 | 668 | */ |
| 669 | 669 | |
| 670 | | static void vc1541_via0_irq (const device_config *device, int level) |
| 670 | static void vc1541_via0_irq(const device_config *device, int level) |
| 671 | 671 | { |
| 672 | | running_machine *machine = device->machine; |
| 673 | | |
| 674 | 672 | drive->via0irq = level; |
| 675 | | DBG_LOG(2, "vc1541 via0 irq",("level %d %d\n",drive->via0irq,drive->via1irq)); |
| 673 | DBG_LOG(device->machine, 2, "vc1541 via0 irq", ("level %d %d\n", drive->via0irq, drive->via1irq)); |
| 676 | 674 | |
| 677 | | cpu_set_input_line (device->machine->cpu[drive->cpunumber], M6502_IRQ_LINE, drive->via1irq || drive->via0irq); |
| 675 | cputag_set_input_line(device->machine, drive->cputag, M6502_IRQ_LINE, drive->via1irq || drive->via0irq); |
| 678 | 676 | } |
| 679 | 677 | |
| 680 | 678 | static READ8_DEVICE_HANDLER( vc1541_via0_read_portb ) |
| r4769 | r4770 | |
| 709 | 707 | |
| 710 | 708 | static WRITE8_DEVICE_HANDLER( vc1541_via0_write_portb ) |
| 711 | 709 | { |
| 712 | | running_machine *machine = device->machine; |
| 713 | | |
| 714 | | DBG_LOG(2, "vc1541 serial write",("%s %s %s\n", |
| 710 | DBG_LOG(device->machine, 2, "vc1541 serial write", ("%s %s %s\n", |
| 715 | 711 | data & 0x10 ? "ATN" : "atn", |
| 716 | 712 | data & 0x08 ? "CLOCK" : "clock", |
| 717 | 713 | data & 0x02 ? "DATA" : "data")); |
| r4769 | r4770 | |
| 721 | 717 | |
| 722 | 718 | if ((!(data & 0x02)) != drive->drive.serial.serial_data) |
| 723 | 719 | { |
| 724 | | vc1541_serial_data_write (1, drive->drive.serial.serial_data = !(data & 0x02)); |
| 720 | vc1541_serial_data_write(device->machine, 1, drive->drive.serial.serial_data = !(data & 0x02)); |
| 725 | 721 | } |
| 726 | 722 | |
| 727 | 723 | if ((!(data & 0x08)) != drive->drive.serial.serial_clock) |
| 728 | 724 | { |
| 729 | | vc1541_serial_clock_write (1, drive->drive.serial.serial_clock = !(data & 0x08)); |
| 725 | vc1541_serial_clock_write(device->machine, 1, drive->drive.serial.serial_clock = !(data & 0x08)); |
| 730 | 726 | } |
| 731 | 727 | |
| 732 | | vc1541_serial_atn_write (device->machine, 1, drive->drive.serial.serial_atn = 1); |
| 728 | vc1541_serial_atn_write(device->machine, 1, drive->drive.serial.serial_atn = 1); |
| 733 | 729 | } |
| 734 | 730 | |
| 735 | 731 | |
| r4769 | r4770 | |
| 763 | 759 | |
| 764 | 760 | static void vc1541_via1_irq (const device_config *device, int level) |
| 765 | 761 | { |
| 766 | | running_machine *machine = device->machine; |
| 767 | | |
| 768 | 762 | drive->via1irq = level; |
| 769 | | DBG_LOG(2, "vc1541 via1 irq", ("level %d %d\n", drive->via0irq, drive->via1irq)); |
| 763 | DBG_LOG(device->machine, 2, "vc1541 via1 irq", ("level %d %d\n", drive->via0irq, drive->via1irq)); |
| 770 | 764 | |
| 771 | | cpu_set_input_line (machine->cpu[drive->cpunumber], M6502_IRQ_LINE, drive->via1irq || drive->via0irq); |
| 765 | cputag_set_input_line(device->machine, drive->cputag, M6502_IRQ_LINE, drive->via1irq || drive->via0irq); |
| 772 | 766 | } |
| 773 | 767 | |
| 774 | 768 | static READ8_DEVICE_HANDLER( vc1541_via1_read_porta ) |
| 775 | 769 | { |
| 776 | | running_machine *machine = device->machine; |
| 777 | 770 | int data = drive->gcr.data[drive->pos]; |
| 778 | | DBG_LOG(2, "vc1541 drive", ("port a read %.2x\n", data)); |
| 771 | |
| 772 | DBG_LOG(device->machine, 2, "vc1541 drive", ("port a read %.2x\n", data)); |
| 779 | 773 | return data; |
| 780 | 774 | } |
| 781 | 775 | |
| 782 | 776 | static WRITE8_DEVICE_HANDLER( vc1541_via1_write_porta ) |
| 783 | 777 | { |
| 784 | | running_machine *machine = device->machine; |
| 785 | | DBG_LOG(1, "vc1541 drive", ("port a write %.2x\n", data)); |
| 778 | DBG_LOG(device->machine, 1, "vc1541 drive", ("port a write %.2x\n", data)); |
| 786 | 779 | } |
| 787 | 780 | |
| 788 | 781 | static READ8_DEVICE_HANDLER( vc1541_via1_read_portb ) |
| r4769 | r4770 | |
| 806 | 799 | |
| 807 | 800 | static WRITE8_DEVICE_HANDLER( vc1541_via1_write_portb ) |
| 808 | 801 | { |
| 809 | | running_machine *machine = device->machine; |
| 810 | 802 | if (data != old) |
| 811 | 803 | { |
| 812 | | DBG_LOG(1, "vc1541 drive",("%.2x\n", data)); |
| 804 | DBG_LOG(device->machine, 1, "vc1541 drive",("%.2x\n", data)); |
| 813 | 805 | |
| 814 | 806 | if ((old & 0x03) != (data & 0x03)) |
| 815 | 807 | { |
| r4769 | r4770 | |
| 844 | 836 | break; |
| 845 | 837 | } |
| 846 | 838 | |
| 847 | | logerror("Track #: %f\n", drive->track); |
| 839 | // logerror("Track #: %f\n", drive->track); |
| 848 | 840 | |
| 849 | 841 | /* If we have reached the first or last track, we cannot proceed further! */ |
| 850 | 842 | if (drive->track < 1) |
| r4769 | r4770 | |
| 889 | 881 | { |
| 890 | 882 | } |
| 891 | 883 | |
| 892 | | const via6522_interface vc1541_via2 = |
| 884 | const via6522_interface vc1541_via0 = |
| 893 | 885 | { |
| 894 | 886 | DEVCB_NULL, /*vc1541_via0_read_porta, */ |
| 895 | 887 | DEVCB_HANDLER(vc1541_via0_read_portb), |
| r4769 | r4770 | |
| 904 | 896 | DEVCB_NULL, /*via2_write_ca2, */ |
| 905 | 897 | DEVCB_NULL, /*via2_write_cb2, */ |
| 906 | 898 | DEVCB_LINE(vc1541_via0_irq) |
| 907 | | }, vc1541_via3 = |
| 899 | }, |
| 900 | |
| 901 | vc1541_via1 = |
| 908 | 902 | { |
| 909 | 903 | DEVCB_HANDLER(vc1541_via1_read_porta), |
| 910 | 904 | DEVCB_HANDLER(vc1541_via1_read_portb), |
| r4769 | r4770 | |
| 922 | 916 | }; |
| 923 | 917 | |
| 924 | 918 | |
| 925 | | void vc1541_serial_reset_write (int which, int level) |
| 919 | void vc1541_serial_reset_write( running_machine *machine, int which, int level ) |
| 926 | 920 | { |
| 927 | 921 | } |
| 928 | 922 | |
| 929 | | int vc1541_serial_atn_read (int which) |
| 923 | int vc1541_serial_atn_read( running_machine *machine, int which ) |
| 930 | 924 | { |
| 925 | /* there is no more cpu_getactivecpu! */ |
| 931 | 926 | #ifdef CPU_SYNC |
| 932 | 927 | if (cpu_getactivecpu()==0) cpu_sync(); |
| 933 | 928 | #endif |
| 934 | 929 | return serial.atn[0]; |
| 935 | 930 | } |
| 936 | 931 | |
| 937 | | void vc1541_serial_atn_write (running_machine *machine, int which, int level) |
| 932 | void vc1541_serial_atn_write( running_machine *machine, int which, int level ) |
| 938 | 933 | { |
| 939 | | const device_config *via_2 = devtag_get_device(machine, "via6522_2"); |
| 934 | const device_config *via_2 = devtag_get_device(machine, "_1541_via_0"); |
| 940 | 935 | #if 0 |
| 941 | 936 | int value; |
| 942 | 937 | #endif |
| 943 | 938 | if (serial.atn[1 + which] != level) |
| 944 | 939 | { |
| 940 | /* there is no more cpu_getactivecpu! */ |
| 945 | 941 | #ifdef CPU_SYNC |
| 946 | 942 | if (cpu_getactivecpu()==0) cpu_sync(); |
| 947 | 943 | #endif |
| r4769 | r4770 | |
| 952 | 948 | if (serial.atn[0] == level) |
| 953 | 949 | { |
| 954 | 950 | #if 0 |
| 955 | | DBG_LOG(1, "vc1541",("%d:%.4x atn %s\n", |
| 951 | DBG_LOG(machine, 1, "vc1541",("%d:%.4x atn %s\n", |
| 956 | 952 | cpu_getactivecpu (), |
| 957 | 953 | activecpu_get_pc(), |
| 958 | 954 | serial.atn[0]?"ATN":"atn")); |
| r4769 | r4770 | |
| 973 | 969 | } |
| 974 | 970 | } |
| 975 | 971 | |
| 976 | | int vc1541_serial_data_read (int which) |
| 972 | int vc1541_serial_data_read( running_machine *machine, int which ) |
| 977 | 973 | { |
| 974 | /* there is no more cpu_getactivecpu! */ |
| 978 | 975 | #ifdef CPU_SYNC |
| 979 | 976 | if (cpu_getactivecpu()==0) cpu_sync(); |
| 980 | 977 | #endif |
| 981 | 978 | return serial.data[0]; |
| 982 | 979 | } |
| 983 | 980 | |
| 984 | | void vc1541_serial_data_write (int which, int level) |
| 981 | void vc1541_serial_data_write( running_machine *machine, int which, int level ) |
| 985 | 982 | { |
| 986 | 983 | if (serial.data[1 + which] != level) |
| 987 | 984 | { |
| 985 | /* there is no more cpu_getactivecpu! */ |
| 988 | 986 | #ifdef CPU_SYNC |
| 989 | 987 | if (cpu_getactivecpu()==0) cpu_sync(); |
| 990 | 988 | #endif |
| r4769 | r4770 | |
| 995 | 993 | #if 0 |
| 996 | 994 | if (serial.data[0] == level) |
| 997 | 995 | { |
| 998 | | DBG_LOG(1, "vc1541",("%d:%.4x data %s\n", |
| 996 | DBG_LOG(machine, 1, "vc1541",("%d:%.4x data %s\n", |
| 999 | 997 | cpu_getactivecpu (), |
| 1000 | 998 | activecpu_get_pc(), |
| 1001 | 999 | serial.data[0]?"DATA":"data")); |
| r4769 | r4770 | |
| 1005 | 1003 | } |
| 1006 | 1004 | } |
| 1007 | 1005 | |
| 1008 | | int vc1541_serial_clock_read (int which) |
| 1006 | int vc1541_serial_clock_read( running_machine *machine, int which ) |
| 1009 | 1007 | { |
| 1008 | /* there is no more cpu_getactivecpu! */ |
| 1010 | 1009 | #ifdef CPU_SYNC |
| 1011 | 1010 | if (cpu_getactivecpu()==0) cpu_sync(); |
| 1012 | 1011 | #endif |
| 1013 | 1012 | return serial.clock[0]; |
| 1014 | 1013 | } |
| 1015 | 1014 | |
| 1016 | | void vc1541_serial_clock_write (int which, int level) |
| 1015 | void vc1541_serial_clock_write( running_machine *machine, int which, int level ) |
| 1017 | 1016 | { |
| 1018 | 1017 | if (serial.clock[1 + which] != level) |
| 1019 | 1018 | { |
| 1019 | /* there is no more cpu_getactivecpu! */ |
| 1020 | 1020 | #ifdef CPU_SYNC |
| 1021 | 1021 | if (cpu_getactivecpu()==0) cpu_sync(); |
| 1022 | 1022 | #endif |
| r4769 | r4770 | |
| 1026 | 1026 | serial.clock[0] = serial.clock[1] && serial.clock[2]; |
| 1027 | 1027 | if (serial.clock[0] == level) |
| 1028 | 1028 | { |
| 1029 | | /* DBG_LOG(1, "vc1541",("%d:%.4x clock %s\n", |
| 1029 | /* DBG_LOG(machine, 1, "vc1541",("%d:%.4x clock %s\n", |
| 1030 | 1030 | cpu_getactivecpu (), |
| 1031 | 1031 | activecpu_get_pc(), |
| 1032 | 1032 | serial.clock[0]?"CLOCK":"clock"));*/ |
| r4769 | r4770 | |
| 1035 | 1035 | } |
| 1036 | 1036 | } |
| 1037 | 1037 | |
| 1038 | | int vc1541_serial_request_read (int which) |
| 1038 | int vc1541_serial_request_read( running_machine *machine, int which ) |
| 1039 | 1039 | { |
| 1040 | 1040 | return 1; |
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | | void vc1541_serial_request_write (int which, int level) |
| 1043 | void vc1541_serial_request_write( running_machine *machine, int which, int level ) |
| 1044 | 1044 | { |
| 1045 | 1045 | } |
| 1046 | 1046 | |
| r4769 | r4770 | |
| 1053 | 1053 | |
| 1054 | 1054 | static ADDRESS_MAP_START( _1571_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1055 | 1055 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 1056 | | AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("via6522_2", via_r, via_w) /* 0 and 1 used in vc20 */ |
| 1056 | AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w) /* 0 and 1 used in vc20 */ |
| 1057 | 1057 | AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP) /* for debugger */ |
| 1058 | | AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("via6522_3", via_r, via_w) |
| 1058 | AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w) |
| 1059 | 1059 | AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP) /* for debugger */ |
| 1060 | 1060 | // AM_RANGE(0x2000, 0x2003) // WD17xx |
| 1061 | 1061 | // AM_RANGE(0x4000, 0x400f) // CIA |
| r4769 | r4770 | |
| 1100 | 1100 | */ |
| 1101 | 1101 | static TIMER_CALLBACK(c1551_irq_timer) |
| 1102 | 1102 | { |
| 1103 | | cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_IRQ_LINE, ASSERT_LINE); |
| 1103 | cputag_set_input_line(machine, drive->cputag, M6502_IRQ_LINE, ASSERT_LINE); |
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | /* |
| r4769 | r4770 | |
| 1113 | 1113 | 7: input byte ready |
| 1114 | 1114 | */ |
| 1115 | 1115 | |
| 1116 | | static WRITE8_HANDLER ( c1551_port_w ) |
| 1116 | static WRITE8_HANDLER( c1551_port_w ) |
| 1117 | 1117 | { |
| 1118 | | running_machine *machine = space->machine; |
| 1119 | 1118 | if (offset) |
| 1120 | 1119 | { |
| 1121 | | DBG_LOG(1, "c1551 port",("write %.2x\n", data)); |
| 1120 | DBG_LOG(space->machine, 1, "c1551 port",("write %.2x\n", data)); |
| 1122 | 1121 | drive->drive.c1551.cpu_port = data; |
| 1123 | 1122 | |
| 1124 | 1123 | if (data != old) |
| 1125 | 1124 | { |
| 1126 | | DBG_LOG(1, "vc1541 drive",("%.2x\n", data)); |
| 1125 | DBG_LOG(space->machine, 1, "vc1541 drive",("%.2x\n", data)); |
| 1127 | 1126 | |
| 1128 | 1127 | if ((old & 0x03) != (data & 0x03)) |
| 1129 | 1128 | { |
| r4769 | r4770 | |
| 1191 | 1190 | else |
| 1192 | 1191 | { |
| 1193 | 1192 | drive->drive.c1551.cpu_ddr = data; |
| 1194 | | DBG_LOG(1, "c1551 ddr", ("write %.2x\n", data)); |
| 1193 | DBG_LOG(space->machine, 1, "c1551 ddr", ("write %.2x\n", data)); |
| 1195 | 1194 | } |
| 1196 | 1195 | } |
| 1197 | 1196 | |
| 1198 | | static READ8_HANDLER ( c1551_port_r ) |
| 1197 | static READ8_HANDLER( c1551_port_r ) |
| 1199 | 1198 | { |
| 1200 | | running_machine *machine = space->machine; |
| 1201 | 1199 | int data; |
| 1202 | 1200 | |
| 1203 | 1201 | if (offset) |
| r4769 | r4770 | |
| 1215 | 1213 | |
| 1216 | 1214 | data &= ~drive->drive.c1551.cpu_ddr; |
| 1217 | 1215 | data |= drive->drive.c1551.cpu_ddr & drive->drive.c1551.cpu_port; |
| 1218 | | DBG_LOG(3, "c1551 port",("read %.2x\n", data)); |
| 1216 | DBG_LOG(space->machine, 3, "c1551 port",("read %.2x\n", data)); |
| 1219 | 1217 | } |
| 1220 | 1218 | else |
| 1221 | 1219 | { |
| 1222 | 1220 | data = drive->drive.c1551.cpu_ddr; |
| 1223 | | DBG_LOG(3, "c1551 ddr",("read %.2x\n", data)); |
| 1221 | DBG_LOG(space->machine, 3, "c1551 ddr",("read %.2x\n", data)); |
| 1224 | 1222 | } |
| 1225 | 1223 | return data; |
| 1226 | 1224 | } |
| r4769 | r4770 | |
| 1255 | 1253 | |
| 1256 | 1254 | static READ8_DEVICE_HANDLER( c1551_port_b_r ) |
| 1257 | 1255 | { |
| 1258 | | running_machine *machine = device->machine; |
| 1259 | 1256 | int data = drive->gcr.data[drive->pos]; |
| 1260 | | DBG_LOG(2, "c1551 drive",("port a read %.2x\n", data)); |
| 1257 | |
| 1258 | DBG_LOG(device->machine, 2, "c1551 drive",("port a read %.2x\n", data)); |
| 1261 | 1259 | return data; |
| 1262 | 1260 | } |
| 1263 | 1261 | |
| r4769 | r4770 | |
| 1272 | 1270 | |
| 1273 | 1271 | WRITE8_DEVICE_HANDLER( c1551x_write_data ) |
| 1274 | 1272 | { |
| 1275 | | // DBG_LOG(1, "c1551 cpu", ("%d write data %.2x\n", cpu_getactivecpu (), data)); |
| 1273 | // DBG_LOG(device->machine, 1, "c1551 cpu", ("%d write data %.2x\n", cpu_getactivecpu (), data)); |
| 1276 | 1274 | #ifdef CPU_SYNC |
| 1277 | 1275 | cpu_sync(); |
| 1278 | 1276 | #endif |
| r4769 | r4770 | |
| 1287 | 1285 | #endif |
| 1288 | 1286 | |
| 1289 | 1287 | data = tpi6525_porta_r(device, 0); |
| 1290 | | // DBG_LOG(2, "c1551 cpu",("%d read data %.2x\n", cpu_getactivecpu (), data)); |
| 1288 | // DBG_LOG(device->machine, 2, "c1551 cpu",("%d read data %.2x\n", cpu_getactivecpu (), data)); |
| 1291 | 1289 | return data; |
| 1292 | 1290 | } |
| 1293 | 1291 | |
| 1294 | 1292 | WRITE8_DEVICE_HANDLER( c1551x_write_handshake ) |
| 1295 | 1293 | { |
| 1296 | | // DBG_LOG(1, "c1551 cpu",("%d write handshake %.2x\n", cpu_getactivecpu (), data)); |
| 1294 | // DBG_LOG(device->machine, 1, "c1551 cpu",("%d write handshake %.2x\n", cpu_getactivecpu (), data)); |
| 1297 | 1295 | #ifdef CPU_SYNC |
| 1298 | 1296 | cpu_sync(); |
| 1299 | 1297 | #endif |
| r4769 | r4770 | |
| 1309 | 1307 | #endif |
| 1310 | 1308 | |
| 1311 | 1309 | data = tpi6525_portc_r(device, 0) & 0x08 ? 0x80 : 0x00; |
| 1312 | | // DBG_LOG(2, "c1551 cpu",("%d read handshake %.2x\n", cpu_getactivecpu (), data)); |
| 1310 | // DBG_LOG(device->machine, 2, "c1551 cpu",("%d read handshake %.2x\n", cpu_getactivecpu (), data)); |
| 1313 | 1311 | return data; |
| 1314 | 1312 | } |
| 1315 | 1313 | |
| r4769 | r4770 | |
| 1321 | 1319 | #endif |
| 1322 | 1320 | |
| 1323 | 1321 | data = tpi6525_portc_r(device, 0) & 0x03; |
| 1324 | | // DBG_LOG(1, "c1551 cpu",("%d read status %.2x\n", cpu_getactivecpu (), data)); |
| 1322 | // DBG_LOG(device->machine, 1, "c1551 cpu",("%d read status %.2x\n", cpu_getactivecpu (), data)); |
| 1325 | 1323 | |
| 1326 | 1324 | return data; |
| 1327 | 1325 | } |
| r4769 | r4770 | |
| 1333 | 1331 | |
| 1334 | 1332 | **************************************/ |
| 1335 | 1333 | |
| 1336 | | int drive_config (running_machine *machine, int type, int id, int mode, int cpunr, int devicenr) |
| 1334 | int drive_config( running_machine *machine, int type, int id, int mode, const char *cputag, int devicenr ) |
| 1337 | 1335 | { |
| 1338 | 1336 | drive->type = type; |
| 1339 | | drive->cpunumber = cpunr; |
| 1337 | drive->cputag = cputag; |
| 1340 | 1338 | drive->drive.serial.deviceid = devicenr; |
| 1341 | 1339 | drive->timer = timer_alloc(machine, drive_timer, NULL); |
| 1342 | 1340 | |
| r4769 | r4770 | |
| 1390 | 1388 | MACHINE_DRIVER_START( cpu_vc1540 ) |
| 1391 | 1389 | MDRV_CPU_ADD("cpu_vc1540", M6502, XTAL_16_MHz / 16) |
| 1392 | 1390 | MDRV_CPU_PROGRAM_MAP(_1541_map) |
| 1391 | |
| 1392 | MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0) |
| 1393 | MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1) |
| 1393 | 1394 | MACHINE_DRIVER_END |
| 1394 | 1395 | |
| 1395 | 1396 | MACHINE_DRIVER_START( cpu_vc1541 ) |
| r4769 | r4770 | |
| 1416 | 1417 | MACHINE_DRIVER_START( cpu_c1571 ) |
| 1417 | 1418 | MDRV_CPU_ADD("cpu_vc1540", M6502, XTAL_16_MHz / 16) |
| 1418 | 1419 | MDRV_CPU_PROGRAM_MAP(_1571_map) |
| 1420 | |
| 1421 | MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0) |
| 1422 | MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1) |
| 1419 | 1423 | MACHINE_DRIVER_END |
| 1420 | 1424 | |
| 1421 | 1425 | |
src/mess/machine/vc20.c
| r4769 | r4770 | |
| 351 | 351 | 6 ndac in |
| 352 | 352 | 7 atn in |
| 353 | 353 | */ |
| 354 | | static READ8_DEVICE_HANDLER( vc20_via4_read_portb ) |
| 354 | static READ8_DEVICE_HANDLER( vc20_via2_read_portb ) |
| 355 | 355 | { |
| 356 | 356 | UINT8 data = 0; |
| 357 | 357 | if (cbm_ieee_eoi_r(device->machine)) data |= 0x08; |
| r4769 | r4770 | |
| 362 | 362 | return data; |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | | static WRITE8_DEVICE_HANDLER( vc20_via4_write_portb ) |
| 365 | static WRITE8_DEVICE_HANDLER( vc20_via2_write_portb ) |
| 366 | 366 | { |
| 367 | 367 | cbm_ieee_dav_w(device->machine, 0, data & 0x01); |
| 368 | 368 | cbm_ieee_nrfd_w(device->machine, 0, data & 0x02); |
| r4769 | r4770 | |
| 376 | 376 | cb2 eoi out |
| 377 | 377 | ca2 atn out |
| 378 | 378 | */ |
| 379 | | static WRITE8_DEVICE_HANDLER( vc20_via5_write_porta ) |
| 379 | static WRITE8_DEVICE_HANDLER( vc20_via3_write_porta ) |
| 380 | 380 | { |
| 381 | 381 | cbm_ieee_data_w(device->machine, 0, data); |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | | static READ8_DEVICE_HANDLER( vc20_via5_read_portb ) |
| 384 | static READ8_DEVICE_HANDLER( vc20_via3_read_portb ) |
| 385 | 385 | { |
| 386 | 386 | return cbm_ieee_data_r(device->machine); |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | | static WRITE8_DEVICE_HANDLER( vc20_via5_write_ca2 ) |
| 389 | static WRITE8_DEVICE_HANDLER( vc20_via3_write_ca2 ) |
| 390 | 390 | { |
| 391 | 391 | cbm_ieee_atn_w(device->machine, 0, data); |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | | static READ8_DEVICE_HANDLER( vc20_via5_read_cb1 ) |
| 394 | static READ8_DEVICE_HANDLER( vc20_via3_read_cb1 ) |
| 395 | 395 | { |
| 396 | 396 | return cbm_ieee_srq_r(device->machine); |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | | static WRITE8_DEVICE_HANDLER( vc20_via5_write_cb2 ) |
| 399 | static WRITE8_DEVICE_HANDLER( vc20_via3_write_cb2 ) |
| 400 | 400 | { |
| 401 | 401 | cbm_ieee_eoi_w(device->machine, 0, data); |
| 402 | 402 | } |
| r4769 | r4770 | |
| 416 | 416 | DEVCB_HANDLER(vc20_via0_write_ca2), |
| 417 | 417 | DEVCB_NULL, /*via0_write_cb2, */ |
| 418 | 418 | DEVCB_LINE(vc20_via0_irq) |
| 419 | | }, vc20_via1 = |
| 419 | }, |
| 420 | |
| 421 | vc20_via1 = |
| 420 | 422 | { |
| 421 | 423 | DEVCB_HANDLER(vc20_via1_read_porta), |
| 422 | 424 | DEVCB_HANDLER(vc20_via1_read_portb), |
| r4769 | r4770 | |
| 432 | 434 | DEVCB_HANDLER(vc20_via1_write_cb2), |
| 433 | 435 | DEVCB_LINE(vc20_via1_irq) |
| 434 | 436 | }, |
| 435 | | /* via2,3 used by vc1541 and 2031 disk drives */ |
| 436 | | vc20_via4 = |
| 437 | |
| 438 | vc20_via2 = |
| 437 | 439 | { |
| 438 | | DEVCB_NULL, /*vc20_via4_read_porta, */ |
| 439 | | DEVCB_HANDLER(vc20_via4_read_portb), |
| 440 | | DEVCB_NULL, /*vc20_via4_read_ca1, */ |
| 441 | | DEVCB_NULL, /*vc20_via5_read_cb1, */ |
| 440 | DEVCB_NULL, /*vc20_via2_read_porta, */ |
| 441 | DEVCB_HANDLER(vc20_via2_read_portb), |
| 442 | DEVCB_NULL, /*vc20_via2_read_ca1, */ |
| 443 | DEVCB_NULL, /*vc20_via2_read_cb1, */ |
| 442 | 444 | DEVCB_NULL, /* via1_read_ca2 */ |
| 443 | 445 | DEVCB_NULL, /*via1_read_cb2, */ |
| 444 | 446 | DEVCB_NULL, /*via1_write_porta, */ |
| 445 | | DEVCB_HANDLER(vc20_via4_write_portb), |
| 447 | DEVCB_HANDLER(vc20_via2_write_portb), |
| 446 | 448 | DEVCB_NULL, /*via0_write_ca1, */ |
| 447 | 449 | DEVCB_NULL, /*via0_write_cb1, */ |
| 448 | | DEVCB_NULL, /*vc20_via5_write_ca2, */ |
| 449 | | DEVCB_NULL, /*vc20_via5_write_cb2, */ |
| 450 | DEVCB_NULL, /*vc20_via2_write_ca2, */ |
| 451 | DEVCB_NULL, /*vc20_via2_write_cb2, */ |
| 450 | 452 | DEVCB_LINE(vc20_via1_irq) |
| 451 | | }, vc20_via5 = |
| 453 | }, |
| 454 | |
| 455 | vc20_via3 = |
| 452 | 456 | { |
| 453 | | DEVCB_NULL,/*vc20_via5_read_porta, */ |
| 454 | | DEVCB_HANDLER(vc20_via5_read_portb), |
| 455 | | DEVCB_NULL, /*vc20_via5_read_ca1, */ |
| 456 | | DEVCB_HANDLER(vc20_via5_read_cb1), |
| 457 | DEVCB_NULL,/*vc20_via3_read_porta, */ |
| 458 | DEVCB_HANDLER(vc20_via3_read_portb), |
| 459 | DEVCB_NULL, /*vc20_via3_read_ca1, */ |
| 460 | DEVCB_HANDLER(vc20_via3_read_cb1), |
| 457 | 461 | DEVCB_NULL, /*via1_read_ca2, */ |
| 458 | 462 | DEVCB_NULL, /*via1_read_cb2, */ |
| 459 | | DEVCB_HANDLER(vc20_via5_write_porta), |
| 460 | | DEVCB_NULL,/*vc20_via5_write_portb, */ |
| 463 | DEVCB_HANDLER(vc20_via3_write_porta), |
| 464 | DEVCB_NULL,/*vc20_via3_write_portb, */ |
| 461 | 465 | DEVCB_NULL, /*via0_write_ca1, */ |
| 462 | 466 | DEVCB_NULL, /*via0_write_cb1, */ |
| 463 | | DEVCB_HANDLER(vc20_via5_write_ca2), |
| 464 | | DEVCB_HANDLER(vc20_via5_write_cb2), |
| 467 | DEVCB_HANDLER(vc20_via3_write_ca2), |
| 468 | DEVCB_HANDLER(vc20_via3_write_cb2), |
| 465 | 469 | DEVCB_LINE(vc20_via1_irq) |
| 466 | 470 | }; |
| 467 | 471 | |
| r4769 | r4770 | |
| 485 | 489 | |
| 486 | 490 | WRITE8_HANDLER( vc20_0400_w ) |
| 487 | 491 | { |
| 488 | | if ( mess_ram_size >= 8 * 1024 ) |
| 492 | if (mess_ram_size >= 8 * 1024) |
| 489 | 493 | { |
| 490 | | mess_ram[ 0x0400 + offset ] = data; |
| 494 | mess_ram[0x0400 + offset] = data; |
| 491 | 495 | } |
| 492 | 496 | } |
| 493 | 497 | |
| 494 | 498 | WRITE8_HANDLER( vc20_2000_w ) |
| 495 | 499 | { |
| 496 | | if ( ( mess_ram_size >= 16 * 1024 ) && vc20_rom_2000 == NULL ) |
| 500 | if ((mess_ram_size >= 16 * 1024) && vc20_rom_2000 == NULL) |
| 497 | 501 | { |
| 498 | | mess_ram[ 0x2000 + offset ] = data; |
| 502 | mess_ram[0x2000 + offset] = data; |
| 499 | 503 | } |
| 500 | 504 | } |
| 501 | 505 | |
| 502 | 506 | WRITE8_HANDLER( vc20_4000_w ) |
| 503 | 507 | { |
| 504 | | if ( ( mess_ram_size >= 24 * 1024 ) && vc20_rom_4000 == NULL ) |
| 508 | if ((mess_ram_size >= 24 * 1024) && vc20_rom_4000 == NULL) |
| 505 | 509 | { |
| 506 | | mess_ram[ 0x4000 + offset ] = data; |
| 510 | mess_ram[0x4000 + offset] = data; |
| 507 | 511 | } |
| 508 | 512 | } |
| 509 | 513 | |
| 510 | 514 | WRITE8_HANDLER( vc20_6000_w ) |
| 511 | 515 | { |
| 512 | | if ( ( mess_ram_size >= 32 * 1024 ) && vc20_rom_6000 == NULL ) |
| 516 | if ((mess_ram_size >= 32 * 1024) && vc20_rom_6000 == NULL) |
| 513 | 517 | { |
| 514 | | mess_ram[ 0x6000 + offset ] = data; |
| 518 | mess_ram[0x6000 + offset] = data; |
| 515 | 519 | } |
| 516 | 520 | } |
| 517 | 521 | |
| r4769 | r4770 | |
| 538 | 542 | /* 2114 poweron ? 64 x 0xff, 64x 0, and so on */ |
| 539 | 543 | for (i = 0; i < 0x400; i += 0x40) |
| 540 | 544 | { |
| 541 | | memset (memory + i, i & 0x40 ? 0 : 0xff, 0x40); |
| 542 | | memset (memory + 0x9400 + i, 0xf0 | (i & 0x40 ? 0 : 0xf), 0x40); |
| 545 | memset(memory + i, i & 0x40 ? 0 : 0xff, 0x40); |
| 546 | memset(memory + 0x9400 + i, 0xf0 | (i & 0x40 ? 0 : 0xf), 0x40); |
| 543 | 547 | } |
| 544 | 548 | // this would be the straight forward memory init for |
| 545 | 549 | // non cost reduced vic20 (2114 rams) |
| r4769 | r4770 | |
| 548 | 552 | #endif |
| 549 | 553 | |
| 550 | 554 | /* clears ieee cartrige rom */ |
| 551 | | /* memset (memory + 0xa000, 0xff, 0x2000); */ |
| 555 | /* memset(memory + 0xa000, 0xff, 0x2000); */ |
| 552 | 556 | |
| 553 | 557 | inited = 1; |
| 554 | 558 | } |
| r4769 | r4770 | |
| 561 | 565 | via_ca1_w(via_1, 0, data); |
| 562 | 566 | } |
| 563 | 567 | |
| 564 | | static void vc20_common_driver_init (running_machine *machine) |
| 568 | static void vc20_common_driver_init( running_machine *machine ) |
| 565 | 569 | { |
| 566 | 570 | vc20_memory_init(machine); |
| 567 | 571 | |
| 568 | 572 | datasette_timer = timer_alloc(machine, vic20_tape_timer, NULL); |
| 569 | 573 | |
| 570 | 574 | if (has_vc1541) |
| 571 | | drive_config (machine, type_1541, 0, 0, 1, 8); |
| 575 | drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8); |
| 572 | 576 | } |
| 573 | 577 | |
| 574 | 578 | DRIVER_INIT( vc20 ) |
| 575 | 579 | { |
| 576 | | vc20_common_driver_init (machine); |
| 577 | | vic6561_init (vic6560_dma_read, vic6560_dma_read_color); |
| 580 | vc20_common_driver_init(machine); |
| 581 | vic6561_init(vic6560_dma_read, vic6560_dma_read_color); |
| 578 | 582 | } |
| 579 | 583 | |
| 580 | 584 | DRIVER_INIT( vic20 ) |
| 581 | 585 | { |
| 582 | | vc20_common_driver_init (machine); |
| 583 | | vic6560_init (vic6560_dma_read, vic6560_dma_read_color); |
| 586 | vc20_common_driver_init(machine); |
| 587 | vic6560_init(vic6560_dma_read, vic6560_dma_read_color); |
| 584 | 588 | } |
| 585 | 589 | |
| 586 | 590 | DRIVER_INIT( vic1001 ) |
| r4769 | r4770 | |
| 591 | 595 | DRIVER_INIT( vc20v ) |
| 592 | 596 | { |
| 593 | 597 | has_vc1541 = 1; |
| 594 | | vc20_common_driver_init (machine); |
| 595 | | vic6561_init (vic6560_dma_read, vic6560_dma_read_color); |
| 598 | vc20_common_driver_init(machine); |
| 599 | vic6561_init(vic6560_dma_read, vic6560_dma_read_color); |
| 596 | 600 | } |
| 597 | 601 | |
| 598 | 602 | DRIVER_INIT( vic20v ) |
| 599 | 603 | { |
| 600 | 604 | has_vc1541 = 1; |
| 601 | | vc20_common_driver_init (machine); |
| 602 | | vic6560_init (vic6560_dma_read, vic6560_dma_read_color); |
| 605 | vc20_common_driver_init(machine); |
| 606 | vic6560_init(vic6560_dma_read, vic6560_dma_read_color); |
| 603 | 607 | } |
| 604 | 608 | |
| 605 | 609 | DRIVER_INIT( vic20i ) |
| 606 | 610 | { |
| 607 | 611 | ieee = 1; |
| 608 | | vc20_common_driver_init (machine); |
| 609 | | vic6560_init (vic6560_dma_read, vic6560_dma_read_color); |
| 612 | vc20_common_driver_init(machine); |
| 613 | vic6560_init(vic6560_dma_read, vic6560_dma_read_color); |
| 610 | 614 | cbm_ieee_open(); |
| 611 | 615 | } |
| 612 | 616 | |
| r4769 | r4770 | |
| 617 | 621 | if (has_vc1541) |
| 618 | 622 | { |
| 619 | 623 | cbm_serial_config(machine, &cbm_fake_drive_interface); |
| 620 | | drive_reset (); |
| 624 | drive_reset(); |
| 621 | 625 | } |
| 622 | 626 | else |
| 623 | 627 | { |
| 624 | 628 | cbm_serial_config(machine, &cbm_sim_drive_interface); |
| 625 | | cbm_serial_reset_write (machine, 0); |
| 629 | cbm_serial_reset_write(machine, 0); |
| 626 | 630 | |
| 627 | 631 | if (ieee) |
| 628 | 632 | { |
| 629 | | cbm_drive_0_config (IEEE, 8); |
| 630 | | cbm_drive_1_config (IEEE, 9); |
| 633 | cbm_drive_0_config(IEEE, 8); |
| 634 | cbm_drive_1_config(IEEE, 9); |
| 631 | 635 | } |
| 632 | 636 | else |
| 633 | 637 | { |
| 634 | | cbm_drive_0_config (SERIAL, 8); |
| 635 | | cbm_drive_1_config (SERIAL, 9); |
| 638 | cbm_drive_0_config(SERIAL, 8); |
| 639 | cbm_drive_1_config(SERIAL, 9); |
| 636 | 640 | } |
| 637 | 641 | } |
| 638 | 642 | |
src/mess/drivers/c64.c
| r4769 | r4770 | |
| 494 | 494 | MDRV_QUANTUM_TIME(HZ(60)) |
| 495 | 495 | |
| 496 | 496 | MDRV_MACHINE_START( c64 ) |
| 497 | MDRV_MACHINE_RESET( c64 ) |
| 497 | 498 | |
| 498 | 499 | /* video hardware */ |
| 499 | 500 | MDRV_IMPORT_FROM( vh_vic2 ) |
| r4769 | r4770 | |
| 519 | 520 | MDRV_CIA6526_ADD("cia_0", CIA6526R1, VIC6567_CLOCK, c64_ntsc_cia0) |
| 520 | 521 | MDRV_CIA6526_ADD("cia_1", CIA6526R1, VIC6567_CLOCK, c64_ntsc_cia1) |
| 521 | 522 | |
| 522 | | /* via */ |
| 523 | | MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2) |
| 524 | | MDRV_VIA6522_ADD("via6522_3", 0, vc1541_via3) |
| 525 | | |
| 526 | 523 | MDRV_IMPORT_FROM(c64_cartslot) |
| 527 | 524 | MACHINE_DRIVER_END |
| 528 | 525 | |
| r4769 | r4770 | |
| 535 | 532 | MDRV_QUANTUM_TIME(HZ(50)) |
| 536 | 533 | |
| 537 | 534 | MDRV_MACHINE_START( c64 ) |
| 535 | MDRV_MACHINE_RESET( c64 ) |
| 538 | 536 | |
| 539 | 537 | /* video hardware */ |
| 540 | 538 | MDRV_IMPORT_FROM( vh_vic2_pal ) |
| r4769 | r4770 | |
| 594 | 592 | |
| 595 | 593 | static MACHINE_DRIVER_START( sx64 ) |
| 596 | 594 | MDRV_IMPORT_FROM( c64pal ) |
| 595 | |
| 597 | 596 | MDRV_IMPORT_FROM( cpu_vc1541 ) |
| 598 | 597 | MDRV_SOUND_REMOVE( "dac" ) |
| 599 | 598 | MDRV_CASSETTE_REMOVE( "cassette" ) |
| r4769 | r4770 | |
| 602 | 601 | #else |
| 603 | 602 | MDRV_QUANTUM_TIME(HZ(180000)) |
| 604 | 603 | #endif |
| 605 | | MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2) |
| 606 | | MDRV_VIA6522_ADD("via6522_3", 0, vc1541_via3) |
| 607 | 604 | MACHINE_DRIVER_END |
| 608 | 605 | |
| 609 | 606 | |
| r4769 | r4770 | |
| 616 | 613 | |
| 617 | 614 | ROM_START( max ) |
| 618 | 615 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 616 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 619 | 617 | ROM_END |
| 620 | 618 | |
| 621 | 619 | ROM_START( c64 ) |
| r4769 | r4770 | |
| 628 | 626 | ROM_SYSTEM_BIOS(2, "rev2", "Kernal rev. 2" ) |
| 629 | 627 | ROMX_LOAD( "901227-02.bin", 0x12000, 0x2000, CRC(a5c687b3) SHA1(0e2e4ee3f2d41f00bed72f9ab588b83e306fdb13), ROM_BIOS(3) ) // Kernal |
| 630 | 628 | ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) ) // Character |
| 629 | |
| 630 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 631 | 631 | ROM_END |
| 632 | 632 | |
| 633 | 633 | #define rom_c64pal rom_c64 |
| r4769 | r4770 | |
| 637 | 637 | ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) ) |
| 638 | 638 | ROM_LOAD( "906145-02.bin", 0x12000, 0x2000, CRC(3a9ef6f1) SHA1(4ff0f11e80f4b57430d8f0c3799ed0f0e0f4565d) ) |
| 639 | 639 | ROM_LOAD( "906143-02.bin", 0x14000, 0x1000, CRC(1604f6c1) SHA1(0fad19dbcdb12461c99657b2979dbb5c2e47b527) ) |
| 640 | |
| 641 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 640 | 642 | ROM_END |
| 641 | 643 | |
| 642 | 644 | |
| r4769 | r4770 | |
| 648 | 650 | ROMX_LOAD( "charswe.bin",0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a), ROM_BIOS(1) ) |
| 649 | 651 | ROM_SYSTEM_BIOS(1, "alt", "Swedish Characters (Alt)" ) |
| 650 | 652 | ROMX_LOAD( "charswe2.bin",0x14000, 0x1000, CRC(377a382b) SHA1(20df25e0ba1c88f31689c1521397c96968967fac), ROM_BIOS(2) ) |
| 653 | |
| 654 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 651 | 655 | ROM_END |
| 652 | 656 | |
| 653 | 657 | #define rom_c64swe rom_vic64s |
| r4769 | r4770 | |
| 657 | 661 | ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) ) |
| 658 | 662 | ROM_LOAD( "901246-01.bin", 0x12000, 0x2000, CRC(789c8cc5) SHA1(6c4fa9465f6091b174df27dfe679499df447503c) ) |
| 659 | 663 | ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) ) |
| 664 | |
| 665 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 660 | 666 | ROM_END |
| 661 | 667 | |
| 662 | 668 | #define rom_cbm4064 rom_pet64 |
| r4769 | r4770 | |
| 668 | 674 | ROM_LOAD( "251104-04.bin", 0x12000, 0x2000, CRC(2c5965d4) SHA1(aa136e91ecf3c5ac64f696b3dbcbfc5ba0871c98) ) |
| 669 | 675 | ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) ) |
| 670 | 676 | |
| 677 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 678 | |
| 671 | 679 | VC1541_ROM( "cpu_vc1540" ) |
| 672 | 680 | ROM_END |
| 673 | 681 | |
| r4769 | r4770 | |
| 676 | 684 | ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) ) |
| 677 | 685 | ROM_LOAD( "dx64kern.bin", 0x12000, 0x2000, CRC(58065128) ) |
| 678 | 686 | |
| 687 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 688 | |
| 679 | 689 | // vc1541 roms were not included in submission |
| 680 | 690 | VC1541_ROM ("cpu_vc1540") |
| 681 | 691 | // VC1541_ROM (" ") |
| r4769 | r4770 | |
| 687 | 697 | ROM_LOAD( "kernelsx.swe", 0x12000, 0x2000, CRC(7858d3d7) SHA1(097cda60469492a8916c2677b7cce4e12a944bc0) ) |
| 688 | 698 | ROM_LOAD( "charswe.bin", 0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a) ) |
| 689 | 699 | |
| 700 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 701 | |
| 690 | 702 | VC1541_ROM( "cpu_vc1540" ) |
| 691 | 703 | ROM_END |
| 692 | 704 | |
| r4769 | r4770 | |
| 696 | 708 | /* standard basic, modified kernel */ |
| 697 | 709 | ROM_LOAD( "251913-01.bin", 0x10000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) ) |
| 698 | 710 | ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) ) |
| 711 | |
| 712 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 699 | 713 | ROM_END |
| 700 | 714 | |
| 701 | 715 | #define rom_c64cpal rom_c64c |
| r4769 | r4770 | |
| 706 | 720 | /* standard basic, modified kernel */ |
| 707 | 721 | ROM_LOAD( "390852-01.bin", 0x10000, 0x4000, CRC(b0a9c2da) SHA1(21940ef5f1bfe67d7537164f7ca130a1095b067a) ) |
| 708 | 722 | ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) ) |
| 723 | |
| 724 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 ) |
| 709 | 725 | ROM_END |
| 710 | 726 | |
| 711 | 727 | |