1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00
cc65/libsrc/c128/acc_detect_scpu.s
Greg King c92a3c5bd5 Improved the accelerator code. Fixed an infinite loop.
Removed the execute permissions from some files.
2018-04-26 05:46:34 -04:00

35 lines
811 B
ArmAsm

;
; Marco van den Heuvel, 2018-04-08
;
; unsigned char detect_scpu (void);
;
;/* Check for the presence of the SuperCPU cartridge.
; *
; * Possible return values:
; * 0x00 : SuperCPU cartridge not present
; * 0x01 : SuperCPU cartridge present
; */
.export _detect_scpu
.include "accelerator.inc"
_detect_scpu:
ldx #$00
txa
; Make sure the current CPU is a 65816
clc
.byte $E2,$01 ; NOP #$01 on 6510 and 65(S)C02, LDA $(01,S),Y on 65CE02 and 4510, SEP #$01 on 65816
bcc not_found ; carry will be set on 65816
; 65816 has been detected, make sure it's the SuperCPU cartridge
lda SuperCPU_Detect
asl
bcs not_found
found:
lda #$01
not_found:
rts