Fix Wolvesenstein on BOOTI (#292)

This commit is contained in:
Tom Greene 2020-07-14 21:30:40 -04:00 committed by GitHub
parent 1fc5637950
commit 24da67333b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 83 additions and 81 deletions

View File

@ -7,34 +7,7 @@
!source "src/prelaunch/common.a"
+ENABLE_ACCEL
+USES_TEXT_PAGE_2
lda #$60
sta $97C
jsr $800 ; find and load "DOS"
lda #<callback
sta $B748
lda #>callback
sta $B749
jmp $B700
callback
lda #$01
sta $9E31
lda #$00
sta $9E3C ; reset vector patch
lda #<patch ; intercept BRUN command before
sta $A395 ; it jumps to the loaded file
lda #>patch
sta $A396
+DISABLE_ACCEL
jmp $9D84
patch
!word brunpatch
jmp main
brunpatch
lda $AA76 ; check second character of filename
@ -58,9 +31,35 @@ brunpatch
stx $15AE ; don't decrement bullets
++ jmp ($AA72) ; finally jump to the loaded file
patch
!word brunpatch
main
+ENABLE_ACCEL
+USES_TEXT_PAGE_2
lda #$60
sta $97C
jsr $800 ; find and load "DOS"
lda #<callback
sta $B748
lda #>callback
sta $B749
jmp $B700
callback
lda #$01
sta $9E31
lda #$00
sta $9E3C ; reset vector patch
lda #<patch ; intercept BRUN command before
sta $A395 ; it jumps to the loaded file
lda #>patch
sta $A396
+DISABLE_ACCEL
jmp $9D84
!if * > $1C0 {
!error "code is too large, ends at ", *

View File

@ -7,6 +7,31 @@
!source "src/prelaunch/common.a"
jmp main
brunpatch
ldx #$FF
txs
lda $AA76 ; check second character of filename
cmp #$D7 ; = W, filename = @WOLF
bne +
ldx #$01 ; Patch it to return to TR
stx $1EFA ; instead of exiting to BASIC
+GET_MACHINE_STATUS
and #CHEATS_ENABLED
beq +
ldx #$03
stx $4048 ; start with 3 grenades
dec $14AD ; don't decrement bullets
dec $1999 ; or grenades
+ jmp ($AA72) ; finally jump to the loaded file
patch
!word brunpatch
main
+ENABLE_ACCEL
lda ROM_MACHINEID
@ -17,7 +42,6 @@
sta $36
lda #$BD
sta $37
bne ++
+ sec
jsr $FE1F ; check for IIgs
@ -45,33 +69,9 @@ callback
lda #>patch
sta $A396
@notiiplus
+DISABLE_ACCEL
jmp $9B00
patch
!word brunpatch
brunpatch
ldx #$FF
txs
lda $AA76 ; check second character of filename
cmp #$D7 ; = W, filename = @WOLF
bne +
ldx #$01 ; Patch it to return to TR
stx $1EFA ; instead of exiting to BASIC
+GET_MACHINE_STATUS
and #CHEATS_ENABLED
beq +
ldx #$03
stx $4048 ; start with 3 grenades
ldx #$2C
stx $14AD ; don't decrement bullets
stx $1999 ; or grenades
+ jmp ($AA72) ; finally jump to the loaded file
!if * > $1C0 {
!error "code is too large, ends at ", *

View File

@ -7,33 +7,7 @@
!source "src/prelaunch/common.a"
+ENABLE_ACCEL
+USES_TEXT_PAGE_2
lda #$60
sta $21E8
jsr $2000 ; find and load "DOS"
lda #<callback
sta $B748
lda #>callback
sta $B749
jmp $B700
callback
lda #$00
sta $9E52
lda #$01
sta $9E53
lda #<patch ; intercept BRUN command before
sta $A395 ; it jumps to the loaded file
lda #>patch
sta $A396
+DISABLE_ACCEL
jmp $9D84
patch
!word brunpatch
jmp main
brunpatch
lda $AA76 ; check second character of filename
@ -58,6 +32,35 @@ brunpatch
stx $18FE ; or grenades
++ jmp ($AA72) ; finally jump to the loaded file
patch
!word brunpatch
main
+ENABLE_ACCEL
+USES_TEXT_PAGE_2
lda #$60
sta $21E8
jsr $2000 ; find and load "DOS"
lda #<callback
sta $B748
lda #>callback
sta $B749
jmp $B700
callback
ldx #$00
stx $9E52
inx
stx $9E53
lda #<patch ; intercept BRUN command before
sta $A395 ; it jumps to the loaded file
lda #>patch
sta $A396
+DISABLE_ACCEL
jmp $9D84
!if * > $1C0 {
!error "code is too large, ends at ", *