]> git.sur5r.net Git - cc65/blob - include/accelerator.h
Fixed _textcolor definition.
[cc65] / include / accelerator.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                               accelerator.h                               */
4 /*                                                                           */
5 /*                      Accelerator specific definitions                     */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2018 Marco van den Heuvel                                             */
10 /* EMail:        blackystardust68@yahoo.com                                  */
11 /*                                                                           */
12 /*                                                                           */
13 /* This software is provided 'as-is', without any expressed or implied       */
14 /* warranty.  In no event will the authors be held liable for any damages    */
15 /* arising from the use of this software.                                    */
16 /*                                                                           */
17 /* Permission is granted to anyone to use this software for any purpose,     */
18 /* including commercial applications, and to alter it and redistribute it    */
19 /* freely, subject to the following restrictions:                            */
20 /*                                                                           */
21 /* 1. The origin of this software must not be misrepresented; you must not   */
22 /*    claim that you wrote the original software. If you use this software   */
23 /*    in a product, an acknowledgment in the product documentation would be  */
24 /*    appreciated but is not required.                                       */
25 /* 2. Altered source versions must be plainly marked as such, and must not   */
26 /*    be misrepresented as being the original software.                      */
27 /* 3. This notice may not be removed or altered from any source              */
28 /*    distribution.                                                          */
29 /*                                                                           */
30 /*****************************************************************************/
31
32
33
34 #ifndef _ACCELERATOR_H
35 #define _ACCELERATOR_H
36
37 /*****************/
38 /* Speed defines */
39 /*****************/
40
41 #define SPEED_SLOW   0x00
42 #define SPEED_FAST   0xFF
43
44 #define SPEED_1X   SPEED_SLOW
45 #define SPEED_2X    2 - 1        /* C64 Chameleon, C64DTV, C128, PET 65816, Apple2 Fast Chip, Apple2 TransWarp, Apple2 Zip Chip */
46 #define SPEED_3X    3 - 1        /* C64 Chameleon, C65, PET 65816, Apple2 Booster, Apple 2 Fast Chip, Apple2 Titan, Apple2 TransWarp, Apple2 Zip Chip */
47 #define SPEED_4X    4 - 1        /* C64 Chameleon, C64 TurboMaster, C64 TurboProcess, PET 65816, Apple2 Fast Chip, Apple2 Zip Chip */
48 #define SPEED_5X    5 - 1        /* C64 Chameleon, PET 65816, Apple2 Fast Chip */
49 #define SPEED_6X    6 - 1        /* C64 Chameleon, PET 65816, Apple2 Fast Chip */
50 #define SPEED_7X    7 - 1        /* PET 65816, Apple2 Fast Chip */
51 #define SPEED_8X    8 - 1        /* C64 Flash8, PET 65816, Apple 2 Fast Chip */
52 #define SPEED_10X  10 - 1        /* PET 65816, Apple2 Fast Chip */
53 #define SPEED_12X  12 - 1        /* Apple2 Fast Chip */
54 #define SPEED_16X  16 - 1        /* Apple2 Fast Chip */
55 #define SPEED_20X  20 - 1        /* C64/C128 SuperCPU */
56
57 /***********************************/
58 /* Accelerator function prototypes */
59 /***********************************/
60
61 /* C64/C128 SuperCPU cartridge */
62
63 unsigned char __fastcall__ set_scpu_speed (unsigned char speed);
64
65 /* Set the speed of the SuperCPU cartridge, using SPEED_SLOW will switch to
66  * 1 Mhz mode, SPEED_20X or SPEED_FAST will switch to 20 Mhz mode.
67  *
68  * Note that any value lower than SPEED_20X will switch to 1 Mhz mode, and
69  * any value higher or equal to SPEED_20X will switch to 20 Mhz mode.
70  *
71  * This function will return the actual speed the CPU is at after trying
72  * to set the requested speed, if this is not the speed that was requested
73  * then possibly the hardware speed switch prevented any software speed
74  * switching.
75  *
76  * This function does not check for the presence of the SuperCPU cartridge,
77  * make sure you use 'detect_scpu();' before using.
78  */
79
80 unsigned char get_scpu_speed (void);
81
82 /* Get the speed of the SuperCPU cartridge.
83  *
84  * Possible return values:
85  * SPEED_1X    :  1 Mhz mode
86  * SPEED_20X   : 20 Mhz mode
87  *
88  * This function does not check for the presence of the SuperCPU cartridge,
89  * make sure you use 'detect_scpu();' before using.
90  */
91
92 unsigned char detect_scpu (void);
93
94 /* Check for the presence of the SuperCPU cartridge.
95  *
96  * Possible return values:
97  * 0x00  : SuperCPU cartridge not present
98  * 0x01  : SuperCPU cartridge present
99  */
100
101
102 /* C64DTV */
103
104 unsigned char __fastcall__ set_c64dtv_speed (unsigned char speed);
105
106 /* Set the speed of the C64DTV, using SPEED_SLOW will switch to
107  * slow mode, SPEED_2X or SPEED_FAST will switch to fast mode.
108  *
109  * Note that any value higher or equal to SPEED_2X will switch to fast mode.
110  *
111  * This function will return the actual speed the CPU is at after trying
112  * to set the requested speed, to my knowledge the switch should not fail.
113  *
114  * This function does not check for the presence of the C64DTV,
115  * make sure you use 'detect_c64dtv();' before using.
116  */
117
118 unsigned char get_c64dtv_speed (void);
119
120 /* Get the speed of the C64DTV.
121  *
122  * Possible return values:
123  * SPEED_1X    : slow mode
124  * SPEED_2X    : fast mode
125  *
126  * This function does not check for the presence of the C64DTV,
127  * make sure you use 'detect_c64dtv();' before using.
128  */
129
130 unsigned char detect_c64dtv (void);
131
132 /* Check for the presence of the C64DTV.
133  *
134  * Possible return values:
135  * 0x00  : C64DTV not present
136  * 0x01  : C64DTV present
137  */
138
139
140 /* C128 8502 CPU */
141
142 unsigned char __fastcall__ set_c128_speed (unsigned char speed);
143
144 /* Set the speed of the C128 8502 CPU, using SPEED_SLOW will switch to
145  * 1 Mhz (slow) mode, SPEED_2X or SPEED_FAST will switch to 2Mhz (fast) mode.
146  *
147  * Note that any value higher or equal to SPEED_2X will switch to fast mode.
148  *
149  * This function will return the actual speed the CPU is at after trying
150  * to set the requested speed, to my knowledge the switching should not fail.
151  *
152  * This function does not check if the C128 CPU is the current CPU, make sure
153  * you use 'detect_c128();' before using.
154  */
155
156 unsigned char get_c128_speed (void);
157
158 /* Get the speed of the C128 8502 CPU.
159  *
160  * Possible return values:
161  * SPEED_SLOW  : Slow mode
162  * SPEED_2X    : Fast mode
163  *
164  * This function does not check if the C128 CPU is the current CPU, make sure
165  * you use 'detect_c128();' before using.
166  */
167
168 unsigned char detect_c128 (void);
169
170 /* Check if the C128 CPU is the current CPU.
171  *
172  * Possible return values:
173  * 0x00  : C128 CPU is not the current CPU
174  * 0x01  : C128 CPU is the current CPU
175  */
176
177
178 /* C64 Chameleon cartridge */
179
180 unsigned char __fastcall__ set_chameleon_speed (unsigned char speed);
181
182 /* Set the speed of the C64 Chameleon cartridge, the following inputs
183  * are accepted: 
184  * SPEED_SLOW : 1 Mhz mode
185  * SPEED_1X   : 1 Mhz mode
186  * SPEED_2X   : 2 Mhz mode
187  * SPEED_3X   : 3 Mhz mode
188  * SPEED_4X   : 4 Mhz mode
189  * SPEED_5X   : 5 Mhz mode
190  * SPEED_6X   : 6 Mhz mode
191  * SPEED_FAST : Maximum speed mode
192  *
193  * Note that any value higher or equal to SPEED_7X will switch to maximum
194  * speed mode.
195  *
196  * This function will return the actual speed the CPU is at after trying
197  * to set the requested speed, to my knowledge the switching should not fail.
198  *
199  * This function does not check for the presence of the C64 Chameleon cartridge,
200  * make sure you use 'detect_chameleon();' before using.
201  */
202
203 unsigned char get_chameleon_speed (void);
204
205 ;/* Get the speed of the C64 Chameleon cartridge.
206 ; *
207 ; * Possible return values:
208 ; * SPEED_SLOW  : Slow mode
209 ; * SPEED_2X    : 2Mhz mode
210 ; * SPEED_3X    : 3Mhz mode
211 ; * SPEED_4X    : 4Mhz mode
212 ; * SPEED_5X    : 5Mhz mode
213 ; * SPEED_6X    : 6Mhz mode
214 ; * SPEED_FAST  : Maximum speed mode
215 ; *
216 ; * This function does not check for the presence of the C64 Chameleon cartridge,
217 ; * make sure you use 'detect_chameleon();' before using.
218 ; */
219
220 unsigned char detect_chameleon (void);
221
222 /* Check for the presence of the C64 Chameleon cartridge.
223  *
224  * Possible return values:
225  * 0x00  : C64 Chameleon cartridge not present
226  * 0x01  : C64 Chameleon cartridge present
227  */
228
229
230 /* C65/C64DX in C64 mode */
231
232 unsigned char __fastcall__ set_c65_speed (unsigned char speed);
233
234 /* Set the speed of the C65/C64DX CPU, using SPEED_SLOW will switch to
235  * 1 Mhz mode, SPEED_3X or SPEED_FAST will switch to 3.5 Mhz (fast) mode.
236  *
237  * Note that any value higher or equal to SPEED_3X will switch to fast mode.
238  *
239  * This function will return the actual speed the CPU is at after trying
240  * to set the requested speed, to my knowledge the switching should not fail.
241  *
242  * This function does not check for the presence of a C65/C64DX in C64 mode,
243  * make sure you use 'detect_c65();' before using.
244  */
245
246 unsigned char get_c65_speed (void);
247
248 /* Get the speed of the C65/C64DX CPU.
249  *
250  * Possible return values:
251  * SPEED_SLOW  : Slow mode
252  * SPEED_3X    : Fast mode
253  *
254  * This function does not check for the presence of a C65/C64DX in C64 mode,
255  * make sure you use 'detect_c65();' before using.
256  */
257
258 unsigned char detect_c65 (void);
259
260 /* Check for the presence of a C65/C64DX in C64 mode.
261  *
262  * Possible return values:
263  * 0x00  : C65/C64DX in C64 mode not present
264  * 0x01  : C65/C64DX in C64 mode present
265  */
266
267
268 /* C64 Turbo Master cartridge */
269
270 unsigned char __fastcall__ set_turbomaster_speed (unsigned char speed);
271
272 /* Set the speed of the Turbo Master cartridge, using SPEED_SLOW will switch to
273  * 1 Mhz mode, SPEED_4X or SPEED_FAST will switch to 4 Mhz mode.
274  *
275  * Note that any value higher or equal to SPEED_4X will switch to 4 Mhz mode,
276  * any value lower than SPEED_4X will switch to 1 Mhz mode.
277  *
278  * This function will return the actual speed the CPU is at after trying
279  * to set the requested speed, if the speed is different it might indicate
280  * that the hardware switch has locked the speed.
281  *
282  * This function does not check for the presence of a Turbo Master cartridge,
283  * make sure you use 'detect_turbomaster();' before using.
284  */
285
286 unsigned char get_turbomaster_speed (void);
287
288 /* Get the speed of the Turbo Master cartridge.
289  *
290  * Possible return values:
291  * SPEED_SLOW  : 1 Mhz mode
292  * SPEED_4X    : 4 Mhz mode
293  *
294  * This function does not check for the presence of a Turbo Master cartridge,
295  * make sure you use 'detect_turbomaster();' before using.
296  */
297
298 unsigned char detect_turbomaster (void);
299
300 /* Check for the presence of a C64 Turbo Master cartridge.
301  *
302  * Possible return values:
303  * 0x00  : C64 Turbo Master cartridge not present
304  * 0x01  : C64 Turbo Master cartridge present
305  */
306
307 /* End of accelerator.h */
308 #endif
309