1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-15 12:24:39 +00:00

Merge branch 'main' into doc_pause_menu (but has bss issues for some versions)

This commit is contained in:
Dragorn421 2024-08-21 13:54:12 +02:00
commit d1c0e51871
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335
678 changed files with 6590 additions and 3454 deletions

89
Jenkinsfile vendored
View file

@ -24,52 +24,71 @@ pipeline {
sh 'python3 tools/check_format.py --verbose --compare-to origin/main' sh 'python3 tools/check_format.py --verbose --compare-to origin/main'
} }
} }
stage('Setup gc-eu-mq-dbg') { // The ROMs are built in an order that maximizes compiler flags coverage in a "fail fast" approach.
// Specifically we start with a retail ROM for BSS ordering, and make sure we cover all of
// NTSC/PAL/MQ/DEBUG as quickly as possible.
stage('Build gc-jp') {
steps { steps {
sh 'cp /usr/local/etc/roms/oot-gc-eu-mq-dbg.z64 baseroms/gc-eu-mq-dbg/baserom.z64' sh 'ln -s /usr/local/etc/roms/oot-gc-jp.z64 baseroms/gc-jp/baserom.z64'
sh 'make -j setup' sh 'make -j setup VERSION=gc-jp'
} sh 'make -j RUN_CC_CHECK=0 VERSION=gc-jp'
} sh 'make clean assetclean VERSION=gc-jp'
stage('Build gc-eu-mq-dbg') {
steps {
sh 'make -j RUN_CC_CHECK=0'
}
}
stage('Setup gc-eu-mq') {
steps {
sh 'cp /usr/local/etc/roms/oot-gc-eu-mq.z64 baseroms/gc-eu-mq/baserom.z64'
sh 'make -j setup VERSION=gc-eu-mq'
} }
} }
stage('Build gc-eu-mq') { stage('Build gc-eu-mq') {
steps { steps {
sh 'make -j VERSION=gc-eu-mq RUN_CC_CHECK=0' sh 'ln -s /usr/local/etc/roms/oot-gc-eu-mq.z64 baseroms/gc-eu-mq/baserom.z64'
sh 'make -j setup VERSION=gc-eu-mq'
sh 'make -j RUN_CC_CHECK=0 VERSION=gc-eu-mq'
sh 'make clean assetclean VERSION=gc-eu-mq'
} }
} }
stage('Report Progress') { stage('Build gc-eu-mq-dbg') {
when {
branch 'main'
}
steps { steps {
sh 'mkdir reports' sh 'ln -s /usr/local/etc/roms/oot-gc-eu-mq-dbg.z64 baseroms/gc-eu-mq-dbg/baserom.z64'
sh 'python3 progress.py csv >> reports/progress-oot-nonmatching.csv' sh 'make -j setup VERSION=gc-eu-mq-dbg'
sh 'python3 progress.py csv -m >> reports/progress-oot-matching.csv' sh 'make -j RUN_CC_CHECK=0 VERSION=gc-eu-mq-dbg'
sh 'python3 progress.py shield-json > reports/progress-oot-shield.json' sh 'make clean assetclean VERSION=gc-eu-mq-dbg'
stash includes: 'reports/*', name: 'reports'
} }
} }
stage('Update Progress') { stage('Build gc-us') {
when {
branch 'main'
}
agent {
label 'zeldaret_website'
}
steps { steps {
unstash 'reports' sh 'ln -s /usr/local/etc/roms/oot-gc-us.z64 baseroms/gc-us/baserom.z64'
sh 'cat reports/progress-oot-nonmatching.csv >> /var/www/zelda64.dev/assets/csv/progress-oot-nonmatching.csv' sh 'make -j setup VERSION=gc-us'
sh 'cat reports/progress-oot-matching.csv >> /var/www/zelda64.dev/assets/csv/progress-oot-matching.csv' sh 'make -j RUN_CC_CHECK=0 VERSION=gc-us'
sh 'cat reports/progress-oot-shield.json > /var/www/zelda64.dev/assets/csv/progress-oot-shield.json' sh 'make clean assetclean VERSION=gc-us'
}
}
stage('Build gc-jp-ce') {
steps {
sh 'ln -s /usr/local/etc/roms/oot-gc-jp-ce.z64 baseroms/gc-jp-ce/baserom.z64'
sh 'make -j setup VERSION=gc-jp-ce'
sh 'make -j RUN_CC_CHECK=0 VERSION=gc-jp-ce'
sh 'make clean assetclean VERSION=gc-jp-ce'
}
}
stage('Build gc-eu') {
steps {
sh 'ln -s /usr/local/etc/roms/oot-gc-eu.z64 baseroms/gc-eu/baserom.z64'
sh 'make -j setup VERSION=gc-eu'
sh 'make -j RUN_CC_CHECK=0 VERSION=gc-eu'
sh 'make clean assetclean VERSION=gc-eu'
}
}
stage('Build gc-jp-mq') {
steps {
sh 'ln -s /usr/local/etc/roms/oot-gc-jp-mq.z64 baseroms/gc-jp-mq/baserom.z64'
sh 'make -j setup VERSION=gc-jp-mq'
sh 'make -j RUN_CC_CHECK=0 VERSION=gc-jp-mq'
sh 'make clean assetclean VERSION=gc-jp-mq'
}
}
stage('Build gc-us-mq') {
steps {
sh 'ln -s /usr/local/etc/roms/oot-gc-us-mq.z64 baseroms/gc-us-mq/baserom.z64'
sh 'make -j setup VERSION=gc-us-mq'
sh 'make -j RUN_CC_CHECK=0 VERSION=gc-us-mq'
sh 'make clean assetclean VERSION=gc-us-mq'
} }
} }
} }

127
Makefile
View file

@ -27,7 +27,7 @@ COMPILER ?= ido
# gc-eu-mq GameCube Europe/PAL Master Quest # gc-eu-mq GameCube Europe/PAL Master Quest
# gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug (default) # gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug (default)
# The following versions are work-in-progress and not yet matching: # The following versions are work-in-progress and not yet matching:
# ntsc-1.2 N64 NTSC 1.2 (Japan) # ntsc-1.2 N64 NTSC 1.2 (Japan/US depending on REGION)
VERSION ?= gc-eu-mq-dbg VERSION ?= gc-eu-mq-dbg
# Number of threads to extract and compress with # Number of threads to extract and compress with
N_THREADS ?= $(shell nproc) N_THREADS ?= $(shell nproc)
@ -45,8 +45,10 @@ CFLAGS ?=
CPPFLAGS ?= CPPFLAGS ?=
CPP_DEFINES ?= CPP_DEFINES ?=
REGIONAL_CHECKSUM := 0
# Version-specific settings # Version-specific settings
ifeq ($(VERSION),ntsc-1.2) ifeq ($(VERSION),ntsc-1.2)
REGIONAL_CHECKSUM := 1
REGION ?= JP REGION ?= JP
PLATFORM := N64 PLATFORM := N64
PAL := 0 PAL := 0
@ -227,13 +229,17 @@ ZAPD := tools/ZAPD/ZAPD.out
FADO := tools/fado/fado.elf FADO := tools/fado/fado.elf
PYTHON ?= $(VENV)/bin/python3 PYTHON ?= $(VENV)/bin/python3
# Command to replace path variables in the spec file. We can't use the C # Command to replace $(BUILD_DIR) in some files with the build path.
# preprocessor for this because it won't substitute inside string literals. # We can't use the C preprocessor for this because it won't substitute inside string literals.
SPEC_REPLACE_VARS := sed -e 's|$$(BUILD_DIR)|$(BUILD_DIR)|g' BUILD_DIR_REPLACE := sed -e 's|$$(BUILD_DIR)|$(BUILD_DIR)|g'
# Audio tools # Audio tools
AUDIO_EXTRACT := $(PYTHON) tools/audio_extraction.py AUDIO_EXTRACT := $(PYTHON) tools/audio_extraction.py
SAMPLECONV := tools/audio/sampleconv/sampleconv SAMPLECONV := tools/audio/sampleconv/sampleconv
SBC := tools/audio/sbc
ATBLGEN := tools/audio/atblgen
SBCFLAGS := --matching
CFLAGS += $(CPP_DEFINES) CFLAGS += $(CPP_DEFINES)
CPPFLAGS += $(CPP_DEFINES) CPPFLAGS += $(CPP_DEFINES)
@ -301,8 +307,10 @@ endif
ifneq ($(wildcard $(EXTRACTED_DIR)/assets/audio),) ifneq ($(wildcard $(EXTRACTED_DIR)/assets/audio),)
SAMPLE_EXTRACT_DIRS := $(shell find $(EXTRACTED_DIR)/assets/audio/samples -type d) SAMPLE_EXTRACT_DIRS := $(shell find $(EXTRACTED_DIR)/assets/audio/samples -type d)
SAMPLEBANK_EXTRACT_DIRS := $(shell find $(EXTRACTED_DIR)/assets/audio/samplebanks -type d)
else else
SAMPLE_EXTRACT_DIRS := SAMPLE_EXTRACT_DIRS :=
SAMPLEBANK_EXTRACT_DIRS :=
endif endif
ifneq ($(wildcard assets/audio/samples),) ifneq ($(wildcard assets/audio/samples),)
@ -311,10 +319,22 @@ else
SAMPLE_DIRS := SAMPLE_DIRS :=
endif endif
ifneq ($(wildcard assets/audio/samplebanks),)
SAMPLEBANK_DIRS := $(shell find assets/audio/samplebanks -type d)
else
SAMPLEBANK_DIRS :=
endif
SAMPLE_FILES := $(foreach dir,$(SAMPLE_DIRS),$(wildcard $(dir)/*.wav)) SAMPLE_FILES := $(foreach dir,$(SAMPLE_DIRS),$(wildcard $(dir)/*.wav))
SAMPLE_EXTRACT_FILES := $(foreach dir,$(SAMPLE_EXTRACT_DIRS),$(wildcard $(dir)/*.wav)) SAMPLE_EXTRACT_FILES := $(foreach dir,$(SAMPLE_EXTRACT_DIRS),$(wildcard $(dir)/*.wav))
AIFC_FILES := $(foreach f,$(SAMPLE_FILES),$(BUILD_DIR)/$(f:.wav=.aifc)) $(foreach f,$(SAMPLE_EXTRACT_FILES:.wav=.aifc),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) AIFC_FILES := $(foreach f,$(SAMPLE_FILES),$(BUILD_DIR)/$(f:.wav=.aifc)) $(foreach f,$(SAMPLE_EXTRACT_FILES:.wav=.aifc),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%))
SAMPLEBANK_XMLS := $(foreach dir,$(SAMPLEBANK_DIRS),$(wildcard $(dir)/*.xml))
SAMPLEBANK_EXTRACT_XMLS := $(foreach dir,$(SAMPLEBANK_EXTRACT_DIRS),$(wildcard $(dir)/*.xml))
SAMPLEBANK_BUILD_XMLS := $(foreach f,$(SAMPLEBANK_XMLS),$(BUILD_DIR)/$f) $(foreach f,$(SAMPLEBANK_EXTRACT_XMLS),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%))
SAMPLEBANK_O_FILES := $(foreach f,$(SAMPLEBANK_BUILD_XMLS),$(f:.xml=.o))
SAMPLEBANK_DEP_FILES := $(foreach f,$(SAMPLEBANK_O_FILES),$(f:.o=.d))
# create extracted directories # create extracted directories
$(shell mkdir -p $(EXTRACTED_DIR) $(EXTRACTED_DIR)/assets $(EXTRACTED_DIR)/text) $(shell mkdir -p $(EXTRACTED_DIR) $(EXTRACTED_DIR)/assets $(EXTRACTED_DIR)/text)
@ -341,9 +361,10 @@ O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(SRC_C_FILES:.c=.o),$(BUILD_DIR)/$f) \ $(foreach f,$(SRC_C_FILES:.c=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(ASSET_C_FILES_EXTRACTED:.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,$(ASSET_C_FILES_COMMITTED:.c=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(BASEROM_BIN_FILES),$(BUILD_DIR)/baserom/$(notdir $f).o) $(foreach f,$(BASEROM_BIN_FILES),$(BUILD_DIR)/baserom/$(notdir $f).o) \
$(BUILD_DIR)/src/code/z_message_z_game_over.o
OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(SPEC_REPLACE_VARS) | grep -o '[^"]*_reloc.o' ) OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(BUILD_DIR_REPLACE) | grep -o '[^"]*_reloc.o' )
# Automatic dependency files # Automatic dependency files
# (Only asm_processor dependencies and reloc dependencies are handled for now) # (Only asm_processor dependencies and reloc dependencies are handled for now)
@ -361,17 +382,24 @@ TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG_EXTRACTED:.png=.inc.c),$(f:
# create build directories # create build directories
$(shell mkdir -p $(BUILD_DIR)/baserom \ $(shell mkdir -p $(BUILD_DIR)/baserom \
$(BUILD_DIR)/assets/text \ $(BUILD_DIR)/assets/text)
$(foreach dir, \ $(shell mkdir -p $(foreach dir, \
$(SRC_DIRS) \ $(SRC_DIRS) \
$(UNDECOMPILED_DATA_DIRS) \ $(UNDECOMPILED_DATA_DIRS) \
$(SAMPLE_DIRS) \
$(SAMPLEBANK_DIRS) \
$(ASSET_BIN_DIRS_COMMITTED), \ $(ASSET_BIN_DIRS_COMMITTED), \
$(BUILD_DIR)/$(dir)) \ $(BUILD_DIR)/$(dir)))
$(foreach dir, \ ifneq ($(wildcard $(EXTRACTED_DIR)/assets),)
$(shell mkdir -p $(foreach dir, \
$(SAMPLE_EXTRACT_DIRS) \
$(SAMPLEBANK_EXTRACT_DIRS) \
$(ASSET_BIN_DIRS_EXTRACTED), \ $(ASSET_BIN_DIRS_EXTRACTED), \
$(dir:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%))) $(dir:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)))
endif
ifeq ($(COMPILER),ido) ifeq ($(COMPILER),ido)
$(BUILD_DIR)/src/boot/logutils.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/boot/stackcheck.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/boot/stackcheck.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/__osMalloc.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/__osMalloc.o: OPTFLAGS := -O2
@ -383,7 +411,6 @@ $(BUILD_DIR)/src/code/jpegutils.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/jpegdecoder.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/jpegdecoder.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/load.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/load.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/loadfragment2.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/loadfragment2.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/logutils.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/mtxuty-cvt.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/mtxuty-cvt.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/padsetup.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/padsetup.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/padutils.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/code/padutils.o: OPTFLAGS := -O2
@ -399,13 +426,9 @@ $(BUILD_DIR)/src/code/fault_drawer.o: OPTFLAGS := -O2 -g3
$(BUILD_DIR)/src/code/ucode_disas.o: OPTFLAGS := -O2 -g3 $(BUILD_DIR)/src/code/ucode_disas.o: OPTFLAGS := -O2 -g3
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
$(BUILD_DIR)/src/code/fmodf.o: OPTFLAGS := -g $(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -g
$(BUILD_DIR)/src/code/__osMemset.o: OPTFLAGS := -g
$(BUILD_DIR)/src/code/__osMemmove.o: OPTFLAGS := -g
else else
$(BUILD_DIR)/src/code/fmodf.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/__osMemset.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/code/__osMemmove.o: OPTFLAGS := -O2
endif endif
$(BUILD_DIR)/src/audio/%.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/audio/%.o: OPTFLAGS := -O2
@ -417,14 +440,6 @@ $(BUILD_DIR)/src/audio/general.o: CFLAGS += -signed
$(BUILD_DIR)/src/audio/sfx.o: CFLAGS += -use_readwrite_const $(BUILD_DIR)/src/audio/sfx.o: CFLAGS += -use_readwrite_const
$(BUILD_DIR)/src/audio/sequence.o: CFLAGS += -use_readwrite_const $(BUILD_DIR)/src/audio/sequence.o: CFLAGS += -use_readwrite_const
ifeq ($(DEBUG),1)
$(BUILD_DIR)/src/libultra/libc/absf.o: OPTFLAGS := -O2 -g3
$(BUILD_DIR)/src/libultra/libc/sqrt.o: OPTFLAGS := -O2 -g3
else
$(BUILD_DIR)/src/libultra/libc/absf.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/libultra/libc/sqrt.o: OPTFLAGS := -O2
endif
$(BUILD_DIR)/src/libultra/libc/ll.o: OPTFLAGS := -O1 $(BUILD_DIR)/src/libultra/libc/ll.o: OPTFLAGS := -O1
$(BUILD_DIR)/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32 $(BUILD_DIR)/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32
$(BUILD_DIR)/src/libultra/libc/llcvt.o: OPTFLAGS := -O1 $(BUILD_DIR)/src/libultra/libc/llcvt.o: OPTFLAGS := -O1
@ -452,7 +467,7 @@ $(BUILD_DIR)/src/code/jpegdecoder.o: CC := $(CC_OLD)
ifeq ($(PERMUTER),) # permuter + preprocess.py misbehaves, permuter doesn't care about rodata diffs or bss ordering so just don't use it in that case ifeq ($(PERMUTER),) # permuter + preprocess.py misbehaves, permuter doesn't care about rodata diffs or bss ordering so just don't use it in that case
# Handle encoding (UTF-8 -> EUC-JP) and custom pragmas # Handle encoding (UTF-8 -> EUC-JP) and custom pragmas
$(BUILD_DIR)/src/%.o: CC := $(PYTHON) tools/preprocess.py -v $(VERSION) -- $(CC) $(BUILD_DIR)/src/%.o: CC := ./tools/preprocess.sh -v $(VERSION) -- $(CC)
endif endif
else else
@ -470,13 +485,21 @@ all: rom compress
rom: $(ROM) rom: $(ROM)
ifneq ($(COMPARE),0) ifneq ($(COMPARE),0)
@md5sum $(ROM) @md5sum $(ROM)
ifneq ($(REGIONAL_CHECKSUM),0)
@md5sum -c $(BASEROM_DIR)/checksum-$(REGION).md5
else
@md5sum -c $(BASEROM_DIR)/checksum.md5 @md5sum -c $(BASEROM_DIR)/checksum.md5
endif
endif endif
compress: $(ROMC) compress: $(ROMC)
ifneq ($(COMPARE),0) ifneq ($(COMPARE),0)
@md5sum $(ROMC) @md5sum $(ROMC)
ifneq ($(REGIONAL_CHECKSUM),0)
@md5sum -c $(BASEROM_DIR)/checksum-$(REGION)-compressed.md5
else
@md5sum -c $(BASEROM_DIR)/checksum-compressed.md5 @md5sum -c $(BASEROM_DIR)/checksum-compressed.md5
endif
endif endif
clean: clean:
@ -533,7 +556,8 @@ $(ROMC): $(ROM) $(ELF) $(BUILD_DIR)/compress_ranges.txt
$(PYTHON) tools/compress.py --in $(ROM) --out $@ --dmadata-start `./tools/dmadata_start.sh $(NM) $(ELF)` --compress `cat $(BUILD_DIR)/compress_ranges.txt` --threads $(N_THREADS) $(PYTHON) tools/compress.py --in $(ROM) --out $@ --dmadata-start `./tools/dmadata_start.sh $(NM) $(ELF)` --compress `cat $(BUILD_DIR)/compress_ranges.txt` --threads $(N_THREADS)
$(PYTHON) -m ipl3checksum sum --cic 6105 --update $@ $(PYTHON) -m ipl3checksum sum --cic 6105 --update $@
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(LDSCRIPT) $(BUILD_DIR)/undefined_syms.txt $(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(LDSCRIPT) $(BUILD_DIR)/undefined_syms.txt \
$(SAMPLEBANK_O_FILES)
$(LD) -T $(LDSCRIPT) -T $(BUILD_DIR)/undefined_syms.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(MAP) -o $@ $(LD) -T $(LDSCRIPT) -T $(BUILD_DIR)/undefined_syms.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(MAP) -o $@
## Order-only prerequisites ## Order-only prerequisites
@ -549,7 +573,7 @@ $(O_FILES): | asset_files
.PHONY: o_files asset_files .PHONY: o_files asset_files
$(BUILD_DIR)/$(SPEC): $(SPEC) $(BUILD_DIR)/$(SPEC): $(SPEC)
$(CPP) $(CPPFLAGS) $< | $(SPEC_REPLACE_VARS) > $@ $(CPP) $(CPPFLAGS) $< | $(BUILD_DIR_REPLACE) > $@
$(LDSCRIPT): $(BUILD_DIR)/$(SPEC) $(LDSCRIPT): $(BUILD_DIR)/$(SPEC)
$(MKLDSCRIPT) $< $@ $(MKLDSCRIPT) $< $@
@ -586,7 +610,7 @@ ifneq ($(COMPILER),gcc)
else else
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
endif endif
$(OBJCOPY) -O binary -j.rodata $@ $@.bin $(OBJCOPY) -O binary --only-section .rodata $@ $@.bin
$(BUILD_DIR)/assets/%.o: assets/%.c $(BUILD_DIR)/assets/%.o: assets/%.c
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
@ -599,6 +623,10 @@ $(BUILD_DIR)/assets/%.o: $(EXTRACTED_DIR)/assets/%.c
$(BUILD_DIR)/src/%.o: src/%.s $(BUILD_DIR)/src/%.o: src/%.s
$(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@ $(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@
# Incremental link to move z_message and z_game_over data into rodata
$(BUILD_DIR)/src/code/z_message_z_game_over.o: $(BUILD_DIR)/src/code/z_message.o $(BUILD_DIR)/src/code/z_game_over.o
$(LD) -r -T linker_scripts/data_with_rodata.ld -o $@ $^
$(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt: $(BUILD_DIR)/$(SPEC) $(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt: $(BUILD_DIR)/$(SPEC)
$(MKDMADATA) $< $(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt $(MKDMADATA) $< $(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt
@ -667,6 +695,9 @@ AUDIO_BUILD_DEBUG ?= 0
# first build samples... # first build samples...
.PRECIOUS: $(BUILD_DIR)/assets/audio/samples/%.aifc
.PRECIOUS: $(BUILD_DIR)/assets/audio/samples/%.half.aifc
$(BUILD_DIR)/assets/audio/samples/%.half.aifc: assets/audio/samples/%.half.wav $(BUILD_DIR)/assets/audio/samples/%.half.aifc: assets/audio/samples/%.half.wav
$(SAMPLECONV) vadpcm-half $< $@ $(SAMPLECONV) vadpcm-half $< $@
@ -685,6 +716,44 @@ ifeq ($(AUDIO_BUILD_DEBUG),1)
@(cmp $(<D)/aifc/$(<F:.wav=.aifc) $@ && echo "$(<F) OK") || (mkdir -p NONMATCHINGS/$(<D) && cp $(<D)/aifc/$(<F:.wav=.aifc) NONMATCHINGS/$(<D)/$(<F:.wav=.aifc)) @(cmp $(<D)/aifc/$(<F:.wav=.aifc) $@ && echo "$(<F) OK") || (mkdir -p NONMATCHINGS/$(<D) && cp $(<D)/aifc/$(<F:.wav=.aifc) NONMATCHINGS/$(<D)/$(<F:.wav=.aifc))
endif endif
# then assemble the samplebanks...
.PRECIOUS: $(BUILD_DIR)/assets/audio/samplebanks/%.xml
$(BUILD_DIR)/assets/audio/samplebanks/%.xml: assets/audio/samplebanks/%.xml
cat $< | $(BUILD_DIR_REPLACE) > $@
$(BUILD_DIR)/assets/audio/samplebanks/%.xml: $(EXTRACTED_DIR)/assets/audio/samplebanks/%.xml
cat $< | $(BUILD_DIR_REPLACE) > $@
.PRECIOUS: $(BUILD_DIR)/assets/audio/samplebanks/%.s
$(BUILD_DIR)/assets/audio/samplebanks/%.s: $(BUILD_DIR)/assets/audio/samplebanks/%.xml | $(AIFC_FILES)
$(SBC) $(SBCFLAGS) --makedepend $(@:.s=.d) $< $@
-include $(SAMPLEBANK_DEP_FILES)
$(BUILD_DIR)/assets/audio/samplebanks/%.o: $(BUILD_DIR)/assets/audio/samplebanks/%.s
$(AS) $(ASFLAGS) $< -o $@
ifeq ($(AUDIO_BUILD_DEBUG),1)
$(OBJCOPY) -O binary --only-section .rodata $@ $(@:.o=.bin)
@cmp $(@:.o=.bin) $(patsubst $(BUILD_DIR)/assets/audio/samplebanks/%,$(EXTRACTED_DIR)/baserom_audiotest/audiotable_files/%,$(@:.o=.bin)) && echo "$(<F) OK"
endif
# put together the tables
$(BUILD_DIR)/assets/audio/samplebank_table.h: $(SAMPLEBANK_BUILD_XMLS)
$(ATBLGEN) --banks $@ $^
# build the tables into objects, move data -> rodata
$(BUILD_DIR)/src/audio/tables/samplebank_table.o: src/audio/tables/samplebank_table.c $(BUILD_DIR)/assets/audio/samplebank_table.h
ifneq ($(RUN_CC_CHECK),0)
$(CC_CHECK) $<
endif
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $(@:.o=.tmp) $<
$(LD) -r -T linker_scripts/data_with_rodata.ld $(@:.o=.tmp) -o $@
@$(RM) $(@:.o=.tmp)
-include $(DEP_FILES) -include $(DEP_FILES)
# Print target for debugging # Print target for debugging

View file

@ -5,13 +5,13 @@
[jenkins]: https://jenkins.deco.mp/job/OOT/job/main [jenkins]: https://jenkins.deco.mp/job/OOT/job/main
[jenkins-badge]: https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins.deco.mp%2Fjob%2FOOT%2Fjob%2Fmain [jenkins-badge]: https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins.deco.mp%2Fjob%2FOOT%2Fjob%2Fmain
[progress]: https://zelda64.dev/games/oot [progress]: https://zelda.deco.mp/games/oot
[progress-badge]: https://img.shields.io/endpoint?url=https://zelda64.dev/assets/csv/progress-oot-shield.json [progress-badge]: https://img.shields.io/endpoint?url=https://zelda.deco.mp/assets/csv/progress-oot-shield.json
[contributors]: https://github.com/zeldaret/oot/graphs/contributors [contributors]: https://github.com/zeldaret/oot/graphs/contributors
[contributors-badge]: https://img.shields.io/github/contributors/zeldaret/oot [contributors-badge]: https://img.shields.io/github/contributors/zeldaret/oot
[discord]: https://discord.zelda64.dev [discord]: https://discord.zelda.deco.mp
[discord-badge]: https://img.shields.io/discord/688807550715560050?color=%237289DA&logo=discord&logoColor=%23FFFFFF [discord-badge]: https://img.shields.io/discord/688807550715560050?color=%237289DA&logo=discord&logoColor=%23FFFFFF
```diff ```diff
@ -23,7 +23,7 @@ the codebase can drastically change at any time. Also note that some parts of th
'shiftable' yet, so modifying them could be difficult at this point. 'shiftable' yet, so modifying them could be difficult at this point.
``` ```
This is a WIP **decompilation** of ***The Legend of Zelda: Ocarina of Time***. The purpose of the project is to recreate a source code base for the game from scratch, using information found inside the game along with static and/or dynamic analysis. **It is not producing a PC port.** For more information you can get in touch with the team on our [Discord server](https://discord.zelda64.dev). This is a WIP **decompilation** of ***The Legend of Zelda: Ocarina of Time***. The purpose of the project is to recreate a source code base for the game from scratch, using information found inside the game along with static and/or dynamic analysis. **It is not producing a PC port.** For more information you can get in touch with the team on our [Discord server][discord].
The only build currently supported is Master Quest (Debug), but other versions are planned to be supported. The only build currently supported is Master Quest (Debug), but other versions are planned to be supported.
@ -33,9 +33,9 @@ It builds the following ROM:
**Note: This repository does not include any of the assets necessary to build the ROM. A prior copy of the game is required to extract the needed assets.** **Note: This repository does not include any of the assets necessary to build the ROM. A prior copy of the game is required to extract the needed assets.**
**Website:** <https://zelda64.dev> **Website:** <https://zelda.deco.mp>
**Discord:** <https://discord.zelda64.dev> **Discord:** <https://discord.zelda.deco.mp>
## Installation ## Installation
@ -71,12 +71,13 @@ The build process has the following package requirements:
* python3-pip * python3-pip
* python3-venv * python3-venv
* libpng-dev * libpng-dev
* libxml2-dev
Under Debian / Ubuntu (which we recommend using), you can install them with the following commands: Under Debian / Ubuntu (which we recommend using), you can install them with the following commands:
```bash ```bash
sudo apt-get update sudo apt-get update
sudo apt-get install git build-essential binutils-mips-linux-gnu python3 python3-pip python3-venv libpng-dev sudo apt-get install git build-essential binutils-mips-linux-gnu python3 python3-pip python3-venv libpng-dev libxml2-dev
``` ```
If you are using GCC as the compiler for Ocarina of Time, you will also need: If you are using GCC as the compiler for Ocarina of Time, you will also need:
@ -155,4 +156,4 @@ Both of these have the disadvantage that the ordering of the terminal output is
All contributions are welcome. This is a group effort, and even small contributions can make a difference. All contributions are welcome. This is a group effort, and even small contributions can make a difference.
Some tasks also don't require much knowledge to get started. Some tasks also don't require much knowledge to get started.
Most discussions happen on our [Discord Server](https://discord.zelda64.dev), where you are welcome to ask if you need help getting started, or if you have any questions regarding this project and other decompilation projects. Most discussions happen on our [Discord Server][discord], where you are welcome to ask if you need help getting started, or if you have any questions regarding this project and other decompilation projects.

View file

@ -41,10 +41,6 @@ incbins:
segment: code segment: code
vram: 0x80155500 vram: 0x80155500
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80155BF0
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80155C70 vram: 0x80155C70

View file

@ -33,10 +33,6 @@ incbins:
segment: code segment: code
vram: 0x801108A0 vram: 0x801108A0
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80110F90
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80111010 vram: 0x80111010

View file

@ -33,10 +33,6 @@ incbins:
segment: code segment: code
vram: 0x801108C0 vram: 0x801108C0
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80110FB0
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80111030 vram: 0x80111030

View file

@ -33,10 +33,6 @@ incbins:
segment: code segment: code
vram: 0x801130B0 vram: 0x801130B0
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x801137A0
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80113820 vram: 0x80113820

View file

@ -33,10 +33,6 @@ incbins:
segment: code segment: code
vram: 0x801130B0 vram: 0x801130B0
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x801137A0
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80113820 vram: 0x80113820

View file

@ -33,10 +33,6 @@ incbins:
segment: code segment: code
vram: 0x801130D0 vram: 0x801130D0
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x801137C0
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80113840 vram: 0x80113840

View file

@ -33,10 +33,6 @@ incbins:
segment: code segment: code
vram: 0x80113090 vram: 0x80113090
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80113780
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80113800 vram: 0x80113800

View file

@ -33,10 +33,6 @@ incbins:
segment: code segment: code
vram: 0x801130B0 vram: 0x801130B0
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x801137A0
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80113820 vram: 0x80113820

View file

@ -0,0 +1 @@
57a9719ad547c516342e1a15d5c28c3d build/ntsc-1.2/oot-ntsc-1.2-compressed.z64

View file

@ -0,0 +1 @@
12fcafeba93992facaf65c2ba00f3089 build/ntsc-1.2/oot-ntsc-1.2.z64

View file

@ -1,3 +1,6 @@
checksums:
- checksum-JP
- checksum-US
dmadata_start: 0x7960 dmadata_start: 0x7960
text_lang_pal: false text_lang_pal: false
incbins: incbins:
@ -33,10 +36,6 @@ incbins:
segment: code segment: code
vram: 0x80114220 vram: 0x80114220
size: 0x6F0 size: 0x6F0
- name: gSampleBankTable
segment: code
vram: 0x80114910
size: 0x80
- name: aspMainData - name: aspMainData
segment: code segment: code
vram: 0x80114990 vram: 0x80114990

View file

@ -17,6 +17,3 @@ glabel gSequenceFontTable
glabel gSequenceTable glabel gSequenceTable
.incbin "incbin/gSequenceTable" .incbin "incbin/gSequenceTable"
glabel gSampleBankTable
.incbin "incbin/gSampleBankTable"

View file

@ -13,12 +13,13 @@ For macOS, use Homebrew to install the following dependencies:
* libpng * libpng
* bash * bash
* clang-format * clang-format
* libxml2
You can install them with the following commands: You can install them with the following commands:
```bash ```bash
brew update brew update
brew install coreutils make python3 libpng bash clang-format brew install coreutils make python3 libpng bash clang-format libxml2
``` ```
(The repository expects Homebrew-installed programs to be either linked correctly in `$PATH` etc. or in their default locations.) (The repository expects Homebrew-installed programs to be either linked correctly in `$PATH` etc. or in their default locations.)

View file

@ -1,5 +1,90 @@
{ {
"configurations": [ "configurations": [
{
"name": "oot-ntsc-1.2",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/ntsc-1.2",
".",
"extracted/ntsc-1.2"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=OOT_NTSC_1_2",
"OOT_REGION=REGION_JP",
"PLATFORM_N64=1",
"PLATFORM_GC=0",
"OOT_NTSC=1",
"OOT_MQ=0",
"OOT_DEBUG=0",
"NDEBUG",
"F3DEX_GBI_2"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-jp",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-jp",
".",
"extracted/gc-jp"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=OOT_GC_JP",
"OOT_REGION=REGION_JP",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_NTSC=1",
"OOT_MQ=0",
"OOT_DEBUG=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-jp-mq",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-jp-mq",
".",
"extracted/gc-jp-mq"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=OOT_GC_JP_MQ",
"OOT_REGION=REGION_JP",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_NTSC=1",
"OOT_MQ=1",
"OOT_DEBUG=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{ {
"name": "oot-gc-us", "name": "oot-gc-us",
"compilerArgs": [ "compilerArgs": [
@ -17,6 +102,8 @@
"_LANGUAGE_C", "_LANGUAGE_C",
"OOT_VERSION=OOT_GC_US", "OOT_VERSION=OOT_GC_US",
"OOT_REGION=REGION_US", "OOT_REGION=REGION_US",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_NTSC=1", "OOT_NTSC=1",
"OOT_MQ=0", "OOT_MQ=0",
"OOT_DEBUG=0", "OOT_DEBUG=0",
@ -27,6 +114,64 @@
], ],
"cStandard": "gnu89" "cStandard": "gnu89"
}, },
{
"name": "oot-gc-us-mq",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-us-mq",
".",
"extracted/gc-us-mq"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=OOT_GC_US_MQ",
"OOT_REGION=REGION_US",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_NTSC=1",
"OOT_MQ=1",
"OOT_DEBUG=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-eu-mq-dbg",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-eu-mq-dbg",
".",
"extracted/gc-eu-mq-dbg"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=OOT_GC_EU_MQ_DBG",
"OOT_REGION=REGION_EU",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_PAL=1",
"OOT_MQ=1",
"OOT_DEBUG=1",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE",
"GBI_DEBUG"
],
"cStandard": "gnu89"
},
{ {
"name": "oot-gc-eu", "name": "oot-gc-eu",
"compilerArgs": [ "compilerArgs": [
@ -44,6 +189,8 @@
"_LANGUAGE_C", "_LANGUAGE_C",
"OOT_VERSION=OOT_GC_EU", "OOT_VERSION=OOT_GC_EU",
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_EU",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_PAL=1", "OOT_PAL=1",
"OOT_MQ=0", "OOT_MQ=0",
"OOT_DEBUG=0", "OOT_DEBUG=0",
@ -71,6 +218,8 @@
"_LANGUAGE_C", "_LANGUAGE_C",
"OOT_VERSION=OOT_GC_EU_MQ", "OOT_VERSION=OOT_GC_EU_MQ",
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_EU",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_PAL=1", "OOT_PAL=1",
"OOT_MQ=1", "OOT_MQ=1",
"OOT_DEBUG=0", "OOT_DEBUG=0",
@ -82,7 +231,7 @@
"cStandard": "gnu89" "cStandard": "gnu89"
}, },
{ {
"name": "oot-gc-eu-mq-dbg", "name": "oot-gc-jp-ce",
"compilerArgs": [ "compilerArgs": [
"-m32" "-m32"
], ],
@ -90,24 +239,26 @@
"include", "include",
"include/libc", "include/libc",
"src", "src",
"build/gc-eu-mq-dbg", "build/gc-jp-ce",
".", ".",
"extracted/gc-eu-mq-dbg" "extracted/gc-jp-ce"
], ],
"defines": [ "defines": [
"_LANGUAGE_C", "_LANGUAGE_C",
"OOT_VERSION=OOT_GC_EU_MQ_DBG", "OOT_VERSION=OOT_GC_JP_CE",
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_JP",
"OOT_PAL=1", "PLATFORM_N64=0",
"OOT_MQ=1", "PLATFORM_GC=1",
"OOT_DEBUG=1", "OOT_NTSC=1",
"OOT_MQ=0",
"OOT_DEBUG=0",
"NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
"GBI_DOWHILE", "GBI_DOWHILE"
"GBI_DEBUG"
], ],
"cStandard": "gnu89" "cStandard": "gnu89"
} },
], ],
"version": 4 "version": 4
} }

View file

@ -46,11 +46,9 @@ A more complete `c_cpp_properties.json` with configurations for all supported ve
"configurations": [ "configurations": [
{ {
"name": "oot-gc-eu-mq-dbg", "name": "oot-gc-eu-mq-dbg",
"compilerPath": "${default}", // Needs to not be "" for -m32 to work
"compilerArgs": [ "compilerArgs": [
"-m32" // Removes integer truncation warnings with gbi macros "-m32" // Removes integer truncation warnings with gbi macros
], ],
"intelliSenseMode": "${default}", // Shouldn't matter
"includePath": [ // Matches makefile's includes "includePath": [ // Matches makefile's includes
"include", "include",
"include/libc", "include/libc",
@ -64,6 +62,8 @@ A more complete `c_cpp_properties.json` with configurations for all supported ve
// Version-specific // Version-specific
"OOT_VERSION=OOT_GC_EU_MQ_DBG", "OOT_VERSION=OOT_GC_EU_MQ_DBG",
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_EU",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_PAL=1", "OOT_PAL=1",
"OOT_MQ=1", "OOT_MQ=1",
"OOT_DEBUG=1", "OOT_DEBUG=1",
@ -73,7 +73,6 @@ A more complete `c_cpp_properties.json` with configurations for all supported ve
"GBI_DEBUG" "GBI_DEBUG"
], ],
"cStandard": "gnu89", // C89 + some GNU extensions from C99 like C++ comments "cStandard": "gnu89", // C89 + some GNU extensions from C99 like C++ comments
"cppStandard": "${default}" // Only ZAPD uses C++, so doesn't really matter
} }
], ],
"version": 4 "version": 4

View file

@ -8,5 +8,6 @@
#define UNUSED __attribute__((unused)) #define UNUSED __attribute__((unused))
#define FALLTHROUGH __attribute__((fallthrough)) #define FALLTHROUGH __attribute__((fallthrough))
#define NORETURN __attribute__((noreturn)) #define NORETURN __attribute__((noreturn))
#define NO_REORDER __attribute__((no_reorder))
#endif #endif

View file

@ -4,13 +4,13 @@
#include "sched.h" #include "sched.h"
#include "z64audio.h" #include "z64audio.h"
typedef enum { typedef enum AudioMgrDebugLevel {
/* 0 */ AUDIOMGR_DEBUG_LEVEL_NONE, /* 0 */ AUDIOMGR_DEBUG_LEVEL_NONE,
/* 1 */ AUDIOMGR_DEBUG_LEVEL_NO_RSP, /* 1 */ AUDIOMGR_DEBUG_LEVEL_NO_RSP,
/* 2 */ AUDIOMGR_DEBUG_LEVEL_NO_UPDATE /* 2 */ AUDIOMGR_DEBUG_LEVEL_NO_UPDATE
} AudioMgrDebugLevel; } AudioMgrDebugLevel;
typedef struct { typedef struct AudioMgr {
/* 0x0000 */ IrqMgr* irqMgr; /* 0x0000 */ IrqMgr* irqMgr;
/* 0x0004 */ Scheduler* sched; /* 0x0004 */ Scheduler* sched;
/* 0x0008 */ OSScTask audioTask; /* 0x0008 */ OSScTask audioTask;

View file

@ -6,7 +6,7 @@
* from the external graph thread to the internal audio thread * from the external graph thread to the internal audio thread
*/ */
typedef enum { typedef enum AudioThreadCmdOp {
// Channel Commands // Channel Commands
/* 0x00 */ AUDIOCMD_OP_NOOP, /* 0x00 */ AUDIOCMD_OP_NOOP,
/* 0x01 */ AUDIOCMD_OP_CHANNEL_SET_VOL_SCALE, /* 0x01 */ AUDIOCMD_OP_CHANNEL_SET_VOL_SCALE,

10
include/cic6105.h Normal file
View file

@ -0,0 +1,10 @@
#ifndef CIC6105_H
#define CIC6105_H
#include "ultra64.h"
extern u32 B_80008EE0;
void func_80001720(void);
#endif

View file

@ -1,11 +1,11 @@
#ifndef COLOR_H #ifndef COLOR_H
#define COLOR_H #define COLOR_H
typedef struct { typedef struct Color_RGB8 {
u8 r, g, b; u8 r, g, b;
} Color_RGB8; } Color_RGB8;
typedef struct { typedef struct Color_RGBA8 {
u8 r, g, b, a; u8 r, g, b, a;
} Color_RGBA8; } Color_RGBA8;
@ -17,11 +17,11 @@ typedef union Color_RGBA8_u32 {
u32 rgba; u32 rgba;
} Color_RGBA8_u32; } Color_RGBA8_u32;
typedef struct { typedef struct Color_RGBAf {
f32 r, g, b, a; f32 r, g, b, a;
} Color_RGBAf; } Color_RGBAf;
typedef union { typedef union Color_RGBA16 {
struct { struct {
u16 r : 5; u16 r : 5;
u16 g : 5; u16 g : 5;

View file

@ -1,7 +1,7 @@
#ifndef FACE_CHANGE_H #ifndef FACE_CHANGE_H
#define FACE_CHANGE_H #define FACE_CHANGE_H
typedef struct { typedef struct FaceChange {
/* 0x00 */ s16 face; /* 0x00 */ s16 face;
/* 0x02 */ s16 timer; /* 0x02 */ s16 timer;
} FaceChange; // size = 0x4 } FaceChange; // size = 0x4

View file

@ -4,7 +4,6 @@
#include "z64.h" #include "z64.h"
#include "macros.h" #include "macros.h"
void cleararena(void);
void bootproc(void); void bootproc(void);
void Main_ThreadEntry(void* arg); void Main_ThreadEntry(void* arg);
void Idle_ThreadEntry(void* arg); void Idle_ThreadEntry(void* arg);
@ -47,6 +46,15 @@ s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flag);
void osStopThread(OSThread* thread); void osStopThread(OSThread* thread);
void osViExtendVStart(u32 value); void osViExtendVStart(u32 value);
s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag); s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag);
#if PLATFORM_N64
void osInitialize(void);
#else
#define osInitialize() \
{ \
__osInitialize_common(); \
__osInitialize_autodetect(); \
}
#endif
void __osInitialize_common(void); void __osInitialize_common(void);
void __osInitialize_autodetect(void); void __osInitialize_autodetect(void);
void __osEnqueueAndYield(OSThread**); void __osEnqueueAndYield(OSThread**);
@ -452,8 +460,8 @@ f32 Rand_CenteredFloat(f32 f);
void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type); void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type);
void func_8003424C(PlayState* play, Vec3f* arg1); void func_8003424C(PlayState* play, Vec3f* arg1);
void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 bufFlag, s16 duration); void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 bufFlag, s16 duration);
Hilite* func_800342EC(Vec3f* object, PlayState* play); void func_800342EC(Vec3f* object, PlayState* play);
Hilite* func_8003435C(Vec3f* object, PlayState* play); void func_8003435C(Vec3f* object, PlayState* play);
s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange, s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange,
NpcGetTextIdFunc getTextId, NpcUpdateTalkStateFunc updateTalkState); NpcGetTextIdFunc getTextId, NpcUpdateTalkStateFunc updateTalkState);
s16 Npc_GetTrackingPresetMaxPlayerYaw(s16 presetIndex); s16 Npc_GetTrackingPresetMaxPlayerYaw(s16 presetIndex);
@ -1732,8 +1740,8 @@ void guMtxF2L(MtxF* m1, Mtx* m2);
void* osViGetCurrentFramebuffer(void); void* osViGetCurrentFramebuffer(void);
s32 __osSpSetPc(void* pc); s32 __osSpSetPc(void* pc);
f32 absf(f32); f32 absf(f32);
void* __osMemset(void* dest, s32 val, size_t len); void* memset(void* dest, int val, size_t len);
void* __osMemmove(void* dest, const void* src, size_t len); void* memmove(void* dest, const void* src, size_t len);
void Message_UpdateOcarinaMemoryGame(PlayState* play); void Message_UpdateOcarinaMemoryGame(PlayState* play);
u8 Message_ShouldAdvance(PlayState* play); u8 Message_ShouldAdvance(PlayState* play);
void Message_CloseTextbox(PlayState*); void Message_CloseTextbox(PlayState*);

View file

@ -9,7 +9,7 @@
// Texture memory size, 4 KiB // Texture memory size, 4 KiB
#define TMEM_SIZE 0x1000 #define TMEM_SIZE 0x1000
typedef struct { typedef struct GfxPool {
/* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC /* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC
/* 0x00008 */ Gfx polyOpaBuffer[0x17E0]; /* 0x00008 */ Gfx polyOpaBuffer[0x17E0];
/* 0x0BF08 */ Gfx polyXluBuffer[0x800]; /* 0x0BF08 */ Gfx polyXluBuffer[0x800];
@ -51,7 +51,7 @@ typedef struct GraphicsContext {
/* 0x02FC */ char unk_2FC[0x04]; /* 0x02FC */ char unk_2FC[0x04];
} GraphicsContext; // size = 0x300 } GraphicsContext; // size = 0x300
typedef enum { typedef enum SetupDL {
/* 0 */ SETUPDL_0, /* 0 */ SETUPDL_0,
/* 1 */ SETUPDL_1, /* 1 */ SETUPDL_1,
/* 2 */ SETUPDL_2, /* 2 */ SETUPDL_2,
@ -131,12 +131,12 @@ typedef enum {
#define UCODE_UNK 2 #define UCODE_UNK 2
#define UCODE_S2DEX 3 #define UCODE_S2DEX 3
typedef struct { typedef struct UCodeInfo {
/* 0x00 */ u32 type; /* 0x00 */ u32 type;
/* 0x04 */ void* ptr; /* 0x04 */ void* ptr;
} UCodeInfo; // size = 0x8 } UCodeInfo; // size = 0x8
typedef struct { typedef struct UCodeDisas {
/* 0x00 */ uintptr_t segments[NUM_SEGMENTS]; /* 0x00 */ uintptr_t segments[NUM_SEGMENTS];
/* 0x40 */ Gfx* dlStack[18]; /* 0x40 */ Gfx* dlStack[18];
/* 0x88 */ s32 dlDepth; /* 0x88 */ s32 dlDepth;

View file

@ -4,7 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "color.h" #include "color.h"
typedef struct { typedef struct GfxPrint {
/* 0x00 */ PrintCallback callback; /* 0x00 */ PrintCallback callback;
/* 0x04 */ Gfx* dList; /* 0x04 */ Gfx* dList;
/* 0x08 */ u16 posX; /* 0x08 */ u16 posX;

View file

@ -5,14 +5,14 @@
struct Actor; struct Actor;
typedef struct { typedef struct InitChainEntry {
u32 cont: 1; u32 cont: 1;
u32 type: 4; u32 type: 4;
u32 offset: 11; u32 offset: 11;
s32 value: 16; s32 value: 16;
} InitChainEntry; } InitChainEntry;
typedef enum { typedef enum InitChainType {
/* 0x0 */ ICHAINTYPE_U8, // sets byte /* 0x0 */ ICHAINTYPE_U8, // sets byte
/* 0x1 */ ICHAINTYPE_S8, /* 0x1 */ ICHAINTYPE_S8,
/* 0x2 */ ICHAINTYPE_U16, // sets short /* 0x2 */ ICHAINTYPE_U16, // sets short

View file

@ -8,13 +8,13 @@
#define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c #define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c
#define OS_SC_PRE_NMI_MSG 4 #define OS_SC_PRE_NMI_MSG 4
typedef enum { typedef enum IrqResetStatus {
IRQ_RESET_STATUS_IDLE, IRQ_RESET_STATUS_IDLE,
IRQ_RESET_STATUS_PRENMI, IRQ_RESET_STATUS_PRENMI,
IRQ_RESET_STATUS_NMI IRQ_RESET_STATUS_NMI
} IrqResetStatus; } IrqResetStatus;
typedef struct { typedef struct OSScMsg {
/* 0x00 */ s16 type; /* 0x00 */ s16 type;
/* 0x02 */ char misc[0x1E]; /* 0x02 */ char misc[0x1E];
} OSScMsg; // size = 0x20 } OSScMsg; // size = 0x20
@ -24,7 +24,7 @@ typedef struct IrqMgrClient {
/* 0x04 */ OSMesgQueue* queue; /* 0x04 */ OSMesgQueue* queue;
} IrqMgrClient; } IrqMgrClient;
typedef struct { typedef struct IrqMgr {
/* 0x000 */ OSScMsg retraceMsg; /* 0x000 */ OSScMsg retraceMsg;
/* 0x020 */ OSScMsg prenmiMsg; /* 0x020 */ OSScMsg prenmiMsg;
/* 0x040 */ OSScMsg nmiMsg; /* 0x040 */ OSScMsg nmiMsg;

View file

@ -4,11 +4,11 @@
#include "ultra64.h" #include "ultra64.h"
#include "sched.h" #include "sched.h"
typedef struct { typedef struct JpegQuantizationTable {
/* 0x00 */ u16 table[8*8]; /* 0x00 */ u16 table[8*8];
} JpegQuantizationTable; // size = 0x80 } JpegQuantizationTable; // size = 0x80
typedef struct { typedef struct JpegHuffmanTable {
/* 0x00 */ u8 codeOffs[16]; /* 0x00 */ u8 codeOffs[16];
/* 0x10 */ u16 codesA[16]; /* 0x10 */ u16 codesA[16];
/* 0x30 */ u16 codesB[16]; /* 0x30 */ u16 codesB[16];
@ -16,13 +16,13 @@ typedef struct {
} JpegHuffmanTable; // size = 0x54 } JpegHuffmanTable; // size = 0x54
// this struct might be inaccurate but it's not used outside jpegutils.c anyways // this struct might be inaccurate but it's not used outside jpegutils.c anyways
typedef struct { typedef struct JpegHuffmanTableOld {
/* 0x000 */ u8 codeOffs[16]; /* 0x000 */ u8 codeOffs[16];
/* 0x010 */ u16 dcCodes[120]; /* 0x010 */ u16 dcCodes[120];
/* 0x100 */ u16 acCodes[256]; /* 0x100 */ u16 acCodes[256];
} JpegHuffmanTableOld; // size = 0x300 } JpegHuffmanTableOld; // size = 0x300
typedef union { typedef union JpegTaskData {
struct { struct {
/* 0x00 */ u32 address; /* 0x00 */ u32 address;
/* 0x04 */ u32 mbCount; /* 0x04 */ u32 mbCount;
@ -35,7 +35,7 @@ typedef union {
long long int force_structure_alignment; long long int force_structure_alignment;
} JpegTaskData; // size = 0x20 } JpegTaskData; // size = 0x20
typedef struct { typedef struct JpegWork {
/* 0x000 */ JpegTaskData taskData; /* 0x000 */ JpegTaskData taskData;
/* 0x020 */ u64 yieldData[0x200 / sizeof(u64)]; /* 0x020 */ u64 yieldData[0x200 / sizeof(u64)];
/* 0x220 */ JpegQuantizationTable qTableY; /* 0x220 */ JpegQuantizationTable qTableY;
@ -46,7 +46,7 @@ typedef struct {
/* 0x6C0 */ u16 data[4][0x180]; /* 0x6C0 */ u16 data[4][0x180];
} JpegWork; // size = 0x12C0 } JpegWork; // size = 0x12C0
typedef struct { typedef struct JpegDecoder {
/* 0x00 */ void* imageData; /* 0x00 */ void* imageData;
/* 0x04 */ u8 mode; /* 0x04 */ u8 mode;
/* 0x05 */ u8 unk_05; /* 0x05 */ u8 unk_05;
@ -54,7 +54,7 @@ typedef struct {
/* 0x18 */ u8 unk_18; /* 0x18 */ u8 unk_18;
} JpegDecoder; // size = 0x1C } JpegDecoder; // size = 0x1C
typedef struct { typedef struct JpegContext {
/* 0x00 */ u8 dqtCount; /* 0x00 */ u8 dqtCount;
/* 0x04 */ u8* dqtPtr[3]; /* 0x04 */ u8* dqtPtr[3];
/* 0x10 */ u8 dhtCount; /* 0x10 */ u8 dhtCount;
@ -67,7 +67,7 @@ typedef struct {
/* 0xB4 */ JpegWork* workBuf; /* 0xB4 */ JpegWork* workBuf;
} JpegContext; // size = 0xB8 } JpegContext; // size = 0xB8
typedef struct { typedef struct JpegDecoderState {
/* 0x00 */ u32 byteIdx; /* 0x00 */ u32 byteIdx;
/* 0x04 */ u8 bitIdx; /* 0x04 */ u8 bitIdx;
/* 0x05 */ u8 dontSkip; /* 0x05 */ u8 dontSkip;

View file

@ -1,16 +1,6 @@
#ifndef MACROS_H #ifndef MACROS_H
#define 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 #ifndef AVOID_UB
#define BAD_RETURN(type) type #define BAD_RETURN(type) type
#else #else

View file

@ -111,7 +111,7 @@
* Colors * Colors
*/ */
typedef enum { typedef enum TextColor {
TEXT_COLOR_DEFAULT, TEXT_COLOR_DEFAULT,
TEXT_COLOR_RED, TEXT_COLOR_RED,
TEXT_COLOR_ADJUSTABLE, TEXT_COLOR_ADJUSTABLE,
@ -126,12 +126,12 @@ typedef enum {
* Background * Background
*/ */
typedef enum { typedef enum TextboxBackgroundIndex {
TEXTBOX_BG_X_LEFT, TEXTBOX_BG_X_LEFT,
TEXTBOX_BG_X_RIGHT TEXTBOX_BG_X_RIGHT
} TextboxBackgroundIndex; } TextboxBackgroundIndex;
typedef enum { typedef enum TextboxBackgroundForegroundColor {
TEXTBOX_BG_FGCOL_WHITE, TEXTBOX_BG_FGCOL_WHITE,
TEXTBOX_BG_FGCOL_DARK_RED, TEXTBOX_BG_FGCOL_DARK_RED,
TEXTBOX_BG_FGCOL_ORANGE, TEXTBOX_BG_FGCOL_ORANGE,
@ -142,14 +142,14 @@ typedef enum {
TEXTBOX_BG_FGCOL_WHITE_7 TEXTBOX_BG_FGCOL_WHITE_7
} TextboxBackgroundForegroundColor; } TextboxBackgroundForegroundColor;
typedef enum { typedef enum TextboxBackgroundBackgroundColor {
TEXTBOX_BG_BGCOL_BLACK, TEXTBOX_BG_BGCOL_BLACK,
TEXTBOX_BG_BGCOL_GOLD, TEXTBOX_BG_BGCOL_GOLD,
TEXTBOX_BG_BGCOL_BLACK_2, TEXTBOX_BG_BGCOL_BLACK_2,
TEXTBOX_BG_BGCOL_BLACK_3 TEXTBOX_BG_BGCOL_BLACK_3
} TextboxBackgroundBackgroundColor; } TextboxBackgroundBackgroundColor;
typedef enum { typedef enum TextboxBackgroundYOffsetIndex {
TEXTBOX_BG_Y_OFFSET_1, TEXTBOX_BG_Y_OFFSET_1,
TEXTBOX_BG_Y_OFFSET_2 TEXTBOX_BG_Y_OFFSET_2
} TextboxBackgroundYOffsetIndex; } TextboxBackgroundYOffsetIndex;

View file

@ -4,7 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "message_data_fmt.h" #include "message_data_fmt.h"
typedef enum { typedef enum TextBoxType {
/* 0 */ TEXTBOX_TYPE_BLACK, /* 0 */ TEXTBOX_TYPE_BLACK,
/* 1 */ TEXTBOX_TYPE_WOODEN, /* 1 */ TEXTBOX_TYPE_WOODEN,
/* 2 */ TEXTBOX_TYPE_BLUE, /* 2 */ TEXTBOX_TYPE_BLUE,
@ -14,18 +14,18 @@ typedef enum {
/* 11 */ TEXTBOX_TYPE_CREDITS = 11 /* 11 */ TEXTBOX_TYPE_CREDITS = 11
} TextBoxType; } TextBoxType;
typedef enum { typedef enum TextBoxBackground {
/* 0 */ TEXTBOX_BG_CROSS /* 0 */ TEXTBOX_BG_CROSS
} TextBoxBackground; } TextBoxBackground;
typedef enum { typedef enum TextBoxPosition {
/* 0 */ TEXTBOX_POS_VARIABLE, /* 0 */ TEXTBOX_POS_VARIABLE,
/* 1 */ TEXTBOX_POS_TOP, /* 1 */ TEXTBOX_POS_TOP,
/* 2 */ TEXTBOX_POS_MIDDLE, /* 2 */ TEXTBOX_POS_MIDDLE,
/* 3 */ TEXTBOX_POS_BOTTOM /* 3 */ TEXTBOX_POS_BOTTOM
} TextBoxPosition; } TextBoxPosition;
typedef struct { typedef struct MessageTableEntry {
u16 textId; u16 textId;
u8 typePos; u8 typePos;
const char* segment; const char* segment;

50
include/n64dd.h Normal file
View file

@ -0,0 +1,50 @@
#ifndef N64DD_H
#define N64DD_H
#include "z64scene.h"
struct RegEditor;
struct SaveContext;
// TODO Use the specific pointer types instead of void*
typedef struct n64ddStruct_800FF4B0_pointers {
void* unk_00;
void* unk_04;
struct RegEditor* unk_08;
void* unk_0C[31];
struct SaveContext* unk_88;
void* unk_8C[9];
} n64ddStruct_800FF4B0_pointers; // size = 0xB0
struct n64ddStruct_80121AF0;
struct PlayState;
typedef struct n64ddStruct_80121AF0 {
void (*unk_00)(n64ddStruct_800FF4B0_pointers*, struct n64ddStruct_80121AF0*);
void (*unk_04)(void);
char unk_08[0x34];
void (*unk_3C)(void);
void (*unk_40)(void);
char unk_44[0x28];
void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*);
} n64ddStruct_80121AF0; // size = ?
void func_800ADA80(void);
void func_800ADAF8(void);
n64ddStruct_80121AF0* func_800ADB30(n64ddStruct_80121AF0* arg0);
void func_800ADB8C(void);
n64ddStruct_800FF4B0_pointers* func_800ADBD0(void);
void func_800ADC00(void);
void func_800ADC08(s32 arg0, s32 arg1, s32 arg2);
extern n64ddStruct_800FF4B0_pointers D_800FF4B0;
extern n64ddStruct_80121AF0* B_80121AF0;
extern u8 B_80121AE0;
extern s8 B_80121AE1;
extern u8 B_80121AE2;
extern char D_801DA410; // type ?
extern char D_801E8090; // type ?
#endif

View file

@ -4,7 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "irqmgr.h" #include "irqmgr.h"
typedef enum { typedef enum ControllerPakType {
CONT_PAK_NONE, CONT_PAK_NONE,
CONT_PAK_RUMBLE, CONT_PAK_RUMBLE,
CONT_PAK_OTHER CONT_PAK_OTHER

View file

@ -8,7 +8,7 @@ typedef struct ListAlloc {
/* 0x04 */ struct ListAlloc* next; /* 0x04 */ struct ListAlloc* next;
} ListAlloc; // size = 0x8 } ListAlloc; // size = 0x8
typedef struct { typedef struct PreRender {
/* 0x00 */ s32 width; /* 0x00 */ s32 width;
/* 0x04 */ s32 height; /* 0x04 */ s32 height;
/* 0x08 */ s32 widthSave; /* 0x08 */ s32 widthSave;

View file

@ -4,7 +4,7 @@
#include "z64camera.h" #include "z64camera.h"
#include "z64math.h" #include "z64math.h"
typedef struct { typedef struct ShakeInfo {
/* 0x00 */ Vec3f atOffset; /* 0x00 */ Vec3f atOffset;
/* 0x0C */ Vec3f eyeOffset; /* 0x0C */ Vec3f eyeOffset;
/* 0x18 */ s16 upPitchOffset; // gives a "roll" effect by offsetting the Up vector /* 0x18 */ s16 upPitchOffset; // gives a "roll" effect by offsetting the Up vector
@ -13,7 +13,7 @@ typedef struct {
/* 0x20 */ f32 maxOffset; /* 0x20 */ f32 maxOffset;
} ShakeInfo; // size = 0x24 } ShakeInfo; // size = 0x24
typedef enum { typedef enum QuakeType {
/* 0 */ QUAKE_TYPE_NONE, /* 0 */ QUAKE_TYPE_NONE,
/* 1 */ QUAKE_TYPE_1, // Periodic, sustaining, random X perturbations /* 1 */ QUAKE_TYPE_1, // Periodic, sustaining, random X perturbations
/* 2 */ QUAKE_TYPE_2, // Aperiodic, sustaining, random X perturbations /* 2 */ QUAKE_TYPE_2, // Aperiodic, sustaining, random X perturbations

View file

@ -262,7 +262,7 @@
#define R_HREG_MODE HREG(80) // see `HRegMode` for mode options #define R_HREG_MODE HREG(80) // see `HRegMode` for mode options
typedef enum { typedef enum HRegMode {
/* 6 */ HREG_MODE_PRINT_HILITE_INFO = 6, // print hilite information /* 6 */ HREG_MODE_PRINT_HILITE_INFO = 6, // print hilite information
/* 7 */ HREG_MODE_UCODE_DISAS, // various controls for the ucode disas system /* 7 */ HREG_MODE_UCODE_DISAS, // various controls for the ucode disas system
/* 8 */ HREG_MODE_PRINT_MEMORY, // print memory at a specified address /* 8 */ HREG_MODE_PRINT_MEMORY, // print memory at a specified address
@ -405,7 +405,7 @@ typedef enum {
#define R_VI_CUR_ADDI_SCAN_LINES HREG(83) #define R_VI_CUR_ADDI_SCAN_LINES HREG(83)
#define R_VI_CUR_Y_SCALE_MODE HREG(84) #define R_VI_CUR_Y_SCALE_MODE HREG(84)
typedef struct { typedef struct RegEditor {
/* 0x00 */ s32 regPage; // 0: no page selected (reg editor is not active); 1: first page; `REG_PAGES`: last page /* 0x00 */ s32 regPage; // 0: no page selected (reg editor is not active); 1: first page; `REG_PAGES`: last page
/* 0x04 */ s32 regGroup; // Indexed from 0 to `REG_GROUPS`-1. Each group has its own character to identify it. /* 0x04 */ s32 regGroup; // Indexed from 0 to `REG_GROUPS`-1. Each group has its own character to identify it.
/* 0x08 */ s32 regCur; // Selected reg, indexed from 0 as the page start /* 0x08 */ s32 regCur; // Selected reg, indexed from 0 as the page start

View file

@ -3,7 +3,7 @@
#include "ultra64.h" #include "ultra64.h"
typedef struct { typedef struct RomFile {
/* 0x00 */ uintptr_t vromStart; /* 0x00 */ uintptr_t vromStart;
/* 0x04 */ uintptr_t vromEnd; /* 0x04 */ uintptr_t vromEnd;
} RomFile; // size = 0x8 } RomFile; // size = 0x8

View file

@ -5,13 +5,13 @@
#define RUMBLE_MAX_REQUESTS 64 #define RUMBLE_MAX_REQUESTS 64
typedef enum { typedef enum RumbleState {
RUMBLE_STATE_CLEAR, RUMBLE_STATE_CLEAR,
RUMBLE_STATE_RUNNING, RUMBLE_STATE_RUNNING,
RUMBLE_STATE_RESET RUMBLE_STATE_RESET
} RumbleState; } RumbleState;
typedef struct { typedef struct RumbleMgr {
/* 0x000 */ u8 rumbleEnable[MAXCONTROLLERS]; /* 0x000 */ u8 rumbleEnable[MAXCONTROLLERS];
/* 0x004 */ u8 reqStrengths[RUMBLE_MAX_REQUESTS]; // Source strength modulated by distance to the source /* 0x004 */ u8 reqStrengths[RUMBLE_MAX_REQUESTS]; // Source strength modulated by distance to the source
/* 0x044 */ u8 reqDurations[RUMBLE_MAX_REQUESTS]; // Duration until decreaseRate kicks in /* 0x044 */ u8 reqDurations[RUMBLE_MAX_REQUESTS]; // Duration until decreaseRate kicks in

View file

@ -19,7 +19,7 @@
#define OS_SC_RCP_MASK (OS_SC_NEEDS_RDP | OS_SC_NEEDS_RSP) #define OS_SC_RCP_MASK (OS_SC_NEEDS_RDP | OS_SC_NEEDS_RSP)
#define OS_SC_TYPE_MASK (OS_SC_NEEDS_RDP | OS_SC_NEEDS_RSP | OS_SC_DRAM_DLIST) #define OS_SC_TYPE_MASK (OS_SC_NEEDS_RDP | OS_SC_NEEDS_RSP | OS_SC_DRAM_DLIST)
typedef struct { typedef struct CfbInfo {
/* 0x00 */ u16* framebuffer; // current framebuffer /* 0x00 */ u16* framebuffer; // current framebuffer
/* 0x04 */ u16* swapBuffer; // framebuffer to swap to /* 0x04 */ u16* swapBuffer; // framebuffer to swap to
/* 0x08 */ OSViMode* viMode; /* 0x08 */ OSViMode* viMode;
@ -43,7 +43,7 @@ typedef struct OSScTask {
/* 0x60 */ OSTime totalTime; /* 0x60 */ OSTime totalTime;
} OSScTask; // size = 0x68 } OSScTask; // size = 0x68
typedef struct { typedef struct Scheduler {
/* 0x0000 */ OSMesgQueue interruptQueue; /* 0x0000 */ OSMesgQueue interruptQueue;
/* 0x0018 */ OSMesg interruptMsgBuf[8]; /* 0x0018 */ OSMesg interruptMsgBuf[8];
/* 0x0038 */ OSMesgQueue cmdQueue; // queue for receiving OSScTask pointers /* 0x0038 */ OSMesgQueue cmdQueue; // queue for receiving OSScTask pointers

View file

@ -648,7 +648,9 @@ DECLARE_ROM_SEGMENT(spot20_room_0)
DECLARE_ROM_SEGMENT(ganon_tou_room_0) DECLARE_ROM_SEGMENT(ganon_tou_room_0)
#if OOT_DEBUG // Room symbols for compiling test scenes, these are not wrapped in an `#if OOT_DEBUG`
// so that debug ROMs (including gc-eu-mq-dbg) can be built with OOT_DEBUG=0.
DECLARE_ROM_SEGMENT(test01_room_0) DECLARE_ROM_SEGMENT(test01_room_0)
DECLARE_ROM_SEGMENT(besitu_room_0) DECLARE_ROM_SEGMENT(besitu_room_0)
@ -670,6 +672,5 @@ DECLARE_ROM_SEGMENT(testroom_room_1)
DECLARE_ROM_SEGMENT(testroom_room_2) DECLARE_ROM_SEGMENT(testroom_room_2)
DECLARE_ROM_SEGMENT(testroom_room_3) DECLARE_ROM_SEGMENT(testroom_room_3)
DECLARE_ROM_SEGMENT(testroom_room_4) DECLARE_ROM_SEGMENT(testroom_room_4)
#endif
#endif #endif

View file

@ -5,7 +5,7 @@
#define SEQCMD_OP_MASK 0xF0000000 #define SEQCMD_OP_MASK 0xF0000000
typedef enum { typedef enum SeqCmdOp {
/* 0x0 */ SEQCMD_OP_PLAY_SEQUENCE, /* 0x0 */ SEQCMD_OP_PLAY_SEQUENCE,
/* 0x1 */ SEQCMD_OP_STOP_SEQUENCE, /* 0x1 */ SEQCMD_OP_STOP_SEQUENCE,
/* 0x2 */ SEQCMD_OP_QUEUE_SEQUENCE, /* 0x2 */ SEQCMD_OP_QUEUE_SEQUENCE,
@ -27,7 +27,7 @@ typedef enum {
// ==== Secondary commands ==== // ==== Secondary commands ====
// Subset of `SEQCMD_OP_TEMPO_CMD` // Subset of `SEQCMD_OP_TEMPO_CMD`
typedef enum { typedef enum SeqCmdTempoCmdOp {
/* 0x0 */ SEQCMD_SUB_OP_TEMPO_SET, /* 0x0 */ SEQCMD_SUB_OP_TEMPO_SET,
/* 0x1 */ SEQCMD_SUB_OP_TEMPO_SPEED_UP, /* 0x1 */ SEQCMD_SUB_OP_TEMPO_SPEED_UP,
/* 0x2 */ SEQCMD_SUB_OP_TEMPO_SLOW_DOWN, /* 0x2 */ SEQCMD_SUB_OP_TEMPO_SLOW_DOWN,
@ -36,7 +36,7 @@ typedef enum {
} SeqCmdTempoCmdOp; } SeqCmdTempoCmdOp;
// Subset of `SEQCMD_OP_SETUP_CMD` // Subset of `SEQCMD_OP_SETUP_CMD`
typedef enum { typedef enum SeqCmdSetupCmdOp {
/* 0x0 */ SEQCMD_SUB_OP_SETUP_RESTORE_SEQPLAYER_VOLUME, /* 0x0 */ SEQCMD_SUB_OP_SETUP_RESTORE_SEQPLAYER_VOLUME,
/* 0x1 */ SEQCMD_SUB_OP_SETUP_SEQ_UNQUEUE, /* 0x1 */ SEQCMD_SUB_OP_SETUP_SEQ_UNQUEUE,
/* 0x2 */ SEQCMD_SUB_OP_SETUP_RESTART_SEQ, /* 0x2 */ SEQCMD_SUB_OP_SETUP_RESTART_SEQ,
@ -53,7 +53,7 @@ typedef enum {
} SeqCmdSetupCmdOp; } SeqCmdSetupCmdOp;
// Subset of `SEQCMD_OP_GLOBAL_CMD` // Subset of `SEQCMD_OP_GLOBAL_CMD`
typedef enum { typedef enum SeqCmdSubCmdOp {
/* 0x0 */ SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE, /* 0x0 */ SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE,
/* 0x1 */ SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES /* 0x1 */ SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES
} SeqCmdSubCmdOp; } SeqCmdSubCmdOp;

View file

@ -1,7 +1,7 @@
#ifndef SEQUENCE_H #ifndef SEQUENCE_H
#define SEQUENCE_H #define SEQUENCE_H
typedef enum { typedef enum SeqId {
/* 0x00 */ NA_BGM_GENERAL_SFX, // General Sound Effects /* 0x00 */ NA_BGM_GENERAL_SFX, // General Sound Effects
/* 0x01 */ NA_BGM_NATURE_AMBIENCE, // Environmental nature background sounds /* 0x01 */ NA_BGM_NATURE_AMBIENCE, // Environmental nature background sounds
/* 0x02 */ NA_BGM_FIELD_LOGIC, // Hyrule Field /* 0x02 */ NA_BGM_FIELD_LOGIC, // Hyrule Field
@ -117,21 +117,21 @@ typedef enum {
/* 0xFFFF */ NA_BGM_DISABLED = 0xFFFF /* 0xFFFF */ NA_BGM_DISABLED = 0xFFFF
} SeqId; } SeqId;
typedef enum { typedef enum SequencePlayerId {
/* 0 */ SEQ_PLAYER_BGM_MAIN, /* 0 */ SEQ_PLAYER_BGM_MAIN,
/* 1 */ SEQ_PLAYER_FANFARE, /* 1 */ SEQ_PLAYER_FANFARE,
/* 2 */ SEQ_PLAYER_SFX, /* 2 */ SEQ_PLAYER_SFX,
/* 3 */ SEQ_PLAYER_BGM_SUB /* 3 */ SEQ_PLAYER_BGM_SUB
} SequencePlayerId; } SequencePlayerId;
typedef enum { typedef enum SequenceMode {
/* 0 */ SEQ_MODE_DEFAULT, /* 0 */ SEQ_MODE_DEFAULT,
/* 1 */ SEQ_MODE_ENEMY, /* 1 */ SEQ_MODE_ENEMY,
/* 2 */ SEQ_MODE_STILL, // Not moving or first-person view /* 2 */ SEQ_MODE_STILL, // Not moving or first-person view
/* 3 */ SEQ_MODE_IGNORE /* 3 */ SEQ_MODE_IGNORE
} SequenceMode; } SequenceMode;
typedef enum { typedef enum SequenceCutsceneEffects {
/* 0x0 */ SEQ_CS_EFFECTS_SWORD_GLOW, // Master sword glow /* 0x0 */ SEQ_CS_EFFECTS_SWORD_GLOW, // Master sword glow
/* 0x1 */ SEQ_CS_EFFECTS_SHEIK_TRANSFORM, // Sheik's transformation to Zelda /* 0x1 */ SEQ_CS_EFFECTS_SHEIK_TRANSFORM, // Sheik's transformation to Zelda
/* 0x2 */ SEQ_CS_EFFECTS_SAGE_SEAL, // Sages accumulating their power /* 0x2 */ SEQ_CS_EFFECTS_SAGE_SEAL, // Sages accumulating their power
@ -150,7 +150,7 @@ typedef enum {
/* 0xF */ SEQ_CS_EFFECTS_RAINFALL // Rain with thunder effects /* 0xF */ SEQ_CS_EFFECTS_RAINFALL // Rain with thunder effects
} SequenceCutsceneEffects; } SequenceCutsceneEffects;
typedef enum { typedef enum ChannelIOPort {
/* 0x0 */ CHANNEL_IO_PORT_0, /* 0x0 */ CHANNEL_IO_PORT_0,
/* 0x1 */ CHANNEL_IO_PORT_1, /* 0x1 */ CHANNEL_IO_PORT_1,
/* 0x2 */ CHANNEL_IO_PORT_2, /* 0x2 */ CHANNEL_IO_PORT_2,
@ -161,7 +161,7 @@ typedef enum {
/* 0x7 */ CHANNEL_IO_PORT_7 /* 0x7 */ CHANNEL_IO_PORT_7
} ChannelIOPort; } ChannelIOPort;
typedef enum { typedef enum VolumeScaleIndex {
/* 0 */ VOL_SCALE_INDEX_BGM_MAIN, /* 0 */ VOL_SCALE_INDEX_BGM_MAIN,
/* 1 */ VOL_SCALE_INDEX_FANFARE, /* 1 */ VOL_SCALE_INDEX_FANFARE,
/* 2 */ VOL_SCALE_INDEX_SFX, /* 2 */ VOL_SCALE_INDEX_SFX,
@ -169,7 +169,7 @@ typedef enum {
/* 4 */ VOL_SCALE_INDEX_MAX /* 4 */ VOL_SCALE_INDEX_MAX
} VolumeScaleIndex; // May be worth using SequencePlayerId instead } VolumeScaleIndex; // May be worth using SequencePlayerId instead
typedef struct { typedef struct ActiveSequenceChannelData {
/* 0x00 */ f32 volCur; /* 0x00 */ f32 volCur;
/* 0x04 */ f32 volTarget; /* 0x04 */ f32 volTarget;
/* 0x08 */ f32 volStep; /* 0x08 */ f32 volStep;
@ -180,7 +180,7 @@ typedef struct {
/* 0x1C */ u16 freqScaleTimer; /* 0x1C */ u16 freqScaleTimer;
} ActiveSequenceChannelData; // size = 0x20 } ActiveSequenceChannelData; // size = 0x20
typedef struct { typedef struct ActiveSequence {
/* 0x000 */ f32 volCur; /* 0x000 */ f32 volCur;
/* 0x004 */ f32 volTarget; /* 0x004 */ f32 volTarget;
/* 0x008 */ f32 volStep; /* 0x008 */ f32 volStep;
@ -208,7 +208,7 @@ typedef struct {
/* 0x260 */ u8 isWaitingForFonts; // This name comes from MM /* 0x260 */ u8 isWaitingForFonts; // This name comes from MM
} ActiveSequence; // size = 0x264 } ActiveSequence; // size = 0x264
typedef enum { typedef enum NatureChannelIndex {
/* 0x0 */ NATURE_CHANNEL_STREAM_0, /* 0x0 */ NATURE_CHANNEL_STREAM_0,
/* 0x1 */ NATURE_CHANNEL_CRITTER_0, /* 0x1 */ NATURE_CHANNEL_CRITTER_0,
/* 0x2 */ NATURE_CHANNEL_CRITTER_1, /* 0x2 */ NATURE_CHANNEL_CRITTER_1,
@ -224,7 +224,7 @@ typedef enum {
/* 0xF */ NATURE_CHANNEL_LIGHTNING /* 0xF */ NATURE_CHANNEL_LIGHTNING
} NatureChannelIndex; // seqPlayerIndex = 0 (Overlaps with main bgm) } NatureChannelIndex; // seqPlayerIndex = 0 (Overlaps with main bgm)
typedef enum { typedef enum NatureAmbienceId {
/* 0x00 */ NATURE_ID_GENERAL_NIGHT, /* 0x00 */ NATURE_ID_GENERAL_NIGHT,
/* 0x01 */ NATURE_ID_MARKET_ENTRANCE, /* 0x01 */ NATURE_ID_MARKET_ENTRANCE,
/* 0x02 */ NATURE_ID_KAKARIKO_REGION, /* 0x02 */ NATURE_ID_KAKARIKO_REGION,
@ -248,14 +248,14 @@ typedef enum {
/* 0xFF */ NATURE_ID_DISABLED = 0xFF /* 0xFF */ NATURE_ID_DISABLED = 0xFF
} NatureAmbienceId; } NatureAmbienceId;
typedef enum { typedef enum NatureStreamId {
/* 0x00 */ NATURE_STREAM_RUSHING_WATER, /* 0x00 */ NATURE_STREAM_RUSHING_WATER,
/* 0x01 */ NATURE_STREAM_HOWLING_WIND, /* 0x01 */ NATURE_STREAM_HOWLING_WIND,
/* 0x02 */ NATURE_STREAM_SCREECHING_WIND, /* 0x02 */ NATURE_STREAM_SCREECHING_WIND,
/* 0x03 */ NATURE_STREAM_SCREECHING_WIND_ALT1 /* 0x03 */ NATURE_STREAM_SCREECHING_WIND_ALT1
} NatureStreamId; } NatureStreamId;
typedef enum { typedef enum NatureAmimalId {
/* 0x00 */ NATURE_CRITTER_BIRD_CHIRP_1, /* 0x00 */ NATURE_CRITTER_BIRD_CHIRP_1,
/* 0x01 */ NATURE_CRITTER_TAP, /* 0x01 */ NATURE_CRITTER_TAP,
/* 0x02 */ NATURE_CRITTER_BIRD_CHIRP_2, /* 0x02 */ NATURE_CRITTER_BIRD_CHIRP_2,

View file

@ -1,7 +1,7 @@
#ifndef SFX_H #ifndef SFX_H
#define SFX_H #define SFX_H
typedef enum { typedef enum SfxBankType {
/* 0 */ BANK_PLAYER, /* 0 */ BANK_PLAYER,
/* 1 */ BANK_ITEM, /* 1 */ BANK_ITEM,
/* 2 */ BANK_ENV, /* 2 */ BANK_ENV,
@ -11,7 +11,7 @@ typedef enum {
/* 6 */ BANK_VOICE /* 6 */ BANK_VOICE
} SfxBankType; } SfxBankType;
typedef enum { typedef enum SfxState {
/* 0 */ SFX_STATE_EMPTY, /* 0 */ SFX_STATE_EMPTY,
/* 1 */ SFX_STATE_QUEUED, /* 1 */ SFX_STATE_QUEUED,
/* 2 */ SFX_STATE_READY, /* 2 */ SFX_STATE_READY,
@ -20,7 +20,7 @@ typedef enum {
/* 5 */ SFX_STATE_PLAYING_2 /* 5 */ SFX_STATE_PLAYING_2
} SfxState; } SfxState;
typedef struct { typedef struct SfxBankEntry {
/* 0x00 */ f32* posX; /* 0x00 */ f32* posX;
/* 0x04 */ f32* posY; /* 0x04 */ f32* posY;
/* 0x08 */ f32* posZ; /* 0x08 */ f32* posZ;
@ -57,7 +57,7 @@ typedef struct {
#define DEFINE_SFX(enum, _1, _2, _3, _4) enum, #define DEFINE_SFX(enum, _1, _2, _3, _4) enum,
typedef enum { typedef enum SfxId {
NA_SE_NONE, // Requesting a sfx with this id will play no sound NA_SE_NONE, // Requesting a sfx with this id will play no sound
NA_SE_PL_BASE = 0x7FF, NA_SE_PL_BASE = 0x7FF,
#include "tables/sfx/playerbank_table.h" #include "tables/sfx/playerbank_table.h"
@ -87,7 +87,7 @@ typedef enum {
#define SFX_FLAG 0x800 #define SFX_FLAG 0x800
typedef struct { typedef struct ActiveSfx {
u32 priority; // lower is more prioritized u32 priority; // lower is more prioritized
u8 entryIndex; u8 entryIndex;
} ActiveSfx; } ActiveSfx;
@ -114,7 +114,7 @@ typedef struct {
#define SFX_FLAG_14 (1 << 14) #define SFX_FLAG_14 (1 << 14)
#define SFX_FLAG_15 (1 << 15) #define SFX_FLAG_15 (1 << 15)
typedef struct { typedef struct SfxParams {
u8 importance; u8 importance;
u16 params; u16 params;
} SfxParams; } SfxParams;

View file

@ -6,7 +6,7 @@
struct GraphicsContext; struct GraphicsContext;
struct GameState; struct GameState;
typedef struct { typedef struct SpeedMeter {
/* 0x00 */ char unk_00[0x18]; /* 0x00 */ char unk_00[0x18];
/* 0x18 */ s32 x; // Unused /* 0x18 */ s32 x; // Unused
/* 0x1C */ s32 y; /* 0x1C */ s32 y;

View file

@ -4,7 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "alignment.h" #include "alignment.h"
typedef struct { typedef struct TwoHeadArena {
/* 0x00 */ size_t size; /* 0x00 */ size_t size;
/* 0x04 */ void* start; /* 0x04 */ void* start;
/* 0x08 */ void* head; /* 0x08 */ void* head;

View file

@ -3,7 +3,7 @@
#include "tha.h" #include "tha.h"
typedef union { typedef union TwoHeadGfxArena {
/* 0x00 */ TwoHeadArena tha; /* 0x00 */ TwoHeadArena tha;
struct { // Same as TwoHeadArena, with different types and field names for the head and tail pointers struct { // Same as TwoHeadArena, with different types and field names for the head and tail pointers
/* 0x00 */ size_t size; /* 0x00 */ size_t size;

View file

@ -49,28 +49,28 @@
* Data Structures. * Data Structures.
*/ */
typedef struct { typedef struct Aadpcm {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 gain : 16; u32 gain : 16;
u32 addr; u32 addr;
} Aadpcm; } Aadpcm;
typedef struct { typedef struct Apolef {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 gain : 16; u32 gain : 16;
u32 addr; u32 addr;
} Apolef; } Apolef;
typedef struct { typedef struct Aenvelope {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 pad1 : 16; u32 pad1 : 16;
u32 addr; u32 addr;
} Aenvelope; } Aenvelope;
typedef struct { typedef struct Aclearbuff {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 8; u32 pad1 : 8;
u32 dmem : 16; u32 dmem : 16;
@ -78,7 +78,7 @@ typedef struct {
u32 count : 16; u32 count : 16;
} Aclearbuff; } Aclearbuff;
typedef struct { typedef struct Ainterleave {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 8; u32 pad1 : 8;
u32 pad2 : 16; u32 pad2 : 16;
@ -86,20 +86,20 @@ typedef struct {
u32 inR : 16; u32 inR : 16;
} Ainterleave; } Ainterleave;
typedef struct { typedef struct Aloadbuff {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 24; u32 pad1 : 24;
u32 addr; u32 addr;
} Aloadbuff; } Aloadbuff;
typedef struct { typedef struct Aenvmixer {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 pad1 : 16; u32 pad1 : 16;
u32 addr; u32 addr;
} Aenvmixer; } Aenvmixer;
typedef struct { typedef struct Amixer {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 gain : 16; u32 gain : 16;
@ -107,34 +107,34 @@ typedef struct {
u32 dmemo : 16; u32 dmemo : 16;
} Amixer; } Amixer;
typedef struct { typedef struct Apan {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 dmem2 : 16; u32 dmem2 : 16;
u32 addr; u32 addr;
} Apan; } Apan;
typedef struct { typedef struct Aresample {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 pitch : 16; u32 pitch : 16;
u32 addr; u32 addr;
} Aresample; } Aresample;
typedef struct { typedef struct Areverb {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 pad1 : 16; u32 pad1 : 16;
u32 addr; u32 addr;
} Areverb; } Areverb;
typedef struct { typedef struct Asavebuff {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 24; u32 pad1 : 24;
u32 addr; u32 addr;
} Asavebuff; } Asavebuff;
typedef struct { typedef struct Asegment {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 24; u32 pad1 : 24;
u32 pad2 : 2; u32 pad2 : 2;
@ -142,7 +142,7 @@ typedef struct {
u32 base : 24; u32 base : 24;
} Asegment; } Asegment;
typedef struct { typedef struct Asetbuff {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 dmemin : 16; u32 dmemin : 16;
@ -150,7 +150,7 @@ typedef struct {
u32 count : 16; u32 count : 16;
} Asetbuff; } Asetbuff;
typedef struct { typedef struct Asetvol {
u32 cmd : 8; u32 cmd : 8;
u32 flags : 8; u32 flags : 8;
u32 vol : 16; u32 vol : 16;
@ -158,7 +158,7 @@ typedef struct {
u32 volrate : 16; u32 volrate : 16;
} Asetvol; } Asetvol;
typedef struct { typedef struct Admemmove {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 8; u32 pad1 : 8;
u32 dmemin : 16; u32 dmemin : 16;
@ -166,14 +166,14 @@ typedef struct {
u32 count : 16; u32 count : 16;
} Admemmove; } Admemmove;
typedef struct { typedef struct Aloadadpcm {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 8; u32 pad1 : 8;
u32 count : 16; u32 count : 16;
u32 addr; u32 addr;
} Aloadadpcm; } Aloadadpcm;
typedef struct { typedef struct Asetloop {
u32 cmd : 8; u32 cmd : 8;
u32 pad1 : 8; u32 pad1 : 8;
u32 pad2 : 16; u32 pad2 : 16;
@ -184,12 +184,12 @@ typedef struct {
* Generic Acmd Packet * Generic Acmd Packet
*/ */
typedef struct { typedef struct Awords {
u32 w0; u32 w0;
u32 w1; u32 w1;
} Awords; } Awords;
typedef union { typedef union Acmd {
Awords words; Awords words;
Aadpcm adpcm; Aadpcm adpcm;
Apolef polef; Apolef polef;

View file

@ -125,7 +125,7 @@
// however file alignment should not be relied on in general. // however file alignment should not be relied on in general.
__attribute__((aligned(0x10))) __attribute__((aligned(0x10)))
#endif #endif
typedef union { typedef union OSPifRam {
struct { struct {
/* 0x00 */ u32 ram[15]; /* 0x00 */ u32 ram[15];
/* 0x3C */ u32 status; /* 0x3C */ u32 status;
@ -133,20 +133,20 @@ typedef union {
u64 force_structure_alignment; u64 force_structure_alignment;
} OSPifRam; // size = 0x40 } OSPifRam; // size = 0x40
typedef struct { typedef struct OSContStatus {
/* 0x00 */ u16 type; /* 0x00 */ u16 type;
/* 0x02 */ u8 status; /* 0x02 */ u8 status;
/* 0x03 */ u8 errno; /* 0x03 */ u8 errno;
} OSContStatus; // size = 0x04 } OSContStatus; // size = 0x04
typedef struct { typedef struct OSContPad {
/* 0x00 */ u16 button; /* 0x00 */ u16 button;
/* 0x02 */ s8 stick_x; /* 0x02 */ s8 stick_x;
/* 0x03 */ s8 stick_y; /* 0x03 */ s8 stick_y;
/* 0x04 */ u8 errno; /* 0x04 */ u8 errno;
} OSContPad; // size = 0x06 } OSContPad; // size = 0x06
typedef struct { typedef struct OSContRamIo {
/* 0x00 */ void* address; /* 0x00 */ void* address;
/* 0x04 */ u8 databuffer[32]; /* 0x04 */ u8 databuffer[32];
/* 0x24 */ u8 addressCrc; /* 0x24 */ u8 addressCrc;
@ -154,7 +154,7 @@ typedef struct {
/* 0x26 */ u8 errno; /* 0x26 */ u8 errno;
} OSContRamIo; // size = 0x28 } OSContRamIo; // size = 0x28
typedef struct { typedef struct __OSContRequesFormat {
/* 0x00 */ u8 align; /* 0x00 */ u8 align;
/* 0x01 */ u8 txsize; /* 0x01 */ u8 txsize;
/* 0x02 */ u8 rxsize; /* 0x02 */ u8 rxsize;
@ -165,7 +165,7 @@ typedef struct {
/* 0x07 */ u8 align1; /* 0x07 */ u8 align1;
} __OSContRequesFormat; // size = 0x8 } __OSContRequesFormat; // size = 0x8
typedef struct { typedef struct __OSContRequesFormatShort {
/* 0x00 */ u8 txsize; /* 0x00 */ u8 txsize;
/* 0x01 */ u8 rxsize; /* 0x01 */ u8 rxsize;
/* 0x02 */ u8 cmd; /* 0x02 */ u8 cmd;
@ -174,7 +174,7 @@ typedef struct {
/* 0x05 */ u8 status; /* 0x05 */ u8 status;
} __OSContRequesFormatShort; // size = 0x6 } __OSContRequesFormatShort; // size = 0x6
typedef struct { typedef struct __OSContRamReadFormat {
/* 0x00 */ u8 unk_00; /* 0x00 */ u8 unk_00;
/* 0x01 */ u8 txsize; /* 0x01 */ u8 txsize;
/* 0x02 */ u8 rxsize; /* 0x02 */ u8 rxsize;
@ -187,7 +187,7 @@ typedef struct {
#define READFORMAT(ptr) ((__OSContRamReadFormat*)(ptr)) #define READFORMAT(ptr) ((__OSContRamReadFormat*)(ptr))
typedef struct { typedef struct __OSContReadFormat {
/* 0x00 */ u8 align; /* 0x00 */ u8 align;
/* 0x01 */ u8 txsize; /* 0x01 */ u8 txsize;
/* 0x02 */ u8 rxsize; /* 0x02 */ u8 rxsize;

View file

@ -1005,7 +1005,7 @@
/* /*
* Vertex (set up for use with colors) * Vertex (set up for use with colors)
*/ */
typedef struct { typedef struct Vtx_t {
short ob[3]; /* x, y, z */ short ob[3]; /* x, y, z */
unsigned short flag; unsigned short flag;
short tc[2]; /* texture coord */ short tc[2]; /* texture coord */
@ -1015,7 +1015,7 @@ typedef struct {
/* /*
* Vertex (set up for use with normals) * Vertex (set up for use with normals)
*/ */
typedef struct { typedef struct Vtx_tn {
short ob[3]; /* x, y, z */ short ob[3]; /* x, y, z */
unsigned short flag; unsigned short flag;
short tc[2]; /* texture coord */ short tc[2]; /* texture coord */
@ -1023,7 +1023,7 @@ typedef struct {
unsigned char a; /* alpha */ unsigned char a; /* alpha */
} Vtx_tn; } Vtx_tn;
typedef union { typedef union Vtx {
Vtx_t v; /* Use this one for colors */ Vtx_t v; /* Use this one for colors */
Vtx_tn n; /* Use this one for normals */ Vtx_tn n; /* Use this one for normals */
long long int force_structure_alignment; long long int force_structure_alignment;
@ -1033,7 +1033,7 @@ typedef union {
* Sprite structure * Sprite structure
*/ */
typedef struct { typedef struct uSprite_t {
void* SourceImagePointer; void* SourceImagePointer;
void* TlutPointer; void* TlutPointer;
short Stride; short Stride;
@ -1049,7 +1049,7 @@ typedef struct {
char dummy[4]; char dummy[4];
} uSprite_t; } uSprite_t;
typedef union { typedef union uSprite {
uSprite_t s; uSprite_t s;
/* Need to make sure this is 64 bit aligned */ /* Need to make sure this is 64 bit aligned */
@ -1059,7 +1059,7 @@ typedef union {
/* /*
* Triangle face * Triangle face
*/ */
typedef struct { typedef struct Tri {
unsigned char flag; unsigned char flag;
unsigned char v[3]; unsigned char v[3];
} Tri; } Tri;
@ -1070,7 +1070,7 @@ typedef struct {
* Last 8 words are the fraction portion of the 4x4 matrix * Last 8 words are the fraction portion of the 4x4 matrix
*/ */
typedef long int Mtx_t[4][4]; typedef long int Mtx_t[4][4];
typedef union { typedef union Mtx {
Mtx_t m; Mtx_t m;
struct { struct {
u16 intPart[4][4]; u16 intPart[4][4];
@ -1140,13 +1140,13 @@ typedef union {
* (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, G_MAXZ, 0, * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, G_MAXZ, 0,
* (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, 0, 0, * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, 0, 0,
*/ */
typedef struct { typedef struct Vp_t {
short vscale[4]; /* scale, 2 bits fraction */ short vscale[4]; /* scale, 2 bits fraction */
short vtrans[4]; /* translate, 2 bits fraction */ short vtrans[4]; /* translate, 2 bits fraction */
/* both the above arrays are padded to 64-bit boundary */ /* both the above arrays are padded to 64-bit boundary */
} Vp_t; } Vp_t;
typedef union { typedef union Vp {
Vp_t vp; Vp_t vp;
long long int force_structure_alignment; long long int force_structure_alignment;
} Vp; } Vp;
@ -1306,7 +1306,7 @@ typedef union {
* *
*/ */
typedef struct { typedef struct Light_t {
unsigned char col[3]; /* diffuse light value (rgba) */ unsigned char col[3]; /* diffuse light value (rgba) */
char pad1; char pad1;
unsigned char colc[3]; /* copy of diffuse light value (rgba) */ unsigned char colc[3]; /* copy of diffuse light value (rgba) */
@ -1316,7 +1316,7 @@ typedef struct {
} Light_t; } Light_t;
#ifdef F3DEX_GBI_PL #ifdef F3DEX_GBI_PL
typedef struct { typedef struct PointLight_t {
unsigned char col[3]; /* point light value (rgba) */ unsigned char col[3]; /* point light value (rgba) */
unsigned char kc; /* constant attenuation (> 0 indicates point light) */ unsigned char kc; /* constant attenuation (> 0 indicates point light) */
unsigned char colc[3]; /* copy of point light value (rgba) */ unsigned char colc[3]; /* copy of point light value (rgba) */
@ -1326,14 +1326,14 @@ typedef struct {
} PointLight_t; } PointLight_t;
#endif #endif
typedef struct { typedef struct Ambient_t {
unsigned char col[3]; /* ambient light value (rgba) */ unsigned char col[3]; /* ambient light value (rgba) */
char pad1; char pad1;
unsigned char colc[3]; /* copy of ambient light value (rgba) */ unsigned char colc[3]; /* copy of ambient light value (rgba) */
char pad2; char pad2;
} Ambient_t; } Ambient_t;
typedef struct { typedef struct Hilite_t {
/* texture offsets for highlight 1/2 */ /* texture offsets for highlight 1/2 */
int x1; int x1;
int y1; int y1;
@ -1341,7 +1341,7 @@ typedef struct {
int y2; int y2;
} Hilite_t; } Hilite_t;
typedef union { typedef union Light {
Light_t l; Light_t l;
#ifdef F3DEX_GBI_PL #ifdef F3DEX_GBI_PL
PointLight_t p; PointLight_t p;
@ -1349,61 +1349,61 @@ typedef union {
long long int force_structure_alignment[2]; long long int force_structure_alignment[2];
} Light; } Light;
typedef union { typedef union Ambient {
Ambient_t l; Ambient_t l;
long long int force_structure_alignment[1]; long long int force_structure_alignment[1];
} Ambient; } Ambient;
typedef struct { typedef struct Lightsn {
Ambient a; Ambient a;
Light l[7]; Light l[7];
} Lightsn; } Lightsn;
typedef struct { typedef struct Lights0 {
Ambient a; Ambient a;
Light l[1]; Light l[1];
} Lights0; } Lights0;
typedef struct { typedef struct Lights1 {
Ambient a; Ambient a;
Light l[1]; Light l[1];
} Lights1; } Lights1;
typedef struct { typedef struct Lights2 {
Ambient a; Ambient a;
Light l[2]; Light l[2];
} Lights2; } Lights2;
typedef struct { typedef struct Lights3 {
Ambient a; Ambient a;
Light l[3]; Light l[3];
} Lights3; } Lights3;
typedef struct { typedef struct Lights4 {
Ambient a; Ambient a;
Light l[4]; Light l[4];
} Lights4; } Lights4;
typedef struct { typedef struct Lights5 {
Ambient a; Ambient a;
Light l[5]; Light l[5];
} Lights5; } Lights5;
typedef struct { typedef struct Lights6 {
Ambient a; Ambient a;
Light l[6]; Light l[6];
} Lights6; } Lights6;
typedef struct { typedef struct Lights7 {
Ambient a; Ambient a;
Light l[7]; Light l[7];
} Lights7; } Lights7;
typedef struct { typedef struct LookAt {
Light l[2]; Light l[2];
} LookAt; } LookAt;
typedef union { typedef union Hilite {
Hilite_t h; Hilite_t h;
long int force_structure_alignment; long int force_structure_alignment;
} Hilite; } Hilite;
@ -1672,7 +1672,7 @@ typedef union {
}}, \ }}, \
}} }}
typedef struct { typedef struct Gnoop {
int cmd : 8; int cmd : 8;
unsigned int type : 8; unsigned int type : 8;
unsigned int len : 16; unsigned int len : 16;
@ -1690,7 +1690,7 @@ typedef struct {
/* /*
* Graphics DMA Packet * Graphics DMA Packet
*/ */
typedef struct { typedef struct Gdma {
int cmd : 8; int cmd : 8;
unsigned int par : 8; unsigned int par : 8;
unsigned int len : 16; unsigned int len : 16;
@ -1698,7 +1698,7 @@ typedef struct {
} Gdma; } Gdma;
#ifdef F3DEX_GBI_2 #ifdef F3DEX_GBI_2
typedef struct { typedef struct Gdma2 {
int cmd : 8; int cmd : 8;
unsigned int len : 8; unsigned int len : 8;
unsigned int ofs : 8; unsigned int ofs : 8;
@ -1711,7 +1711,7 @@ typedef struct {
* Graphics Moveword Packet * Graphics Moveword Packet
*/ */
// Inaccurate for F3DEX2, offset and index are swapped // Inaccurate for F3DEX2, offset and index are swapped
typedef struct { typedef struct Gmovewd {
int cmd : 8; int cmd : 8;
unsigned int offset : 16; unsigned int offset : 16;
unsigned int index : 8; unsigned int index : 8;
@ -1721,7 +1721,7 @@ typedef struct {
/* /*
* Graphics Movemem Packet * Graphics Movemem Packet
*/ */
typedef struct { typedef struct Gmovemem {
int cmd : 8; int cmd : 8;
unsigned int size : 8; unsigned int size : 8;
unsigned int offset : 8; unsigned int offset : 8;
@ -1732,24 +1732,24 @@ typedef struct {
/* /*
* Graphics Immediate Mode Packet types * Graphics Immediate Mode Packet types
*/ */
typedef struct { typedef struct Gtri {
int cmd : 8; int cmd : 8;
int pad : 24; int pad : 24;
Tri tri; Tri tri;
} Gtri; } Gtri;
#if (defined(F3DLP_GBI) || defined(F3DEX_GBI)) #if (defined(F3DLP_GBI) || defined(F3DEX_GBI))
typedef struct { typedef struct Gtri2 {
Tri tri1; /* flag is the command byte */ Tri tri1; /* flag is the command byte */
Tri tri2; Tri tri2;
} Gtri2; } Gtri2;
typedef struct { typedef struct Gquad {
Tri tri1; /* flag is the command byte */ Tri tri1; /* flag is the command byte */
Tri tri2; Tri tri2;
} Gquad; } Gquad;
typedef struct { typedef struct Gcull {
int cmd : 8; int cmd : 8;
unsigned int pad : 8; unsigned int pad : 8;
unsigned short vstart_x2; unsigned short vstart_x2;
@ -1758,14 +1758,14 @@ typedef struct {
} Gcull; } Gcull;
#endif #endif
typedef struct { typedef struct Gsetprimdepth {
int cmd : 8; int cmd : 8;
unsigned int pad : 24; unsigned int pad : 24;
unsigned short z; unsigned short z;
unsigned short dz; unsigned short dz;
} Gsetprimdepth; } Gsetprimdepth;
typedef struct { typedef struct Gpopmtx {
int cmd : 8; int cmd : 8;
int pad1 : 24; int pad1 : 24;
#ifdef F3DEX_GBI_2 #ifdef F3DEX_GBI_2
@ -1777,7 +1777,7 @@ typedef struct {
} Gpopmtx; } Gpopmtx;
/* /*
* typedef struct { * typedef struct Gsegment {
* int cmd:8; * int cmd:8;
* int pad0:24; * int pad0:24;
* int pad1:4; * int pad1:4;
@ -1785,7 +1785,7 @@ typedef struct {
* int base:24; * int base:24;
* } Gsegment; * } Gsegment;
*/ */
typedef struct { typedef struct Gsegment {
int cmd : 8; int cmd : 8;
int pad0 : 8; int pad0 : 8;
int mw_index : 8; int mw_index : 8;
@ -1794,7 +1794,7 @@ typedef struct {
int base : 24; int base : 24;
} Gsegment; } Gsegment;
typedef struct { typedef struct GsetothermodeL {
int cmd : 8; int cmd : 8;
int pad0 : 8; int pad0 : 8;
unsigned int sft : 8; unsigned int sft : 8;
@ -1802,7 +1802,7 @@ typedef struct {
unsigned int data : 32; unsigned int data : 32;
} GsetothermodeL; } GsetothermodeL;
typedef struct { typedef struct GsetothermodeH {
int cmd : 8; int cmd : 8;
int pad0 : 8; int pad0 : 8;
unsigned int sft : 8; unsigned int sft : 8;
@ -1810,7 +1810,7 @@ typedef struct {
unsigned int data : 32; unsigned int data : 32;
} GsetothermodeH; } GsetothermodeH;
typedef struct { typedef struct Gtexture {
unsigned char cmd; unsigned char cmd;
unsigned char lodscale; unsigned char lodscale;
#ifdef F3DEX_GBI_2 #ifdef F3DEX_GBI_2
@ -1825,7 +1825,7 @@ typedef struct {
unsigned short t; unsigned short t;
} Gtexture; } Gtexture;
typedef struct { typedef struct Gline3D {
int cmd : 8; int cmd : 8;
#ifdef F3DEX_GBI_2 #ifdef F3DEX_GBI_2
unsigned char v0; unsigned char v0;
@ -1838,7 +1838,7 @@ typedef struct {
#endif #endif
} Gline3D; } Gline3D;
typedef struct { typedef struct Gperspnorm {
int cmd : 8; int cmd : 8;
int pad1 : 24; int pad1 : 24;
short int pad2; short int pad2;
@ -1849,7 +1849,7 @@ typedef struct {
/* /*
* RDP Packet types * RDP Packet types
*/ */
typedef struct { typedef struct Gsetimg {
int cmd : 8; int cmd : 8;
unsigned int fmt : 3; unsigned int fmt : 3;
unsigned int siz : 2; unsigned int siz : 2;
@ -1858,7 +1858,7 @@ typedef struct {
unsigned int dram; /* to account for 1024 */ unsigned int dram; /* to account for 1024 */
} Gsetimg; } Gsetimg;
typedef struct { typedef struct Gsetcombine {
int cmd : 8; int cmd : 8;
// muxs0 // muxs0
unsigned int a0 : 4; unsigned int a0 : 4;
@ -1880,7 +1880,7 @@ typedef struct {
unsigned int Ad1 : 3; unsigned int Ad1 : 3;
} Gsetcombine; } Gsetcombine;
typedef struct { typedef struct Gsetcolor {
int cmd : 8; int cmd : 8;
unsigned char pad; unsigned char pad;
unsigned char prim_min_level; unsigned char prim_min_level;
@ -1896,7 +1896,7 @@ typedef struct {
}; };
} Gsetcolor; } Gsetcolor;
typedef struct { typedef struct Gfillrect {
int cmd : 8; int cmd : 8;
int x0 : 10; int x0 : 10;
int x0frac : 2; int x0frac : 2;
@ -1909,7 +1909,7 @@ typedef struct {
int y1frac : 2; int y1frac : 2;
} Gfillrect; } Gfillrect;
typedef struct { typedef struct Gsettile {
int cmd : 8; int cmd : 8;
unsigned int fmt : 3; unsigned int fmt : 3;
unsigned int siz : 2; unsigned int siz : 2;
@ -1929,7 +1929,7 @@ typedef struct {
unsigned int shifts : 4; unsigned int shifts : 4;
} Gsettile; } Gsettile;
typedef struct { typedef struct Gloadtile {
int cmd : 8; int cmd : 8;
unsigned int sl : 12; unsigned int sl : 12;
unsigned int tl : 12; unsigned int tl : 12;
@ -1945,7 +1945,7 @@ typedef Gloadtile Gsettilesize;
typedef Gloadtile Gloadtlut; typedef Gloadtile Gloadtlut;
typedef struct { typedef struct Gtexrect {
unsigned int cmd : 8; /* command */ unsigned int cmd : 8; /* command */
unsigned int xl : 12; /* X coordinate of upper left */ unsigned int xl : 12; /* X coordinate of upper left */
unsigned int yl : 12; /* Y coordinate of upper left */ unsigned int yl : 12; /* Y coordinate of upper left */
@ -1965,7 +1965,7 @@ typedef struct {
/* /*
* Textured rectangles are 128 bits not 64 bits * Textured rectangles are 128 bits not 64 bits
*/ */
typedef struct { typedef struct TexRect {
unsigned long w0; unsigned long w0;
unsigned long w1; unsigned long w1;
unsigned long w2; unsigned long w2;
@ -1973,7 +1973,7 @@ typedef struct {
} TexRect; } TexRect;
#ifdef F3DEX_GBI_2 #ifdef F3DEX_GBI_2
typedef struct { typedef struct Gvtx {
int cmd : 8; int cmd : 8;
unsigned int pad : 4; unsigned int pad : 4;
unsigned int len : 8; // n unsigned int len : 8; // n
@ -1988,7 +1988,7 @@ typedef Gdma Gvtx;
/* /*
* Generic Gfx Packet * Generic Gfx Packet
*/ */
typedef struct { typedef struct Gwords {
unsigned int w0; unsigned int w0;
unsigned int w1; unsigned int w1;
} Gwords; } Gwords;
@ -1997,7 +1997,7 @@ typedef struct {
* This union is the fundamental type of the display list. * This union is the fundamental type of the display list.
* It is, by law, exactly 64 bits in size. * It is, by law, exactly 64 bits in size.
*/ */
typedef union { typedef union Gfx {
Gwords words; Gwords words;
Gnoop noop; Gnoop noop;
Gdma dma; Gdma dma;

View file

@ -91,7 +91,7 @@ typedef struct {
} uObjScaleBg_t; /* 40 bytes */ } uObjScaleBg_t; /* 40 bytes */
typedef union { typedef union uObjBg {
uObjBg_t b; uObjBg_t b;
uObjScaleBg_t s; uObjScaleBg_t s;
long long int force_structure_alignment; long long int force_structure_alignment;
@ -103,7 +103,7 @@ typedef union {
#define G_OBJ_FLAG_FLIPS 1<<0 /* inversion to S-direction */ #define G_OBJ_FLAG_FLIPS 1<<0 /* inversion to S-direction */
#define G_OBJ_FLAG_FLIPT 1<<4 /* nversion to T-direction */ #define G_OBJ_FLAG_FLIPT 1<<4 /* nversion to T-direction */
typedef struct { typedef struct uObjSprite_t {
s16 objX; /* s10.2 OBJ x-coordinate of upper-left end */ s16 objX; /* s10.2 OBJ x-coordinate of upper-left end */
u16 scaleW; /* u5.10 Scaling of u5.10 width direction */ u16 scaleW; /* u5.10 Scaling of u5.10 width direction */
u16 imageW; /* u10.5 width of u10.5 texture (length of S-direction) */ u16 imageW; /* u10.5 width of u10.5 texture (length of S-direction) */
@ -120,7 +120,7 @@ typedef struct {
u8 imageFlags; /* The display flag - G_OBJ_FLAG_FLIP* */ u8 imageFlags; /* The display flag - G_OBJ_FLAG_FLIP* */
} uObjSprite_t; /* 24 bytes */ } uObjSprite_t; /* 24 bytes */
typedef union { typedef union uObjSprite {
uObjSprite_t s; uObjSprite_t s;
long long int force_structure_alignment; long long int force_structure_alignment;
} uObjSprite; } uObjSprite;
@ -128,25 +128,25 @@ typedef union {
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
* 2D Matrix * 2D Matrix
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
typedef struct { typedef struct uObjMtx_t {
s32 A, B, C, D; /* s15.16 */ s32 A, B, C, D; /* s15.16 */
s16 X, Y; /* s10.2 */ s16 X, Y; /* s10.2 */
u16 BaseScaleX; /* u5.10 */ u16 BaseScaleX; /* u5.10 */
u16 BaseScaleY; /* u5.10 */ u16 BaseScaleY; /* u5.10 */
} uObjMtx_t; /* 24 bytes */ } uObjMtx_t; /* 24 bytes */
typedef union { typedef union uObjMtx {
uObjMtx_t m; uObjMtx_t m;
long long int force_structure_alignment; long long int force_structure_alignment;
} uObjMtx; } uObjMtx;
typedef struct { typedef struct uObjSubMtx_t {
s16 X, Y; /* s10.2 */ s16 X, Y; /* s10.2 */
u16 BaseScaleX; /* u5.10 */ u16 BaseScaleX; /* u5.10 */
u16 BaseScaleY; /* u5.10 */ u16 BaseScaleY; /* u5.10 */
} uObjSubMtx_t; /* 8 bytes */ } uObjSubMtx_t; /* 8 bytes */
typedef union { typedef union uObjSubMtx {
uObjSubMtx_t m; uObjSubMtx_t m;
long long int force_structure_alignment; long long int force_structure_alignment;
} uObjSubMtx; } uObjSubMtx;
@ -200,7 +200,7 @@ typedef struct {
u32 mask; /* STATE mask */ u32 mask; /* STATE mask */
} uObjTxtrTLUT_t; /* 24 bytes */ } uObjTxtrTLUT_t; /* 24 bytes */
typedef union { typedef union uObjTxtr {
uObjTxtrBlock_t block; uObjTxtrBlock_t block;
uObjTxtrTile_t tile; uObjTxtrTile_t tile;
uObjTxtrTLUT_t tlut; uObjTxtrTLUT_t tlut;

View file

@ -7,7 +7,7 @@
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5)) #define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
typedef union { typedef union du {
struct { struct {
u32 hi; u32 hi;
u32 lo; u32 lo;
@ -16,7 +16,7 @@ typedef union {
f64 d; f64 d;
} du; } du;
typedef union { typedef union fu {
u32 i; u32 i;
f32 f; f32 f;
} fu; } fu;

View file

@ -3,7 +3,7 @@
#include "pi.h" #include "pi.h"
typedef struct { typedef struct OSDevMgr {
/* 0x00 */ u32 active; /* 0x00 */ u32 active;
/* 0x04 */ OSThread* thread; /* 0x04 */ OSThread* thread;
/* 0x08 */ OSMesgQueue* cmdQueue; /* 0x08 */ OSMesgQueue* cmdQueue;

View file

@ -69,7 +69,7 @@
#define PFS_INODE_DIST_MAP (PFS_BANK_LAPPED_BY * PFS_SECTOR_PER_BANK) #define PFS_INODE_DIST_MAP (PFS_BANK_LAPPED_BY * PFS_SECTOR_PER_BANK)
#define PFS_SECTOR_SIZE (PFS_INODE_SIZE_PER_PAGE/PFS_SECTOR_PER_BANK) #define PFS_SECTOR_SIZE (PFS_INODE_SIZE_PER_PAGE/PFS_SECTOR_PER_BANK)
typedef struct { typedef struct OSPfs {
/* 0x00 */ s32 status; /* 0x00 */ s32 status;
/* 0x04 */ OSMesgQueue* queue; /* 0x04 */ OSMesgQueue* queue;
/* 0x08 */ s32 channel; /* 0x08 */ s32 channel;
@ -85,7 +85,7 @@ typedef struct {
/* 0x65 */ u8 activebank; /* 0x65 */ u8 activebank;
} OSPfs; // size = 0x68 } OSPfs; // size = 0x68
typedef struct { typedef struct OSPfsState {
/* 0x00 */ u32 file_size; /* bytes */ /* 0x00 */ u32 file_size; /* bytes */
/* 0x04 */ u32 game_code; /* 0x04 */ u32 game_code;
/* 0x08 */ u16 company_code; /* 0x08 */ u16 company_code;
@ -93,7 +93,7 @@ typedef struct {
/* 0x10 */ char game_name[16]; /* 0x10 */ char game_name[16];
} OSPfsState; // size = 0x20 } OSPfsState; // size = 0x20
typedef union { typedef union __OSInodeUnit {
struct { struct {
/* 0x00 */ u8 bank; /* 0x00 */ u8 bank;
/* 0x01 */ u8 page; /* 0x01 */ u8 page;
@ -101,11 +101,11 @@ typedef union {
/* 0x00 */ u16 ipage; /* 0x00 */ u16 ipage;
} __OSInodeUnit; // size = 0x02 } __OSInodeUnit; // size = 0x02
typedef struct { typedef struct __OSInode {
/* 0x00 */ __OSInodeUnit inodePage[128]; /* 0x00 */ __OSInodeUnit inodePage[128];
} __OSInode; // size = 0x100 } __OSInode; // size = 0x100
typedef struct { typedef struct __OSDir {
/* 0x00 */ u32 game_code; /* 0x00 */ u32 game_code;
/* 0x04 */ u16 company_code; /* 0x04 */ u16 company_code;
/* 0x06 */ __OSInodeUnit start_page; /* 0x06 */ __OSInodeUnit start_page;
@ -116,7 +116,7 @@ typedef struct {
/* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN]; /* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN];
} __OSDir; // size = 0x20 } __OSDir; // size = 0x20
typedef struct { typedef struct __OSPackId {
/* 0x00 */ u32 repaired; /* 0x00 */ u32 repaired;
/* 0x04 */ u32 random; /* 0x04 */ u32 random;
/* 0x08 */ u64 serialMid; /* 0x08 */ u64 serialMid;
@ -128,7 +128,7 @@ typedef struct {
/* 0x1E */ u16 invertedChecksum; /* 0x1E */ u16 invertedChecksum;
} __OSPackId; // size = 0x20 } __OSPackId; // size = 0x20
typedef struct { typedef struct __OSInodeCache {
/* 0x000 */ __OSInode inode; /* 0x000 */ __OSInode inode;
/* 0x100 */ u8 bank; /* 0x100 */ u8 bank;
/* 0x101 */ u8 map[PFS_INODE_DIST_MAP]; /* 0x101 */ u8 map[PFS_INODE_DIST_MAP];

View file

@ -3,7 +3,7 @@
#include "message.h" #include "message.h"
typedef struct { typedef struct __OSBlockInfo {
/* 0x00 */ u32 errStatus; /* 0x00 */ u32 errStatus;
/* 0x04 */ void* dramAddr; /* 0x04 */ void* dramAddr;
/* 0x08 */ void* C2Addr; /* 0x08 */ void* C2Addr;
@ -12,7 +12,7 @@ typedef struct {
/* 0x14 */ u32 C1ErrSector[4]; /* 0x14 */ u32 C1ErrSector[4];
} __OSBlockInfo; // size = 0x24 } __OSBlockInfo; // size = 0x24
typedef struct { typedef struct __OSTranxInfo {
/* 0x00 */ u32 cmdType; /* 0x00 */ u32 cmdType;
/* 0x04 */ u16 transferMode; /* 0x04 */ u16 transferMode;
/* 0x06 */ u16 blockNum; /* 0x06 */ u16 blockNum;
@ -36,19 +36,19 @@ typedef struct OSPiHandle {
/* 0x14 */ __OSTranxInfo transferInfo; /* 0x14 */ __OSTranxInfo transferInfo;
} OSPiHandle; // size = 0x74 } OSPiHandle; // size = 0x74
typedef struct { typedef struct OSPiInfo {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
/* 0x04 */ u32 address; /* 0x04 */ u32 address;
} OSPiInfo; // size = 0x08 } OSPiInfo; // size = 0x08
typedef struct { typedef struct OSIoMesgHdr {
/* 0x00 */ u16 type; /* 0x00 */ u16 type;
/* 0x02 */ u8 pri; /* 0x02 */ u8 pri;
/* 0x03 */ u8 status; /* 0x03 */ u8 status;
/* 0x04 */ OSMesgQueue* retQueue; /* 0x04 */ OSMesgQueue* retQueue;
} OSIoMesgHdr; // size = 0x08 } OSIoMesgHdr; // size = 0x08
typedef struct { typedef struct OSIoMesg {
/* 0x00 */ OSIoMesgHdr hdr; /* 0x00 */ OSIoMesgHdr hdr;
/* 0x08 */ void* dramAddr; /* 0x08 */ void* dramAddr;
/* 0x0C */ u32 devAddr; /* 0x0C */ u32 devAddr;

View file

@ -71,7 +71,7 @@
#include "ultratypes.h" #include "ultratypes.h"
/* Structure for debug port */ /* Structure for debug port */
typedef struct { typedef struct rdbPacket {
u32 type : 6; /* 0: invalid, 1: print, 2: debug */ u32 type : 6; /* 0: invalid, 1: print, 2: debug */
u32 length : 2; /* 1, 2, or 3 */ u32 length : 2; /* 1, 2, or 3 */
char buf[3]; /* character buffer */ char buf[3]; /* character buffer */

View file

@ -28,7 +28,7 @@
#define OS_YIELD_DATA_SIZE 0xC00 #define OS_YIELD_DATA_SIZE 0xC00
typedef struct { typedef struct OSTask_t {
/* 0x00 */ u32 type; /* 0x00 */ u32 type;
/* 0x04 */ u32 flags; /* 0x04 */ u32 flags;
@ -54,7 +54,7 @@ typedef struct {
/* 0x3C */ u32 yield_data_size; /* 0x3C */ u32 yield_data_size;
} OSTask_t; // size = 0x40 } OSTask_t; // size = 0x40
typedef union { typedef union OSTask {
OSTask_t t; OSTask_t t;
long long int force_structure_alignment; long long int force_structure_alignment;
} OSTask; } OSTask;

View file

@ -27,7 +27,7 @@
typedef s32 OSPri; typedef s32 OSPri;
typedef s32 OSId; typedef s32 OSId;
typedef union { typedef union __OSfp {
struct { struct {
/* 0x00 */ f32 f_odd; /* 0x00 */ f32 f_odd;
/* 0x04 */ f32 f_even; /* 0x04 */ f32 f_even;
@ -35,7 +35,7 @@ typedef union {
f64 d; f64 d;
} __OSfp; // size = 0x08 } __OSfp; // size = 0x08
typedef struct { typedef struct __OSThreadContext {
/* 0x000 */ u64 at, v0, v1, a0, a1, a2, a3; /* 0x000 */ u64 at, v0, v1, a0, a1, a2, a3;
/* 0x038 */ u64 t0, t1, t2, t3, t4, t5, t6, t7; /* 0x038 */ u64 t0, t1, t2, t3, t4, t5, t6, t7;
/* 0x078 */ u64 s0, s1, s2, s3, s4, s5, s6, s7; /* 0x078 */ u64 s0, s1, s2, s3, s4, s5, s6, s7;
@ -47,7 +47,7 @@ typedef struct {
/* 0x150 */ __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30; /* 0x150 */ __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30;
} __OSThreadContext; // size = 0x190 } __OSThreadContext; // size = 0x190
typedef struct { typedef struct __OSThreadprofile {
/* 0x00 */ u32 flag; /* 0x00 */ u32 flag;
/* 0x04 */ u32 count; /* 0x04 */ u32 count;
/* 0x08 */ u64 time; /* 0x08 */ u64 time;
@ -66,7 +66,7 @@ typedef struct OSThread {
/* 0x20 */ __OSThreadContext context; /* 0x20 */ __OSThreadContext context;
} OSThread; // size = 0x1B0 } OSThread; // size = 0x1B0
typedef struct { typedef struct __OSThreadTail {
OSThread* next; OSThread* next;
OSPri priority; OSPri priority;
} __OSThreadTail; // size = 0x8 } __OSThreadTail; // size = 0x8

View file

@ -26,7 +26,7 @@ typedef double f64;
typedef float MtxF_t[4][4]; typedef float MtxF_t[4][4];
typedef union { typedef union MtxF {
MtxF_t mf; MtxF_t mf;
struct { struct {
// Note: The order displayed here is the transpose of the order in which matrices are typically written. // Note: The order displayed here is the transpose of the order in which matrices are typically written.

View file

@ -13,7 +13,7 @@
#define OS_VI_DITHER_FILTER_ON 0x0040 #define OS_VI_DITHER_FILTER_ON 0x0040
#define OS_VI_DITHER_FILTER_OFF 0x0080 #define OS_VI_DITHER_FILTER_OFF 0x0080
typedef struct { typedef struct OSViCommonRegs {
/* 0x00 */ u32 ctrl; /* 0x00 */ u32 ctrl;
/* 0x04 */ u32 width; /* 0x04 */ u32 width;
/* 0x08 */ u32 burst; /* 0x08 */ u32 burst;
@ -25,7 +25,7 @@ typedef struct {
/* 0x20 */ u32 vCurrent; /* 0x20 */ u32 vCurrent;
} OSViCommonRegs; // size = 0x20 } OSViCommonRegs; // size = 0x20
typedef struct { typedef struct OSViFieldRegs {
/* 0x00 */ u32 origin; /* 0x00 */ u32 origin;
/* 0x04 */ u32 yScale; /* 0x04 */ u32 yScale;
/* 0x08 */ u32 vStart; /* 0x08 */ u32 vStart;
@ -33,19 +33,19 @@ typedef struct {
/* 0x10 */ u32 vIntr; /* 0x10 */ u32 vIntr;
} OSViFieldRegs; // size = 0x14 } OSViFieldRegs; // size = 0x14
typedef struct { typedef struct OSViMode {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
/* 0x04 */ OSViCommonRegs comRegs; /* 0x04 */ OSViCommonRegs comRegs;
/* 0x24 */ OSViFieldRegs fldRegs[2]; /* 0x24 */ OSViFieldRegs fldRegs[2];
} OSViMode; // size = 0x4C } OSViMode; // size = 0x4C
typedef struct { typedef struct __OSViScale {
/* 0x0 */ f32 factor; /* 0x0 */ f32 factor;
/* 0x4 */ u16 offset; /* 0x4 */ u16 offset;
/* 0x8 */ u32 scale; /* 0x8 */ u32 scale;
} __OSViScale; // size = 0x0C } __OSViScale; // size = 0x0C
typedef struct { typedef struct OSViContext {
/* 0x00 */ u16 state; /* 0x00 */ u16 state;
/* 0x02 */ u16 retraceCount; /* 0x02 */ u16 retraceCount;
/* 0x04 */ void* framep; /* 0x04 */ void* framep;

View file

@ -10,7 +10,7 @@
#define LONG_DOUBLE_TYPE long double #define LONG_DOUBLE_TYPE long double
#endif #endif
typedef struct { typedef struct _Pft {
/* 0x00 */ union { /* 0x00 */ union {
long long ll; long long ll;
LONG_DOUBLE_TYPE ld; LONG_DOUBLE_TYPE ld;

View file

@ -9,6 +9,7 @@ extern Mtx D_01000000;
extern u32 osTvType; extern u32 osTvType;
extern u32 osRomBase; extern u32 osRomBase;
extern u32 osResetType; extern u32 osResetType;
extern u32 osCicId;
extern u32 osMemSize; extern u32 osMemSize;
extern u8 osAppNMIBuffer[0x40]; extern u8 osAppNMIBuffer[0x40];
@ -170,7 +171,7 @@ extern s16 gOcarinaSongItemMap[];
extern u8 gSoundFontTable[]; extern u8 gSoundFontTable[];
extern u8 gSequenceFontTable[]; extern u8 gSequenceFontTable[];
extern u8 gSequenceTable[]; extern u8 gSequenceTable[];
extern u8 gSampleBankTable[]; extern AudioTable gSampleBankTable;
extern SaveContext gSaveContext; extern SaveContext gSaveContext;

15
include/versions.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef VERSIONS_H
#define VERSIONS_H
// OOT versions in build order
#define OOT_NTSC_1_2 1
#define OOT_GC_JP 2
#define OOT_GC_JP_MQ 3
#define OOT_GC_US 4
#define OOT_GC_US_MQ 5
#define OOT_GC_EU_MQ_DBG 6
#define OOT_GC_EU 7
#define OOT_GC_EU_MQ 8
#define OOT_GC_JP_CE 9
#endif

View file

@ -99,7 +99,7 @@
#define STACK_TOP(stack) \ #define STACK_TOP(stack) \
((u8*)(stack) + sizeof(stack)) ((u8*)(stack) + sizeof(stack))
typedef struct { typedef struct KaleidoMgrOverlay {
/* 0x00 */ void* loadedRamAddr; /* 0x00 */ void* loadedRamAddr;
/* 0x04 */ RomFile file; /* 0x04 */ RomFile file;
/* 0x0C */ void* vramStart; /* 0x0C */ void* vramStart;
@ -108,22 +108,22 @@ typedef struct {
/* 0x18 */ const char* name; /* 0x18 */ const char* name;
} KaleidoMgrOverlay; // size = 0x1C } KaleidoMgrOverlay; // size = 0x1C
typedef enum { typedef enum KaleidoOverlayType {
/* 0 */ KALEIDO_OVL_KALEIDO_SCOPE, /* 0 */ KALEIDO_OVL_KALEIDO_SCOPE,
/* 1 */ KALEIDO_OVL_PLAYER_ACTOR, /* 1 */ KALEIDO_OVL_PLAYER_ACTOR,
/* 2 */ KALEIDO_OVL_MAX /* 2 */ KALEIDO_OVL_MAX
} KaleidoOverlayType; } KaleidoOverlayType;
typedef enum { typedef enum LensMode {
/* 0 */ LENS_MODE_SHOW_ACTORS, // lens actors are invisible by default, and shown by using lens (for example, invisible enemies) /* 0 */ LENS_MODE_SHOW_ACTORS, // lens actors are invisible by default, and shown by using lens (for example, invisible enemies)
/* 1 */ LENS_MODE_HIDE_ACTORS // lens actors are visible by default, and hidden by using lens (for example, fake walls) /* 1 */ LENS_MODE_HIDE_ACTORS // lens actors are visible by default, and hidden by using lens (for example, fake walls)
} LensMode; } LensMode;
typedef struct { typedef struct SetupState {
/* 0x00 */ GameState state; /* 0x00 */ GameState state;
} SetupState; // size = 0xA4 } SetupState; // size = 0xA4
typedef struct { typedef struct ConsoleLogoState {
/* 0x0000 */ GameState state; /* 0x0000 */ GameState state;
/* 0x00A4 */ u8* staticSegment; /* 0x00A4 */ u8* staticSegment;
/* 0x00A8 */ View view; /* 0x00A8 */ View view;
@ -141,7 +141,7 @@ typedef struct {
struct MapSelectState; struct MapSelectState;
typedef struct { typedef struct SceneSelectEntry {
/* 0x00 */ char* name; /* 0x00 */ char* name;
/* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32); /* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32);
/* 0x08 */ s32 entranceIndex; /* 0x08 */ s32 entranceIndex;
@ -169,7 +169,7 @@ typedef struct MapSelectState {
/* 0x0238 */ u8* staticSegment; /* 0x0238 */ u8* staticSegment;
} MapSelectState; // size = 0x240 } MapSelectState; // size = 0x240
typedef struct { typedef struct SampleState {
/* 0x0000 */ GameState state; /* 0x0000 */ GameState state;
/* 0x00A4 */ u8* staticSegment; /* 0x00A4 */ u8* staticSegment;
/* 0x00A8 */ View view; /* 0x00A8 */ View view;
@ -182,7 +182,7 @@ typedef struct QuestHintCmd {
/* 0x03 */ u8 byte3; /* 0x03 */ u8 byte3;
} QuestHintCmd; // size = 0x4 } QuestHintCmd; // size = 0x4
typedef enum { typedef enum PauseBgPreRenderState {
/* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing. /* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing.
/* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background. /* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background.
/* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters. /* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters.
@ -190,19 +190,19 @@ typedef enum {
/* 4 */ PAUSE_BG_PRERENDER_MAX /* 4 */ PAUSE_BG_PRERENDER_MAX
} PauseBgPreRenderState; } PauseBgPreRenderState;
typedef enum { typedef enum TransitionTileState {
/* 0 */ TRANS_TILE_OFF, // Inactive, do nothing /* 0 */ TRANS_TILE_OFF, // Inactive, do nothing
/* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers /* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers
/* 2 */ TRANS_TILE_PROCESS, // Initialize the transition /* 2 */ TRANS_TILE_PROCESS, // Initialize the transition
/* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame /* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame
} TransitionTileState; } TransitionTileState;
typedef struct { typedef struct TitleSetupState {
/* 0x0000 */ GameState state; /* 0x0000 */ GameState state;
/* 0x00A8 */ View view; /* 0x00A8 */ View view;
} TitleSetupState; // size = 0x1D0 } TitleSetupState; // size = 0x1D0
typedef struct { typedef struct FileSelectState {
/* 0x00000 */ GameState state; /* 0x00000 */ GameState state;
/* 0x000A4 */ Vtx* windowVtx; /* 0x000A4 */ Vtx* windowVtx;
/* 0x000A8 */ u8* staticSegment; /* 0x000A8 */ u8* staticSegment;
@ -299,13 +299,13 @@ typedef struct {
(((field) >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT) \ (((field) >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT) \
& (ENTRANCE_INFO_START_TRANS_TYPE_MASK >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT)) & (ENTRANCE_INFO_START_TRANS_TYPE_MASK >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT))
typedef struct { typedef struct EntranceInfo {
/* 0x00 */ s8 sceneId; /* 0x00 */ s8 sceneId;
/* 0x01 */ s8 spawn; /* 0x01 */ s8 spawn;
/* 0x02 */ u16 field; /* 0x02 */ u16 field;
} EntranceInfo; // size = 0x4 } EntranceInfo; // size = 0x4
typedef struct { typedef struct GameStateOverlay {
/* 0x00 */ void* loadedRamAddr; /* 0x00 */ void* loadedRamAddr;
/* 0x04 */ RomFile file; // if applicable /* 0x04 */ RomFile file; // if applicable
/* 0x0C */ void* vramStart; // if applicable /* 0x0C */ void* vramStart; // if applicable
@ -319,13 +319,13 @@ typedef struct {
/* 0x2C */ u32 instanceSize; /* 0x2C */ u32 instanceSize;
} GameStateOverlay; // size = 0x30 } GameStateOverlay; // size = 0x30
typedef struct { typedef struct PreNMIState {
/* 0x00 */ GameState state; /* 0x00 */ GameState state;
/* 0xA4 */ u32 timer; /* 0xA4 */ u32 timer;
/* 0xA8 */ UNK_TYPE4 unk_A8; /* 0xA8 */ UNK_TYPE4 unk_A8;
} PreNMIState; // size = 0xAC } PreNMIState; // size = 0xAC
typedef enum { typedef enum FloorID {
/* 1 */ F_8F = 1, /* 1 */ F_8F = 1,
/* 2 */ F_7F, /* 2 */ F_7F,
/* 3 */ F_6F, /* 3 */ F_6F,
@ -347,7 +347,7 @@ typedef enum {
// All arrays pointed in this struct are indexed by "map indices" // All arrays pointed in this struct are indexed by "map indices"
// In dungeons, the map index corresponds to the dungeon index (which also indexes keys, items, etc) // In dungeons, the map index corresponds to the dungeon index (which also indexes keys, items, etc)
// In overworld areas, the map index corresponds to the overworld area index (spot 00, 01, etc) // In overworld areas, the map index corresponds to the overworld area index (spot 00, 01, etc)
typedef struct { typedef struct MapData {
/* 0x00 */ s16 (*floorTexIndexOffset)[8]; // dungeon texture index offset by floor /* 0x00 */ s16 (*floorTexIndexOffset)[8]; // dungeon texture index offset by floor
/* 0x04 */ s16* bossFloor; // floor the boss is on /* 0x04 */ s16* bossFloor; // floor the boss is on
/* 0x08 */ s16 (*roomPalette)[32]; // map palette by room /* 0x08 */ s16 (*roomPalette)[32]; // map palette by room
@ -396,7 +396,7 @@ typedef struct DebugDispObject {
/* 0x28 */ struct DebugDispObject* next; /* 0x28 */ struct DebugDispObject* next;
} DebugDispObject; // size = 0x2C } DebugDispObject; // size = 0x2C
typedef enum { typedef enum MatrixMode {
/* 0 */ MTXMODE_NEW, // generates a new matrix /* 0 */ MTXMODE_NEW, // generates a new matrix
/* 1 */ MTXMODE_APPLY // applies transformation to the current matrix /* 1 */ MTXMODE_APPLY // applies transformation to the current matrix
} MatrixMode; } MatrixMode;
@ -411,13 +411,13 @@ typedef struct StackEntry {
/* 0x18 */ const char* name; /* 0x18 */ const char* name;
} StackEntry; } StackEntry;
typedef enum { typedef enum StackStatus {
/* 0 */ STACK_STATUS_OK, /* 0 */ STACK_STATUS_OK,
/* 1 */ STACK_STATUS_WARNING, /* 1 */ STACK_STATUS_WARNING,
/* 2 */ STACK_STATUS_OVERFLOW /* 2 */ STACK_STATUS_OVERFLOW
} StackStatus; } StackStatus;
typedef struct { typedef struct ISVDbg {
/* 0x00 */ u32 magic; // IS64 /* 0x00 */ u32 magic; // IS64
/* 0x04 */ u32 get; /* 0x04 */ u32 get;
/* 0x08 */ u8 unk_08[0x14-0x08]; /* 0x08 */ u8 unk_08[0x14-0x08];
@ -426,7 +426,7 @@ typedef struct {
/* 0x20 */ u8 data[0x10000-0x20]; /* 0x20 */ u8 data[0x10000-0x20];
} ISVDbg; } ISVDbg;
typedef struct { typedef struct LocaleCartInfo {
/* 0x00 */ char name[0x18]; /* 0x00 */ char name[0x18];
/* 0x18 */ u32 mediaFormat; /* 0x18 */ u32 mediaFormat;
/* 0x1C */ union { /* 0x1C */ union {
@ -439,7 +439,7 @@ typedef struct {
}; };
} LocaleCartInfo; // size = 0x20 } LocaleCartInfo; // size = 0x20
typedef struct { typedef struct Yaz0Header {
/* 0x00 */ char magic[4]; // Yaz0 /* 0x00 */ char magic[4]; // Yaz0
/* 0x04 */ u32 decSize; /* 0x04 */ u32 decSize;
/* 0x08 */ u32 compInfoOffset; // only used in mio0 /* 0x08 */ u32 compInfoOffset; // only used in mio0
@ -486,7 +486,7 @@ typedef struct ArenaNode {
#define R_MIPS_LO16 6 #define R_MIPS_LO16 6
/* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */ /* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */
typedef enum { typedef enum RelocSectionId {
/* 0 */ RELOC_SECTION_NULL, /* 0 */ RELOC_SECTION_NULL,
/* 1 */ RELOC_SECTION_TEXT, /* 1 */ RELOC_SECTION_TEXT,
/* 2 */ RELOC_SECTION_DATA, /* 2 */ RELOC_SECTION_DATA,
@ -508,21 +508,21 @@ typedef struct OverlayRelocationSection {
// where 64-bit load/store instructions are emulated with 2x 32-bit load/store instructions. The alignment attribute // where 64-bit load/store instructions are emulated with 2x 32-bit load/store instructions. The alignment attribute
// conveys that this structure will not always be 8-bytes aligned, allowing a modern compiler to generate non-crashing // conveys that this structure will not always be 8-bytes aligned, allowing a modern compiler to generate non-crashing
// code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code. // code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code.
ALIGNED(4) typedef struct { ALIGNED(4) typedef struct PreNmiBuff {
/* 0x00 */ u32 resetting; /* 0x00 */ u32 resetting;
/* 0x04 */ u32 resetCount; /* 0x04 */ u32 resetCount;
/* 0x08 */ OSTime duration; /* 0x08 */ OSTime duration;
/* 0x10 */ OSTime resetTime; /* 0x10 */ OSTime resetTime;
} PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused) } PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused)
typedef enum { typedef enum ViModeEditState {
/* 0 */ VI_MODE_EDIT_STATE_INACTIVE, /* 0 */ VI_MODE_EDIT_STATE_INACTIVE,
/* 1 */ VI_MODE_EDIT_STATE_ACTIVE, /* 1 */ VI_MODE_EDIT_STATE_ACTIVE,
/* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments /* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments
/* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode /* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode
} ViModeEditState; } ViModeEditState;
typedef struct { typedef struct ViMode {
/* 0x00 */ OSViMode customViMode; /* 0x00 */ OSViMode customViMode;
/* 0x50 */ s32 viHeight; /* 0x50 */ s32 viHeight;
/* 0x54 */ s32 viWidth; /* 0x54 */ s32 viWidth;

View file

@ -24,7 +24,7 @@ typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*); typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*); typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
typedef struct { typedef struct ActorProfile {
/* 0x00 */ s16 id; /* 0x00 */ s16 id;
/* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw /* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
/* 0x04 */ u32 flags; /* 0x04 */ u32 flags;
@ -85,7 +85,7 @@ typedef struct {
*/ */
#define ACTOROVL_ALLOC_PERSISTENT (1 << 1) #define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
typedef struct { typedef struct ActorOverlay {
/* 0x00 */ RomFile file; /* 0x00 */ RomFile file;
/* 0x08 */ void* vramStart; /* 0x08 */ void* vramStart;
/* 0x0C */ void* vramEnd; /* 0x0C */ void* vramEnd;
@ -96,18 +96,18 @@ typedef struct {
/* 0x1E */ s8 numLoaded; // original name: "clients" /* 0x1E */ s8 numLoaded; // original name: "clients"
} ActorOverlay; // size = 0x20 } ActorOverlay; // size = 0x20
typedef struct { typedef struct DamageTable {
u8 table[32]; u8 table[32];
} DamageTable; } DamageTable;
typedef struct { typedef struct CollisionCheckInfoInit {
/* 0x00 */ u8 health; /* 0x00 */ u8 health;
/* 0x02 */ s16 cylRadius; /* 0x02 */ s16 cylRadius;
/* 0x04 */ s16 cylHeight; /* 0x04 */ s16 cylHeight;
/* 0x06 */ u8 mass; /* 0x06 */ u8 mass;
} CollisionCheckInfoInit; } CollisionCheckInfoInit;
typedef struct { typedef struct CollisionCheckInfoInit2 {
/* 0x00 */ u8 health; /* 0x00 */ u8 health;
/* 0x02 */ s16 cylRadius; /* 0x02 */ s16 cylRadius;
/* 0x04 */ s16 cylHeight; /* 0x04 */ s16 cylHeight;
@ -115,7 +115,7 @@ typedef struct {
/* 0x08 */ u8 mass; /* 0x08 */ u8 mass;
} CollisionCheckInfoInit2; } CollisionCheckInfoInit2;
typedef struct { typedef struct CollisionCheckInfo {
/* 0x00 */ DamageTable* damageTable; /* 0x00 */ DamageTable* damageTable;
/* 0x04 */ Vec3f displacement; // Amount to correct actor velocity by when colliding into a body /* 0x04 */ Vec3f displacement; // Amount to correct actor velocity by when colliding into a body
/* 0x10 */ s16 cylRadius; // Used for various purposes /* 0x10 */ s16 cylRadius; // Used for various purposes
@ -129,7 +129,7 @@ typedef struct {
/* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT
} CollisionCheckInfo; // size = 0x1C } CollisionCheckInfo; // size = 0x1C
typedef struct { typedef struct ActorShape {
/* 0x00 */ Vec3s rot; // Current actor shape rotation /* 0x00 */ Vec3s rot; // Current actor shape rotation
/* 0x06 */ s16 face; // Used to index eyes and mouth textures. Only used by player /* 0x06 */ s16 face; // Used to index eyes and mouth textures. Only used by player
/* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units /* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units
@ -310,7 +310,7 @@ typedef struct Actor {
#endif #endif
} Actor; // size = 0x14C } Actor; // size = 0x14C
typedef enum { typedef enum ActorFootIndex {
/* 0 */ FOOT_LEFT, /* 0 */ FOOT_LEFT,
/* 1 */ FOOT_RIGHT /* 1 */ FOOT_RIGHT
} ActorFootIndex; } ActorFootIndex;
@ -344,7 +344,7 @@ typedef struct DynaPolyActor {
/* 0x162 */ s16 unk_162; /* 0x162 */ s16 unk_162;
} DynaPolyActor; // size = 0x164 } DynaPolyActor; // size = 0x164
typedef struct { typedef struct BodyBreak {
/* 0x00 */ MtxF* matrices; /* 0x00 */ MtxF* matrices;
/* 0x04 */ s16* objectSlots; /* 0x04 */ s16* objectSlots;
/* 0x08 */ s16 count; /* 0x08 */ s16 count;
@ -357,7 +357,7 @@ typedef struct {
#define BODYBREAK_STATUS_READY -1 #define BODYBREAK_STATUS_READY -1
#define BODYBREAK_STATUS_FINISHED 0 #define BODYBREAK_STATUS_FINISHED 0
typedef enum { typedef enum Item00Type {
/* 0x00 */ ITEM00_RUPEE_GREEN, /* 0x00 */ ITEM00_RUPEE_GREEN,
/* 0x01 */ ITEM00_RUPEE_BLUE, /* 0x01 */ ITEM00_RUPEE_BLUE,
/* 0x02 */ ITEM00_RUPEE_RED, /* 0x02 */ ITEM00_RUPEE_RED,
@ -406,7 +406,7 @@ typedef struct EnItem00 {
} EnItem00; // size = 0x1AC } EnItem00; // size = 0x1AC
// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files. // Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
typedef enum { typedef enum AObjType {
/* 0x00 */ A_OBJ_BLOCK_SMALL, /* 0x00 */ A_OBJ_BLOCK_SMALL,
/* 0x01 */ A_OBJ_BLOCK_LARGE, /* 0x01 */ A_OBJ_BLOCK_LARGE,
/* 0x02 */ A_OBJ_BLOCK_HUGE, /* 0x02 */ A_OBJ_BLOCK_HUGE,
@ -439,7 +439,7 @@ typedef struct EnAObj {
/* 0x17C */ ColliderCylinder collider; /* 0x17C */ ColliderCylinder collider;
} EnAObj; // size = 0x1C8 } EnAObj; // size = 0x1C8
typedef enum { typedef enum ActorCategory {
/* 0x00 */ ACTORCAT_SWITCH, /* 0x00 */ ACTORCAT_SWITCH,
/* 0x01 */ ACTORCAT_BG, /* 0x01 */ ACTORCAT_BG,
/* 0x02 */ ACTORCAT_PLAYER, /* 0x02 */ ACTORCAT_PLAYER,
@ -459,7 +459,7 @@ typedef enum {
#define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum, #define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum,
#define DEFINE_ACTOR_UNSET(enum) enum, #define DEFINE_ACTOR_UNSET(enum) enum,
typedef enum { typedef enum ActorID {
#include "tables/actor_table.h" #include "tables/actor_table.h"
/* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX" /* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX"
} ActorID; } ActorID;
@ -468,13 +468,13 @@ typedef enum {
#undef DEFINE_ACTOR_INTERNAL #undef DEFINE_ACTOR_INTERNAL
#undef DEFINE_ACTOR_UNSET #undef DEFINE_ACTOR_UNSET
typedef enum { typedef enum DoorLockType {
DOORLOCK_NORMAL, DOORLOCK_NORMAL,
DOORLOCK_BOSS, DOORLOCK_BOSS,
DOORLOCK_NORMAL_SPIRIT DOORLOCK_NORMAL_SPIRIT
} DoorLockType; } DoorLockType;
typedef enum { typedef enum NaviEnemy {
/* 0x00 */ NAVI_ENEMY_DEFAULT, /* 0x00 */ NAVI_ENEMY_DEFAULT,
/* 0x01 */ NAVI_ENEMY_GOHMA, /* 0x01 */ NAVI_ENEMY_GOHMA,
/* 0x02 */ NAVI_ENEMY_GOHMA_EGG, /* 0x02 */ NAVI_ENEMY_GOHMA_EGG,
@ -641,9 +641,6 @@ typedef struct ActorContext {
/* 0x13C */ void* absoluteSpace; // Space used to allocate actor overlays with alloc type ACTOROVL_ALLOC_ABSOLUTE /* 0x13C */ void* absoluteSpace; // Space used to allocate actor overlays with alloc type ACTOROVL_ALLOC_ABSOLUTE
} ActorContext; // size = 0x140 } ActorContext; // size = 0x140
#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10
#define GET_TRANSITION_ACTOR_INDEX(actor) ((u16)(actor)->params >> TRANSITION_ACTOR_PARAMS_INDEX_SHIFT)
// EnDoor and DoorKiller share openAnim and playerIsOpening // EnDoor and DoorKiller share openAnim and playerIsOpening
// Due to alignment, a substruct cannot be used in the structs of these actors. // Due to alignment, a substruct cannot be used in the structs of these actors.
#define DOOR_ACTOR_BASE \ #define DOOR_ACTOR_BASE \
@ -666,7 +663,7 @@ typedef struct SlidingDoorActorBase {
/* 0x0000 */ SLIDING_DOOR_ACTOR_BASE; /* 0x0000 */ SLIDING_DOOR_ACTOR_BASE;
} SlidingDoorActorBase; } SlidingDoorActorBase;
typedef enum { typedef enum DoorOpenAnim {
/* 0x00 */ DOOR_OPEN_ANIM_ADULT_L, /* 0x00 */ DOOR_OPEN_ANIM_ADULT_L,
/* 0x01 */ DOOR_OPEN_ANIM_CHILD_L, /* 0x01 */ DOOR_OPEN_ANIM_CHILD_L,
/* 0x02 */ DOOR_OPEN_ANIM_ADULT_R, /* 0x02 */ DOOR_OPEN_ANIM_ADULT_R,
@ -683,14 +680,14 @@ typedef enum {
#define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples #define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples
#define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check? #define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check?
typedef enum { typedef enum NpcTalkState {
/* 0x0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player /* 0x0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player
/* 0x1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player /* 0x1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player
/* 0x2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation /* 0x2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation
/* 0x3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done /* 0x3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done
} NpcTalkState; } NpcTalkState;
typedef enum { typedef enum NpcTrackingMode {
/* 0x0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn /* 0x0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn
/* 0x1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player) /* 0x1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player)
/* 0x2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso /* 0x2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso
@ -698,7 +695,7 @@ typedef enum {
/* 0x4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head /* 0x4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head
} NpcTrackingMode; } NpcTrackingMode;
typedef struct { typedef struct NpcInteractInfo {
/* 0x00 */ s16 talkState; /* 0x00 */ s16 talkState;
/* 0x02 */ s16 trackingMode; /* 0x02 */ s16 trackingMode;
/* 0x04 */ s16 autoTurnTimer; /* 0x04 */ s16 autoTurnTimer;
@ -710,4 +707,33 @@ typedef struct {
/* 0x24 */ char unk_24[0x4]; /* 0x24 */ char unk_24[0x4];
} NpcInteractInfo; // size = 0x28 } NpcInteractInfo; // size = 0x28
// Converts a number of bits to a bitmask, helper for params macros
// e.g. 3 becomes 0b111 (7)
#define NBITS_TO_MASK(n) \
((1 << (n)) - 1)
// Extracts the `n`-bit value at position `s` in `p`, shifts then masks
// Unsigned variant, no possibility of sign extension
#define PARAMS_GET_U(p, s, n) \
(((p) >> (s)) & NBITS_TO_MASK(n))
// Extracts the `n`-bit value at position `s` in `p`, masks then shifts
// Signed variant, possibility of sign extension
#define PARAMS_GET_S(p, s, n) \
(((p) & (NBITS_TO_MASK(n) << (s))) >> (s))
// Extracts all bits past position `s` in `p`
#define PARAMS_GET_NOMASK(p, s) \
((p) >> (s))
// Extracts the `n`-bit value at position `s` in `p` without shifting it from its current position
#define PARAMS_GET_NOSHIFT(p, s, n) \
((p) & (NBITS_TO_MASK(n) << (s)))
// Generates a bitmask for bit position `s` of length `n`
#define PARAMS_MAKE_MASK(s, n) PARAMS_GET_NOSHIFT(~0, s, n)
#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10
#define GET_TRANSITION_ACTOR_INDEX(actor) PARAMS_GET_NOMASK((u16)(actor)->params, 10)
#endif #endif

View file

@ -16,14 +16,14 @@ struct SkelAnime;
#define LIMB_DONE 0xFF #define LIMB_DONE 0xFF
typedef struct { typedef struct StandardLimb {
/* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent
/* 0x06 */ u8 child; /* 0x06 */ u8 child;
/* 0x07 */ u8 sibling; /* 0x07 */ u8 sibling;
/* 0x08 */ Gfx* dList; /* 0x08 */ Gfx* dList;
} StandardLimb; // size = 0xC } StandardLimb; // size = 0xC
typedef struct { typedef struct LodLimb {
/* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent
/* 0x06 */ u8 child; /* 0x06 */ u8 child;
/* 0x07 */ u8 sibling; /* 0x07 */ u8 sibling;
@ -31,13 +31,13 @@ typedef struct {
} LodLimb; // size = 0x10 } LodLimb; // size = 0x10
// Model has limbs with only rigid meshes // Model has limbs with only rigid meshes
typedef struct { typedef struct SkeletonHeader {
/* 0x00 */ void** segment; /* 0x00 */ void** segment;
/* 0x04 */ u8 limbCount; /* 0x04 */ u8 limbCount;
} SkeletonHeader; // size = 0x8 } SkeletonHeader; // size = 0x8
// Model has limbs with flexible meshes // Model has limbs with flexible meshes
typedef struct { typedef struct FlexSkeletonHeader {
/* 0x00 */ SkeletonHeader sh; /* 0x00 */ SkeletonHeader sh;
/* 0x08 */ u8 dListCount; /* 0x08 */ u8 dListCount;
} FlexSkeletonHeader; // size = 0xC } FlexSkeletonHeader; // size = 0xC
@ -47,22 +47,22 @@ typedef struct {
*/ */
// Index into the frame data table. // Index into the frame data table.
typedef struct { typedef struct JointIndex {
/* 0x00 */ u16 x; /* 0x00 */ u16 x;
/* 0x02 */ u16 y; /* 0x02 */ u16 y;
/* 0x04 */ u16 z; /* 0x04 */ u16 z;
} JointIndex; // size = 0x06 } JointIndex; // size = 0x06
typedef struct { typedef struct AnimationHeaderCommon {
/* 0x00 */ s16 frameCount; /* 0x00 */ s16 frameCount;
} AnimationHeaderCommon; } AnimationHeaderCommon;
typedef struct { typedef struct LinkAnimationHeader {
/* 0x00 */ AnimationHeaderCommon common; /* 0x00 */ AnimationHeaderCommon common;
/* 0x04 */ void* segment; /* 0x04 */ void* segment;
} LinkAnimationHeader; // size = 0x8 } LinkAnimationHeader; // size = 0x8
typedef struct { typedef struct AnimationHeader {
/* 0x00 */ AnimationHeaderCommon common; /* 0x00 */ AnimationHeaderCommon common;
/* 0x04 */ s16* frameData; // "tbl" /* 0x04 */ s16* frameData; // "tbl"
/* 0x08 */ JointIndex* jointIndices; // "ref_tbl" /* 0x08 */ JointIndex* jointIndices; // "ref_tbl"
@ -73,7 +73,7 @@ typedef struct {
* SkelAnime * SkelAnime
*/ */
typedef enum { typedef enum AnimationMode {
/* 0 */ ANIMMODE_LOOP, /* 0 */ ANIMMODE_LOOP,
/* 1 */ ANIMMODE_LOOP_INTERP, /* 1 */ ANIMMODE_LOOP_INTERP,
/* 2 */ ANIMMODE_ONCE, /* 2 */ ANIMMODE_ONCE,
@ -82,7 +82,7 @@ typedef enum {
/* 5 */ ANIMMODE_LOOP_PARTIAL_INTERP /* 5 */ ANIMMODE_LOOP_PARTIAL_INTERP
} AnimationMode; } AnimationMode;
typedef enum { typedef enum AnimationTapers {
/* -1 */ ANIMTAPER_DECEL = -1, /* -1 */ ANIMTAPER_DECEL = -1,
/* 0 */ ANIMTAPER_NONE, /* 0 */ ANIMTAPER_NONE,
/* 1 */ ANIMTAPER_ACCEL /* 1 */ ANIMTAPER_ACCEL
@ -253,7 +253,7 @@ void Animation_EndLoop(SkelAnime* skelAnime);
void Animation_Reverse(SkelAnime* skelAnime); void Animation_Reverse(SkelAnime* skelAnime);
void Animation_SetMorph(struct PlayState* play, SkelAnime* skelAnime, f32 morphFrames); void Animation_SetMorph(struct PlayState* play, SkelAnime* skelAnime, f32 morphFrames);
typedef struct { typedef struct AnimationInfo {
/* 0x00 */ AnimationHeader* animation; /* 0x00 */ AnimationHeader* animation;
/* 0x04 */ f32 playSpeed; /* 0x04 */ f32 playSpeed;
/* 0x08 */ f32 startFrame; /* 0x08 */ f32 startFrame;
@ -264,21 +264,21 @@ typedef struct {
void Animation_ChangeByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 index); void Animation_ChangeByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 index);
typedef struct { typedef struct AnimationFrameCountInfo {
/* 0x00 */ AnimationHeader* animation; /* 0x00 */ AnimationHeader* animation;
/* 0x04 */ f32 frameCount; /* 0x04 */ f32 frameCount;
/* 0x08 */ u8 mode; /* 0x08 */ u8 mode;
/* 0x0C */ f32 morphFrames; /* 0x0C */ f32 morphFrames;
} AnimationFrameCountInfo; // size = 0x10 } AnimationFrameCountInfo; // size = 0x10
typedef struct { typedef struct AnimationSpeedInfo {
/* 0x00 */ AnimationHeader* animation; /* 0x00 */ AnimationHeader* animation;
/* 0x04 */ f32 playSpeed; /* 0x04 */ f32 playSpeed;
/* 0x08 */ u8 mode; /* 0x08 */ u8 mode;
/* 0x0C */ f32 morphFrames; /* 0x0C */ f32 morphFrames;
} AnimationSpeedInfo; // size = 0x10 } AnimationSpeedInfo; // size = 0x10
typedef struct { typedef struct AnimationMinimalInfo {
/* 0x00 */ AnimationHeader* animation; /* 0x00 */ AnimationHeader* animation;
/* 0x04 */ u8 mode; /* 0x04 */ u8 mode;
/* 0x08 */ f32 morphFrames; /* 0x08 */ f32 morphFrames;
@ -296,7 +296,7 @@ s16 Animation_GetLastFrame(void* animation);
* Animation Task Queue * Animation Task Queue
*/ */
typedef enum { typedef enum AnimTaskType {
/* 0 */ ANIMTASK_LOAD_PLAYER_FRAME, /* 0 */ ANIMTASK_LOAD_PLAYER_FRAME,
/* 1 */ ANIMTASK_COPY, /* 1 */ ANIMTASK_COPY,
/* 2 */ ANIMTASK_INTERP, /* 2 */ ANIMTASK_INTERP,
@ -305,20 +305,20 @@ typedef enum {
/* 5 */ ANIMTASK_ACTOR_MOVE /* 5 */ ANIMTASK_ACTOR_MOVE
} AnimTaskType; } AnimTaskType;
typedef struct { typedef struct AnimTaskLoadPlayerFrame {
/* 0x00 */ DmaRequest req; /* 0x00 */ DmaRequest req;
/* 0x20 */ OSMesgQueue msgQueue; /* 0x20 */ OSMesgQueue msgQueue;
/* 0x38 */ OSMesg msg; /* 0x38 */ OSMesg msg;
} AnimTaskLoadPlayerFrame; // size = 0x3C } AnimTaskLoadPlayerFrame; // size = 0x3C
typedef struct { typedef struct AnimTaskCopy {
/* 0x00 */ u8 group; /* 0x00 */ u8 group;
/* 0x01 */ u8 vecCount; /* 0x01 */ u8 vecCount;
/* 0x04 */ Vec3s* dest; /* 0x04 */ Vec3s* dest;
/* 0x08 */ Vec3s* src; /* 0x08 */ Vec3s* src;
} AnimTaskCopy; // size = 0xC } AnimTaskCopy; // size = 0xC
typedef struct { typedef struct AnimTaskInterp {
/* 0x00 */ u8 group; /* 0x00 */ u8 group;
/* 0x01 */ u8 vecCount; /* 0x01 */ u8 vecCount;
/* 0x04 */ Vec3s* base; /* 0x04 */ Vec3s* base;
@ -326,7 +326,7 @@ typedef struct {
/* 0x0C */ f32 weight; /* 0x0C */ f32 weight;
} AnimTaskInterp; // size = 0x10 } AnimTaskInterp; // size = 0x10
typedef struct { typedef struct AnimTaskCopyUsingMap {
/* 0x00 */ u8 group; /* 0x00 */ u8 group;
/* 0x01 */ u8 vecCount; /* 0x01 */ u8 vecCount;
/* 0x04 */ Vec3s* dest; /* 0x04 */ Vec3s* dest;
@ -334,7 +334,7 @@ typedef struct {
/* 0x0C */ u8* limbCopyMap; /* 0x0C */ u8* limbCopyMap;
} AnimTaskCopyUsingMap; // size = 0x10 } AnimTaskCopyUsingMap; // size = 0x10
typedef struct { typedef struct AnimTaskCopyUsingMapInverted {
/* 0x00 */ u8 group; /* 0x00 */ u8 group;
/* 0x01 */ u8 vecCount; /* 0x01 */ u8 vecCount;
/* 0x04 */ Vec3s* dest; /* 0x04 */ Vec3s* dest;
@ -342,13 +342,13 @@ typedef struct {
/* 0x0C */ u8* limbCopyMap; /* 0x0C */ u8* limbCopyMap;
} AnimTaskCopyUsingMapInverted; // size = 0x10 } AnimTaskCopyUsingMapInverted; // size = 0x10
typedef struct { typedef struct AnimTaskActorMove {
/* 0x00 */ struct Actor* actor; /* 0x00 */ struct Actor* actor;
/* 0x04 */ struct SkelAnime* skelAnime; /* 0x04 */ struct SkelAnime* skelAnime;
/* 0x08 */ f32 diffScaleY; /* 0x08 */ f32 diffScaleY;
} AnimTaskActorMove; // size = 0xC } AnimTaskActorMove; // size = 0xC
typedef union { typedef union AnimTaskData {
AnimTaskLoadPlayerFrame loadPlayerFrame; AnimTaskLoadPlayerFrame loadPlayerFrame;
AnimTaskCopy copy; AnimTaskCopy copy;
AnimTaskInterp interp; AnimTaskInterp interp;
@ -357,7 +357,7 @@ typedef union {
AnimTaskActorMove actorMove; AnimTaskActorMove actorMove;
} AnimTaskData; // size = 0x3C } AnimTaskData; // size = 0x3C
typedef struct { typedef struct AnimTask {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
/* 0x04 */ AnimTaskData data; /* 0x04 */ AnimTaskData data;
} AnimTask; // size = 0x40 } AnimTask; // size = 0x40

View file

@ -12,7 +12,7 @@ typedef struct LegacyLimb {
/* 0x01C */ struct LegacyLimb* child; /* 0x01C */ struct LegacyLimb* child;
} LegacyLimb; // size = 0x20 } LegacyLimb; // size = 0x20
typedef struct { typedef struct LegacyJointKey {
/* 0x00 */ s16 xMax; /* 0x00 */ s16 xMax;
/* 0x02 */ s16 x; /* 0x02 */ s16 x;
/* 0x04 */ s16 yMax; /* 0x04 */ s16 yMax;
@ -21,7 +21,7 @@ typedef struct {
/* 0x0A */ s16 z; /* 0x0A */ s16 z;
} LegacyJointKey; // size = 0x0C } LegacyJointKey; // size = 0x0C
typedef struct { typedef struct LegacyAnimationHeader {
/* 0x00 */ s16 frameCount; /* 0x00 */ s16 frameCount;
/* 0x02 */ s16 limbCount; /* 0x02 */ s16 limbCount;
/* 0x04 */ s16* frameData; /* 0x04 */ s16* frameData;

View file

@ -1,6 +1,9 @@
#ifndef Z64_AUDIO_H #ifndef Z64_AUDIO_H
#define Z64_AUDIO_H #define Z64_AUDIO_H
#include "ultra64.h"
#include "sequence.h"
typedef void (*AudioCustomUpdateFunction)(void); typedef void (*AudioCustomUpdateFunction)(void);
@ -62,14 +65,14 @@ typedef void (*AudioCustomUpdateFunction)(void);
#define AUDIO_RELOCATED_ADDRESS_START K0BASE #define AUDIO_RELOCATED_ADDRESS_START K0BASE
typedef enum { typedef enum SoundMode {
/* 0 */ SOUNDMODE_STEREO, /* 0 */ SOUNDMODE_STEREO,
/* 1 */ SOUNDMODE_HEADSET, /* 1 */ SOUNDMODE_HEADSET,
/* 2 */ SOUNDMODE_SURROUND, /* 2 */ SOUNDMODE_SURROUND,
/* 3 */ SOUNDMODE_MONO /* 3 */ SOUNDMODE_MONO
} SoundMode; } SoundMode;
typedef enum { typedef enum AdsrStatus {
/* 0 */ ADSR_STATE_DISABLED, /* 0 */ ADSR_STATE_DISABLED,
/* 1 */ ADSR_STATE_INITIAL, /* 1 */ ADSR_STATE_INITIAL,
/* 2 */ ADSR_STATE_START_LOOP, /* 2 */ ADSR_STATE_START_LOOP,
@ -81,14 +84,14 @@ typedef enum {
/* 8 */ ADSR_STATE_SUSTAIN /* 8 */ ADSR_STATE_SUSTAIN
} AdsrStatus; } AdsrStatus;
typedef enum { typedef enum SampleMedium {
/* 0 */ MEDIUM_RAM, /* 0 */ MEDIUM_RAM,
/* 1 */ MEDIUM_UNK, /* 1 */ MEDIUM_UNK,
/* 2 */ MEDIUM_CART, /* 2 */ MEDIUM_CART,
/* 3 */ MEDIUM_DISK_DRIVE /* 3 */ MEDIUM_DISK_DRIVE
} SampleMedium; } SampleMedium;
typedef enum { typedef enum SampleCodec {
/* 0 */ CODEC_ADPCM, // 16 2-byte samples (32 bytes) compressed into 4-bit samples (8 bytes) + 1 header byte /* 0 */ CODEC_ADPCM, // 16 2-byte samples (32 bytes) compressed into 4-bit samples (8 bytes) + 1 header byte
/* 1 */ CODEC_S8, // 16 2-byte samples (32 bytes) compressed into 8-bit samples (16 bytes) /* 1 */ CODEC_S8, // 16 2-byte samples (32 bytes) compressed into 8-bit samples (16 bytes)
/* 2 */ CODEC_S16_INMEMORY, /* 2 */ CODEC_S16_INMEMORY,
@ -97,20 +100,28 @@ typedef enum {
/* 5 */ CODEC_S16 /* 5 */ CODEC_S16
} SampleCodec; } SampleCodec;
typedef enum { typedef enum SampleBankTableType {
/* 0 */ SEQUENCE_TABLE, /* 0 */ SEQUENCE_TABLE,
/* 1 */ FONT_TABLE, /* 1 */ FONT_TABLE,
/* 2 */ SAMPLE_TABLE /* 2 */ SAMPLE_TABLE
} SampleBankTableType; } SampleBankTableType;
typedef enum { typedef enum AudioCacheType {
/* 0 */ CACHE_TEMPORARY, /* 0 */ CACHE_TEMPORARY,
/* 1 */ CACHE_PERSISTENT, /* 1 */ CACHE_PERSISTENT,
/* 2 */ CACHE_EITHER, /* 2 */ CACHE_EITHER,
/* 3 */ CACHE_PERMANENT /* 3 */ CACHE_PERMANENT
} AudioCacheType; } AudioCacheType;
typedef enum { typedef enum AudioCacheLoadType {
/* 0 */ CACHE_LOAD_PERMANENT,
/* 1 */ CACHE_LOAD_PERSISTENT,
/* 2 */ CACHE_LOAD_TEMPORARY,
/* 3 */ CACHE_LOAD_EITHER,
/* 4 */ CACHE_LOAD_EITHER_NOSYNC
} AudioCacheLoadType;
typedef enum AudioLoadStatus {
/* 0 */ LOAD_STATUS_NOT_LOADED, // the entry data is not loaded /* 0 */ LOAD_STATUS_NOT_LOADED, // the entry data is not loaded
/* 1 */ LOAD_STATUS_IN_PROGRESS, // the entry data is being loaded asynchronously /* 1 */ LOAD_STATUS_IN_PROGRESS, // the entry data is being loaded asynchronously
/* 2 */ LOAD_STATUS_COMPLETE, // the entry data is loaded, it may be discarded if not stored persistently, and either no longer in use, or the memory is needed for something else /* 2 */ LOAD_STATUS_COMPLETE, // the entry data is loaded, it may be discarded if not stored persistently, and either no longer in use, or the memory is needed for something else
@ -154,19 +165,19 @@ typedef struct NotePool {
// direction is "supported" by setting extent to be negative. The code // direction is "supported" by setting extent to be negative. The code
// exterpolates exponentially in the wrong direction in that case, but that // exterpolates exponentially in the wrong direction in that case, but that
// doesn't prevent seqplayer from doing it, AFAICT. // doesn't prevent seqplayer from doing it, AFAICT.
typedef struct { typedef struct Portamento {
/* 0x00 */ u8 mode; // bit 0x80 denotes something; the rest are an index 0-5 /* 0x00 */ u8 mode; // bit 0x80 denotes something; the rest are an index 0-5
/* 0x02 */ u16 cur; /* 0x02 */ u16 cur;
/* 0x04 */ u16 speed; /* 0x04 */ u16 speed;
/* 0x08 */ f32 extent; /* 0x08 */ f32 extent;
} Portamento; // size = 0xC } Portamento; // size = 0xC
typedef struct { typedef struct EnvelopePoint {
/* 0x0 */ s16 delay; /* 0x0 */ s16 delay;
/* 0x2 */ s16 arg; /* 0x2 */ s16 arg;
} EnvelopePoint; // size = 0x4 } EnvelopePoint; // size = 0x4
typedef struct { typedef struct AdpcmLoop {
/* 0x00 */ u32 start; /* 0x00 */ u32 start;
/* 0x04 */ u32 end; /* 0x04 */ u32 end;
/* 0x08 */ u32 count; /* 0x08 */ u32 count;
@ -174,13 +185,13 @@ typedef struct {
/* 0x10 */ s16 predictorState[16]; // only exists if count != 0. 8-byte aligned /* 0x10 */ s16 predictorState[16]; // only exists if count != 0. 8-byte aligned
} AdpcmLoop; // size = 0x30 (or 0x10) } AdpcmLoop; // size = 0x30 (or 0x10)
typedef struct { typedef struct AdpcmBook {
/* 0x00 */ s32 order; /* 0x00 */ s32 order;
/* 0x04 */ s32 numPredictors; /* 0x04 */ s32 numPredictors;
/* 0x08 */ s16 book[1]; // size 8 * order * numPredictors. 8-byte aligned /* 0x08 */ s16 book[1]; // size 8 * order * numPredictors. 8-byte aligned
} AdpcmBook; // size >= 0x8 } AdpcmBook; // size >= 0x8
typedef struct { typedef struct Sample {
/* 0x00 */ u32 codec : 4; // The state of compression or decompression /* 0x00 */ u32 codec : 4; // The state of compression or decompression
/* 0x00 */ u32 medium : 2; // Medium where sample is currently stored /* 0x00 */ u32 medium : 2; // Medium where sample is currently stored
/* 0x00 */ u32 unk_bit26 : 1; /* 0x00 */ u32 unk_bit26 : 1;
@ -191,12 +202,12 @@ typedef struct {
/* 0x0C */ AdpcmBook* book; // Adpcm book parameters used by the sample. Offset from the start of the sound font / pointer to ram /* 0x0C */ AdpcmBook* book; // Adpcm book parameters used by the sample. Offset from the start of the sound font / pointer to ram
} Sample; // size = 0x10 } Sample; // size = 0x10
typedef struct { typedef struct TunedSample {
/* 0x00 */ Sample* sample; /* 0x00 */ Sample* sample;
/* 0x04 */ f32 tuning; // frequency scale factor /* 0x04 */ f32 tuning; // frequency scale factor
} TunedSample; // size = 0x8 } TunedSample; // size = 0x8
typedef struct { typedef struct Instrument {
/* 0x00 */ u8 isRelocated; // have the envelope and all samples been relocated (offsets to pointers) /* 0x00 */ u8 isRelocated; // have the envelope and all samples been relocated (offsets to pointers)
/* 0x01 */ u8 normalRangeLo; /* 0x01 */ u8 normalRangeLo;
/* 0x02 */ u8 normalRangeHi; /* 0x02 */ u8 normalRangeHi;
@ -207,7 +218,7 @@ typedef struct {
/* 0x18 */ TunedSample highPitchTunedSample; /* 0x18 */ TunedSample highPitchTunedSample;
} Instrument; // size = 0x20 } Instrument; // size = 0x20
typedef struct { typedef struct Drum {
/* 0x00 */ u8 adsrDecayIndex; // index used to obtain adsr decay rate from adsrDecayTable /* 0x00 */ u8 adsrDecayIndex; // index used to obtain adsr decay rate from adsrDecayTable
/* 0x01 */ u8 pan; /* 0x01 */ u8 pan;
/* 0x02 */ u8 isRelocated; // have tunedSample.sample and envelope been relocated (offsets to pointers) /* 0x02 */ u8 isRelocated; // have tunedSample.sample and envelope been relocated (offsets to pointers)
@ -215,14 +226,14 @@ typedef struct {
/* 0x0C */ EnvelopePoint* envelope; /* 0x0C */ EnvelopePoint* envelope;
} Drum; // size = 0x10 } Drum; // size = 0x10
typedef struct { typedef struct SoundEffect {
/* 0x00 */ TunedSample tunedSample; /* 0x00 */ TunedSample tunedSample;
} SoundEffect; // size = 0x08 } SoundEffect; // size = 0x08
/** /**
* Stores parsed information from soundfont data * Stores parsed information from soundfont data
*/ */
typedef struct { typedef struct SoundFont {
/* 0x00 */ u8 numInstruments; /* 0x00 */ u8 numInstruments;
/* 0x01 */ u8 numDrums; /* 0x01 */ u8 numDrums;
/* 0x02 */ u8 sampleBankId1; /* 0x02 */ u8 sampleBankId1;
@ -233,7 +244,7 @@ typedef struct {
/* 0x10 */ SoundEffect* soundEffects; /* 0x10 */ SoundEffect* soundEffects;
} SoundFont; // size = 0x14 } SoundFont; // size = 0x14
typedef struct { typedef struct ReverbRingBufferItem {
/* 0x00 */ s16 numSamplesAfterDownsampling; // never read /* 0x00 */ s16 numSamplesAfterDownsampling; // never read
/* 0x02 */ s16 chunkLen; // never read /* 0x02 */ s16 chunkLen; // never read
/* 0x04 */ s16* toDownsampleLeft; /* 0x04 */ s16* toDownsampleLeft;
@ -246,7 +257,7 @@ typedef struct {
/* 0x18 */ u16 unk_18; /* 0x18 */ u16 unk_18;
} ReverbRingBufferItem; // size = 0x1C } ReverbRingBufferItem; // size = 0x1C
typedef struct { typedef struct SynthesisReverb {
/* 0x000 */ u8 resampleFlags; /* 0x000 */ u8 resampleFlags;
/* 0x001 */ u8 useReverb; /* 0x001 */ u8 useReverb;
/* 0x002 */ u8 framesToIgnore; /* 0x002 */ u8 framesToIgnore;
@ -286,7 +297,7 @@ typedef struct {
/* 0x298 */ AdpcmLoop loop; /* 0x298 */ AdpcmLoop loop;
} SynthesisReverb; // size = 0x2C8 } SynthesisReverb; // size = 0x2C8
typedef struct { typedef struct SeqScriptState {
/* 0x00 */ u8* pc; // program counter /* 0x00 */ u8* pc; // program counter
/* 0x04 */ u8* stack[4]; /* 0x04 */ u8* stack[4];
/* 0x14 */ u8 remLoopIters[4]; // remaining loop iterations /* 0x14 */ u8 remLoopIters[4]; // remaining loop iterations
@ -295,7 +306,7 @@ typedef struct {
} SeqScriptState; // size = 0x1C } SeqScriptState; // size = 0x1C
// Also known as a Group, according to debug strings. // Also known as a Group, according to debug strings.
typedef struct { typedef struct SequencePlayer {
/* 0x000 */ u8 enabled : 1; /* 0x000 */ u8 enabled : 1;
/* 0x000 */ u8 finished : 1; /* 0x000 */ u8 finished : 1;
/* 0x000 */ u8 muted : 1; /* 0x000 */ u8 muted : 1;
@ -337,13 +348,13 @@ typedef struct {
/* 0x158 */ s8 seqScriptIO[8]; /* 0x158 */ s8 seqScriptIO[8];
} SequencePlayer; // size = 0x160 } SequencePlayer; // size = 0x160
typedef struct { typedef struct AdsrSettings {
/* 0x0 */ u8 decayIndex; // index used to obtain adsr decay rate from adsrDecayTable /* 0x0 */ u8 decayIndex; // index used to obtain adsr decay rate from adsrDecayTable
/* 0x1 */ u8 sustain; /* 0x1 */ u8 sustain;
/* 0x4 */ EnvelopePoint* envelope; /* 0x4 */ EnvelopePoint* envelope;
} AdsrSettings; // size = 0x8 } AdsrSettings; // size = 0x8
typedef struct { typedef struct AdsrState {
/* 0x00 */ union { /* 0x00 */ union {
struct A { struct A {
/* 0x00 */ u8 unused : 1; /* 0x00 */ u8 unused : 1;
@ -365,7 +376,7 @@ typedef struct {
/* 0x1C */ EnvelopePoint* envelope; /* 0x1C */ EnvelopePoint* envelope;
} AdsrState; // size = 0x20 } AdsrState; // size = 0x20
typedef struct { typedef struct StereoData {
/* 0x00 */ u8 unused : 2; /* 0x00 */ u8 unused : 2;
/* 0x00 */ u8 bit2 : 2; /* 0x00 */ u8 bit2 : 2;
/* 0x00 */ u8 strongRight : 1; /* 0x00 */ u8 strongRight : 1;
@ -374,12 +385,12 @@ typedef struct {
/* 0x00 */ u8 usesHeadsetPanEffects : 1; /* 0x00 */ u8 usesHeadsetPanEffects : 1;
} StereoData; // size = 0x1 } StereoData; // size = 0x1
typedef union { typedef union Stereo {
/* 0x00 */ StereoData s; /* 0x00 */ StereoData s;
/* 0x00 */ u8 asByte; /* 0x00 */ u8 asByte;
} Stereo; // size = 0x1 } Stereo; // size = 0x1
typedef struct { typedef struct NoteAttributes {
/* 0x00 */ u8 reverb; /* 0x00 */ u8 reverb;
/* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number /* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
/* 0x02 */ u8 pan; /* 0x02 */ u8 pan;
@ -498,7 +509,7 @@ typedef struct SequenceLayer {
/* 0x70 */ AudioListItem listItem; /* 0x70 */ AudioListItem listItem;
} SequenceLayer; // size = 0x80 } SequenceLayer; // size = 0x80
typedef struct { typedef struct NoteSynthesisBuffers {
/* 0x000 */ s16 adpcmdecState[16]; /* 0x000 */ s16 adpcmdecState[16];
/* 0x020 */ s16 finalResampleState[16]; /* 0x020 */ s16 finalResampleState[16];
/* 0x040 */ s16 mixEnvelopeState[32]; /* 0x040 */ s16 mixEnvelopeState[32];
@ -507,7 +518,7 @@ typedef struct {
/* 0x0E0 */ s16 combFilterState[128]; /* 0x0E0 */ s16 combFilterState[128];
} NoteSynthesisBuffers; // size = 0x1E0 } NoteSynthesisBuffers; // size = 0x1E0
typedef struct { typedef struct NoteSynthesisState {
/* 0x00 */ u8 restart; /* 0x00 */ u8 restart;
/* 0x01 */ u8 sampleDmaIndex; /* 0x01 */ u8 sampleDmaIndex;
/* 0x02 */ u8 prevHaasEffectLeftDelaySize; /* 0x02 */ u8 prevHaasEffectLeftDelaySize;
@ -524,7 +535,7 @@ typedef struct {
/* 0x1C */ char unk_1C[0x4]; /* 0x1C */ char unk_1C[0x4];
} NoteSynthesisState; // size = 0x20 } NoteSynthesisState; // size = 0x20
typedef struct { typedef struct VibratoState {
/* 0x00 */ struct SequenceChannel* channel; /* 0x00 */ struct SequenceChannel* channel;
/* 0x04 */ u32 time; /* 0x04 */ u32 time;
/* 0x08 */ s16* curve; // sineWave /* 0x08 */ s16* curve; // sineWave
@ -536,7 +547,7 @@ typedef struct {
/* 0x1A */ u16 delay; /* 0x1A */ u16 delay;
} VibratoState; // size = 0x1C } VibratoState; // size = 0x1C
typedef struct { typedef struct NotePlaybackState {
/* 0x00 */ u8 priority; /* 0x00 */ u8 priority;
/* 0x01 */ u8 waveId; /* 0x01 */ u8 waveId;
/* 0x02 */ u8 harmonicIndex; // the harmonic index for the synthetic wave contained in gWaveSamples (also matches the base 2 logarithm of the harmonic order) /* 0x02 */ u8 harmonicIndex; // the harmonic index for the synthetic wave contained in gWaveSamples (also matches the base 2 logarithm of the harmonic order)
@ -555,7 +566,7 @@ typedef struct {
/* 0x6C */ VibratoState vibratoState; /* 0x6C */ VibratoState vibratoState;
} NotePlaybackState; // size = 0x88 } NotePlaybackState; // size = 0x88
typedef struct { typedef struct NoteSubEu {
struct { struct {
/* 0x00 */ volatile u8 enabled : 1; /* 0x00 */ volatile u8 enabled : 1;
/* 0x00 */ u8 needsInit : 1; /* 0x00 */ u8 needsInit : 1;
@ -600,7 +611,7 @@ typedef struct Note {
/* 0xC0 */ NoteSubEu noteSubEu; /* 0xC0 */ NoteSubEu noteSubEu;
} Note; // size = 0xE0 } Note; // size = 0xE0
typedef struct { typedef struct ReverbSettings {
/* 0x00 */ u8 downsampleRate; /* 0x00 */ u8 downsampleRate;
/* 0x02 */ u16 windowSize; /* 0x02 */ u16 windowSize;
/* 0x04 */ u16 decayRatio; // determines how much reverb persists /* 0x04 */ u16 decayRatio; // determines how much reverb persists
@ -619,7 +630,7 @@ typedef struct {
* The high-level audio specifications requested when initializing or resetting the audio heap. * The high-level audio specifications requested when initializing or resetting the audio heap.
* The audio heap can be reset on various occasions, including on most scene transitions. * The audio heap can be reset on various occasions, including on most scene transitions.
*/ */
typedef struct { typedef struct AudioSpec {
/* 0x00 */ u32 samplingFrequency; // Target sampling rate in Hz /* 0x00 */ u32 samplingFrequency; // Target sampling rate in Hz
/* 0x04 */ u8 unk_04; /* 0x04 */ u8 unk_04;
/* 0x05 */ u8 numNotes; /* 0x05 */ u8 numNotes;
@ -646,7 +657,7 @@ typedef struct {
* digital-analog converter (DAC), then to play on the speakers. The audio buffer is written to by the rsp after * digital-analog converter (DAC), then to play on the speakers. The audio buffer is written to by the rsp after
* processing audio commands. This struct parameterizes that buffer. * processing audio commands. This struct parameterizes that buffer.
*/ */
typedef struct { typedef struct AudioBufferParameters {
/* 0x00 */ s16 specUnk4; /* 0x00 */ s16 specUnk4;
/* 0x02 */ u16 samplingFrequency; // Target sampling rate in Hz /* 0x02 */ u16 samplingFrequency; // Target sampling rate in Hz
/* 0x04 */ u16 aiSamplingFrequency; // True sampling rate of the audio interface (AI), see `osAiSetFrequency` /* 0x04 */ u16 aiSamplingFrequency; // True sampling rate of the audio interface (AI), see `osAiSetFrequency`
@ -667,7 +678,7 @@ typedef struct {
/** /**
* Meta-data associated with a pool (contained within the Audio Heap) * Meta-data associated with a pool (contained within the Audio Heap)
*/ */
typedef struct { typedef struct AudioAllocPool {
/* 0x0 */ u8* startRamAddr; // start addr of the pool /* 0x0 */ u8* startRamAddr; // start addr of the pool
/* 0x4 */ u8* curRamAddr; // address of the next available memory for allocation /* 0x4 */ u8* curRamAddr; // address of the next available memory for allocation
/* 0x8 */ s32 size; // size of the pool /* 0x8 */ s32 size; // size of the pool
@ -677,7 +688,7 @@ typedef struct {
/** /**
* Audio cache entry data to store a single entry containing either a sequence, soundfont, or entire sample banks * Audio cache entry data to store a single entry containing either a sequence, soundfont, or entire sample banks
*/ */
typedef struct { typedef struct AudioCacheEntry {
/* 0x0 */ u8* ramAddr; /* 0x0 */ u8* ramAddr;
/* 0x4 */ u32 size; /* 0x4 */ u32 size;
/* 0x8 */ s16 tableType; /* 0x8 */ s16 tableType;
@ -687,7 +698,7 @@ typedef struct {
/** /**
* Audio cache entry data to store a single entry containing an individual sample * Audio cache entry data to store a single entry containing an individual sample
*/ */
typedef struct { typedef struct SampleCacheEntry {
/* 0x00 */ s8 inUse; /* 0x00 */ s8 inUse;
/* 0x01 */ s8 origMedium; /* 0x01 */ s8 origMedium;
/* 0x02 */ s8 sampleBankId; /* 0x02 */ s8 sampleBankId;
@ -700,48 +711,48 @@ typedef struct {
/** /**
* Audio cache entry data to store individual samples * Audio cache entry data to store individual samples
*/ */
typedef struct { typedef struct AudioSampleCache {
/* 0x000 */ AudioAllocPool pool; /* 0x000 */ AudioAllocPool pool;
/* 0x010 */ SampleCacheEntry entries[32]; /* 0x010 */ SampleCacheEntry entries[32];
/* 0x290 */ s32 numEntries; /* 0x290 */ s32 numEntries;
} AudioSampleCache; // size = 0x294 } AudioSampleCache; // size = 0x294
typedef struct { typedef struct AudioPersistentCache {
/* 0x00*/ u32 numEntries; /* 0x00*/ u32 numEntries;
/* 0x04*/ AudioAllocPool pool; /* 0x04*/ AudioAllocPool pool;
/* 0x14*/ AudioCacheEntry entries[16]; /* 0x14*/ AudioCacheEntry entries[16];
} AudioPersistentCache; // size = 0xD4 } AudioPersistentCache; // size = 0xD4
typedef struct { typedef struct AudioTemporaryCache {
/* 0x00*/ u32 nextSide; /* 0x00*/ u32 nextSide;
/* 0x04*/ AudioAllocPool pool; /* 0x04*/ AudioAllocPool pool;
/* 0x14*/ AudioCacheEntry entries[2]; /* 0x14*/ AudioCacheEntry entries[2];
} AudioTemporaryCache; // size = 0x3C } AudioTemporaryCache; // size = 0x3C
typedef struct { typedef struct AudioCache {
/* 0x000*/ AudioPersistentCache persistent; /* 0x000*/ AudioPersistentCache persistent;
/* 0x0D4*/ AudioTemporaryCache temporary; /* 0x0D4*/ AudioTemporaryCache temporary;
/* 0x100*/ u8 unk_100[0x10]; /* 0x100*/ u8 unk_100[0x10];
} AudioCache; // size = 0x110 } AudioCache; // size = 0x110
typedef struct { typedef struct AudioCachePoolSplit {
/* 0x0 */ u32 persistentCommonPoolSize; /* 0x0 */ u32 persistentCommonPoolSize;
/* 0x4 */ u32 temporaryCommonPoolSize; /* 0x4 */ u32 temporaryCommonPoolSize;
} AudioCachePoolSplit; // size = 0x8 } AudioCachePoolSplit; // size = 0x8
typedef struct { typedef struct AudioCommonPoolSplit {
/* 0x0 */ u32 seqCacheSize; /* 0x0 */ u32 seqCacheSize;
/* 0x4 */ u32 fontCacheSize; /* 0x4 */ u32 fontCacheSize;
/* 0x8 */ u32 sampleBankCacheSize; /* 0x8 */ u32 sampleBankCacheSize;
} AudioCommonPoolSplit; // size = 0xC } AudioCommonPoolSplit; // size = 0xC
typedef struct { typedef struct AudioSessionPoolSplit {
/* 0x0 */ u32 miscPoolSize; /* 0x0 */ u32 miscPoolSize;
/* 0x4 */ u32 unkSizes[2]; /* 0x4 */ u32 unkSizes[2];
/* 0xC */ u32 cachePoolSize; /* 0xC */ u32 cachePoolSize;
} AudioSessionPoolSplit; // size = 0x10 } AudioSessionPoolSplit; // size = 0x10
typedef struct { typedef struct AudioPreloadReq {
/* 0x00 */ u32 endAndMediumKey; /* 0x00 */ u32 endAndMediumKey;
/* 0x04 */ Sample* sample; /* 0x04 */ Sample* sample;
/* 0x08 */ u8* ramAddr; /* 0x08 */ u8* ramAddr;
@ -752,7 +763,7 @@ typedef struct {
/** /**
* Audio commands used to transfer audio requests from the graph thread to the audio thread * Audio commands used to transfer audio requests from the graph thread to the audio thread
*/ */
typedef struct { typedef struct AudioCmd {
/* 0x0 */ union{ /* 0x0 */ union{
u32 opArgs; u32 opArgs;
struct { struct {
@ -773,7 +784,7 @@ typedef struct {
}; };
} AudioCmd; // size = 0x8 } AudioCmd; // size = 0x8
typedef struct { typedef struct AudioAsyncLoad {
/* 0x00 */ s8 status; /* 0x00 */ s8 status;
/* 0x01 */ s8 delay; /* 0x01 */ s8 delay;
/* 0x02 */ s8 medium; /* 0x02 */ s8 medium;
@ -790,7 +801,7 @@ typedef struct {
/* 0x40 */ OSIoMesg ioMesg; /* 0x40 */ OSIoMesg ioMesg;
} AudioAsyncLoad; // size = 0x58 } AudioAsyncLoad; // size = 0x58
typedef struct { typedef struct AudioSlowLoad {
/* 0x00 */ u8 medium; /* 0x00 */ u8 medium;
/* 0x01 */ u8 seqOrFontId; /* 0x01 */ u8 seqOrFontId;
/* 0x02 */ u16 instId; /* 0x02 */ u16 instId;
@ -807,7 +818,14 @@ typedef struct {
/* 0x4C */ OSIoMesg ioMesg; /* 0x4C */ OSIoMesg ioMesg;
} AudioSlowLoad; // size = 0x64 } AudioSlowLoad; // size = 0x64
typedef struct { typedef struct AudioTableHeader {
/* 0x00 */ s16 numEntries;
/* 0x02 */ s16 unkMediumParam;
/* 0x04 */ uintptr_t romAddr;
/* 0x08 */ char pad[0x8];
} AudioTableHeader; // size = 0x10
typedef struct AudioTableEntry {
/* 0x00 */ u32 romAddr; /* 0x00 */ u32 romAddr;
/* 0x04 */ u32 size; /* 0x04 */ u32 size;
/* 0x08 */ s8 medium; /* 0x08 */ s8 medium;
@ -817,15 +835,12 @@ typedef struct {
/* 0x0E */ s16 shortData3; /* 0x0E */ s16 shortData3;
} AudioTableEntry; // size = 0x10 } AudioTableEntry; // size = 0x10
typedef struct { typedef struct AudioTable {
/* 0x00 */ s16 numEntries; /* 0x00 */ AudioTableHeader header;
/* 0x02 */ s16 unkMediumParam;
/* 0x04 */ u32 romAddr;
/* 0x08 */ char pad[0x8];
/* 0x10 */ AudioTableEntry entries[1]; // (dynamic size) /* 0x10 */ AudioTableEntry entries[1]; // (dynamic size)
} AudioTable; // size >= 0x20 } AudioTable; // size >= 0x20
typedef struct { typedef struct SampleDma {
/* 0x00 */ u8* ramAddr; /* 0x00 */ u8* ramAddr;
/* 0x04 */ u32 devAddr; /* 0x04 */ u32 devAddr;
/* 0x08 */ u16 sizeUnused; /* 0x08 */ u16 sizeUnused;
@ -835,14 +850,14 @@ typedef struct {
/* 0x0E */ u8 ttl; // duration after which the DMA can be discarded /* 0x0E */ u8 ttl; // duration after which the DMA can be discarded
} SampleDma; // size = 0x10 } SampleDma; // size = 0x10
typedef struct { typedef struct AudioTask {
/* 0x00 */ OSTask task; /* 0x00 */ OSTask task;
/* 0x40 */ OSMesgQueue* msgQueue; /* 0x40 */ OSMesgQueue* msgQueue;
/* 0x44 */ void* unk_44; // probably a message that gets unused. /* 0x44 */ void* unk_44; // probably a message that gets unused.
/* 0x48 */ char unk_48[0x8]; /* 0x48 */ char unk_48[0x8];
} AudioTask; // size = 0x50 } AudioTask; // size = 0x50
typedef struct { typedef struct AudioContext {
/* 0x0000 */ char unk_0000; /* 0x0000 */ char unk_0000;
/* 0x0001 */ s8 numSynthesisReverbs; /* 0x0001 */ s8 numSynthesisReverbs;
/* 0x0002 */ u16 unk_2; // reads from audio spec unk_14, never used, always set to 0x7FFF /* 0x0002 */ u16 unk_2; // reads from audio spec unk_14, never used, always set to 0x7FFF
@ -968,7 +983,7 @@ typedef struct {
/* 0x5C50 */ AudioCmd threadCmdBuf[0x100]; // Audio thread commands used to transfer audio requests from the graph thread to the audio thread /* 0x5C50 */ AudioCmd threadCmdBuf[0x100]; // Audio thread commands used to transfer audio requests from the graph thread to the audio thread
} AudioContext; // size = 0x6450 } AudioContext; // size = 0x6450
typedef struct { typedef struct NoteSubAttributes {
/* 0x00 */ u8 reverbVol; /* 0x00 */ u8 reverbVol;
/* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number /* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
/* 0x02 */ u8 pan; /* 0x02 */ u8 pan;
@ -981,12 +996,12 @@ typedef struct {
/* 0x16 */ u16 combFilterGain; /* 0x16 */ u16 combFilterGain;
} NoteSubAttributes; // size = 0x18 } NoteSubAttributes; // size = 0x18
typedef struct { typedef struct TempoData {
/* 0x0 */ s16 unk_00; // set to 0x1C00, unused /* 0x0 */ s16 unk_00; // set to 0x1C00, unused
/* 0x2 */ s16 seqTicksPerBeat; /* 0x2 */ s16 seqTicksPerBeat;
} TempoData; // size = 0x4 } TempoData; // size = 0x4
typedef struct { typedef struct AudioHeapInitSizes {
/* 0x00 */ u32 heapSize; // total number of bytes allocated to the audio heap. Must be <= the size of `gAudioHeap` (ideally about the same size) /* 0x00 */ u32 heapSize; // total number of bytes allocated to the audio heap. Must be <= the size of `gAudioHeap` (ideally about the same size)
/* 0x04 */ u32 initPoolSize; // The entire audio heap is split into two pools. /* 0x04 */ u32 initPoolSize; // The entire audio heap is split into two pools.
/* 0x08 */ u32 permanentPoolSize; /* 0x08 */ u32 permanentPoolSize;

View file

@ -23,7 +23,7 @@ struct DynaPolyActor;
#define FUNC_80041EA4_STOP 8 #define FUNC_80041EA4_STOP 8
#define FUNC_80041EA4_VOID_OUT 12 #define FUNC_80041EA4_VOID_OUT 12
typedef struct { typedef struct ScaleRotPos {
/* 0x00 */ Vec3f scale; /* 0x00 */ Vec3f scale;
/* 0x0C */ Vec3s rot; /* 0x0C */ Vec3s rot;
/* 0x14 */ Vec3f pos; /* 0x14 */ Vec3f pos;
@ -66,7 +66,7 @@ typedef struct CollisionPoly {
/* 0x0E */ s16 dist; // Plane distance from origin along the normal /* 0x0E */ s16 dist; // Plane distance from origin along the normal
} CollisionPoly; // size = 0x10 } CollisionPoly; // size = 0x10
typedef struct { typedef struct BgCamInfo {
/* 0x0 */ u16 setting; // camera setting described by CameraSettingType enum /* 0x0 */ u16 setting; // camera setting described by CameraSettingType enum
/* 0x2 */ s16 count; // only used when `bgCamFuncData` is a list of points used for crawlspaces /* 0x2 */ s16 count; // only used when `bgCamFuncData` is a list of points used for crawlspaces
/* 0x4 */ Vec3s* bgCamFuncData; // s16 data grouped in threes (ex. Vec3s), is usually of type `BgCamFuncData`, but can be a list of points of type `Vec3s` for crawlspaces /* 0x4 */ Vec3s* bgCamFuncData; // s16 data grouped in threes (ex. Vec3s), is usually of type `BgCamFuncData`, but can be a list of points of type `Vec3s` for crawlspaces
@ -74,7 +74,7 @@ typedef struct {
// The structure used for all instances of s16 data from `BgCamInfo` with the exception of crawlspaces. // The structure used for all instances of s16 data from `BgCamInfo` with the exception of crawlspaces.
// See `Camera_Subj4` for Vec3s data usage in crawlspaces // See `Camera_Subj4` for Vec3s data usage in crawlspaces
typedef struct { typedef struct BgCamFuncData {
/* 0x00 */ Vec3s pos; /* 0x00 */ Vec3s pos;
/* 0x06 */ Vec3s rot; /* 0x06 */ Vec3s rot;
/* 0x0C */ s16 fov; /* 0x0C */ s16 fov;
@ -101,7 +101,7 @@ typedef struct {
(((room) & 0x3F) << 13) | \ (((room) & 0x3F) << 13) | \
(((setFlag19) & 1) << 19)) (((setFlag19) & 1) << 19))
typedef struct { typedef struct WaterBox {
/* 0x00 */ s16 xMin; /* 0x00 */ s16 xMin;
/* 0x02 */ s16 ySurface; /* 0x02 */ s16 ySurface;
/* 0x04 */ s16 zMin; /* 0x04 */ s16 zMin;
@ -110,7 +110,7 @@ typedef struct {
/* 0x0C */ u32 properties; /* 0x0C */ u32 properties;
} WaterBox; // size = 0x10 } WaterBox; // size = 0x10
typedef enum { typedef enum FloorType {
/* 0 */ FLOOR_TYPE_0, /* 0 */ FLOOR_TYPE_0,
/* 1 */ FLOOR_TYPE_1, /* 1 */ FLOOR_TYPE_1,
/* 2 */ FLOOR_TYPE_2, /* 2 */ FLOOR_TYPE_2,
@ -126,7 +126,7 @@ typedef enum {
/* 12 */ FLOOR_TYPE_12 /* 12 */ FLOOR_TYPE_12
} FloorType; } FloorType;
typedef enum { typedef enum WallType {
/* 0 */ WALL_TYPE_0, /* 0 */ WALL_TYPE_0,
/* 1 */ WALL_TYPE_1, /* 1 */ WALL_TYPE_1,
/* 2 */ WALL_TYPE_2, /* 2 */ WALL_TYPE_2,
@ -152,7 +152,7 @@ typedef enum {
#define WALL_FLAG_6 (1 << 6) #define WALL_FLAG_6 (1 << 6)
#define WALL_FLAG_CRAWLSPACE (WALL_FLAG_CRAWLSPACE_1 | WALL_FLAG_CRAWLSPACE_2) #define WALL_FLAG_CRAWLSPACE (WALL_FLAG_CRAWLSPACE_1 | WALL_FLAG_CRAWLSPACE_2)
typedef enum { typedef enum FloorProperty {
/* 0 */ FLOOR_PROPERTY_0, /* 0 */ FLOOR_PROPERTY_0,
/* 5 */ FLOOR_PROPERTY_5 = 5, /* 5 */ FLOOR_PROPERTY_5 = 5,
/* 6 */ FLOOR_PROPERTY_6, /* 6 */ FLOOR_PROPERTY_6,
@ -163,7 +163,7 @@ typedef enum {
/* 12 */ FLOOR_PROPERTY_12 /* 12 */ FLOOR_PROPERTY_12
} FloorProperty; } FloorProperty;
typedef enum { typedef enum SurfaceSfxOffset {
/* 0 */ SURFACE_SFX_OFFSET_DIRT, /* 0 */ SURFACE_SFX_OFFSET_DIRT,
/* 1 */ SURFACE_SFX_OFFSET_SAND, /* 1 */ SURFACE_SFX_OFFSET_SAND,
/* 2 */ SURFACE_SFX_OFFSET_STONE, /* 2 */ SURFACE_SFX_OFFSET_STONE,
@ -182,7 +182,7 @@ typedef enum {
/* 15 */ SURFACE_SFX_OFFSET_ICE /* 15 */ SURFACE_SFX_OFFSET_ICE
} SurfaceSfxOffset; } SurfaceSfxOffset;
typedef enum { typedef enum SurfaceMaterial {
/* 0 */ SURFACE_MATERIAL_DIRT, /* 0 */ SURFACE_MATERIAL_DIRT,
/* 1 */ SURFACE_MATERIAL_SAND, /* 1 */ SURFACE_MATERIAL_SAND,
/* 2 */ SURFACE_MATERIAL_STONE, /* 2 */ SURFACE_MATERIAL_STONE,
@ -200,13 +200,13 @@ typedef enum {
/* 14 */ SURFACE_MATERIAL_MAX /* 14 */ SURFACE_MATERIAL_MAX
} SurfaceMaterial; } SurfaceMaterial;
typedef enum { typedef enum FloorEffect {
/* 0 */ FLOOR_EFFECT_0, /* 0 */ FLOOR_EFFECT_0,
/* 1 */ FLOOR_EFFECT_1, /* 1 */ FLOOR_EFFECT_1,
/* 2 */ FLOOR_EFFECT_2 /* 2 */ FLOOR_EFFECT_2
} FloorEffect; } FloorEffect;
typedef enum { typedef enum ConveyorSpeed {
/* 0 */ CONVEYOR_SPEED_DISABLED, /* 0 */ CONVEYOR_SPEED_DISABLED,
/* 1 */ CONVEYOR_SPEED_SLOW, /* 1 */ CONVEYOR_SPEED_SLOW,
/* 2 */ CONVEYOR_SPEED_MEDIUM, /* 2 */ CONVEYOR_SPEED_MEDIUM,
@ -237,11 +237,11 @@ typedef enum {
(((conveyorDirection) & 0x3F) << 21) | \ (((conveyorDirection) & 0x3F) << 21) | \
(((unk27) & 1) << 27)) (((unk27) & 1) << 27))
typedef struct { typedef struct SurfaceType {
u32 data[2]; u32 data[2];
} SurfaceType; } SurfaceType;
typedef struct { typedef struct CollisionHeader {
/* 0x00 */ Vec3s minBounds; // minimum coordinates of poly bounding box /* 0x00 */ Vec3s minBounds; // minimum coordinates of poly bounding box
/* 0x06 */ Vec3s maxBounds; // maximum coordinates of poly bounding box /* 0x06 */ Vec3s maxBounds; // maximum coordinates of poly bounding box
/* 0x0C */ u16 numVertices; /* 0x0C */ u16 numVertices;
@ -254,16 +254,16 @@ typedef struct {
/* 0x28 */ WaterBox* waterBoxes; /* 0x28 */ WaterBox* waterBoxes;
} CollisionHeader; // original name: BGDataInfo } CollisionHeader; // original name: BGDataInfo
typedef struct { typedef struct SSNode {
s16 polyId; s16 polyId;
u16 next; // next SSNode index u16 next; // next SSNode index
} SSNode; } SSNode;
typedef struct { typedef struct SSList {
u16 head; // first SSNode index u16 head; // first SSNode index
} SSList; } SSList;
typedef struct { typedef struct SSNodeList {
/* 0x00 */ u16 max; // original name: short_slist_node_size /* 0x00 */ u16 max; // original name: short_slist_node_size
/* 0x02 */ u16 count; // original name: short_slist_node_last_index /* 0x02 */ u16 count; // original name: short_slist_node_last_index
/* 0x04 */ SSNode* tbl; // original name: short_slist_node_tbl /* 0x04 */ SSNode* tbl; // original name: short_slist_node_tbl
@ -271,26 +271,26 @@ typedef struct {
// bg check, and set to 1 if that poly has already been tested. // bg check, and set to 1 if that poly has already been tested.
} SSNodeList; } SSNodeList;
typedef struct { typedef struct DynaSSNodeList {
SSNode* tbl; SSNode* tbl;
s32 count; s32 count;
s32 max; s32 max;
} DynaSSNodeList; } DynaSSNodeList;
typedef struct { typedef struct StaticLookup {
SSList floor; SSList floor;
SSList wall; SSList wall;
SSList ceiling; SSList ceiling;
} StaticLookup; } StaticLookup;
typedef struct { typedef struct DynaLookup {
u16 polyStartIndex; u16 polyStartIndex;
SSList ceiling; SSList ceiling;
SSList wall; SSList wall;
SSList floor; SSList floor;
} DynaLookup; } DynaLookup;
typedef struct { typedef struct BgActor {
/* 0x00 */ struct Actor* actor; /* 0x00 */ struct Actor* actor;
/* 0x04 */ CollisionHeader* colHeader; /* 0x04 */ CollisionHeader* colHeader;
/* 0x08 */ DynaLookup dynaLookup; /* 0x08 */ DynaLookup dynaLookup;
@ -307,7 +307,7 @@ typedef struct {
#define BGACTOR_COLLISION_DISABLED (1 << 2) // The collision of the bgActor is disabled #define BGACTOR_COLLISION_DISABLED (1 << 2) // The collision of the bgActor is disabled
#define BGACTOR_CEILING_COLLISION_DISABLED (1 << 3) // The ceilings in the collision of the bgActor are ignored #define BGACTOR_CEILING_COLLISION_DISABLED (1 << 3) // The ceilings in the collision of the bgActor are ignored
typedef struct { typedef struct DynaCollisionContext {
/* 0x0000 */ u8 bitFlag; /* 0x0000 */ u8 bitFlag;
/* 0x0004 */ BgActor bgActors[BG_ACTOR_MAX]; /* 0x0004 */ BgActor bgActors[BG_ACTOR_MAX];
/* 0x138C */ u16 bgActorFlags[BG_ACTOR_MAX]; /* 0x138C */ u16 bgActorFlags[BG_ACTOR_MAX];
@ -332,7 +332,7 @@ typedef struct CollisionContext {
/* 0x1460 */ u32 memSize; // Size of all allocated memory plus CollisionContext /* 0x1460 */ u32 memSize; // Size of all allocated memory plus CollisionContext
} CollisionContext; // size = 0x1464 } CollisionContext; // size = 0x1464
typedef struct { typedef struct DynaRaycastDown {
/* 0x00 */ struct PlayState* play; /* 0x00 */ struct PlayState* play;
/* 0x04 */ struct CollisionContext* colCtx; /* 0x04 */ struct CollisionContext* colCtx;
/* 0x08 */ u16 xpFlags; /* 0x08 */ u16 xpFlags;
@ -347,7 +347,7 @@ typedef struct {
/* 0x2C */ SSList* ssList; /* 0x2C */ SSList* ssList;
} DynaRaycastDown; } DynaRaycastDown;
typedef struct { typedef struct DynaLineTest {
/* 0x00 */ struct CollisionContext* colCtx; /* 0x00 */ struct CollisionContext* colCtx;
/* 0x04 */ u16 xpFlags; /* 0x04 */ u16 xpFlags;
/* 0x08 */ DynaCollisionContext* dyna; /* 0x08 */ DynaCollisionContext* dyna;

View file

@ -133,7 +133,7 @@
struct Actor; struct Actor;
struct CollisionPoly; struct CollisionPoly;
typedef enum { typedef enum CameraSettingType {
/* 0x00 */ CAM_SET_NONE, /* 0x00 */ CAM_SET_NONE,
/* 0x01 */ CAM_SET_NORMAL0, /* 0x01 */ CAM_SET_NORMAL0,
/* 0x02 */ CAM_SET_NORMAL1, /* 0x02 */ CAM_SET_NORMAL1,
@ -203,7 +203,7 @@ typedef enum {
/* 0x42 */ CAM_SET_MAX /* 0x42 */ CAM_SET_MAX
} CameraSettingType; } CameraSettingType;
typedef enum { typedef enum CameraModeType {
/* 0x00 */ CAM_MODE_NORMAL, /* 0x00 */ CAM_MODE_NORMAL,
/* 0x01 */ CAM_MODE_Z_PARALLEL, // Holding Z but with no target, keeps the camera aligned /* 0x01 */ CAM_MODE_Z_PARALLEL, // Holding Z but with no target, keeps the camera aligned
/* 0x02 */ CAM_MODE_Z_TARGET_FRIENDLY, /* 0x02 */ CAM_MODE_Z_TARGET_FRIENDLY,
@ -228,7 +228,7 @@ typedef enum {
/* 0x15 */ CAM_MODE_MAX /* 0x15 */ CAM_MODE_MAX
} CameraModeType; } CameraModeType;
typedef enum { typedef enum CameraFuncType {
/* 0x00 */ CAM_FUNC_NONE, /* 0x00 */ CAM_FUNC_NONE,
/* 0x01 */ CAM_FUNC_NORM0, /* 0x01 */ CAM_FUNC_NORM0,
/* 0x02 */ CAM_FUNC_NORM1, /* 0x02 */ CAM_FUNC_NORM1,
@ -303,7 +303,7 @@ typedef enum {
/* 0x47 */ CAM_FUNC_MAX /* 0x47 */ CAM_FUNC_MAX
} CameraFuncType; } CameraFuncType;
typedef enum { typedef enum CameraDataType {
/* 0x00 */ CAM_DATA_Y_OFFSET, /* 0x00 */ CAM_DATA_Y_OFFSET,
/* 0x01 */ CAM_DATA_EYE_DIST, /* 0x01 */ CAM_DATA_EYE_DIST,
/* 0x02 */ CAM_DATA_EYE_DIST_NEXT, /* 0x02 */ CAM_DATA_EYE_DIST_NEXT,
@ -337,7 +337,7 @@ typedef enum {
#define CAM_FUNCDATA_INTERFACE_FIELD(interfaceField) \ #define CAM_FUNCDATA_INTERFACE_FIELD(interfaceField) \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct SwingAnimation {
/* 0x00 */ Vec3f collisionClosePoint; /* 0x00 */ Vec3f collisionClosePoint;
/* 0x0C */ struct CollisionPoly* atEyePoly; /* 0x0C */ struct CollisionPoly* atEyePoly;
/* 0x10 */ f32 swingUpdateRate; /* 0x10 */ f32 swingUpdateRate;
@ -347,7 +347,7 @@ typedef struct {
/* 0x1A */ s16 swingUpdateRateTimer; /* 0x1A */ s16 swingUpdateRateTimer;
} SwingAnimation; // size = 0x1C } SwingAnimation; // size = 0x1C
typedef struct { typedef struct Normal1ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 distMin; /* 0x04 */ f32 distMin;
/* 0x08 */ f32 distMax; /* 0x08 */ f32 distMax;
@ -360,7 +360,7 @@ typedef struct {
/* 0x22 */ s16 interfaceField; /* 0x22 */ s16 interfaceField;
} Normal1ReadOnlyData; // size = 0x24 } Normal1ReadOnlyData; // size = 0x24
typedef struct { typedef struct Normal1ReadWriteData {
/* 0x00 */ SwingAnimation swing; /* 0x00 */ SwingAnimation swing;
/* 0x1C */ f32 yOffset; /* 0x1C */ f32 yOffset;
/* 0x20 */ f32 unk_20; /* 0x20 */ f32 unk_20;
@ -370,7 +370,7 @@ typedef struct {
/* 0x2A */ s16 startSwingTimer; /* 0x2A */ s16 startSwingTimer;
} Normal1ReadWriteData; // size = 0x2C } Normal1ReadWriteData; // size = 0x2C
typedef struct { typedef struct Normal1 {
/* 0x00 */ Normal1ReadOnlyData roData; /* 0x00 */ Normal1ReadOnlyData roData;
/* 0x24 */ Normal1ReadWriteData rwData; /* 0x24 */ Normal1ReadWriteData rwData;
} Normal1; // size = 0x50 } Normal1; // size = 0x50
@ -406,7 +406,7 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Normal2ReadOnlyData {
/* 0x00 */ f32 unk_00; /* 0x00 */ f32 unk_00;
/* 0x04 */ f32 unk_04; /* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08; /* 0x08 */ f32 unk_08;
@ -418,7 +418,7 @@ typedef struct {
/* 0x1E */ s16 interfaceField; /* 0x1E */ s16 interfaceField;
} Normal2ReadOnlyData; // size = 0x20 } Normal2ReadOnlyData; // size = 0x20
typedef struct { typedef struct Normal2ReadWriteData {
/* 0x00 */ Vec3f unk_00; /* 0x00 */ Vec3f unk_00;
/* 0x0C */ Vec3f unk_0C; /* 0x0C */ Vec3f unk_0C;
/* 0x18 */ f32 unk_18; /* 0x18 */ f32 unk_18;
@ -429,7 +429,7 @@ typedef struct {
/* 0x28 */ s16 unk_28; /* 0x28 */ s16 unk_28;
} Normal2ReadWriteData; // size = 0x2C } Normal2ReadWriteData; // size = 0x2C
typedef struct { typedef struct Normal2 {
/* 0x00 */ Normal2ReadOnlyData roData; /* 0x00 */ Normal2ReadOnlyData roData;
/* 0x20 */ Normal2ReadWriteData rwData; /* 0x20 */ Normal2ReadWriteData rwData;
} Normal2; // size = 0x4C } Normal2; // size = 0x4C
@ -450,7 +450,7 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Normal3ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 distMin; /* 0x04 */ f32 distMin;
/* 0x08 */ f32 distMax; /* 0x08 */ f32 distMax;
@ -462,7 +462,7 @@ typedef struct {
/* 0x1E */ s16 interfaceField; /* 0x1E */ s16 interfaceField;
} Normal3ReadOnlyData; // size = 0x20 } Normal3ReadOnlyData; // size = 0x20
typedef struct { typedef struct Normal3ReadWriteData {
/* 0x00 */ SwingAnimation swing; /* 0x00 */ SwingAnimation swing;
/* 0x1C */ f32 unk_1C; /* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20; /* 0x20 */ f32 unk_20;
@ -472,7 +472,7 @@ typedef struct {
/* 0x2A */ s16 distTimer; /* 0x2A */ s16 distTimer;
} Normal3ReadWriteData; // size = 0x2C } Normal3ReadWriteData; // size = 0x2C
typedef struct { typedef struct Normal3 {
/* 0x00 */ Normal3ReadOnlyData roData; /* 0x00 */ Normal3ReadOnlyData roData;
/* 0x20 */ Normal3ReadWriteData rwData; /* 0x20 */ Normal3ReadWriteData rwData;
} Normal3; // size = 0x4C } Normal3; // size = 0x4C
@ -488,7 +488,7 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Parallel1ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 distTarget; /* 0x04 */ f32 distTarget;
/* 0x08 */ f32 unk_08; /* 0x08 */ f32 unk_08;
@ -502,7 +502,7 @@ typedef struct {
/* 0x24 */ s16 interfaceField; /* 0x24 */ s16 interfaceField;
} Parallel1ReadOnlyData; // size = 0x28 } Parallel1ReadOnlyData; // size = 0x28
typedef struct { typedef struct Parallel1ReadWriteData {
/* 0x00 */ Vec3f unk_00; /* 0x00 */ Vec3f unk_00;
/* 0x0C */ f32 yTarget; /* 0x0C */ f32 yTarget;
/* 0x10 */ s16 unk_10; /* 0x10 */ s16 unk_10;
@ -512,7 +512,7 @@ typedef struct {
/* 0x18 */ s16 animTimer; /* 0x18 */ s16 animTimer;
} Parallel1ReadWriteData; // size = 0x1C } Parallel1ReadWriteData; // size = 0x1C
typedef struct { typedef struct Parallel1 {
/* 0x00 */ Parallel1ReadOnlyData roData; /* 0x00 */ Parallel1ReadOnlyData roData;
/* 0x28 */ Parallel1ReadWriteData rwData; /* 0x28 */ Parallel1ReadWriteData rwData;
} Parallel1; // size = 0x44 } Parallel1; // size = 0x44
@ -542,7 +542,7 @@ typedef struct {
#define PARALLEL3_FLAG_0 (1 << 0) #define PARALLEL3_FLAG_0 (1 << 0)
#define PARALLEL3_FLAG_1 (1 << 1) #define PARALLEL3_FLAG_1 (1 << 1)
typedef struct { typedef struct Jump1ReadOnlyData {
/* 0x00 */ f32 atYOffset; /* 0x00 */ f32 atYOffset;
/* 0x04 */ f32 distMin; /* 0x04 */ f32 distMin;
/* 0x08 */ f32 distMax; /* 0x08 */ f32 distMax;
@ -553,7 +553,7 @@ typedef struct {
/* 0x1C */ s16 interfaceField; /* 0x1C */ s16 interfaceField;
} Jump1ReadOnlyData; // size = 0x20 } Jump1ReadOnlyData; // size = 0x20
typedef struct { typedef struct Jump1ReadWriteData {
/* 0x00 */ SwingAnimation swing; /* 0x00 */ SwingAnimation swing;
/* 0x1C */ f32 unk_1C; /* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20; /* 0x20 */ f32 unk_20;
@ -561,7 +561,7 @@ typedef struct {
/* 0x26 */ s16 unk_26; /* 0x26 */ s16 unk_26;
} Jump1ReadWriteData; // size = 0x28 } Jump1ReadWriteData; // size = 0x28
typedef struct { typedef struct Jump1 {
/* 0x00 */ Jump1ReadOnlyData roData; /* 0x00 */ Jump1ReadOnlyData roData;
/* 0x20 */ Jump1ReadWriteData rwData; /* 0x20 */ Jump1ReadWriteData rwData;
} Jump1; // size = 0x48 } Jump1; // size = 0x48
@ -579,7 +579,7 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Jump2ReadOnlyData {
/* 0x00 */ f32 atYOffset; /* 0x00 */ f32 atYOffset;
/* 0x04 */ f32 minDist; /* 0x04 */ f32 minDist;
/* 0x08 */ f32 maxDist; /* 0x08 */ f32 maxDist;
@ -591,7 +591,7 @@ typedef struct {
/* 0x20 */ s16 interfaceField; /* 0x20 */ s16 interfaceField;
} Jump2ReadOnlyData; // size = 0x24 } Jump2ReadOnlyData; // size = 0x24
typedef struct { typedef struct Jump2ReadWriteData {
/* 0x0 */ f32 floorY; /* 0x0 */ f32 floorY;
/* 0x4 */ s16 yawTarget; /* 0x4 */ s16 yawTarget;
/* 0x6 */ s16 initYawDiff; // unused, set but not read. /* 0x6 */ s16 initYawDiff; // unused, set but not read.
@ -600,7 +600,7 @@ typedef struct {
/* 0xC */ s16 animTimer; /* 0xC */ s16 animTimer;
} Jump2ReadWriteData; // size = 0x10 } Jump2ReadWriteData; // size = 0x10
typedef struct { typedef struct Jump2 {
/* 0x00 */ Jump2ReadOnlyData roData; /* 0x00 */ Jump2ReadOnlyData roData;
/* 0x24 */ Jump2ReadWriteData rwData; /* 0x24 */ Jump2ReadWriteData rwData;
} Jump2; // size = 0x34 } Jump2; // size = 0x34
@ -619,7 +619,7 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Jump3ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 distMin; /* 0x04 */ f32 distMin;
/* 0x08 */ f32 distMax; /* 0x08 */ f32 distMax;
@ -632,14 +632,14 @@ typedef struct {
/* 0x22 */ s16 interfaceField; /* 0x22 */ s16 interfaceField;
} Jump3ReadOnlyData; // size = 0x24 } Jump3ReadOnlyData; // size = 0x24
typedef struct { typedef struct Jump3ReadWriteData {
/* 0x00 */ SwingAnimation swing; /* 0x00 */ SwingAnimation swing;
/* 0x1C */ f32 unk_1C; /* 0x1C */ f32 unk_1C;
/* 0x20 */ s16 animTimer; /* 0x20 */ s16 animTimer;
/* 0x22 */ s16 mode; /* 0x22 */ s16 mode;
} Jump3ReadWriteData; // size = 0x24 } Jump3ReadWriteData; // size = 0x24
typedef struct { typedef struct Jump3 {
/* 0x00 */ Jump3ReadOnlyData roData; /* 0x00 */ Jump3ReadOnlyData roData;
/* 0x24 */ Jump3ReadWriteData rwData; /* 0x24 */ Jump3ReadWriteData rwData;
} Jump3; // size = 0x48 } Jump3; // size = 0x48
@ -660,7 +660,7 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Battle1ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 distance; /* 0x04 */ f32 distance;
/* 0x08 */ f32 swingYawInitial; /* 0x08 */ f32 swingYawInitial;
@ -675,7 +675,7 @@ typedef struct {
/* 0x2C */ s16 interfaceField; /* 0x2C */ s16 interfaceField;
} Battle1ReadOnlyData; // size = 0x30 } Battle1ReadOnlyData; // size = 0x30
typedef struct { typedef struct Battle1ReadWriteData {
/* 0x00 */ f32 initialEyeToAtDist; /* 0x00 */ f32 initialEyeToAtDist;
/* 0x04 */ f32 roll; /* 0x04 */ f32 roll;
/* 0x08 */ f32 yPosOffset; /* 0x08 */ f32 yPosOffset;
@ -688,7 +688,7 @@ typedef struct {
/* 0x1C */ s16 chargeTimer; /* 0x1C */ s16 chargeTimer;
} Battle1ReadWriteData; // size = 0x20 } Battle1ReadWriteData; // size = 0x20
typedef struct { typedef struct Battle1 {
/* 0x00 */ Battle1ReadOnlyData roData; /* 0x00 */ Battle1ReadOnlyData roData;
/* 0x30 */ Battle1ReadWriteData rwData; /* 0x30 */ Battle1ReadWriteData rwData;
} Battle1; // size = 0x50 } Battle1; // size = 0x50
@ -711,7 +711,7 @@ typedef struct {
{ groundYOffset, CAM_DATA_GROUND_Y_OFFSET }, \ { groundYOffset, CAM_DATA_GROUND_Y_OFFSET }, \
{ groundAtLerpStepScale, CAM_DATA_GROUND_AT_LERP_STEP_SCALE } { groundAtLerpStepScale, CAM_DATA_GROUND_AT_LERP_STEP_SCALE }
typedef struct { typedef struct Battle4ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 rTarget; /* 0x04 */ f32 rTarget;
/* 0x08 */ s16 pitchTarget; /* 0x08 */ s16 pitchTarget;
@ -722,11 +722,11 @@ typedef struct {
/* 0x1A */ s16 unk_1A; /* 0x1A */ s16 unk_1A;
} Battle4ReadOnlyData; // size = 0x1C } Battle4ReadOnlyData; // size = 0x1C
typedef struct { typedef struct Battle4ReadWriteData {
/* 0x0 */ s16 animTimer; /* 0x0 */ s16 animTimer;
} Battle4ReadWriteData; // size = 0x4 } Battle4ReadWriteData; // size = 0x4
typedef struct { typedef struct Battle4 {
/* 0x00 */ Battle4ReadOnlyData roData; /* 0x00 */ Battle4ReadOnlyData roData;
/* 0x1C */ Battle4ReadWriteData rwData; /* 0x1C */ Battle4ReadWriteData rwData;
} Battle4; // size = 0x20 } Battle4; // size = 0x20
@ -740,7 +740,7 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct KeepOn1ReadOnlyData {
/* 0x00 */ f32 unk_00; /* 0x00 */ f32 unk_00;
/* 0x04 */ f32 unk_04; /* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08; /* 0x08 */ f32 unk_08;
@ -756,7 +756,7 @@ typedef struct {
/* 0x30 */ s16 interfaceField; /* 0x30 */ s16 interfaceField;
} KeepOn1ReadOnlyData; // size = 0x34 } KeepOn1ReadOnlyData; // size = 0x34
typedef struct { typedef struct KeepOn1ReadWriteData {
/* 0x00 */ f32 unk_00; /* 0x00 */ f32 unk_00;
/* 0x04 */ f32 unk_04; /* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08; /* 0x08 */ f32 unk_08;
@ -767,7 +767,7 @@ typedef struct {
/* 0x16 */ s16 unk_16; /* 0x16 */ s16 unk_16;
} KeepOn1ReadWriteData; // size = 0x18 } KeepOn1ReadWriteData; // size = 0x18
typedef struct { typedef struct KeepOn1 {
/* 0x00 */ KeepOn1ReadOnlyData roData; /* 0x00 */ KeepOn1ReadOnlyData roData;
/* 0x34 */ KeepOn1ReadWriteData rwData; /* 0x34 */ KeepOn1ReadWriteData rwData;
} KeepOn1; // size = 0x4C } KeepOn1; // size = 0x4C
@ -790,7 +790,7 @@ typedef struct {
{ groundYOffset, CAM_DATA_GROUND_Y_OFFSET }, \ { groundYOffset, CAM_DATA_GROUND_Y_OFFSET }, \
{ groundAtLerpStepScale, CAM_DATA_GROUND_AT_LERP_STEP_SCALE } { groundAtLerpStepScale, CAM_DATA_GROUND_AT_LERP_STEP_SCALE }
typedef struct { typedef struct KeepOn3ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 minDist; /* 0x04 */ f32 minDist;
/* 0x08 */ f32 maxDist; /* 0x08 */ f32 maxDist;
@ -805,7 +805,7 @@ typedef struct {
/* 0x2A */ s16 interfaceField; /* 0x2A */ s16 interfaceField;
} KeepOn3ReadOnlyData; // size = 0x2C } KeepOn3ReadOnlyData; // size = 0x2C
typedef struct { typedef struct KeepOn3ReadWriteData {
/* 0x00 */ f32 eyeToAtTargetR; /* 0x00 */ f32 eyeToAtTargetR;
/* 0x08 */ f32 eyeToAtTargetYaw; /* 0x08 */ f32 eyeToAtTargetYaw;
/* 0x04 */ f32 eyeToAtTargetPitch; /* 0x04 */ f32 eyeToAtTargetPitch;
@ -814,7 +814,7 @@ typedef struct {
/* 0x1C */ s16 animTimer; /* 0x1C */ s16 animTimer;
} KeepOn3ReadWriteData; // size = 0x20 } KeepOn3ReadWriteData; // size = 0x20
typedef struct { typedef struct KeepOn3 {
/* 0x00 */ KeepOn3ReadOnlyData roData; /* 0x00 */ KeepOn3ReadOnlyData roData;
/* 0x2C */ KeepOn3ReadWriteData rwData; /* 0x2C */ KeepOn3ReadWriteData rwData;
} KeepOn3; // size = 0x4C } KeepOn3; // size = 0x4C
@ -837,7 +837,7 @@ typedef struct {
{ yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct KeepOn4ReadOnlyData {
/* 0x00 */ f32 unk_00; /* 0x00 */ f32 unk_00;
/* 0x04 */ f32 unk_04; /* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08; /* 0x08 */ f32 unk_08;
@ -849,7 +849,7 @@ typedef struct {
/* 0x1E */ s16 unk_1E; /* 0x1E */ s16 unk_1E;
} KeepOn4ReadOnlyData; // size = 0x20 } KeepOn4ReadOnlyData; // size = 0x20
typedef struct { typedef struct KeepOn4ReadWriteData {
/* 0x00 */ f32 unk_00; /* 0x00 */ f32 unk_00;
/* 0x04 */ f32 unk_04; /* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08; /* 0x08 */ f32 unk_08;
@ -860,7 +860,7 @@ typedef struct {
/* 0x14 */ s16 unk_14; /* 0x14 */ s16 unk_14;
} KeepOn4ReadWriteData; // size = 0x18 } KeepOn4ReadWriteData; // size = 0x18
typedef struct { typedef struct KeepOn4 {
/* 0x00 */ KeepOn4ReadOnlyData roData; /* 0x00 */ KeepOn4ReadOnlyData roData;
/* 0x20 */ KeepOn4ReadWriteData rwData; /* 0x20 */ KeepOn4ReadWriteData rwData;
} KeepOn4; // size = 0x38 } KeepOn4; // size = 0x38
@ -885,19 +885,19 @@ typedef struct {
{ yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \
{ unk_22, CAM_DATA_UNK_22 } { unk_22, CAM_DATA_UNK_22 }
typedef struct { typedef struct KeepOn0ReadOnlyData {
/* 0x00 */ f32 fovScale; /* 0x00 */ f32 fovScale;
/* 0x04 */ f32 yawScale; /* 0x04 */ f32 yawScale;
/* 0x08 */ s16 timerInit; /* 0x08 */ s16 timerInit;
/* 0x0A */ s16 interfaceField; /* 0x0A */ s16 interfaceField;
} KeepOn0ReadOnlyData; // size = 0x0C } KeepOn0ReadOnlyData; // size = 0x0C
typedef struct { typedef struct KeepOn0ReadWriteData {
/* 0x0 */ f32 fovTarget; /* 0x0 */ f32 fovTarget;
/* 0x4 */ s16 animTimer; /* 0x4 */ s16 animTimer;
} KeepOn0ReadWriteData; // size = 0x8 } KeepOn0ReadWriteData; // size = 0x8
typedef struct { typedef struct KeepOn0 {
/* 0x00 */ KeepOn0ReadOnlyData roData; /* 0x00 */ KeepOn0ReadOnlyData roData;
/* 0x0C */ KeepOn0ReadWriteData rwData; /* 0x0C */ KeepOn0ReadWriteData rwData;
} KeepOn0; // size = 0x14 } KeepOn0; // size = 0x14
@ -908,19 +908,19 @@ typedef struct {
{ yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Fixed1ReadOnlyData {
/* 0x00 */ f32 unk_00; // seems to be unused? /* 0x00 */ f32 unk_00; // seems to be unused?
/* 0x04 */ f32 lerpStep; /* 0x04 */ f32 lerpStep;
/* 0x08 */ f32 fov; /* 0x08 */ f32 fov;
/* 0x0C */ s16 interfaceField; /* 0x0C */ s16 interfaceField;
} Fixed1ReadOnlyData; // size = 0x10 } Fixed1ReadOnlyData; // size = 0x10
typedef struct { typedef struct Fixed1ReadWriteData {
/* 0x00 */ PosRot eyePosRotTarget; /* 0x00 */ PosRot eyePosRotTarget;
/* 0x14 */ s16 fov; /* 0x14 */ s16 fov;
} Fixed1ReadWriteData; // size = 0x18 } Fixed1ReadWriteData; // size = 0x18
typedef struct { typedef struct Fixed1 {
/* 0x00 */ Fixed1ReadOnlyData roData; /* 0x00 */ Fixed1ReadOnlyData roData;
/* 0x10 */ Fixed1ReadWriteData rwData; /* 0x10 */ Fixed1ReadWriteData rwData;
} Fixed1; // size = 0x28 } Fixed1; // size = 0x28
@ -931,7 +931,7 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Fixed2ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 eyeStepScale; /* 0x04 */ f32 eyeStepScale;
/* 0x08 */ f32 posStepScale; /* 0x08 */ f32 posStepScale;
@ -939,12 +939,12 @@ typedef struct {
/* 0x10 */ s16 interfaceField; /* 0x10 */ s16 interfaceField;
} Fixed2ReadOnlyData; // size = 0x14 } Fixed2ReadOnlyData; // size = 0x14
typedef struct { typedef struct Fixed2ReadWriteData {
/* 0x0 */ Vec3f eye; /* 0x0 */ Vec3f eye;
/* 0xC */ s16 fov; /* 0xC */ s16 fov;
} Fixed2ReadWriteData; // size = 0x10 } Fixed2ReadWriteData; // size = 0x10
typedef struct { typedef struct Fixed2 {
/* 0x00 */ Fixed2ReadOnlyData roData; /* 0x00 */ Fixed2ReadOnlyData roData;
/* 0x14 */ Fixed2ReadWriteData rwData; /* 0x14 */ Fixed2ReadWriteData rwData;
} Fixed2; // size = 0x24 } Fixed2; // size = 0x24
@ -959,23 +959,23 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Fixed3ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Fixed3ReadOnlyData; // size = 0x4 } Fixed3ReadOnlyData; // size = 0x4
typedef struct { typedef struct Fixed3ReadWriteData {
/* 0x0 */ Vec3s rot; /* 0x0 */ Vec3s rot;
/* 0x6 */ s16 fov; /* 0x6 */ s16 fov;
/* 0x8 */ s16 updDirTimer; /* 0x8 */ s16 updDirTimer;
/* 0xA */ s16 roomImageOverrideBgCamIndex; /* 0xA */ s16 roomImageOverrideBgCamIndex;
} Fixed3ReadWriteData; // size = 0xC } Fixed3ReadWriteData; // size = 0xC
typedef struct { typedef struct Fixed3 {
/* 0x0 */ Fixed3ReadOnlyData roData; /* 0x0 */ Fixed3ReadOnlyData roData;
/* 0x4 */ Fixed3ReadWriteData rwData; /* 0x4 */ Fixed3ReadWriteData rwData;
} Fixed3; // size = 0x10 } Fixed3; // size = 0x10
typedef struct { typedef struct Fixed4ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 speedToEyePos; /* 0x04 */ f32 speedToEyePos;
/* 0x08 */ f32 followSpeed; /* 0x08 */ f32 followSpeed;
@ -983,12 +983,12 @@ typedef struct {
/* 0x10 */ s16 interfaceField; /* 0x10 */ s16 interfaceField;
} Fixed4ReadOnlyData; // size = 0x14 } Fixed4ReadOnlyData; // size = 0x14
typedef struct { typedef struct Fixed4ReadWriteData {
/* 0x0 */ Vec3f eyeTarget; /* 0x0 */ Vec3f eyeTarget;
/* 0xC */ f32 followSpeed; /* 0xC */ f32 followSpeed;
} Fixed4ReadWriteData; // size = 0x10 } Fixed4ReadWriteData; // size = 0x10
typedef struct { typedef struct Fixed4 {
/* 0x00 */ Fixed4ReadOnlyData roData; /* 0x00 */ Fixed4ReadOnlyData roData;
/* 0x14 */ Fixed4ReadWriteData rwData; /* 0x14 */ Fixed4ReadWriteData rwData;
} Fixed4; // size = 0x24 } Fixed4; // size = 0x24
@ -1002,7 +1002,7 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Subj3ReadOnlyData {
/* 0x00 */ f32 eyeNextYOffset; /* 0x00 */ f32 eyeNextYOffset;
/* 0x04 */ f32 eyeDist; /* 0x04 */ f32 eyeDist;
/* 0x08 */ f32 eyeNextDist; /* 0x08 */ f32 eyeNextDist;
@ -1012,14 +1012,14 @@ typedef struct {
/* 0x20 */ s16 interfaceField; /* 0x20 */ s16 interfaceField;
} Subj3ReadOnlyData; // size = 0x24 } Subj3ReadOnlyData; // size = 0x24
typedef struct { typedef struct Subj3ReadWriteData {
/* 0x0 */ f32 r; /* 0x0 */ f32 r;
/* 0x4 */ s16 yaw; /* 0x4 */ s16 yaw;
/* 0x6 */ s16 pitch; /* 0x6 */ s16 pitch;
/* 0x8 */ s16 animTimer; /* 0x8 */ s16 animTimer;
} Subj3ReadWriteData; // size = 0xC } Subj3ReadWriteData; // size = 0xC
typedef struct { typedef struct Subj3 {
/* 0x00 */ Subj3ReadOnlyData roData; /* 0x00 */ Subj3ReadOnlyData roData;
/* 0x24 */ Subj3ReadWriteData rwData; /* 0x24 */ Subj3ReadWriteData rwData;
} Subj3; // size = 0x30 } Subj3; // size = 0x30
@ -1035,11 +1035,11 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Subj4ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Subj4ReadOnlyData; // size = 0x4 } Subj4ReadOnlyData; // size = 0x4
typedef struct { typedef struct Subj4ReadWriteData {
/* 0x00 */ InfiniteLine crawlspaceLine; /* 0x00 */ InfiniteLine crawlspaceLine;
/* 0x18 */ Vec3f unk_18; // unused /* 0x18 */ Vec3f unk_18; // unused
/* 0x24 */ f32 xzSpeed; /* 0x24 */ f32 xzSpeed;
@ -1050,7 +1050,7 @@ typedef struct {
/* 0x32 */ s16 zoomTimer; /* 0x32 */ s16 zoomTimer;
} Subj4ReadWriteData; // size = 0x34 } Subj4ReadWriteData; // size = 0x34
typedef struct { typedef struct Subj4 {
/* 0x00 */ Subj4ReadOnlyData roData; /* 0x00 */ Subj4ReadOnlyData roData;
/* 0x04 */ Subj4ReadWriteData rwData; /* 0x04 */ Subj4ReadWriteData rwData;
} Subj4; // size = 0x38 } Subj4; // size = 0x38
@ -1063,20 +1063,20 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Data4ReadOnlyData {
/* 0x0 */ f32 yOffset; /* 0x0 */ f32 yOffset;
/* 0x4 */ f32 fov; /* 0x4 */ f32 fov;
/* 0x8 */ s16 interfaceField; /* 0x8 */ s16 interfaceField;
} Data4ReadOnlyData; // size = 0xC } Data4ReadOnlyData; // size = 0xC
typedef struct { typedef struct Data4ReadWriteData {
/* 0x00 */ PosRot eyePosRot; /* 0x00 */ PosRot eyePosRot;
/* 0x14 */ char unk_14[0x8]; /* 0x14 */ char unk_14[0x8];
/* 0x1C */ s16 fov; /* 0x1C */ s16 fov;
/* 0x1E */ s16 flags; /* 0x1E */ s16 flags;
} Data4ReadWriteData; // size = 0x20 } Data4ReadWriteData; // size = 0x20
typedef struct { typedef struct Data4 {
/* 0x00 */ Data4ReadOnlyData roData; /* 0x00 */ Data4ReadOnlyData roData;
/* 0x0C */ Data4ReadWriteData rwData; /* 0x0C */ Data4ReadWriteData rwData;
} Data4; // size = 0x2C } Data4; // size = 0x2C
@ -1086,7 +1086,7 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Unique1ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 distMin; /* 0x04 */ f32 distMin;
/* 0x08 */ f32 distMax; /* 0x08 */ f32 distMax;
@ -1097,14 +1097,14 @@ typedef struct {
/* 0x1A */ s16 interfaceField; /* 0x1A */ s16 interfaceField;
} Unique1ReadOnlyData; // size = 0x1C } Unique1ReadOnlyData; // size = 0x1C
typedef struct { typedef struct Unique1ReadWriteData {
/* 0x0 */ f32 unk_00; // unused /* 0x0 */ f32 unk_00; // unused
/* 0x4 */ s16 yawTarget; /* 0x4 */ s16 yawTarget;
/* 0x6 */ s16 yawTargetAdj; /* 0x6 */ s16 yawTargetAdj;
/* 0x8 */ s16 timer; /* 0x8 */ s16 timer;
} Unique1ReadWriteData; // size = 0xC } Unique1ReadWriteData; // size = 0xC
typedef struct { typedef struct Unique1 {
/* 0x00 */ Unique1ReadOnlyData roData; /* 0x00 */ Unique1ReadOnlyData roData;
/* 0x1C */ Unique1ReadWriteData rwData; /* 0x1C */ Unique1ReadWriteData rwData;
} Unique1; // size = 0x28 } Unique1; // size = 0x28
@ -1118,19 +1118,19 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Unique2ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 distTarget; /* 0x04 */ f32 distTarget;
/* 0x08 */ f32 fovTarget; /* 0x08 */ f32 fovTarget;
/* 0x0C */ s16 interfaceField; /* 0x0C */ s16 interfaceField;
} Unique2ReadOnlyData; // size = 0x10 } Unique2ReadOnlyData; // size = 0x10
typedef struct { typedef struct Unique2ReadWriteData {
/* 0x0 */ f32 unk_00; /* 0x0 */ f32 unk_00;
/* 0x4 */ s16 unk_04; /* 0x4 */ s16 unk_04;
} Unique2ReadWriteData; // size = 0x8 } Unique2ReadWriteData; // size = 0x8
typedef struct { typedef struct Unique2 {
/* 0x00 */ Unique2ReadOnlyData roData; /* 0x00 */ Unique2ReadOnlyData roData;
/* 0x10 */ Unique2ReadWriteData rwData; /* 0x10 */ Unique2ReadWriteData rwData;
} Unique2; // size = 0x18 } Unique2; // size = 0x18
@ -1145,7 +1145,7 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct DoorParams {
/* 0x0 */ struct Actor* doorActor; /* 0x0 */ struct Actor* doorActor;
/* 0x4 */ s16 bgCamIndex; /* 0x4 */ s16 bgCamIndex;
/* 0x6 */ s16 timer1; /* 0x6 */ s16 timer1;
@ -1153,18 +1153,18 @@ typedef struct {
/* 0xA */ s16 timer3; /* 0xA */ s16 timer3;
} DoorParams; // size = 0xC } DoorParams; // size = 0xC
typedef struct { typedef struct Unique3ReadOnlyData {
/* 0x0 */ f32 yOffset; /* 0x0 */ f32 yOffset;
/* 0x4 */ f32 fov; /* 0x4 */ f32 fov;
/* 0x8 */ s16 interfaceField; /* 0x8 */ s16 interfaceField;
} Unique3ReadOnlyData; // size = 0xC } Unique3ReadOnlyData; // size = 0xC
typedef struct { typedef struct Unique3ReadWriteData {
/* 0x0 */ f32 initialFov; /* 0x0 */ f32 initialFov;
/* 0x4 */ f32 initialDist; /* 0x4 */ f32 initialDist;
} Unique3ReadWriteData; // size = 0x8 } Unique3ReadWriteData; // size = 0x8
typedef struct { typedef struct Unique3 {
/* 0x00 */ Unique3ReadOnlyData roData; /* 0x00 */ Unique3ReadOnlyData roData;
/* 0x0C */ Unique3ReadWriteData rwData; /* 0x0C */ Unique3ReadWriteData rwData;
} Unique3; // size = 0x14 } Unique3; // size = 0x14
@ -1177,44 +1177,44 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Unique0ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Unique0ReadOnlyData; // size = 0x4 } Unique0ReadOnlyData; // size = 0x4
typedef struct { typedef struct Unique0ReadWriteData {
/* 0x00 */ Vec3f initalPos; /* 0x00 */ Vec3f initalPos;
/* 0x0C */ s16 animTimer; /* 0x0C */ s16 animTimer;
/* 0x10 */ InfiniteLine eyeAndDirection; /* 0x10 */ InfiniteLine eyeAndDirection;
} Unique0ReadWriteData; // size = 0x28 } Unique0ReadWriteData; // size = 0x28
typedef struct { typedef struct Unique0 {
/* 0x00 */ Unique0ReadOnlyData roData; /* 0x00 */ Unique0ReadOnlyData roData;
/* 0x04 */ Unique0ReadWriteData rwData; /* 0x04 */ Unique0ReadWriteData rwData;
} Unique0; // size = 0x2C } Unique0; // size = 0x2C
#define UNIQUE0_FLAG_0 (1 << 0) #define UNIQUE0_FLAG_0 (1 << 0)
typedef struct { typedef struct Unique6ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Unique6ReadOnlyData; // size = 0x4 } Unique6ReadOnlyData; // size = 0x4
typedef struct { typedef struct Unique6 {
/* 0x0 */ Unique6ReadOnlyData roData; /* 0x0 */ Unique6ReadOnlyData roData;
} Unique6; // size = 0x4 } Unique6; // size = 0x4
#define UNIQUE6_FLAG_0 (1 << 0) #define UNIQUE6_FLAG_0 (1 << 0)
typedef struct { typedef struct Unique7ReadOnlyData {
/* 0x0 */ f32 fov; /* 0x0 */ f32 fov;
/* 0x4 */ s16 interfaceField; /* 0x4 */ s16 interfaceField;
/* 0x6 */ s16 align; /* 0x6 */ s16 align;
} Unique7ReadOnlyData; // size = 0x8 } Unique7ReadOnlyData; // size = 0x8
typedef struct { typedef struct Unique7ReadWriteData {
/* 0x0 */ Vec3s unk_00; /* 0x0 */ Vec3s unk_00;
} Unique7ReadWriteData; // size = 0x8 } Unique7ReadWriteData; // size = 0x8
typedef struct { typedef struct Unique7 {
/* 0x00 */ Unique7ReadOnlyData roData; /* 0x00 */ Unique7ReadOnlyData roData;
/* 0x08 */ Unique7ReadWriteData rwData; /* 0x08 */ Unique7ReadWriteData rwData;
} Unique7; // size = 0x10 } Unique7; // size = 0x10
@ -1223,7 +1223,7 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef enum { typedef enum OnePointCsAction {
/* 0x1 */ ONEPOINT_CS_ACTION_ID_1 = 1, /* 0x1 */ ONEPOINT_CS_ACTION_ID_1 = 1,
/* 0x2 */ ONEPOINT_CS_ACTION_ID_2, /* 0x2 */ ONEPOINT_CS_ACTION_ID_2,
/* 0x3 */ ONEPOINT_CS_ACTION_ID_3, /* 0x3 */ ONEPOINT_CS_ACTION_ID_3,
@ -1272,7 +1272,7 @@ typedef enum {
* 0x10: ? unused * 0x10: ? unused
* 0x20: focus on player * 0x20: focus on player
*/ */
typedef struct { typedef struct OnePointCsFull {
/* 0x00 */ u8 actionFlags; /* 0x00 */ u8 actionFlags;
/* 0x01 */ u8 initField; /* 0x01 */ u8 initField;
/* 0x02 */ s16 viewFlags; /* 0x02 */ s16 viewFlags;
@ -1284,16 +1284,16 @@ typedef struct {
/* 0x1C */ Vec3f eyeTargetInit; /* 0x1C */ Vec3f eyeTargetInit;
} OnePointCsFull; // size = 0x28 } OnePointCsFull; // size = 0x28
typedef struct { typedef struct OnePointCsInfo {
/* 0x0 */ s32 keyFrameCount; /* 0x0 */ s32 keyFrameCount;
/* 0x4 */ OnePointCsFull* keyFrames; /* 0x4 */ OnePointCsFull* keyFrames;
} OnePointCsInfo; // size = 0x8 } OnePointCsInfo; // size = 0x8
typedef struct { typedef struct Unique9ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Unique9ReadOnlyData; // size = 0x40 } Unique9ReadOnlyData; // size = 0x40
typedef struct { typedef struct Unique9ReadWriteData {
/* 0x00 */ OnePointCsFull* curKeyFrame; /* 0x00 */ OnePointCsFull* curKeyFrame;
/* 0x04 */ Vec3f atTarget; /* 0x04 */ Vec3f atTarget;
/* 0x10 */ Vec3f eyeTarget; /* 0x10 */ Vec3f eyeTarget;
@ -1307,40 +1307,40 @@ typedef struct {
/* 0x3C */ s16 keyFrameTimer; /* 0x3C */ s16 keyFrameTimer;
} Unique9ReadWriteData; // size = 0x40 } Unique9ReadWriteData; // size = 0x40
typedef struct { typedef struct Unique9 {
/* 0x00 */ OnePointCsInfo csInfo; /* 0x00 */ OnePointCsInfo csInfo;
/* 0x08 */ Unique9ReadOnlyData roData; /* 0x08 */ Unique9ReadOnlyData roData;
/* 0x0C */ Unique9ReadWriteData rwData; /* 0x0C */ Unique9ReadWriteData rwData;
} Unique9; // size = 0x4C } Unique9; // size = 0x4C
typedef struct { typedef struct Demo1ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Demo1ReadOnlyData; // size = 0x4 } Demo1ReadOnlyData; // size = 0x4
typedef struct { typedef struct Demo1ReadWriteData {
/* 0x0 */ f32 curFrame; /* 0x0 */ f32 curFrame;
/* 0x4 */ s16 keyframe; /* 0x4 */ s16 keyframe;
} Demo1ReadWriteData; // size = 0x14 } Demo1ReadWriteData; // size = 0x14
typedef struct { typedef struct Demo1 {
/* 0x00 */ Demo1ReadOnlyData roData; /* 0x00 */ Demo1ReadOnlyData roData;
/* 0x04 */ Demo1ReadWriteData rwData; /* 0x04 */ Demo1ReadWriteData rwData;
} Demo1; // size = 0x18 } Demo1; // size = 0x18
typedef struct { typedef struct Demo3ReadOnlyData {
/* 0x0 */ f32 fov; /* 0x0 */ f32 fov;
/* 0x4 */ f32 unk_04; // unused /* 0x4 */ f32 unk_04; // unused
/* 0x8 */ s16 interfaceField; /* 0x8 */ s16 interfaceField;
} Demo3ReadOnlyData; // size = 0xC } Demo3ReadOnlyData; // size = 0xC
typedef struct { typedef struct Demo3ReadWriteData {
/* 0x00 */ Vec3f initialAt; /* 0x00 */ Vec3f initialAt;
/* 0x0C */ f32 unk_0C; /* 0x0C */ f32 unk_0C;
/* 0x10 */ s16 animFrame; /* 0x10 */ s16 animFrame;
/* 0x12 */ s16 yawDir; /* 0x12 */ s16 yawDir;
} Demo3ReadWriteData; // size = 0x14 } Demo3ReadWriteData; // size = 0x14
typedef struct { typedef struct Demo3 {
/* 0x00 */ Demo3ReadOnlyData roData; /* 0x00 */ Demo3ReadOnlyData roData;
/* 0x0C */ Demo3ReadWriteData rwData; /* 0x0C */ Demo3ReadWriteData rwData;
} Demo3; // size = 0x20 } Demo3; // size = 0x20
@ -1350,33 +1350,33 @@ typedef struct {
{ atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \ { atLerpStepScale, CAM_DATA_AT_LERP_STEP_SCALE }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Demo6ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
/* 0x2 */ s16 unk_02; /* 0x2 */ s16 unk_02;
} Demo6ReadOnlyData; // size = 0x4 } Demo6ReadOnlyData; // size = 0x4
typedef struct { typedef struct Demo6ReadWriteData {
/* 0x0 */ s16 animTimer; /* 0x0 */ s16 animTimer;
/* 0x4 */ Vec3f atTarget; /* 0x4 */ Vec3f atTarget;
} Demo6ReadWriteData; // size = 0x10 } Demo6ReadWriteData; // size = 0x10
typedef struct { typedef struct Demo6 {
/* 0x00 */ Demo6ReadOnlyData roData; /* 0x00 */ Demo6ReadOnlyData roData;
/* 0x04 */ Demo6ReadWriteData rwData; /* 0x04 */ Demo6ReadWriteData rwData;
} Demo6; // size = 0x14 } Demo6; // size = 0x14
typedef struct { typedef struct OnePointCamData {
/* 0x0 */ CutsceneCameraPoint* atPoints; /* 0x0 */ CutsceneCameraPoint* atPoints;
/* 0x4 */ CutsceneCameraPoint* eyePoints; /* 0x4 */ CutsceneCameraPoint* eyePoints;
/* 0x8 */ s16 actionParameters; /* 0x8 */ s16 actionParameters;
/* 0xA */ s16 initTimer; /* 0xA */ s16 initTimer;
} OnePointCamData; // size = 0xC } OnePointCamData; // size = 0xC
typedef struct { typedef struct Demo9ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Demo9ReadOnlyData; // size = 0x4 } Demo9ReadOnlyData; // size = 0x4
typedef struct { typedef struct Demo9ReadWriteData {
/* 0x0 */ f32 curFrame; /* 0x0 */ f32 curFrame;
/* 0x4 */ s16 keyframe; /* 0x4 */ s16 keyframe;
/* 0x6 */ s16 doLERPAt; /* 0x6 */ s16 doLERPAt;
@ -1384,7 +1384,7 @@ typedef struct {
/* 0xA */ s16 animTimer; /* 0xA */ s16 animTimer;
} Demo9ReadWriteData; // size = 0xC } Demo9ReadWriteData; // size = 0xC
typedef struct { typedef struct Demo9 {
/* 0x00 */ OnePointCamData onePointCamData; /* 0x00 */ OnePointCamData onePointCamData;
/* 0x0C */ Demo9ReadOnlyData roData; /* 0x0C */ Demo9ReadOnlyData roData;
/* 0x10 */ Demo9ReadWriteData rwData; /* 0x10 */ Demo9ReadWriteData rwData;
@ -1393,12 +1393,12 @@ typedef struct {
#define DEMO9_FLAG_1 (1 << 1) #define DEMO9_FLAG_1 (1 << 1)
#define DEMO9_FLAG_4 (1 << 4) #define DEMO9_FLAG_4 (1 << 4)
typedef struct { typedef struct Special0ReadOnlyData {
/* 0x0 */ f32 lerpAtScale; /* 0x0 */ f32 lerpAtScale;
/* 0x4 */ s16 interfaceField; /* 0x4 */ s16 interfaceField;
} Special0ReadOnlyData; // size = 0x8 } Special0ReadOnlyData; // size = 0x8
typedef struct { typedef struct Special0 {
/* 0x0 */ Special0ReadOnlyData roData; /* 0x0 */ Special0ReadOnlyData roData;
} Special0; // size = 0x8 } Special0; // size = 0x8
@ -1406,15 +1406,15 @@ typedef struct {
{ yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Special4ReadWriteData {
/* 0x0 */ s16 initalTimer; /* 0x0 */ s16 initalTimer;
} Special4ReadWriteData; // size = 0x4 } Special4ReadWriteData; // size = 0x4
typedef struct { typedef struct Special4 {
/* 0x0 */ Special4ReadWriteData rwData; /* 0x0 */ Special4ReadWriteData rwData;
} Special4; // size = 0x4 } Special4; // size = 0x4
typedef struct { typedef struct Special5ReadOnlyData {
/* 0x00 */ f32 yOffset; /* 0x00 */ f32 yOffset;
/* 0x04 */ f32 eyeDist; /* 0x04 */ f32 eyeDist;
/* 0x08 */ f32 minDistForRot; /* 0x08 */ f32 minDistForRot;
@ -1426,11 +1426,11 @@ typedef struct {
/* 0x1A */ s16 unk_1A; /* 0x1A */ s16 unk_1A;
} Special5ReadOnlyData; // size = 0x1C } Special5ReadOnlyData; // size = 0x1C
typedef struct { typedef struct Special5ReadWriteData {
/* 0x0 */ s16 animTimer; /* 0x0 */ s16 animTimer;
} Special5ReadWriteData; // size = 0x4 } Special5ReadWriteData; // size = 0x4
typedef struct { typedef struct Special5 {
/* 0x00 */ Special5ReadOnlyData roData; /* 0x00 */ Special5ReadOnlyData roData;
/* 0x1C */ Special5ReadWriteData rwData; /* 0x1C */ Special5ReadWriteData rwData;
} Special5; // size = 0x20 } Special5; // size = 0x20
@ -1456,40 +1456,40 @@ typedef struct {
{ unk_22, CAM_DATA_UNK_22 }, \ { unk_22, CAM_DATA_UNK_22 }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef struct { typedef struct Special7ReadWriteData {
/* 0x0 */ s16 index; // See `CamElevatorPlatform` /* 0x0 */ s16 index; // See `CamElevatorPlatform`
} Special7ReadWriteData; // size = 0x4 } Special7ReadWriteData; // size = 0x4
typedef struct { typedef struct Special7 {
/* 0x0 */ Special7ReadWriteData rwData; /* 0x0 */ Special7ReadWriteData rwData;
} Special7; // size = 0x4 } Special7; // size = 0x4
typedef struct { typedef struct Special6ReadOnlyData {
/* 0x0 */ s16 interfaceField; /* 0x0 */ s16 interfaceField;
} Special6ReadOnlyData; // size = 0x4 } Special6ReadOnlyData; // size = 0x4
typedef struct { typedef struct Special6ReadWriteData {
/* 0x0 */ f32 initalPlayerY; /* 0x0 */ f32 initalPlayerY;
/* 0x4 */ s16 animTimer; /* 0x4 */ s16 animTimer;
} Special6ReadWriteData; // size = 0x8 } Special6ReadWriteData; // size = 0x8
typedef struct { typedef struct Special6 {
/* 0x0 */ Special6ReadOnlyData roData; /* 0x0 */ Special6ReadOnlyData roData;
/* 0x4 */ Special6ReadWriteData rwData; /* 0x4 */ Special6ReadWriteData rwData;
} Special6; // size = 0xC } Special6; // size = 0xC
typedef struct { typedef struct Special9ReadOnlyData {
/* 0x0 */ f32 yOffset; /* 0x0 */ f32 yOffset;
/* 0x4 */ f32 unk_04; /* 0x4 */ f32 unk_04;
/* 0x8 */ s16 interfaceField; /* 0x8 */ s16 interfaceField;
/* 0xA */ s16 unk_0A; /* 0xA */ s16 unk_0A;
} Special9ReadOnlyData; // size = 0xC } Special9ReadOnlyData; // size = 0xC
typedef struct { typedef struct Special9ReadWriteData {
/* 0x0 */ s16 targetYaw; /* 0x0 */ s16 targetYaw;
} Special9ReadWriteData; // size = 0x4 } Special9ReadWriteData; // size = 0x4
typedef struct { typedef struct Special9 {
/* 0x00 */ Special9ReadOnlyData roData; /* 0x00 */ Special9ReadOnlyData roData;
/* 0x0C */ Special9ReadWriteData rwData; /* 0x0C */ Special9ReadWriteData rwData;
} Special9; // size = 0x10 } Special9; // size = 0x10
@ -1503,7 +1503,7 @@ typedef struct {
{ fov, CAM_DATA_FOV }, \ { fov, CAM_DATA_FOV }, \
{ interfaceField, CAM_DATA_INTERFACE_FIELD } { interfaceField, CAM_DATA_INTERFACE_FIELD }
typedef union { typedef union CamParamData {
Normal1 norm1; Normal1 norm1;
Normal2 norm2; Normal2 norm2;
Normal3 norm3; Normal3 norm3;
@ -1548,7 +1548,7 @@ typedef union {
}; };
} CamParamData; // size = 0x50 } CamParamData; // size = 0x50
typedef struct { typedef struct CamColChk {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f norm; /* 0x0C */ Vec3f norm;
/* 0x18 */ struct CollisionPoly* poly; /* 0x18 */ struct CollisionPoly* poly;
@ -1623,7 +1623,7 @@ typedef struct Camera {
* Debug Camera * Debug Camera
*/ */
typedef struct { typedef struct DebugCamSub {
/* 0x0000 */ s16 mode; /* 0x0000 */ s16 mode;
/* 0x0002 */ s16 nFrames; /* 0x0002 */ s16 nFrames;
/* 0x0004 */ s16 nPoints; /* 0x0004 */ s16 nPoints;
@ -1640,7 +1640,7 @@ typedef struct {
/* 0x104A */ Vec3s unk_104A; /* 0x104A */ Vec3s unk_104A;
} DebugCamSub; // size = 0x1050 } DebugCamSub; // size = 0x1050
typedef struct { typedef struct DebugCam {
/* 0x00 */ s32 unk_00; /* 0x00 */ s32 unk_00;
/* 0x04 */ Vec3f at; /* 0x04 */ Vec3f at;
/* 0x10 */ Vec3f eye; /* 0x10 */ Vec3f eye;
@ -1663,7 +1663,7 @@ typedef struct {
/* 0x7C */ DebugCamSub sub; /* 0x7C */ DebugCamSub sub;
} DebugCam; // size = 0x10CC } DebugCam; // size = 0x10CC
typedef struct { typedef struct DebugCamCut {
/* 0x00 */ char letter; /* 0x00 */ char letter;
/* 0x01 */ u8 unk_01; /* 0x01 */ u8 unk_01;
/* 0x02 */ s16 mode; /* 0x02 */ s16 mode;
@ -1673,7 +1673,7 @@ typedef struct {
/* 0x0E */ s16 nPoints; /* 0x0E */ s16 nPoints;
} DebugCamCut; // size = 0x10 } DebugCamCut; // size = 0x10
typedef struct { typedef struct DebugCamAnim {
/* 0x00 */ f32 curFrame; /* 0x00 */ f32 curFrame;
/* 0x04 */ f32 unk_04; // frame count? /* 0x04 */ f32 unk_04; // frame count?
/* 0x08 */ s16 keyframe; /* 0x08 */ s16 keyframe;
@ -1685,7 +1685,7 @@ typedef struct {
/* 0x2C */ f32 fov; /* 0x2C */ f32 fov;
} DebugCamAnim; // size = 0x30 } DebugCamAnim; // size = 0x30
typedef enum { typedef enum DebugCamTextColor {
/* 0 */ DEBUG_CAM_TEXT_YELLOW, /* 0 */ DEBUG_CAM_TEXT_YELLOW,
/* 1 */ DEBUG_CAM_TEXT_PEACH, /* 1 */ DEBUG_CAM_TEXT_PEACH,
/* 2 */ DEBUG_CAM_TEXT_BROWN, /* 2 */ DEBUG_CAM_TEXT_BROWN,

View file

@ -12,7 +12,7 @@ struct Actor;
* Bases for all shapes of colliders * Bases for all shapes of colliders
*/ */
typedef enum { typedef enum ColliderType {
/* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark /* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark
/* 1 */ COLTYPE_HIT1, // No blood, dust hitmark /* 1 */ COLTYPE_HIT1, // No blood, dust hitmark
/* 2 */ COLTYPE_HIT2, // Green blood, dust hitmark /* 2 */ COLTYPE_HIT2, // Green blood, dust hitmark
@ -29,7 +29,7 @@ typedef enum {
/* 13 */ COLTYPE_TREE /* 13 */ COLTYPE_TREE
} ColliderType; } ColliderType;
typedef enum { typedef enum ColliderShape {
/* 0 */ COLSHAPE_JNTSPH, /* 0 */ COLSHAPE_JNTSPH,
/* 1 */ COLSHAPE_CYLINDER, /* 1 */ COLSHAPE_CYLINDER,
/* 2 */ COLSHAPE_TRIS, /* 2 */ COLSHAPE_TRIS,
@ -37,7 +37,7 @@ typedef enum {
/* 4 */ COLSHAPE_MAX /* 4 */ COLSHAPE_MAX
} ColliderShape; } ColliderShape;
typedef struct { typedef struct Collider {
/* 0x00 */ struct Actor* actor; // Attached actor /* 0x00 */ struct Actor* actor; // Attached actor
/* 0x04 */ struct Actor* at; // Actor attached to what it collided with as an AT collider. /* 0x04 */ struct Actor* at; // Actor attached to what it collided with as an AT collider.
/* 0x08 */ struct Actor* ac; // Actor attached to what it collided with as an AC collider. /* 0x08 */ struct Actor* ac; // Actor attached to what it collided with as an AC collider.
@ -50,7 +50,7 @@ typedef struct {
/* 0x15 */ u8 shape; // See `ColliderShape` enum /* 0x15 */ u8 shape; // See `ColliderShape` enum
} Collider; // size = 0x18 } Collider; // size = 0x18
typedef struct { typedef struct ColliderInit {
/* 0x00 */ u8 colType; /* 0x00 */ u8 colType;
/* 0x01 */ u8 atFlags; /* 0x01 */ u8 atFlags;
/* 0x02 */ u8 acFlags; /* 0x02 */ u8 acFlags;
@ -59,7 +59,7 @@ typedef struct {
/* 0x05 */ u8 shape; /* 0x05 */ u8 shape;
} ColliderInit; // size = 0x06 } ColliderInit; // size = 0x06
typedef struct { typedef struct ColliderInitType1 {
/* 0x00 */ u8 colType; /* 0x00 */ u8 colType;
/* 0x01 */ u8 atFlags; /* 0x01 */ u8 atFlags;
/* 0x02 */ u8 acFlags; /* 0x02 */ u8 acFlags;
@ -67,7 +67,7 @@ typedef struct {
/* 0x04 */ u8 shape; /* 0x04 */ u8 shape;
} ColliderInitType1; // size = 0x05 } ColliderInitType1; // size = 0x05
typedef struct { typedef struct ColliderInitToActor {
/* 0x00 */ struct Actor* actor; /* 0x00 */ struct Actor* actor;
/* 0x04 */ u8 atFlags; /* 0x04 */ u8 atFlags;
/* 0x05 */ u8 acFlags; /* 0x05 */ u8 acFlags;
@ -75,20 +75,20 @@ typedef struct {
/* 0x07 */ u8 shape; /* 0x07 */ u8 shape;
} ColliderInitToActor; // size = 0x08 } ColliderInitToActor; // size = 0x08
typedef struct { typedef struct ColliderElementDamageInfoAT {
/* 0x00 */ u32 dmgFlags; // Damage types dealt by this collider element as AT. /* 0x00 */ u32 dmgFlags; // Damage types dealt by this collider element as AT.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 damage; // Damage /* 0x05 */ u8 damage; // Damage
} ColliderElementDamageInfoAT; // size = 0x08 } ColliderElementDamageInfoAT; // size = 0x08
typedef struct { typedef struct ColliderElementDamageInfoAC {
/* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC. /* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense; // Damage Resistance /* 0x05 */ u8 defense; // Damage Resistance
/* 0x06 */ Vec3s hitPos; // Point of contact /* 0x06 */ Vec3s hitPos; // Point of contact
} ColliderElementDamageInfoAC; // size = 0x0C } ColliderElementDamageInfoAC; // size = 0x0C
typedef struct { typedef struct ColliderElementDamageInfoACInit {
/* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC. /* 0x00 */ u32 dmgFlags; // Damage types that may affect this collider element as AC.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense; // Damage Resistance /* 0x05 */ u8 defense; // Damage Resistance
@ -100,7 +100,7 @@ typedef struct {
* are == or !=. Will probably need more actors decomped to truly * are == or !=. Will probably need more actors decomped to truly
* understand what this is. * understand what this is.
*/ */
typedef enum { typedef enum ElementType {
/* 0 */ ELEMTYPE_UNK0, /* 0 */ ELEMTYPE_UNK0,
/* 1 */ ELEMTYPE_UNK1, /* 1 */ ELEMTYPE_UNK1,
/* 2 */ ELEMTYPE_UNK2, /* 2 */ ELEMTYPE_UNK2,
@ -124,7 +124,7 @@ typedef struct ColliderElement {
/* 0x24 */ struct ColliderElement* acHitElem; // element that hit the AC collider /* 0x24 */ struct ColliderElement* acHitElem; // element that hit the AC collider
} ColliderElement; // size = 0x28 } ColliderElement; // size = 0x28
typedef struct { typedef struct ColliderElementInit {
/* 0x00 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown. /* 0x00 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown.
/* 0x04 */ ColliderElementDamageInfoAT atDmgInfo; // Damage properties when acting as an AT collider /* 0x04 */ ColliderElementDamageInfoAT atDmgInfo; // Damage properties when acting as an AT collider
/* 0x0C */ ColliderElementDamageInfoACInit acDmgInfo; // Damage properties when acting as an AC collider /* 0x0C */ ColliderElementDamageInfoACInit acDmgInfo; // Damage properties when acting as an AC collider
@ -139,19 +139,19 @@ typedef struct {
// collider structs // collider structs
typedef struct { typedef struct ColliderJntSphElementDim {
/* 0x00 */ Sphere16 modelSphere; // model space sphere /* 0x00 */ Sphere16 modelSphere; // model space sphere
/* 0x08 */ Sphere16 worldSphere; // world space sphere /* 0x08 */ Sphere16 worldSphere; // world space sphere
/* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01 /* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01
/* 0x14 */ u8 limb; // attached limb /* 0x14 */ u8 limb; // attached limb
} ColliderJntSphElementDim; // size = 0x18 } ColliderJntSphElementDim; // size = 0x18
typedef struct { typedef struct ColliderJntSphElement {
/* 0x00 */ ColliderElement base; /* 0x00 */ ColliderElement base;
/* 0x28 */ ColliderJntSphElementDim dim; /* 0x28 */ ColliderJntSphElementDim dim;
} ColliderJntSphElement; // size = 0x40 } ColliderJntSphElement; // size = 0x40
typedef struct { typedef struct ColliderJntSph {
/* 0x00 */ Collider base; /* 0x00 */ Collider base;
/* 0x18 */ s32 count; /* 0x18 */ s32 count;
/* 0x1C */ ColliderJntSphElement* elements; /* 0x1C */ ColliderJntSphElement* elements;
@ -159,30 +159,30 @@ typedef struct {
// init data structs // init data structs
typedef struct { typedef struct ColliderJntSphElementDimInit {
/* 0x00 */ u8 limb; // attached limb /* 0x00 */ u8 limb; // attached limb
/* 0x02 */ Sphere16 modelSphere; // model space sphere /* 0x02 */ Sphere16 modelSphere; // model space sphere
/* 0x0A */ s16 scale; // world space sphere = model * scale * 0.01 /* 0x0A */ s16 scale; // world space sphere = model * scale * 0.01
} ColliderJntSphElementDimInit; // size = 0x0C } ColliderJntSphElementDimInit; // size = 0x0C
typedef struct { typedef struct ColliderJntSphElementInit {
/* 0x00 */ ColliderElementInit base; /* 0x00 */ ColliderElementInit base;
/* 0x18 */ ColliderJntSphElementDimInit dim; /* 0x18 */ ColliderJntSphElementDimInit dim;
} ColliderJntSphElementInit; // size = 0x24 } ColliderJntSphElementInit; // size = 0x24
typedef struct { typedef struct ColliderJntSphInit {
/* 0x00 */ ColliderInit base; /* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count; /* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements; /* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInit; // size = 0x10 } ColliderJntSphInit; // size = 0x10
typedef struct { typedef struct ColliderJntSphInitType1 {
/* 0x00 */ ColliderInitType1 base; /* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count; /* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements; /* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInitType1; // size = 0x10 } ColliderJntSphInitType1; // size = 0x10
typedef struct { typedef struct ColliderJntSphInitToActor {
/* 0x00 */ ColliderInitToActor base; /* 0x00 */ ColliderInitToActor base;
/* 0x08 */ s32 count; /* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements; /* 0x0C */ ColliderJntSphElementInit* elements;
@ -194,7 +194,7 @@ typedef struct {
// collider structs // collider structs
typedef struct { typedef struct ColliderCylinder {
/* 0x00 */ Collider base; /* 0x00 */ Collider base;
/* 0x18 */ ColliderElement elem; /* 0x18 */ ColliderElement elem;
/* 0x40 */ Cylinder16 dim; /* 0x40 */ Cylinder16 dim;
@ -202,19 +202,19 @@ typedef struct {
// init data structs // init data structs
typedef struct { typedef struct ColliderCylinderInit {
/* 0x00 */ ColliderInit base; /* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderElementInit elem; /* 0x08 */ ColliderElementInit elem;
/* 0x20 */ Cylinder16 dim; /* 0x20 */ Cylinder16 dim;
} ColliderCylinderInit; // size = 0x2C } ColliderCylinderInit; // size = 0x2C
typedef struct { typedef struct ColliderCylinderInitType1 {
/* 0x00 */ ColliderInitType1 base; /* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderElementInit elem; /* 0x08 */ ColliderElementInit elem;
/* 0x20 */ Cylinder16 dim; /* 0x20 */ Cylinder16 dim;
} ColliderCylinderInitType1; // size = 0x2C } ColliderCylinderInitType1; // size = 0x2C
typedef struct { typedef struct ColliderCylinderInitToActor {
/* 0x00 */ ColliderInitToActor base; /* 0x00 */ ColliderInitToActor base;
/* 0x08 */ ColliderElementInit elem; /* 0x08 */ ColliderElementInit elem;
/* 0x20 */ Cylinder16 dim; /* 0x20 */ Cylinder16 dim;
@ -226,12 +226,12 @@ typedef struct {
// collider structs // collider structs
typedef struct { typedef struct ColliderTrisElement {
/* 0x00 */ ColliderElement base; /* 0x00 */ ColliderElement base;
/* 0x28 */ TriNorm dim; /* 0x28 */ TriNorm dim;
} ColliderTrisElement; // size = 0x5C } ColliderTrisElement; // size = 0x5C
typedef struct { typedef struct ColliderTris {
/* 0x00 */ Collider base; /* 0x00 */ Collider base;
/* 0x18 */ s32 count; /* 0x18 */ s32 count;
/* 0x1C */ ColliderTrisElement* elements; /* 0x1C */ ColliderTrisElement* elements;
@ -239,22 +239,22 @@ typedef struct {
// init data structs // init data structs
typedef struct { typedef struct ColliderTrisElementDimInit {
/* 0x00 */ Vec3f vtx[3]; /* 0x00 */ Vec3f vtx[3];
} ColliderTrisElementDimInit; // size = 0x24 } ColliderTrisElementDimInit; // size = 0x24
typedef struct { typedef struct ColliderTrisElementInit {
/* 0x00 */ ColliderElementInit base; /* 0x00 */ ColliderElementInit base;
/* 0x18 */ ColliderTrisElementDimInit dim; /* 0x18 */ ColliderTrisElementDimInit dim;
} ColliderTrisElementInit; // size = 0x3C } ColliderTrisElementInit; // size = 0x3C
typedef struct { typedef struct ColliderTrisInit {
/* 0x00 */ ColliderInit base; /* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count; /* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisElementInit* elements; /* 0x0C */ ColliderTrisElementInit* elements;
} ColliderTrisInit; // size = 0x10 } ColliderTrisInit; // size = 0x10
typedef struct { typedef struct ColliderTrisInitType1 {
/* 0x00 */ ColliderInitType1 base; /* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count; /* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisElementInit* elements; /* 0x0C */ ColliderTrisElementInit* elements;
@ -266,14 +266,14 @@ typedef struct {
// collider structs // collider structs
typedef struct { typedef struct ColliderQuadDim {
/* 0x00 */ Vec3f quad[4]; /* 0x00 */ Vec3f quad[4];
/* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c /* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c
/* 0x36 */ Vec3s baMid; // midpoint of vectors b, a /* 0x36 */ Vec3s baMid; // midpoint of vectors b, a
/* 0x3C */ f32 acDistSq; // distance to nearest AC collision this frame, squared. /* 0x3C */ f32 acDistSq; // distance to nearest AC collision this frame, squared.
} ColliderQuadDim; // size = 0x40 } ColliderQuadDim; // size = 0x40
typedef struct { typedef struct ColliderQuad {
/* 0x00 */ Collider base; /* 0x00 */ Collider base;
/* 0x18 */ ColliderElement elem; /* 0x18 */ ColliderElement elem;
/* 0x40 */ ColliderQuadDim dim; /* 0x40 */ ColliderQuadDim dim;
@ -281,17 +281,17 @@ typedef struct {
// init data structs // init data structs
typedef struct { typedef struct ColliderQuadDimInit {
/* 0x00 */ Vec3f quad[4]; /* 0x00 */ Vec3f quad[4];
} ColliderQuadDimInit; // size = 0x30 } ColliderQuadDimInit; // size = 0x30
typedef struct { typedef struct ColliderQuadInit {
/* 0x00 */ ColliderInit base; /* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderElementInit elem; /* 0x08 */ ColliderElementInit elem;
/* 0x20 */ ColliderQuadDimInit dim; /* 0x20 */ ColliderQuadDimInit dim;
} ColliderQuadInit; // size = 0x50 } ColliderQuadInit; // size = 0x50
typedef struct { typedef struct ColliderQuadInitType1 {
/* 0x00 */ ColliderInitType1 base; /* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderElementInit elem; /* 0x08 */ ColliderElementInit elem;
/* 0x20 */ ColliderQuadDimInit dim; /* 0x20 */ ColliderQuadDimInit dim;
@ -301,7 +301,7 @@ typedef struct {
* Line collider * Line collider
*/ */
typedef struct { typedef struct OcLine {
/* 0x00 */ Linef line; /* 0x00 */ Linef line;
/* 0x18 */ u16 ocFlags; /* 0x18 */ u16 ocFlags;
} OcLine; // size = 0x1C } OcLine; // size = 0x1C

View file

@ -6,7 +6,7 @@
struct PlayState; struct PlayState;
typedef struct { typedef struct CurveInterpKnot {
/* 0x0 */ u16 flags; // Only the bottom two bits are used, although others are set in objects /* 0x0 */ u16 flags; // Only the bottom two bits are used, although others are set in objects
/* 0x2 */ s16 abscissa; // knot input value /* 0x2 */ s16 abscissa; // knot input value
/* 0x4 */ s16 leftGradient; // left derivative at the point /* 0x4 */ s16 leftGradient; // left derivative at the point
@ -14,7 +14,7 @@ typedef struct {
/* 0x8 */ f32 ordinate; // output value /* 0x8 */ f32 ordinate; // output value
} CurveInterpKnot; // size = 0xC } CurveInterpKnot; // size = 0xC
typedef struct { typedef struct CurveAnimationHeader {
/* 0x0 */ u8* knotCounts; /* 0x0 */ u8* knotCounts;
/* 0x4 */ CurveInterpKnot* interpolationData; /* 0x4 */ CurveInterpKnot* interpolationData;
/* 0x8 */ s16* constantData; /* 0x8 */ s16* constantData;
@ -22,18 +22,18 @@ typedef struct {
/* 0xE */ s16 frameCount; // Not used, inferred from use in objects /* 0xE */ s16 frameCount; // Not used, inferred from use in objects
} CurveAnimationHeader; // size = 0x10 } CurveAnimationHeader; // size = 0x10
typedef struct { typedef struct SkelCurveLimb {
/* 0x0 */ u8 child; /* 0x0 */ u8 child;
/* 0x1 */ u8 sibling; /* 0x1 */ u8 sibling;
/* 0x4 */ Gfx* dList[2]; /* 0x4 */ Gfx* dList[2];
} SkelCurveLimb; // size = 0xC } SkelCurveLimb; // size = 0xC
typedef struct { typedef struct CurveSkeletonHeader {
/* 0x0 */ SkelCurveLimb** limbs; /* 0x0 */ SkelCurveLimb** limbs;
/* 0x4 */ u8 limbCount; /* 0x4 */ u8 limbCount;
} CurveSkeletonHeader; // size = 0x8 } CurveSkeletonHeader; // size = 0x8
typedef struct { typedef struct SkelCurve {
/* 0x00 */ u8 limbCount; /* 0x00 */ u8 limbCount;
/* 0x04 */ SkelCurveLimb** skeleton; /* 0x04 */ SkelCurveLimb** skeleton;
/* 0x08 */ CurveAnimationHeader* animation; /* 0x08 */ CurveAnimationHeader* animation;

View file

@ -11,7 +11,7 @@ typedef union CutsceneData {
s8 b[4]; s8 b[4];
} CutsceneData; } CutsceneData;
typedef enum { typedef enum CutsceneState {
/* 0 */ CS_STATE_IDLE, /* 0 */ CS_STATE_IDLE,
/* 1 */ CS_STATE_START, /* 1 */ CS_STATE_START,
/* 2 */ CS_STATE_RUN, /* 2 */ CS_STATE_RUN,
@ -19,7 +19,7 @@ typedef enum {
/* 4 */ CS_STATE_RUN_UNSTOPPABLE /* 4 */ CS_STATE_RUN_UNSTOPPABLE
} CutsceneState; } CutsceneState;
typedef enum { typedef enum CutsceneCmd {
/* 0x0001 */ CS_CMD_CAM_EYE_SPLINE = 0x01, /* 0x0001 */ CS_CMD_CAM_EYE_SPLINE = 0x01,
/* 0x0002 */ CS_CMD_CAM_AT_SPLINE, /* 0x0002 */ CS_CMD_CAM_AT_SPLINE,
/* 0x0003 */ CS_CMD_MISC, /* 0x0003 */ CS_CMD_MISC,
@ -151,7 +151,7 @@ typedef enum {
/* 0xFFFF */ CS_CMD_END = 0xFFFF /* 0xFFFF */ CS_CMD_END = 0xFFFF
} CutsceneCmd; } CutsceneCmd;
typedef enum { typedef enum CutsceneMiscType {
/* 0x00 */ CS_MISC_UNIMPLEMENTED_0, /* 0x00 */ CS_MISC_UNIMPLEMENTED_0,
/* 0x01 */ CS_MISC_RAIN, /* 0x01 */ CS_MISC_RAIN,
/* 0x02 */ CS_MISC_LIGHTNING, /* 0x02 */ CS_MISC_LIGHTNING,
@ -190,7 +190,7 @@ typedef enum {
/* 0x23 */ CS_MISC_LONG_SCARECROW_SONG /* 0x23 */ CS_MISC_LONG_SCARECROW_SONG
} CutsceneMiscType; } CutsceneMiscType;
typedef enum { typedef enum CutsceneTextType {
/* 0x00 */ CS_TEXT_NORMAL, /* 0x00 */ CS_TEXT_NORMAL,
/* 0x01 */ CS_TEXT_CHOICE, /* 0x01 */ CS_TEXT_CHOICE,
/* 0x02 */ CS_TEXT_OCARINA_ACTION, /* 0x02 */ CS_TEXT_OCARINA_ACTION,
@ -198,12 +198,12 @@ typedef enum {
/* 0x04 */ CS_TEXT_ZORA_SAPPHIRE // use `altTextId1` in the sapphire cutscene if ruby is already obtained /* 0x04 */ CS_TEXT_ZORA_SAPPHIRE // use `altTextId1` in the sapphire cutscene if ruby is already obtained
} CutsceneTextType; } CutsceneTextType;
typedef enum { typedef enum CutsceneFadeOutSeqPlayer {
/* 0x03 */ CS_FADE_OUT_FANFARE = 3, /* 0x03 */ CS_FADE_OUT_FANFARE = 3,
/* 0x04 */ CS_FADE_OUT_BGM_MAIN /* 0x04 */ CS_FADE_OUT_BGM_MAIN
} CutsceneFadeOutSeqPlayer; } CutsceneFadeOutSeqPlayer;
typedef enum { typedef enum CutsceneTransitionType {
/* 0x01 */ CS_TRANS_GRAY_FILL_IN = 1, // has hardcoded sounds for some scenes /* 0x01 */ CS_TRANS_GRAY_FILL_IN = 1, // has hardcoded sounds for some scenes
/* 0x02 */ CS_TRANS_BLUE_FILL_IN, /* 0x02 */ CS_TRANS_BLUE_FILL_IN,
/* 0x03 */ CS_TRANS_RED_FILL_OUT, /* 0x03 */ CS_TRANS_RED_FILL_OUT,
@ -219,7 +219,7 @@ typedef enum {
/* 0x0D */ CS_TRANS_BLACK_FILL_IN_FROM_HALF /* 0x0D */ CS_TRANS_BLACK_FILL_IN_FROM_HALF
} CutsceneTransitionType; } CutsceneTransitionType;
typedef enum { typedef enum CutsceneDestination {
/* 0x00 */ CS_DEST_UNIMPLEMENTED_0, /* 0x00 */ CS_DEST_UNIMPLEMENTED_0,
/* 0x01 */ CS_DEST_CUTSCENE_MAP_GANON_HORSE, /* 0x01 */ CS_DEST_CUTSCENE_MAP_GANON_HORSE,
/* 0x02 */ CS_DEST_CUTSCENE_MAP_THREE_GODDESSES, /* 0x02 */ CS_DEST_CUTSCENE_MAP_THREE_GODDESSES,
@ -342,7 +342,7 @@ typedef enum {
/* 0x77 */ CS_DEST_ZELDAS_COURTYARD_RECEIVE_LETTER /* 0x77 */ CS_DEST_ZELDAS_COURTYARD_RECEIVE_LETTER
} CutsceneDestination; } CutsceneDestination;
typedef union { typedef union CsCmdCam {
struct { struct {
/* 0x00 */ u16 unused0; /* 0x00 */ u16 unused0;
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -352,7 +352,7 @@ typedef union {
} CsCmdCam; // size = 0x8 } CsCmdCam; // size = 0x8
typedef union { typedef union CsCmdMisc {
struct { struct {
/* 0x00 */ u16 type; /* 0x00 */ u16 type;
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -361,7 +361,7 @@ typedef union {
s32 _words[12]; s32 _words[12];
} CsCmdMisc; // size = 0x30 } CsCmdMisc; // size = 0x30
typedef union { typedef union CsCmdLightSetting {
struct { struct {
/* 0x00 */ u8 unused0; /* 0x00 */ u8 unused0;
/* 0x01 */ u8 settingPlusOne; /* 0x01 */ u8 settingPlusOne;
@ -371,7 +371,7 @@ typedef union {
s32 _words[12]; s32 _words[12];
} CsCmdLightSetting; // size = 0x30 } CsCmdLightSetting; // size = 0x30
typedef union { typedef union CsCmdStartSeq {
struct { struct {
/* 0x00 */ u8 unused0; /* 0x00 */ u8 unused0;
/* 0x01 */ u8 seqIdPlusOne; /* 0x01 */ u8 seqIdPlusOne;
@ -381,7 +381,7 @@ typedef union {
s32 _words[12]; s32 _words[12];
} CsCmdStartSeq; // size = 0x30 } CsCmdStartSeq; // size = 0x30
typedef union { typedef union CsCmdStopSeq {
struct { struct {
/* 0x00 */ u8 unused0; /* 0x00 */ u8 unused0;
/* 0x01 */ u8 seqIdPlusOne; /* 0x01 */ u8 seqIdPlusOne;
@ -391,7 +391,7 @@ typedef union {
s32 _words[12]; s32 _words[12];
} CsCmdStopSeq; // size = 0x30 } CsCmdStopSeq; // size = 0x30
typedef union { typedef union CsCmdFadeOutSeq {
struct { struct {
/* 0x00 */ u16 seqPlayer; /* 0x00 */ u16 seqPlayer;
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -400,7 +400,7 @@ typedef union {
s32 _words[12]; s32 _words[12];
} CsCmdFadeOutSeq; // size = 0x30 } CsCmdFadeOutSeq; // size = 0x30
typedef union { typedef union CsCmdRumble {
struct { struct {
/* 0x00 */ u16 unused0; /* 0x00 */ u16 unused0;
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -412,7 +412,7 @@ typedef union {
s32 _words[3]; s32 _words[3];
} CsCmdRumble; // size = 0xC } CsCmdRumble; // size = 0xC
typedef union { typedef union CsCmdTime {
struct { struct {
/* 0x00 */ u16 unused0; /* 0x00 */ u16 unused0;
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -423,7 +423,7 @@ typedef union {
s32 _words[3]; s32 _words[3];
} CsCmdTime; // size = 0xC } CsCmdTime; // size = 0xC
typedef union { typedef union CsCmdDestination {
struct { struct {
/* 0x00 */ u16 destination; /* 0x00 */ u16 destination;
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -432,7 +432,7 @@ typedef union {
s32 _words[2]; s32 _words[2];
} CsCmdDestination; // size = 0x8 } CsCmdDestination; // size = 0x8
typedef union { typedef union CsCmdText {
struct { struct {
/* 0x00 */ u16 textId; // can also be an ocarina action for `CS_TEXT_OCARINA_ACTION` /* 0x00 */ u16 textId; // can also be an ocarina action for `CS_TEXT_OCARINA_ACTION`
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -446,7 +446,7 @@ typedef union {
#define CS_TEXT_ID_NONE 0xFFFF #define CS_TEXT_ID_NONE 0xFFFF
typedef union { typedef union CsCmdTransition {
struct { struct {
/* 0x00 */ u16 type; /* 0x00 */ u16 type;
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -455,7 +455,7 @@ typedef union {
s32 _words[2]; s32 _words[2];
} CsCmdTransition; // size = 0x8 } CsCmdTransition; // size = 0x8
typedef union { typedef union CsCmdActorCue {
struct { struct {
/* 0x00 */ u16 id; // "dousa" /* 0x00 */ u16 id; // "dousa"
/* 0x02 */ u16 startFrame; /* 0x02 */ u16 startFrame;
@ -467,7 +467,7 @@ typedef union {
s32 _words[12]; s32 _words[12];
} CsCmdActorCue; // size = 0x30 } CsCmdActorCue; // size = 0x30
typedef union { typedef union CutsceneCameraPoint {
struct { struct {
/* 0x00 */ s8 continueFlag; /* 0x00 */ s8 continueFlag;
/* 0x01 */ s8 cameraRoll; /* 0x01 */ s8 cameraRoll;
@ -483,20 +483,20 @@ typedef union {
#define CS_CAM_DATA_NOT_APPLIED 0xFFFF #define CS_CAM_DATA_NOT_APPLIED 0xFFFF
typedef struct { typedef struct CutsceneCameraDirection {
/* 0x00 */ Vec3f at; /* 0x00 */ Vec3f at;
/* 0x0C */ Vec3f eye; /* 0x0C */ Vec3f eye;
/* 0x18 */ s16 roll; /* 0x18 */ s16 roll;
/* 0x1A */ s16 fov; /* 0x1A */ s16 fov;
} CutsceneCameraDirection; // size = 0x1C } CutsceneCameraDirection; // size = 0x1C
typedef struct { typedef struct CutsceneCameraMove {
/* 0x0 */ CutsceneCameraPoint* atPoints; /* 0x0 */ CutsceneCameraPoint* atPoints;
/* 0x4 */ CutsceneCameraPoint* eyePoints; /* 0x4 */ CutsceneCameraPoint* eyePoints;
/* 0x8 */ s16 relativeToPlayer; /* 0x8 */ s16 relativeToPlayer;
} CutsceneCameraMove; // size = 0xC } CutsceneCameraMove; // size = 0xC
typedef struct { typedef struct CutsceneContext {
/* 0x00 */ char unk_00[0x4]; /* 0x00 */ char unk_00[0x4];
/* 0x04 */ void* script; /* 0x04 */ void* script;
/* 0x08 */ u8 state; /* 0x08 */ u8 state;

View file

@ -5,7 +5,7 @@
#include "alignment.h" #include "alignment.h"
#include "romfile.h" #include "romfile.h"
typedef struct { typedef struct DmaRequest {
/* 0x00 */ uintptr_t vromAddr; // VROM address (source) /* 0x00 */ uintptr_t vromAddr; // VROM address (source)
/* 0x04 */ void* dramAddr; // DRAM address (destination) /* 0x04 */ void* dramAddr; // DRAM address (destination)
/* 0x08 */ size_t size; // File Transfer size /* 0x08 */ size_t size; // File Transfer size
@ -16,7 +16,7 @@ typedef struct {
/* 0x1C */ OSMesg notifyMsg; // Completion notification message /* 0x1C */ OSMesg notifyMsg; // Completion notification message
} DmaRequest; // size = 0x20 } DmaRequest; // size = 0x20
typedef struct { typedef struct DmaEntry {
/* 0x00 */ RomFile file; /* 0x00 */ RomFile file;
/* 0x08 */ uintptr_t romStart; /* 0x08 */ uintptr_t romStart;
/* 0x0C */ uintptr_t romEnd; /* 0x0C */ uintptr_t romEnd;

View file

@ -14,20 +14,20 @@ struct PlayState;
#define TOTAL_EFFECT_COUNT SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT #define TOTAL_EFFECT_COUNT SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT
typedef struct { typedef struct EffectStatus {
/* 0x00 */ u8 active; /* 0x00 */ u8 active;
/* 0x01 */ u8 unk_01; /* 0x01 */ u8 unk_01;
/* 0x02 */ u8 unk_02; /* 0x02 */ u8 unk_02;
} EffectStatus; // size = 0x03 } EffectStatus; // size = 0x03
typedef struct { typedef struct EffectSparkElement {
/* 0x00 */ Vec3f velocity; /* 0x00 */ Vec3f velocity;
/* 0x0C */ Vec3f position; /* 0x0C */ Vec3f position;
/* 0x18 */ Vec3s unkVelocity; /* 0x18 */ Vec3s unkVelocity;
/* 0x1E */ Vec3s unkPosition; /* 0x1E */ Vec3s unkPosition;
} EffectSparkElement; // size = 0x24 } EffectSparkElement; // size = 0x24
typedef struct { typedef struct EffectSparkInit {
/* 0x000 */ Vec3s position; /* 0x000 */ Vec3s position;
/* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2 /* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2
/* 0x00C */ EffectSparkElement elements[32]; /* 0x00C */ EffectSparkElement elements[32];
@ -41,7 +41,7 @@ typedef struct {
/* 0x4C0 */ s32 duration; /* 0x4C0 */ s32 duration;
} EffectSparkInit; // size = 0x4C4 } EffectSparkInit; // size = 0x4C4
typedef struct { typedef struct EffectSpark {
/* 0x000 */ Vec3s position; /* 0x000 */ Vec3s position;
/* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2 /* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2
/* 0x00C */ EffectSparkElement elements[32]; /* 0x00C */ EffectSparkElement elements[32];
@ -55,7 +55,7 @@ typedef struct {
/* 0x4C0 */ s32 duration; /* 0x4C0 */ s32 duration;
} EffectSpark; // size = 0x4C4 } EffectSpark; // size = 0x4C4
typedef struct { typedef struct EffectBlureElement {
/* 0x00 */ s32 state; /* 0x00 */ s32 state;
/* 0x04 */ s32 timer; /* 0x04 */ s32 timer;
/* 0x08 */ Vec3s p1; /* 0x08 */ Vec3s p1;
@ -63,7 +63,7 @@ typedef struct {
/* 0x14 */ u16 flags; /* 0x14 */ u16 flags;
} EffectBlureElement; // size = 0x18 } EffectBlureElement; // size = 0x18
typedef struct { typedef struct EffectBlureInit1 {
/* 0x000 */ char unk_00[0x184]; /* 0x000 */ char unk_00[0x184];
/* 0x184 */ u8 p1StartColor[4]; /* 0x184 */ u8 p1StartColor[4];
/* 0x188 */ u8 p2StartColor[4]; /* 0x188 */ u8 p2StartColor[4];
@ -74,7 +74,7 @@ typedef struct {
/* 0x19C */ s32 calcMode; /* 0x19C */ s32 calcMode;
} EffectBlureInit1; // size = 0x1A0 } EffectBlureInit1; // size = 0x1A0
typedef struct { typedef struct EffectBlureInit2 {
/* 0x00 */ s32 calcMode; /* 0x00 */ s32 calcMode;
/* 0x04 */ u16 flags; /* 0x04 */ u16 flags;
/* 0x06 */ s16 addAngleChange; /* 0x06 */ s16 addAngleChange;
@ -90,7 +90,7 @@ typedef struct {
/* 0x20 */ Color_RGBA8 altEnvColor; // used with drawMode 1 /* 0x20 */ Color_RGBA8 altEnvColor; // used with drawMode 1
} EffectBlureInit2; // size = 0x24 } EffectBlureInit2; // size = 0x24
typedef struct { typedef struct EffectBlure {
/* 0x000 */ EffectBlureElement elements[16]; /* 0x000 */ EffectBlureElement elements[16];
/* 0x180 */ s32 calcMode; /* 0x180 */ s32 calcMode;
/* 0x184 */ f32 mode4Param; /* 0x184 */ f32 mode4Param;
@ -109,7 +109,7 @@ typedef struct {
/* 0x1A6 */ Color_RGBA8 altEnvColor; // used with drawMode 1 /* 0x1A6 */ Color_RGBA8 altEnvColor; // used with drawMode 1
} EffectBlure; // size = 0x1AC } EffectBlure; // size = 0x1AC
typedef struct { typedef struct EffectShieldParticleElement {
/* 0x00 */ f32 initialSpeed; /* 0x00 */ f32 initialSpeed;
/* 0x04 */ f32 endXChange; /* 0x04 */ f32 endXChange;
/* 0x08 */ f32 endX; /* 0x08 */ f32 endX;
@ -119,7 +119,7 @@ typedef struct {
/* 0x16 */ s16 pitch; /* 0x16 */ s16 pitch;
} EffectShieldParticleElement; // size = 0x18 } EffectShieldParticleElement; // size = 0x18
typedef struct { typedef struct EffectShieldParticleInit {
/* 0x00 */ u8 numElements; /* 0x00 */ u8 numElements;
/* 0x02 */ Vec3s position; /* 0x02 */ Vec3s position;
/* 0x08 */ Color_RGBA8 primColorStart; /* 0x08 */ Color_RGBA8 primColorStart;
@ -136,7 +136,7 @@ typedef struct {
/* 0x3C */ s32 lightDecay; // halves light radius every frame when set to 1 /* 0x3C */ s32 lightDecay; // halves light radius every frame when set to 1
} EffectShieldParticleInit; // size = 0x40 } EffectShieldParticleInit; // size = 0x40
typedef struct { typedef struct EffectShieldParticle {
/* 0x000 */ EffectShieldParticleElement elements[16]; /* 0x000 */ EffectShieldParticleElement elements[16];
/* 0x180 */ u8 numElements; /* 0x180 */ u8 numElements;
/* 0x182 */ Vec3s position; /* 0x182 */ Vec3s position;
@ -157,7 +157,7 @@ typedef struct {
/* 0x1C4 */ s32 lightDecay; // halves light radius every frame when set to 1 /* 0x1C4 */ s32 lightDecay; // halves light radius every frame when set to 1
} EffectShieldParticle; // size = 0x1C8 } EffectShieldParticle; // size = 0x1C8
typedef struct { typedef struct EffectContext {
/* 0x0000 */ struct PlayState* play; /* 0x0000 */ struct PlayState* play;
struct { struct {
EffectStatus status; EffectStatus status;
@ -173,7 +173,7 @@ typedef struct {
} /* 0x388C */ shieldParticles[SHIELD_PARTICLE_COUNT]; } /* 0x388C */ shieldParticles[SHIELD_PARTICLE_COUNT];
} EffectContext; // size = 0x3DF0 } EffectContext; // size = 0x3DF0
typedef struct { typedef struct EffectInfo {
/* 0x00 */ u32 size; /* 0x00 */ u32 size;
/* 0x04 */ void (*init)(void* effect, void* initParams); /* 0x04 */ void (*init)(void* effect, void* initParams);
/* 0x08 */ void (*destroy)(void* effect); /* 0x08 */ void (*destroy)(void* effect);
@ -181,7 +181,7 @@ typedef struct {
/* 0x10 */ void (*draw)(void* effect, struct GraphicsContext* gfxCtx); /* 0x10 */ void (*draw)(void* effect, struct GraphicsContext* gfxCtx);
} EffectInfo; // size = 0x14 } EffectInfo; // size = 0x14
typedef enum { typedef enum EffectType {
/* 0x00 */ EFFECT_SPARK, /* 0x00 */ EFFECT_SPARK,
/* 0x01 */ EFFECT_BLURE1, /* 0x01 */ EFFECT_BLURE1,
/* 0x02 */ EFFECT_BLURE2, /* 0x02 */ EFFECT_BLURE2,
@ -196,12 +196,12 @@ typedef u32 (*EffectSsInitFunc)(struct PlayState* play, u32 index, struct Effect
typedef void (*EffectSsUpdateFunc)(struct PlayState* play, u32 index, struct EffectSs* effectSs); typedef void (*EffectSsUpdateFunc)(struct PlayState* play, u32 index, struct EffectSs* effectSs);
typedef void (*EffectSsDrawFunc)(struct PlayState* play, u32 index, struct EffectSs* effectSs); typedef void (*EffectSsDrawFunc)(struct PlayState* play, u32 index, struct EffectSs* effectSs);
typedef struct { typedef struct EffectSsProfile {
/* 0x00 */ u32 type; /* 0x00 */ u32 type;
/* 0x04 */ EffectSsInitFunc init; /* 0x04 */ EffectSsInitFunc init;
} EffectSsProfile; // size = 0x08 } EffectSsProfile; // size = 0x08
typedef struct { typedef struct EffectSsOverlay {
/* 0x00 */ RomFile file; /* 0x00 */ RomFile file;
/* 0x08 */ void* vramStart; /* 0x08 */ void* vramStart;
/* 0x0C */ void* vramEnd; /* 0x0C */ void* vramEnd;
@ -226,7 +226,7 @@ typedef struct EffectSs {
/* 0x5F */ u8 type; /* 0x5F */ u8 type;
} EffectSs; // size = 0x60 } EffectSs; // size = 0x60
typedef struct { typedef struct EffectSsInfo {
/* 0x00 */ EffectSs* table; // "data_table" /* 0x00 */ EffectSs* table; // "data_table"
/* 0x04 */ s32 searchStartIndex; /* 0x04 */ s32 searchStartIndex;
/* 0x08 */ s32 tableSize; /* 0x08 */ s32 tableSize;
@ -250,7 +250,7 @@ typedef struct {
#define DEFINE_EFFECT_SS(_0, enum) enum, #define DEFINE_EFFECT_SS(_0, enum) enum,
#define DEFINE_EFFECT_SS_UNSET(enum) enum, #define DEFINE_EFFECT_SS_UNSET(enum) enum,
typedef enum { typedef enum EffectSsType {
#include "tables/effect_ss_table.h" #include "tables/effect_ss_table.h"
/* 0x25 */ EFFECT_SS_TYPE_MAX // originally "EFFECT_SS2_TYPE_LAST_LABEL" /* 0x25 */ EFFECT_SS_TYPE_MAX // originally "EFFECT_SS2_TYPE_LAST_LABEL"
} EffectSsType; } EffectSsType;

View file

@ -34,12 +34,12 @@ struct SkyboxContext;
// This is a bit of a hack used only by bosses in the original game. // This is a bit of a hack used only by bosses in the original game.
#define LIGHT_BLEND_OVERRIDE_FULL_CONTROL 2 #define LIGHT_BLEND_OVERRIDE_FULL_CONTROL 2
typedef enum { typedef enum LightMode {
/* 0 */ LIGHT_MODE_TIME, // environment lights use `lightConfig` and change based on time of day /* 0 */ LIGHT_MODE_TIME, // environment lights use `lightConfig` and change based on time of day
/* 1 */ LIGHT_MODE_SETTINGS // environment lights use `lightSetting` /* 1 */ LIGHT_MODE_SETTINGS // environment lights use `lightSetting`
} LightMode; } LightMode;
typedef enum { typedef enum SkyboxDmaState {
/* 0 */ SKYBOX_DMA_INACTIVE, /* 0 */ SKYBOX_DMA_INACTIVE,
/* 1 */ SKYBOX_DMA_TEXTURE1_START, /* 1 */ SKYBOX_DMA_TEXTURE1_START,
/* 2 */ SKYBOX_DMA_TEXTURE1_DONE, /* 2 */ SKYBOX_DMA_TEXTURE1_DONE,
@ -49,19 +49,19 @@ typedef enum {
/* 13 */ SKYBOX_DMA_TLUT2_START /* 13 */ SKYBOX_DMA_TLUT2_START
} SkyboxDmaState; } SkyboxDmaState;
typedef enum { typedef enum LightningState {
/* 0 */ LIGHTNING_OFF, // no lightning /* 0 */ LIGHTNING_OFF, // no lightning
/* 1 */ LIGHTNING_ON, // request lightning strikes at random intervals /* 1 */ LIGHTNING_ON, // request lightning strikes at random intervals
/* 2 */ LIGHTNING_LAST // request one lightning strike before turning off /* 2 */ LIGHTNING_LAST // request one lightning strike before turning off
} LightningState; } LightningState;
typedef enum { typedef enum LightningStrikeState {
/* 0 */ LIGHTNING_STRIKE_WAIT, // wait between lightning strikes. request bolts when timer hits 0 /* 0 */ LIGHTNING_STRIKE_WAIT, // wait between lightning strikes. request bolts when timer hits 0
/* 1 */ LIGHTNING_STRIKE_START, // fade in the flash. note: bolts are requested in the previous state /* 1 */ LIGHTNING_STRIKE_START, // fade in the flash. note: bolts are requested in the previous state
/* 2 */ LIGHTNING_STRIKE_END // fade out the flash and go back to wait /* 2 */ LIGHTNING_STRIKE_END // fade out the flash and go back to wait
} LightningStrikeState; } LightningStrikeState;
typedef enum { typedef enum WeatherMode {
/* 0 */ WEATHER_MODE_CLEAR, /* 0 */ WEATHER_MODE_CLEAR,
/* 1 */ WEATHER_MODE_CLOUDY_CONFIG3, // scene must define settings for light config 3 /* 1 */ WEATHER_MODE_CLOUDY_CONFIG3, // scene must define settings for light config 3
/* 2 */ WEATHER_MODE_CLOUDY_CONFIG2, // scene must define settings for light config 2 /* 2 */ WEATHER_MODE_CLOUDY_CONFIG2, // scene must define settings for light config 2
@ -70,14 +70,14 @@ typedef enum {
/* 5 */ WEATHER_MODE_HEAVY_RAIN // scene must define settings for light config 4 /* 5 */ WEATHER_MODE_HEAVY_RAIN // scene must define settings for light config 4
} WeatherMode; } WeatherMode;
typedef enum { typedef enum ChangeSkyboxState {
/* 0 */ CHANGE_SKYBOX_INACTIVE, /* 0 */ CHANGE_SKYBOX_INACTIVE,
/* 1 */ CHANGE_SKYBOX_REQUESTED, /* 1 */ CHANGE_SKYBOX_REQUESTED,
/* 2 */ CHANGE_SKYBOX_WAIT, /* 2 */ CHANGE_SKYBOX_WAIT,
/* 3 */ CHANGE_SKYBOX_ACTIVE /* 3 */ CHANGE_SKYBOX_ACTIVE
} ChangeSkyboxState; } ChangeSkyboxState;
typedef enum { typedef enum PrecipitationData {
/* 0 */ PRECIP_RAIN_MAX, // max number of raindrops that can draw; uses this or SOS_MAX, whichever is larger /* 0 */ PRECIP_RAIN_MAX, // max number of raindrops that can draw; uses this or SOS_MAX, whichever is larger
/* 1 */ PRECIP_RAIN_CUR, // current number of rain drops being drawn on screen /* 1 */ PRECIP_RAIN_CUR, // current number of rain drops being drawn on screen
/* 2 */ PRECIP_SNOW_CUR, // current number of snowflakes being drawn on screen /* 2 */ PRECIP_SNOW_CUR, // current number of snowflakes being drawn on screen
@ -86,18 +86,18 @@ typedef enum {
/* 5 */ PRECIP_MAX /* 5 */ PRECIP_MAX
} PrecipitationData; } PrecipitationData;
typedef enum { typedef enum StormRequest {
/* 0 */ STORM_REQUEST_NONE, /* 0 */ STORM_REQUEST_NONE,
/* 1 */ STORM_REQUEST_START, /* 1 */ STORM_REQUEST_START,
/* 2 */ STORM_REQUEST_STOP /* 2 */ STORM_REQUEST_STOP
} StormRequest; } StormRequest;
typedef enum { typedef enum StormState {
/* 0 */ STORM_STATE_OFF, /* 0 */ STORM_STATE_OFF,
/* 1 */ STORM_STATE_ON /* 1 */ STORM_STATE_ON
} StormState; } StormState;
typedef enum { typedef enum TimeBasedSeqState {
/* 0x00 */ TIMESEQ_DAY_BGM, /* 0x00 */ TIMESEQ_DAY_BGM,
/* 0x01 */ TIMESEQ_FADE_DAY_BGM, /* 0x01 */ TIMESEQ_FADE_DAY_BGM,
/* 0x02 */ TIMESEQ_NIGHT_BEGIN_SFX, /* 0x02 */ TIMESEQ_NIGHT_BEGIN_SFX,
@ -110,7 +110,7 @@ typedef enum {
/* 0xFF */ TIMESEQ_DISABLED = 0xFF /* 0xFF */ TIMESEQ_DISABLED = 0xFF
} TimeBasedSeqState; } TimeBasedSeqState;
typedef enum { typedef enum SandstormState {
/* 0 */ SANDSTORM_OFF, /* 0 */ SANDSTORM_OFF,
/* 1 */ SANDSTORM_FILL, /* 1 */ SANDSTORM_FILL,
/* 2 */ SANDSTORM_UNFILL, /* 2 */ SANDSTORM_UNFILL,
@ -118,7 +118,7 @@ typedef enum {
/* 4 */ SANDSTORM_DISSIPATE /* 4 */ SANDSTORM_DISSIPATE
} SandstormState; } SandstormState;
typedef struct { typedef struct LightningStrike {
/* 0x00 */ u8 state; /* 0x00 */ u8 state;
/* 0x01 */ u8 flashRed; /* 0x01 */ u8 flashRed;
/* 0x02 */ u8 flashGreen; /* 0x02 */ u8 flashGreen;
@ -127,7 +127,7 @@ typedef struct {
/* 0x08 */ f32 delayTimer; /* 0x08 */ f32 delayTimer;
} LightningStrike; // size = 0xC } LightningStrike; // size = 0xC
typedef struct { typedef struct TimeBasedSkyboxEntry {
/* 0x00 */ u16 startTime; /* 0x00 */ u16 startTime;
/* 0x02 */ u16 endTime; /* 0x02 */ u16 endTime;
/* 0x04 */ u8 changeSkybox; /* 0x04 */ u8 changeSkybox;
@ -135,7 +135,7 @@ typedef struct {
/* 0x06 */ u8 skybox2Index; /* 0x06 */ u8 skybox2Index;
} TimeBasedSkyboxEntry; // size = 0x8 } TimeBasedSkyboxEntry; // size = 0x8
typedef struct { typedef struct CurrentEnvLightSettings {
/* 0x00 */ u8 ambientColor[3]; /* 0x00 */ u8 ambientColor[3];
/* 0x03 */ s8 light1Dir[3]; /* 0x03 */ s8 light1Dir[3];
/* 0x06 */ u8 light1Color[3]; /* 0x06 */ u8 light1Color[3];
@ -155,7 +155,7 @@ typedef struct {
#define ENV_LIGHT_SETTINGS_BLEND_RATE_U8(blendRateAndFogNear) (((blendRateAndFogNear) >> 10) * 4) #define ENV_LIGHT_SETTINGS_BLEND_RATE_U8(blendRateAndFogNear) (((blendRateAndFogNear) >> 10) * 4)
#define ENV_LIGHT_SETTINGS_FOG_NEAR(blendRateAndFogNear) ((blendRateAndFogNear) & 0x3FF) #define ENV_LIGHT_SETTINGS_FOG_NEAR(blendRateAndFogNear) ((blendRateAndFogNear) & 0x3FF)
typedef struct { typedef struct EnvLightSettings {
/* 0x00 */ u8 ambientColor[3]; /* 0x00 */ u8 ambientColor[3];
/* 0x03 */ s8 light1Dir[3]; /* 0x03 */ s8 light1Dir[3];
/* 0x06 */ u8 light1Color[3]; /* 0x06 */ u8 light1Color[3];
@ -166,7 +166,7 @@ typedef struct {
/* 0x14 */ s16 zFar; /* 0x14 */ s16 zFar;
} EnvLightSettings; // size = 0x16 } EnvLightSettings; // size = 0x16
typedef struct { typedef struct EnvironmentContext {
/* 0x00 */ char unk_00[0x02]; /* 0x00 */ char unk_00[0x02];
/* 0x02 */ u16 sceneTimeSpeed; // time speed value from the scene file /* 0x02 */ u16 sceneTimeSpeed; // time speed value from the scene file
/* 0x04 */ Vec3f sunPos; // moon position can be found by negating the sun position /* 0x04 */ Vec3f sunPos; // moon position can be found by negating the sun position

View file

@ -6,7 +6,7 @@
struct Input; struct Input;
struct PlayState; struct PlayState;
typedef struct { typedef struct FrameAdvanceContext {
/* 0x0 */ s32 enabled; /* 0x0 */ s32 enabled;
/* 0x4 */ s32 timer; /* 0x4 */ s32 timer;
} FrameAdvanceContext; // size = 0x8 } FrameAdvanceContext; // size = 0x8

View file

@ -15,7 +15,7 @@ typedef struct GameAllocEntry {
/* 0x0C */ u32 unk_0C; /* 0x0C */ u32 unk_0C;
} GameAllocEntry; // size = 0x10 } GameAllocEntry; // size = 0x10
typedef struct { typedef struct GameAlloc {
/* 0x00 */ GameAllocEntry base; /* 0x00 */ GameAllocEntry base;
/* 0x10 */ GameAllocEntry* head; /* 0x10 */ GameAllocEntry* head;
} GameAlloc; // size = 0x14 } GameAlloc; // size = 0x14
@ -23,7 +23,7 @@ typedef struct {
// Used in Graph_GetNextGameState in graph.c // Used in Graph_GetNextGameState in graph.c
#define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) enumName, #define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) enumName,
#define DEFINE_GAMESTATE(typeName, enumName, name) DEFINE_GAMESTATE_INTERNAL(typeName, enumName) #define DEFINE_GAMESTATE(typeName, enumName, name) DEFINE_GAMESTATE_INTERNAL(typeName, enumName)
typedef enum { typedef enum GameStateId {
#include "tables/gamestate_table.h" #include "tables/gamestate_table.h"
GAMESTATE_ID_MAX GAMESTATE_ID_MAX
} GameStateId; } GameStateId;

View file

@ -1,6 +1,8 @@
#ifndef Z64INTERFACE_H #ifndef Z64INTERFACE_H
#define Z64INTERFACE_H #define Z64INTERFACE_H
#include "z64view.h"
extern u8 _icon_item_staticSegmentRomStart[]; extern u8 _icon_item_staticSegmentRomStart[];
extern u8 _icon_item_24_staticSegmentRomStart[]; extern u8 _icon_item_24_staticSegmentRomStart[];
@ -29,7 +31,7 @@ extern u8 _icon_item_24_staticSegmentRomStart[];
#define GET_QUEST_ICON_VROM(itemId) \ #define GET_QUEST_ICON_VROM(itemId) \
((uintptr_t)_icon_item_24_staticSegmentRomStart + (((itemId)-ITEM_MEDALLION_FOREST) * QUEST_ICON_SIZE)) ((uintptr_t)_icon_item_24_staticSegmentRomStart + (((itemId)-ITEM_MEDALLION_FOREST) * QUEST_ICON_SIZE))
typedef enum { typedef enum DoAction {
/* 0x00 */ DO_ACTION_ATTACK, /* 0x00 */ DO_ACTION_ATTACK,
/* 0x01 */ DO_ACTION_CHECK, /* 0x01 */ DO_ACTION_CHECK,
/* 0x02 */ DO_ACTION_ENTER, /* 0x02 */ DO_ACTION_ENTER,
@ -67,7 +69,7 @@ typedef enum {
#define DO_ACTION_TEX_HEIGHT 16 #define DO_ACTION_TEX_HEIGHT 16
#define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex)) #define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex))
typedef struct { typedef struct InterfaceContext {
/* 0x0000 */ View view; /* 0x0000 */ View view;
/* 0x0128 */ Vtx* actionVtx; /* 0x0128 */ Vtx* actionVtx;
/* 0x012C */ Vtx* beatingHeartVtx; /* 0x012C */ Vtx* beatingHeartVtx;
@ -144,14 +146,34 @@ typedef struct {
} InterfaceContext; // size = 0x270 } InterfaceContext; // size = 0x270
/** /**
* Button HUD Positions (Upper Left) * Button HUD positions and colors
*/ */
#define A_BUTTON_X 186 #define A_BUTTON_X 186
#define A_BUTTON_Y 9 #define A_BUTTON_Y 9
#if PLATFORM_N64
#define A_BUTTON_R 90
#define A_BUTTON_G 90
#define A_BUTTON_B 255
#else
#define A_BUTTON_R 0
#define A_BUTTON_G 200
#define A_BUTTON_B 50
#endif
#define B_BUTTON_X 160 #define B_BUTTON_X 160
#define B_BUTTON_Y 17 #define B_BUTTON_Y 17
#if PLATFORM_N64
#define B_BUTTON_R 0
#define B_BUTTON_G 150
#define B_BUTTON_B 0
#else
#define B_BUTTON_R 255
#define B_BUTTON_G 30
#define B_BUTTON_B 30
#endif
#define C_LEFT_BUTTON_X 227 #define C_LEFT_BUTTON_X 227
#define C_LEFT_BUTTON_Y 18 #define C_LEFT_BUTTON_Y 18

View file

@ -7,7 +7,7 @@
#define ITEM_NAME_TEX_HEIGHT 16 #define ITEM_NAME_TEX_HEIGHT 16
#define ITEM_NAME_TEX_SIZE ((ITEM_NAME_TEX_WIDTH * ITEM_NAME_TEX_HEIGHT) / 2) // 128x16 IA4 texture #define ITEM_NAME_TEX_SIZE ((ITEM_NAME_TEX_WIDTH * ITEM_NAME_TEX_HEIGHT) / 2) // 128x16 IA4 texture
typedef enum { typedef enum EquipmentType {
/* 0 */ EQUIP_TYPE_SWORD, /* 0 */ EQUIP_TYPE_SWORD,
/* 1 */ EQUIP_TYPE_SHIELD, /* 1 */ EQUIP_TYPE_SHIELD,
/* 2 */ EQUIP_TYPE_TUNIC, /* 2 */ EQUIP_TYPE_TUNIC,
@ -17,26 +17,26 @@ typedef enum {
// `EquipInv*` enums are for Inventory.equipment (for example used in the `CHECK_OWNED_EQUIP` macro) // `EquipInv*` enums are for Inventory.equipment (for example used in the `CHECK_OWNED_EQUIP` macro)
typedef enum { typedef enum EquipInvSword {
/* 0 */ EQUIP_INV_SWORD_KOKIRI, /* 0 */ EQUIP_INV_SWORD_KOKIRI,
/* 1 */ EQUIP_INV_SWORD_MASTER, /* 1 */ EQUIP_INV_SWORD_MASTER,
/* 2 */ EQUIP_INV_SWORD_BIGGORON, /* 2 */ EQUIP_INV_SWORD_BIGGORON,
/* 3 */ EQUIP_INV_SWORD_BROKENGIANTKNIFE /* 3 */ EQUIP_INV_SWORD_BROKENGIANTKNIFE
} EquipInvSword; } EquipInvSword;
typedef enum { typedef enum EquipInvShield {
/* 0 */ EQUIP_INV_SHIELD_DEKU, /* 0 */ EQUIP_INV_SHIELD_DEKU,
/* 1 */ EQUIP_INV_SHIELD_HYLIAN, /* 1 */ EQUIP_INV_SHIELD_HYLIAN,
/* 2 */ EQUIP_INV_SHIELD_MIRROR /* 2 */ EQUIP_INV_SHIELD_MIRROR
} EquipInvShield; } EquipInvShield;
typedef enum { typedef enum EquipInvTunic {
/* 0 */ EQUIP_INV_TUNIC_KOKIRI, /* 0 */ EQUIP_INV_TUNIC_KOKIRI,
/* 1 */ EQUIP_INV_TUNIC_GORON, /* 1 */ EQUIP_INV_TUNIC_GORON,
/* 2 */ EQUIP_INV_TUNIC_ZORA /* 2 */ EQUIP_INV_TUNIC_ZORA
} EquipInvTunic; } EquipInvTunic;
typedef enum { typedef enum EquipInvBoots {
/* 0 */ EQUIP_INV_BOOTS_KOKIRI, /* 0 */ EQUIP_INV_BOOTS_KOKIRI,
/* 1 */ EQUIP_INV_BOOTS_IRON, /* 1 */ EQUIP_INV_BOOTS_IRON,
/* 2 */ EQUIP_INV_BOOTS_HOVER /* 2 */ EQUIP_INV_BOOTS_HOVER
@ -44,7 +44,7 @@ typedef enum {
// `EquipValue*` enums are for ItemEquips.equipment (for example used in the `CUR_EQUIP_VALUE` macro) // `EquipValue*` enums are for ItemEquips.equipment (for example used in the `CUR_EQUIP_VALUE` macro)
typedef enum { typedef enum EquipValueSword {
/* 0 */ EQUIP_VALUE_SWORD_NONE, /* 0 */ EQUIP_VALUE_SWORD_NONE,
/* 1 */ EQUIP_VALUE_SWORD_KOKIRI, /* 1 */ EQUIP_VALUE_SWORD_KOKIRI,
/* 2 */ EQUIP_VALUE_SWORD_MASTER, /* 2 */ EQUIP_VALUE_SWORD_MASTER,
@ -52,7 +52,7 @@ typedef enum {
/* 4 */ EQUIP_VALUE_SWORD_MAX /* 4 */ EQUIP_VALUE_SWORD_MAX
} EquipValueSword; } EquipValueSword;
typedef enum { typedef enum EquipValueShield {
/* 0 */ EQUIP_VALUE_SHIELD_NONE, /* 0 */ EQUIP_VALUE_SHIELD_NONE,
/* 1 */ EQUIP_VALUE_SHIELD_DEKU, /* 1 */ EQUIP_VALUE_SHIELD_DEKU,
/* 2 */ EQUIP_VALUE_SHIELD_HYLIAN, /* 2 */ EQUIP_VALUE_SHIELD_HYLIAN,
@ -60,7 +60,7 @@ typedef enum {
/* 4 */ EQUIP_VALUE_SHIELD_MAX /* 4 */ EQUIP_VALUE_SHIELD_MAX
} EquipValueShield; } EquipValueShield;
typedef enum { typedef enum EquipValueTunic {
/* 0 */ EQUIP_VALUE_TUNIC_NONE, /* 0 */ EQUIP_VALUE_TUNIC_NONE,
/* 1 */ EQUIP_VALUE_TUNIC_KOKIRI, /* 1 */ EQUIP_VALUE_TUNIC_KOKIRI,
/* 2 */ EQUIP_VALUE_TUNIC_GORON, /* 2 */ EQUIP_VALUE_TUNIC_GORON,
@ -68,7 +68,7 @@ typedef enum {
/* 4 */ EQUIP_VALUE_TUNIC_MAX /* 4 */ EQUIP_VALUE_TUNIC_MAX
} EquipValueTunic; } EquipValueTunic;
typedef enum { typedef enum EquipValueBoots {
/* 0 */ EQUIP_VALUE_BOOTS_NONE, /* 0 */ EQUIP_VALUE_BOOTS_NONE,
/* 1 */ EQUIP_VALUE_BOOTS_KOKIRI, /* 1 */ EQUIP_VALUE_BOOTS_KOKIRI,
/* 2 */ EQUIP_VALUE_BOOTS_IRON, /* 2 */ EQUIP_VALUE_BOOTS_IRON,
@ -76,7 +76,7 @@ typedef enum {
/* 4 */ EQUIP_VALUE_BOOTS_MAX /* 4 */ EQUIP_VALUE_BOOTS_MAX
} EquipValueBoots; } EquipValueBoots;
typedef enum { typedef enum UpgradeType {
/* 0x00 */ UPG_QUIVER, /* 0x00 */ UPG_QUIVER,
/* 0x01 */ UPG_BOMB_BAG, /* 0x01 */ UPG_BOMB_BAG,
/* 0x02 */ UPG_STRENGTH, /* 0x02 */ UPG_STRENGTH,
@ -88,7 +88,7 @@ typedef enum {
/* 0x08 */ UPG_MAX /* 0x08 */ UPG_MAX
} UpgradeType; } UpgradeType;
typedef enum { typedef enum QuestItem {
/* 0x00 */ QUEST_MEDALLION_FOREST, /* 0x00 */ QUEST_MEDALLION_FOREST,
/* 0x01 */ QUEST_MEDALLION_FIRE, /* 0x01 */ QUEST_MEDALLION_FIRE,
/* 0x02 */ QUEST_MEDALLION_WATER, /* 0x02 */ QUEST_MEDALLION_WATER,
@ -117,13 +117,13 @@ typedef enum {
/* 0x1C */ QUEST_HEART_PIECE_COUNT = 0x1C // for accessing the `Inventory.questItems` bitfield /* 0x1C */ QUEST_HEART_PIECE_COUNT = 0x1C // for accessing the `Inventory.questItems` bitfield
} QuestItem; } QuestItem;
typedef enum { typedef enum DungeonItem {
/* 0x00 */ DUNGEON_BOSS_KEY, /* 0x00 */ DUNGEON_BOSS_KEY,
/* 0x01 */ DUNGEON_COMPASS, /* 0x01 */ DUNGEON_COMPASS,
/* 0x02 */ DUNGEON_MAP /* 0x02 */ DUNGEON_MAP
} DungeonItem; } DungeonItem;
typedef enum { typedef enum InventorySlot {
/* 0x00 */ SLOT_DEKU_STICK, /* 0x00 */ SLOT_DEKU_STICK,
/* 0x01 */ SLOT_DEKU_NUT, /* 0x01 */ SLOT_DEKU_NUT,
/* 0x02 */ SLOT_BOMB, /* 0x02 */ SLOT_BOMB,
@ -151,7 +151,7 @@ typedef enum {
/* 0xFF */ SLOT_NONE = 0xFF /* 0xFF */ SLOT_NONE = 0xFF
} InventorySlot; } InventorySlot;
typedef enum { typedef enum ItemID {
/* 0x00 */ ITEM_DEKU_STICK, /* 0x00 */ ITEM_DEKU_STICK,
/* 0x01 */ ITEM_DEKU_NUT, /* 0x01 */ ITEM_DEKU_NUT,
/* 0x02 */ ITEM_BOMB, /* 0x02 */ ITEM_BOMB,
@ -317,7 +317,7 @@ typedef enum {
#define ITEM_TRADE_ADULT ITEM_POCKET_EGG #define ITEM_TRADE_ADULT ITEM_POCKET_EGG
// Get Item result may vary depending on context (chest/shop/scrub/drop) // Get Item result may vary depending on context (chest/shop/scrub/drop)
typedef enum { typedef enum GetItemID {
/* 0x00 */ GI_NONE, /* 0x00 */ GI_NONE,
/* 0x01 */ GI_BOMBS_5, /* 0x01 */ GI_BOMBS_5,
/* 0x02 */ GI_DEKU_NUTS_5, /* 0x02 */ GI_DEKU_NUTS_5,
@ -447,7 +447,7 @@ typedef enum {
/* 0x7E */ GI_MAX /* 0x7E */ GI_MAX
} GetItemID; } GetItemID;
typedef enum { typedef enum GetItemDrawID {
/* 0x00 */ GID_BOTTLE_EMPTY, /* 0x00 */ GID_BOTTLE_EMPTY,
/* 0x01 */ GID_SMALL_KEY, /* 0x01 */ GID_SMALL_KEY,
/* 0x02 */ GID_SONG_MINUET, /* 0x02 */ GID_SONG_MINUET,
@ -568,7 +568,7 @@ typedef enum {
/* 0x75 */ GID_MAX /* 0x75 */ GID_MAX
} GetItemDrawID; } GetItemDrawID;
typedef enum { typedef enum ExchangeItemID {
/* 0x00 */ EXCH_ITEM_NONE, /* 0x00 */ EXCH_ITEM_NONE,
/* 0x01 */ EXCH_ITEM_ZELDAS_LETTER, /* 0x01 */ EXCH_ITEM_ZELDAS_LETTER,
/* 0x02 */ EXCH_ITEM_WEIRD_EGG, /* 0x02 */ EXCH_ITEM_WEIRD_EGG,

View file

@ -6,7 +6,7 @@
#include "z64math.h" #include "z64math.h"
#include "color.h" #include "color.h"
typedef struct { typedef struct LightPoint {
/* 0x0 */ s16 x; /* 0x0 */ s16 x;
/* 0x2 */ s16 y; /* 0x2 */ s16 y;
/* 0x4 */ s16 z; /* 0x4 */ s16 z;
@ -15,19 +15,19 @@ typedef struct {
/* 0xA */ s16 radius; /* 0xA */ s16 radius;
} LightPoint; // size = 0xC } LightPoint; // size = 0xC
typedef struct { typedef struct LightDirectional {
/* 0x0 */ s8 x; /* 0x0 */ s8 x;
/* 0x1 */ s8 y; /* 0x1 */ s8 y;
/* 0x2 */ s8 z; /* 0x2 */ s8 z;
/* 0x3 */ u8 color[3]; /* 0x3 */ u8 color[3];
} LightDirectional; // size = 0x6 } LightDirectional; // size = 0x6
typedef union { typedef union LightParams {
LightPoint point; LightPoint point;
LightDirectional dir; LightDirectional dir;
} LightParams; // size = 0xC } LightParams; // size = 0xC
typedef struct { typedef struct LightInfo {
/* 0x0 */ u8 type; /* 0x0 */ u8 type;
/* 0x2 */ LightParams params; /* 0x2 */ LightParams params;
} LightInfo; // size = 0xE } LightInfo; // size = 0xE
@ -46,7 +46,7 @@ typedef struct LightNode {
#define ENV_FOGNEAR_MAX 996 #define ENV_FOGNEAR_MAX 996
#define ENV_ZFAR_MAX 12800 #define ENV_ZFAR_MAX 12800
typedef struct { typedef struct LightContext {
/* 0x0 */ LightNode* listHead; /* 0x0 */ LightNode* listHead;
/* 0x4 */ u8 ambientColor[3]; /* 0x4 */ u8 ambientColor[3];
/* 0x7 */ u8 fogColor[3]; /* 0x7 */ u8 fogColor[3];
@ -54,7 +54,7 @@ typedef struct {
/* 0xC */ s16 zFar; // draw distance. range 0 - ENV_ZFAR_MAX /* 0xC */ s16 zFar; // draw distance. range 0 - ENV_ZFAR_MAX
} LightContext; // size = 0x10 } LightContext; // size = 0x10
typedef enum { typedef enum LightType {
/* 0x00 */ LIGHT_POINT_NOGLOW, /* 0x00 */ LIGHT_POINT_NOGLOW,
/* 0x01 */ LIGHT_DIRECTIONAL, /* 0x01 */ LIGHT_DIRECTIONAL,
/* 0x02 */ LIGHT_POINT_GLOW /* 0x02 */ LIGHT_POINT_GLOW

View file

@ -7,12 +7,12 @@
#define MAP_MARK_CHEST 0 #define MAP_MARK_CHEST 0
#define MAP_MARK_BOSS 1 #define MAP_MARK_BOSS 1
typedef struct { typedef struct MapMarkPoint {
/* 0x00 */ s8 chestFlag; // chest icon is only displayed if this flag is not set for the current room /* 0x00 */ s8 chestFlag; // chest icon is only displayed if this flag is not set for the current room
/* 0x01 */ u8 x, y; // coordinates to place the icon (top-left corner), relative to the minimap texture /* 0x01 */ u8 x, y; // coordinates to place the icon (top-left corner), relative to the minimap texture
} MapMarkPoint; // size = 0x3 } MapMarkPoint; // size = 0x3
typedef struct { typedef struct MapMarkIconData {
/* 0x00 */ s8 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none /* 0x00 */ s8 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none
/* 0x01 */ u8 count; // number of icons to display /* 0x01 */ u8 count; // number of icons to display
/* 0x02 */ MapMarkPoint points[12]; /* 0x02 */ MapMarkPoint points[12];

View file

@ -7,76 +7,76 @@
#define SQ(x) ((x)*(x)) #define SQ(x) ((x)*(x))
#define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z) #define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z)
typedef struct { typedef struct Vec2f {
f32 x, y; f32 x, y;
} Vec2f; // size = 0x08 } Vec2f; // size = 0x08
typedef struct { typedef struct Vec3f {
f32 x, y, z; f32 x, y, z;
} Vec3f; // size = 0x0C } Vec3f; // size = 0x0C
typedef struct { typedef struct Vec3us {
u16 x, y, z; u16 x, y, z;
} Vec3us; // size = 0x06 } Vec3us; // size = 0x06
typedef struct { typedef struct Vec3s {
s16 x, y, z; s16 x, y, z;
} Vec3s; // size = 0x06 } Vec3s; // size = 0x06
typedef struct { typedef struct Vec3i {
s32 x, y, z; s32 x, y, z;
} Vec3i; // size = 0x0C } Vec3i; // size = 0x0C
typedef struct { typedef struct Sphere16 {
Vec3s center; Vec3s center;
s16 radius; s16 radius;
} Sphere16; // size = 0x08 } Sphere16; // size = 0x08
typedef struct { typedef struct Spheref {
Vec3f center; Vec3f center;
f32 radius; f32 radius;
} Spheref; // size = 0x10 } Spheref; // size = 0x10
typedef struct { typedef struct PosRot {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3s rot; /* 0x0C */ Vec3s rot;
} PosRot; // size = 0x14 } PosRot; // size = 0x14
typedef struct { typedef struct Plane {
Vec3f normal; Vec3f normal;
f32 originDist; f32 originDist;
} Plane; // size = 0x10 } Plane; // size = 0x10
typedef struct { typedef struct TriNorm {
Vec3f vtx[3]; Vec3f vtx[3];
Plane plane; Plane plane;
} TriNorm; // size = 0x34 } TriNorm; // size = 0x34
typedef struct { typedef struct Cylinder16 {
/* 0x0000 */ s16 radius; /* 0x0000 */ s16 radius;
/* 0x0002 */ s16 height; /* 0x0002 */ s16 height;
/* 0x0004 */ s16 yShift; /* 0x0004 */ s16 yShift;
/* 0x0006 */ Vec3s pos; /* 0x0006 */ Vec3s pos;
} Cylinder16; // size = 0x0C } Cylinder16; // size = 0x0C
typedef struct { typedef struct Cylinderf {
/* 0x00 */ f32 radius; /* 0x00 */ f32 radius;
/* 0x04 */ f32 height; /* 0x04 */ f32 height;
/* 0x08 */ f32 yShift; /* 0x08 */ f32 yShift;
/* 0x0C */ Vec3f pos; /* 0x0C */ Vec3f pos;
} Cylinderf; // size = 0x18 } Cylinderf; // size = 0x18
typedef struct { typedef struct InfiniteLine {
/* 0x0000 */ Vec3f point; /* 0x0000 */ Vec3f point;
/* 0x000C */ Vec3f dir; /* 0x000C */ Vec3f dir;
} InfiniteLine; // size = 0x18 } InfiniteLine; // size = 0x18
typedef struct { typedef struct Linef {
/* 0x0000 */ Vec3f a; /* 0x0000 */ Vec3f a;
/* 0x000C */ Vec3f b; /* 0x000C */ Vec3f b;
} Linef; // size = 0x18 } Linef; // size = 0x18
typedef struct { typedef struct VecSphGeo {
/* 0x0 */ f32 r; // radius /* 0x0 */ f32 r; // radius
/* 0x4 */ s16 pitch; // depends on coordinate system. See below. /* 0x4 */ s16 pitch; // depends on coordinate system. See below.
/* 0x6 */ s16 yaw; // azimuthal angle /* 0x6 */ s16 yaw; // azimuthal angle
@ -123,6 +123,17 @@ typedef VecSphGeo VecGeo;
#define BINANG_TO_RAD_ALT(binang) (((f32)(binang) / (f32)0x8000) * M_PI) #define BINANG_TO_RAD_ALT(binang) (((f32)(binang) / (f32)0x8000) * M_PI)
#define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * M_PI) / 0x8000) #define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * M_PI) / 0x8000)
// Angle conversion macros required for matching. These were probably the original macros used, but
// we prefer DEG_TO_BINANG/RAD_TO_BINANG where possible to avoid possible undefined behavior with input
// values outside of [-180, 180) degrees or [-PI, PI) radians.
#if PLATFORM_N64
#define DEG_TO_BINANG2(degrees) (f32)((degrees) * (0x8000 / 180.0f))
#define RAD_TO_BINANG2(radians) (f32)((radians) * (0x8000 / M_PI))
#else
#define DEG_TO_BINANG2(degrees) (s32)((degrees) * (0x8000 / 180.0f))
#define RAD_TO_BINANG2(radians) (s32)((radians) * (0x8000 / M_PI))
#endif
// Angle conversion macros (Camera) // Angle conversion macros (Camera)
// these two angle conversion macros are slightly inaccurate // these two angle conversion macros are slightly inaccurate
#define CAM_DEG_TO_BINANG(degrees) (s16)TRUNCF_BINANG((degrees) * 182.04167f + .5f) #define CAM_DEG_TO_BINANG(degrees) (s16)TRUNCF_BINANG((degrees) * 182.04167f + .5f)

View file

@ -6,7 +6,7 @@
struct OcarinaStaff; struct OcarinaStaff;
struct Actor; struct Actor;
typedef enum { typedef enum TextBoxIcon {
/* 0 */ TEXTBOX_ICON_TRIANGLE, /* 0 */ TEXTBOX_ICON_TRIANGLE,
/* 1 */ TEXTBOX_ICON_SQUARE, /* 1 */ TEXTBOX_ICON_SQUARE,
/* 2 */ TEXTBOX_ICON_ARROW /* 2 */ TEXTBOX_ICON_ARROW
@ -54,7 +54,7 @@ typedef enum {
#define FILENAME_PERIOD 0x40 #define FILENAME_PERIOD 0x40
#endif #endif
typedef enum { typedef enum MessageMode {
/* 0x00 */ MSGMODE_NONE, /* 0x00 */ MSGMODE_NONE,
/* 0x01 */ MSGMODE_TEXT_START, /* 0x01 */ MSGMODE_TEXT_START,
/* 0x02 */ MSGMODE_TEXT_BOX_GROWING, /* 0x02 */ MSGMODE_TEXT_BOX_GROWING,
@ -177,7 +177,7 @@ typedef enum MaskReactionSet {
/* 0x3C */ MASK_REACTION_SET_MAX /* 0x3C */ MASK_REACTION_SET_MAX
} MaskReactionSet; } MaskReactionSet;
typedef enum { typedef enum TextState {
/* 0 */ TEXT_STATE_NONE, /* 0 */ TEXT_STATE_NONE,
/* 1 */ TEXT_STATE_DONE_HAS_NEXT, /* 1 */ TEXT_STATE_DONE_HAS_NEXT,
/* 2 */ TEXT_STATE_CLOSING, /* 2 */ TEXT_STATE_CLOSING,
@ -191,7 +191,7 @@ typedef enum {
/* 10 */ TEXT_STATE_AWAITING_NEXT /* 10 */ TEXT_STATE_AWAITING_NEXT
} TextState; } TextState;
typedef struct { typedef struct Font {
/* 0x0000 */ u32 msgOffset; /* 0x0000 */ u32 msgOffset;
/* 0x0004 */ u32 msgLength; /* 0x0004 */ u32 msgLength;
union { union {
@ -221,7 +221,7 @@ typedef struct {
#define TEXTBOX_ENDTYPE_EVENT 0x50 #define TEXTBOX_ENDTYPE_EVENT 0x50
#define TEXTBOX_ENDTYPE_FADING 0x60 #define TEXTBOX_ENDTYPE_FADING 0x60
typedef struct { typedef struct MessageContext {
/* 0x0000 */ View view; /* 0x0000 */ View view;
/* 0x0128 */ Font font; /* 0x0128 */ Font font;
/* 0xE2B0 */ u8* textboxSegment; // original name: "fukidashiSegment" /* 0xE2B0 */ u8* textboxSegment; // original name: "fukidashiSegment"

View file

@ -4,7 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "z64dma.h" #include "z64dma.h"
typedef struct { typedef struct ObjectEntry {
/* 0x00 */ s16 id; /* 0x00 */ s16 id;
/* 0x04 */ void* segment; /* 0x04 */ void* segment;
/* 0x08 */ DmaRequest dmaRequest; /* 0x08 */ DmaRequest dmaRequest;
@ -12,7 +12,7 @@ typedef struct {
/* 0x40 */ OSMesg loadMsg; /* 0x40 */ OSMesg loadMsg;
} ObjectEntry; // size = 0x44 } ObjectEntry; // size = 0x44
typedef struct { typedef struct ObjectContext {
/* 0x0000 */ void* spaceStart; /* 0x0000 */ void* spaceStart;
/* 0x0004 */ void* spaceEnd; // original name: "endSegment" /* 0x0004 */ void* spaceEnd; // original name: "endSegment"
/* 0x0008 */ u8 numEntries; // total amount of used entries /* 0x0008 */ u8 numEntries; // total amount of used entries
@ -26,7 +26,7 @@ typedef struct {
#define DEFINE_OBJECT_EMPTY(_0, enum) enum, #define DEFINE_OBJECT_EMPTY(_0, enum) enum,
#define DEFINE_OBJECT_UNSET(enum) enum, #define DEFINE_OBJECT_UNSET(enum) enum,
typedef enum { typedef enum ObjectId {
#include "tables/object_table.h" #include "tables/object_table.h"
/* 0x0192 */ OBJECT_ID_MAX /* 0x0192 */ OBJECT_ID_MAX
} ObjectId; } ObjectId;

View file

@ -3,7 +3,7 @@
#include "ultra64.h" #include "ultra64.h"
typedef enum { typedef enum OcarinaSongId {
/* 0 */ OCARINA_SONG_MINUET, /* 0 */ OCARINA_SONG_MINUET,
/* 1 */ OCARINA_SONG_BOLERO, /* 1 */ OCARINA_SONG_BOLERO,
/* 2 */ OCARINA_SONG_SERENADE, /* 2 */ OCARINA_SONG_SERENADE,
@ -22,7 +22,7 @@ typedef enum {
/* 14 */ OCARINA_SONG_SCARECROW_LONG = OCARINA_SONG_MAX // anything larger than 13 is considered the long scarecrow's song /* 14 */ OCARINA_SONG_SCARECROW_LONG = OCARINA_SONG_MAX // anything larger than 13 is considered the long scarecrow's song
} OcarinaSongId; } OcarinaSongId;
typedef enum { typedef enum OcarinaSongActionId {
/* 0x00 */ OCARINA_ACTION_UNK_0, // acts like free play but never set /* 0x00 */ OCARINA_ACTION_UNK_0, // acts like free play but never set
/* 0x01 */ OCARINA_ACTION_FREE_PLAY, /* 0x01 */ OCARINA_ACTION_FREE_PLAY,
/* 0x02 */ OCARINA_ACTION_TEACH_MINUET, // Song demonstrations by teachers /* 0x02 */ OCARINA_ACTION_TEACH_MINUET, // Song demonstrations by teachers
@ -75,7 +75,7 @@ typedef enum {
/* 0x31 */ OCARINA_ACTION_CHECK_NOWARP_DONE /* 0x31 */ OCARINA_ACTION_CHECK_NOWARP_DONE
} OcarinaSongActionId; } OcarinaSongActionId;
typedef enum { typedef enum OcarinaMode {
/* 0x00 */ OCARINA_MODE_00, /* 0x00 */ OCARINA_MODE_00,
/* 0x01 */ OCARINA_MODE_01, /* 0x01 */ OCARINA_MODE_01,
/* 0x02 */ OCARINA_MODE_02, /* 0x02 */ OCARINA_MODE_02,
@ -94,7 +94,7 @@ typedef enum {
/* 0x0F */ OCARINA_MODE_0F /* 0x0F */ OCARINA_MODE_0F
} OcarinaMode; } OcarinaMode;
typedef enum { typedef enum OcarinaButtonIndex {
/* 0 */ OCARINA_BTN_A, /* 0 */ OCARINA_BTN_A,
/* 1 */ OCARINA_BTN_C_DOWN, /* 1 */ OCARINA_BTN_C_DOWN,
/* 2 */ OCARINA_BTN_C_RIGHT, /* 2 */ OCARINA_BTN_C_RIGHT,
@ -106,7 +106,7 @@ typedef enum {
// Uses scientific pitch notation relative to middle C // Uses scientific pitch notation relative to middle C
// https://en.wikipedia.org/wiki/Scientific_pitch_notation // https://en.wikipedia.org/wiki/Scientific_pitch_notation
typedef enum { typedef enum OcarinaPitch {
/* 0x0 */ OCARINA_PITCH_C4, /* 0x0 */ OCARINA_PITCH_C4,
/* 0x1 */ OCARINA_PITCH_DFLAT4, /* 0x1 */ OCARINA_PITCH_DFLAT4,
/* 0x2 */ OCARINA_PITCH_D4, /* 0x2 */ OCARINA_PITCH_D4,
@ -126,7 +126,7 @@ typedef enum {
/* 0xFF */ OCARINA_PITCH_NONE = 0xFF /* 0xFF */ OCARINA_PITCH_NONE = 0xFF
} OcarinaPitch; } OcarinaPitch;
typedef enum { typedef enum OcarinaInstrumentId {
/* 0 */ OCARINA_INSTRUMENT_OFF, /* 0 */ OCARINA_INSTRUMENT_OFF,
/* 1 */ OCARINA_INSTRUMENT_DEFAULT, /* 1 */ OCARINA_INSTRUMENT_DEFAULT,
/* 2 */ OCARINA_INSTRUMENT_MALON, /* 2 */ OCARINA_INSTRUMENT_MALON,
@ -139,7 +139,7 @@ typedef enum {
/* 8 */ OCARINA_INSTRUMENT_DEFAULT_COPY2 = OCARINA_INSTRUMENT_MAX + 1 // Unused but present in Sequence 0 table /* 8 */ OCARINA_INSTRUMENT_DEFAULT_COPY2 = OCARINA_INSTRUMENT_MAX + 1 // Unused but present in Sequence 0 table
} OcarinaInstrumentId; } OcarinaInstrumentId;
typedef enum { typedef enum OcarinaRecordingState {
/* 0 */ OCARINA_RECORD_OFF, /* 0 */ OCARINA_RECORD_OFF,
/* 1 */ OCARINA_RECORD_SCARECROW_LONG, /* 1 */ OCARINA_RECORD_SCARECROW_LONG,
/* 2 */ OCARINA_RECORD_SCARECROW_SPAWN, /* 2 */ OCARINA_RECORD_SCARECROW_SPAWN,
@ -157,7 +157,7 @@ typedef enum {
* 0x80 - BTN_R is pressed to raise note by a semitone * 0x80 - BTN_R is pressed to raise note by a semitone
*/ */
typedef struct { typedef struct OcarinaNote {
/* 0x0 */ u8 pitch; // number of semitones above middle C /* 0x0 */ u8 pitch; // number of semitones above middle C
/* 0x2 */ u16 length; // number of frames the note is sustained /* 0x2 */ u16 length; // number of frames the note is sustained
/* 0x4 */ u8 volume; /* 0x4 */ u8 volume;
@ -166,7 +166,7 @@ typedef struct {
/* 0x7 */ u8 bFlat4Flag; // See note above /* 0x7 */ u8 bFlat4Flag; // See note above
} OcarinaNote; // size = 0x8 } OcarinaNote; // size = 0x8
typedef struct { typedef struct OcarinaSongButtons {
/* 0x0 */ u8 numButtons; /* 0x0 */ u8 numButtons;
/* 0x1 */ u8 buttonsIndex[8]; /* 0x1 */ u8 buttonsIndex[8];
} OcarinaSongButtons; // size = 0x9 } OcarinaSongButtons; // size = 0x9

View file

@ -12,7 +12,7 @@ struct OcarinaStaff;
#define PAUSE_CURSOR_PAGE_LEFT 10 #define PAUSE_CURSOR_PAGE_LEFT 10
#define PAUSE_CURSOR_PAGE_RIGHT 11 #define PAUSE_CURSOR_PAGE_RIGHT 11
typedef enum { typedef enum PauseMenuPage {
/* 0x00 */ PAUSE_ITEM, // -z /* 0x00 */ PAUSE_ITEM, // -z
/* 0x01 */ PAUSE_MAP, // +x /* 0x01 */ PAUSE_MAP, // +x
/* 0x02 */ PAUSE_QUEST, // +z /* 0x02 */ PAUSE_QUEST, // +z
@ -55,7 +55,7 @@ typedef enum {
#define PAUSE_EQUIP_BUFFER_SIZE sizeof(u16[PAUSE_EQUIP_PLAYER_HEIGHT][PAUSE_EQUIP_PLAYER_WIDTH]) #define PAUSE_EQUIP_BUFFER_SIZE sizeof(u16[PAUSE_EQUIP_PLAYER_HEIGHT][PAUSE_EQUIP_PLAYER_WIDTH])
#define PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE 0x5000 #define PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE 0x5000
typedef enum { typedef enum PauseState {
/* 0 */ PAUSE_STATE_OFF, /* 0 */ PAUSE_STATE_OFF,
/* 1 */ PAUSE_STATE_WAIT_LETTERBOX, // Request no letterboxing and wait for it. /* 1 */ PAUSE_STATE_WAIT_LETTERBOX, // Request no letterboxing and wait for it.
/* 2 */ PAUSE_STATE_WAIT_BG_PRERENDER, // Wait for the pause background prerender to be done. /* 2 */ PAUSE_STATE_WAIT_BG_PRERENDER, // Wait for the pause background prerender to be done.
@ -85,7 +85,7 @@ typedef enum {
(((pauseCtx)->state != PAUSE_STATE_OFF) || ((pauseCtx)->debugState != 0)) (((pauseCtx)->state != PAUSE_STATE_OFF) || ((pauseCtx)->debugState != 0))
// Sub-states of PAUSE_STATE_MAIN // Sub-states of PAUSE_STATE_MAIN
typedef enum { typedef enum PauseMainState {
/* 0 */ PAUSE_MAIN_STATE_IDLE, /* 0 */ PAUSE_MAIN_STATE_IDLE,
/* 1 */ PAUSE_MAIN_STATE_SWITCHING_PAGE, /* 1 */ PAUSE_MAIN_STATE_SWITCHING_PAGE,
/* 2 */ PAUSE_MAIN_STATE_SONG_PLAYBACK, /* 2 */ PAUSE_MAIN_STATE_SONG_PLAYBACK,
@ -98,7 +98,7 @@ typedef enum {
/* 9 */ PAUSE_MAIN_STATE_SONG_PLAYBACK_START /* 9 */ PAUSE_MAIN_STATE_SONG_PLAYBACK_START
} PauseMainState; } PauseMainState;
typedef enum { typedef enum PauseSavePromptState {
/* 0 */ PAUSE_SAVE_PROMPT_STATE_APPEARING, /* 0 */ PAUSE_SAVE_PROMPT_STATE_APPEARING,
/* 1 */ PAUSE_SAVE_PROMPT_STATE_WAIT_CHOICE, /* 1 */ PAUSE_SAVE_PROMPT_STATE_WAIT_CHOICE,
/* 2 */ PAUSE_SAVE_PROMPT_STATE_CLOSING, /* 2 */ PAUSE_SAVE_PROMPT_STATE_CLOSING,
@ -108,7 +108,7 @@ typedef enum {
/* 6 */ PAUSE_SAVE_PROMPT_STATE_RETURN_TO_MENU_ALT /* 6 */ PAUSE_SAVE_PROMPT_STATE_RETURN_TO_MENU_ALT
} PauseSavePromptState; } PauseSavePromptState;
typedef enum { typedef enum PauseCursorQuad {
/* 0 */ PAUSE_QUAD_CURSOR_TL, /* 0 */ PAUSE_QUAD_CURSOR_TL,
/* 1 */ PAUSE_QUAD_CURSOR_TR, /* 1 */ PAUSE_QUAD_CURSOR_TR,
/* 2 */ PAUSE_QUAD_CURSOR_BL, /* 2 */ PAUSE_QUAD_CURSOR_BL,
@ -117,7 +117,7 @@ typedef enum {
/* 5 */ PAUSE_QUAD_CURSOR_MAX /* 5 */ PAUSE_QUAD_CURSOR_MAX
} PauseCursorQuad; } PauseCursorQuad;
typedef enum{ typedef enum WorldMapPoint {
/* 0 */ WORLD_MAP_POINT_HAUNTED_WASTELAND, /* 0 */ WORLD_MAP_POINT_HAUNTED_WASTELAND,
/* 1 */ WORLD_MAP_POINT_GERUDOS_FORTRESS, /* 1 */ WORLD_MAP_POINT_GERUDOS_FORTRESS,
/* 2 */ WORLD_MAP_POINT_GERUDO_VALLEY, /* 2 */ WORLD_MAP_POINT_GERUDO_VALLEY,
@ -135,13 +135,13 @@ typedef enum{
#define TRADE_QUEST_LOCATION_NONE 0xFF #define TRADE_QUEST_LOCATION_NONE 0xFF
typedef enum{ typedef enum WorldMapPointState {
/* 0 */ WORLD_MAP_POINT_STATE_HIDE, /* 0 */ WORLD_MAP_POINT_STATE_HIDE,
/* 1 */ WORLD_MAP_POINT_STATE_SHOW, /* 1 */ WORLD_MAP_POINT_STATE_SHOW,
/* 2 */ WORLD_MAP_POINT_STATE_HIGHLIGHT /* 2 */ WORLD_MAP_POINT_STATE_HIGHLIGHT
} WorldMapPointState; } WorldMapPointState;
typedef struct { typedef struct PauseContext {
/* 0x0000 */ View view; /* 0x0000 */ View view;
/* 0x0128 */ u8* iconItemSegment; /* 0x0128 */ u8* iconItemSegment;
/* 0x012C */ u8* iconItem24Segment; /* 0x012C */ u8* iconItem24Segment;
@ -225,12 +225,12 @@ typedef struct {
#define PAUSE_MAP_MARK_CHEST 0 #define PAUSE_MAP_MARK_CHEST 0
#define PAUSE_MAP_MARK_BOSS 1 #define PAUSE_MAP_MARK_BOSS 1
typedef struct { typedef struct PauseMapMarkPoint {
/* 0x00 */ s16 chestFlag; // chest icon is only displayed if this flag is not set for the current room, -1 for no flag /* 0x00 */ s16 chestFlag; // chest icon is only displayed if this flag is not set for the current room, -1 for no flag
/* 0x04 */ f32 x, y; // coordinates to place the icon (top-left corner) /* 0x04 */ f32 x, y; // coordinates to place the icon (top-left corner)
} PauseMapMarkPoint; // size = 0x0C } PauseMapMarkPoint; // size = 0x0C
typedef struct { typedef struct PauseMapMarkData {
/* 0x00 */ s16 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none /* 0x00 */ s16 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none
/* 0x04 */ s32 unk_04; /* 0x04 */ s32 unk_04;
/* 0x08 */ const Vtx* vtx; /* 0x08 */ const Vtx* vtx;

View file

@ -7,7 +7,7 @@
struct Player; struct Player;
typedef enum { typedef enum PlayerSword {
/* 0 */ PLAYER_SWORD_NONE, /* 0 */ PLAYER_SWORD_NONE,
/* 1 */ PLAYER_SWORD_KOKIRI, /* 1 */ PLAYER_SWORD_KOKIRI,
/* 2 */ PLAYER_SWORD_MASTER, /* 2 */ PLAYER_SWORD_MASTER,
@ -15,7 +15,7 @@ typedef enum {
/* 4 */ PLAYER_SWORD_MAX /* 4 */ PLAYER_SWORD_MAX
} PlayerSword; } PlayerSword;
typedef enum { typedef enum PlayerShield {
/* 0x00 */ PLAYER_SHIELD_NONE, /* 0x00 */ PLAYER_SHIELD_NONE,
/* 0x01 */ PLAYER_SHIELD_DEKU, /* 0x01 */ PLAYER_SHIELD_DEKU,
/* 0x02 */ PLAYER_SHIELD_HYLIAN, /* 0x02 */ PLAYER_SHIELD_HYLIAN,
@ -23,14 +23,14 @@ typedef enum {
/* 0x04 */ PLAYER_SHIELD_MAX /* 0x04 */ PLAYER_SHIELD_MAX
} PlayerShield; } PlayerShield;
typedef enum { typedef enum PlayerTunic {
/* 0x00 */ PLAYER_TUNIC_KOKIRI, /* 0x00 */ PLAYER_TUNIC_KOKIRI,
/* 0x01 */ PLAYER_TUNIC_GORON, /* 0x01 */ PLAYER_TUNIC_GORON,
/* 0x02 */ PLAYER_TUNIC_ZORA, /* 0x02 */ PLAYER_TUNIC_ZORA,
/* 0x03 */ PLAYER_TUNIC_MAX /* 0x03 */ PLAYER_TUNIC_MAX
} PlayerTunic; } PlayerTunic;
typedef enum { typedef enum PlayerBoots {
/* 0x00 */ PLAYER_BOOTS_KOKIRI, /* 0x00 */ PLAYER_BOOTS_KOKIRI,
/* 0x01 */ PLAYER_BOOTS_IRON, /* 0x01 */ PLAYER_BOOTS_IRON,
/* 0x02 */ PLAYER_BOOTS_HOVER, /* 0x02 */ PLAYER_BOOTS_HOVER,
@ -41,7 +41,7 @@ typedef enum {
/* 0x06 */ PLAYER_BOOTS_MAX /* 0x06 */ PLAYER_BOOTS_MAX
} PlayerBoots; } PlayerBoots;
typedef enum { typedef enum PlayerStrength {
/* 0x00 */ PLAYER_STR_NONE, /* 0x00 */ PLAYER_STR_NONE,
/* 0x01 */ PLAYER_STR_BRACELET, /* 0x01 */ PLAYER_STR_BRACELET,
/* 0x02 */ PLAYER_STR_SILVER_G, /* 0x02 */ PLAYER_STR_SILVER_G,
@ -49,7 +49,7 @@ typedef enum {
/* 0x04 */ PLAYER_STR_MAX /* 0x04 */ PLAYER_STR_MAX
} PlayerStrength; } PlayerStrength;
typedef enum { typedef enum PlayerMask {
/* 0x00 */ PLAYER_MASK_NONE, /* 0x00 */ PLAYER_MASK_NONE,
/* 0x01 */ PLAYER_MASK_KEATON, /* 0x01 */ PLAYER_MASK_KEATON,
/* 0x02 */ PLAYER_MASK_SKULL, /* 0x02 */ PLAYER_MASK_SKULL,
@ -62,7 +62,7 @@ typedef enum {
/* 0x09 */ PLAYER_MASK_MAX /* 0x09 */ PLAYER_MASK_MAX
} PlayerMask; } PlayerMask;
typedef enum { typedef enum PlayerEnvHazard {
/* 0x0 */ PLAYER_ENV_HAZARD_NONE, /* 0x0 */ PLAYER_ENV_HAZARD_NONE,
/* 0x1 */ PLAYER_ENV_HAZARD_HOTROOM, /* 0x1 */ PLAYER_ENV_HAZARD_HOTROOM,
/* 0x2 */ PLAYER_ENV_HAZARD_UNDERWATER_FLOOR, /* 0x2 */ PLAYER_ENV_HAZARD_UNDERWATER_FLOOR,
@ -70,7 +70,7 @@ typedef enum {
/* 0x4 */ PLAYER_ENV_HAZARD_UNDERWATER_FREE /* 0x4 */ PLAYER_ENV_HAZARD_UNDERWATER_FREE
} PlayerEnvHazard; } PlayerEnvHazard;
typedef enum { typedef enum PlayerItemAction {
/* 0x00 */ PLAYER_IA_NONE, /* 0x00 */ PLAYER_IA_NONE,
/* 0x01 */ PLAYER_IA_SWORD_CS, // Hold sword without shield in hand. The sword is not useable. /* 0x01 */ PLAYER_IA_SWORD_CS, // Hold sword without shield in hand. The sword is not useable.
/* 0x02 */ PLAYER_IA_FISHING_POLE, /* 0x02 */ PLAYER_IA_FISHING_POLE,
@ -141,7 +141,7 @@ typedef enum {
/* 0x43 */ PLAYER_IA_MAX /* 0x43 */ PLAYER_IA_MAX
} PlayerItemAction; } PlayerItemAction;
typedef enum { typedef enum PlayerLimb {
/* 0x00 */ PLAYER_LIMB_NONE, /* 0x00 */ PLAYER_LIMB_NONE,
/* 0x01 */ PLAYER_LIMB_ROOT, /* 0x01 */ PLAYER_LIMB_ROOT,
/* 0x02 */ PLAYER_LIMB_WAIST, /* 0x02 */ PLAYER_LIMB_WAIST,
@ -167,7 +167,7 @@ typedef enum {
/* 0x16 */ PLAYER_LIMB_MAX /* 0x16 */ PLAYER_LIMB_MAX
} PlayerLimb; } PlayerLimb;
typedef enum { typedef enum PlayerBodyPart {
/* 0x00 */ PLAYER_BODYPART_WAIST, // PLAYER_LIMB_WAIST /* 0x00 */ PLAYER_BODYPART_WAIST, // PLAYER_LIMB_WAIST
/* 0x01 */ PLAYER_BODYPART_R_THIGH, // PLAYER_LIMB_R_THIGH /* 0x01 */ PLAYER_BODYPART_R_THIGH, // PLAYER_LIMB_R_THIGH
/* 0x02 */ PLAYER_BODYPART_R_SHIN, // PLAYER_LIMB_R_SHIN /* 0x02 */ PLAYER_BODYPART_R_SHIN, // PLAYER_LIMB_R_SHIN
@ -189,7 +189,7 @@ typedef enum {
/* 0x12 */ PLAYER_BODYPART_MAX /* 0x12 */ PLAYER_BODYPART_MAX
} PlayerBodyPart; } PlayerBodyPart;
typedef enum { typedef enum PlayerMeleeWeaponAnimation {
/* 0 */ PLAYER_MWA_FORWARD_SLASH_1H, /* 0 */ PLAYER_MWA_FORWARD_SLASH_1H,
/* 1 */ PLAYER_MWA_FORWARD_SLASH_2H, /* 1 */ PLAYER_MWA_FORWARD_SLASH_2H,
/* 2 */ PLAYER_MWA_FORWARD_COMBO_1H, /* 2 */ PLAYER_MWA_FORWARD_COMBO_1H,
@ -221,7 +221,7 @@ typedef enum {
/* 28 */ PLAYER_MWA_MAX /* 28 */ PLAYER_MWA_MAX
} PlayerMeleeWeaponAnimation; } PlayerMeleeWeaponAnimation;
typedef enum { typedef enum PlayerDoorType {
/* -1 */ PLAYER_DOORTYPE_AJAR = -1, /* -1 */ PLAYER_DOORTYPE_AJAR = -1,
/* 0 */ PLAYER_DOORTYPE_NONE, /* 0 */ PLAYER_DOORTYPE_NONE,
/* 1 */ PLAYER_DOORTYPE_HANDLE, /* 1 */ PLAYER_DOORTYPE_HANDLE,
@ -229,13 +229,13 @@ typedef enum {
/* 3 */ PLAYER_DOORTYPE_FAKE /* 3 */ PLAYER_DOORTYPE_FAKE
} PlayerDoorType; } PlayerDoorType;
typedef enum { typedef enum PlayerFacePart {
/* 0 */ PLAYER_FACEPART_EYES, /* 0 */ PLAYER_FACEPART_EYES,
/* 1 */ PLAYER_FACEPART_MOUTH, /* 1 */ PLAYER_FACEPART_MOUTH,
/* 2 */ PLAYER_FACEPART_MAX /* 2 */ PLAYER_FACEPART_MAX
} PlayerFacePart; } PlayerFacePart;
typedef enum { typedef enum PlayerEyes {
/* 0 */ PLAYER_EYES_OPEN, /* 0 */ PLAYER_EYES_OPEN,
/* 1 */ PLAYER_EYES_HALF, /* 1 */ PLAYER_EYES_HALF,
/* 2 */ PLAYER_EYES_CLOSED, /* 2 */ PLAYER_EYES_CLOSED,
@ -247,7 +247,7 @@ typedef enum {
/* 8 */ PLAYER_EYES_MAX /* 8 */ PLAYER_EYES_MAX
} PlayerEyes; } PlayerEyes;
typedef enum { typedef enum PlayerMouth {
/* 0 */ PLAYER_MOUTH_CLOSED, /* 0 */ PLAYER_MOUTH_CLOSED,
/* 1 */ PLAYER_MOUTH_HALF, /* 1 */ PLAYER_MOUTH_HALF,
/* 2 */ PLAYER_MOUTH_OPEN, /* 2 */ PLAYER_MOUTH_OPEN,
@ -255,7 +255,7 @@ typedef enum {
/* 4 */ PLAYER_MOUTH_MAX /* 4 */ PLAYER_MOUTH_MAX
} PlayerMouth; } PlayerMouth;
typedef enum { typedef enum PlayerFace {
/* 0 */ PLAYER_FACE_NEUTRAL, // eyes open and mouth closed /* 0 */ PLAYER_FACE_NEUTRAL, // eyes open and mouth closed
/* 1 */ PLAYER_FACE_NEUTRAL_BLINKING_HALF, // eyes half open and mouth closed /* 1 */ PLAYER_FACE_NEUTRAL_BLINKING_HALF, // eyes half open and mouth closed
/* 2 */ PLAYER_FACE_NEUTRAL_BLINKING_CLOSED, // eyes and mouth closed /* 2 */ PLAYER_FACE_NEUTRAL_BLINKING_CLOSED, // eyes and mouth closed
@ -275,7 +275,7 @@ typedef enum {
/* 16 */ PLAYER_FACE_MAX /* 16 */ PLAYER_FACE_MAX
} PlayerFace; } PlayerFace;
typedef enum { typedef enum PlayerModelGroup {
/* 0x00 */ PLAYER_MODELGROUP_0, // unused (except for a bug in `Player_OverrideLimbDrawPause`) /* 0x00 */ PLAYER_MODELGROUP_0, // unused (except for a bug in `Player_OverrideLimbDrawPause`)
/* 0x01 */ PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD, //hold sword only. used for holding sword only as child link with hylian shield equipped /* 0x01 */ PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD, //hold sword only. used for holding sword only as child link with hylian shield equipped
/* 0x02 */ PLAYER_MODELGROUP_SWORD_AND_SHIELD, // hold sword and shield or just sword if no shield is equipped /* 0x02 */ PLAYER_MODELGROUP_SWORD_AND_SHIELD, // hold sword and shield or just sword if no shield is equipped
@ -295,7 +295,7 @@ typedef enum {
/* 0x10 */ PLAYER_MODELGROUP_MAX /* 0x10 */ PLAYER_MODELGROUP_MAX
} PlayerModelGroup; } PlayerModelGroup;
typedef enum { typedef enum PlayerModelGroupEntry {
/* 0x00 */ PLAYER_MODELGROUPENTRY_ANIM, /* 0x00 */ PLAYER_MODELGROUPENTRY_ANIM,
/* 0x01 */ PLAYER_MODELGROUPENTRY_LEFT_HAND, /* 0x01 */ PLAYER_MODELGROUPENTRY_LEFT_HAND,
/* 0x02 */ PLAYER_MODELGROUPENTRY_RIGHT_HAND, /* 0x02 */ PLAYER_MODELGROUPENTRY_RIGHT_HAND,
@ -304,7 +304,7 @@ typedef enum {
/* 0x05 */ PLAYER_MODELGROUPENTRY_MAX /* 0x05 */ PLAYER_MODELGROUPENTRY_MAX
} PlayerModelGroupEntry; } PlayerModelGroupEntry;
typedef enum { typedef enum PlayerModelType {
// left hand // left hand
/* 0x00 */ PLAYER_MODELTYPE_LH_OPEN, // empty open hand /* 0x00 */ PLAYER_MODELTYPE_LH_OPEN, // empty open hand
/* 0x01 */ PLAYER_MODELTYPE_LH_CLOSED, // empty closed hand /* 0x01 */ PLAYER_MODELTYPE_LH_CLOSED, // empty closed hand
@ -334,7 +334,7 @@ typedef enum {
/* 0xFF */ PLAYER_MODELTYPE_RH_FF = 0xFF // disable shield collider, cutscene-specific /* 0xFF */ PLAYER_MODELTYPE_RH_FF = 0xFF // disable shield collider, cutscene-specific
} PlayerModelType; } PlayerModelType;
typedef enum { typedef enum PlayerAnimType {
/* 0x00 */ PLAYER_ANIMTYPE_0, /* 0x00 */ PLAYER_ANIMTYPE_0,
/* 0x01 */ PLAYER_ANIMTYPE_1, /* 0x01 */ PLAYER_ANIMTYPE_1,
/* 0x02 */ PLAYER_ANIMTYPE_2, /* 0x02 */ PLAYER_ANIMTYPE_2,
@ -347,7 +347,7 @@ typedef enum {
/** /**
* Temporary names, derived from original animation names in `D_80853914` * Temporary names, derived from original animation names in `D_80853914`
*/ */
typedef enum { typedef enum PlayerAnimGroup {
/* 0x00 */ PLAYER_ANIMGROUP_wait, /* 0x00 */ PLAYER_ANIMGROUP_wait,
/* 0x01 */ PLAYER_ANIMGROUP_walk, /* 0x01 */ PLAYER_ANIMGROUP_walk,
/* 0x02 */ PLAYER_ANIMGROUP_run, /* 0x02 */ PLAYER_ANIMGROUP_run,
@ -399,7 +399,7 @@ typedef enum {
#define LIMB_BUF_COUNT(limbCount) ((ALIGN16((limbCount) * sizeof(Vec3s)) + sizeof(Vec3s) - 1) / sizeof(Vec3s)) #define LIMB_BUF_COUNT(limbCount) ((ALIGN16((limbCount) * sizeof(Vec3s)) + sizeof(Vec3s) - 1) / sizeof(Vec3s))
#define PLAYER_LIMB_BUF_COUNT LIMB_BUF_COUNT(PLAYER_LIMB_MAX) #define PLAYER_LIMB_BUF_COUNT LIMB_BUF_COUNT(PLAYER_LIMB_MAX)
typedef enum { typedef enum PlayerCsAction {
/* 0x00 */ PLAYER_CSACTION_NONE, /* 0x00 */ PLAYER_CSACTION_NONE,
/* 0x01 */ PLAYER_CSACTION_1, /* 0x01 */ PLAYER_CSACTION_1,
/* 0x02 */ PLAYER_CSACTION_2, /* 0x02 */ PLAYER_CSACTION_2,
@ -506,7 +506,7 @@ typedef enum {
/* 0x67 */ PLAYER_CSACTION_MAX /* 0x67 */ PLAYER_CSACTION_MAX
} PlayerCsAction; } PlayerCsAction;
typedef enum { typedef enum PlayerCueId {
/* 0x00 */ PLAYER_CUEID_NONE, /* 0x00 */ PLAYER_CUEID_NONE,
/* 0x01 */ PLAYER_CUEID_1, /* 0x01 */ PLAYER_CUEID_1,
/* 0x02 */ PLAYER_CUEID_2, /* 0x02 */ PLAYER_CUEID_2,
@ -588,7 +588,7 @@ typedef enum {
/* 0x4E */ PLAYER_CUEID_MAX /* 0x4E */ PLAYER_CUEID_MAX
} PlayerCueId; } PlayerCueId;
typedef enum { typedef enum PlayerLedgeClimbType {
/* 0 */ PLAYER_LEDGE_CLIMB_NONE, /* 0 */ PLAYER_LEDGE_CLIMB_NONE,
/* 1 */ PLAYER_LEDGE_CLIMB_1, /* 1 */ PLAYER_LEDGE_CLIMB_1,
/* 2 */ PLAYER_LEDGE_CLIMB_2, /* 2 */ PLAYER_LEDGE_CLIMB_2,
@ -596,7 +596,7 @@ typedef enum {
/* 4 */ PLAYER_LEDGE_CLIMB_4 /* 4 */ PLAYER_LEDGE_CLIMB_4
} PlayerLedgeClimbType; } PlayerLedgeClimbType;
typedef enum { typedef enum PlayerStickDirection {
/* -1 */ PLAYER_STICK_DIR_NONE = -1, /* -1 */ PLAYER_STICK_DIR_NONE = -1,
/* 0 */ PLAYER_STICK_DIR_FORWARD, /* 0 */ PLAYER_STICK_DIR_FORWARD,
/* 1 */ PLAYER_STICK_DIR_LEFT, /* 1 */ PLAYER_STICK_DIR_LEFT,
@ -604,7 +604,7 @@ typedef enum {
/* 3 */ PLAYER_STICK_DIR_RIGHT /* 3 */ PLAYER_STICK_DIR_RIGHT
} PlayerStickDirection; } PlayerStickDirection;
typedef struct { typedef struct PlayerAgeProperties {
/* 0x00 */ f32 ceilingCheckHeight; /* 0x00 */ f32 ceilingCheckHeight;
/* 0x04 */ f32 unk_04; /* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08; /* 0x08 */ f32 unk_08;
@ -640,7 +640,7 @@ typedef struct {
/* 0xCC */ LinkAnimationHeader* unk_CC[2]; /* 0xCC */ LinkAnimationHeader* unk_CC[2];
} PlayerAgeProperties; // size = 0xD4 } PlayerAgeProperties; // size = 0xD4
typedef struct { typedef struct WeaponInfo {
/* 0x00 */ s32 active; /* 0x00 */ s32 active;
/* 0x04 */ Vec3f tip; /* 0x04 */ Vec3f tip;
/* 0x10 */ Vec3f base; /* 0x10 */ Vec3f base;

View file

@ -4,7 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "z64math.h" #include "z64math.h"
typedef enum { typedef enum Language {
#if OOT_NTSC #if OOT_NTSC
/* 0 */ LANGUAGE_JPN, /* 0 */ LANGUAGE_JPN,
/* 1 */ LANGUAGE_ENG, /* 1 */ LANGUAGE_ENG,
@ -19,7 +19,7 @@ typedef enum {
// `_FORCE` means that this request will respond to `forceRisingButtonAlphas`. // `_FORCE` means that this request will respond to `forceRisingButtonAlphas`.
// If set, the buttons will also raise alphas but will also account for disabled buttons // If set, the buttons will also raise alphas but will also account for disabled buttons
typedef enum { typedef enum HudVisibilityMode {
/* 0 */ HUD_VISIBILITY_NO_CHANGE, /* 0 */ HUD_VISIBILITY_NO_CHANGE,
/* 1 */ HUD_VISIBILITY_NOTHING, /* 1 */ HUD_VISIBILITY_NOTHING,
/* 2 */ HUD_VISIBILITY_NOTHING_ALT, // Identical to HUD_VISIBILITY_NOTHING /* 2 */ HUD_VISIBILITY_NOTHING_ALT, // Identical to HUD_VISIBILITY_NOTHING
@ -38,7 +38,7 @@ typedef enum {
/* 52 */ HUD_VISIBILITY_NOTHING_INSTANT = 52 /* 52 */ HUD_VISIBILITY_NOTHING_INSTANT = 52
} HudVisibilityMode; } HudVisibilityMode;
typedef enum { typedef enum MagicState {
/* 0x0 */ MAGIC_STATE_IDLE, // Regular gameplay /* 0x0 */ MAGIC_STATE_IDLE, // Regular gameplay
/* 0x1 */ MAGIC_STATE_CONSUME_SETUP, // Sets the speed at which magic border flashes /* 0x1 */ MAGIC_STATE_CONSUME_SETUP, // Sets the speed at which magic border flashes
/* 0x2 */ MAGIC_STATE_CONSUME, // Consume magic until target is reached or no more magic is available /* 0x2 */ MAGIC_STATE_CONSUME, // Consume magic until target is reached or no more magic is available
@ -52,7 +52,7 @@ typedef enum {
/* 0xA */ MAGIC_STATE_ADD // Add requested magic /* 0xA */ MAGIC_STATE_ADD // Add requested magic
} MagicState; } MagicState;
typedef enum { typedef enum MagicChangeType {
/* 0 */ MAGIC_CONSUME_NOW, // Consume Magic immediately without preview /* 0 */ MAGIC_CONSUME_NOW, // Consume Magic immediately without preview
/* 1 */ MAGIC_CONSUME_WAIT_NO_PREVIEW, // Sets consume target but waits to consume. No yellow magic preview to target consumption. Unused /* 1 */ MAGIC_CONSUME_WAIT_NO_PREVIEW, // Sets consume target but waits to consume. No yellow magic preview to target consumption. Unused
/* 2 */ MAGIC_CONSUME_NOW_ALT, // Identical behaviour to MAGIC_CONSUME_NOW. Unused /* 2 */ MAGIC_CONSUME_NOW_ALT, // Identical behaviour to MAGIC_CONSUME_NOW. Unused
@ -64,13 +64,13 @@ typedef enum {
#define MAGIC_NORMAL_METER 0x30 #define MAGIC_NORMAL_METER 0x30
#define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER) #define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER)
typedef struct { typedef struct ItemEquips {
/* 0x00 */ u8 buttonItems[4]; /* 0x00 */ u8 buttonItems[4];
/* 0x04 */ u8 cButtonSlots[3]; /* 0x04 */ u8 cButtonSlots[3];
/* 0x08 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each nibble is a piece `EquipValue*` /* 0x08 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each nibble is a piece `EquipValue*`
} ItemEquips; // size = 0x0A } ItemEquips; // size = 0x0A
typedef struct { typedef struct Inventory {
/* 0x00 */ u8 items[24]; /* 0x00 */ u8 items[24];
/* 0x18 */ s8 ammo[16]; /* 0x18 */ s8 ammo[16];
/* 0x28 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each bit to an owned piece `EquipInv*` /* 0x28 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each bit to an owned piece `EquipInv*`
@ -82,7 +82,7 @@ typedef struct {
/* 0x5C */ s16 gsTokens; /* 0x5C */ s16 gsTokens;
} Inventory; // size = 0x5E } Inventory; // size = 0x5E
typedef struct { typedef struct SavedSceneFlags {
/* 0x00 */ u32 chest; /* 0x00 */ u32 chest;
/* 0x04 */ u32 swch; /* 0x04 */ u32 swch;
/* 0x08 */ u32 clear; /* 0x08 */ u32 clear;
@ -92,7 +92,7 @@ typedef struct {
/* 0x18 */ u32 floors; /* 0x18 */ u32 floors;
} SavedSceneFlags; // size = 0x1C } SavedSceneFlags; // size = 0x1C
typedef struct { typedef struct HorseData {
/* 0x00 */ s16 sceneId; /* 0x00 */ s16 sceneId;
/* 0x02 */ Vec3s pos; /* 0x02 */ Vec3s pos;
/* 0x08 */ s16 angle; /* 0x08 */ s16 angle;
@ -104,14 +104,14 @@ typedef struct {
* "return": coming from the ground * "return": coming from the ground
* "top": coming from the air * "top": coming from the air
*/ */
typedef enum { typedef enum RespawnMode {
/* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */ /* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */
/* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */ /* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */
/* 0x02 */ RESPAWN_MODE_TOP, /* Farore's Wind */ /* 0x02 */ RESPAWN_MODE_TOP, /* Farore's Wind */
/* 0x03 */ RESPAWN_MODE_MAX /* 0x03 */ RESPAWN_MODE_MAX
} RespawnMode; } RespawnMode;
typedef struct { typedef struct RespawnData {
/* 0x00 */ Vec3f pos; /* 0x00 */ Vec3f pos;
/* 0x0C */ s16 yaw; /* 0x0C */ s16 yaw;
/* 0x0E */ s16 playerParams; /* 0x0E */ s16 playerParams;
@ -122,7 +122,7 @@ typedef struct {
/* 0x18 */ u32 tempCollectFlags; /* 0x18 */ u32 tempCollectFlags;
} RespawnData; // size = 0x1C } RespawnData; // size = 0x1C
typedef struct { typedef struct FaroresWindData {
/* 0x00 */ Vec3i pos; /* 0x00 */ Vec3i pos;
/* 0x0C */ s32 yaw; /* 0x0C */ s32 yaw;
/* 0x10 */ s32 playerParams; /* 0x10 */ s32 playerParams;
@ -133,7 +133,7 @@ typedef struct {
/* 0x24 */ s32 tempCollectFlags; /* 0x24 */ s32 tempCollectFlags;
} FaroresWindData; // size = 0x28 } FaroresWindData; // size = 0x28
typedef enum { typedef enum TimerState {
/* 0x0 */ TIMER_STATE_OFF, /* 0x0 */ TIMER_STATE_OFF,
/* 0x1 */ TIMER_STATE_ENV_HAZARD_INIT, // Init env timer that counts down, total time based on health, resets on void-out, kills at 0 /* 0x1 */ TIMER_STATE_ENV_HAZARD_INIT, // Init env timer that counts down, total time based on health, resets on void-out, kills at 0
/* 0x2 */ TIMER_STATE_ENV_HAZARD_PREVIEW, // Display initial time, keep it fixed at the screen center /* 0x2 */ TIMER_STATE_ENV_HAZARD_PREVIEW, // Display initial time, keep it fixed at the screen center
@ -151,7 +151,7 @@ typedef enum {
/* 0xF */ TIMER_STATE_UP_FREEZE // Stop counting the timer /* 0xF */ TIMER_STATE_UP_FREEZE // Stop counting the timer
} TimerState; } TimerState;
typedef enum { typedef enum SubTimerState {
/* 0x0 */ SUBTIMER_STATE_OFF, /* 0x0 */ SUBTIMER_STATE_OFF,
/* 0x1 */ SUBTIMER_STATE_DOWN_INIT, // Init timer that counts down /* 0x1 */ SUBTIMER_STATE_DOWN_INIT, // Init timer that counts down
/* 0x2 */ SUBTIMER_STATE_DOWN_PREVIEW, // Display initial time, keep it fixed at the screen center /* 0x2 */ SUBTIMER_STATE_DOWN_PREVIEW, // Display initial time, keep it fixed at the screen center
@ -165,7 +165,7 @@ typedef enum {
/* 0xA */ SUBTIMER_STATE_UP_TICK // Counting up /* 0xA */ SUBTIMER_STATE_UP_TICK // Counting up
} SubTimerState; } SubTimerState;
typedef enum { typedef enum TimerId {
/* 0 */ TIMER_ID_MAIN, // Takes priority in both counting and drawing. See `timerState` and `timerSeconds` /* 0 */ TIMER_ID_MAIN, // Takes priority in both counting and drawing. See `timerState` and `timerSeconds`
/* 1 */ TIMER_ID_SUB, // See `subTimerState` and `subTimerSeconds` /* 1 */ TIMER_ID_SUB, // See `subTimerState` and `subTimerSeconds`
/* 2 */ TIMER_ID_MAX /* 2 */ TIMER_ID_MAX
@ -203,7 +203,7 @@ typedef enum {
} WorldMapArea; } WorldMapArea;
// offsets in SavePlayerData and SaveContext/Save // offsets in SavePlayerData and SaveContext/Save
typedef struct { typedef struct SavePlayerData {
/* 0x00 0x001C */ char newf[6]; // string "ZELDAZ" /* 0x00 0x001C */ char newf[6]; // string "ZELDAZ"
/* 0x06 0x0022 */ u16 deaths; /* 0x06 0x0022 */ u16 deaths;
/* 0x08 0x0024 */ char playerName[8]; /* 0x08 0x0024 */ char playerName[8];
@ -229,7 +229,7 @@ typedef struct {
} SavePlayerData; } SavePlayerData;
// offsets in SaveInfo and SaveContext/Save // offsets in SaveInfo and SaveContext/Save
typedef struct { typedef struct SaveInfo {
/* 0x0000 0x001C */ SavePlayerData playerData; // "S_Private" /* 0x0000 0x001C */ SavePlayerData playerData; // "S_Private"
/* 0x004C 0x0068 */ ItemEquips equips; /* 0x004C 0x0068 */ ItemEquips equips;
/* 0x0058 0x0074 */ Inventory inventory; /* 0x0058 0x0074 */ Inventory inventory;
@ -255,7 +255,7 @@ typedef struct {
/* 0x1336 0x1352 */ u16 checksum; // "check_sum" /* 0x1336 0x1352 */ u16 checksum; // "check_sum"
} SaveInfo; } SaveInfo;
typedef struct { typedef struct Save {
/* 0x00 */ s32 entranceIndex; /* 0x00 */ s32 entranceIndex;
/* 0x04 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`) /* 0x04 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`)
/* 0x08 */ s32 cutsceneIndex; /* 0x08 */ s32 cutsceneIndex;
@ -266,7 +266,7 @@ typedef struct {
/* 0x1C */ SaveInfo info; // "information" /* 0x1C */ SaveInfo info; // "information"
} Save; } Save;
typedef struct { typedef struct SaveContext {
/* 0x0000 */ Save save; // "memory" /* 0x0000 */ Save save; // "memory"
/* 0x1354 */ s32 fileNum; // "file_no" /* 0x1354 */ s32 fileNum; // "file_no"
/* 0x1358 */ char unk_1358[0x0004]; /* 0x1358 */ char unk_1358[0x0004];
@ -331,12 +331,12 @@ typedef struct {
/* 0x1424 */ s16 healthAccumulator; /* 0x1424 */ s16 healthAccumulator;
} SaveContext; // size = 0x1428 } SaveContext; // size = 0x1428
typedef enum { typedef enum ButtonStatus {
/* 0x00 */ BTN_ENABLED, /* 0x00 */ BTN_ENABLED,
/* 0xFF */ BTN_DISABLED = 0xFF /* 0xFF */ BTN_DISABLED = 0xFF
} ButtonStatus; } ButtonStatus;
typedef enum { typedef enum ChamberCutsceneNum {
/* 0 */ CHAMBER_CS_FOREST, /* 0 */ CHAMBER_CS_FOREST,
/* 1 */ CHAMBER_CS_FIRE, /* 1 */ CHAMBER_CS_FIRE,
/* 2 */ CHAMBER_CS_WATER, /* 2 */ CHAMBER_CS_WATER,
@ -345,7 +345,7 @@ typedef enum {
/* 5 */ CHAMBER_CS_LIGHT /* 5 */ CHAMBER_CS_LIGHT
} ChamberCutsceneNum; } ChamberCutsceneNum;
typedef enum { typedef enum HighScores {
/* 0x00 */ HS_HBA, // horseback archery /* 0x00 */ HS_HBA, // horseback archery
/* 0x01 */ HS_POE_POINTS, /* 0x01 */ HS_POE_POINTS,
/* 0x02 */ HS_FISHING, /* 0x02 */ HS_FISHING,
@ -367,21 +367,21 @@ typedef enum {
#define HS_FISH_CHEAT_ADULT 0x80000000 // used Sinking Lure as adult to catch record fish #define HS_FISH_CHEAT_ADULT 0x80000000 // used Sinking Lure as adult to catch record fish
#define HS_FISH_PLAYED 0x10000 // incremented for every play. controls weather. #define HS_FISH_PLAYED 0x10000 // incremented for every play. controls weather.
typedef enum { typedef enum SunsSongState {
/* 0 */ SUNSSONG_INACTIVE, /* 0 */ SUNSSONG_INACTIVE,
/* 1 */ SUNSSONG_START, // the suns ocarina effect signals that the song has finished playing /* 1 */ SUNSSONG_START, // the suns ocarina effect signals that the song has finished playing
/* 2 */ SUNSSONG_SPEED_TIME, // suns was played where time passes, speed up the advancement of time /* 2 */ SUNSSONG_SPEED_TIME, // suns was played where time passes, speed up the advancement of time
/* 3 */ SUNSSONG_SPECIAL // time does not advance, but signals the song was played. used for freezing redeads /* 3 */ SUNSSONG_SPECIAL // time does not advance, but signals the song was played. used for freezing redeads
} SunsSongState; } SunsSongState;
typedef enum { typedef enum GameMode {
/* 0 */ GAMEMODE_NORMAL, /* 0 */ GAMEMODE_NORMAL,
/* 1 */ GAMEMODE_TITLE_SCREEN, /* 1 */ GAMEMODE_TITLE_SCREEN,
/* 2 */ GAMEMODE_FILE_SELECT, // Note: only instance type transitions swap to file select /* 2 */ GAMEMODE_FILE_SELECT, // Note: only instance type transitions swap to file select
/* 3 */ GAMEMODE_END_CREDITS /* 3 */ GAMEMODE_END_CREDITS
} GameMode; } GameMode;
typedef enum { typedef enum SceneLayer {
/* 0 */ SCENE_LAYER_CHILD_DAY, /* 0 */ SCENE_LAYER_CHILD_DAY,
/* 1 */ SCENE_LAYER_CHILD_NIGHT, /* 1 */ SCENE_LAYER_CHILD_NIGHT,
/* 2 */ SCENE_LAYER_ADULT_DAY, /* 2 */ SCENE_LAYER_ADULT_DAY,
@ -391,7 +391,7 @@ typedef enum {
#define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST) #define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST)
typedef enum { typedef enum LinkAge {
/* 0 */ LINK_AGE_ADULT, /* 0 */ LINK_AGE_ADULT,
/* 1 */ LINK_AGE_CHILD /* 1 */ LINK_AGE_CHILD
} LinkAge; } LinkAge;
@ -846,7 +846,7 @@ typedef enum {
#define EVENTINF_HORSES_0A ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_0A_SHIFT) #define EVENTINF_HORSES_0A ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_0A_SHIFT)
#define EVENTINF_CUCCO_GAME_FINISHED EVENTINF_HORSES_0A #define EVENTINF_CUCCO_GAME_FINISHED EVENTINF_HORSES_0A
typedef enum { typedef enum EventInfHorsesState {
/* 0 */ EVENTINF_HORSES_STATE_0, /* 0 */ EVENTINF_HORSES_STATE_0,
/* 1 */ EVENTINF_HORSES_STATE_1, /* 1 */ EVENTINF_HORSES_STATE_1,
/* 2 */ EVENTINF_HORSES_STATE_2, /* 2 */ EVENTINF_HORSES_STATE_2,

View file

@ -1,12 +1,19 @@
#ifndef Z64SCENE_H #ifndef Z64SCENE_H
#define Z64SCENE_H #define Z64SCENE_H
#include "z64.h" #include "macros.h"
#include "z64dma.h" // for RomFile #include "ultra64.h"
#include "z64bgcheck.h"
#include "z64dma.h"
#include "z64environment.h"
#include "z64light.h"
#include "z64math.h"
#include "command_macros_base.h" #include "command_macros_base.h"
typedef struct { struct PlayState;
typedef struct SceneTableEntry {
/* 0x00 */ RomFile sceneFile; /* 0x00 */ RomFile sceneFile;
/* 0x08 */ RomFile titleFile; /* 0x08 */ RomFile titleFile;
/* 0x10 */ u8 unk_10; /* 0x10 */ u8 unk_10;
@ -15,14 +22,14 @@ typedef struct {
/* 0x13 */ u8 unk_13; /* 0x13 */ u8 unk_13;
} SceneTableEntry; // size = 0x14 } SceneTableEntry; // size = 0x14
typedef struct { typedef struct ActorEntry {
/* 0x00 */ s16 id; /* 0x00 */ s16 id;
/* 0x02 */ Vec3s pos; /* 0x02 */ Vec3s pos;
/* 0x08 */ Vec3s rot; /* 0x08 */ Vec3s rot;
/* 0x0E */ s16 params; /* 0x0E */ s16 params;
} ActorEntry; // size = 0x10 } ActorEntry; // size = 0x10
typedef struct { typedef struct TransitionActorEntry {
struct { struct {
s8 room; // Room to switch to s8 room; // Room to switch to
s8 bgCamIndex; // How the camera reacts during the transition. See `Camera_ChangeDoorCam` s8 bgCamIndex; // How the camera reacts during the transition. See `Camera_ChangeDoorCam`
@ -38,53 +45,53 @@ typedef struct TransitionActorContext {
/* 0x04 */ TransitionActorEntry* list; /* 0x04 */ TransitionActorEntry* list;
} TransitionActorContext; // size = 0x8 } TransitionActorContext; // size = 0x8
typedef struct { typedef struct Spawn {
/* 0x00 */ u8 playerEntryIndex; /* 0x00 */ u8 playerEntryIndex;
/* 0x01 */ u8 room; /* 0x01 */ u8 room;
} Spawn; } Spawn;
typedef struct { typedef struct Path {
/* 0x00 */ u8 count; // number of points in the path /* 0x00 */ u8 count; // number of points in the path
/* 0x04 */ Vec3s* points; // Segment Address to the array of points /* 0x04 */ Vec3s* points; // Segment Address to the array of points
} Path; // size = 0x8 } Path; // size = 0x8
// Room shapes // Room shapes
typedef enum { typedef enum RoomShapeType {
/* 0 */ ROOM_SHAPE_TYPE_NORMAL, /* 0 */ ROOM_SHAPE_TYPE_NORMAL,
/* 1 */ ROOM_SHAPE_TYPE_IMAGE, /* 1 */ ROOM_SHAPE_TYPE_IMAGE,
/* 2 */ ROOM_SHAPE_TYPE_CULLABLE, /* 2 */ ROOM_SHAPE_TYPE_CULLABLE,
/* 3 */ ROOM_SHAPE_TYPE_MAX /* 3 */ ROOM_SHAPE_TYPE_MAX
} RoomShapeType; } RoomShapeType;
typedef struct { typedef struct RoomShapeBase {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
} RoomShapeBase; // size = 0x01 } RoomShapeBase; // size = 0x01
typedef struct { typedef struct RoomShapeDListsEntry {
/* 0x00 */ Gfx* opa; /* 0x00 */ Gfx* opa;
/* 0x04 */ Gfx* xlu; /* 0x04 */ Gfx* xlu;
} RoomShapeDListsEntry; // size = 0x08 } RoomShapeDListsEntry; // size = 0x08
typedef struct { typedef struct RoomShapeNormal {
/* 0x00 */ RoomShapeBase base; /* 0x00 */ RoomShapeBase base;
/* 0x01 */ u8 numEntries; /* 0x01 */ u8 numEntries;
/* 0x04 */ RoomShapeDListsEntry* entries; /* 0x04 */ RoomShapeDListsEntry* entries;
/* 0x08 */ RoomShapeDListsEntry* entriesEnd; /* 0x08 */ RoomShapeDListsEntry* entriesEnd;
} RoomShapeNormal; // size = 0x0C } RoomShapeNormal; // size = 0x0C
typedef enum { typedef enum RoomShapeImageAmountType {
/* 1 */ ROOM_SHAPE_IMAGE_AMOUNT_SINGLE = 1, /* 1 */ ROOM_SHAPE_IMAGE_AMOUNT_SINGLE = 1,
/* 2 */ ROOM_SHAPE_IMAGE_AMOUNT_MULTI /* 2 */ ROOM_SHAPE_IMAGE_AMOUNT_MULTI
} RoomShapeImageAmountType; } RoomShapeImageAmountType;
typedef struct { typedef struct RoomShapeImageBase {
/* 0x00 */ RoomShapeBase base; /* 0x00 */ RoomShapeBase base;
/* 0x01 */ u8 amountType; // RoomShapeImageAmountType /* 0x01 */ u8 amountType; // RoomShapeImageAmountType
/* 0x04 */ RoomShapeDListsEntry* entry; /* 0x04 */ RoomShapeDListsEntry* entry;
} RoomShapeImageBase; // size = 0x08 } RoomShapeImageBase; // size = 0x08
typedef struct { typedef struct RoomShapeImageSingle {
/* 0x00 */ RoomShapeImageBase base; /* 0x00 */ RoomShapeImageBase base;
/* 0x08 */ void* source; /* 0x08 */ void* source;
/* 0x0C */ u32 unk_0C; /* 0x0C */ u32 unk_0C;
@ -97,7 +104,7 @@ typedef struct {
/* 0x1C */ u16 tlutCount; /* 0x1C */ u16 tlutCount;
} RoomShapeImageSingle; // size = 0x20 } RoomShapeImageSingle; // size = 0x20
typedef struct { typedef struct RoomShapeImageMultiBgEntry {
/* 0x00 */ u16 unk_00; /* 0x00 */ u16 unk_00;
/* 0x02 */ u8 bgCamIndex; // for which bg cam index is this entry for /* 0x02 */ u8 bgCamIndex; // for which bg cam index is this entry for
/* 0x04 */ void* source; /* 0x04 */ void* source;
@ -111,13 +118,13 @@ typedef struct {
/* 0x18 */ u16 tlutCount; /* 0x18 */ u16 tlutCount;
} RoomShapeImageMultiBgEntry; // size = 0x1C } RoomShapeImageMultiBgEntry; // size = 0x1C
typedef struct { typedef struct RoomShapeImageMulti {
/* 0x00 */ RoomShapeImageBase base; /* 0x00 */ RoomShapeImageBase base;
/* 0x08 */ u8 numBackgrounds; /* 0x08 */ u8 numBackgrounds;
/* 0x0C */ RoomShapeImageMultiBgEntry* backgrounds; /* 0x0C */ RoomShapeImageMultiBgEntry* backgrounds;
} RoomShapeImageMulti; // size = 0x10 } RoomShapeImageMulti; // size = 0x10
typedef struct { typedef struct RoomShapeCullableEntry {
/* 0x00 */ Vec3s boundsSphereCenter; /* 0x00 */ Vec3s boundsSphereCenter;
/* 0x06 */ s16 boundsSphereRadius; /* 0x06 */ s16 boundsSphereRadius;
/* 0x08 */ Gfx* opa; /* 0x08 */ Gfx* opa;
@ -126,14 +133,14 @@ typedef struct {
#define ROOM_SHAPE_CULLABLE_MAX_ENTRIES 64 #define ROOM_SHAPE_CULLABLE_MAX_ENTRIES 64
typedef struct { typedef struct RoomShapeCullable {
/* 0x00 */ RoomShapeBase base; /* 0x00 */ RoomShapeBase base;
/* 0x01 */ u8 numEntries; /* 0x01 */ u8 numEntries;
/* 0x04 */ RoomShapeCullableEntry* entries; /* 0x04 */ RoomShapeCullableEntry* entries;
/* 0x08 */ RoomShapeCullableEntry* entriesEnd; /* 0x08 */ RoomShapeCullableEntry* entriesEnd;
} RoomShapeCullable; // size = 0x0C } RoomShapeCullable; // size = 0x0C
typedef union { typedef union RoomShape {
RoomShapeBase base; RoomShapeBase base;
RoomShapeNormal normal; RoomShapeNormal normal;
union { union {
@ -193,43 +200,43 @@ typedef struct RoomContext {
// Scene commands // Scene commands
typedef struct { typedef struct SCmdBase {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ u32 data2; /* 0x04 */ u32 data2;
} SCmdBase; } SCmdBase;
typedef struct { typedef struct SCmdPlayerEntryList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 length; /* 0x01 */ u8 length;
/* 0x04 */ ActorEntry* data; /* 0x04 */ ActorEntry* data;
} SCmdPlayerEntryList; } SCmdPlayerEntryList;
typedef struct { typedef struct SCmdActorEntryList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 length; /* 0x01 */ u8 length;
/* 0x04 */ ActorEntry* data; /* 0x04 */ ActorEntry* data;
} SCmdActorEntryList; } SCmdActorEntryList;
typedef struct { typedef struct SCmdUnused02 {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ void* segment; /* 0x04 */ void* segment;
} SCmdUnused02; } SCmdUnused02;
typedef struct { typedef struct SCmdColHeader {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ CollisionHeader* data; /* 0x04 */ CollisionHeader* data;
} SCmdColHeader; } SCmdColHeader;
typedef struct { typedef struct SCmdRoomList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 length; /* 0x01 */ u8 length;
/* 0x04 */ RomFile* data; /* 0x04 */ RomFile* data;
} SCmdRoomList; } SCmdRoomList;
typedef struct { typedef struct SCmdWindSettings {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x02 */ char pad[2]; /* 0x02 */ char pad[2];
@ -239,61 +246,61 @@ typedef struct {
/* 0x07 */ u8 unk_07; /* 0x07 */ u8 unk_07;
} SCmdWindSettings; } SCmdWindSettings;
typedef struct { typedef struct SCmdSpawnList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ Spawn* data; /* 0x04 */ Spawn* data;
} SCmdSpawnList; } SCmdSpawnList;
typedef struct { typedef struct SCmdSpecialFiles {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 naviQuestHintFileId; /* 0x01 */ u8 naviQuestHintFileId;
/* 0x04 */ u32 keepObjectId; /* 0x04 */ u32 keepObjectId;
} SCmdSpecialFiles; } SCmdSpecialFiles;
typedef struct { typedef struct SCmdRoomBehavior {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 gpFlag1; /* 0x01 */ u8 gpFlag1;
/* 0x04 */ u32 gpFlag2; /* 0x04 */ u32 gpFlag2;
} SCmdRoomBehavior; } SCmdRoomBehavior;
typedef struct { typedef struct SCmdMesh {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ RoomShapeBase* data; /* 0x04 */ RoomShapeBase* data;
} SCmdMesh; } SCmdMesh;
typedef struct { typedef struct SCmdObjectList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 length; /* 0x01 */ u8 length;
/* 0x04 */ s16* data; /* 0x04 */ s16* data;
} SCmdObjectList; } SCmdObjectList;
typedef struct { typedef struct SCmdLightList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 length; /* 0x01 */ u8 length;
/* 0x04 */ LightInfo* data; /* 0x04 */ LightInfo* data;
} SCmdLightList; } SCmdLightList;
typedef struct { typedef struct SCmdPathList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ Path* data; /* 0x04 */ Path* data;
} SCmdPathList; } SCmdPathList;
typedef struct { typedef struct SCmdTransiActorList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 length; /* 0x01 */ u8 length;
/* 0x04 */ TransitionActorEntry* data; /* 0x04 */ TransitionActorEntry* data;
} SCmdTransiActorList; } SCmdTransiActorList;
typedef struct { typedef struct SCmdLightSettingList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 length; /* 0x01 */ u8 length;
/* 0x04 */ EnvLightSettings* data; /* 0x04 */ EnvLightSettings* data;
} SCmdLightSettingList; } SCmdLightSettingList;
typedef struct { typedef struct SCmdTimeSettings {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x02 */ char pad[2]; /* 0x02 */ char pad[2];
@ -302,7 +309,7 @@ typedef struct {
/* 0x06 */ u8 timeSpeed; /* 0x06 */ u8 timeSpeed;
} SCmdTimeSettings; } SCmdTimeSettings;
typedef struct { typedef struct SCmdSkyboxSettings {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x02 */ char pad[2]; /* 0x02 */ char pad[2];
@ -311,7 +318,7 @@ typedef struct {
/* 0x06 */ u8 envLightMode; /* 0x06 */ u8 envLightMode;
} SCmdSkyboxSettings; } SCmdSkyboxSettings;
typedef struct { typedef struct SCmdSkyboxDisables {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x02 */ char pad[2]; /* 0x02 */ char pad[2];
@ -319,19 +326,19 @@ typedef struct {
/* 0x05 */ u8 sunMoonDisabled; /* 0x05 */ u8 sunMoonDisabled;
} SCmdSkyboxDisables; } SCmdSkyboxDisables;
typedef struct { typedef struct SCmdEndMarker {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ u32 data2; /* 0x04 */ u32 data2;
} SCmdEndMarker; } SCmdEndMarker;
typedef struct { typedef struct SCmdExitList {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ s16* data; /* 0x04 */ s16* data;
} SCmdExitList; } SCmdExitList;
typedef struct { typedef struct SCmdSoundSettings {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 specId; /* 0x01 */ u8 specId;
/* 0x02 */ char pad[4]; /* 0x02 */ char pad[4];
@ -339,32 +346,32 @@ typedef struct {
/* 0x07 */ u8 seqId; /* 0x07 */ u8 seqId;
} SCmdSoundSettings; } SCmdSoundSettings;
typedef struct { typedef struct SCmdEchoSettings {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x02 */ char pad[5]; /* 0x02 */ char pad[5];
/* 0x07 */ u8 echo; /* 0x07 */ u8 echo;
} SCmdEchoSettings; } SCmdEchoSettings;
typedef struct { typedef struct SCmdCutsceneData {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ void* data; /* 0x04 */ void* data;
} SCmdCutsceneData; } SCmdCutsceneData;
typedef struct { typedef struct SCmdAltHeaders {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 data1; /* 0x01 */ u8 data1;
/* 0x04 */ void* data; /* 0x04 */ void* data;
} SCmdAltHeaders; } SCmdAltHeaders;
typedef struct { typedef struct SCmdMiscSettings {
/* 0x00 */ u8 code; /* 0x00 */ u8 code;
/* 0x01 */ u8 sceneCamType; /* 0x01 */ u8 sceneCamType;
/* 0x04 */ u32 area; /* 0x04 */ u32 area;
} SCmdMiscSettings; } SCmdMiscSettings;
typedef union { typedef union SceneCmd {
SCmdBase base; SCmdBase base;
SCmdPlayerEntryList playerEntryList; SCmdPlayerEntryList playerEntryList;
SCmdActorEntryList actorEntryList; SCmdActorEntryList actorEntryList;
@ -397,7 +404,7 @@ typedef BAD_RETURN(s32) (*SceneCmdHandlerFunc)(struct PlayState*, SceneCmd*);
#define DEFINE_SCENE(_0, _1, enum, _3, _4, _5) enum, #define DEFINE_SCENE(_0, _1, enum, _3, _4, _5) enum,
typedef enum { typedef enum SceneID {
#include "tables/scene_table.h" #include "tables/scene_table.h"
/* 0x6E */ SCENE_ID_MAX /* 0x6E */ SCENE_ID_MAX
} SceneID; } SceneID;
@ -423,7 +430,7 @@ typedef enum {
// Entrance Index Enum // Entrance Index Enum
#define DEFINE_ENTRANCE(enum, _1, _2, _3, _4, _5, _6) enum, #define DEFINE_ENTRANCE(enum, _1, _2, _3, _4, _5, _6) enum,
typedef enum { typedef enum EntranceIndex {
#include "tables/entrance_table.h" #include "tables/entrance_table.h"
/* 0x614 */ ENTR_MAX /* 0x614 */ ENTR_MAX
} EntranceIndex; } EntranceIndex;
@ -432,7 +439,7 @@ typedef enum {
#define ENTR_LOAD_OPENING -1 #define ENTR_LOAD_OPENING -1
typedef enum { typedef enum ReturnEntranceIndex {
/* 0x7FF9 */ ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_SPELLS = 0x7FF9, /* 0x7FF9 */ ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_SPELLS = 0x7FF9,
/* 0x7FFA */ ENTR_RETURN_SHOOTING_GALLERY, /* 0x7FFA */ ENTR_RETURN_SHOOTING_GALLERY,
/* 0x7FFB */ ENTR_RETURN_2, // unused /* 0x7FFB */ ENTR_RETURN_2, // unused
@ -442,7 +449,7 @@ typedef enum {
/* 0x7FFF */ ENTR_RETURN_GROTTO // Grottos and normal Fairy Fountain /* 0x7FFF */ ENTR_RETURN_GROTTO // Grottos and normal Fairy Fountain
} ReturnEntranceIndex; } ReturnEntranceIndex;
typedef enum { typedef enum SceneDrawConfig {
/* 0 */ SDC_DEFAULT, /* 0 */ SDC_DEFAULT,
/* 1 */ SDC_HYRULE_FIELD, /* 1 */ SDC_HYRULE_FIELD,
/* 2 */ SDC_KAKARIKO_VILLAGE, /* 2 */ SDC_KAKARIKO_VILLAGE,
@ -499,6 +506,8 @@ typedef enum {
/* 53 */ SDC_MAX /* 53 */ SDC_MAX
} SceneDrawConfig; } SceneDrawConfig;
typedef void (*SceneDrawConfigFunc)(struct PlayState*);
// R_SCENE_CAM_TYPE values // R_SCENE_CAM_TYPE values
#define SCENE_CAM_TYPE_DEFAULT 0 #define SCENE_CAM_TYPE_DEFAULT 0
#define SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT 0x10 // Camera exhibits fixed behaviors and viewpoint changing is handled by shops #define SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT 0x10 // Camera exhibits fixed behaviors and viewpoint changing is handled by shops
@ -508,7 +517,7 @@ typedef enum {
#define SCENE_CAM_TYPE_SHOOTING_GALLERY 0x50 // Unreferenced in code, and used only by the main layer of the shooting gallery scene #define SCENE_CAM_TYPE_SHOOTING_GALLERY 0x50 // Unreferenced in code, and used only by the main layer of the shooting gallery scene
// navi hints // navi hints
typedef enum { typedef enum NaviQuestHintFileId {
NAVI_QUEST_HINTS_NONE, NAVI_QUEST_HINTS_NONE,
NAVI_QUEST_HINTS_OVERWORLD, NAVI_QUEST_HINTS_OVERWORLD,
NAVI_QUEST_HINTS_DUNGEON NAVI_QUEST_HINTS_DUNGEON
@ -516,7 +525,7 @@ typedef enum {
// Scene commands // Scene commands
typedef enum { typedef enum SceneCommandTypeID {
/* 0x00 */ SCENE_CMD_ID_SPAWN_LIST, /* 0x00 */ SCENE_CMD_ID_SPAWN_LIST,
/* 0x01 */ SCENE_CMD_ID_ACTOR_LIST, /* 0x01 */ SCENE_CMD_ID_ACTOR_LIST,
/* 0x02 */ SCENE_CMD_ID_UNUSED_2, /* 0x02 */ SCENE_CMD_ID_UNUSED_2,

View file

@ -7,7 +7,7 @@
* Holds a compact version of a vertex used in the Skin system * Holds a compact version of a vertex used in the Skin system
* It is used to initialise the Vtx used by an animated limb * It is used to initialise the Vtx used by an animated limb
*/ */
typedef struct { typedef struct SkinVertex {
/* 0x00 */ u16 index; /* 0x00 */ u16 index;
/* 0x02 */ s16 s; // s and t are texture coordinates (also known as u and v) /* 0x02 */ s16 s; // s and t are texture coordinates (also known as u and v)
/* 0x04 */ s16 t; /* 0x04 */ s16 t;
@ -20,7 +20,7 @@ typedef struct {
/** /**
* Describes a position displacement and a scale to be applied to a limb at index `limbIndex` * Describes a position displacement and a scale to be applied to a limb at index `limbIndex`
*/ */
typedef struct { typedef struct SkinTransformation {
/* 0x00 */ u8 limbIndex; /* 0x00 */ u8 limbIndex;
/* 0x02 */ s16 x; /* 0x02 */ s16 x;
/* 0x04 */ s16 y; /* 0x04 */ s16 y;
@ -28,7 +28,7 @@ typedef struct {
/* 0x08 */ u8 scale; /* 0x08 */ u8 scale;
} SkinTransformation; // size = 0xA } SkinTransformation; // size = 0xA
typedef struct { typedef struct SkinLimbModif {
/* 0x00 */ u16 vtxCount; // number of vertices in this modif entry /* 0x00 */ u16 vtxCount; // number of vertices in this modif entry
/* 0x02 */ u16 transformCount; /* 0x02 */ u16 transformCount;
/* 0x04 */ u16 unk_4; // index of limbTransformations? /* 0x04 */ u16 unk_4; // index of limbTransformations?
@ -36,7 +36,7 @@ typedef struct {
/* 0x0C */ SkinTransformation* limbTransformations; /* 0x0C */ SkinTransformation* limbTransformations;
} SkinLimbModif; // size = 0x10 } SkinLimbModif; // size = 0x10
typedef struct { typedef struct SkinAnimatedLimbData {
/* 0x00 */ u16 totalVtxCount; // total vertex count for all modif entries /* 0x00 */ u16 totalVtxCount; // total vertex count for all modif entries
/* 0x02 */ u16 limbModifCount; /* 0x02 */ u16 limbModifCount;
/* 0x04 */ SkinLimbModif* limbModifications; /* 0x04 */ SkinLimbModif* limbModifications;
@ -46,7 +46,7 @@ typedef struct {
#define SKIN_LIMB_TYPE_ANIMATED 4 #define SKIN_LIMB_TYPE_ANIMATED 4
#define SKIN_LIMB_TYPE_NORMAL 11 #define SKIN_LIMB_TYPE_NORMAL 11
typedef struct { typedef struct SkinLimb {
/* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent
/* 0x06 */ u8 child; /* 0x06 */ u8 child;
/* 0x07 */ u8 sibling; /* 0x07 */ u8 sibling;
@ -54,12 +54,12 @@ typedef struct {
/* 0x0C */ void* segment; // Gfx* if segmentType is SKIN_LIMB_TYPE_NORMAL, SkinAnimatedLimbData* if segmentType is SKIN_LIMB_TYPE_ANIMATED, NULL otherwise /* 0x0C */ void* segment; // Gfx* if segmentType is SKIN_LIMB_TYPE_NORMAL, SkinAnimatedLimbData* if segmentType is SKIN_LIMB_TYPE_ANIMATED, NULL otherwise
} SkinLimb; // size = 0x10 } SkinLimb; // size = 0x10
typedef struct { typedef struct SkinLimbVtx {
/* 0x000 */ u8 index; // alternates every draw cycle /* 0x000 */ u8 index; // alternates every draw cycle
/* 0x004 */ Vtx* buf[2]; // number of vertices in buffer determined by `totalVtxCount` /* 0x004 */ Vtx* buf[2]; // number of vertices in buffer determined by `totalVtxCount`
} SkinLimbVtx; // size = 0xC } SkinLimbVtx; // size = 0xC
typedef struct { typedef struct Skin {
/* 0x000 */ SkeletonHeader* skeletonHeader; /* 0x000 */ SkeletonHeader* skeletonHeader;
/* 0x004 */ MtxF mtx; /* 0x004 */ MtxF mtx;
/* 0x044 */ s32 limbCount; /* 0x044 */ s32 limbCount;

View file

@ -10,7 +10,7 @@
struct GameState; struct GameState;
struct GraphicsContext; struct GraphicsContext;
typedef enum { typedef enum SkyboxId {
/* 0x00 */ SKYBOX_NONE, /* 0x00 */ SKYBOX_NONE,
/* 0x01 */ SKYBOX_NORMAL_SKY, /* 0x01 */ SKYBOX_NORMAL_SKY,
/* 0x02 */ SKYBOX_BAZAAR, /* 0x02 */ SKYBOX_BAZAAR,
@ -41,7 +41,7 @@ typedef enum {
/* 0x27 */ SKYBOX_UNSET_27 = 39 /* 0x27 */ SKYBOX_UNSET_27 = 39
} SkyboxId; } SkyboxId;
typedef enum { typedef enum SkyboxDrawType {
/* 0 */ SKYBOX_DRAW_128, // 128x128 top/bottom faces, 128x64 side faces /* 0 */ SKYBOX_DRAW_128, // 128x128 top/bottom faces, 128x64 side faces
/* 1 */ SKYBOX_DRAW_256_4FACE, // 256x256 all side faces with per-face palettes /* 1 */ SKYBOX_DRAW_256_4FACE, // 256x256 all side faces with per-face palettes
/* 2 */ SKYBOX_DRAW_256_3FACE // 256x256 3/4 side faces with per-face palettes /* 2 */ SKYBOX_DRAW_256_3FACE // 256x256 3/4 side faces with per-face palettes
@ -59,7 +59,7 @@ typedef struct SkyboxContext {
/* 0x150 */ char unk_150[0x10]; /* 0x150 */ char unk_150[0x10];
} SkyboxContext; // size = 0x160 } SkyboxContext; // size = 0x160
typedef struct { typedef struct SkyboxFile {
/* 0x00 */ RomFile file; /* 0x00 */ RomFile file;
/* 0x08 */ RomFile palette; /* 0x08 */ RomFile palette;
} SkyboxFile; // size = 0x10 } SkyboxFile; // size = 0x10

View file

@ -3,14 +3,14 @@
#include "ultra64/ultratypes.h" #include "ultra64/ultratypes.h"
typedef struct { typedef struct SramContext {
/* 0x00 */ u8* readBuff; /* 0x00 */ u8* readBuff;
} SramContext; // size = 0x4 } SramContext; // size = 0x4
#define SRAM_SIZE 0x8000 #define SRAM_SIZE 0x8000
#define SRAM_HEADER_SIZE 0x10 #define SRAM_HEADER_SIZE 0x10
typedef enum { typedef enum SramHeaderField {
/* 0x00 */ SRAM_HEADER_SOUND, /* 0x00 */ SRAM_HEADER_SOUND,
/* 0x01 */ SRAM_HEADER_ZTARGET, /* 0x01 */ SRAM_HEADER_ZTARGET,
/* 0x02 */ SRAM_HEADER_LANGUAGE, /* 0x02 */ SRAM_HEADER_LANGUAGE,

View file

@ -9,7 +9,7 @@
#define TRANS_TRIGGER_START 20 // start transition (exiting an area) #define TRANS_TRIGGER_START 20 // start transition (exiting an area)
#define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area) #define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area)
typedef enum { typedef enum TransitionMode {
/* 0 */ TRANS_MODE_OFF, /* 0 */ TRANS_MODE_OFF,
/* 1 */ TRANS_MODE_SETUP, /* 1 */ TRANS_MODE_SETUP,
/* 2 */ TRANS_MODE_INSTANCE_INIT, /* 2 */ TRANS_MODE_INSTANCE_INIT,
@ -30,7 +30,7 @@ typedef enum {
/* 17 */ TRANS_MODE_CS_BLACK_FILL /* 17 */ TRANS_MODE_CS_BLACK_FILL
} TransitionMode; } TransitionMode;
typedef enum { typedef enum TransitionType {
/* 0 */ TRANS_TYPE_WIPE, /* 0 */ TRANS_TYPE_WIPE,
/* 1 */ TRANS_TYPE_TRIFORCE, /* 1 */ TRANS_TYPE_TRIFORCE,
/* 2 */ TRANS_TYPE_FADE_BLACK, /* 2 */ TRANS_TYPE_FADE_BLACK,
@ -62,7 +62,7 @@ typedef enum {
#define TRANS_TYPE_CIRCLE(appearance, color, speed) ((1 << 5) | ((color & 3) << 3) | ((appearance & 3) << 1) | (speed & 1)) #define TRANS_TYPE_CIRCLE(appearance, color, speed) ((1 << 5) | ((color & 3) << 3) | ((appearance & 3) << 1) | (speed & 1))
typedef struct { typedef struct TransitionContext {
union { union {
TransitionFade fade; TransitionFade fade;
TransitionCircle circle; TransitionCircle circle;

View file

@ -4,12 +4,12 @@
#include "ultra64.h" #include "ultra64.h"
#include "color.h" #include "color.h"
typedef struct { typedef struct TransitionTileVtxData {
/* 0x0 */ f32 x; /* 0x0 */ f32 x;
/* 0x4 */ f32 y; /* 0x4 */ f32 y;
} TransitionTileVtxData; // size = 0x8 } TransitionTileVtxData; // size = 0x8
typedef struct { typedef struct TransitionTile {
/* 0x00 */ s32 cols; /* 0x00 */ s32 cols;
/* 0x04 */ s32 rows; /* 0x04 */ s32 rows;
/* 0x08 */ s32 frame; /* 0x08 */ s32 frame;
@ -23,12 +23,12 @@ typedef struct {
/* 0xDC */ u16* zBuffer; /* 0xDC */ u16* zBuffer;
} TransitionTile; // size = 0xE0 } TransitionTile; // size = 0xE0
typedef enum { typedef enum TransitionInstanceType {
/* 1 */ TRANS_INSTANCE_TYPE_FILL_OUT = 1, /* 1 */ TRANS_INSTANCE_TYPE_FILL_OUT = 1,
/* 2 */ TRANS_INSTANCE_TYPE_FILL_IN /* 2 */ TRANS_INSTANCE_TYPE_FILL_IN
} TransitionInstanceType; } TransitionInstanceType;
typedef struct { typedef struct TransitionWipe {
/* 0x000 */ Color_RGBA8_u32 color; /* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ Color_RGBA8_u32 unkColor; /* 0x004 */ Color_RGBA8_u32 unkColor;
/* 0x008 */ u8 direction; /* 0x008 */ u8 direction;
@ -44,7 +44,7 @@ typedef struct {
#define TRANS_INSTANCE_TYPE_FADE_FLASH 3 #define TRANS_INSTANCE_TYPE_FADE_FLASH 3
typedef struct { typedef struct TransitionFade {
/* 0x000 */ u8 type; /* 0x000 */ u8 type;
/* 0x001 */ u8 isDone; /* 0x001 */ u8 isDone;
/* 0x002 */ u8 direction; /* 0x002 */ u8 direction;
@ -52,26 +52,26 @@ typedef struct {
/* 0x008 */ u16 timer; /* 0x008 */ u16 timer;
} TransitionFade; // size = 0xC } TransitionFade; // size = 0xC
typedef enum { typedef enum TransitionCircleAppearance {
/* 0 */ TCA_NORMAL, /* 0 */ TCA_NORMAL,
/* 1 */ TCA_WAVE, /* 1 */ TCA_WAVE,
/* 2 */ TCA_RIPPLE, /* 2 */ TCA_RIPPLE,
/* 3 */ TCA_STARBURST /* 3 */ TCA_STARBURST
} TransitionCircleAppearance; } TransitionCircleAppearance;
typedef enum { typedef enum TransitionCircleColor {
/* 0 */ TCC_BLACK, /* 0 */ TCC_BLACK,
/* 1 */ TCC_WHITE, /* 1 */ TCC_WHITE,
/* 2 */ TCC_GRAY, /* 2 */ TCC_GRAY,
/* 3 */ TCC_SPECIAL // color varies depending on appearance. unused and appears broken /* 3 */ TCC_SPECIAL // color varies depending on appearance. unused and appears broken
} TransitionCircleColor; } TransitionCircleColor;
typedef enum { typedef enum TransitionCircleSpeed {
/* 0 */ TCS_FAST, /* 0 */ TCS_FAST,
/* 1 */ TCS_SLOW /* 1 */ TCS_SLOW
} TransitionCircleSpeed; } TransitionCircleSpeed;
typedef struct { typedef struct TransitionCircle {
/* 0x000 */ Color_RGBA8_u32 color; /* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ Color_RGBA8_u32 unkColor; /* 0x004 */ Color_RGBA8_u32 unkColor;
/* 0x008 */ s32 texX; /* 0x008 */ s32 texX;
@ -90,7 +90,7 @@ typedef struct {
/* 0x0A8 */ Mtx modelView[2][3]; /* 0x0A8 */ Mtx modelView[2][3];
} TransitionCircle; // size = 0x228 } TransitionCircle; // size = 0x228
typedef struct { typedef struct TransitionTriforce {
/* 0x000 */ Color_RGBA8_u32 color; /* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ f32 transPos; /* 0x004 */ f32 transPos;
/* 0x008 */ f32 step; /* 0x008 */ f32 step;

View file

@ -5,14 +5,14 @@
struct GraphicsContext; struct GraphicsContext;
typedef struct { typedef struct Viewport {
/* 0x0 */ s32 topY; // uly (upper left y) /* 0x0 */ s32 topY; // uly (upper left y)
/* 0x4 */ s32 bottomY; // lry (lower right y) /* 0x4 */ s32 bottomY; // lry (lower right y)
/* 0x8 */ s32 leftX; // ulx (upper left x) /* 0x8 */ s32 leftX; // ulx (upper left x)
/* 0xC */ s32 rightX; // lrx (lower right x) /* 0xC */ s32 rightX; // lrx (lower right x)
} Viewport; // size = 0x10 } Viewport; // size = 0x10
typedef struct { typedef struct View {
/* 0x000 */ s32 magic; // string literal "VIEW" / 0x56494557 /* 0x000 */ s32 magic; // string literal "VIEW" / 0x56494557
/* 0x004 */ struct GraphicsContext* gfxCtx; /* 0x004 */ struct GraphicsContext* gfxCtx;
/* 0x008 */ Viewport viewport; /* 0x008 */ Viewport viewport;

View file

@ -4,7 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "color.h" #include "color.h"
typedef enum { typedef enum FramebufferFilterType {
/* 0 */ FB_FILTER_NONE, /* 0 */ FB_FILTER_NONE,
/* 1 */ FB_FILTER_CVG_RGB, /* 1 */ FB_FILTER_CVG_RGB,
/* 2 */ FB_FILTER_CVG_RGB_UNIFORM, /* 2 */ FB_FILTER_CVG_RGB_UNIFORM,
@ -15,12 +15,12 @@ typedef enum {
/* 7 */ FB_FILTER_MONO /* 7 */ FB_FILTER_MONO
} FramebufferFilterType; } FramebufferFilterType;
typedef enum { typedef enum VisScissorType {
/* 0 */ VIS_NO_SETSCISSOR, /* 0 */ VIS_NO_SETSCISSOR,
/* 1 */ VIS_SETSCISSOR /* 1 */ VIS_SETSCISSOR
} VisScissorType; } VisScissorType;
typedef struct { typedef struct Vis {
/* 0x00 */ u32 type; /* 0x00 */ u32 type;
/* 0x04 */ u32 scissorType; /* 0x04 */ u32 scissorType;
/* 0x08 */ Color_RGBA8_u32 primColor; /* 0x08 */ Color_RGBA8_u32 primColor;
@ -33,7 +33,7 @@ typedef struct {
#define FB_FILTER_TO_CVG_TYPE(filter) (filter) #define FB_FILTER_TO_CVG_TYPE(filter) (filter)
typedef enum { typedef enum VisCvgType {
/* 0 */ VIS_CVG_TYPE_NONE = FB_FILTER_TO_CVG_TYPE(FB_FILTER_NONE), /* 0 */ VIS_CVG_TYPE_NONE = FB_FILTER_TO_CVG_TYPE(FB_FILTER_NONE),
/* 1 */ VIS_CVG_TYPE_CVG_RGB = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB), /* 1 */ VIS_CVG_TYPE_CVG_RGB = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB),
/* 2 */ VIS_CVG_TYPE_CVG_RGB_UNIFORM = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_UNIFORM), /* 2 */ VIS_CVG_TYPE_CVG_RGB_UNIFORM = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_UNIFORM),
@ -41,7 +41,7 @@ typedef enum {
/* 4 */ VIS_CVG_TYPE_CVG_RGB_FOG = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_FOG) /* 4 */ VIS_CVG_TYPE_CVG_RGB_FOG = FB_FILTER_TO_CVG_TYPE(FB_FILTER_CVG_RGB_FOG)
} VisCvgType; } VisCvgType;
typedef struct { typedef struct VisCvg {
/* 0x00 */ Vis vis; /* 0x00 */ Vis vis;
} VisCvg; // size = 0x10 } VisCvg; // size = 0x10
@ -71,12 +71,12 @@ void VisMono_Draw(VisMono* this, Gfx** gfxP);
#define FB_FILTER_TO_ZBUF_TYPE(filter) ((filter) - FB_FILTER_ZBUF_IA) #define FB_FILTER_TO_ZBUF_TYPE(filter) ((filter) - FB_FILTER_ZBUF_IA)
typedef enum { typedef enum VisZBufType {
/* 0 */ VIS_ZBUF_TYPE_IA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_IA), /* 0 */ VIS_ZBUF_TYPE_IA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_IA),
/* 1 */ VIS_ZBUF_TYPE_RGBA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_RGBA) /* 1 */ VIS_ZBUF_TYPE_RGBA = FB_FILTER_TO_ZBUF_TYPE(FB_FILTER_ZBUF_RGBA)
} VisZBufType; } VisZBufType;
typedef struct { typedef struct VisZBuf {
/* 0x00 */ Vis vis; /* 0x00 */ Vis vis;
} VisZBuf; // size = 0x10 } VisZBuf; // size = 0x10

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