/*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2002-2004 Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2002-2009, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 #define TGI_TEXT_HORIZONTAL     0
 #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;
+
 
 
 /*****************************************************************************/
 void __fastcall__ tgi_load_driver (const char* name);
 /* 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
- * explicitly. You should NOT use this function in most cases, use tgi_load()
- * instead.
+ * explicitly.
  */
 
 void __fastcall__ tgi_unload (void);
 
 
 ;----------------------------------------------------------------------------
 ; 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
 ; larger that 255 bytes!
 
 
 
 ;----------------------------------------------------------------------------
 ; 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
 ; larger that 255 bytes!
 
 
 
 ;----------------------------------------------------------------------------
 ; 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
 ; larger that 255 bytes!
 
 
 
 ;----------------------------------------------------------------------------
 ; 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
 ; larger that 255 bytes!
 
 
 
 ;----------------------------------------------------------------------------
 ; 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
 ; larger that 255 bytes!
 
 
                 tgi_setpalette.o        \
                 tgi_setpixel.o          \
                 tgi_setviewpage.o       \
+                tgi_stddrv.o            \
+                tgi_stdmode.o           \
                 tgi_textsize.o          \
                 tgi_textstyle.o         \
                 tgi_unload.o
 
--- /dev/null
+;
+; 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
+
 
--- /dev/null
+;
+; Standard tgi mode
+;
+; Ullrich von Bassewitz, 2009-09-11
+;
+; const unsigned char tgi_stdmode[];
+;
+
+        .import _tgi_mode_table
+       .export _tgi_stdmode    = _tgi_mode_table
+
 
 
 
 
-#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_FORE     COLOR_WHITE
 
     DoWarning ();
 
     /* Load and initialize the driver */
-    tgi_load (TGI_MODE);
+    tgi_load_driver (tgi_stddrv);
     CheckError ("tgi_load");
     tgi_init ();
     CheckError ("tgi_init");