diff --git a/Makefile b/Makefile index 2a9b77f..78ba118 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,10 @@ ASMFILES := $(wildcard $(SRCDIR)/*.asm) %.pb16: % src/tools/pb16.py $< $@ +# RGBGFX generates tilemaps with sequential tile IDs, which works fine for $8000 mode but not $8800 mode; `bit7ify.py` takes care to flip bit 7 so maps become $8800-compliant +%.bit7.tilemap: src/tools/bit7ify.py %.tilemap + $^ $@ + CLEANTARGETS := $(BINDIR) $(DEPSDIR) $(OBJDIR) dummy # The list of things that must be cleared; expanded by the resource Makefiles INITTARGETS := diff --git a/src/tools/bit7ify.py b/src/tools/bit7ify.py new file mode 100644 index 0000000..f830383 --- /dev/null +++ b/src/tools/bit7ify.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +from sys import argv + + +with open(argv[1], "rb") as input: + with open(argv[2], "wb") as output: + output.write(bytes((byte ^ 0x80 for byte in input.read())))