From 8c2a3ae7eac3483764ccd42f890a1de9cf768538 Mon Sep 17 00:00:00 2001 From: Pheenoh Date: Sun, 13 Jun 2021 19:47:12 -0400 Subject: [PATCH] add make assets target --- Makefile | 20 ++++++++++++-------- README.md | 19 ++++++++++++++++++- tools/extract_game_assets.py | 3 +-- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index fda0f921813..c9e91c337db 100644 --- a/Makefile +++ b/Makefile @@ -57,14 +57,15 @@ else SHA1SUM := sha1sum endif -AS := $(DEVKITPPC)/bin/powerpc-eabi-as -OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy -STRIP := $(DEVKITPPC)/bin/powerpc-eabi-strip -CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe -LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe -ELF2DOL := tools/elf2dol -PYTHON := python3 -DOXYGEN := doxygen +AS := $(DEVKITPPC)/bin/powerpc-eabi-as +OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy +STRIP := $(DEVKITPPC)/bin/powerpc-eabi-strip +CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe +LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe +ELF2DOL := tools/elf2dol +PYTHON := python3 +DOXYGEN := doxygen +IMAGENAME := gz2e01.iso POSTPROC := tools/postprocess.py @@ -111,6 +112,9 @@ clean: tools: @$(MAKE) -C tools +assets: + @cd game; python3 ../tools/extract_game_assets.py ../$(IMAGENAME) + docs: $(DOXYGEN) Doxyfile diff --git a/README.md b/README.md index 94b9467827e..faacd2159c9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,24 @@ And will eventually build all the [RELs](./docs/rels_sha1.md). 1. Obtain a clean DOL of TP (GCN USA) and place it at the root of the repo and name it `baserom.dol`. 2. Obtain a copy of the MWCC PowerPC compiler (version 2.7 to be exact). See below for a link to our Discord server which has the CodeWarrior compilers pinned in the #tp-decomp channel. -3. Run `make` at the root of the repo. +3. Replace `tools/mwcc_compiler/2.7/mwcceppc.exe` with the custom one also pinned in the #tp-decomp channel. +4. Run `make` at the root of the repo. + +## Dump Assets + +1. Place a vanilla copy of the NTSC-U version at the root of the folder and call it `gz2e01.iso`. +2. Make the game directory. + +```bash +mkdir game +``` + +3. Run make assets. + +```bash +make assets +```` + ## Contributions diff --git a/tools/extract_game_assets.py b/tools/extract_game_assets.py index b15e7408cb7..c83f7008472 100644 --- a/tools/extract_game_assets.py +++ b/tools/extract_game_assets.py @@ -20,8 +20,7 @@ def getFstInfo(handler, fstOffsetPosition): """ Parses the fst.bin into a list of dictionaries containing -the file name, file offset into the ISO, the file size, -and the folder structure +the file entry type, the file/folder name, the ISO file offset/parent file entry, the file size/last file entry """ def parseFstBin(fstBinBytes): currentByte = 0