ootw: lzsa for c4

This commit is contained in:
Vince Weaver 2021-03-23 16:42:37 -04:00
parent 30a058884a
commit ef9ea1a5bb
4 changed files with 48 additions and 263 deletions

View File

@ -1,22 +1,30 @@
include ../../../Makefile.inc
include ../../../../../Makefile.inc
PNG2RLE = ../../../gr-utils/png2rle
PNG2LZ4 = ../../../gr-utils/png2lz4
PNG2GR = ../../../../../utils/gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa
all: ootw_c4_city.inc
#####
ootw_c4_city.inc: $(PNG2RLE) \
recharge.png hallway.png causeway1.png causeway2.png pit.png
$(PNG2RLE) asm recharge.png recharge_rle > ootw_c4_city.inc
$(PNG2RLE) asm hallway.png hallway_rle >> ootw_c4_city.inc
$(PNG2RLE) asm causeway1.png causeway1_rle >> ootw_c4_city.inc
$(PNG2RLE) asm causeway2.png causeway2_rle >> ootw_c4_city.inc
$(PNG2RLE) asm pit.png pit_rle >> ootw_c4_city.inc
ootw_c4_city.inc: \
recharge.lzsa hallway.lzsa causeway1.lzsa causeway2.lzsa pit.lzsa
echo "recharge_lzsa: .incbin \"recharge.lzsa\"" > ootw_c4_city.inc
echo "hallway_lzsa: .incbin \"hallway.lzsa\"" >> ootw_c4_city.inc
echo "causeway1_lzsa: .incbin \"causeway1.lzsa\"" >> ootw_c4_city.inc
echo "causeway2_lzsa: .incbin \"causeway2.lzsa\"" >> ootw_c4_city.inc
echo "pit_lzsa: .incbin \"pit.lzsa\"" >> ootw_c4_city.inc
#####
%.gr: %.png
$(PNG2GR) $< $@
%.lzsa: %.gr
$(LZSA) -r -f2 $< $@
#####
clean:
rm -f *~ *.o *.lst *.lzz *.inc
rm -f *~ *.o *.lst *.inc

View File

@ -1,224 +0,0 @@
recharge_rle: .byte $28 ; ysize=48
.byte $AE,$22, $02, $A0,$19,$00, $AF,$22, $A0,$19,$00, $AF,$22, $A0,$19,$00
.byte $AF,$22, $A5,$00, $20, $A0,$13,$00, $AF,$22, $A5,$00, $22
.byte $20, $A0,$12,$00, $AF,$02, $A5,$00, $22,$22, $A0,$25,$00, $20
.byte $22,$22, $20, $00, $A5,$20, $00, $20, $00
.byte $20, $00, $A6,$20, $A0,$13,$00, $A3,$22, $20, $00
.byte $20, $A4,$22, $00, $22, $00, $22, $00
.byte $A6,$22, $A0,$13,$00, $A4,$22, $00, $A5,$22, $00, $22
.byte $00, $22, $00, $A6,$22, $A0,$13,$00, $A4,$22, $00
.byte $A5,$22, $00, $22, $00, $22, $00, $A6,$22
.byte $A0,$13,$00, $A4,$22, $00, $A5,$22, $00, $22, $00
.byte $22, $00, $A6,$22, $A0,$13,$00, $A4,$22, $00, $A5,$22
.byte $00, $22, $00, $22, $00, $A6,$22, $A5,$00
.byte $AE,$20, $A4,$22, $00, $A5,$22, $20, $22, $20
.byte $22, $20, $A6,$22, $A5,$00, $A0,$12,$22, $00, $A0,$10,$22
.byte $A5,$00, $AF,$22, $82, $A0,$13,$22, $A5,$00, $AF,$22, $88
.byte $A0,$13,$22, $A5,$00, $AE,$22, $88, $22, $52, $A0,$12,$22
.byte $A5,$00, $AE,$22, $28, $82, $55, $A0,$12,$22, $A5,$00
.byte $AF,$22, $88, $A0,$13,$22, $A5,$00, $AE,$22, $88, $22
.byte $52, $A0,$12,$22, $A5,$00, $AE,$22, $28, $82, $55
.byte $A0,$12,$22, $A5,$00, $AF,$02, $08, $05, $A0,$12,$02, $A0,$50,$00
.byte $A1
hallway_rle: .byte $28 ; ysize=48
.byte $A0,$28,$00, $20, $A4,$00, $20, $A4,$00, $20, $A4,$00
.byte $20, $A3,$00, $20, $A4,$00, $20, $A4,$00, $20
.byte $A4,$00, $20, $A4,$00, $20, $02, $22, $A4,$02
.byte $22, $A4,$02, $22, $A3,$02, $22, $A3,$02, $22
.byte $A4,$02, $22, $A3,$02, $22, $A4,$02, $22, $A4,$02
.byte $22, $02, $20, $00, $02,$02, $20, $00,$00
.byte $02, $20, $00,$00, $02, $20, $A3,$00, $22
.byte $00,$00, $22, $A3,$00, $22, $A3,$00, $20, $02
.byte $00,$00, $20, $02, $00,$00, $20, $02,$02, $00
.byte $20, $A0,$27,$02, $52, $A0,$10,$00, $50, $A0,$14,$00, $50
.byte $65, $66, $A8,$00, $55, $A4,$05, $50, $00,$00
.byte $55, $A0,$12,$00, $50, $55, $A3,$66, $A8,$00, $55
.byte $A4,$00, $55, $00,$00, $55, $A0,$10,$00, $50, $55
.byte $65, $A4,$66, $A7,$00, $05,$05, $A4,$50, $00,$00, $05,$05
.byte $AE,$00, $50, $55,$55, $A6,$66, $A9,$00, $55, $A0,$13,$00
.byte $50, $55,$55, $65, $A7,$66, $A0,$1B,$00, $50, $55,$55
.byte $65, $A9,$66, $A0,$1A,$02, $AE,$05, $A0,$2D,$00, $05,$05, $A0,$4D,$00
.byte $A3,$50, $A0,$26,$00, $55, $A0,$29,$00, $05, $A0,$FF,$00, $A0,$11,$00
.byte $A1
causeway1_rle: .byte $28 ; ysize=48
.byte $A8,$00, $66, $06, $66, $A4,$00, $22, $00
.byte $AF,$66, $76, $A7,$66, $A8,$00, $66, $00, $66
.byte $A4,$00, $22,$22, $AE,$66, $27, $22, $77, $A6,$66
.byte $A8,$00, $66, $60, $06, $A4,$00, $22,$22, $26
.byte $76, $A5,$66, $22, $72, $76, $A4,$66, $06
.byte $27, $77, $A6,$66, $A8,$00, $66,$66, $A5,$00, $22
.byte $00, $20, $27, $A5,$66, $00, $22, $72
.byte $A4,$66, $00, $22, $77, $A5,$66, $22, $A8,$00
.byte $66,$66, $A5,$00, $22, $00, $22,$22, $A5,$66, $60
.byte $02, $77, $A4,$66, $60, $02, $77, $A5,$66
.byte $22, $A8,$00, $66,$66, $A5,$00, $22, $00, $22
.byte $72, $A6,$66, $20, $77, $A4,$66, $26, $22
.byte $77, $A5,$66, $22, $A8,$00, $66, $22, $27
.byte $A4,$00, $22, $00, $22, $77, $A5,$66, $06
.byte $22, $77, $A4,$66, $02,$02, $77, $A5,$66, $22
.byte $A9,$00, $22,$22, $70, $A3,$00, $22, $00, $22
.byte $27, $A5,$66, $00, $22, $77, $A4,$66, $06
.byte $22, $77, $A5,$66, $22, $A7,$00, $20, $00
.byte $22,$22, $77, $A3,$00, $22, $00, $22,$22, $56
.byte $A4,$66, $00, $27, $77, $A4,$22, $00, $22
.byte $77, $A3,$66, $56, $66, $22, $A6,$00, $22
.byte $00,$00, $22,$22, $77, $A3,$00, $22, $00, $22,$22
.byte $55, $66, $56, $66,$66, $00, $22, $77
.byte $A3,$22, $02, $00, $22, $77, $A3,$66, $55
.byte $66, $22, $A6,$00, $22, $00,$00, $22,$22, $77
.byte $A3,$00, $22, $00, $22,$22, $A3,$55, $56, $55
.byte $00, $22, $77, $22,$22, $02, $00,$00, $22
.byte $77, $66, $56, $66, $55,$55, $22, $A6,$00
.byte $22, $00,$00, $22,$22, $77, $A3,$00, $22, $00
.byte $22,$22, $25, $22, $25, $05,$05, $00, $22
.byte $77, $02, $A4,$00, $22, $77, $A4,$25, $05
.byte $22, $A6,$00, $02, $20, $00,$00, $22, $77
.byte $A3,$00, $22, $00, $A0,$02,$A2, $72,$72, $02, $A3,$00
.byte $22, $77, $A5,$00, $22, $77, $A3,$22, $02
.byte $00, $22, $A7,$00, $22, $00,$00, $22, $A0,$01,$A7
.byte $A0,$02,$A0, $A3,$2A, $22, $02, $22, $02, $A4,$00
.byte $22, $77, $A5,$00, $22, $77, $22, $02
.byte $A3,$00, $22, $A7,$00, $22, $00,$00, $2A,$2A, $02
.byte $22, $02, $22, $00, $22, $00, $22
.byte $A5,$00, $22, $27, $A5,$00, $22, $27, $A5,$00
.byte $22, $A7,$00, $22, $00,$00, $22, $00,$00, $22
.byte $00, $22, $00, $22, $00, $22, $A5,$00
.byte $22,$22, $A5,$00, $22,$22, $A5,$00, $22, $A7,$00, $22
.byte $80, $88, $78, $57, $58, $78, $88
.byte $58,$58, $88, $58, $A3,$88, $A5,$85, $A5,$50, $52,$52
.byte $A5,$50, $52, $A7,$00, $02, $08,$08, $07, $A8,$08
.byte $A3,$05, $A3,$08, $05, $A4,$08, $A5,$88, $A5,$85, $A0,$34,$00
.byte $20,$20, $A7,$00, $20, $A5,$00, $20, $22, $72
.byte $50, $A5,$00, $50, $55, $AD,$00, $20, $22,$22
.byte $A3,$00, $20, $22,$22, $52,$52, $50, $A3,$00, $50
.byte $55, $25, $77, $55, $A4,$00, $A4,$55, $AC,$00
.byte $A3,$52, $50, $00,$00, $52, $A5,$55, $00,$00, $50
.byte $A5,$55, $A3,$00, $50, $A4,$55, $50, $AB,$00, $75
.byte $A3,$55, $00,$00, $A6,$55, $00,$00, $55,$55, $A4,$25, $A3,$00
.byte $A6,$55, $AA,$00, $77,$77, $25,$25, $22, $00,$00, $55
.byte $A5,$22, $00,$00, $A6,$22, $A3,$00, $22,$22, $A4,$25
.byte $A1
causeway2_rle: .byte $28 ; ysize=48
.byte $26, $AD,$66, $06, $26, $56, $AA,$66, $00
.byte $22, $77, $22,$22, $A8,$00, $22, $76, $AC,$66
.byte $00, $22, $55, $A4,$66, $06, $22, $76
.byte $A3,$66, $00, $22, $77, $A3,$22, $A7,$00, $22
.byte $77, $AC,$66, $00, $22, $76, $A4,$66, $60
.byte $22, $77, $A3,$26, $00, $22, $77, $A3,$22
.byte $20, $A6,$00, $22, $77, $AB,$66, $22, $55
.byte $22, $77, $A4,$66, $06, $22, $77, $A3,$22
.byte $00, $22, $77, $A4,$22, $A6,$00, $22, $77
.byte $AB,$66, $02, $25, $02, $77, $A4,$66, $00
.byte $22, $77, $22,$22, $00,$00, $22, $77, $A4,$22
.byte $A6,$00, $22, $77, $A3,$66, $06, $22, $52
.byte $A5,$66, $00, $22, $00, $77, $A4,$66, $06
.byte $22, $77, $22,$22, $00,$00, $22, $77, $A4,$22
.byte $A6,$00, $22, $77, $A3,$66, $60, $22, $25
.byte $A5,$66, $00, $22, $00, $77, $A4,$66, $00
.byte $22, $77, $22, $02, $00,$00, $22, $77
.byte $A4,$22, $A6,$00, $22, $77, $A3,$66, $00, $22
.byte $77, $66, $56, $A3,$66, $00, $22, $00
.byte $77, $A4,$66, $00, $22, $77, $22, $A3,$00
.byte $22, $77, $A4,$22, $A6,$00, $22, $77, $A3,$22
.byte $00, $22, $77, $66, $55, $A3,$66, $00
.byte $22,$22, $77, $A4,$22, $00, $22, $77, $A4,$00
.byte $22, $77, $A4,$22, $A6,$00, $55, $77, $A3,$22
.byte $00, $22, $77, $66, $55, $66, $55
.byte $66, $00, $22,$22, $77, $A4,$22, $00, $22
.byte $77, $A4,$00, $22, $77, $A4,$22, $A6,$00, $55
.byte $77, $A3,$22, $00, $22, $77, $55,$55, $66
.byte $55,$55, $00, $22,$22, $77, $22, $26, $22,$22
.byte $00, $22, $77, $A4,$00, $22, $77, $A4,$22
.byte $A6,$00, $55, $77, $A3,$22, $00, $22, $77
.byte $A5,$25, $00, $22,$22, $77, $A4,$22, $00, $22,$22
.byte $A4,$00, $22, $77, $A4,$22, $A6,$00, $55, $77
.byte $A3,$22, $00, $22, $77, $A5,$22, $00, $22,$22
.byte $77, $A4,$22, $00, $22,$22, $A4,$00, $22, $57
.byte $A3,$22, $A7,$00, $55, $77, $A3,$22, $00, $22
.byte $77, $A5,$22, $00, $22,$22, $77, $A4,$22, $00,$00
.byte $22, $A4,$00, $22, $55, $22,$22, $A8,$00, $22
.byte $27, $A3,$22, $00, $A6,$22, $00,$00, $22,$22, $77
.byte $A3,$22, $A3,$00, $22, $A4,$00, $22, $25, $22
.byte $A9,$00, $A5,$22, $00, $A6,$22, $00,$00, $22,$22, $77
.byte $22,$22, $02, $A3,$00, $52, $A4,$00, $22,$22, $AA,$00
.byte $A5,$22, $00, $A4,$22, $02, $A3,$00, $22,$22, $77
.byte $22, $02, $A4,$00, $05, $A4,$00, $22,$22, $AA,$00
.byte $A0,$01,$A5, $85, $58,$58, $57, $77, $87, $22,$22
.byte $A5,$00, $02, $22, $27, $02, $A4,$00, $05
.byte $A3,$55, $58,$58, $AC,$88, $A6,$00, $28, $22, $52,$52
.byte $57, $22,$22, $A3,$02, $00, $20, $70, $A0,$11,$00
.byte $08, $A7,$00, $20,$20, $52, $55, $50, $00
.byte $25,$25, $55, $A4,$50, $22, $77, $A3,$00, $20
.byte $70, $A0,$13,$00, $52, $55,$55, $27, $A3,$55, $22
.byte $00, $22,$22, $00, $05, $25, $22, $77
.byte $22, $77, $00, $22, $77, $A0,$12,$00, $22
.byte $55,$55, $25, $22, $55, $52,$52, $22, $00
.byte $22,$22, $00, $05, $55,$55, $25, $22, $77
.byte $55, $52, $57, $A3,$00, $50, $00, $50
.byte $00, $50, $AA,$00, $22, $A3,$55, $75, $A3,$55
.byte $22, $00, $22,$22, $A4,$00, $05,$05, $55,$55, $22
.byte $77, $A3,$00, $55, $25, $55, $52, $55
.byte $AA,$00, $22, $A4,$55, $52, $55,$55, $22, $00
.byte $22,$22, $A6,$00, $50, $55, $22, $77, $A3,$00
.byte $A3,$55, $52, $55, $A8,$00
.byte $A1
pit_rle: .byte $28 ; ysize=48
.byte $00,$00, $22, $55,$55, $52, $22, $25, $55,$55
.byte $77, $22, $20, $22, $20, $A6,$00, $A3,$05
.byte $80, $00,$00, $02, $A4,$22, $AA,$00, $22, $55
.byte $57, $07, $57, $77, $05, $55, $57
.byte $72, $A4,$22, $A8,$00, $88, $00,$00, $20, $A5,$22
.byte $A9,$00, $22, $A3,$00, $55, $77, $00, $55,$55
.byte $77, $A4,$22, $A8,$00, $58, $00,$00, $A6,$22, $A9,$00
.byte $22, $00, $20, $22, $55, $27, $55
.byte $00, $05, $27, $A3,$22, $52, $A8,$00, $55
.byte $A3,$00, $27, $A4,$22, $A9,$00, $55, $00, $22,$22
.byte $55, $22, $05, $50, $55, $A4,$22, $75
.byte $A8,$00, $55, $A4,$00, $02,$02, $22, $AA,$00, $55
.byte $00, $22,$22, $05, $22, $A4,$55, $A4,$22, $A8,$00
.byte $22, $A0,$11,$00, $55, $00, $22, $55, $00
.byte $22, $55, $05,$05, $85, $A4,$22, $00, $20
.byte $AA,$00, $20, $AD,$00, $55, $00,$00, $55, $00
.byte $22, $05, $00, $22, $88, $A4,$22, $00
.byte $22, $AB,$00, $02, $22, $20, $A9,$00, $22
.byte $55, $00, $50, $05, $00, $22,$22, $00
.byte $05, $88, $A3,$22, $02, $00, $22, $AC,$00
.byte $22, $AA,$00, $22, $00,$00, $55, $00, $55
.byte $22, $50,$50, $55, $88, $A3,$22, $00,$00, $22
.byte $AC,$00, $02, $AA,$00, $22, $00,$00, $55, $00
.byte $55, $22, $A3,$55, $88,$88, $22,$22, $00,$00, $22
.byte $AA,$00, $02, $AC,$00, $22, $00,$00, $55, $00
.byte $55, $22,$22, $05, $50, $88,$88, $22,$22, $00
.byte $22, $00,$00, $50,$50, $A4,$52, $22, $20,$20, $AD,$00
.byte $22, $00,$00, $55, $00, $55, $A3,$22, $55
.byte $77, $88, $22, $00,$00, $22, $A7,$00, $02
.byte $A5,$22, $AB,$00, $22, $00,$00, $55, $00, $55
.byte $72, $22,$22, $55, $77, $88, $22, $00,$00
.byte $55, $AB,$00, $22, $02, $AB,$00, $22, $00,$00
.byte $05, $55, $00, $55, $22,$22, $55, $77
.byte $58, $22, $00,$00, $25, $A5,$00, $50,$50, $A3,$20
.byte $22, $02, $AC,$00, $22, $A3,$00, $55, $00
.byte $55, $22, $25, $55, $77, $55, $A3,$00
.byte $22, $A5,$00, $02, $22, $A3,$02, $AE,$00, $22
.byte $A3,$00, $55, $00, $55,$55, $22, $55, $77
.byte $55, $A3,$00, $52, $A5,$00, $50, $22, $A3,$00
.byte $20, $AD,$00, $22, $00,$00, $20, $55, $00
.byte $55,$55, $22, $55, $77, $55, $A3,$00, $55
.byte $A6,$00, $22, $A4,$00, $02, $AC,$00, $22, $00,$00
.byte $22, $55, $00, $55,$55, $22, $55, $77
.byte $80, $A3,$00, $55, $A3,$00, $20, $00, $22
.byte $A0,$12,$00, $20, $00,$00, $22, $55, $00, $55,$55
.byte $22, $00, $77, $88, $A3,$00, $55, $A3,$00
.byte $22, $00, $22, $A0,$12,$00, $52, $00,$00, $22
.byte $55, $00, $22, $55,$55, $00, $55, $22,$22
.byte $02, $22,$22, $20, $00,$00, $22, $00, $02
.byte $A0,$12,$00, $55, $00,$00, $02, $25, $50, $22
.byte $55,$55, $00, $55, $22,$22, $00, $22, $00
.byte $22, $02, $22,$22, $20, $00, $22, $A0,$11,$00
.byte $25, $A3,$00, $02, $25, $52, $25, $55
.byte $00, $55, $72, $22, $00, $22, $00
.byte $22, $00, $22, $00, $22, $00, $02
.byte $A0,$11,$00, $22, $20, $00, $22, $20, $22,$22
.byte $25, $05, $00,$00, $07, $02, $00, $02
.byte $00, $22, $00, $22, $00, $22, $A0,$12,$00
.byte $A1

View File

@ -87,7 +87,7 @@ end_message:
.include "ootw_c4_city.s"
.include "../text_print.s"
.include "../gr_pageflip.s"
.include "../gr_unrle.s"
.include "../decompress_fast_v2.s"
.include "../gr_fast_clear.s"
.include "../gr_copy.s"
.include "../gr_hlin.s"

View File

@ -153,9 +153,9 @@ room0:
room0_falling:
; load background
lda #>(recharge_rle)
sta GBASH
lda #<(recharge_rle)
lda #>(recharge_lzsa)
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #<(recharge_lzsa)
jmp room_setup_done
@ -182,9 +182,9 @@ room1:
sta PHYSICIST_Y
; load background
lda #>(hallway_rle)
sta GBASH
lda #<(hallway_rle)
lda #>(hallway_lzsa)
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #<(hallway_lzsa)
jmp room_setup_done
@ -211,9 +211,9 @@ room2:
sta PHYSICIST_Y
; load background
lda #>(causeway1_rle)
sta GBASH
lda #<(causeway1_rle)
lda #>(causeway1_lzsa)
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #<(causeway1_lzsa)
jmp room_setup_done
@ -247,25 +247,26 @@ room3:
sta PHYSICIST_Y
; load top high
lda #>(causeway2_rle)
sta GBASH
lda #<(causeway2_rle)
sta GBASL
lda #<(causeway2_lzsa)
sta getsrc_smc+1 ; LZSA_SRC_LO
lda #>(causeway2_lzsa)
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #$10 ; load to page $1000
jsr load_rle_gr
jsr decompress_lzsa2_fast
; load pit background even higher
lda #>(pit_rle)
sta GBASH
lda #<(pit_rle)
sta GBASL
lda #<(pit_lzsa)
sta getsrc_smc+1 ; LZSA_SRC_LO
lda #>(pit_lzsa)
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #$BC ; load to page $BC00
jsr load_rle_gr
jsr decompress_lzsa2_fast
; load background
lda #>(causeway2_rle)
sta GBASH
lda #<(causeway2_rle)
lda #>(causeway2_lzsa)
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #<(causeway2_lzsa)
jmp room_setup_done
@ -307,9 +308,9 @@ room4:
r4_impaled:
; load background
lda #>(pit_rle)
sta GBASH
lda #<(pit_rle)
lda #>(pit_lzsa)
sta getsrc_smc+2 ; LZSA_SRC_HI
lda #<(pit_lzsa)
jmp room_setup_done
@ -317,9 +318,9 @@ r4_impaled:
room_setup_done:
; load bg image
sta GBASL
sta getsrc_smc+1 ; LZSA_SRC_LO
lda #$c ; load to page $c00
jsr load_rle_gr
jsr decompress_lzsa2_fast
; setup walk collision
jsr recalc_walk_collision