From 9c555865692992e9c452b4c8d6b4c451add60f45 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 17 Jul 2011 18:36:12 +0000 Subject: [PATCH] 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 --- asminc/tgi-kernel.inc | 9 ++++---- include/tgi.h | 10 ++++----- libsrc/tgi/Makefile | 6 ++--- .../{tgi_textheight.s => tgi_gettextheight.s} | 6 ++--- .../{tgi_textwidth.s => tgi_gettextwidth.s} | 4 ++-- libsrc/tgi/tgi_init.s | 2 +- libsrc/tgi/tgi_outtext.s | 22 +++++++++---------- .../{tgi_textstyle.s => tgi_settextstyle.s} | 10 ++++----- 8 files changed, 35 insertions(+), 34 deletions(-) rename libsrc/tgi/{tgi_textheight.s => tgi_gettextheight.s} (90%) rename libsrc/tgi/{tgi_textwidth.s => tgi_gettextwidth.s} (96%) rename libsrc/tgi/{tgi_textstyle.s => tgi_settextstyle.s} (91%) diff --git a/asminc/tgi-kernel.inc b/asminc/tgi-kernel.inc index 9dd0dd453..15a32e8bf 100644 --- a/asminc/tgi-kernel.inc +++ b/asminc/tgi-kernel.inc @@ -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 diff --git a/include/tgi.h b/include/tgi.h index 90f8f2e85..bd312dc63 100644 --- a/include/tgi.h +++ b/include/tgi.h @@ -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. */ diff --git a/libsrc/tgi/Makefile b/libsrc/tgi/Makefile index 904c61212..e84d88b17 100644 --- a/libsrc/tgi/Makefile +++ b/libsrc/tgi/Makefile @@ -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 diff --git a/libsrc/tgi/tgi_textheight.s b/libsrc/tgi/tgi_gettextheight.s similarity index 90% rename from libsrc/tgi/tgi_textheight.s rename to libsrc/tgi/tgi_gettextheight.s index 7e0aee935..8daad941b 100644 --- a/libsrc/tgi/tgi_textheight.s +++ b/libsrc/tgi/tgi_gettextheight.s @@ -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 diff --git a/libsrc/tgi/tgi_textwidth.s b/libsrc/tgi/tgi_gettextwidth.s similarity index 96% rename from libsrc/tgi/tgi_textwidth.s rename to libsrc/tgi/tgi_gettextwidth.s index b75468114..9b39fb6a6 100644 --- a/libsrc/tgi/tgi_textwidth.s +++ b/libsrc/tgi/tgi_gettextwidth.s @@ -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 diff --git a/libsrc/tgi/tgi_init.s b/libsrc/tgi/tgi_init.s index 14e1bd9f9..2100d06e1 100644 --- a/libsrc/tgi/tgi_init.s +++ b/libsrc/tgi/tgi_init.s @@ -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 diff --git a/libsrc/tgi/tgi_outtext.s b/libsrc/tgi/tgi_outtext.s index 76fbf78ad..079cea3af 100644 --- a/libsrc/tgi/tgi_outtext.s +++ b/libsrc/tgi/tgi_outtext.s @@ -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 diff --git a/libsrc/tgi/tgi_textstyle.s b/libsrc/tgi/tgi_settextstyle.s similarity index 91% rename from libsrc/tgi/tgi_textstyle.s rename to libsrc/tgi/tgi_settextstyle.s index 8b65057c8..ba3cb188b 100644 --- a/libsrc/tgi/tgi_textstyle.s +++ b/libsrc/tgi/tgi_settextstyle.s @@ -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 -- 2.39.5