From e3cf6fb733d9d08670220a3cca582570dd597283 Mon Sep 17 00:00:00 2001 From: frankmilliron <34376619+frankmilliron@users.noreply.github.com> Date: Tue, 31 Dec 2019 13:29:20 -0800 Subject: [PATCH] Reset vector fixes (#95) --- src/prelaunch/ballblazer.a | 27 ++++++++++++++++++++++++ src/prelaunch/fs2.a | 38 ++++++++++++++++++++++++++++++++++ src/prelaunch/orileys.mine.a | 8 ++++++- src/prelaunch/raster.blaster.a | 22 -------------------- src/prelaunch/xevious.a | 16 ++++++++------ 5 files changed, 82 insertions(+), 29 deletions(-) create mode 100755 src/prelaunch/ballblazer.a create mode 100755 src/prelaunch/fs2.a delete mode 100755 src/prelaunch/raster.blaster.a mode change 100644 => 100755 src/prelaunch/xevious.a diff --git a/src/prelaunch/ballblazer.a b/src/prelaunch/ballblazer.a new file mode 100755 index 000000000..1408333cb --- /dev/null +++ b/src/prelaunch/ballblazer.a @@ -0,0 +1,27 @@ +;license:MIT +;(c) 2019 by Frank M. + +!cpu 6502 +!to "build/PRELAUNCH/BALLBLAZER",plain +*=$106 + + !source "src/prelaunch/common.a" + + +ENABLE_ACCEL + lda #$60 + sta $5FEB + jsr $5FCC ; decompress1 + + lda #$60 + sta $BE20 + +DISABLE_ACCEL + jsr $BE00 ; decompress2/title + + lda #1 + sta $415 ; gets patched to LC reset vector + + jmp $400 + +!if * > $1C0 { + !error "code is too large, ends at ", * +} diff --git a/src/prelaunch/fs2.a b/src/prelaunch/fs2.a new file mode 100755 index 000000000..703f12268 --- /dev/null +++ b/src/prelaunch/fs2.a @@ -0,0 +1,38 @@ +;license:MIT +;(c) 2019 by Frank M. + +!cpu 6502 +!to "build/PRELAUNCH/FS2",plain +*=$106 + + !source "src/prelaunch/common.a" + + ;+ENABLE_ACCEL ; can't + + lda #$2C + sta $1C0 + lda #$82 + sta $1C1 + lda #$C0 + sta $1C2 + lda #$4C ; add reboot hook @ $1C0 + sta $1C3 + lda #$A6 + sta $1C4 + lda #$FA + sta $1C5 + + lda #$C0 + sta $81D3 ; cloned to $3F2 + sta $7C6E ; cloned to $FFFC + lda #$01 + sta $81D4 ; cloned to $3F3 + sta $7C71 ; cloned to $FFFD + lda #$A4 + sta $81CB ; cloned to $3F4 + + jmp $24F8 + +!if * > $1C0 { + !error "code is too large, ends at ", * +} diff --git a/src/prelaunch/orileys.mine.a b/src/prelaunch/orileys.mine.a index 86c03f01d..776042311 100755 --- a/src/prelaunch/orileys.mine.a +++ b/src/prelaunch/orileys.mine.a @@ -12,9 +12,15 @@ sta $81D jsr $800 ; decompress - lda #1 + +NEW_RESET_VECTOR $280 + lda #$80 + sta $2001 + sta $2016 + sta $812E + lda #$02 sta $2006 sta $201B ; reset vector patch + sta $8133 ; (yes, that's 3 times) +DISABLE_ACCEL jmp $8FD diff --git a/src/prelaunch/raster.blaster.a b/src/prelaunch/raster.blaster.a deleted file mode 100755 index 099934dc5..000000000 --- a/src/prelaunch/raster.blaster.a +++ /dev/null @@ -1,22 +0,0 @@ -;license:MIT -;(c) 2019 by Frank M. - -!cpu 6502 -!to "build/PRELAUNCH/RASTER.BLASTER",plain -*=$106 - - !source "src/prelaunch/common.a" - - ;+ENABLE_ACCEL ; can't - lda #$60 - sta $825 - jsr $800 ; decompress/set reset vector - - +RESET_VECTOR $100 - - jsr $8200 ; title - jmp $FEBC ; demo - -!if * > $1C0 { - !error "code is too large, ends at ", * -} diff --git a/src/prelaunch/xevious.a b/src/prelaunch/xevious.a old mode 100644 new mode 100755 index c664a7bc7..3da75038e --- a/src/prelaunch/xevious.a +++ b/src/prelaunch/xevious.a @@ -8,6 +8,14 @@ !source "src/prelaunch/common.a" +ENABLE_ACCEL + + +READ_RAM2_WRITE_RAM2 + lda #reset + sta $FFFD ; reset vector patch + +GET_MACHINE_STATUS and #CHEATS_ENABLED sta patch2+1 @@ -27,7 +35,7 @@ patch1 sta $ACE8 lda #>patch2 sta $ACE9 - jmp $AC48 ; decompress 2 + jmp $AC48 ; decompress 2/first title patch2 lda #0 ; SMC beq + @@ -38,11 +46,7 @@ patch2 sta $750D ; patch - don't increase lives sta $894F ; patch - don't increase lives + - lda #reset - sta $FFFD - jmp $0600 + jmp $0600 ; play demo/start game !if * > $1C0 { !error "code is too large, ends at ", *