mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-09-12 03:12:24 +00:00
Before alternative compression
This commit is contained in:
@@ -3,23 +3,26 @@ EXAMPLE_NAME=slideshow
|
||||
SHRINKLER=0
|
||||
INTERLACE=1
|
||||
HAM_MODE=1
|
||||
COMPRESSED_IMAGES=0
|
||||
|
||||
BOOTBLOCK_ASM=alpine_bootblock.s
|
||||
|
||||
OBJS=out/init.o out/utils.o out/trackloader.o out/image.o
|
||||
|
||||
IMAGES=mr.png batgirl.png catwoman.png kb.png fe.png ww.png
|
||||
IMAGES=mr.png mr2.png mr3.png mr4.png mr5.png mr6.png mr7.png
|
||||
|
||||
USERSTACK_ADDRESS=7fffc
|
||||
BASE_ADDRESS=10000
|
||||
DECOMPRESS_ADDRESS=10000
|
||||
|
||||
#--use-palette=palettes/$*.pal
|
||||
|
||||
ifeq ($(HAM_MODE),1)
|
||||
VASM_EXTRA_ARGS=-DINTERLACE=$(INTERLACE) -DHAM_MODE=$(HAM_MODE)
|
||||
VASM_EXTRA_ARGS=-DINTERLACE=$(INTERLACE) -DHAM_MODE=$(HAM_MODE) -DCOMPRESSED_IMAGES=$(COMPRESSED_IMAGES)
|
||||
IMAGECON_ARGS= --dither --ham
|
||||
IMAGEDATA=$(addprefix out/, $(IMAGES:.png=-ham.bin))
|
||||
else
|
||||
VASM_EXTRA_ARGS=-DINTERLACE=$(INTERLACE) -DHAM_MODE=$(HAM_MODE)
|
||||
VASM_EXTRA_ARGS=-DINTERLACE=$(INTERLACE) -DHAM_MODE=$(HAM_MODE) -DCOMPRESSED_IMAGES=$(COMPRESSED_IMAGES)
|
||||
IMAGECON_ARGS=--colors 32 --quantize
|
||||
IMAGEDATA=$(addprefix out/, $(IMAGES:.png=.bin))
|
||||
endif
|
||||
@@ -48,7 +51,7 @@ out/%.bin.sz: out/%.bin
|
||||
|
||||
|
||||
out/%-ham.bin: out/%.sized.png
|
||||
$(IMAGECON) --input $< $(IMAGECON_ARGS) --output-bitplanes --output-palette-asm --output-palette $(DITHER) --output out/$* --use-palette=palettes/$*.pal
|
||||
$(IMAGECON) --input $< $(IMAGECON_ARGS) --output-bitplanes --output-palette-asm --output-palette $(DITHER) --output out/$*
|
||||
|
||||
out/main.o: $(SIZEDIMAGEDATA) $(IMAGEDATA) $(SHRUNKDATA) constants.i Makefile link.script
|
||||
out/init.o: constants.i Makefile
|
||||
+143
-31
@@ -1,8 +1,6 @@
|
||||
include "includes.i"
|
||||
|
||||
xref LoadNextImage
|
||||
|
||||
|
||||
xref LoadNextImage
|
||||
|
||||
LoadNextImage:
|
||||
movem.l d0-a6,-(sp)
|
||||
@@ -36,14 +34,22 @@ LoadImage1:
|
||||
;; d0 - size
|
||||
;; a1 - start address
|
||||
;; a2 - InstallColorPalette(X) address
|
||||
if 0
|
||||
if COMPRESSED_IMAGES==1
|
||||
|
||||
move.l a2,a3
|
||||
move.l bitplanesp3,a0 ; Load compressed data into bitplanes3
|
||||
endif
|
||||
|
||||
else; COMPRESSED_IMAGES==0
|
||||
|
||||
move.l bitplanesp1,a0
|
||||
|
||||
endif; COMPRESSED_IMAGES==1
|
||||
|
||||
|
||||
move.l bitplanesp1,a0
|
||||
bsr DoLoadImage
|
||||
|
||||
if 0
|
||||
if COMPRESSED_IMAGES==1
|
||||
|
||||
;; Decompress
|
||||
; a0 = compressed data
|
||||
; a1 = decompressed data destination
|
||||
@@ -51,9 +57,15 @@ LoadImage1:
|
||||
; a2 = progress callback, can be zero if no callback is desired.
|
||||
lea Callback(pc),a2
|
||||
bsr ShrinklerDecompress ; -> decompress!
|
||||
endif
|
||||
jsr (a3)
|
||||
|
||||
else; COMPRESSED_IMAGES==10
|
||||
|
||||
jsr (a2)
|
||||
|
||||
endif; COMPRESSED_IMAGES==1
|
||||
|
||||
jsr (a2)
|
||||
|
||||
move.l bitplanesp1,a1
|
||||
bsr SetupImage
|
||||
rts
|
||||
@@ -62,14 +74,17 @@ LoadImage2:
|
||||
;; d0 - size
|
||||
;; a1 - start address
|
||||
;; a2 - InstallColorPalette(X) address
|
||||
if 0
|
||||
if COMPRESSED_IMAGES==1
|
||||
move.l a2,a3
|
||||
move.l bitplanesp3,a0 ; Load compressed data into bitplanes3
|
||||
endif
|
||||
else; COMPRESSED_IMAGES==0
|
||||
move.l bitplanesp2,a0
|
||||
endif; COMPRESSED_IMAGES==1
|
||||
|
||||
move.l bitplanesp2,a0
|
||||
bsr DoLoadImage
|
||||
|
||||
if 0
|
||||
if COMPRESSED_IMAGES==1
|
||||
|
||||
;; Decompress
|
||||
; a0 = compressed data
|
||||
; a1 = decompressed data destination
|
||||
@@ -77,9 +92,15 @@ LoadImage2:
|
||||
; a2 = progress callback, can be zero if no callback is desired.
|
||||
lea Callback(pc),a2
|
||||
bsr ShrinklerDecompress ; -> decompress!
|
||||
endif
|
||||
|
||||
jsr (a3)
|
||||
|
||||
else; COMPRESSED_IMAGES==0
|
||||
|
||||
jsr (a2)
|
||||
|
||||
endif; COMPRESSED_IMAGES==1
|
||||
|
||||
|
||||
move.l bitplanesp2,a1
|
||||
bsr SetupImage
|
||||
rts
|
||||
@@ -156,69 +177,160 @@ imageLookupTable:
|
||||
dc.l InstallColorPalette6
|
||||
dc.l imageData6
|
||||
dc.l endImageData6-imageData6
|
||||
dc.l LoadImage1
|
||||
dc.l LoadImage1
|
||||
dc.l 0
|
||||
|
||||
dc.l InstallColorPalette7
|
||||
dc.l imageData7
|
||||
dc.l endImageData7-imageData7
|
||||
dc.l LoadImage2
|
||||
dc.l 0
|
||||
|
||||
imageIndex:
|
||||
dc.l 0
|
||||
|
||||
InstallColorPalette:
|
||||
include "out/mr-palette.s"
|
||||
rts
|
||||
InstallColorPalette2:
|
||||
include "out/mr2-palette.s"
|
||||
rts
|
||||
InstallColorPalette3:
|
||||
include "out/mr3-palette.s"
|
||||
rts
|
||||
InstallColorPalette4:
|
||||
include "out/mr4-palette.s"
|
||||
rts
|
||||
InstallColorPalette5:
|
||||
include "out/mr5-palette.s"
|
||||
rts
|
||||
InstallColorPalette6:
|
||||
include "out/mr6-palette.s"
|
||||
rts
|
||||
InstallColorPalette7:
|
||||
include "out/mr7-palette.s"
|
||||
rts
|
||||
|
||||
|
||||
include "../tools/external/shrinkler/ShrinklerDecompress.S"
|
||||
|
||||
|
||||
|
||||
section .photo
|
||||
|
||||
cnop 0,512
|
||||
imageData1:
|
||||
if COMPRESSED_IMAGES==1
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr-ham.bin.sz"
|
||||
else
|
||||
incbin "out/mr.bin.sz"
|
||||
endif
|
||||
else
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr-ham.bin"
|
||||
else
|
||||
incbin "out/mr.bin"
|
||||
endif
|
||||
endif
|
||||
endImageData1:
|
||||
|
||||
cnop 0,512
|
||||
imageData2:
|
||||
if COMPRESSED_IMAGES==1
|
||||
if HAM_MODE==1
|
||||
incbin "out/catwoman-ham.bin"
|
||||
incbin "out/mr2-ham.bin.sz"
|
||||
else
|
||||
incbin "out/catwoman.bin"
|
||||
incbin "out/mr2.bin.sz"
|
||||
endif
|
||||
else
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr2-ham.bin"
|
||||
else
|
||||
incbin "out/mr2.bin"
|
||||
endif
|
||||
endif
|
||||
endImageData2:
|
||||
|
||||
cnop 0,512
|
||||
imageData3:
|
||||
imageData3:
|
||||
if COMPRESSED_IMAGES==1
|
||||
if HAM_MODE==1
|
||||
incbin "out/batgirl-ham.bin"
|
||||
incbin "out/mr3-ham.bin.sz"
|
||||
else
|
||||
incbin "out/batgirl.bin"
|
||||
incbin "out/mr3.bin.sz"
|
||||
endif
|
||||
else
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr3-ham.bin"
|
||||
else
|
||||
incbin "out/mr3.bin"
|
||||
endif
|
||||
endif
|
||||
endImageData3:
|
||||
|
||||
cnop 0,512
|
||||
imageData4:
|
||||
if COMPRESSED_IMAGES==1
|
||||
if HAM_MODE==1
|
||||
incbin "out/kb-ham.bin"
|
||||
incbin "out/mr4-ham.bin.sz"
|
||||
else
|
||||
incbin "out/kb.bin"
|
||||
incbin "out/mr4.bin.sz"
|
||||
endif
|
||||
else
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr4-ham.bin"
|
||||
else
|
||||
incbin "out/mr4.bin"
|
||||
endif
|
||||
endif
|
||||
endImageData4:
|
||||
|
||||
cnop 0,512
|
||||
imageData5:
|
||||
imageData5:
|
||||
if COMPRESSED_IMAGES==1
|
||||
if HAM_MODE==1
|
||||
incbin "out/fe-ham.bin"
|
||||
incbin "out/mr5-ham.bin.sz"
|
||||
else
|
||||
incbin "out/fe.bin"
|
||||
incbin "out/mr5.bin.sz"
|
||||
endif
|
||||
else
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr5-ham.bin"
|
||||
else
|
||||
incbin "out/mr5.bin"
|
||||
endif
|
||||
endif
|
||||
endImageData5:
|
||||
|
||||
cnop 0,512
|
||||
imageData6:
|
||||
if COMPRESSED_IMAGES==1
|
||||
if HAM_MODE==1
|
||||
incbin "out/ww-ham.bin"
|
||||
incbin "out/mr6-ham.bin.sz"
|
||||
else
|
||||
incbin "out/ww.bin"
|
||||
incbin "out/mr6.bin.sz"
|
||||
endif
|
||||
endImageData6:
|
||||
else
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr6-ham.bin"
|
||||
else
|
||||
incbin "out/mr6.bin"
|
||||
endif
|
||||
endif
|
||||
endImageData6:
|
||||
|
||||
cnop 0,512
|
||||
imageData7:
|
||||
if COMPRESSED_IMAGES==1
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr7-ham.bin.sz"
|
||||
else
|
||||
incbin "out/mr7.bin.sz"
|
||||
endif
|
||||
else
|
||||
if HAM_MODE==1
|
||||
incbin "out/mr7-ham.bin"
|
||||
else
|
||||
incbin "out/mr7.bin"
|
||||
endif
|
||||
endif
|
||||
endImageData7:
|
||||
@@ -5,12 +5,6 @@
|
||||
xref Level3InterruptHandler
|
||||
xref copperList
|
||||
xref copperListAlternate
|
||||
xref InstallColorPalette
|
||||
xref InstallColorPalette2
|
||||
xref InstallColorPalette3
|
||||
xref InstallColorPalette4
|
||||
xref InstallColorPalette5
|
||||
xref InstallColorPalette6
|
||||
xref bitplanesp1
|
||||
xref bitplanesp2
|
||||
xref bitplanesp3
|
||||
@@ -30,10 +24,14 @@ Entry:
|
||||
.mainLoop:
|
||||
jsr WaitVerticalBlank
|
||||
|
||||
if 0
|
||||
cmp.l #50*5,counter
|
||||
bne .updateCounter
|
||||
jsr LoadNextImage
|
||||
move.l #0,counter
|
||||
else
|
||||
jsr LoadNextImage
|
||||
endif
|
||||
|
||||
.updateCounter:
|
||||
add.l #1,counter
|
||||
@@ -127,28 +125,8 @@ copperList:
|
||||
dc.w BPL6PTH,0
|
||||
dc.l $fffffffe
|
||||
|
||||
InstallColorPalette:
|
||||
include "out/mr-palette.s"
|
||||
rts
|
||||
InstallColorPalette2:
|
||||
include "out/catwoman-palette.s"
|
||||
rts
|
||||
InstallColorPalette3:
|
||||
include "out/batgirl-palette.s"
|
||||
rts
|
||||
InstallColorPalette4:
|
||||
include "out/kb-palette.s"
|
||||
rts
|
||||
InstallColorPalette5:
|
||||
include "out/fe-palette.s"
|
||||
rts
|
||||
InstallColorPalette6:
|
||||
include "out/ww-palette.s"
|
||||
rts
|
||||
|
||||
align 4
|
||||
|
||||
|
||||
bitplanesp1:
|
||||
dc.l endCode
|
||||
bitplanesp2:
|
||||
|
||||
Reference in New Issue
Block a user