2 ; Marco van den Heuvel, 2018-04-30
5 ; unsigned char detect_turbomaster (void);
7 ;/* Check for the presence of a Turbo Master cartridge.
9 ; * Possible return values:
10 ; * 0x00 : TurboMaster cartridge not present
11 ; * 0x01 : TurboMaster cartridge present
14 .export _detect_turbomaster
16 .include "accelerator.inc"
22 ; Make sure the current CPU is not a 6510
23 .byte $1A ; NOP on 8502, INA on 65(S)C(E)02, 4510 and 65816
26 ; Make sure the current CPU is not a 65816
28 .byte $E2,$01 ; NOP #$01 on 65(S)C02, LDA $(01,S),Y on 65CE02 and 4510, SEP #$01 on 65816
29 bcs not_found ; carry will be set on 65816
31 ; Make sure the current CPU is not a 65CE02/4510
32 .byte $A3,$A3 ; NOP NOP on 65(S)C02 and LDZ #$00 on 65CE02 and 4510
33 .byte $6B ; NOP on 65(S)C02 and TZA on 65CE02 and 4510
37 ; Check for turbo master basic replacement
38 ldy TURBOMASTER_DETECT