rts
;----------------------------------------------------------------------------
-; MOVE: Move the mouse to a new position which is passed in X=ptr1, Y=a/x.
-; No checks are done if the new position is valid (within the bounding box or
+; MOVE: Move the mouse to a new position. The position is passed as it comes
+; from the C program, that is: X on the stack and Y in a/x. The C wrapper will
+; remove the parameter from the stack on return.
+; No checks are done if the new position is valid (within the bounding box or
; the screen). No return code required.
;
stx YPos+1 ; New Y position
jsr CMOVEY ; Set it
- lda ptr1
- ldx ptr1+1
- sta XPos
- stx XPos+1 ; New X position
+ ldy #$01
+ lda (sp),y
+ sta XPos+1
+ tax
+ dey
+ lda (sp),y
+ sta XPos ; New X position
jsr CMOVEX ; Move the cursor
; */
;
- .import ptr1: zp
+ .import incsp2
+ .import ptr1: zp
.include "mouse-kernel.inc"
.proc _mouse_move
- sta ptr1
- stx ptr1+1 ; Store x into ptr1
- jsr popax
- jmp mouse_move ; Call the driver
+ jsr mouse_move ; Call the driver
+ jmp incsp2 ; Drop the parameter
.endproc