2019-12-15 03:15:27 +00:00
|
|
|
;license:MIT
|
2020-04-13 02:44:59 +00:00
|
|
|
;(c) 2019-2020 by qkumba/Tom Greene
|
2019-12-15 03:15:27 +00:00
|
|
|
|
|
|
|
!cpu 6502
|
2021-10-16 01:34:39 +00:00
|
|
|
!to "build/PRELAUNCH.INDEXED/BW",plain
|
2019-12-15 03:15:27 +00:00
|
|
|
*=$106
|
|
|
|
|
2024-05-25 23:18:49 +00:00
|
|
|
!source "src/macros.a"
|
2019-12-15 03:15:27 +00:00
|
|
|
|
2020-07-15 01:30:40 +00:00
|
|
|
jmp main
|
2020-04-13 02:44:59 +00:00
|
|
|
|
|
|
|
brunpatch
|
|
|
|
lda $AA76 ; check second character of filename
|
|
|
|
cmp #$C9 ; = I, filename = @INIT
|
|
|
|
bne +
|
|
|
|
|
|
|
|
ldx #$00 ; Patch it to return to TR
|
|
|
|
stx $0DB4 ; instead of exiting to BASIC
|
|
|
|
inx
|
|
|
|
stx $0DB5
|
|
|
|
|
|
|
|
inc $0C85 ; prevent language card detection
|
|
|
|
|
|
|
|
+ cmp #$C6 ; = F, filename = @FHR
|
|
|
|
bne ++
|
|
|
|
|
|
|
|
+GET_MACHINE_STATUS
|
|
|
|
and #CHEATS_ENABLED
|
|
|
|
beq ++
|
|
|
|
ldx #$2C
|
|
|
|
stx $15AE ; don't decrement bullets
|
|
|
|
|
|
|
|
++ jmp ($AA72) ; finally jump to the loaded file
|
2020-07-15 01:30:40 +00:00
|
|
|
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
|
2020-04-13 02:44:59 +00:00
|
|
|
|
2020-07-15 01:30:40 +00:00
|
|
|
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
|
2020-04-13 02:44:59 +00:00
|
|
|
|
|
|
|
|
2019-12-15 03:15:27 +00:00
|
|
|
!if * > $1C0 {
|
|
|
|
!error "code is too large, ends at ", *
|
|
|
|
}
|