mirror of
https://github.com/cc65/cc65.git
synced 2024-09-29 02:55:20 +00:00
Renamed tgi_textheight -> tgi_gettextheight, tgi_textwidth -> tgi_gettextwidth
tgi_textstyle -> tgi_settextstyle and tgi_textscale -> tgi_settextscale. git-svn-id: svn://svn.cc65.org/cc65/trunk@5090 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
83d67e930a
commit
9c55586569
@ -134,6 +134,7 @@ TGI_CLIP_TOP = $08
|
|||||||
.global _tgi_fontwidth ; System font width
|
.global _tgi_fontwidth ; System font width
|
||||||
.global _tgi_fontheight ; System font height
|
.global _tgi_fontheight ; System font height
|
||||||
.global _tgi_aspectratio ; Aspect ratio, fixed point 8.8
|
.global _tgi_aspectratio ; Aspect ratio, fixed point 8.8
|
||||||
|
.global _tgi_flags ; TGI driver flags
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; ASM accessible variables
|
; ASM accessible variables
|
||||||
@ -202,6 +203,8 @@ TGI_CLIP_TOP = $08
|
|||||||
.global _tgi_getpagecount
|
.global _tgi_getpagecount
|
||||||
.global _tgi_getpalette
|
.global _tgi_getpalette
|
||||||
.global _tgi_getpixel
|
.global _tgi_getpixel
|
||||||
|
.global _tgi_gettextheight
|
||||||
|
.global _tgi_gettextwidth
|
||||||
.global _tgi_getxres
|
.global _tgi_getxres
|
||||||
.global _tgi_getyres
|
.global _tgi_getyres
|
||||||
.global _tgi_gotoxy
|
.global _tgi_gotoxy
|
||||||
@ -221,10 +224,8 @@ TGI_CLIP_TOP = $08
|
|||||||
.global _tgi_setdrawpage
|
.global _tgi_setdrawpage
|
||||||
.global _tgi_setpalette
|
.global _tgi_setpalette
|
||||||
.global _tgi_setpixel
|
.global _tgi_setpixel
|
||||||
|
.global _tgi_settextscale
|
||||||
|
.global _tgi_settextstyle
|
||||||
.global _tgi_setviewpage
|
.global _tgi_setviewpage
|
||||||
.global _tgi_textheight
|
|
||||||
.global _tgi_textscale
|
|
||||||
.global _tgi_textstyle
|
|
||||||
.global _tgi_textwidth
|
|
||||||
.global _tgi_uninstall
|
.global _tgi_uninstall
|
||||||
.global _tgi_unload
|
.global _tgi_unload
|
||||||
|
@ -228,25 +228,25 @@ void __fastcall__ tgi_pieslice (int x, int y, unsigned char rx, unsigned char ry
|
|||||||
void __fastcall__ tgi_bar (int x1, int y1, int x2, int y2);
|
void __fastcall__ tgi_bar (int x1, int y1, int x2, int y2);
|
||||||
/* Draw a bar (a filled rectangle) using the current color. */
|
/* Draw a bar (a filled rectangle) using the current color. */
|
||||||
|
|
||||||
void __fastcall__ tgi_textscale (unsigned width, unsigned height);
|
void __fastcall__ tgi_settextscale (unsigned width, unsigned height);
|
||||||
/* Set the scaling for text output. The scaling factors for width and height
|
/* Set the scaling for text output. The scaling factors for width and height
|
||||||
* are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
* are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void __fastcall__ tgi_textstyle (unsigned width, unsigned height,
|
void __fastcall__ tgi_settextstyle (unsigned width, unsigned height,
|
||||||
unsigned char dir, unsigned char font);
|
unsigned char dir, unsigned char font);
|
||||||
/* Set the style for text output. The scaling factors for width and height
|
/* Set the style for text output. The scaling factors for width and height
|
||||||
* are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
* are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
||||||
* dir is one of the TGI_TEXT_XXX constants. font is one of the TGI_FONT_XXX
|
* dir is one of the TGI_TEXT_XXX constants. font is one of the TGI_FONT_XXX
|
||||||
* constants.
|
* constants.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned __fastcall__ tgi_textwidth (const char* s);
|
unsigned __fastcall__ tgi_gettextwidth (const char* s);
|
||||||
/* Calculate the width of the text in pixels according to the current text
|
/* Calculate the width of the text in pixels according to the current text
|
||||||
* style.
|
* style.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned __fastcall__ tgi_textheight (const char* s);
|
unsigned __fastcall__ tgi_gettextheight (const char* s);
|
||||||
/* Calculate the height of the text in pixels according to the current text
|
/* Calculate the height of the text in pixels according to the current text
|
||||||
* style.
|
* style.
|
||||||
*/
|
*/
|
||||||
|
@ -56,6 +56,8 @@ S_OBJS = tgi-kernel.o \
|
|||||||
tgi_getpalette.o \
|
tgi_getpalette.o \
|
||||||
tgi_getpixel.o \
|
tgi_getpixel.o \
|
||||||
tgi_getset.o \
|
tgi_getset.o \
|
||||||
|
tgi_gettextheight.o \
|
||||||
|
tgi_gettextwidth.o \
|
||||||
tgi_getxres.o \
|
tgi_getxres.o \
|
||||||
tgi_getyres.o \
|
tgi_getyres.o \
|
||||||
tgi_gotoxy.o \
|
tgi_gotoxy.o \
|
||||||
@ -76,10 +78,8 @@ S_OBJS = tgi-kernel.o \
|
|||||||
tgi_setdrawpage.o \
|
tgi_setdrawpage.o \
|
||||||
tgi_setpalette.o \
|
tgi_setpalette.o \
|
||||||
tgi_setpixel.o \
|
tgi_setpixel.o \
|
||||||
|
tgi_settextstyle.o \
|
||||||
tgi_setviewpage.o \
|
tgi_setviewpage.o \
|
||||||
tgi_textheight.o \
|
|
||||||
tgi_textwidth.o \
|
|
||||||
tgi_textstyle.o \
|
|
||||||
tgi_unload.o \
|
tgi_unload.o \
|
||||||
tgi_vectorchar.o
|
tgi_vectorchar.o
|
||||||
|
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
|
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; unsigned __fastcall__ tgi_textheight (const char* s);
|
; unsigned __fastcall__ tgi_gettextheight (const char* s);
|
||||||
; /* Calculate the height of the text in pixels according to the current text
|
; /* Calculate the height of the text in pixels according to the current text
|
||||||
; * style.
|
; * style.
|
||||||
; */
|
; */
|
||||||
;
|
;
|
||||||
|
|
||||||
.proc _tgi_textheight
|
.proc _tgi_gettextheight
|
||||||
|
|
||||||
ldy _tgi_font
|
ldy _tgi_font
|
||||||
bne @L2 ; Jump if vector font
|
bne @L2 ; Jump if vector font
|
@ -20,7 +20,7 @@ Text := ptr3
|
|||||||
|
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; unsigned __fastcall__ tgi_textwidth (const char* s);
|
; unsigned __fastcall__ tgi_gettextwidth (const char* s);
|
||||||
; /* Calculate the width of the text in pixels according to the current text
|
; /* Calculate the width of the text in pixels according to the current text
|
||||||
; * style.
|
; * style.
|
||||||
; */
|
; */
|
||||||
@ -29,7 +29,7 @@ Text := ptr3
|
|||||||
;
|
;
|
||||||
|
|
||||||
.code
|
.code
|
||||||
.proc _tgi_textwidth
|
.proc _tgi_gettextwidth
|
||||||
|
|
||||||
ldy _tgi_font
|
ldy _tgi_font
|
||||||
bne @L1 ; Jump if vector font
|
bne @L1 ; Jump if vector font
|
@ -65,7 +65,7 @@
|
|||||||
jsr pushax ; Width scale = 1.0
|
jsr pushax ; Width scale = 1.0
|
||||||
jsr pushax ; Heigh scale = 1.0
|
jsr pushax ; Heigh scale = 1.0
|
||||||
jsr pusha ; Text direction = TGI_TEXT_HORIZONTAL
|
jsr pusha ; Text direction = TGI_TEXT_HORIZONTAL
|
||||||
jmp _tgi_textstyle ; A = Font = TGI_FONT_BITMAP
|
jmp _tgi_settextstyle ; A = Font = TGI_FONT_BITMAP
|
||||||
|
|
||||||
; Error exit
|
; Error exit
|
||||||
|
|
||||||
|
@ -25,35 +25,35 @@ widths := regbank+2
|
|||||||
|
|
||||||
.proc _tgi_outtext
|
.proc _tgi_outtext
|
||||||
|
|
||||||
ldy _tgi_font ; Bit or vectorfont?
|
ldy _tgi_font ; Bit or vectorfont?
|
||||||
bne VectorFont
|
bne VectorFont
|
||||||
|
|
||||||
; Handle bitmapped font output
|
; Handle bitmapped font output
|
||||||
|
|
||||||
sta ptr3
|
sta ptr3
|
||||||
stx ptr3+1 ; Pass s in ptr3 to driver
|
stx ptr3+1 ; Pass s in ptr3 to driver
|
||||||
pha
|
pha
|
||||||
txa
|
txa
|
||||||
pha ; Save s on stack for later
|
pha ; Save s on stack for later
|
||||||
|
|
||||||
jsr tgi_curtoxy ; Copy curx/cury into ptr1/ptr2
|
jsr tgi_curtoxy ; Copy curx/cury into ptr1/ptr2
|
||||||
jsr tgi_outtext ; Call the driver
|
jsr tgi_outtext ; Call the driver
|
||||||
|
|
||||||
pla
|
pla
|
||||||
tax
|
tax
|
||||||
pla ; Restore s
|
pla ; Restore s
|
||||||
jsr _tgi_textwidth ; Get width of text string
|
jsr _tgi_gettextwidth ; Get width of text string
|
||||||
|
|
||||||
; Move the graphics cursor by the amount in a/x
|
; Move the graphics cursor by the amount in a/x
|
||||||
|
|
||||||
MoveCursor:
|
MoveCursor:
|
||||||
ldy _tgi_textdir ; Horizontal or vertical text?
|
ldy _tgi_textdir ; Horizontal or vertical text?
|
||||||
beq @L1 ; Jump if horizontal
|
beq @L1 ; Jump if horizontal
|
||||||
|
|
||||||
; Move graphics cursor for vertical text
|
; Move graphics cursor for vertical text
|
||||||
|
|
||||||
jsr negax
|
jsr negax
|
||||||
ldy #2 ; Point to _tgi_cury
|
ldy #2 ; Point to _tgi_cury
|
||||||
|
|
||||||
; Move graphics cursor for horizontal text
|
; Move graphics cursor for horizontal text
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
.macpack cpu
|
.macpack cpu
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; void __fastcall__ tgi_textstyle (unsigned width, unsigned height,
|
; void __fastcall__ tgi_settextstyle (unsigned width, unsigned height,
|
||||||
; unsigned char dir, unsigned char font);
|
; unsigned char dir, unsigned char font);
|
||||||
; /* Set the style for text output. The scaling factors for width and height
|
; /* Set the style for text output. The scaling factors for width and height
|
||||||
; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
||||||
; * dir is one of the TGI_TEXT_XXX constants. font is one of the TGI_FONT_XXX
|
; * dir is one of the TGI_TEXT_XXX constants. font is one of the TGI_FONT_XXX
|
||||||
@ -21,7 +21,7 @@
|
|||||||
; */
|
; */
|
||||||
;
|
;
|
||||||
|
|
||||||
.proc _tgi_textstyle
|
.proc _tgi_settextstyle
|
||||||
|
|
||||||
sta _tgi_font ; Remember the font to use
|
sta _tgi_font ; Remember the font to use
|
||||||
jsr popa
|
jsr popa
|
||||||
@ -34,12 +34,12 @@
|
|||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; void __fastcall__ tgi_textscale (unsigned width, unsigned height);
|
; void __fastcall__ tgi_settextscale (unsigned width, unsigned height);
|
||||||
; /* Set the scaling for text output. The scaling factors for width and height
|
; /* Set the scaling for text output. The scaling factors for width and height
|
||||||
; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
|
||||||
; */
|
; */
|
||||||
|
|
||||||
.proc _tgi_textscale
|
.proc _tgi_settextscale
|
||||||
|
|
||||||
; Setup the height
|
; Setup the height
|
||||||
|
|
Loading…
Reference in New Issue
Block a user