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

trunk/src/emu/machine/8530scc.c
r242685r242686
227227
228228      rv |= (ourCh->txUnderrun) ? 0x40 : 0;
229229      rv |= (ourCh->syncHunt) ? 0x10 : 0;
230      rv |= channel[0].reg_val[0] & 0x05; // pick up TXBE and RXBF bits
230      rv |= channel[0].reg_val[0] & 0x0D; // pick up TXBE, RXBF, DCD bits
231231
232232      return rv;
233233   }
r242685r242686
258258
259259      rv |= (ourCh->txUnderrun) ? 0x40 : 0;
260260      rv |= (ourCh->syncHunt) ? 0x10 : 0;
261      rv |= channel[1].reg_val[0] & 0x05; // pick up TXBE and RXBF bits
261      rv |= channel[1].reg_val[0] & 0x0D; // pick up TXBE, RXBF, DCD bits
262262
263263      return rv;
264264   }
trunk/src/mess/machine/mac.c
r242685r242686
840840      {
841841         count_x++;
842842         m_mouse_bit_x = 0;
843         x_needs_update = 2;
843844      }
844845      else
845846      {
846847         count_x--;
847848         m_mouse_bit_x = 1;
849         x_needs_update = 1;
848850      }
849      x_needs_update = 1;
850851   }
851852   else if (count_y)
852853   {
r242685r242686
854855      {
855856         count_y++;
856857         m_mouse_bit_y = 1;
858         y_needs_update = 1;
857859      }
858860      else
859861      {
860862         count_y--;
861863         m_mouse_bit_y = 0;
864         y_needs_update = 2;
862865      }
863      y_needs_update = 1;
864866   }
865867
866868   if (x_needs_update || y_needs_update)
r242685r242686
10401042void mac_state::scc_mouse_irq(int x, int y)
10411043{
10421044   scc8530_t *scc = machine().device<scc8530_t>("scc");
1045   static int lasty = 0;
1046   static int lastx = 0;
1047
10431048   if (x && y)
10441049   {
1045      if (m_last_was_x)
1050      if (m_last_was_x) {
10461051         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 {
10481071         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      }
10491091
10501092      m_last_was_x ^= 1;
10511093   }
10521094   else
10531095   {
1054      if (x)
1096      if (x) {
10551097         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 {
10571117         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      }
10581137   }
10591138
10601139   this->set_scc_interrupt(1);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team