]> git.sur5r.net Git - cc65/blob - include/accelerator.h
Added c64dtv accelerator code and documentation.
[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 extern 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 extern 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 extern 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 extern 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 extern 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 extern 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 /* End of accelerator.h */
140 #endif