mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-12-22 00:10:25 +00:00
use a script to output zero-terminated strings instead of bash printf
This commit is contained in:
parent
9f9e79ed9d
commit
e3401f1547
2 changed files with 8 additions and 1 deletions
3
Makefile
3
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 ., ,$@))
|
||||
|
|
6
tools/zeroterm.py
Normal file
6
tools/zeroterm.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
if len(sys.argv) < 2:
|
||||
print("usage: zeroterm <string>")
|
||||
else:
|
||||
sys.stdout.buffer.write(bytes(sys.argv[1], 'ascii') + b'\x00')
|
Loading…
Reference in a new issue