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