]> git.sur5r.net Git - cc65/blobdiff - libsrc/tgi/tgi_outtextxy.s
remove superfluous ".code" line
[cc65] / libsrc / tgi / tgi_outtextxy.s
index 6348210e572b9fd79e407bdad19d2ca38827e974..3934df8717e0df45103ddf6c62cc05018b543f4d 100644 (file)
@@ -7,14 +7,31 @@
 
         .include        "tgi-kernel.inc"
 
-        .import         popax
-        .importzp       ptr3
-        .export         _tgi_outtextxy
+        .import         addysp1
+        .importzp       sp
 
-_tgi_outtextxy:
-        sta     ptr3
-        stx     ptr3+1          ; Save s
-        jsr     tgi_popxy       ; Pop x/y into ptr1/ptr2
-        jmp     tgi_outtext     ; Call the driver
+.proc   _tgi_outtextxy
 
+; Get the X/Y parameters and store them into curx/cury. This enables us
+; to use tgi_outtext for the actual output
+
+        pha                     ;
+        ldy     #0
+        lda     (sp),y
+        sta     _tgi_cury
+        iny
+        lda     (sp),y
+        sta     _tgi_cury+1
+        iny
+        lda     (sp),y
+        sta     _tgi_curx
+        iny
+        lda     (sp),y
+        sta     _tgi_curx+1
+        pla
+        jsr     addysp1         ; Drop arguments from stack
+
+        jmp     _tgi_outtext
+
+.endproc