dos33fsprogs/music/pt3_lib/pt3_lib_detect_model.s

64 lines
902 B
ArmAsm
Raw Normal View History

2021-06-25 19:08:00 +00:00
;===========================
2021-06-28 03:21:09 +00:00
; Check Apple II model
2021-06-25 19:08:00 +00:00
;===========================
2021-06-28 03:21:09 +00:00
; this is mostly for IIc support
; as it does interrupts differently
2021-06-25 19:08:00 +00:00
; ' ' ($20) = Apple II
; '+' ($2B) = Apple II+
; 'E' ($45) = Apple IIe
; 'C' ($43) = Apple IIc
; 'G' ($47) = Apple IIgs
2021-06-28 03:21:09 +00:00
2021-06-25 19:08:00 +00:00
detect_appleii_model:
lda #' '
2021-06-28 03:21:09 +00:00
ldx $FBB3
; II is $38
; J-plus is $C9
; II+ is $EA (so is III)
; IIe and newer is $06
cpx #$38
beq done_apple_detect
2021-06-25 19:08:00 +00:00
2021-06-28 03:21:09 +00:00
lda #'+'
cpx #$EA
beq done_apple_detect
2021-06-25 19:08:00 +00:00
2021-06-28 03:21:09 +00:00
; TODO: check for J-plus or III?
cpx #$06
bne done_apple_detect
2021-06-25 19:08:00 +00:00
apple_iie_or_newer:
2021-06-28 03:21:09 +00:00
ldx $FBC0 ; $EA on a IIe
; $E0 on a IIe enhanced
; $00 on a IIc/IIc+
; $FE1F = $60, IIgs
beq apple_iic
lda #'E'
cpx #$EA
beq done_apple_detect
cpx #$E0
beq done_apple_detect
; assume GS?
lda #'G'
2021-06-25 19:08:00 +00:00
bne done_apple_detect
2021-06-28 03:21:09 +00:00
2021-06-25 19:08:00 +00:00
apple_iic:
lda #'C'
done_apple_detect:
2021-06-28 03:21:09 +00:00
sta APPLEII_MODEL
2021-06-25 19:08:00 +00:00
rts