From 5b04986f082a413e91bd8b69a6a73d4c333a9d11 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Wed, 17 Apr 2024 19:57:23 -0500 Subject: [PATCH] Add tool glue code for ReadMouse2. This is documented in TBR3 and is already declared in , but did not previously have glue code. TBR3 says "Applications should never make this call," but it may be useful in system utilities. --- toolglue.asm | 38 ++++++++++++++++++++++++++++++++++++++ toolglue.macros | 5 +++++ 2 files changed, 43 insertions(+) diff --git a/toolglue.asm b/toolglue.asm index da3b780..93a61a3 100644 --- a/toolglue.asm +++ b/toolglue.asm @@ -206,6 +206,44 @@ yPos ds 2 xPos ds 2 end +**************************************************************** +* +* ReadMouse2 - return mouse statistics +* +* Outputs: +* Returns a pointer to a record with the following +* structure: +* +* typedef struct MouseRec { +* char mouseMode; +* char mouseStatus; +* int yPos; +* int xPos; +* } +* +**************************************************************** +* +ReadMouse2 start + + pha + pha + pha + _ReadMouse2 + sta >~TOOLERROR + pl2 >mouseMode + pl2 >yPos + pl2 >xPos + + lda #mouseMode + ldx #^mouseMode + rtl + +mouseMode ds 1 +mouseStatus ds 1 +yPos ds 2 +xPos ds 2 + end + **************************************************************** * * ReadTimeHex - returns the time in hex format diff --git a/toolglue.macros b/toolglue.macros index 462d0be..195d809 100644 --- a/toolglue.macros +++ b/toolglue.macros @@ -384,3 +384,8 @@ &lab ldx #$1F23 jsl $E10000 MEND + MACRO +&lab _ReadMouse2 +&lab ldx #$3303 + jsl $E10000 + MEND