xmas2018: automatically get filesize after load

This commit is contained in:
Vince Weaver 2018-12-19 10:09:31 -05:00
parent 18145ba58e
commit 28e89b2acb
3 changed files with 25 additions and 11 deletions

View File

@ -7,10 +7,10 @@ PNG_TO_RLE = ../gr-utils/png2rle
all: xmas2018.dsk
xmas2018.dsk: HELLO XMAS2018 wreath.img.lz4 ball.img.lz4 merry.img.lz4 MUSIC.lz4
xmas2018.dsk: HELLO XMAS2018 wreath.img.lz4t ball.img.lz4 merry.img.lz4 MUSIC.lz4
$(DOS33) -y xmas2018.dsk SAVE A HELLO
$(DOS33) -y xmas2018.dsk BSAVE -a 0x1000 XMAS2018
$(DOS33) -y xmas2018.dsk BSAVE -a 0xa000 wreath.img.lz4 WREATH.LZ4
$(DOS33) -y xmas2018.dsk BSAVE -a 0xa000 wreath.img.lz4t WREATH.LZ4
$(DOS33) -y xmas2018.dsk BSAVE -a 0xa000 ball.img.lz4 BALL.LZ4
$(DOS33) -y xmas2018.dsk BSAVE -a 0xa000 merry.img.lz4 MERRY.LZ4
$(DOS33) -y xmas2018.dsk BSAVE -a 0x6000 MUSIC.lz4 MUSIC.LZ4
@ -57,6 +57,10 @@ merry.img: merry_christmas.png
####
wreath.img.lz4t: wreath.img.lz4
dd if=wreath.img.lz4 of=wreath.img.lz4t bs=1 skip=11
truncate wreath.img.lz4t -s -8
wreath.img.lz4: wreath.img
lz4 -f -16 wreath.img

View File

@ -4,6 +4,8 @@
; modified to assembled with ca64 -- vmw
; added code to patch it to run from current disk slot -- vmw
; also stores filesize in ldsizel:ldsizeh
dirbuf = $900
; note, don't put this immediately below
; the value being read as destaddr-4
@ -232,12 +234,15 @@ L5:
; increase load size by 4, to account for offst and length
lda filbuf+2
sta ldsizel ; store out raw size
adc #3
sta sizelo
sta secsize
sta ldsizel
lda filbuf+3
sta ldsizeh ; store out raw size
adc #0
sta sizehi
sta ldsizeh

View File

@ -48,19 +48,24 @@ apple_iie:
; decompress to $2000
; decompress from $a000
; size in ???
; size in ldsizeh:ldsizel (f1/f0)
lda #<($a000+11)
clc
lda #<($a000)
sta LZ4_SRC
lda #>($a000+11)
sta LZ4_SRC+1
lda #<($a000+4103-8) ; skip checksum at end
adc ldsizel
sta LZ4_END
lda #>($a000+4103-8) ; skip checksum at end
lda #>($a000)
sta LZ4_SRC+1
adc ldsizeh
sta LZ4_END+1
; lda #<($a000+4103-8) ; skip checksum at end
; sta LZ4_END
; lda #>($a000+4103-8) ; skip checksum at end
; sta LZ4_END+1
lda #<$2000
sta LZ4_DST
lda #>$2000