1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-15 17:30:06 +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:
uz 2011-07-17 18:36:12 +00:00
parent 83d67e930a
commit 9c55586569
8 changed files with 35 additions and 34 deletions

View File

@ -134,6 +134,7 @@ TGI_CLIP_TOP = $08
.global _tgi_fontwidth ; System font width
.global _tgi_fontheight ; System font height
.global _tgi_aspectratio ; Aspect ratio, fixed point 8.8
.global _tgi_flags ; TGI driver flags
;------------------------------------------------------------------------------
; ASM accessible variables
@ -202,6 +203,8 @@ TGI_CLIP_TOP = $08
.global _tgi_getpagecount
.global _tgi_getpalette
.global _tgi_getpixel
.global _tgi_gettextheight
.global _tgi_gettextwidth
.global _tgi_getxres
.global _tgi_getyres
.global _tgi_gotoxy
@ -221,10 +224,8 @@ TGI_CLIP_TOP = $08
.global _tgi_setdrawpage
.global _tgi_setpalette
.global _tgi_setpixel
.global _tgi_settextscale
.global _tgi_settextstyle
.global _tgi_setviewpage
.global _tgi_textheight
.global _tgi_textscale
.global _tgi_textstyle
.global _tgi_textwidth
.global _tgi_uninstall
.global _tgi_unload

View File

@ -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);
/* 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
* are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
*/
void __fastcall__ tgi_textstyle (unsigned width, unsigned height,
unsigned char dir, unsigned char font);
void __fastcall__ tgi_settextstyle (unsigned width, unsigned height,
unsigned char dir, unsigned char font);
/* 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.
* dir is one of the TGI_TEXT_XXX constants. font is one of the TGI_FONT_XXX
* 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
* 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
* style.
*/

View File

@ -56,6 +56,8 @@ S_OBJS = tgi-kernel.o \
tgi_getpalette.o \
tgi_getpixel.o \
tgi_getset.o \
tgi_gettextheight.o \
tgi_gettextwidth.o \
tgi_getxres.o \
tgi_getyres.o \
tgi_gotoxy.o \
@ -76,10 +78,8 @@ S_OBJS = tgi-kernel.o \
tgi_setdrawpage.o \
tgi_setpalette.o \
tgi_setpixel.o \
tgi_settextstyle.o \
tgi_setviewpage.o \
tgi_textheight.o \
tgi_textwidth.o \
tgi_textstyle.o \
tgi_unload.o \
tgi_vectorchar.o

View File

@ -2,20 +2,20 @@
; Ullrich von Bassewitz, 2009-10-30
;
.include "tgi-kernel.inc"
.include "tgi-vectorfont.inc"
.include "zeropage.inc"
;-----------------------------------------------------------------------------
; 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
; * style.
; */
;
.proc _tgi_textheight
.proc _tgi_gettextheight
ldy _tgi_font
bne @L2 ; Jump if vector font

View File

@ -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
; * style.
; */
@ -29,7 +29,7 @@ Text := ptr3
;
.code
.proc _tgi_textwidth
.proc _tgi_gettextwidth
ldy _tgi_font
bne @L1 ; Jump if vector font

View File

@ -65,7 +65,7 @@
jsr pushax ; Width scale = 1.0
jsr pushax ; Heigh scale = 1.0
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

View File

@ -25,35 +25,35 @@ widths := regbank+2
.proc _tgi_outtext
ldy _tgi_font ; Bit or vectorfont?
ldy _tgi_font ; Bit or vectorfont?
bne VectorFont
; Handle bitmapped font output
sta ptr3
stx ptr3+1 ; Pass s in ptr3 to driver
stx ptr3+1 ; Pass s in ptr3 to driver
pha
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_outtext ; Call the driver
jsr tgi_curtoxy ; Copy curx/cury into ptr1/ptr2
jsr tgi_outtext ; Call the driver
pla
tax
pla ; Restore s
jsr _tgi_textwidth ; Get width of text string
pla ; Restore s
jsr _tgi_gettextwidth ; Get width of text string
; Move the graphics cursor by the amount in a/x
MoveCursor:
ldy _tgi_textdir ; Horizontal or vertical text?
beq @L1 ; Jump if horizontal
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
ldy #2 ; Point to _tgi_cury
; Move graphics cursor for horizontal text
@ -125,7 +125,7 @@ VectorFont:
jsr MoveCursor ; Move the graphics cursor
; Next char in string
inc text
bne @L1
inc text+1

View File

@ -12,8 +12,8 @@
.macpack cpu
;-----------------------------------------------------------------------------
; void __fastcall__ tgi_textstyle (unsigned width, unsigned height,
; unsigned char dir, unsigned char font);
; void __fastcall__ tgi_settextstyle (unsigned width, unsigned height,
; unsigned char dir, unsigned char font);
; /* 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.
; * 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
jsr popa
@ -34,12 +34,12 @@
.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
; * are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
; */
.proc _tgi_textscale
.proc _tgi_settextscale
; Setup the height