]> git.sur5r.net Git - cc65/blob - include/atmos.h
Merge pull request #849 from polluks/patch-4
[cc65] / include / atmos.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 atmos.h                                   */
4 /*                                                                           */
5 /*                   Oric Atmos system-specific definitions                  */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2002       Debrune Jérome, <jede@oric.org>                            */
10 /* (C) 2003-2013  Ullrich von Bassewitz                                      */
11 /*                Roemerstrasse 52                                           */
12 /*                D-70794 Filderstadt                                        */
13 /* EMail:         uz@cc65.org                                                */
14 /*                                                                           */
15 /*                                                                           */
16 /* This software is provided 'as-is', without any expressed or implied       */
17 /* warranty.  In no event will the authors be held liable for any damages    */
18 /* arising from the use of this software.                                    */
19 /*                                                                           */
20 /* Permission is granted to anyone to use this software for any purpose,     */
21 /* including commercial applications, and to alter it and redistribute it    */
22 /* freely, subject to the following restrictions:                            */
23 /*                                                                           */
24 /* 1. The origin of this software must not be misrepresented; you must not   */
25 /*    claim that you wrote the original software. If you use this software   */
26 /*    in a product, an acknowledgment in the product documentation would be  */
27 /*    appreciated but is not required.                                       */
28 /* 2. Altered source versions must be plainly marked as such, and must not   */
29 /*    be misrepresented as being the original software.                      */
30 /* 3. This notice may not be removed or altered from any source              */
31 /*    distribution.                                                          */
32 /*                                                                           */
33 /*****************************************************************************/
34
35
36
37 #ifndef _ATMOS_H
38 #define _ATMOS_H
39
40
41
42 /* Check for errors */
43 #if !defined(__ATMOS__)
44 #  error This module may only be used when compiling for the Oric Atmos!
45 #endif
46
47
48
49 /* Color defines */
50 #define COLOR_BLACK     0x00
51 #define COLOR_RED       0x01
52 #define COLOR_GREEN     0x02
53 #define COLOR_YELLOW    0x03
54 #define COLOR_BLUE      0x04
55 #define COLOR_MAGENTA   0x05
56 #define COLOR_CYAN      0x06
57 #define COLOR_WHITE     0x07
58
59 /* TGI color defines */
60 /* White and red are swapped, so that the pallete
61 ** driver is compatible with black-and-white drivers.
62 */
63 #define TGI_COLOR_BLACK         COLOR_BLACK
64 #define TGI_COLOR_WHITE         1
65 #define TGI_COLOR_GREEN         COLOR_GREEN
66 #define TGI_COLOR_YELLOW        COLOR_YELLOW
67 #define TGI_COLOR_BLUE          COLOR_BLUE
68 #define TGI_COLOR_MAGENTA       COLOR_MAGENTA
69 #define TGI_COLOR_CYAN          COLOR_CYAN
70 #define TGI_COLOR_RED           7
71
72
73
74 /* Define hardware */
75 #include <_6522.h>
76 #define VIA     (*(struct __6522*)0x300)
77
78
79
80 /* These are defined to be FUNCT + NumberKey */
81 #define CH_F1           0xB1
82 #define CH_F2           0xB2
83 #define CH_F3           0xB3
84 #define CH_F4           0xB4
85 #define CH_F5           0xB5
86 #define CH_F6           0xB6
87 #define CH_F7           0xB7
88 #define CH_F8           0xB8
89 #define CH_F9           0xB9
90 #define CH_F10          0xB0
91
92
93
94 /* Character codes */
95 #define CH_ULCORNER     '+'
96 #define CH_URCORNER     '+'
97 #define CH_LLCORNER     '+'
98 #define CH_LRCORNER     '+'
99 #define CH_TTEE         '+'
100 #define CH_BTEE         '+'
101 #define CH_LTEE         '+'
102 #define CH_RTEE         '+'
103 #define CH_CROSS        '+'
104 #define CH_CURS_UP       11
105 #define CH_CURS_DOWN     10
106 #define CH_CURS_LEFT      8
107 #define CH_CURS_RIGHT     9
108 #define CH_DEL          127
109 #define CH_ENTER         13
110 #define CH_STOP           3
111 #define CH_LIRA          95
112 #define CH_ESC           27
113
114
115
116 /* Masks for joy_read */
117 #define JOY_UP_MASK     0x10
118 #define JOY_DOWN_MASK   0x08
119 #define JOY_LEFT_MASK   0x01
120 #define JOY_RIGHT_MASK  0x02
121 #define JOY_BTN_1_MASK  0x20
122
123
124
125 /* No support for dynamically loadable drivers */
126 #define DYN_DRV         0
127
128
129
130 /* The addresses of the static drivers */
131 extern void atmos_pase_joy[];           /* Referred to by joy_static_stddrv[] */
132 extern void atmos_ijk_joy[];
133 extern void atmos_acia_ser[];
134 extern void atmos_228_200_3_tgi[];
135 extern void atmos_240_200_2_tgi[];      /* Referred to by tgi_static_stddrv[] */
136
137
138
139 /*****************************************************************************/
140 /*                                 Functions                                 */
141 /*****************************************************************************/
142
143
144
145 void __fastcall__ atmos_load(const char* name);
146 /* Load Atmos tape. */
147
148 void __fastcall__ atmos_save(const char* name, const void* start, const void* end);
149 /* Save Atmos tape. */
150
151 void atmos_explode (void);
152 /* Bomb sound effect */
153
154 void atmos_ping (void);
155 /* Bell or ricochet sound effect */
156
157 void atmos_shoot (void);
158 /* Pistol sound effect */
159
160 void atmos_tick (void);
161 /* High-pitch click */
162
163 void atmos_tock (void);
164 /* Low-pitch click */
165
166 void atmos_zap (void);
167 /* Raygun sound effect */
168
169
170
171 /* End of atmos.h */
172 #endif