2 ; Ullrich von Bassewitz, 2009-10-30
6 .include "tgi-kernel.inc"
11 ;-----------------------------------------------------------------------------
12 ; Calculate either the total height or the total width of a bitmapped
13 ; character, depending on the value in Y. On entry, X contains the scaling
14 ; factor. Since it is usually small, we multiplicate by doing repeated adds.
15 ; The function returns zero in X and the calculated value in A.
30 ;-----------------------------------------------------------------------------
31 ; void __fastcall__ tgi_textstyle (unsigned width, unsigned height,
32 ; unsigned char dir, unsigned char font);
33 ; /* Set the style for text output. The scaling factors for width and height
34 ; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
35 ; * dir is one of the TGI_TEXT_XXX constants. font is one of the TGI_FONT_XXX
42 sta _tgi_font ; Remember the font to use
44 sta _tgi_textdir ; Remember the direction
46 ; Pop the height and run directly into tgi_textscale
52 ;-----------------------------------------------------------------------------
53 ; void __fastcall__ tgi_textscale (unsigned width, unsigned height);
54 ; /* Set the scaling for text output. The scaling factors for width and height
55 ; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
60 ; The height value is in 8.8 fixed point. Store it and calculate a rounded
61 ; value for scaling the bitmapped system font in the driver.
65 asl a ; Check value behind comma
68 @L1: stx _tgi_textscaleh+2 ; Store rounded value
70 ; Calculate the total height of the bitmapped font and remember it.
75 ; The width value is in 8.8 fixed point. Store it and calculate a rounded
76 ; value for scaling the bitmapped system font in the driver.
81 asl a ; Check value behind comma
84 @L2: stx _tgi_textscalew+2 ; Store rounded value
86 ; Calculate the total width of the bitmapped font and remember it.
91 ; Load values and call the driver, parameters are passed in registers