2002-10-03 11:18:23 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 21.06.2002
|
|
|
|
;
|
|
|
|
; void __fastcall__ tgi_outtext (const char* s);
|
|
|
|
; /* Output text at the current graphics cursor position. */
|
|
|
|
|
|
|
|
|
|
|
|
.include "tgi-kernel.inc"
|
|
|
|
|
2009-10-30 21:26:35 +00:00
|
|
|
.import popax, negax
|
2002-10-03 11:18:23 +00:00
|
|
|
.importzp ptr3
|
|
|
|
|
2003-02-11 12:37:46 +00:00
|
|
|
.proc _tgi_outtext
|
|
|
|
|
2002-10-03 11:18:23 +00:00
|
|
|
sta ptr3
|
2009-10-30 21:26:35 +00:00
|
|
|
stx ptr3+1 ; Pass s in ptr3 to driver
|
|
|
|
pha
|
|
|
|
txa
|
|
|
|
pha ; Save s on stack for later
|
|
|
|
|
2002-10-03 11:18:23 +00:00
|
|
|
jsr tgi_curtoxy ; Copy curx/cury into ptr1/ptr2
|
2009-10-30 21:26:35 +00:00
|
|
|
jsr tgi_outtext ; Call the driver
|
|
|
|
|
|
|
|
pla
|
|
|
|
tax
|
|
|
|
pla ; Restore s
|
|
|
|
jsr _tgi_textwidth ; Get width of text string
|
|
|
|
ldy _tgi_textdir ; Horizontal or vertical text?
|
|
|
|
beq @L1 ; Jump if horizontal
|
|
|
|
|
|
|
|
; Move graphics cursor for vertical text
|
|
|
|
|
|
|
|
jsr negax
|
|
|
|
ldy #2 ; Point to _tgi_cury
|
|
|
|
|
|
|
|
; Move graphics cursor for horizontal text
|
|
|
|
|
|
|
|
@L1: clc
|
|
|
|
adc _tgi_curx,y
|
|
|
|
sta _tgi_curx,y
|
|
|
|
txa
|
|
|
|
adc _tgi_curx+1,y
|
|
|
|
sta _tgi_curx+1,y
|
|
|
|
rts
|
2002-10-03 11:18:23 +00:00
|
|
|
|
2003-02-11 12:37:46 +00:00
|
|
|
.endproc
|
2002-10-03 11:18:23 +00:00
|
|
|
|