2 ; Ullrich von Bassewitz, 2009-11-02
4 ; void __fastcall__ tgi_vectorchar (const unsigned char* Ops);
5 ; /* Draw one character of the vector font at the current graphics cursor
6 ; * position using the current font magnification.
10 .export _tgi_vectorchar
12 .import push0ax, tosmuleax
14 .include "tgi-kernel.inc"
15 .include "zeropage.inc"
18 ;----------------------------------------------------------------------------
32 ;----------------------------------------------------------------------------
38 ; Since we will call tgi_lineto, which uses the zero page, and we do also
39 ; need the zero page, make room in the register bank.
54 ; Main loop executing vector operations
56 Loop: lda _tgi_textscalew+0
60 ; X2 = tgi_curx + XMag * XDelta.
75 ; Y2 = tgi_cury - YMag * YDelta;
76 ; Y2 = tgi_cury + (~(YMag * YDelta) + 1);
87 ; Do the actual operation
90 bpl @Move ; Jump if move only
92 ldy #7 ; Copy start coords into zp
98 jsr tgi_line ; Call the driver
100 ; Move the start position
113 ; Done. Restore zp and return.
125 ;----------------------------------------------------------------------------
126 ; Get and process one coordinate value. The scale factor is passed in a/x
128 .proc GetProcessedCoord
130 ; Push the scale factor
142 ; Move bit 7 into Flag
144 : asl a ; Flag into carry
147 ; Sign extend the value
150 cmp #$80 ; Sign bit into carry
153 : ror a ; Sign extend the value
155 ; Multiplicate with the scale factor.
159 jsr tosmuleax ; Multiplicate
161 ; The result is a 16.8 fixed point value. Round and return it.
163 cmp #$80 ; Check digits after the dec point