2 ; 2018-04-23, Marco van den Heuvel
3 ; 2018-04-26, Greg King
6 ; unsigned char __fastcall__ set_c128_speed (unsigned char speed);
8 ;/* Set the speed of the C128 8502 CPU; using SPEED_SLOW will switch to
9 ; * 1 Mhz (slow) mode, SPEED_2X or SPEED_FAST will switch to 2Mhz (fast) mode.
11 ; * Note that any value higher or equal to SPEED_2X will switch to fast mode.
13 ; * This function will return the actual speed the CPU is at, after trying
14 ; * to set the requested speed; to my knowledge, the switching should not fail.
16 ; * For C64 programs, a check for a C128 in C64 mode is needed; make sure you
17 ; * use 'detect_c128();' before using.
19 ; * For C128 programs, no detect function call is needed.
22 ; unsigned char get_c128_speed (void);
24 ;/* Get the speed of the C128 8502 CPU.
26 ; * Possible return values:
27 ; * SPEED_SLOW : Slow mode
28 ; * SPEED_2X : Fast mode
30 ; * For C64 programs, a check for a C128 in C64 mode is needed; make sure you
31 ; * use 'detect_c128();' before using.
33 ; * For C128 programs, no detect function call is needed.
36 .export _set_c128_speed
37 .export _get_c128_speed
39 .include "accelerator.inc"
43 lda #$00 ; clear VIC-IIe test bit
44 rol a ; carry flag is speed bit