1 /*****************************************************************************/
5 /* Accelerator specific definitions */
9 /* (C) 2018 Marco van den Heuvel */
10 /* EMail: blackystardust68@yahoo.com */
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. */
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: */
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 */
30 /*****************************************************************************/
34 #ifndef _ACCELERATOR_H
35 #define _ACCELERATOR_H
41 #define SPEED_SLOW 0x00
42 #define SPEED_FAST 0xFF
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 */
57 /***********************************/
58 /* Accelerator function prototypes */
59 /***********************************/
61 /* C64/C128 SuperCPU cartridge */
63 unsigned char __fastcall__ set_scpu_speed (unsigned char speed);
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.
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.
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
76 * This function does not check for the presence of the SuperCPU cartridge,
77 * make sure you use 'detect_scpu();' before using.
80 unsigned char get_scpu_speed (void);
82 /* Get the speed of the SuperCPU cartridge.
84 * Possible return values:
85 * SPEED_1X : 1 Mhz mode
86 * SPEED_20X : 20 Mhz mode
88 * This function does not check for the presence of the SuperCPU cartridge,
89 * make sure you use 'detect_scpu();' before using.
92 unsigned char detect_scpu (void);
94 /* Check for the presence of the SuperCPU cartridge.
96 * Possible return values:
97 * 0x00 : SuperCPU cartridge not present
98 * 0x01 : SuperCPU cartridge present
104 unsigned char __fastcall__ set_c64dtv_speed (unsigned char speed);
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.
109 * Note that any value higher or equal to SPEED_2X will switch to fast mode.
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.
114 * This function does not check for the presence of the C64DTV,
115 * make sure you use 'detect_c64dtv();' before using.
118 unsigned char get_c64dtv_speed (void);
120 /* Get the speed of the C64DTV.
122 * Possible return values:
123 * SPEED_1X : slow mode
124 * SPEED_2X : fast mode
126 * This function does not check for the presence of the C64DTV,
127 * make sure you use 'detect_c64dtv();' before using.
130 unsigned char detect_c64dtv (void);
132 /* Check for the presence of the C64DTV.
134 * Possible return values:
135 * 0x00 : C64DTV not present
136 * 0x01 : C64DTV present
142 unsigned char __fastcall__ set_c128_speed (unsigned char speed);
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.
147 * Note that any value higher or equal to SPEED_2X will switch to fast mode.
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.
152 * This function does not check if the C128 CPU is the current CPU, make sure
153 * you use 'detect_c128();' before using.
156 unsigned char get_c128_speed (void);
158 /* Get the speed of the C128 8502 CPU.
160 * Possible return values:
161 * SPEED_SLOW : Slow mode
162 * SPEED_2X : Fast mode
164 * This function does not check if the C128 CPU is the current CPU, make sure
165 * you use 'detect_c128();' before using.
168 unsigned char detect_c128 (void);
170 /* Check if the C128 CPU is the current CPU.
172 * Possible return values:
173 * 0x00 : C128 CPU is not the current CPU
174 * 0x01 : C128 CPU is the current CPU
178 /* C64 Chameleon cartridge */
180 unsigned char __fastcall__ set_chameleon_speed (unsigned char speed);
182 /* Set the speed of the C64 Chameleon cartridge, the following inputs
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
193 * Note that any value higher or equal to SPEED_7X will switch to maximum
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.
199 * This function does not check for the presence of the C64 Chameleon cartridge,
200 * make sure you use 'detect_chameleon();' before using.
203 unsigned char get_chameleon_speed (void);
205 ;/* Get the speed of the C64 Chameleon cartridge.
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
216 ; * This function does not check for the presence of the C64 Chameleon cartridge,
217 ; * make sure you use 'detect_chameleon();' before using.
220 unsigned char detect_chameleon (void);
222 /* Check for the presence of the C64 Chameleon cartridge.
224 * Possible return values:
225 * 0x00 : C64 Chameleon cartridge not present
226 * 0x01 : C64 Chameleon cartridge present
230 /* C65/C64DX in C64 mode */
232 unsigned char __fastcall__ set_c65_speed (unsigned char speed);
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.
237 * Note that any value higher or equal to SPEED_3X will switch to fast mode.
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.
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.
246 unsigned char get_c65_speed (void);
248 /* Get the speed of the C65/C64DX CPU.
250 * Possible return values:
251 * SPEED_SLOW : Slow mode
252 * SPEED_3X : Fast mode
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.
258 unsigned char detect_c65 (void);
260 /* Check for the presence of a C65/C64DX in C64 mode.
262 * Possible return values:
263 * 0x00 : C65/C64DX in C64 mode not present
264 * 0x01 : C65/C64DX in C64 mode present
268 /* C64 Turbo Master cartridge */
270 unsigned char __fastcall__ set_turbomaster_speed (unsigned char speed);
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.
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.
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.
282 * This function does not check for the presence of a Turbo Master cartridge,
283 * make sure you use 'detect_turbomaster();' before using.
286 unsigned char get_turbomaster_speed (void);
288 /* Get the speed of the Turbo Master cartridge.
290 * Possible return values:
291 * SPEED_SLOW : 1 Mhz mode
292 * SPEED_4X : 4 Mhz mode
294 * This function does not check for the presence of a Turbo Master cartridge,
295 * make sure you use 'detect_turbomaster();' before using.
298 unsigned char detect_turbomaster (void);
300 /* Check for the presence of a C64 Turbo Master cartridge.
302 * Possible return values:
303 * 0x00 : C64 Turbo Master cartridge not present
304 * 0x01 : C64 Turbo Master cartridge present
307 /* End of accelerator.h */