]> git.sur5r.net Git - cc65/blobdiff - include/atari.h
Ignore a few more "harmless" functions when optimizing.
[cc65] / include / atari.h
index 4ceadfd62e38c321e78c83b0041f5cd15870b07a..f22479095b5649dc42b213747204347fd8f31895 100644 (file)
@@ -6,9 +6,9 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000 Mark Keates <markk@dendrite.co.uk>                               */
-/*          Freddy Offenga <taf_offenga@yahoo.com>                           */
-/*          Christian Groessler <cpg@aladdin.de>                             */
+/* (C) 2000-2006 Mark Keates <markk@dendrite.co.uk>                          */
+/*               Freddy Offenga <taf_offenga@yahoo.com>                      */
+/*               Christian Groessler <chris@groessler.org>                   */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -45,7 +45,8 @@
 
 
 /* Character codes */
-#define CH_DEL                 0xFE
+#define CH_DELCHR      0xFE   /* delete char under the cursor */
+#define CH_ENTER       0x9B
 #define CH_ESC                 0x1B
 #define CH_CURS_UP     28
 #define CH_CURS_DOWN   29
@@ -56,7 +57,8 @@
 #define CH_EOL          0x9B   /* end-of-line marker */
 #define CH_CLR          0x7D   /* clear screen */
 #define CH_BEL          0xFD   /* bell */
-#define CH_RUBOUT       0x7E   /* back space (rubout) */
+#define CH_DEL          0x7E   /* back space (delete char to the left) */
+#define CH_RUBOUT       0x7E   /* back space (old, deprecated) */
 #define CH_DELLINE      0x9C   /* delete line */
 #define CH_INSLINE      0x9D   /* insert line */
 
@@ -80,9 +82,9 @@
 #define CH_BTEE        0x18
 #define CH_LTEE        0x01
 #define CH_RTEE        0x04
-#define CH_CROSS       0x19
+#define CH_CROSS       0x13
 #define CH_HLINE        0x12
-#define CH_VLINE        0x16
+#define CH_VLINE        0x7C
 
 /* color defines */
 
 #define HUE_GREEN       12
 #define HUE_YELLOWGREEN 13
 #define HUE_YELLOW      14
-#define HUE_YELLOWRED   15                                       
+#define HUE_YELLOWRED   15
 
 /* Color defines, similar to c64 colors (untested) */
 /* Note that the conio color implementation is monochrome (bgcolor and textcolor are only placeholders) */
 #define COLOR_GRAY3            _gtia_mkcolor(HUE_GREY,5)
 
 /* color register functions */
-extern void __fastcall__ setcolor     (unsigned char color_reg, unsigned char hue, unsigned char luminace);
-extern void __fastcall__ setcolor_low (unsigned char color_reg, unsigned char color_value);
-extern unsigned char __fastcall__ getcolor (unsigned char color_reg);
-
-/* function similar to conio color functions; please note that _atari_textcolor only sets the */
-/* luminance of the text in standard text mode */
-extern unsigned char __fastcall__ _atari_textcolor (unsigned char color);
-extern unsigned char __fastcall__ _atari_bgcolor (unsigned char color);
-extern unsigned char __fastcall__ _atari_bordercolor (unsigned char color);
+extern void __fastcall__ _setcolor     (unsigned char color_reg, unsigned char hue, unsigned char luminace);
+extern void __fastcall__ _setcolor_low (unsigned char color_reg, unsigned char color_value);
+extern unsigned char __fastcall__ _getcolor (unsigned char color_reg);
 
 /* other screen functions */
-extern int  __fastcall__ graphics(unsigned char mode); /* mode value same as in BASIC */
-extern void __fastcall__ scroll (signed char numlines);
+extern int  __fastcall__ _graphics (unsigned char mode); /* mode value same as in BASIC */
+extern void __fastcall__ _scroll (signed char numlines);
                                           /* numlines > 0  scrolls up */
                                           /* numlines < 0  scrolls down */
 
 /* misc. functions */
-extern void save_vecs(void);           /* save system vectors */
-extern void rest_vecs(void);           /* restore system vectors */
-extern unsigned char get_ostype(void); /* get ROM version */
-extern unsigned char get_tv(void);     /* get TV system */
+extern unsigned char get_ostype(void);  /* get ROM version */
+extern unsigned char get_tv(void);      /* get TV system */
+extern void _save_vecs(void);           /* save system vectors */
+extern void _rest_vecs(void);           /* restore system vectors */
+extern char *_getdefdev(void);          /* get default floppy device */
+
+/* global variables */
+extern unsigned char _dos_type;        /* the DOS flavour */
+
+/* provide old names for backwards compatibility */
+#ifdef ATARI_COMPAT_PRE_2_11
+#define setcolor     _setcolor
+#define setcolor_low _setcolor_low
+#define getcolor     _getcolor
+#define graphics     _graphics
+#define scroll       _scroll
+#define save_vecs    _save_vecs
+#define rest_vecs    _rest_vecs
+#define getdefdev    _getdefdev
+#endif  /* #ifdef ATARI_COMPAT_PRE_2_11 */
 
 /* get_ostype return value defines (for explanation, see ostype.s) */
 /* masks */
@@ -179,6 +191,14 @@ extern unsigned char get_tv(void);     /* get TV system */
 #define AT_NTSC     0
 #define AT_PAL      1
 
+/* valid _dos_type values */
+#define ATARIDOS    0
+#define SPARTADOS   1
+#define OSADOS      2
+#define MYDOS       3
+#define XDOS        4
+#define NODOS       255
+
 /* Define hardware */
 #include <_gtia.h>
 #define GTIA_READ  (*(struct __gtia_read*)0xD000)
@@ -211,5 +231,24 @@ struct __dcb {
 };
 #define DCB (*(struct __dcb *)0x300)
 
+/* I/O control block */
+struct __iocb {
+    unsigned char handler;    /* handler index number (0xff free) */
+    unsigned char drive;      /* device number (drive) */
+    unsigned char command;    /* command */
+    unsigned char status;     /* status of last operation */
+    void          *buffer;    /* pointer to buffer */
+    void          *put_byte;  /* pointer to device's PUT BYTE routine */
+    unsigned int  buflen;     /* length of buffer */
+    unsigned char aux1;       /* 1st auxiliary byte */
+    unsigned char aux2;       /* 2nd auxiliary byte */
+    unsigned char aux3;       /* 3rd auxiliary byte */
+    unsigned char aux4;       /* 4th auxiliary byte */
+    unsigned char aux5;       /* 5th auxiliary byte */
+    unsigned char spare;      /* spare byte */
+};
+#define ZIOCB (*(struct __iocb *)0x20)  /* zero page IOCB */
+#define IOCB (*(struct __iocb *)0x340)  /* system IOCB buffers */
+
 /* End of atari.h */
 #endif /* #ifndef _ATARI_H */