Skip to content

Commit c5bba98

Browse files
committed
Adding ECTS splat configuration, corrected+simplified splitting of compressed texture section
1 parent 4eec1ec commit c5bba98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+96160
-70598
lines changed

Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ GAME_DIR = $(BASENAME)
88
BIN_DIR = bin
99
BIN_FILES = $(wildcard $(BIN_DIR)/*.bin)
1010

11+
EXTRACT_DIR = extracted
12+
1113
RZIP_DIRS = $(wildcard rzip/assets*)
1214
RZIP_FILES = $(wildcard rzip/assets*/assets*.bin)
1315

1416
O_FILES = $(foreach file,$(BIN_FILES) $(RZIP_FILES),$(BUILD_DIR)/$(file:.bin=.o))
1517

16-
ifeq ($(VERSION),ects)
17-
$(error The ECTS ROM is not yet supported)
18-
endif
18+
19+
# ifeq ($(VERSION),ects)
20+
# $(error The ECTS ROM is not yet supported)
21+
# endif
1922

2023
CROSS = mips-linux-gnu-
2124
CPP = cpp
@@ -47,6 +50,8 @@ check: .baserom.$(VERSION).ok
4750

4851
extract: check $(GAME_DIR)/$(BASENAME).$(VERSION).bin
4952

53+
decompress: $(EXTRACT_DIR)/00000000.bin
54+
5055
verify: $(TARGET).z64
5156
@echo "$$(cat $(BASENAME).$(VERSION).sha1) $<" | sha1sum --check
5257

@@ -71,6 +76,11 @@ $(TARGET).z64: $(TARGET).bin
7176
$(GAME_DIR)/$(BASENAME).$(VERSION).bin: bin/game.$(VERSION).bin
7277
cat bin/header.$(VERSION).bin bin/boot.$(VERSION).bin bin/init.$(VERSION).bin bin/game.$(VERSION).bin bin/debugger.$(VERSION).bin > $@
7378

79+
# game code is not compressed in ECTS ROM
80+
ifeq ($(VERSION),ects)
81+
bin/game.$(VERSION).bin: $(BASENAME).$(VERSION).yaml
82+
$(PYTHON) tools/n64splat/split.py baserom.$(VERSION).z64 $< .
83+
else
7484
bin/game.$(VERSION).bin: bin/game/rzip/data/0000.bin
7585
cat bin/game/rzip/code/0*.bin bin/game/rzip/data/0000.bin > $@
7686

@@ -79,11 +89,16 @@ bin/game/rzip/data/0000.bin: bin/game.$(VERSION).rzip.bin
7989

8090
bin/game.$(VERSION).rzip.bin: $(BASENAME).$(VERSION).yaml
8191
$(PYTHON) tools/n64splat/split.py baserom.$(VERSION).z64 $< .
92+
endif
8293

8394
.baserom.$(VERSION).ok: baserom.$(VERSION).z64
8495
@echo "$$(cat $(BASENAME).$(VERSION).sha1) $<" | sha1sum --check
8596
@touch $@
8697

98+
$(EXTRACT_DIR)/00000000.bin:
99+
@mkdir -p $(EXTRACT_DIR)
100+
$(PYTHON) tools/extract_compressed.py compressed.$(VERSION).yaml bin/compressed.bin $(EXTRACT_DIR)
101+
87102
# settings
88103
.PHONY: all clean default
89104
SHELL = /bin/bash -e -o pipefail

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Overview of US ROM shown below:
108108
[ rzip ] 0018 8328 > 0019 C7D8 ; game .data (compressed)
109109
[ code ] 0019 EA88 > 001A 2190 ; debugger .text
110110
[ data ] 001A 2190 > 001A 37E0 ; debugger .data
111-
[ rzip ] 001A 37E0 > 00AB 1950 ; compressed assets + unknown
111+
[ rzip ] 001A 37E0 > 00AB 1950 ; compressed section (textures?)
112112
[ offs ] 00AB 1950 > 00AB 1A40 ; table of asset offsets
113113
[ rzip ] 00AB 1A40 > 03F8 B800 ; assets 00 thru assets 1C
114114
[ ffff ] 03F8 B800 > 0400 0000 ; 0xff padding

config/README.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,9 @@ Use the `extract_compressed.py` script to decompress these compressed files.
1111
The arguments are the config file, the file to be decompressed, and the output directory to extract to, e.g.:
1212

1313
```sh
14-
python3 tools/extract_compressed.py config/compressed06.us.yaml bin/compressed06.bin tmp/
14+
mkdir -p tmp
15+
python3 tools/extract_compressed.py config/compressed.us.yaml bin/compressed.bin tmp/
1516
```
16-
17-
You can also iterate over all 6 compressed sections with something like this:
18-
19-
```sh
20-
# create output folders
21-
for d in 00 01 02 03 04 05 06; do mkdir -p textures/${d}; done
22-
# dump textures
23-
for d in 00 01 02 03 04 05 06; \
24-
do \
25-
echo "extracting compressed${d}"; \
26-
python3 tools/extract_compressed.py config/compressed${d}.us.yaml \
27-
bin/compressed${d}.bin textures/${d}; \
28-
done
29-
```
30-
3117
**NOTE:** Change `us` to `eu` if you are working with the `eu` ROM.
3218

3319
### Compression
@@ -42,3 +28,5 @@ python3 tools/compress_dir.py tmp tmp2 --no-padding
4228
# combine compressed files into single blob
4329
cat tmp2/*.gz > compressed.bin
4430
```
31+
32+
In the ROM there is `0x0` padding added to the end of the compressed section to align to a 16 byte boundary.

0 commit comments

Comments
 (0)