]> git.sur5r.net Git - cc65/commitdiff
Allow to replace the color functions in conio.h by macros for platforms
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 26 Mar 2005 17:20:27 +0000 (17:20 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 26 Mar 2005 17:20:27 +0000 (17:20 +0000)
where these functions are dummies anyway.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3422 b7a2c559-68d2-44c3-8de9-860c34a00d81

include/apple2.h
include/cbm610.h
include/conio.h
include/pet.h

index 175df71d8762fd64c2585ae39f5df6a681d0f671..eeda7bac44672b012c056a1a5f2f2d0cceecc1fc 100644 (file)
@@ -1,32 +1,32 @@
 /*****************************************************************************/
-/*                                                                          */
-/*                                apple2.h                                  */
-/*                                                                          */
-/*                  Apple ][ system specific definitions                    */
-/*                                                                          */
-/*                                                                          */
-/*                                                                          */
-/* (C) 2000  Kevin Ruland, <kevin@rodin.wustl.edu>                          */
-/* (C) 2003  Ullrich von Bassewitz, <uz@cc65.org>                           */
-/*                                                                          */
-/*                                                                          */
-/* This software is provided 'as-is', without any expressed or implied      */
+/*                                                                           */
+/*                                 apple2.h                                 */
+/*                                                                           */
+/*                   Apple ][ system specific definitions                   */
+/*                                                                           */
+/*                                                                           */
+/*                                                                           */
+/* (C) 2000  Kevin Ruland, <kevin@rodin.wustl.edu>                           */
+/* (C) 2003  Ullrich von Bassewitz, <uz@cc65.org>                            */
+/*                                                                           */
+/*                                                                           */
+/* This software is provided 'as-is', without any expressed or implied       */
 /* warranty.  In no event will the authors be held liable for any damages    */
-/* arising from the use of this software.                                   */
-/*                                                                          */
+/* arising from the use of this software.                                    */
+/*                                                                           */
 /* Permission is granted to anyone to use this software for any purpose,     */
 /* including commercial applications, and to alter it and redistribute it    */
-/* freely, subject to the following restrictions:                           */
-/*                                                                          */
+/* freely, subject to the following restrictions:                            */
+/*                                                                           */
 /* 1. The origin of this software must not be misrepresented; you must not   */
 /*    claim that you wrote the original software. If you use this software   */
 /*    in a product, an acknowledgment in the product documentation would be  */
-/*    appreciated but is not required.                                      */
+/*    appreciated but is not required.                                       */
 /* 2. Altered source versions must be plainly marked as such, and must not   */
-/*    be misrepresented as being the original software.                     */
-/* 3. This notice may not be removed or altered from any source             */
-/*    distribution.                                                         */
-/*                                                                          */
+/*    be misrepresented as being the original software.                      */
+/* 3. This notice may not be removed or altered from any source              */
+/*    distribution.                                                          */
+/*                                                                           */
 /*****************************************************************************/
 
 
@@ -44,7 +44,7 @@
 
 
 /*****************************************************************************/
-/*                                  Data                                    */
+/*                                   Data                                   */
 /*****************************************************************************/
 
 
  * used to get the library to compile correctly.  They should not be used
  * in user code
  */
-#define COLOR_BLACK    0x00
-#define COLOR_WHITE    0x01
+#define COLOR_BLACK     0x00
+#define COLOR_WHITE     0x01
 
 /* Characters codes */
-#define CH_ENTER       0x0D
-#define CH_ESC         0x1B
-#define CH_CURS_LEFT   0x08
-#define CH_CURS_RIGHT  0x15
-
-#define CH_ULCORNER    '+'
-#define CH_URCORNER    '+'
-#define CH_LLCORNER    '+'
-#define CH_LRCORNER    '+'
-#define CH_TTEE        '+'
-#define CH_BTEE        '+'
-#define CH_LTEE        '+'
-#define CH_RTEE        '+'
-#define CH_CROSS       '+'
+#define CH_ENTER        0x0D
+#define CH_ESC          0x1B
+#define CH_CURS_LEFT    0x08
+#define CH_CURS_RIGHT   0x15
+
+#define CH_ULCORNER     '+'
+#define CH_URCORNER     '+'
+#define CH_LLCORNER     '+'
+#define CH_LRCORNER     '+'
+#define CH_TTEE         '+'
+#define CH_BTEE         '+'
+#define CH_LTEE         '+'
+#define CH_RTEE         '+'
+#define CH_CROSS        '+'
 
 /* Return codes for get_ostype */
 #define APPLE_UNKNOWN 0x00
-#define APPLE_II      0x10             /* Apple ][                     */
-#define APPLE_IIPLUS  0x11             /* Apple ][+                    */
-#define APPLE_IIIEM   0x20             /* Apple /// (emulation)        */
-#define APPLE_IIE     0x30             /* Apple //e                    */
-#define APPLE_IIEENH  0x31             /* Apple //e (enhanced)         */
-#define APPLE_IIECARD 0x40             /* Apple //e Option Card        */
-#define APPLE_IIC     0x50             /* Apple //c                    */
-#define APPLE_IIC35   0x51             /* Apple //c (3.5 ROM)          */
-#define APPLE_IICEXP  0x53             /* Apple //c (Mem. Exp.)        */
-#define APPLE_IICREV  0x54             /* Apple //c (Rev. Mem. Exp.)   */
-#define APPLE_IICPLUS 0x55             /* Apple //c Plus               */
-#define        APPLE_IIGS    0x80              /* Apple IIgs                   */
-#define        APPLE_IIGS1   0x81              /* Apple IIgs (ROM 1)           */
-#define        APPLE_IIGS3   0x83              /* Apple IIgs (ROM 3)           */
+#define APPLE_II      0x10              /* Apple ][                    */
+#define APPLE_IIPLUS  0x11              /* Apple ][+                   */
+#define APPLE_IIIEM   0x20              /* Apple /// (emulation)       */
+#define APPLE_IIE     0x30              /* Apple //e                   */
+#define APPLE_IIEENH  0x31              /* Apple //e (enhanced)                */
+#define APPLE_IIECARD 0x40              /* Apple //e Option Card       */
+#define APPLE_IIC     0x50              /* Apple //c                   */
+#define APPLE_IIC35   0x51              /* Apple //c (3.5 ROM)         */
+#define APPLE_IICEXP  0x53              /* Apple //c (Mem. Exp.)       */
+#define APPLE_IICREV  0x54              /* Apple //c (Rev. Mem. Exp.)  */
+#define APPLE_IICPLUS 0x55              /* Apple //c Plus              */
+#define APPLE_IIGS    0x80             /* Apple IIgs                   */
+#define APPLE_IIGS1   0x81             /* Apple IIgs (ROM 1)           */
+#define APPLE_IIGS3   0x83             /* Apple IIgs (ROM 3)           */
+
+extern unsigned char _dos_type;
+/* Valid _dos_type values:
+ *
+ * AppleDOS 3.3   - 0x00
+ * ProDOS 8 1.0.1 - 0x10
+ * ProDOS 8 1.0.2 - 0x10
+ * ProDOS 8 1.1.1 - 0x11
+ * ProDOS 8 1.2   - 0x12
+ * ProDOS 8 1.3   - 0x13
+ * ProDOS 8 1.4   - 0x14
+ * ProDOS 8 1.5   - 0x15
+ * ProDOS 8 1.6   - 0x16
+ * ProDOS 8 1.7   - 0x17
+ * ProDOS 8 1.8   - 0x18
+ * ProDOS 8 1.9   - 0x18
+ * ProDOS 8 2.0.1 - 0x21
+ * ProDOS 8 2.0.2 - 0x22
+ * ProDOS 8 2.0.3 - 0x23
+ */
+
 
 
 /*****************************************************************************/
-/*                                  Code                                    */
+/*                                   Code                                   */
 /*****************************************************************************/
 
 
 unsigned char get_ostype (void);
 /* Get the machine type. Returns one of the APPLE_xxx codes. */
 
+/* The following #defines will cause the matching functions calls in conio.h
+ * to be overlaid by macros with the same names, saving the function call
+ * overhead.
+ */
+#define _textcolor(color)       COLOR_WHITE
+#define _bgcolor(color)         COLOR_BLACK
+#define _bordercolor(color)     COLOR_BLACK
+
 
 
 /* End of apple2.h */
index d3a37d97752e77b23c0a4175e17a397e440b9744..e1b4a9df82c4d4f023e2413d913d608f2c652f35 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                cbm610.h                                  */
+/*                                 cbm610.h                                 */
 /*                                                                           */
-/*                   CBM610 system specific definitions                     */
+/*                    CBM610 system specific definitions                    */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
 
 
 
-/* Additional key defines */
-#define CH_F1                  224
-#define CH_F2                  225
-#define CH_F3                  226
-#define CH_F4                  227
-#define CH_F5                  228
-#define CH_F6                  229
-#define CH_F7                  230
-#define CH_F8                  231
-#define CH_F9                  232
-#define CH_F10                 233
-#define CH_F11                 234
-#define CH_F12                 235
-#define CH_F13                 236
-#define CH_F14                 237
-#define CH_F15                 238
-#define CH_F16                 239
-#define CH_F17                 240
-#define CH_F18                 241
-#define CH_F19                 242
-#define CH_F20                 243
+/*****************************************************************************/
+/*                                   Data                                   */
+/*****************************************************************************/
+
 
 
+/* Additional key defines */
+#define CH_F1                   224
+#define CH_F2                   225
+#define CH_F3                   226
+#define CH_F4                   227
+#define CH_F5                   228
+#define CH_F6                   229
+#define CH_F7                   230
+#define CH_F8                   231
+#define CH_F9                   232
+#define CH_F10                  233
+#define CH_F11                  234
+#define CH_F12                  235
+#define CH_F13                  236
+#define CH_F14                  237
+#define CH_F15                  238
+#define CH_F16                  239
+#define CH_F17                  240
+#define CH_F18                  241
+#define CH_F19                  242
+#define CH_F20                  243
 
 /* Color defines */
-#define COLOR_BLACK            0x00
-#define COLOR_WHITE            0x01
+#define COLOR_BLACK                    0x00
+#define COLOR_WHITE                    0x01
+
+/* Define hardware */
+#include <_6545.h>
+#define CRTC    (*(struct __6545)0xD800)
+
+#include <_sid.h>
+#define SID    (*(struct __sid*)0xDA00)
+
+#include <_6526.h>
+#define CIA     (*(struct __cia*)0xDC00)
+
+#include <_6551.h>
+#define ACIA    (*(struct __6551*)0xDD00)
+
+#include <_6525.h>
+#define TPI1    (*(struct __6525*)0xDE00)
+#define TPI2    (*(struct __6525*)0xDF00)
+
+
+
+/*****************************************************************************/
+/*                                   Code                                   */
+/*****************************************************************************/
 
 
 
@@ -98,22 +125,13 @@ void __fastcall__ pokewsys (unsigned addr, unsigned val);
 
 
 
-/* Define hardware */
-#include <_6545.h>
-#define CRTC   (*(struct __6545)0xD800)
-
-#include <_sid.h>
-#define        SID     (*(struct __sid*)0xDA00)
-
-#include <_6526.h>
-#define CIA    (*(struct __cia*)0xDC00)
-
-#include <_6551.h>
-#define ACIA   (*(struct __6551*)0xDD00)
-
-#include <_6525.h>
-#define TPI1   (*(struct __6525*)0xDE00)
-#define TPI2   (*(struct __6525*)0xDF00)
+/* The following #defines will cause the matching functions calls in conio.h
+ * to be overlaid by macros with the same names, saving the function call
+ * overhead.
+ */
+#define _textcolor(color)       COLOR_WHITE
+#define _bgcolor(color)         COLOR_BLACK
+#define _bordercolor(color)     COLOR_BLACK
 
 
 
index 4a7bd0eb773d0708d50b638bbbf3b34ae9d20f5f..300a3be6fd0be8402806b12661de86eaa84dba22 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2004 Ullrich von Bassewitz                                       */
+/* (C) 1998-2005 Ullrich von Bassewitz                                       */
 /*               Römerstraße 52                                              */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
@@ -191,6 +191,34 @@ void __fastcall__ cputhex16 (unsigned val);
 
 
 
+/*****************************************************************************/
+/*                                  Macros                                   */
+/*****************************************************************************/
+
+
+
+/* On some platforms, functions are not available or are dummys. To suppress
+ * the call to these functions completely, the platform header files may
+ * define macros for these functions that start with an underline. If such a
+ * macro exists, a new macro is defined here, that expands to the one with the
+ * underline. The reason for this two stepped approach is that it is sometimes
+ * necessary to take the address of the function, which is not possible when
+ * using a macro. Since the function prototype is still present, #undefining
+ * the macro will give access to the actual function.
+ */
+
+#if defined(_textcolor)
+#  define textcolor(x)          _textcolor(x)
+#endif
+#if defined(_bgcolor)
+#  define bgcolor(x)            _bgcolor(x)
+#endif
+#if defined(_bordercolor)
+#  define bordercolor(x)        _bordercolor(x)
+#endif
+
+
+
 /* End of conio.h */
 #endif
 
index 79abbb82a50700611694f4461f30f4ddcf5b28ff..3ad4dd1904058fee474227f4e8631fb2f6d9471b 100644 (file)
@@ -1,12 +1,12 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                  pet.h                                   */
+/*                                   pet.h                                   */
 /*                                                                           */
-/*                     PET system specific definitions                      */
+/*                      PET system specific definitions                             */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2004 Ullrich von Bassewitz                                       */
+/* (C) 1998-2005 Ullrich von Bassewitz                                       */
 /*               Römerstraße 52                                              */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 
 
 
-/* Color defines */
-#define COLOR_BLACK            0x00
-#define COLOR_WHITE            0x01
+/*****************************************************************************/
+/*                                   Data                                    */
+/*****************************************************************************/
 
 
 
+/* Color defines */
+#define COLOR_BLACK                    0x00
+#define COLOR_WHITE                    0x01
+
 /* Define hardware */
 #include <_pia.h>
-#define PIA1   (*(struct __pia*)0xE810)
-#define PIA2   (*(struct __pia*)0xE820)
+#define PIA1    (*(struct __pia*)0xE810)
+#define PIA2    (*(struct __pia*)0xE820)
 
 #include <_6522.h>
-#define VIA            (*(struct __6522*)0xE840)
+#define VIA     (*(struct __6522*)0xE840)
+
+
+
+/*****************************************************************************/
+/*                                   Code                                    */
+/*****************************************************************************/
+
+
+
+/* The following #defines will cause the matching functions calls in conio.h
+ * to be overlaid by macros with the same names, saving the function call
+ * overhead.
+ */
+#define _textcolor(color)       COLOR_WHITE
+#define _bgcolor(color)         COLOR_BLACK
+#define _bordercolor(color)     COLOR_BLACK