4cade/src/prelaunch/up.n.down.a

54 lines
1.4 KiB
Plaintext
Executable File

;license:MIT
;(c) 2019 by 4am/Frank M.
!cpu 6502
!to "build/PRELAUNCH.INDEXED/UD",plain
*=$106
!source "src/prelaunch/common.a"
lda #$03 ; reset vector to $103
sta $2D4E
lda #$01 ; (game uses the 3 value to set STA $'03'F2
sta $2D50 ; so reset has to be somewhere $xx03
sta $2DB1 ; unless you want to waste more time making this reboot)
+GET_MACHINE_STATUS
and #CHEATS_ENABLED
sta patch+1
ldx #$2A-1 ; copy patch code to zero page
- lda patch,x ; (stack will be destroyed by the time we need to patch)
sta $80,x
dex
bpl -
lda #$80 ; call patch instead of $200
sta $4054
lda #$00
sta $4055 ; updated here for new .po file locations
jmp $2D2C
patch
lda #0 ; SMC
beq +
; lives in $1B,X (X=0/1 for player 1/2)
lda #$B5
sta $0912 ; patch - don't decrease lives
+
lda #$2C
sta $103
lda #$82
sta $104
lda #$C0
sta $105
lda #$4C ; add reboot hook @ $103
sta $106
lda #$A6
sta $107
lda #$FA
sta $108
jmp $200 ; continue to game
!if * > $1C0 {
!error "code is too large, ends at ", *
}