1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-10 19:29:45 +00:00

Define a standard driver and mode for tgi graphics and use it in the sample

program. The standard driver and mode is the first one in the tgi_mode_table.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4153 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-09-11 18:59:37 +00:00
parent 569b8d0e77
commit 7de61e351c
10 changed files with 46 additions and 17 deletions

View File

@ -6,10 +6,10 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 2002-2004 Ullrich von Bassewitz */ /* (C) 2002-2009, Ullrich von Bassewitz */
/* Römerstrasse 52 */ /* Roemerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
/* */ /* */
/* */ /* */
/* This software is provided 'as-is', without any expressed or implied */ /* This software is provided 'as-is', without any expressed or implied */
@ -57,6 +57,12 @@
#define TGI_TEXT_HORIZONTAL 0 #define TGI_TEXT_HORIZONTAL 0
#define TGI_TEXT_VERTICAL 1 #define TGI_TEXT_VERTICAL 1
/* The name of the standard tgi driver for a platform */
extern const char tgi_stddrv[];
/* The default tgi mode for a platform */
extern const unsigned char tgi_stdmode;
/*****************************************************************************/ /*****************************************************************************/
@ -74,8 +80,7 @@ void __fastcall__ tgi_load (unsigned char mode);
void __fastcall__ tgi_load_driver (const char* name); void __fastcall__ tgi_load_driver (const char* name);
/* Load and install the given driver. This function is identical to tgi_load /* Load and install the given driver. This function is identical to tgi_load
* with the only difference that the name of the driver is specified * with the only difference that the name of the driver is specified
* explicitly. You should NOT use this function in most cases, use tgi_load() * explicitly.
* instead.
*/ */
void __fastcall__ tgi_unload (void); void __fastcall__ tgi_unload (void);

View File

@ -10,7 +10,8 @@
;---------------------------------------------------------------------------- ;----------------------------------------------------------------------------
; Mode table. Contains entries of mode and driver name, the driver name being ; Mode table. Contains entries of mode and driver name, the driver name being
; null terminated. A mode with code zero terminates the list. ; null terminated. A mode with code zero terminates the list. The first entry
; defines also the default mode and driver for the system.
; BEWARE: The current implementation of tgi_map_mode does not work with tables ; BEWARE: The current implementation of tgi_map_mode does not work with tables
; larger that 255 bytes! ; larger that 255 bytes!

View File

@ -10,7 +10,8 @@
;---------------------------------------------------------------------------- ;----------------------------------------------------------------------------
; Mode table. Contains entries of mode and driver name, the driver name being ; Mode table. Contains entries of mode and driver name, the driver name being
; null terminated. A mode with code zero terminates the list. ; null terminated. A mode with code zero terminates the list. The first entry
; defines also the default mode and driver for the system.
; BEWARE: The current implementation of tgi_map_mode does not work with tables ; BEWARE: The current implementation of tgi_map_mode does not work with tables
; larger that 255 bytes! ; larger that 255 bytes!

View File

@ -10,7 +10,8 @@
;---------------------------------------------------------------------------- ;----------------------------------------------------------------------------
; Mode table. Contains entries of mode and driver name, the driver name being ; Mode table. Contains entries of mode and driver name, the driver name being
; null terminated. A mode with code zero terminates the list. ; null terminated. A mode with code zero terminates the list. The first entry
; defines also the default mode and driver for the system.
; BEWARE: The current implementation of tgi_map_mode does not work with tables ; BEWARE: The current implementation of tgi_map_mode does not work with tables
; larger that 255 bytes! ; larger that 255 bytes!

View File

@ -10,7 +10,8 @@
;---------------------------------------------------------------------------- ;----------------------------------------------------------------------------
; Mode table. Contains entries of mode and driver name, the driver name being ; Mode table. Contains entries of mode and driver name, the driver name being
; null terminated. A mode with code zero terminates the list. ; null terminated. A mode with code zero terminates the list. The first entry
; defines also the default mode and driver for the system.
; BEWARE: The current implementation of tgi_map_mode does not work with tables ; BEWARE: The current implementation of tgi_map_mode does not work with tables
; larger that 255 bytes! ; larger that 255 bytes!

View File

@ -10,7 +10,8 @@
;---------------------------------------------------------------------------- ;----------------------------------------------------------------------------
; Mode table. Contains entries of mode and driver name, the driver name being ; Mode table. Contains entries of mode and driver name, the driver name being
; null terminated. A mode with code zero terminates the list. ; null terminated. A mode with code zero terminates the list. The first entry
; defines also the default mode and driver for the system.
; BEWARE: The current implementation of tgi_map_mode does not work with tables ; BEWARE: The current implementation of tgi_map_mode does not work with tables
; larger that 255 bytes! ; larger that 255 bytes!

View File

@ -68,6 +68,8 @@ S_OBJS = tgi-kernel.o \
tgi_setpalette.o \ tgi_setpalette.o \
tgi_setpixel.o \ tgi_setpixel.o \
tgi_setviewpage.o \ tgi_setviewpage.o \
tgi_stddrv.o \
tgi_stdmode.o \
tgi_textsize.o \ tgi_textsize.o \
tgi_textstyle.o \ tgi_textstyle.o \
tgi_unload.o tgi_unload.o

11
libsrc/tgi/tgi_stddrv.s Normal file
View File

@ -0,0 +1,11 @@
;
; Name of the standard tgi driver
;
; Ullrich von Bassewitz, 2009-09-11
;
; const char tgi_stddrv[];
;
.import _tgi_mode_table
.export _tgi_stddrv = _tgi_mode_table + 1

11
libsrc/tgi/tgi_stdmode.s Normal file
View File

@ -0,0 +1,11 @@
;
; Standard tgi mode
;
; Ullrich von Bassewitz, 2009-09-11
;
; const unsigned char tgi_stdmode[];
;
.import _tgi_mode_table
.export _tgi_stdmode = _tgi_mode_table

View File

@ -7,11 +7,6 @@
#if defined(__APPLE2__) || defined(__APPLE2ENH__)
# define TGI_MODE TGI_MODE_280_192_8
#else
# define TGI_MODE TGI_MODE_320_200_2
#endif
#define COLOR_BACK COLOR_BLACK #define COLOR_BACK COLOR_BLACK
#define COLOR_FORE COLOR_WHITE #define COLOR_FORE COLOR_WHITE
@ -203,7 +198,7 @@ int main (void)
DoWarning (); DoWarning ();
/* Load and initialize the driver */ /* Load and initialize the driver */
tgi_load (TGI_MODE); tgi_load_driver (tgi_stddrv);
CheckError ("tgi_load"); CheckError ("tgi_load");
tgi_init (); tgi_init ();
CheckError ("tgi_init"); CheckError ("tgi_init");