From 663bce6cd736d1f80428d8b6dfc1c8a9084a6e25 Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 29 Mar 2004 16:44:39 +0000 Subject: [PATCH] Change MOVE routine calling conventions git-svn-id: svn://svn.cc65.org/cc65/trunk@2965 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/c64/c64-1351.s | 17 +++++++++++------ libsrc/mouse/mouse_move.s | 9 ++++----- 2 files changed, 15 insertions(+), 11 deletions(-) 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 -- 2.39.5