Isolate rev1 building tree (#239)

* try

* move yamls

* gitignore

* fix

* gitignore starfox64.us.rev1.yaml

* fix RM

* update readme

* readme again, forgot a few things

* okay one more...

* fix ci
This commit is contained in:
Alejandro Asenjo Nitti 2024-05-11 21:11:29 -03:00 committed by GitHub
parent 0dbbf453f9
commit cd3444b727
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 66 additions and 67 deletions

View File

@ -37,7 +37,7 @@ jobs:
path: sf64-secret
- name: Get the dependency
run: cp -r sf64-secret/baserom.us.z64 ./
run: cp -r sf64-secret/baserom.us.rev1.z64 ./
- name: Compile
run: make init

2
.gitignore vendored
View File

@ -4,7 +4,7 @@ __pycache__
.splat/
starfox64.ld
starfox64.uncompressed.ld
starfox64.us.yaml
starfox64.us.rev1.yaml
ctx.c
ctx.c.m2c
*.d

View File

@ -47,9 +47,10 @@ else
endif
VERSION ?= us
REV ?= rev1
BASEROM := baserom.$(VERSION).z64
BASEROM_UNCOMPRESSED := baserom.$(VERSION).uncompressed.z64
BASEROM := baserom.$(VERSION).$(REV).z64
BASEROM_UNCOMPRESSED := baserom.$(VERSION).$(REV).uncompressed.z64
TARGET := starfox64
### Output ###
@ -57,11 +58,11 @@ TARGET := starfox64
BUILD_DIR := build
TOOLS := tools
PYTHON := python3
ROM := $(BUILD_DIR)/$(TARGET).$(VERSION).uncompressed.z64
ROMC := $(BUILD_DIR)/$(TARGET).$(VERSION).z64
ELF := $(BUILD_DIR)/$(TARGET).$(VERSION).elf
LD_MAP := $(BUILD_DIR)/$(TARGET).$(VERSION).map
LD_SCRIPT := linker_scripts/$(VERSION)/$(TARGET).ld
ROM := $(BUILD_DIR)/$(TARGET).$(VERSION).$(REV).uncompressed.z64
ROMC := $(BUILD_DIR)/$(TARGET).$(VERSION).$(REV).z64
ELF := $(BUILD_DIR)/$(TARGET).$(VERSION).$(REV).elf
LD_MAP := $(BUILD_DIR)/$(TARGET).$(VERSION).$(REV).map
LD_SCRIPT := linker_scripts/$(VERSION)/$(REV)/$(TARGET).ld
#### Setup ####
@ -205,14 +206,14 @@ endif
ASM_PROC_FLAGS := --input-enc=utf-8 --output-enc=euc-jp --convert-statics=global-with-filename
SPLAT ?= $(PYTHON) $(TOOLS)/splat/split.py
SPLAT_YAML ?= $(TARGET).$(VERSION).yaml
SPLAT_YAML ?= $(TARGET).$(VERSION).$(REV).yaml
COMPTOOL := $(TOOLS)/comptool.py
COMPTOOL_DIR := baserom
MIO0 := $(TOOLS)/mio0
IINC := -Iinclude -Ibin/$(VERSION) -I.
IINC := -Iinclude -Ibin/$(VERSION).$(REV) -I.
IINC += -Ilib/ultralib/include -Ilib/ultralib/include/PR -Ilib/ultralib/include/ido
ifeq ($(KEEP_MDEBUG),0)
@ -273,10 +274,10 @@ endif
#### Files ####
$(shell mkdir -p asm bin linker_scripts/$(VERSION)/auto)
$(shell mkdir -p asm bin linker_scripts/$(VERSION)/$(REV)/auto)
SRC_DIRS := $(shell find src -type d)
ASM_DIRS := $(shell find asm/$(VERSION) -type d -not -path "asm/$(VERSION)/nonmatchings/*")
ASM_DIRS := $(shell find asm/$(VERSION)/$(REV) -type d -not -path "asm/$(VERSION)/$(REV)/nonmatchings/*")
BIN_DIRS := $(shell find bin -type d)
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
@ -293,7 +294,7 @@ DEP_FILES := $(O_FILES:.o=.d) \
$(O_FILES:.o=.asmproc.d)
# create build directories
$(shell mkdir -p $(BUILD_DIR)/linker_scripts/$(VERSION) $(BUILD_DIR)/linker_scripts/$(VERSION)/auto $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(BIN_DIRS),$(BUILD_DIR)/$(dir)))
$(shell mkdir -p $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV) $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV)/auto $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(BIN_DIRS),$(BUILD_DIR)/$(dir)))
ifeq ($(COMPILER),ido)
@ -393,21 +394,21 @@ uncompressed: $(ROM)
ifneq ($(COMPARE),0)
@echo "$(GREEN)Calculating Rom Header Checksum... $(YELLOW)$<$(NO_COL)"
@$(PYTHON) $(COMPTOOL) -r $(ROM) .
@md5sum --status -c $(TARGET).$(VERSION).uncompressed.md5 && \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).uncompressed.z64$(NO_COL): $(GREEN)OK$(NO_COL)\n$(YELLOW) $(SF)" || \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).uncompressed.z64 $(RED)FAILED$(NO_COL)\n\
@md5sum --status -c $(TARGET).$(VERSION).$(REV).uncompressed.md5 && \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).$(REV).uncompressed.z64$(NO_COL): $(GREEN)OK$(NO_COL)\n$(YELLOW) $(SF)" || \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).$(REV).uncompressed.z64 $(RED)FAILED$(NO_COL)\n\
$(RED)CAN'T LET YOU DO THAT, STARFOX.$(NO_COL)\n"
@md5sum --status -c $(TARGET).$(VERSION).uncompressed.md5
@md5sum --status -c $(TARGET).$(VERSION).$(REV).uncompressed.md5
endif
compressed: $(ROMC)
ifeq ($(COMPARE),1)
@echo "$(GREEN)Calculating Rom Header Checksum... $(YELLOW)$<$(NO_COL)"
@$(PYTHON) $(COMPTOOL) -r $(ROMC) .
@md5sum --status -c $(TARGET).$(VERSION).md5 && \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).z64$(NO_COL): $(GREEN)OK$(NO_COL)\n" || \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).z64 $(RED)FAILED$(NO_COL)\n"
@md5sum --status -c $(TARGET).$(VERSION).uncompressed.md5
@md5sum --status -c $(TARGET).$(VERSION).$(REV).md5 && \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).$(REV).z64$(NO_COL): $(GREEN)OK$(NO_COL)\n" || \
$(PRINT) "$(BLUE)$(TARGET).$(VERSION).$(REV).z64 $(RED)FAILED$(NO_COL)\n"
@md5sum --status -c $(TARGET).$(VERSION).$(REV).uncompressed.md5
endif
#### Main Targets ###
@ -421,9 +422,9 @@ compress: $(BASEROM)
@$(PYTHON) $(COMPTOOL) -c -m $(MIO0) $(ROM) $(ROMC)
extract:
@$(RM) -r asm/$(VERSION) bin/$(VERSION)
@$(RM) -r asm/$(VERSION)/$(REV) bin/$(VERSION)/$(REV)
@echo "Unifying yamls..."
@$(CAT) yamls/$(VERSION)/header.yaml yamls/$(VERSION)/main.yaml yamls/$(VERSION)/assets.yaml yamls/$(VERSION)/overlays.yaml > $(SPLAT_YAML)
@$(CAT) yamls/$(VERSION)/$(REV)/header.yaml yamls/$(VERSION)/$(REV)/main.yaml yamls/$(VERSION)/$(REV)/assets.yaml yamls/$(VERSION)/$(REV)/overlays.yaml > $(SPLAT_YAML)
@echo "Extracting..."
@$(SPLAT) $(SPLAT_YAML)
@ -440,7 +441,7 @@ clean:
@git clean -fdx build/
@git clean -fdx src/assets/
@git clean -fdx include/assets/
@git clean -fdx linker_scripts/*.ld
@git clean -fdx linker_scripts/$(REV)/*.ld
format:
@$(PYTHON) $(TOOLS)/format.py -j $(N_THREADS)
@ -459,9 +460,9 @@ context:
@$(PYTHON) ./tools/m2ctx.py $(filter-out $@, $(MAKECMDGOALS))
disasm:
@$(RM) -r asm/$(VERSION) bin/$(VERSION)
@$(RM) -r asm/$(VERSION)/$(REV) bin/$(VERSION)/$(REV)
@echo "Unifying yamls..."
@$(CAT) yamls/$(VERSION)/header.yaml yamls/$(VERSION)/main.yaml yamls/$(VERSION)/assets.yaml yamls/$(VERSION)/overlays.yaml > $(SPLAT_YAML)
@$(CAT) yamls/$(VERSION)/$(REV)/header.yaml yamls/$(VERSION)/$(REV)/main.yaml yamls/$(VERSION)/$(REV)/assets.yaml yamls/$(VERSION)/$(REV)/overlays.yaml > $(SPLAT_YAML)
@echo "Extracting..."
@$(SPLAT) $(SPLAT_YAML) --disassemble-all
@ -478,10 +479,10 @@ $(ROM): $(ELF)
$(V)$(OBJCOPY) -O binary $< $@
# Link
$(ELF): $(LIBULTRA_O) $(O_FILES) $(LD_SCRIPT) $(BUILD_DIR)/linker_scripts/$(VERSION)/hardware_regs.ld $(BUILD_DIR)/linker_scripts/$(VERSION)/undefined_syms.ld $(BUILD_DIR)/linker_scripts/$(VERSION)/pif_syms.ld
$(ELF): $(LIBULTRA_O) $(O_FILES) $(LD_SCRIPT) $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV)/hardware_regs.ld $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV)/undefined_syms.ld $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV)/pif_syms.ld
$(call print,Linking:,$<,$@)
$(V)$(LD) $(LDFLAGS) -T $(LD_SCRIPT) \
-T $(BUILD_DIR)/linker_scripts/$(VERSION)/hardware_regs.ld -T $(BUILD_DIR)/linker_scripts/$(VERSION)/undefined_syms.ld -T $(BUILD_DIR)/linker_scripts/$(VERSION)/pif_syms.ld \
-T $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV)/hardware_regs.ld -T $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV)/undefined_syms.ld -T $(BUILD_DIR)/linker_scripts/$(VERSION)/$(REV)/pif_syms.ld \
-Map $(LD_MAP) -o $@
# PreProcessor

View File

@ -6,7 +6,7 @@ This is a WIP **matching decompilation** of ***Starfox 64***. The purpose of the
It currently builds the following ROM:
* starfox64.us.z64 `MD5: 741a94eee093c4c8684e66b89f8685e8`
* starfox64.us.rev1.z64 `MD5: 741a94eee093c4c8684e66b89f8685e8`
**This repo does not include any assets or assembly code necessary for compiling the ROM. A prior copy of the game is required to extract the required assets.**
@ -81,7 +81,7 @@ make toolchain
#### 5. Prepare a base ROM
Copy your ROM to the root of this new project directory, and rename the file of the baserom to reflect the version of ROM you are using. ex: `baserom.us.z64`
Copy your ROM to the root of this new project directory, and rename the file of the baserom to reflect the version of ROM you are using. ex: `baserom.us.rev1.z64`
* Make sure the ROM is the US version, revision 1.1 (REV A).
#### 6. Make and Build the ROM
@ -93,17 +93,17 @@ make init
```
This will create the build folders, a new folder with the assembly as well as containing the disassembly of nearly all the files containing code.
this make target will also build the ROM. If all goes well, a new ROM called "starfox64.us.z64" should be built and the following text should be printed:
this make target will also build the ROM. If all goes well, a new ROM called "starfox64.us.rev1.z64" should be built and the following text should be printed:
```bash
741a94eee093c4c8684e66b89f8685e8 build/starfox64.us.z64
./build/starfox64.us.z64: OK
741a94eee093c4c8684e66b89f8685e8 build/starfox64.us.rev1.z64
./build/starfox64.us.rev1.z64: OK
```
If you instead see the following:
```bash
./build/starfox64.us.z64: FAILED
./build/starfox64.us.rev1.z64: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
```

View File

@ -364,7 +364,7 @@ void func_80008780(f32* arg0, s32 arg1, f32* arg2) {
}
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/audio/audio_synthesis/func_80008780.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/audio/audio_synthesis/func_80008780.s")
#endif
// https://decomp.me/scratch/mYlns
@ -494,7 +494,7 @@ void func_80009124(s16** arg0) {
}
#else
void func_80009124(s16** arg0);
#pragma GLOBAL_ASM("asm/us/nonmatchings/audio/audio_synthesis/func_80009124.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/audio/audio_synthesis/func_80009124.s")
#endif
void func_80009504(s16* arg0, UnkStruct_800097A8* arg1) {
@ -1143,7 +1143,7 @@ Acmd* func_8000A700(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisState* synth
return aList;
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/audio/audio_synthesis/func_8000A700.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/audio/audio_synthesis/func_8000A700.s")
#endif
Acmd* func_8000B3F0(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthState, s32 numSamplesToLoad) {

View File

@ -398,7 +398,7 @@ void Ending_8018845C(void) {
}
#else
void Ending_8018845C(void);
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_ending/fox_end1/Ending_8018845C.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/overlays/ovl_ending/fox_end1/Ending_8018845C.s")
#endif
s32 Ending_80188634(void) {

View File

@ -2317,7 +2317,7 @@ void Venom1_Boss_Update(Boss* boss) {
}
#else
void Venom1_Boss_Update(Boss* boss);
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i1/fox_ve1/Venom1_Boss_Update.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/overlays/ovl_i1/fox_ve1/Venom1_Boss_Update.s")
#endif
void Venom1_80198310(Boss* boss) {

View File

@ -3309,7 +3309,7 @@ void Aquas_Boss_Update(Boss* bossAQ) {
}
#else
void Aquas_Boss_Update(Boss* bossAQ);
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i3/fox_aq/Aquas_Boss_Update.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/overlays/ovl_i3/fox_aq/Aquas_Boss_Update.s")
#endif
bool Aquas_801B42AC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) {

View File

@ -176,7 +176,7 @@ void SectorZ_Missile_Update(Actor* this) {
}
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i4/fox_sz/SectorZ_Missile_Update.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/overlays/ovl_i4/fox_sz/SectorZ_Missile_Update.s")
#endif
void SectorZ_80199FCC(Actor* actor, s32 arg1) {

View File

@ -2922,7 +2922,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
return ret;
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i5/fox_ti/Titania_80190A08.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/overlays/ovl_i5/fox_ti/Titania_80190A08.s")
bool Titania_80190A08(s32, Gfx**, Vec3f*, Vec3f*, void*);
#endif
@ -4720,7 +4720,7 @@ void Titania_80193DF0(Boss* boss) {
boss->dmgType = DMG_NONE;
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i5/fox_ti/Titania_80193DF0.s")
#pragma GLOBAL_ASM("asm/us/rev1/nonmatchings/overlays/ovl_i5/fox_ti/Titania_80193DF0.s")
void Titania_80193DF0(Boss*);
#endif

View File

@ -1 +0,0 @@
741a94eee093c4c8684e66b89f8685e8 ./build/starfox64.us.z64

1
starfox64.us.rev1.md5 Normal file
View File

@ -0,0 +1 @@
741a94eee093c4c8684e66b89f8685e8 ./build/starfox64.us.rev1.z64

View File

@ -0,0 +1 @@
23e24fb0f090c6c0b3793a96169dce51 ./build/starfox64.us.rev1.uncompressed.z64

View File

@ -1 +0,0 @@
23e24fb0f090c6c0b3793a96169dce51 ./build/starfox64.us.uncompressed.z64

View File

@ -1,39 +1,37 @@
name: Starfox64 (North America)
name: Starfox64 US REV 1 (v1.1)
# baserom compressed
# sha1: 09f0d105f476b00efa5303a3ebc42e60a7753b7a
# baserom uncompressed
sha1: f7475fb11e7e6830f82883412638e8390791ab87
options:
basename: starfox64
target_path: baserom.us.uncompressed.z64
elf_path: build/starfox64.elf
ld_script_path: linker_scripts/us/starfox64.ld
target_path: baserom.us.rev1.uncompressed.z64
elf_path: build/starfox64.us.rev1.elf
ld_script_path: linker_scripts/us/rev1/starfox64.ld
base_path: .
compiler: IDO
find_file_boundaries: True
header_encoding: ASCII
platform: n64
undefined_funcs_auto_path: linker_scripts/us/auto/undefined_funcs_auto.ld
undefined_syms_auto_path: linker_scripts/us/auto/undefined_syms_auto.ld
undefined_funcs_auto_path: linker_scripts/us/rev1/auto/undefined_funcs_auto.ld
undefined_syms_auto_path: linker_scripts/us/rev1/auto/undefined_syms_auto.ld
symbol_addrs_path:
- linker_scripts/us/symbol_addrs.txt
- linker_scripts/us/symbol_addrs_engine.txt
- linker_scripts/us/symbol_addrs_libultra.txt
- linker_scripts/us/symbol_addrs_nlib_funcs.txt
- linker_scripts/us/symbol_addrs_nlib_vars.txt
- linker_scripts/us/symbol_addrs_assets.txt
- linker_scripts/us/symbol_addrs_mesg.txt
- linker_scripts/us/symbol_addrs_audio.txt
- linker_scripts/us/symbol_addrs_overlays.txt
- linker_scripts/us/symbol_addrs_EBFBE0.txt
- linker_scripts/us/ignored_addresses.txt
reloc_addrs_path:
- relocs/reloc_addrs.us.txt
- linker_scripts/us/rev1/symbol_addrs.txt
- linker_scripts/us/rev1/symbol_addrs_engine.txt
- linker_scripts/us/rev1/symbol_addrs_libultra.txt
- linker_scripts/us/rev1/symbol_addrs_nlib_funcs.txt
- linker_scripts/us/rev1/symbol_addrs_nlib_vars.txt
- linker_scripts/us/rev1/symbol_addrs_assets.txt
- linker_scripts/us/rev1/symbol_addrs_mesg.txt
- linker_scripts/us/rev1/symbol_addrs_audio.txt
- linker_scripts/us/rev1/symbol_addrs_overlays.txt
- linker_scripts/us/rev1/symbol_addrs_EBFBE0.txt
- linker_scripts/us/rev1/ignored_addresses.txt
asm_path: asm/us
asm_path: asm/us/rev1
src_path: src
asset_path: bin/us
asset_path: bin/us/rev1
build_path: build