trunk/src/emu/cpu/m6502/om740.lst
| r22049 | r22050 | |
| 152 | 152 | TMP = read_pc(); |
| 153 | 153 | TMP = set_h(TMP, read_pc()); |
| 154 | 154 | TMP = read(TMP); |
| 155 | TMP2 = read(X); |
| 155 | 156 | do_adct(TMP); |
| 157 | write(X, TMP2); |
| 156 | 158 | prefetch(); |
| 157 | 159 | |
| 158 | 160 | adct_abx |
| r22049 | r22050 | |
| 163 | 165 | } |
| 164 | 166 | TMP += X; |
| 165 | 167 | TMP = read(TMP); |
| 168 | TMP2 = read(X); |
| 166 | 169 | do_adct(TMP); |
| 170 | write(X, TMP2); |
| 167 | 171 | prefetch(); |
| 168 | 172 | |
| 169 | 173 | adct_aby |
| r22049 | r22050 | |
| 174 | 178 | } |
| 175 | 179 | TMP += Y; |
| 176 | 180 | TMP = read(TMP); |
| 181 | TMP2 = read(X); |
| 177 | 182 | do_adct(TMP); |
| 183 | write(X, TMP2); |
| 178 | 184 | prefetch(); |
| 179 | 185 | |
| 180 | 186 | adct_idx |
| r22049 | r22050 | |
| 183 | 189 | TMP2 += X; |
| 184 | 190 | TMP = read(TMP2 & 0xff); |
| 185 | 191 | TMP = set_h(TMP, read((TMP2+1) & 0xff)); |
| 192 | TMP2 = read(X); |
| 186 | 193 | do_adct(read(TMP)); |
| 194 | write(X, TMP2); |
| 187 | 195 | prefetch(); |
| 188 | 196 | |
| 189 | 197 | adct_idy |
| r22049 | r22050 | |
| 193 | 201 | if(page_changing(TMP, Y)) { |
| 194 | 202 | read(set_l(TMP, TMP+Y)); |
| 195 | 203 | } |
| 204 | TMP2 = read(X); |
| 196 | 205 | do_adct(read(TMP+Y)); |
| 206 | write(X, TMP2); |
| 197 | 207 | prefetch(); |
| 198 | 208 | |
| 199 | 209 | adct_imm |
| 200 | 210 | TMP = read_pc(); |
| 211 | TMP2 = read(X); |
| 201 | 212 | do_adct(TMP); |
| 213 | write(X, TMP2); |
| 202 | 214 | prefetch(); |
| 203 | 215 | |
| 204 | 216 | adct_zpg |
| 205 | 217 | TMP = read_pc(); |
| 206 | 218 | TMP = read(TMP); |
| 219 | TMP2 = read(X); |
| 207 | 220 | do_adct(TMP); |
| 221 | write(X, TMP2); |
| 208 | 222 | prefetch(); |
| 209 | 223 | |
| 210 | 224 | adct_zpx |
| 211 | 225 | TMP = read_pc(); |
| 212 | 226 | read(TMP); |
| 213 | 227 | TMP = read(UINT8(TMP+X)); |
| 228 | TMP2 = read(X); |
| 214 | 229 | do_adct(TMP); |
| 230 | write(X, TMP2); |
| 215 | 231 | prefetch(); |
| 216 | 232 | |
| 217 | 233 | andt_aba |
| r22049 | r22050 | |
| 654 | 670 | TMP = read_pc(); |
| 655 | 671 | TMP = set_h(TMP, read_pc()); |
| 656 | 672 | TMP = read(TMP); |
| 673 | TMP2 = read(X); |
| 657 | 674 | do_sbct(TMP); |
| 675 | write(X, TMP2); |
| 658 | 676 | prefetch(); |
| 659 | 677 | |
| 660 | 678 | sbct_abx |
| r22049 | r22050 | |
| 665 | 683 | } |
| 666 | 684 | TMP += X; |
| 667 | 685 | TMP = read(TMP); |
| 686 | TMP2 = read(X); |
| 668 | 687 | do_sbct(TMP); |
| 688 | write(X, TMP2); |
| 669 | 689 | prefetch(); |
| 670 | 690 | |
| 671 | 691 | sbct_aby |
| r22049 | r22050 | |
| 676 | 696 | } |
| 677 | 697 | TMP += Y; |
| 678 | 698 | TMP = read(TMP); |
| 699 | TMP2 = read(X); |
| 679 | 700 | do_sbct(TMP); |
| 701 | write(X, TMP2); |
| 680 | 702 | prefetch(); |
| 681 | 703 | |
| 682 | 704 | sbct_idx |
| r22049 | r22050 | |
| 685 | 707 | TMP2 += X; |
| 686 | 708 | TMP = read(TMP2 & 0xff); |
| 687 | 709 | TMP = set_h(TMP, read((TMP2+1) & 0xff)); |
| 710 | TMP2 = read(X); |
| 688 | 711 | do_sbct(read(TMP)); |
| 712 | write(X, TMP2); |
| 689 | 713 | prefetch(); |
| 690 | 714 | |
| 691 | 715 | sbct_idy |
| r22049 | r22050 | |
| 695 | 719 | if(page_changing(TMP, Y)) { |
| 696 | 720 | read(set_l(TMP, TMP+Y)); |
| 697 | 721 | } |
| 722 | TMP2 = read(X); |
| 698 | 723 | do_sbct(read(TMP+Y)); |
| 724 | write(X, TMP2); |
| 699 | 725 | prefetch(); |
| 700 | 726 | |
| 701 | 727 | sbct_imm |
| 702 | 728 | TMP = read_pc(); |
| 729 | TMP2 = read(X); |
| 703 | 730 | do_sbct(TMP); |
| 731 | write(X, TMP2); |
| 704 | 732 | prefetch(); |
| 705 | 733 | |
| 706 | 734 | sbct_zpg |
| 707 | 735 | TMP = read_pc(); |
| 708 | 736 | TMP = read(TMP); |
| 737 | TMP2 = read(X); |
| 709 | 738 | do_sbct(TMP); |
| 739 | write(X, TMP2); |
| 710 | 740 | prefetch(); |
| 711 | 741 | |
| 712 | 742 | sbct_zpx |
| 713 | 743 | TMP = read_pc(); |
| 714 | 744 | read(TMP); |
| 715 | 745 | TMP = read(UINT8(TMP+X)); |
| 746 | TMP2 = read(X); |
| 716 | 747 | do_sbct(TMP); |
| 748 | write(X, TMP2); |
| 717 | 749 | prefetch(); |
| 718 | 750 | |
trunk/src/emu/cpu/m6502/m740.c
| r22049 | r22050 | |
| 113 | 113 | { |
| 114 | 114 | UINT8 c = P & F_C ? 0 : 1; |
| 115 | 115 | P &= ~(F_N|F_V|F_Z|F_C); |
| 116 | | TMP2 = read(X); |
| 117 | 116 | UINT16 diff = TMP2 - val - c; |
| 118 | 117 | UINT8 al = (TMP2 & 15) - (val & 15) - c; |
| 119 | 118 | if(INT8(al) < 0) |
| r22049 | r22050 | |
| 130 | 129 | if(INT8(ah) < 0) |
| 131 | 130 | ah -= 6; |
| 132 | 131 | TMP2 = (ah << 4) | (al & 15); |
| 133 | | write(X, TMP2); |
| 134 | 132 | } |
| 135 | 133 | |
| 136 | 134 | void m740_device::do_sbc_ndt(UINT8 val) |
| 137 | 135 | { |
| 138 | | UINT16 diff; |
| 139 | | |
| 140 | | TMP2 = read(X); |
| 141 | | diff = TMP2 - val - (P & F_C ? 0 : 1); |
| 136 | UINT16 diff = TMP2 - val - (P & F_C ? 0 : 1); |
| 142 | 137 | P &= ~(F_N|F_V|F_Z|F_C); |
| 143 | 138 | if(!UINT8(diff)) |
| 144 | 139 | P |= F_Z; |
| r22049 | r22050 | |
| 149 | 144 | if(!(diff & 0xff00)) |
| 150 | 145 | P |= F_C; |
| 151 | 146 | TMP2 = diff; |
| 152 | | write(X, TMP2); |
| 153 | 147 | } |
| 154 | 148 | |
| 155 | 149 | void m740_device::do_sbct(UINT8 val) |
| r22049 | r22050 | |
| 164 | 158 | { |
| 165 | 159 | UINT8 c = P & F_C ? 1 : 0; |
| 166 | 160 | P &= ~(F_N|F_V|F_Z|F_C); |
| 167 | | TMP2 = read(X); |
| 168 | 161 | UINT8 al = (TMP2 & 15) + (val & 15) + c; |
| 169 | 162 | if(al > 9) |
| 170 | 163 | al += 6; |
| r22049 | r22050 | |
| 180 | 173 | if(ah > 15) |
| 181 | 174 | P |= F_C; |
| 182 | 175 | TMP2 = (ah << 4) | (al & 15); |
| 183 | | write(X, TMP2); |
| 184 | 176 | } |
| 185 | 177 | |
| 186 | 178 | void m740_device::do_adc_ndt(UINT8 val) |
| 187 | 179 | { |
| 188 | 180 | UINT16 sum; |
| 189 | | TMP2 = read(X); |
| 190 | 181 | sum = TMP2 + val + (P & F_C ? 1 : 0); |
| 191 | 182 | P &= ~(F_N|F_V|F_Z|F_C); |
| 192 | 183 | if(!UINT8(sum)) |
| r22049 | r22050 | |
| 198 | 189 | if(sum & 0xff00) |
| 199 | 190 | P |= F_C; |
| 200 | 191 | TMP2 = sum; |
| 201 | | write(X, TMP2); |
| 202 | 192 | } |
| 203 | 193 | |
| 204 | 194 | void m740_device::do_adct(UINT8 val) |