2020-03-17 22:30:20 +00:00
|
|
|
;license:MIT
|
|
|
|
;(c) 2020 by qkumba
|
|
|
|
;
|
|
|
|
; Identify platform and construct appropriate VBL routine
|
|
|
|
|
|
|
|
romid = $FBB3
|
|
|
|
; $38=][, $EA=][+, $06=//e compatible
|
|
|
|
ROMID_IIECOMPAT = 6
|
|
|
|
romid_ec = $FBC0
|
|
|
|
; $EA=//e original, $E0=//e enhanced, $E1=//e EDM, $00=//c
|
2021-01-04 18:51:06 +00:00
|
|
|
romid_mac = $FBDD
|
|
|
|
ROMID_IIECARD = 2
|
2020-03-17 22:30:20 +00:00
|
|
|
|
|
|
|
; IIGS
|
|
|
|
idroutine = $FE1F ; SEC, JSR $FE1F, BCS notgs
|
|
|
|
|
|
|
|
BuildVBLFunction
|
|
|
|
ldx romid
|
|
|
|
cpx #ROMID_IIECOMPAT
|
|
|
|
bne @build_none ; not a //e
|
|
|
|
lda romid_ec
|
|
|
|
beq @build_iic ; //c family
|
2021-01-04 18:51:06 +00:00
|
|
|
lda romid_mac
|
|
|
|
cmp #ROMID_IIECARD
|
|
|
|
beq @build_none ; broken in some versions, disable
|
2020-03-17 22:30:20 +00:00
|
|
|
sec
|
|
|
|
jsr idroutine ; check for IIgs
|
|
|
|
bcs @NotGS
|
|
|
|
lda #$30
|
|
|
|
sta patch_VBL_iigs1
|
|
|
|
lda #$10
|
|
|
|
sta patch_VBL_iigs2
|
|
|
|
@NotGS
|
|
|
|
rts
|
|
|
|
@build_iic
|
2020-06-18 16:47:13 +00:00
|
|
|
sta patch_VBL_iic2+1
|
2020-03-17 22:30:20 +00:00
|
|
|
lda #$70
|
2020-03-18 02:46:01 +00:00
|
|
|
sta patch_VBL_iic1+1
|
2020-06-18 16:47:13 +00:00
|
|
|
lda #$10
|
|
|
|
sta patch_VBL_iic3
|
2020-03-19 02:53:50 +00:00
|
|
|
lda #<iWaitForVBL
|
|
|
|
sta WaitForVBL+1
|
|
|
|
lda #>iWaitForVBL
|
|
|
|
sta WaitForVBL+2
|
|
|
|
lda #$4C
|
2020-03-17 22:30:20 +00:00
|
|
|
sta UnwaitForVBL
|
|
|
|
rts
|
2020-03-19 02:53:50 +00:00
|
|
|
@build_none
|
|
|
|
lda #$60
|
|
|
|
sta WaitForVBL
|
|
|
|
rts
|