diff --git a/libsrc/c64/c64-1351.s b/libsrc/c64/c64-1351.s index ab4732aaa..5fbc8122e 100644 --- a/libsrc/c64/c64-1351.s +++ b/libsrc/c64/c64-1351.s @@ -175,8 +175,10 @@ BOX: ldy #5 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. ; @@ -186,10 +188,13 @@ MOVE: sei ; No interrupts 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 diff --git a/libsrc/mouse/mouse_move.s b/libsrc/mouse/mouse_move.s index f3052c1ee..2245221f6 100644 --- a/libsrc/mouse/mouse_move.s +++ b/libsrc/mouse/mouse_move.s @@ -9,16 +9,15 @@ ; */ ; - .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