src/mess/machine/dgn_beta.c
| r4574 | r4575 | |
| 268 | 268 | |
| 269 | 269 | static void UpdateBanks(running_machine *machine, int first, int last) |
| 270 | 270 | { |
| 271 | | const address_space *space_0 = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ); |
| 272 | | const address_space *space_1 = cpu_get_address_space( machine->cpu[1], ADDRESS_SPACE_PROGRAM ); |
| 271 | const address_space *space_0 = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 272 | const address_space *space_1 = cputag_get_address_space(machine, "dma", ADDRESS_SPACE_PROGRAM); |
| 273 | 273 | int Page; |
| 274 | 274 | UINT8 *readbank; |
| 275 | 275 | write8_space_func writebank; |
| r4574 | r4575 | |
| 695 | 695 | const device_config *fdc = devtag_get_device(device->machine, "wd179x"); |
| 696 | 696 | |
| 697 | 697 | /* Only play with halt line if halt bit changed since last write */ |
| 698 | | if((data & 0x80)!=d_pia1_pa_last) |
| 698 | if((data & 0x80) != d_pia1_pa_last) |
| 699 | 699 | { |
| 700 | 700 | /* Bit 7 of $FF24, seems to control HALT on second CPU (through an inverter) */ |
| 701 | 701 | if(data & 0x80) |
| 702 | | HALT_DMA=ASSERT_LINE; |
| 702 | HALT_DMA = ASSERT_LINE; |
| 703 | 703 | else |
| 704 | | HALT_DMA=CLEAR_LINE; |
| 704 | HALT_DMA = CLEAR_LINE; |
| 705 | 705 | |
| 706 | | LOG_HALT(("DMA_CPU HALT=%d\n",HALT_DMA)); |
| 707 | | cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_HALT, HALT_DMA); |
| 706 | LOG_HALT(("DMA_CPU HALT=%d\n", HALT_DMA)); |
| 707 | cputag_set_input_line(device->machine, "dma", INPUT_LINE_HALT, HALT_DMA); |
| 708 | 708 | |
| 709 | 709 | /* CPU un-halted let it run ! */ |
| 710 | | if (HALT_DMA==CLEAR_LINE) |
| 711 | | cpu_yield(device->machine->cpu[0]); |
| 710 | if (HALT_DMA == CLEAR_LINE) |
| 711 | cpu_yield(cputag_get_cpu(device->machine, "maincpu")); |
| 712 | 712 | |
| 713 | | d_pia1_pa_last=data & 0x80; |
| 713 | d_pia1_pa_last = data & 0x80; |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | /* Drive selects are binary encoded on PA0 & PA1 */ |
| 717 | | wd17xx_set_drive(fdc,~data & DSMask); |
| 717 | wd17xx_set_drive(fdc, ~data & DSMask); |
| 718 | 718 | |
| 719 | 719 | /* Set density of WD2797 */ |
| 720 | 720 | if (data & DDenCtrl) |
| 721 | 721 | { |
| 722 | | wd17xx_set_density(fdc,DEN_FM_LO); |
| 723 | | LOG_DISK(("Set density low %d\n",(data & DDenCtrl))); |
| 722 | wd17xx_set_density(fdc, DEN_FM_LO); |
| 723 | LOG_DISK(("Set density low %d\n", (data & DDenCtrl))); |
| 724 | 724 | } |
| 725 | 725 | else |
| 726 | 726 | { |
| 727 | | wd17xx_set_density(fdc,DEN_MFM_LO); |
| 728 | | LOG_DISK(("Set density high %d\n",(data & DDenCtrl))); |
| 727 | wd17xx_set_density(fdc, DEN_MFM_LO); |
| 728 | LOG_DISK(("Set density high %d\n", (data & DDenCtrl))); |
| 729 | 729 | } |
| 730 | 730 | } |
| 731 | 731 | |
| r4574 | r4575 | |
| 739 | 739 | int HALT_CPU; |
| 740 | 740 | |
| 741 | 741 | /* Only play with halt line if halt bit changed since last write */ |
| 742 | | if((data & 0x02)!=d_pia1_pb_last) |
| 742 | if((data & 0x02) != d_pia1_pb_last) |
| 743 | 743 | { |
| 744 | 744 | /* Bit 1 of $FF26, seems to control HALT on primary CPU */ |
| 745 | 745 | if(data & 0x02) |
| 746 | | HALT_CPU=CLEAR_LINE; |
| 746 | HALT_CPU = CLEAR_LINE; |
| 747 | 747 | else |
| 748 | | HALT_CPU=ASSERT_LINE; |
| 749 | | LOG_HALT(("MAIN_CPU HALT=%d\n",HALT_CPU)); |
| 750 | | cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_HALT, HALT_CPU); |
| 748 | HALT_CPU = ASSERT_LINE; |
| 749 | LOG_HALT(("MAIN_CPU HALT=%d\n", HALT_CPU)); |
| 750 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, HALT_CPU); |
| 751 | 751 | |
| 752 | | d_pia1_pb_last=data & 0x02; |
| 752 | d_pia1_pb_last = data & 0x02; |
| 753 | 753 | |
| 754 | 754 | /* CPU un-halted let it run ! */ |
| 755 | | if (HALT_CPU==CLEAR_LINE) |
| 756 | | cpu_yield(device->machine->cpu[1]); |
| 755 | if (HALT_CPU == CLEAR_LINE) |
| 756 | cpu_yield(cputag_get_cpu(device->machine, "dma")); |
| 757 | 757 | } |
| 758 | 758 | } |
| 759 | 759 | |
| r4574 | r4575 | |
| 787 | 787 | int OldEnableMap; |
| 788 | 788 | int NMI; |
| 789 | 789 | |
| 790 | | LOG_TASK(("FCC0 write : $%02X\n",data)); |
| 790 | LOG_TASK(("FCC0 write : $%02X\n", data)); |
| 791 | 791 | |
| 792 | 792 | /* Bit 7 of $FFC0, seems to control NMI on second CPU */ |
| 793 | 793 | NMI=(data & 0x80); |
| 794 | 794 | |
| 795 | 795 | /* only take action if NMI changed */ |
| 796 | | if(NMI!=DMA_NMI_LAST) |
| 796 | if(NMI != DMA_NMI_LAST) |
| 797 | 797 | { |
| 798 | | LOG_INTS(("cpu1 NMI : %d\n",NMI)); |
| 798 | LOG_INTS(("cpu1 NMI : %d\n", NMI)); |
| 799 | 799 | if(!NMI) |
| 800 | 800 | { |
| 801 | | cpu_set_input_line(device->machine->cpu[1],INPUT_LINE_NMI,ASSERT_LINE); |
| 801 | cputag_set_input_line(device->machine, "dma", INPUT_LINE_NMI, ASSERT_LINE); |
| 802 | 802 | logerror("cpu_yield()\n"); |
| 803 | | cpu_yield(device->machine->cpu[1]); /* Let DMA CPU run */ |
| 803 | cpu_yield(cputag_get_cpu(device->machine, "dma")); /* Let DMA CPU run */ |
| 804 | 804 | } |
| 805 | 805 | else |
| 806 | 806 | { |
| 807 | | cpu_set_input_line(device->machine->cpu[1],INPUT_LINE_NMI,CLEAR_LINE); |
| 807 | cputag_set_input_line(device->machine, "dma", INPUT_LINE_NMI, CLEAR_LINE); |
| 808 | 808 | } |
| 809 | 809 | |
| 810 | | DMA_NMI_LAST=NMI; /* Save it for next time */ |
| 810 | DMA_NMI_LAST = NMI; /* Save it for next time */ |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | | OldEnableMap=EnableMapRegs; |
| 813 | OldEnableMap = EnableMapRegs; |
| 814 | 814 | /* Bit 6 seems to enable memory paging */ |
| 815 | 815 | if(data & 0x40) |
| 816 | | EnableMapRegs=0; |
| 816 | EnableMapRegs = 0; |
| 817 | 817 | else |
| 818 | | EnableMapRegs=1; |
| 818 | EnableMapRegs = 1; |
| 819 | 819 | |
| 820 | 820 | /* Bits 0..3 seem to control which task register is selected */ |
| 821 | | OldTask=PIATaskReg; |
| 822 | | PIATaskReg=data & 0x0F; |
| 821 | OldTask = PIATaskReg; |
| 822 | PIATaskReg = data & 0x0F; |
| 823 | 823 | |
| 824 | | LOG_TASK(("OldTask=$%02X EnableMapRegs=%d OldEnableMap=%d\n",OldTask,EnableMapRegs,OldEnableMap)); |
| 824 | LOG_TASK(("OldTask=$%02X EnableMapRegs=%d OldEnableMap=%d\n", OldTask, EnableMapRegs, OldEnableMap)); |
| 825 | 825 | |
| 826 | 826 | // Maping was enabled or disabled, select apropreate task reg |
| 827 | 827 | // and map it in |
| 828 | | if (EnableMapRegs!=OldEnableMap) |
| 828 | if (EnableMapRegs != OldEnableMap) |
| 829 | 829 | { |
| 830 | 830 | if(EnableMapRegs) |
| 831 | 831 | { |
| 832 | | TaskReg=PIATaskReg; |
| 832 | TaskReg = PIATaskReg; |
| 833 | 833 | } |
| 834 | 834 | else |
| 835 | 835 | { |
| 836 | | TaskReg=NoPagingTask; |
| 836 | TaskReg = NoPagingTask; |
| 837 | 837 | } |
| 838 | | UpdateBanks(device->machine, 0,IOPage+1); |
| 838 | UpdateBanks(device->machine, 0, IOPage + 1); |
| 839 | 839 | } |
| 840 | 840 | else |
| 841 | 841 | { |
| 842 | 842 | // Update ram banks only if task reg changed and mapping enabled |
| 843 | | if ((PIATaskReg!=OldTask) && (EnableMapRegs)) |
| 843 | if ((PIATaskReg != OldTask) && (EnableMapRegs)) |
| 844 | 844 | { |
| 845 | | TaskReg=PIATaskReg; |
| 846 | | UpdateBanks(device->machine, 0,IOPage+1); |
| 845 | TaskReg = PIATaskReg; |
| 846 | UpdateBanks(device->machine, 0, IOPage + 1); |
| 847 | 847 | } |
| 848 | 848 | } |
| 849 | | LOG_TASK(("TaskReg=$%02X PIATaskReg=$%02X\n",TaskReg,PIATaskReg)); |
| 849 | LOG_TASK(("TaskReg=$%02X PIATaskReg=$%02X\n", TaskReg, PIATaskReg)); |
| 850 | 850 | } |
| 851 | 851 | |
| 852 | 852 | static READ8_DEVICE_HANDLER(d_pia2_pb_r) |
| r4574 | r4575 | |
| 862 | 862 | |
| 863 | 863 | static WRITE_LINE_DEVICE_HANDLER( d_pia2_irq_a ) |
| 864 | 864 | { |
| 865 | | logerror("PIA2 IRQ1 state=%02X\n",state); |
| 865 | logerror("PIA2 IRQ1 state=%02X\n", state); |
| 866 | 866 | cpu0_recalc_irq(device->machine, state); |
| 867 | 867 | } |
| 868 | 868 | |
| r4574 | r4575 | |
| 891 | 891 | else |
| 892 | 892 | IRQ = CLEAR_LINE; |
| 893 | 893 | |
| 894 | | cpu_set_input_line(machine->cpu[0], M6809_IRQ_LINE, IRQ); |
| 895 | | LOG_INTS(("cpu0 IRQ : %d\n",IRQ)); |
| 894 | cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, IRQ); |
| 895 | LOG_INTS(("cpu0 IRQ : %d\n", IRQ)); |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | 898 | static void cpu0_recalc_firq(running_machine *machine, int state) |
| r4574 | r4575 | |
| 906 | 906 | else |
| 907 | 907 | FIRQ = CLEAR_LINE; |
| 908 | 908 | |
| 909 | | cpu_set_input_line(machine->cpu[0], M6809_FIRQ_LINE, FIRQ); |
| 909 | cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, FIRQ); |
| 910 | 910 | |
| 911 | | LOG_INTS(("cpu0 FIRQ : %d\n",FIRQ)); |
| 911 | LOG_INTS(("cpu0 FIRQ : %d\n", FIRQ)); |
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | /* CPU 1 */ |
| 915 | 915 | |
| 916 | 916 | static void cpu1_recalc_firq(running_machine *machine, int state) |
| 917 | 917 | { |
| 918 | | cpu_set_input_line(machine->cpu[1], M6809_FIRQ_LINE, state); |
| 918 | cputag_set_input_line(machine, "dma", M6809_FIRQ_LINE, state); |
| 919 | 919 | LOG_INTS(("cpu1 FIRQ : %d\n",state)); |
| 920 | 920 | } |
| 921 | 921 | |
| r4574 | r4575 | |
| 1080 | 1080 | system_rom = memory_region(machine, "maincpu"); |
| 1081 | 1081 | |
| 1082 | 1082 | /* Make sure CPU 1 is started out halted ! */ |
| 1083 | | cpu_set_input_line(machine->cpu[1], INPUT_LINE_HALT, ASSERT_LINE); |
| 1083 | cputag_set_input_line(machine, "dma", INPUT_LINE_HALT, ASSERT_LINE); |
| 1084 | 1084 | |
| 1085 | 1085 | /* Reset to task 0, and map banks disabled, so standard memory map */ |
| 1086 | 1086 | /* with ram at $0000-$BFFF, ROM at $C000-FBFF, IO at $FC00-$FEFF */ |
| 1087 | 1087 | /* and ROM at $FF00-$FFFF */ |
| 1088 | | TaskReg=0; |
| 1089 | | PIATaskReg=0; |
| 1090 | | EnableMapRegs=0; |
| 1091 | | memset(PageRegs,0,sizeof(PageRegs)); /* Reset page registers to 0 */ |
| 1088 | TaskReg = 0; |
| 1089 | PIATaskReg = 0; |
| 1090 | EnableMapRegs = 0; |
| 1091 | memset(PageRegs, 0, sizeof(PageRegs)); /* Reset page registers to 0 */ |
| 1092 | 1092 | SetDefaultTask(machine); |
| 1093 | 1093 | |
| 1094 | 1094 | /* Set pullups on all PIA port A, to match what hardware does */ |
| 1095 | | pia6821_set_port_a_z_mask(pia_0,0xFF); |
| 1096 | | pia6821_set_port_a_z_mask(pia_1,0xFF); |
| 1097 | | pia6821_set_port_a_z_mask(pia_2,0xFF); |
| 1095 | pia6821_set_port_a_z_mask(pia_0, 0xFF); |
| 1096 | pia6821_set_port_a_z_mask(pia_1, 0xFF); |
| 1097 | pia6821_set_port_a_z_mask(pia_2, 0xFF); |
| 1098 | 1098 | |
| 1099 | | d_pia1_pa_last=0x00; |
| 1100 | | d_pia1_pb_last=0x00; |
| 1101 | | RowShifter=0x00; /* shift register to select row */ |
| 1102 | | Keyrow=0x00; /* Keyboard row being shifted out */ |
| 1103 | | d_pia0_pb_last=0x00; /* Last byte output to pia0 port b */ |
| 1104 | | d_pia0_cb2_last=0x00; /* Last state of CB2 */ |
| 1099 | d_pia1_pa_last = 0x00; |
| 1100 | d_pia1_pb_last = 0x00; |
| 1101 | RowShifter = 0x00; /* shift register to select row */ |
| 1102 | Keyrow = 0x00; /* Keyboard row being shifted out */ |
| 1103 | d_pia0_pb_last = 0x00; /* Last byte output to pia0 port b */ |
| 1104 | d_pia0_cb2_last = 0x00; /* Last state of CB2 */ |
| 1105 | 1105 | |
| 1106 | | KInDat_next=0x00; /* Next data bit to input */ |
| 1107 | | KAny_next=0x00; /* Next value for KAny */ |
| 1106 | KInDat_next = 0x00; /* Next data bit to input */ |
| 1107 | KAny_next = 0x00; /* Next value for KAny */ |
| 1108 | 1108 | |
| 1109 | | DMA_NMI_LAST=0x80; /* start with DMA NMI inactive, as pulled up */ |
| 1110 | | // DMA_NMI=CLEAR_LINE; /* start with DMA NMI inactive */ |
| 1109 | DMA_NMI_LAST = 0x80; /* start with DMA NMI inactive, as pulled up */ |
| 1110 | // DMA_NMI = CLEAR_LINE; /* start with DMA NMI inactive */ |
| 1111 | 1111 | |
| 1112 | | wd17xx_set_density(fdc,DEN_MFM_LO); |
| 1113 | | wd17xx_set_drive(fdc,0); |
| 1112 | wd17xx_set_density(fdc, DEN_MFM_LO); |
| 1113 | wd17xx_set_drive(fdc, 0); |
| 1114 | 1114 | |
| 1115 | | videoram=mess_ram; /* Point video ram at the start of physical ram */ |
| 1115 | videoram = mess_ram; /* Point video ram at the start of physical ram */ |
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | |
| r4574 | r4575 | |
| 1120 | 1120 | { |
| 1121 | 1121 | dgnbeta_init_video(machine); |
| 1122 | 1122 | |
| 1123 | | debug_cpu_set_dasm_override(machine->cpu[0],dgnbeta_dasm_override); |
| 1123 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), dgnbeta_dasm_override); |
| 1124 | 1124 | |
| 1125 | 1125 | add_reset_callback(machine, dgnbeta_reset); |
| 1126 | 1126 | dgnbeta_reset(machine); |
src/mess/machine/europc.c
| r4574 | r4575 | |
| 76 | 76 | UINT8 data[16]; |
| 77 | 77 | UINT8 state; |
| 78 | 78 | AGA_MODE mode; |
| 79 | | } europc_jim= { { 0 } } ; |
| 79 | } europc_jim = { { 0 } } ; |
| 80 | 80 | |
| 81 | 81 | /* |
| 82 | 82 | 250..253 write only 00 be 00 10 |
| r4574 | r4575 | |
| 96 | 96 | */ |
| 97 | 97 | WRITE8_HANDLER ( europc_jim_w ) |
| 98 | 98 | { |
| 99 | | switch (offset) { |
| 99 | switch (offset) |
| 100 | { |
| 100 | 101 | case 2: |
| 101 | | if (!(data&0x80)) { |
| 102 | | switch (data) { |
| 102 | if (!(data & 0x80)) |
| 103 | { |
| 104 | switch (data) |
| 105 | { |
| 103 | 106 | case 0x1f: |
| 104 | | case 0x0b: europc_jim.mode=AGA_MONO; break; |
| 107 | case 0x0b: europc_jim.mode = AGA_MONO; break; |
| 105 | 108 | case 0xe: //80 columns? |
| 106 | 109 | case 0xd: //40 columns? |
| 107 | 110 | case 0x18: |
| 108 | | case 0x1a: europc_jim.mode=AGA_COLOR; break; |
| 109 | | default: europc_jim.mode=AGA_OFF; break; |
| 111 | case 0x1a: europc_jim.mode = AGA_COLOR; break; |
| 112 | default: europc_jim.mode = AGA_OFF; break; |
| 110 | 113 | } |
| 111 | 114 | } |
| 112 | 115 | // mode= data&0x10?AGA_COLOR:AGA_MONO; |
| 113 | 116 | // mode= data&0x10?AGA_COLOR:AGA_OFF; |
| 114 | | pc_aga_set_mode(space->machine,europc_jim.mode); |
| 115 | | if (data&0x80) europc_jim.state=0; |
| 117 | pc_aga_set_mode(space->machine, europc_jim.mode); |
| 118 | if (data & 0x80) europc_jim.state = 0; |
| 116 | 119 | break; |
| 117 | 120 | case 4: |
| 118 | | switch(data&0xc0) { |
| 119 | | case 0x00: cpu_set_clockscale(space->machine->cpu[0], 1.0/2);break; |
| 120 | | case 0x40: cpu_set_clockscale(space->machine->cpu[0], 3.0/4);break; |
| 121 | | default: cpu_set_clockscale(space->machine->cpu[0], 1);break; |
| 121 | switch(data & 0xc0) |
| 122 | { |
| 123 | case 0x00: cpu_set_clockscale(cputag_get_cpu(space->machine, "maincpu"), 1.0 / 2); break; |
| 124 | case 0x40: cpu_set_clockscale(cputag_get_cpu(space->machine, "maincpu"), 3.0 / 4); break; |
| 125 | default: cpu_set_clockscale(cputag_get_cpu(space->machine, "maincpu"), 1); break; |
| 122 | 126 | } |
| 123 | 127 | break; |
| 124 | 128 | case 0xa: |
| 125 | 129 | europc_rtc_w(space, 0, data); |
| 126 | 130 | return; |
| 127 | 131 | } |
| 128 | | logerror("jim write %.2x %.2x\n",offset,data); |
| 129 | | europc_jim.data[offset]=data; |
| 132 | logerror("jim write %.2x %.2x\n", offset, data); |
| 133 | europc_jim.data[offset] = data; |
| 130 | 134 | } |
| 131 | 135 | |
| 132 | 136 | READ8_HANDLER ( europc_jim_r ) |
| 133 | 137 | { |
| 134 | | int data=0; |
| 135 | | switch(offset) { |
| 136 | | case 4: case 5: case 6: case 7: data=europc_jim.data[offset];break; |
| 137 | | case 0: case 1: case 2: case 3: data=0;break; |
| 138 | int data = 0; |
| 139 | switch(offset) |
| 140 | { |
| 141 | case 4: case 5: case 6: case 7: data = europc_jim.data[offset]; break; |
| 142 | case 0: case 1: case 2: case 3: data = 0; break; |
| 138 | 143 | case 0xa: return europc_rtc_r(space, 0); |
| 139 | 144 | } |
| 140 | 145 | return data; |
| r4574 | r4575 | |
| 142 | 147 | |
| 143 | 148 | READ8_HANDLER ( europc_jim2_r ) |
| 144 | 149 | { |
| 145 | | switch (europc_jim.state) { |
| 150 | switch (europc_jim.state) |
| 151 | { |
| 146 | 152 | case 0: europc_jim.state++; return 0; |
| 147 | 153 | case 1: europc_jim.state++; return 0x80; |
| 148 | 154 | case 2: |
| 149 | | europc_jim.state=0; |
| 150 | | switch (europc_jim.mode) { |
| 155 | europc_jim.state = 0; |
| 156 | switch (europc_jim.mode) |
| 157 | { |
| 151 | 158 | case AGA_COLOR: return 0x87; // for color; |
| 152 | 159 | case AGA_MONO: return 0x90; //for mono |
| 153 | 160 | case AGA_OFF: return 0x80; // for vram |
| r4574 | r4575 | |
| 165 | 172 | |
| 166 | 173 | WRITE8_HANDLER( europc_pio_w ) |
| 167 | 174 | { |
| 168 | | switch (offset) { |
| 175 | switch (offset) |
| 176 | { |
| 169 | 177 | case 1: |
| 170 | 178 | europc_pio.port61=data; |
| 171 | | // if (data==0x30) pc1640.port62=(pc1640.port65&0x10)>>4; |
| 172 | | // else if (data==0x34) pc1640.port62=pc1640.port65&0xf; |
| 179 | // if (data == 0x30) pc1640.port62 = (pc1640.port65 & 0x10) >> 4; |
| 180 | // else if (data == 0x34) pc1640.port62 = pc1640.port65 & 0xf; |
| 173 | 181 | pit8253_gate_w(devtag_get_device(space->machine, "pit8253"), 2, BIT(data, 0)); |
| 174 | 182 | pc_speaker_set_spkrdata(space->machine, BIT(data, 1)); |
| 175 | 183 | pc_keyb_set_clock(BIT(data, 6)); |
| 176 | 184 | break; |
| 177 | 185 | } |
| 178 | 186 | |
| 179 | | logerror("europc pio write %.2x %.2x\n",offset,data); |
| 187 | logerror("europc pio write %.2x %.2x\n", offset, data); |
| 180 | 188 | } |
| 181 | 189 | |
| 182 | 190 | |
| 183 | 191 | READ8_HANDLER( europc_pio_r ) |
| 184 | 192 | { |
| 185 | | int data=0; |
| 186 | | switch (offset) { |
| 193 | int data = 0; |
| 194 | switch (offset) |
| 195 | { |
| 187 | 196 | case 0: |
| 188 | 197 | if (!(europc_pio.port61&0x80)) |
| 189 | 198 | data = pc_keyb_read(); |
| 190 | 199 | break; |
| 191 | 200 | case 1: |
| 192 | | data=europc_pio.port61; |
| 201 | data = europc_pio.port61; |
| 193 | 202 | break; |
| 194 | 203 | case 2: |
| 195 | | if (pit8253_get_output(devtag_get_device(space->machine, "pit8253"),2)) data|=0x20; |
| 204 | if (pit8253_get_output(devtag_get_device(space->machine, "pit8253"), 2)) |
| 205 | data |= 0x20; |
| 196 | 206 | break; |
| 197 | 207 | } |
| 198 | 208 | return data; |
| r4574 | r4575 | |
| 249 | 259 | { |
| 250 | 260 | int month, year; |
| 251 | 261 | europc_rtc.data[0]=bcd_adjust(europc_rtc.data[0]+1); |
| 252 | | if (europc_rtc.data[0]>=0x60) { |
| 262 | if (europc_rtc.data[0]>=0x60) |
| 263 | { |
| 253 | 264 | europc_rtc.data[0]=0; |
| 254 | 265 | europc_rtc.data[1]=bcd_adjust(europc_rtc.data[1]+1); |
| 255 | | if (europc_rtc.data[1]>=0x60) { |
| 266 | if (europc_rtc.data[1]>=0x60) |
| 267 | { |
| 256 | 268 | europc_rtc.data[1]=0; |
| 257 | 269 | europc_rtc.data[2]=bcd_adjust(europc_rtc.data[2]+1); |
| 258 | | if (europc_rtc.data[2]>=0x24) { |
| 270 | if (europc_rtc.data[2]>=0x24) |
| 271 | { |
| 259 | 272 | europc_rtc.data[2]=0; |
| 260 | 273 | europc_rtc.data[3]=bcd_adjust(europc_rtc.data[3]+1); |
| 261 | 274 | month=bcd_2_dec(europc_rtc.data[4]); |
| 262 | 275 | year=bcd_2_dec(europc_rtc.data[5])+2000; // save for julian_days_in_month_calculation |
| 263 | | if (europc_rtc.data[3]> gregorian_days_in_month(month, year)) { |
| 276 | if (europc_rtc.data[3]> gregorian_days_in_month(month, year)) |
| 277 | { |
| 264 | 278 | europc_rtc.data[3]=1; |
| 265 | 279 | europc_rtc.data[4]=bcd_adjust(europc_rtc.data[4]+1); |
| 266 | | if (europc_rtc.data[4]>0x12) { |
| 280 | if (europc_rtc.data[4]>0x12) |
| 281 | { |
| 267 | 282 | europc_rtc.data[4]=1; |
| 268 | 283 | europc_rtc.data[5]=bcd_adjust(europc_rtc.data[5]+1)&0xff; |
| 269 | 284 | } |
| r4574 | r4575 | |
| 285 | 300 | READ8_HANDLER( europc_rtc_r ) |
| 286 | 301 | { |
| 287 | 302 | int data=0; |
| 288 | | switch (europc_rtc.state) { |
| 303 | switch (europc_rtc.state) |
| 304 | { |
| 289 | 305 | case 1: |
| 290 | 306 | data=(europc_rtc.data[europc_rtc.reg]&0xf0)>>4; |
| 291 | 307 | europc_rtc.state++; |
| r4574 | r4575 | |
| 301 | 317 | |
| 302 | 318 | WRITE8_HANDLER( europc_rtc_w ) |
| 303 | 319 | { |
| 304 | | switch (europc_rtc.state) { |
| 320 | switch (europc_rtc.state) |
| 321 | { |
| 305 | 322 | case 0: |
| 306 | 323 | europc_rtc.reg=data; |
| 307 | 324 | europc_rtc.state=1; |
src/mess/machine/electron.c
| r4574 | r4575 | |
| 15 | 15 | ULA electron_ula; |
| 16 | 16 | static emu_timer *electron_tape_timer; |
| 17 | 17 | |
| 18 | | static const device_config *cassette_device_image( running_machine *machine ) { |
| 18 | static const device_config *cassette_device_image( running_machine *machine ) |
| 19 | { |
| 19 | 20 | return devtag_get_device(machine, "cassette"); |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | | static void electron_tape_start( void ) { |
| 23 | | if ( electron_ula.tape_running ) { |
| 23 | static void electron_tape_start( void ) |
| 24 | { |
| 25 | if ( electron_ula.tape_running ) |
| 26 | { |
| 24 | 27 | return; |
| 25 | 28 | } |
| 26 | 29 | electron_ula.tape_steps = 0; |
| r4574 | r4575 | |
| 31 | 34 | timer_adjust_periodic(electron_tape_timer, attotime_zero, 0, ATTOTIME_IN_HZ(4800)); |
| 32 | 35 | } |
| 33 | 36 | |
| 34 | | static void electron_tape_stop( void ) { |
| 37 | static void electron_tape_stop( void ) |
| 38 | { |
| 35 | 39 | electron_ula.tape_running = 0; |
| 36 | 40 | timer_reset( electron_tape_timer, attotime_never ); |
| 37 | 41 | } |
| r4574 | r4575 | |
| 41 | 45 | |
| 42 | 46 | static TIMER_CALLBACK(electron_tape_timer_handler) |
| 43 | 47 | { |
| 44 | | if ( electron_ula.cassette_motor_mode ) { |
| 48 | if ( electron_ula.cassette_motor_mode ) |
| 49 | { |
| 45 | 50 | double tap_val; |
| 46 | 51 | tap_val = cassette_input( cassette_device_image( machine ) ); |
| 47 | | if ( tap_val < -0.5 ) { |
| 52 | if ( tap_val < -0.5 ) |
| 53 | { |
| 48 | 54 | electron_ula.tape_value = ( electron_ula.tape_value << 8 ) | TAPE_LOW; |
| 49 | 55 | electron_ula.tape_steps++; |
| 50 | | } else if ( tap_val > 0.5 ) { |
| 56 | } |
| 57 | else if ( tap_val > 0.5 ) |
| 58 | { |
| 51 | 59 | electron_ula.tape_value = ( electron_ula.tape_value << 8 ) | TAPE_HIGH; |
| 52 | 60 | electron_ula.tape_steps++; |
| 53 | | } else { |
| 61 | } |
| 62 | else |
| 63 | { |
| 54 | 64 | electron_ula.tape_steps = 0; |
| 55 | 65 | electron_ula.bit_count = 0; |
| 56 | 66 | electron_ula.high_tone_set = 0; |
| 57 | 67 | electron_ula.tape_value = 0x80808080; |
| 58 | 68 | } |
| 59 | | if ( electron_ula.tape_steps > 2 && ( electron_ula.tape_value == 0x0000FFFF || electron_ula.tape_value == 0x00FF00FF ) ) { |
| 69 | if ( electron_ula.tape_steps > 2 && ( electron_ula.tape_value == 0x0000FFFF || electron_ula.tape_value == 0x00FF00FF ) ) |
| 70 | { |
| 60 | 71 | electron_ula.tape_steps = 0; |
| 61 | | switch( electron_ula.bit_count ) { |
| 72 | switch( electron_ula.bit_count ) |
| 73 | { |
| 62 | 74 | case 0: /* start bit */ |
| 63 | 75 | electron_ula.start_bit = ( ( electron_ula.tape_value == 0x0000FFFF ) ? 0 : 1 ); |
| 64 | 76 | //logerror( "++ Read start bit: %d\n", electron_ula.start_bit ); |
| 65 | | if ( electron_ula.start_bit ) { |
| 66 | | if ( electron_ula.high_tone_set ) { |
| 77 | if ( electron_ula.start_bit ) |
| 78 | { |
| 79 | if ( electron_ula.high_tone_set ) |
| 80 | { |
| 67 | 81 | electron_ula.bit_count--; |
| 68 | 82 | } |
| 69 | | } else { |
| 83 | } |
| 84 | else |
| 85 | { |
| 70 | 86 | electron_ula.high_tone_set = 0; |
| 71 | 87 | } |
| 72 | 88 | break; |
| r4574 | r4575 | |
| 78 | 94 | case 9: /* stop bit */ |
| 79 | 95 | electron_ula.stop_bit = ( ( electron_ula.tape_value == 0x0000FFFF ) ? 0 : 1 ); |
| 80 | 96 | //logerror( "++ Read stop bit: %d\n", electron_ula.stop_bit ); |
| 81 | | if ( electron_ula.start_bit && electron_ula.stop_bit && electron_ula.tape_byte == 0xFF && ! electron_ula.high_tone_set ) { |
| 97 | if ( electron_ula.start_bit && electron_ula.stop_bit && electron_ula.tape_byte == 0xFF && ! electron_ula.high_tone_set ) |
| 98 | { |
| 82 | 99 | electron_interrupt_handler( machine, INT_SET, INT_HIGH_TONE ); |
| 83 | 100 | electron_ula.high_tone_set = 1; |
| 84 | | } else if ( ! electron_ula.start_bit && electron_ula.stop_bit ) { |
| 101 | } |
| 102 | else if ( ! electron_ula.start_bit && electron_ula.stop_bit ) |
| 103 | { |
| 85 | 104 | //logerror( "-- Byte read from tape: %02x\n", electron_ula.tape_byte ); |
| 86 | 105 | electron_interrupt_handler( machine, INT_SET, INT_RECEIVE_FULL ); |
| 87 | | } else { |
| 106 | } |
| 107 | else |
| 108 | { |
| 88 | 109 | logerror( "Invalid start/stop bit combination detected: %d,%d\n", electron_ula.start_bit, electron_ula.stop_bit ); |
| 89 | 110 | } |
| 90 | 111 | break; |
| r4574 | r4575 | |
| 113 | 134 | return data; |
| 114 | 135 | } |
| 115 | 136 | |
| 116 | | READ8_HANDLER( electron_jim_r ) { |
| 137 | READ8_HANDLER( electron_jim_r ) |
| 138 | { |
| 117 | 139 | return 0xff; |
| 118 | 140 | } |
| 119 | 141 | |
| 120 | | WRITE8_HANDLER( electron_jim_w ) { |
| 142 | WRITE8_HANDLER( electron_jim_w ) |
| 143 | { |
| 121 | 144 | } |
| 122 | 145 | |
| 123 | | READ8_HANDLER( electron_1mhz_r ) { |
| 146 | READ8_HANDLER( electron_1mhz_r ) |
| 147 | { |
| 124 | 148 | return 0xff; |
| 125 | 149 | } |
| 126 | 150 | |
| 127 | | WRITE8_HANDLER( electron_1mhz_w ) { |
| 151 | WRITE8_HANDLER( electron_1mhz_w ) |
| 152 | { |
| 128 | 153 | } |
| 129 | 154 | |
| 130 | | READ8_HANDLER( electron_ula_r ) { |
| 155 | READ8_HANDLER( electron_ula_r ) |
| 156 | { |
| 131 | 157 | UINT8 data = ((UINT8 *)memory_region(space->machine, "user1"))[0x43E00 + offset]; |
| 132 | | switch ( offset & 0x0f ) { |
| 158 | switch ( offset & 0x0f ) |
| 159 | { |
| 133 | 160 | case 0x00: /* Interrupt status */ |
| 134 | 161 | data = electron_ula.interrupt_status; |
| 135 | 162 | electron_ula.interrupt_status &= ~0x02; |
| r4574 | r4575 | |
| 153 | 180 | const device_config *speaker = devtag_get_device(space->machine, "beep"); |
| 154 | 181 | int i = electron_palette_offset[(( offset >> 1 ) & 0x03)]; |
| 155 | 182 | logerror( "ULA: write offset %02x <- %02x\n", offset & 0x0f, data ); |
| 156 | | switch( offset & 0x0f ) { |
| 183 | switch( offset & 0x0f ) |
| 184 | { |
| 157 | 185 | case 0x00: /* Interrupt control */ |
| 158 | 186 | electron_ula.interrupt_control = data; |
| 159 | 187 | break; |
| r4574 | r4575 | |
| 176 | 204 | * Rompages 10 and 11 both select the Basic ROM. |
| 177 | 205 | * Rompages 8 and 9 both select the keyboard. |
| 178 | 206 | */ |
| 179 | | if ( ( ( electron_ula.rompage & 0x0C ) != 0x08 ) || ( data & 0x08 ) ) { |
| 207 | if ( ( ( electron_ula.rompage & 0x0C ) != 0x08 ) || ( data & 0x08 ) ) |
| 208 | { |
| 180 | 209 | electron_ula.rompage = data & 0x0f; |
| 181 | | if ( electron_ula.rompage == 8 || electron_ula.rompage == 9 ) { |
| 210 | if ( electron_ula.rompage == 8 || electron_ula.rompage == 9 ) |
| 211 | { |
| 182 | 212 | electron_ula.rompage = 8; |
| 183 | 213 | memory_install_read8_handler( space, 0x8000, 0xbfff, 0, 0, electron_read_keyboard ); |
| 184 | | } else { |
| 214 | } |
| 215 | else |
| 216 | { |
| 185 | 217 | memory_install_read8_handler( space, 0x8000, 0xbfff, 0, 0, SMH_BANK2 ); |
| 186 | 218 | } |
| 187 | 219 | memory_set_bank(space->machine, 2, electron_ula.rompage); |
| 188 | 220 | } |
| 189 | | if ( data & 0x10 ) { |
| 221 | if ( data & 0x10 ) |
| 222 | { |
| 190 | 223 | electron_interrupt_handler( space->machine, INT_CLEAR, INT_DISPLAY_END ); |
| 191 | 224 | } |
| 192 | | if ( data & 0x20 ) { |
| 225 | if ( data & 0x20 ) |
| 226 | { |
| 193 | 227 | electron_interrupt_handler( space->machine, INT_CLEAR, INT_RTC ); |
| 194 | 228 | } |
| 195 | | if ( data & 0x40 ) { |
| 229 | if ( data & 0x40 ) |
| 230 | { |
| 196 | 231 | electron_interrupt_handler( space->machine, INT_CLEAR, INT_HIGH_TONE ); |
| 197 | 232 | } |
| 198 | | if ( data & 0x80 ) { |
| 233 | if ( data & 0x80 ) |
| 234 | { |
| 199 | 235 | } |
| 200 | 236 | break; |
| 201 | 237 | case 0x06: /* Counter divider */ |
| 202 | | if ( electron_ula.communication_mode == 0x01) { |
| 238 | if ( electron_ula.communication_mode == 0x01) |
| 239 | { |
| 203 | 240 | beep_set_frequency( speaker, 1000000 / ( 16 * ( data + 1 ) ) ); |
| 204 | 241 | } |
| 205 | 242 | break; |
| 206 | 243 | case 0x07: /* Misc. */ |
| 207 | 244 | electron_ula.communication_mode = ( data >> 1 ) & 0x03; |
| 208 | | switch( electron_ula.communication_mode ) { |
| 245 | switch( electron_ula.communication_mode ) |
| 246 | { |
| 209 | 247 | case 0x00: /* cassette input */ |
| 210 | 248 | beep_set_state( speaker, 0 ); |
| 211 | 249 | electron_tape_start(); |
| r4574 | r4575 | |
| 249 | 287 | } |
| 250 | 288 | } |
| 251 | 289 | |
| 252 | | void electron_interrupt_handler(running_machine *machine, int mode, int interrupt) { |
| 253 | | if ( mode == INT_SET ) { |
| 290 | void electron_interrupt_handler(running_machine *machine, int mode, int interrupt) |
| 291 | { |
| 292 | if ( mode == INT_SET ) |
| 293 | { |
| 254 | 294 | electron_ula.interrupt_status |= interrupt; |
| 255 | | } else { |
| 295 | } |
| 296 | else |
| 297 | { |
| 256 | 298 | electron_ula.interrupt_status &= ~interrupt; |
| 257 | 299 | } |
| 258 | | if ( electron_ula.interrupt_status & electron_ula.interrupt_control & ~0x83 ) { |
| 300 | if ( electron_ula.interrupt_status & electron_ula.interrupt_control & ~0x83 ) |
| 301 | { |
| 259 | 302 | electron_ula.interrupt_status |= 0x01; |
| 260 | | cpu_set_input_line(machine->cpu[0], 0, ASSERT_LINE ); |
| 261 | | } else { |
| 303 | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE ); |
| 304 | } |
| 305 | else |
| 306 | { |
| 262 | 307 | electron_ula.interrupt_status &= ~0x01; |
| 263 | | cpu_set_input_line(machine->cpu[0], 0, CLEAR_LINE ); |
| 308 | cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE ); |
| 264 | 309 | } |
| 265 | 310 | } |
| 266 | 311 | |
| r4574 | r4575 | |
| 289 | 334 | electron_ula.screen_size = 0x8000 - 0x3000; |
| 290 | 335 | electron_ula.screen_addr = 0; |
| 291 | 336 | electron_ula.tape_running = 0; |
| 292 | | electron_ula.vram = memory_get_read_ptr( cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM ), electron_ula.screen_base ); |
| 337 | electron_ula.vram = memory_get_read_ptr(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), electron_ula.screen_base); |
| 293 | 338 | } |
| 294 | 339 | |
| 295 | 340 | MACHINE_START( electron ) |
src/mess/drivers/einstein.c
| r4574 | r4575 | |
| 358 | 358 | /* NPW 21-Jul-2005 - Not sure how to update this for MAME 0.98u2 */ |
| 359 | 359 | /* |
| 360 | 360 | if (einstein_int & einstein_int_mask & EINSTEIN_KEY_INT) |
| 361 | | cpu_set_input_line(machine->cpu[0], Z80_INT_REQ, PULSE_LINE); |
| 361 | cputag_set_input_line(machine, "maincpu", Z80_INT_REQ, PULSE_LINE); |
| 362 | 362 | else |
| 363 | | cpu_set_input_line(machine->cpu[0], Z80_INT_IEO, PULSE_LINE); |
| 363 | cputag_set_input_line(machine, "maincpu", Z80_INT_IEO, PULSE_LINE); |
| 364 | 364 | |
| 365 | 365 | if (einstein_int & einstein_int_mask & EINSTEIN_ADC_INT) |
| 366 | | cpu_set_input_line(machine->cpu[0], Z80_INT_REQ, PULSE_LINE); |
| 366 | cputag_set_input_line(machine, "maincpu", Z80_INT_REQ, PULSE_LINE); |
| 367 | 367 | else |
| 368 | | cpu_set_input_line(machine->cpu[0], Z80_INT_IEO, PULSE_LINE); |
| 368 | cputag_set_input_line(machine, "maincpu", Z80_INT_IEO, PULSE_LINE); |
| 369 | 369 | |
| 370 | 370 | if (einstein_int & einstein_int_mask & EINSTEIN_FIRE_INT) |
| 371 | | cpu_set_input_line(machine->cpu[0], Z80_INT_REQ, PULSE_LINE); |
| 371 | cputag_set_input_line(machine, "maincpu", Z80_INT_REQ, PULSE_LINE); |
| 372 | 372 | else |
| 373 | | cpu_set_input_line(machine->cpu[0], Z80_INT_IEO, PULSE_LINE); |
| 373 | cputag_set_input_line(machine, "maincpu", Z80_INT_IEO, PULSE_LINE); |
| 374 | 374 | */ |
| 375 | 375 | } |
| 376 | 376 | |
| r4574 | r4575 | |
| 406 | 406 | /* interrupt state callback for ctc */ |
| 407 | 407 | static void einstein_ctc_interrupt(const device_config *device, int state) |
| 408 | 408 | { |
| 409 | | logerror("ctc irq state: %02x\n",state); |
| 410 | | cpu_set_input_line(device->machine->cpu[0], 1, state); |
| 409 | logerror("ctc irq state: %02x\n", state); |
| 410 | cputag_set_input_line(device->machine, "maincpu", 1, state); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | static void einstein_pio_interrupt(const device_config *device, int state) |
| 414 | 414 | { |
| 415 | | logerror("pio irq state: %02x\n",state); |
| 416 | | cpu_set_input_line(device->machine->cpu[0], 3, state); |
| 415 | logerror("pio irq state: %02x\n", state); |
| 416 | cputag_set_input_line(device->machine, "maincpu", 3, state); |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | static WRITE8_DEVICE_HANDLER(einstein_serial_transmit_clock) |
| r4574 | r4575 | |
| 580 | 580 | int reg = offset & 0x03; |
| 581 | 581 | const device_config *fdc = devtag_get_device(space->machine, "wd177x"); |
| 582 | 582 | |
| 583 | | logerror("fdc w: PC: %04x %04x %02x\n",cpu_get_pc(space->machine->cpu[0]),offset,data); |
| 583 | logerror("fdc w: PC: %04x %04x %02x\n", cpu_get_pc(cputag_get_cpu(space->machine,"maincpu")), offset, data); |
| 584 | 584 | |
| 585 | 585 | switch (reg) |
| 586 | 586 | { |
| r4574 | r4575 | |
| 616 | 616 | int reg = offset & 0x03; |
| 617 | 617 | const device_config *fdc = devtag_get_device(space->machine, "wd177x"); |
| 618 | 618 | |
| 619 | | logerror("fdc r: PC: %04x %04x\n",cpu_get_pc(space->machine->cpu[0]),offset); |
| 619 | logerror("fdc r: PC: %04x %04x\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset); |
| 620 | 620 | |
| 621 | 621 | switch (reg) |
| 622 | 622 | { |
| r4574 | r4575 | |
| 815 | 815 | /* bit 1: select drive 1 */ |
| 816 | 816 | /* bit 0: select drive 0 */ |
| 817 | 817 | |
| 818 | | logerror("drive w: PC: %04x %04x %02x\n",cpu_get_pc(space->machine->cpu[0]),offset,data); |
| 818 | logerror("drive w: PC: %04x %04x %02x\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), offset, data); |
| 819 | 819 | |
| 820 | | wd17xx_set_side(fdc,(data>>4) & 0x01); |
| 820 | wd17xx_set_side(fdc, (data >> 4) & 0x01); |
| 821 | 821 | |
| 822 | 822 | if (data & 0x01) |
| 823 | 823 | { |
| 824 | | wd17xx_set_drive(fdc,0); |
| 824 | wd17xx_set_drive(fdc, 0); |
| 825 | 825 | } |
| 826 | 826 | else |
| 827 | 827 | if (data & 0x02) |
| 828 | 828 | { |
| 829 | | wd17xx_set_drive(fdc,1); |
| 829 | wd17xx_set_drive(fdc, 1); |
| 830 | 830 | } |
| 831 | 831 | else |
| 832 | 832 | if (data & 0x04) |
| 833 | 833 | { |
| 834 | | wd17xx_set_drive(fdc,2); |
| 834 | wd17xx_set_drive(fdc, 2); |
| 835 | 835 | } |
| 836 | 836 | else |
| 837 | 837 | if (data & 0x08) |
| 838 | 838 | { |
| 839 | | wd17xx_set_drive(fdc,3); |
| 839 | wd17xx_set_drive(fdc, 3); |
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | static WRITE8_HANDLER(einstein_rom_w) |
| 844 | 844 | { |
| 845 | | einstein_rom_enabled^=1; |
| 845 | einstein_rom_enabled ^= 1; |
| 846 | 846 | einstein_page_rom(space->machine); |
| 847 | 847 | } |
| 848 | 848 | |
| r4574 | r4575 | |
| 1385 | 1385 | einstein_int_mask = 0; |
| 1386 | 1386 | floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); |
| 1387 | 1387 | |
| 1388 | | cpu_set_irq_callback(machine->cpu[0], einstein_cpu_acknowledge_int); |
| 1388 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), einstein_cpu_acknowledge_int); |
| 1389 | 1389 | |
| 1390 | 1390 | /* the einstein keyboard can generate a interrupt */ |
| 1391 | 1391 | /* the int is actually clocked at the system clock 4 MHz, but this would be too fast for our |
src/mess/drivers/exelv.c
| r4574 | r4575 | |
| 207 | 207 | break; |
| 208 | 208 | case IOS_INIT: |
| 209 | 209 | mailbox_out = 0x08; |
| 210 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 211 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 210 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 211 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 212 | 212 | io_state = IOS_NOP; |
| 213 | 213 | break; |
| 214 | 214 | case IOS_RESET: |
| r4574 | r4575 | |
| 224 | 224 | break; |
| 225 | 225 | case IOS_CHARDEF1: |
| 226 | 226 | mailbox_out = 0x07; |
| 227 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 228 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 227 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 228 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 229 | 229 | io_state = IOS_CHARDEF2; |
| 230 | 230 | break; |
| 231 | 231 | case IOS_CHARDEF2: |
| 232 | 232 | mailbox_out = 0x04; |
| 233 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 234 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 233 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 234 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 235 | 235 | io_state = IOS_CHARDEF3; |
| 236 | 236 | break; |
| 237 | 237 | case IOS_CHARDEF3: |
| 238 | 238 | mailbox_out = 0xF5; |
| 239 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 240 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 239 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 240 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 241 | 241 | io_state = IOS_CHARDEF4; |
| 242 | 242 | io_counter = 0; |
| 243 | 243 | break; |
| r4574 | r4575 | |
| 375 | 375 | 0x00,0x48,0xA8,0x90,0x00,0x00,0x00,0x00,0x00,0x00, |
| 376 | 376 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 377 | 377 | }; |
| 378 | | mailbox_out = fontdata[io_counter+9-2*(io_counter%10)] >> 2; |
| 379 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 380 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 378 | mailbox_out = fontdata[io_counter + 9 - 2 * (io_counter % 10)] >> 2; |
| 379 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 380 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 381 | 381 | io_counter++; |
| 382 | | if (io_counter == 127*10) |
| 382 | if (io_counter == 127 * 10) |
| 383 | 383 | io_state = IOS_NOP; |
| 384 | 384 | } |
| 385 | 385 | break; |
| r4574 | r4575 | |
| 395 | 395 | if (io_command_ack) |
| 396 | 396 | { |
| 397 | 397 | if (io_hsk) { |
| 398 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 399 | | cpu_set_input_line(machine->cpu[0], TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 398 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, ASSERT_LINE); |
| 399 | cputag_set_input_line(machine, "maincpu", TMS7000_IRQ1_LINE, CLEAR_LINE); |
| 400 | 400 | } |
| 401 | 401 | else |
| 402 | 402 | { |