Skip to content

Commit d39055b

Browse files
committed
gcipack, rel: Add multi-version game code support
1 parent 2d05c52 commit d39055b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ttyd-tools/gcipack/gcipack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
# Create header
4141
headerBuffer = ctypes.create_string_buffer(0x40)
42-
struct.pack_into(">L", headerBuffer, 0x00, 0x47384D45) # game code
42+
struct.pack_into("4s", headerBuffer, 0x00, sys.argv[7].encode()) # game code
4343
struct.pack_into(">H", headerBuffer, 0x04, 0x3031) # maker code
4444
struct.pack_into(">B", headerBuffer, 0x06, 0xFF) # unused
4545
struct.pack_into(">B", headerBuffer, 0x07, 2) # banner flags (RGB5A3)

ttyd-tools/rel/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ LDFLAGS = -r -e _prolog -u _prolog -u _epilog -u _unresolved -Wl,--gc-sections
5959
# Platform options
6060
ifeq ($(VERSION),us)
6161
CFLAGS += -DTTYD_US
62+
GAMECODE = "G8ME"
6263
else ifeq ($(VERSION),jp)
6364
CFLAGS += -DTTYD_JP
65+
GAMECODE = "G8MJ"
6466
else ifeq ($(VERSION),eu)
6567
CFLAGS += -DTTYD_EU
68+
GAMECODE = "G8MP"
6669
endif
6770

6871

@@ -169,7 +172,7 @@ $(OFILES_SOURCES) : $(HFILES)
169172

170173
%.gci: %.rel
171174
@echo packing ... $(notdir $@)
172-
@$(GCIPACK) $< "rel" "Paper Mario" "TTYD Debug Menu" $(BANNERFILE) $(ICONFILE)
175+
@$(GCIPACK) $< "rel" "Paper Mario" "TTYD Debug Menu" $(BANNERFILE) $(ICONFILE) $(GAMECODE)
173176

174177
#---------------------------------------------------------------------------------
175178
# This rule links in binary data with the .jpg extension

0 commit comments

Comments
 (0)