From 30a058884a3c7e4631935c562ed472128b6d21c7 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 23 Mar 2021 16:33:27 -0400 Subject: [PATCH] ootw: update c5 to lzsa --- games/ootw/ootw_c5/graphics/l5_cave/Makefile | 22 ++++++++++++------ .../ootw_c5/graphics/l5_cave/ootw_c5_cave.inc | 23 ------------------- games/ootw/ootw_c5/ootw_c5.s | 2 +- games/ootw/ootw_c5/ootw_c5_cave.s | 10 ++++---- 4 files changed, 21 insertions(+), 36 deletions(-) delete mode 100644 games/ootw/ootw_c5/graphics/l5_cave/ootw_c5_cave.inc diff --git a/games/ootw/ootw_c5/graphics/l5_cave/Makefile b/games/ootw/ootw_c5/graphics/l5_cave/Makefile index f150395c..563831f2 100644 --- a/games/ootw/ootw_c5/graphics/l5_cave/Makefile +++ b/games/ootw/ootw_c5/graphics/l5_cave/Makefile @@ -1,18 +1,26 @@ -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_c5_cave.inc ##### -ootw_c5_cave.inc: $(PNG2RLE) \ - entrance_cave.png - $(PNG2RLE) asm entrance_cave.png entrance_rle > ootw_c5_cave.inc +ootw_c5_cave.inc: entrance_cave.lzsa + echo "entrance_lzsa: .incbin \"entrance_cave.lzsa\"" > ootw_c5_cave.inc + + +##### + +%.gr: %.png + $(PNG2GR) $< $@ + +%.lzsa: %.gr + $(LZSA) -r -f2 $< $@ ##### clean: - rm -f *~ *.o *.lst *.lzz *.inc + rm -f *~ *.o *.lst *.lzsa *.gr *.inc diff --git a/games/ootw/ootw_c5/graphics/l5_cave/ootw_c5_cave.inc b/games/ootw/ootw_c5/graphics/l5_cave/ootw_c5_cave.inc deleted file mode 100644 index 28a90211..00000000 --- a/games/ootw/ootw_c5/graphics/l5_cave/ootw_c5_cave.inc +++ /dev/null @@ -1,23 +0,0 @@ -entrance_rle: .byte $28 ; ysize=48 - .byte $A0,$17,$00, $20, $A0,$26,$00, $02, $A6,$00, $02, $20,$20 - .byte $AA,$00, $20, $A0,$12,$00, $22, $AA,$00, $06,$06, $A3,$20 - .byte $A3,$00, $20, $00, $22, $A0,$11,$00, $22, $A0,$13,$00 - .byte $22, $00, $22, $20, $00,$00, $A3,$20, $26 - .byte $06, $02,$02, $20,$20, $A3,$00, $20, $02, $A0,$14,$00 - .byte $22, $00, $02, $22, $AB,$00, $A4,$02, $A0,$15,$00 - .byte $22, $00,$00, $02, $A0,$24,$00, $22, $A0,$20,$00, $02,$02 - .byte $66, $60, $A4,$00, $22, $A0,$21,$00, $20, $22 - .byte $A4,$00, $22, $AA,$00, $60, $A0,$16,$00, $62, $60 - .byte $A4,$00, $22, $AB,$00, $66, $A0,$11,$00, $20, $22 - .byte $00,$00, $06, $66, $60, $A3,$00, $22, $A9,$00 - .byte $20,$20, $06, $A0,$15,$00, $22, $02, $06, $A3,$00 - .byte $22, $AB,$00, $02, $22, $A0,$14,$00, $02, $60 - .byte $62, $60,$60, $00,$00, $02, $20, $AA,$00, $22 - .byte $AA,$00, $A3,$20, $22, $02,$02, $06, $00,$00, $02 - .byte $A7,$00, $20, $02, $00,$00, $A5,$20, $00,$00, $02 - .byte $20, $A4,$00, $A4,$26, $06, $02,$02, $A0,$10,$00, $02 - .byte $00, $A3,$02, $A7,$00, $22, $A0,$27,$00, $02, $20 - .byte $A0,$27,$00, $22, $A0,$27,$00, $22, $A0,$27,$00, $22, $A0,$27,$00 - .byte $22, $A0,$27,$00, $62, $A0,$27,$00, $66, $A0,$27,$00, $66 - .byte $A0,$18,$00 - .byte $A1 diff --git a/games/ootw/ootw_c5/ootw_c5.s b/games/ootw/ootw_c5/ootw_c5.s index 10b684fd..1e237529 100644 --- a/games/ootw/ootw_c5/ootw_c5.s +++ b/games/ootw/ootw_c5/ootw_c5.s @@ -82,7 +82,7 @@ end_message: .include "ootw_c5_cave.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_copy_offset.s" diff --git a/games/ootw/ootw_c5/ootw_c5_cave.s b/games/ootw/ootw_c5/ootw_c5_cave.s index c5371f77..7c7dd457 100644 --- a/games/ootw/ootw_c5/ootw_c5_cave.s +++ b/games/ootw/ootw_c5/ootw_c5_cave.s @@ -69,9 +69,9 @@ not_falling_in: falling_in: ; load background - lda #>(entrance_rle) - sta GBASH - lda #<(entrance_rle) + lda #>(entrance_lzsa) + sta getsrc_smc+2 ; LZSA_SRC_HI + lda #<(entrance_lzsa) jmp cave_setup_done @@ -105,9 +105,9 @@ cave1: cave_setup_done: - sta GBASL + sta getsrc_smc+1 ; LZSA_SRC_LO lda #$c ; load to page $c00 - jsr load_rle_gr ; tail call + jsr decompress_lzsa2_fast ; tail call ;===================== ; setup walk collision