summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@github.com>2013-02-09 05:09:58 -0500
committeryenatch <yenatch@github.com>2013-02-09 05:23:39 -0500
commit0b05325e07648f989c612e81fb6bbd37e56813de (patch)
treed6abf47eee3b56b4ea3a50949a618b3746b96e33
parent087e2556f2a5ab0c3d046d5b9667ae3743d48aca (diff)
Allow png->lz compression in the build process
To enable, append '${IMGFILES}' to line 22: pokecrystal.o: pokecrystal.asm constants.asm wram.asm ${TEXTFILES} ${IMGFILES} Also append '${LZFILES}' to line 48: rm -f main.tx pokecrystal.o pokecrystal.gbc ${TEXTFILES} ${LZFILES}
-rw-r--r--Makefile27
1 files changed, 26 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 44d24932f..fbd7bc5c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.SUFFIXES: .asm .tx .o .gbc
+.SUFFIXES: .asm .tx .o .gbc .png .2bpp .lz
TEXTFILES = text/sweethoney.tx \
text/phone/bill.tx \
@@ -7,8 +7,18 @@ TEXTFILES = text/sweethoney.tx \
text/phone/trainers1.tx \
main.tx
+VERTFILES = gfx/pics/%.png \
+ gfx/trainers/%.png
+
+HORIZFILES = $(filter-out gfx/%.png, $(VERTFILES))
+
+IMGFILES = ${VERTFILES} ${HORIZFILES}
+
+LZFILES = gfx/%.lz
+
all: pokecrystal.gbc
+
pokecrystal.o: pokecrystal.asm constants.asm wram.asm ${TEXTFILES}
rgbasm -o pokecrystal.o pokecrystal.asm
@@ -20,5 +30,20 @@ pokecrystal.gbc: pokecrystal.o
rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
cmp baserom.gbc $@
+
+front.png: tiles.png
+ python gfx.py png-to-lz --front $@ $(OBJECT_DIRECTORY)/tiles.2bpp
+
+tiles.png:
+ python gfx.py png-to-2bpp $@
+
+.png: ${VERTFILES}
+ python gfx.py png-to-lz --vert $@
+
+.png: ${HORIZFILES}
+ python gfx.py png-to-lz $@
+
+
clean:
rm -f main.tx pokecrystal.o pokecrystal.gbc ${TEXTFILES}
+