1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-01 00:57:11 +00:00

Change MOVE routine calling conventions

git-svn-id: svn://svn.cc65.org/cc65/trunk@2965 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-03-29 16:44:39 +00:00
parent 5c63b08d26
commit 663bce6cd7
2 changed files with 15 additions and 11 deletions

View File

@ -175,7 +175,9 @@ BOX: ldy #5
rts rts
;---------------------------------------------------------------------------- ;----------------------------------------------------------------------------
; MOVE: Move the mouse to a new position which is passed in X=ptr1, Y=a/x. ; 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 ; No checks are done if the new position is valid (within the bounding box or
; the screen). No return code required. ; the screen). No return code required.
; ;
@ -186,10 +188,13 @@ MOVE: sei ; No interrupts
stx YPos+1 ; New Y position stx YPos+1 ; New Y position
jsr CMOVEY ; Set it jsr CMOVEY ; Set it
lda ptr1 ldy #$01
ldx ptr1+1 lda (sp),y
sta XPos sta XPos+1
stx XPos+1 ; New X position tax
dey
lda (sp),y
sta XPos ; New X position
jsr CMOVEX ; Move the cursor jsr CMOVEX ; Move the cursor

View File

@ -9,16 +9,15 @@
; */ ; */
; ;
.import incsp2
.import ptr1: zp .import ptr1: zp
.include "mouse-kernel.inc" .include "mouse-kernel.inc"
.proc _mouse_move .proc _mouse_move
sta ptr1 jsr mouse_move ; Call the driver
stx ptr1+1 ; Store x into ptr1 jmp incsp2 ; Drop the parameter
jsr popax
jmp mouse_move ; Call the driver
.endproc .endproc