4cade/src/prelaunch/bejeweled.a

56 lines
1.1 KiB
Plaintext

;license:MIT
;(c) 2020-2021 by qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/BEJEWELED",plain
*=$106
!source "src/prelaunch/common.a"
+ENABLE_ACCEL
lda #<callback
sta $467F
lda #>callback
sta $4680
jmp $800 ; decompress
helper
lda $89A0
cmp #$CB ; write file
bne nohelp
lda $8DB5 ; write address (low)
cmp #$F3 ; erasing save
beq nohelp
cmp #$F5 ; writing "valid"
beq nocall ; ignore it
cmp #$5E ; writing options
beq nohelp
dec $8DB5 ; write address (low)
nohelp
jmp $FDFD ; SMC
nocall
plp
pla
pla
clc
rts
callback
jsr $BE00
lda $BF0B
sta nohelp + 1
lda $BF0C
sta nohelp + 2
lda #<helper
sta $BF0B
lda #>helper
sta $BF0C
+DISABLE_ACCEL
rts
!if * > $1C0 {
!error "code is too large, ends at ", *
}