From 40465a1dc5d6448e6eb01fdcd863d1576c5c5a87 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Mon, 21 Mar 2016 20:37:33 +1100 Subject: [PATCH] Converted to use doynamite68k compression --- 023.slideshow/Makefile | 11 +-- 023.slideshow/constants.i | 2 +- 023.slideshow/image.s | 168 ++++++++-------------------------- 023.slideshow/palettes/mr.pal | 16 ++++ 4 files changed, 61 insertions(+), 136 deletions(-) create mode 100644 023.slideshow/palettes/mr.pal diff --git a/023.slideshow/Makefile b/023.slideshow/Makefile index 6abedaa..a0e037e 100644 --- a/023.slideshow/Makefile +++ b/023.slideshow/Makefile @@ -3,13 +3,13 @@ EXAMPLE_NAME=slideshow SHRINKLER=0 INTERLACE=1 HAM_MODE=1 -COMPRESSED_IMAGES=0 +COMPRESSED_IMAGES=1 BOOTBLOCK_ASM=alpine_bootblock.s OBJS=out/init.o out/utils.o out/trackloader.o out/image.o -IMAGES=mr.png mr2.png mr3.png mr4.png mr5.png mr6.png mr7.png +IMAGES=mr.png mr2.png mr3.png mr4.png mr5.png mr6.png mr7.png mr8.png USERSTACK_ADDRESS=7fffc BASE_ADDRESS=10000 @@ -27,7 +27,7 @@ IMAGECON_ARGS=--colors 32 --quantize IMAGEDATA=$(addprefix out/, $(IMAGES:.png=.bin)) endif -SHRUNKDATA=$(IMAGEDATA:.bin=.bin.sz) +SHRUNKDATA=$(IMAGEDATA:.bin=.lz) SIZEDIMAGEDATA=$(addprefix out/, $(IMAGES:.png=.sized.png)) ifeq ($(INTERLACE),1) @@ -46,9 +46,8 @@ out/%.sized.png: ../assets/%.png out/%.bin: out/%.sized.png $(IMAGECON) --input $< $(IMAGECON_ARGS) --output-bitplanes --output-palette-asm --output-palette $(DITHER) --output out/$* -out/%.bin.sz: out/%.bin - $(SHRINKLEREXE) -d $< $@ - +out/%.lz: out/%.bin + $(DOYNAMITE68K) $< out/%-ham.bin: out/%.sized.png $(IMAGECON) --input $< $(IMAGECON_ARGS) --output-bitplanes --output-palette-asm --output-palette $(DITHER) --output out/$* diff --git a/023.slideshow/constants.i b/023.slideshow/constants.i index 8a4aff6..4b14bf2 100644 --- a/023.slideshow/constants.i +++ b/023.slideshow/constants.i @@ -1,7 +1,7 @@ SCREEN_WIDTH equ 320 SCREEN_HEIGHT equ (256+(256*INTERLACE)) SCREEN_WIDTH_BYTES equ (SCREEN_WIDTH/8) - if HAM_MODE == 1 + if HAM_MODE==1 SCREEN_BIT_DEPTH equ 6 else SCREEN_BIT_DEPTH equ 5 diff --git a/023.slideshow/image.s b/023.slideshow/image.s index fbdde14..49580d1 100644 --- a/023.slideshow/image.s +++ b/023.slideshow/image.s @@ -21,52 +21,21 @@ LoadNextImage: movem.l (sp)+,d0-a6 rts -Callback: - ;; d0 = Number of bytes decompressed so far - ;; a0 = Callback argument - move.l a6,-(sp) - lea CUSTOM,a6 - move.w d0,COLOR00(a6) ; Set wild background colors as we decompress - move.l (sp)+,a6 - rts LoadImage1: ;; d0 - size ;; a1 - start address ;; a2 - InstallColorPalette(X) address - if COMPRESSED_IMAGES==1 - move.l a2,a3 move.l bitplanesp3,a0 ; Load compressed data into bitplanes3 - - else; COMPRESSED_IMAGES==0 - - move.l bitplanesp1,a0 - - endif; COMPRESSED_IMAGES==1 - - bsr DoLoadImage - if COMPRESSED_IMAGES==1 - - ;; Decompress - ; a0 = compressed data - ; a1 = decompressed data destination move.l bitplanesp1,a1 - ; a2 = progress callback, can be zero if no callback is desired. - lea Callback(pc),a2 - bsr ShrinklerDecompress ; -> decompress! - jsr (a3) - - else; COMPRESSED_IMAGES==10 - - jsr (a2) - - endif; COMPRESSED_IMAGES==1 + movem.l d0-a6,-(sp) + bsr doynaxdepack + movem.l (sp)+,d0-a6 - - move.l bitplanesp1,a1 + jsr (a2) bsr SetupImage rts @@ -74,34 +43,16 @@ LoadImage2: ;; d0 - size ;; a1 - start address ;; a2 - InstallColorPalette(X) address - if COMPRESSED_IMAGES==1 - move.l a2,a3 - move.l bitplanesp3,a0 ; Load compressed data into bitplanes3 - else; COMPRESSED_IMAGES==0 - move.l bitplanesp2,a0 - endif; COMPRESSED_IMAGES==1 + move.l bitplanesp3,a0 ; Load compressed data into bitplanes3 bsr DoLoadImage - if COMPRESSED_IMAGES==1 - - ;; Decompress - ; a0 = compressed data - ; a1 = decompressed data destination move.l bitplanesp2,a1 - ; a2 = progress callback, can be zero if no callback is desired. - lea Callback(pc),a2 - bsr ShrinklerDecompress ; -> decompress! - jsr (a3) - - else; COMPRESSED_IMAGES==0 + movem.l d0-a6,-(sp) + bsr doynaxdepack + movem.l (sp)+,d0-a6 jsr (a2) - - endif; COMPRESSED_IMAGES==1 - - - move.l bitplanesp2,a1 bsr SetupImage rts @@ -178,12 +129,16 @@ imageLookupTable: dc.l imageData6 dc.l endImageData6-imageData6 dc.l LoadImage1 - dc.l 0 dc.l InstallColorPalette7 dc.l imageData7 dc.l endImageData7-imageData7 dc.l LoadImage2 + + dc.l InstallColorPalette8 + dc.l imageData8 + dc.l endImageData8-imageData8 + dc.l LoadImage1 dc.l 0 imageIndex: @@ -209,128 +164,83 @@ InstallColorPalette6: rts InstallColorPalette7: include "out/mr7-palette.s" - rts + rts +InstallColorPalette8: + include "out/mr8-palette.s" + rts - - include "../tools/external/shrinkler/ShrinklerDecompress.S" + include "../tools/external/doynamite68k/depacker_doynax.asm" section .photo cnop 0,512 imageData1: - if COMPRESSED_IMAGES==1 if HAM_MODE==1 - incbin "out/mr-ham.bin.sz" + incbin "out/mr-ham.lz" else - incbin "out/mr.bin.sz" - endif - else - if HAM_MODE==1 - incbin "out/mr-ham.bin" - else - incbin "out/mr.bin" - endif + incbin "out/mr.lz" endif endImageData1: cnop 0,512 imageData2: - if COMPRESSED_IMAGES==1 if HAM_MODE==1 - incbin "out/mr2-ham.bin.sz" + incbin "out/mr2-ham.lz" else - incbin "out/mr2.bin.sz" - endif - else - if HAM_MODE==1 - incbin "out/mr2-ham.bin" - else - incbin "out/mr2.bin" - endif + incbin "out/mr2.lz" endif endImageData2: cnop 0,512 imageData3: - if COMPRESSED_IMAGES==1 if HAM_MODE==1 - incbin "out/mr3-ham.bin.sz" + incbin "out/mr3-ham.lz" else - incbin "out/mr3.bin.sz" - endif - else - if HAM_MODE==1 - incbin "out/mr3-ham.bin" - else - incbin "out/mr3.bin" - endif + incbin "out/mr3.lz" endif endImageData3: cnop 0,512 imageData4: - if COMPRESSED_IMAGES==1 if HAM_MODE==1 - incbin "out/mr4-ham.bin.sz" + incbin "out/mr4-ham.lz" else - incbin "out/mr4.bin.sz" - endif - else - if HAM_MODE==1 - incbin "out/mr4-ham.bin" - else - incbin "out/mr4.bin" - endif + incbin "out/mr4.lz" endif endImageData4: cnop 0,512 imageData5: - if COMPRESSED_IMAGES==1 if HAM_MODE==1 - incbin "out/mr5-ham.bin.sz" + incbin "out/mr5-ham.lz" else - incbin "out/mr5.bin.sz" - endif - else - if HAM_MODE==1 - incbin "out/mr5-ham.bin" - else - incbin "out/mr5.bin" - endif + incbin "out/mr5.lz" endif endImageData5: cnop 0,512 imageData6: - if COMPRESSED_IMAGES==1 if HAM_MODE==1 - incbin "out/mr6-ham.bin.sz" + incbin "out/mr6-ham.lz" else - incbin "out/mr6.bin.sz" - endif - else - if HAM_MODE==1 - incbin "out/mr6-ham.bin" - else - incbin "out/mr6.bin" - endif + incbin "out/mr6.lz" endif endImageData6: cnop 0,512 imageData7: - if COMPRESSED_IMAGES==1 if HAM_MODE==1 - incbin "out/mr7-ham.bin.sz" + incbin "out/mr7-ham.lz" else - incbin "out/mr7.bin.sz" + incbin "out/mr7.lz" endif - else +endImageData7: + + cnop 0,512 +imageData8: if HAM_MODE==1 - incbin "out/mr7-ham.bin" + incbin "out/mr8-ham.lz" else - incbin "out/mr7.bin" + incbin "out/mr8.lz" endif - endif -endImageData7: \ No newline at end of file +endImageData8: \ No newline at end of file diff --git a/023.slideshow/palettes/mr.pal b/023.slideshow/palettes/mr.pal new file mode 100644 index 0000000..cbc1362 --- /dev/null +++ b/023.slideshow/palettes/mr.pal @@ -0,0 +1,16 @@ +9ac +244 +cef +28a +744 +122 +3ce +267 +cbd +978 +422 +b8c +def +133 +19c +111