]> git.sur5r.net Git - cc65/blobdiff - include/atari.h
memmove, memcpy, memset and bzero now return dest ptr as they should
[cc65] / include / atari.h
index 2238c8f84cf49dcdb32b90c53bf8e2b0cf17ea2e..4ceadfd62e38c321e78c83b0041f5cd15870b07a 100644 (file)
 /*                                                                           */
 /*****************************************************************************/
 
+
+
 #ifndef _ATARI_H
 #define _ATARI_H
 
+
+
+/* Check for errors */
+#if !defined(__ATARI__)
+#  error This module may only be used when compiling for the Atari!
+#endif
+
+
+
 /* Character codes */
 #define CH_DEL                 0xFE
 #define CH_ESC                 0x1B
 #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) */
+/* Use the defines with the setcolor() or _atari_xxxcolor() functions */
 #define COLOR_BLACK            _gtia_mkcolor(HUE_GREY,0)
 #define COLOR_WHITE            _gtia_mkcolor(HUE_GREY,7)
 #define COLOR_RED              _gtia_mkcolor(HUE_REDORANGE,1)
@@ -121,32 +134,40 @@ extern void __fastcall__ setcolor     (unsigned char color_reg, unsigned char hu
 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);
+
 /* other screen functions */
+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 int get_ostype(void); /* get ROM version */
+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 */
 
 /* get_ostype return value defines (for explanation, see ostype.s) */
 /* masks */
 #define AT_OS_TYPE_MAIN  7
-#define AT_OS_PALNTSC    (3 << 3)
-#define AT_OS_TYPE_MINOR (7 << 5)
+#define AT_OS_TYPE_MINOR (7 << 3)
 /* AT_OS_TYPE_MAIN values */
 #define AT_OS_UNKNOWN  0
 #define AT_OS_400800   1
 #define AT_OS_1200XL   2
 #define AT_OS_XLXE     3
-/* AT_OS_PALNTSC values */
-#define AT_OS_PAL      1
-#define AT_OS_NTSC     2
 /* AS_OS_TYPE_MINOR values */
-#define AT_OS_400800_A 1
-#define AT_OS_400800_B 2
+/* for 400/800 remember this are the ROM versions */
+/* to check whether the hw is PAL or NTSC, use get_tv() */
+#define AT_OS_400800PAL_A  1
+#define AT_OS_400800PAL_B  2
+#define AT_OS_400800NTSC_A 1
+#define AT_OS_400800NTSC_B 2
 #define AT_OS_1200_10  1
 #define AT_OS_1200_11  2
 #define AT_OS_XLXE_1   1
@@ -154,6 +175,10 @@ extern unsigned int get_ostype(void); /* get ROM version */
 #define AT_OS_XLXE_3   3
 #define AT_OS_XLXE_4   4
 
+/* get_tv return values */
+#define AT_NTSC     0
+#define AT_PAL      1
+
 /* Define hardware */
 #include <_gtia.h>
 #define GTIA_READ  (*(struct __gtia_read*)0xD000)
@@ -171,5 +196,20 @@ extern unsigned int get_ostype(void); /* get ROM version */
 #include <_antic.h>
 #define ANTIC (*(struct __antic*)0xD400)
 
+/* device control block */
+struct __dcb {
+    unsigned char device;     /* device id */
+    unsigned char unit;       /* unit number */
+    unsigned char command;    /* command */
+    unsigned char status;     /* command type / status return */
+    void          *buffer;    /* pointer to buffer */
+    unsigned char timeout;    /* device timeout in seconds */
+    unsigned char unused;
+    unsigned int  xfersize;   /* # of bytes to transfer */
+    unsigned char aux1;       /* 1st command auxiliary byte */
+    unsigned char aux2;       /* 2nd command auxiliary byte */
+};
+#define DCB (*(struct __dcb *)0x300)
+
 /* End of atari.h */
 #endif /* #ifndef _ATARI_H */