2 ; Ullrich von Bassewitz, 2009-20-30
4 ; void __fastcall__ tgi_textstyle (unsigned magwidth, unsigned magheight,
6 ; /* Set the style for text output. The scaling factors for width and height
7 ; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
11 .include "tgi-kernel.inc"
16 ;-----------------------------------------------------------------------------
17 ; Calculate either the total height or the total width of a bitmapped
18 ; character, depending on the value in Y. On entry, X contains the scaling
19 ; factor. Since it is usually small, we multiplicate by doing repeated adds.
20 ; The function returns zero in X and the calculated value in A.
36 ;-----------------------------------------------------------------------------
41 sta _tgi_textdir ; Remember the direction
43 ; The magheight value is in 8.8 fixed point. Store it and calculate a rounded
44 ; value for scaling the bitmapped system font in the driver.
49 asl a ; Check value behind comma
52 @L1: stx _tgi_textmagh+2 ; Store rounded value
54 ; Calculate the total height of the bitmapped font and remember it.
59 ; The magwidth value is in 8.8 fixed point. Store it and calculate a rounded
60 ; value for scaling the bitmapped system font in the driver.
65 asl a ; Check value behind comma
68 @L2: stx _tgi_textmagw+2 ; Store rounded value
70 ; Calculate the total width of the bitmapped font and remember it.
75 ; Load values and call the driver, parameters are passed in registers