Merge remote-tracking branch 'decomp/main' into decomp_merge_4

This commit is contained in:
Yanis42
2024-07-30 00:36:11 +02:00
39 changed files with 1985 additions and 567 deletions

110
Makefile
View File

@@ -85,24 +85,34 @@ endif
# Version-specific settings
ifeq ($(VERSION),gc-us)
REGION := US
PAL := 0
MQ := 0
DEBUG := 0
COMPARE := 0
CPP_DEFINES += -DOOT_NTSC=1 -DOOT_PAL=0 -DOOT_MQ=0
HACKEROOT := 0
else ifeq ($(VERSION),gc-eu)
REGION := EU
PAL := 1
MQ := 0
DEBUG := 0
CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=0
HACKEROOT := 0
else ifeq ($(VERSION),gc-eu-mq)
REGION := EU
PAL := 1
MQ := 1
DEBUG := 0
CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1
HACKEROOT := 0
else ifeq ($(VERSION),gc-eu-mq-dbg)
REGION := EU
PAL := 1
MQ := 1
DEBUG := 1
CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1
HACKEROOT := 0
else ifeq ($(VERSION),hackeroot-mq)
REGION := NULL
PAL := 1
MQ := 1
DEBUG := 1
CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1
HACKEROOT := 1
else
$(error Unsupported version $(VERSION))
@@ -126,6 +136,31 @@ ifeq ($(origin PACKAGE_VERSION), undefined)
endif
endif
# Converts e.g. ntsc-1.0 to OOT_NTSC_1_0
VERSION_MACRO := OOT_$(shell echo $(VERSION) | tr a-z-. A-Z__)
CPP_DEFINES += -DOOT_VERSION=$(VERSION_MACRO)
CPP_DEFINES += -DOOT_REGION=REGION_$(REGION)
ifeq ($(PAL),0)
CPP_DEFINES += -DOOT_NTSC=1
else
CPP_DEFINES += -DOOT_PAL=1
endif
ifeq ($(MQ),0)
CPP_DEFINES += -DOOT_MQ=0
else
CPP_DEFINES += -DOOT_MQ=1
endif
ifeq ($(DEBUG),1)
CPP_DEFINES += -DOOT_DEBUG=1
OPTFLAGS := -O2
else
CPP_DEFINES += -DOOT_DEBUG=0 -DNDEBUG
OPTFLAGS := -O2 -g3
endif
ifeq ($(VERSION),hackeroot-mq)
CPP_DEFINES += -DENABLE_HACKEROOT=1
OPTFLAGS := -Os
@@ -217,7 +252,7 @@ INC := -Iinclude -Iinclude/libc -Isrc -I$(BUILD_DIR) -I. -I$(EXTRACTED_DIR)
# Check code syntax with host compiler
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces
CHECK_WARNINGS += -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion
CHECK_WARNINGS += -Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=incompatible-pointer-types
# The `cpp` command behaves differently on macOS (it behaves as if
# `-traditional-cpp` was passed) so we use `gcc -E` instead.
@@ -248,7 +283,7 @@ endif
CFLAGS += $(GBI_DEFINES)
ASFLAGS := -march=vr4300 -32 -no-pad-sections -Iinclude
ASFLAGS := -march=vr4300 -32 -no-pad-sections -Iinclude -I$(EXTRACTED_DIR)
ifeq ($(COMPILER),gcc)
CFLAGS += -G 0 -nostdinc $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -mdivide-breaks -fno-PIC -fno-common -ffreestanding -fbuiltin -fno-builtin-sinf -fno-builtin-cosf $(CHECK_WARNINGS) -funsigned-char
@@ -287,25 +322,29 @@ endif
# create extracted directories
$(shell mkdir -p $(EXTRACTED_DIR) $(EXTRACTED_DIR)/assets $(EXTRACTED_DIR)/text)
# create extracted directories
$(shell mkdir -p $(EXTRACTED_DIR) $(EXTRACTED_DIR)/assets $(EXTRACTED_DIR)/text)
ASSET_BIN_DIRS_EXTRACTED := $(shell find $(EXTRACTED_DIR)/assets -type d)
ASSET_BIN_DIRS_COMMITTED := $(shell find assets -type d -not -path "assets/xml*" -not -path assets/text)
ASSET_BIN_DIRS := $(ASSET_BIN_DIRS_EXTRACTED) $(ASSET_BIN_DIRS_COMMITTED)
ASSET_BIN_DIRS := $(shell find $(EXTRACTED_DIR)/assets -type d)
ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin))
ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(wildcard assets/text/*.c),$(BUILD_DIR)/$(f:.c=.o))
ASSET_FILES_BIN_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.bin))
ASSET_FILES_BIN_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.bin))
ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN_EXTRACTED:.bin=.bin.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(ASSET_FILES_BIN_COMMITTED:.bin=.bin.inc.c),$(BUILD_DIR)/$f) \
$(foreach f,$(wildcard assets/text/*.c),$(BUILD_DIR)/$(f:.c=.o))
UNDECOMPILED_DATA_DIRS := $(shell find data -type d)
BASEROM_BIN_FILES := $(wildcard $(EXTRACTED_DIR)/baserom/*)
# source files
ASSET_C_FILES_EXTRACTED := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.c)))
ASSET_C_FILES_COMMITTED := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.c)))
SRC_C_FILES := $(filter-out %.inc.c,$(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)))
ASSET_C_FILES := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c)))
S_FILES := $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(wildcard $(dir)/*.s))
O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(SRC_C_FILES:.c=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(ASSET_C_FILES:.c=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(ASSET_C_FILES_EXTRACTED:.c=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(ASSET_C_FILES_COMMITTED:.c=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(BASEROM_BIN_FILES),$(BUILD_DIR)/baserom/$(notdir $f).o)
UCODE_PATCHES := $(wildcard F3DEX3/*.bps)
UCODE_FILES := $(foreach f,$(UCODE_PATCHES:.bps=),$f)
@@ -318,13 +357,26 @@ OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(SPEC_REPLACE_VARS) | g
DEP_FILES := $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d)
TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png))
TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg))
TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%))
TEXTURE_FILES_PNG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.png))
TEXTURE_FILES_PNG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.png))
TEXTURE_FILES_JPG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.jpg))
TEXTURE_FILES_JPG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.jpg))
TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG_EXTRACTED:.png=.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(TEXTURE_FILES_PNG_COMMITTED:.png=.inc.c),$(BUILD_DIR)/$f) \
$(foreach f,$(TEXTURE_FILES_JPG_EXTRACTED:.jpg=.jpg.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(TEXTURE_FILES_JPG_COMMITTED:.jpg=.jpg.inc.c),$(BUILD_DIR)/$f)
# create build directories
$(shell mkdir -p $(BUILD_DIR)/baserom $(BUILD_DIR)/assets/text $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(BUILD_DIR)/$(dir)) $(foreach dir,$(ASSET_BIN_DIRS),$(dir:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)))
$(shell mkdir -p $(BUILD_DIR)/baserom \
$(BUILD_DIR)/assets/text \
$(foreach dir, \
$(SRC_DIRS) \
$(UNDECOMPILED_DATA_DIRS) \
$(ASSET_BIN_DIRS_COMMITTED), \
$(BUILD_DIR)/$(dir)) \
$(foreach dir, \
$(ASSET_BIN_DIRS_EXTRACTED), \
$(dir:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)))
ifeq ($(COMPILER),gcc)
# Note that if adding additional assets directories for modding reasons these flags must also be used there
@@ -440,6 +492,7 @@ setup: venv
$(V)$(PYTHON) tools/decompress_baserom.py $(VERSION)
$(call print,Decompressing baserom: Done!)
$(V)$(PYTHON) tools/extract_baserom.py $(BASEROM_DIR)/baserom-decompressed.z64 --oot-version $(VERSION) -o $(EXTRACTED_DIR)/baserom
$(V)$(PYTHON) tools/extract_incbins.py $(EXTRACTED_DIR)/baserom --oot-version $(VERSION) -o $(EXTRACTED_DIR)/incbin
$(V)$(PYTHON) tools/msgdis.py $(VERSION)
$(V)$(PYTHON) extract_assets.py -v $(VERSION) -j$(N_THREADS)
$(call print,Extracting files: Done!)
@@ -544,7 +597,7 @@ $(BUILD_DIR)/F3DEX3/%.o: F3DEX3/%
$(BUILD_DIR)/data/%.o: data/%.s
$(call print,Assembling:,$<,$@)
$(V)$(AS) $(ASFLAGS) $< -o $@
$(V)$(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@
$(BUILD_DIR)/assets/text/%.enc.jpn.h: assets/text/%.h $(EXTRACTED_DIR)/text/%.h assets/text/charmap.txt
$(call print,Encoding:,$<,$@)
@@ -568,6 +621,10 @@ $(BUILD_DIR)/assets/text/%.o: assets/text/%.c
$(V)$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
$(V)$(OBJCOPY) -O binary -j.rodata $@ $@.bin
$(BUILD_DIR)/assets/%.o: assets/%.c
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
$(OBJCOPY) -O binary $@ $@.bin
$(BUILD_DIR)/assets/%.o: $(EXTRACTED_DIR)/assets/%.c
$(call print,Compiling:,$<,$@)
$(V)$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
@@ -625,12 +682,21 @@ $(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/$(SPEC)
$(V)$(FADO) $$(tools/reloc_prereq $< $(notdir $*)) -n $(notdir $*) -o $(@:.o=.s) -M $(@:.o=.d)
$(V)$(AS) $(ASFLAGS) $(@:.o=.s) -o $@
$(BUILD_DIR)/assets/%.inc.c: assets/%.png
$(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@
$(BUILD_DIR)/assets/%.inc.c: $(EXTRACTED_DIR)/assets/%.png
$(V)$(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@
$(BUILD_DIR)/assets/%.bin.inc.c: assets/%.bin
$(ZAPD) bblb -eh -i $< -o $@
$(BUILD_DIR)/assets/%.bin.inc.c: $(EXTRACTED_DIR)/assets/%.bin
$(V)$(ZAPD) bblb -eh -i $< -o $@
$(BUILD_DIR)/assets/%.jpg.inc.c: assets/%.jpg
$(ZAPD) bren -eh -i $< -o $@
$(BUILD_DIR)/assets/%.jpg.inc.c: $(EXTRACTED_DIR)/assets/%.jpg
$(V)$(ZAPD) bren -eh -i $< -o $@

View File

@@ -1,5 +1,70 @@
dmadata_start: 0x12F70
text_lang_pal: true
incbins:
- name: ipl3
segment: makerom
vram: 0x80000040
size: 0xFC0
- name: rspbootText
segment: boot
vram: 0x80009320
size: 0xD0
- name: aspMainText
segment: code
vram: 0x801120C0
size: 0xFB0
- name: gspS2DEX2d_fifoText
segment: code
vram: 0x80113070
size: 0x18C0
- name: njpgdspMainText
segment: code
vram: 0x80114930
size: 0xAF0
- name: gMojiFontTLUTs
segment: code
vram: 0x8012A740
size: 0x80
- name: gMojiFontTex
segment: code
vram: 0x8012A7C0
size: 0x400
- name: gSoundFontTable
segment: code
vram: 0x801550D0
size: 0x270
- name: gSequenceFontTable
segment: code
vram: 0x80155340
size: 0x1C0
- name: gSequenceTable
segment: code
vram: 0x80155500
size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80155BF0
size: 0x80
- name: aspMainData
segment: code
vram: 0x80155C70
size: 0x2E0
- name: gspF3DZEX2_NoN_PosLight_fifoText
segment: code
vram: 0x80155F50
size: 0x1630
- name: gspF3DZEX2_NoN_PosLight_fifoData
segment: code
vram: 0x80157580
size: 0x420
- name: gspS2DEX2d_fifoData
segment: code
vram: 0x801579A0
size: 0x390
- name: njpgdspMainData
segment: code
vram: 0x80157D30
size: 0x60
variables:
gMtxClear: 0x8012DB20
sNesMessageEntryTable: 0x8014B320

View File

@@ -1,5 +1,62 @@
dmadata_start: 0x7170
text_lang_pal: true
incbins:
- name: ipl3
segment: makerom
vram: 0x80000040
size: 0xFC0
- name: rspbootText
segment: boot
vram: 0x80005FC0
size: 0xD0
- name: aspMainText
segment: code
vram: 0x800E11A0
size: 0xFB0
- name: gspS2DEX2d_fifoText
segment: code
vram: 0x800E2150
size: 0x18C0
- name: njpgdspMainText
segment: code
vram: 0x800E3A10
size: 0xAF0
- name: gSoundFontTable
segment: code
vram: 0x80110470
size: 0x270
- name: gSequenceFontTable
segment: code
vram: 0x801106E0
size: 0x1C0
- name: gSequenceTable
segment: code
vram: 0x801108A0
size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80110F90
size: 0x80
- name: aspMainData
segment: code
vram: 0x80111010
size: 0x2E0
- name: gspF3DZEX2_NoN_PosLight_fifoText
segment: code
vram: 0x801112F0
size: 0x1630
- name: gspF3DZEX2_NoN_PosLight_fifoData
segment: code
vram: 0x80112920
size: 0x420
- name: gspS2DEX2d_fifoData
segment: code
vram: 0x80112D40
size: 0x390
- name: njpgdspMainData
segment: code
vram: 0x801130D0
size: 0x60
variables:
gMtxClear: 0x800FBC00
sNesMessageEntryTable: 0x801077F0

View File

@@ -1,5 +1,62 @@
dmadata_start: 0x7170
text_lang_pal: true
incbins:
- name: ipl3
segment: makerom
vram: 0x80000040
size: 0xFC0
- name: rspbootText
segment: boot
vram: 0x80005FC0
size: 0xD0
- name: aspMainText
segment: code
vram: 0x800E11C0
size: 0xFB0
- name: gspS2DEX2d_fifoText
segment: code
vram: 0x800E2170
size: 0x18C0
- name: njpgdspMainText
segment: code
vram: 0x800E3A30
size: 0xAF0
- name: gSoundFontTable
segment: code
vram: 0x80110490
size: 0x270
- name: gSequenceFontTable
segment: code
vram: 0x80110700
size: 0x1C0
- name: gSequenceTable
segment: code
vram: 0x801108C0
size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80110FB0
size: 0x80
- name: aspMainData
segment: code
vram: 0x80111030
size: 0x2E0
- name: gspF3DZEX2_NoN_PosLight_fifoText
segment: code
vram: 0x80111310
size: 0x1630
- name: gspF3DZEX2_NoN_PosLight_fifoData
segment: code
vram: 0x80112940
size: 0x420
- name: gspS2DEX2d_fifoData
segment: code
vram: 0x80112D60
size: 0x390
- name: njpgdspMainData
segment: code
vram: 0x801130F0
size: 0x60
variables:
gMtxClear: 0x800FBC20
sNesMessageEntryTable: 0x80107810

View File

@@ -1,5 +1,62 @@
dmadata_start: 0x7170
text_lang_pal: false
incbins:
- name: ipl3
segment: makerom
vram: 0x80000040
size: 0xFC0
- name: rspbootText
segment: boot
vram: 0x80005FC0
size: 0xD0
- name: aspMainText
segment: code
vram: 0x800E3840
size: 0xFB0
- name: gspS2DEX2d_fifoText
segment: code
vram: 0x800E47F0
size: 0x18C0
- name: njpgdspMainText
segment: code
vram: 0x800E60B0
size: 0xAF0
- name: gSoundFontTable
segment: code
vram: 0x80112C80
size: 0x270
- name: gSequenceFontTable
segment: code
vram: 0x80112EF0
size: 0x1C0
- name: gSequenceTable
segment: code
vram: 0x801130B0
size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x801137A0
size: 0x80
- name: aspMainData
segment: code
vram: 0x80113820
size: 0x2E0
- name: gspF3DZEX2_NoN_PosLight_fifoText
segment: code
vram: 0x80113B00
size: 0x1630
- name: gspF3DZEX2_NoN_PosLight_fifoData
segment: code
vram: 0x80115130
size: 0x420
- name: gspS2DEX2d_fifoData
segment: code
vram: 0x80115550
size: 0x390
- name: njpgdspMainData
segment: code
vram: 0x801158E0
size: 0x60
variables:
gMtxClear: 0x800FE2A0
sJpnMessageEntryTable: 0x80109E8C

View File

@@ -1,5 +1,70 @@
dmadata_start: 0x12F70
text_lang_pal: true
incbins:
- name: ipl3
segment: makerom
vram: 0x80000040
size: 0xFC0
- name: rspbootText
segment: boot
vram: 0x80009320
size: 0xD0
- name: aspMainText
segment: code
vram: 0x801120C0
size: 0xFB0
- name: gspS2DEX2d_fifoText
segment: code
vram: 0x80113070
size: 0x18C0
- name: njpgdspMainText
segment: code
vram: 0x80114930
size: 0xAF0
- name: gMojiFontTLUTs
segment: code
vram: 0x8012A740
size: 0x80
- name: gMojiFontTex
segment: code
vram: 0x8012A7C0
size: 0x400
- name: gSoundFontTable
segment: code
vram: 0x801550D0
size: 0x270
- name: gSequenceFontTable
segment: code
vram: 0x80155340
size: 0x1C0
- name: gSequenceTable
segment: code
vram: 0x80155500
size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80155BF0
size: 0x80
- name: aspMainData
segment: code
vram: 0x80155C70
size: 0x2E0
- name: gspF3DZEX2_NoN_PosLight_fifoText
segment: code
vram: 0x80155F50
size: 0x1630
- name: gspF3DZEX2_NoN_PosLight_fifoData
segment: code
vram: 0x80157580
size: 0x420
- name: gspS2DEX2d_fifoData
segment: code
vram: 0x801579A0
size: 0x390
- name: njpgdspMainData
segment: code
vram: 0x80157D30
size: 0x60
variables:
gMtxClear: 0x8012DB20
sNesMessageEntryTable: 0x8014B320

View File

@@ -1,22 +1,22 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .rodata
.balign 16
glabel gSoundFontTable
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCC270, 0x270
.incbin "incbin/gSoundFontTable"
glabel gSequenceFontTable
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCC4E0, 0x1C0
.incbin "incbin/gSequenceFontTable"
glabel gSequenceTable
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCC6A0, 0x6F0
.incbin "incbin/gSequenceTable"
glabel gSampleBankTable
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCCD90, 0x80
.incbin "incbin/gSampleBankTable"

View File

@@ -1,18 +1,18 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .rodata
.balign 16
glabel gspF3DZEX2_NoN_PosLight_fifoTextStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCD0F0, 0x1630
.incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoText"
glabel gspF3DZEX2_NoN_PosLight_fifoTextEnd
glabel gspF3DZEX2_NoN_PosLight_fifoDataStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCE720, 0x420
.incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoData"
glabel gspF3DZEX2_NoN_PosLight_fifoDataEnd

View File

@@ -1,38 +1,38 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .rodata
.balign 16
glabel rspbootTextStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0x9F20, 0xD0
.incbin "incbin/rspbootText"
glabel rspbootTextEnd
glabel aspMainTextStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xB89260, 0xFB0
.incbin "incbin/aspMainText"
glabel aspMainTextEnd
glabel aspMainDataStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCCE10, 0x2E0
.incbin "incbin/aspMainData"
glabel aspMainDataEnd
glabel gspS2DEX2d_fifoTextStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xB8A210, 0x18C0
.incbin "incbin/gspS2DEX2d_fifoText"
glabel gspS2DEX2d_fifoTextEnd
glabel gspS2DEX2d_fifoDataStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCEB40, 0x390
.incbin "incbin/gspS2DEX2d_fifoData"
glabel gspS2DEX2d_fifoDataEnd
glabel njpgdspMainTextStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xB8BAD0, 0xAF0
.incbin "incbin/njpgdspMainText"
glabel njpgdspMainTextEnd
glabel njpgdspMainDataStart
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCEED0, 0x60
.incbin "incbin/njpgdspMainData"
glabel njpgdspMainDataEnd

View File

@@ -1,17 +1,18 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .data
.balign 16
# Unused.
# This appears to be RSP code, however it is not part of
# rspboot as rspbootTextEnd is at this symbol
/* Unused.
* This appears to be RSP code, however it is not part of
* rspboot as rspbootTextEnd is at this symbol.
*/
glabel D_800093F0
.word 0xE80C2001 # sqv $v12[0], 0x10($zero)
.word 0x34014000 # li $1, 0x4000

View File

@@ -1,15 +1,15 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .data
.balign 16
# Unused
/* Unused */
glabel D_80009410
.word osStopThread
.word __osSetHWIntrRoutine

View File

@@ -1,15 +1,15 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .data
.balign 16
# Unused
/* Unused */
glabel D_8012ABC0
.word fmodf
.word guScale

View File

@@ -1,18 +1,20 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .data
.balign 16
# temporary file name, rename to something more appropriate when decompiled
/* temporary file name, rename to something more appropriate when decompiled */
#if OOT_DEBUG
glabel gMojiFontTLUTs
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBA18E0, 0x80
.incbin "incbin/gMojiFontTLUTs"
glabel gMojiFontTex
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBA1960, 0x400
.incbin "incbin/gMojiFontTex"
#endif

View File

@@ -37,10 +37,10 @@ Large code block, click to show
```
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
/* assembler directives */
.set noat /* allow manual use of $at */
.set noreorder /* don't insert nops after branches */
.set gp=64 /* allow use of 64-bit general purpose registers */
.section .data

View File

@@ -771,7 +771,8 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize);
void KaleidoSetup_Update(PlayState* play);
void KaleidoSetup_Init(PlayState* play);
void KaleidoSetup_Destroy(PlayState* play);
void func_8006EE50(Font* font, u16 arg1, u16 arg2);
s32 Kanji_OffsetFromShiftJIS(s32 character);
void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex);
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex);
void Font_LoadMessageBoxIcon(Font* font, u16 icon);
void Font_LoadOrderedFont(Font* font);

View File

@@ -1,6 +1,16 @@
#ifndef MACROS_H
#define MACROS_H
// OOT versions in build order
#define OOT_GC_JP 1
#define OOT_GC_JP_MQ 2
#define OOT_GC_US 3
#define OOT_GC_US_MQ 4
#define OOT_GC_EU_MQ_DBG 5
#define OOT_GC_EU 6
#define OOT_GC_EU_MQ 7
#define OOT_GC_JP_CE 8
#ifndef AVOID_UB
#define BAD_RETURN(type) type
#else

View File

@@ -77,6 +77,38 @@
#define MESSAGE_WIDE_HIGHSCORE 0x869F
#define MESSAGE_WIDE_TIME 0x81A1
/*
* Message character constants
*/
// Non-Wide (nes/ger/fra)
#define MESSAGE_CHAR_SPACE 0x20 // ' '
// Wide (jpn)
#define MESSAGE_WIDE_CHAR_SPACE 0x8140 // ' '
#define MESSAGE_WIDE_CHAR_TOUTEN 0x8141 // '、'
#define MESSAGE_WIDE_CHAR_KUTEN 0x8142 // '。'
#define MESSAGE_WIDE_CHAR_PERIOD 0x8144 // ''
#define MESSAGE_WIDE_CHAR_NAKATEN 0x8145 // '・'
#define MESSAGE_WIDE_CHAR_QUESTION_MARK 0x8148 // ''
#define MESSAGE_WIDE_CHAR_EXCLAMATION_MARK 0x8149 // ''
#define MESSAGE_WIDE_CHAR_CIRCUMFLEX_ACCENT 0x814F // ''
#define MESSAGE_WIDE_CHAR_DOUBLE_QUOTATION_MARK_LEFT 0x8167 // '“'
#define MESSAGE_WIDE_CHAR_DOUBLE_QUOTATION_MARK_RIGHT 0x8168 // '”'
#define MESSAGE_WIDE_CHAR_PARENTHESES_LEFT 0x8169 // ''
#define MESSAGE_WIDE_CHAR_PARENTHESES_RIGHT 0x816A // ''
#define MESSAGE_WIDE_CHAR_KAGIKAKKO_LEFT 0x8175 // '「'
#define MESSAGE_WIDE_CHAR_KAGIKAKKO_RIGHT 0x8176 // '」'
#define MESSAGE_WIDE_CHAR_NUMBER_SIGN 0x8194 // ''
#define MESSAGE_WIDE_CHAR_ASTERISK 0x8196 // ''
#define MESSAGE_WIDE_CHAR_ZERO 0x824F // ''
#define MESSAGE_WIDE_CHAR_ONE 0x8250 // ''
#define MESSAGE_WIDE_CHAR_HOURS 0x8E9E // '時'
#define MESSAGE_WIDE_CHAR_SECONDS 0x9562 // '秒'
#define MESSAGE_WIDE_CHAR_MINUTES 0x95AA // '分'
/*
* Colors
*/

9
include/region.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef REGION_H
#define REGION_H
#define REGION_NULL 0
#define REGION_JP 1
#define REGION_US 2
#define REGION_EU 3
#endif

View File

@@ -84,11 +84,6 @@
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define REGION_NULL 0
#define REGION_JP 1
#define REGION_US 2
#define REGION_EU 3
#define THREAD_PRI_IDLE_INIT 10
#define THREAD_PRI_MAIN_INIT 10
#define THREAD_PRI_DMAMGR_LOW 10 // Used when decompressing files
@@ -128,9 +123,6 @@
#define STACK_TOP(stack) \
((u8*)(stack) + sizeof(stack))
// NOTE: Once we start supporting other builds, this can be changed with an ifdef
#define REGION_NATIVE REGION_EU
typedef struct {
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ RomFile file;

View File

@@ -106,14 +106,41 @@ typedef enum {
// An option is to implement and use `ANIM_FLAG_OVERRIDE_MOVEMENT`.
#define ANIM_FLAG_UPDATE_Y (1 << 1)
// (player-only) Related to scaling an animation from/to child/adult
#define ANIM_FLAG_PLAYER_2 (1 << 2)
// When this flag is set, Player's root limb position adjustment as child is disabled.
// Many of Player's animations are originally created for Adult Link. When playing those
// animations as Child Link without any adjustment, he will appear to be floating in the air.
// To fix this, Child Link's root position is scaled down by default to fit his smaller size.
// However, if an animation is created specifically for Child Link, it is desirable to disable
// this scaling of the root position by using this flag.
// Note that this flag will be ignored if `ANIM_FLAG_UPDATE_XZ` or `ANIM_FLAG_UPDATE_Y` are also
// set. The adjustment will be applied in this case regardless of this flag being enabled.
#define ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT (1 << 2)
// (player-only) Call AnimTaskQueue_AddActorMove
#define ANIM_FLAG_PLAYER_SETMOVE (1 << 3)
// When this flag is set, movement in all axes will not be applied for one frame. The flag
// is unset automatically after one use, so movement can resume. The intent is for this flag to be used
// when changing between two different animations.
// In some contexts, disabling the first frame of movement is necessary for a seamless transition.
//
#define ANIM_FLAG_NO_MOVE (1 << 4)
// Depending on specific implementations, an actor may choose to reset `prevTransl` to `baseTransl` when
// starting a new animation. This is helpful when an animation's translation data starts at the "origin"
// (in this case, the origin refers to `baseTransl`, in model space).
// Some animations have translation data that does not begin at the "origin". This is common when a
// longer sequence of animation is broken up into different parts as seperate animations.
// In this case, when one animation starts its translation at the same position where a different animation
// left off, resetting `prevTransl` is not desirable. This will cause the actor's position to noticeably change
// when the translation data from the first frame of the new animation is applied.
//
// When this flag is used during a transition between two animations, the first frame of movement is not applied.
// This allows the actor's world postiion to stay at the same location as where the previous animation ended.
// Because translations are calculated as a difference from the current and previous frame, all subsequent
// frames have their translation occur relative to this new starting point.
//
// Note that for Player, this flag is only relevant when transitioning from an animation that was also using
// animation translation. This is because of how `prevTransl` gets reset in `Player_AnimReplaceApplyFlags`.
#define ANIM_FLAG_ADJUST_STARTING_POS (1 << 4)
// Disables "normal" movement from sources like speed/velocity and collisions, which allows the
// animation to have full control over the actor's movement.

Some files were not shown because too many files have changed in this diff Show More