]> git.sur5r.net Git - cc65/blob - include/atari5200.h
Remove trailings spaces from CBM-related asm files
[cc65] / include / atari5200.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                               atari5200.h                                 */
4 /*                                                                           */
5 /*                   Atari 5200 system specific definitions                  */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2014      Christian Groessler <chris@groessler.org>                   */
10 /*                                                                           */
11 /*                                                                           */
12 /* This software is provided 'as-is', without any expressed or implied       */
13 /* warranty.  In no event will the authors be held liable for any damages    */
14 /* arising from the use of this software.                                    */
15 /*                                                                           */
16 /* Permission is granted to anyone to use this software for any purpose,     */
17 /* including commercial applications, and to alter it and redistribute it    */
18 /* freely, subject to the following restrictions:                            */
19 /*                                                                           */
20 /* 1. The origin of this software must not be misrepresented; you must not   */
21 /*    claim that you wrote the original software. If you use this software   */
22 /*    in a product, an acknowledgment in the product documentation would be  */
23 /*    appreciated but is not required.                                       */
24 /* 2. Altered source versions must be plainly marked as such, and must not   */
25 /*    be misrepresented as being the original software.                      */
26 /* 3. This notice may not be removed or altered from any source              */
27 /*    distribution.                                                          */
28 /*                                                                           */
29 /*****************************************************************************/
30
31
32
33 #ifndef _ATARI5200_H
34 #define _ATARI5200_H
35
36
37
38 /* Check for errors */
39 #if !defined(__ATARI5200__)
40 #  error This module may only be used when compiling for the Atari 5200!
41 #endif
42
43 /* no support for dynamically loadable drivers */
44 #define DYN_DRV 0
45
46 /* the addresses of the static drivers */
47 extern void atr5200std_joy[];        /* referred to by joy_static_stddrv[] */
48
49 /* make GTIA color value */
50 #define _gtia_mkcolor(hue,lum) (((hue) << 4) | ((lum) << 1))
51
52 /* luminance values go from 0 (black) to 7 (white) */
53
54 /* hue values */
55 #define HUE_GREY        0
56 #define HUE_GOLD        1
57 #define HUE_GOLDORANGE  2
58 #define HUE_REDORANGE   3
59 #define HUE_ORANGE      4
60 #define HUE_MAGENTA     5
61 #define HUE_PURPLE      6
62 #define HUE_BLUE        7
63 #define HUE_BLUE2       8
64 #define HUE_CYAN        9
65 #define HUE_BLUEGREEN   10
66 #define HUE_BLUEGREEN2  11
67 #define HUE_GREEN       12
68 #define HUE_YELLOWGREEN 13
69 #define HUE_YELLOW      14
70 #define HUE_YELLOWRED   15
71
72 /* Color defines, similar to c64 colors (untested) */
73 #define COLOR_BLACK             _gtia_mkcolor(HUE_GREY,0)
74 #define COLOR_WHITE             _gtia_mkcolor(HUE_GREY,7)
75 #define COLOR_RED               _gtia_mkcolor(HUE_REDORANGE,1)
76 #define COLOR_CYAN              _gtia_mkcolor(HUE_CYAN,3)
77 #define COLOR_VIOLET            _gtia_mkcolor(HUE_PURPLE,4)
78 #define COLOR_GREEN             _gtia_mkcolor(HUE_GREEN,2)
79 #define COLOR_BLUE              _gtia_mkcolor(HUE_BLUE,2)
80 #define COLOR_YELLOW            _gtia_mkcolor(HUE_YELLOW,7)
81 #define COLOR_ORANGE            _gtia_mkcolor(HUE_ORANGE,5)
82 #define COLOR_BROWN             _gtia_mkcolor(HUE_YELLOW,2)
83 #define COLOR_LIGHTRED          _gtia_mkcolor(HUE_REDORANGE,6)
84 #define COLOR_GRAY1             _gtia_mkcolor(HUE_GREY,2)
85 #define COLOR_GRAY2             _gtia_mkcolor(HUE_GREY,3)
86 #define COLOR_LIGHTGREEN        _gtia_mkcolor(HUE_GREEN,6)
87 #define COLOR_LIGHTBLUE         _gtia_mkcolor(HUE_BLUE,6)
88 #define COLOR_GRAY3             _gtia_mkcolor(HUE_GREY,5)
89
90 /* Masks for joy_read */
91 #define JOY_UP_MASK     0x01
92 #define JOY_DOWN_MASK   0x02
93 #define JOY_LEFT_MASK   0x04
94 #define JOY_RIGHT_MASK  0x08
95 #define JOY_BTN_1_MASK  0x10
96
97 /* get_tv return values */
98 #define AT_NTSC     0
99 #define AT_PAL      1
100
101 /* Define hardware */
102 #include <_gtia.h>
103 #define GTIA_READ  (*(struct __gtia_read*)0xC000)
104 #define GTIA_WRITE (*(struct __gtia_write*)0xC000)
105
106 #include <_pokey.h>
107 #define POKEY_READ  (*(struct __pokey_read*)0xE800)
108 #define POKEY_WRITE (*(struct __pokey_write*)0xE800)
109
110 #include <_antic.h>
111 #define ANTIC (*(struct __antic*)0xD400)
112
113 /* End of atari5200.h */
114 #endif