mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-10-03 21:55:17 +00:00
Fix problem that expander didn't get re-split when it was re-loaded.
This commit is contained in:
parent
16b100c7f6
commit
50c78621e6
@ -76,7 +76,6 @@ nextLink: !byte 0 ; next link to allocate
|
|||||||
plasmaStk: !byte 0
|
plasmaStk: !byte 0
|
||||||
nTextures: !byte 0
|
nTextures: !byte 0
|
||||||
scripts: !word 0 ; pointer to loaded scripts module
|
scripts: !word 0 ; pointer to loaded scripts module
|
||||||
expanderRelocd: !byte 0 ; flag so we only reloc expander once
|
|
||||||
shadow_pTex: !word 0 ; backup of pTmp space on aux (because it gets overwritten by expander)
|
shadow_pTex: !word 0 ; backup of pTmp space on aux (because it gets overwritten by expander)
|
||||||
|
|
||||||
skyColorEven: !byte $20
|
skyColorEven: !byte $20
|
||||||
@ -2120,9 +2119,12 @@ pl_initMap: !zone
|
|||||||
jsr graphInit
|
jsr graphInit
|
||||||
jmp renderFrame
|
jmp renderFrame
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
; Split part of the expander off into a hard-to-use area in the aux LC.
|
||||||
|
; NOTE: It's safe to do this more than once, and is in fact necessary in case
|
||||||
|
; the expander gets reloaded without the main engine being reloaded. It's safe
|
||||||
|
; to call expand_0 since it's just an RTS.
|
||||||
splitExpander:
|
splitExpander:
|
||||||
lda expanderRelocd
|
|
||||||
bne .done ; only relocate once
|
|
||||||
jsr setExpansionCaller
|
jsr setExpansionCaller
|
||||||
sei ; prevent interrupts while in aux mem
|
sei ; prevent interrupts while in aux mem
|
||||||
sta setAuxZP
|
sta setAuxZP
|
||||||
@ -2147,9 +2149,7 @@ splitExpander:
|
|||||||
pla
|
pla
|
||||||
tax
|
tax
|
||||||
lda #REQUEST_MEMORY
|
lda #REQUEST_MEMORY
|
||||||
jsr auxLoader
|
jmp auxLoader
|
||||||
inc expanderRelocd
|
|
||||||
.done rts
|
|
||||||
.memexp ldx #<expandVec
|
.memexp ldx #<expandVec
|
||||||
ldy #>expandVec
|
ldy #>expandVec
|
||||||
jmp auxLoader
|
jmp auxLoader
|
||||||
|
Loading…
Reference in New Issue
Block a user