diff --git a/Makefile b/Makefile index c862101d..56404185 100644 --- a/Makefile +++ b/Makefile @@ -607,6 +607,7 @@ EMU_FLAGS = --noosd LOADER = loader64 LOADER_FLAGS = -vwf SHA1SUM = sha1sum +ZEROTERM = $(PYTHON) $(TOOLS_DIR)/zeroterm.py ###################### Dependency Check ##################### @@ -725,7 +726,7 @@ endif # RGBA32, RGBA16, IA16, IA8, IA4, IA1, I8, I4 ifeq ($(EXTERNAL_TEXTURES),1) $(BUILD_DIR)/%: %.png - printf "%s%b" "$(patsubst %.png,%,$^)" '\x00' > $@ + $(ZEROTERM) "$(patsubst %.png,%,$^)" > $@ else $(BUILD_DIR)/%: %.png $(N64GRAPHICS) -i $@ -g $< -f $(lastword $(subst ., ,$@)) diff --git a/tools/zeroterm.py b/tools/zeroterm.py new file mode 100644 index 00000000..7675017a --- /dev/null +++ b/tools/zeroterm.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +import sys +if len(sys.argv) < 2: + print("usage: zeroterm ") +else: + sys.stdout.buffer.write(bytes(sys.argv[1], 'ascii') + b'\x00')