| Previous | 199869 Revisions | Next |
| r34174 Saturday 3rd January, 2015 at 21:43:42 UTC by R. Belmont |
|---|
| (MESS) Improve mouse tracking for pre-ADB Macs. [Rob Braun] |
| [src/emu/machine] | 8530scc.c |
| [src/mess/machine] | mac.c |
| r242685 | r242686 | |
|---|---|---|
| 227 | 227 | |
| 228 | 228 | rv |= (ourCh->txUnderrun) ? 0x40 : 0; |
| 229 | 229 | rv |= (ourCh->syncHunt) ? 0x10 : 0; |
| 230 | rv |= channel[0].reg_val[0] & 0x0 | |
| 230 | rv |= channel[0].reg_val[0] & 0x0D; // pick up TXBE, RXBF, DCD bits | |
| 231 | 231 | |
| 232 | 232 | return rv; |
| 233 | 233 | } |
| r242685 | r242686 | |
| 258 | 258 | |
| 259 | 259 | rv |= (ourCh->txUnderrun) ? 0x40 : 0; |
| 260 | 260 | rv |= (ourCh->syncHunt) ? 0x10 : 0; |
| 261 | rv |= channel[1].reg_val[0] & 0x0 | |
| 261 | rv |= channel[1].reg_val[0] & 0x0D; // pick up TXBE, RXBF, DCD bits | |
| 262 | 262 | |
| 263 | 263 | return rv; |
| 264 | 264 | } |
| r242685 | r242686 | |
|---|---|---|
| 840 | 840 | { |
| 841 | 841 | count_x++; |
| 842 | 842 | m_mouse_bit_x = 0; |
| 843 | x_needs_update = 2; | |
| 843 | 844 | } |
| 844 | 845 | else |
| 845 | 846 | { |
| 846 | 847 | count_x--; |
| 847 | 848 | m_mouse_bit_x = 1; |
| 849 | x_needs_update = 1; | |
| 848 | 850 | } |
| 849 | x_needs_update = 1; | |
| 850 | 851 | } |
| 851 | 852 | else if (count_y) |
| 852 | 853 | { |
| r242685 | r242686 | |
| 854 | 855 | { |
| 855 | 856 | count_y++; |
| 856 | 857 | m_mouse_bit_y = 1; |
| 858 | y_needs_update = 1; | |
| 857 | 859 | } |
| 858 | 860 | else |
| 859 | 861 | { |
| 860 | 862 | count_y--; |
| 861 | 863 | m_mouse_bit_y = 0; |
| 864 | y_needs_update = 2; | |
| 862 | 865 | } |
| 863 | y_needs_update = 1; | |
| 864 | 866 | } |
| 865 | 867 | |
| 866 | 868 | if (x_needs_update || y_needs_update) |
| r242685 | r242686 | |
| 1040 | 1042 | void mac_state::scc_mouse_irq(int x, int y) |
| 1041 | 1043 | { |
| 1042 | 1044 | scc8530_t *scc = machine().device<scc8530_t>("scc"); |
| 1045 | static int lasty = 0; | |
| 1046 | static int lastx = 0; | |
| 1047 | ||
| 1043 | 1048 | if (x && y) |
| 1044 | 1049 | { |
| 1045 | if (m_last_was_x) | |
| 1050 | if (m_last_was_x) { | |
| 1046 | 1051 | scc->set_status(0x0a); |
| 1047 | else | |
| 1052 | if(x == 2) { | |
| 1053 | if(lastx) { | |
| 1054 | scc->set_reg_a(0, 0x04); | |
| 1055 | m_mouse_bit_x = 0; | |
| 1056 | } else { | |
| 1057 | scc->set_reg_a(0, 0x0C); | |
| 1058 | m_mouse_bit_x = 1; | |
| 1059 | } | |
| 1060 | } else { | |
| 1061 | if(lastx) { | |
| 1062 | scc->set_reg_a(0, 0x04); | |
| 1063 | m_mouse_bit_x = 1; | |
| 1064 | } else { | |
| 1065 | scc->set_reg_a(0, 0x0C); | |
| 1066 | m_mouse_bit_x = 0; | |
| 1067 | } | |
| 1068 | } | |
| 1069 | lastx = !lastx; | |
| 1070 | } else { | |
| 1048 | 1071 | scc->set_status(0x02); |
| 1072 | if(y == 2) { | |
| 1073 | if(lasty) { | |
| 1074 | scc->set_reg_b(0, 0x04); | |
| 1075 | m_mouse_bit_y = 0; | |
| 1076 | } else { | |
| 1077 | scc->set_reg_b(0, 0x0C); | |
| 1078 | m_mouse_bit_y = 1; | |
| 1079 | } | |
| 1080 | } else { | |
| 1081 | if(lasty) { | |
| 1082 | scc->set_reg_b(0, 0x04); | |
| 1083 | m_mouse_bit_y = 1; | |
| 1084 | } else { | |
| 1085 | scc->set_reg_b(0, 0x0C); | |
| 1086 | m_mouse_bit_y = 0; | |
| 1087 | } | |
| 1088 | } | |
| 1089 | lasty = !lasty; | |
| 1090 | } | |
| 1049 | 1091 | |
| 1050 | 1092 | m_last_was_x ^= 1; |
| 1051 | 1093 | } |
| 1052 | 1094 | else |
| 1053 | 1095 | { |
| 1054 | if (x) | |
| 1096 | if (x) { | |
| 1055 | 1097 | scc->set_status(0x0a); |
| 1056 | else | |
| 1098 | if(x == 2) { | |
| 1099 | if(lastx) { | |
| 1100 | scc->set_reg_a(0, 0x04); | |
| 1101 | m_mouse_bit_x = 0; | |
| 1102 | } else { | |
| 1103 | scc->set_reg_a(0, 0x0C); | |
| 1104 | m_mouse_bit_x = 1; | |
| 1105 | } | |
| 1106 | } else { | |
| 1107 | if(lastx) { | |
| 1108 | scc->set_reg_a(0, 0x04); | |
| 1109 | m_mouse_bit_x = 1; | |
| 1110 | } else { | |
| 1111 | scc->set_reg_a(0, 0x0C); | |
| 1112 | m_mouse_bit_x = 0; | |
| 1113 | } | |
| 1114 | } | |
| 1115 | lastx = !lastx; | |
| 1116 | } else { | |
| 1057 | 1117 | scc->set_status(0x02); |
| 1118 | if(y == 2) { | |
| 1119 | if(lasty) { | |
| 1120 | scc->set_reg_b(0, 0x04); | |
| 1121 | m_mouse_bit_y = 0; | |
| 1122 | } else { | |
| 1123 | scc->set_reg_b(0, 0x0C); | |
| 1124 | m_mouse_bit_y = 1; | |
| 1125 | } | |
| 1126 | } else { | |
| 1127 | if(lasty) { | |
| 1128 | scc->set_reg_b(0, 0x04); | |
| 1129 | m_mouse_bit_y = 1; | |
| 1130 | } else { | |
| 1131 | scc->set_reg_b(0, 0x0C); | |
| 1132 | m_mouse_bit_y = 0; | |
| 1133 | } | |
| 1134 | } | |
| 1135 | lasty = !lasty; | |
| 1136 | } | |
| 1058 | 1137 | } |
| 1059 | 1138 | |
| 1060 | 1139 | this->set_scc_interrupt(1); |
| https://github.com/mamedev/mame/commit/d22725a6235a250ebee30888600c154e1cc991df |
| Previous | 199869 Revisions | Next |