]> git.sur5r.net Git - cc65/blob - libsrc/c128/acc_scpu_speed.s
Removed extern keyword from function prototypes.
[cc65] / libsrc / c128 / acc_scpu_speed.s
1 ;
2 ; Marco van den Heuvel, 2018-04-09
3 ;
4
5 ; unsigned char __fastcall__ set_scpu_speed (unsigned char speed);
6 ;
7 ;/* Set the speed of the SuperCPU cartridge, using SPEED_SLOW will switch to
8 ; * 1 Mhz mode, SPEED_20X or SPEED_FAST will switch to 20 Mhz mode.
9 ; *
10 ; * Note that any value lower than SPEED_20X will switch to 1 Mhz mode, and
11 ; * any value higher or equal to SPEED_20X will switch to 20 Mhz mode.
12 ; *
13 ; * This function will return the actual speed the CPU is at after trying
14 ; * to set the requested speed, if this is not the speed that was requested
15 ; * then possibly the hardware speed switch prevented any software speed
16 ; * switching.
17 ; *
18 ; * This function does not check for the presence of the SuperCPU cartridge,
19 ; * make sure you use 'detect_scpu();' before using.
20 ; */
21
22 ; unsigned char get_scpu_speed (void);
23 ;
24 ;/* Get the speed of the SuperCPU cartridge.
25 ; *
26 ; * Possible return values:
27 ; * SPEED_1X    :  1 Mhz mode
28 ; * SPEED_20X   : 20 Mhz mode
29 ; *
30 ; * This function does not check for the presence of the SuperCPU cartridge,
31 ; * make sure you use 'detect_scpu();' before using.
32 ; */
33
34         .export         _set_scpu_speed
35         .export         _get_scpu_speed
36
37         .include        "accelerator.inc"
38
39 _set_scpu_speed:
40         cmp     #SPEED_20X
41         bcs     high_speed
42 low_speed:
43         sta     SuperCPU_Slow
44         jmp     _get_scpu_speed
45
46 high_speed:
47         sta     SuperCPU_Fast
48
49 _get_scpu_speed:
50         ldx     #$00
51         lda     SuperCPU_Speed_Mode
52         asl
53         asl
54         bcc     is_fast_speed
55         lda     #SPEED_1X
56         rts
57 is_fast_speed:
58         lda     #SPEED_20X
59         rts