Skip to content

Commit

Permalink
Mouse cursor selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Robson committed Apr 13, 2024
1 parent a2ac4de commit ec77677
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
17 changes: 16 additions & 1 deletion basic/sources/commands/hardware/mouse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Command_Mouse: ;; [mouse]
;
; MOUSE SHOW|HIDE
;
cmp #KWD_SYS_SH1 ; check for SHOW and HIDE, shifted
cmp #KWD_SYS_SH1 ; check for CURSOR SHOW and HIDE, shifted
bne _MOError
iny
lda (codePtr),y ; check SHOW/HIDE
Expand All @@ -34,9 +34,24 @@ Command_Mouse: ;; [mouse]
beq _MOControl
cmp #KWD_HIDE-$100
beq _MOControl
cmp #KWD_CURSOR-$100 ; check cursor
beq _MOCursor
_MOError:
.error_syntax

_MOCursor:
ldx #0 ; get cursor number
jsr EXPEvalInteger8
sta ControlParameters+0
.DoSendMessage ; set mouse cursor
.byte 11,5
.DoWaitMessage
lda ControlError
bne _MORange
rts
_MORange:
.error_range

_MOControl:
eor #KWD_HIDE-$100 ; 0 HIDE <>0 SHOW
sta ControlParameters+0
Expand Down
1 change: 1 addition & 0 deletions basic/test.bsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
' BASIC Mouse cursor manipulation
'
mouse show
mouse cursor 1
cls:line 0,0 ink 3 to 100,100
mouse to 260,180
repeat
Expand Down
Binary file modified documents/release/basic.odt
Binary file not shown.
Binary file modified documents/release/basic.pdf
Binary file not shown.
9 changes: 7 additions & 2 deletions firmware/common/config/miscellany/group11_mouse.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,10 @@ GROUP 11 Mouse
FUNCTION 4 Test mouse present
*DPARAMS = MSEMousePresent() ? 1 : 0;
DOCUMENTATION
Returns non zero if a mouse is plugged in.

Returns non zero if a mouse is plugged in in \Param{0}

FUNCTION 5 Select mouse Cursor
*DERROR = CURSetCurrent(DPARAMS[0]);
DOCUMENTATION
Select a mouse cursor in \Param{0} ; returns error status.

0 comments on commit ec77677

Please sign in to comment.