]> git.sur5r.net Git - cc65/blobdiff - include/tgi/tgi-kernel.h
Merge pull request #297 from groessler/something_to_pull
[cc65] / include / tgi / tgi-kernel.h
index bf83d49aa5860772baa20c0b8bb63e1551ec3d2e..bc5fdc3c6016b6289040b9fbe073f4af142a333c 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2002      Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
-/* EMail:        uz@musoftware.de                                            */
+/* (C) 2002-2012, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 /*****************************************************************************/
-/*                                  Data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
 
-/* A structure that describes the header of a graphics driver loaded into
- * memory.
- */
-typedef struct {
-
-    /* Data that describes the capabilities of the driver */
-    char                id[3];          /* Contains 0x74, 0x67, 0x69 ("tgi") */
-    unsigned char       version;        /* Interface version */
-    unsigned            xres;           /* X resolution */
-    unsigned            yres;           /* Y resolution */
-    unsigned char       colorcount;     /* Number of available colors */
-    unsigned char       pagecount;      /* Number of screens available */
-    unsigned char      error;          /* Error code */
-    unsigned char       res[5];         /* Reserved for extensions */
-
-    /* Jump vectors. Note that these are not C callable */
-    void*               install;        /* INSTALL routine */
-    void*               deinstall;      /* DEINSTALL routine */
-    void*               init;           /* INIT routine */
-    void*               done;           /* DONE routine */
-    void*               control;        /* CONTROL routine */
-    void*               clear;          /* CLEAR routine */
-    void*               setviewpage;    /* SETVIEWPAGE routine */
-    void*               setdrawpage;    /* SETDRAWPAGE routine */
-    void*               setcolor;       /* SETCOLOR routine */
-    void*               setpixel;       /* SETPIXEL routine */
-    void*               getpixel;       /* GETPIXEL routine */
-    void*               line;           /* LINE routine */
-    void*               bar;            /* BAR routine */
-    void*               circle;         /* CIRCLE routine */
-
-} tgi_drv_header;
-
-
-
 /* TGI kernel variables */
-extern tgi_drv_header* tgi_drv;        /* Pointer to driver */
-extern unsigned char   tgi_error;      /* Last error code */
-extern unsigned char    tgi_mode;       /* Graphics mode or zero */
-extern int              tgi_curx;       /* Current drawing cursor X */
-extern int              tgi_cury;       /* Current drawing cursor Y */
-extern unsigned char    tgi_color;      /* Current drawing color */
-extern unsigned         tgi_xres;       /* X resolution of the current mode */
-extern unsigned         tgi_yres;       /* Y resolution of the current mode */
-extern unsigned char    tgi_colorcount; /* Number of available colors */
-extern unsigned char    tgi_pagecount;  /* Number of available screens */
-
-
-
-/*****************************************************************************/
-/*                                     Code                                  */
-/*****************************************************************************/
-
-
-
-const char* __fastcall__ tgi_map_mode (unsigned char mode);
-/* Map a tgi mode to a driver name. Returns NULL if no driver available. */
-
-void __fastcall__ tgi_setup (void);
-/* Setup the driver and graphics kernel once the driver is loaded */
+extern void*         tgi_drv;           /* Pointer to driver */
+extern unsigned char tgi_error;         /* Last error code */
+extern unsigned char tgi_gmode;         /* Flag: Graphics mode active */
+extern int           tgi_curx;          /* Current drawing cursor X */
+extern int           tgi_cury;          /* Current drawing cursor Y */
+extern unsigned char tgi_color;         /* Current drawing color */
+extern unsigned char tgi_font;          /* Current font type */
+extern unsigned      tgi_xres;          /* X resolution of the current mode */
+extern unsigned      tgi_yres;          /* Y resolution of the current mode */
+extern unsigned char tgi_colorcount;    /* Number of available colors */
+extern unsigned char tgi_pagecount;     /* Number of available screens */
+extern unsigned char tgi_fontwidth;     /* System font width in pixels */
+extern unsigned char tgi_fontheight;    /* System font height in pixels */
+extern unsigned      tgi_aspectratio;   /* Aspect ratio as fixed point 8.8 */
+extern unsigned char tgi_flags;         /* TGI driver flags */
+extern unsigned      tgi_textscalew[2]; /* Vector/bitmap font scale 8.8 */
+extern unsigned      tgi_textscaleh[2]; /* Vector/bitmap font scale 8.8 */
+extern unsigned      tgi_charwidth;     /* Width of scaled bitmap font */
+extern unsigned      tgi_charheight;    /* Height of scaled bitmap font */