shave some bytes at the boundary of decrunch

This commit is contained in:
4am 2025-01-27 18:05:30 -05:00
parent 258960f6f1
commit dcbbf60ac0
2 changed files with 10 additions and 25 deletions

View File

@ -111,26 +111,6 @@ skip:
}
}
ExoDecompress:
pla
tay
pla
tax
clc
pla
adc #$F8
sta _byte_lo
pla
sta zp_bitbuf
pla
adc zp_bitbuf
sta _byte_hi
txa
pha
tya
pha
;/!\ execution falls through to decrunch
; -------------------------------------------------------------------
; no code below this comment has to be modified in order to generate
; a working decruncher of this source file.

View File

@ -115,7 +115,7 @@ DecompressAfterLoad
; remember these don't affect zero page or stack
; we always use mainmem zp and mainmem stack
pha ; push target address (hi) -1 for decompressor
pha ; push target address (hi) -1
bvc +
lda #$60 ; if V=1, set up returning from decompressor on keypress
@ -126,12 +126,17 @@ DecompressAfterLoad
jsr SwitchToBank2
jsr EnableAccelerator
lda sizehi2
pha ; push compressed data length (hi) for decompressor
lda sizelo2
pha ; push compressed data length (lo) for decompressor
clc
adc #$F8
sta _byte_lo
lda sizehi2
sta zp_bitbuf
pla ; target address (hi) -1
adc zp_bitbuf
sta _byte_hi
jsr ExoDecompress
jsr decrunch
.postDecompress
stx exo_save_x
sty exo_save_y