.include "tgi-kernel.inc"
.import popax
- .importzp ptr1, ptr2, ptr3, ptr4
- .export _tgi_line
-
-_tgi_line:
- sta ptr4 ; Get the coordinates
- stx ptr4+1
- jsr popax
- sta ptr3
- stx ptr3+1
- jsr popax
- sta ptr2
- stx ptr2+1
- jsr popax
- sta ptr1
- stx ptr1+1
-
- jmp tgi_line ; Call the driver
+
+.proc _tgi_line
+
+ jsr tgi_linepop ; Pop/store Y2/X2
+ jsr popax ; Y1
+ sta tgi_clip_y1
+ stx tgi_clip_y1+1
+ jsr popax ; X1
+ sta tgi_clip_x1
+ stx tgi_clip_x1+1
+ jmp tgi_clippedline ; Call the line clipper
+
+.endproc