|
|
| version 1.1.1.1, 2003/10/16 17:57:55 | version 1.3, 2003/10/19 14:56:15 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "mousemng.h" | #include "mousemng.h" |
| #include "i286.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| Line 20 void mouseif_sync(void) { | Line 21 void mouseif_sync(void) { |
| mouseif.rx = mouseif.sx; | mouseif.rx = mouseif.sx; |
| mouseif.ry = mouseif.sy; | mouseif.ry = mouseif.sy; |
| mouseif.lastc = nevent.clock + nevent.baseclock | mouseif.lastc = I286_CLOCK + I286_BASECLOCK + I286_REMCLOCK; |
| - nevent.remainclock; | |
| } | } |
| static void calc_mousexy(void) { | static void calc_mousexy(void) { |
| Line 29 static void calc_mousexy(void) { | Line 29 static void calc_mousexy(void) { |
| UINT32 clock; | UINT32 clock; |
| SINT32 diff; | SINT32 diff; |
| clock = nevent.clock + nevent.baseclock - nevent.remainclock; | clock = I286_CLOCK + I286_BASECLOCK + I286_REMCLOCK; |
| diff = clock - mouseif.lastc; | diff = clock - mouseif.lastc; |
| if (diff >= 2000) { | if (diff >= 2000) { |
| short dx, dy; | SINT16 dx; |
| SINT16 dy; | |
| mouseif.rapid ^= 0xa0; | mouseif.rapid ^= 0xa0; |
| diff /= 1000; | diff /= 1000; |
| dx = (short)((long)mouseif.sx * diff / (long)pc.frame1000); | dx = (SINT16)(mouseif.sx * diff / pc.frame1000); |
| if (dx >= 0) { // ˵ | if (dx >= 0) { // ˵ |
| if (dx > mouseif.rx) { | if (dx > mouseif.rx) { |
| dx = mouseif.rx; | dx = mouseif.rx; |
| Line 48 static void calc_mousexy(void) { | Line 49 static void calc_mousexy(void) { |
| } | } |
| mouseif.x += dx; | mouseif.x += dx; |
| mouseif.rx -= dx; | mouseif.rx -= dx; |
| dy = (short)((long)mouseif.sy * diff / (long)pc.frame1000); | dy = (SINT16)(mouseif.sy * diff / pc.frame1000); |
| if (dy >= 0) { // ˵ | if (dy >= 0) { // ˵ |
| if (dy > mouseif.ry) { | if (dy > mouseif.ry) { |
| dy = mouseif.ry; | dy = mouseif.ry; |