From 296d235deee11f6e59fe33167261ff21c57aa90e Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Sun, 23 Sep 2001 21:42:51 +0000 Subject: [PATCH] Added mouse functions --- zsnes/src/linux/sdlintrf.asm | 54 ++++++++++++++++-------------------- zsnes/src/linux/sdllink.c | 9 +++--- zsnes/src/win/winintrf.asm | 7 ----- zsnes/src/win/winlink.cpp | 6 ++++ 4 files changed, 34 insertions(+), 42 deletions(-) diff --git a/zsnes/src/linux/sdlintrf.asm b/zsnes/src/linux/sdlintrf.asm index 7f38d8c2..de836894 100644 --- a/zsnes/src/linux/sdlintrf.asm +++ b/zsnes/src/linux/sdlintrf.asm @@ -1137,42 +1137,36 @@ NEWSYM Get_MouseData ; Returns both pressed and coordinates ret NEWSYM Set_MouseXMax ; Sets the X boundaries (ecx = left, edx = right) -; pushad -; or ecx,0FFFh -; push ecx -; call SetMouseMinX -; pop ecx -; or edx,0FFFh -; push edx -; call SetMouseMaxX -; pop edx -; popad + pushad + push ecx + call SetMouseMinX + pop ecx + push edx + call SetMouseMaxX + pop edx + popad ret NEWSYM Set_MouseYMax ; Sets the Y boundaries (ecx = left, edx = right) -; pushad -; or ecx,0FFFh -; push ecx -; call SetMouseMinY -; pop ecx -; or edx,0FFFh -; push edx -; call SetMouseMaxY -; pop edx -; popad + pushad + push ecx + call SetMouseMinY + pop ecx + push edx + call SetMouseMaxY + pop edx + popad ret NEWSYM Set_MousePosition ; Sets Mouse Position (x:cx,y:dx) -; pushad -; or ecx,0FFFFh -; push ecx -; call SetMouseX -; pop ecx -; push edx -; or edx,0FFFFh -; call SetMouseY -; pop edx -; popad + pushad + push ecx + call SetMouseX + pop ecx + push edx + call SetMouseY + pop edx + popad ret NEWSYM Get_MousePositionDisplacement diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index b547c6d7..de03ab37 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -1014,14 +1014,13 @@ void SetMouseMaxY(int MaxY) MouseMaxY = MaxY; adjustMouseYScale(); } - -// we can probably get rid of these functions since they are no -// longer called in sdlintrf.asm void SetMouseX(int X) -{ /* MouseX=X; */ +{ + MouseX = X; } void SetMouseY(int Y) -{ /* MouseY=Y; */ +{ + MouseY = Y; } void ZsnesPage() diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index cae2746d..9d1067c2 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -1438,11 +1438,9 @@ NEWSYM Get_MouseData ; Returns both pressed and coordinates NEWSYM Set_MouseXMax ; Sets the X boundaries (ecx = left, edx = right) pushad - or ecx,0FFFh push ecx call SetMouseMinX pop ecx - or edx,0FFFh push edx call SetMouseMaxX pop edx @@ -1451,11 +1449,9 @@ NEWSYM Set_MouseXMax ; Sets the X boundaries (ecx = left, edx = right) NEWSYM Set_MouseYMax ; Sets the Y boundaries (ecx = left, edx = right) pushad - or ecx,0FFFh push ecx call SetMouseMinY pop ecx - or edx,0FFFh push edx call SetMouseMaxY pop edx @@ -1464,12 +1460,10 @@ NEWSYM Set_MouseYMax ; Sets the Y boundaries (ecx = left, edx = right) NEWSYM Set_MousePosition ; Sets Mouse Position (x:cx,y:dx) pushad - or ecx,0FFFFh push ecx call SetMouseX pop ecx push edx - or edx,0FFFFh call SetMouseY pop edx popad @@ -1487,7 +1481,6 @@ NEWSYM Get_MousePositionDisplacement mov dx,[WMouseMoveY] ret - NEWSYM MouseWindow pushad or byte[MouseButton],2 diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index ae7e788d..a024a456 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -2727,26 +2727,32 @@ int GetMouseButton(void) void SetMouseMinX(int MinX) { + MouseMinX = MinX; } void SetMouseMaxX(int MaxX) { + MouseMaxX = MaxX; } void SetMouseMinY(int MinY) { + MouseMinY = MinY; } void SetMouseMaxY(int MaxY) { + MouseMaxY = MaxY; } void SetMouseX(int X) { + MouseX = X; } void SetMouseY(int Y) { + MouseY = Y; } void ZsnesPage()