4cade/src/prelaunch/black.magic.a
frankmilliron 46d05fbac9
fix Black Magic on //c+ (#330)
Seems like starting a new game is wonky. after it shows the high score screen it messes up the graphics. not sure if that's my fix causing it or not, but both reset work, and every machine works currently.
2020-08-12 11:55:52 -04:00

66 lines
1.4 KiB
Plaintext

;license:MIT
;(c) 2019 by qkumba/Tom Greene/Frank M.
!cpu 6502
!to "build/PRELAUNCH/BLACK.MAGIC",plain
*=$106
!source "src/prelaunch/common.a"
; acceleration has problems with Fastchip
; let's remove it
lda #<reset ; fix reset during title
sta $9AE
sta $80FC
lda #$60
sta $9C2
jsr $800 ; decompress
lda #$60
sta $1B2D
sta $D6E6
jsr $1B00
lda #<callback1
sta $D7E9
lda #>callback1
sta $D7EA
jsr $D000
lda #<callback2
sta $8D5
lda #>callback2
sta $8D6
jmp $800
callback1
lda #<reset
sta $5029 ; fix tamper check
sta $80FC ; re-cloned to $FFFC
jmp $5000
callback2
lda #$4C
sta $D6EB
jsr $D003
ldx #5
- lda reset, x
sta $4182, x
dex
bpl -
lda #$20
sta $D6EB
lda #$63 ; back to original vector
sta $3F2
sta $FFFC
+READ_RAM2_WRITE_RAM2 ; fix on //c+
jmp $D6EE
reset
+READ_ROM_NO_WRITE
jmp $FAA6
!if * > $1C0 {
!error "code is too large, ends at ", *
}