diff --git a/Makefile b/Makefile
index bc37ffdb42..56134bd7fc 100644
--- a/Makefile
+++ b/Makefile
@@ -40,8 +40,6 @@ COMPILER ?= ido
VERSION ?= gc-eu-mq-dbg
# Number of threads to extract and compress with.
N_THREADS ?= $(shell nproc)
-# Check code syntax with host compiler.
-RUN_CC_CHECK ?= 1
# If DEBUG_OBJECTS is 1, produce additional debugging files such as objdump output or raw binaries for assets
DEBUG_OBJECTS ?= 0
# Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk!
@@ -320,7 +318,8 @@ CPP := gcc -E
MKLDSCRIPT := tools/mkldscript
MKDMADATA := tools/mkdmadata
ELF2ROM := tools/elf2rom
-ZAPD := tools/ZAPD/ZAPD.out
+BIN2C := tools/bin2c
+N64TEXCONV := tools/assets/n64texconv/n64texconv
FADO := tools/fado/fado.elf
PYTHON ?= $(VENV)/bin/python3
@@ -367,8 +366,8 @@ CPPFLAGS += -P -xc -fno-dollars-in-identifiers $(CPP_DEFINES)
ASFLAGS += -march=vr4300 -32 -no-pad-sections -Iinclude -I$(EXTRACTED_DIR)
ifeq ($(COMPILER),gcc)
- CFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -mdivide-breaks -fno-PIC -fno-common -ffreestanding -funsigned-char -fbuiltin -fno-builtin-sinf -fno-builtin-cosf $(CHECK_WARNINGS)
- CCASFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -fno-PIC -fno-common -Wa,-no-pad-sections
+ CFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc -MD $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -mdivide-breaks -fno-PIC -fno-common -ffreestanding -funsigned-char -fbuiltin -fno-builtin-sinf -fno-builtin-cosf $(CHECK_WARNINGS)
+ CCASFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc -MD $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -fno-PIC -fno-common -Wa,-no-pad-sections
MIPS_VERSION := -mips3
else
# Suppress warnings for wrong number of macro arguments (to fake variadic
@@ -386,7 +385,7 @@ endif
ifeq ($(COMPILER),ido)
# Have CC_CHECK pretend to be a MIPS compiler
MIPS_BUILTIN_DEFS := -D_MIPS_ISA_MIPS2=2 -D_MIPS_ISA=_MIPS_ISA_MIPS2 -D_ABIO32=1 -D_MIPS_SIM=_ABIO32 -D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32
- CC_CHECK = gcc -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C $(CPP_DEFINES) $(MIPS_BUILTIN_DEFS) $(GBI_DEFINES) $(INC) $(CHECK_WARNINGS)
+ CC_CHECK = gcc -nostdinc -MD -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C $(CPP_DEFINES) $(MIPS_BUILTIN_DEFS) $(GBI_DEFINES) $(INC) $(CHECK_WARNINGS)
ifeq ($(shell getconf LONG_BIT), 32)
# Work around memory allocation bug in QEMU
export QEMU_GUEST_BASE := 1
@@ -395,7 +394,7 @@ ifeq ($(COMPILER),ido)
CC_CHECK += -m32
endif
else
- RUN_CC_CHECK := 0
+ CC_CHECK = @:
endif
OBJDUMP_FLAGS := -d -r -z -Mreg-names=32
@@ -467,7 +466,7 @@ SOUNDFONT_EXTRACT_XMLS := $(foreach dir,$(SOUNDFONT_EXTRACT_DIRS),$(wildcard $(d
SOUNDFONT_BUILD_XMLS := $(foreach f,$(SOUNDFONT_XMLS),$(BUILD_DIR)/$f) $(foreach f,$(SOUNDFONT_EXTRACT_XMLS),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%))
SOUNDFONT_O_FILES := $(foreach f,$(SOUNDFONT_BUILD_XMLS),$(f:.xml=.o))
SOUNDFONT_HEADERS := $(foreach f,$(SOUNDFONT_BUILD_XMLS),$(f:.xml=.h))
-SOUNDFONT_DEP_FILES := $(foreach f,$(SOUNDFONT_O_FILES),$(f:.o=.d))
+SOUNDFONT_DEP_FILES := $(foreach f,$(SOUNDFONT_O_FILES),$(f:.o=.c.d))
SEQUENCE_FILES := $(foreach dir,$(SEQUENCE_DIRS),$(wildcard $(dir)/*.seq))
SEQUENCE_EXTRACT_FILES := $(foreach dir,$(SEQUENCE_EXTRACT_DIRS),$(wildcard $(dir)/*.seq))
@@ -501,7 +500,7 @@ OVL_RELOC_FILES := $(filter %_reloc.o,$(SPEC_O_FILES))
# Automatic dependency files
# (Only asm_processor dependencies and reloc dependencies are handled for now)
-DEP_FILES := $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d)
+DEP_FILES := $(O_FILES:.o=.d) $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d) $(BUILD_DIR)/spec.d
TEXTURE_FILES_PNG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.png))
TEXTURE_FILES_PNG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.png))
@@ -537,6 +536,8 @@ endif
$(BUILD_DIR)/src/boot/build.o: CPP_DEFINES += -DBUILD_CREATOR="\"$(BUILD_CREATOR)\"" -DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_TIME="\"$(BUILD_TIME)\""
+$(BUILD_DIR)/src/audio/internal/seqplayer.o: CPP_DEFINES += -DMML_VERSION=MML_VERSION_OOT
+
ifeq ($(COMPILER),ido)
$(BUILD_DIR)/src/boot/driverominit.o: OPTFLAGS := -O2
@@ -619,15 +620,15 @@ $(BUILD_DIR)/src/libu64/%.o: OPTFLAGS := -O2
$(BUILD_DIR)/src/audio/%.o: OPTFLAGS := -O2
# Use signed chars instead of unsigned for this audio file (needed to match AudioDebug_ScrPrt)
-$(BUILD_DIR)/src/audio/general.o: CFLAGS += -signed
+$(BUILD_DIR)/src/audio/game/general.o: CFLAGS += -signed
ifeq ($(PLATFORM),N64)
-$(BUILD_DIR)/src/audio/general.o: CFLAGS += -DNO_SQRTF_INTRINSIC
+$(BUILD_DIR)/src/audio/game/general.o: CFLAGS += -DNO_SQRTF_INTRINSIC
endif
# Put string literals in .data for some audio files (needed to match these files with literals)
-$(BUILD_DIR)/src/audio/sfx.o: CFLAGS += -use_readwrite_const
-$(BUILD_DIR)/src/audio/sequence.o: CFLAGS += -use_readwrite_const
+$(BUILD_DIR)/src/audio/game/sfx.o: CFLAGS += -use_readwrite_const
+$(BUILD_DIR)/src/audio/game/sequence.o: CFLAGS += -use_readwrite_const
ifeq ($(PLATFORM),IQUE)
$(BUILD_DIR)/src/libultra/%.o: CC := $(EGCS_CC)
@@ -790,10 +791,10 @@ setup: venv
$(MAKE) -C tools
$(PYTHON) tools/decompress_baserom.py $(VERSION)
$(PYTHON) tools/extract_baserom.py $(BASEROM_DIR)/baserom-decompressed.z64 $(EXTRACTED_DIR)/baserom -v $(VERSION)
+ $(PYTHON) -m tools.assets.extract $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR) -v $(VERSION) -j$(N_THREADS)
$(PYTHON) tools/extract_incbins.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/incbin -v $(VERSION)
$(PYTHON) tools/extract_text.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/text -v $(VERSION)
- $(PYTHON) tools/extract_assets.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/assets -v $(VERSION) -j$(N_THREADS)
- $(PYTHON) tools/extract_audio.py -o $(EXTRACTED_DIR) -v $(VERSION) --read-xml
+ $(PYTHON) tools/extract_audio.py -b $(EXTRACTED_DIR)/baserom -o $(EXTRACTED_DIR) -v $(VERSION) --read-xml
disasm:
$(RM) -r $(EXPECTED_DIR)
@@ -811,9 +812,6 @@ endif
#### Various Recipes ####
-$(ROM): $(ELF)
- $(ELF2ROM) -cic 6105 $< $@
-
ifeq ($(PLATFORM),IQUE)
COMPRESS_ARGS := --format gzip --pad-to 0x4000
CIC = 6102
@@ -822,6 +820,9 @@ else
CIC = 6105
endif
+$(ROM): $(ELF)
+ $(ELF2ROM) -cic $(CIC) $< $@
+
$(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) $(COMPRESS_ARGS)
$(PYTHON) -m ipl3checksum sum --cic $(CIC) --update $@
@@ -830,8 +831,10 @@ COM_PLUGIN := tools/com-plugin/common-plugin.so
LDFLAGS := -T $(LDSCRIPT) -T $(BUILD_DIR)/linker_scripts/makerom.ld -T $(BUILD_DIR)/undefined_syms.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(MAP)
ifeq ($(PLATFORM),IQUE)
- LDFLAGS += -plugin $(COM_PLUGIN) -plugin-opt order=$(BASEROM_DIR)/bss-order.txt
- $(ELF): $(BASEROM_DIR)/bss-order.txt
+ ifeq ($(NON_MATCHING),0)
+ LDFLAGS += -plugin $(COM_PLUGIN) -plugin-opt order=$(BASEROM_DIR)/bss-order.txt
+ $(ELF): $(BASEROM_DIR)/bss-order.txt
+ endif
endif
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(LDSCRIPT) $(BUILD_DIR)/linker_scripts/makerom.ld $(BUILD_DIR)/undefined_syms.txt \
@@ -855,7 +858,7 @@ $(O_FILES): | asset_files
.PHONY: o_files asset_files
$(BUILD_DIR)/spec: $(SPEC) $(SPEC_INCLUDES)
- $(CPP) $(CPPFLAGS) -I. $< | $(BUILD_DIR_REPLACE) > $@
+ $(CPP) $(CPPFLAGS) -MD -MF $@.d -MT $@ -I. $< | $(BUILD_DIR_REPLACE) > $@
$(LDSCRIPT): $(BUILD_DIR)/spec
$(MKLDSCRIPT) $< $@
@@ -867,7 +870,7 @@ $(BUILD_DIR)/baserom/%.o: $(EXTRACTED_DIR)/baserom/%
$(OBJCOPY) -I binary -O elf32-big $< $@
$(BUILD_DIR)/data/%.o: data/%.s
- $(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@
+ $(CPP) $(CPPFLAGS) -MD -MF $(@:.o=.d) -MT $@ -Iinclude $< | $(AS) $(ASFLAGS) -o $@
ifeq ($(PLATFORM),IQUE)
NES_CHARMAP := assets/text/charmap.chn.txt
@@ -876,24 +879,23 @@ else
endif
$(BUILD_DIR)/assets/text/%.enc.nes.h: assets/text/%.h $(EXTRACTED_DIR)/text/%.h $(NES_CHARMAP)
- $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) $< | $(PYTHON) tools/msgenc.py --encoding utf-8 --charmap $(NES_CHARMAP) - $@
+ $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) -MD -MF $(@:.o=.d) -MT $@ $< | $(PYTHON) tools/msgenc.py --encoding utf-8 --charmap $(NES_CHARMAP) - $@
$(BUILD_DIR)/assets/text/%.enc.jpn.h: assets/text/%.h $(EXTRACTED_DIR)/text/%.h assets/text/charmap.jpn.txt
- $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) $< | $(PYTHON) tools/msgenc.py --encoding SHIFT-JIS --wchar --charmap assets/text/charmap.jpn.txt - $@
+ $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) -MD -MF $(@:.o=.d) -MT $@ $< | $(PYTHON) tools/msgenc.py --encoding SHIFT-JIS --wchar --charmap assets/text/charmap.jpn.txt - $@
-# Dependencies for files including message data headers
-# TODO remove when full header dependencies are used.
+# Dependencies for encoded message headers. These dependencies are not automatic as these headers are generated
+# as part of the build. A clean build must know to generate them before the relevant .d files are created.
$(BUILD_DIR)/assets/text/jpn_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.jpn.h
$(BUILD_DIR)/assets/text/nes_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.nes.h
$(BUILD_DIR)/assets/text/ger_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.nes.h
$(BUILD_DIR)/assets/text/fra_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.nes.h
$(BUILD_DIR)/assets/text/staff_message_data_static.o: $(BUILD_DIR)/assets/text/message_data_staff.enc.nes.h
-$(BUILD_DIR)/src/code/z_message.o: assets/text/message_data.h assets/text/message_data_staff.h
$(BUILD_DIR)/assets/text/%.o: assets/text/%.c
ifneq ($(COMPILER),gcc)
# Preprocess text with modern cpp for varargs macros
- $(CPP) -undef -D_LANGUAGE_C -D__sgi $(CPPFLAGS) $(INC) $< -o $(@:.o=.c)
+ $(CPP) -undef -D_LANGUAGE_C -D__sgi $(CPPFLAGS) -MD -MT $@ $(INC) $< -o $(@:.o=.c)
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $(@:.o=.c)
else
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
@@ -901,17 +903,19 @@ endif
$(OBJCOPY) -O binary --only-section .rodata $@ $@.bin
$(BUILD_DIR)/assets/%.o: assets/%.c
+ $(CC_CHECK) $< -o $@
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
$(OBJCOPY_CMD)
$(BUILD_DIR)/assets/%.o: $(EXTRACTED_DIR)/assets/%.c
+ $(CC_CHECK) $< -o $@
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
$(OBJCOPY_CMD)
# Assemble the ROM header with GNU AS always
$(BUILD_DIR)/src/makerom/rom_header.o: src/makerom/rom_header.s
ifeq ($(COMPILER),ido)
- $(CPP) $(CPPFLAGS) $(MIPS_BUILTIN_DEFS) $(INC) $< | $(AS) $(ASFLAGS) -o $@
+ $(CPP) $(CPPFLAGS) $(MIPS_BUILTIN_DEFS) $(INC) -MD -MF $(@:.o=.d) -MT $@ $< | $(AS) $(ASFLAGS) -o $@
else
$(CCAS) -c $(CCASFLAGS) $(MIPS_VERSION) $(ASOPTFLAGS) -o $@ $<
endif
@@ -922,12 +926,15 @@ $(BUILD_DIR)/src/makerom/ipl3.o: $(EXTRACTED_DIR)/incbin/ipl3
$(BUILD_DIR)/src/%.o: src/%.s
ifeq ($(COMPILER),ido)
+# For header dependencies
+ $(CPP) $(MIPS_BUILTIN_DEFS) $(CPPFLAGS) -x assembler-with-cpp $(INC) -MD -MF $(@:.o=.d) -MT $@ $< -o /dev/null
$(CCAS) -c $(CCASFLAGS) $(MIPS_VERSION) $(ASOPTFLAGS) -o $(@:.o=.tmp.o) $<
# IDO generates bad symbol tables, fix the symbol table with strip..
$(STRIP) $(@:.o=.tmp.o) -N dummy-symbol-name
# but strip doesn't know about file-relative offsets in .mdebug and doesn't relocate them, ld will
# segfault unless .mdebug is removed
$(OBJCOPY) --remove-section .mdebug $(@:.o=.tmp.o) $@
+ @$(RM) $(@:.o=.tmp.o)
else
$(CCAS) -c $(CCASFLAGS) $(MIPS_VERSION) $(ASOPTFLAGS) -o $@ $<
endif
@@ -937,6 +944,9 @@ endif
# 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 -G 0 -T linker_scripts/data_with_rodata.ld -o $@ $^
+ $(PYTHON) tools/patch_data_with_rodata_mdebug.py $@
+
+DEP_FILES += $(BUILD_DIR)/src/code/z_message.d $(BUILD_DIR)/src/code/z_game_over.d
$(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
@@ -945,33 +955,18 @@ $(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt: $(BUILD_DIR)
$(BUILD_DIR)/src/boot/z_std_dma.o: $(BUILD_DIR)/dmadata_table_spec.h
$(BUILD_DIR)/src/dmadata/dmadata.o: $(BUILD_DIR)/dmadata_table_spec.h
-# Dependencies for files including from include/tables/
-# TODO remove when full header dependencies are used.
-$(BUILD_DIR)/src/code/graph.o: include/tables/gamestate_table.h
-$(BUILD_DIR)/src/code/object_table.o: include/tables/object_table.h
-$(BUILD_DIR)/src/code/z_actor.o: include/tables/actor_table.h # so uses of ACTOR_ID_MAX update when the table length changes
-$(BUILD_DIR)/src/code/z_actor_dlftbls.o: include/tables/actor_table.h
-$(BUILD_DIR)/src/code/z_effect_soft_sprite_dlftbls.o: include/tables/effect_ss_table.h
-$(BUILD_DIR)/src/code/z_game_dlftbls.o: include/tables/gamestate_table.h
-$(BUILD_DIR)/src/code/z_scene_table.o: include/tables/scene_table.h include/tables/entrance_table.h
-$(BUILD_DIR)/src/audio/general.o: $(SEQUENCE_TABLE) include/tables/sfx/*.h
-$(BUILD_DIR)/src/audio/sfx_params.o: include/tables/sfx/*.h
-
$(BUILD_DIR)/src/%.o: src/%.c
-ifneq ($(RUN_CC_CHECK),0)
- $(CC_CHECK) $<
-endif
+ $(CC_CHECK) $< -o $@
$(PREPROCESS) $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
$(POSTPROCESS_OBJ) $@
$(OBJDUMP_CMD)
-$(BUILD_DIR)/src/audio/session_init.o: src/audio/session_init.c $(BUILD_DIR)/assets/audio/soundfont_sizes.h $(BUILD_DIR)/assets/audio/sequence_sizes.h
-ifneq ($(RUN_CC_CHECK),0)
- $(CC_CHECK) $<
-endif
+$(BUILD_DIR)/src/audio/game/session_init.o: src/audio/game/session_init.c $(BUILD_DIR)/assets/audio/soundfont_sizes.h $(BUILD_DIR)/assets/audio/sequence_sizes.h
+ $(CC_CHECK) $< -o $@
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $(@:.o=.tmp) $<
$(LD) -r -T linker_scripts/data_with_rodata.ld -o $@ $(@:.o=.tmp)
- @$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
+ $(PYTHON) tools/patch_data_with_rodata_mdebug.py $@
+ $(OBJDUMP_CMD)
ifeq ($(PLATFORM),IQUE)
ifneq ($(NON_MATCHING),1)
@@ -984,23 +979,27 @@ $(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/spec
$(POSTPROCESS_OBJ) $(@:.o=.s)
$(AS) $(ASFLAGS) $(@:.o=.s) -o $@
-$(BUILD_DIR)/assets/%.inc.c: assets/%.png
- $(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@
+# Assets from assets/
-$(BUILD_DIR)/assets/%.inc.c: $(EXTRACTED_DIR)/assets/%.png
- $(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@
+$(BUILD_DIR)/assets/%.inc.c: assets/%.png
+ tools/assets/build_from_png/build_from_png $< $(dir $@) assets/$(dir $*) $(wildcard $(EXTRACTED_DIR)/assets/$(dir $*))
$(BUILD_DIR)/assets/%.bin.inc.c: assets/%.bin
- $(ZAPD) bblb -eh -i $< -o $@
-
-$(BUILD_DIR)/assets/%.bin.inc.c: $(EXTRACTED_DIR)/assets/%.bin
- $(ZAPD) bblb -eh -i $< -o $@
+ $(BIN2C) -t 1 $< $@
$(BUILD_DIR)/assets/%.jpg.inc.c: assets/%.jpg
- $(ZAPD) bren -eh -i $< -o $@
+ $(N64TEXCONV) JFIF "" $< $@
+
+# Assets from extracted/
+
+$(BUILD_DIR)/assets/%.inc.c: $(EXTRACTED_DIR)/assets/%.png
+ tools/assets/build_from_png/build_from_png $< $(dir $@) $(wildcard assets/$(dir $*)) $(EXTRACTED_DIR)/assets/$(dir $*)
+
+$(BUILD_DIR)/assets/%.bin.inc.c: $(EXTRACTED_DIR)/assets/%.bin
+ $(BIN2C) -t 1 $< $@
$(BUILD_DIR)/assets/%.jpg.inc.c: $(EXTRACTED_DIR)/assets/%.jpg
- $(ZAPD) bren -eh -i $< -o $@
+ $(N64TEXCONV) JFIF "" $< $@
# Audio
@@ -1068,11 +1067,12 @@ $(BUILD_DIR)/assets/audio/soundfonts/%.xml: $(EXTRACTED_DIR)/assets/audio/soundf
$(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.h $(BUILD_DIR)/assets/audio/soundfonts/%.name: $(BUILD_DIR)/assets/audio/soundfonts/%.xml | $(SAMPLEBANK_BUILD_XMLS) $(AIFC_FILES)
# This rule can be triggered for either the .c or .h file, so $@ may refer to either the .c or .h file. A simple
# substitution $(@:.c=.h) will fail ~50% of the time with -j. Instead, don't assume anything about the suffix of $@.
- $(SFC) $(SFCFLAGS) --makedepend $(basename $@).d $< $(basename $@).c $(basename $@).h $(basename $@).name
+ $(SFC) $(SFCFLAGS) --makedepend $(basename $@).c.d $< $(basename $@).c $(basename $@).h $(basename $@).name
-include $(SOUNDFONT_DEP_FILES)
$(BUILD_DIR)/assets/audio/soundfonts/%.o: $(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.name
+ $(CPP) $(MIPS_BUILTIN_DEFS) $(CPPFLAGS) -x assembler-with-cpp $(INC) -I include/audio -MD -MF $(@:.o=.d) -MT $@ $< -o /dev/null
# compile c to unlinked object
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -I include/audio -o $(@:.o=.tmp) $<
# partial link
@@ -1093,11 +1093,11 @@ endif
# then assemble the sequences...
$(BUILD_DIR)/assets/audio/sequences/%.o: assets/audio/sequences/%.seq include/audio/aseq.h $(SEQUENCE_TABLE) | $(SOUNDFONT_HEADERS)
- $(SEQ_CPP) $(SEQ_CPPFLAGS) $< -o $(@:.o=.s) -MMD -MT $@
+ $(SEQ_CPP) $(SEQ_CPPFLAGS) -MD -MT $@ $< -o $(@:.o=.s)
$(AS) $(ASFLAGS) -I $(BUILD_DIR)/assets/audio/soundfonts -I include/audio -I $(dir $<) $(@:.o=.s) -o $@
$(BUILD_DIR)/assets/audio/sequences/%.o: $(EXTRACTED_DIR)/assets/audio/sequences/%.seq include/audio/aseq.h $(SEQUENCE_TABLE) | $(SOUNDFONT_HEADERS)
- $(SEQ_CPP) $(SEQ_CPPFLAGS) $< -o $(@:.o=.s) -MMD -MT $@
+ $(SEQ_CPP) $(SEQ_CPPFLAGS) -MD -MT $@ $< -o $(@:.o=.s)
$(AS) $(ASFLAGS) -I $(BUILD_DIR)/assets/audio/soundfonts -I include/audio -I $(dir $<) $(@:.o=.s) -o $@
ifeq ($(AUDIO_BUILD_DEBUG),1)
$(OBJCOPY) -O binary -j.data $@ $(@:.o=.aseq)
@@ -1131,11 +1131,10 @@ $(BUILD_DIR)/src/audio/tables/sequence_table.o: src/audio/tables/sequence_table.
$(BUILD_DIR)/src/audio/tables/sequence_table.o: CFLAGS += -I include/tables
$(BUILD_DIR)/src/audio/tables/%.o: src/audio/tables/%.c
-ifneq ($(RUN_CC_CHECK),0)
- $(CC_CHECK) $<
-endif
+ $(CC_CHECK) $< -o $@
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $(@:.o=.tmp) $<
$(LD) -r -T linker_scripts/data_with_rodata.ld $(@:.o=.tmp) -o $@
+ $(PYTHON) tools/patch_data_with_rodata_mdebug.py $@
@$(RM) $(@:.o=.tmp)
$(BUILD_DIR)/assets/audio/sequence_font_table.o: $(BUILD_DIR)/assets/audio/sequence_font_table.s
diff --git a/assets/audio/sequences/seq_0.prg.seq b/assets/audio/sequences/seq_0.prg.seq
index 602ed791c6..b5f8a2906d 100644
--- a/assets/audio/sequences/seq_0.prg.seq
+++ b/assets/audio/sequences/seq_0.prg.seq
@@ -1302,7 +1302,7 @@ CHAN_08EC:
/* 0x08EE [0xC7 0x02 0x09 0x04 ] */ stseq 2, LAYER_0903 + STSEQ_NOTEDV_DELAY_HI
/* 0x08F2 [0xC7 0x02 0x08 0xFD ] */ stseq 2, CHAN_08FC + STSEQ_LDI_IMM
/* 0x08F6 [0xB8 0x0C ] */ rand 12
-/* 0x08F8 [0xC7 0x5C 0x09 0x03 ] */ stseq (NOTEDV_OPCODE | PITCH_DF3), LAYER_0903 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x08F8 [0xC7 0x5C 0x09 0x03 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_DF3), LAYER_0903 + STSEQ_NOTEDV_OPCODE_PITCH
CHAN_08FC:
/* 0x08FC [0xCC 0x01 ] */ ldi 1
/* 0x08FE [0xFC 0x00 0x48 ] */ call CHAN_0048
@@ -3022,10 +3022,10 @@ LAYER_140B:
/* 0x1411 [0xCC 0x00 ] */ ldi 0
/* 0x1413 [0x76 ] */ stio IO_PORT_6
CHAN_1414:
-/* 0x1414 [0xCB 0x14 0x2D ] */ ldseq UNK_142D
+/* 0x1414 [0xCB 0x14 0x2D ] */ ldseq ARRAY_142D
/* 0x1417 [0xC7 0x00 0x14 0x5B ] */ stseq 0, LAYER_145A + STSEQ_TRANSPOSITION
/* 0x141B [0x66 ] */ ldio IO_PORT_6
-/* 0x141C [0xCB 0x14 0x31 ] */ ldseq UNK_1431
+/* 0x141C [0xCB 0x14 0x31 ] */ ldseq ARRAY_1431
/* 0x141F [0xC7 0x00 0x14 0x56 ] */ stseq 0, LAYER_1455 + STSEQ_NOTEDV_DELAY_HI
/* 0x1423 [0xCC 0x18 ] */ ldi 24
/* 0x1425 [0x71 ] */ stio IO_PORT_1
@@ -3033,14 +3033,14 @@ CHAN_1414:
/* 0x1429 [0x89 0x14 0x35 ] */ ldlayer 1, LAYER_1435
/* 0x142C [0xFF ] */ end
-UNK_142D:
- .byte 0x00, 0x04, 0x08, 0x00
+.array ARRAY_142D
+ .byte 0, 4, 8, 0
-UNK_1431:
+.array ARRAY_1431
#if !OOT_PAL_N64
- .byte 0x60, 0x30, 0x18, 0x60
+ .byte 96, 48, 24, 96
#else
- .byte 0x73, 0x3A, 0x1D, 0x60
+ .byte 115, 58, 29, 96
#endif
.layer LAYER_1435
@@ -3943,15 +3943,15 @@ LAYER_1B5C:
CHAN_1BA1:
/* 0x1BA1 [0x66 ] */ ldio IO_PORT_6
/* 0x1BA2 [0xC9 0x03 ] */ and 3
-/* 0x1BA4 [0xCB 0x1B 0xB6 ] */ ldseq UNK_1BB6
+/* 0x1BA4 [0xCB 0x1B 0xB6 ] */ ldseq ARRAY_1BB6
/* 0x1BA7 [0xC7 0x00 0x1B 0xE7 ] */ stseq 0, LAYER_1BE6 + STSEQ_LDELAY
/* 0x1BAB [0xC7 0x08 0x1B 0xB0 ] */ stseq 8, STSEQ_HERE + STSEQ_LDI_IMM
/* 0x1BAF [0xCC 0x30 ] */ ldi 48
/* 0x1BB1 [0xFC 0x00 0x48 ] */ call CHAN_0048
/* 0x1BB4 [0xF4 0xEB ] */ rjump CHAN_1BA1
-UNK_1BB6:
- .byte 0x20, 0x0E, 0x05, 0x20
+.array ARRAY_1BB6
+ .byte 32, 14, 5, 32
.layer LAYER_1BBA
/* 0x1BBA [0xC2 0x30 ] */ transpose 48
@@ -4031,16 +4031,16 @@ CHAN_1C3B:
/* 0x1C3B [0x63 ] */ ldio IO_PORT_3
/* 0x1C3C [0xC9 0xF0 ] */ and 240
/* 0x1C3E [0xF3 0x0E ] */ rbeqz CHAN_1C4E
-/* 0x1C40 [0xCE 0x00 0x00 ] */ ldptr SEQ_0000
+/* 0x1C40 [0xCE 0x00 0x00 ] */ ldptri 0
/* 0x1C43 [0xCF 0x1C 0x80 ] */ stptrtoseq ENVELOPE_1C7A + STSEQ_ENVELOPE_POINT(3)
-/* 0x1C46 [0xCE 0x7F 0xBC ] */ ldptr SEQ_0_END + 0x1538
+/* 0x1C46 [0xCE 0x7F 0xBC ] */ ldptri 32700
/* 0x1C49 [0xCF 0x1C 0x8C ] */ stptrtoseq ENVELOPE_1C86 + STSEQ_ENVELOPE_POINT(3)
/* 0x1C4C [0xF4 0x0C ] */ rjump CHAN_1C5A
CHAN_1C4E:
-/* 0x1C4E [0xCE 0x00 0x00 ] */ ldptr SEQ_0000
+/* 0x1C4E [0xCE 0x00 0x00 ] */ ldptri 0
/* 0x1C51 [0xCF 0x1C 0x8C ] */ stptrtoseq ENVELOPE_1C86 + STSEQ_ENVELOPE_POINT(3)
-/* 0x1C54 [0xCE 0x7F 0xBC ] */ ldptr SEQ_0_END + 0x1538
+/* 0x1C54 [0xCE 0x7F 0xBC ] */ ldptri 32700
/* 0x1C57 [0xCF 0x1C 0x80 ] */ stptrtoseq ENVELOPE_1C7A + STSEQ_ENVELOPE_POINT(3)
CHAN_1C5A:
/* 0x1C5A [0xCC 0x01 ] */ ldi 1
@@ -4978,7 +4978,7 @@ CHAN_2274:
/* 0x2284 [0x56 ] */ subio IO_PORT_6
/* 0x2285 [0xC9 0x07 ] */ and 7
CHAN_2287:
-/* 0x2287 [0xC7 0x60 0x22 0x98 ] */ stseq (NOTEDV_OPCODE | PITCH_F3), LAYER_2298 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x2287 [0xC7 0x60 0x22 0x98 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_F3), LAYER_2298 + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x228B [0x66 ] */ ldio IO_PORT_6
/* 0x228C [0xC8 0xFC ] */ sub 252
/* 0x228E [0xC9 0x04 ] */ and 4
@@ -6529,7 +6529,7 @@ LAYER_2C4E:
.channel CHAN_2C54
/* 0x2C54 [0x89 0x2C 0x62 ] */ ldlayer 1, LAYER_2C62
-/* 0x2C57 [0xCC 0x58 ] */ ldi (NOTEDV_OPCODE | PITCH_A2)
+/* 0x2C57 [0xCC 0x58 ] */ ldi (ASEQ_OP_LAYER_NOTEDV | PITCH_A2)
/* 0x2C59 [0xC7 0x00 0x22 0x88 ] */ stseq 0, CHAN_2287 + STSEQ_STSEQ_IMM
/* 0x2C5D [0xFB 0x22 0x67 ] */ jump CHAN_2267
@@ -6649,7 +6649,7 @@ CHAN_2D01:
.channel CHAN_2D13
/* 0x2D13 [0x89 0x2D 0x25 ] */ ldlayer 1, LAYER_2D25
/* 0x2D16 [0x8A 0x2D 0x23 ] */ ldlayer 2, LAYER_2D23
-/* 0x2D19 [0xCC 0x66 ] */ ldi (NOTEDV_OPCODE | PITCH_B3)
+/* 0x2D19 [0xCC 0x66 ] */ ldi (ASEQ_OP_LAYER_NOTEDV | PITCH_B3)
/* 0x2D1B [0xC7 0x00 0x22 0x88 ] */ stseq 0, CHAN_2287 + STSEQ_STSEQ_IMM
/* 0x2D1F [0xFB 0x22 0x67 ] */ jump CHAN_2267
/* 0x2D22 [0xFF ] */ end
@@ -7056,9 +7056,9 @@ CHAN_2F7D:
/* 0x2F85 [0xB8 0x02 ] */ rand 2
/* 0x2F87 [0xC7 0x2F 0x2F 0xAC ] */ stseq 47, LAYER_2FAB + STSEQ_TRANSPOSITION
/* 0x2F8B [0xBD 0x00 0x6A 0x00 0x96] */ randptr 106, 150
-/* 0x2F90 [0xCF 0x2F 0xB6 ] */ stptrtoseq UNK_2FB6
+/* 0x2F90 [0xCF 0x2F 0xB6 ] */ stptrtoseq BUF_2FB6
/* 0x2F93 [0xCC 0x01 ] */ ldi 1
-/* 0x2F95 [0xCB 0x2F 0xB6 ] */ ldseq UNK_2FB6
+/* 0x2F95 [0xCB 0x2F 0xB6 ] */ ldseq BUF_2FB6
/* 0x2F98 [0xC7 0x00 0x2F 0xA0 ] */ stseq 0, CHAN_2F9F + STSEQ_LDI_IMM
/* 0x2F9C [0x88 0x2F 0xAB ] */ ldlayer 0, LAYER_2FAB
CHAN_2F9F:
@@ -7077,8 +7077,8 @@ CHAN_2F9F:
/* 0x2FB2 [0xC0 0xFD 0x00 ] */ ldelay 32000
/* 0x2FB5 [0xFF ] */ end
-UNK_2FB6:
- .half 0x0000
+BUF_2FB6:
+ .half 0
.channel CHAN_2FB8
/* 0x2FB8 [0x88 0x2F 0xBF ] */ ldlayer 0, LAYER_2FBF
@@ -9201,7 +9201,7 @@ CHAN_4162:
/* 0x4164 [0xC7 0x03 0x41 0x7A ] */ stseq 3, LAYER_4179 + STSEQ_NOTEDV_DELAY_HI
/* 0x4168 [0xC7 0x03 0x41 0x73 ] */ stseq 3, CHAN_4172 + STSEQ_LDI_IMM
/* 0x416C [0xB8 0x08 ] */ rand 8
-/* 0x416E [0xC7 0x5B 0x41 0x79 ] */ stseq (NOTEDV_OPCODE | PITCH_C3), LAYER_4179 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x416E [0xC7 0x5B 0x41 0x79 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_C3), LAYER_4179 + STSEQ_NOTEDV_OPCODE_PITCH
CHAN_4172:
/* 0x4172 [0xCC 0x01 ] */ ldi 1
/* 0x4174 [0xFC 0x00 0x48 ] */ call CHAN_0048
@@ -9763,7 +9763,7 @@ LAYER_4245:
/* 0x44C9 [0x88 0x44 0xD7 ] */ ldlayer 0, LAYER_44D7
/* 0x44CC [0xED 0x14 ] */ gain 20
/* 0x44CE [0xB8 0x04 ] */ rand 4
-/* 0x44D0 [0xC7 0x6B 0x44 0xD7 ] */ stseq (NOTEDV_OPCODE | PITCH_E4), LAYER_44D7 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x44D0 [0xC7 0x6B 0x44 0xD7 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_E4), LAYER_44D7 + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x44D4 [0xD9 0xE8 ] */ releaserate 232
/* 0x44D6 [0xFF ] */ end
@@ -10353,7 +10353,7 @@ LAYER_47B3:
/* 0x4860 [0x88 0x48 0x70 ] */ ldlayer 0, LAYER_4870
CHAN_4863:
/* 0x4863 [0xB8 0x04 ] */ rand 4
-/* 0x4865 [0xC7 0x60 0x48 0x70 ] */ stseq (NOTEDV_OPCODE | PITCH_F3), LAYER_4870 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x4865 [0xC7 0x60 0x48 0x70 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_F3), LAYER_4870 + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x4869 [0xCC 0x12 ] */ ldi 18
/* 0x486B [0xFC 0x00 0x48 ] */ call CHAN_0048
/* 0x486E [0xF4 0xF3 ] */ rjump CHAN_4863
@@ -12265,9 +12265,9 @@ LAYER_53FD:
.channel CHAN_5403
/* 0x5403 [0xC1 0x7E ] */ instr FONTANY_INSTR_SFX
/* 0x5405 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS
-/* 0x5406 [0xC8 0xB0 ] */ sub 176
-/* 0x5408 [0xC7 0x00 0x54 0x17 ] */ stseq (NOTEDVG_OPCODE | PITCH_A0), LAYER_5417 + STSEQ_NOTEDVG_OPCODE_PITCH
-/* 0x540C [0xCB 0x54 0x1C ] */ ldseq UNK_541C
+/* 0x5406 [0xC8 0xB0 ] */ sub NA_SE_EN_TWINROBA_LAUGH & 0xFF
+/* 0x5408 [0xC7 0x00 0x54 0x17 ] */ stseq (ASEQ_OP_LAYER_NOTEDVG | PITCH_A0), LAYER_5417 + STSEQ_NOTEDVG_OPCODE_PITCH
+/* 0x540C [0xCB 0x54 0x1C ] */ ldseq ARRAY_541C
/* 0x540F [0xC7 0x00 0x54 0x19 ] */ stseq 0, LAYER_5417 + STSEQ_NOTEDVG_DELAY_LO
/* 0x5413 [0x88 0x54 0x17 ] */ ldlayer 0, LAYER_5417
/* 0x5416 [0xFF ] */ end
@@ -12276,10 +12276,10 @@ LAYER_53FD:
/* 0x5417 [0x00 0x00 0x64 0x00 ] */ notedvg PITCH_A0, 0, 100, 0
/* 0x541B [0xFF ] */ end
-UNK_541C:
- .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
- .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
- .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+.array ARRAY_541C
+ .byte 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
+ .byte 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
+ .byte 100, 100, 100, 100, 100, 100, 100
.channel CHAN_5443
/* 0x5443 [0x88 0x42 0x20 ] */ ldlayer 0, LAYER_4220
@@ -12640,7 +12640,7 @@ CHAN_565E:
/* 0x5660 [0xC7 0x28 0x56 0x76 ] */ stseq 40, LAYER_5675 + STSEQ_NOTEDV_DELAY_HI
/* 0x5664 [0xC7 0x28 0x56 0x6F ] */ stseq 40, CHAN_566E + STSEQ_LDI_IMM
/* 0x5668 [0xB8 0x06 ] */ rand 6
-/* 0x566A [0xC7 0x64 0x56 0x75 ] */ stseq (NOTEDV_OPCODE | PITCH_A3), LAYER_5675 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x566A [0xC7 0x64 0x56 0x75 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_A3), LAYER_5675 + STSEQ_NOTEDV_OPCODE_PITCH
CHAN_566E:
/* 0x566E [0xCC 0x01 ] */ ldi 1
/* 0x5670 [0xFC 0x00 0x48 ] */ call CHAN_0048
@@ -13861,11 +13861,11 @@ CHAN_5EE2:
/* 0x5EF7 [0x71 ] */ stio IO_PORT_1
/* 0x5EF8 [0x67 ] */ ldio IO_PORT_7
/* 0x5EF9 [0xC9 0x07 ] */ and 7
-/* 0x5EFB [0xCB 0x5F 0x30 ] */ ldseq UNK_5F30
+/* 0x5EFB [0xCB 0x5F 0x30 ] */ ldseq ARRAY_5F30
/* 0x5EFE [0xC7 0x00 0x5F 0x0D ] */ stseq 0, CHAN_5F0C + STSEQ_INSTR
/* 0x5F02 [0x67 ] */ ldio IO_PORT_7
/* 0x5F03 [0xC9 0x07 ] */ and 7
-/* 0x5F05 [0xCB 0x5F 0x38 ] */ ldseq UNK_5F38
+/* 0x5F05 [0xCB 0x5F 0x38 ] */ ldseq ARRAY_5F38
/* 0x5F08 [0xC7 0x00 0x5F 0x2E ] */ stseq 0, LAYER_5F2B + STSEQ_NOTEDV_VELOCITY
CHAN_5F0C:
/* 0x5F0C [0xC1 0x34 ] */ instr SF0_INST_52
@@ -13894,11 +13894,18 @@ LAYER_5F2B:
/* 0x5F2B [0x67 0x81 0xE0 0x7F ] */ notedv PITCH_C4, 480, 127
/* 0x5F2F [0xFF ] */ end
-UNK_5F30:
- .byte 0x34, 0x55, 0x56, 0x59, 0x53, 0x52, 0x34, 0x34
+.array ARRAY_5F30
+ .byte SF0_INST_52
+ .byte SF0_INST_85
+ .byte SF0_INST_86
+ .byte SF0_INST_89
+ .byte SF0_INST_83
+ .byte SF0_INST_82
+ .byte SF0_INST_52
+ .byte SF0_INST_52
-UNK_5F38:
- .byte 0x73, 0x73, 0x64, 0x73, 0x64, 0x73, 0x73, 0x73
+.array ARRAY_5F38
+ .byte 115, 115, 100, 115, 100, 115, 115, 115
.channel CHAN_5F40
/* 0x5F40 [0xCC 0x81 ] */ ldi 129
@@ -14044,11 +14051,11 @@ CHAN_6116:
/* 0x6116 [0x3E 0x06 ] */ stcio 14, IO_PORT_6
/* 0x6118 [0x3F 0x06 ] */ stcio 15, IO_PORT_6
CHAN_611A:
-/* 0x611A [0xCB 0x61 0x6D ] */ ldseq UNK_616D
-/* 0x611D [0xC7 0x40 0x61 0x2D ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_612D + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x611A [0xCB 0x61 0x6D ] */ ldseq ARRAY_616D
+/* 0x611D [0xC7 0x40 0x61 0x2D ] */ stseq (ASEQ_OP_LAYER_NOTEDV | SF0_EFFECT_0), LAYER_612D + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x6121 [0x66 ] */ ldio IO_PORT_6
CHAN_6122:
-/* 0x6122 [0xCB 0x61 0x71 ] */ ldseq UNK_6171
+/* 0x6122 [0xCB 0x61 0x71 ] */ ldseq ARRAY_6171
CHAN_6125:
/* 0x6125 [0xC7 0x00 0x61 0x2F ] */ stseq 0, LAYER_612D + STSEQ_NOTEDV_VELOCITY_2
/* 0x6129 [0x88 0x61 0x2D ] */ ldlayer 0, LAYER_612D
@@ -14079,8 +14086,8 @@ CHAN_613E:
/* 0x6145 [0xCC 0x00 ] */ ldi 0
// Reads the byte at (PTR + 0) into TR (the note)
/* 0x6147 [0xB6 ] */ dyntblv
- // Store NOTEDV_OPCODE + TR into the pitch
-/* 0x6148 [0xC7 0x40 0x61 0x2D ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_612D + STSEQ_NOTEDV_OPCODE_PITCH
+ // Store ASEQ_OP_LAYER_NOTEDV + TR into the pitch
+/* 0x6148 [0xC7 0x40 0x61 0x2D ] */ stseq (ASEQ_OP_LAYER_NOTEDV | SF0_EFFECT_0), LAYER_612D + STSEQ_NOTEDV_OPCODE_PITCH
// Load 1 into TR
/* 0x614C [0xCC 0x01 ] */ ldi 1
// Reads the byte at (PTR + 1) into TR (the velocity)
@@ -14096,23 +14103,26 @@ CHAN_6151:
/* 0x615B [0xF4 0xBD ] */ rjump CHAN_611A
.channel CHAN_615D
-/* 0x615D [0xCE 0x61 0x6D ] */ ldptr UNK_616D
+/* 0x615D [0xCE 0x61 0x6D ] */ ldptr ARRAY_616D
/* 0x6160 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x6163 [0xCE 0x61 0x71 ] */ ldptr UNK_6171
+/* 0x6163 [0xCE 0x61 0x71 ] */ ldptr ARRAY_6171
/* 0x6166 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6169 [0xCC 0x04 ] */ ldi 4
/* 0x616B [0xF4 0x85 ] */ rjump CHAN_60F2
-UNK_616D:
- .byte 0x00, 0x01, 0x02, 0x03
+.array ARRAY_616D
+ .byte SF0_EFFECT_0
+ .byte SF0_EFFECT_1
+ .byte SF0_EFFECT_2
+ .byte SF0_EFFECT_3
-UNK_6171:
- .byte 0x69, 0x69, 0x69, 0x69
+.array ARRAY_6171
+ .byte 105, 105, 105, 105
.channel CHAN_6175
-/* 0x6175 [0xCE 0x61 0x97 ] */ ldptr UNK_6197
+/* 0x6175 [0xCE 0x61 0x97 ] */ ldptr ARRAY_6197
/* 0x6178 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x617B [0xCE 0x61 0x99 ] */ ldptr UNK_6199
+/* 0x617B [0xCE 0x61 0x99 ] */ ldptr ARRAY_6199
/* 0x617E [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6181 [0xB8 0x02 ] */ rand 2
/* 0x6183 [0xF4 0xAF ] */ rjump CHAN_6134
@@ -14132,16 +14142,17 @@ CHAN_618C:
CHAN_6196:
/* 0x6196 [0x76 ] */ stio IO_PORT_6
-UNK_6197:
- .byte 0x04, 0x05
+.array ARRAY_6197
+ .byte SF0_EFFECT_4
+ .byte SF0_EFFECT_5
-UNK_6199:
- .byte 0x6E, 0x6E
+.array ARRAY_6199
+ .byte 110, 110
.channel CHAN_619B
-/* 0x619B [0xCE 0x61 0xBD ] */ ldptr UNK_61BD
+/* 0x619B [0xCE 0x61 0xBD ] */ ldptr ARRAY_61BD
/* 0x619E [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x61A1 [0xCE 0x61 0xBF ] */ ldptr UNK_61BF
+/* 0x61A1 [0xCE 0x61 0xBF ] */ ldptr ARRAY_61BF
/* 0x61A4 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x61A7 [0xB8 0x02 ] */ rand 2
/* 0x61A9 [0xF4 0x89 ] */ rjump CHAN_6134
@@ -14161,109 +14172,119 @@ CHAN_61B2:
CHAN_61BC:
/* 0x61BC [0x76 ] */ stio IO_PORT_6
-UNK_61BD:
- .byte 0x15, 0x16
+.array ARRAY_61BD
+ .byte SF0_EFFECT_21
+ .byte SF0_EFFECT_22
-UNK_61BF:
- .byte 0x69, 0x69
+.array ARRAY_61BF
+ .byte 105, 105
.channel CHAN_61C1
-/* 0x61C1 [0xCE 0x61 0xD1 ] */ ldptr UNK_61D1
+/* 0x61C1 [0xCE 0x61 0xD1 ] */ ldptr ARRAY_61D1
/* 0x61C4 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x61C7 [0xCE 0x61 0xD3 ] */ ldptr UNK_61D3
+/* 0x61C7 [0xCE 0x61 0xD3 ] */ ldptr ARRAY_61D3
/* 0x61CA [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x61CD [0xCC 0x00 ] */ ldi 0
/* 0x61CF [0xF4 0x80 ] */ rjump CHAN_6151
-UNK_61D1:
- .byte 0x06, 0x19
+.array ARRAY_61D1
+ .byte SF0_EFFECT_6
+ .byte SF0_EFFECT_25
-UNK_61D3:
- .byte 0x5F, 0x69
+.array ARRAY_61D3
+ .byte 95, 105
.channel CHAN_61D5
-/* 0x61D5 [0xCE 0x61 0xE6 ] */ ldptr UNK_61E6
+/* 0x61D5 [0xCE 0x61 0xE6 ] */ ldptr ARRAY_61E6
/* 0x61D8 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x61DB [0xCE 0x61 0xE8 ] */ ldptr UNK_61E8
+/* 0x61DB [0xCE 0x61 0xE8 ] */ ldptr ARRAY_61E8
/* 0x61DE [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x61E1 [0xB8 0x02 ] */ rand 2
/* 0x61E3 [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_61E6:
- .byte 0x07, 0x08
+.array ARRAY_61E6
+ .byte SF0_EFFECT_7
+ .byte SF0_EFFECT_8
-UNK_61E8:
- .byte 0x48, 0x50
+.array ARRAY_61E8
+ .byte 72, 80
.channel CHAN_61EA
-/* 0x61EA [0xCE 0x61 0xFB ] */ ldptr UNK_61FB
+/* 0x61EA [0xCE 0x61 0xFB ] */ ldptr ARRAY_61FB
/* 0x61ED [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x61F0 [0xCE 0x61 0xFE ] */ ldptr UNK_61FE
+/* 0x61F0 [0xCE 0x61 0xFE ] */ ldptr ARRAY_61FE
/* 0x61F3 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x61F6 [0xCC 0x03 ] */ ldi 3
/* 0x61F8 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2
-UNK_61FB:
- .byte 0x09, 0x0A, 0x0B
+.array ARRAY_61FB
+ .byte SF0_EFFECT_9
+ .byte SF0_EFFECT_10
+ .byte SF0_EFFECT_11
-UNK_61FE:
- .byte 0x75, 0x75, 0x75
+.array ARRAY_61FE
+ .byte 117, 117, 117
.channel CHAN_6201
-/* 0x6201 [0xCE 0x62 0x12 ] */ ldptr UNK_6212
+/* 0x6201 [0xCE 0x62 0x12 ] */ ldptr ARRAY_6212
/* 0x6204 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x6207 [0xCE 0x62 0x15 ] */ ldptr UNK_6215
+/* 0x6207 [0xCE 0x62 0x15 ] */ ldptr ARRAY_6215
/* 0x620A [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x620D [0xCC 0x03 ] */ ldi 3
/* 0x620F [0xFB 0x60 0xF2 ] */ jump CHAN_60F2
-UNK_6212:
- .byte 0x0C, 0x0D, 0x0E
+.array ARRAY_6212
+ .byte SF0_EFFECT_12
+ .byte SF0_EFFECT_13
+ .byte SF0_EFFECT_14
-UNK_6215:
- .byte 0x71, 0x71, 0x71
+.array ARRAY_6215
+ .byte 113, 113, 113
.channel CHAN_6218
-/* 0x6218 [0xCE 0x62 0x29 ] */ ldptr UNK_6229
+/* 0x6218 [0xCE 0x62 0x29 ] */ ldptr ARRAY_6229
/* 0x621B [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x621E [0xCE 0x62 0x2B ] */ ldptr UNK_622B
+/* 0x621E [0xCE 0x62 0x2B ] */ ldptr ARRAY_622B
/* 0x6221 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6224 [0xB8 0x02 ] */ rand 2
/* 0x6226 [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_6229:
- .byte 0x11, 0x12
+.array ARRAY_6229
+ .byte SF0_EFFECT_17
+ .byte SF0_EFFECT_18
-UNK_622B:
- .byte 0x64, 0x64
+.array ARRAY_622B
+ .byte 100, 100
.channel CHAN_622D
-/* 0x622D [0xCE 0x62 0x3E ] */ ldptr UNK_623E
+/* 0x622D [0xCE 0x62 0x3E ] */ ldptr ARRAY_623E
/* 0x6230 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x6233 [0xCE 0x62 0x40 ] */ ldptr UNK_6240
+/* 0x6233 [0xCE 0x62 0x40 ] */ ldptr ARRAY_6240
/* 0x6236 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6239 [0xB8 0x02 ] */ rand 2
/* 0x623B [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_623E:
- .byte 0x0F, 0x10
+.array ARRAY_623E
+ .byte SF0_EFFECT_15
+ .byte SF0_EFFECT_16
-UNK_6240:
- .byte 0x6E, 0x6E
+.array ARRAY_6240
+ .byte 110, 110
.channel CHAN_6242
-/* 0x6242 [0xCE 0x62 0x53 ] */ ldptr UNK_6253
+/* 0x6242 [0xCE 0x62 0x53 ] */ ldptr ARRAY_6253
/* 0x6245 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x6248 [0xCE 0x62 0x55 ] */ ldptr UNK_6255
+/* 0x6248 [0xCE 0x62 0x55 ] */ ldptr ARRAY_6255
/* 0x624B [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x624E [0xB8 0x02 ] */ rand 2
/* 0x6250 [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_6253:
- .byte 0x13, 0x17
+.array ARRAY_6253
+ .byte SF0_EFFECT_19
+ .byte SF0_EFFECT_23
-UNK_6255:
- .byte 0x5A, 0x5A
+.array ARRAY_6255
+ .byte 90, 90
.channel CHAN_6257
/* 0x6257 [0x88 0x62 0x5B ] */ ldlayer 0, LAYER_625B
@@ -14285,18 +14306,19 @@ UNK_6255:
/* 0x626E [0xFF ] */ end
.channel CHAN_626F
-/* 0x626F [0xCE 0x62 0x80 ] */ ldptr UNK_6280
+/* 0x626F [0xCE 0x62 0x80 ] */ ldptr ARRAY_6280
/* 0x6272 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x6275 [0xCE 0x62 0x82 ] */ ldptr UNK_6282
+/* 0x6275 [0xCE 0x62 0x82 ] */ ldptr ARRAY_6282
/* 0x6278 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x627B [0xB8 0x02 ] */ rand 2
/* 0x627D [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_6280:
- .byte 0x0F, 0x10
+.array ARRAY_6280
+ .byte SF0_EFFECT_15
+ .byte SF0_EFFECT_16
-UNK_6282:
- .byte 0x69, 0x69
+.array ARRAY_6282
+ .byte 105, 105
.channel CHAN_6284
/* 0x6284 [0xFB 0x61 0xEA ] */ jump CHAN_61EA
@@ -14343,37 +14365,40 @@ UNK_6282:
/* 0x62C5 [0xFF ] */ end
.channel CHAN_62C6
-/* 0x62C6 [0xCE 0x62 0xCC ] */ ldptr UNK_62CC
+/* 0x62C6 [0xCE 0x62 0xCC ] */ ldptr ARRAY_62CC
/* 0x62C9 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_62CC:
- .byte 0x00, 0x64
+.array ARRAY_62CC
+ .byte SF0_EFFECT_0
+ .byte 100
.channel CHAN_62CE
/* 0x62CE [0x66 ] */ ldio IO_PORT_6
/* 0x62CF [0xC8 0xFF ] */ sub 255
/* 0x62D1 [0x76 ] */ stio IO_PORT_6
/* 0x62D2 [0xC9 0x01 ] */ and 1
-/* 0x62D4 [0xCB 0x62 0xE8 ] */ ldseq UNK_62E8
-/* 0x62D7 [0xC7 0x40 0x64 0xBF ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_64BF + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x62D4 [0xCB 0x62 0xE8 ] */ ldseq ARRAY_62E8
+/* 0x62D7 [0xC7 0x40 0x64 0xBF ] */ stseq (ASEQ_OP_LAYER_NOTEDV | SF0_EFFECT_0), LAYER_64BF + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x62DB [0xB8 0x02 ] */ rand 2
-/* 0x62DD [0xCB 0x62 0xEA ] */ ldseq UNK_62EA
+/* 0x62DD [0xCB 0x62 0xEA ] */ ldseq ARRAY_62EA
/* 0x62E0 [0xC7 0x00 0x64 0xC1 ] */ stseq 0, LAYER_64BF + STSEQ_NOTEDV_VELOCITY_2
/* 0x62E4 [0x88 0x64 0xBF ] */ ldlayer 0, LAYER_64BF
/* 0x62E7 [0xFF ] */ end
-UNK_62E8:
- .byte 0x1A, 0x1B
+.array ARRAY_62E8
+ .byte SF0_EFFECT_26
+ .byte SF0_EFFECT_27
-UNK_62EA:
- .byte 0x50, 0x55
+.array ARRAY_62EA
+ .byte 80, 85
.channel CHAN_62EC
-/* 0x62EC [0xCE 0x62 0xF2 ] */ ldptr UNK_62F2
+/* 0x62EC [0xCE 0x62 0xF2 ] */ ldptr ARRAY_62F2
/* 0x62EF [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_62F2:
- .byte 0x05, 0x6E
+.array ARRAY_62F2
+ .byte SF0_EFFECT_5
+ .byte 110
.channel CHAN_62F4
/* 0x62F4 [0x88 0x62 0xF8 ] */ ldlayer 0, LAYER_62F8
@@ -14385,72 +14410,82 @@ UNK_62F2:
/* 0x62FD [0xFF ] */ end
.channel CHAN_62FE
-/* 0x62FE [0xCE 0x63 0x04 ] */ ldptr UNK_6304
+/* 0x62FE [0xCE 0x63 0x04 ] */ ldptr ARRAY_6304
/* 0x6301 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6304:
- .byte 0x04, 0x5F
+.array ARRAY_6304
+ .byte SF0_EFFECT_4
+ .byte 95
.channel CHAN_6306
-/* 0x6306 [0xCE 0x63 0x0C ] */ ldptr UNK_630C
+/* 0x6306 [0xCE 0x63 0x0C ] */ ldptr ARRAY_630C
/* 0x6309 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_630C:
- .byte 0x07, 0x52
+.array ARRAY_630C
+ .byte SF0_EFFECT_7
+ .byte 82
.channel CHAN_630E
-/* 0x630E [0xCE 0x63 0x14 ] */ ldptr UNK_6314
+/* 0x630E [0xCE 0x63 0x14 ] */ ldptr ARRAY_6314
/* 0x6311 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6314:
- .byte 0x06, 0x5F
+.array ARRAY_6314
+ .byte SF0_EFFECT_6
+ .byte 95
.channel CHAN_6316
-/* 0x6316 [0xCE 0x63 0x1C ] */ ldptr UNK_631C
+/* 0x6316 [0xCE 0x63 0x1C ] */ ldptr ARRAY_631C
/* 0x6319 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_631C:
- .byte 0x18, 0x6E
+.array ARRAY_631C
+ .byte SF0_EFFECT_24
+ .byte 110
.channel CHAN_631E
-/* 0x631E [0xCE 0x63 0x24 ] */ ldptr UNK_6324
+/* 0x631E [0xCE 0x63 0x24 ] */ ldptr ARRAY_6324
/* 0x6321 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6324:
- .byte 0x3C, 0x64
+.array ARRAY_6324
+ .byte SF0_EFFECT_60
+ .byte 100
.channel CHAN_6326
-/* 0x6326 [0xCE 0x63 0x2C ] */ ldptr UNK_632C
+/* 0x6326 [0xCE 0x63 0x2C ] */ ldptr ARRAY_632C
/* 0x6329 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_632C:
- .byte 0x3D, 0x6E
+.array ARRAY_632C
+ .byte SF0_EFFECT_61
+ .byte 110
.channel CHAN_632E
-/* 0x632E [0xCE 0x63 0x34 ] */ ldptr UNK_6334
+/* 0x632E [0xCE 0x63 0x34 ] */ ldptr ARRAY_6334
/* 0x6331 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6334:
- .byte 0x0D, 0x71
+.array ARRAY_6334
+ .byte SF0_EFFECT_13
+ .byte 113
.channel CHAN_6336
-/* 0x6336 [0xCE 0x63 0x47 ] */ ldptr UNK_6347
+/* 0x6336 [0xCE 0x63 0x47 ] */ ldptr ARRAY_6347
/* 0x6339 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x633C [0xCE 0x63 0x4B ] */ ldptr UNK_634B
+/* 0x633C [0xCE 0x63 0x4B ] */ ldptr ARRAY_634B
/* 0x633F [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6342 [0xCC 0x04 ] */ ldi 4
/* 0x6344 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2
-UNK_6347:
- .byte 0x1C, 0x1D, 0x1E, 0x1F
+.array ARRAY_6347
+ .byte SF0_EFFECT_28
+ .byte SF0_EFFECT_29
+ .byte SF0_EFFECT_30
+ .byte SF0_EFFECT_31
-UNK_634B:
- .byte 0x6E, 0x6E, 0x6E, 0x6E
+.array ARRAY_634B
+ .byte 110, 110, 110, 110
.channel CHAN_634F
-/* 0x634F [0xCE 0x63 0x72 ] */ ldptr UNK_6372
+/* 0x634F [0xCE 0x63 0x72 ] */ ldptr ARRAY_6372
/* 0x6352 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x6355 [0xCE 0x63 0x74 ] */ ldptr UNK_6374
+/* 0x6355 [0xCE 0x63 0x74 ] */ ldptr ARRAY_6374
/* 0x6358 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x635B [0xB8 0x02 ] */ rand 2
/* 0x635D [0xFB 0x61 0x34 ] */ jump CHAN_6134
@@ -14470,21 +14505,22 @@ CHAN_6367:
CHAN_6371:
/* 0x6371 [0x76 ] */ stio IO_PORT_6
-UNK_6372:
- .byte 0x20, 0x21
+.array ARRAY_6372
+ .byte SF0_EFFECT_32
+ .byte SF0_EFFECT_33
-UNK_6374:
- .byte 0x6E, 0x6E
+.array ARRAY_6374
+ .byte 110, 110
.channel CHAN_6376
/* 0x6376 [0x66 ] */ ldio IO_PORT_6
/* 0x6377 [0xC8 0xFF ] */ sub 255
/* 0x6379 [0x76 ] */ stio IO_PORT_6
/* 0x637A [0xC9 0x01 ] */ and 1
-/* 0x637C [0xCB 0x63 0x96 ] */ ldseq UNK_6396
-/* 0x637F [0xC7 0x40 0x63 0x90 ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_6390 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x637C [0xCB 0x63 0x96 ] */ ldseq ARRAY_6396
+/* 0x637F [0xC7 0x40 0x63 0x90 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | SF0_EFFECT_0), LAYER_6390 + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x6383 [0xB8 0x02 ] */ rand 2
-/* 0x6385 [0xCB 0x63 0x98 ] */ ldseq UNK_6398
+/* 0x6385 [0xCB 0x63 0x98 ] */ ldseq ARRAY_6398
/* 0x6388 [0xC7 0x00 0x63 0x92 ] */ stseq 0, LAYER_6390 + STSEQ_NOTEDV_VELOCITY_2
/* 0x638C [0x88 0x63 0x90 ] */ ldlayer 0, LAYER_6390
/* 0x638F [0xFF ] */ end
@@ -14494,95 +14530,104 @@ UNK_6374:
/* 0x6393 [0xC0 0x30 ] */ ldelay 48
/* 0x6395 [0xFF ] */ end
-UNK_6396:
- .byte 0x22, 0x32
+.array ARRAY_6396
+ .byte SF0_EFFECT_34
+ .byte SF0_EFFECT_50
-UNK_6398:
- .byte 0x64, 0x64
+.array ARRAY_6398
+ .byte 100, 100
.channel CHAN_639A
-/* 0x639A [0xCE 0x63 0xAB ] */ ldptr UNK_63AB
+/* 0x639A [0xCE 0x63 0xAB ] */ ldptr ARRAY_63AB
/* 0x639D [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x63A0 [0xCE 0x63 0xAD ] */ ldptr UNK_63AD
+/* 0x63A0 [0xCE 0x63 0xAD ] */ ldptr ARRAY_63AD
/* 0x63A3 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x63A6 [0xB8 0x02 ] */ rand 2
/* 0x63A8 [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_63AB:
- .byte 0x23, 0x24
+.array ARRAY_63AB
+ .byte SF0_EFFECT_35
+ .byte SF0_EFFECT_36
-UNK_63AD:
- .byte 0x5A, 0x46
+.array ARRAY_63AD
+ .byte 90, 70
.channel CHAN_63AF
-/* 0x63AF [0xCE 0x63 0xC0 ] */ ldptr UNK_63C0
+/* 0x63AF [0xCE 0x63 0xC0 ] */ ldptr ARRAY_63C0
/* 0x63B2 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x63B5 [0xCE 0x63 0xC3 ] */ ldptr UNK_63C3
+/* 0x63B5 [0xCE 0x63 0xC3 ] */ ldptr ARRAY_63C3
/* 0x63B8 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x63BB [0xCC 0x03 ] */ ldi 3
/* 0x63BD [0xFB 0x60 0xF2 ] */ jump CHAN_60F2
-UNK_63C0:
- .byte 0x25, 0x26, 0x27
+.array ARRAY_63C0
+ .byte SF0_EFFECT_37
+ .byte SF0_EFFECT_38
+ .byte SF0_EFFECT_39
-UNK_63C3:
- .byte 0x6E, 0x6E, 0x6E
+.array ARRAY_63C3
+ .byte 110, 110, 110
.channel CHAN_63C6
-/* 0x63C6 [0xCE 0x63 0xD7 ] */ ldptr UNK_63D7
+/* 0x63C6 [0xCE 0x63 0xD7 ] */ ldptr ARRAY_63D7
/* 0x63C9 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x63CC [0xCE 0x63 0xDA ] */ ldptr UNK_63DA
+/* 0x63CC [0xCE 0x63 0xDA ] */ ldptr ARRAY_63DA
/* 0x63CF [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x63D2 [0xCC 0x03 ] */ ldi 3
/* 0x63D4 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2
-UNK_63D7:
- .byte 0x28, 0x29, 0x2A
+.array ARRAY_63D7
+ .byte SF0_EFFECT_40
+ .byte SF0_EFFECT_41
+ .byte SF0_EFFECT_42
-UNK_63DA:
- .byte 0x6E, 0x6E, 0x6E
+.array ARRAY_63DA
+ .byte 110, 110, 110
.channel CHAN_63DD
-/* 0x63DD [0xCE 0x63 0xEE ] */ ldptr UNK_63EE
+/* 0x63DD [0xCE 0x63 0xEE ] */ ldptr ARRAY_63EE
/* 0x63E0 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x63E3 [0xCE 0x63 0xF0 ] */ ldptr UNK_63F0
+/* 0x63E3 [0xCE 0x63 0xF0 ] */ ldptr ARRAY_63F0
/* 0x63E6 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x63E9 [0xB8 0x02 ] */ rand 2
/* 0x63EB [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_63EE:
- .byte 0x2D, 0x2E
+.array ARRAY_63EE
+ .byte SF0_EFFECT_45
+ .byte SF0_EFFECT_46
-UNK_63F0:
- .byte 0x64, 0x64
+.array ARRAY_63F0
+ .byte 100, 100
.channel CHAN_63F2
-/* 0x63F2 [0xCE 0x64 0x03 ] */ ldptr UNK_6403
+/* 0x63F2 [0xCE 0x64 0x03 ] */ ldptr ARRAY_6403
/* 0x63F5 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x63F8 [0xCE 0x64 0x05 ] */ ldptr UNK_6405
+/* 0x63F8 [0xCE 0x64 0x05 ] */ ldptr ARRAY_6405
/* 0x63FB [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x63FE [0xB8 0x02 ] */ rand 2
/* 0x6400 [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_6403:
- .byte 0x2B, 0x2C
+.array ARRAY_6403
+ .byte SF0_EFFECT_43
+ .byte SF0_EFFECT_44
-UNK_6405:
- .byte 0x64, 0x64
+.array ARRAY_6405
+ .byte 100, 100
.channel CHAN_6407
-/* 0x6407 [0xCE 0x64 0x18 ] */ ldptr UNK_6418
+/* 0x6407 [0xCE 0x64 0x18 ] */ ldptr ARRAY_6418
/* 0x640A [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x640D [0xCE 0x64 0x1A ] */ ldptr UNK_641A
+/* 0x640D [0xCE 0x64 0x1A ] */ ldptr ARRAY_641A
/* 0x6410 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6413 [0xB8 0x02 ] */ rand 2
/* 0x6415 [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_6418:
- .byte 0x2F, 0x30
+.array ARRAY_6418
+ .byte SF0_EFFECT_47
+ .byte SF0_EFFECT_48
-UNK_641A:
- .byte 0x55, 0x55
+.array ARRAY_641A
+ .byte 85, 85
.channel CHAN_641C
/* 0x641C [0x88 0x64 0x20 ] */ ldlayer 0, LAYER_6420
@@ -14604,25 +14649,27 @@ UNK_641A:
/* 0x6433 [0xFF ] */ end
.channel CHAN_6434
-/* 0x6434 [0xCE 0x64 0x45 ] */ ldptr UNK_6445
+/* 0x6434 [0xCE 0x64 0x45 ] */ ldptr ARRAY_6445
/* 0x6437 [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x643A [0xCE 0x64 0x47 ] */ ldptr UNK_6447
+/* 0x643A [0xCE 0x64 0x47 ] */ ldptr ARRAY_6447
/* 0x643D [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6440 [0xB8 0x02 ] */ rand 2
/* 0x6442 [0xFB 0x61 0x34 ] */ jump CHAN_6134
-UNK_6445:
- .byte 0x2B, 0x2C
+.array ARRAY_6445
+ .byte SF0_EFFECT_43
+ .byte SF0_EFFECT_44
-UNK_6447:
- .byte 0x64, 0x64
+.array ARRAY_6447
+ .byte 100, 100
.channel CHAN_6449
-/* 0x6449 [0xCE 0x64 0x4F ] */ ldptr UNK_644F
+/* 0x6449 [0xCE 0x64 0x4F ] */ ldptr ARRAY_644F
/* 0x644C [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_644F:
- .byte 0x14, 0x64
+.array ARRAY_644F
+ .byte SF0_EFFECT_20
+ .byte 100
.channel CHAN_6451
/* 0x6451 [0x88 0x64 0x55 ] */ ldlayer 0, LAYER_6455
@@ -14667,11 +14714,12 @@ UNK_644F:
/* 0x6492 [0xFF ] */ end
.channel CHAN_6493
-/* 0x6493 [0xCE 0x64 0x99 ] */ ldptr UNK_6499
+/* 0x6493 [0xCE 0x64 0x99 ] */ ldptr ARRAY_6499
/* 0x6496 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6499:
- .byte 0x1C, 0x64
+.array ARRAY_6499
+ .byte SF0_EFFECT_28
+ .byte 100
.channel CHAN_649B
/* 0x649B [0x88 0x64 0x9F ] */ ldlayer 0, LAYER_649F
@@ -14687,10 +14735,10 @@ UNK_6499:
/* 0x64A6 [0xC8 0xFF ] */ sub 255
/* 0x64A8 [0x76 ] */ stio IO_PORT_6
/* 0x64A9 [0xC9 0x01 ] */ and 1
-/* 0x64AB [0xCB 0x64 0xC5 ] */ ldseq UNK_64C5
-/* 0x64AE [0xC7 0x40 0x64 0xBF ] */ stseq (NOTEDV_OPCODE | PITCH_A0), LAYER_64BF + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x64AB [0xCB 0x64 0xC5 ] */ ldseq ARRAY_64C5
+/* 0x64AE [0xC7 0x40 0x64 0xBF ] */ stseq (ASEQ_OP_LAYER_NOTEDV | SF0_EFFECT_0), LAYER_64BF + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x64B2 [0xB8 0x02 ] */ rand 2
-/* 0x64B4 [0xCB 0x64 0xC7 ] */ ldseq UNK_64C7
+/* 0x64B4 [0xCB 0x64 0xC7 ] */ ldseq ARRAY_64C7
/* 0x64B7 [0xC7 0x00 0x64 0xC1 ] */ stseq 0, LAYER_64BF + STSEQ_NOTEDV_VELOCITY_2
/* 0x64BB [0x88 0x64 0xBF ] */ ldlayer 0, LAYER_64BF
/* 0x64BE [0xFF ] */ end
@@ -14700,18 +14748,20 @@ UNK_6499:
/* 0x64C2 [0xC0 0x30 ] */ ldelay 48
/* 0x64C4 [0xFF ] */ end
-UNK_64C5:
- .byte 0x35, 0x36
+.array ARRAY_64C5
+ .byte SF0_EFFECT_53
+ .byte SF0_EFFECT_54
-UNK_64C7:
- .byte 0x50, 0x50
+.array ARRAY_64C7
+ .byte 80, 80
.channel CHAN_64C9
-/* 0x64C9 [0xCE 0x64 0xCF ] */ ldptr UNK_64CF
+/* 0x64C9 [0xCE 0x64 0xCF ] */ ldptr ARRAY_64CF
/* 0x64CC [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_64CF:
- .byte 0x21, 0x6E
+.array ARRAY_64CF
+ .byte SF0_EFFECT_33
+ .byte 110
.channel CHAN_64D1
/* 0x64D1 [0x88 0x64 0xD5 ] */ ldlayer 0, LAYER_64D5
@@ -14723,53 +14773,60 @@ UNK_64CF:
/* 0x64DA [0xFF ] */ end
.channel CHAN_64DB
-/* 0x64DB [0xCE 0x64 0xE1 ] */ ldptr UNK_64E1
+/* 0x64DB [0xCE 0x64 0xE1 ] */ ldptr ARRAY_64E1
/* 0x64DE [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_64E1:
- .byte 0x20, 0x5F
+.array ARRAY_64E1
+ .byte SF0_EFFECT_32
+ .byte 95
.channel CHAN_64E3
-/* 0x64E3 [0xCE 0x64 0xE9 ] */ ldptr UNK_64E9
+/* 0x64E3 [0xCE 0x64 0xE9 ] */ ldptr ARRAY_64E9
/* 0x64E6 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_64E9:
- .byte 0x23, 0x5A
+.array ARRAY_64E9
+ .byte SF0_EFFECT_35
+ .byte 90
.channel CHAN_64EB
-/* 0x64EB [0xCE 0x64 0xF1 ] */ ldptr UNK_64F1
+/* 0x64EB [0xCE 0x64 0xF1 ] */ ldptr ARRAY_64F1
/* 0x64EE [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_64F1:
- .byte 0x22, 0x64
+.array ARRAY_64F1
+ .byte SF0_EFFECT_34
+ .byte 100
.channel CHAN_64F3
-/* 0x64F3 [0xCE 0x64 0xF9 ] */ ldptr UNK_64F9
+/* 0x64F3 [0xCE 0x64 0xF9 ] */ ldptr ARRAY_64F9
/* 0x64F6 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_64F9:
- .byte 0x31, 0x73
+.array ARRAY_64F9
+ .byte SF0_EFFECT_49
+ .byte 115
.channel CHAN_64FB
-/* 0x64FB [0xCE 0x65 0x01 ] */ ldptr UNK_6501
+/* 0x64FB [0xCE 0x65 0x01 ] */ ldptr ARRAY_6501
/* 0x64FE [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6501:
- .byte 0x3E, 0x64
+.array ARRAY_6501
+ .byte SF0_EFFECT_62
+ .byte 100
.channel CHAN_6503
-/* 0x6503 [0xCE 0x65 0x09 ] */ ldptr UNK_6509
+/* 0x6503 [0xCE 0x65 0x09 ] */ ldptr ARRAY_6509
/* 0x6506 [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6509:
- .byte 0x3F, 0x6E
+.array ARRAY_6509
+ .byte SF0_EFFECT_63
+ .byte 110
.channel CHAN_650B
-/* 0x650B [0xCE 0x65 0x11 ] */ ldptr UNK_6511
+/* 0x650B [0xCE 0x65 0x11 ] */ ldptr ARRAY_6511
/* 0x650E [0xFB 0x61 0x3E ] */ jump CHAN_613E
-UNK_6511:
- .byte 0x2C, 0x64
+.array ARRAY_6511
+ .byte SF0_EFFECT_44
+ .byte 100
.channel CHAN_6513
/* 0x6513 [0xCC 0x20 ] */ ldi 32
@@ -14784,9 +14841,9 @@ UNK_6511:
.channel CHAN_6520
/* 0x6520 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS
-/* 0x6521 [0xC8 0x50 ] */ sub 80
-/* 0x6523 [0xC7 0x19 0x65 0x36 ] */ stseq (NOTEDVG_OPCODE | PITCH_BF2), LAYER_6536 + STSEQ_NOTEDVG_OPCODE_PITCH
-/* 0x6527 [0xCB 0x65 0x3B ] */ ldseq UNK_653B
+/* 0x6521 [0xC8 0x50 ] */ sub NA_SE_VO_TA_SLEEP & 0xFF
+/* 0x6523 [0xC7 0x19 0x65 0x36 ] */ stseq (ASEQ_OP_LAYER_NOTEDVG | PITCH_BF2), LAYER_6536 + STSEQ_NOTEDVG_OPCODE_PITCH
+/* 0x6527 [0xCB 0x65 0x3B ] */ ldseq ARRAY_653B
/* 0x652A [0xC7 0x00 0x65 0x38 ] */ stseq 0, LAYER_6536 + STSEQ_NOTEDVG_DELAY_LO
/* 0x652E [0x88 0x65 0x34 ] */ ldlayer 0, LAYER_6534
/* 0x6531 [0xDC 0x60 ] */ panweight 96
@@ -14798,16 +14855,16 @@ LAYER_6536:
/* 0x6536 [0x21 0x00 0x64 0x00 ] */ notedvg PITCH_GF3, 0, 100, 0
/* 0x653A [0xFF ] */ end
-UNK_653B:
- .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x6E, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
- .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
- .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x6E
+.array ARRAY_653B
+ .byte 100, 100, 100, 100, 100, 100, 100, 100, 110, 100, 100, 100, 100, 100, 100, 100
+ .byte 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
+ .byte 100, 100, 100, 100, 100, 100, 110
.channel CHAN_6562
/* 0x6562 [0x64 ] */ ldio IO_PORT_SFX_INDEX_LOBITS
-/* 0x6563 [0xC8 0x77 ] */ sub 119
-/* 0x6565 [0xC7 0x00 0x65 0x76 ] */ stseq (NOTEDVG_OPCODE | PITCH_A0), LAYER_6576 + STSEQ_NOTEDVG_OPCODE_PITCH
-/* 0x6569 [0xCB 0x65 0x7B ] */ ldseq UNK_657B
+/* 0x6563 [0xC8 0x77 ] */ sub NA_SE_VO_Z1_OPENDOOR & 0xFF
+/* 0x6565 [0xC7 0x00 0x65 0x76 ] */ stseq (ASEQ_OP_LAYER_NOTEDVG | PITCH_A0), LAYER_6576 + STSEQ_NOTEDVG_OPCODE_PITCH
+/* 0x6569 [0xCB 0x65 0x7B ] */ ldseq ARRAY_657B
/* 0x656C [0xC7 0x00 0x65 0x78 ] */ stseq 0, LAYER_6576 + STSEQ_NOTEDVG_DELAY_LO
/* 0x6570 [0x88 0x65 0x74 ] */ ldlayer 0, LAYER_6574
/* 0x6573 [0xFF ] */ end
@@ -14818,16 +14875,16 @@ LAYER_6576:
/* 0x6576 [0x00 0x00 0x64 0x00 ] */ notedvg PITCH_A0, 0, 100, 0
/* 0x657A [0xFF ] */ end
-UNK_657B:
- .byte 0x64, 0x64, 0x64, 0x64, 0x64, 0x64
+.array ARRAY_657B
+ .byte 100, 100, 100, 100, 100, 100
.channel CHAN_6581
/* 0x6581 [0xCC 0x20 ] */ ldi 32
/* 0x6583 [0x71 ] */ stio IO_PORT_1
/* 0x6584 [0x89 0x65 0x98 ] */ ldlayer 1, LAYER_6598
-/* 0x6587 [0xCE 0x65 0xA7 ] */ ldptr UNK_65A7
+/* 0x6587 [0xCE 0x65 0xA7 ] */ ldptr ARRAY_65A7
/* 0x658A [0xCF 0x61 0x1B ] */ stptrtoseq CHAN_611A + STSEQ_PTR_LDSEQ
-/* 0x658D [0xCE 0x65 0xAA ] */ ldptr UNK_65AA
+/* 0x658D [0xCE 0x65 0xAA ] */ ldptr ARRAY_65AA
/* 0x6590 [0xCF 0x61 0x23 ] */ stptrtoseq CHAN_6122 + STSEQ_PTR_LDSEQ
/* 0x6593 [0xCC 0x03 ] */ ldi 3
/* 0x6595 [0xFB 0x60 0xF2 ] */ jump CHAN_60F2
@@ -14840,11 +14897,13 @@ UNK_657B:
/* 0x65A3 [0x78 0x30 0x41 ] */ notedv PITCH_F5, 48, 65
/* 0x65A6 [0xFF ] */ end
-UNK_65A7:
- .byte 0x39, 0x3A, 0x3B
+.array ARRAY_65A7
+ .byte SF0_EFFECT_57
+ .byte SF0_EFFECT_58
+ .byte SF0_EFFECT_59
-UNK_65AA:
- .byte 0x64, 0x5F, 0x69
+.array ARRAY_65AA
+ .byte 100, 95, 105
.balign 16
diff --git a/assets/audio/sequences/seq_1.prg.seq b/assets/audio/sequences/seq_1.prg.seq
index 0babce8065..02994cf733 100644
--- a/assets/audio/sequences/seq_1.prg.seq
+++ b/assets/audio/sequences/seq_1.prg.seq
@@ -454,7 +454,7 @@ CHAN_0308:
/* 0x0319 [0xC7 0x60 0x10 0x00 ] */ stseq 96, ENVELOPE_0FFA + STSEQ_ENVELOPE_POINT(3)
CHAN_031D:
/* 0x031D [0xB8 0x18 ] */ rand 24
-/* 0x031F [0xC7 0x62 0x03 0x6F ] */ stseq (NOTEDV_OPCODE | PITCH_G3), LAYER_036F + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x031F [0xC7 0x62 0x03 0x6F ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_G3), LAYER_036F + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x0323 [0xCC 0x40 ] */ ldi 64
/* 0x0325 [0x53 ] */ subio IO_PORT_3
/* 0x0326 [0xC7 0x00 0x03 0x2B ] */ stseq 0, STSEQ_HERE + STSEQ_RAND
@@ -482,7 +482,7 @@ CHAN_0335:
/* 0x034B [0xC8 0xFF ] */ sub 255
/* 0x034D [0xC7 0x64 0x03 0x87 ] */ stseq 100, LAYER_0385 + STSEQ_NOTEDV_VELOCITY_2
/* 0x0351 [0xC7 0x64 0x03 0x8A ] */ stseq 100, LAYER_0388 + STSEQ_NOTEDV_VELOCITY_2
-/* 0x0355 [0xC7 0x67 0x03 0x85 ] */ stseq (NOTEDV_OPCODE | PITCH_C4), LAYER_0385 + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x0355 [0xC7 0x67 0x03 0x85 ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_C4), LAYER_0385 + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x0359 [0xFF ] */ end
UNK_035A:
@@ -1664,7 +1664,7 @@ CHAN_0E72:
/* 0x0E84 [0xB8 0x02 ] */ rand 2
/* 0x0E86 [0x73 ] */ stio IO_PORT_3
CHAN_0E87:
-/* 0x0E87 [0xC7 0x67 0x0E 0xCF ] */ stseq (NOTEDV_OPCODE | PITCH_C4), LAYER_0ECF + STSEQ_NOTEDV_OPCODE_PITCH
+/* 0x0E87 [0xC7 0x67 0x0E 0xCF ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_C4), LAYER_0ECF + STSEQ_NOTEDV_OPCODE_PITCH
/* 0x0E8B [0xB8 0x1E ] */ rand 30
/* 0x0E8D [0xC7 0x31 0x0E 0xCC ] */ stseq 49, LAYER_0ECB + STSEQ_NOTEPAN
/* 0x0E91 [0x76 ] */ stio IO_PORT_6
diff --git a/assets/xml/code/fbdemo_circle.xml b/assets/xml/code/fbdemo_circle.xml
index 530506369c..618c743314 100644
--- a/assets/xml/code/fbdemo_circle.xml
+++ b/assets/xml/code/fbdemo_circle.xml
@@ -7,7 +7,6 @@
-
-
+
diff --git a/assets/xml/code/fbdemo_wipe1.xml b/assets/xml/code/fbdemo_wipe1.xml
index 74f129776b..87f7e47b6f 100644
--- a/assets/xml/code/fbdemo_wipe1.xml
+++ b/assets/xml/code/fbdemo_wipe1.xml
@@ -4,7 +4,6 @@
-
-
+
diff --git a/assets/xml/objects/gameplay_field_keep.xml b/assets/xml/objects/gameplay_field_keep.xml
index 011e8f7fc7..3c0f18d74e 100644
--- a/assets/xml/objects/gameplay_field_keep.xml
+++ b/assets/xml/objects/gameplay_field_keep.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml
index dcb7e29605..1a1077f038 100644
--- a/assets/xml/objects/gameplay_keep.xml
+++ b/assets/xml/objects/gameplay_keep.xml
@@ -1,5 +1,5 @@
-
+
@@ -759,7 +759,7 @@
-
+
@@ -848,7 +848,7 @@
-
+
diff --git a/assets/xml/objects/gameplay_keep_pal.xml b/assets/xml/objects/gameplay_keep_pal.xml
index fbea0efd0c..92a7bb06e0 100644
--- a/assets/xml/objects/gameplay_keep_pal.xml
+++ b/assets/xml/objects/gameplay_keep_pal.xml
@@ -1,5 +1,5 @@
-
+
@@ -753,7 +753,7 @@
-
+
@@ -843,7 +843,7 @@
-
+
diff --git a/assets/xml/objects/object_am.xml b/assets/xml/objects/object_am.xml
index 0a4b88ddf8..2467baf6ab 100644
--- a/assets/xml/objects/object_am.xml
+++ b/assets/xml/objects/object_am.xml
@@ -5,5 +5,6 @@
+
diff --git a/assets/xml/objects/object_ani.xml b/assets/xml/objects/object_ani.xml
index 25ad7af354..d83aa7656a 100644
--- a/assets/xml/objects/object_ani.xml
+++ b/assets/xml/objects/object_ani.xml
@@ -51,6 +51,8 @@
+
+
diff --git a/assets/xml/objects/object_bdoor.xml b/assets/xml/objects/object_bdoor.xml
index e926ae40bd..e15f0f6294 100644
--- a/assets/xml/objects/object_bdoor.xml
+++ b/assets/xml/objects/object_bdoor.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_box.xml b/assets/xml/objects/object_box.xml
index 34162fc94f..7ab9d9e7f4 100644
--- a/assets/xml/objects/object_box.xml
+++ b/assets/xml/objects/object_box.xml
@@ -5,7 +5,9 @@
+
+
@@ -19,11 +21,7 @@
-
+
-
-
-
-
diff --git a/assets/xml/objects/object_bv.xml b/assets/xml/objects/object_bv.xml
index e2c2ce9202..5a8e6c594d 100644
--- a/assets/xml/objects/object_bv.xml
+++ b/assets/xml/objects/object_bv.xml
@@ -7,7 +7,7 @@
-
+
diff --git a/assets/xml/objects/object_bv_pal.xml b/assets/xml/objects/object_bv_pal.xml
index 204273fc01..8de7492663 100644
--- a/assets/xml/objects/object_bv_pal.xml
+++ b/assets/xml/objects/object_bv_pal.xml
@@ -7,7 +7,7 @@
-
+
diff --git a/assets/xml/objects/object_demo_6k.xml b/assets/xml/objects/object_demo_6k.xml
index 73058d5e46..e2de93db2e 100644
--- a/assets/xml/objects/object_demo_6k.xml
+++ b/assets/xml/objects/object_demo_6k.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_demo_kekkai.xml b/assets/xml/objects/object_demo_kekkai.xml
index 1b9c9b4027..8b7b739c64 100644
--- a/assets/xml/objects/object_demo_kekkai.xml
+++ b/assets/xml/objects/object_demo_kekkai.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_door_killer.xml b/assets/xml/objects/object_door_killer.xml
index a37f590d60..fbee0e5f70 100644
--- a/assets/xml/objects/object_door_killer.xml
+++ b/assets/xml/objects/object_door_killer.xml
@@ -12,6 +12,6 @@
-
+
diff --git a/assets/xml/objects/object_efc_erupc.xml b/assets/xml/objects/object_efc_erupc.xml
index 800d9535f1..13cc2ab033 100644
--- a/assets/xml/objects/object_efc_erupc.xml
+++ b/assets/xml/objects/object_efc_erupc.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_fd.xml b/assets/xml/objects/object_fd.xml
index a28919d8e8..4a5ce9fafa 100644
--- a/assets/xml/objects/object_fd.xml
+++ b/assets/xml/objects/object_fd.xml
@@ -19,9 +19,10 @@
-
-
-
+
+
+
+
diff --git a/assets/xml/objects/object_fd2.xml b/assets/xml/objects/object_fd2.xml
index b3fbdcb216..8d2b3dcdb6 100644
--- a/assets/xml/objects/object_fd2.xml
+++ b/assets/xml/objects/object_fd2.xml
@@ -21,9 +21,10 @@
-
-
-
+
+
+
+
diff --git a/assets/xml/objects/object_fd_pal.xml b/assets/xml/objects/object_fd_pal.xml
index 776a2ee494..be375399f6 100644
--- a/assets/xml/objects/object_fd_pal.xml
+++ b/assets/xml/objects/object_fd_pal.xml
@@ -19,9 +19,10 @@
-
-
-
+
+
+
+
diff --git a/assets/xml/objects/object_fish.xml b/assets/xml/objects/object_fish.xml
index f5ad4f6da0..2ce27bac3a 100644
--- a/assets/xml/objects/object_fish.xml
+++ b/assets/xml/objects/object_fish.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_fz.xml b/assets/xml/objects/object_fz.xml
index dad6fec5ce..bbed88b106 100644
--- a/assets/xml/objects/object_fz.xml
+++ b/assets/xml/objects/object_fz.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_arrow.xml b/assets/xml/objects/object_gi_arrow.xml
index 4b58787a9d..4ce9110cc1 100644
--- a/assets/xml/objects/object_gi_arrow.xml
+++ b/assets/xml/objects/object_gi_arrow.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_arrowcase.xml b/assets/xml/objects/object_gi_arrowcase.xml
index 267b0a734d..990576428d 100644
--- a/assets/xml/objects/object_gi_arrowcase.xml
+++ b/assets/xml/objects/object_gi_arrowcase.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bean.xml b/assets/xml/objects/object_gi_bean.xml
index e74247816f..2c6ce0cf12 100644
--- a/assets/xml/objects/object_gi_bean.xml
+++ b/assets/xml/objects/object_gi_bean.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bomb_1.xml b/assets/xml/objects/object_gi_bomb_1.xml
index bae86c11d8..5d7dab6d86 100644
--- a/assets/xml/objects/object_gi_bomb_1.xml
+++ b/assets/xml/objects/object_gi_bomb_1.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bomb_2.xml b/assets/xml/objects/object_gi_bomb_2.xml
index 1400c4a4d4..01f3956803 100644
--- a/assets/xml/objects/object_gi_bomb_2.xml
+++ b/assets/xml/objects/object_gi_bomb_2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bombpouch.xml b/assets/xml/objects/object_gi_bombpouch.xml
index 07134748c3..42620ec94d 100644
--- a/assets/xml/objects/object_gi_bombpouch.xml
+++ b/assets/xml/objects/object_gi_bombpouch.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_boomerang.xml b/assets/xml/objects/object_gi_boomerang.xml
index 3c1a0fe7fc..fef261c489 100644
--- a/assets/xml/objects/object_gi_boomerang.xml
+++ b/assets/xml/objects/object_gi_boomerang.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_boots_2.xml b/assets/xml/objects/object_gi_boots_2.xml
index 8e9cd1028d..e172bd006c 100644
--- a/assets/xml/objects/object_gi_boots_2.xml
+++ b/assets/xml/objects/object_gi_boots_2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bosskey.xml b/assets/xml/objects/object_gi_bosskey.xml
index e5e4bc86c9..8e93c10d1a 100644
--- a/assets/xml/objects/object_gi_bosskey.xml
+++ b/assets/xml/objects/object_gi_bosskey.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bottle.xml b/assets/xml/objects/object_gi_bottle.xml
index 3b0884a03f..0a27562954 100644
--- a/assets/xml/objects/object_gi_bottle.xml
+++ b/assets/xml/objects/object_gi_bottle.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bottle_letter.xml b/assets/xml/objects/object_gi_bottle_letter.xml
index 443219caf5..04b08dd673 100644
--- a/assets/xml/objects/object_gi_bottle_letter.xml
+++ b/assets/xml/objects/object_gi_bottle_letter.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bow.xml b/assets/xml/objects/object_gi_bow.xml
index 946e9c4965..6e9101b413 100644
--- a/assets/xml/objects/object_gi_bow.xml
+++ b/assets/xml/objects/object_gi_bow.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bracelet.xml b/assets/xml/objects/object_gi_bracelet.xml
index 5a0b62a60a..da35c003f8 100644
--- a/assets/xml/objects/object_gi_bracelet.xml
+++ b/assets/xml/objects/object_gi_bracelet.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_brokensword.xml b/assets/xml/objects/object_gi_brokensword.xml
index 408741ac54..44cae3e100 100644
--- a/assets/xml/objects/object_gi_brokensword.xml
+++ b/assets/xml/objects/object_gi_brokensword.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_butterfly.xml b/assets/xml/objects/object_gi_butterfly.xml
index 76ac706096..9882d27954 100644
--- a/assets/xml/objects/object_gi_butterfly.xml
+++ b/assets/xml/objects/object_gi_butterfly.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_coin.xml b/assets/xml/objects/object_gi_coin.xml
index 22e29f255f..f65993465b 100644
--- a/assets/xml/objects/object_gi_coin.xml
+++ b/assets/xml/objects/object_gi_coin.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_compass.xml b/assets/xml/objects/object_gi_compass.xml
index 076229b11e..10c6fbb63a 100644
--- a/assets/xml/objects/object_gi_compass.xml
+++ b/assets/xml/objects/object_gi_compass.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_dekupouch.xml b/assets/xml/objects/object_gi_dekupouch.xml
index 3d6d95d98a..25cde931f2 100644
--- a/assets/xml/objects/object_gi_dekupouch.xml
+++ b/assets/xml/objects/object_gi_dekupouch.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_egg.xml b/assets/xml/objects/object_gi_egg.xml
index 2b2e2847db..ceae8be407 100644
--- a/assets/xml/objects/object_gi_egg.xml
+++ b/assets/xml/objects/object_gi_egg.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_eye_lotion.xml b/assets/xml/objects/object_gi_eye_lotion.xml
index 5128c5f6ff..86e053cd94 100644
--- a/assets/xml/objects/object_gi_eye_lotion.xml
+++ b/assets/xml/objects/object_gi_eye_lotion.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_fire.xml b/assets/xml/objects/object_gi_fire.xml
index a57fba6e86..3b81815d5f 100644
--- a/assets/xml/objects/object_gi_fire.xml
+++ b/assets/xml/objects/object_gi_fire.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_fish.xml b/assets/xml/objects/object_gi_fish.xml
index edb39dc297..75361b32da 100644
--- a/assets/xml/objects/object_gi_fish.xml
+++ b/assets/xml/objects/object_gi_fish.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_frog.xml b/assets/xml/objects/object_gi_frog.xml
index f180fd267b..8c5d616eb4 100644
--- a/assets/xml/objects/object_gi_frog.xml
+++ b/assets/xml/objects/object_gi_frog.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_gerudo.xml b/assets/xml/objects/object_gi_gerudo.xml
index 3be8d34620..26dc606ce0 100644
--- a/assets/xml/objects/object_gi_gerudo.xml
+++ b/assets/xml/objects/object_gi_gerudo.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ghost.xml b/assets/xml/objects/object_gi_ghost.xml
index 186f4c74b7..e6c631c98e 100644
--- a/assets/xml/objects/object_gi_ghost.xml
+++ b/assets/xml/objects/object_gi_ghost.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_glasses.xml b/assets/xml/objects/object_gi_glasses.xml
index 63d32ab5ac..4a9cacf086 100644
--- a/assets/xml/objects/object_gi_glasses.xml
+++ b/assets/xml/objects/object_gi_glasses.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_gloves.xml b/assets/xml/objects/object_gi_gloves.xml
index 1b4282dcaa..fb273e95f4 100644
--- a/assets/xml/objects/object_gi_gloves.xml
+++ b/assets/xml/objects/object_gi_gloves.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_goddess.xml b/assets/xml/objects/object_gi_goddess.xml
index 50cbdd8918..6339012d47 100644
--- a/assets/xml/objects/object_gi_goddess.xml
+++ b/assets/xml/objects/object_gi_goddess.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_grass.xml b/assets/xml/objects/object_gi_grass.xml
index ae7834201a..2cc465c959 100644
--- a/assets/xml/objects/object_gi_grass.xml
+++ b/assets/xml/objects/object_gi_grass.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hammer.xml b/assets/xml/objects/object_gi_hammer.xml
index feb5c8659d..49da345a93 100644
--- a/assets/xml/objects/object_gi_hammer.xml
+++ b/assets/xml/objects/object_gi_hammer.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_heart.xml b/assets/xml/objects/object_gi_heart.xml
index 48e78b1b5c..b3576efaad 100644
--- a/assets/xml/objects/object_gi_heart.xml
+++ b/assets/xml/objects/object_gi_heart.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hearts.xml b/assets/xml/objects/object_gi_hearts.xml
index d2e763e631..122c898571 100644
--- a/assets/xml/objects/object_gi_hearts.xml
+++ b/assets/xml/objects/object_gi_hearts.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hookshot.xml b/assets/xml/objects/object_gi_hookshot.xml
index a6b3b0fdac..513194fa7d 100644
--- a/assets/xml/objects/object_gi_hookshot.xml
+++ b/assets/xml/objects/object_gi_hookshot.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hoverboots.xml b/assets/xml/objects/object_gi_hoverboots.xml
index c4a67877b2..9d710662e5 100644
--- a/assets/xml/objects/object_gi_hoverboots.xml
+++ b/assets/xml/objects/object_gi_hoverboots.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_insect.xml b/assets/xml/objects/object_gi_insect.xml
index 7af5b5b3b2..9467605ce2 100644
--- a/assets/xml/objects/object_gi_insect.xml
+++ b/assets/xml/objects/object_gi_insect.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_jewel.xml b/assets/xml/objects/object_gi_jewel.xml
index e83c651164..5dc87f53e2 100644
--- a/assets/xml/objects/object_gi_jewel.xml
+++ b/assets/xml/objects/object_gi_jewel.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_key.xml b/assets/xml/objects/object_gi_key.xml
index a37d45a71c..e38547a32c 100644
--- a/assets/xml/objects/object_gi_key.xml
+++ b/assets/xml/objects/object_gi_key.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ki_tan_mask.xml b/assets/xml/objects/object_gi_ki_tan_mask.xml
index f66535af37..e447c8fadf 100644
--- a/assets/xml/objects/object_gi_ki_tan_mask.xml
+++ b/assets/xml/objects/object_gi_ki_tan_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_liquid.xml b/assets/xml/objects/object_gi_liquid.xml
index 5eeeca0fd2..b3af2b2627 100644
--- a/assets/xml/objects/object_gi_liquid.xml
+++ b/assets/xml/objects/object_gi_liquid.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_longsword.xml b/assets/xml/objects/object_gi_longsword.xml
index 7161e42e38..bdfffe3b16 100644
--- a/assets/xml/objects/object_gi_longsword.xml
+++ b/assets/xml/objects/object_gi_longsword.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_m_arrow.xml b/assets/xml/objects/object_gi_m_arrow.xml
index 0fd659ae95..069a1bf1d4 100644
--- a/assets/xml/objects/object_gi_m_arrow.xml
+++ b/assets/xml/objects/object_gi_m_arrow.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_magicpot.xml b/assets/xml/objects/object_gi_magicpot.xml
index 7623e6353e..070de07fa0 100644
--- a/assets/xml/objects/object_gi_magicpot.xml
+++ b/assets/xml/objects/object_gi_magicpot.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_map.xml b/assets/xml/objects/object_gi_map.xml
index 8887dd22c9..619b0bc845 100644
--- a/assets/xml/objects/object_gi_map.xml
+++ b/assets/xml/objects/object_gi_map.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_medal.xml b/assets/xml/objects/object_gi_medal.xml
index 28e5b1e683..5676a9e316 100644
--- a/assets/xml/objects/object_gi_medal.xml
+++ b/assets/xml/objects/object_gi_medal.xml
@@ -1,11 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_gi_melody.xml b/assets/xml/objects/object_gi_melody.xml
index b01fca9538..e028bc9463 100644
--- a/assets/xml/objects/object_gi_melody.xml
+++ b/assets/xml/objects/object_gi_melody.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_milk.xml b/assets/xml/objects/object_gi_milk.xml
index 00b9530d95..3e5cb0cb5a 100644
--- a/assets/xml/objects/object_gi_milk.xml
+++ b/assets/xml/objects/object_gi_milk.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_mushroom.xml b/assets/xml/objects/object_gi_mushroom.xml
index 5b19bca743..8ee686263c 100644
--- a/assets/xml/objects/object_gi_mushroom.xml
+++ b/assets/xml/objects/object_gi_mushroom.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_niwatori.xml b/assets/xml/objects/object_gi_niwatori.xml
index 713cc1ce5a..8af44b8708 100644
--- a/assets/xml/objects/object_gi_niwatori.xml
+++ b/assets/xml/objects/object_gi_niwatori.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_nuts.xml b/assets/xml/objects/object_gi_nuts.xml
index 5508fe8569..d1a8454dbc 100644
--- a/assets/xml/objects/object_gi_nuts.xml
+++ b/assets/xml/objects/object_gi_nuts.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ocarina.xml b/assets/xml/objects/object_gi_ocarina.xml
index 7693cc122f..b8714d6e3c 100644
--- a/assets/xml/objects/object_gi_ocarina.xml
+++ b/assets/xml/objects/object_gi_ocarina.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ocarina_0.xml b/assets/xml/objects/object_gi_ocarina_0.xml
index 336d338946..caca8f2002 100644
--- a/assets/xml/objects/object_gi_ocarina_0.xml
+++ b/assets/xml/objects/object_gi_ocarina_0.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_pachinko.xml b/assets/xml/objects/object_gi_pachinko.xml
index 5f808baf92..9967813b3d 100644
--- a/assets/xml/objects/object_gi_pachinko.xml
+++ b/assets/xml/objects/object_gi_pachinko.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_powder.xml b/assets/xml/objects/object_gi_powder.xml
index fb7dc0155d..4e33b58208 100644
--- a/assets/xml/objects/object_gi_powder.xml
+++ b/assets/xml/objects/object_gi_powder.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_prescription.xml b/assets/xml/objects/object_gi_prescription.xml
index 081de301c4..9fa16660c7 100644
--- a/assets/xml/objects/object_gi_prescription.xml
+++ b/assets/xml/objects/object_gi_prescription.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_rabit_mask.xml b/assets/xml/objects/object_gi_rabit_mask.xml
index 75f855550d..a3c07e469c 100644
--- a/assets/xml/objects/object_gi_rabit_mask.xml
+++ b/assets/xml/objects/object_gi_rabit_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_redead_mask.xml b/assets/xml/objects/object_gi_redead_mask.xml
index 7de08487f8..fe601cab64 100644
--- a/assets/xml/objects/object_gi_redead_mask.xml
+++ b/assets/xml/objects/object_gi_redead_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_rupy.xml b/assets/xml/objects/object_gi_rupy.xml
index 0a1af96d0f..07b18b82dd 100644
--- a/assets/xml/objects/object_gi_rupy.xml
+++ b/assets/xml/objects/object_gi_rupy.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_saw.xml b/assets/xml/objects/object_gi_saw.xml
index dcc038b7c1..999b818e8b 100644
--- a/assets/xml/objects/object_gi_saw.xml
+++ b/assets/xml/objects/object_gi_saw.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_scale.xml b/assets/xml/objects/object_gi_scale.xml
index 1cf5de5b99..c6794b6aea 100644
--- a/assets/xml/objects/object_gi_scale.xml
+++ b/assets/xml/objects/object_gi_scale.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_seed.xml b/assets/xml/objects/object_gi_seed.xml
index 82c15c82d2..5d3ef9c03f 100644
--- a/assets/xml/objects/object_gi_seed.xml
+++ b/assets/xml/objects/object_gi_seed.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_shield_1.xml b/assets/xml/objects/object_gi_shield_1.xml
index 2e93695699..867292a4c3 100644
--- a/assets/xml/objects/object_gi_shield_1.xml
+++ b/assets/xml/objects/object_gi_shield_1.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_shield_2.xml b/assets/xml/objects/object_gi_shield_2.xml
index 176ae025fe..364070d101 100644
--- a/assets/xml/objects/object_gi_shield_2.xml
+++ b/assets/xml/objects/object_gi_shield_2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_shield_3.xml b/assets/xml/objects/object_gi_shield_3.xml
index 250bf7fea3..974a2539a9 100644
--- a/assets/xml/objects/object_gi_shield_3.xml
+++ b/assets/xml/objects/object_gi_shield_3.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_skj_mask.xml b/assets/xml/objects/object_gi_skj_mask.xml
index e6c90f76f1..6479015715 100644
--- a/assets/xml/objects/object_gi_skj_mask.xml
+++ b/assets/xml/objects/object_gi_skj_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_soul.xml b/assets/xml/objects/object_gi_soul.xml
index 76ffc56852..ee9dbd9570 100644
--- a/assets/xml/objects/object_gi_soul.xml
+++ b/assets/xml/objects/object_gi_soul.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_stick.xml b/assets/xml/objects/object_gi_stick.xml
index fed89f4659..d974b7ac5d 100644
--- a/assets/xml/objects/object_gi_stick.xml
+++ b/assets/xml/objects/object_gi_stick.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_sutaru.xml b/assets/xml/objects/object_gi_sutaru.xml
index a2606afbe3..343d301868 100644
--- a/assets/xml/objects/object_gi_sutaru.xml
+++ b/assets/xml/objects/object_gi_sutaru.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_sword_1.xml b/assets/xml/objects/object_gi_sword_1.xml
index e1119abca0..3bc15dcaf3 100644
--- a/assets/xml/objects/object_gi_sword_1.xml
+++ b/assets/xml/objects/object_gi_sword_1.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ticketstone.xml b/assets/xml/objects/object_gi_ticketstone.xml
index 0fa37fe11e..6cdd5ea2f0 100644
--- a/assets/xml/objects/object_gi_ticketstone.xml
+++ b/assets/xml/objects/object_gi_ticketstone.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_truth_mask.xml b/assets/xml/objects/object_gi_truth_mask.xml
index f28c7cbcad..64bd0939c6 100644
--- a/assets/xml/objects/object_gi_truth_mask.xml
+++ b/assets/xml/objects/object_gi_truth_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gla.xml b/assets/xml/objects/object_gla.xml
index ca4d9225da..dbbfcb58ff 100644
--- a/assets/xml/objects/object_gla.xml
+++ b/assets/xml/objects/object_gla.xml
@@ -58,7 +58,7 @@
-
+
diff --git a/assets/xml/objects/object_gnd.xml b/assets/xml/objects/object_gnd.xml
index 53d2bbde4c..d073b8b973 100644
--- a/assets/xml/objects/object_gnd.xml
+++ b/assets/xml/objects/object_gnd.xml
@@ -44,11 +44,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/assets/xml/objects/object_god_lgt.xml b/assets/xml/objects/object_god_lgt.xml
index 60df9e4693..b630605364 100644
--- a/assets/xml/objects/object_god_lgt.xml
+++ b/assets/xml/objects/object_god_lgt.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_hintnuts.xml b/assets/xml/objects/object_hintnuts.xml
index f7da2e8f5c..d3595d85e8 100644
--- a/assets/xml/objects/object_hintnuts.xml
+++ b/assets/xml/objects/object_hintnuts.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/assets/xml/objects/object_hni.xml b/assets/xml/objects/object_hni.xml
index 6b317eb7a6..763f6892c0 100644
--- a/assets/xml/objects/object_hni.xml
+++ b/assets/xml/objects/object_hni.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/assets/xml/objects/object_ik.xml b/assets/xml/objects/object_ik.xml
index 5d86e1075a..50f47e9d7c 100644
--- a/assets/xml/objects/object_ik.xml
+++ b/assets/xml/objects/object_ik.xml
@@ -1,8 +1,8 @@
-
-
-
+
+
+
@@ -29,7 +29,10 @@
+
+
+
diff --git a/assets/xml/objects/object_jya_obj.xml b/assets/xml/objects/object_jya_obj.xml
index 4a203b0b92..50c2700db1 100644
--- a/assets/xml/objects/object_jya_obj.xml
+++ b/assets/xml/objects/object_jya_obj.xml
@@ -29,7 +29,7 @@
-
+
@@ -59,10 +59,10 @@
-
+
-
-
+
+
diff --git a/assets/xml/objects/object_kanban.xml b/assets/xml/objects/object_kanban.xml
index 9ffc7a2ceb..b989d3572a 100644
--- a/assets/xml/objects/object_kanban.xml
+++ b/assets/xml/objects/object_kanban.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_kingdodongo.xml b/assets/xml/objects/object_kingdodongo.xml
index 32c28766b2..3ada2822c9 100644
--- a/assets/xml/objects/object_kingdodongo.xml
+++ b/assets/xml/objects/object_kingdodongo.xml
@@ -101,7 +101,15 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_kingdodongo_pal.xml b/assets/xml/objects/object_kingdodongo_pal.xml
index 1aa1735cbe..a0790a6db5 100644
--- a/assets/xml/objects/object_kingdodongo_pal.xml
+++ b/assets/xml/objects/object_kingdodongo_pal.xml
@@ -101,7 +101,15 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_kusa.xml b/assets/xml/objects/object_kusa.xml
index 67291a5543..5eaaa99c58 100644
--- a/assets/xml/objects/object_kusa.xml
+++ b/assets/xml/objects/object_kusa.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_lightbox.xml b/assets/xml/objects/object_lightbox.xml
index 552a79d7c7..c67059b89d 100644
--- a/assets/xml/objects/object_lightbox.xml
+++ b/assets/xml/objects/object_lightbox.xml
@@ -1,12 +1,11 @@
-
-
-
+
+
-
+
-
+
diff --git a/assets/xml/objects/object_link_boy.xml b/assets/xml/objects/object_link_boy.xml
index c5e11f54ce..14917fd165 100644
--- a/assets/xml/objects/object_link_boy.xml
+++ b/assets/xml/objects/object_link_boy.xml
@@ -1,4 +1,5 @@
+
@@ -125,6 +126,14 @@
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_link_child.xml b/assets/xml/objects/object_link_child.xml
index 640228441a..85ed8de950 100644
--- a/assets/xml/objects/object_link_child.xml
+++ b/assets/xml/objects/object_link_child.xml
@@ -1,4 +1,5 @@
+
@@ -123,8 +124,9 @@
-
-
+
+
+
@@ -175,11 +177,12 @@
+
+
-
diff --git a/assets/xml/objects/object_medal.xml b/assets/xml/objects/object_medal.xml
index 533872a551..94976bd3f9 100644
--- a/assets/xml/objects/object_medal.xml
+++ b/assets/xml/objects/object_medal.xml
@@ -1,4 +1,5 @@
+
@@ -6,7 +7,7 @@
-
+
diff --git a/assets/xml/objects/object_mo.xml b/assets/xml/objects/object_mo.xml
index 68035c3844..ad84a14026 100644
--- a/assets/xml/objects/object_mo.xml
+++ b/assets/xml/objects/object_mo.xml
@@ -74,9 +74,5 @@
-
-
-
-
diff --git a/assets/xml/objects/object_mo_pal.xml b/assets/xml/objects/object_mo_pal.xml
index b191e8395e..17cd4fc2f4 100644
--- a/assets/xml/objects/object_mo_pal.xml
+++ b/assets/xml/objects/object_mo_pal.xml
@@ -74,9 +74,5 @@
-
-
-
-
diff --git a/assets/xml/objects/object_mori_hineri1.xml b/assets/xml/objects/object_mori_hineri1.xml
index a2033a6f97..572eb6e1f3 100644
--- a/assets/xml/objects/object_mori_hineri1.xml
+++ b/assets/xml/objects/object_mori_hineri1.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_hineri1a.xml b/assets/xml/objects/object_mori_hineri1a.xml
index d7e3489044..23e6f5e665 100644
--- a/assets/xml/objects/object_mori_hineri1a.xml
+++ b/assets/xml/objects/object_mori_hineri1a.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_hineri2.xml b/assets/xml/objects/object_mori_hineri2.xml
index 9f1c892afb..d539cd86f0 100644
--- a/assets/xml/objects/object_mori_hineri2.xml
+++ b/assets/xml/objects/object_mori_hineri2.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_hineri2a.xml b/assets/xml/objects/object_mori_hineri2a.xml
index 6fd6818562..0334488567 100644
--- a/assets/xml/objects/object_mori_hineri2a.xml
+++ b/assets/xml/objects/object_mori_hineri2a.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_objects.xml b/assets/xml/objects/object_mori_objects.xml
index aa24a38d70..1844cf6f69 100644
--- a/assets/xml/objects/object_mori_objects.xml
+++ b/assets/xml/objects/object_mori_objects.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_tex.xml b/assets/xml/objects/object_mori_tex.xml
index 79f1f0b4c0..756347bcc6 100644
--- a/assets/xml/objects/object_mori_tex.xml
+++ b/assets/xml/objects/object_mori_tex.xml
@@ -1,12 +1,12 @@
-
+
-
+
diff --git a/assets/xml/objects/object_nwc.xml b/assets/xml/objects/object_nwc.xml
index 96ffa32383..abe2be092b 100644
--- a/assets/xml/objects/object_nwc.xml
+++ b/assets/xml/objects/object_nwc.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_ny.xml b/assets/xml/objects/object_ny.xml
index e2e8187ff8..c81d66ab56 100644
--- a/assets/xml/objects/object_ny.xml
+++ b/assets/xml/objects/object_ny.xml
@@ -1,10 +1,11 @@
+
-
-
+
+
diff --git a/assets/xml/objects/object_oA3.xml b/assets/xml/objects/object_oA3.xml
index a492bd8751..176ad09315 100644
--- a/assets/xml/objects/object_oA3.xml
+++ b/assets/xml/objects/object_oA3.xml
@@ -1,7 +1,6 @@
-
-
+
diff --git a/assets/xml/objects/object_oE1.xml b/assets/xml/objects/object_oE1.xml
index 4d5b1663fe..5b3234893e 100644
--- a/assets/xml/objects/object_oE1.xml
+++ b/assets/xml/objects/object_oE1.xml
@@ -56,7 +56,8 @@
-
+
+
diff --git a/assets/xml/objects/object_oE11.xml b/assets/xml/objects/object_oE11.xml
index 04f6f186da..26ff739cd0 100644
--- a/assets/xml/objects/object_oE11.xml
+++ b/assets/xml/objects/object_oE11.xml
@@ -3,7 +3,8 @@
-
+
+
diff --git a/assets/xml/objects/object_oE12.xml b/assets/xml/objects/object_oE12.xml
index a5fa39fd25..4b89954e0d 100644
--- a/assets/xml/objects/object_oE12.xml
+++ b/assets/xml/objects/object_oE12.xml
@@ -3,7 +3,8 @@
-
+
+
diff --git a/assets/xml/objects/object_oE2.xml b/assets/xml/objects/object_oE2.xml
index af62ad6d11..ea3ba91fc6 100644
--- a/assets/xml/objects/object_oE2.xml
+++ b/assets/xml/objects/object_oE2.xml
@@ -56,7 +56,8 @@
-
+
+
diff --git a/assets/xml/objects/object_oE3.xml b/assets/xml/objects/object_oE3.xml
index 95227da384..4a6cb3d926 100644
--- a/assets/xml/objects/object_oE3.xml
+++ b/assets/xml/objects/object_oE3.xml
@@ -56,13 +56,14 @@
-
+
+
-
+
-
+
diff --git a/assets/xml/objects/object_oE5.xml b/assets/xml/objects/object_oE5.xml
index 040fb8d733..c05917dc9a 100644
--- a/assets/xml/objects/object_oE5.xml
+++ b/assets/xml/objects/object_oE5.xml
@@ -52,9 +52,9 @@
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_oE6.xml b/assets/xml/objects/object_oE6.xml
index 95bb602b6b..d253130af1 100644
--- a/assets/xml/objects/object_oE6.xml
+++ b/assets/xml/objects/object_oE6.xml
@@ -3,7 +3,8 @@
-
+
+
diff --git a/assets/xml/objects/object_oE7.xml b/assets/xml/objects/object_oE7.xml
index b3e588d4c2..2b6b5cf316 100644
--- a/assets/xml/objects/object_oE7.xml
+++ b/assets/xml/objects/object_oE7.xml
@@ -7,7 +7,8 @@
-
+
+
diff --git a/assets/xml/objects/object_oE8.xml b/assets/xml/objects/object_oE8.xml
index be5de24947..8b1333fa9c 100644
--- a/assets/xml/objects/object_oE8.xml
+++ b/assets/xml/objects/object_oE8.xml
@@ -3,7 +3,8 @@
-
+
+
diff --git a/assets/xml/objects/object_oE9.xml b/assets/xml/objects/object_oE9.xml
index 8ea7ee18c7..e43cee426b 100644
--- a/assets/xml/objects/object_oE9.xml
+++ b/assets/xml/objects/object_oE9.xml
@@ -3,7 +3,8 @@
-
+
+
diff --git a/assets/xml/objects/object_ossan.xml b/assets/xml/objects/object_ossan.xml
index 963053f3f4..7e51c33bce 100644
--- a/assets/xml/objects/object_ossan.xml
+++ b/assets/xml/objects/object_ossan.xml
@@ -1,6 +1,9 @@
+
+
+
diff --git a/assets/xml/objects/object_owl.xml b/assets/xml/objects/object_owl.xml
index 24be378985..4ea2006678 100644
--- a/assets/xml/objects/object_owl.xml
+++ b/assets/xml/objects/object_owl.xml
@@ -61,7 +61,7 @@
-
+
diff --git a/assets/xml/objects/object_po_composer.xml b/assets/xml/objects/object_po_composer.xml
index 2ab8d64d85..17c04fd18b 100644
--- a/assets/xml/objects/object_po_composer.xml
+++ b/assets/xml/objects/object_po_composer.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_po_field.xml b/assets/xml/objects/object_po_field.xml
index 10b402e2c7..43e1066e3b 100644
--- a/assets/xml/objects/object_po_field.xml
+++ b/assets/xml/objects/object_po_field.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_poh.xml b/assets/xml/objects/object_poh.xml
index 009d0fca3f..33517945e8 100644
--- a/assets/xml/objects/object_poh.xml
+++ b/assets/xml/objects/object_poh.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_ps.xml b/assets/xml/objects/object_ps.xml
index 043e232d64..98f548db1b 100644
--- a/assets/xml/objects/object_ps.xml
+++ b/assets/xml/objects/object_ps.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_rl.xml b/assets/xml/objects/object_rl.xml
index bbe0246ac8..8453935b1f 100644
--- a/assets/xml/objects/object_rl.xml
+++ b/assets/xml/objects/object_rl.xml
@@ -12,8 +12,6 @@
-
-
@@ -22,13 +20,12 @@
-
-
+
diff --git a/assets/xml/objects/object_sa.xml b/assets/xml/objects/object_sa.xml
index 8a63840409..e87cd793dd 100644
--- a/assets/xml/objects/object_sa.xml
+++ b/assets/xml/objects/object_sa.xml
@@ -66,7 +66,7 @@
-
+
diff --git a/assets/xml/objects/object_sb.xml b/assets/xml/objects/object_sb.xml
index 64d3bb005a..57a0f7f8f7 100644
--- a/assets/xml/objects/object_sb.xml
+++ b/assets/xml/objects/object_sb.xml
@@ -1,11 +1,13 @@
+
-
-
+
+
+
diff --git a/assets/xml/objects/object_siofuki.xml b/assets/xml/objects/object_siofuki.xml
index a23240a728..f8a9e50d83 100644
--- a/assets/xml/objects/object_siofuki.xml
+++ b/assets/xml/objects/object_siofuki.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_skb.xml b/assets/xml/objects/object_skb.xml
index 5b5efb4848..1220ddf6d9 100644
--- a/assets/xml/objects/object_skb.xml
+++ b/assets/xml/objects/object_skb.xml
@@ -55,10 +55,15 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_skj.xml b/assets/xml/objects/object_skj.xml
index 38636256fe..958301d2e8 100644
--- a/assets/xml/objects/object_skj.xml
+++ b/assets/xml/objects/object_skj.xml
@@ -41,27 +41,25 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_spot02_objects.xml b/assets/xml/objects/object_spot02_objects.xml
index 65f45ff515..3dfaf227d3 100644
--- a/assets/xml/objects/object_spot02_objects.xml
+++ b/assets/xml/objects/object_spot02_objects.xml
@@ -3,7 +3,6 @@
-
diff --git a/assets/xml/objects/object_spot17_obj.xml b/assets/xml/objects/object_spot17_obj.xml
index d4239d8d28..73a4ca5203 100644
--- a/assets/xml/objects/object_spot17_obj.xml
+++ b/assets/xml/objects/object_spot17_obj.xml
@@ -7,6 +7,6 @@
-
+
diff --git a/assets/xml/objects/object_sst.xml b/assets/xml/objects/object_sst.xml
index c142c50f43..66cf6c8e02 100644
--- a/assets/xml/objects/object_sst.xml
+++ b/assets/xml/objects/object_sst.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_sst_pal.xml b/assets/xml/objects/object_sst_pal.xml
index 9a9199b58f..138a320324 100644
--- a/assets/xml/objects/object_sst_pal.xml
+++ b/assets/xml/objects/object_sst_pal.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_st.xml b/assets/xml/objects/object_st.xml
index 983b9e2eab..e374b4cb4a 100644
--- a/assets/xml/objects/object_st.xml
+++ b/assets/xml/objects/object_st.xml
@@ -1,4 +1,5 @@
+
@@ -22,7 +23,9 @@
-
+
+
+
diff --git a/assets/xml/objects/object_stream.xml b/assets/xml/objects/object_stream.xml
index 59b0838e47..6c65f77c34 100644
--- a/assets/xml/objects/object_stream.xml
+++ b/assets/xml/objects/object_stream.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_syokudai.xml b/assets/xml/objects/object_syokudai.xml
index 11af7e9a3a..6434d923a5 100644
--- a/assets/xml/objects/object_syokudai.xml
+++ b/assets/xml/objects/object_syokudai.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_ta.xml b/assets/xml/objects/object_ta.xml
index 5e446bf5c9..4f339fc951 100644
--- a/assets/xml/objects/object_ta.xml
+++ b/assets/xml/objects/object_ta.xml
@@ -66,7 +66,6 @@
-
-
+
diff --git a/assets/xml/objects/object_tk.xml b/assets/xml/objects/object_tk.xml
index 5b2fd13806..5c9d0a0a6f 100644
--- a/assets/xml/objects/object_tk.xml
+++ b/assets/xml/objects/object_tk.xml
@@ -4,10 +4,12 @@
+
-
+
+
diff --git a/assets/xml/objects/object_toki_objects.xml b/assets/xml/objects/object_toki_objects.xml
index cd07e60d2b..917d239347 100644
--- a/assets/xml/objects/object_toki_objects.xml
+++ b/assets/xml/objects/object_toki_objects.xml
@@ -1,4 +1,5 @@
+
@@ -12,7 +13,8 @@
-
+
+
diff --git a/assets/xml/objects/object_tr.xml b/assets/xml/objects/object_tr.xml
index 986a88cc5c..827b85bfe6 100644
--- a/assets/xml/objects/object_tr.xml
+++ b/assets/xml/objects/object_tr.xml
@@ -9,7 +9,9 @@
-
+
+
+
@@ -97,7 +99,9 @@
-
+
+
+
diff --git a/assets/xml/objects/object_trap.xml b/assets/xml/objects/object_trap.xml
index 56195cf41b..1f8f4b5310 100644
--- a/assets/xml/objects/object_trap.xml
+++ b/assets/xml/objects/object_trap.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_tw.xml b/assets/xml/objects/object_tw.xml
index c6b9ec6099..c528fb4518 100644
--- a/assets/xml/objects/object_tw.xml
+++ b/assets/xml/objects/object_tw.xml
@@ -106,9 +106,11 @@
-
-
+
+
+
+
@@ -130,9 +132,11 @@
-
-
+
+
+
+
diff --git a/assets/xml/objects/object_wf.xml b/assets/xml/objects/object_wf.xml
index 96ea841032..d5d70639d7 100644
--- a/assets/xml/objects/object_wf.xml
+++ b/assets/xml/objects/object_wf.xml
@@ -122,6 +122,7 @@
+
diff --git a/assets/xml/objects/object_wood02.xml b/assets/xml/objects/object_wood02.xml
index 5dd80a17b6..dcf6d21291 100644
--- a/assets/xml/objects/object_wood02.xml
+++ b/assets/xml/objects/object_wood02.xml
@@ -1,5 +1,5 @@
-
+
@@ -20,7 +20,7 @@
-
+
diff --git a/assets/xml/objects/object_ydan_objects.xml b/assets/xml/objects/object_ydan_objects.xml
index baf7ca4c9c..70174a1e70 100644
--- a/assets/xml/objects/object_ydan_objects.xml
+++ b/assets/xml/objects/object_ydan_objects.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_zf.xml b/assets/xml/objects/object_zf.xml
index 7f20eb7866..74e9d45915 100644
--- a/assets/xml/objects/object_zf.xml
+++ b/assets/xml/objects/object_zf.xml
@@ -1,4 +1,5 @@
+
@@ -109,7 +110,7 @@
-
+
diff --git a/assets/xml/objects/object_zl2.xml b/assets/xml/objects/object_zl2.xml
index 9af0a65270..2503b811d3 100644
--- a/assets/xml/objects/object_zl2.xml
+++ b/assets/xml/objects/object_zl2.xml
@@ -38,5 +38,7 @@
+
+
diff --git a/assets/xml/objects/object_zl4.xml b/assets/xml/objects/object_zl4.xml
index e87a654656..99cc12ea2a 100644
--- a/assets/xml/objects/object_zl4.xml
+++ b/assets/xml/objects/object_zl4.xml
@@ -39,19 +39,21 @@
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_zo.xml b/assets/xml/objects/object_zo.xml
index 77465760ef..8872cc4c9f 100644
--- a/assets/xml/objects/object_zo.xml
+++ b/assets/xml/objects/object_zo.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Boss_Ganon.xml b/assets/xml/overlays/ovl_Boss_Ganon.xml
index a6ed9c66eb..d09648d8d7 100644
--- a/assets/xml/overlays/ovl_Boss_Ganon.xml
+++ b/assets/xml/overlays/ovl_Boss_Ganon.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Boss_Ganon2.xml b/assets/xml/overlays/ovl_Boss_Ganon2.xml
index 00f985786c..b922003dfa 100644
--- a/assets/xml/overlays/ovl_Boss_Ganon2.xml
+++ b/assets/xml/overlays/ovl_Boss_Ganon2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_En_Jsjutan.xml b/assets/xml/overlays/ovl_En_Jsjutan.xml
index b3b012b1f5..13bbd82199 100644
--- a/assets/xml/overlays/ovl_En_Jsjutan.xml
+++ b/assets/xml/overlays/ovl_En_Jsjutan.xml
@@ -16,9 +16,6 @@
-
-
-
diff --git a/assets/xml/overlays/ovl_Magic_Dark.xml b/assets/xml/overlays/ovl_Magic_Dark.xml
index 965d140db4..37165cebc2 100644
--- a/assets/xml/overlays/ovl_Magic_Dark.xml
+++ b/assets/xml/overlays/ovl_Magic_Dark.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Oceff_Storm.xml b/assets/xml/overlays/ovl_Oceff_Storm.xml
index 385f56dbff..d9e1f7e65a 100644
--- a/assets/xml/overlays/ovl_Oceff_Storm.xml
+++ b/assets/xml/overlays/ovl_Oceff_Storm.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Oceff_Wipe4.xml b/assets/xml/overlays/ovl_Oceff_Wipe4.xml
index 6446beedb2..a4ec2c5def 100644
--- a/assets/xml/overlays/ovl_Oceff_Wipe4.xml
+++ b/assets/xml/overlays/ovl_Oceff_Wipe4.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/dungeons/MIZUsin.xml b/assets/xml/scenes/dungeons/MIZUsin.xml
index e48f534d88..12a124cf09 100644
--- a/assets/xml/scenes/dungeons/MIZUsin.xml
+++ b/assets/xml/scenes/dungeons/MIZUsin.xml
@@ -7,6 +7,7 @@
+
diff --git a/assets/xml/scenes/dungeons/MIZUsin_mq.xml b/assets/xml/scenes/dungeons/MIZUsin_mq.xml
index bd0e260ace..cbbe48287e 100644
--- a/assets/xml/scenes/dungeons/MIZUsin_mq.xml
+++ b/assets/xml/scenes/dungeons/MIZUsin_mq.xml
@@ -7,6 +7,7 @@
+
diff --git a/assets/xml/scenes/dungeons/ddan.xml b/assets/xml/scenes/dungeons/ddan.xml
index a42e97cfc9..295f651739 100644
--- a/assets/xml/scenes/dungeons/ddan.xml
+++ b/assets/xml/scenes/dungeons/ddan.xml
@@ -1,5 +1,6 @@
+
@@ -18,6 +19,7 @@
+
diff --git a/assets/xml/scenes/dungeons/ddan_mq.xml b/assets/xml/scenes/dungeons/ddan_mq.xml
index a42e97cfc9..295f651739 100644
--- a/assets/xml/scenes/dungeons/ddan_mq.xml
+++ b/assets/xml/scenes/dungeons/ddan_mq.xml
@@ -1,5 +1,6 @@
+
@@ -18,6 +19,7 @@
+
diff --git a/assets/xml/scenes/dungeons/ganon_boss.xml b/assets/xml/scenes/dungeons/ganon_boss.xml
index c75914c29c..7c28b472d6 100644
--- a/assets/xml/scenes/dungeons/ganon_boss.xml
+++ b/assets/xml/scenes/dungeons/ganon_boss.xml
@@ -1,6 +1,9 @@
+
+
+
diff --git a/assets/xml/scenes/indoors/tokinoma.xml b/assets/xml/scenes/indoors/tokinoma.xml
index 4d83fe3908..fb62d9c2cc 100644
--- a/assets/xml/scenes/indoors/tokinoma.xml
+++ b/assets/xml/scenes/indoors/tokinoma.xml
@@ -1,5 +1,6 @@
+
@@ -12,7 +13,6 @@
-
diff --git a/assets/xml/scenes/indoors/tokinoma_pal_n64.xml b/assets/xml/scenes/indoors/tokinoma_pal_n64.xml
index eb98a321af..9c0a970998 100644
--- a/assets/xml/scenes/indoors/tokinoma_pal_n64.xml
+++ b/assets/xml/scenes/indoors/tokinoma_pal_n64.xml
@@ -1,5 +1,6 @@
+
diff --git a/assets/xml/scenes/overworld/spot20.xml b/assets/xml/scenes/overworld/spot20.xml
index 3d305508ad..d3dd77a41e 100644
--- a/assets/xml/scenes/overworld/spot20.xml
+++ b/assets/xml/scenes/overworld/spot20.xml
@@ -1,5 +1,6 @@
+
diff --git a/assets/xml/scenes/overworld/spot20_pal.xml b/assets/xml/scenes/overworld/spot20_pal.xml
index 0ba9380e13..297b1c316e 100644
--- a/assets/xml/scenes/overworld/spot20_pal.xml
+++ b/assets/xml/scenes/overworld/spot20_pal.xml
@@ -1,5 +1,6 @@
+
diff --git a/assets/xml/textures/map_48x85_static.xml b/assets/xml/textures/map_48x85_static.xml
index 2788498a84..b8795bd07d 100644
--- a/assets/xml/textures/map_48x85_static.xml
+++ b/assets/xml/textures/map_48x85_static.xml
@@ -1,72 +1,74 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/baseroms/gc-eu-mq-dbg/config.yml b/baseroms/gc-eu-mq-dbg/config.yml
index 09abaaf67a..e457028060 100644
--- a/baseroms/gc-eu-mq-dbg/config.yml
+++ b/baseroms/gc-eu-mq-dbg/config.yml
@@ -50,7 +50,7 @@ incbins:
vram: 0x80157D30
size: 0x60
variables:
- gMtxClear: 0x8012DB20
+ gIdentityMtx: 0x8012DB20
sNesMessageEntryTable: 0x8014B320
sGerMessageEntryTable: 0x8014F548
sFraMessageEntryTable: 0x80151658
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0x10ED48
- end_offset: 0x10FF68
+ end_offset: 0x110038
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0x10E1D0
@@ -72,7 +72,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0x10E2A0
- end_offset: 0x10EC30
+ end_offset: 0x10ED28
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-eu-mq/config.yml b/baseroms/gc-eu-mq/config.yml
index 62925ab3b4..0093015d7e 100644
--- a/baseroms/gc-eu-mq/config.yml
+++ b/baseroms/gc-eu-mq/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x801130D0
size: 0x60
variables:
- gMtxClear: 0x800FBC00
+ gIdentityMtx: 0x800FBC00
sNesMessageEntryTable: 0x801077F0
sGerMessageEntryTable: 0x8010BA18
sFraMessageEntryTable: 0x8010DB28
@@ -56,7 +56,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE90A8
- end_offset: 0xEA2C8
+ end_offset: 0xEA398
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8530
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8600
- end_offset: 0xE8F90
+ end_offset: 0xE9088
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-eu/config.yml b/baseroms/gc-eu/config.yml
index 278badfb80..9aef9891f9 100644
--- a/baseroms/gc-eu/config.yml
+++ b/baseroms/gc-eu/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x801130F0
size: 0x60
variables:
- gMtxClear: 0x800FBC20
+ gIdentityMtx: 0x800FBC20
sNesMessageEntryTable: 0x80107810
sGerMessageEntryTable: 0x8010BA38
sFraMessageEntryTable: 0x8010DB48
@@ -56,7 +56,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE90C8
- end_offset: 0xEA2E8
+ end_offset: 0xEA3B8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8550
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8620
- end_offset: 0xE8FB0
+ end_offset: 0xE90A8
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-jp-ce/config.yml b/baseroms/gc-jp-ce/config.yml
index f73344d892..f3c0541a62 100644
--- a/baseroms/gc-jp-ce/config.yml
+++ b/baseroms/gc-jp-ce/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x801158E0
size: 0x60
variables:
- gMtxClear: 0x800FE2A0
+ gIdentityMtx: 0x800FE2A0
sJpnMessageEntryTable: 0x80109E8C
sNesMessageEntryTable: 0x8010DFCC
sStaffMessageEntryTable: 0x801121EC
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB768
- end_offset: 0xEC988
+ end_offset: 0xECA58
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABF0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACC0
- end_offset: 0xEB650
+ end_offset: 0xEB748
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-jp-mq/config.yml b/baseroms/gc-jp-mq/config.yml
index 81927277bd..41d1721f3d 100644
--- a/baseroms/gc-jp-mq/config.yml
+++ b/baseroms/gc-jp-mq/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x801158E0
size: 0x60
variables:
- gMtxClear: 0x800FE2A0
+ gIdentityMtx: 0x800FE2A0
sJpnMessageEntryTable: 0x80109E8C
sNesMessageEntryTable: 0x8010DFCC
sStaffMessageEntryTable: 0x801121EC
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB768
- end_offset: 0xEC988
+ end_offset: 0xECA58
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABF0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACC0
- end_offset: 0xEB650
+ end_offset: 0xEB748
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-jp/config.yml b/baseroms/gc-jp/config.yml
index 26e407d8c4..73285664c6 100644
--- a/baseroms/gc-jp/config.yml
+++ b/baseroms/gc-jp/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x80115900
size: 0x60
variables:
- gMtxClear: 0x800FE2C0
+ gIdentityMtx: 0x800FE2C0
sJpnMessageEntryTable: 0x80109EAC
sNesMessageEntryTable: 0x8010DFEC
sStaffMessageEntryTable: 0x8011220C
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB788
- end_offset: 0xEC9A8
+ end_offset: 0xECA78
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEAC10
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACE0
- end_offset: 0xEB670
+ end_offset: 0xEB768
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-us-mq/config.yml b/baseroms/gc-us-mq/config.yml
index 77f12ba8bd..1057e49b2e 100644
--- a/baseroms/gc-us-mq/config.yml
+++ b/baseroms/gc-us-mq/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x801158C0
size: 0x60
variables:
- gMtxClear: 0x800FE280
+ gIdentityMtx: 0x800FE280
sJpnMessageEntryTable: 0x80109E6C
sNesMessageEntryTable: 0x8010DFAC
sStaffMessageEntryTable: 0x801121CC
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB748
- end_offset: 0xEC968
+ end_offset: 0xECA38
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABD0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACA0
- end_offset: 0xEB630
+ end_offset: 0xEB728
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-us/config.yml b/baseroms/gc-us/config.yml
index c53cd1841a..620d550631 100644
--- a/baseroms/gc-us/config.yml
+++ b/baseroms/gc-us/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x801158E0
size: 0x60
variables:
- gMtxClear: 0x800FE2A0
+ gIdentityMtx: 0x800FE2A0
sJpnMessageEntryTable: 0x80109E8C
sNesMessageEntryTable: 0x8010DFCC
sStaffMessageEntryTable: 0x801121EC
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB768
- end_offset: 0xEC988
+ end_offset: 0xECA58
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABF0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACC0
- end_offset: 0xEB650
+ end_offset: 0xEB748
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/ique-cn/checksum.md5 b/baseroms/ique-cn/checksum.md5
index 82dfff85bf..6390fc95b9 100644
--- a/baseroms/ique-cn/checksum.md5
+++ b/baseroms/ique-cn/checksum.md5
@@ -1 +1 @@
-17a9f30d722c29e6912bd4b66713d2b0 build/ique-cn/oot-ique-cn.z64
+0238288a8e7c53b558b818865daf6ef3 build/ique-cn/oot-ique-cn.z64
diff --git a/baseroms/ique-cn/config.yml b/baseroms/ique-cn/config.yml
index bcc6ca5b0c..6236b0cf51 100644
--- a/baseroms/ique-cn/config.yml
+++ b/baseroms/ique-cn/config.yml
@@ -42,7 +42,7 @@ incbins:
vram: 0x80121EE0
size: 0x60
variables:
- gMtxClear: 0x80106980
+ gIdentityMtx: 0x80106980
sJpnMessageEntryTable: 0x80115838
sNesMessageEntryTable: 0x80119978
sStaffMessageEntryTable: 0x8011DB98
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEBD88
- end_offset: 0xECFA8
+ end_offset: 0xED078
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB210
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB2E0
- end_offset: 0xEBC70
+ end_offset: 0xEBD68
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/ntsc-1.0/config.yml b/baseroms/ntsc-1.0/config.yml
index 2bdf99411a..948bbd179a 100644
--- a/baseroms/ntsc-1.0/config.yml
+++ b/baseroms/ntsc-1.0/config.yml
@@ -45,7 +45,7 @@ incbins:
vram: 0x80114D70
size: 0x60
variables:
- gMtxClear: 0x800FEDB0
+ gIdentityMtx: 0x800FEDB0
sJpnMessageEntryTable: 0x8010A94C
sNesMessageEntryTable: 0x8010EA8C
sStaffMessageEntryTable: 0x80112CAC
@@ -58,7 +58,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEC0A8
- end_offset: 0xED2C8
+ end_offset: 0xED398
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB530
@@ -66,7 +66,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB600
- end_offset: 0xEBF90
+ end_offset: 0xEC088
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC160
diff --git a/baseroms/ntsc-1.1/config.yml b/baseroms/ntsc-1.1/config.yml
index 1b110a84c8..2317ae2dac 100644
--- a/baseroms/ntsc-1.1/config.yml
+++ b/baseroms/ntsc-1.1/config.yml
@@ -45,7 +45,7 @@ incbins:
vram: 0x80114F30
size: 0x60
variables:
- gMtxClear: 0x800FEF70
+ gIdentityMtx: 0x800FEF70
sJpnMessageEntryTable: 0x8010AB0C
sNesMessageEntryTable: 0x8010EC4C
sStaffMessageEntryTable: 0x80112E6C
@@ -58,7 +58,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEC268
- end_offset: 0xED488
+ end_offset: 0xED558
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB6F0
@@ -66,7 +66,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB7C0
- end_offset: 0xEC150
+ end_offset: 0xEC248
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC140
diff --git a/baseroms/ntsc-1.2/config.yml b/baseroms/ntsc-1.2/config.yml
index a631ca5511..6fc7896db0 100644
--- a/baseroms/ntsc-1.2/config.yml
+++ b/baseroms/ntsc-1.2/config.yml
@@ -45,7 +45,7 @@ incbins:
vram: 0x80115420
size: 0x60
variables:
- gMtxClear: 0x800FF3F0
+ gIdentityMtx: 0x800FF3F0
sJpnMessageEntryTable: 0x8010AFFC
sNesMessageEntryTable: 0x8010F13C
sStaffMessageEntryTable: 0x8011335C
@@ -58,7 +58,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEC0B8
- end_offset: 0xED2D8
+ end_offset: 0xED3A8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB540
@@ -66,7 +66,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB610
- end_offset: 0xEBFA0
+ end_offset: 0xEC098
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC120
diff --git a/baseroms/pal-1.0/config.yml b/baseroms/pal-1.0/config.yml
index a8ea60b79d..37ffb7500b 100644
--- a/baseroms/pal-1.0/config.yml
+++ b/baseroms/pal-1.0/config.yml
@@ -50,7 +50,7 @@ incbins:
vram: 0x80112B70
size: 0x60
variables:
- gMtxClear: 0x800FCD00
+ gIdentityMtx: 0x800FCD00
sNesMessageEntryTable: 0x801088BC
sGerMessageEntryTable: 0x8010CAE4
sFraMessageEntryTable: 0x8010EBF4
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE99C8
- end_offset: 0xEABE8
+ end_offset: 0xEACB8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8E50
@@ -72,7 +72,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8F20
- end_offset: 0xE98B0
+ end_offset: 0xE99A8
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC0E0
diff --git a/baseroms/pal-1.1/config.yml b/baseroms/pal-1.1/config.yml
index 4811f1cb93..45bf82b877 100644
--- a/baseroms/pal-1.1/config.yml
+++ b/baseroms/pal-1.1/config.yml
@@ -50,7 +50,7 @@ incbins:
vram: 0x80112BB0
size: 0x60
variables:
- gMtxClear: 0x800FCD40
+ gIdentityMtx: 0x800FCD40
sNesMessageEntryTable: 0x801088FC
sGerMessageEntryTable: 0x8010CB24
sFraMessageEntryTable: 0x8010EC34
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE9A08
- end_offset: 0xEAC28
+ end_offset: 0xEACF8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8E90
@@ -72,7 +72,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8F60
- end_offset: 0xE98F0
+ end_offset: 0xE99E8
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC0E0
diff --git a/docs/BUILDING_MACOS.md b/docs/BUILDING_MACOS.md
index d34035fcec..8d2f67458e 100644
--- a/docs/BUILDING_MACOS.md
+++ b/docs/BUILDING_MACOS.md
@@ -55,12 +55,12 @@ cd build-binutils
Configure the build
```bash
-../binutils-2.35/configure --target=mips-linux-gnu --prefix=/opt/cross --disable-gprof --disable-gdb --disable-werror
+../binutils-2.35/configure --target=mips-linux-gnu --prefix=/opt/cross --with-system-zlib --disable-gprof --disable-gdb --disable-werror
```
Make and install binutils
```bash
-make -j
+make -j$(nproc)
sudo make install
```
@@ -82,3 +82,44 @@ If this worked, you can now delete the temporary directory `~/binutils-tmp`.
Apple's version of `make` is very out-of-date, so you should use the brew-installed `gmake` in place of `make` in this repo from now on.
You should now be able to continue from [step 2](../README.md#2-clone-the-repository) of the Linux instructions.
+
+
+## 4. Building GCC (optional)
+
+If you'd like to compile with GCC instead of IDO (e.g. for modding), you can build it from source similarly to how we built binutils:
+
+Install dependences
+```bash
+brew install gcc@14 gmp isl libmpc mpfr
+```
+
+Create and enter local working dir
+```bash
+mkdir ~/gcc-tmp
+cd ~/gcc-tmp
+```
+
+Get and extract gcc source
+```bash
+curl -O https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz
+tar xvf gcc-14.2.0.tar.xz
+```
+
+Create and enter a build directory
+```bash
+mkdir build-gcc
+cd build-gcc
+```
+
+Configure the build
+```bash
+CC=gcc-14 CXX=g++-14 ../gcc-14.2.0/configure --target=mips-linux-gnu --prefix=/opt/cross --disable-nls --enable-languages=c --with-gmp=$(brew --prefix)/opt/gmp --with-mpfr=$(brew --prefix)/opt/mpfr --with-mpc=$(brew --prefix)/opt/libmpc --with-isl=$(brew --prefix)/opt/isl
+```
+
+Make and install gcc
+```bash
+CC=gcc-14 CXX=g++-14 make all-gcc -j$(nproc)
+sudo make install-gcc
+```
+
+If this worked, you can now delete the temporary directory `~/gcc-tmp`.
diff --git a/docs/assets/extraction.md b/docs/assets/extraction.md
new file mode 100644
index 0000000000..a4c342db3b
--- /dev/null
+++ b/docs/assets/extraction.md
@@ -0,0 +1,18 @@
+Assets are not committed to the repo; instead, they are extracted from the ROM files as part of `make setup`.
+
+Assets are extracted to `extracted/VERSION/assets` (for example `extracted/ntsc-1.0/assets` for the `ntsc-1.0` version), based on the descriptions stored in xml files in `assets/xml/`.
+
+For details on the xml files contents, see [the assets xml specification file](../../tools/assets/descriptor/spec.md).
+
+The extraction tool can use [rich](https://github.com/Textualize/rich) if installed to make output prettier.
+If you are looking at output or errors from during extraction, consider installing rich for a better experience: `.venv/bin/python3 -m pip install rich`
+
+To run the extraction outside of `make setup`, use `./tools/extract_assets.sh VERSION`.
+- Pass `-f` to force extraction: otherwise only assets for which xmls were modified will be extracted.
+- Pass `-j` to use multiprocessing, making extraction quicker. Note that this makes for less readable errors if any error happens.
+- Pass `-s name` to extract assets using baserom file `name`.
+- Pass `-r -s 'name.*'` to extract assets using baserom files whose name match regular expression `name.*`.
+
+There currently are various hacks in place in the extraction tool source code to make extraction of some corner cases possible, or to silence extraction warnings.
+Some of these hacks check for the name of resources, so renaming a few specific resources may need updating the extraction tool's source too.
+The plan is to eventually remove those hardcoded checks from the source and use a `HackMode` attribute in the xmls to trigger the hacks code paths.
diff --git a/docs/assets/images.md b/docs/assets/images.md
new file mode 100644
index 0000000000..e35e16201a
--- /dev/null
+++ b/docs/assets/images.md
@@ -0,0 +1,72 @@
+# Images
+
+Images in the rom are in N64 image formats.
+On extraction, they are converted to png and written to `extracted/VERSION/`.
+On build, they are converted back to N64 formats and written as C arrays to `.inc.c` files in `build/VERSION/`.
+
+The build system will also pick up images in `assets/`, allowing modders to add or even [replace](#replacing-images) images.
+
+PNG files have suffixes indicating how they are to be converted. For example, a `gDekuStickTex.i8.png` file will be converted to `i8`.
+
+The valid formats are `rgba32`, `rgba16`, `i4`, `i8`, `ia4`, `ia8`, `ia16`, `ci4` and `ci8`.
+
+An optional suffix can be used to indicate the element type of the C array written out, for example `.u32` in `gHylianMan1ShirtTex.i8.u32.png`. The valid array element types are `u64` and `u32`. If omitted, the element type defaults to `u64`. `u32` is only used for unaligned textures.
+
+The tool implementing png->n64 conversion is [build_from_png](../../tools/assets/build_from_png/build_from_png.c), using [n64texconv](../../tools/assets/n64texconv/) as its backbone.
+
+# Replacing images
+
+The contents of `extracted/` are meant to hold the baserom assets and should not be modified. Instead, replacing an image can be done by creating a png file at the same relative path under `assets/` as the image to replace.
+
+For example, replacing `gLinkHairTex` (`extracted/VERSION/assets/objects/gameplay_keep/gLinkHairTex.rgba16.png`) with the texture for `gHylianMan1BeardedEyeOpenTex` (`extracted/VERSION/assets/objects/object_ahg/gHylianMan1BeardedEyeOpenTex.ci8.tlut_gHylianMan1TLUT_u32.u32.png`):
+
+```sh
+# for VERSION=gc-eu-mq-dbg
+
+mkdir -p assets/objects/gameplay_keep/
+cp \
+ extracted/gc-eu-mq-dbg/assets/objects/object_ahg/gHylianMan1BeardedEyeOpenTex.ci8.tlut_gHylianMan1TLUT_u32.u32.png \
+ assets/objects/gameplay_keep/gLinkHairTex.rgba16.png
+
+# Cause make to rebuild gameplay_keep, where gLinkHairTex is
+touch extracted/gc-eu-mq-dbg/assets/objects/gameplay_keep/gameplay_keep.c
+
+make VERSION=gc-eu-mq-dbg
+```
+
+# CI images
+
+CI (Color Indexed) images also have a palette or TLUT (Texture Look-Up Table).
+
+PNG images to be converted to CI formats may have a `.tlut_gNameTLUT[_]` suffix indicating the name and element type (optional, defaults to u64) of the TLUT `gNameTLUT.tlut.rgba16[.].inc.c` file to write the palette to.
+
+If this suffix is omitted, the TLUT will be written to a `gNameTex.tlut.rgba16.inc.c` file named after the CI image.
+
+For example without the `.tlut_` suffix, `gGanonHairFringeTex.ci8.png`:
+
+- extracted to `extracted/VERSION/assets/objects/object_ganon2/gGanonHairFringeTex.ci8.png`
+- texture written to `build/VERSION/assets/objects/object_ganon2/gGanonHairFringeTex.ci8.inc.c`
+- palette written to `build/VERSION/assets/objects/object_ganon2/gGanonHairFringeTex.tlut.rgba16.inc.c`
+
+For example with the `.tlut_` suffix, `gCowNoseTex.ci8.tlut_gCowTLUT.png`:
+
+- extracted to `extracted/gc-eu-mq-dbg/assets/objects/object_cow/gCowNoseTex.ci8.tlut_gCowTLUT.png`
+- texture written to `build/gc-eu-mq-dbg/assets/objects/object_cow/gCowNoseTex.ci8.tlut_gCowTLUT.inc.c`
+- palette written to `build/gc-eu-mq-dbg/assets/objects/object_cow/gCowTLUT.tlut.rgba16.bin`
+
+CI images with a `.tlut_` suffix have a shared palette: there are several CI images using the same palette.
+The build system (`build_from_png`) will find images sharing the same palette by looking at the `.tlut_` suffixes of png files in the same folder and in the corresponding `assets/` folder.
+
+In the matching case of shared palettes, all png files have the same palette, which is written out.
+Otherwise the images are automatically co-quantized and the resulting images and palette are written out.
+
+Note the N64 supports CI images with IA16 palettes instead of RGBA16 palettes, but OoT doesn't have such textures.
+For simplicity, CI images with IA16 palettes are not supported in the build system, and all CI images are assumed to use RGBA16 palettes.
+
+# Skybox textures
+
+Skybox textures, located in (`extracted/VERSION/`)`assets/textures/skyboxes`, are ci8 images with the additional specificity of being limited to a palette of 128 colors that can be loaded as either the first or last 128 colors of a 256-colors palette, depending on the skybox.
+
+The build system identifies such textures with the additional "sub-format" suffix `.split_lo` or `.split_hi` right after the `.ci8` suffix. `split_lo` corresponds to textures where the half palette is mapped to the lower half, and `split_hi` to the higher half.
+
+Like for regular ci images, images are automatically converted, quantized and written within those restrictions by the build system.
diff --git a/format.py b/format.py
index f95885344e..b0043075d5 100755
--- a/format.py
+++ b/format.py
@@ -154,12 +154,22 @@ def format_files(src_files: List[str], extra_files: List[str], nb_jobs: int):
def list_files_to_format():
- files = glob.glob("src/**/*.c", recursive=True)
+ files = (
+ glob.glob("src/**/*.c", recursive=True)
+ + glob.glob("assets/**/*.c", recursive=True)
+ )
extra_files = (
glob.glob("assets/**/*.xml", recursive=True)
+ glob.glob("include/**/*.h", recursive=True)
+ glob.glob("src/**/*.h", recursive=True)
+ + glob.glob("assets/**/*.h", recursive=True)
)
+
+ # Do not format assets/text/ files
+ for assets_text_f in glob.glob("assets/text/**/*.c", recursive=True):
+ if assets_text_f in files:
+ files.remove(assets_text_f)
+
return files, extra_files
diff --git a/include/array_count.h b/include/array_count.h
new file mode 100644
index 0000000000..9e5f6ed4ca
--- /dev/null
+++ b/include/array_count.h
@@ -0,0 +1,8 @@
+#ifndef ARRAY_COUNT_H
+#define ARRAY_COUNT_H
+
+#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
+#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
+#define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0]))
+
+#endif
diff --git a/include/audio/aseq.h b/include/audio/aseq.h
index 689c42664f..99df3248f7 100644
--- a/include/audio/aseq.h
+++ b/include/audio/aseq.h
@@ -52,7 +52,18 @@
#ifndef ASEQ_H
#define ASEQ_H
-#include "versions.h"
+/**
+ * MML Version
+ */
+
+#ifndef MML_VERSION
+ #error "MML version not defined, define MML_VERSION in the cpp invocation"
+#endif
+
+#define MML_VERSION_OOT 0
+#define MML_VERSION_MM 1
+
+
/**
* IO Ports
@@ -220,21 +231,190 @@
#define FONTANY_INSTR_ASM_NOISE 136
-
-#ifdef _LANGUAGE_ASEQ
-
/**
- * MML Version
+ * Command Opcode IDs
*/
-#ifndef MML_VERSION
- #error "MML version not defined, define MML_VERSION in the cpp invocation"
+// control flow commands
+#define ASEQ_OP_CONTROL_FLOW_FIRST 0xF2
+#define ASEQ_OP_RBLTZ 0xF2
+#define ASEQ_OP_RBEQZ 0xF3
+#define ASEQ_OP_RJUMP 0xF4
+#define ASEQ_OP_BGEZ 0xF5
+#define ASEQ_OP_BREAK 0xF6
+#define ASEQ_OP_LOOPEND 0xF7
+#define ASEQ_OP_LOOP 0xF8
+#define ASEQ_OP_BLTZ 0xF9
+#define ASEQ_OP_BEQZ 0xFA
+#define ASEQ_OP_JUMP 0xFB
+#define ASEQ_OP_CALL 0xFC
+#define ASEQ_OP_DELAY 0xFD
+#define ASEQ_OP_DELAY1 0xFE
+#define ASEQ_OP_END 0xFF
+
+// sequence commands
+#define ASEQ_OP_SEQ_TESTCHAN 0x00 // low nibble used as argument
+#define ASEQ_OP_SEQ_STOPCHAN 0x40 // low nibble used as argument
+#define ASEQ_OP_SEQ_SUBIO 0x50 // low nibble used as argument
+#define ASEQ_OP_SEQ_LDRES 0x60 // low nibble used as argument
+#define ASEQ_OP_SEQ_STIO 0x70 // low nibble used as argument
+#define ASEQ_OP_SEQ_LDIO 0x80 // low nibble used as argument
+#define ASEQ_OP_SEQ_LDCHAN 0x90 // low nibble used as argument
+#define ASEQ_OP_SEQ_RLDCHAN 0xA0 // low nibble used as argument
+#define ASEQ_OP_SEQ_LDSEQ 0xB0 // low nibble used as argument
+#if (MML_VERSION == MML_VERSION_MM)
+#define ASEQ_OP_SEQ_C2 0xC2
+#define ASEQ_OP_SEQ_C3 0xC3
+#endif
+#define ASEQ_OP_SEQ_RUNSEQ 0xC4
+#define ASEQ_OP_SEQ_SCRIPTCTR 0xC5
+#define ASEQ_OP_SEQ_STOP 0xC6
+#define ASEQ_OP_SEQ_STSEQ 0xC7
+#define ASEQ_OP_SEQ_SUB 0xC8
+#define ASEQ_OP_SEQ_AND 0xC9
+#define ASEQ_OP_SEQ_LDI 0xCC
+#define ASEQ_OP_SEQ_DYNCALL 0xCD
+#define ASEQ_OP_SEQ_RAND 0xCE
+#define ASEQ_OP_SEQ_NOTEALLOC 0xD0
+#define ASEQ_OP_SEQ_LDSHORTGATEARR 0xD1
+#define ASEQ_OP_SEQ_LDSHORTVELARR 0xD2
+#define ASEQ_OP_SEQ_MUTEBHV 0xD3
+#define ASEQ_OP_SEQ_MUTE 0xD4
+#define ASEQ_OP_SEQ_MUTESCALE 0xD5
+#define ASEQ_OP_SEQ_FREECHAN 0xD6
+#define ASEQ_OP_SEQ_INITCHAN 0xD7
+#define ASEQ_OP_SEQ_VOLSCALE 0xD9
+#define ASEQ_OP_SEQ_VOLMODE 0xDA
+#define ASEQ_OP_SEQ_VOL 0xDB
+#define ASEQ_OP_SEQ_TEMPOCHG 0xDC
+#define ASEQ_OP_SEQ_TEMPO 0xDD
+#define ASEQ_OP_SEQ_RTRANSPOSE 0xDE
+#define ASEQ_OP_SEQ_TRANSPOSE 0xDF
+#define ASEQ_OP_SEQ_EF 0xEF
+#define ASEQ_OP_SEQ_FREENOTELIST 0xF0
+#define ASEQ_OP_SEQ_ALLOCNOTELIST 0xF1
+
+// channel commands
+#define ASEQ_OP_CHAN_CDELAY 0x00 // low nibble used as argument
+#define ASEQ_OP_CHAN_LDSAMPLE 0x10 // low nibble used as argument
+#define ASEQ_OP_CHAN_LDCHAN 0x20 // low nibble used as argument
+#define ASEQ_OP_CHAN_STCIO 0x30 // low nibble used as argument
+#define ASEQ_OP_CHAN_LDCIO 0x40 // low nibble used as argument
+#define ASEQ_OP_CHAN_SUBIO 0x50 // low nibble used as argument
+#define ASEQ_OP_CHAN_LDIO 0x60 // low nibble used as argument
+#define ASEQ_OP_CHAN_STIO 0x70 // lower 3 bits used as argument
+#define ASEQ_OP_CHAN_RLDLAYER 0x78 // lower 3 bits used as argument
+#define ASEQ_OP_CHAN_TESTLAYER 0x80 // lower 3 bits used as argument
+#define ASEQ_OP_CHAN_LDLAYER 0x88 // lower 3 bits used as argument
+#define ASEQ_OP_CHAN_DELLAYER 0x90 // lower 3 bits used as argument
+#define ASEQ_OP_CHAN_DYNLDLAYER 0x98 // lower 3 bits used as argument
+#if (MML_VERSION == MML_VERSION_MM)
+#define ASEQ_OP_CHAN_A0 0xA0
+#define ASEQ_OP_CHAN_A1 0xA1
+#define ASEQ_OP_CHAN_A2 0xA2
+#define ASEQ_OP_CHAN_A3 0xA3
+#define ASEQ_OP_CHAN_A4 0xA4
+#define ASEQ_OP_CHAN_A5 0xA5
+#define ASEQ_OP_CHAN_A6 0xA6
+#define ASEQ_OP_CHAN_A7 0xA7
+#define ASEQ_OP_CHAN_RANDPTR 0xA8
+#endif
+#define ASEQ_OP_CHAN_LDFILTER 0xB0
+#define ASEQ_OP_CHAN_FREEFILTER 0xB1
+#define ASEQ_OP_CHAN_LDSEQTOPTR 0xB2
+#define ASEQ_OP_CHAN_FILTER 0xB3
+#define ASEQ_OP_CHAN_PTRTODYNTBL 0xB4
+#define ASEQ_OP_CHAN_DYNTBLTOPTR 0xB5
+#define ASEQ_OP_CHAN_DYNTBLV 0xB6
+#define ASEQ_OP_CHAN_RANDTOPTR 0xB7
+#define ASEQ_OP_CHAN_RAND 0xB8
+#define ASEQ_OP_CHAN_RANDVEL 0xB9
+#define ASEQ_OP_CHAN_RANDGATE 0xBA
+#define ASEQ_OP_CHAN_COMBFILTER 0xBB
+#define ASEQ_OP_CHAN_PTRADD 0xBC
+#if (MML_VERSION == MML_VERSION_OOT)
+#define ASEQ_OP_CHAN_RANDPTR 0xBD
+#endif
+#if (MML_VERSION == MML_VERSION_MM)
+#define ASEQ_OP_CHAN_SAMPLESTART 0xBD
+#define ASEQ_OP_CHAN_UNK_BE 0xBE
+#endif
+#define ASEQ_OP_CHAN_INSTR 0xC1
+#define ASEQ_OP_CHAN_DYNTBL 0xC2
+#define ASEQ_OP_CHAN_SHORT 0xC3
+#define ASEQ_OP_CHAN_NOSHORT 0xC4
+#define ASEQ_OP_CHAN_DYNTBLLOOKUP 0xC5
+#define ASEQ_OP_CHAN_FONT 0xC6
+#define ASEQ_OP_CHAN_STSEQ 0xC7
+#define ASEQ_OP_CHAN_SUB 0xC8
+#define ASEQ_OP_CHAN_AND 0xC9
+#define ASEQ_OP_CHAN_MUTEBHV 0xCA
+#define ASEQ_OP_CHAN_LDSEQ 0xCB
+#define ASEQ_OP_CHAN_LDI 0xCC
+#define ASEQ_OP_CHAN_STOPCHAN 0xCD
+#define ASEQ_OP_CHAN_LDPTR 0xCE
+#define ASEQ_OP_CHAN_STPTRTOSEQ 0xCF
+#define ASEQ_OP_CHAN_EFFECTS 0xD0
+#define ASEQ_OP_CHAN_NOTEALLOC 0xD1
+#define ASEQ_OP_CHAN_SUSTAIN 0xD2
+#define ASEQ_OP_CHAN_BEND 0xD3
+#define ASEQ_OP_CHAN_REVERB 0xD4
+#define ASEQ_OP_CHAN_VIBFREQ 0xD7
+#define ASEQ_OP_CHAN_VIBDEPTH 0xD8
+#define ASEQ_OP_CHAN_RELEASERATE 0xD9
+#define ASEQ_OP_CHAN_ENV 0xDA
+#define ASEQ_OP_CHAN_TRANSPOSE 0xDB
+#define ASEQ_OP_CHAN_PANWEIGHT 0xDC
+#define ASEQ_OP_CHAN_PAN 0xDD
+#define ASEQ_OP_CHAN_FREQSCALE 0xDE
+#define ASEQ_OP_CHAN_VOL 0xDF
+#define ASEQ_OP_CHAN_VOLEXP 0xE0
+#define ASEQ_OP_CHAN_VIBFREQGRAD 0xE1
+#define ASEQ_OP_CHAN_VIBDEPTHGRAD 0xE2
+#define ASEQ_OP_CHAN_VIBDELAY 0xE3
+#define ASEQ_OP_CHAN_DYNCALL 0xE4
+#define ASEQ_OP_CHAN_REVERBIDX 0xE5
+#define ASEQ_OP_CHAN_SAMPLEBOOK 0xE6
+#define ASEQ_OP_CHAN_LDPARAMS 0xE7
+#define ASEQ_OP_CHAN_PARAMS 0xE8
+#define ASEQ_OP_CHAN_NOTEPRI 0xE9
+#define ASEQ_OP_CHAN_STOP 0xEA
+#define ASEQ_OP_CHAN_FONTINSTR 0xEB
+#define ASEQ_OP_CHAN_VIBRESET 0xEC
+#define ASEQ_OP_CHAN_GAIN 0xED
+#define ASEQ_OP_CHAN_BENDFINE 0xEE
+#define ASEQ_OP_CHAN_FREENOTELIST 0xF0
+#define ASEQ_OP_CHAN_ALLOCNOTELIST 0xF1
+
+// layer commands
+#define ASEQ_OP_LAYER_NOTEDVG 0x00
+#define ASEQ_OP_LAYER_NOTEDV 0x40
+#define ASEQ_OP_LAYER_NOTEVG 0x80
+#define ASEQ_OP_LAYER_LDELAY 0xC0
+#define ASEQ_OP_LAYER_SHORTVEL 0xC1
+#define ASEQ_OP_LAYER_TRANSPOSE 0xC2
+#define ASEQ_OP_LAYER_SHORTDELAY 0xC3
+#define ASEQ_OP_LAYER_LEGATO 0xC4
+#define ASEQ_OP_LAYER_NOLEGATO 0xC5
+#define ASEQ_OP_LAYER_INSTR 0xC6
+#define ASEQ_OP_LAYER_PORTAMENTO 0xC7
+#define ASEQ_OP_LAYER_NOPORTAMENTO 0xC8
+#define ASEQ_OP_LAYER_SHORTGATE 0xC9
+#define ASEQ_OP_LAYER_NOTEPAN 0xCA
+#define ASEQ_OP_LAYER_ENV 0xCB
+#define ASEQ_OP_LAYER_NODRUMPAN 0xCC
+#define ASEQ_OP_LAYER_STEREO 0xCD
+#define ASEQ_OP_LAYER_BENDFINE 0xCE
+#define ASEQ_OP_LAYER_RELEASERATE 0xCF
+#define ASEQ_OP_LAYER_LDSHORTVEL 0xD0 // low nibble used as an argument
+#define ASEQ_OP_LAYER_LDSHORTGATE 0xE0 // low nibble used as an argument
+#if (MML_VERSION == MML_VERSION_MM)
+#define ASEQ_OP_LAYER_F0 0xF0
+#define ASEQ_OP_LAYER_F1 0xF1
#endif
-#define MML_VERSION_OOT 0
-#define MML_VERSION_MM 1
-
+#ifdef _LANGUAGE_ASEQ
/**
* IDENT
@@ -391,7 +571,7 @@ _RESET_SECTION
/* `ldseq` changes structure based on current section. */
.purgem ldseq
.macro ldseq ioPortNum, seqId, label
- _wr_cmd_id ldseq, 0xB0,,,,,,,, \ioPortNum, 4
+ _wr_cmd_id ldseq, ASEQ_OP_SEQ_LDSEQ,,,,,,,, \ioPortNum, 4
_wr_u8 \seqId
_wr_lbl \label
.endm
@@ -409,7 +589,7 @@ _RESET_SECTION
/* `ldseq` changes structure based on current section. */
.purgem ldseq
.macro ldseq label
- _wr_cmd_id ldseq, ,0xCB,,,,,,, 0, 0
+ _wr_cmd_id ldseq, ,ASEQ_OP_CHAN_LDSEQ,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -419,14 +599,14 @@ _RESET_SECTION
_check_arg_bitwidth_u \lowpassCutoff, 4
_check_arg_bitwidth_u \highpassCutoff, 4
- _wr_cmd_id filter, ,0xB3,,,,,,, 0, 0
+ _wr_cmd_id filter, ,ASEQ_OP_CHAN_FILTER,,,,,,, 0, 0
_wr_u8 (\lowpassCutoff << 4) | (\highpassCutoff)
.endm
/* `env` changes structure based on current section. */
.purgem env
.macro env label
- _wr_cmd_id env, ,0xDA,,,,,,, 0, 0
+ _wr_cmd_id env, ,ASEQ_OP_CHAN_ENV,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -443,7 +623,7 @@ _RESET_SECTION
/* `env` changes structure based on current section. */
.purgem env
.macro env label, arg
- _wr_cmd_id env, ,,0xCB,,,,,, 0, 0
+ _wr_cmd_id env, ,,ASEQ_OP_LAYER_ENV,,,,,, 0, 0
_wr_lbl \label
_wr_u8 \arg
.endm
@@ -561,6 +741,7 @@ _RESET_SECTION
/* Write the sequence name into a special .note.name section */
.pushsection .note.name, "", @note
.asciz "\name"
+ .balign 4
.popsection
/* Reset section and write start symbol. */
@@ -646,7 +827,7 @@ _RESET_SECTION
.macro _wr_s16 value
/* Ensure the provided arg value fits in 16 bits (signed) */
_check_arg_bitwidth_s \value, 16
- _wr16 \value
+ _wr16 \value & 0xFFFF
.endm
.macro _wr_u16 value
@@ -734,7 +915,7 @@ $reladdr\@:
* closed, so are its layers.
*/
.macro end
- _wr_cmd_id end, 0xFF,0xFF,0xFF,,,,,, 0, 0
+ _wr_cmd_id end, ASEQ_OP_END,ASEQ_OP_END,ASEQ_OP_END,,,,,, 0, 0
.endm
/**
@@ -743,7 +924,7 @@ $reladdr\@:
* Delays for one tick.
*/
.macro delay1
- _wr_cmd_id delay1, 0xFE,0xFE,,,,,,, 0, 0
+ _wr_cmd_id delay1, ASEQ_OP_DELAY1,ASEQ_OP_DELAY1,,,,,,, 0, 0
.endm
/**
@@ -752,7 +933,7 @@ $reladdr\@:
* Delays for `delay` ticks.
*/
.macro delay delay
- _wr_cmd_id delay, 0xFD,0xFD,,,,,,, 0, 0
+ _wr_cmd_id delay, ASEQ_OP_DELAY,ASEQ_OP_DELAY,,,,,,, 0, 0
_var \delay
.endm
@@ -763,7 +944,7 @@ $reladdr\@:
* subroutine encounters an `end` instruction.
*/
.macro call label
- _wr_cmd_id call, 0xFC,0xFC,0xFC,,,,,, 0, 0
+ _wr_cmd_id call, ASEQ_OP_CALL,ASEQ_OP_CALL,ASEQ_OP_CALL,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -773,7 +954,7 @@ $reladdr\@:
* Branches to `label` unconditionally.
*/
.macro jump label
- _wr_cmd_id jump, 0xFB,0xFB,0xFB,,,,,, 0, 0
+ _wr_cmd_id jump, ASEQ_OP_JUMP,ASEQ_OP_JUMP,ASEQ_OP_JUMP,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -783,7 +964,7 @@ $reladdr\@:
* Branches to `label` if TR == 0.
*/
.macro beqz label
- _wr_cmd_id beqz, 0xFA,0xFA,0xFA,,,,,, 0, 0
+ _wr_cmd_id beqz, ASEQ_OP_BEQZ,ASEQ_OP_BEQZ,ASEQ_OP_BEQZ,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -793,7 +974,7 @@ $reladdr\@:
* Branches to `label` if TR < 0.
*/
.macro bltz label
- _wr_cmd_id beqz, 0xF9,0xF9,0xF9,,,,,, 0, 0
+ _wr_cmd_id beqz, ASEQ_OP_BLTZ,ASEQ_OP_BLTZ,ASEQ_OP_BLTZ,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -807,7 +988,7 @@ $reladdr\@:
* becomes full.
*/
.macro loop num
- _wr_cmd_id loop, 0xF8,0xF8,0xF8,,,,,, 0, 0
+ _wr_cmd_id loop, ASEQ_OP_LOOP,ASEQ_OP_LOOP,ASEQ_OP_LOOP,,,,,, 0, 0
_wr_u8 \num
.endm
@@ -821,7 +1002,7 @@ $reladdr\@:
* stack is popped.
*/
.macro loopend
- _wr_cmd_id loopend, 0xF7,0xF7,0xF7,,,,,, 0, 0
+ _wr_cmd_id loopend, ASEQ_OP_LOOPEND,ASEQ_OP_LOOPEND,ASEQ_OP_LOOPEND,,,,,, 0, 0
.endm
/**
@@ -834,7 +1015,7 @@ $reladdr\@:
* the call stack would be popped twice.
*/
.macro break
- _wr_cmd_id break, 0xF6,0xF6,0xF6,,,,,, 0, 0
+ _wr_cmd_id break, ASEQ_OP_BREAK,ASEQ_OP_BREAK,ASEQ_OP_BREAK,,,,,, 0, 0
.endm
/**
@@ -843,7 +1024,7 @@ $reladdr\@:
* Branches to `label` if TR >= 0.
*/
.macro bgez label
- _wr_cmd_id bgez, 0xF5,0xF5,0xF5,,,,,, 0, 0
+ _wr_cmd_id bgez, ASEQ_OP_BGEZ,ASEQ_OP_BGEZ,ASEQ_OP_BGEZ,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -857,7 +1038,7 @@ $reladdr\@:
* signed 8-bit (+/-128) range are reachable.
*/
.macro rjump label
- _wr_cmd_id rjump, 0xF4,0xF4,0xF4,,,,,, 0, 0
+ _wr_cmd_id rjump, ASEQ_OP_RJUMP,ASEQ_OP_RJUMP,ASEQ_OP_RJUMP,,,,,, 0, 0
_wr_8_rel \label
.endm
@@ -871,7 +1052,7 @@ $reladdr\@:
* signed 8-bit (+/-128) range are reachable.
*/
.macro rbeqz label
- _wr_cmd_id rbeqz, 0xF3,0xF3,0xF3,,,,,, 0, 0
+ _wr_cmd_id rbeqz, ASEQ_OP_RBEQZ,ASEQ_OP_RBEQZ,ASEQ_OP_RBEQZ,,,,,, 0, 0
_wr_8_rel \label
.endm
@@ -885,7 +1066,7 @@ $reladdr\@:
* signed 8-bit (+/-128) range are reachable.
*/
.macro rbltz label
- _wr_cmd_id rbltz, 0xF2,0xF2,0xF2,,,,,, 0, 0
+ _wr_cmd_id rbltz, ASEQ_OP_RBLTZ,ASEQ_OP_RBLTZ,ASEQ_OP_RBLTZ,,,,,, 0, 0
_wr_8_rel \label
.endm
@@ -895,7 +1076,7 @@ $reladdr\@:
* Clears the channel note pool and reallocates it with space for `num` notes.
*/
.macro allocnotelist num
- _wr_cmd_id allocnotelist, 0xF1,0xF1,,,,,,, 0, 0
+ _wr_cmd_id allocnotelist, ASEQ_OP_SEQ_ALLOCNOTELIST,ASEQ_OP_CHAN_ALLOCNOTELIST,,,,,,, 0, 0
_wr_u8 \num
.endm
@@ -905,7 +1086,7 @@ $reladdr\@:
* Clears the channel note pool.
*/
.macro freenotelist
- _wr_cmd_id freenotelist, 0xF0,0xF0,,,,,,, 0, 0
+ _wr_cmd_id freenotelist, ASEQ_OP_SEQ_FREENOTELIST,ASEQ_OP_CHAN_FREENOTELIST,,,,,,, 0, 0
.endm
/**
@@ -914,7 +1095,7 @@ $reladdr\@:
* Has no function.
*/
.macro unk_EF arg1, arg2
- _wr_cmd_id unk_EF, 0xEF,,,,,,,, 0, 0
+ _wr_cmd_id unk_EF, ASEQ_OP_SEQ_EF,,,,,,,, 0, 0
_wr_s16 \arg1
_w_u8 \arg2
.endm
@@ -925,7 +1106,7 @@ $reladdr\@:
* Fine-tunes the pitch bend amount for the channel or layer.
*/
.macro bendfine amt
- _wr_cmd_id bendfine, ,0xEE,0xCE,,,,,, 0, 0
+ _wr_cmd_id bendfine, ,ASEQ_OP_CHAN_BENDFINE,ASEQ_OP_LAYER_BENDFINE,,,,,, 0, 0
_wr_s8 \amt
.endm
@@ -935,7 +1116,7 @@ $reladdr\@:
* Sets the channel gain (multiplicative volume scale factor) to the provided qu4.4 fixed-point value.
*/
.macro gain value
- _wr_cmd_id gain, ,0xED,,,,,,, 0, 0
+ _wr_cmd_id gain, ,ASEQ_OP_CHAN_GAIN,,,,,,, 0, 0
_wr_u8 \value
.endm
@@ -945,7 +1126,7 @@ $reladdr\@:
* Resets channel vibrato, filter, gain, sustain, etc. state.
*/
.macro vibreset
- _wr_cmd_id vibreset, ,0xEC,,,,,,, 0, 0
+ _wr_cmd_id vibreset, ,ASEQ_OP_CHAN_VIBRESET,,,,,,, 0, 0
.endm
/**
@@ -954,7 +1135,7 @@ $reladdr\@:
* Updates the soundfont and instrument for the channel simultaneously.
*/
.macro fontinstr fontId, instId
- _wr_cmd_id fontinstr, ,0xEB,,,,,,, 0, 0
+ _wr_cmd_id fontinstr, ,ASEQ_OP_CHAN_FONTINSTR,,,,,,, 0, 0
_wr_u8 \fontId
_wr_u8 \instId
.endm
@@ -967,7 +1148,7 @@ $reladdr\@:
.macro notepri priority1, priority2
_check_arg_bitwidth_u \priority1, 4
_check_arg_bitwidth_u \priority2, 4
- _wr_cmd_id notepri, ,0xE9,,,,,,, 0, 0
+ _wr_cmd_id notepri, ,ASEQ_OP_CHAN_NOTEPRI,,,,,,, 0, 0
_wr_u8 (\priority1 << 4) | \priority2
.endm
@@ -978,7 +1159,7 @@ $reladdr\@:
* Sets various channel parameters.
*/
.macro params muteBhv, noteAllocPolicy, channelPriority, transposition, pan, panWeight, reverb, reverbIndex
- _wr_cmd_id params, ,0xE8,,,,,,, 0, 0
+ _wr_cmd_id params, ,ASEQ_OP_CHAN_PARAMS,,,,,,, 0, 0
_wr_u8 \muteBhv
_wr_u8 \noteAllocPolicy
_wr_u8 \channelPriority
@@ -996,7 +1177,7 @@ $reladdr\@:
* is ordered in the same way as the arguments in `params`.
*/
.macro ldparams label
- _wr_cmd_id ldparams, ,0xE7,,,,,,, 0, 0
+ _wr_cmd_id ldparams, ,ASEQ_OP_CHAN_LDPARAMS,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -1006,7 +1187,7 @@ $reladdr\@:
* Sets the sample book mode.
*/
.macro samplebook value
- _wr_cmd_id samplebook, ,0xE6,,,,,,, 0, 0
+ _wr_cmd_id samplebook, ,ASEQ_OP_CHAN_SAMPLEBOOK,,,,,,, 0, 0
_wr_u8 \value
.endm
@@ -1016,7 +1197,7 @@ $reladdr\@:
* Sets the channel reverb.
*/
.macro reverbidx arg
- _wr_cmd_id reverbidx, ,0xE5,,,,,,, 0, 0
+ _wr_cmd_id reverbidx, ,ASEQ_OP_CHAN_REVERBIDX,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1026,7 +1207,7 @@ $reladdr\@:
* Sets the channel vibrato delay.
*/
.macro vibdelay arg
- _wr_cmd_id vibdelay, ,0xE3,,,,,,, 0, 0
+ _wr_cmd_id vibdelay, ,ASEQ_OP_CHAN_VIBDELAY,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1036,7 +1217,7 @@ $reladdr\@:
* Sets the vibrato extent.
*/
.macro vibdepthgrad arg0, arg1, arg2
- _wr_cmd_id vibdepthgrad, ,0xE2,,,,,,, 0, 0
+ _wr_cmd_id vibdepthgrad, ,ASEQ_OP_CHAN_VIBDEPTHGRAD,,,,,,, 0, 0
_wr_u8 \arg0
_wr_u8 \arg1
_wr_u8 \arg2
@@ -1048,7 +1229,7 @@ $reladdr\@:
* Sets the vibrato rate.
*/
.macro vibfreqgrad arg0, arg1, arg2
- _wr_cmd_id vibfreqgrad, ,0xE1,,,,,,, 0, 0
+ _wr_cmd_id vibfreqgrad, ,ASEQ_OP_CHAN_VIBFREQGRAD,,,,,,, 0, 0
_wr_u8 \arg0
_wr_u8 \arg1
_wr_u8 \arg2
@@ -1060,7 +1241,7 @@ $reladdr\@:
* Changes the expression amount for the channel.
*/
.macro volexp amt
- _wr_cmd_id volexp, ,0xE0,,,,,,, 0, 0
+ _wr_cmd_id volexp, ,ASEQ_OP_CHAN_VOLEXP,,,,,,, 0, 0
_wr_u8 \amt
.endm
@@ -1071,7 +1252,7 @@ $reladdr\@:
* provided number of semitones.
*/
.macro transpose semitones
- _wr_cmd_id transpose, 0xDF,0xDB,0xC2,,,,,, 0, 0
+ _wr_cmd_id transpose, ASEQ_OP_SEQ_TRANSPOSE,ASEQ_OP_CHAN_TRANSPOSE,ASEQ_OP_LAYER_TRANSPOSE,,,,,, 0, 0
_wr_s8 \semitones
.endm
@@ -1081,7 +1262,7 @@ $reladdr\@:
* Adjusts the transposition amount. This is only available at the top sequence level.
*/
.macro rtranspose semitones
- _wr_cmd_id rtranspose, 0xDE,,,,,,,, 0, 0
+ _wr_cmd_id rtranspose, ASEQ_OP_SEQ_RTRANSPOSE,,,,,,,, 0, 0
_wr_s8 \semitones
.endm
@@ -1091,7 +1272,7 @@ $reladdr\@:
* Sets the freqScale for the current channel.
*/
.macro freqscale arg
- _wr_cmd_id freqscale, ,0xDE,,,,,,, 0, 0
+ _wr_cmd_id freqscale, ,ASEQ_OP_CHAN_FREQSCALE,,,,,,, 0, 0
_wr_s16 \arg
.endm
@@ -1101,7 +1282,7 @@ $reladdr\@:
* Changes the tempo of the sequence.
*/
.macro tempo bpm
- _wr_cmd_id tempo, 0xDD,,,,,,,, 0, 0
+ _wr_cmd_id tempo, ASEQ_OP_SEQ_TEMPO,,,,,,,, 0, 0
_wr_u8 \bpm
.endm
@@ -1111,7 +1292,7 @@ $reladdr\@:
* Sets the tempoChange for the sequence.
*/
.macro tempochg arg
- _wr_cmd_id tempochg, 0xDC,,,,,,,, 0, 0
+ _wr_cmd_id tempochg, ASEQ_OP_SEQ_TEMPOCHG,,,,,,,, 0, 0
_wr_s8 \arg
.endm
@@ -1123,7 +1304,7 @@ $reladdr\@:
.macro pan pan
/* pan can only take values in 0..127 */
_check_arg_bitwidth_u \pan, 7
- _wr_cmd_id pan, ,0xDD,,,,,,, 0, 0
+ _wr_cmd_id pan, ,ASEQ_OP_CHAN_PAN,,,,,,, 0, 0
_wr_u8 \pan
.endm
@@ -1139,7 +1320,7 @@ $reladdr\@:
.macro panweight weight
/* weight can only take values in 0..127 */
_check_arg_bitwidth_u \weight, 7
- _wr_cmd_id panweight, ,0xDC,,,,,,, 0, 0
+ _wr_cmd_id panweight, ,ASEQ_OP_CHAN_PANWEIGHT,,,,,,, 0, 0
_wr_u8 \weight
.endm
@@ -1149,7 +1330,7 @@ $reladdr\@:
* Sets the volume amount for this sequence or channel.
*/
.macro vol amt
- _wr_cmd_id vol, 0xDB,0xDF,,,,,,, 0, 0
+ _wr_cmd_id vol, ASEQ_OP_SEQ_VOL,ASEQ_OP_CHAN_VOL,,,,,,, 0, 0
_wr_u8 \amt
.endm
@@ -1159,7 +1340,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro volmode mode, fadeTimer
- _wr_cmd_id volmode, 0xDA,,,,,,,, 0, 0
+ _wr_cmd_id volmode, ASEQ_OP_SEQ_VOLMODE,,,,,,,, 0, 0
_wr_u8 \mode
_wr_u16 \fadeTimer
.endm
@@ -1170,7 +1351,7 @@ $reladdr\@:
* Sets the fadeVolumeScale for the sequence.
*/
.macro volscale arg
- _wr_cmd_id volscale, 0xD9,,,,,,,, 0, 0
+ _wr_cmd_id volscale, ASEQ_OP_SEQ_VOLSCALE,,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1180,7 +1361,7 @@ $reladdr\@:
* Sets the envelope release rate for this channel or layer.
*/
.macro releaserate release
- _wr_cmd_id releaserate, ,0xD9,0xCF,,,,,, 0, 0
+ _wr_cmd_id releaserate, ,ASEQ_OP_CHAN_RELEASERATE,ASEQ_OP_LAYER_RELEASERATE,,,,,, 0, 0
_wr_u8 \release
.endm
@@ -1190,7 +1371,7 @@ $reladdr\@:
* Sets the vibrato depth for the channel.
*/
.macro vibdepth arg
- _wr_cmd_id vibdepth, ,0xD8,,,,,,, 0, 0
+ _wr_cmd_id vibdepth, ,ASEQ_OP_CHAN_VIBDEPTH,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1200,7 +1381,7 @@ $reladdr\@:
* Sets the vibrato rate for the channel.
*/
.macro vibfreq arg
- _wr_cmd_id vibfreq, ,0xD7,,,,,,, 0, 0
+ _wr_cmd_id vibfreq, ,ASEQ_OP_CHAN_VIBFREQ,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1213,7 +1394,7 @@ $reladdr\@:
* initchan 0b101 initializes channels 0 and 2.
*/
.macro initchan bitmask
- _wr_cmd_id initchan, 0xD7,,,,,,,, 0, 0
+ _wr_cmd_id initchan, ASEQ_OP_SEQ_INITCHAN,,,,,,,, 0, 0
_wr_u16 \bitmask
.endm
@@ -1223,7 +1404,7 @@ $reladdr\@:
* Frees the channels marked in the provided bitmask.
*/
.macro freechan bitmask
- _wr_cmd_id freechan, 0xD6,,,,,,,, 0, 0
+ _wr_cmd_id freechan, ASEQ_OP_SEQ_FREECHAN,,,,,,,, 0, 0
_wr_u16 \bitmask
.endm
@@ -1233,7 +1414,7 @@ $reladdr\@:
* Sets the muteVolumeScale for the sequence.
*/
.macro mutescale arg
- _wr_cmd_id mutescale, 0xD5,,,,,,,, 0, 0
+ _wr_cmd_id mutescale, ASEQ_OP_SEQ_MUTESCALE,,,,,,,, 0, 0
_wr_s8 \arg
.endm
@@ -1243,7 +1424,7 @@ $reladdr\@:
* Mutes the sequence player.
*/
.macro mute
- _wr_cmd_id mute, 0xD4,,,,,,,, 0, 0
+ _wr_cmd_id mute, ASEQ_OP_SEQ_MUTE,,,,,,,, 0, 0
.endm
/**
@@ -1252,7 +1433,7 @@ $reladdr\@:
* Sets the reverb amount for this channel.
*/
.macro reverb amt
- _wr_cmd_id reverb, ,0xD4,,,,,,, 0, 0
+ _wr_cmd_id reverb, ,ASEQ_OP_CHAN_REVERB,,,,,,, 0, 0
_wr_u8 \amt
.endm
@@ -1262,7 +1443,7 @@ $reladdr\@:
* Sets mute behavior for this sequence or channel.
*/
.macro mutebhv flags
- _wr_cmd_id mutebhv, 0xD3,0xCA,,,,,,, 0, 0
+ _wr_cmd_id mutebhv, ASEQ_OP_SEQ_MUTEBHV,ASEQ_OP_CHAN_MUTEBHV,,,,,,, 0, 0
_wr_u8 \flags
.endm
@@ -1272,7 +1453,7 @@ $reladdr\@:
* Sets the pitch bend amount for this channel.
*/
.macro bend amt
- _wr_cmd_id bend, ,0xD3,,,,,,, 0, 0
+ _wr_cmd_id bend, ,ASEQ_OP_CHAN_BEND,,,,,,, 0, 0
_wr_s8 \amt
.endm
@@ -1282,7 +1463,7 @@ $reladdr\@:
* Sets the location of SHORTVELTBL.
*/
.macro ldshortvelarr label
- _wr_cmd_id ldshortvelarr, 0xD2,,,,,,,, 0, 0
+ _wr_cmd_id ldshortvelarr, ASEQ_OP_SEQ_LDSHORTVELARR,,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -1292,7 +1473,7 @@ $reladdr\@:
* Sets the adsr sustain value for this channel.
*/
.macro sustain value
- _wr_cmd_id sustain, ,0xD2,,,,,,, 0, 0
+ _wr_cmd_id sustain, ,ASEQ_OP_CHAN_SUSTAIN,,,,,,, 0, 0
_wr_u8 \value
.endm
@@ -1302,7 +1483,7 @@ $reladdr\@:
* Sets the location of SHORTGATETBL.
*/
.macro ldshortgatearr label
- _wr_cmd_id ldshortgatearr, 0xD1,,,,,,,, 0, 0
+ _wr_cmd_id ldshortgatearr, ASEQ_OP_SEQ_LDSHORTGATEARR,,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -1312,7 +1493,7 @@ $reladdr\@:
* Sets the noteAllocPolicy for either the sequence or the current channel.
*/
.macro notealloc arg
- _wr_cmd_id notealloc, 0xD0,0xD1,,,,,,, 0, 0
+ _wr_cmd_id notealloc, ASEQ_OP_SEQ_NOTEALLOC,ASEQ_OP_CHAN_NOTEALLOC,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1329,7 +1510,7 @@ $reladdr\@:
_check_arg_bitwidth_u \strongRvrbR, 1
_check_arg_bitwidth_u \strongRvrbL, 1
- _wr_cmd_id effects, ,0xD0,,,,,,, 0, 0
+ _wr_cmd_id effects, ,ASEQ_OP_CHAN_EFFECTS,,,,,,, 0, 0
_wr_u8 (\headset << 7) | (\type << 4) | (\strongR << 3) | (\strongL << 2) | (\strongRvrbR << 1) | (\strongRvrbL << 0)
.endm
@@ -1339,7 +1520,7 @@ $reladdr\@:
* Stores TP -> label
*/
.macro stptrtoseq label
- _wr_cmd_id stptrtoseq, ,0xCF,,,,,,, 0, 0
+ _wr_cmd_id stptrtoseq, ,ASEQ_OP_CHAN_STPTRTOSEQ,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -1349,7 +1530,7 @@ $reladdr\@:
* Loads label -> TP
*/
.macro ldptr label
- _wr_cmd_id ldptr, ,0xCE,,,,,,, 0, 0
+ _wr_cmd_id ldptr, ,ASEQ_OP_CHAN_LDPTR,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -1359,7 +1540,7 @@ $reladdr\@:
* Loads imm -> TP
*/
.macro ldptri imm
- _wr_cmd_id ldptr, ,0xCE,,,,,,, 0, 0
+ _wr_cmd_id ldptr, ,ASEQ_OP_CHAN_LDPTR,,,,,,, 0, 0
_wr_u16 \imm
.endm
@@ -1369,7 +1550,7 @@ $reladdr\@:
* Stores a random number in the range [0, max) into TR. If max is 0 the range is [0, 255]
*/
.macro rand max
- _wr_cmd_id rand, 0xCE,0xB8,,,,,,, 0, 0
+ _wr_cmd_id rand, ASEQ_OP_SEQ_RAND,ASEQ_OP_CHAN_RAND,,,,,,, 0, 0
_wr_u8 \max
.endm
@@ -1384,9 +1565,9 @@ $reladdr\@:
*/
.macro dyncall table=-1
.if \table == -1
- _wr_cmd_id dyncall, ,0xE4,,,,,,, 0, 0
+ _wr_cmd_id dyncall, ,ASEQ_OP_CHAN_DYNCALL,,,,,,, 0, 0
.else
- _wr_cmd_id dyncall, 0xCD,,,,,,,, 0, 0
+ _wr_cmd_id dyncall, ASEQ_OP_SEQ_DYNCALL,,,,,,,, 0, 0
_wr_lbl \table
.endif
.endm
@@ -1397,7 +1578,7 @@ $reladdr\@:
* Loads the immediate value `imm` into TR.
*/
.macro ldi imm
- _wr_cmd_id ldi, 0xCC,0xCC,,,,,,, 0, 0
+ _wr_cmd_id ldi, ASEQ_OP_SEQ_LDI,ASEQ_OP_CHAN_LDI,,,,,,, 0, 0
_wr_u8 \imm
.endm
@@ -1407,7 +1588,7 @@ $reladdr\@:
* Computes TR = TR & imm
*/
.macro and imm
- _wr_cmd_id and, 0xC9,0xC9,,,,,,, 0, 0
+ _wr_cmd_id and, ASEQ_OP_SEQ_AND,ASEQ_OP_CHAN_AND,,,,,,, 0, 0
_wr_u8 \imm
.endm
@@ -1417,7 +1598,7 @@ $reladdr\@:
* Computes TR = TR - imm
*/
.macro sub imm
- _wr_cmd_id sub, 0xC8,0xC8,,,,,,, 0, 0
+ _wr_cmd_id sub, ASEQ_OP_SEQ_SUB,ASEQ_OP_CHAN_SUB,,,,,,, 0, 0
_wr_u8 \imm
.endm
@@ -1427,7 +1608,7 @@ $reladdr\@:
* Stores the u8 value `TR + imm` to the location specified by `label`.
*/
.macro stseq imm, label
- _wr_cmd_id stseq, 0xC7,0xC7,,,,,,, 0, 0
+ _wr_cmd_id stseq, ASEQ_OP_SEQ_STSEQ,ASEQ_OP_CHAN_STSEQ,,,,,,, 0, 0
_wr_u8 \imm
_wr_lbl \label
.endm
@@ -1438,7 +1619,7 @@ $reladdr\@:
* Immediately stops the sequence or channel.
*/
.macro stop
- _wr_cmd_id stop, 0xC6,0xEA,,,,,,, 0, 0
+ _wr_cmd_id stop, ASEQ_OP_SEQ_STOP,ASEQ_OP_CHAN_STOP,,,,,,, 0, 0
.endm
/**
@@ -1447,7 +1628,7 @@ $reladdr\@:
* Set the current soundfont for this channel to `fontId`.
*/
.macro font fontId
- _wr_cmd_id font, ,0xC6,,,,,,, 0, 0
+ _wr_cmd_id font, ,ASEQ_OP_CHAN_FONT,,,,,,, 0, 0
_wr_u8 \fontId
.endm
@@ -1460,7 +1641,7 @@ $reladdr\@:
* never used, so changing it with this instruction has no useful effects.
*/
.macro scriptctr arg
- _wr_cmd_id scriptctr, 0xC5,,,,,,,, 0, 0
+ _wr_cmd_id scriptctr, ASEQ_OP_SEQ_SCRIPTCTR,,,,,,,, 0, 0
_wr_u16 \arg
.endm
@@ -1471,7 +1652,7 @@ $reladdr\@:
* unless TR is -1, in which case nothing happens.
*/
.macro dyntbllookup
- _wr_cmd_id dyntbllookup, ,0xC5,,,,,,, 0, 0
+ _wr_cmd_id dyntbllookup, ,ASEQ_OP_CHAN_DYNTBLLOOKUP,,,,,,, 0, 0
.endm
/**
@@ -1480,7 +1661,7 @@ $reladdr\@:
* Plays the sequence seqId on seqPlayer.
*/
.macro runseq seqPlayer, seqId
- _wr_cmd_id runseq, 0xC4,,,,,,,, 0, 0
+ _wr_cmd_id runseq, ASEQ_OP_SEQ_RUNSEQ,,,,,,,, 0, 0
_wr_u8 \seqPlayer
_wr_u8 \seqId
.endm
@@ -1493,7 +1674,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro mutechan arg0
- _wr_cmd_id mutechan, 0xC3,,,,,,,, 0, 0
+ _wr_cmd_id mutechan, ASEQ_OP_SEQ_C3,,,,,,,, 0, 0
_wr_s16 \arg0
.endm
@@ -1505,7 +1686,7 @@ $reladdr\@:
* Disable short notes encoding.
*/
.macro noshort
- _wr_cmd_id noshort, ,0xC4,,,,,,, 0, 0
+ _wr_cmd_id noshort, ,ASEQ_OP_CHAN_NOSHORT,,,,,,, 0, 0
.endm
/**
@@ -1514,7 +1695,7 @@ $reladdr\@:
* Enable short notes encoding.
*/
.macro short
- _wr_cmd_id short, ,0xC3,,,,,,, 0, 0
+ _wr_cmd_id short, ,ASEQ_OP_CHAN_SHORT,,,,,,, 0, 0
.endm
/**
@@ -1523,7 +1704,7 @@ $reladdr\@:
* Loads label -> DYNTBL
*/
.macro dyntbl label
- _wr_cmd_id dyntbl, ,0xC2,,,,,,, 0, 0
+ _wr_cmd_id dyntbl, ,ASEQ_OP_CHAN_DYNTBL,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -1533,7 +1714,7 @@ $reladdr\@:
* Set instrument `instNum` from the current soundfont as the active instrument for this channel or layer.
*/
.macro instr instNum
- _wr_cmd_id instr, ,0xC1,0xC6,,,,,, 0, 0
+ _wr_cmd_id instr, ,ASEQ_OP_CHAN_INSTR,ASEQ_OP_LAYER_INSTR,,,,,, 0, 0
_wr_u8 \instNum
.endm
@@ -1545,7 +1726,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_BE arg0
- _wr_cmd_id unk_BE, ,0xBE,,,,,,, 0, 0
+ _wr_cmd_id unk_BE, ,ASEQ_OP_CHAN_UNK_BE,,,,,,, 0, 0
_wr_u8 \arg0
.endm
@@ -1559,13 +1740,9 @@ $reladdr\@:
* If range is 0, it is treated as 65536.
*/
.macro randptr range, offset
- #if (MML_VERSION == MML_VERSION_OOT)
- _wr_cmd_id randptr, ,0xBD,,,,,,, 0, 0
- #else
- _wr_cmd_id randptr, ,0xA8,,,,,,, 0, 0
- #endif
- _wr_u16 \range
- _wr_u16 \offset
+ _wr_cmd_id randptr, ,ASEQ_OP_CHAN_RANDPTR,,,,,,, 0, 0
+ _wr_u16 \range
+ _wr_u16 \offset
.endm
#if (MML_VERSION == MML_VERSION_MM)
@@ -1576,7 +1753,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro samplestart arg
- _wr_cmd_id samplestart, ,0xBD,,,,,,, 0, 0
+ _wr_cmd_id samplestart, ,ASEQ_OP_CHAN_SAMPLESTART,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1586,7 +1763,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A7 arg
- _wr_cmd_id unk_A7, ,0xA7,,,,,,, 0, 0
+ _wr_cmd_id unk_A7, ,ASEQ_OP_CHAN_A7,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1596,7 +1773,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A6 arg0, arg1
- _wr_cmd_id unk_A6, ,0xA6,,,,,,, 0, 0
+ _wr_cmd_id unk_A6, ,ASEQ_OP_CHAN_A6,,,,,,, 0, 0
_wr_u8 \arg0
_wr_s16 \arg1
.endm
@@ -1607,7 +1784,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A5
- _wr_cmd_id unk_A5, ,0xA5,,,,,,, 0, 0
+ _wr_cmd_id unk_A5, ,ASEQ_OP_CHAN_A5,,,,,,, 0, 0
.endm
/**
@@ -1616,7 +1793,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A4 arg
- _wr_cmd_id unk_A4, ,0xA4,,,,,,, 0, 0
+ _wr_cmd_id unk_A4, ,ASEQ_OP_CHAN_A4,,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -1626,7 +1803,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A3
- _wr_cmd_id unk_A3, ,0xA3,,,,,,, 0, 0
+ _wr_cmd_id unk_A3, ,ASEQ_OP_CHAN_A3,,,,,,, 0, 0
.endm
/**
@@ -1635,7 +1812,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A2 arg
- _wr_cmd_id unk_A2, ,0xA2,,,,,,, 0, 0
+ _wr_cmd_id unk_A2, ,ASEQ_OP_CHAN_A2,,,,,,, 0, 0
_wr_s16 \arg
.endm
@@ -1645,7 +1822,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A1
- _wr_cmd_id unk_A1, ,0xA1,,,,,,, 0, 0
+ _wr_cmd_id unk_A1, ,ASEQ_OP_CHAN_A1,,,,,,, 0, 0
.endm
/**
@@ -1654,7 +1831,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_A0 arg
- _wr_cmd_id unk_A0, ,0xA0,,,,,,, 0, 0
+ _wr_cmd_id unk_A0, ,ASEQ_OP_CHAN_A0,,,,,,, 0, 0
_wr_s16 \arg
.endm
@@ -1666,20 +1843,20 @@ $reladdr\@:
* Computes TP += value
*/
.macro ptradd value
- _wr_cmd_id ptradd, ,0xBC,,,,,,, 0, 0
+ _wr_cmd_id ptradd, ,ASEQ_OP_CHAN_PTRADD,,,,,,, 0, 0
_wr_lbl \value
.endm
/**
- * ptraddi
+ * ptraddi
*
* Like ptradd but for immediates instead of labels
*
* Computes TP += value
*/
.macro ptraddi value
- _wr_cmd_id ptradd, ,0xBC,,,,,,, 0, 0
- _wr_u16 \value
+ _wr_cmd_id ptradd, ,ASEQ_OP_CHAN_PTRADD,,,,,,, 0, 0
+ _wr_s16 \value
.endm
/**
@@ -1689,7 +1866,7 @@ $reladdr\@:
* TODO args? arg0=16,arg1=val<<8 maps well to midi chorus
*/
.macro combfilter arg0, arg1
- _wr_cmd_id combfilter, ,0xBB,,,,,,, 0, 0
+ _wr_cmd_id combfilter, ,ASEQ_OP_CHAN_COMBFILTER,,,,,,, 0, 0
_wr_u8 \arg0
_wr_u16 \arg1
.endm
@@ -1702,7 +1879,7 @@ $reladdr\@:
* NOTE: This feature is bugged. If this is non-zero it will actually use the range set by randvel.
*/
.macro randgate range
- _wr_cmd_id randgate, ,0xBA,,,,,,, 0, 0
+ _wr_cmd_id randgate, ,ASEQ_OP_CHAN_RANDGATE,,,,,,, 0, 0
_wr_u8 \range
.endm
@@ -1712,7 +1889,7 @@ $reladdr\@:
* Sets the range for random note velocity fluctuations.
*/
.macro randvel range
- _wr_cmd_id randvel, ,0xB9,,,,,,, 0, 0
+ _wr_cmd_id randvel, ,ASEQ_OP_CHAN_RANDVEL,,,,,,, 0, 0
_wr_u8 \range
.endm
@@ -1722,7 +1899,7 @@ $reladdr\@:
* Stores a random number in the range [0, max) into TP. If max is 0 the range is [0, 65535]
*/
.macro randtoptr max
- _wr_cmd_id randtoptr, ,0xB7,,,,,,, 0, 0
+ _wr_cmd_id randtoptr, ,ASEQ_OP_CHAN_RANDTOPTR,,,,,,, 0, 0
_wr_u16 \max
.endm
@@ -1732,7 +1909,7 @@ $reladdr\@:
* Loads DYNTBL8[TR] -> TR
*/
.macro dyntblv
- _wr_cmd_id dyntblv, ,0xB6,,,,,,, 0, 0
+ _wr_cmd_id dyntblv, ,ASEQ_OP_CHAN_DYNTBLV,,,,,,, 0, 0
.endm
/**
@@ -1741,7 +1918,7 @@ $reladdr\@:
* Loads DYNTBL16[TR] -> TP
*/
.macro dyntbltoptr
- _wr_cmd_id dyntbltoptr, ,0xB5,,,,,,, 0, 0
+ _wr_cmd_id dyntbltoptr, ,ASEQ_OP_CHAN_DYNTBLTOPTR,,,,,,, 0, 0
.endm
/**
@@ -1750,7 +1927,7 @@ $reladdr\@:
* Transfers TP -> DYNTBL
*/
.macro ptrtodyntbl
- _wr_cmd_id ptrtodyntbl, ,0xB4,,,,,,, 0, 0
+ _wr_cmd_id ptrtodyntbl, ,ASEQ_OP_CHAN_PTRTODYNTBL,,,,,,, 0, 0
.endm
/**
@@ -1761,7 +1938,7 @@ $reladdr\@:
* Note that TR acts as an index into an array of u16 starting at label.
*/
.macro ldseqtoptr label
- _wr_cmd_id ldseqtoptr, ,0xB2,,,,,,, 0, 0
+ _wr_cmd_id ldseqtoptr, ,ASEQ_OP_CHAN_LDSEQTOPTR,,,,,,, 0, 0
_wr_lbl \label
.endm
@@ -1771,7 +1948,7 @@ $reladdr\@:
* Invalidates the current active filter buffer.
*/
.macro freefilter
- _wr_cmd_id freefilter, ,0xB1,,,,,,, 0, 0
+ _wr_cmd_id freefilter, ,ASEQ_OP_CHAN_FREEFILTER,,,,,,, 0, 0
.endm
/**
@@ -1780,7 +1957,7 @@ $reladdr\@:
* Sets the active filter buffer to the location specified by `filter`.
*/
.macro ldfilter filter
- _wr_cmd_id ldfilter, ,0xB0,,,,,,, 0, 0
+ _wr_cmd_id ldfilter, ,ASEQ_OP_CHAN_LDFILTER,,,,,,, 0, 0
_wr_lbl \filter
.endm
@@ -1791,7 +1968,7 @@ $reladdr\@:
* Delays by `delay` ticks.
*/
.macro cdelay delay
- _wr_cmd_id cdelay, ,0x00,,,,,,, \delay, 4
+ _wr_cmd_id cdelay, ,ASEQ_OP_CHAN_CDELAY,,,,,,, \delay, 4
.endm
/**
@@ -1805,9 +1982,9 @@ $reladdr\@:
*/
.macro ldsample type, portNum
.if \type == LDSAMPLE_INST
- _wr_cmd_id ldsample, ,0x10,,,,,,, \portNum, 3
+ _wr_cmd_id ldsample, ,ASEQ_OP_CHAN_LDSAMPLE,,,,,,, \portNum, 3
.elif \type == LDSAMPLE_SFX
- _wr_cmd_id ldsample, ,0x18,,,,,,, \portNum, 3
+ _wr_cmd_id ldsample, ,ASEQ_OP_CHAN_LDSAMPLE | 8,,,,,,, \portNum, 3
.else
.error "ldsample: invalid type"
.endif
@@ -1821,7 +1998,7 @@ $reladdr\@:
* Stores the contents of TR into CIO[channelNum][portNum]
*/
.macro stcio channelNum, portNum
- _wr_cmd_id stcio, ,0x30,,,,,,, \channelNum, 4
+ _wr_cmd_id stcio, ,ASEQ_OP_CHAN_STCIO,,,,,,, \channelNum, 4
_wr_u8 \portNum
.endm
@@ -1831,7 +2008,7 @@ $reladdr\@:
* Loads the contents of CIO[channelNum][portNum] into TR.
*/
.macro ldcio channelNum, portNum
- _wr_cmd_id ldcio, ,0x40,,,,,,, \channelNum, 4
+ _wr_cmd_id ldcio, ,ASEQ_OP_CHAN_LDCIO,,,,,,, \channelNum, 4
_wr_u8 \portNum
.endm
@@ -1843,7 +2020,7 @@ $reladdr\@:
* for use in position-independent code.
*/
.macro rldlayer layerNum, label
- _wr_cmd_id rldlayer, ,0x78,,,,,,, \layerNum, 3
+ _wr_cmd_id rldlayer, ,ASEQ_OP_CHAN_RLDLAYER,,,,,,, \layerNum, 3
_wr_16_rel \label
.endm
@@ -1857,7 +2034,7 @@ $reladdr\@:
* - -1 if layer does not exist.
*/
.macro testlayer layerNum
- _wr_cmd_id testlayer, ,0x80,,,,,,, \layerNum, 3
+ _wr_cmd_id testlayer, ,ASEQ_OP_CHAN_TESTLAYER,,,,,,, \layerNum, 3
.endm
/**
@@ -1866,7 +2043,7 @@ $reladdr\@:
* Opens the note layer at `label` for index `layerNum`.
*/
.macro ldlayer layerNum, label
- _wr_cmd_id ldlayer, ,0x88,,,,,,, \layerNum, 3
+ _wr_cmd_id ldlayer, ,ASEQ_OP_CHAN_LDLAYER,,,,,,, \layerNum, 3
_wr_lbl \label
.endm
@@ -1876,7 +2053,7 @@ $reladdr\@:
* Deletes the layer specified by index `layerNum`.
*/
.macro dellayer arg
- _wr_cmd_id dellayer, ,0x90,,,,,,, \arg, 3
+ _wr_cmd_id dellayer, ,ASEQ_OP_CHAN_DELLAYER,,,,,,, \arg, 3
.endm
/**
@@ -1885,7 +2062,7 @@ $reladdr\@:
* Allocates a new layer starting at the pointer read from DYNTBL16[TR]
*/
.macro dynldlayer arg
- _wr_cmd_id dynldlayer, ,0x98,,,,,,, \arg, 3
+ _wr_cmd_id dynldlayer, ,ASEQ_OP_CHAN_DYNLDLAYER,,,,,,, \arg, 3
.endm
/**
@@ -1897,7 +2074,7 @@ $reladdr\@:
* - 1 if disabled
*/
.macro testchan channelNum
- _wr_cmd_id testchan, 0x00,,,,,,,, \channelNum, 4
+ _wr_cmd_id testchan, ASEQ_OP_SEQ_TESTCHAN,,,,,,,, \channelNum, 4
.endm
/**
@@ -1907,9 +2084,9 @@ $reladdr\@:
*/
.macro stopchan channelNum
.if ASEQ_MODE == ASEQ_MODE_SEQUENCE
- _wr_cmd_id stopchan, 0x40,,,,,,,, \channelNum, 4
+ _wr_cmd_id stopchan, ASEQ_OP_SEQ_STOPCHAN,,,,,,,, \channelNum, 4
.else
- _wr_cmd_id stopchan, ,0xCD,,,,,,, 0, 0
+ _wr_cmd_id stopchan, ,ASEQ_OP_CHAN_STOPCHAN,,,,,,, 0, 0
_wr_u8 \channelNum
.endif
.endm
@@ -1924,7 +2101,7 @@ $reladdr\@:
* Computes TR = TR - CIO[CUR_CHANNEL][portNum]
*/
.macro subio portNum
- _wr_cmd_id subio, 0x50,0x50,,,,,,, \portNum, 4
+ _wr_cmd_id subio, ASEQ_OP_SEQ_SUBIO,ASEQ_OP_CHAN_SUBIO,,,,,,, \portNum, 4
.endm
/**
@@ -1941,7 +2118,7 @@ $reladdr\@:
* Load status is made available in SIO[portNum].
*/
.macro ldres portNum, resType, resId
- _wr_cmd_id ldres, 0x60,,,,,,,, \portNum, 4
+ _wr_cmd_id ldres, ASEQ_OP_SEQ_LDRES,,,,,,,, \portNum, 4
_wr_u8 \resType
_wr_u8 \resId
.endm
@@ -1955,9 +2132,9 @@ $reladdr\@:
*/
.macro stio portNum
.if ASEQ_MODE == ASEQ_MODE_CHANNEL
- _wr_cmd_id stio, ,0x70,,,,,,, \portNum, 3
+ _wr_cmd_id stio, ,ASEQ_OP_CHAN_STIO,,,,,,, \portNum, 3
.else
- _wr_cmd_id stio, 0x70,,,,,,,, \portNum, 4
+ _wr_cmd_id stio, ASEQ_OP_SEQ_STIO,,,,,,,, \portNum, 4
.endif
.endm
@@ -1968,7 +2145,7 @@ $reladdr\@:
* depending on current section.
*/
.macro ldio portNum
- _wr_cmd_id ldio, 0x80,0x60,,,,,,, \portNum, 4
+ _wr_cmd_id ldio, ASEQ_OP_SEQ_LDIO,ASEQ_OP_CHAN_LDIO,,,,,,, \portNum, 4
.endm
/**
@@ -1977,7 +2154,7 @@ $reladdr\@:
* Opens the sequence channel for index `channelNum` with data beginning at `label`.
*/
.macro ldchan channelNum, label
- _wr_cmd_id ldchan, 0x90,0x20,,,,,,, \channelNum, 4
+ _wr_cmd_id ldchan, ASEQ_OP_SEQ_LDCHAN,ASEQ_OP_CHAN_LDCHAN,,,,,,, \channelNum, 4
_wr_lbl \label
.endm
@@ -1989,7 +2166,7 @@ $reladdr\@:
* for use in position-independent code.
*/
.macro rldchan channelNum, label
- _wr_cmd_id rldchan, 0xA0,,,,,,,, \channelNum, 4
+ _wr_cmd_id rldchan, ASEQ_OP_SEQ_RLDCHAN,,,,,,,, \channelNum, 4
_wr_16_rel \label
.endm
@@ -1999,7 +2176,7 @@ $reladdr\@:
* Delay for `delay` ticks.
*/
.macro ldelay delay
- _wr_cmd_id ldelay, ,,0xC0,,,,,, 0, 0
+ _wr_cmd_id ldelay, ,,ASEQ_OP_LAYER_LDELAY,,,,,, 0, 0
_var \delay
.endm
@@ -2010,7 +2187,7 @@ $reladdr\@:
* Should never be used when not required for matching purposes.
*/
.macro lldelay delay
- _wr_cmd_id lldelay, ,0xFD,0xC0,,,,,, 0, 0
+ _wr_cmd_id lldelay, ,ASEQ_OP_DELAY,ASEQ_OP_LAYER_LDELAY,,,,,, 0, 0
_var_long \delay
.endm
@@ -2020,7 +2197,7 @@ $reladdr\@:
* Set velocity used by short notes.
*/
.macro shortvel velocity
- _wr_cmd_id shortvel, ,,0xC1,,,,,, 0, 0
+ _wr_cmd_id shortvel, ,,ASEQ_OP_LAYER_SHORTVEL,,,,,, 0, 0
_wr_u8 \velocity
.endm
@@ -2030,7 +2207,7 @@ $reladdr\@:
* Set delay used by short notes.
*/
.macro shortdelay delay
- _wr_cmd_id shortdelay, ,,0xC3,,,,,, 0, 0
+ _wr_cmd_id shortdelay, ,,ASEQ_OP_LAYER_SHORTDELAY,,,,,, 0, 0
_var \delay
.endm
@@ -2040,7 +2217,7 @@ $reladdr\@:
* Enables legato on the current layer.
*/
.macro legato
- _wr_cmd_id legato, ,,0xC4,,,,,, 0, 0
+ _wr_cmd_id legato, ,,ASEQ_OP_LAYER_LEGATO,,,,,, 0, 0
.endm
/**
@@ -2049,7 +2226,7 @@ $reladdr\@:
* Disables legato on the current layer.
*/
.macro nolegato
- _wr_cmd_id nolegato, ,,0xC5,,,,,, 0, 0
+ _wr_cmd_id nolegato, ,,ASEQ_OP_LAYER_NOLEGATO,,,,,, 0, 0
.endm
/**
@@ -2058,7 +2235,7 @@ $reladdr\@:
* The time argument is either a var or a u8 depending on mode
*/
.macro portamento mode, target, time
- _wr_cmd_id portamento, ,,0xC7,,,,,, 0, 0
+ _wr_cmd_id portamento, ,,ASEQ_OP_LAYER_PORTAMENTO,,,,,, 0, 0
_wr_u8 \mode
_wr_u8 \target
.if (\mode & 0x80) != 0
@@ -2074,7 +2251,7 @@ $reladdr\@:
* Disables portamento on the current layer.
*/
.macro noportamento
- _wr_cmd_id noportamento, ,,0xC8,,,,,, 0, 0
+ _wr_cmd_id noportamento, ,,ASEQ_OP_LAYER_NOPORTAMENTO,,,,,, 0, 0
.endm
/**
@@ -2083,7 +2260,7 @@ $reladdr\@:
* Sets gate time for short notes.
*/
.macro shortgate gateTime
- _wr_cmd_id shortgate, ,,0xC9,,,,,, 0, 0
+ _wr_cmd_id shortgate, ,,ASEQ_OP_LAYER_SHORTGATE,,,,,, 0, 0
_wr_u8 \gateTime
.endm
@@ -2095,7 +2272,7 @@ $reladdr\@:
.macro notepan pan
/* pan can only take values in 0..127 */
_check_arg_bitwidth_u \pan, 7
- _wr_cmd_id notepan, ,,0xCA,,,,,, 0, 0
+ _wr_cmd_id notepan, ,,ASEQ_OP_LAYER_NOTEPAN,,,,,, 0, 0
_wr_u8 \pan
.endm
@@ -2106,7 +2283,7 @@ $reladdr\@:
* use pan set in the layer.
*/
.macro nodrumpan
- _wr_cmd_id nodrumpan, ,,0xCC,,,,,, 0, 0
+ _wr_cmd_id nodrumpan, ,,ASEQ_OP_LAYER_NODRUMPAN,,,,,, 0, 0
.endm
/**
@@ -2114,7 +2291,6 @@ $reladdr\@:
*
* TODO DESCRIPTION
*/
-#define STEREO_OPCODE 0xCD
.macro stereo type, strongR, strongL, strongRvrbR, strongRvrbL
_check_arg_bitwidth_u \type, 2
_check_arg_bitwidth_u \strongR, 1
@@ -2122,7 +2298,7 @@ $reladdr\@:
_check_arg_bitwidth_u \strongRvrbR, 1
_check_arg_bitwidth_u \strongRvrbL, 1
- _wr_cmd_id stereo, ,,STEREO_OPCODE,,,,,, 0, 0
+ _wr_cmd_id stereo, ,,ASEQ_OP_LAYER_STEREO,,,,,, 0, 0
_wr_u8 (\type << 4) | (\strongR << 3) | (\strongL << 2) | (\strongRvrbR << 1) | (\strongRvrbL << 0)
.endm
@@ -2132,7 +2308,7 @@ $reladdr\@:
* Sets the velocity used in short notes by reading from SHORTVELTBL[velocity]
*/
.macro ldshortvel velocity
- _wr_cmd_id ldshortvel, ,,0xD0,,,,,, \velocity, 4
+ _wr_cmd_id ldshortvel, ,,ASEQ_OP_LAYER_LDSHORTVEL,,,,,, \velocity, 4
.endm
/**
@@ -2141,7 +2317,7 @@ $reladdr\@:
* Sets the gate time used in short notes by reading from SHORTGATETBL[gateTime]
*/
.macro ldshortgate gateTime
- _wr_cmd_id ldshortgate, ,,0xE0,,,,,, \gateTime, 4
+ _wr_cmd_id ldshortgate, ,,ASEQ_OP_LAYER_LDSHORTGATE,,,,,, \gateTime, 4
.endm
#if (MML_VERSION == MML_VERSION_MM)
@@ -2152,7 +2328,7 @@ $reladdr\@:
* TODO DESCRIPTION
*/
.macro unk_F0 arg
- _wr_cmd_id unk_F0, ,,0xF0,,,,,, 0, 0
+ _wr_cmd_id unk_F0, ,,ASEQ_OP_LAYER_F0,,,,,, 0, 0
_wr_s16 \arg
.endm
@@ -2161,9 +2337,8 @@ $reladdr\@:
*
* TODO DESCRIPTION
*/
- #define SURROUNDEFFECT_OPCODE 0xF1
.macro surroundeffect arg
- _wr_cmd_id surroundeffect, ,,SURROUNDEFFECT_OPCODE,,,,,, 0, 0
+ _wr_cmd_id surroundeffect, ,,ASEQ_OP_LAYER_F1,,,,,, 0, 0
_wr_u8 \arg
.endm
@@ -2182,9 +2357,8 @@ $reladdr\@:
*
* This instruction must only be used when long notes are enabled with the noshort instruction.
*/
-#define NOTEDVG_OPCODE 0x00
.macro notedvg pitch, delay, velocity, gateTime
- _wr_cmd_id notedvg, ,,0x00,,,,,, \pitch, 6
+ _wr_cmd_id notedvg, ,,ASEQ_OP_LAYER_NOTEDVG,,,,,, \pitch, 6
_var \delay
_wr_u8 \velocity
_wr_u8 \gateTime
@@ -2197,16 +2371,15 @@ $reladdr\@:
*
* This instruction must only be used when long notes are enabled with the noshort instruction.
*/
-#define NOTEDV_OPCODE 0x40
.macro notedv pitch, delay, velocity
- _wr_cmd_id notedv, ,,NOTEDV_OPCODE,,,,,, \pitch, 6
+ _wr_cmd_id notedv, ,,ASEQ_OP_LAYER_NOTEDV,,,,,, \pitch, 6
_var \delay
_wr_u8 \velocity
.endm
/* Workaround for bugs in vanilla sequences, force long encoding for delay. This should not typically be used. */
.macro noteldv pitch, delay, velocity
- _wr_cmd_id noteldv, ,,0x40,,,,,, \pitch, 6
+ _wr_cmd_id noteldv, ,,ASEQ_OP_LAYER_NOTEDV,,,,,, \pitch, 6
_var_long \delay
_wr_u8 \velocity
.endm
@@ -2219,7 +2392,7 @@ $reladdr\@:
* This instruction must only be used when long notes are enabled with the noshort instruction.
*/
.macro notevg pitch, velocity, gateTime
- _wr_cmd_id notevg, ,,0x80,,,,,, \pitch, 6
+ _wr_cmd_id notevg, ,,ASEQ_OP_LAYER_NOTEVG,,,,,, \pitch, 6
_wr_u8 \velocity
_wr_u8 \gateTime
.endm
@@ -2233,7 +2406,7 @@ $reladdr\@:
* This instruction must only be used when short notes are enabled with the short instruction.
*/
.macro shortdvg pitch, delay
- _wr_cmd_id shortdvg, ,,0x00,,,,,, \pitch, 6
+ _wr_cmd_id shortdvg, ,,ASEQ_OP_LAYER_NOTEDVG,,,,,, \pitch, 6
_var \delay
.endm
@@ -2246,7 +2419,7 @@ $reladdr\@:
* This instruction must only be used when short notes are enabled with the short instruction.
*/
.macro shortdv pitch
- _wr_cmd_id shortdv, ,,0x40,,,,,, \pitch, 6
+ _wr_cmd_id shortdv, ,,ASEQ_OP_LAYER_NOTEDV,,,,,, \pitch, 6
.endm
/**
@@ -2258,7 +2431,7 @@ $reladdr\@:
* This instruction must only be used when short notes are enabled with the short instruction.
*/
.macro shortvg pitch
- _wr_cmd_id shortvg, ,,0x80,,,,,, \pitch, 6
+ _wr_cmd_id shortvg, ,,ASEQ_OP_LAYER_NOTEVG,,,,,, \pitch, 6
.endm
/**
diff --git a/include/audiothread_cmd.h b/include/audiothread_cmd.h
index c0576b82b3..c4a3436311 100644
--- a/include/audiothread_cmd.h
+++ b/include/audiothread_cmd.h
@@ -44,7 +44,7 @@ typedef enum AudioThreadCmdOp {
/* 0xE1 */ AUDIOCMD_OP_GLOBAL_SET_SFX_FONT,
/* 0xE2 */ AUDIOCMD_OP_GLOBAL_SET_INSTRUMENT_FONT,
/* 0xE3 */ AUDIOCMD_OP_GLOBAL_POP_PERSISTENT_CACHE,
- /* 0xF0 */ AUDIOCMD_OP_GLOBAL_SET_SOUND_MODE = 0xF0,
+ /* 0xF0 */ AUDIOCMD_OP_GLOBAL_SET_SOUND_OUTPUT_MODE = 0xF0,
/* 0xF1 */ AUDIOCMD_OP_GLOBAL_MUTE,
/* 0xF2 */ AUDIOCMD_OP_GLOBAL_UNMUTE,
/* 0xF3 */ AUDIOCMD_OP_GLOBAL_SYNC_LOAD_INSTRUMENT,
@@ -412,12 +412,12 @@ typedef enum AudioThreadCmdOp {
AudioThread_QueueCmdS32(AUDIO_MK_CMD(AUDIOCMD_OP_GLOBAL_POP_PERSISTENT_CACHE, 0, 0, 0), tableType)
/**
- * Change the sound mode of audio
+ * Change the sound output mode
*
- * @param soundMode (s32) see the `SoundMode` enum
+ * @param soundOutputMode (s32) see the `SoundOutputMode` enum
*/
-#define AUDIOCMD_GLOBAL_SET_SOUND_MODE(soundMode) \
- AudioThread_QueueCmdS32(AUDIO_MK_CMD(AUDIOCMD_OP_GLOBAL_SET_SOUND_MODE, 0, 0, 0), soundMode)
+#define AUDIOCMD_GLOBAL_SET_SOUND_OUTPUT_MODE(soundOutputMode) \
+ AudioThread_QueueCmdS32(AUDIO_MK_CMD(AUDIOCMD_OP_GLOBAL_SET_SOUND_OUTPUT_MODE, 0, 0, 0), soundOutputMode)
/**
* Mute all sequence players
diff --git a/include/avoid_ub.h b/include/avoid_ub.h
new file mode 100644
index 0000000000..4706f50ecf
--- /dev/null
+++ b/include/avoid_ub.h
@@ -0,0 +1,13 @@
+#ifndef AVOID_UB_H
+#define AVOID_UB_H
+
+/**
+ * This macro is used when the return type of a function is incorrect
+ */
+#ifndef AVOID_UB
+#define BAD_RETURN(type) type
+#else
+#define BAD_RETURN(type) void
+#endif
+
+#endif
diff --git a/include/buffers.h b/include/buffers.h
new file mode 100644
index 0000000000..2a690d2730
--- /dev/null
+++ b/include/buffers.h
@@ -0,0 +1,14 @@
+#ifndef BUFFERS_H
+#define BUFFERS_H
+
+#include "gfx.h"
+#include "ultra64.h"
+
+extern u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; // 0x25800 bytes
+extern u64 gGfxSPTaskOutputBuffer[0x3000]; // 0x18000 bytes
+extern u64 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE / sizeof(u64)]; // 0xC00 bytes
+extern u64 gGfxSPTaskStack[SP_DRAM_STACK_SIZE64]; // 0x400 bytes
+extern GfxPool gGfxPools[2]; // 0x24820 bytes
+extern u8 gAudioHeap[0x38000]; // 0x38000 bytes
+
+#endif
diff --git a/include/build.h b/include/build.h
new file mode 100644
index 0000000000..25afaaa811
--- /dev/null
+++ b/include/build.h
@@ -0,0 +1,8 @@
+#ifndef BUILD_H
+#define BUILD_H
+
+extern const char gBuildCreator[];
+extern const char gBuildDate[];
+extern const char gBuildMakeOption[];
+
+#endif
diff --git a/include/carthandle.h b/include/carthandle.h
new file mode 100644
index 0000000000..72d0821e56
--- /dev/null
+++ b/include/carthandle.h
@@ -0,0 +1,8 @@
+#ifndef CARTHANDLE_H
+#define CARTHANDLE_H
+
+#include "ultra64.h"
+
+extern OSPiHandle* gCartHandle;
+
+#endif
diff --git a/include/color.h b/include/color.h
index 816d38349d..73fa5d63a0 100644
--- a/include/color.h
+++ b/include/color.h
@@ -33,4 +33,6 @@ typedef union Color_RGBA16 {
u16 rgba;
} Color_RGBA16;
+#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0))
+
#endif
diff --git a/include/console_logo_state.h b/include/console_logo_state.h
new file mode 100644
index 0000000000..09b7d66546
--- /dev/null
+++ b/include/console_logo_state.h
@@ -0,0 +1,28 @@
+#ifndef CONSOLE_LOGO_STATE_H
+#define CONSOLE_LOGO_STATE_H
+
+#include "ultra64.h"
+#include "z64game.h"
+#include "z64sram.h"
+#include "z64view.h"
+
+typedef struct ConsoleLogoState {
+ /* 0x0000 */ GameState state;
+ /* 0x00A4 */ u8* staticSegment;
+ /* 0x00A8 */ View view;
+ /* 0x01D0 */ SramContext sramCtx;
+ /* 0x01D4 */ s16 unk_1D4;
+ /* 0x01D6 */ s16 coverAlpha;
+ /* 0x01D8 */ s16 addAlpha;
+ /* 0x01DA */ s16 visibleDuration;
+ /* 0x01DC */ s16 ult;
+ /* 0x01DE */ s16 uls;
+ /* 0x01E0 */ u8 unk_1E0;
+ /* 0x01E1 */ u8 exit;
+ /* 0x01E2 */ char unk_1E2[0x06];
+} ConsoleLogoState; // size = 0x1E8
+
+void ConsoleLogo_Init(GameState* thisx);
+void ConsoleLogo_Destroy(GameState* thisx);
+
+#endif
diff --git a/include/db_camera.h b/include/db_camera.h
new file mode 100644
index 0000000000..81d8515d0b
--- /dev/null
+++ b/include/db_camera.h
@@ -0,0 +1,88 @@
+#ifndef DB_CAMERA_H
+#define DB_CAMERA_H
+
+#include "ultra64.h"
+#include "z64cutscene.h"
+#include "z64math.h"
+
+struct Camera;
+
+typedef struct DebugCamSub {
+ /* 0x0000 */ s16 mode;
+ /* 0x0002 */ s16 nFrames;
+ /* 0x0004 */ s16 nPoints;
+ /* 0x0006 */ s16 unkIdx;
+ /* 0x0008 */ s16 unk_08;
+ /* 0x000A */ s16 unk_0A;
+ /* 0x000C */ s32 unk_0C; // bool: indicates position vs lookAt?
+ /* 0x0010 */ char unk_10[0x14];
+ /* 0x0024 */ CutsceneCameraPoint position[129];
+ /* 0x0834 */ CutsceneCameraPoint lookAt[129];
+ /* 0x1044 */ s16 demoCtrlMenu;
+ /* 0x1046 */ s16 demoCtrlActionIdx; // e (?), s (save), l (load), c (clear)
+ /* 0x1048 */ s16 demoCtrlToggleSwitch;
+ /* 0x104A */ Vec3s unk_104A;
+} DebugCamSub; // size = 0x1050
+
+typedef struct DebugCam {
+ /* 0x00 */ s32 unk_00;
+ /* 0x04 */ Vec3f at;
+ /* 0x10 */ Vec3f eye;
+ /* 0x1C */ Vec3f unk_1C;
+ /* 0x28 */ char unk_28[0xC];
+ /* 0x34 */ s32 unk_34;
+ /* 0x38 */ s32 unk_38;
+ /* 0x3C */ s32 unk_3C; // bool
+ /* 0x40 */ s32 unk_40;
+ /* 0x44 */ s32 unk_44;
+ /* 0x48 */ f32 fov;
+ /* 0x4C */ s16 roll;
+ /* 0x4E */ char unk_4E[0x2];
+ /* 0x50 */ f32 rollDegrees;
+ /* 0x54 */ Vec3f unk_54;
+ /* 0x60 */ Vec3f unk_60;
+ /* 0x6C */ Vec3f unk_6C;
+ /* 0x78 */ s16 unk_78;
+ /* 0x7A */ s16 unk_7A;
+ /* 0x7C */ DebugCamSub sub;
+} DebugCam; // size = 0x10CC
+
+typedef struct DebugCamCut {
+ /* 0x00 */ char letter;
+ /* 0x01 */ u8 unk_01;
+ /* 0x02 */ s16 mode;
+ /* 0x04 */ CutsceneCameraPoint* position;
+ /* 0x08 */ CutsceneCameraPoint* lookAt;
+ /* 0x0C */ s16 nFrames;
+ /* 0x0E */ s16 nPoints;
+} DebugCamCut; // size = 0x10
+
+typedef struct DebugCamAnim {
+ /* 0x00 */ f32 curFrame;
+ /* 0x04 */ f32 unk_04; // frame count?
+ /* 0x08 */ s16 keyframe;
+ /* 0x0A */ s16 unk_0A;
+ /* 0x0C */ s16 unk_0C;
+ /* 0x10 */ Vec3f positionPos; // confusing name
+ /* 0x1C */ Vec3f lookAtPos;
+ /* 0x28 */ f32 roll;
+ /* 0x2C */ f32 fov;
+} DebugCamAnim; // size = 0x30
+
+typedef enum DebugCamTextColor {
+ /* 0 */ DEBUG_CAM_TEXT_YELLOW,
+ /* 1 */ DEBUG_CAM_TEXT_PEACH,
+ /* 2 */ DEBUG_CAM_TEXT_BROWN,
+ /* 3 */ DEBUG_CAM_TEXT_ORANGE,
+ /* 4 */ DEBUG_CAM_TEXT_GOLD,
+ /* 5 */ DEBUG_CAM_TEXT_WHITE,
+ /* 6 */ DEBUG_CAM_TEXT_BLUE,
+ /* 7 */ DEBUG_CAM_TEXT_GREEN
+} DebugCamTextColor;
+
+void DebugCamera_Init(DebugCam* debugCam, struct Camera* cameraPtr);
+void DebugCamera_Enable(DebugCam* debugCam, struct Camera* cam);
+void DebugCamera_Update(DebugCam* debugCam, struct Camera* cam);
+void DebugCamera_Reset(struct Camera* cam, DebugCam* debugCam);
+
+#endif
diff --git a/include/debug_arena.h b/include/debug_arena.h
new file mode 100644
index 0000000000..352a7f6dc6
--- /dev/null
+++ b/include/debug_arena.h
@@ -0,0 +1,38 @@
+#ifndef DEBUG_ARENA_H
+#define DEBUG_ARENA_H
+
+#include "ultra64/ultratypes.h"
+
+void* DebugArena_Malloc(u32 size);
+void* DebugArena_MallocR(u32 size);
+void* DebugArena_Realloc(void* ptr, u32 newSize);
+void DebugArena_Free(void* ptr);
+void* DebugArena_Calloc(u32 num, u32 size);
+void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc);
+void DebugArena_Check(void);
+void DebugArena_Init(void* start, u32 size);
+void DebugArena_Cleanup(void);
+s32 DebugArena_IsInitialized(void);
+
+#if DEBUG_FEATURES
+
+#define DEBUG_ARENA_MALLOC(size, file, line) DebugArena_MallocDebug(size, file, line)
+#define DEBUG_ARENA_MALLOC_R(size, file, line) DebugArena_MallocRDebug(size, file, line)
+#define DEBUG_ARENA_FREE(size, file, line) DebugArena_FreeDebug(size, file, line)
+
+void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
+void* DebugArena_MallocDebug(u32 size, const char* file, int line);
+void* DebugArena_MallocRDebug(u32 size, const char* file, int line);
+void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
+void DebugArena_FreeDebug(void* ptr, const char* file, int line);
+void DebugArena_Display(void);
+
+#else
+
+#define DEBUG_ARENA_MALLOC(size, file, line) DebugArena_Malloc(size)
+#define DEBUG_ARENA_MALLOC_R(size, file, line) DebugArena_MallocR(size)
+#define DEBUG_ARENA_FREE(size, file, line) DebugArena_Free(size)
+
+#endif
+
+#endif
diff --git a/include/fault.h b/include/fault.h
index 8f1979520f..af895927d0 100644
--- a/include/fault.h
+++ b/include/fault.h
@@ -1,9 +1,10 @@
#ifndef FAULT_H
#define FAULT_H
-#include "ultra64.h"
+#include "libu64/debug.h"
+#include "libu64/pad.h"
#include "attributes.h"
-#include "padmgr.h"
+#include "ultra64.h"
#if !PLATFORM_N64
// These are the same as the 3-bit ansi color codes
@@ -50,6 +51,12 @@ void Fault_Init(void);
NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2);
NORETURN void Fault_AddHungupAndCrash(const char* file, int line);
+#if PLATFORM_N64 || DEBUG_FEATURES
+#define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line)
+#else
+#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line)
+#endif
+
// Client Registration
void Fault_AddClient(FaultClient* client, void* callback, void* arg0, void* arg1);
diff --git a/include/file_select_state.h b/include/file_select_state.h
new file mode 100644
index 0000000000..0a831caa0f
--- /dev/null
+++ b/include/file_select_state.h
@@ -0,0 +1,97 @@
+#ifndef FILE_SELECT_STATE_H
+#define FILE_SELECT_STATE_H
+
+#include "ultra64.h"
+#include "z64environment.h"
+#include "z64game.h"
+#include "z64message.h"
+#include "z64skybox.h"
+#include "z64sram.h"
+#include "z64view.h"
+
+typedef struct FileSelectState {
+ /* 0x00000 */ GameState state;
+ /* 0x000A4 */ Vtx* windowVtx;
+ /* 0x000A8 */ u8* staticSegment;
+ /* 0x000AC */ u8* parameterSegment;
+#if OOT_PAL
+ /* 0x000B0 */ u8* objectMagSegment;
+#endif
+ /* 0x000B8 */ View view;
+ /* 0x001E0 */ SramContext sramCtx;
+ /* 0x001E4 */ char unk_1E4[0x4];
+ /* 0x001E8 */ SkyboxContext skyboxCtx;
+ /* 0x00348 */ MessageContext msgCtx;
+ /* 0x0E760 */ Font font;
+ /* 0x1C8E8 */ EnvironmentContext envCtx;
+ /* 0x1C9E4 */ char unk_1C9E4[0x4];
+ /* 0x1C9E8 */ Vtx* windowContentVtx;
+ /* 0x1C9EC */ Vtx* keyboardVtx;
+ /* 0x1C9F0 */ Vtx* nameEntryVtx;
+ /* 0x1C9F4 */ u8 n64ddFlag;
+ /* 0x1C9F6 */ u16 deaths[3];
+ /* 0x1C9FC */ u8 fileNames[3][8];
+ /* 0x1CA14 */ u16 healthCapacities[3];
+ /* 0x1CA1C */ u32 questItems[3];
+ /* 0x1CA28 */ s16 n64ddFlags[3];
+ /* 0x1CA2E */ s8 defense[3];
+#if OOT_PAL
+ /* 0x1CA32 */ u16 health[3];
+#endif
+ /* 0x1CA38 */ s16 buttonIndex;
+ /* 0x1CA3A */ s16 confirmButtonIndex; // 0: yes, 1: quit
+ /* 0x1CA3C */ s16 menuMode;
+ /* 0x1CA3E */ s16 configMode;
+ /* 0x1CA40 */ s16 prevConfigMode;
+ /* 0x1CA42 */ s16 nextConfigMode;
+ /* 0x1CA44 */ s16 selectMode;
+ /* 0x1CA46 */ s16 selectedFileIndex;
+ /* 0x1CA48 */ char unk_1CA48[0x2];
+ /* 0x1CA4A */ s16 fileNamesY[3];
+ /* 0x1CA50 */ s16 actionTimer;
+ /* 0x1CA52 */ s16 buttonYOffsets[6];
+ /* 0x1CA5E */ s16 copyDestFileIndex;
+ /* 0x1CA60 */ s16 warningLabel;
+ /* 0x1CA62 */ s16 warningButtonIndex;
+ /* 0x1CA64 */ s16 titleLabel;
+ /* 0x1CA66 */ s16 nextTitleLabel;
+ /* 0x1CA68 */ s16 windowColor[3];
+ /* 0x1CA6E */ s16 titleAlpha[2];
+ /* 0x1CA72 */ s16 windowAlpha;
+ /* 0x1CA74 */ s16 fileButtonAlpha[3];
+ /* 0x1CA7A */ s16 nameBoxAlpha[3];
+ /* 0x1CA80 */ s16 nameAlpha[3];
+ /* 0x1CA86 */ s16 connectorAlpha[3];
+ /* 0x1CA8C */ s16 fileInfoAlpha[3];
+ /* 0x1CA92 */ s16 actionButtonAlpha[4]; // also contains the alphas for the confirm buttons
+ /* 0x1CA9A */ s16 optionButtonAlpha;
+ /* 0x1CA9C */ s16 nameEntryBoxAlpha;
+ /* 0x1CA9E */ s16 controlsAlpha;
+ /* 0x1CAA0 */ s16 emptyFileTextAlpha;
+ /* 0x1CAA2 */ s16 highlightColor[4];
+ /* 0x1CAAA */ s16 highlightPulseDir; // 0 fade out, 1 fade in
+ /* 0x1CAAC */ s16 unk_1CAAC; // initialized but never used
+ /* 0x1CAAE */ s16 confirmButtonTexIndices[2];
+ /* 0x1CAB2 */ s16 inputTimerX;
+ /* 0x1CAB4 */ s16 inputTimerY;
+ /* 0x1CAB6 */ s16 stickXDir;
+ /* 0x1CAB8 */ s16 stickYDir;
+ /* 0x1CABA */ s16 stickAdjX;
+ /* 0x1CABC */ s16 stickAdjY;
+ /* 0x1CABE */ s16 nameEntryBoxPosX;
+ /* 0x1CAC0 */ s16 windowPosX;
+ /* 0x1CAC4 */ f32 windowRot;
+ /* 0x1CAC8 */ s16 kbdButton; // only for buttons, not characters
+ /* 0x1CACA */ s16 charPage; // 0: hiragana, 1: katakana, 2: alphabet
+ /* 0x1CACC */ s16 charBgAlpha; // square shape the letter sits in
+ /* 0x1CACE */ s16 charIndex; // 0 - 64, top left to bottom right
+ /* 0x1CAD0 */ s16 kbdX; // (0, 0) is top left character
+ /* 0x1CAD2 */ s16 kbdY;
+ /* 0x1CAD4 */ s16 newFileNameCharCount;
+ /* 0x1CAD6 */ s16 unk_1CAD6[5];
+} FileSelectState; // size = 0x1CAE0
+
+void FileSelect_Init(GameState* thisx);
+void FileSelect_Destroy(GameState* thisx);
+
+#endif
diff --git a/include/flag_set.h b/include/flag_set.h
new file mode 100644
index 0000000000..df9262ac7f
--- /dev/null
+++ b/include/flag_set.h
@@ -0,0 +1,8 @@
+#ifndef FLAG_SET_H
+#define FLAG_SET_H
+
+struct PlayState;
+
+void FlagSet_Update(struct PlayState* play);
+
+#endif
diff --git a/include/functions.h b/include/functions.h
deleted file mode 100644
index d861112d49..0000000000
--- a/include/functions.h
+++ /dev/null
@@ -1,291 +0,0 @@
-#ifndef FUNCTIONS_H
-#define FUNCTIONS_H
-
-#include "z64.h"
-#include "macros.h"
-
-void bootproc(void);
-void Main_ThreadEntry(void* arg);
-void Idle_ThreadEntry(void* arg);
-void ViConfig_UpdateVi(u32 black);
-void ViConfig_UpdateBlack(void);
-#if !PLATFORM_IQUE
-void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size);
-#else
-void gzip_decompress(uintptr_t romStart, u8* dst, size_t size);
-#endif
-void Locale_Init(void);
-void Locale_ResetRegion(void);
-#if DEBUG_FEATURES
-void isPrintfInit(void);
-#endif
-void rmonPrintf(const char* fmt, ...);
-#if DEBUG_FEATURES
-void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
-NORETURN void func_80002384(const char* exp, const char* file, int line);
-#endif
-OSPiHandle* osDriveRomInit(void);
-void Mio0_Decompress(u8* src, u8* dst);
-
-void FlagSet_Update(PlayState* play);
-void Overlay_LoadGameState(GameStateOverlay* overlayEntry);
-void Overlay_FreeGameState(GameStateOverlay* overlayEntry);
-
-void ActorOverlayTable_LogPrint(void);
-void ActorOverlayTable_Init(void);
-void ActorOverlayTable_Cleanup(void);
-
-void SaveContext_Init(void);
-s32 func_800635D0(s32);
-void Regs_Init(void);
-void DebugCamera_ScreenText(u8 x, u8 y, const char* text);
-void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text);
-#if DEBUG_FEATURES
-void Regs_UpdateEditor(Input* input);
-#endif
-void Debug_DrawText(GraphicsContext* gfxCtx);
-
-void* MemCpy(void* dest, const void* src, s32 len);
-
-u16 QuestHint_GetSariaTextId(PlayState* play);
-u16 QuestHint_GetNaviTextId(PlayState* play);
-u16 MaskReaction_GetTextId(PlayState* play, u32 maskReactionSet);
-void CutsceneFlags_UnsetAll(PlayState* play);
-void CutsceneFlags_Set(PlayState* play, s16 flag);
-void CutsceneFlags_Unset(PlayState* play, s16 flag);
-s32 CutsceneFlags_Get(PlayState* play, s16 flag);
-
-s32 Kanji_OffsetFromShiftJIS(s32 character);
-#if PLATFORM_IQUE
-void Font_LoadCharCHN(Font* font, u16 character, u16 codePointIndex);
-#endif
-void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex);
-void Font_LoadChar(Font* font, u8 character, u16 codePointIndex);
-void Font_LoadMessageBoxIcon(Font* font, u16 icon);
-void Font_LoadOrderedFont(Font* font);
-
-void Health_InitMeter(PlayState* play);
-void Health_UpdateMeter(PlayState* play);
-void Health_DrawMeter(PlayState* play);
-void Health_UpdateBeatingHeart(PlayState* play);
-u32 Health_IsCritical(void);
-
-void MapMark_Init(PlayState* play);
-void MapMark_ClearPointers(PlayState* play);
-void MapMark_Draw(PlayState* play);
-void PreNmiBuff_Init(PreNmiBuff* this);
-void PreNmiBuff_SetReset(PreNmiBuff* this);
-u32 PreNmiBuff_IsResetting(PreNmiBuff* this);
-void Sched_FlushTaskQueue(void);
-
-Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
-f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
-void Path_CopyLastPoint(Path* path, Vec3f* dest);
-
-void PreNMI_Init(GameState* thisx);
-
-void func_80095AA0(PlayState* play, Room* room, Input* input, s32 arg3);
-void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
- u16 tlutCount, f32 offsetX, f32 offsetY);
-void Room_Init(PlayState* play, Room* room);
-u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx);
-s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 roomNum);
-s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx);
-void Room_Draw(PlayState* play, Room* room, u32 flags);
-void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx);
-void Sample_Destroy(GameState* thisx);
-void Sample_Init(GameState* thisx);
-
-void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* modifEntry, Vtx* vtxBuf, Vec3f* pos);
-void Skin_DrawAnimatedLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, s32 arg3, s32 drawFlags);
-void Skin_DrawLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, Gfx* dlistOverride, s32 drawFlags);
-void func_800A6330(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw, s32 setTranslation);
-void func_800A6360(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
- SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation);
-void func_800A6394(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
- SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6);
-void func_800A63CC(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
- SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6, s32 drawFlags);
-void Skin_GetLimbPos(Skin* skin, s32 limbIndex, Vec3f* offset, Vec3f* dst);
-void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, AnimationHeader* animationHeader);
-void Skin_Free(PlayState* play, Skin* skin);
-s32 Skin_ApplyAnimTransformations(Skin* skin, MtxF* limbMatrices, Actor* actor, s32 setTranslation);
-
-void Sram_InitNewSave(void);
-void Sram_InitDebugSave(void);
-void Sram_OpenSave(SramContext* sramCtx);
-void Sram_WriteSave(SramContext* sramCtx);
-void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCtx);
-void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx);
-void Sram_EraseSave(FileSelectState* fileSelect, SramContext* sramCtx);
-void Sram_CopySave(FileSelectState* fileSelect, SramContext* sramCtx);
-void Sram_WriteSramHeader(SramContext* sramCtx);
-void Sram_InitSram(GameState* gameState, SramContext* sramCtx);
-void Sram_Alloc(GameState* gameState, SramContext* sramCtx);
-void Sram_Init(PlayState* play, SramContext* sramCtx);
-void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration,
- u8 handlePulse, u32 handleSpeed);
-void SsSram_Dma(void* dramAddr, size_t size, s32 direction);
-void SsSram_ReadWrite(s32 addr, void* dramAddr, size_t size, s32 direction);
-
-void ViMode_LogPrint(OSViMode* osViMode);
-void ViMode_Configure(ViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 antialiasOff, s32 modeN, s32 fb16Bit,
- s32 width, s32 height, s32 leftAdjust, s32 rightAdjust, s32 upperAdjust, s32 lowerAdjust);
-void ViMode_Save(ViMode* viMode);
-void ViMode_Load(ViMode* viMode);
-void ViMode_Init(ViMode* viMode);
-void ViMode_Destroy(ViMode* viMode);
-void ViMode_ConfigureFeatures(ViMode* viMode, s32 viFeatures);
-void ViMode_Update(ViMode* viMode, Input* input);
-void PlayerCall_InitFuncPtrs(void);
-void TransitionTile_Destroy(TransitionTile* this);
-TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows);
-void TransitionTile_Draw(TransitionTile* this, Gfx** gfxP);
-void TransitionTile_Update(TransitionTile* this);
-void TransitionTriforce_Start(void* thisx);
-void* TransitionTriforce_Init(void* thisx);
-void TransitionTriforce_Destroy(void* thisx);
-void TransitionTriforce_Update(void* thisx, s32 updateRate);
-void TransitionTriforce_SetColor(void* thisx, u32 color);
-void TransitionTriforce_SetType(void* thisx, s32 type);
-void TransitionTriforce_Draw(void* thisx, Gfx** gfxP);
-s32 TransitionTriforce_IsDone(void* thisx);
-void TransitionWipe_Start(void* thisx);
-void* TransitionWipe_Init(void* thisx);
-void TransitionWipe_Destroy(void* thisx);
-void TransitionWipe_Update(void* thisx, s32 updateRate);
-void TransitionWipe_Draw(void* thisx, Gfx** gfxP);
-s32 TransitionWipe_IsDone(void* thisx);
-void TransitionWipe_SetType(void* thisx, s32 type);
-void TransitionWipe_SetColor(void* thisx, u32 color);
-void TransitionCircle_Start(void* thisx);
-void* TransitionCircle_Init(void* thisx);
-void TransitionCircle_Destroy(void* thisx);
-void TransitionCircle_Update(void* thisx, s32 updateRate);
-void TransitionCircle_Draw(void* thisx, Gfx** gfxP);
-s32 TransitionCircle_IsDone(void* thisx);
-void TransitionCircle_SetType(void* thisx, s32 type);
-void TransitionCircle_SetColor(void* thisx, u32 color);
-void TransitionCircle_SetUnkColor(void* thisx, u32 color);
-void TransitionFade_Start(void* thisx);
-void* TransitionFade_Init(void* thisx);
-void TransitionFade_Destroy(void* thisx);
-void TransitionFade_Update(void* thisx, s32 updateRate);
-void TransitionFade_Draw(void* thisx, Gfx** gfxP);
-s32 TransitionFade_IsDone(void* thisx);
-void TransitionFade_SetColor(void* thisx, u32 color);
-void TransitionFade_SetType(void* thisx, s32 type);
-
-void DebugCamera_Init(DebugCam* debugCam, Camera* cameraPtr);
-void DebugCamera_Enable(DebugCam* debugCam, Camera* cam);
-void DebugCamera_Update(DebugCam* debugCam, Camera* cam);
-void DebugCamera_Reset(Camera* cam, DebugCam* debugCam);
-void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3);
-s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame);
-
-s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw);
-s32 func_800C0DB4(PlayState* this, Vec3f* pos);
-void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
-void PreRender_Init(PreRender* this);
-void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf);
-void PreRender_Destroy(PreRender* this);
-void func_800C170C(PreRender* this, Gfx** gfxP, void* buf, void* bufSave, u32 r, u32 g, u32 b, u32 a);
-void func_800C1AE8(PreRender* this, Gfx** gfxP, void* fbuf, void* fbufSave);
-void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxP);
-void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxP);
-void PreRender_DrawCoverage(PreRender* this, Gfx** gfxP);
-void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxP);
-void func_800C213C(PreRender* this, Gfx** gfxP);
-void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP);
-void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP);
-void PreRender_ApplyFilters(PreRender* this);
-void GameState_SetFBFilter(Gfx** gfxP);
-void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx);
-void GameState_SetFrameBuffer(GraphicsContext* gfxCtx);
-void GameState_ReqPadData(GameState* gameState);
-void GameState_Update(GameState* gameState);
-void GameState_InitArena(GameState* gameState, size_t size);
-void GameState_Realloc(GameState* gameState, size_t size);
-void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* gfxCtx);
-void GameState_Destroy(GameState* gameState);
-GameStateFunc GameState_GetInit(GameState* gameState);
-u32 GameState_IsRunning(GameState* gameState);
-#if DEBUG_FEATURES
-void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line);
-void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line);
-#endif
-void* GameAlloc_Malloc(GameAlloc* this, u32 size);
-void GameAlloc_Free(GameAlloc* this, void* data);
-void GameAlloc_Cleanup(GameAlloc* this);
-void GameAlloc_Init(GameAlloc* this);
-void Graph_InitTHGA(GraphicsContext* gfxCtx);
-GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
-void Graph_Init(GraphicsContext* gfxCtx);
-void Graph_Destroy(GraphicsContext* gfxCtx);
-void Graph_TaskSet00(GraphicsContext* gfxCtx);
-void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState);
-void Graph_ThreadEntry(void*);
-
-ListAlloc* ListAlloc_Init(ListAlloc* this);
-void* ListAlloc_Alloc(ListAlloc* this, u32 size);
-void ListAlloc_Free(ListAlloc* this, void* data);
-void ListAlloc_FreeAll(ListAlloc* this);
-void Main(void* arg);
-void SysCfb_Init(s32 n64dd);
-void* SysCfb_GetFbPtr(s32 idx);
-void* SysCfb_GetFbEnd(void);
-
-u64* SysUcode_GetUCodeBoot(void);
-size_t SysUcode_GetUCodeBootSize(void);
-u64* SysUcode_GetUCode(void);
-u64* SysUcode_GetUCodeData(void);
-NORETURN void func_800D31A0(void);
-void func_800D31F0(void);
-void func_800D3210(void);
-void* DebugArena_Malloc(u32 size);
-void* DebugArena_MallocR(u32 size);
-void* DebugArena_Realloc(void* ptr, u32 newSize);
-void DebugArena_Free(void* ptr);
-void* DebugArena_Calloc(u32 num, u32 size);
-void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc);
-void DebugArena_Check(void);
-void DebugArena_Init(void* start, u32 size);
-void DebugArena_Cleanup(void);
-s32 DebugArena_IsInitialized(void);
-#if DEBUG_FEATURES
-void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
-void* DebugArena_MallocDebug(u32 size, const char* file, int line);
-void* DebugArena_MallocRDebug(u32 size, const char* file, int line);
-void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
-void DebugArena_FreeDebug(void* ptr, const char* file, int line);
-void DebugArena_Display(void);
-#endif
-
-void RcpUtils_PrintRegisterStatus(void);
-void RcpUtils_Reset(void);
-void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd);
-void MtxConv_F2L(Mtx* m1, MtxF* m2);
-void MtxConv_L2F(MtxF* m1, Mtx* m2);
-void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelocs, void* vramStart);
-size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr);
-// ? func_800FC800(?);
-// ? func_800FC83C(?);
-// ? func_800FCAB4(?);
-void SystemHeap_Init(void* start, u32 size);
-
-f32 absf(f32);
-
-void Regs_InitData(PlayState* play);
-
-void Setup_Init(GameState* thisx);
-void Setup_Destroy(GameState* thisx);
-void ConsoleLogo_Init(GameState* thisx);
-void ConsoleLogo_Destroy(GameState* thisx);
-void MapSelect_Init(GameState* thisx);
-void MapSelect_Destroy(GameState* thisx);
-void TitleSetup_Init(GameState* thisx);
-void TitleSetup_Destroy(GameState* thisx);
-void FileSelect_Init(GameState* thisx);
-void FileSelect_Destroy(GameState* thisx);
-
-#endif
diff --git a/include/gamealloc.h b/include/gamealloc.h
new file mode 100644
index 0000000000..c69ea35749
--- /dev/null
+++ b/include/gamealloc.h
@@ -0,0 +1,31 @@
+#ifndef GAMEALLOC_H
+#define GAMEALLOC_H
+
+#include "ultra64/ultratypes.h"
+
+typedef struct GameAllocEntry {
+ /* 0x00 */ struct GameAllocEntry* next;
+ /* 0x04 */ struct GameAllocEntry* prev;
+ /* 0x08 */ u32 size;
+ /* 0x0C */ u32 unk_0C;
+} GameAllocEntry; // size = 0x10
+
+typedef struct GameAlloc {
+ /* 0x00 */ GameAllocEntry base;
+ /* 0x10 */ GameAllocEntry* head;
+} GameAlloc; // size = 0x14
+
+#if DEBUG_FEATURES
+
+#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_MallocDebug(alloc, size, file, line)
+void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line);
+#else
+#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_Malloc(alloc, size)
+#endif
+
+void* GameAlloc_Malloc(GameAlloc* this, u32 size);
+void GameAlloc_Free(GameAlloc* this, void* data);
+void GameAlloc_Cleanup(GameAlloc* this);
+void GameAlloc_Init(GameAlloc* this);
+
+#endif
diff --git a/include/gfx.h b/include/gfx.h
index 46a06649b9..e534655964 100644
--- a/include/gfx.h
+++ b/include/gfx.h
@@ -7,6 +7,9 @@
#include "thga.h"
#include "versions.h"
+#define SCREEN_WIDTH 320
+#define SCREEN_HEIGHT 240
+
// Texture memory size, 4 KiB
#define TMEM_SIZE 0x1000
@@ -54,6 +57,8 @@ typedef struct GraphicsContext {
/* 0x02FC */ char unk_2FC[0x04];
} GraphicsContext; // size = 0x300
+extern Gfx gEmptyDL[];
+
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
@@ -117,4 +122,44 @@ void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file,
#endif
+void Graph_ThreadEntry(void*);
+
+extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut"
+extern u64 gMojiFontTex[]; // original name: "font_ff"
+
+/**
+ * `x` vertex x
+ * `y` vertex y
+ * `z` vertex z
+ * `s` texture s coordinate
+ * `t` texture t coordinate
+ * `crnx` red component of color vertex, or x component of normal vertex
+ * `cgny` green component of color vertex, or y component of normal vertex
+ * `cbnz` blue component of color vertex, or z component of normal vertex
+ * `a` alpha
+ */
+#define VTX(x,y,z,s,t,crnx,cgny,cbnz,a) { { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } } }
+
+#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } }
+
+#define gDPSetTileCustom(pkt, fmt, siz, uls, ult, lrs, lrt, pal, \
+ cms, cmt, masks, maskt, shifts, shiftt) \
+_DW({ \
+ gDPPipeSync(pkt); \
+ gDPTileSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), 0, \
+ G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPTileSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((((lrs) - (uls) + 1) * siz##_LINE_BYTES) + 7) >> 3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, \
+ (uls) << G_TEXTURE_IMAGE_FRAC, \
+ (ult) << G_TEXTURE_IMAGE_FRAC, \
+ (lrs) << G_TEXTURE_IMAGE_FRAC, \
+ (lrt) << G_TEXTURE_IMAGE_FRAC); \
+})
+
#endif
diff --git a/include/global.h b/include/global.h
deleted file mode 100644
index d2a081a5fb..0000000000
--- a/include/global.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef GLOBAL_H
-#define GLOBAL_H
-
-#include "functions.h"
-#include "variables.h"
-#include "macros.h"
-#include "versions.h"
-
-#endif
diff --git a/include/idle.h b/include/idle.h
new file mode 100644
index 0000000000..1317775d53
--- /dev/null
+++ b/include/idle.h
@@ -0,0 +1,12 @@
+#ifndef IDLE_H
+#define IDLE_H
+
+#include "ultra64.h"
+
+void Idle_ThreadEntry(void* arg);
+
+extern OSMesgQueue gPiMgrCmdQueue;
+extern OSViMode gViConfigMode;
+extern u8 gViConfigModeType;
+
+#endif
diff --git a/include/inflate.h b/include/inflate.h
new file mode 100644
index 0000000000..f26f7e496b
--- /dev/null
+++ b/include/inflate.h
@@ -0,0 +1,10 @@
+#ifndef INFLATE_H
+#define INFLATE_H
+
+#include "libc/stddef.h"
+#include "libc/stdint.h"
+#include "ultra64.h"
+
+void gzip_decompress(uintptr_t romStart, u8* dst, size_t size);
+
+#endif
diff --git a/include/irqmgr.h b/include/irqmgr.h
index b931977ab0..b841fb141f 100644
--- a/include/irqmgr.h
+++ b/include/irqmgr.h
@@ -46,4 +46,6 @@ void IrqMgr_RemoveClient(IrqMgr* irqMgr, IrqMgrClient* client);
extern vu32 gIrqMgrResetStatus;
extern volatile OSTime gIrqMgrRetraceTime;
+extern IrqMgr gIrqMgr;
+
#endif
diff --git a/include/is_debug.h b/include/is_debug.h
new file mode 100644
index 0000000000..e5f03bb784
--- /dev/null
+++ b/include/is_debug.h
@@ -0,0 +1,18 @@
+#ifndef IS_DEBUG_H
+#define IS_DEBUG_H
+
+#include "libc/stddef.h"
+#include "attributes.h"
+
+#if DEBUG_FEATURES
+void isPrintfInit(void);
+#endif
+
+void rmonPrintf(const char* fmt, ...);
+
+#if DEBUG_FEATURES
+void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
+NORETURN void func_80002384(const char* exp, const char* file, int line);
+#endif
+
+#endif
diff --git a/include/kanread.h b/include/kanread.h
new file mode 100644
index 0000000000..bea4831c81
--- /dev/null
+++ b/include/kanread.h
@@ -0,0 +1,8 @@
+#ifndef KANREAD_H
+#define KANREAD_H
+
+#include "ultra64/ultratypes.h"
+
+s32 Kanji_OffsetFromShiftJIS(s32 sjis);
+
+#endif
diff --git a/include/language_array.h b/include/language_array.h
new file mode 100644
index 0000000000..b93dbd4e0e
--- /dev/null
+++ b/include/language_array.h
@@ -0,0 +1,12 @@
+#ifndef LANGUAGE_ARRAY_H
+#define LANGUAGE_ARRAY_H
+
+#include "versions.h"
+
+#if OOT_NTSC
+#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { jpn, eng }
+#else
+#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { eng, ger, fra }
+#endif
+
+#endif
diff --git a/include/libc64/malloc.h b/include/libc64/malloc.h
index 86b58d17ca..02540e3530 100644
--- a/include/libc64/malloc.h
+++ b/include/libc64/malloc.h
@@ -16,13 +16,22 @@ void SystemArena_Cleanup(void);
s32 SystemArena_IsInitialized(void);
#if DEBUG_FEATURES
+#define SYSTEM_ARENA_MALLOC(size, file, line) SystemArena_MallocDebug(size, file, line)
+#define SYSTEM_ARENA_MALLOC_R(size, file, line) SystemArena_MallocRDebug(size, file, line)
+#define SYSTEM_ARENA_FREE(size, file, line) SystemArena_FreeDebug(size, file, line)
+
void* SystemArena_MallocDebug(u32 size, const char* file, int line);
void* SystemArena_MallocRDebug(u32 size, const char* file, int line);
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
void SystemArena_FreeDebug(void* ptr, const char* file, int line);
void SystemArena_Display(void);
+#else
+#define SYSTEM_ARENA_MALLOC(size, file, line) SystemArena_Malloc(size)
+#define SYSTEM_ARENA_MALLOC_R(size, file, line) SystemArena_MallocR(size)
+#define SYSTEM_ARENA_FREE(size, file, line) SystemArena_Free(size)
#endif
extern Arena gSystemArena;
+extern s32 gSystemArenaLogSeverity;
#endif
diff --git a/include/libu64/debug.h b/include/libu64/debug.h
index 598c901957..87015afde8 100644
--- a/include/libu64/debug.h
+++ b/include/libu64/debug.h
@@ -3,12 +3,33 @@
#include "ultra64.h"
+#if DEBUG_FEATURES
+#define LOG(exp, value, format, file, line) \
+ do { \
+ LogUtils_LogThreadId(file, line); \
+ osSyncPrintf(exp " = " format "\n", value); \
+ } while (0)
+#else
+#define LOG(exp, value, format, file, line) (void)(value)
+#endif
+
+#define LOG_STRING(string, file, line) LOG(#string, string, "%s", file, line)
+#define LOG_ADDRESS(exp, value, file, line) LOG(exp, value, "%08x", file, line)
+#define LOG_TIME(exp, value, file, line) LOG(exp, value, "%lld", file, line)
+#define LOG_NUM(exp, value, file, line) LOG(exp, value, "%d", file, line)
+#define LOG_HEX(exp, value, file, line) LOG(exp, value, "%x", file, line)
+#define LOG_HEX32(exp, value, file, line) LOG(exp, value, "%08x", file, line)
+#define LOG_FLOAT(exp, value, file, line) LOG(exp, value, "%f", file, line)
+
#if PLATFORM_N64 || DEBUG_FEATURES
f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min,
const char* maxName, f32 max);
#endif
#if DEBUG_FEATURES
+#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) LogUtils_CheckNullPointer(exp, ptr, file, line)
+#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) LogUtils_CheckValidPointer(exp, ptr, file, line)
+
s32 LogUtils_CheckIntRange(const char* exp, int line, const char* valueName, s32 value, const char* minName, s32 min,
const char* maxName, s32 max);
void LogUtils_LogHexDump(void* ptr, s32 size0);
@@ -17,6 +38,11 @@ void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* fi
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line);
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line);
void LogUtils_LogThreadId(const char* name, int line);
+#else
+
+#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) (void)0
+#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) (void)0
+
#endif
void LogUtils_HungupThread(const char* name, int line);
diff --git a/include/libu64/mtxuty-cvt.h b/include/libu64/mtxuty-cvt.h
new file mode 100644
index 0000000000..636978bb6f
--- /dev/null
+++ b/include/libu64/mtxuty-cvt.h
@@ -0,0 +1,9 @@
+#ifndef LIBU64_MTXUTY_CVT_H
+#define LIBU64_MTXUTY_CVT_H
+
+#include "ultra64.h"
+
+void MtxConv_F2L(Mtx* m1, MtxF* m2);
+void MtxConv_L2F(MtxF* m1, Mtx* m2);
+
+#endif
diff --git a/include/libu64/overlay.h b/include/libu64/overlay.h
new file mode 100644
index 0000000000..47f3276576
--- /dev/null
+++ b/include/libu64/overlay.h
@@ -0,0 +1,42 @@
+#ifndef LIBU64_OVERLAY_H
+#define LIBU64_OVERLAY_H
+
+#include "ultra64.h"
+
+/* Relocation entry field getters */
+#define RELOC_SECTION(reloc) ((reloc) >> 30)
+#define RELOC_OFFSET(reloc) ((reloc) & 0xFFFFFF)
+#define RELOC_TYPE_MASK(reloc) ((reloc) & 0x3F000000)
+#define RELOC_TYPE_SHIFT 24
+
+/* MIPS Relocation Types, matches the MIPS ELF spec */
+#define R_MIPS_32 2
+#define R_MIPS_26 4
+#define R_MIPS_HI16 5
+#define R_MIPS_LO16 6
+
+/* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */
+typedef enum RelocSectionId {
+ /* 0 */ RELOC_SECTION_NULL,
+ /* 1 */ RELOC_SECTION_TEXT,
+ /* 2 */ RELOC_SECTION_DATA,
+ /* 3 */ RELOC_SECTION_RODATA,
+ /* 4 */ RELOC_SECTION_MAX
+} RelocSectionId;
+
+typedef struct OverlayRelocationSection {
+ /* 0x00 */ u32 textSize;
+ /* 0x04 */ u32 dataSize;
+ /* 0x08 */ u32 rodataSize;
+ /* 0x0C */ u32 bssSize;
+ /* 0x10 */ u32 nRelocations;
+ /* 0x14 */ u32 relocations[1]; // size is nRelocations
+} OverlayRelocationSection; // size >= 0x18
+
+extern s32 gOverlayLogSeverity;
+
+void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd);
+void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelocs, void* vramStart);
+size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr);
+
+#endif
diff --git a/include/libu64/rcp_utils.h b/include/libu64/rcp_utils.h
new file mode 100644
index 0000000000..7582305142
--- /dev/null
+++ b/include/libu64/rcp_utils.h
@@ -0,0 +1,6 @@
+#ifndef LIBU64_RCP_UTILS_H
+#define LIBU64_RCP_UTILS_H
+
+void RcpUtils_Reset(void);
+
+#endif
diff --git a/include/libu64/runtime.h b/include/libu64/runtime.h
new file mode 100644
index 0000000000..7df947cef5
--- /dev/null
+++ b/include/libu64/runtime.h
@@ -0,0 +1,8 @@
+#ifndef LIBU64_RUNTIME_H
+#define LIBU64_RUNTIME_H
+
+#include "ultra64.h"
+
+void Runtime_Init(void* start, u32 size);
+
+#endif
diff --git a/include/line_numbers.h b/include/line_numbers.h
index bc11d555db..adc2d654d5 100644
--- a/include/line_numbers.h
+++ b/include/line_numbers.h
@@ -1,6 +1,8 @@
#ifndef LINE_NUMBERS_H
#define LINE_NUMBERS_H
+#include "versions.h"
+
// The macros in this file serve to reduce clutter from version differences that are only due to line numbers being different.
// The "LN" macros defined here are not meant to be used directly. See the wrapper macros below.
diff --git a/include/listalloc.h b/include/listalloc.h
new file mode 100644
index 0000000000..76321a3e87
--- /dev/null
+++ b/include/listalloc.h
@@ -0,0 +1,16 @@
+#ifndef LISTALLOC_H
+#define LISTALLOC_H
+
+#include "ultra64/ultratypes.h"
+
+typedef struct ListAlloc {
+ /* 0x00 */ struct ListAlloc* prev;
+ /* 0x04 */ struct ListAlloc* next;
+} ListAlloc; // size = 0x8
+
+ListAlloc* ListAlloc_Init(ListAlloc* this);
+void* ListAlloc_Alloc(ListAlloc* this, u32 size);
+void ListAlloc_Free(ListAlloc* this, void* data);
+void ListAlloc_FreeAll(ListAlloc* this);
+
+#endif
diff --git a/include/macros.h b/include/macros.h
deleted file mode 100644
index 343484028d..0000000000
--- a/include/macros.h
+++ /dev/null
@@ -1,197 +0,0 @@
-#ifndef MACROS_H
-#define MACROS_H
-
-#include "terminal.h"
-#include "versions.h"
-
-#ifndef AVOID_UB
-#define BAD_RETURN(type) type
-#else
-#define BAD_RETURN(type) void
-#endif
-
-/**
- * The T macro holds translations in English for original debug strings written in Japanese.
- * The translated strings match the original debug strings, they are only direct translations.
- * For example, any original name is left as is rather than being replaced with the name in the codebase.
- */
-#define T(jp, en) jp
-
-#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
-#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
-#define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0]))
-
-#define PHYSICAL_TO_VIRTUAL(addr) (void*)((uintptr_t)(addr) + 0x80000000)
-#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - 0x80000000)
-
-#define ABS(x) ((x) >= 0 ? (x) : -(x))
-#define DECR(x) ((x) == 0 ? 0 : --(x))
-#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
-#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
-#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))
-
-#define SWAP(type, a, b) \
- { \
- type _temp = (a); \
- (a) = (b); \
- (b) = _temp; \
- } \
- (void)0
-
-#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0))
-
-#define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask))
-
-// IDO doesn't support variadic macros, but it merely throws a warning for the
-// number of arguments not matching the definition (warning 609) instead of
-// throwing an error. We suppress this warning and rely on GCC to catch macro
-// argument errors instead.
-// Note some tools define __sgi but preprocess with a modern cpp implementation,
-// ensure that these do not use the IDO workaround to avoid errors.
-#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX)
-
-#if DEBUG_FEATURES
-#define PRINTF osSyncPrintf
-#elif defined(EGCS)
-#define PRINTF(format, args...) while (0) osSyncPrintf(format, ##args)
-#elif IDO_PRINTF_WORKAROUND
-#define PRINTF(args) (void)0
-#else
-#define PRINTF(format, ...) (void)0
-#endif
-
-#if DEBUG_FEATURES
-#define PRINTF_COLOR_BLACK() PRINTF(VT_FGCOL(BLACK))
-#define PRINTF_COLOR_RED() PRINTF(VT_FGCOL(RED))
-#define PRINTF_COLOR_GREEN() PRINTF(VT_FGCOL(GREEN))
-#define PRINTF_COLOR_YELLOW() PRINTF(VT_FGCOL(YELLOW))
-#define PRINTF_COLOR_BLUE() PRINTF(VT_FGCOL(BLUE))
-#define PRINTF_COLOR_MAGENTA() PRINTF(VT_FGCOL(MAGENTA))
-#define PRINTF_COLOR_CYAN() PRINTF(VT_FGCOL(CYAN))
-#define PRINTF_COLOR_WHITE() PRINTF(VT_FGCOL(WHITE))
-#define PRINTF_COLOR_WARNING() PRINTF(VT_COL(YELLOW, BLACK))
-#define PRINTF_COLOR_ERROR() PRINTF(VT_COL(RED, WHITE))
-#define PRINTF_RST() PRINTF(VT_RST)
-#else
-#define PRINTF_COLOR_BLACK() (void)0
-#define PRINTF_COLOR_RED() (void)0
-#define PRINTF_COLOR_GREEN() (void)0
-#define PRINTF_COLOR_YELLOW() (void)0
-#define PRINTF_COLOR_BLUE() (void)0
-#define PRINTF_COLOR_MAGENTA() (void)0
-#define PRINTF_COLOR_CYAN() (void)0
-#define PRINTF_COLOR_WHITE() (void)0
-#define PRINTF_COLOR_WARNING() (void)0
-#define PRINTF_COLOR_ERROR() (void)0
-#define PRINTF_RST() (void)0
-#endif
-
-#if DEBUG_FEATURES
-#define LOG(exp, value, format, file, line) \
- do { \
- LogUtils_LogThreadId(file, line); \
- osSyncPrintf(exp " = " format "\n", value); \
- } while (0)
-#else
-#define LOG(exp, value, format, file, line) (void)(value)
-#endif
-
-#define LOG_STRING(string, file, line) LOG(#string, string, "%s", file, line)
-#define LOG_ADDRESS(exp, value, file, line) LOG(exp, value, "%08x", file, line)
-#define LOG_TIME(exp, value, file, line) LOG(exp, value, "%lld", file, line)
-#define LOG_NUM(exp, value, file, line) LOG(exp, value, "%d", file, line)
-#define LOG_HEX(exp, value, file, line) LOG(exp, value, "%x", file, line)
-#define LOG_HEX32(exp, value, file, line) LOG(exp, value, "%08x", file, line)
-#define LOG_FLOAT(exp, value, file, line) LOG(exp, value, "%f", file, line)
-
-#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
- if (1) { \
- GameState* state = curState; \
- \
- (state)->init = newInit; \
- (state)->size = sizeof(newStruct); \
- } (void)0
-
-#if DEBUG_FEATURES
-
-#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line)
-#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, file, line)
-#define GAME_STATE_ALLOC(gameState, size, file, line) GameState_Alloc(gameState, size, file, line)
-#define DEBUG_ARENA_MALLOC(size, file, line) DebugArena_MallocDebug(size, file, line)
-#define DEBUG_ARENA_MALLOC_R(size, file, line) DebugArena_MallocRDebug(size, file, line)
-#define DEBUG_ARENA_FREE(size, file, line) DebugArena_FreeDebug(size, file, line)
-#define SYSTEM_ARENA_MALLOC(size, file, line) SystemArena_MallocDebug(size, file, line)
-#define SYSTEM_ARENA_MALLOC_R(size, file, line) SystemArena_MallocRDebug(size, file, line)
-#define SYSTEM_ARENA_FREE(size, file, line) SystemArena_FreeDebug(size, file, line)
-#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) LogUtils_CheckNullPointer(exp, ptr, file, line)
-#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) LogUtils_CheckValidPointer(exp, ptr, file, line)
-#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_MallocDebug(alloc, size, file, line)
-
-#else
-
-#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSync(ram, vrom, size)
-#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg)
-#define GAME_STATE_ALLOC(gameState, size, file, line) THA_AllocTailAlign16(&(gameState)->tha, size)
-#define DEBUG_ARENA_MALLOC(size, file, line) DebugArena_Malloc(size)
-#define DEBUG_ARENA_MALLOC_R(size, file, line) DebugArena_MallocR(size)
-#define DEBUG_ARENA_FREE(size, file, line) DebugArena_Free(size)
-#define SYSTEM_ARENA_MALLOC(size, file, line) SystemArena_Malloc(size)
-#define SYSTEM_ARENA_MALLOC_R(size, file, line) SystemArena_MallocR(size)
-#define SYSTEM_ARENA_FREE(size, file, line) SystemArena_Free(size)
-#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) (void)0
-#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) (void)0
-#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_Malloc(alloc, size)
-
-#endif
-
-#if PLATFORM_N64 || DEBUG_FEATURES
-#define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line)
-#else
-#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line)
-#endif
-
-#define MATRIX_FINALIZE_AND_LOAD(pkt, gfxCtx, file, line) \
- gSPMatrix(pkt, MATRIX_FINALIZE(gfxCtx, file, line), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW)
-
-#if OOT_NTSC
-#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { jpn, eng }
-#else
-#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { eng, ger, fra }
-#endif
-
-/**
- * `x` vertex x
- * `y` vertex y
- * `z` vertex z
- * `s` texture s coordinate
- * `t` texture t coordinate
- * `crnx` red component of color vertex, or x component of normal vertex
- * `cgny` green component of color vertex, or y component of normal vertex
- * `cbnz` blue component of color vertex, or z component of normal vertex
- * `a` alpha
- */
-#define VTX(x,y,z,s,t,crnx,cgny,cbnz,a) { { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } } }
-
-#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } }
-
-#define gDPSetTileCustom(pkt, fmt, siz, uls, ult, lrs, lrt, pal, \
- cms, cmt, masks, maskt, shifts, shiftt) \
-_DW({ \
- gDPPipeSync(pkt); \
- gDPTileSync(pkt); \
- gDPSetTile(pkt, fmt, siz, \
- (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), 0, \
- G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, \
- shifts); \
- gDPTileSync(pkt); \
- gDPSetTile(pkt, fmt, siz, \
- (((((lrs) - (uls) + 1) * siz##_LINE_BYTES) + 7) >> 3), 0, \
- G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, shifts); \
- gDPSetTileSize(pkt, G_TX_RENDERTILE, \
- (uls) << G_TEXTURE_IMAGE_FRAC, \
- (ult) << G_TEXTURE_IMAGE_FRAC, \
- (lrs) << G_TEXTURE_IMAGE_FRAC, \
- (lrt) << G_TEXTURE_IMAGE_FRAC); \
-})
-
-#endif
diff --git a/include/map.h b/include/map.h
index 23d3eb3c88..ef82c03554 100644
--- a/include/map.h
+++ b/include/map.h
@@ -67,6 +67,9 @@ typedef struct MapData {
#define MAP_48x85_TEX_HEIGHT 85
#define MAP_48x85_TEX_SIZE ((MAP_48x85_TEX_WIDTH * MAP_48x85_TEX_HEIGHT) / 2) // 48x85 CI4 texture
+extern MapData gMapDataTable;
+extern MapData* gMapData;
+
void Map_SavePlayerInitialInfo(struct PlayState* play);
void Map_SetFloorPalettesData(struct PlayState* play, s16 floor);
void Map_InitData(struct PlayState* play, s16 room);
diff --git a/include/map_select_state.h b/include/map_select_state.h
new file mode 100644
index 0000000000..d2a6b43d19
--- /dev/null
+++ b/include/map_select_state.h
@@ -0,0 +1,41 @@
+#ifndef MAP_SELECT_STATE_H
+#define MAP_SELECT_STATE_H
+
+#include "ultra64.h"
+#include "z64game.h"
+#include "z64view.h"
+
+struct MapSelectState;
+
+typedef struct MapSelectEntry {
+ /* 0x00 */ char* name;
+ /* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32);
+ /* 0x08 */ s32 entranceIndex;
+} MapSelectEntry; // size = 0xC
+
+typedef struct MapSelectState {
+ /* 0x0000 */ GameState state;
+ /* 0x00A8 */ View view;
+ /* 0x01D0 */ s32 count;
+ /* 0x01D4 */ MapSelectEntry* entries;
+ /* 0x01D8 */ s32 currentEntry;
+ /* 0x01DC */ s32 pageDownIndex; // Index of pageDownStops
+ /* 0x01E0 */ s32 pageDownStops[7];
+ /* 0x01FC */ char unk_1FC[0x0C];
+ /* 0x0208 */ s32 opt;
+ /* 0x020C */ s32 topDisplayedEntry; // The entry which is currently at the top of the screen
+ /* 0x0210 */ char unk_210[0x0C];
+ /* 0x021C */ s32 verticalInputAccumulator;
+ /* 0x0220 */ s32 verticalInput;
+ /* 0x0224 */ s32 timerUp;
+ /* 0x0228 */ s32 timerDown;
+ /* 0x022C */ s32 lockUp;
+ /* 0x0230 */ s32 lockDown;
+ /* 0x0234 */ s32 unk_234; // unused
+ /* 0x0238 */ u8* staticSegment;
+} MapSelectState; // size = 0x240
+
+void MapSelect_Init(GameState* thisx);
+void MapSelect_Destroy(GameState* thisx);
+
+#endif
diff --git a/include/memory_utils.h b/include/memory_utils.h
new file mode 100644
index 0000000000..7a8d9aca91
--- /dev/null
+++ b/include/memory_utils.h
@@ -0,0 +1,9 @@
+#ifndef MEMORY_UTILS_H
+#define MEMORY_UTILS_H
+
+#include "ultra64.h"
+
+void* MemCpy(void* dest, const void* src, s32 len);
+void* MemSet(void* dest, s32 val, s32 len);
+
+#endif
diff --git a/include/mio0.h b/include/mio0.h
new file mode 100644
index 0000000000..d350b45551
--- /dev/null
+++ b/include/mio0.h
@@ -0,0 +1,8 @@
+#ifndef MIO0_H
+#define MIO0_H
+
+#include "ultra64.h"
+
+void Mio0_Decompress(u8* src, u8* dst);
+
+#endif
diff --git a/include/prenmi_buff.h b/include/prenmi_buff.h
new file mode 100644
index 0000000000..b0a9e66f72
--- /dev/null
+++ b/include/prenmi_buff.h
@@ -0,0 +1,25 @@
+#ifndef PRENMI_BUFF_H
+#define PRENMI_BUFF_H
+
+#include "ultra64.h"
+#include "alignment.h"
+
+// This struct is used at osAppNMIBuffer which is not at an 8-byte aligned address. This causes an unaligned access
+// crash if the OSTime variables use 64-bit load/store instructions, which is the case in any MIPS ABI other than O32
+// 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
+// code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code.
+ALIGNED(4) typedef struct PreNmiBuff {
+ /* 0x00 */ u32 resetting;
+ /* 0x04 */ u32 resetCount;
+ /* 0x08 */ OSTime duration;
+ /* 0x10 */ OSTime resetTime;
+} PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused)
+
+extern PreNmiBuff* gAppNmiBufferPtr;
+
+void PreNmiBuff_Init(PreNmiBuff* this);
+void PreNmiBuff_SetReset(PreNmiBuff* this);
+u32 PreNmiBuff_IsResetting(PreNmiBuff* this);
+
+#endif
diff --git a/include/prenmi_state.h b/include/prenmi_state.h
new file mode 100644
index 0000000000..3710425ca9
--- /dev/null
+++ b/include/prenmi_state.h
@@ -0,0 +1,16 @@
+#ifndef PRENMI_STATE_H
+#define PRENMI_STATE_H
+
+#include "ultra64.h"
+#include "z64game.h"
+
+typedef struct PreNMIState {
+ /* 0x00 */ GameState state;
+ /* 0xA4 */ u32 timer;
+ /* 0xA8 */ s32 unk_A8;
+} PreNMIState; // size = 0xAC
+
+void PreNMI_Init(GameState* thisx);
+void PreNMI_Destroy(GameState* thisx);
+
+#endif
diff --git a/include/prerender.h b/include/prerender.h
index ca16826341..0674fac020 100644
--- a/include/prerender.h
+++ b/include/prerender.h
@@ -2,11 +2,7 @@
#define PRERENDER_H
#include "ultra64/ultratypes.h"
-
-typedef struct ListAlloc {
- /* 0x00 */ struct ListAlloc* prev;
- /* 0x04 */ struct ListAlloc* next;
-} ListAlloc; // size = 0x8
+#include "listalloc.h"
typedef struct PreRender {
/* 0x00 */ s32 width;
@@ -30,4 +26,19 @@ typedef struct PreRender {
/* 0x4C */ u32 unk_4C;
} PreRender; // size = 0x50
+void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
+void PreRender_Init(PreRender* this);
+void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf);
+void PreRender_Destroy(PreRender* this);
+void func_800C170C(PreRender* this, Gfx** gfxP, void* buf, void* bufSave, u32 r, u32 g, u32 b, u32 a);
+void func_800C1AE8(PreRender* this, Gfx** gfxP, void* fbuf, void* fbufSave);
+void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxP);
+void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxP);
+void PreRender_DrawCoverage(PreRender* this, Gfx** gfxP);
+void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxP);
+void func_800C213C(PreRender* this, Gfx** gfxP);
+void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP);
+void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP);
+void PreRender_ApplyFilters(PreRender* this);
+
#endif
diff --git a/include/printf.h b/include/printf.h
new file mode 100644
index 0000000000..a2a31a39e5
--- /dev/null
+++ b/include/printf.h
@@ -0,0 +1,51 @@
+#ifndef PRINTF_H
+#define PRINTF_H
+
+#include "terminal.h"
+#include "ultra64.h"
+
+// IDO doesn't support variadic macros, but it merely throws a warning for the
+// number of arguments not matching the definition (warning 609) instead of
+// throwing an error. We suppress this warning and rely on GCC to catch macro
+// argument errors instead.
+// Note some tools define __sgi but preprocess with a modern cpp implementation,
+// ensure that these do not use the IDO workaround to avoid errors.
+#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX)
+
+#if DEBUG_FEATURES
+#define PRINTF osSyncPrintf
+#elif defined(EGCS)
+#define PRINTF(format, args...) while (0) osSyncPrintf(format, ##args)
+#elif IDO_PRINTF_WORKAROUND
+#define PRINTF(args) (void)0
+#else
+#define PRINTF(format, ...) (void)0
+#endif
+
+#if DEBUG_FEATURES
+#define PRINTF_COLOR_BLACK() PRINTF(VT_FGCOL(BLACK))
+#define PRINTF_COLOR_RED() PRINTF(VT_FGCOL(RED))
+#define PRINTF_COLOR_GREEN() PRINTF(VT_FGCOL(GREEN))
+#define PRINTF_COLOR_YELLOW() PRINTF(VT_FGCOL(YELLOW))
+#define PRINTF_COLOR_BLUE() PRINTF(VT_FGCOL(BLUE))
+#define PRINTF_COLOR_MAGENTA() PRINTF(VT_FGCOL(MAGENTA))
+#define PRINTF_COLOR_CYAN() PRINTF(VT_FGCOL(CYAN))
+#define PRINTF_COLOR_WHITE() PRINTF(VT_FGCOL(WHITE))
+#define PRINTF_COLOR_WARNING() PRINTF(VT_COL(YELLOW, BLACK))
+#define PRINTF_COLOR_ERROR() PRINTF(VT_COL(RED, WHITE))
+#define PRINTF_RST() PRINTF(VT_RST)
+#else
+#define PRINTF_COLOR_BLACK() (void)0
+#define PRINTF_COLOR_RED() (void)0
+#define PRINTF_COLOR_GREEN() (void)0
+#define PRINTF_COLOR_YELLOW() (void)0
+#define PRINTF_COLOR_BLUE() (void)0
+#define PRINTF_COLOR_MAGENTA() (void)0
+#define PRINTF_COLOR_CYAN() (void)0
+#define PRINTF_COLOR_WHITE() (void)0
+#define PRINTF_COLOR_WARNING() (void)0
+#define PRINTF_COLOR_ERROR() (void)0
+#define PRINTF_RST() (void)0
+#endif
+
+#endif
diff --git a/include/regs.h b/include/regs.h
index 89cb022bc9..509f5ea583 100644
--- a/include/regs.h
+++ b/include/regs.h
@@ -1,8 +1,11 @@
#ifndef REGS_H
#define REGS_H
+#include "ultra64.h"
#include "versions.h"
+struct PlayState;
+
#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc.
#define REG_PAGES 6
#define REGS_PER_PAGE 16
@@ -419,6 +422,8 @@ typedef struct RegEditor {
/* 0x14 */ s16 data[REG_GROUPS * REGS_PER_GROUP]; // Accessed through *REG macros, see regs.h
} RegEditor; // size = 0x15D4
+void Regs_InitData(struct PlayState* play);
+
extern RegEditor* gRegEditor;
#endif
diff --git a/include/sample_state.h b/include/sample_state.h
new file mode 100644
index 0000000000..b568a83f95
--- /dev/null
+++ b/include/sample_state.h
@@ -0,0 +1,17 @@
+#ifndef SAMPLE_STATE_H
+#define SAMPLE_STATE_H
+
+#include "ultra64.h"
+#include "z64game.h"
+#include "z64view.h"
+
+typedef struct SampleState {
+ /* 0x0000 */ GameState state;
+ /* 0x00A4 */ u8* staticSegment;
+ /* 0x00A8 */ View view;
+} SampleState; // size = 0x1D0
+
+void Sample_Init(GameState* thisx);
+void Sample_Destroy(GameState* thisx);
+
+#endif
diff --git a/include/sched.h b/include/sched.h
index 2d20e7ec09..bf204bc6d9 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -69,6 +69,7 @@ typedef struct Scheduler {
void Sched_Notify(Scheduler* sc);
void Sched_Init(Scheduler* sc, void* stack, OSPri priority, u8 viModeType, UNK_TYPE arg4, IrqMgr* irqMgr);
+void Sched_FlushTaskQueue(void);
extern Scheduler gScheduler;
diff --git a/include/segment_symbols.h b/include/segment_symbols.h
index 1aacb246d0..d036e7cec0 100644
--- a/include/segment_symbols.h
+++ b/include/segment_symbols.h
@@ -1,8 +1,8 @@
#ifndef SEGMENT_SYMBOLS_H
#define SEGMENT_SYMBOLS_H
+#include "ultra64/ultratypes.h"
#include "versions.h"
-#include "z64.h"
#define DECLARE_SEGMENT(name) \
extern u8 _##name##SegmentStart[]; \
diff --git a/include/seqcmd.h b/include/seqcmd.h
index 5acce7c493..53fce27bfb 100644
--- a/include/seqcmd.h
+++ b/include/seqcmd.h
@@ -56,7 +56,7 @@ typedef enum SeqCmdSetupCmdOp {
// Subset of `SEQCMD_OP_GLOBAL_CMD`
typedef enum SeqCmdSubCmdOp {
- /* 0x0 */ SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE,
+ /* 0x0 */ SEQCMD_SUB_OP_GLOBAL_SET_SOUND_OUTPUT_MODE,
/* 0x1 */ SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES
} SeqCmdSubCmdOp;
@@ -479,12 +479,12 @@ typedef enum SeqCmdSubCmdOp {
*/
/**
- * Change the sound mode of audio
+ * Change the sound output mode
*
- * @param soundMode see the `SoundMode` enum
+ * @param soundOutputMode see the `SoundOutputMode` enum
*/
-#define SEQCMD_SET_SOUND_MODE(soundMode) \
- Audio_QueueSeqCmd((SEQCMD_OP_GLOBAL_CMD << 28) | (SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE << 8) | (u8)(soundMode))
+#define SEQCMD_SET_SOUND_OUTPUT_MODE(soundOutputMode) \
+ Audio_QueueSeqCmd((SEQCMD_OP_GLOBAL_CMD << 28) | (SEQCMD_SUB_OP_GLOBAL_SET_SOUND_OUTPUT_MODE << 8) | (u8)(soundOutputMode))
/**
* Disable (or reenable) new sequences from starting
diff --git a/include/setup_state.h b/include/setup_state.h
new file mode 100644
index 0000000000..863b71401e
--- /dev/null
+++ b/include/setup_state.h
@@ -0,0 +1,13 @@
+#ifndef SETUP_STATE_H
+#define SETUP_STATE_H
+
+#include "z64game.h"
+
+typedef struct SetupState {
+ /* 0x00 */ GameState state;
+} SetupState; // size = 0xA4
+
+void Setup_Init(GameState* thisx);
+void Setup_Destroy(GameState* thisx);
+
+#endif
diff --git a/include/sfx.h b/include/sfx.h
index 16d0b122d3..4dfb96f9b4 100644
--- a/include/sfx.h
+++ b/include/sfx.h
@@ -6,6 +6,8 @@
#include "z64math.h"
#include "libc/assert.h"
+#define MAX_CHANNELS_PER_BANK 3
+
typedef enum SfxBankType {
/* 0 */ BANK_PLAYER,
/* 1 */ BANK_ITEM,
@@ -178,4 +180,36 @@ extern Vec3f gSfxDefaultPos;
extern f32 gSfxDefaultFreqAndVolScale;
extern s8 gSfxDefaultReverb;
+extern SfxParams* gSfxParams[7];
+extern char D_80133390[];
+extern char D_80133398[];
+extern u8 gSfxRequestWriteIndex;
+extern u8 gSfxRequestReadIndex;
+extern SfxBankEntry* gSfxBanks[7];
+extern u8 gSfxBankSizes[];
+extern u8 gSfxChannelLayout;
+extern u16 D_801333D0;
+extern Vec3f gSfxDefaultPos;
+extern f32 gSfxDefaultFreqAndVolScale;
+extern s8 gSfxDefaultReverb;
+
+#if DEBUG_FEATURES
+extern u8 D_801333F0;
+extern u8 gAudioSfxSwapOff;
+extern u8 D_801333F8;
+#endif
+
+extern SfxBankEntry D_8016BAD0[9];
+extern SfxBankEntry D_8016BC80[12];
+extern SfxBankEntry D_8016BEC0[22];
+extern SfxBankEntry D_8016C2E0[20];
+extern SfxBankEntry D_8016C6A0[8];
+extern SfxBankEntry D_8016C820[3];
+extern SfxBankEntry D_8016C8B0[5];
+extern ActiveSfx gActiveSfx[7][MAX_CHANNELS_PER_BANK]; // total size = 0xA8
+extern u8 gSfxBankMuted[];
+extern u16 gAudioSfxSwapSource[10];
+extern u16 gAudioSfxSwapTarget[10];
+extern u8 gAudioSfxSwapMode[10];
+
#endif
diff --git a/include/speed_meter.h b/include/speed_meter.h
index 393c89de8d..f8779902f9 100644
--- a/include/speed_meter.h
+++ b/include/speed_meter.h
@@ -1,7 +1,7 @@
#ifndef SPEEDMETER_H
#define SPEEDMETER_H
-#include "ultra64/ultratypes.h"
+#include "ultra64.h"
struct GraphicsContext;
struct GameState;
@@ -12,6 +12,20 @@ typedef struct SpeedMeter {
/* 0x1C */ s32 y;
} SpeedMeter; // size = 0x20
+extern volatile OSTime gAudioThreadUpdateTimeTotalPerGfxTask;
+extern volatile OSTime gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime;
+extern volatile OSTime gRSPAudioTimeTotal;
+extern volatile OSTime gRSPGfxTimeTotal;
+extern volatile OSTime gRDPTimeTotal;
+extern volatile OSTime gGraphUpdatePeriod;
+extern volatile OSTime gAudioThreadUpdateTimeStart;
+extern volatile OSTime gAudioThreadUpdateTimeAcc;
+extern volatile OSTime gRSPAudioTimeAcc;
+extern volatile OSTime gRSPGfxTimeAcc;
+extern volatile OSTime gRSPOtherTimeAcc;
+extern volatile OSTime D_8016A578;
+extern volatile OSTime gRDPTimeAcc;
+
void SpeedMeter_Init(SpeedMeter* this);
void SpeedMeter_Destroy(SpeedMeter* this);
void SpeedMeter_DrawTimeEntries(SpeedMeter* this, struct GraphicsContext* gfxCtx);
diff --git a/include/sys_cfb.h b/include/sys_cfb.h
new file mode 100644
index 0000000000..5b7039175d
--- /dev/null
+++ b/include/sys_cfb.h
@@ -0,0 +1,10 @@
+#ifndef SYS_CFB_H
+#define SYS_CFB_H
+
+#include "ultra64.h"
+
+void SysCfb_Init(s32 n64dd);
+void* SysCfb_GetFbPtr(s32 idx);
+void* SysCfb_GetFbEnd(void);
+
+#endif
diff --git a/include/sys_debug_controller.h b/include/sys_debug_controller.h
new file mode 100644
index 0000000000..0345d85aaf
--- /dev/null
+++ b/include/sys_debug_controller.h
@@ -0,0 +1,13 @@
+#ifndef SYS_DEBUG_CONTROLLER_H
+#define SYS_DEBUG_CONTROLLER_H
+
+#include "ultra64/ultratypes.h"
+
+#if DEBUG_FEATURES
+extern u32 gIsCtrlr2Valid;
+
+void func_800D31F0(void);
+void func_800D3210(void);
+#endif
+
+#endif
diff --git a/include/sys_freeze.h b/include/sys_freeze.h
new file mode 100644
index 0000000000..0e033cacd9
--- /dev/null
+++ b/include/sys_freeze.h
@@ -0,0 +1,8 @@
+#ifndef SYS_FREEZE_H
+#define SYS_FREEZE_H
+
+#include "attributes.h"
+
+NORETURN void func_800D31A0(void);
+
+#endif
diff --git a/include/sys_matrix.h b/include/sys_matrix.h
index 1d136a06ee..2708af81ee 100644
--- a/include/sys_matrix.h
+++ b/include/sys_matrix.h
@@ -11,8 +11,8 @@ typedef enum MatrixMode {
/* 1 */ MTXMODE_APPLY // applies transformation to the current matrix
} MatrixMode;
-extern Mtx gMtxClear;
-extern MtxF gMtxFClear;
+extern Mtx gIdentityMtx;
+extern MtxF gIdentityMtxF;
/* Stack operations */
@@ -64,6 +64,9 @@ Mtx* Matrix_Finalize(struct GraphicsContext* gfxCtx);
#endif
+#define MATRIX_FINALIZE_AND_LOAD(pkt, gfxCtx, file, line) \
+ gSPMatrix(pkt, MATRIX_FINALIZE(gfxCtx, file, line), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW)
+
/* Vector operations */
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest);
diff --git a/include/sys_ucode.h b/include/sys_ucode.h
new file mode 100644
index 0000000000..fa690d4784
--- /dev/null
+++ b/include/sys_ucode.h
@@ -0,0 +1,11 @@
+#ifndef SYS_UCODE_H
+#define SYS_UCODE_H
+
+#include "ultra64.h"
+
+u64* SysUcode_GetUCodeBoot(void);
+size_t SysUcode_GetUCodeBootSize(void);
+u64* SysUcode_GetUCode(void);
+u64* SysUcode_GetUCodeData(void);
+
+#endif
diff --git a/include/title_setup_state.h b/include/title_setup_state.h
new file mode 100644
index 0000000000..30219872a8
--- /dev/null
+++ b/include/title_setup_state.h
@@ -0,0 +1,15 @@
+#ifndef TITLE_SETUP_STATE_H
+#define TITLE_SETUP_STATE_H
+
+#include "z64game.h"
+#include "z64view.h"
+
+typedef struct TitleSetupState {
+ /* 0x0000 */ GameState state;
+ /* 0x00A8 */ View view;
+} TitleSetupState; // size = 0x1D0
+
+void TitleSetup_Init(GameState* thisx);
+void TitleSetup_Destroy(GameState* thisx);
+
+#endif
diff --git a/include/transition_circle.h b/include/transition_circle.h
new file mode 100644
index 0000000000..23dec1d9d5
--- /dev/null
+++ b/include/transition_circle.h
@@ -0,0 +1,55 @@
+#ifndef TRANSITION_CIRCLE_H
+#define TRANSITION_CIRCLE_H
+
+#include "ultra64.h"
+#include "color.h"
+
+typedef enum TransitionCircleAppearance {
+ /* 0 */ TCA_NORMAL,
+ /* 1 */ TCA_WAVE,
+ /* 2 */ TCA_RIPPLE,
+ /* 3 */ TCA_STARBURST
+} TransitionCircleAppearance;
+
+typedef enum TransitionCircleColor {
+ /* 0 */ TCC_BLACK,
+ /* 1 */ TCC_WHITE,
+ /* 2 */ TCC_GRAY,
+ /* 3 */ TCC_SPECIAL // color varies depending on appearance. unused and appears broken
+} TransitionCircleColor;
+
+typedef enum TransitionCircleSpeed {
+ /* 0 */ TCS_FAST,
+ /* 1 */ TCS_SLOW
+} TransitionCircleSpeed;
+
+typedef struct TransitionCircle {
+ /* 0x000 */ Color_RGBA8_u32 color;
+ /* 0x004 */ Color_RGBA8_u32 unkColor;
+ /* 0x008 */ s32 texX;
+ /* 0x00C */ s32 texY;
+ /* 0x010 */ s32 speed;
+ /* 0x014 */ u8 direction;
+ /* 0x015 */ u8 colorType;
+ /* 0x016 */ u8 speedType;
+ /* 0x017 */ u8 appearanceType;
+ /* 0x018 */ u8 isDone;
+ /* 0x019 */ u8 frame;
+ /* 0x01A */ u16 normal;
+ /* 0x020 */ Mtx projection;
+ /* 0x060 */ Mtx lookAt;
+ /* 0x0A0 */ void* texture;
+ /* 0x0A8 */ Mtx modelView[2][3];
+} TransitionCircle; // size = 0x228
+
+void TransitionCircle_Start(void* thisx);
+void* TransitionCircle_Init(void* thisx);
+void TransitionCircle_Destroy(void* thisx);
+void TransitionCircle_Update(void* thisx, s32 updateRate);
+void TransitionCircle_Draw(void* thisx, Gfx** gfxP);
+s32 TransitionCircle_IsDone(void* thisx);
+void TransitionCircle_SetType(void* thisx, s32 type);
+void TransitionCircle_SetColor(void* thisx, u32 color);
+void TransitionCircle_SetUnkColor(void* thisx, u32 color);
+
+#endif
diff --git a/include/transition_fade.h b/include/transition_fade.h
new file mode 100644
index 0000000000..be4e575e0c
--- /dev/null
+++ b/include/transition_fade.h
@@ -0,0 +1,24 @@
+#ifndef TRANSITION_FADE_H
+#define TRANSITION_FADE_H
+
+#include "ultra64.h"
+#include "color.h"
+
+typedef struct TransitionFade {
+ /* 0x000 */ u8 type;
+ /* 0x001 */ u8 isDone;
+ /* 0x002 */ u8 direction;
+ /* 0x004 */ Color_RGBA8_u32 color;
+ /* 0x008 */ u16 timer;
+} TransitionFade; // size = 0xC
+
+void TransitionFade_Start(void* thisx);
+void* TransitionFade_Init(void* thisx);
+void TransitionFade_Destroy(void* thisx);
+void TransitionFade_Update(void* thisx, s32 updateRate);
+void TransitionFade_Draw(void* thisx, Gfx** gfxP);
+s32 TransitionFade_IsDone(void* thisx);
+void TransitionFade_SetColor(void* thisx, u32 color);
+void TransitionFade_SetType(void* thisx, s32 type);
+
+#endif
diff --git a/include/transition_tile.h b/include/transition_tile.h
new file mode 100644
index 0000000000..14191f3fe7
--- /dev/null
+++ b/include/transition_tile.h
@@ -0,0 +1,30 @@
+#ifndef TRANSITION_TILE_H
+#define TRANSITION_TILE_H
+
+#include "ultra64.h"
+
+typedef struct TransitionTileVtxData {
+ /* 0x0 */ f32 x;
+ /* 0x4 */ f32 y;
+} TransitionTileVtxData; // size = 0x8
+
+typedef struct TransitionTile {
+ /* 0x00 */ s32 cols;
+ /* 0x04 */ s32 rows;
+ /* 0x08 */ s32 frame;
+ /* 0x0C */ TransitionTileVtxData* vtxData;
+ /* 0x10 */ Vtx* vtxFrame1;
+ /* 0x14 */ Vtx* vtxFrame2;
+ /* 0x18 */ Mtx projection;
+ /* 0x58 */ Mtx modelView;
+ /* 0x98 */ Mtx unk_98;
+ /* 0xD8 */ Gfx* gfx; // "gfxtbl"
+ /* 0xDC */ u16* zBuffer;
+} TransitionTile; // size = 0xE0
+
+TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows);
+void TransitionTile_Destroy(TransitionTile* this);
+void TransitionTile_Update(TransitionTile* this);
+void TransitionTile_Draw(TransitionTile* this, Gfx** gfxP);
+
+#endif
diff --git a/include/transition_triforce.h b/include/transition_triforce.h
new file mode 100644
index 0000000000..85eb1597ea
--- /dev/null
+++ b/include/transition_triforce.h
@@ -0,0 +1,27 @@
+#ifndef TRANSITION_TRIFORCE_H
+#define TRANSITION_TRIFORCE_H
+
+#include "ultra64.h"
+#include "color.h"
+
+typedef struct TransitionTriforce {
+ /* 0x000 */ Color_RGBA8_u32 color;
+ /* 0x004 */ f32 transPos;
+ /* 0x008 */ f32 step;
+ /* 0x00C */ s32 state;
+ /* 0x010 */ s32 type;
+ /* 0x018 */ Mtx projection;
+ /* 0x058 */ s32 frame;
+ /* 0x060 */ Mtx modelView[2][3];
+} TransitionTriforce; // size = 0x1E0
+
+void TransitionTriforce_Start(void* thisx);
+void* TransitionTriforce_Init(void* thisx);
+void TransitionTriforce_Destroy(void* thisx);
+void TransitionTriforce_Update(void* thisx, s32 updateRate);
+void TransitionTriforce_SetColor(void* thisx, u32 color);
+void TransitionTriforce_SetType(void* thisx, s32 type);
+void TransitionTriforce_Draw(void* thisx, Gfx** gfxP);
+s32 TransitionTriforce_IsDone(void* thisx);
+
+#endif
diff --git a/include/transition_wipe.h b/include/transition_wipe.h
new file mode 100644
index 0000000000..654e9b6230
--- /dev/null
+++ b/include/transition_wipe.h
@@ -0,0 +1,30 @@
+#ifndef TRANSITION_WIPE_H
+#define TRANSITION_WIPE_H
+
+#include "ultra64.h"
+#include "color.h"
+
+typedef struct TransitionWipe {
+ /* 0x000 */ Color_RGBA8_u32 color;
+ /* 0x004 */ Color_RGBA8_u32 unkColor;
+ /* 0x008 */ u8 direction;
+ /* 0x009 */ u8 frame;
+ /* 0x00A */ u8 isDone;
+ /* 0x00C */ u16 texX;
+ /* 0x00E */ u16 texY;
+ /* 0x010 */ u16 normal;
+ /* 0x018 */ Mtx projection;
+ /* 0x058 */ Mtx lookAt;
+ /* 0x098 */ Mtx modelView[2][3];
+} TransitionWipe; // size = 0x218
+
+void TransitionWipe_Start(void* thisx);
+void* TransitionWipe_Init(void* thisx);
+void TransitionWipe_Destroy(void* thisx);
+void TransitionWipe_Update(void* thisx, s32 updateRate);
+void TransitionWipe_Draw(void* thisx, Gfx** gfxP);
+s32 TransitionWipe_IsDone(void* thisx);
+void TransitionWipe_SetType(void* thisx, s32 type);
+void TransitionWipe_SetColor(void* thisx, u32 color);
+
+#endif
diff --git a/include/translation.h b/include/translation.h
new file mode 100644
index 0000000000..6583326701
--- /dev/null
+++ b/include/translation.h
@@ -0,0 +1,16 @@
+#ifndef TRANSLATION_H
+#define TRANSLATION_H
+
+/**
+ * The "T" macro holds translations in English for original debug strings written in Japanese.
+ * The translated strings are only direct translations. Certain names or terms may not reflect
+ * their in-game localized counterparts.
+ *
+ * To use translated English strings in the build, change the definition below to "en".
+ *
+ * Note: This translation macro exists for quality of life purposes.
+ * The original game would not have had a macro like this.
+ */
+#define T(jp, en) jp
+
+#endif
diff --git a/include/ultra64.h b/include/ultra64.h
index 30e43563e9..4a8696a841 100644
--- a/include/ultra64.h
+++ b/include/ultra64.h
@@ -24,12 +24,19 @@
#include "ultra64/sptask.h"
#include "ultra64/gu.h"
#include "ultra64/vi.h"
+#include "ultra64/viint.h"
#include "ultra64/pi.h"
#include "ultra64/controller.h"
#include "ultra64/mbi.h"
#include "ultra64/pfs.h"
#include "ultra64/motor.h"
+#include "ultra64/os_pi.h"
+#include "ultra64/os_system.h"
+#include "ultra64/os_vi.h"
+#include "ultra64/osint.h"
+#include "ultra64/piint.h"
#include "ultra64/R4300.h"
+#include "ultra64/siint.h"
#include "ultra64/ucode.h"
#include "ultra64/version.h"
@@ -105,6 +112,7 @@ OSMesgQueue* osPiGetCmdQueue(void);
s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data);
void osViSetSpecialFeatures(u32 func);
OSPiHandle* osCartRomInit(void);
+OSPiHandle* osDriveRomInit(void);
void __osSetFpcCsr(u32);
u32 __osGetFpcCsr(void);
s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data);
@@ -189,7 +197,6 @@ void osViSetEvent(OSMesgQueue* mq, OSMesg msg, u32 retraceCount);
s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern);
void __osPfsRequestData(u8 cmd);
void __osPfsGetInitData(u8* pattern, OSContStatus* contData);
-void guS2DInitBg(union uObjBg* bg);
s32 __osPfsSelectBank(OSPfs* pfs, u8 bank);
s32 osContSetCh(u8 ch);
s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state);
diff --git a/include/ultra64/controller.h b/include/ultra64/controller.h
index 1b6d0cf323..e233f00484 100644
--- a/include/ultra64/controller.h
+++ b/include/ultra64/controller.h
@@ -182,4 +182,9 @@ typedef struct __OSContReadFormat {
/* 0x07 */ s8 joyY;
} __OSContReadFormat; // size = 0x8
+extern u8 __osContLastCmd;
+extern OSPifRam __osContPifRam;
+extern OSPifRam __osPfsPifRam;
+extern u8 __osMaxControllers;
+
#endif
diff --git a/include/ultra64/gbi.h b/include/ultra64/gbi.h
index 55171076d6..fe248cdf69 100644
--- a/include/ultra64/gbi.h
+++ b/include/ultra64/gbi.h
@@ -1,8 +1,10 @@
-#include "mbi.h"
#ifndef ULTRA64_GBI_H
#define ULTRA64_GBI_H
+#include "mbi.h"
+#include "ultratypes.h"
+
#ifdef GBI_DOWHILE
/* Private macro to wrap other macros in do {...} while (0) */
#define _DW(macro) do { macro } while (0)
diff --git a/include/ultra64/gs2dex.h b/include/ultra64/gs2dex.h
index 031dcb9f7d..3e15c49d14 100644
--- a/include/ultra64/gs2dex.h
+++ b/include/ultra64/gs2dex.h
@@ -1,6 +1,8 @@
#ifndef GS2DEX_H
#define GS2DEX_H
+#include "ultratypes.h"
+
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
diff --git a/include/ultra64/os_pi.h b/include/ultra64/os_pi.h
new file mode 100644
index 0000000000..5a13f05fd9
--- /dev/null
+++ b/include/ultra64/os_pi.h
@@ -0,0 +1,8 @@
+#ifndef ULTRA64_OS_PI_H
+#define ULTRA64_OS_PI_H
+
+#include "pi.h"
+
+extern OSPiHandle* __osPiTable;
+
+#endif
diff --git a/include/ultra64/os_system.h b/include/ultra64/os_system.h
new file mode 100644
index 0000000000..19558c3103
--- /dev/null
+++ b/include/ultra64/os_system.h
@@ -0,0 +1,31 @@
+#ifndef ULTRA64_OS_SYSTEM_H
+#define ULTRA64_OS_SYSTEM_H
+
+#include "exception.h"
+#include "ultratypes.h"
+
+extern s32 osRomType; /* Bulk or cartridge ROM. 0=cartridge 1=bulk */
+extern void* osRomBase; /* Rom base address of the game image */
+extern s32 osTvType; /* 0 = PAL, 1 = NTSC, 2 = MPAL */
+extern s32 osResetType; /* 0 = cold reset, 1 = NMI */
+extern s32 osCicId;
+extern s32 osVersion;
+extern u32 osMemSize; /* Memory Size */
+extern s32 osAppNMIBuffer[0x10];
+
+extern OSIntMask __OSGlobalIntMask;
+
+#ifdef BBPLAYER
+extern u32 __osBbIsBb;
+extern u32 __osBbEepromSize;
+extern u32 __osBbPakSize;
+extern u32 __osBbFlashSize;
+extern u32 __osBbEepromAddress;
+extern u32 __osBbPakAddress[4];
+extern u32 __osBbFlashAddress;
+extern u32 __osBbSramSize;
+extern u32 __osBbSramAddress;
+extern u32 __osBbHackFlags;
+#endif
+
+#endif
diff --git a/include/ultra64/os_vi.h b/include/ultra64/os_vi.h
new file mode 100644
index 0000000000..3b38b60fe4
--- /dev/null
+++ b/include/ultra64/os_vi.h
@@ -0,0 +1,11 @@
+#ifndef ULTRA64_OS_VI_H
+#define ULTRA64_OS_VI_H
+
+#include "vi.h"
+
+extern OSViMode osViModeNtscLan1;
+extern OSViMode osViModePalLan1;
+extern OSViMode osViModeMpalLan1;
+extern OSViMode osViModeFpalLan1;
+
+#endif
diff --git a/include/ultra64/osint.h b/include/ultra64/osint.h
new file mode 100644
index 0000000000..ec254d4163
--- /dev/null
+++ b/include/ultra64/osint.h
@@ -0,0 +1,22 @@
+#ifndef ULTRA64_OSINT_H
+#define ULTRA64_OSINT_H
+
+#include "time.h"
+#include "thread.h"
+#include "ultratypes.h"
+
+extern __OSThreadTail __osThreadTail;
+
+extern OSThread* __osRunningThread;
+extern OSThread* __osActiveQueue;
+extern OSThread* __osFaultedThread;
+extern OSThread* __osRunQueue;
+
+extern OSTimer* __osTimerList;
+extern u32 __osBaseCounter;
+extern OSTime __osCurrentTime;
+extern u32 __osViIntrCount;
+extern u32 __osTimerCounter;
+extern u32 __osShutdown;
+
+#endif
diff --git a/include/ultra64/pi.h b/include/ultra64/pi.h
index af18c407ea..42a90d7609 100644
--- a/include/ultra64/pi.h
+++ b/include/ultra64/pi.h
@@ -1,6 +1,7 @@
#ifndef ULTRA64_PI_H
#define ULTRA64_PI_H
+#include "stddef.h"
#include "message.h"
typedef struct __OSBlockInfo {
diff --git a/include/ultra64/piint.h b/include/ultra64/piint.h
new file mode 100644
index 0000000000..59b200a6cf
--- /dev/null
+++ b/include/ultra64/piint.h
@@ -0,0 +1,11 @@
+#ifndef ULTRA64_PIINT_H
+#define ULTRA64_PIINT_H
+
+#include "ultratypes.h"
+#include "pi.h"
+
+extern OSPiHandle* __osCurrentHandle[];
+extern OSMesgQueue __osPiAccessQueue;
+extern u32 __osPiAccessQueueEnabled;
+
+#endif
diff --git a/include/ultra64/siint.h b/include/ultra64/siint.h
new file mode 100644
index 0000000000..d43489b657
--- /dev/null
+++ b/include/ultra64/siint.h
@@ -0,0 +1,8 @@
+#ifndef ULTRA64_SIINT_H
+#define ULTRA64_SIINT_H
+
+#include "pfs.h"
+
+extern u8 __osPfsInodeCacheBank;
+
+#endif
diff --git a/include/ultra64/viint.h b/include/ultra64/viint.h
index 2df9936405..25a6ceb041 100644
--- a/include/ultra64/viint.h
+++ b/include/ultra64/viint.h
@@ -1,6 +1,9 @@
#ifndef ULTRA64_VIINT_H
#define ULTRA64_VIINT_H
+#include "vi.h"
+#include "ultratypes.h"
+
#define VI_STATE_MODE_SET (1 << 0)
#define VI_STATE_XSCALE_SET (1 << 1)
#define VI_STATE_YSCALE_FACTOR_SET (1 << 2)
@@ -43,4 +46,8 @@
#define VI_CTRL_PIXEL_ADV_DEFAULT VI_CTRL_PIXEL_ADV(3)
#endif
+extern OSViContext* __osViCurr;
+extern OSViContext* __osViNext;
+extern u32 __additional_scanline;
+
#endif
diff --git a/include/variables.h b/include/variables.h
deleted file mode 100644
index f5f4599e7a..0000000000
--- a/include/variables.h
+++ /dev/null
@@ -1,228 +0,0 @@
-#ifndef VARIABLES_H
-#define VARIABLES_H
-
-#include "z64.h"
-#include "libc64/os_malloc.h"
-#include "segment_symbols.h"
-
-extern Mtx D_01000000;
-
-extern void* osRomBase;
-extern s32 osTvType;
-extern u32 osRomType;
-extern u32 osVersion;
-extern s32 osResetType;
-extern s32 osCicId;
-extern u32 osMemSize;
-extern u8 osAppNMIBuffer[0x40];
-
-extern u32 __osBbIsBb;
-extern u32 __osBbEepromSize;
-extern u32 __osBbPakSize;
-extern u32 __osBbFlashSize;
-extern u32 __osBbEepromAddress;
-extern u32 __osBbPakAddress[4];
-extern u32 __osBbFlashAddress;
-extern u32 __osBbSramSize;
-extern u32 __osBbSramAddress;
-extern u32 __osBbHackFlags;
-
-extern s8 D_80009430;
-extern vu8 gViConfigBlack;
-extern u8 gViConfigAdditionalScanLines;
-extern u32 gViConfigFeatures;
-extern f32 gViConfigXScale;
-extern f32 gViConfigYScale;
-extern OSPiHandle* gCartHandle;
-extern s32 gCurrentRegion;
-extern u32 __osPiAccessQueueEnabled;
-extern OSViMode osViModePalLan1;
-extern s32 osViClock;
-extern u32 __osShutdown;
-extern OSHWIntr __OSGlobalIntMask;
-extern __OSThreadTail __osThreadTail;
-extern OSThread* __osRunQueue;
-extern OSThread* __osActiveQueue;
-extern OSThread* __osRunningThread;
-extern OSThread* __osFaultedThread;
-extern OSPiHandle* __osPiTable;
-extern OSPiHandle* __osCurrentHandle[];
-extern OSTimer* __osTimerList;
-extern OSViMode osViModeNtscLan1;
-extern OSViMode osViModeMpalLan1;
-extern OSViContext* __osViCurr;
-extern OSViContext* __osViNext;
-extern OSViMode osViModeFpalLan1;
-extern u32 __additional_scanline;
-extern const char gBuildCreator[];
-extern const char gBuildDate[];
-extern const char gBuildMakeOption[];
-extern OSMesgQueue gPiMgrCmdQueue;
-extern OSViMode gViConfigMode;
-extern u8 gViConfigModeType;
-extern OSMesgQueue __osPiAccessQueue;
-extern OSPiHandle __Dom1SpeedParam;
-extern OSPiHandle __Dom2SpeedParam;
-extern OSTime __osCurrentTime;
-extern u32 __osBaseCounter;
-extern u32 __osViIntrCount;
-extern u32 __osTimerCounter;
-extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX];
-extern Gfx D_80116280[];
-extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0
-extern s32 gMaxActorId; // original name: "MaxProfile"
-extern s32 gDebugCamEnabled;
-extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX];
-extern s32 gZeldaArenaLogSeverity;
-extern MapData gMapDataTable;
-extern s16 gSpoilingItems[3];
-extern s16 gSpoilingItemReverts[3];
-
-extern Gfx gEmptyDL[];
-
-extern u16 gSramSlotOffsets[];
-// 4 16-colors palettes
-extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut"
-extern u64 gMojiFontTex[]; // original name: "font_ff"
-extern u8 gBossMarkState;
-
-#if DEBUG_FEATURES
-extern u32 gIsCtrlr2Valid;
-#endif
-extern s16* gWaveSamples[9];
-extern f32 gBendPitchOneOctaveFrequencies[256];
-extern f32 gBendPitchTwoSemitonesFrequencies[256];
-extern f32 gPitchFrequencies[];
-extern u8 gDefaultShortNoteVelocityTable[16];
-extern u8 gDefaultShortNoteGateTimeTable[16];
-extern EnvelopePoint gDefaultEnvelope[4];
-extern NoteSubEu gZeroNoteSub;
-extern NoteSubEu gDefaultNoteSub;
-extern u16 gHaasEffectDelaySizes[64];
-extern s16 D_8012FBA8[];
-extern f32 gHeadsetPanVolume[128];
-extern f32 gStereoPanVolume[128];
-extern f32 gDefaultPanVolume[128];
-extern s16 gLowPassFilterData[16 * 8];
-extern s16 gHighPassFilterData[15 * 8];
-extern s32 gAudioContextInitialized;
-extern u8 gIsLargeSfxBank[7];
-extern u8 gChannelsPerBank[4][7];
-extern u8 gUsedChannelsPerBank[4][7];
-extern u8 gMorphaTransposeTable[16];
-extern u8* gFrogsSongPtr;
-extern OcarinaNote* gScarecrowLongSongPtr;
-extern u8* gScarecrowSpawnSongPtr;
-extern OcarinaSongButtons gOcarinaSongButtons[];
-extern SfxParams* gSfxParams[7];
-extern char D_80133390[];
-extern char D_80133398[];
-extern u8 gSfxRequestWriteIndex;
-extern u8 gSfxRequestReadIndex;
-extern SfxBankEntry* gSfxBanks[7];
-extern u8 gSfxBankSizes[];
-extern u8 gSfxChannelLayout;
-extern u16 D_801333D0;
-extern Vec3f gSfxDefaultPos;
-extern f32 gSfxDefaultFreqAndVolScale;
-extern s8 gSfxDefaultReverb;
-#if DEBUG_FEATURES
-extern u8 D_801333F0;
-extern u8 gAudioSfxSwapOff;
-extern u8 D_801333F8;
-#endif
-extern u8 gSeqCmdWritePos;
-extern u8 gSeqCmdReadPos;
-extern u8 gStartSeqDisabled;
-#if DEBUG_FEATURES
-extern u8 gAudioDebugPrintSeqCmd;
-#endif
-extern u8 gSoundModeList[];
-extern u8 gAudioSpecId;
-extern u8 D_80133418;
-extern AudioSpec gAudioSpecs[18];
-extern s32 gOverlayLogSeverity;
-extern s32 gSystemArenaLogSeverity;
-extern u8 __osPfsInodeCacheBank;
-extern s32 __osPfsLastChannel;
-
-extern TempoData gTempoData;
-extern AudioHeapInitSizes gAudioHeapInitSizes;
-extern s16 gOcarinaSongItemMap[];
-extern AudioTable gSoundFontTable;
-extern u8 gSequenceFontTable[];
-extern u8 gSequenceTable[];
-extern AudioTable gSampleBankTable;
-
-extern u8 gUseCutsceneCam;
-extern u16 D_8015FCCC;
-extern char D_8015FCD0[20];
-extern u8 D_8015FCE4;
-extern u16 gCamAtSplinePointsAppliedFrame;
-extern u16 gCamEyePointAppliedFrame;
-extern u16 gCamAtPointAppliedFrame;
-
-extern LightningStrike gLightningStrike;
-// TODO: These variables are here for BSS ordering but ideally they should not
-// be extern. This could be fixed by putting more stuff (e.g. struct definitions)
-// between gLightningStrike and gCustomLensFlareOn.
-extern s16 sLightningFlashAlpha;
-extern s16 sSunDepthTestX;
-extern s16 sSunDepthTestY;
-extern u8 gCustomLensFlareOn;
-extern Vec3f gCustomLensFlarePos;
-extern s16 gLensFlareScale;
-extern f32 gLensFlareColorIntensity;
-extern s16 gLensFlareGlareStrength;
-extern MapData* gMapData;
-extern f32 gBossMarkScale;
-extern u32 D_8016139C;
-extern PauseMapMarksData* gLoadedPauseMarkDataTable;
-
-extern PreNmiBuff* gAppNmiBufferPtr;
-extern Scheduler gScheduler;
-extern PadMgr gPadMgr;
-extern IrqMgr gIrqMgr;
-extern volatile OSTime gAudioThreadUpdateTimeTotalPerGfxTask;
-extern volatile OSTime gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime;
-extern volatile OSTime gRSPAudioTimeTotal;
-extern volatile OSTime gRSPGfxTimeTotal;
-extern volatile OSTime gRDPTimeTotal;
-extern volatile OSTime gGraphUpdatePeriod;
-extern volatile OSTime gAudioThreadUpdateTimeStart;
-extern volatile OSTime gAudioThreadUpdateTimeAcc;
-extern volatile OSTime gRSPAudioTimeAcc;
-extern volatile OSTime gRSPGfxTimeAcc;
-extern volatile OSTime gRSPOtherTimeAcc;
-extern volatile OSTime D_8016A578;
-extern volatile OSTime gRDPTimeAcc;
-
-extern SfxBankEntry D_8016BAD0[9];
-extern SfxBankEntry D_8016BC80[12];
-extern SfxBankEntry D_8016BEC0[22];
-extern SfxBankEntry D_8016C2E0[20];
-extern SfxBankEntry D_8016C6A0[8];
-extern SfxBankEntry D_8016C820[3];
-extern SfxBankEntry D_8016C8B0[5];
-extern ActiveSfx gActiveSfx[7][MAX_CHANNELS_PER_BANK]; // total size = 0xA8
-extern u8 gSfxBankMuted[];
-extern u16 gAudioSfxSwapSource[10];
-extern u16 gAudioSfxSwapTarget[10];
-extern u8 gAudioSfxSwapMode[10];
-extern ActiveSequence gActiveSeqs[4];
-extern AudioContext gAudioCtx;
-extern AudioCustomUpdateFunction gAudioCustomUpdateFunction;
-
-extern OSPifRam __osContPifRam;
-extern u8 __osContLastCmd;
-extern u8 __osMaxControllers;
-extern __OSInode __osPfsInodeCache;
-extern OSPifRam __osPfsPifRam;
-extern u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; // 0x25800 bytes
-extern u64 gGfxSPTaskOutputBuffer[0x3000]; // 0x18000 bytes
-extern u64 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE / sizeof(u64)]; // 0xC00 bytes
-extern u64 gGfxSPTaskStack[SP_DRAM_STACK_SIZE64]; // 0x400 bytes
-extern GfxPool gGfxPools[2]; // 0x24820 bytes
-extern u8 gAudioHeap[0x38000]; // 0x38000 bytes
-
-#endif
diff --git a/include/vi_mode.h b/include/vi_mode.h
new file mode 100644
index 0000000000..5c2f1bace2
--- /dev/null
+++ b/include/vi_mode.h
@@ -0,0 +1,55 @@
+#ifndef VI_MODE_H
+#define VI_MODE_H
+
+#include "ultra64.h"
+#include "libu64/pad.h"
+#include "versions.h"
+
+typedef enum ViModeEditState {
+#if OOT_VERSION < PAL_1_0
+ /* -2 */ VI_MODE_EDIT_STATE_NEGATIVE_2 = -2,
+ /* -1 */ VI_MODE_EDIT_STATE_NEGATIVE_1,
+ /* 0 */ VI_MODE_EDIT_STATE_INACTIVE,
+ /* 1 */ VI_MODE_EDIT_STATE_2, // active, more adjustments
+ /* 2 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode
+#else
+ /* 0 */ VI_MODE_EDIT_STATE_INACTIVE,
+ /* 1 */ VI_MODE_EDIT_STATE_ACTIVE,
+ /* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments
+ /* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode
+#endif
+} ViModeEditState;
+
+typedef struct ViMode {
+ /* 0x00 */ OSViMode customViMode;
+ /* 0x50 */ s32 viHeight;
+ /* 0x54 */ s32 viWidth;
+ /* 0x58 */ s32 rightAdjust;
+ /* 0x5C */ s32 leftAdjust;
+ /* 0x60 */ s32 lowerAdjust;
+ /* 0x64 */ s32 upperAdjust;
+ /* 0x68 */ s32 editState;
+ /* 0x6C */ s32 tvType;
+ /* 0x70 */ u32 loRes;
+ /* 0x74 */ u32 antialiasOff;
+ /* 0x78 */ u32 modeN; // Controls interlacing, the meaning of this mode is different based on choice of resolution
+ /* 0x7C */ u32 fb16Bit;
+ /* 0x80 */ u32 viFeatures;
+ /* 0x84 */ u32 unk_84;
+} ViMode; // size = 0x88
+
+void ViMode_Init(ViMode* viMode);
+void ViMode_Destroy(ViMode* viMode);
+void ViMode_Update(ViMode* viMode, Input* input);
+
+void ViConfig_UpdateVi(u32 black);
+void ViConfig_UpdateBlack(void);
+
+extern s8 D_80009430;
+extern vu8 gViConfigBlack;
+extern u8 gViConfigAdditionalScanLines;
+extern u32 gViConfigFeatures;
+extern f32 gViConfigXScale;
+extern f32 gViConfigYScale;
+
+#endif
diff --git a/include/yaz0.h b/include/yaz0.h
new file mode 100644
index 0000000000..52f5ba951e
--- /dev/null
+++ b/include/yaz0.h
@@ -0,0 +1,10 @@
+#ifndef YAZ0_H
+#define YAZ0_H
+
+#include "libc/stddef.h"
+#include "libc/stdint.h"
+#include "ultra64.h"
+
+void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size);
+
+#endif
diff --git a/include/z64.h b/include/z64.h
deleted file mode 100644
index f0ac7d547a..0000000000
--- a/include/z64.h
+++ /dev/null
@@ -1,418 +0,0 @@
-#ifndef Z64_H
-#define Z64_H
-
-#include "ultra64.h"
-#include "ultra64/gs2dex.h"
-#include "attributes.h"
-#include "audiomgr.h"
-#include "controller.h"
-#include "versions.h"
-#include "z64save.h"
-#include "z64light.h"
-#include "z64bgcheck.h"
-#include "z64actor.h"
-#include "z64player.h"
-#include "z64audio.h"
-#include "z64object.h"
-#include "z64ocarina.h"
-#include "z64camera.h"
-#include "z64environment.h"
-#include "z64cutscene.h"
-#include "z64collision_check.h"
-#include "z64curve.h"
-#include "z64scene.h"
-#include "z64effect.h"
-#include "z64game_over.h"
-#include "z64inventory.h"
-#include "z64item.h"
-#include "z64animation.h"
-#include "z64animation_legacy.h"
-#include "z64dma.h"
-#include "letterbox.h"
-#include "z64math.h"
-#include "z64map_mark.h"
-#include "z64message.h"
-#include "z64olib.h"
-#include "one_point_cutscene.h"
-#include "z64pause.h"
-#include "z64play.h"
-#include "z64skin.h"
-#include "z64skin_matrix.h"
-#include "z64game.h"
-#include "z64transition.h"
-#include "z64transition_instances.h"
-#include "z64interface.h"
-#include "z64sfx_source.h"
-#include "z64skybox.h"
-#include "z64sram.h"
-#include "z64view.h"
-#include "z64vis.h"
-#include "zelda_arena.h"
-#include "alignment.h"
-#include "audiothread_cmd.h"
-#include "seqcmd.h"
-#include "sequence.h"
-#include "sfx.h"
-#include "color.h"
-#include "libu64/gfxprint.h"
-#include "z_lib.h"
-#include "ichain.h"
-#include "regs.h"
-#include "irqmgr.h"
-#include "padmgr.h"
-#include "sched.h"
-#include "rumble.h"
-#include "map.h"
-#include "mempak.h"
-#include "tha.h"
-#include "thga.h"
-#include "speed_meter.h"
-#include "gfx.h"
-#include "gfx_setupdl.h"
-#include "gfxalloc.h"
-#include "jpeg.h"
-#include "prerender.h"
-#include "rand.h"
-#include "libc64/qrand.h"
-#include "sys_math.h"
-#include "sys_math3d.h"
-#include "libc64/math64.h"
-#include "sys_matrix.h"
-#include "main.h"
-#include "segmented_address.h"
-#include "stackcheck.h"
-#include "kaleido_manager.h"
-#include "libc64/aprintf.h"
-#include "libc64/malloc.h"
-#include "libc64/sleep.h"
-#include "libc64/sprintf.h"
-#include "libu64/debug.h"
-#include "z64debug_display.h"
-#include "z64draw.h"
-#include "z_en_item00.h"
-
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 240
-
-#define THREAD_PRI_IDLE_INIT 10
-#define THREAD_PRI_MAIN_INIT 10
-#define THREAD_PRI_DMAMGR_LOW 10 // Used when decompressing files
-#define THREAD_PRI_GRAPH 11
-#define THREAD_PRI_AUDIOMGR 12
-#define THREAD_PRI_N64DD 13
-#define THREAD_PRI_DDMSG 13
-#define THREAD_PRI_PADMGR 14
-#define THREAD_PRI_MAIN 15
-#define THREAD_PRI_SCHED 15
-#define THREAD_PRI_DMAMGR 16
-#define THREAD_PRI_IRQMGR 17
-#define THREAD_PRI_FAULT_CLIENT (OS_PRIORITY_APPMAX - 1)
-#define THREAD_PRI_FAULT OS_PRIORITY_APPMAX
-
-#define THREAD_ID_IDLE 1
-#define THREAD_ID_FAULT 2
-#define THREAD_ID_MAIN 3
-#define THREAD_ID_GRAPH 4
-#define THREAD_ID_SCHED 5
-#define THREAD_ID_PADMGR 7
-#define THREAD_ID_N64DD 8
-#define THREAD_ID_DDMSG 9
-#define THREAD_ID_AUDIOMGR 10
-#define THREAD_ID_DMAMGR 18
-#define THREAD_ID_IRQMGR 19
-
-typedef enum LensMode {
- /* 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)
-} LensMode;
-
-typedef struct SetupState {
- /* 0x00 */ GameState state;
-} SetupState; // size = 0xA4
-
-typedef struct ConsoleLogoState {
- /* 0x0000 */ GameState state;
- /* 0x00A4 */ u8* staticSegment;
- /* 0x00A8 */ View view;
- /* 0x01D0 */ SramContext sramCtx;
- /* 0x01D4 */ s16 unk_1D4;
- /* 0x01D6 */ s16 coverAlpha;
- /* 0x01D8 */ s16 addAlpha;
- /* 0x01DA */ s16 visibleDuration;
- /* 0x01DC */ s16 ult;
- /* 0x01DE */ s16 uls;
- /* 0x01E0 */ u8 unk_1E0;
- /* 0x01E1 */ u8 exit;
- /* 0x01E2 */ char unk_1E2[0x06];
-} ConsoleLogoState; // size = 0x1E8
-
-struct MapSelectState;
-
-typedef struct SceneSelectEntry {
- /* 0x00 */ char* name;
- /* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32);
- /* 0x08 */ s32 entranceIndex;
-} SceneSelectEntry; // size = 0xC
-
-typedef struct MapSelectState {
- /* 0x0000 */ GameState state;
- /* 0x00A8 */ View view;
- /* 0x01D0 */ s32 count;
- /* 0x01D4 */ SceneSelectEntry* scenes;
- /* 0x01D8 */ s32 currentScene;
- /* 0x01DC */ s32 pageDownIndex; // Index of pageDownStops
- /* 0x01E0 */ s32 pageDownStops[7];
- /* 0x01FC */ char unk_1FC[0x0C];
- /* 0x0208 */ s32 opt;
- /* 0x020C */ s32 topDisplayedScene; // The scene which is currently at the top of the screen
- /* 0x0210 */ char unk_210[0x0C];
- /* 0x021C */ s32 verticalInputAccumulator;
- /* 0x0220 */ s32 verticalInput;
- /* 0x0224 */ s32 timerUp;
- /* 0x0228 */ s32 timerDown;
- /* 0x022C */ s32 lockUp;
- /* 0x0230 */ s32 lockDown;
- /* 0x0234 */ s32 unk_234; // unused
- /* 0x0238 */ u8* staticSegment;
-} MapSelectState; // size = 0x240
-
-typedef struct SampleState {
- /* 0x0000 */ GameState state;
- /* 0x00A4 */ u8* staticSegment;
- /* 0x00A8 */ View view;
-} SampleState; // size = 0x1D0
-
-typedef struct QuestHintCmd {
- /* 0x00 */ u8 byte0;
- /* 0x01 */ u8 byte1;
- /* 0x02 */ u8 byte2;
- /* 0x03 */ u8 byte3;
-} QuestHintCmd; // size = 0x4
-
-typedef enum PauseBgPreRenderState {
- /* 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.
- /* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters.
- /* 3 */ PAUSE_BG_PRERENDER_READY, // The pause background is ready to be used.
- /* 4 */ PAUSE_BG_PRERENDER_MAX
-} PauseBgPreRenderState;
-
-typedef enum TransitionTileState {
- /* 0 */ TRANS_TILE_OFF, // Inactive, do nothing
- /* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers
- /* 2 */ TRANS_TILE_PROCESS, // Initialize the transition
- /* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame
-} TransitionTileState;
-
-typedef struct TitleSetupState {
- /* 0x0000 */ GameState state;
- /* 0x00A8 */ View view;
-} TitleSetupState; // size = 0x1D0
-
-typedef struct FileSelectState {
- /* 0x00000 */ GameState state;
- /* 0x000A4 */ Vtx* windowVtx;
- /* 0x000A8 */ u8* staticSegment;
- /* 0x000AC */ u8* parameterSegment;
-#if OOT_PAL
- /* 0x000B0 */ u8* objectMagSegment;
-#endif
- /* 0x000B8 */ View view;
- /* 0x001E0 */ SramContext sramCtx;
- /* 0x001E4 */ char unk_1E4[0x4];
- /* 0x001E8 */ SkyboxContext skyboxCtx;
- /* 0x00348 */ MessageContext msgCtx;
- /* 0x0E760 */ Font font;
- /* 0x1C8E8 */ EnvironmentContext envCtx;
- /* 0x1C9E4 */ char unk_1C9E4[0x4];
- /* 0x1C9E8 */ Vtx* windowContentVtx;
- /* 0x1C9EC */ Vtx* keyboardVtx;
- /* 0x1C9F0 */ Vtx* nameEntryVtx;
- /* 0x1C9F4 */ u8 n64ddFlag;
- /* 0x1C9F6 */ u16 deaths[3];
- /* 0x1C9FC */ u8 fileNames[3][8];
- /* 0x1CA14 */ u16 healthCapacities[3];
- /* 0x1CA1C */ u32 questItems[3];
- /* 0x1CA28 */ s16 n64ddFlags[3];
- /* 0x1CA2E */ s8 defense[3];
-#if OOT_PAL
- /* 0x1CA32 */ u16 health[3];
-#endif
- /* 0x1CA38 */ s16 buttonIndex;
- /* 0x1CA3A */ s16 confirmButtonIndex; // 0: yes, 1: quit
- /* 0x1CA3C */ s16 menuMode;
- /* 0x1CA3E */ s16 configMode;
- /* 0x1CA40 */ s16 prevConfigMode;
- /* 0x1CA42 */ s16 nextConfigMode;
- /* 0x1CA44 */ s16 selectMode;
- /* 0x1CA46 */ s16 selectedFileIndex;
- /* 0x1CA48 */ char unk_1CA48[0x2];
- /* 0x1CA4A */ s16 fileNamesY[3];
- /* 0x1CA50 */ s16 actionTimer;
- /* 0x1CA52 */ s16 buttonYOffsets[6];
- /* 0x1CA5E */ s16 copyDestFileIndex;
- /* 0x1CA60 */ s16 warningLabel;
- /* 0x1CA62 */ s16 warningButtonIndex;
- /* 0x1CA64 */ s16 titleLabel;
- /* 0x1CA66 */ s16 nextTitleLabel;
- /* 0x1CA68 */ s16 windowColor[3];
- /* 0x1CA6E */ s16 titleAlpha[2];
- /* 0x1CA72 */ s16 windowAlpha;
- /* 0x1CA74 */ s16 fileButtonAlpha[3];
- /* 0x1CA7A */ s16 nameBoxAlpha[3];
- /* 0x1CA80 */ s16 nameAlpha[3];
- /* 0x1CA86 */ s16 connectorAlpha[3];
- /* 0x1CA8C */ s16 fileInfoAlpha[3];
- /* 0x1CA92 */ s16 actionButtonAlpha[4]; // also contains the alphas for the confirm buttons
- /* 0x1CA9A */ s16 optionButtonAlpha;
- /* 0x1CA9C */ s16 nameEntryBoxAlpha;
- /* 0x1CA9E */ s16 controlsAlpha;
- /* 0x1CAA0 */ s16 emptyFileTextAlpha;
- /* 0x1CAA2 */ s16 highlightColor[4];
- /* 0x1CAAA */ s16 highlightPulseDir; // 0 fade out, 1 fade in
- /* 0x1CAAC */ s16 unk_1CAAC; // initialized but never used
- /* 0x1CAAE */ s16 confirmButtonTexIndices[2];
- /* 0x1CAB2 */ s16 inputTimerX;
- /* 0x1CAB4 */ s16 inputTimerY;
- /* 0x1CAB6 */ s16 stickXDir;
- /* 0x1CAB8 */ s16 stickYDir;
- /* 0x1CABA */ s16 stickAdjX;
- /* 0x1CABC */ s16 stickAdjY;
- /* 0x1CABE */ s16 nameEntryBoxPosX;
- /* 0x1CAC0 */ s16 windowPosX;
- /* 0x1CAC4 */ f32 windowRot;
- /* 0x1CAC8 */ s16 kbdButton; // only for buttons, not characters
- /* 0x1CACA */ s16 charPage; // 0: hiragana, 1: katakana, 2: alphabet
- /* 0x1CACC */ s16 charBgAlpha; // square shape the letter sits in
- /* 0x1CACE */ s16 charIndex; // 0 - 64, top left to bottom right
- /* 0x1CAD0 */ s16 kbdX; // (0, 0) is top left character
- /* 0x1CAD2 */ s16 kbdY;
- /* 0x1CAD4 */ s16 newFileNameCharCount;
- /* 0x1CAD6 */ s16 unk_1CAD6[5];
-} FileSelectState; // size = 0x1CAE0
-
-typedef struct GameStateOverlay {
- /* 0x00 */ void* loadedRamAddr;
- /* 0x04 */ RomFile file; // if applicable
- /* 0x0C */ void* vramStart; // if applicable
- /* 0x10 */ void* vramEnd; // if applicable
- /* 0x14 */ void* unk_14;
- /* 0x18 */ void* init; // initializes and executes the given context
- /* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load
- /* 0x20 */ void* unk_20;
- /* 0x24 */ void* unk_24;
- /* 0x28 */ UNK_TYPE4 unk_28;
- /* 0x2C */ u32 instanceSize;
-} GameStateOverlay; // size = 0x30
-
-typedef struct PreNMIState {
- /* 0x00 */ GameState state;
- /* 0xA4 */ u32 timer;
- /* 0xA8 */ UNK_TYPE4 unk_A8;
-} PreNMIState; // size = 0xAC
-
-typedef struct ISVDbg {
- /* 0x00 */ u32 magic; // IS64
- /* 0x04 */ u32 get;
- /* 0x08 */ u8 unk_08[0x14-0x08];
- /* 0x14 */ u32 put;
- /* 0x18 */ u8 unk_18[0x20-0x18];
- /* 0x20 */ u8 data[0x10000-0x20];
-} ISVDbg;
-
-typedef struct LocaleCartInfo {
- /* 0x00 */ char name[0x18];
- /* 0x18 */ u32 mediaFormat;
- /* 0x1C */ union {
- struct {
- u16 cartId;
- u8 countryCode;
- u8 version;
- };
- u32 regionInfo;
- };
-} LocaleCartInfo; // size = 0x20
-
-typedef struct Yaz0Header {
- /* 0x00 */ char magic[4]; // Yaz0
- /* 0x04 */ u32 decSize;
- /* 0x08 */ u32 compInfoOffset; // only used in mio0
- /* 0x0C */ u32 uncompDataOffset; // only used in mio0
-} Yaz0Header; // size = 0x10
-
-/* Relocation entry field getters */
-#define RELOC_SECTION(reloc) ((reloc) >> 30)
-#define RELOC_OFFSET(reloc) ((reloc) & 0xFFFFFF)
-#define RELOC_TYPE_MASK(reloc) ((reloc) & 0x3F000000)
-#define RELOC_TYPE_SHIFT 24
-
-/* MIPS Relocation Types, matches the MIPS ELF spec */
-#define R_MIPS_32 2
-#define R_MIPS_26 4
-#define R_MIPS_HI16 5
-#define R_MIPS_LO16 6
-
-/* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */
-typedef enum RelocSectionId {
- /* 0 */ RELOC_SECTION_NULL,
- /* 1 */ RELOC_SECTION_TEXT,
- /* 2 */ RELOC_SECTION_DATA,
- /* 3 */ RELOC_SECTION_RODATA,
- /* 4 */ RELOC_SECTION_MAX
-} RelocSectionId;
-
-typedef struct OverlayRelocationSection {
- /* 0x00 */ u32 textSize;
- /* 0x04 */ u32 dataSize;
- /* 0x08 */ u32 rodataSize;
- /* 0x0C */ u32 bssSize;
- /* 0x10 */ u32 nRelocations;
- /* 0x14 */ u32 relocations[1]; // size is nRelocations
-} OverlayRelocationSection; // size >= 0x18
-
-// This struct is used at osAppNMIBuffer which is not at an 8-byte aligned address. This causes an unaligned access
-// crash if the OSTime variables use 64-bit load/store instructions, which is the case in any MIPS ABI other than O32
-// 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
-// code for accessing these. This is not an issue in the original compiler as it only output O32 ABI code.
-ALIGNED(4) typedef struct PreNmiBuff {
- /* 0x00 */ u32 resetting;
- /* 0x04 */ u32 resetCount;
- /* 0x08 */ OSTime duration;
- /* 0x10 */ OSTime resetTime;
-} PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused)
-
-typedef enum ViModeEditState {
-#if OOT_VERSION < PAL_1_0
- /* -2 */ VI_MODE_EDIT_STATE_NEGATIVE_2 = -2,
- /* -1 */ VI_MODE_EDIT_STATE_NEGATIVE_1,
- /* 0 */ VI_MODE_EDIT_STATE_INACTIVE,
- /* 1 */ VI_MODE_EDIT_STATE_2, // active, more adjustments
- /* 2 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode
-#else
- /* 0 */ VI_MODE_EDIT_STATE_INACTIVE,
- /* 1 */ VI_MODE_EDIT_STATE_ACTIVE,
- /* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments
- /* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode
-#endif
-} ViModeEditState;
-
-typedef struct ViMode {
- /* 0x00 */ OSViMode customViMode;
- /* 0x50 */ s32 viHeight;
- /* 0x54 */ s32 viWidth;
- /* 0x58 */ s32 rightAdjust;
- /* 0x5C */ s32 leftAdjust;
- /* 0x60 */ s32 lowerAdjust;
- /* 0x64 */ s32 upperAdjust;
- /* 0x68 */ s32 editState;
- /* 0x6C */ s32 tvType;
- /* 0x70 */ u32 loRes;
- /* 0x74 */ u32 antialiasOff;
- /* 0x78 */ u32 modeN; // Controls interlacing, the meaning of this mode is different based on choice of resolution
- /* 0x7C */ u32 fb16Bit;
- /* 0x80 */ u32 viFeatures;
- /* 0x84 */ u32 unk_84;
-} ViMode; // size = 0x88
-
-#endif
diff --git a/include/z64actor.h b/include/z64actor.h
index 38132540ab..1a8b503297 100644
--- a/include/z64actor.h
+++ b/include/z64actor.h
@@ -3,6 +3,7 @@
#include "color.h"
#include "romfile.h"
+#include "z64actor_profile.h"
#include "z64animation.h"
#include "z64math.h"
#include "z64collision_check.h"
@@ -23,88 +24,16 @@
struct Actor;
struct ActorEntry;
+struct ActorOverlay;
struct CollisionPoly;
struct Lights;
struct Player;
struct PlayState;
-typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
-typedef struct ActorProfile {
- /* 0x00 */ s16 id;
- /* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
- /* 0x04 */ u32 flags;
- /* 0x08 */ s16 objectId;
- /* 0x0C */ u32 instanceSize;
- /* 0x10 */ ActorFunc init; // Constructor
- /* 0x14 */ ActorFunc destroy; // Destructor
- /* 0x18 */ ActorFunc update; // Update Function
- /* 0x1C */ ActorFunc draw; // Draw function
-} ActorProfile; // size = 0x20
-
-/**
- * @see ACTOROVL_ALLOC_ABSOLUTE
- */
-#if DEBUG_FEATURES
-#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0
-#else
-#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0
-#endif
-
-/**
- * The actor overlay should be allocated memory for when loading,
- * and the memory deallocated when there is no more actor using the overlay.
- *
- * `ACTOROVL_ALLOC_` defines indicate how an actor overlay should be loaded.
- *
- * @note Bitwise or-ing `ACTOROVL_ALLOC_` types is not meaningful.
- * The `ACTOROVL_ALLOC_` types are 0, 1, 2 but checked against with a bitwise and.
- *
- * @see ACTOROVL_ALLOC_ABSOLUTE
- * @see ACTOROVL_ALLOC_PERSISTENT
- * @see actor_table.h
- */
-#define ACTOROVL_ALLOC_NORMAL 0
-
-/**
- * The actor overlay should be loaded to "absolute space".
- *
- * Absolute space is a fixed amount of memory allocated once.
- * The overlay will still need to be loaded again if at some point there is no more actor using the overlay.
- *
- * @note Only one such overlay may be loaded at a time.
- * This is not checked: a newly loaded overlay will overwrite the previous one in absolute space,
- * even if actors are still relying on the previous one. Actors using absolute-allocated overlays should be deleted
- * when another absolute-allocated overlay is about to be used.
- *
- * @see ACTOROVL_ABSOLUTE_SPACE_SIZE
- * @see ActorContext.absoluteSpace
- * @see ACTOROVL_ALLOC_NORMAL
- */
-#define ACTOROVL_ALLOC_ABSOLUTE (1 << 0)
-
-/**
- * The actor overlay should be loaded persistently.
- * It will stay loaded until the current game state instance ends.
- *
- * @see ACTOROVL_ALLOC_NORMAL
- */
-#define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
-
-typedef struct ActorOverlay {
- /* 0x00 */ RomFile file;
- /* 0x08 */ void* vramStart;
- /* 0x0C */ void* vramEnd;
- /* 0x10 */ void* loadedRamAddr; // original name: "allocp"
- /* 0x14 */ ActorProfile* profile;
- /* 0x18 */ char* name;
- /* 0x1C */ u16 allocType; // See `ACTOROVL_ALLOC_` defines
- /* 0x1E */ s8 numLoaded; // original name: "clients"
-} ActorOverlay; // size = 0x20
-
typedef struct ActorShape {
/* 0x00 */ Vec3s rot; // Current actor shape rotation
/* 0x06 */ s16 face; // Used to index eyes and mouth textures. Only used by player
@@ -231,6 +160,8 @@ typedef struct ActorShape {
// Flag controlling the use of `Actor.sfx`. Do not use directly. See Actor_PlaySfx_FlaggedTimer
#define ACTOR_FLAG_SFX_TIMER (1 << 28)
+#define ACTOR_FLAGS_CHECK_ALL(thisx, mask) (((thisx)->flags & (mask)) == (mask))
+
#define COLORFILTER_GET_COLORINTENSITY(colorFilterParams) (((colorFilterParams) & 0x1F00) >> 5)
#define COLORFILTER_GET_DURATION(colorFilterParams) ((colorFilterParams) & 0xFF)
@@ -309,7 +240,7 @@ typedef struct Actor {
/* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy`
/* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll`
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
- /* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
+ /* 0x138 */ struct ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
#if DEBUG_FEATURES
/* 0x13C */ char dbgPad[0x10];
#endif
@@ -362,69 +293,6 @@ typedef struct BodyBreak {
#define BODYBREAK_STATUS_READY -1
#define BODYBREAK_STATUS_FINISHED 0
-// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
-typedef enum AObjType {
- /* 0x00 */ A_OBJ_BLOCK_SMALL,
- /* 0x01 */ A_OBJ_BLOCK_LARGE,
- /* 0x02 */ A_OBJ_BLOCK_HUGE,
- /* 0x03 */ A_OBJ_BLOCK_SMALL_ROT,
- /* 0x04 */ A_OBJ_BLOCK_LARGE_ROT,
- /* 0x05 */ A_OBJ_CUBE_SMALL,
- /* 0x06 */ A_OBJ_UNKNOWN_6,
- /* 0x07 */ A_OBJ_GRASS_CLUMP,
- /* 0x08 */ A_OBJ_TREE_STUMP,
- /* 0x09 */ A_OBJ_SIGNPOST_OBLONG,
- /* 0x0A */ A_OBJ_SIGNPOST_ARROW,
- /* 0x0B */ A_OBJ_BOULDER_FRAGMENT,
- /* 0x0C */ A_OBJ_MAX
-} AObjType;
-
-struct EnAObj;
-
-typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*);
-
-typedef struct EnAObj {
- /* 0x000 */ DynaPolyActor dyna;
- /* 0x164 */ EnAObjActionFunc actionFunc;
- /* 0x168 */ s32 rotateWaitTimer;
- /* 0x16C */ s16 textId;
- /* 0x16E */ s16 rotateState;
- /* 0x170 */ s16 rotateForTimer;
- /* 0x172 */ s16 rotSpeedY;
- /* 0x174 */ s16 rotSpeedX;
- /* 0x178 */ f32 focusYoffset;
- /* 0x17C */ ColliderCylinder collider;
-} EnAObj; // size = 0x1C8
-
-typedef enum ActorCategory {
- /* 0x00 */ ACTORCAT_SWITCH,
- /* 0x01 */ ACTORCAT_BG,
- /* 0x02 */ ACTORCAT_PLAYER,
- /* 0x03 */ ACTORCAT_EXPLOSIVE,
- /* 0x04 */ ACTORCAT_NPC,
- /* 0x05 */ ACTORCAT_ENEMY,
- /* 0x06 */ ACTORCAT_PROP,
- /* 0x07 */ ACTORCAT_ITEMACTION,
- /* 0x08 */ ACTORCAT_MISC,
- /* 0x09 */ ACTORCAT_BOSS,
- /* 0x0A */ ACTORCAT_DOOR,
- /* 0x0B */ ACTORCAT_CHEST,
- /* 0x0C */ ACTORCAT_MAX
-} ActorCategory;
-
-#define DEFINE_ACTOR(_0, enum, _2, _3) enum,
-#define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum,
-#define DEFINE_ACTOR_UNSET(enum) enum,
-
-typedef enum ActorID {
- #include "tables/actor_table.h"
- /* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX"
-} ActorID;
-
-#undef DEFINE_ACTOR
-#undef DEFINE_ACTOR_INTERNAL
-#undef DEFINE_ACTOR_UNSET
-
typedef enum DoorLockType {
DOORLOCK_NORMAL,
DOORLOCK_BOSS,
@@ -732,6 +600,8 @@ typedef struct NpcInteractInfo {
#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10
#define GET_TRANSITION_ACTOR_INDEX(actor) PARAMS_GET_NOMASK((u16)(actor)->params, 10)
+extern Gfx D_80116280[];
+
void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale);
void ActorShadow_DrawCircle(Actor* actor, struct Lights* lights, struct PlayState* play);
void ActorShadow_DrawWhiteCircle(Actor* actor, struct Lights* lights, struct PlayState* play);
@@ -850,7 +720,7 @@ void Actor_DisableLens(struct PlayState* play);
void Actor_InitContext(struct PlayState* play, ActorContext* actorCtx, struct ActorEntry* playerEntry);
void Actor_UpdateAll(struct PlayState* play, ActorContext* actorCtx);
s32 Actor_CullingVolumeTest(struct PlayState* play, Actor* actor, Vec3f* projPos, f32 projW);
-void func_800315AC(struct PlayState* play, ActorContext* actorCtx);
+void Actor_DrawAll(struct PlayState* play, ActorContext* actorCtx);
void Actor_KillAllWithMissingObject(struct PlayState* play, ActorContext* actorCtx);
void func_80031B14(struct PlayState* play, ActorContext* actorCtx);
void func_80031C3C(ActorContext* actorCtx, struct PlayState* play);
diff --git a/include/z64actor_profile.h b/include/z64actor_profile.h
new file mode 100644
index 0000000000..82ec9f957b
--- /dev/null
+++ b/include/z64actor_profile.h
@@ -0,0 +1,52 @@
+#ifndef Z64ACTOR_PROFILE_H
+#define Z64ACTOR_PROFILE_H
+
+#include "ultra64.h"
+
+struct Actor;
+struct PlayState;
+
+#define DEFINE_ACTOR(_0, enum, _2, _3) enum,
+#define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum,
+#define DEFINE_ACTOR_UNSET(enum) enum,
+
+typedef enum ActorID {
+ #include "tables/actor_table.h"
+ /* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX"
+} ActorID;
+
+#undef DEFINE_ACTOR
+#undef DEFINE_ACTOR_INTERNAL
+#undef DEFINE_ACTOR_UNSET
+
+typedef enum ActorCategory {
+ /* 0x00 */ ACTORCAT_SWITCH,
+ /* 0x01 */ ACTORCAT_BG,
+ /* 0x02 */ ACTORCAT_PLAYER,
+ /* 0x03 */ ACTORCAT_EXPLOSIVE,
+ /* 0x04 */ ACTORCAT_NPC,
+ /* 0x05 */ ACTORCAT_ENEMY,
+ /* 0x06 */ ACTORCAT_PROP,
+ /* 0x07 */ ACTORCAT_ITEMACTION,
+ /* 0x08 */ ACTORCAT_MISC,
+ /* 0x09 */ ACTORCAT_BOSS,
+ /* 0x0A */ ACTORCAT_DOOR,
+ /* 0x0B */ ACTORCAT_CHEST,
+ /* 0x0C */ ACTORCAT_MAX
+} ActorCategory;
+
+typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
+
+typedef struct ActorProfile {
+ /* 0x00 */ s16 id;
+ /* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
+ /* 0x04 */ u32 flags;
+ /* 0x08 */ s16 objectId;
+ /* 0x0C */ u32 instanceSize;
+ /* 0x10 */ ActorFunc init; // Constructor
+ /* 0x14 */ ActorFunc destroy; // Destructor
+ /* 0x18 */ ActorFunc update; // Update Function
+ /* 0x1C */ ActorFunc draw; // Draw function
+} ActorProfile; // size = 0x20
+
+#endif
diff --git a/include/z64animation.h b/include/z64animation.h
index 17b42e1a0f..a085da5ddd 100644
--- a/include/z64animation.h
+++ b/include/z64animation.h
@@ -1,10 +1,10 @@
#ifndef Z64_ANIMATION_H
#define Z64_ANIMATION_H
+#include "avoid_ub.h"
#include "ultra64.h"
#include "z64dma.h"
#include "z64math.h"
-#include "macros.h"
struct PlayState;
struct Actor;
diff --git a/include/z64audio.h b/include/z64audio.h
index d60a6aaeb7..308c220d7a 100644
--- a/include/z64audio.h
+++ b/include/z64audio.h
@@ -31,8 +31,6 @@ typedef void (*AudioCustomUpdateFunction)(void);
#define SEQ_NUM_CHANNELS 16
#define SEQ_IO_VAL_NONE -1
-#define MAX_CHANNELS_PER_BANK 3
-
#define MUTE_BEHAVIOR_3 (1 << 3) // prevent further noteSubEus from playing
#define MUTE_BEHAVIOR_4 (1 << 4) // stop something in seqLayer scripts
#define MUTE_BEHAVIOR_SOFTEN (1 << 5) // lower volume, by default to half
@@ -68,12 +66,19 @@ typedef void (*AudioCustomUpdateFunction)(void);
#define AUDIO_RELOCATED_ADDRESS_START K0BASE
-typedef enum SoundMode {
- /* 0 */ SOUNDMODE_STEREO,
- /* 1 */ SOUNDMODE_HEADSET,
- /* 2 */ SOUNDMODE_SURROUND,
- /* 3 */ SOUNDMODE_MONO
-} SoundMode;
+typedef enum SoundSetting {
+ /* 0 */ SOUND_SETTING_STEREO,
+ /* 1 */ SOUND_SETTING_MONO,
+ /* 2 */ SOUND_SETTING_HEADSET,
+ /* 3 */ SOUND_SETTING_SURROUND
+} SoundSetting;
+
+typedef enum SoundOutputMode {
+ /* 0 */ SOUND_OUTPUT_STEREO,
+ /* 1 */ SOUND_OUTPUT_HEADSET,
+ /* 2 */ SOUND_OUTPUT_SURROUND,
+ /* 3 */ SOUND_OUTPUT_MONO
+} SoundOutputMode;
typedef enum AdsrStatus {
/* 0 */ ADSR_STATE_DISABLED,
@@ -929,7 +934,7 @@ typedef struct AudioContext {
/* 0x2890 */ s32 maxAudioCmds;
/* 0x2894 */ s32 numNotes;
/* 0x2898 */ s16 maxTempo; // Maximum possible tempo (seqTicks per minute), using every tick as a seqTick to process a .seq file
- /* 0x289A */ s8 soundMode;
+ /* 0x289A */ s8 soundOutputMode;
/* 0x289C */ s32 totalTaskCount; // The total number of times the top-level function on the audio thread has run since audio was initialized
/* 0x28A0 */ s32 curAudioFrameDmaCount;
/* 0x28A4 */ s32 rspTaskIndex;
@@ -1197,7 +1202,7 @@ void func_800F64E0(u8 arg0);
void Audio_ToggleMalonSinging(u8 malonSingingDisabled);
void Audio_SetEnvReverb(s8 reverb);
void Audio_SetCodeReverb(s8 reverb);
-void func_800F6700(s8 audioSetting);
+void Audio_SetSoundOutputMode(s8 soundSetting);
void Audio_SetBaseFilter(u8);
void Audio_SetExtraFilter(u8);
void Audio_SetCutsceneFlag(s8 flag);
@@ -1214,4 +1219,51 @@ void Audio_InitSound(void);
void func_800F7170(void);
void func_800F71BC(s32 arg0);
+extern s16* gWaveSamples[9];
+extern f32 gBendPitchOneOctaveFrequencies[256];
+extern f32 gBendPitchTwoSemitonesFrequencies[256];
+extern f32 gPitchFrequencies[];
+extern u8 gDefaultShortNoteVelocityTable[16];
+extern u8 gDefaultShortNoteGateTimeTable[16];
+extern EnvelopePoint gDefaultEnvelope[4];
+extern NoteSubEu gZeroNoteSub;
+extern NoteSubEu gDefaultNoteSub;
+extern u16 gHaasEffectDelaySizes[64];
+extern s16 D_8012FBA8[];
+extern f32 gHeadsetPanVolume[128];
+extern f32 gStereoPanVolume[128];
+extern f32 gDefaultPanVolume[128];
+extern s16 gLowPassFilterData[16 * 8];
+extern s16 gHighPassFilterData[15 * 8];
+extern s32 gAudioContextInitialized;
+extern u8 gIsLargeSfxBank[7];
+extern u8 gChannelsPerBank[4][7];
+extern u8 gUsedChannelsPerBank[4][7];
+extern u8 gMorphaTransposeTable[16];
+
+extern u8 gSeqCmdWritePos;
+extern u8 gSeqCmdReadPos;
+extern u8 gStartSeqDisabled;
+
+#if DEBUG_FEATURES
+extern u8 gAudioDebugPrintSeqCmd;
+#endif
+
+extern u8 gSoundOutputModes[];
+extern u8 gAudioSpecId;
+extern u8 D_80133418;
+extern AudioSpec gAudioSpecs[18];
+
+extern TempoData gTempoData;
+extern AudioHeapInitSizes gAudioHeapInitSizes;
+
+extern AudioTable gSequenceTable;
+extern AudioTable gSoundFontTable;
+extern u8 gSequenceFontTable[];
+extern AudioTable gSampleBankTable;
+
+extern ActiveSequence gActiveSeqs[4];
+extern AudioContext gAudioCtx;
+extern AudioCustomUpdateFunction gAudioCustomUpdateFunction;
+
#endif
diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h
index bb9e9cf148..eb7e9155d0 100644
--- a/include/z64bgcheck.h
+++ b/include/z64bgcheck.h
@@ -215,7 +215,7 @@ typedef enum ConveyorSpeed {
} ConveyorSpeed;
#define CONVEYOR_DIRECTION_TO_BINANG(conveyorDirection) ((conveyorDirection) * (0x10000 / 64))
-#define CONVEYOR_DIRECTION_FROM_BINANG(conveyorDirectionBinang) ((conveyorDirectionBinang) * (64 / 0x10000))
+#define CONVEYOR_DIRECTION_FROM_BINANG(conveyorDirectionBinang) ((conveyorDirectionBinang) / (0x10000 / 64))
#define SURFACETYPE0(bgCamIndex, exitIndex, floorType, unk18, wallType, floorProperty, isSoft, isHorseBlocked) \
((((bgCamIndex) & 0xFF) << 0) | \
diff --git a/include/z64camera.h b/include/z64camera.h
index 1e831a909e..2fcbffdf5a 100644
--- a/include/z64camera.h
+++ b/include/z64camera.h
@@ -4,7 +4,6 @@
#include "ultra64.h"
#include "z64cutscene.h"
#include "z64math.h"
-#include "z64save.h"
struct CollisionContext;
struct View;
@@ -1622,82 +1621,7 @@ typedef struct Camera {
/* 0x16A */ s16 unk_16A;
} Camera; // size = 0x16C
-/**
- * Debug Camera
-*/
-
-typedef struct DebugCamSub {
- /* 0x0000 */ s16 mode;
- /* 0x0002 */ s16 nFrames;
- /* 0x0004 */ s16 nPoints;
- /* 0x0006 */ s16 unkIdx;
- /* 0x0008 */ s16 unk_08;
- /* 0x000A */ s16 unk_0A;
- /* 0x000C */ s32 unk_0C; // bool: indicates position vs lookAt?
- /* 0x0010 */ char unk_10[0x14];
- /* 0x0024 */ CutsceneCameraPoint position[129];
- /* 0x0834 */ CutsceneCameraPoint lookAt[129];
- /* 0x1044 */ s16 demoCtrlMenu;
- /* 0x1046 */ s16 demoCtrlActionIdx; // e (?), s (save), l (load), c (clear)
- /* 0x1048 */ s16 demoCtrlToggleSwitch;
- /* 0x104A */ Vec3s unk_104A;
-} DebugCamSub; // size = 0x1050
-
-typedef struct DebugCam {
- /* 0x00 */ s32 unk_00;
- /* 0x04 */ Vec3f at;
- /* 0x10 */ Vec3f eye;
- /* 0x1C */ Vec3f unk_1C;
- /* 0x28 */ char unk_28[0xC];
- /* 0x34 */ s32 unk_34;
- /* 0x38 */ s32 unk_38;
- /* 0x3C */ s32 unk_3C; // bool
- /* 0x40 */ s32 unk_40;
- /* 0x44 */ s32 unk_44;
- /* 0x48 */ f32 fov;
- /* 0x4C */ s16 roll;
- /* 0x4E */ char unk_4E[0x2];
- /* 0x50 */ f32 rollDegrees;
- /* 0x54 */ Vec3f unk_54;
- /* 0x60 */ Vec3f unk_60;
- /* 0x6C */ Vec3f unk_6C;
- /* 0x78 */ s16 unk_78;
- /* 0x7A */ s16 unk_7A;
- /* 0x7C */ DebugCamSub sub;
-} DebugCam; // size = 0x10CC
-
-typedef struct DebugCamCut {
- /* 0x00 */ char letter;
- /* 0x01 */ u8 unk_01;
- /* 0x02 */ s16 mode;
- /* 0x04 */ CutsceneCameraPoint* position;
- /* 0x08 */ CutsceneCameraPoint* lookAt;
- /* 0x0C */ s16 nFrames;
- /* 0x0E */ s16 nPoints;
-} DebugCamCut; // size = 0x10
-
-typedef struct DebugCamAnim {
- /* 0x00 */ f32 curFrame;
- /* 0x04 */ f32 unk_04; // frame count?
- /* 0x08 */ s16 keyframe;
- /* 0x0A */ s16 unk_0A;
- /* 0x0C */ s16 unk_0C;
- /* 0x10 */ Vec3f positionPos; // confusing name
- /* 0x1C */ Vec3f lookAtPos;
- /* 0x28 */ f32 roll;
- /* 0x2C */ f32 fov;
-} DebugCamAnim; // size = 0x30
-
-typedef enum DebugCamTextColor {
- /* 0 */ DEBUG_CAM_TEXT_YELLOW,
- /* 1 */ DEBUG_CAM_TEXT_PEACH,
- /* 2 */ DEBUG_CAM_TEXT_BROWN,
- /* 3 */ DEBUG_CAM_TEXT_ORANGE,
- /* 4 */ DEBUG_CAM_TEXT_GOLD,
- /* 5 */ DEBUG_CAM_TEXT_WHITE,
- /* 6 */ DEBUG_CAM_TEXT_BLUE,
- /* 7 */ DEBUG_CAM_TEXT_GREEN
-} DebugCamTextColor;
+extern s32 gDebugCamEnabled;
void Camera_Init(Camera* camera, struct View* view, struct CollisionContext* colCtx, struct PlayState* play);
void Camera_InitDataUsingPlayer(Camera* camera, struct Player* player);
diff --git a/include/z64curve.h b/include/z64curve.h
index 2f35aec967..8fb83242ba 100644
--- a/include/z64curve.h
+++ b/include/z64curve.h
@@ -5,6 +5,7 @@
#include "z64math.h"
struct PlayState;
+struct Actor;
typedef struct CurveInterpKnot {
/* 0x0 */ u16 flags; // Only the bottom two bits are used, although others are set in objects
@@ -56,7 +57,7 @@ void SkelCurve_Destroy(struct PlayState* play, SkelCurve* skelCurve);
void SkelCurve_SetAnim(SkelCurve* skelCurve, CurveAnimationHeader* animation, f32 arg2, f32 endFrame, f32 curFrame,
f32 playSpeed);
s32 SkelCurve_Update(struct PlayState* play, SkelCurve* skelCurve);
-void SkelCurve_Draw(Actor* actor, struct PlayState* play, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw,
+void SkelCurve_Draw(struct Actor* actor, struct PlayState* play, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw,
PostCurveLimbDraw postLimbDraw, s32 lod, void* data);
#endif
diff --git a/include/z64cutscene.h b/include/z64cutscene.h
index c9200c24f9..f8aed368d4 100644
--- a/include/z64cutscene.h
+++ b/include/z64cutscene.h
@@ -515,6 +515,14 @@ typedef struct CutsceneContext {
/* 0x28 */ CsCmdActorCue* actorCues[10]; // "npcdemopnt"
} CutsceneContext; // size = 0x50
+extern u8 gUseCutsceneCam;
+extern u16 D_8015FCCC;
+extern char D_8015FCD0[20];
+extern u8 D_8015FCE4;
+extern u16 gCamAtSplinePointsAppliedFrame;
+extern u16 gCamEyePointAppliedFrame;
+extern u16 gCamAtPointAppliedFrame;
+
void Cutscene_InitContext(struct PlayState* play, CutsceneContext* csCtx);
void Cutscene_StartManual(struct PlayState* play, CutsceneContext* csCtx);
void Cutscene_StopManual(struct PlayState* play, CutsceneContext* csCtx);
diff --git a/include/z64cutscene_flags.h b/include/z64cutscene_flags.h
new file mode 100644
index 0000000000..5a3c7c2a7a
--- /dev/null
+++ b/include/z64cutscene_flags.h
@@ -0,0 +1,13 @@
+#ifndef Z64CUTSCENE_FLAGS_H
+#define Z64CUTSCENE_FLAGS_H
+
+#include "ultra64.h"
+
+struct PlayState;
+
+void CutsceneFlags_UnsetAll(struct PlayState* play);
+void CutsceneFlags_Set(struct PlayState* play, s16 flag);
+void CutsceneFlags_Unset(struct PlayState* play, s16 flag);
+s32 CutsceneFlags_Get(struct PlayState* play, s16 flag);
+
+#endif
diff --git a/include/z64cutscene_spline.h b/include/z64cutscene_spline.h
new file mode 100644
index 0000000000..3a73949453
--- /dev/null
+++ b/include/z64cutscene_spline.h
@@ -0,0 +1,12 @@
+#ifndef Z64CUTSCENE_SPLINE_H
+#define Z64CUTSCENE_SPLINE_H
+
+#include "ultra64.h"
+#include "z64math.h"
+
+union CutsceneCameraPoint;
+
+void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3);
+s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, union CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame);
+
+#endif
diff --git a/include/z64debug.h b/include/z64debug.h
new file mode 100644
index 0000000000..0e2c7334ee
--- /dev/null
+++ b/include/z64debug.h
@@ -0,0 +1,17 @@
+#ifndef Z64DEBUG_H
+#define Z64DEBUG_H
+
+#include "ultra64.h"
+
+struct GraphicsContext;
+struct Input;
+
+void Regs_Init(void);
+void DebugCamera_ScreenText(u8 x, u8 y, const char* text);
+void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text);
+#if DEBUG_FEATURES
+void Regs_UpdateEditor(struct Input* input);
+#endif
+void Debug_DrawText(struct GraphicsContext* gfxCtx);
+
+#endif
diff --git a/include/z64dma.h b/include/z64dma.h
index b9cbf6a42d..10968517bc 100755
--- a/include/z64dma.h
+++ b/include/z64dma.h
@@ -50,4 +50,12 @@ s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction);
void DmaMgr_Init(void);
+#if DEBUG_FEATURES
+#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line)
+#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, file, line)
+#else
+#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSync(ram, vrom, size)
+#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg)
+#endif
+
#endif
diff --git a/include/z64effect.h b/include/z64effect.h
index bad2b1d324..0c07cc5124 100644
--- a/include/z64effect.h
+++ b/include/z64effect.h
@@ -262,6 +262,8 @@ typedef enum EffectSsType {
#undef DEFINE_EFFECT_SS
#undef DEFINE_EFFECT_SS_UNSET
+extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX];
+
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2);
void EffectBlure_AddSpace(EffectBlure* this);
void EffectBlure_Init1(void* thisx, void* initParamsx);
diff --git a/include/z64environment.h b/include/z64environment.h
index 598c4655a9..4c4bc770cd 100644
--- a/include/z64environment.h
+++ b/include/z64environment.h
@@ -242,6 +242,19 @@ extern u8 gLightConfigAfterUnderwater;
extern u8 gInterruptSongOfStorms;
extern u16 gTimeSpeed;
+extern LightningStrike gLightningStrike;
+// TODO: These variables are here for BSS ordering but ideally they should not
+// be extern. This could be fixed by putting more stuff (e.g. struct definitions)
+// between gLightningStrike and gCustomLensFlareOn.
+extern s16 sLightningFlashAlpha;
+extern s16 sSunDepthTestX;
+extern s16 sSunDepthTestY;
+extern u8 gCustomLensFlareOn;
+extern Vec3f gCustomLensFlarePos;
+extern s16 gLensFlareScale;
+extern f32 gLensFlareColorIntensity;
+extern s16 gLensFlareGlareStrength;
+
void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, struct SkyboxContext* skyboxCtx);
void Environment_DrawSkyboxFilters(struct PlayState* play);
diff --git a/include/z64face_reaction.h b/include/z64face_reaction.h
new file mode 100644
index 0000000000..274340ebcb
--- /dev/null
+++ b/include/z64face_reaction.h
@@ -0,0 +1,74 @@
+#ifndef Z64FACE_REACTION_H
+#define Z64FACE_REACTION_H
+
+#include "ultra64.h"
+
+struct PlayState;
+
+typedef enum MaskReactionSet {
+ /* 0x00 */ MASK_REACTION_SET_CARPENTER_BOSS,
+ /* 0x01 */ MASK_REACTION_SET_CARPENTER_1,
+ /* 0x02 */ MASK_REACTION_SET_CARPENTER_2,
+ /* 0x03 */ MASK_REACTION_SET_CARPENTER_3,
+ /* 0x04 */ MASK_REACTION_SET_CARPENTER_4,
+ /* 0x05 */ MASK_REACTION_SET_HYRULIAN_GUARD,
+ /* 0x06 */ MASK_REACTION_SET_HEISHI4_1,
+ /* 0x07 */ MASK_REACTION_SET_HEISHI4_2,
+ /* 0x08 */ MASK_REACTION_SET_CUCCO_LADY,
+ /* 0x09 */ MASK_REACTION_SET_CARPENTERS_SON,
+ /* 0x0A */ MASK_REACTION_SET_KAKARIKO_ROOF_MAN,
+ /* 0x0B */ MASK_REACTION_SET_WINDMILL_MAN,
+ /* 0x0C */ MASK_REACTION_SET_12, // Unused
+ /* 0x0D */ MASK_REACTION_SET_CURSED_SKULLTULA_MAN,
+ /* 0x0E */ MASK_REACTION_SET_DAMPE,
+ /* 0x0F */ MASK_REACTION_SET_GRAVEYARD_KID,
+ /* 0x10 */ MASK_REACTION_SET_SARIA,
+ /* 0x11 */ MASK_REACTION_SET_MIDO,
+ /* 0x12 */ MASK_REACTION_SET_FADO,
+ /* 0x13 */ MASK_REACTION_SET_KOKIRI_1,
+ /* 0x14 */ MASK_REACTION_SET_KOKIRI_2,
+ /* 0x15 */ MASK_REACTION_SET_SKULL_KID,
+ /* 0x16 */ MASK_REACTION_SET_ZELDA,
+ /* 0x17 */ MASK_REACTION_SET_MALON,
+ /* 0x18 */ MASK_REACTION_SET_TALON,
+ /* 0x19 */ MASK_REACTION_SET_INGO,
+ /* 0x1A */ MASK_REACTION_SET_LAKESIDE_PROFESSOR,
+ /* 0x1B */ MASK_REACTION_SET_MAGIC_BEAN_SALESMAN,
+ /* 0x1C */ MASK_REACTION_SET_RUNNING_MAN,
+ /* 0x1D */ MASK_REACTION_SET_ZORA,
+ /* 0x1E */ MASK_REACTION_SET_KING_ZORA,
+ /* 0x1F */ MASK_REACTION_SET_RUTO,
+ /* 0x20 */ MASK_REACTION_SET_GORON,
+ /* 0x21 */ MASK_REACTION_SET_DARUNIA,
+ /* 0x22 */ MASK_REACTION_SET_GERUDO_WHITE,
+ /* 0x23 */ MASK_REACTION_SET_NABOORU,
+ /* 0x24 */ MASK_REACTION_SET_DANCING_COUPLE,
+ /* 0x25 */ MASK_REACTION_SET_DOG_LADY,
+ /* 0x26 */ MASK_REACTION_SET_WOMAN_3,
+ /* 0x27 */ MASK_REACTION_SET_MAN_1_BEARD,
+ /* 0x28 */ MASK_REACTION_SET_MAN_2_BALD,
+ /* 0x29 */ MASK_REACTION_SET_MAN_1_SHAVED_BLACK_SHIRT,
+ /* 0x2A */ MASK_REACTION_SET_BEGGAR,
+ /* 0x2B */ MASK_REACTION_SET_OLD_WOMAN,
+ /* 0x2C */ MASK_REACTION_SET_OLD_MAN,
+ /* 0x2D */ MASK_REACTION_SET_YOUNG_WOMAN_BROWN_HAIR,
+ /* 0x2E */ MASK_REACTION_SET_MAN_2_MUSTACHE_RED_SHIRT,
+ /* 0x2F */ MASK_REACTION_SET_MAN_2_MUSTACHE_BLUE_SHIRT,
+ /* 0x30 */ MASK_REACTION_SET_YOUNG_WOMAN_ORANGE_HAIR,
+ /* 0x31 */ MASK_REACTION_SET_MAN_2_ALT_MUSTACHE,
+ /* 0x32 */ MASK_REACTION_SET_MAN_1_BOWL_CUT_PURPLE_SHIRT,
+ /* 0x33 */ MASK_REACTION_SET_MAN_2_BEARD,
+ /* 0x34 */ MASK_REACTION_SET_OLD_MAN_BALD_BROWN_ROBE,
+ /* 0x35 */ MASK_REACTION_SET_MAN_2_MUSTACHE_WHITE_SHIRT,
+ /* 0x36 */ MASK_REACTION_SET_MAN_1_SHAVED_GREEN_SHIRT,
+ /* 0x37 */ MASK_REACTION_SET_WOMAN_2,
+ /* 0x38 */ MASK_REACTION_SET_OLD_MAN_BALD_PURPLE_ROBE,
+ /* 0x39 */ MASK_REACTION_SET_MAN_1_BOWL_CUT_GREEN_SHIRT,
+ /* 0x3A */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_1,
+ /* 0x3B */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_2,
+ /* 0x3C */ MASK_REACTION_SET_MAX
+} MaskReactionSet;
+
+u16 MaskReaction_GetTextId(struct PlayState* play, u32 maskReactionSet);
+
+#endif
diff --git a/include/z64font.h b/include/z64font.h
new file mode 100644
index 0000000000..72f97fddd6
--- /dev/null
+++ b/include/z64font.h
@@ -0,0 +1,41 @@
+#ifndef Z64FONT_H
+#define Z64FONT_H
+
+#include "ultra64.h"
+
+// TODO get these properties from the textures themselves
+#define FONT_CHAR_TEX_WIDTH 16
+#define FONT_CHAR_TEX_HEIGHT 16
+#define FONT_CHAR_TEX_SIZE ((FONT_CHAR_TEX_WIDTH * FONT_CHAR_TEX_HEIGHT) / 2) // 16x16 I4 texture
+
+typedef struct Font {
+ /* 0x0000 */ u32 msgOffset;
+ /* 0x0004 */ u32 msgLength;
+ union {
+ /* 0x0008 */ u8 charTexBuf[FONT_CHAR_TEX_SIZE * 120];
+ /* 0x0008 */ u64 force_structure_alignment_charTex;
+ };
+ union {
+ /* 0x3C08 */ u8 iconBuf[FONT_CHAR_TEX_SIZE];
+ /* 0x3C08 */ u64 force_structure_alignment_icon;
+ };
+ union {
+ /* 0x3C88 */ u8 fontBuf[FONT_CHAR_TEX_SIZE * 320];
+ /* 0x3C88 */ u64 force_structure_alignment_font;
+ };
+ union {
+ /* 0xDC88 */ u8 msgBuf[1280];
+ /* 0xDC88 */ u16 msgBufWide[640];
+ /* 0xDC88 */ u64 force_structure_alignment_msg;
+ };
+} Font; // size = 0xE188
+
+#if PLATFORM_IQUE
+void Font_LoadCharCHN(Font* font, u16 character, u16 codePointIndex);
+#endif
+void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex);
+void Font_LoadChar(Font* font, u8 character, u16 codePointIndex);
+void Font_LoadMessageBoxIcon(Font* font, u16 icon);
+void Font_LoadOrderedFont(Font* font);
+
+#endif
diff --git a/include/z64game.h b/include/z64game.h
index 3b50cfd362..fe683777b7 100644
--- a/include/z64game.h
+++ b/include/z64game.h
@@ -3,33 +3,12 @@
// This file is named "game" after game.c for now, this may change later with the system name
#include "ultra64/ultratypes.h"
-#include "padmgr.h"
+#include "libu64/pad.h"
+#include "gamealloc.h"
+#include "romfile.h"
#include "tha.h"
struct GraphicsContext;
-
-typedef struct GameAllocEntry {
- /* 0x00 */ struct GameAllocEntry* next;
- /* 0x04 */ struct GameAllocEntry* prev;
- /* 0x08 */ u32 size;
- /* 0x0C */ u32 unk_0C;
-} GameAllocEntry; // size = 0x10
-
-typedef struct GameAlloc {
- /* 0x00 */ GameAllocEntry base;
- /* 0x10 */ GameAllocEntry* head;
-} GameAlloc; // size = 0x14
-
-// Used in Graph_GetNextGameState in graph.c
-#define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) enumName,
-#define DEFINE_GAMESTATE(typeName, enumName, name) DEFINE_GAMESTATE_INTERNAL(typeName, enumName)
-typedef enum GameStateId {
-#include "tables/gamestate_table.h"
- GAMESTATE_ID_MAX
-} GameStateId;
-#undef DEFINE_GAMESTATE
-#undef DEFINE_GAMESTATE_INTERNAL
-
struct GameState;
typedef void (*GameStateFunc)(struct GameState* gameState);
@@ -48,4 +27,27 @@ typedef struct GameState {
/* 0xA0 */ u32 inPreNMIState;
} GameState; // size = 0xA4
+#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
+ if (1) { \
+ GameState* state = curState; \
+ \
+ (state)->init = newInit; \
+ (state)->size = sizeof(newStruct); \
+ } (void)0
+
+void GameState_ReqPadData(GameState* gameState);
+void GameState_Update(GameState* gameState);
+void GameState_InitArena(GameState* gameState, size_t size);
+void GameState_Realloc(GameState* gameState, size_t size);
+void GameState_Init(GameState* gameState, GameStateFunc init, struct GraphicsContext* gfxCtx);
+void GameState_Destroy(GameState* gameState);
+GameStateFunc GameState_GetInit(GameState* gameState);
+u32 GameState_IsRunning(GameState* gameState);
+#if DEBUG_FEATURES
+void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line);
+#define GAME_STATE_ALLOC(gameState, size, file, line) GameState_Alloc(gameState, size, file, line)
+#else
+#define GAME_STATE_ALLOC(gameState, size, file, line) THA_AllocTailAlign16(&(gameState)->tha, size)
+#endif
+
#endif
diff --git a/include/z64interface.h b/include/z64interface.h
index 5bcad2bc11..bfa3bffeb3 100644
--- a/include/z64interface.h
+++ b/include/z64interface.h
@@ -279,4 +279,7 @@ void Interface_Update(struct PlayState* play);
void Interface_Destroy(struct PlayState* play);
void Interface_Init(struct PlayState* play);
+extern s16 gSpoilingItems[3];
+extern s16 gSpoilingItemReverts[3];
+
#endif
diff --git a/include/z64inventory.h b/include/z64inventory.h
index 9a8133b3da..8c1a5a90d8 100644
--- a/include/z64inventory.h
+++ b/include/z64inventory.h
@@ -3,7 +3,6 @@
#include "ultra64.h"
#include "z64item.h"
-#include "z64save.h"
struct PlayState;
diff --git a/include/z64lifemeter.h b/include/z64lifemeter.h
new file mode 100644
index 0000000000..29b2656b88
--- /dev/null
+++ b/include/z64lifemeter.h
@@ -0,0 +1,14 @@
+#ifndef Z64LIFEMETER_H
+#define Z64LIFEMETER_H
+
+#include "ultra64/ultratypes.h"
+
+struct PlayState;
+
+void Health_InitMeter(struct PlayState* play);
+void Health_UpdateMeter(struct PlayState* play);
+void Health_DrawMeter(struct PlayState* play);
+void Health_UpdateBeatingHeart(struct PlayState* play);
+u32 Health_IsCritical(void);
+
+#endif
diff --git a/include/z64map_mark.h b/include/z64map_mark.h
index 0c55efa3ae..b566491118 100644
--- a/include/z64map_mark.h
+++ b/include/z64map_mark.h
@@ -3,6 +3,8 @@
#include "ultra64.h"
+struct PlayState;
+
#define MAP_MARK_NONE -1
#define MAP_MARK_CHEST 0
#define MAP_MARK_BOSS 1
@@ -20,6 +22,10 @@ typedef struct MapMarkIconData {
typedef MapMarkIconData MapMarkData[3]; // size = 0x72
+void MapMark_Init(struct PlayState* play);
+void MapMark_ClearPointers(struct PlayState* play);
+void MapMark_Draw(struct PlayState* play);
+
extern MapMarkData* gMapMarkDataTable[];
#endif
diff --git a/include/z64math.h b/include/z64math.h
index 95a494a693..187d95b250 100644
--- a/include/z64math.h
+++ b/include/z64math.h
@@ -1,11 +1,8 @@
#ifndef Z64MATH_H
#define Z64MATH_H
-#include "ultra64.h"
#include "math.h"
-
-#define SQ(x) ((x)*(x))
-#define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z)
+#include "ultra64.h"
typedef union FloatInt {
f32 f;
@@ -95,6 +92,27 @@ typedef VecSphGeo VecSph;
// Pitch is 0 along the xz-plane (horizon)
typedef VecSphGeo VecGeo;
+/**
+ * Macros
+ */
+
+// General number macros
+#define SQ(x) ((x)*(x))
+#define ABS(x) ((x) >= 0 ? (x) : -(x))
+#define DECR(x) ((x) == 0 ? 0 : --(x))
+#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
+#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
+#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))
+
+#define SWAP(type, a, b) \
+ { \
+ type _temp = (a); \
+ (a) = (b); \
+ (b) = _temp; \
+ } \
+ (void)0
+
+// LERP macros
#define LERP(x, y, scale) (((y) - (x)) * (scale) + (x))
#define LERP32(x, y, scale) ((s32)(((y) - (x)) * (scale)) + (x))
#define LERP16(x, y, scale) ((s16)(((y) - (x)) * (scale)) + (x))
@@ -110,6 +128,7 @@ typedef VecSphGeo VecGeo;
(dst)->z = (v0)->z + (((v1)->z - (v0)->z) * t); \
}
+// Floating point macros
#define IS_ZERO(f) (fabsf(f) < 0.008f)
// Casting a float to an integer, when the float value is larger than what the integer type can hold,
@@ -145,6 +164,7 @@ typedef VecSphGeo VecGeo;
#define CAM_BINANG_TO_DEG(binang) ((f32)(binang) * (360.0001525f / 65535.0f))
// Vector macros
+#define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z)
#define SQXZ(vec) ((vec).x * (vec).x + (vec).z * (vec).z)
#define DOTXZ(vec1, vec2) ((vec1).x * (vec2).x + (vec1).z * (vec2).z)
#define SQXYZ(vec) ((vec).x * (vec).x + (vec).y * (vec).y + (vec).z * (vec).z)
diff --git a/include/z64message.h b/include/z64message.h
index 415ab80ac7..3dfa196d97 100644
--- a/include/z64message.h
+++ b/include/z64message.h
@@ -3,6 +3,7 @@
#include "z64view.h"
#include "versions.h"
+#include "z64font.h"
struct OcarinaStaff;
struct Actor;
@@ -14,11 +15,6 @@ typedef enum TextBoxIcon {
/* 2 */ TEXTBOX_ICON_ARROW
} TextBoxIcon;
-// TODO get these properties from the textures themselves
-#define FONT_CHAR_TEX_WIDTH 16
-#define FONT_CHAR_TEX_HEIGHT 16
-#define FONT_CHAR_TEX_SIZE ((FONT_CHAR_TEX_WIDTH * FONT_CHAR_TEX_HEIGHT) / 2) // 16x16 I4 texture
-
// TODO get these properties from the textures themselves
#define MESSAGE_STATIC_TEX_SIZE 0x1000
@@ -115,70 +111,6 @@ typedef enum MessageMode {
/* 0x37 */ MSGMODE_PAUSED // Causes the message system to do nothing until external code sets a new message mode or calls a public function
} MessageMode;
-typedef enum MaskReactionSet {
- /* 0x00 */ MASK_REACTION_SET_CARPENTER_BOSS,
- /* 0x01 */ MASK_REACTION_SET_CARPENTER_1,
- /* 0x02 */ MASK_REACTION_SET_CARPENTER_2,
- /* 0x03 */ MASK_REACTION_SET_CARPENTER_3,
- /* 0x04 */ MASK_REACTION_SET_CARPENTER_4,
- /* 0x05 */ MASK_REACTION_SET_HYRULIAN_GUARD,
- /* 0x06 */ MASK_REACTION_SET_HEISHI4_1,
- /* 0x07 */ MASK_REACTION_SET_HEISHI4_2,
- /* 0x08 */ MASK_REACTION_SET_CUCCO_LADY,
- /* 0x09 */ MASK_REACTION_SET_CARPENTERS_SON,
- /* 0x0A */ MASK_REACTION_SET_KAKARIKO_ROOF_MAN,
- /* 0x0B */ MASK_REACTION_SET_WINDMILL_MAN,
- /* 0x0C */ MASK_REACTION_SET_12, // Unused
- /* 0x0D */ MASK_REACTION_SET_CURSED_SKULLTULA_MAN,
- /* 0x0E */ MASK_REACTION_SET_DAMPE,
- /* 0x0F */ MASK_REACTION_SET_GRAVEYARD_KID,
- /* 0x10 */ MASK_REACTION_SET_SARIA,
- /* 0x11 */ MASK_REACTION_SET_MIDO,
- /* 0x12 */ MASK_REACTION_SET_FADO,
- /* 0x13 */ MASK_REACTION_SET_KOKIRI_1,
- /* 0x14 */ MASK_REACTION_SET_KOKIRI_2,
- /* 0x15 */ MASK_REACTION_SET_SKULL_KID,
- /* 0x16 */ MASK_REACTION_SET_ZELDA,
- /* 0x17 */ MASK_REACTION_SET_MALON,
- /* 0x18 */ MASK_REACTION_SET_TALON,
- /* 0x19 */ MASK_REACTION_SET_INGO,
- /* 0x1A */ MASK_REACTION_SET_LAKESIDE_PROFESSOR,
- /* 0x1B */ MASK_REACTION_SET_MAGIC_BEAN_SALESMAN,
- /* 0x1C */ MASK_REACTION_SET_RUNNING_MAN,
- /* 0x1D */ MASK_REACTION_SET_ZORA,
- /* 0x1E */ MASK_REACTION_SET_KING_ZORA,
- /* 0x1F */ MASK_REACTION_SET_RUTO,
- /* 0x20 */ MASK_REACTION_SET_GORON,
- /* 0x21 */ MASK_REACTION_SET_DARUNIA,
- /* 0x22 */ MASK_REACTION_SET_GERUDO_WHITE,
- /* 0x23 */ MASK_REACTION_SET_NABOORU,
- /* 0x24 */ MASK_REACTION_SET_DANCING_COUPLE,
- /* 0x25 */ MASK_REACTION_SET_DOG_LADY,
- /* 0x26 */ MASK_REACTION_SET_WOMAN_3,
- /* 0x27 */ MASK_REACTION_SET_MAN_1_BEARD,
- /* 0x28 */ MASK_REACTION_SET_MAN_2_BALD,
- /* 0x29 */ MASK_REACTION_SET_MAN_1_SHAVED_BLACK_SHIRT,
- /* 0x2A */ MASK_REACTION_SET_BEGGAR,
- /* 0x2B */ MASK_REACTION_SET_OLD_WOMAN,
- /* 0x2C */ MASK_REACTION_SET_OLD_MAN,
- /* 0x2D */ MASK_REACTION_SET_YOUNG_WOMAN_BROWN_HAIR,
- /* 0x2E */ MASK_REACTION_SET_MAN_2_MUSTACHE_RED_SHIRT,
- /* 0x2F */ MASK_REACTION_SET_MAN_2_MUSTACHE_BLUE_SHIRT,
- /* 0x30 */ MASK_REACTION_SET_YOUNG_WOMAN_ORANGE_HAIR,
- /* 0x31 */ MASK_REACTION_SET_MAN_2_ALT_MUSTACHE,
- /* 0x32 */ MASK_REACTION_SET_MAN_1_BOWL_CUT_PURPLE_SHIRT,
- /* 0x33 */ MASK_REACTION_SET_MAN_2_BEARD,
- /* 0x34 */ MASK_REACTION_SET_OLD_MAN_BALD_BROWN_ROBE,
- /* 0x35 */ MASK_REACTION_SET_MAN_2_MUSTACHE_WHITE_SHIRT,
- /* 0x36 */ MASK_REACTION_SET_MAN_1_SHAVED_GREEN_SHIRT,
- /* 0x37 */ MASK_REACTION_SET_WOMAN_2,
- /* 0x38 */ MASK_REACTION_SET_OLD_MAN_BALD_PURPLE_ROBE,
- /* 0x39 */ MASK_REACTION_SET_MAN_1_BOWL_CUT_GREEN_SHIRT,
- /* 0x3A */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_1,
- /* 0x3B */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_2,
- /* 0x3C */ MASK_REACTION_SET_MAX
-} MaskReactionSet;
-
typedef enum TextState {
/* 0 */ TEXT_STATE_NONE,
/* 1 */ TEXT_STATE_DONE_HAS_NEXT,
@@ -193,28 +125,6 @@ typedef enum TextState {
/* 10 */ TEXT_STATE_AWAITING_NEXT
} TextState;
-typedef struct Font {
- /* 0x0000 */ u32 msgOffset;
- /* 0x0004 */ u32 msgLength;
- union {
- /* 0x0008 */ u8 charTexBuf[FONT_CHAR_TEX_SIZE * 120];
- /* 0x0008 */ u64 force_structure_alignment_charTex;
- };
- union {
- /* 0x3C08 */ u8 iconBuf[FONT_CHAR_TEX_SIZE];
- /* 0x3C08 */ u64 force_structure_alignment_icon;
- };
- union {
- /* 0x3C88 */ u8 fontBuf[FONT_CHAR_TEX_SIZE * 320];
- /* 0x3C88 */ u64 force_structure_alignment_font;
- };
- union {
- /* 0xDC88 */ u8 msgBuf[1280];
- /* 0xDC88 */ u16 msgBufWide[640];
- /* 0xDC88 */ u64 force_structure_alignment_msg;
- };
-} Font; // size = 0xE188
-
#define TEXTBOX_ENDTYPE_DEFAULT 0x00
#define TEXTBOX_ENDTYPE_2_CHOICE 0x10
#define TEXTBOX_ENDTYPE_3_CHOICE 0x20
@@ -293,4 +203,6 @@ void Message_Update(struct PlayState* play);
void Message_SetTables(void);
void Message_Init(struct PlayState* play);
+extern s16 gOcarinaSongItemMap[];
+
#endif
diff --git a/include/z64ocarina.h b/include/z64ocarina.h
index afad53811b..d00ef01f2b 100644
--- a/include/z64ocarina.h
+++ b/include/z64ocarina.h
@@ -188,4 +188,9 @@ void AudioOcarina_MemoryGameInit(u8 minigameRound);
s32 AudioOcarina_MemoryGameNextNote(void);
void AudioOcarina_PlayLongScarecrowSong(void);
+extern u8* gFrogsSongPtr;
+extern OcarinaNote* gScarecrowLongSongPtr;
+extern u8* gScarecrowSpawnSongPtr;
+extern OcarinaSongButtons gOcarinaSongButtons[];
+
#endif
diff --git a/include/z64path.h b/include/z64path.h
new file mode 100644
index 0000000000..0f9243974a
--- /dev/null
+++ b/include/z64path.h
@@ -0,0 +1,19 @@
+#ifndef Z64PATH_H
+#define Z64PATH_H
+
+#include "ultra64.h"
+#include "z64math.h"
+
+struct PlayState;
+struct Actor;
+
+typedef struct Path {
+ /* 0x00 */ u8 count; // number of points in the path
+ /* 0x04 */ Vec3s* points; // Segment Address to the array of points
+} Path; // size = 0x8
+
+Path* Path_GetByIndex(struct PlayState* play, s16 index, s16 max);
+f32 Path_OrientAndGetDistSq(struct Actor* actor, Path* path, s16 waypoint, s16* yaw);
+void Path_CopyLastPoint(Path* path, Vec3f* dest);
+
+#endif
diff --git a/include/z64pause.h b/include/z64pause.h
index 97ae476d1a..da0e56038a 100644
--- a/include/z64pause.h
+++ b/include/z64pause.h
@@ -252,4 +252,9 @@ void KaleidoSetup_Update(struct PlayState* play);
void KaleidoSetup_Init(struct PlayState* play);
void KaleidoSetup_Destroy(struct PlayState* play);
+extern u8 gBossMarkState;
+extern f32 gBossMarkScale;
+extern u32 D_8016139C;
+extern PauseMapMarksData* gLoadedPauseMarkDataTable;
+
#endif
diff --git a/include/z64play.h b/include/z64play.h
index cb2e78edc4..4853ac8f47 100644
--- a/include/z64play.h
+++ b/include/z64play.h
@@ -4,7 +4,7 @@
#include "ultra64.h"
#include "prerender.h"
-
+#include "transition_tile.h"
#include "z64actor.h"
#include "z64bgcheck.h"
#include "z64camera.h"
@@ -18,6 +18,7 @@
#include "z64message.h"
#include "z64object.h"
#include "z64pause.h"
+#include "z64room.h"
#include "z64scene.h"
#include "z64sfx_source.h"
#include "z64skybox.h"
@@ -26,10 +27,26 @@
#include "z64view.h"
union Color_RGBA8_u32;
+struct Path;
struct Player;
struct QuestHintCmd;
struct VisMono;
+typedef enum PauseBgPreRenderState {
+ /* 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.
+ /* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters.
+ /* 3 */ PAUSE_BG_PRERENDER_READY, // The pause background is ready to be used.
+ /* 4 */ PAUSE_BG_PRERENDER_MAX
+} PauseBgPreRenderState;
+
+typedef enum TransitionTileState {
+ /* 0 */ TRANS_TILE_OFF, // Inactive, do nothing
+ /* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers
+ /* 2 */ TRANS_TILE_PROCESS, // Initialize the transition
+ /* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame
+} TransitionTileState;
+
typedef struct SceneSequences {
/* 0x00 */ u8 seqId;
/* 0x01 */ u8 natureAmbienceId;
@@ -88,7 +105,7 @@ typedef struct PlayState {
/* 0x11DFC */ void* unk_11DFC;
/* 0x11E00 */ Spawn* spawnList;
/* 0x11E04 */ s16* exitList;
- /* 0x11E08 */ Path* pathList;
+ /* 0x11E08 */ struct Path* pathList;
/* 0x11E0C */ struct QuestHintCmd* naviQuestHints;
/* 0x11E10 */ void* specialEffects;
/* 0x11E14 */ u8 skyboxId;
@@ -115,6 +132,8 @@ typedef struct PlayState {
/* 0x12430 */ char unk_12430[0xE8];
} PlayState; // size = 0x12518
+extern Mtx D_01000000; // billboardMtx
+
#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamId])
#define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].head)
@@ -122,8 +141,6 @@ void Play_SetViewpoint(PlayState* this, s16 viewpoint);
s32 Play_CheckViewpoint(PlayState* this, s16 viewpoint);
void Play_SetShopBrowsingViewpoint(PlayState* this);
Gfx* Play_SetFog(PlayState* this, Gfx* gfx);
-void Play_Destroy(GameState* thisx);
-void Play_Init(GameState* thisx);
void Play_Main(GameState* thisx);
int Play_InCsMode(PlayState* this);
f32 func_800BFCB8(PlayState* this, MtxF* mf, Vec3f* pos);
@@ -148,6 +165,11 @@ void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams);
void Play_TriggerVoidOut(PlayState* this);
void Play_TriggerRespawn(PlayState* this);
int Play_CamIsNotFixed(PlayState* this);
+s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw);
+s32 func_800C0DB4(PlayState* this, Vec3f* pos);
+
+void Play_Init(GameState* thisx);
+void Play_Destroy(GameState* thisx);
#if DEBUG_FEATURES
extern void* gDebugCutsceneScript;
diff --git a/include/z64quest_hint.h b/include/z64quest_hint.h
new file mode 100644
index 0000000000..b592a07c34
--- /dev/null
+++ b/include/z64quest_hint.h
@@ -0,0 +1,11 @@
+#ifndef Z64QUEST_HINT_H
+#define Z64QUEST_HINT_H
+
+#include "ultra64.h"
+
+struct PlayState;
+
+u16 QuestHint_GetSariaTextId(struct PlayState* play);
+u16 QuestHint_GetNaviTextId(struct PlayState* play);
+
+#endif
diff --git a/include/z64quest_hint_commands.h b/include/z64quest_hint_commands.h
index 62f262f39b..8b99510160 100644
--- a/include/z64quest_hint_commands.h
+++ b/include/z64quest_hint_commands.h
@@ -3,6 +3,13 @@
#include "ultra64.h"
+typedef struct QuestHintCmd {
+ /* 0x00 */ u8 byte0;
+ /* 0x01 */ u8 byte1;
+ /* 0x02 */ u8 byte2;
+ /* 0x03 */ u8 byte3;
+} QuestHintCmd; // size = 0x4
+
/*
* Hint Command Types
*/
diff --git a/include/z64room.h b/include/z64room.h
new file mode 100644
index 0000000000..72c6f0982b
--- /dev/null
+++ b/include/z64room.h
@@ -0,0 +1,174 @@
+#ifndef Z64ROOM_H
+#define Z64ROOM_H
+
+#include "ultra64.h"
+#include "z64dma.h"
+#include "z64math.h"
+
+struct Input;
+struct PlayState;
+
+// Room shapes
+
+typedef enum RoomShapeType {
+ /* 0 */ ROOM_SHAPE_TYPE_NORMAL,
+ /* 1 */ ROOM_SHAPE_TYPE_IMAGE,
+ /* 2 */ ROOM_SHAPE_TYPE_CULLABLE,
+ /* 3 */ ROOM_SHAPE_TYPE_MAX
+} RoomShapeType;
+
+typedef struct RoomShapeBase {
+ /* 0x00 */ u8 type;
+} RoomShapeBase; // size = 0x01
+
+typedef struct RoomShapeDListsEntry {
+ /* 0x00 */ Gfx* opa;
+ /* 0x04 */ Gfx* xlu;
+} RoomShapeDListsEntry; // size = 0x08
+
+typedef struct RoomShapeNormal {
+ /* 0x00 */ RoomShapeBase base;
+ /* 0x01 */ u8 numEntries;
+ /* 0x04 */ RoomShapeDListsEntry* entries;
+ /* 0x08 */ RoomShapeDListsEntry* entriesEnd;
+} RoomShapeNormal; // size = 0x0C
+
+typedef enum RoomShapeImageAmountType {
+ /* 1 */ ROOM_SHAPE_IMAGE_AMOUNT_SINGLE = 1,
+ /* 2 */ ROOM_SHAPE_IMAGE_AMOUNT_MULTI
+} RoomShapeImageAmountType;
+
+typedef struct RoomShapeImageBase {
+ /* 0x00 */ RoomShapeBase base;
+ /* 0x01 */ u8 amountType; // RoomShapeImageAmountType
+ /* 0x04 */ RoomShapeDListsEntry* entry;
+} RoomShapeImageBase; // size = 0x08
+
+typedef struct RoomShapeImageSingle {
+ /* 0x00 */ RoomShapeImageBase base;
+ /* 0x08 */ void* source;
+ /* 0x0C */ u32 unk_0C;
+ /* 0x10 */ void* tlut;
+ /* 0x14 */ u16 width;
+ /* 0x16 */ u16 height;
+ /* 0x18 */ u8 fmt;
+ /* 0x19 */ u8 siz;
+ /* 0x1A */ u16 tlutMode;
+ /* 0x1C */ u16 tlutCount;
+} RoomShapeImageSingle; // size = 0x20
+
+typedef struct RoomShapeImageMultiBgEntry {
+ /* 0x00 */ u16 unk_00;
+ /* 0x02 */ u8 bgCamIndex; // for which bg cam index is this entry for
+ /* 0x04 */ void* source;
+ /* 0x08 */ u32 unk_0C;
+ /* 0x0C */ void* tlut;
+ /* 0x10 */ u16 width;
+ /* 0x12 */ u16 height;
+ /* 0x14 */ u8 fmt;
+ /* 0x15 */ u8 siz;
+ /* 0x16 */ u16 tlutMode;
+ /* 0x18 */ u16 tlutCount;
+} RoomShapeImageMultiBgEntry; // size = 0x1C
+
+typedef struct RoomShapeImageMulti {
+ /* 0x00 */ RoomShapeImageBase base;
+ /* 0x08 */ u8 numBackgrounds;
+ /* 0x0C */ RoomShapeImageMultiBgEntry* backgrounds;
+} RoomShapeImageMulti; // size = 0x10
+
+typedef struct RoomShapeCullableEntry {
+ /* 0x00 */ Vec3s boundsSphereCenter;
+ /* 0x06 */ s16 boundsSphereRadius;
+ /* 0x08 */ Gfx* opa;
+ /* 0x0C */ Gfx* xlu;
+} RoomShapeCullableEntry; // size = 0x10
+
+#define ROOM_SHAPE_CULLABLE_MAX_ENTRIES 64
+
+typedef struct RoomShapeCullable {
+ /* 0x00 */ RoomShapeBase base;
+ /* 0x01 */ u8 numEntries;
+ /* 0x04 */ RoomShapeCullableEntry* entries;
+ /* 0x08 */ RoomShapeCullableEntry* entriesEnd;
+} RoomShapeCullable; // size = 0x0C
+
+typedef union RoomShape {
+ RoomShapeBase base;
+ RoomShapeNormal normal;
+ union {
+ RoomShapeImageBase base;
+ RoomShapeImageSingle single;
+ RoomShapeImageMulti multi;
+ } image;
+ RoomShapeCullable cullable;
+} RoomShape; // "Ground Shape"
+
+typedef enum RoomType {
+ /* 0 */ ROOM_TYPE_NORMAL,
+ /* 1 */ ROOM_TYPE_DUNGEON, // Blocks Sun's Song's time advance effect. Not exclusively used by typical dungeon rooms.
+ /* 2 */ ROOM_TYPE_INDOORS, // Reduces player run speed and blocks player from attacking or jumping.
+ /* 3 */ ROOM_TYPE_3, // Unused. Color dithering is turned off when drawing the room and other things.
+ /* 4 */ ROOM_TYPE_4, // Unused. Prevents switching to CAM_SET_HORSE when mounting a horse.
+ /* 5 */ ROOM_TYPE_BOSS // Disables Environment_AdjustLights
+} RoomType;
+
+typedef enum RoomEnvironmentType {
+ /* 0 */ ROOM_ENV_DEFAULT,
+ /* 1 */ ROOM_ENV_COLD,
+ /* 2 */ ROOM_ENV_WARM,
+ /* 3 */ ROOM_ENV_HOT, // Enables hot room timer for the current room
+ /* 4 */ ROOM_ENV_UNK_STRETCH_1,
+ /* 5 */ ROOM_ENV_UNK_STRETCH_2,
+ /* 6 */ ROOM_ENV_UNK_STRETCH_3
+} RoomEnvironmentType;
+
+typedef enum LensMode {
+ /* 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)
+} LensMode;
+
+typedef struct Room {
+ /* 0x00 */ s8 num; // -1 is invalid room
+ /* 0x01 */ u8 unk_01;
+ /* 0x02 */ u8 environmentType;
+ /* 0x03 */ u8 type;
+ /* 0x04 */ s8 echo;
+ /* 0x05 */ u8 lensMode;
+ /* 0x08 */ RoomShape* roomShape; // original name: "ground_shape"
+ /* 0x0C */ void* segment;
+ /* 0x10 */ char unk_10[0x4];
+} Room; // size = 0x14
+
+typedef struct RoomContext {
+ /* 0x00 */ Room curRoom;
+ /* 0x14 */ Room prevRoom;
+ /* 0x28 */ void* bufPtrs[2]; // Start and end pointers for the room buffer. Can be split into two pages, where page 0 is allocated from the start pointer and page 1 is allocated from the end pointer.
+ /* 0x30 */ u8 activeBufPage; // 0 - First page in memory, 1 - Last page in memory
+ /* 0x31 */ s8 status; // 0 - Free for new room request, 1 - DmaRequest for a new room is in progress
+ /* 0x34 */ void* roomRequestAddr; // Pointer to where the requested room segment will be stored
+ /* 0x38 */ DmaRequest dmaRequest;
+ /* 0x58 */ OSMesgQueue loadQueue;
+ /* 0x70 */ OSMesg loadMsg;
+ /* 0x74 */ s16 drawParams[2]; // context-specific data used by the current scene draw config
+} RoomContext; // size = 0x78
+
+typedef struct RoomList {
+ /* 0x00 */ u8 count;
+ /* 0x04 */ RomFile* romFiles; // Array of rom addresses for each room in a scene
+} RoomList;
+
+#define ROOM_DRAW_OPA (1 << 0)
+#define ROOM_DRAW_XLU (1 << 1)
+
+void func_80095AA0(struct PlayState* play, Room* room, struct Input* input, s32 arg3);
+void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
+ u16 tlutCount, f32 offsetX, f32 offsetY);
+void Room_Init(struct PlayState* play, Room* room);
+u32 Room_SetupFirstRoom(struct PlayState* play, RoomContext* roomCtx);
+s32 Room_RequestNewRoom(struct PlayState* play, RoomContext* roomCtx, s32 roomNum);
+s32 Room_ProcessRoomRequest(struct PlayState* play, RoomContext* roomCtx);
+void Room_Draw(struct PlayState* play, Room* room, u32 flags);
+void Room_FinishRoomChange(struct PlayState* play, RoomContext* roomCtx);
+
+#endif
diff --git a/include/z64save.h b/include/z64save.h
index 62107df5ed..71b1414052 100644
--- a/include/z64save.h
+++ b/include/z64save.h
@@ -6,6 +6,11 @@
#include "z64inventory.h"
#include "z64math.h"
+typedef enum ZTargetSetting {
+ /* 0 */ Z_TARGET_SETTING_SWITCH,
+ /* 1 */ Z_TARGET_SETTING_HOLD
+} ZTargetSetting;
+
typedef enum Language {
#if OOT_NTSC
/* 0 */ LANGUAGE_JPN,
@@ -315,10 +320,10 @@ typedef struct SaveContext {
/* 0x1404 */ u16 minigameState;
/* 0x1406 */ u16 minigameScore; // "yabusame_total"
/* 0x1408 */ char unk_1408[0x0001];
- /* 0x1409 */ u8 language; // NTSC 0: Japanese; 1: English | PAL 0: English; 1: German; 2: French
- /* 0x140A */ u8 audioSetting;
+ /* 0x1409 */ u8 language; // NTSC 0: Japanese; 1: English | PAL 0: English; 1: German; 2: French (see enum `Language`)
+ /* 0x140A */ u8 soundSetting; // 0: Stereo; 1: Mono; 2: Headset; 3: Surround (see enum `SoundSetting`)
/* 0x140B */ char unk_140B[0x0001];
- /* 0x140C */ u8 zTargetSetting; // 0: Switch; 1: Hold
+ /* 0x140C */ u8 zTargetSetting; // 0: Switch; 1: Hold (see enum `ZTargetSetting`)
/* 0x140E */ u16 forcedSeqId; // immediately start playing the sequence if set
/* 0x1410 */ u8 cutsceneTransitionControl; // context dependent usage: can either trigger a delayed fade or control fill alpha
/* 0x1411 */ char unk_1411[0x0001];
@@ -587,14 +592,11 @@ typedef enum LinkAge {
(EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_0_RESCUED) | EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_1_RESCUED) | \
EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_2_RESCUED) | EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_3_RESCUED))
-#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED() \
- CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED], \
- EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK)
+#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED() \
+ ((gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) == (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK))
-#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED2() \
- CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & \
- (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK | 0xF0), \
- EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK)
+#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED2() \
+ ((gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK | 0xF0) & EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) == (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK))
#define ENDAIKU_CARPENTER_RESCUED_MASK(carpenterType) (1 << (carpenterType))
@@ -991,6 +993,7 @@ typedef enum IngoRaceState {
#define EVENTINF_30 0x30
+void SaveContext_Init(void);
extern SaveContext gSaveContext;
diff --git a/include/z64scene.h b/include/z64scene.h
index 4acf9df16a..09b342c047 100644
--- a/include/z64scene.h
+++ b/include/z64scene.h
@@ -1,18 +1,19 @@
#ifndef Z64SCENE_H
#define Z64SCENE_H
-#include "macros.h"
+#include "avoid_ub.h"
#include "ultra64.h"
#include "z64bgcheck.h"
-#include "z64dma.h"
#include "z64environment.h"
#include "z64light.h"
#include "z64math.h"
+#include "z64path.h"
#include "command_macros_base.h"
struct GameState;
struct PlayState;
+struct RoomShapeBase;
typedef struct SceneTableEntry {
/* 0x00 */ RomFile sceneFile;
@@ -51,159 +52,6 @@ typedef struct Spawn {
/* 0x01 */ u8 room;
} Spawn;
-typedef struct Path {
- /* 0x00 */ u8 count; // number of points in the path
- /* 0x04 */ Vec3s* points; // Segment Address to the array of points
-} Path; // size = 0x8
-
-// Room shapes
-
-typedef enum RoomShapeType {
- /* 0 */ ROOM_SHAPE_TYPE_NORMAL,
- /* 1 */ ROOM_SHAPE_TYPE_IMAGE,
- /* 2 */ ROOM_SHAPE_TYPE_CULLABLE,
- /* 3 */ ROOM_SHAPE_TYPE_MAX
-} RoomShapeType;
-
-typedef struct RoomShapeBase {
- /* 0x00 */ u8 type;
-} RoomShapeBase; // size = 0x01
-
-typedef struct RoomShapeDListsEntry {
- /* 0x00 */ Gfx* opa;
- /* 0x04 */ Gfx* xlu;
-} RoomShapeDListsEntry; // size = 0x08
-
-typedef struct RoomShapeNormal {
- /* 0x00 */ RoomShapeBase base;
- /* 0x01 */ u8 numEntries;
- /* 0x04 */ RoomShapeDListsEntry* entries;
- /* 0x08 */ RoomShapeDListsEntry* entriesEnd;
-} RoomShapeNormal; // size = 0x0C
-
-typedef enum RoomShapeImageAmountType {
- /* 1 */ ROOM_SHAPE_IMAGE_AMOUNT_SINGLE = 1,
- /* 2 */ ROOM_SHAPE_IMAGE_AMOUNT_MULTI
-} RoomShapeImageAmountType;
-
-typedef struct RoomShapeImageBase {
- /* 0x00 */ RoomShapeBase base;
- /* 0x01 */ u8 amountType; // RoomShapeImageAmountType
- /* 0x04 */ RoomShapeDListsEntry* entry;
-} RoomShapeImageBase; // size = 0x08
-
-typedef struct RoomShapeImageSingle {
- /* 0x00 */ RoomShapeImageBase base;
- /* 0x08 */ void* source;
- /* 0x0C */ u32 unk_0C;
- /* 0x10 */ void* tlut;
- /* 0x14 */ u16 width;
- /* 0x16 */ u16 height;
- /* 0x18 */ u8 fmt;
- /* 0x19 */ u8 siz;
- /* 0x1A */ u16 tlutMode;
- /* 0x1C */ u16 tlutCount;
-} RoomShapeImageSingle; // size = 0x20
-
-typedef struct RoomShapeImageMultiBgEntry {
- /* 0x00 */ u16 unk_00;
- /* 0x02 */ u8 bgCamIndex; // for which bg cam index is this entry for
- /* 0x04 */ void* source;
- /* 0x08 */ u32 unk_0C;
- /* 0x0C */ void* tlut;
- /* 0x10 */ u16 width;
- /* 0x12 */ u16 height;
- /* 0x14 */ u8 fmt;
- /* 0x15 */ u8 siz;
- /* 0x16 */ u16 tlutMode;
- /* 0x18 */ u16 tlutCount;
-} RoomShapeImageMultiBgEntry; // size = 0x1C
-
-typedef struct RoomShapeImageMulti {
- /* 0x00 */ RoomShapeImageBase base;
- /* 0x08 */ u8 numBackgrounds;
- /* 0x0C */ RoomShapeImageMultiBgEntry* backgrounds;
-} RoomShapeImageMulti; // size = 0x10
-
-typedef struct RoomShapeCullableEntry {
- /* 0x00 */ Vec3s boundsSphereCenter;
- /* 0x06 */ s16 boundsSphereRadius;
- /* 0x08 */ Gfx* opa;
- /* 0x0C */ Gfx* xlu;
-} RoomShapeCullableEntry; // size = 0x10
-
-#define ROOM_SHAPE_CULLABLE_MAX_ENTRIES 64
-
-typedef struct RoomShapeCullable {
- /* 0x00 */ RoomShapeBase base;
- /* 0x01 */ u8 numEntries;
- /* 0x04 */ RoomShapeCullableEntry* entries;
- /* 0x08 */ RoomShapeCullableEntry* entriesEnd;
-} RoomShapeCullable; // size = 0x0C
-
-typedef union RoomShape {
- RoomShapeBase base;
- RoomShapeNormal normal;
- union {
- RoomShapeImageBase base;
- RoomShapeImageSingle single;
- RoomShapeImageMulti multi;
- } image;
- RoomShapeCullable cullable;
-} RoomShape; // "Ground Shape"
-
-typedef enum RoomType {
- /* 0 */ ROOM_TYPE_NORMAL,
- /* 1 */ ROOM_TYPE_DUNGEON, // Blocks Sun's Song's time advance effect. Not exclusively used by typical dungeon rooms.
- /* 2 */ ROOM_TYPE_INDOORS, // Reduces player run speed and blocks player from attacking or jumping.
- /* 3 */ ROOM_TYPE_3, // Unused. Color dithering is turned off when drawing the room and other things.
- /* 4 */ ROOM_TYPE_4, // Unused. Prevents switching to CAM_SET_HORSE when mounting a horse.
- /* 5 */ ROOM_TYPE_BOSS // Disables Environment_AdjustLights
-} RoomType;
-
-typedef enum RoomEnvironmentType {
- /* 0 */ ROOM_ENV_DEFAULT,
- /* 1 */ ROOM_ENV_COLD,
- /* 2 */ ROOM_ENV_WARM,
- /* 3 */ ROOM_ENV_HOT, // Enables hot room timer for the current room
- /* 4 */ ROOM_ENV_UNK_STRETCH_1,
- /* 5 */ ROOM_ENV_UNK_STRETCH_2,
- /* 6 */ ROOM_ENV_UNK_STRETCH_3
-} RoomEnvironmentType;
-
-typedef struct Room {
- /* 0x00 */ s8 num; // -1 is invalid room
- /* 0x01 */ u8 unk_01;
- /* 0x02 */ u8 environmentType;
- /* 0x03 */ u8 type;
- /* 0x04 */ s8 echo;
- /* 0x05 */ u8 lensMode;
- /* 0x08 */ RoomShape* roomShape; // original name: "ground_shape"
- /* 0x0C */ void* segment;
- /* 0x10 */ char unk_10[0x4];
-} Room; // size = 0x14
-
-typedef struct RoomContext {
- /* 0x00 */ Room curRoom;
- /* 0x14 */ Room prevRoom;
- /* 0x28 */ void* bufPtrs[2]; // Start and end pointers for the room buffer. Can be split into two pages, where page 0 is allocated from the start pointer and page 1 is allocated from the end pointer.
- /* 0x30 */ u8 activeBufPage; // 0 - First page in memory, 1 - Last page in memory
- /* 0x31 */ s8 status; // 0 - Free for new room request, 1 - DmaRequest for a new room is in progress
- /* 0x34 */ void* roomRequestAddr; // Pointer to where the requested room segment will be stored
- /* 0x38 */ DmaRequest dmaRequest;
- /* 0x58 */ OSMesgQueue loadQueue;
- /* 0x70 */ OSMesg loadMsg;
- /* 0x74 */ s16 drawParams[2]; // context-specific data used by the current scene draw config
-} RoomContext; // size = 0x78
-
-typedef struct RoomList {
- /* 0x00 */ u8 count;
- /* 0x04 */ RomFile* romFiles; // Array of rom addresses for each room in a scene
-} RoomList;
-
-#define ROOM_DRAW_OPA (1 << 0)
-#define ROOM_DRAW_XLU (1 << 1)
-
// Scene commands
typedef struct SCmdBase {
@@ -273,7 +121,7 @@ typedef struct SCmdRoomBehavior {
typedef struct SCmdMesh {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
- /* 0x04 */ RoomShapeBase* data;
+ /* 0x04 */ struct RoomShapeBase* data;
} SCmdMesh;
typedef struct SCmdObjectList {
diff --git a/include/z64skin.h b/include/z64skin.h
index d29c7c7482..641a980925 100644
--- a/include/z64skin.h
+++ b/include/z64skin.h
@@ -3,6 +3,10 @@
#include "z64animation.h"
+struct Actor;
+struct GraphicsContext;
+struct PlayState;
+
/**
* Holds a compact version of a vertex used in the Skin system
* It is used to initialise the Vtx used by an animated limb
@@ -75,4 +79,19 @@ typedef s32 (*SkinOverrideLimbDraw)(struct Actor*, struct PlayState*, s32, Skin*
#define SKIN_TRANSFORM_IS_FHG 0x23
+void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* modifEntry, Vtx* vtxBuf, Vec3f* pos);
+void Skin_DrawAnimatedLimb(struct GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, s32 arg3, s32 drawFlags);
+void Skin_DrawLimb(struct GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, Gfx* dlistOverride, s32 drawFlags);
+void func_800A6330(struct Actor* actor, struct PlayState* play, Skin* skin, SkinPostDraw postDraw, s32 setTranslation);
+void func_800A6360(struct Actor* actor, struct PlayState* play, Skin* skin, SkinPostDraw postDraw,
+ SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation);
+void func_800A6394(struct Actor* actor, struct PlayState* play, Skin* skin, SkinPostDraw postDraw,
+ SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6);
+void func_800A63CC(struct Actor* actor, struct PlayState* play, Skin* skin, SkinPostDraw postDraw,
+ SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6, s32 drawFlags);
+void Skin_GetLimbPos(Skin* skin, s32 limbIndex, Vec3f* offset, Vec3f* dst);
+void Skin_Init(struct PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, AnimationHeader* animationHeader);
+void Skin_Free(struct PlayState* play, Skin* skin);
+s32 Skin_ApplyAnimTransformations(Skin* skin, MtxF* limbMatrices, struct Actor* actor, s32 setTranslation);
+
#endif
diff --git a/include/z64sram.h b/include/z64sram.h
index 3769f4419d..f1d05b7775 100644
--- a/include/z64sram.h
+++ b/include/z64sram.h
@@ -3,6 +3,9 @@
#include "ultra64/ultratypes.h"
+struct FileSelectState;
+struct GameState;
+
typedef struct SramContext {
/* 0x00 */ u8* readBuff;
} SramContext; // size = 0x4
@@ -12,9 +15,24 @@ typedef struct SramContext {
typedef enum SramHeaderField {
/* 0x00 */ SRAM_HEADER_SOUND,
- /* 0x01 */ SRAM_HEADER_ZTARGET,
+ /* 0x01 */ SRAM_HEADER_Z_TARGET,
/* 0x02 */ SRAM_HEADER_LANGUAGE,
/* 0x03 */ SRAM_HEADER_MAGIC // must be the value in `sSramDefaultHeader` for save to be considered valid
} SramHeaderField;
+extern u16 gSramSlotOffsets[];
+
+void Sram_InitNewSave(void);
+void Sram_InitDebugSave(void);
+void Sram_OpenSave(SramContext* sramCtx);
+void Sram_WriteSave(SramContext* sramCtx);
+void Sram_VerifyAndLoadAllSaves(struct FileSelectState* fileSelect, SramContext* sramCtx);
+void Sram_InitSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
+void Sram_EraseSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
+void Sram_CopySave(struct FileSelectState* fileSelect, SramContext* sramCtx);
+void Sram_WriteSramHeader(SramContext* sramCtx);
+void Sram_InitSram(struct GameState* gameState, SramContext* sramCtx);
+void Sram_Alloc(struct GameState* gameState, SramContext* sramCtx);
+void Sram_Init(struct GameState* gameState, SramContext* sramCtx);
+
#endif
diff --git a/include/z64ss_sram.h b/include/z64ss_sram.h
new file mode 100644
index 0000000000..ffd628239d
--- /dev/null
+++ b/include/z64ss_sram.h
@@ -0,0 +1,12 @@
+#ifndef Z64SS_SRAM_H
+#define Z64SS_SRAM_H
+
+#include "libc/stddef.h"
+#include "ultra64/ultratypes.h"
+
+void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration,
+ u8 handlePulse, u32 handleSpeed);
+void SsSram_Dma(void* dramAddr, size_t size, s32 direction);
+void SsSram_ReadWrite(s32 addr, void* dramAddr, size_t size, s32 direction);
+
+#endif
diff --git a/include/z64thread.h b/include/z64thread.h
new file mode 100644
index 0000000000..c4ab827b42
--- /dev/null
+++ b/include/z64thread.h
@@ -0,0 +1,33 @@
+#ifndef Z64THREAD_H
+#define Z64THREAD_H
+
+#include "ultra64.h"
+
+#define THREAD_ID_IDLE 1
+#define THREAD_ID_FAULT 2
+#define THREAD_ID_MAIN 3
+#define THREAD_ID_GRAPH 4
+#define THREAD_ID_SCHED 5
+#define THREAD_ID_PADMGR 7
+#define THREAD_ID_N64DD 8
+#define THREAD_ID_DDMSG 9
+#define THREAD_ID_AUDIOMGR 10
+#define THREAD_ID_DMAMGR 18
+#define THREAD_ID_IRQMGR 19
+
+#define THREAD_PRI_IDLE_INIT 10
+#define THREAD_PRI_MAIN_INIT 10
+#define THREAD_PRI_DMAMGR_LOW 10 // Used when decompressing files
+#define THREAD_PRI_GRAPH 11
+#define THREAD_PRI_AUDIOMGR 12
+#define THREAD_PRI_N64DD 13
+#define THREAD_PRI_DDMSG 13
+#define THREAD_PRI_PADMGR 14
+#define THREAD_PRI_MAIN 15
+#define THREAD_PRI_SCHED 15
+#define THREAD_PRI_DMAMGR 16
+#define THREAD_PRI_IRQMGR 17
+#define THREAD_PRI_FAULT_CLIENT (OS_PRIORITY_APPMAX - 1)
+#define THREAD_PRI_FAULT OS_PRIORITY_APPMAX
+
+#endif
diff --git a/include/z64transition.h b/include/z64transition.h
index 569b8fb328..d46683d2b3 100644
--- a/include/z64transition.h
+++ b/include/z64transition.h
@@ -3,6 +3,10 @@
#include "ultra64/ultratypes.h"
#include "ultra64/gbi.h" // for Gfx
+#include "transition_circle.h"
+#include "transition_fade.h"
+#include "transition_triforce.h"
+#include "transition_wipe.h"
#include "z64transition_instances.h"
#define TRANS_TRIGGER_OFF 0 // transition is not active
diff --git a/include/z64transition_instances.h b/include/z64transition_instances.h
index 154b98d008..cc35add03c 100644
--- a/include/z64transition_instances.h
+++ b/include/z64transition_instances.h
@@ -1,104 +1,10 @@
#ifndef Z64TRANSITION_INSTANCES_H
#define Z64TRANSITION_INSTANCES_H
-#include "ultra64.h"
-#include "color.h"
-
-typedef struct TransitionTileVtxData {
- /* 0x0 */ f32 x;
- /* 0x4 */ f32 y;
-} TransitionTileVtxData; // size = 0x8
-
-typedef struct TransitionTile {
- /* 0x00 */ s32 cols;
- /* 0x04 */ s32 rows;
- /* 0x08 */ s32 frame;
- /* 0x0C */ TransitionTileVtxData* vtxData;
- /* 0x10 */ Vtx* vtxFrame1;
- /* 0x14 */ Vtx* vtxFrame2;
- /* 0x18 */ Mtx projection;
- /* 0x58 */ Mtx modelView;
- /* 0x98 */ Mtx unk_98;
- /* 0xD8 */ Gfx* gfx; // "gfxtbl"
- /* 0xDC */ u16* zBuffer;
-} TransitionTile; // size = 0xE0
-
typedef enum TransitionInstanceType {
/* 1 */ TRANS_INSTANCE_TYPE_FILL_OUT = 1,
- /* 2 */ TRANS_INSTANCE_TYPE_FILL_IN
+ /* 2 */ TRANS_INSTANCE_TYPE_FILL_IN,
+ /* 3 */ TRANS_INSTANCE_TYPE_FADE_FLASH
} TransitionInstanceType;
-typedef struct TransitionWipe {
- /* 0x000 */ Color_RGBA8_u32 color;
- /* 0x004 */ Color_RGBA8_u32 unkColor;
- /* 0x008 */ u8 direction;
- /* 0x009 */ u8 frame;
- /* 0x00A */ u8 isDone;
- /* 0x00C */ u16 texX;
- /* 0x00E */ u16 texY;
- /* 0x010 */ u16 normal;
- /* 0x018 */ Mtx projection;
- /* 0x058 */ Mtx lookAt;
- /* 0x098 */ Mtx modelView[2][3];
-} TransitionWipe; // size = 0x218
-
-#define TRANS_INSTANCE_TYPE_FADE_FLASH 3
-
-typedef struct TransitionFade {
- /* 0x000 */ u8 type;
- /* 0x001 */ u8 isDone;
- /* 0x002 */ u8 direction;
- /* 0x004 */ Color_RGBA8_u32 color;
- /* 0x008 */ u16 timer;
-} TransitionFade; // size = 0xC
-
-typedef enum TransitionCircleAppearance {
- /* 0 */ TCA_NORMAL,
- /* 1 */ TCA_WAVE,
- /* 2 */ TCA_RIPPLE,
- /* 3 */ TCA_STARBURST
-} TransitionCircleAppearance;
-
-typedef enum TransitionCircleColor {
- /* 0 */ TCC_BLACK,
- /* 1 */ TCC_WHITE,
- /* 2 */ TCC_GRAY,
- /* 3 */ TCC_SPECIAL // color varies depending on appearance. unused and appears broken
-} TransitionCircleColor;
-
-typedef enum TransitionCircleSpeed {
- /* 0 */ TCS_FAST,
- /* 1 */ TCS_SLOW
-} TransitionCircleSpeed;
-
-typedef struct TransitionCircle {
- /* 0x000 */ Color_RGBA8_u32 color;
- /* 0x004 */ Color_RGBA8_u32 unkColor;
- /* 0x008 */ s32 texX;
- /* 0x00C */ s32 texY;
- /* 0x010 */ s32 speed;
- /* 0x014 */ u8 direction;
- /* 0x015 */ u8 colorType;
- /* 0x016 */ u8 speedType;
- /* 0x017 */ u8 appearanceType;
- /* 0x018 */ u8 isDone;
- /* 0x019 */ u8 frame;
- /* 0x01A */ u16 normal;
- /* 0x020 */ Mtx projection;
- /* 0x060 */ Mtx lookAt;
- /* 0x0A0 */ void* texture;
- /* 0x0A8 */ Mtx modelView[2][3];
-} TransitionCircle; // size = 0x228
-
-typedef struct TransitionTriforce {
- /* 0x000 */ Color_RGBA8_u32 color;
- /* 0x004 */ f32 transPos;
- /* 0x008 */ f32 step;
- /* 0x00C */ s32 state;
- /* 0x010 */ s32 type;
- /* 0x018 */ Mtx projection;
- /* 0x058 */ s32 frame;
- /* 0x060 */ Mtx modelView[2][3];
-} TransitionTriforce; // size = 0x1E0
-
#endif
diff --git a/include/z64view.h b/include/z64view.h
index 82f4ee48ff..83bdf0fe84 100644
--- a/include/z64view.h
+++ b/include/z64view.h
@@ -1,6 +1,7 @@
#ifndef Z64VIEW_H
#define Z64VIEW_H
+#include "avoid_ub.h"
#include "ultra64.h"
#include "z64math.h"
diff --git a/include/z64vis.h b/include/z64vis.h
index fcd24d1b76..86e286c325 100644
--- a/include/z64vis.h
+++ b/include/z64vis.h
@@ -28,7 +28,6 @@ typedef struct Vis {
} Vis; // size = 0x10
-
/* Cvg: Coverage */
#define FB_FILTER_TO_CVG_TYPE(filter) (filter)
@@ -50,7 +49,6 @@ void VisCvg_Destroy(VisCvg* this);
void VisCvg_Draw(VisCvg* this, Gfx** gfxP);
-
/* Mono: Desaturation */
// Only one type
@@ -66,7 +64,6 @@ void VisMono_Destroy(VisMono* this);
void VisMono_Draw(VisMono* this, Gfx** gfxP);
-
/* ZBuf: Z-Buffer */
#define FB_FILTER_TO_ZBUF_TYPE(filter) ((filter) - FB_FILTER_ZBUF_IA)
diff --git a/include/z_actor_dlftbls.h b/include/z_actor_dlftbls.h
new file mode 100644
index 0000000000..e9e2dc7d93
--- /dev/null
+++ b/include/z_actor_dlftbls.h
@@ -0,0 +1,74 @@
+#ifndef Z_ACTOR_DLFTBLS_H
+#define Z_ACTOR_DLFTBLS_H
+
+#include "romfile.h"
+#include "z64actor_profile.h"
+
+/**
+ * @see ACTOROVL_ALLOC_ABSOLUTE
+ */
+#if DEBUG_FEATURES
+#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0
+#else
+#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0
+#endif
+
+/**
+ * The actor overlay should be allocated memory for when loading,
+ * and the memory deallocated when there is no more actor using the overlay.
+ *
+ * `ACTOROVL_ALLOC_` defines indicate how an actor overlay should be loaded.
+ *
+ * @note Bitwise or-ing `ACTOROVL_ALLOC_` types is not meaningful.
+ * The `ACTOROVL_ALLOC_` types are 0, 1, 2 but checked against with a bitwise and.
+ *
+ * @see ACTOROVL_ALLOC_ABSOLUTE
+ * @see ACTOROVL_ALLOC_PERSISTENT
+ * @see actor_table.h
+ */
+#define ACTOROVL_ALLOC_NORMAL 0
+
+/**
+ * The actor overlay should be loaded to "absolute space".
+ *
+ * Absolute space is a fixed amount of memory allocated once.
+ * The overlay will still need to be loaded again if at some point there is no more actor using the overlay.
+ *
+ * @note Only one such overlay may be loaded at a time.
+ * This is not checked: a newly loaded overlay will overwrite the previous one in absolute space,
+ * even if actors are still relying on the previous one. Actors using absolute-allocated overlays should be deleted
+ * when another absolute-allocated overlay is about to be used.
+ *
+ * @see ACTOROVL_ABSOLUTE_SPACE_SIZE
+ * @see ActorContext.absoluteSpace
+ * @see ACTOROVL_ALLOC_NORMAL
+ */
+#define ACTOROVL_ALLOC_ABSOLUTE (1 << 0)
+
+/**
+ * The actor overlay should be loaded persistently.
+ * It will stay loaded until the current game state instance ends.
+ *
+ * @see ACTOROVL_ALLOC_NORMAL
+ */
+#define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
+
+typedef struct ActorOverlay {
+ /* 0x00 */ RomFile file;
+ /* 0x08 */ void* vramStart;
+ /* 0x0C */ void* vramEnd;
+ /* 0x10 */ void* loadedRamAddr; // original name: "allocp"
+ /* 0x14 */ ActorProfile* profile;
+ /* 0x18 */ char* name;
+ /* 0x1C */ u16 allocType; // See `ACTOROVL_ALLOC_` defines
+ /* 0x1E */ s8 numLoaded; // original name: "clients"
+} ActorOverlay; // size = 0x20
+
+extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0
+extern s32 gMaxActorId; // original name: "MaxProfile"
+
+void ActorOverlayTable_LogPrint(void);
+void ActorOverlayTable_Init(void);
+void ActorOverlayTable_Cleanup(void);
+
+#endif
diff --git a/include/z_en_a_obj.h b/include/z_en_a_obj.h
new file mode 100644
index 0000000000..bd65f88f13
--- /dev/null
+++ b/include/z_en_a_obj.h
@@ -0,0 +1,41 @@
+#ifndef Z_EN_A_OBJ_H
+#define Z_EN_A_OBJ_H
+
+#include "ultra64.h"
+#include "z64actor.h"
+
+// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
+typedef enum AObjType {
+ /* 0x00 */ A_OBJ_BLOCK_SMALL,
+ /* 0x01 */ A_OBJ_BLOCK_LARGE,
+ /* 0x02 */ A_OBJ_BLOCK_HUGE,
+ /* 0x03 */ A_OBJ_BLOCK_SMALL_ROT,
+ /* 0x04 */ A_OBJ_BLOCK_LARGE_ROT,
+ /* 0x05 */ A_OBJ_CUBE_SMALL,
+ /* 0x06 */ A_OBJ_UNKNOWN_6,
+ /* 0x07 */ A_OBJ_GRASS_CLUMP,
+ /* 0x08 */ A_OBJ_TREE_STUMP,
+ /* 0x09 */ A_OBJ_SIGNPOST_OBLONG,
+ /* 0x0A */ A_OBJ_SIGNPOST_ARROW,
+ /* 0x0B */ A_OBJ_BOULDER_FRAGMENT,
+ /* 0x0C */ A_OBJ_MAX
+} AObjType;
+
+struct EnAObj;
+
+typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*);
+
+typedef struct EnAObj {
+ /* 0x000 */ DynaPolyActor dyna;
+ /* 0x164 */ EnAObjActionFunc actionFunc;
+ /* 0x168 */ s32 rotateWaitTimer;
+ /* 0x16C */ s16 textId;
+ /* 0x16E */ s16 rotateState;
+ /* 0x170 */ s16 rotateForTimer;
+ /* 0x172 */ s16 rotSpeedY;
+ /* 0x174 */ s16 rotSpeedX;
+ /* 0x178 */ f32 focusYoffset;
+ /* 0x17C */ ColliderCylinder collider;
+} EnAObj; // size = 0x1C8
+
+#endif
diff --git a/include/z_game_dlftbls.h b/include/z_game_dlftbls.h
new file mode 100644
index 0000000000..b5b8c62c87
--- /dev/null
+++ b/include/z_game_dlftbls.h
@@ -0,0 +1,36 @@
+#ifndef Z_GAME_DLFTBLS_H
+#define Z_GAME_DLFTBLS_H
+
+#include "ultra64.h"
+#include "romfile.h"
+
+typedef struct GameStateOverlay {
+ /* 0x00 */ void* loadedRamAddr;
+ /* 0x04 */ RomFile file; // if applicable
+ /* 0x0C */ void* vramStart; // if applicable
+ /* 0x10 */ void* vramEnd; // if applicable
+ /* 0x14 */ void* unk_14;
+ /* 0x18 */ void* init; // initializes and executes the given context
+ /* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load
+ /* 0x20 */ void* unk_20;
+ /* 0x24 */ void* unk_24;
+ /* 0x28 */ s32 unk_28;
+ /* 0x2C */ u32 instanceSize;
+} GameStateOverlay; // size = 0x30
+
+// Used in Graph_GetNextGameState in graph.c
+#define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) enumName,
+#define DEFINE_GAMESTATE(typeName, enumName, name) DEFINE_GAMESTATE_INTERNAL(typeName, enumName)
+typedef enum GameStateId {
+#include "tables/gamestate_table.h"
+ GAMESTATE_ID_MAX
+} GameStateId;
+#undef DEFINE_GAMESTATE
+#undef DEFINE_GAMESTATE_INTERNAL
+
+extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX];
+
+void Overlay_LoadGameState(GameStateOverlay* overlayEntry);
+void Overlay_FreeGameState(GameStateOverlay* overlayEntry);
+
+#endif
diff --git a/include/z_lib.h b/include/z_lib.h
index 34581da982..1e9052f93b 100644
--- a/include/z_lib.h
+++ b/include/z_lib.h
@@ -2,7 +2,7 @@
#define Z_LIB_H
#include "libc/stddef.h"
-#include "padmgr.h"
+#include "libu64/pad.h"
#include "z64math.h"
#include "color.h"
diff --git a/include/z_locale.h b/include/z_locale.h
new file mode 100644
index 0000000000..7afcb33db4
--- /dev/null
+++ b/include/z_locale.h
@@ -0,0 +1,12 @@
+#ifndef Z_LOCALE_H
+#define Z_LOCALE_H
+
+#include "ultra64/ultratypes.h"
+#include "region.h"
+
+extern s32 gCurrentRegion;
+
+void Locale_Init(void);
+void Locale_ResetRegion(void);
+
+#endif
diff --git a/include/zelda_arena.h b/include/zelda_arena.h
index 1d035a0bbe..cf67406577 100644
--- a/include/zelda_arena.h
+++ b/include/zelda_arena.h
@@ -3,6 +3,8 @@
#include "ultra64.h"
+extern s32 gZeldaArenaLogSeverity;
+
void* ZeldaArena_Malloc(u32 size);
void* ZeldaArena_MallocR(u32 size);
void* ZeldaArena_Realloc(void* ptr, u32 newSize);
diff --git a/requirements.txt b/requirements.txt
index c9c4afed64..bea2fe176c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,6 +2,7 @@
crunch64>=0.5.1,<1.0.0
ipl3checksum>=1.2.0,<2.0.0
pyyaml>=6.0.1,<7.0.0
+pygfxd>=1.0.3,<2.0.0
# asm-differ
argcomplete
diff --git a/spec/code_libultra_ique.inc b/spec/code_libultra_ique.inc
index 4e53234778..e99152cf98 100644
--- a/spec/code_libultra_ique.inc
+++ b/spec/code_libultra_ique.inc
@@ -101,7 +101,9 @@
include "$(BUILD_DIR)/src/libultra/gu/rotate.o"
include "$(BUILD_DIR)/src/libultra/os/getcurrfaultedthread.o"
include "$(BUILD_DIR)/src/libultra/bb/sk/skapi.o"
+#ifndef COMPILER_GCC
include "$(BUILD_DIR)/src/libultra/bb/sa/common.o"
+#endif
include "$(BUILD_DIR)/src/libultra/io/motor.o"
include "$(BUILD_DIR)/src/libultra/os/afterprenmi.o"
include "$(BUILD_DIR)/src/libultra/audio/drvrnew.o"
diff --git a/spec/spec b/spec/spec
index 345f46f27d..60437c4bf9 100644
--- a/spec/spec
+++ b/spec/spec
@@ -676,31 +676,30 @@ beginseg
#if OOT_VERSION < NTSC_1_1 || !PLATFORM_N64
pad_text
#endif
- include "$(BUILD_DIR)/src/audio/lib/data.o"
- include "$(BUILD_DIR)/src/audio/lib/synthesis.o"
- include "$(BUILD_DIR)/src/audio/lib/heap.o"
- include "$(BUILD_DIR)/src/audio/lib/load.o"
- include "$(BUILD_DIR)/src/audio/lib/thread.o"
- include "$(BUILD_DIR)/src/audio/lib/dcache.o"
- include "$(BUILD_DIR)/src/audio/lib/aisetnextbuf.o"
+ include "$(BUILD_DIR)/src/audio/internal/data.o"
+ include "$(BUILD_DIR)/src/audio/internal/synthesis.o"
+ include "$(BUILD_DIR)/src/audio/internal/heap.o"
+ include "$(BUILD_DIR)/src/audio/internal/load.o"
+ include "$(BUILD_DIR)/src/audio/internal/thread.o"
+ include "$(BUILD_DIR)/src/audio/internal/os.o"
#if OOT_PAL_N64
pad_text
pad_text
pad_text
#endif
- include "$(BUILD_DIR)/src/audio/lib/playback.o"
- include "$(BUILD_DIR)/src/audio/lib/effects.o"
- include "$(BUILD_DIR)/src/audio/lib/seqplayer.o"
- include "$(BUILD_DIR)/src/audio/general.o"
+ include "$(BUILD_DIR)/src/audio/internal/playback.o"
+ include "$(BUILD_DIR)/src/audio/internal/effects.o"
+ include "$(BUILD_DIR)/src/audio/internal/seqplayer.o"
+ include "$(BUILD_DIR)/src/audio/game/general.o"
#if !PLATFORM_N64 && !DEBUG_FEATURES
pad_text
#endif
- include "$(BUILD_DIR)/src/audio/sfx_params.o"
- include "$(BUILD_DIR)/src/audio/sfx.o"
- include "$(BUILD_DIR)/src/audio/sequence.o"
- include "$(BUILD_DIR)/src/audio/data.o"
- include "$(BUILD_DIR)/src/audio/session_config.o"
- include "$(BUILD_DIR)/src/audio/session_init.o"
+ include "$(BUILD_DIR)/src/audio/game/sfx_params.o"
+ include "$(BUILD_DIR)/src/audio/game/sfx.o"
+ include "$(BUILD_DIR)/src/audio/game/sequence.o"
+ include "$(BUILD_DIR)/src/audio/game/data.o"
+ include "$(BUILD_DIR)/src/audio/game/session_config.o"
+ include "$(BUILD_DIR)/src/audio/game/session_init.o"
// libu64
#if PLATFORM_N64
@@ -708,7 +707,7 @@ beginseg
include "$(BUILD_DIR)/src/libu64/rcp_utils.o"
include "$(BUILD_DIR)/src/libu64/loadfragment2_n64.o"
include "$(BUILD_DIR)/src/libu64/pad.o"
- include "$(BUILD_DIR)/src/libu64/system_heap.o"
+ include "$(BUILD_DIR)/src/libu64/runtime.o"
include "$(BUILD_DIR)/src/libu64/padsetup.o"
#elif PLATFORM_GC
include "$(BUILD_DIR)/src/libu64/logseverity_gc.o"
@@ -720,11 +719,11 @@ beginseg
#endif
include "$(BUILD_DIR)/src/libu64/relocation_gc.o"
include "$(BUILD_DIR)/src/libu64/load_gc.o"
- include "$(BUILD_DIR)/src/libu64/system_heap.o"
+ include "$(BUILD_DIR)/src/libu64/runtime.o"
include "$(BUILD_DIR)/src/libu64/pad.o"
include "$(BUILD_DIR)/src/libu64/padsetup.o"
#elif PLATFORM_IQUE
- include "$(BUILD_DIR)/src/libu64/system_heap.o"
+ include "$(BUILD_DIR)/src/libu64/runtime.o"
include "$(BUILD_DIR)/src/libu64/debug.o"
include "$(BUILD_DIR)/src/libu64/gfxprint.o"
include "$(BUILD_DIR)/src/libu64/logseverity_gc.o"
@@ -786,14 +785,14 @@ beginseg
include "$(BUILD_DIR)/src/libc/memmove.o"
#elif PLATFORM_GC
include "$(BUILD_DIR)/src/libc/sqrt.o"
- include "$(BUILD_DIR)/src/libc/absf.o"
+ include "$(BUILD_DIR)/src/libc/fabsf.o"
include "$(BUILD_DIR)/src/libc/fmodf.o"
include "$(BUILD_DIR)/src/libc/memset.o"
include "$(BUILD_DIR)/src/libc/memmove.o"
#elif PLATFORM_IQUE
include "$(BUILD_DIR)/src/libc/fmodf.o"
include "$(BUILD_DIR)/src/libc/memmove.o"
- include "$(BUILD_DIR)/src/libc/absf.o"
+ include "$(BUILD_DIR)/src/libc/fabsf.o"
include "$(BUILD_DIR)/src/libc/sqrt.o"
#endif
diff --git a/src/audio/data.c b/src/audio/game/data.c
similarity index 89%
rename from src/audio/data.c
rename to src/audio/game/data.c
index 5f8bfa71f3..6c5528f347 100644
--- a/src/audio/data.c
+++ b/src/audio/game/data.c
@@ -1,5 +1,7 @@
+#include "array_count.h"
+#include "sfx.h"
#include "ultra64.h"
-#include "global.h"
+#include "z64audio.h"
// sSfxRequests ring buffer endpoints. read index <= write index, wrapping around mod 256.
u8 gSfxRequestWriteIndex = 0;
@@ -59,11 +61,11 @@ u8 gStartSeqDisabled = false;
u8 gAudioDebugPrintSeqCmd = true;
#endif
-u8 gSoundModeList[] = {
- SOUNDMODE_STEREO,
- SOUNDMODE_HEADSET,
- SOUNDMODE_SURROUND,
- SOUNDMODE_MONO,
+u8 gSoundOutputModes[] = {
+ SOUND_OUTPUT_STEREO,
+ SOUND_OUTPUT_HEADSET,
+ SOUND_OUTPUT_SURROUND,
+ SOUND_OUTPUT_MONO,
};
u8 gAudioSpecId = 0;
diff --git a/src/audio/debug.inc.c b/src/audio/game/debug.inc.c
similarity index 99%
rename from src/audio/debug.inc.c
rename to src/audio/game/debug.inc.c
index 29fbd50a3c..e6d2dd89ca 100644
--- a/src/audio/debug.inc.c
+++ b/src/audio/game/debug.inc.c
@@ -847,7 +847,7 @@ void AudioDebug_ProcessInput_SndCont(void) {
&gSfxDefaultReverb);
break;
case 4:
- func_800F6700(sAudioSndContWork[sAudioSndContSel]);
+ Audio_SetSoundOutputMode(sAudioSndContWork[sAudioSndContSel]);
break;
case 5:
SEQCMD_DISABLE_PLAY_SEQUENCES(sAudioSndContWork[sAudioSndContSel]);
diff --git a/src/audio/general.c b/src/audio/game/general.c
similarity index 98%
rename from src/audio/general.c
rename to src/audio/game/general.c
index 2a639275bb..f04f203a1f 100644
--- a/src/audio/general.c
+++ b/src/audio/game/general.c
@@ -1,6 +1,17 @@
+#include "libu64/gfxprint.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "audiothread_cmd.h"
+#include "controller.h"
+#include "padmgr.h"
+#include "printf.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
#include "ultra64.h"
-#include "global.h"
#include "versions.h"
+#include "z64audio.h"
+#include "z64ocarina.h"
#define ABS_ALT(x) ((x) < 0 ? -(x) : (x))
@@ -134,9 +145,9 @@ f32 D_801305F4 = 1.0f;
u8 sGanonsTowerLevelsVol[8] = { 127, 80, 75, 73, 70, 68, 65, 60 };
u8 sEnterGanonsTowerTimer = 0;
#if DEBUG_FEATURES
-s8 sSoundMode = SOUNDMODE_SURROUND;
+s8 sSoundOutputMode = SOUND_OUTPUT_SURROUND;
#else
-s8 sSoundMode = SOUNDMODE_STEREO;
+s8 sSoundOutputMode = SOUND_OUTPUT_STEREO;
#endif
s8 D_80130608 = 0;
s8 sAudioCutsceneFlag = 0;
@@ -2624,7 +2635,7 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex) {
case BANK_ENV:
case BANK_ENEMY:
case BANK_VOICE:
- if (sSoundMode == SOUNDMODE_SURROUND) {
+ if (sSoundOutputMode == SOUND_OUTPUT_SURROUND) {
combFilterGain = func_800F3990(*entry->posY, entry->sfxParams);
}
FALLTHROUGH;
@@ -2636,7 +2647,7 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex) {
pan = Audio_ComputeSfxPanSigned(*entry->posX, *entry->posZ, entry->token);
freqScale = Audio_ComputeSfxFreqScale(bankId, entryIdx) * *entry->freqScale;
- if (sSoundMode == SOUNDMODE_SURROUND) {
+ if (sSoundOutputMode == SOUND_OUTPUT_SURROUND) {
behindScreenZ = sBehindScreenZ[(entry->sfxParams & SFX_FLAG_10) >> SFX_FLAG_10_SHIFT];
if (!(entry->sfxParams & SFX_FLAG_11)) {
if (*entry->posZ < behindScreenZ) {
@@ -2668,7 +2679,7 @@ void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex) {
if ((baseFilter | sAudioExtraFilter) != 0) {
filter = (baseFilter | sAudioExtraFilter);
- } else if ((sSoundMode == SOUNDMODE_SURROUND) && !(entry->sfxParams & SFX_FLAG_13)) {
+ } else if ((sSoundOutputMode == SOUND_OUTPUT_SURROUND) && !(entry->sfxParams & SFX_FLAG_13)) {
filter = func_800F37B8(behindScreenZ, entry, pan);
}
break;
@@ -2875,7 +2886,7 @@ void func_800F4578(Vec3f* pos, u16 sfxId, f32 arg2) {
void func_800F45D0(f32 arg0) {
func_800F4414(&gSfxDefaultPos, NA_SE_IT_FISHING_REEL_SLOW - SFX_FLAG, arg0);
- func_800F436C(&gSfxDefaultPos, 0, (0.15f * arg0) + 1.4f);
+ func_800F436C(&gSfxDefaultPos, NA_SE_NONE, (0.15f * arg0) + 1.4f);
}
void Audio_PlaySfxRiver(Vec3f* pos, f32 freqScale) {
@@ -3766,32 +3777,40 @@ void Audio_SetCodeReverb(s8 reverb) {
}
}
-void func_800F6700(s8 audioSetting) {
- s8 soundModeIndex;
+/**
+ * Sets the Sound Output Mode.
+ *
+ * This function translates the game-side `SoundSetting` to an internal `SoundOutputMode` value.
+ * The order of each value between the two enums is slightly different.
+ *
+ * Original name: Na_SetSoundOutputMode
+ */
+void Audio_SetSoundOutputMode(s8 soundSetting) {
+ s8 soundOutputMode;
- switch (audioSetting) {
- case 0:
- soundModeIndex = SOUNDMODE_STEREO;
- sSoundMode = SOUNDMODE_STEREO;
+ switch (soundSetting) {
+ case SOUND_SETTING_STEREO:
+ soundOutputMode = SOUND_OUTPUT_STEREO;
+ sSoundOutputMode = SOUND_OUTPUT_STEREO;
break;
- case 1:
- soundModeIndex = SOUNDMODE_MONO;
- sSoundMode = SOUNDMODE_MONO;
+ case SOUND_SETTING_MONO:
+ soundOutputMode = SOUND_OUTPUT_MONO;
+ sSoundOutputMode = SOUND_OUTPUT_MONO;
break;
- case 2:
- soundModeIndex = SOUNDMODE_HEADSET;
- sSoundMode = SOUNDMODE_HEADSET;
+ case SOUND_SETTING_HEADSET:
+ soundOutputMode = SOUND_OUTPUT_HEADSET;
+ sSoundOutputMode = SOUND_OUTPUT_HEADSET;
break;
- case 3:
- soundModeIndex = SOUNDMODE_STEREO;
- sSoundMode = SOUNDMODE_SURROUND;
+ case SOUND_SETTING_SURROUND:
+ soundOutputMode = SOUND_OUTPUT_STEREO;
+ sSoundOutputMode = SOUND_OUTPUT_SURROUND;
break;
}
- SEQCMD_SET_SOUND_MODE(soundModeIndex);
+ SEQCMD_SET_SOUND_OUTPUT_MODE(soundOutputMode);
}
void Audio_SetBaseFilter(u8 filter) {
@@ -4039,7 +4058,7 @@ void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId) {
SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, channelIdx, ioPort, ioData);
}
- SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, NATURE_CHANNEL_UNK, CHANNEL_IO_PORT_7, sSoundMode);
+ SEQCMD_SET_CHANNEL_IO(SEQ_PLAYER_BGM_MAIN, NATURE_CHANNEL_UNK, CHANNEL_IO_PORT_7, sSoundOutputMode);
}
}
diff --git a/src/audio/sequence.c b/src/audio/game/sequence.c
similarity index 99%
rename from src/audio/sequence.c
rename to src/audio/game/sequence.c
index c1530377a2..a311e4e73d 100644
--- a/src/audio/sequence.c
+++ b/src/audio/game/sequence.c
@@ -17,9 +17,13 @@
* Nor are these commands to be confused with the internal audio commands used to transfer requests from
* the graph thread to the audio thread.
*/
+#include "array_count.h"
+#include "audiothread_cmd.h"
+#include "seqcmd.h"
+#include "sfx.h"
#include "ultra64.h"
-#include "global.h"
#include "ultra64/abi.h"
+#include "z64audio.h"
// Direct audio command (skips the queueing system)
#define SEQCMD_SET_SEQPLAYER_VOLUME_NOW(seqPlayerIndex, duration, volume) \
@@ -369,9 +373,9 @@ void Audio_ProcessSeqCmd(u32 cmd) {
subOp = (cmd & 0xF00) >> 8;
val = cmd & 0xFF;
switch (subOp) {
- case SEQCMD_SUB_OP_GLOBAL_SET_SOUND_MODE:
- // Set sound mode
- AUDIOCMD_GLOBAL_SET_SOUND_MODE(gSoundModeList[val]);
+ case SEQCMD_SUB_OP_GLOBAL_SET_SOUND_OUTPUT_MODE:
+ // Set sound output mode
+ AUDIOCMD_GLOBAL_SET_SOUND_OUTPUT_MODE(gSoundOutputModes[val]);
break;
case SEQCMD_SUB_OP_GLOBAL_DISABLE_NEW_SEQUENCES:
diff --git a/src/audio/session_config.c b/src/audio/game/session_config.c
similarity index 99%
rename from src/audio/session_config.c
rename to src/audio/game/session_config.c
index a531d6c27b..c21a79c725 100644
--- a/src/audio/session_config.c
+++ b/src/audio/game/session_config.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "z64audio.h"
AudioContext gAudioCtx;
AudioCustomUpdateFunction gAudioCustomUpdateFunction;
diff --git a/src/audio/session_init.c b/src/audio/game/session_init.c
similarity index 93%
rename from src/audio/session_init.c
rename to src/audio/game/session_init.c
index a6e67f40d4..3c3d9c4aeb 100644
--- a/src/audio/session_init.c
+++ b/src/audio/game/session_init.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "array_count.h"
+#include "buffers.h"
+#include "z64audio.h"
+
#include "assets/audio/sequence_sizes.h"
#include "assets/audio/soundfont_sizes.h"
diff --git a/src/audio/sfx.c b/src/audio/game/sfx.c
similarity index 99%
rename from src/audio/sfx.c
rename to src/audio/game/sfx.c
index 1c743e95ba..65309942a6 100644
--- a/src/audio/sfx.c
+++ b/src/audio/game/sfx.c
@@ -1,6 +1,10 @@
-#include "ultra64.h"
-#include "global.h"
+#include "array_count.h"
+#include "audiothread_cmd.h"
+#include "printf.h"
+#include "sfx.h"
#include "terminal.h"
+#include "ultra64.h"
+#include "z64audio.h"
typedef struct SfxRequest {
/* 0x00 */ u16 sfxId;
diff --git a/src/audio/sfx_params.c b/src/audio/game/sfx_params.c
similarity index 98%
rename from src/audio/sfx_params.c
rename to src/audio/game/sfx_params.c
index 7dc1bbd2c7..37b9971caa 100644
--- a/src/audio/sfx_params.c
+++ b/src/audio/game/sfx_params.c
@@ -1,5 +1,5 @@
#include "ultra64.h"
-#include "global.h"
+#include "sfx.h"
#include "versions.h"
#define DEFINE_SFX(_0, _1, importance, distParam, randParam, flags) \
diff --git a/src/audio/lib/data.c b/src/audio/internal/data.c
similarity index 99%
rename from src/audio/lib/data.c
rename to src/audio/internal/data.c
index 8dc4729ff9..f2f1b2c94e 100644
--- a/src/audio/lib/data.c
+++ b/src/audio/internal/data.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "alignment.h"
+#include "ultra64.h"
+#include "z64audio.h"
// clang-format off
ALIGNED(16) s16 gSawtoothWaveSample[] = {
diff --git a/src/audio/lib/effects.c b/src/audio/internal/effects.c
similarity index 99%
rename from src/audio/lib/effects.c
rename to src/audio/internal/effects.c
index bbfcaf61ad..7e3d01d3a7 100644
--- a/src/audio/lib/effects.c
+++ b/src/audio/internal/effects.c
@@ -1,5 +1,6 @@
#include "ultra64.h"
-#include "global.h"
+#include "attributes.h"
+#include "z64audio.h"
void Audio_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend) {
f32 channelVolume;
diff --git a/src/audio/lib/heap.c b/src/audio/internal/heap.c
similarity index 99%
rename from src/audio/lib/heap.c
rename to src/audio/internal/heap.c
index d996b553ab..e78787027b 100644
--- a/src/audio/lib/heap.c
+++ b/src/audio/internal/heap.c
@@ -1,6 +1,7 @@
+#include "alignment.h"
#include "ultra64.h"
-#include "global.h"
#include "versions.h"
+#include "z64audio.h"
void AudioHeap_InitSampleCaches(u32 persistentSampleCacheSize, u32 temporarySampleCacheSize);
SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(u32 size);
diff --git a/src/audio/lib/load.c b/src/audio/internal/load.c
similarity index 95%
rename from src/audio/lib/load.c
rename to src/audio/internal/load.c
index 0aa3324d73..f723e5b836 100644
--- a/src/audio/lib/load.c
+++ b/src/audio/internal/load.c
@@ -1,6 +1,14 @@
+/**
+ * Original Filename: system.c
+ */
+
+#include "array_count.h"
+#include "attributes.h"
+#include "buffers.h"
+#include "segment_symbols.h"
#include "ultra64.h"
-#include "global.h"
#include "versions.h"
+#include "z64audio.h"
#define MK_ASYNC_MSG(retData, tableType, id, loadStatus) \
(((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (loadStatus))
@@ -73,6 +81,9 @@ void* sUnusedHandler = NULL;
s32 gAudioContextInitialized = false;
+/**
+ * original name: Nas_WaveDmaFrameWork
+ */
void AudioLoad_DecreaseSampleDmaTtls(void) {
u32 i;
@@ -105,6 +116,9 @@ void AudioLoad_DecreaseSampleDmaTtls(void) {
gAudioCtx.unused2628 = 0;
}
+/**
+ * original name:Nas_WaveDmaCallBack
+ */
void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium) {
s32 pad1;
SampleDma* dma;
@@ -199,6 +213,9 @@ void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef,
return (devAddr - dmaDevAddr) + dma->ramAddr;
}
+/**
+ * original name: Nas_WaveDmaNew
+ */
void AudioLoad_InitSampleDmaBuffers(s32 numNotes) {
SampleDma* dma;
s32 i;
@@ -268,6 +285,9 @@ void AudioLoad_InitSampleDmaBuffers(s32 numNotes) {
gAudioCtx.sampleDmaReuseQueue2WrPos = gAudioCtx.sampleDmaCount - gAudioCtx.sampleDmaListSize1;
}
+/**
+ * original name: Nas_CheckIDbank
+ */
s32 AudioLoad_IsFontLoadComplete(s32 fontId) {
if (fontId == 0xFF) {
return true;
@@ -280,6 +300,9 @@ s32 AudioLoad_IsFontLoadComplete(s32 fontId) {
}
}
+/**
+ * original name: Nas_CheckIDseq
+ */
s32 AudioLoad_IsSeqLoadComplete(s32 seqId) {
if (seqId == 0xFF) {
return true;
@@ -292,6 +315,9 @@ s32 AudioLoad_IsSeqLoadComplete(s32 seqId) {
}
}
+/**
+ * original name: Nas_CheckIDwave
+ */
s32 AudioLoad_IsSampleLoadComplete(s32 sampleBankId) {
if (sampleBankId == 0xFF) {
return true;
@@ -305,18 +331,27 @@ s32 AudioLoad_IsSampleLoadComplete(s32 sampleBankId) {
}
}
+/**
+ * original name: Nas_WriteIDbank
+ */
void AudioLoad_SetFontLoadStatus(s32 fontId, s32 loadStatus) {
if ((fontId != 0xFF) && (gAudioCtx.fontLoadStatus[fontId] != LOAD_STATUS_PERMANENTLY_LOADED)) {
gAudioCtx.fontLoadStatus[fontId] = loadStatus;
}
}
+/**
+ * original name: Nas_WriteIDseq
+ */
void AudioLoad_SetSeqLoadStatus(s32 seqId, s32 loadStatus) {
if ((seqId != 0xFF) && (gAudioCtx.seqLoadStatus[seqId] != LOAD_STATUS_PERMANENTLY_LOADED)) {
gAudioCtx.seqLoadStatus[seqId] = loadStatus;
}
}
+/**
+ * original name: Nas_WriteIDwave
+ */
void AudioLoad_SetSampleFontLoadStatusAndApplyCaches(s32 sampleBankId, s32 loadStatus) {
if (sampleBankId != 0xFF) {
if (gAudioCtx.sampleFontLoadStatus[sampleBankId] != LOAD_STATUS_PERMANENTLY_LOADED) {
@@ -330,12 +365,18 @@ void AudioLoad_SetSampleFontLoadStatusAndApplyCaches(s32 sampleBankId, s32 loadS
}
}
+/**
+ * original name: Nas_WriteIDwaveOnly
+ */
void AudioLoad_SetSampleFontLoadStatus(s32 sampleBankId, s32 loadStatus) {
if ((sampleBankId != 0xFF) && (gAudioCtx.sampleFontLoadStatus[sampleBankId] != LOAD_STATUS_PERMANENTLY_LOADED)) {
gAudioCtx.sampleFontLoadStatus[sampleBankId] = loadStatus;
}
}
+/**
+ * original name: Nas_BankHeaderInit
+ */
void AudioLoad_InitTable(AudioTable* table, u32 romAddr, u16 unkMediumParam) {
s32 i;
@@ -349,6 +390,9 @@ void AudioLoad_InitTable(AudioTable* table, u32 romAddr, u16 unkMediumParam) {
}
}
+/**
+ * original name: Nas_PreLoadBank
+ */
SoundFontData* AudioLoad_SyncLoadSeqFonts(s32 seqId, u32* outDefaultFontId) {
s32 pad[2];
s32 index;
@@ -375,6 +419,9 @@ SoundFontData* AudioLoad_SyncLoadSeqFonts(s32 seqId, u32* outDefaultFontId) {
return fontData;
}
+/**
+ * original name: Nas_PreLoadSeq
+ */
void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1) {
s32 pad;
u32 defaultFontId;
@@ -389,6 +436,9 @@ void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1) {
}
}
+/**
+ * original name: __Nas_LoadVoice_Inner
+ */
s32 AudioLoad_SyncLoadSample(Sample* sample, s32 fontId) {
void* sampleAddr;
@@ -413,6 +463,9 @@ s32 AudioLoad_SyncLoadSample(Sample* sample, s32 fontId) {
//! @bug Missing return, but the return value is never used so it's fine.
}
+/**
+ * original name: Nas_LoadVoice
+ */
s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId) {
if (instId < 0x7F) {
Instrument* instrument = Audio_GetInstrumentInner(fontId, instId);
@@ -439,24 +492,39 @@ s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId) {
}
}
+/**
+ * original name: Nas_PreLoad_BG
+ */
void AudioLoad_AsyncLoad(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesgQueue* retQueue) {
if (AudioLoad_AsyncLoadInner(tableType, id, nChunks, retData, retQueue) == NULL) {
osSendMesg(retQueue, (OSMesg)0xFFFFFFFF, OS_MESG_NOBLOCK);
}
}
+/**
+ * original name: Nas_PreLoadSeq_BG
+ */
void AudioLoad_AsyncLoadSeq(s32 seqId, s32 arg1, s32 retData, OSMesgQueue* retQueue) {
AudioLoad_AsyncLoad(SEQUENCE_TABLE, seqId, 0, retData, retQueue);
}
+/**
+ * original name: Nas_PreLoadWave_BG
+ */
void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 arg1, s32 retData, OSMesgQueue* retQueue) {
AudioLoad_AsyncLoad(SAMPLE_TABLE, sampleBankId, 0, retData, retQueue);
}
+/**
+ * original name: Nas_PreLoadBank_BG
+ */
void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* retQueue) {
AudioLoad_AsyncLoad(FONT_TABLE, fontId, 0, retData, retQueue);
}
+/**
+ * original name: Nas_SeqToBank
+ */
u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts) {
s32 index = ((u16*)gAudioCtx.sequenceFontTable)[seqId];
@@ -467,6 +535,9 @@ u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts) {
return &gAudioCtx.sequenceFontTable[index];
}
+/**
+ * original name: Nas_FlushBank
+ */
void AudioLoad_DiscardSeqFonts(s32 seqId) {
s32 fontId;
s32 index = ((u16*)gAudioCtx.sequenceFontTable)[seqId];
@@ -482,6 +553,9 @@ void AudioLoad_DiscardSeqFonts(s32 seqId) {
}
}
+/**
+ * original name: __Kill_Bank
+ */
void AudioLoad_DiscardFont(s32 fontId) {
u32 i;
AudioCache* pool = &gAudioCtx.fontCache;
@@ -503,6 +577,9 @@ void AudioLoad_DiscardFont(s32 fontId) {
AudioHeap_DiscardFont(fontId);
}
+/**
+ * original name: Nas_StartMySeq
+ */
s32 AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2) {
if (gAudioCtx.resetTimer != 0) {
return 0;
@@ -516,6 +593,9 @@ s32 AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2) {
//! The callers of this function do not use the return value, so it's fine.
}
+/**
+ * original name: Nas_StartSeq_Skip
+ */
s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIdx, s32 seqId, s32 skipTicks) {
if (gAudioCtx.resetTimer != 0) {
return 0;
@@ -526,6 +606,9 @@ s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIdx, s32 seqId, s32 skipTicks
//! @bug Missing return, see comment in AudioLoad_SyncInitSeqPlayer above.
}
+/**
+ * original name: __Nas_StartSeq
+ */
s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[playerIdx];
u8* seqData;
@@ -568,6 +651,9 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
//! @bug missing return (but the return value is not used so it's not UB)
}
+/**
+ * original name: __Load_Seq
+ */
u8* AudioLoad_SyncLoadSeq(s32 seqId) {
s32 pad;
s32 didAllocate;
@@ -579,10 +665,16 @@ u8* AudioLoad_SyncLoadSeq(s32 seqId) {
return AudioLoad_SyncLoad(SEQUENCE_TABLE, seqId, &didAllocate);
}
+/**
+ * original name: __Load_Wave_Check
+ */
u32 AudioLoad_GetSampleBank(u32 sampleBankId, u32* outMedium) {
return AudioLoad_TrySyncLoadSampleBank(sampleBankId, outMedium, true);
}
+/**
+ * original name: __Load_Wave
+ */
u32 AudioLoad_TrySyncLoadSampleBank(u32 sampleBankId, u32* outMedium, s32 noLoad) {
void* ramAddr;
AudioTable* sampleBankTable;
@@ -615,6 +707,9 @@ u32 AudioLoad_TrySyncLoadSampleBank(u32 sampleBankId, u32* outMedium, s32 noLoad
return sampleBankTable->entries[realTableId].romAddr;
}
+/**
+ * original name: __Load_Ctrl
+ */
SoundFontData* AudioLoad_SyncLoadFont(u32 fontId) {
SoundFontData* fontData;
s32 sampleBankId1;
@@ -654,6 +749,9 @@ SoundFontData* AudioLoad_SyncLoadFont(u32 fontId) {
return fontData;
}
+/**
+ * original name: __Load_Bank
+ */
void* AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) {
u32 size;
AudioTable* table;
@@ -738,6 +836,9 @@ void* AudioLoad_SyncLoad(u32 tableType, u32 id, s32* didAllocate) {
return ramAddr;
}
+/**
+ * original name: __Link_BankNum
+ */
u32 AudioLoad_GetRealTableIndex(s32 tableType, u32 id) {
AudioTable* table = AudioLoad_GetLoadTable(tableType);
@@ -748,6 +849,9 @@ u32 AudioLoad_GetRealTableIndex(s32 tableType, u32 id) {
return id;
}
+/**
+ * original name: __Check_Cache
+ */
void* AudioLoad_SearchCaches(s32 tableType, s32 id) {
void* ramAddr;
@@ -764,6 +868,10 @@ void* AudioLoad_SearchCaches(s32 tableType, s32 id) {
return NULL;
}
+/**
+ * Animal Crossing's equivalent to this function is __Get_ArcHeader.
+ * This name must be new, because ARC files are GameCube speicifc.
+ */
AudioTable* AudioLoad_GetLoadTable(s32 tableType) {
AudioTable* table;
@@ -789,7 +897,9 @@ AudioTable* AudioLoad_GetLoadTable(s32 tableType) {
/**
* Read and extract information from soundFont binary loaded into ram.
- * Also relocate offsets into pointers within this loaded soundFont
+ * Also relocate offsets into pointers within this loaded soundFont.
+ *
+ * original name: Nas_BankOfsToAddr_Inner
*
* @param fontId index of font being processed
* @param fontDataStartAddr ram address of raw soundfont binary loaded into cache
@@ -919,6 +1029,9 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
gAudioCtx.soundFontList[fontId].instruments = (Instrument**)(fontData + 2);
}
+/**
+ * original name: Nas_FastCopy
+ */
void AudioLoad_SyncDma(u32 devAddr, u8* ramAddr, u32 size, s32 medium) {
OSMesgQueue* msgQueue = &gAudioCtx.syncDmaQueue;
OSIoMesg* ioMesg = &gAudioCtx.syncDmaIoMesg;
@@ -943,9 +1056,15 @@ void AudioLoad_SyncDma(u32 devAddr, u8* ramAddr, u32 size, s32 medium) {
}
}
+/**
+ * original name: Nas_FastDiskCopy
+ */
void AudioLoad_SyncDmaUnkMedium(u32 devAddr, u8* addr, u32 size, s32 unkMediumParam) {
}
+/**
+ * original name: Nas_StartDma
+ */
s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, u32 devAddr, void* ramAddr, u32 size,
OSMesgQueue* reqQueue, s32 medium, const char* dmaFuncType) {
OSPiHandle* handle;
@@ -983,15 +1102,24 @@ s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, u32 devAddr, void
return 0;
}
+/**
+ * original name: __OfsToLbaOfs
+ */
void AudioLoad_Unused1(void) {
}
+/**
+ * original name: EmemLoad
+ */
void AudioLoad_SyncLoadSimple(u32 tableType, u32 fontId) {
s32 didAllocate;
AudioLoad_SyncLoad(tableType, fontId, &didAllocate);
}
+/**
+ * original name: __Load_Bank_BG
+ */
void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesgQueue* retQueue) {
u32 size;
AudioTable* table;
@@ -1098,20 +1226,32 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData,
return ramAddr;
}
+/**
+ * original name: Nas_BgDmaFrameWork
+ */
void AudioLoad_ProcessLoads(s32 resetStatus) {
AudioLoad_ProcessSlowLoads(resetStatus);
AudioLoad_ProcessSamplePreloads(resetStatus);
AudioLoad_ProcessAsyncLoads(resetStatus);
}
+/**
+ * original name: Nas_SetRomHandler
+ */
void AudioLoad_SetDmaHandler(DmaHandler callback) {
sDmaHandler = callback;
}
+/**
+ * original name: Nas_SetRomHandler
+ */
void AudioLoad_SetUnusedHandler(void* callback) {
sUnusedHandler = callback;
}
+/**
+ * original name: __SetVlute
+ */
void AudioLoad_InitSoundFont(s32 fontId) {
SoundFont* font = &gAudioCtx.soundFontList[fontId];
AudioTableEntry* entry = &gAudioCtx.soundFontTable->entries[fontId];
@@ -1123,6 +1263,9 @@ void AudioLoad_InitSoundFont(s32 fontId) {
font->numSfx = entry->shortData3;
}
+/**
+ * original name: Nas_InitAudio
+ */
void AudioLoad_Init(void* heap, u32 heapSize) {
s32 pad[18];
s32 numFonts;
@@ -1189,7 +1332,7 @@ void AudioLoad_Init(void* heap, u32 heapSize) {
gAudioCtx.totalTaskCount = 0;
gAudioCtx.rspTaskIndex = 0;
gAudioCtx.curAiBufIndex = 0;
- gAudioCtx.soundMode = SOUNDMODE_STEREO;
+ gAudioCtx.soundOutputMode = SOUND_OUTPUT_STEREO;
gAudioCtx.curTask = NULL;
gAudioCtx.rspTask[0].task.t.data_size = 0;
gAudioCtx.rspTask[1].task.t.data_size = 0;
@@ -1225,7 +1368,7 @@ void AudioLoad_Init(void* heap, u32 heapSize) {
}
// Set audio tables pointers
- gAudioCtx.sequenceTable = (AudioTable*)gSequenceTable;
+ gAudioCtx.sequenceTable = &gSequenceTable;
gAudioCtx.soundFontTable = &gSoundFontTable;
gAudioCtx.sampleBankTable = &gSampleBankTable;
gAudioCtx.sequenceFontTable = gSequenceFontTable;
@@ -1258,11 +1401,17 @@ void AudioLoad_Init(void* heap, u32 heapSize) {
osSendMesg(gAudioCtx.taskStartQueueP, (OSMesg)gAudioCtx.totalTaskCount, OS_MESG_NOBLOCK);
}
+/**
+ * original name: LpsInit
+ */
void AudioLoad_InitSlowLoads(void) {
gAudioCtx.slowLoads[0].state = SLOW_LOAD_STATE_WAITING;
gAudioCtx.slowLoads[1].state = SLOW_LOAD_STATE_WAITING;
}
+/**
+ * original name: VoiceLoad
+ */
s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status) {
Sample* sample;
AudioSlowLoad* slowLoad;
@@ -1313,6 +1462,9 @@ s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status) {
return 0;
}
+/**
+ * original name: __GetWaveTable
+ */
Sample* AudioLoad_GetFontSample(s32 fontId, s32 instId) {
Sample* sample;
@@ -1344,6 +1496,9 @@ Sample* AudioLoad_GetFontSample(s32 fontId, s32 instId) {
void AudioLoad_Unused2(void) {
}
+/**
+ * original name: __SwapLoadLps
+ */
void AudioLoad_FinishSlowLoad(AudioSlowLoad* slowLoad) {
Sample* sample;
@@ -1361,6 +1516,9 @@ void AudioLoad_FinishSlowLoad(AudioSlowLoad* slowLoad) {
sample->medium = MEDIUM_RAM;
}
+/**
+ * original name: LpsDma
+ */
void AudioLoad_ProcessSlowLoads(s32 resetStatus) {
AudioSlowLoad* slowLoad;
s32 i;
@@ -1410,6 +1568,9 @@ void AudioLoad_ProcessSlowLoads(s32 resetStatus) {
}
}
+/**
+ * original name: __Nas_SlowCopy
+ */
void AudioLoad_DmaSlowCopy(AudioSlowLoad* slowLoad, s32 size) {
Audio_InvalDCache(slowLoad->curRamAddr, size);
osCreateMesgQueue(&slowLoad->msgQueue, &slowLoad->msg, 1);
@@ -1417,9 +1578,15 @@ void AudioLoad_DmaSlowCopy(AudioSlowLoad* slowLoad, s32 size) {
&slowLoad->msgQueue, slowLoad->medium, "SLOWCOPY");
}
+/**
+ * original name: __Nas_SlowDiskCopy
+ */
void AudioLoad_DmaSlowCopyUnkMedium(s32 devAddr, u8* ramAddr, s32 size, s32 arg3) {
}
+/**
+ * original name: SeqLoad
+ */
s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status) {
AudioSlowLoad* slowLoad;
AudioTable* seqTable;
@@ -1457,6 +1624,9 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status) {
return 0;
}
+/**
+ * original name: Nas_BgCopyInit
+ */
void AudioLoad_InitAsyncLoads(void) {
s32 i;
@@ -1465,6 +1635,9 @@ void AudioLoad_InitAsyncLoads(void) {
}
}
+/**
+ * original name: Nas_BgCopyDisk
+ */
AudioAsyncLoad* AudioLoad_StartAsyncLoadUnkMedium(s32 unkMediumParam, u32 devAddr, void* ramAddr, s32 size, s32 medium,
s32 nChunks, OSMesgQueue* retQueue, s32 retMsg) {
AudioAsyncLoad* asyncLoad;
@@ -1480,6 +1653,9 @@ AudioAsyncLoad* AudioLoad_StartAsyncLoadUnkMedium(s32 unkMediumParam, u32 devAdd
return asyncLoad;
}
+/**
+ * original name: Nas_BgCopyReq
+ */
AudioAsyncLoad* AudioLoad_StartAsyncLoad(u32 devAddr, void* ramAddr, u32 size, s32 medium, s32 nChunks,
OSMesgQueue* retQueue, s32 retMsg) {
AudioAsyncLoad* asyncLoad;
@@ -1522,6 +1698,9 @@ AudioAsyncLoad* AudioLoad_StartAsyncLoad(u32 devAddr, void* ramAddr, u32 size, s
return asyncLoad;
}
+/**
+ * original name: Nas_BgCopyMain
+ */
void AudioLoad_ProcessAsyncLoads(s32 resetStatus) {
AudioAsyncLoad* asyncLoad;
s32 i;
@@ -1556,9 +1735,15 @@ void AudioLoad_ProcessAsyncLoads(s32 resetStatus) {
}
}
+/**
+ * original name: __BgCopyDisk
+ */
void AudioLoad_ProcessAsyncLoadUnkMedium(AudioAsyncLoad* asyncLoad, s32 resetStatus) {
}
+/**
+ * original name: __BgCopyFinishProcess
+ */
void AudioLoad_FinishAsyncLoad(AudioAsyncLoad* asyncLoad) {
u32 retMsg = asyncLoad->retMsg;
u32 fontId;
@@ -1599,6 +1784,9 @@ void AudioLoad_FinishAsyncLoad(AudioAsyncLoad* asyncLoad) {
osSendMesg(asyncLoad->retQueue, doneMsg, OS_MESG_NOBLOCK);
}
+/**
+ * original name: __BgCopySub
+ */
void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) {
AudioTable* sampleBankTable = gAudioCtx.sampleBankTable;
@@ -1647,6 +1835,9 @@ void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) {
asyncLoad->curRamAddr += asyncLoad->chunkSize;
}
+/**
+ * original name: __Nas_BgCopy
+ */
void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, u32 size) {
size = ALIGN16(size);
Audio_InvalDCache(asyncLoad->curRamAddr, size);
@@ -1655,6 +1846,9 @@ void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, u32 size) {
&asyncLoad->msgQueue, asyncLoad->medium, "BGCOPY");
}
+/**
+ * original name: __Nas_BgDiskCopy
+ */
void AudioLoad_AsyncDmaUnkMedium(u32 devAddr, void* ramAddr, u32 size, s16 arg3) {
}
@@ -1664,6 +1858,8 @@ void AudioLoad_AsyncDmaUnkMedium(u32 devAddr, void* ramAddr, u32 size, s16 arg3)
* TunedSample contains metadata on a sample used by a particular instrument/drum/sfx
* Also relocate offsets into pointers within this loaded TunedSample
*
+ * original name: __WaveTouch
+ *
* @param fontId index of font being processed
* @param fontData ram address of raw soundfont binary loaded into cache
* @param sampleBankReloc information on the sampleBank containing raw audio samples
@@ -1720,6 +1916,8 @@ void AudioLoad_RelocateSample(TunedSample* tunedSample, SoundFontData* fontData,
}
/**
+ * original name: Nas_BankOfsToAddr
+ *
* @param fontId index of font being processed
* @param fontData ram address of raw soundfont binary loaded into cache
* @param sampleBankReloc information on the sampleBank containing raw audio samples
@@ -1827,6 +2025,9 @@ void AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, SoundFontData* fontData
}
}
+/**
+ * original name: Nas_CheckBgWave
+ */
s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) {
Sample* sample;
AudioPreloadReq* preload;
@@ -1889,6 +2090,9 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) {
return true;
}
+/**
+ * original name: __AddList
+ */
s32 AudioLoad_AddToSampleSet(Sample* sample, s32 numSamples, Sample** sampleSet) {
s32 i;
@@ -1906,6 +2110,9 @@ s32 AudioLoad_AddToSampleSet(Sample* sample, s32 numSamples, Sample** sampleSet)
return numSamples;
}
+/**
+ * original name: MakeWaveList
+ */
s32 AudioLoad_GetSamplesForFont(s32 fontId, Sample** sampleSet) {
s32 i;
s32 numSamples = 0;
@@ -1939,6 +2146,9 @@ s32 AudioLoad_GetSamplesForFont(s32 fontId, Sample** sampleSet) {
return numSamples;
}
+/**
+ * original name: __Reload
+ */
void AudioLoad_AddUsedSample(TunedSample* tunedSample) {
Sample* sample = tunedSample->sample;
@@ -1947,6 +2157,9 @@ void AudioLoad_AddUsedSample(TunedSample* tunedSample) {
}
}
+/**
+ * original name: WaveReload
+ */
void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* sampleBankReloc) {
s32 numDrums;
s32 numInstruments;
@@ -2082,6 +2295,9 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo*
}
}
+/**
+ * original name: EmemReload
+ */
void AudioLoad_LoadPermanentSamples(void) {
s32 pad;
u32 fontId;
@@ -2114,15 +2330,27 @@ void AudioLoad_LoadPermanentSamples(void) {
}
}
+/**
+ * original name: __ExtDiskFinishCheck
+ */
void AudioLoad_Unused3(void) {
}
+/**
+ * original name: __ExtDiskInit
+ */
void AudioLoad_Unused4(void) {
}
+/**
+ * original name: __ExtDiskLoad
+ */
void AudioLoad_Unused5(void) {
}
+/**
+ * original name: MK_load
+ */
void AudioLoad_ScriptLoad(s32 tableType, s32 id, s8* status) {
static u32 sLoadIndex = 0;
@@ -2134,6 +2362,9 @@ void AudioLoad_ScriptLoad(s32 tableType, s32 id, s8* status) {
}
}
+/**
+ * original name: MK_FrameWork
+ */
void AudioLoad_ProcessScriptLoads(void) {
u32 temp;
u32 sp20;
@@ -2148,6 +2379,9 @@ void AudioLoad_ProcessScriptLoads(void) {
}
}
+/**
+ * original name: MK_Init
+ */
void AudioLoad_InitScriptLoads(void) {
osCreateMesgQueue(&sScriptLoadQueue, sScriptLoadMsgBuf, ARRAY_COUNT(sScriptLoadMsgBuf));
}
diff --git a/src/audio/lib/aisetnextbuf.c b/src/audio/internal/os.c
similarity index 83%
rename from src/audio/lib/aisetnextbuf.c
rename to src/audio/internal/os.c
index 4cf5d1f7d9..4bbb0d2fdb 100644
--- a/src/audio/lib/aisetnextbuf.c
+++ b/src/audio/internal/os.c
@@ -1,4 +1,23 @@
-#include "global.h"
+/**
+ * Original Filename: os.c
+ */
+
+#include "ultra64.h"
+#include "z64audio.h"
+
+void Audio_InvalDCache(void* buf, s32 size) {
+ OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
+
+ osInvalDCache(buf, size);
+ osSetIntMask(prevMask);
+}
+
+void Audio_WritebackDCache(void* buf, s32 size) {
+ OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
+
+ osWritebackDCache(buf, size);
+ osSetIntMask(prevMask);
+}
/**
* Submits an audio buffer to be consumed by the Audio DAC. The audio interface can queue a second DMA while another
diff --git a/src/audio/lib/playback.c b/src/audio/internal/playback.c
similarity index 99%
rename from src/audio/lib/playback.c
rename to src/audio/internal/playback.c
index 9c1b8126e4..327e271d06 100644
--- a/src/audio/lib/playback.c
+++ b/src/audio/internal/playback.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "ultra64.h"
+#include "z64audio.h"
void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
f32 volLeft;
@@ -31,7 +32,7 @@ void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
sub->bitField0.stereoStrongLeft = false;
sub->bitField0.stereoHeadsetEffects = stereoData.stereoHeadsetEffects;
sub->bitField0.usesHeadsetPanEffects = stereoData.usesHeadsetPanEffects;
- if (stereoHeadsetEffects && (gAudioCtx.soundMode == SOUNDMODE_HEADSET)) {
+ if (stereoHeadsetEffects && (gAudioCtx.soundOutputMode == SOUND_OUTPUT_HEADSET)) {
halfPanIndex = pan >> 1;
if (halfPanIndex > 0x3F) {
halfPanIndex = 0x3F;
@@ -43,7 +44,7 @@ void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
volLeft = gHeadsetPanVolume[pan];
volRight = gHeadsetPanVolume[0x7F - pan];
- } else if (stereoHeadsetEffects && (gAudioCtx.soundMode == SOUNDMODE_STEREO)) {
+ } else if (stereoHeadsetEffects && (gAudioCtx.soundOutputMode == SOUND_OUTPUT_STEREO)) {
strongLeft = strongRight = 0;
sub->haasEffectLeftDelaySize = 0;
sub->haasEffectRightDelaySize = 0;
@@ -80,7 +81,7 @@ void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
break;
}
- } else if (gAudioCtx.soundMode == SOUNDMODE_MONO) {
+ } else if (gAudioCtx.soundOutputMode == SOUND_OUTPUT_MONO) {
sub->bitField0.stereoHeadsetEffects = false;
sub->bitField0.usesHeadsetPanEffects = false;
volLeft = 0.707f; // approx 1/sqrt(2)
diff --git a/src/audio/lib/seqplayer.c b/src/audio/internal/seqplayer.c
similarity index 83%
rename from src/audio/lib/seqplayer.c
rename to src/audio/internal/seqplayer.c
index a7091b24b3..1d6fb7c0a6 100644
--- a/src/audio/lib/seqplayer.c
+++ b/src/audio/internal/seqplayer.c
@@ -1,5 +1,6 @@
/**
* @file audio_seqplayer.c
+ * original name: track.c
*
* Manages audio sequence players, interprets and executes sequence instructions used to write .seq files
*
@@ -13,8 +14,14 @@
* - All three sets share a common pool of control flow instructions (>= 0xF2).
* Otherwise, each set of instructions has its own command interpreter
*/
+#include "audio/aseq.h"
+#include "array_count.h"
+#include "assert.h"
+#include "attributes.h"
#include "ultra64.h"
-#include "global.h"
+#include "z64audio.h"
+
+static_assert(MML_VERSION == MML_VERSION_OOT, "This file implements the OoT version of the MML");
#define PORTAMENTO_IS_SPECIAL(x) ((x).mode & 0x80)
#define PORTAMENTO_MODE(x) ((x).mode & ~0x80)
@@ -70,93 +77,95 @@ u8 AudioSeq_GetInstrument(SequenceChannel* channel, u8 instId, Instrument** inst
(((sizeof(arg0Type) - 1) << 7) | ((sizeof(arg1Type) - 1) << 6) | ((sizeof(arg2Type) - 1) << 5) | 3)
u8 sSeqInstructionArgsTable[] = {
- CMD_ARGS_1(s16), // 0xB0
- CMD_ARGS_0(), // 0xB1
- CMD_ARGS_1(s16), // 0xB2
- CMD_ARGS_1(u8), // 0xB3
- CMD_ARGS_0(), // 0xB4
- CMD_ARGS_0(), // 0xB5
- CMD_ARGS_0(), // 0xB6
- CMD_ARGS_1(s16), // 0xB7
- CMD_ARGS_1(u8), // 0xB8
- CMD_ARGS_1(u8), // 0xB9
- CMD_ARGS_1(u8), // 0xBA
- CMD_ARGS_2(u8, s16), // 0xBB
- CMD_ARGS_1(s16), // 0xBC
- CMD_ARGS_2(s16, s16), // 0xBD
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_LDFILTER
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_FREEFILTER
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_LDSEQTOPTR
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_FILTER
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_PTRTODYNTBL
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_DYNTBLTOPTR
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_DYNTBLV
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_RANDTOPTR
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_RAND
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_RANDVEL
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_RANDGATE
+ CMD_ARGS_2(u8, s16), // ASEQ_OP_CHAN_COMBFILTER
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_PTRADD
+ CMD_ARGS_2(s16, s16), // ASEQ_OP_CHAN_RANDPTR
CMD_ARGS_0(), // 0xBE
CMD_ARGS_0(), // 0xBF
CMD_ARGS_0(), // 0xC0
- CMD_ARGS_1(u8), // 0xC1
- CMD_ARGS_1(s16), // 0xC2
- CMD_ARGS_0(), // 0xC3
- CMD_ARGS_0(), // 0xC4
- CMD_ARGS_0(), // 0xC5
- CMD_ARGS_1(u8), // 0xC6
- CMD_ARGS_2(u8, s16), // 0xC7
- CMD_ARGS_1(u8), // 0xC8
- CMD_ARGS_1(u8), // 0xC9
- CMD_ARGS_1(u8), // 0xCA
- CMD_ARGS_1(s16), // 0xCB
- CMD_ARGS_1(u8), // 0xCC
- CMD_ARGS_1(u8), // 0xCD
- CMD_ARGS_1(s16), // 0xCE
- CMD_ARGS_1(s16), // 0xCF
- CMD_ARGS_1(u8), // 0xD0
- CMD_ARGS_1(u8), // 0xD1
- CMD_ARGS_1(u8), // 0xD2
- CMD_ARGS_1(u8), // 0xD3
- CMD_ARGS_1(u8), // 0xD4
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_INSTR
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_DYNTBL
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_SHORT
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_NOSHORT
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_DYNTBLLOOKUP
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_FONT
+ CMD_ARGS_2(u8, s16), // ASEQ_OP_CHAN_STSEQ
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_SUB
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_AND
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_MUTEBHV
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_LDSEQ
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_LDI
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_STOPCHAN
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_LDPTR
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_STPTRTOSEQ
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_EFFECTS
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_NOTEALLOC
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_SUSTAIN
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_BEND
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_REVERB
CMD_ARGS_1(u8), // 0xD5
CMD_ARGS_1(u8), // 0xD6
- CMD_ARGS_1(u8), // 0xD7
- CMD_ARGS_1(u8), // 0xD8
- CMD_ARGS_1(u8), // 0xD9
- CMD_ARGS_1(s16), // 0xDA
- CMD_ARGS_1(u8), // 0xDB
- CMD_ARGS_1(u8), // 0xDC
- CMD_ARGS_1(u8), // 0xDD
- CMD_ARGS_1(s16), // 0xDE
- CMD_ARGS_1(u8), // 0xDF
- CMD_ARGS_1(u8), // 0xE0
- CMD_ARGS_3(u8, u8, u8), // 0xE1
- CMD_ARGS_3(u8, u8, u8), // 0xE2
- CMD_ARGS_1(u8), // 0xE3
- CMD_ARGS_0(), // 0xE4
- CMD_ARGS_1(u8), // 0xE5
- CMD_ARGS_1(u8), // 0xE6
- CMD_ARGS_1(s16), // 0xE7
- CMD_ARGS_3(u8, u8, u8), // 0xE8
- CMD_ARGS_1(u8), // 0xE9
- CMD_ARGS_0(), // 0xEA
- CMD_ARGS_2(u8, u8), // 0xEB
- CMD_ARGS_0(), // 0xEC
- CMD_ARGS_1(u8), // 0xED
- CMD_ARGS_1(u8), // 0xEE
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_VIBFREQ
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_VIBDEPTH
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_RELEASERATE
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_ENV
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_TRANSPOSE
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_PANWEIGHT
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_PAN
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_FREQSCALE
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_VOL
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_VOLEXP
+ CMD_ARGS_3(u8, u8, u8), // ASEQ_OP_CHAN_VIBFREQGRAD
+ CMD_ARGS_3(u8, u8, u8), // ASEQ_OP_CHAN_VIBDEPTHGRAD
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_VIBDELAY
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_DYNCALL
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_REVERBIDX
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_SAMPLEBOOK
+ CMD_ARGS_1(s16), // ASEQ_OP_CHAN_LDPARAMS
+ CMD_ARGS_3(u8, u8, u8), // ASEQ_OP_CHAN_PARAMS
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_NOTEPRI
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_STOP
+ CMD_ARGS_2(u8, u8), // ASEQ_OP_CHAN_FONTINSTR
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_VIBRESET
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_GAIN
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_BENDFINE
CMD_ARGS_2(s16, u8), // 0xEF
- CMD_ARGS_0(), // 0xF0
- CMD_ARGS_1(u8), // 0xF1
- // Control flow instructions (>= 0xF2) can only have 0 or 1 args
- CMD_ARGS_1(u8), // 0xF2
- CMD_ARGS_1(u8), // 0xF3
- CMD_ARGS_1(u8), // 0xF4
- CMD_ARGS_1(s16), // 0xF5
- CMD_ARGS_0(), // 0xF6
- CMD_ARGS_0(), // 0xF7
- CMD_ARGS_1(u8), // 0xF8
- CMD_ARGS_1(s16), // 0xF9
- CMD_ARGS_1(s16), // 0xFA
- CMD_ARGS_1(s16), // 0xFB
- CMD_ARGS_1(s16), // 0xFC
- CMD_ARGS_0(), // 0xFD
- CMD_ARGS_0(), // 0xFE
- CMD_ARGS_0(), // 0xFF
+ CMD_ARGS_0(), // ASEQ_OP_CHAN_FREENOTELIST
+ CMD_ARGS_1(u8), // ASEQ_OP_CHAN_ALLOCNOTELIST
+ // Control flow instructions (>= ASEQ_OP_CONTROL_FLOW_FIRST) can only have 0 or 1 args
+ CMD_ARGS_1(u8), // ASEQ_OP_RBLTZ
+ CMD_ARGS_1(u8), // ASEQ_OP_RBEQZ
+ CMD_ARGS_1(u8), // ASEQ_OP_RJUMP
+ CMD_ARGS_1(s16), // ASEQ_OP_BGEZ
+ CMD_ARGS_0(), // ASEQ_OP_BREAK
+ CMD_ARGS_0(), // ASEQ_OP_LOOPEND
+ CMD_ARGS_1(u8), // ASEQ_OP_LOOP
+ CMD_ARGS_1(s16), // ASEQ_OP_BLTZ
+ CMD_ARGS_1(s16), // ASEQ_OP_BEQZ
+ CMD_ARGS_1(s16), // ASEQ_OP_JUMP
+ CMD_ARGS_1(s16), // ASEQ_OP_CALL
+ CMD_ARGS_0(), // ASEQ_OP_DELAY
+ CMD_ARGS_0(), // ASEQ_OP_DELAY1
+ CMD_ARGS_0(), // ASEQ_OP_END
};
/**
* Read and return the argument from the sequence script for a control flow instruction.
- * Control flow instructions (>= 0xF2) can only have 0 or 1 args.
+ * Control flow instructions (>= ASEQ_OP_CONTROL_FLOW_FIRST) can only have 0 or 1 args.
* @return the argument value for a control flow instruction, or 0 if there is no argument
+ *
+ * original name: Convert_Com
*/
u16 AudioSeq_GetScriptControlFlowArgument(SeqScriptState* state, u8 cmd) {
u8 highBits = sSeqInstructionArgsTable[cmd - 0xB0];
@@ -178,33 +187,35 @@ u16 AudioSeq_GetScriptControlFlowArgument(SeqScriptState* state, u8 cmd) {
/**
* Read and execute the control flow sequence instructions
* @return number of frames until next instruction. -1 signals termination
+ *
+ * original name: Common_Com
*/
s32 AudioSeq_HandleScriptFlowControl(SequencePlayer* seqPlayer, SeqScriptState* state, s32 cmd, s32 cmdArg) {
switch (cmd) {
- case 0xFF:
+ case ASEQ_OP_END:
if (state->depth == 0) {
return PROCESS_SCRIPT_END;
}
state->pc = state->stack[--state->depth];
break;
- case 0xFD:
+ case ASEQ_OP_DELAY:
return AudioSeq_ScriptReadCompressedU16(state);
- case 0xFE:
+ case ASEQ_OP_DELAY1:
return 1;
- case 0xFC:
+ case ASEQ_OP_CALL:
state->stack[state->depth++] = state->pc;
state->pc = seqPlayer->seqData + (u16)cmdArg;
break;
- case 0xF8:
+ case ASEQ_OP_LOOP:
state->remLoopIters[state->depth] = cmdArg;
state->stack[state->depth++] = state->pc;
break;
- case 0xF7:
+ case ASEQ_OP_LOOPEND:
state->remLoopIters[state->depth - 1]--;
if (state->remLoopIters[state->depth - 1] != 0) {
state->pc = state->stack[state->depth - 1];
@@ -213,33 +224,33 @@ s32 AudioSeq_HandleScriptFlowControl(SequencePlayer* seqPlayer, SeqScriptState*
}
break;
- case 0xF6:
+ case ASEQ_OP_BREAK:
state->depth--;
break;
- case 0xF5:
- case 0xF9:
- case 0xFA:
- case 0xFB:
- if (cmd == 0xFA && state->value != 0) {
+ case ASEQ_OP_BGEZ:
+ case ASEQ_OP_BLTZ:
+ case ASEQ_OP_BEQZ:
+ case ASEQ_OP_JUMP:
+ if (cmd == ASEQ_OP_BEQZ && state->value != 0) {
break;
}
- if (cmd == 0xF9 && state->value >= 0) {
+ if (cmd == ASEQ_OP_BLTZ && state->value >= 0) {
break;
}
- if (cmd == 0xF5 && state->value < 0) {
+ if (cmd == ASEQ_OP_BGEZ && state->value < 0) {
break;
}
state->pc = seqPlayer->seqData + (u16)cmdArg;
break;
- case 0xF2:
- case 0xF3:
- case 0xF4:
- if (cmd == 0xF3 && state->value != 0) {
+ case ASEQ_OP_RBLTZ:
+ case ASEQ_OP_RBEQZ:
+ case ASEQ_OP_RJUMP:
+ if (cmd == ASEQ_OP_RBEQZ && state->value != 0) {
break;
}
- if (cmd == 0xF2 && state->value >= 0) {
+ if (cmd == ASEQ_OP_RBLTZ && state->value >= 0) {
break;
}
state->pc += (s8)(cmdArg & 0xFF);
@@ -249,6 +260,9 @@ s32 AudioSeq_HandleScriptFlowControl(SequencePlayer* seqPlayer, SeqScriptState*
return 0;
}
+/**
+ * original name: Nas_InitSubTrack
+ */
void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
s32 i;
@@ -304,6 +318,9 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
Audio_InitNoteLists(&channel->notePool);
}
+/**
+ * original name: Nas_EntryNoteTrack
+ */
s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
SequenceLayer* layer;
s32 pad;
@@ -351,6 +368,9 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
return 0;
}
+/**
+ * original name: Nas_ReleaseNoteTrack
+ */
void AudioSeq_SeqLayerDisable(SequenceLayer* layer) {
if (layer != NULL) {
if (layer->channel != &gAudioCtx.sequenceChannelNone && layer->channel->seqPlayer->finished == 1) {
@@ -363,6 +383,9 @@ void AudioSeq_SeqLayerDisable(SequenceLayer* layer) {
}
}
+/**
+ * original name: Nas_CloseNoteTrack
+ */
void AudioSeq_SeqLayerFree(SequenceChannel* channel, s32 layerIndex) {
SequenceLayer* layer = channel->layers[layerIndex];
@@ -373,6 +396,9 @@ void AudioSeq_SeqLayerFree(SequenceChannel* channel, s32 layerIndex) {
}
}
+/**
+ * original name: Nas_ReleaseSubTrack
+ */
void AudioSeq_SequenceChannelDisable(SequenceChannel* channel) {
s32 i;
@@ -385,6 +411,9 @@ void AudioSeq_SequenceChannelDisable(SequenceChannel* channel) {
channel->finished = true;
}
+/**
+ * original name: Nas_AllocSub
+ */
void AudioSeq_SequencePlayerSetupChannels(SequencePlayer* seqPlayer, u16 channelBits) {
SequenceChannel* channel;
s32 i;
@@ -400,6 +429,9 @@ void AudioSeq_SequencePlayerSetupChannels(SequencePlayer* seqPlayer, u16 channel
}
}
+/**
+ * original name: Nas_DeAllocSub
+ */
void AudioSeq_SequencePlayerDisableChannels(SequencePlayer* seqPlayer, u16 channelBitsUnused) {
SequenceChannel* channel;
s32 i;
@@ -412,6 +444,9 @@ void AudioSeq_SequencePlayerDisableChannels(SequencePlayer* seqPlayer, u16 chann
}
}
+/**
+ * original name: Nas_OpenSub
+ */
void AudioSeq_SequenceChannelEnable(SequencePlayer* seqPlayer, u8 channelIndex, void* script) {
SequenceChannel* channel = seqPlayer->channels[channelIndex];
s32 i;
@@ -429,11 +464,17 @@ void AudioSeq_SequenceChannelEnable(SequencePlayer* seqPlayer, u8 channelIndex,
}
}
+/**
+ * original name: Nas_ReleaseGroup_Force
+ */
void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer) {
seqPlayer->finished = true;
AudioSeq_SequencePlayerDisable(seqPlayer);
}
+/**
+ * original name: Nas_ReleaseGroup
+ */
void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) {
s32 finished = 0;
@@ -472,6 +513,9 @@ void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) {
}
}
+/**
+ * original name: Nas_AddList
+ */
void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item) {
if (item->prev == NULL) {
list->prev->next = item;
@@ -483,6 +527,9 @@ void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item) {
}
}
+/**
+ * original name: Nas_GetList
+ */
void* AudioSeq_AudioListPopBack(AudioListItem* list) {
AudioListItem* item = list->prev;
@@ -498,6 +545,9 @@ void* AudioSeq_AudioListPopBack(AudioListItem* list) {
return item->u.value;
}
+/**
+ * original name: Nas_InitNoteList
+ */
void AudioSeq_InitLayerFreelist(void) {
s32 i;
@@ -513,10 +563,16 @@ void AudioSeq_InitLayerFreelist(void) {
}
}
+/**
+ * original name: Nas_ReadByteData
+ */
u8 AudioSeq_ScriptReadU8(SeqScriptState* state) {
return *(state->pc++);
}
+/**
+ * original name: Nas_ReadWordData
+ */
s16 AudioSeq_ScriptReadS16(SeqScriptState* state) {
s16 ret = *(state->pc++) << 8;
@@ -524,6 +580,9 @@ s16 AudioSeq_ScriptReadS16(SeqScriptState* state) {
return ret;
}
+/**
+ * original name: Nas_ReadLengthData
+ */
u16 AudioSeq_ScriptReadCompressedU16(SeqScriptState* state) {
u16 ret = *(state->pc++);
@@ -534,6 +593,9 @@ u16 AudioSeq_ScriptReadCompressedU16(SeqScriptState* state) {
return ret;
}
+/**
+ * original name: Nas_NoteSeq
+ */
void AudioSeq_SeqLayerProcessScript(SequenceLayer* layer) {
s32 cmd;
@@ -575,6 +637,9 @@ void AudioSeq_SeqLayerProcessScript(SequenceLayer* layer) {
}
}
+/**
+ * original name: __Stop_Note
+ */
void AudioSeq_SeqLayerProcessScriptStep1(SequenceLayer* layer) {
if (!layer->continuousNotes) {
Audio_SeqLayerNoteDecay(layer);
@@ -589,6 +654,9 @@ void AudioSeq_SeqLayerProcessScriptStep1(SequenceLayer* layer) {
layer->notePropertiesNeedInit = true;
}
+/**
+ * original name: __SetChannel
+ */
s32 AudioSeq_SeqLayerProcessScriptStep5(SequenceLayer* layer, s32 sameTunedSample) {
Note* note;
@@ -627,6 +695,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep5(SequenceLayer* layer, s32 sameTunedSampl
return 0;
}
+/**
+ * original name: __Command_Seq
+ */
s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
SequenceChannel* channel = layer->channel;
SeqScriptState* state = &layer->scriptState;
@@ -645,7 +716,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
}
// Control Flow Commands
- if (cmd >= 0xF2) {
+ if (cmd >= ASEQ_OP_CONTROL_FLOW_FIRST) {
cmdArg16 = AudioSeq_GetScriptControlFlowArgument(state, cmd);
if (AudioSeq_HandleScriptFlowControl(seqPlayer, state, cmd, cmdArg16) == 0) {
@@ -656,29 +727,29 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
}
switch (cmd) {
- case 0xC1: // layer_setshortnotevelocity
- case 0xCA: // layer_setpan
+ case ASEQ_OP_LAYER_SHORTVEL: // layer_setshortnotevelocity
+ case ASEQ_OP_LAYER_NOTEPAN: // layer_setpan
cmdArg8 = *(state->pc++);
- if (cmd == 0xC1) {
+ if (cmd == ASEQ_OP_LAYER_SHORTVEL) {
layer->velocitySquare = SQ(cmdArg8) / SQ(127.0f);
} else {
layer->pan = cmdArg8;
}
break;
- case 0xC9: // layer_setshortnotegatetime
- case 0xC2: // layer_transpose; set transposition in semitones
+ case ASEQ_OP_LAYER_SHORTGATE: // layer_setshortnotegatetime
+ case ASEQ_OP_LAYER_TRANSPOSE: // layer_transpose; set transposition in semitones
cmdArg8 = *(state->pc++);
- if (cmd == 0xC9) {
+ if (cmd == ASEQ_OP_LAYER_SHORTGATE) {
layer->gateTime = cmdArg8;
} else {
layer->transposition = cmdArg8;
}
break;
- case 0xC4: // layer_continuousnoteson
- case 0xC5: // layer_continuousnotesoff
- if (cmd == 0xC4) {
+ case ASEQ_OP_LAYER_LEGATO: // layer_continuousnoteson
+ case ASEQ_OP_LAYER_NOLEGATO: // layer_continuousnotesoff
+ if (cmd == ASEQ_OP_LAYER_LEGATO) {
layer->continuousNotes = true;
} else {
layer->continuousNotes = false;
@@ -687,12 +758,12 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
Audio_SeqLayerNoteDecay(layer);
break;
- case 0xC3: // layer_setshortnotedefaultdelay
+ case ASEQ_OP_LAYER_SHORTDELAY: // layer_setshortnotedefaultdelay
cmdArg16 = AudioSeq_ScriptReadCompressedU16(state);
layer->shortNoteDefaultDelay = cmdArg16;
break;
- case 0xC6: // layer_setinstr
+ case ASEQ_OP_LAYER_INSTR: // layer_setinstr
cmd = AudioSeq_ScriptReadU8(state);
if (cmd >= 0x7E) {
if (cmd == 0x7E) {
@@ -719,7 +790,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
}
break;
- case 0xC7: // layer_portamento
+ case ASEQ_OP_LAYER_PORTAMENTO: // layer_portamento
layer->portamento.mode = AudioSeq_ScriptReadU8(state);
cmd = AudioSeq_ScriptReadU8(state);
@@ -743,39 +814,39 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
layer->portamentoTime = cmdArg16;
break;
- case 0xC8: // layer_disableportamento
+ case ASEQ_OP_LAYER_NOPORTAMENTO: // layer_disableportamento
layer->portamento.mode = PORTAMENTO_MODE_OFF;
break;
- case 0xCB:
+ case ASEQ_OP_LAYER_ENV:
cmdArg16 = AudioSeq_ScriptReadS16(state);
layer->adsr.envelope = (EnvelopePoint*)(seqPlayer->seqData + cmdArg16);
FALLTHROUGH;
- case 0xCF:
+ case ASEQ_OP_LAYER_RELEASERATE:
layer->adsr.decayIndex = AudioSeq_ScriptReadU8(state);
break;
- case 0xCC:
+ case ASEQ_OP_LAYER_NODRUMPAN:
layer->ignoreDrumPan = true;
break;
- case 0xCD:
+ case ASEQ_OP_LAYER_STEREO:
layer->stereo.asByte = AudioSeq_ScriptReadU8(state);
break;
- case 0xCE:
+ case ASEQ_OP_LAYER_BENDFINE:
cmdArg8 = AudioSeq_ScriptReadU8(state);
layer->bend = gBendPitchTwoSemitonesFrequencies[(u8)(cmdArg8 + 0x80)];
break;
default:
switch (cmd & 0xF0) {
- case 0xD0: // layer_setshortnotevelocityfromtable
+ case ASEQ_OP_LAYER_LDSHORTVEL: // layer_setshortnotevelocityfromtable
velocity = seqPlayer->shortNoteVelocityTable[cmd & 0xF];
layer->velocitySquare = SQ(velocity) / SQ(127.0f);
break;
- case 0xE0: // layer_setshortnotegatetimefromtable
+ case ASEQ_OP_LAYER_LDSHORTGATE: // layer_setshortnotegatetimefromtable
layer->gateTime = seqPlayer->shortNoteGateTimeTable[cmd & 0xF];
break;
}
@@ -783,6 +854,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
}
}
+/**
+ * original name: __SetVoice
+ */
s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
s32 sameTunedSample = true;
s32 instOrWave;
@@ -991,6 +1065,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
return sameTunedSample;
}
+/**
+ * original name: __SetNote
+ */
s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) {
SeqScriptState* state = &layer->scriptState;
u16 delay;
@@ -1000,7 +1077,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) {
s32 intDelta;
f32 floatDelta;
- if (cmd == 0xC0) {
+ if (cmd == ASEQ_OP_LAYER_LDELAY) {
layer->delay = AudioSeq_ScriptReadCompressedU16(state);
layer->muted = true;
layer->bit1 = false;
@@ -1011,21 +1088,21 @@ s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) {
if (channel->largeNotes == true) {
switch (cmd & 0xC0) {
- case 0x00:
+ case ASEQ_OP_LAYER_NOTEDVG:
delay = AudioSeq_ScriptReadCompressedU16(state);
velocity = *(state->pc++);
layer->gateTime = *(state->pc++);
layer->lastDelay = delay;
break;
- case 0x40:
+ case ASEQ_OP_LAYER_NOTEDV:
delay = AudioSeq_ScriptReadCompressedU16(state);
velocity = *(state->pc++);
layer->gateTime = 0;
layer->lastDelay = delay;
break;
- case 0x80:
+ case ASEQ_OP_LAYER_NOTEVG:
delay = layer->lastDelay;
velocity = *(state->pc++);
layer->gateTime = *(state->pc++);
@@ -1039,16 +1116,16 @@ s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) {
cmd -= (cmd & 0xC0);
} else {
switch (cmd & 0xC0) {
- case 0x00:
+ case ASEQ_OP_LAYER_NOTEDVG:
delay = AudioSeq_ScriptReadCompressedU16(state);
layer->lastDelay = delay;
break;
- case 0x40:
+ case ASEQ_OP_LAYER_NOTEDV:
delay = layer->shortNoteDefaultDelay;
break;
- case 0x80:
+ case ASEQ_OP_LAYER_NOTEVG:
delay = layer->lastDelay;
break;
}
@@ -1104,6 +1181,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) {
return cmd;
}
+/**
+ * original name: Nas_PriorityChanger
+ */
void AudioSeq_SetChannelPriorities(SequenceChannel* channel, u8 priority) {
if ((priority & 0xF) != 0) {
channel->notePriority = priority & 0xF;
@@ -1115,6 +1195,9 @@ void AudioSeq_SetChannelPriorities(SequenceChannel* channel, u8 priority) {
}
}
+/**
+ * original name: Nas_ProgramChanger
+ */
u8 AudioSeq_GetInstrument(SequenceChannel* channel, u8 instId, Instrument** instOut, AdsrSettings* adsr) {
Instrument* inst = Audio_GetInstrumentInner(channel->fontId, instId);
@@ -1134,6 +1217,9 @@ u8 AudioSeq_GetInstrument(SequenceChannel* channel, u8 instId, Instrument** inst
return instId;
}
+/**
+ * original name: Nas_SubVoiceSet
+ */
void AudioSeq_SetInstrument(SequenceChannel* channel, u8 instId) {
if (instId >= 0x80) {
// Synthetic Waves
@@ -1159,10 +1245,16 @@ void AudioSeq_SetInstrument(SequenceChannel* channel, u8 instId) {
channel->hasInstrument = true;
}
+/**
+ * original name: Nas_SubVolumeSet
+ */
void AudioSeq_SequenceChannelSetVolume(SequenceChannel* channel, u8 volume) {
channel->volume = (s32)volume / 127.0f;
}
+/**
+ * original name: Nas_SubSeq
+ */
void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
s32 i;
u8* data;
@@ -1210,7 +1302,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
// Control Flow Commands
- if (cmd >= 0xF2) {
+ if (cmd >= ASEQ_OP_CONTROL_FLOW_FIRST) {
delay = AudioSeq_HandleScriptFlowControl(seqPlayer, scriptState, cmd, cmdArgs[0]);
if (delay != 0) {
@@ -1225,26 +1317,26 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
switch (cmd) {
- case 0xEA:
+ case ASEQ_OP_CHAN_STOP:
channel->stopScript = true;
goto exit_loop;
- case 0xF1:
+ case ASEQ_OP_CHAN_ALLOCNOTELIST:
Audio_NotePoolClear(&channel->notePool);
cmd = (u8)cmdArgs[0];
Audio_NotePoolFill(&channel->notePool, cmd);
break;
- case 0xF0:
+ case ASEQ_OP_CHAN_FREENOTELIST:
Audio_NotePoolClear(&channel->notePool);
break;
- case 0xC2:
+ case ASEQ_OP_CHAN_DYNTBL:
cmdArgU16 = (u16)cmdArgs[0];
channel->dynTable = (void*)&seqPlayer->seqData[cmdArgU16];
break;
- case 0xC5:
+ case ASEQ_OP_CHAN_DYNTBLLOOKUP:
if (scriptState->value != -1) {
data = (*channel->dynTable)[scriptState->value];
cmdArgU16 = (u16)((data[0] << 8) + data[1]);
@@ -1253,7 +1345,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
- case 0xEB:
+ case ASEQ_OP_CHAN_FONTINSTR:
cmd = (u8)cmdArgs[0];
if (seqPlayer->defaultFont != 0xFF) {
@@ -1268,93 +1360,93 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
cmdArgs[0] = cmdArgs[1];
FALLTHROUGH;
- case 0xC1:
+ case ASEQ_OP_CHAN_INSTR:
cmd = (u8)cmdArgs[0];
AudioSeq_SetInstrument(channel, cmd);
break;
- case 0xC3:
+ case ASEQ_OP_CHAN_SHORT:
channel->largeNotes = false;
break;
- case 0xC4:
+ case ASEQ_OP_CHAN_NOSHORT:
channel->largeNotes = true;
break;
- case 0xDF:
+ case ASEQ_OP_CHAN_VOL:
cmd = (u8)cmdArgs[0];
AudioSeq_SequenceChannelSetVolume(channel, cmd);
channel->changes.s.volume = true;
break;
- case 0xE0:
+ case ASEQ_OP_CHAN_VOLEXP:
cmd = (u8)cmdArgs[0];
channel->volumeScale = (s32)cmd / 128.0f;
channel->changes.s.volume = true;
break;
- case 0xDE:
+ case ASEQ_OP_CHAN_FREQSCALE:
cmdArgU16 = (u16)cmdArgs[0];
channel->freqScale = (s32)cmdArgU16 / 32768.0f;
channel->changes.s.freqScale = true;
break;
- case 0xD3:
+ case ASEQ_OP_CHAN_BEND:
cmd = (u8)cmdArgs[0];
cmd += 0x80;
channel->freqScale = gBendPitchOneOctaveFrequencies[cmd];
channel->changes.s.freqScale = true;
break;
- case 0xEE:
+ case ASEQ_OP_CHAN_BENDFINE:
cmd = (u8)cmdArgs[0];
cmd += 0x80;
channel->freqScale = gBendPitchTwoSemitonesFrequencies[cmd];
channel->changes.s.freqScale = true;
break;
- case 0xDD:
+ case ASEQ_OP_CHAN_PAN:
cmd = (u8)cmdArgs[0];
channel->newPan = cmd;
channel->changes.s.pan = true;
break;
- case 0xDC:
+ case ASEQ_OP_CHAN_PANWEIGHT:
cmd = (u8)cmdArgs[0];
channel->panChannelWeight = cmd;
channel->changes.s.pan = true;
break;
- case 0xDB:
+ case ASEQ_OP_CHAN_TRANSPOSE:
cmdArgS8 = (s8)cmdArgs[0];
channel->transposition = cmdArgS8;
break;
- case 0xDA:
+ case ASEQ_OP_CHAN_ENV:
cmdArgU16 = (u16)cmdArgs[0];
channel->adsr.envelope = (EnvelopePoint*)&seqPlayer->seqData[cmdArgU16];
break;
- case 0xD9:
+ case ASEQ_OP_CHAN_RELEASERATE:
cmd = (u8)cmdArgs[0];
channel->adsr.decayIndex = cmd;
break;
- case 0xD8:
+ case ASEQ_OP_CHAN_VIBDEPTH:
cmd = (u8)cmdArgs[0];
channel->vibratoDepthTarget = cmd * 8;
channel->vibratoDepthStart = 0;
channel->vibratoDepthChangeDelay = 0;
break;
- case 0xD7:
+ case ASEQ_OP_CHAN_VIBFREQ:
cmd = (u8)cmdArgs[0];
channel->vibratoRateChangeDelay = 0;
channel->vibratoRateTarget = cmd * 32;
channel->vibratoRateStart = cmd * 32;
break;
- case 0xE2:
+ case ASEQ_OP_CHAN_VIBDEPTHGRAD:
cmd = (u8)cmdArgs[0];
channel->vibratoDepthStart = cmd * 8;
cmd = (u8)cmdArgs[1];
@@ -1363,7 +1455,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->vibratoDepthChangeDelay = cmd * 16;
break;
- case 0xE1:
+ case ASEQ_OP_CHAN_VIBFREQGRAD:
cmd = (u8)cmdArgs[0];
channel->vibratoRateStart = cmd * 32;
cmd = (u8)cmdArgs[1];
@@ -1372,17 +1464,17 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->vibratoRateChangeDelay = cmd * 16;
break;
- case 0xE3:
+ case ASEQ_OP_CHAN_VIBDELAY:
cmd = (u8)cmdArgs[0];
channel->vibratoDelay = cmd * 16;
break;
- case 0xD4:
+ case ASEQ_OP_CHAN_REVERB:
cmd = (u8)cmdArgs[0];
channel->targetReverbVol = cmd;
break;
- case 0xC6:
+ case ASEQ_OP_CHAN_FONT:
cmd = (u8)cmdArgs[0];
if (seqPlayer->defaultFont != 0xFF) {
@@ -1396,56 +1488,56 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
- case 0xC7:
+ case ASEQ_OP_CHAN_STSEQ:
cmd = (u8)cmdArgs[0];
cmdArgU16 = (u16)cmdArgs[1];
seqData = &seqPlayer->seqData[cmdArgU16];
seqData[0] = (u8)scriptState->value + cmd;
break;
- case 0xC8:
- case 0xCC:
- case 0xC9:
+ case ASEQ_OP_CHAN_SUB:
+ case ASEQ_OP_CHAN_LDI:
+ case ASEQ_OP_CHAN_AND:
cmdArgS8 = (s8)cmdArgs[0];
- if (cmd == 0xC8) {
+ if (cmd == ASEQ_OP_CHAN_SUB) {
scriptState->value -= cmdArgS8;
- } else if (cmd == 0xCC) {
+ } else if (cmd == ASEQ_OP_CHAN_LDI) {
scriptState->value = cmdArgS8;
} else {
scriptState->value &= cmdArgS8;
}
break;
- case 0xCD:
+ case ASEQ_OP_CHAN_STOPCHAN:
cmd = (u8)cmdArgs[0];
AudioSeq_SequenceChannelDisable(seqPlayer->channels[cmd]);
break;
- case 0xCA:
+ case ASEQ_OP_CHAN_MUTEBHV:
cmd = (u8)cmdArgs[0];
channel->muteBehavior = cmd;
channel->changes.s.volume = true;
break;
- case 0xCB:
+ case ASEQ_OP_CHAN_LDSEQ:
cmdArgU16 = (u16)cmdArgs[0];
scriptState->value = *(seqPlayer->seqData + (u32)(cmdArgU16 + scriptState->value));
break;
- case 0xCE:
+ case ASEQ_OP_CHAN_LDPTR:
cmdArgU16 = (u16)cmdArgs[0];
channel->unk_22 = cmdArgU16;
break;
- case 0xCF:
+ case ASEQ_OP_CHAN_STPTRTOSEQ:
cmdArgU16 = (u16)cmdArgs[0];
seqData = &seqPlayer->seqData[cmdArgU16];
seqData[0] = (channel->unk_22 >> 8) & 0xFF;
seqData[1] = channel->unk_22 & 0xFF;
break;
- case 0xD0:
+ case ASEQ_OP_CHAN_EFFECTS:
cmd = (u8)cmdArgs[0];
if (cmd & 0x80) {
channel->stereoHeadsetEffects = true;
@@ -1455,22 +1547,22 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->stereo.asByte = cmd & 0x7F;
break;
- case 0xD1:
+ case ASEQ_OP_CHAN_NOTEALLOC:
cmd = (u8)cmdArgs[0];
channel->noteAllocPolicy = cmd;
break;
- case 0xD2:
+ case ASEQ_OP_CHAN_SUSTAIN:
cmd = (u8)cmdArgs[0];
channel->adsr.sustain = cmd;
break;
- case 0xE5:
+ case ASEQ_OP_CHAN_REVERBIDX:
cmd = (u8)cmdArgs[0];
channel->reverbIndex = cmd;
break;
- case 0xE4:
+ case ASEQ_OP_CHAN_DYNCALL:
if (scriptState->value != -1) {
data = (*channel->dynTable)[scriptState->value];
//! @bug: Missing a stack depth check here
@@ -1480,12 +1572,12 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
- case 0xE6:
+ case ASEQ_OP_CHAN_SAMPLEBOOK:
cmd = (u8)cmdArgs[0];
channel->bookOffset = cmd;
break;
- case 0xE7:
+ case ASEQ_OP_CHAN_LDPARAMS:
cmdArgU16 = (u16)cmdArgs[0];
data = &seqPlayer->seqData[cmdArgU16];
channel->muteBehavior = *data++;
@@ -1500,7 +1592,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->changes.s.pan = true;
break;
- case 0xE8:
+ case ASEQ_OP_CHAN_PARAMS:
channel->muteBehavior = cmdArgs[0];
channel->noteAllocPolicy = cmdArgs[1];
cmd = (u8)cmdArgs[2];
@@ -1514,7 +1606,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->changes.s.pan = true;
break;
- case 0xEC:
+ case ASEQ_OP_CHAN_VIBRESET:
channel->vibratoDepthTarget = 0;
channel->vibratoDepthStart = 0;
channel->vibratoDepthChangeDelay = 0;
@@ -1532,26 +1624,26 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->freqScale = 1.0f;
break;
- case 0xE9:
+ case ASEQ_OP_CHAN_NOTEPRI:
AudioSeq_SetChannelPriorities(channel, (u8)cmdArgs[0]);
break;
- case 0xED:
+ case ASEQ_OP_CHAN_GAIN:
cmd = (u8)cmdArgs[0];
channel->gain = cmd;
break;
- case 0xB0:
+ case ASEQ_OP_CHAN_LDFILTER:
cmdArgU16 = (u16)cmdArgs[0];
data = seqPlayer->seqData + cmdArgU16;
channel->filter = (s16*)data;
break;
- case 0xB1:
+ case ASEQ_OP_CHAN_FREEFILTER:
channel->filter = NULL;
break;
- case 0xB3:
+ case ASEQ_OP_CHAN_FILTER:
cmd = cmdArgs[0];
if (channel->filter != NULL) {
@@ -1561,34 +1653,34 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
- case 0xB2:
+ case ASEQ_OP_CHAN_LDSEQTOPTR:
cmdArgU16 = (u16)cmdArgs[0];
channel->unk_22 = *(u16*)(seqPlayer->seqData + (u32)(cmdArgU16 + scriptState->value * 2));
break;
- case 0xB4:
+ case ASEQ_OP_CHAN_PTRTODYNTBL:
channel->dynTable = (void*)&seqPlayer->seqData[channel->unk_22];
break;
- case 0xB5:
+ case ASEQ_OP_CHAN_DYNTBLTOPTR:
channel->unk_22 = ((u16*)(channel->dynTable))[scriptState->value];
break;
- case 0xB6:
+ case ASEQ_OP_CHAN_DYNTBLV:
scriptState->value = (*channel->dynTable)[0][scriptState->value];
break;
- case 0xB7:
+ case ASEQ_OP_CHAN_RANDTOPTR:
channel->unk_22 =
(cmdArgs[0] == 0) ? gAudioCtx.audioRandom & 0xFFFF : gAudioCtx.audioRandom % cmdArgs[0];
break;
- case 0xB8:
+ case ASEQ_OP_CHAN_RAND:
scriptState->value =
(cmdArgs[0] == 0) ? gAudioCtx.audioRandom & 0xFFFF : gAudioCtx.audioRandom % cmdArgs[0];
break;
- case 0xBD:
+ case ASEQ_OP_CHAN_RANDPTR:
temp2 = AudioThread_NextRandom();
channel->unk_22 = (cmdArgs[0] == 0) ? (temp2 & 0xFFFF) : (temp2 % cmdArgs[0]);
channel->unk_22 += cmdArgs[1];
@@ -1597,20 +1689,20 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->unk_22 = (temp2 << 8) | param;
break;
- case 0xB9:
+ case ASEQ_OP_CHAN_RANDVEL:
channel->velocityRandomVariance = cmdArgs[0];
break;
- case 0xBA:
+ case ASEQ_OP_CHAN_RANDGATE:
channel->gateTimeRandomVariance = cmdArgs[0];
break;
- case 0xBB:
+ case ASEQ_OP_CHAN_COMBFILTER:
channel->combFilterSize = cmdArgs[0];
channel->combFilterGain = cmdArgs[1];
break;
- case 0xBC:
+ case ASEQ_OP_CHAN_PTRADD:
channel->unk_22 += cmdArgs[0];
break;
}
@@ -1620,12 +1712,12 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
if (cmd >= 0x70) {
lowBits = cmd & 0x7;
- if ((cmd & 0xF8) != 0x70 && lowBits >= 4) {
+ if ((cmd & 0xF8) != ASEQ_OP_CHAN_STIO && lowBits >= 4) {
lowBits = 0;
}
switch (cmd & 0xF8) {
- case 0x80:
+ case ASEQ_OP_CHAN_TESTLAYER:
if (channel->layers[lowBits] != NULL) {
scriptState->value = channel->layers[lowBits]->finished;
} else {
@@ -1633,18 +1725,18 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
- case 0x88:
+ case ASEQ_OP_CHAN_LDLAYER:
cmdArgU16 = AudioSeq_ScriptReadS16(scriptState);
if (!AudioSeq_SeqChannelSetLayer(channel, lowBits)) {
channel->layers[lowBits]->scriptState.pc = &seqPlayer->seqData[cmdArgU16];
}
break;
- case 0x90:
+ case ASEQ_OP_CHAN_DELLAYER:
AudioSeq_SeqLayerFree(channel, lowBits);
break;
- case 0x98:
+ case ASEQ_OP_CHAN_DYNLDLAYER:
if (scriptState->value != -1 && AudioSeq_SeqChannelSetLayer(channel, lowBits) != -1) {
data = (*channel->dynTable)[scriptState->value];
cmdArgU16 = (data[0] << 8) + data[1];
@@ -1652,11 +1744,11 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
- case 0x70:
+ case ASEQ_OP_CHAN_STIO:
channel->seqScriptIO[lowBits] = scriptState->value;
break;
- case 0x78:
+ case ASEQ_OP_CHAN_RLDLAYER:
temp1 = AudioSeq_ScriptReadS16(scriptState);
if (!AudioSeq_SeqChannelSetLayer(channel, lowBits)) {
channel->layers[lowBits]->scriptState.pc = &scriptState->pc[temp1];
@@ -1669,11 +1761,11 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
lowBits = cmd & 0xF;
switch (cmd & 0xF0) {
- case 0x00:
+ case ASEQ_OP_CHAN_CDELAY:
channel->delay = lowBits;
goto exit_loop;
- case 0x10:
+ case ASEQ_OP_CHAN_LDSAMPLE:
if (lowBits < 8) {
channel->seqScriptIO[lowBits] = SEQ_IO_VAL_NONE;
if (AudioLoad_SlowLoadSample(channel->fontId, scriptState->value, &channel->seqScriptIO[lowBits]) ==
@@ -1686,28 +1778,28 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
}
break;
- case 0x60:
+ case ASEQ_OP_CHAN_LDIO:
scriptState->value = channel->seqScriptIO[lowBits];
if (lowBits < 2) {
channel->seqScriptIO[lowBits] = SEQ_IO_VAL_NONE;
}
break;
- case 0x50:
+ case ASEQ_OP_CHAN_SUBIO:
scriptState->value -= channel->seqScriptIO[lowBits];
break;
- case 0x20:
+ case ASEQ_OP_CHAN_LDCHAN:
cmdArgU16 = AudioSeq_ScriptReadS16(scriptState);
AudioSeq_SequenceChannelEnable(seqPlayer, lowBits, &seqPlayer->seqData[cmdArgU16]);
break;
- case 0x30:
+ case ASEQ_OP_CHAN_STCIO:
cmd = AudioSeq_ScriptReadU8(scriptState);
seqPlayer->channels[lowBits]->seqScriptIO[cmd] = scriptState->value;
break;
- case 0x40:
+ case ASEQ_OP_CHAN_LDCIO:
cmd = AudioSeq_ScriptReadU8(scriptState);
scriptState->value = seqPlayer->channels[lowBits]->seqScriptIO[cmd];
break;
@@ -1722,6 +1814,9 @@ exit_loop:
}
}
+/**
+ * original name: Nas_GroupSeq
+ */
void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
u8 cmd;
u8 cmdLowBits;
@@ -1780,7 +1875,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
cmd = AudioSeq_ScriptReadU8(seqScript);
// 0xF2 and above are "flow control" commands, including termination.
- if (cmd >= 0xF2) {
+ if (cmd >= ASEQ_OP_CONTROL_FLOW_FIRST) {
delay = AudioSeq_HandleScriptFlowControl(
seqPlayer, seqScript, cmd, AudioSeq_GetScriptControlFlowArgument(&seqPlayer->scriptState, cmd));
@@ -1797,7 +1892,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
if (cmd >= 0xC0) {
switch (cmd) {
- case 0xF1:
+ case ASEQ_OP_SEQ_ALLOCNOTELIST:
Audio_NotePoolClear(&seqPlayer->notePool);
cmd = AudioSeq_ScriptReadU8(seqScript);
Audio_NotePoolFill(&seqPlayer->notePool, cmd);
@@ -1813,18 +1908,18 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
if (dummy) {}
break;
- case 0xF0:
+ case ASEQ_OP_SEQ_FREENOTELIST:
Audio_NotePoolClear(&seqPlayer->notePool);
break;
- case 0xDF:
+ case ASEQ_OP_SEQ_TRANSPOSE:
seqPlayer->transposition = 0;
FALLTHROUGH;
- case 0xDE:
+ case ASEQ_OP_SEQ_RTRANSPOSE:
seqPlayer->transposition += (s8)AudioSeq_ScriptReadU8(seqScript);
break;
- case 0xDD:
+ case ASEQ_OP_SEQ_TEMPO:
seqPlayer->tempo = AudioSeq_ScriptReadU8(seqScript) * SEQTICKS_PER_BEAT;
if (seqPlayer->tempo > gAudioCtx.maxTempo) {
seqPlayer->tempo = (u16)gAudioCtx.maxTempo;
@@ -1835,11 +1930,11 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
}
break;
- case 0xDC:
+ case ASEQ_OP_SEQ_TEMPOCHG:
seqPlayer->tempoChange = (s8)AudioSeq_ScriptReadU8(seqScript) * SEQTICKS_PER_BEAT;
break;
- case 0xDA:
+ case ASEQ_OP_SEQ_VOLMODE:
cmd = AudioSeq_ScriptReadU8(seqScript);
temp = AudioSeq_ScriptReadS16(seqScript);
switch (cmd) {
@@ -1859,7 +1954,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
}
break;
- case 0xDB:
+ case ASEQ_OP_SEQ_VOL:
value = AudioSeq_ScriptReadU8(seqScript);
switch (seqPlayer->state) {
case 1:
@@ -1881,47 +1976,47 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
}
break;
- case 0xD9:
+ case ASEQ_OP_SEQ_VOLSCALE:
seqPlayer->fadeVolumeScale = (s8)AudioSeq_ScriptReadU8(seqScript) / 127.0f;
break;
- case 0xD7:
+ case ASEQ_OP_SEQ_INITCHAN:
temp = AudioSeq_ScriptReadS16(seqScript);
AudioSeq_SequencePlayerSetupChannels(seqPlayer, temp);
break;
- case 0xD6:
+ case ASEQ_OP_SEQ_FREECHAN:
AudioSeq_ScriptReadS16(seqScript);
break;
- case 0xD5:
+ case ASEQ_OP_SEQ_MUTESCALE:
seqPlayer->muteVolumeScale = (s8)AudioSeq_ScriptReadU8(seqScript) / 127.0f;
break;
- case 0xD4:
+ case ASEQ_OP_SEQ_MUTE:
seqPlayer->muted = true;
break;
- case 0xD3:
+ case ASEQ_OP_SEQ_MUTEBHV:
seqPlayer->muteBehavior = AudioSeq_ScriptReadU8(seqScript);
break;
- case 0xD1:
- case 0xD2:
+ case ASEQ_OP_SEQ_LDSHORTGATEARR:
+ case ASEQ_OP_SEQ_LDSHORTVELARR:
temp = AudioSeq_ScriptReadS16(seqScript);
data3 = &seqPlayer->seqData[temp];
- if (cmd == 0xD2) {
+ if (cmd == ASEQ_OP_SEQ_LDSHORTVELARR) {
seqPlayer->shortNoteVelocityTable = data3;
} else {
seqPlayer->shortNoteGateTimeTable = data3;
}
break;
- case 0xD0:
+ case ASEQ_OP_SEQ_NOTEALLOC:
seqPlayer->noteAllocPolicy = AudioSeq_ScriptReadU8(seqScript);
break;
- case 0xCE:
+ case ASEQ_OP_SEQ_RAND:
cmd = AudioSeq_ScriptReadU8(seqScript);
if (cmd == 0) {
seqScript->value = (gAudioCtx.audioRandom >> 2) & 0xFF;
@@ -1930,7 +2025,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
}
break;
- case 0xCD:
+ case ASEQ_OP_SEQ_DYNCALL:
temp = AudioSeq_ScriptReadS16(seqScript);
if ((seqScript->value != -1) && (seqScript->depth != 3)) {
data = seqPlayer->seqData + (u32)(temp + (seqScript->value << 1));
@@ -1942,39 +2037,39 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
}
break;
- case 0xCC:
+ case ASEQ_OP_SEQ_LDI:
seqScript->value = AudioSeq_ScriptReadU8(seqScript);
break;
- case 0xC9:
+ case ASEQ_OP_SEQ_AND:
seqScript->value &= AudioSeq_ScriptReadU8(seqScript);
break;
- case 0xC8:
+ case ASEQ_OP_SEQ_SUB:
seqScript->value -= AudioSeq_ScriptReadU8(seqScript);
break;
- case 0xC7:
+ case ASEQ_OP_SEQ_STSEQ:
cmd = AudioSeq_ScriptReadU8(seqScript);
temp = AudioSeq_ScriptReadS16(seqScript);
data2 = &seqPlayer->seqData[temp];
*data2 = (u8)seqScript->value + cmd;
break;
- case 0xC6:
+ case ASEQ_OP_SEQ_STOP:
seqPlayer->stopScript = true;
return;
- case 0xC5:
+ case ASEQ_OP_SEQ_SCRIPTCTR:
seqPlayer->scriptCounter = (u16)AudioSeq_ScriptReadS16(seqScript);
break;
- case 0xEF:
+ case ASEQ_OP_SEQ_EF:
AudioSeq_ScriptReadS16(seqScript);
AudioSeq_ScriptReadU8(seqScript);
break;
- case 0xC4:
+ case ASEQ_OP_SEQ_RUNSEQ:
cmd = AudioSeq_ScriptReadU8(seqScript);
if (cmd == 0xFF) {
cmd = seqPlayer->playerIdx;
@@ -1992,47 +2087,47 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
cmdLowBits = cmd & 0x0F;
switch (cmd & 0xF0) {
- case 0x00:
+ case ASEQ_OP_SEQ_TESTCHAN:
seqScript->value = seqPlayer->channels[cmdLowBits]->enabled ^ 1;
break;
- case 0x50:
+ case ASEQ_OP_SEQ_SUBIO:
seqScript->value -= seqPlayer->seqScriptIO[cmdLowBits];
break;
- case 0x70:
+ case ASEQ_OP_SEQ_STIO:
seqPlayer->seqScriptIO[cmdLowBits] = seqScript->value;
break;
- case 0x80:
+ case ASEQ_OP_SEQ_LDIO:
seqScript->value = seqPlayer->seqScriptIO[cmdLowBits];
if (cmdLowBits < 2) {
seqPlayer->seqScriptIO[cmdLowBits] = SEQ_IO_VAL_NONE;
}
break;
- case 0x40:
+ case ASEQ_OP_SEQ_STOPCHAN:
AudioSeq_SequenceChannelDisable(seqPlayer->channels[cmdLowBits]);
break;
- case 0x90:
+ case ASEQ_OP_SEQ_LDCHAN:
temp = AudioSeq_ScriptReadS16(seqScript);
AudioSeq_SequenceChannelEnable(seqPlayer, cmdLowBits, (void*)&seqPlayer->seqData[temp]);
break;
- case 0xA0:
+ case ASEQ_OP_SEQ_RLDCHAN:
tempS = AudioSeq_ScriptReadS16(seqScript);
AudioSeq_SequenceChannelEnable(seqPlayer, cmdLowBits, (void*)&seqScript->pc[tempS]);
break;
- case 0xB0:
+ case ASEQ_OP_SEQ_LDSEQ:
cmd = AudioSeq_ScriptReadU8(seqScript);
temp = AudioSeq_ScriptReadS16(seqScript);
data2 = &seqPlayer->seqData[temp];
AudioLoad_SlowLoadSeq(cmd, data2, &seqPlayer->seqScriptIO[cmdLowBits]);
break;
- case 0x60:
+ case ASEQ_OP_SEQ_LDRES:
cmd = AudioSeq_ScriptReadU8(seqScript);
value = cmd;
temp = AudioSeq_ScriptReadU8(seqScript);
@@ -2049,6 +2144,9 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
}
}
+/**
+ * original name: Nas_MySeqMain
+ */
void AudioSeq_ProcessSequences(s32 arg0) {
SequencePlayer* seqPlayer;
u32 i;
@@ -2066,6 +2164,9 @@ void AudioSeq_ProcessSequences(s32 arg0) {
Audio_ProcessNotes();
}
+/**
+ * original name: Nas_SeqSkip
+ */
void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer) {
while (seqPlayer->skipTicks > 0) {
AudioSeq_SequencePlayerProcessSequence(seqPlayer);
@@ -2074,6 +2175,9 @@ void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer) {
}
}
+/**
+ * original name: Nas_InitMySeq
+ */
void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer) {
s32 i;
@@ -2101,6 +2205,9 @@ void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer) {
}
}
+/**
+ * original name: Nas_AssignSubTrack
+ */
void AudioSeq_InitSequencePlayerChannels(s32 playerIdx) {
SequenceChannel* channel;
SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[playerIdx];
@@ -2123,6 +2230,9 @@ void AudioSeq_InitSequencePlayerChannels(s32 playerIdx) {
}
}
+/**
+ * original name: __InitGroup
+ */
void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) {
s32 i;
s32 j;
@@ -2148,6 +2258,9 @@ void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) {
AudioSeq_ResetSequencePlayer(seqPlayer);
}
+/**
+ * original name: Nas_InitPlayer
+ */
void AudioSeq_InitSequencePlayers(void) {
s32 i;
diff --git a/src/audio/lib/synthesis.c b/src/audio/internal/synthesis.c
similarity index 99%
rename from src/audio/lib/synthesis.c
rename to src/audio/internal/synthesis.c
index 85fb8d2610..c7c3eefb04 100644
--- a/src/audio/lib/synthesis.c
+++ b/src/audio/internal/synthesis.c
@@ -1,5 +1,6 @@
+#include "alignment.h"
#include "ultra64.h"
-#include "global.h"
+#include "z64audio.h"
// DMEM Addresses for the RSP
#define DMEM_TEMP 0x3C0
@@ -647,7 +648,7 @@ Acmd* AudioSynth_DoOneAudioUpdate(s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updat
#if OOT_VERSION < NTSC_1_1 || !PLATFORM_N64
if ((reverb->leakRtl != 0) || (reverb->leakLtr != 0))
#else
- if (((reverb->leakRtl != 0) || (reverb->leakLtr != 0)) && (gAudioCtx.soundMode != SOUNDMODE_MONO))
+ if (((reverb->leakRtl != 0) || (reverb->leakLtr != 0)) && (gAudioCtx.soundOutputMode != SOUND_OUTPUT_MONO))
#endif
{
cmd = AudioSynth_LeakReverb(cmd, reverb);
diff --git a/src/audio/lib/thread.c b/src/audio/internal/thread.c
similarity index 95%
rename from src/audio/lib/thread.c
rename to src/audio/internal/thread.c
index f47dbade7e..2e2d0630e1 100644
--- a/src/audio/lib/thread.c
+++ b/src/audio/internal/thread.c
@@ -1,5 +1,12 @@
-#include "global.h"
+/**
+ * Original Filename: sub_sys.c
+ */
+
+#include "array_count.h"
+#include "audiothread_cmd.h"
+#include "ultra64.h"
#include "versions.h"
+#include "z64audio.h"
#define SAMPLES_TO_OVERPRODUCE 0x10
#define EXTRA_BUFFERED_AI_SAMPLES_TARGET 0x80
@@ -24,6 +31,8 @@ static AudioTask* sWaitingAudioTask = NULL;
/**
* This is Audio_Update for the audio thread
+ *
+ * original name: CreateAudioTask (note: function is heavily modified in Animal Crossing)
*/
AudioTask* AudioThread_UpdateImpl(void) {
#if OOT_VERSION < PAL_1_0 || !PLATFORM_N64
@@ -197,6 +206,9 @@ AudioTask* AudioThread_UpdateImpl(void) {
}
}
+/**
+ * original name: Nap_AudioSysProcess
+ */
void AudioThread_ProcessGlobalCmd(AudioCmd* cmd) {
s32 i;
s32 pad[3];
@@ -226,8 +238,8 @@ void AudioThread_ProcessGlobalCmd(AudioCmd* cmd) {
}
break;
- case AUDIOCMD_OP_GLOBAL_SET_SOUND_MODE:
- gAudioCtx.soundMode = cmd->asUInt;
+ case AUDIOCMD_OP_GLOBAL_SET_SOUND_OUTPUT_MODE:
+ gAudioCtx.soundOutputMode = cmd->asUInt;
break;
case AUDIOCMD_OP_GLOBAL_MUTE:
@@ -322,6 +334,9 @@ void AudioThread_ProcessGlobalCmd(AudioCmd* cmd) {
}
}
+/**
+ * original name: __Nas_GroupFadeOut
+ */
void AudioThread_SetFadeOutTimer(s32 seqPlayerIndex, s32 fadeTimer) {
SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[seqPlayerIndex];
@@ -334,6 +349,9 @@ void AudioThread_SetFadeOutTimer(s32 seqPlayerIndex, s32 fadeTimer) {
seqPlayer->fadeTimer = fadeTimer;
}
+/**
+ * original name: __Nas_GroupFadeIn
+ */
void AudioThread_SetFadeInTimer(s32 seqPlayerIndex, s32 fadeTimer) {
SequencePlayer* seqPlayer;
@@ -347,6 +365,9 @@ void AudioThread_SetFadeInTimer(s32 seqPlayerIndex, s32 fadeTimer) {
}
}
+/**
+ * original name: Nap_AudioPortInit
+ */
void AudioThread_InitMesgQueuesImpl(void) {
gAudioCtx.threadCmdWritePos = 0;
gAudioCtx.threadCmdReadPos = 0;
@@ -362,6 +383,9 @@ void AudioThread_InitMesgQueuesImpl(void) {
osCreateMesgQueue(gAudioCtx.audioResetQueueP, gAudioCtx.audioResetMsgBuf, ARRAY_COUNT(gAudioCtx.audioResetMsgBuf));
}
+/**
+ * original name: Nap_PortSet
+ */
void AudioThread_QueueCmd(u32 opArgs, void** data) {
AudioCmd* cmd = &gAudioCtx.threadCmdBuf[gAudioCtx.threadCmdWritePos & 0xFF];
@@ -375,26 +399,41 @@ void AudioThread_QueueCmd(u32 opArgs, void** data) {
}
}
+/**
+ * original name: Nap_SetF32
+ */
void AudioThread_QueueCmdF32(u32 opArgs, f32 data) {
AudioThread_QueueCmd(opArgs, (void**)&data);
}
+/**
+ * original name: Nap_SetS32
+ */
void AudioThread_QueueCmdS32(u32 opArgs, s32 data) {
AudioThread_QueueCmd(opArgs, (void**)&data);
}
+/**
+ * original name: Nap_SetS8
+ */
void AudioThread_QueueCmdS8(u32 opArgs, s8 data) {
u32 uData = data << 0x18;
AudioThread_QueueCmd(opArgs, (void**)&uData);
}
+/**
+ * original name: Nap_SetU16
+ */
void AudioThread_QueueCmdU16(u32 opArgs, u16 data) {
u32 uData = data << 0x10;
AudioThread_QueueCmd(opArgs, (void**)&uData);
}
+/**
+ * original name: Nap_SendStart
+ */
s32 AudioThread_ScheduleProcessCmds(void) {
static s32 D_801304E8 = 0;
s32 ret;
@@ -416,11 +455,17 @@ s32 AudioThread_ScheduleProcessCmds(void) {
return ret;
}
+/**
+ * original name: Nap_FlushPort
+ */
void AudioThread_ResetCmdQueue(void) {
gAudioCtx.threadCmdQueueFinished = false;
gAudioCtx.threadCmdReadPos = gAudioCtx.threadCmdWritePos;
}
+/**
+ * original name: Nap_Process1Command
+ */
void AudioThread_ProcessCmd(AudioCmd* cmd) {
SequencePlayer* seqPlayer;
u16 threadCmdChannelMask;
@@ -458,6 +503,9 @@ void AudioThread_ProcessCmd(AudioCmd* cmd) {
}
}
+/**
+ * original name: Nap_AudioPortProcess
+ */
void AudioThread_ProcessCmds(u32 msg) {
static u8 sCurCmdRdPos = 0;
AudioCmd* cmd;
@@ -505,6 +553,9 @@ void Audio_GetSampleBankIdsOfFont(s32 fontId, u32* sampleBankId1, u32* sampleBan
*sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2;
}
+/**
+ * original name: Nap_CheckSpecChange
+ */
s32 func_800E5EDC(void) {
s32 pad;
s32 specId;
@@ -518,6 +569,9 @@ s32 func_800E5EDC(void) {
}
}
+/**
+ * original name: __ClearSpecChangeQ
+ */
void func_800E5F34(void) {
// macro?
// clang-format off
@@ -525,6 +579,9 @@ void func_800E5F34(void) {
// clang-format on
}
+/**
+ * original name: Nap_StartSpecChange
+ */
s32 AudioThread_ResetAudioHeap(s32 specId) {
s32 resetStatus;
OSMesg msg;
@@ -550,6 +607,9 @@ s32 AudioThread_ResetAudioHeap(s32 specId) {
return AudioThread_ScheduleProcessCmds();
}
+/**
+ * original name: Nap_StartReset
+ */
void AudioThread_PreNMIInternal(void) {
gAudioCtx.resetTimer = 1;
if (gAudioContextInitialized) {
@@ -558,6 +618,9 @@ void AudioThread_PreNMIInternal(void) {
}
}
+/**
+ * original name: Nap_ReadSubPort
+ */
s8 AudioThread_GetChannelIO(s32 seqPlayerIndex, s32 channelIndex, s32 ioPort) {
SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[seqPlayerIndex];
SequenceChannel* channel;
@@ -570,6 +633,9 @@ s8 AudioThread_GetChannelIO(s32 seqPlayerIndex, s32 channelIndex, s32 ioPort) {
}
}
+/**
+ * original name: Nap_ReadGrpPort
+ */
s8 AudioThread_GetSeqPlayerIO(s32 seqPlayerIndex, s32 ioPort) {
return gAudioCtx.seqPlayers[seqPlayerIndex].seqScriptIO[ioPort];
}
@@ -582,6 +648,9 @@ void AudioThread_ResetExternalPool(void) {
gAudioCtx.externalPool.startRamAddr = NULL;
}
+/**
+ * original name: __SetGrpParam
+ */
void AudioThread_ProcessSeqPlayerCmd(SequencePlayer* seqPlayer, AudioCmd* cmd) {
f32 fadeVolume;
@@ -662,6 +731,9 @@ void AudioThread_ProcessSeqPlayerCmd(SequencePlayer* seqPlayer, AudioCmd* cmd) {
}
}
+/**
+ * original name: __SetSubParam
+ */
void AudioThread_ProcessChannelCmd(SequenceChannel* channel, AudioCmd* cmd) {
switch (cmd->op) {
case AUDIOCMD_OP_CHANNEL_SET_VOL_SCALE:
@@ -768,6 +840,9 @@ void AudioThread_Noop2Cmd(u32 arg0, s32 arg1) {
AUDIOCMD_GLOBAL_NOOP_2(0, 0, arg1, arg0);
}
+/**
+ * original name: Nap_WaitVsync
+ */
void AudioThread_WaitForAudioTask(void) {
osRecvMesg(gAudioCtx.taskStartQueueP, NULL, OS_MESG_NOBLOCK);
osRecvMesg(gAudioCtx.taskStartQueueP, NULL, OS_MESG_BLOCK);
@@ -821,6 +896,9 @@ void func_800E66A0(void) {
func_800E66C0(2);
}
+/**
+ * original name: Nap_SilenceCheck_Inner
+ */
s32 func_800E66C0(s32 flags) {
s32 phi_v1;
NotePlaybackState* playbackState;
@@ -857,6 +935,9 @@ s32 func_800E66C0(s32 flags) {
return phi_v1;
}
+/**
+ * original name: Nap_GetRandom
+ */
u32 AudioThread_NextRandom(void) {
static u32 sAudioRandom = 0x12345678;
@@ -866,6 +947,9 @@ u32 AudioThread_NextRandom(void) {
return sAudioRandom;
}
+/**
+ * original name: Nas_InitGAudio
+ */
void AudioThread_InitMesgQueues(void) {
AudioThread_InitMesgQueuesImpl();
}
diff --git a/src/audio/lib/dcache.c b/src/audio/lib/dcache.c
deleted file mode 100644
index caaaea3323..0000000000
--- a/src/audio/lib/dcache.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "global.h"
-
-void Audio_InvalDCache(void* buf, s32 size) {
- OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
-
- osInvalDCache(buf, size);
- osSetIntMask(prevMask);
-}
-
-void Audio_WritebackDCache(void* buf, s32 size) {
- OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
-
- osWritebackDCache(buf, size);
- osSetIntMask(prevMask);
-}
diff --git a/src/audio/tables/samplebank_table.c b/src/audio/tables/samplebank_table.c
index 58ebf06f22..d26d9d5bcb 100644
--- a/src/audio/tables/samplebank_table.c
+++ b/src/audio/tables/samplebank_table.c
@@ -3,7 +3,6 @@
// Symbol definition
-extern AudioTable gSampleBankTable;
#pragma weak gSampleBankTable = sSampleBankTableHeader
// Externs for table
diff --git a/src/audio/tables/sequence_table.c b/src/audio/tables/sequence_table.c
index dc3321d2b4..8235cd674b 100644
--- a/src/audio/tables/sequence_table.c
+++ b/src/audio/tables/sequence_table.c
@@ -4,7 +4,6 @@
// Symbol definition
-extern AudioTable gSequenceTable;
#pragma weak gSequenceTable = sSequenceTableHeader
// Externs for table
diff --git a/src/audio/tables/soundfont_table.c b/src/audio/tables/soundfont_table.c
index 65d1fc9a52..779be397ba 100644
--- a/src/audio/tables/soundfont_table.c
+++ b/src/audio/tables/soundfont_table.c
@@ -3,7 +3,6 @@
// Symbol definition
-extern AudioTable gSoundFontTable;
#pragma weak gSoundFontTable = sSoundFontTableHeader
// Externs for table
diff --git a/src/boot/assert.c b/src/boot/assert.c
index e58f2cc1e7..661f7db873 100644
--- a/src/boot/assert.c
+++ b/src/boot/assert.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "libc64/sprintf.h"
+#include "assert.h"
#include "fault.h"
NORETURN void __assert(const char* assertion, const char* file, int line) {
diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c
index 0c1eeea49e..2f948b9d6a 100644
--- a/src/boot/boot_main.c
+++ b/src/boot/boot_main.c
@@ -1,12 +1,18 @@
-#include "global.h"
#include "boot.h"
+
+#include "carthandle.h"
+#include "idle.h"
+#include "is_debug.h"
+#include "segment_symbols.h"
#include "stack.h"
+#include "stackcheck.h"
#if PLATFORM_N64
#include "cic6105.h"
#endif
+#include "z_locale.h"
+#include "z64thread.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.2:128"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:128"
StackEntry sBootThreadInfo;
OSThread sIdleThread;
diff --git a/src/boot/build.c b/src/boot/build.c
index 31e48096b2..035e685db9 100644
--- a/src/boot/build.c
+++ b/src/boot/build.c
@@ -1,3 +1,5 @@
+#include "build.h"
+
#include "versions.h"
const char gBuildCreator[] = BUILD_CREATOR;
diff --git a/src/boot/carthandle.c b/src/boot/carthandle.c
index 16d3160b55..9a4cf542d8 100644
--- a/src/boot/carthandle.c
+++ b/src/boot/carthandle.c
@@ -1,3 +1,3 @@
-#include "ultra64.h"
+#include "carthandle.h"
OSPiHandle* gCartHandle = NULL;
diff --git a/src/boot/cic6105.c b/src/boot/cic6105.c
index 5ef47053fc..fadae3a181 100644
--- a/src/boot/cic6105.c
+++ b/src/boot/cic6105.c
@@ -1,8 +1,11 @@
-#pragma increment_block_number "ntsc-1.2:128"
+#pragma increment_block_number "ntsc-1.0:132 ntsc-1.1:132 ntsc-1.2:132 pal-1.0:132 pal-1.1:132"
-#include "global.h"
+#include "audiomgr.h"
+#include "build.h"
#include "cic6105.h"
#include "fault.h"
+#include "regs.h"
+#include "sched.h"
s32 func_80001714(void);
diff --git a/src/boot/driverominit.c b/src/boot/driverominit.c
index 5ed69abe07..72ab069d34 100644
--- a/src/boot/driverominit.c
+++ b/src/boot/driverominit.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSPiHandle __DriveRomHandle;
diff --git a/src/boot/idle.c b/src/boot/idle.c
index 508fd16c4e..743219d94c 100644
--- a/src/boot/idle.c
+++ b/src/boot/idle.c
@@ -1,9 +1,21 @@
-#include "global.h"
+#include "array_count.h"
+#include "buffers.h"
+#include "build.h"
+#include "idle.h"
+#include "main.h"
+#include "printf.h"
+#include "segment_symbols.h"
#include "stack.h"
+#include "stackcheck.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
+#include "vi_mode.h"
+#include "z64thread.h"
+#include "z64dma.h"
-#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64 ntsc-1.2:64"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
+ "ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
OSThread sMainThread;
#if OOT_VERSION < PAL_1_0
diff --git a/src/boot/inflate.c b/src/boot/inflate.c
index c0467dd38c..391ce0368f 100644
--- a/src/boot/inflate.c
+++ b/src/boot/inflate.c
@@ -95,6 +95,8 @@
the two sets of lengths.
*/
+#include "inflate.h"
+
#include "ultra64/ultratypes.h"
#include "libc/stddef.h"
#include "libc/stdint.h"
diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c
index 5415b8a7b3..6d63118853 100644
--- a/src/boot/is_debug.c
+++ b/src/boot/is_debug.c
@@ -1,4 +1,15 @@
-#include "global.h"
+#include "is_debug.h"
+
+#include "ultra64.h"
+
+typedef struct ISVDbg {
+ /* 0x00 */ u32 magic; // "IS64"
+ /* 0x04 */ u32 get;
+ /* 0x08 */ u8 unk_08[0xC];
+ /* 0x14 */ u32 put;
+ /* 0x18 */ u8 unk_18[0x8];
+ /* 0x20 */ u8 data[0xFFE0];
+} ISVDbg; // size = 0x10000
#define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000)
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
diff --git a/src/boot/viconfig.c b/src/boot/viconfig.c
index ae50922e63..0381f57f30 100644
--- a/src/boot/viconfig.c
+++ b/src/boot/viconfig.c
@@ -1,5 +1,6 @@
-#include "global.h"
+#include "printf.h"
#include "terminal.h"
+#include "idle.h"
s8 D_80009430 = 1;
vu8 gViConfigBlack = true;
diff --git a/src/boot/yaz0.c b/src/boot/yaz0.c
index 5e5ed26eb1..eb3ce23317 100644
--- a/src/boot/yaz0.c
+++ b/src/boot/yaz0.c
@@ -1,7 +1,11 @@
-#include "global.h"
+#include "yaz0.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.2:128 pal-1.1:128"
+#include "alignment.h"
+#include "ultra64.h"
+#include "z64dma.h"
+
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:128" \
+ "pal-1.1:128"
ALIGNED(16) u8 sYaz0DataBuffer[0x400];
u8* sYaz0DataBufferEnd;
@@ -51,6 +55,13 @@ void* Yaz0_NextDMA(u8* curSrcPos) {
return dst;
}
+typedef struct Yaz0Header {
+ /* 0x00 */ char magic[4]; // Yaz0
+ /* 0x04 */ u32 decSize;
+ /* 0x08 */ u32 compInfoOffset; // only used in mio0
+ /* 0x0C */ u32 uncompDataOffset; // only used in mio0
+} Yaz0Header; // size = 0x10
+
void Yaz0_DecompressImpl(u8* src, u8* dst) {
Yaz0Header* header = (Yaz0Header*)src;
u32 bitIdx = 0;
diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c
index f320f1e0f4..a517f561ce 100644
--- a/src/boot/z_locale.c
+++ b/src/boot/z_locale.c
@@ -1,11 +1,31 @@
-#include "global.h"
+#include "libu64/debug.h"
+#include "alignment.h"
+#include "carthandle.h"
+#include "line_numbers.h"
+#include "padmgr.h"
+#include "printf.h"
#include "region.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
-#include "line_numbers.h"
+#include "vi_mode.h"
+#include "z_locale.h"
s32 gCurrentRegion = 0;
+typedef struct LocaleCartInfo {
+ /* 0x00 */ char name[0x18];
+ /* 0x18 */ u32 mediaFormat;
+ /* 0x1C */ union {
+ struct {
+ u16 cartId;
+ u8 countryCode;
+ u8 version;
+ };
+ u32 regionInfo;
+ };
+} LocaleCartInfo; // size = 0x20
+
void Locale_Init(void) {
#if !PLATFORM_GC
ALIGNED(4) u8 regionInfo[4];
diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c
index 38da143aed..de2a19e57c 100644
--- a/src/boot/z_std_dma.c
+++ b/src/boot/z_std_dma.c
@@ -18,17 +18,35 @@
* There are some additional provisions to ensure that audio DMA is particularly high-speed, the audio data is assumed
* to be uncompressed and the request queue and address translation is skipped.
*/
-#include "global.h"
+#include "libc64/sleep.h"
+#include "libc64/sprintf.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "carthandle.h"
#include "fault.h"
-#include "stack.h"
-#include "terminal.h"
+#include "idle.h"
+#if PLATFORM_IQUE
+#include "inflate.h"
+#endif
#include "line_numbers.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "segment_symbols.h"
+#include "stack.h"
+#include "stackcheck.h"
+#include "terminal.h"
+#include "translation.h"
+#if !PLATFORM_IQUE
+#include "yaz0.h"
+#endif
+#include "z64dma.h"
+#include "z64thread.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.2:62 pal-1.0:60 pal-1.1:60"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:66" \
+ "pal-1.0:64 pal-1.1:64"
StackEntry sDmaMgrStackInfo;
OSMesgQueue sDmaMgrMsgQueue;
diff --git a/src/buffers/audio_heap.c b/src/buffers/audio_heap.c
index b6474ccc6a..b8e0e336e7 100644
--- a/src/buffers/audio_heap.c
+++ b/src/buffers/audio_heap.c
@@ -1,3 +1,5 @@
-#include "z64.h"
+#include "ultra64/ultratypes.h"
+#include "alignment.h"
+#include "buffers.h"
ALIGNED(16) u8 gAudioHeap[0x38000];
diff --git a/src/buffers/gfxbuffers.c b/src/buffers/gfxbuffers.c
index fa466bc829..1806570ae4 100644
--- a/src/buffers/gfxbuffers.c
+++ b/src/buffers/gfxbuffers.c
@@ -1,4 +1,7 @@
-#include "z64.h"
+#include "alignment.h"
+#include "buffers.h"
+#include "gfx.h"
+#include "ultra64.h"
ALIGNED(16) u64 gGfxSPTaskOutputBuffer[0x3000];
diff --git a/src/buffers/zbuffer.c b/src/buffers/zbuffer.c
index d9e5d2784a..69c445b633 100644
--- a/src/buffers/zbuffer.c
+++ b/src/buffers/zbuffer.c
@@ -1,3 +1,5 @@
-#include "z64.h"
+#include "alignment.h"
+#include "buffers.h"
+#include "ultra64/ultratypes.h"
ALIGNED(64) u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH];
diff --git a/src/code/PreRender.c b/src/code/PreRender.c
index 8e002a5a18..ddf6b473ea 100644
--- a/src/code/PreRender.c
+++ b/src/code/PreRender.c
@@ -5,8 +5,13 @@
* buffer copies and coverage drawing. Also contains software implementations of the Video Interface anti-aliasing and
* divot filters.
*/
-#include "global.h"
+#include "libu64/debug.h"
#include "alloca.h"
+#include "color.h"
+#include "gfx.h"
+#include "prerender.h"
+#include "printf.h"
+#include "regs.h"
void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) {
this->widthSave = width;
diff --git a/src/code/TwoHeadArena.c b/src/code/TwoHeadArena.c
index 271c2ae7ff..490304a472 100644
--- a/src/code/TwoHeadArena.c
+++ b/src/code/TwoHeadArena.c
@@ -9,7 +9,7 @@
* is to reset the entire arena, deallocating everything. This scheme is most applicable to allocating similar data
* with identical lifetime.
*/
-#include "global.h"
+#include "tha.h"
void* THA_GetHead(TwoHeadArena* tha) {
return tha->head;
diff --git a/src/code/TwoHeadGfxArena.c b/src/code/TwoHeadGfxArena.c
index ce7b8a45fb..c3f2216fad 100644
--- a/src/code/TwoHeadGfxArena.c
+++ b/src/code/TwoHeadGfxArena.c
@@ -8,7 +8,7 @@
*
* @see TwoHeadArena.c
*/
-#include "global.h"
+#include "thga.h"
void THGA_Init(TwoHeadGfxArena* thga, void* start, size_t size) {
THA_Init(&thga->tha, start, size);
diff --git a/src/code/audio_stop_all_sfx.c b/src/code/audio_stop_all_sfx.c
index ef84cd6fff..b1b526e8ec 100644
--- a/src/code/audio_stop_all_sfx.c
+++ b/src/code/audio_stop_all_sfx.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "array_count.h"
+#include "sfx.h"
+#include "ultra64.h"
u8 sSfxBankIds[] = {
BANK_PLAYER, BANK_ITEM, BANK_ENV, BANK_ENEMY, BANK_SYSTEM, BANK_OCARINA, BANK_VOICE,
diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c
index 1dc72642f3..57f530a4b8 100644
--- a/src/code/audio_thread_manager.c
+++ b/src/code/audio_thread_manager.c
@@ -5,7 +5,13 @@
* and sending the audio rsp tasks generated by the driver to the task scheduler.
*/
-#include "global.h"
+#include "array_count.h"
+#include "audiomgr.h"
+#include "printf.h"
+#include "regs.h"
+#include "speed_meter.h"
+#include "translation.h"
+#include "z64dma.h"
void AudioMgr_NotifyTaskDone(AudioMgr* audioMgr) {
AudioTask* task = audioMgr->rspTask;
diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c
index 3f1488c66e..4c4e0db0e3 100644
--- a/src/code/code_n64dd_800AD4C0.c
+++ b/src/code/code_n64dd_800AD4C0.c
@@ -1,6 +1,10 @@
-#include "global.h"
#include "fault.h"
#include "n64dd.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "z64actor.h"
+#include "z64cutscene.h"
+#include "z64save.h"
n64ddStruct_800FEE70_pointers D_800FEE70 = {
func_801C7C1C,
diff --git a/src/code/db_camera.c b/src/code/db_camera.c
index 242609295d..a275cae523 100644
--- a/src/code/db_camera.c
+++ b/src/code/db_camera.c
@@ -1,4 +1,23 @@
-#include "global.h"
+#include "libu64/gfxprint.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "controller.h"
+#include "db_camera.h"
+#include "debug_arena.h"
+#include "letterbox.h"
+#include "mempak.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64camera.h"
+#include "z64cutscene.h"
+#include "z64cutscene_spline.h"
+#include "z64debug.h"
+#include "z64debug_display.h"
+#include "z64olib.h"
+#include "z64play.h"
+#include "z64save.h"
#define DEBUG_CAM_CONTROLLER_PORT 2
diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c
index b6aa81b329..ad7c786f34 100644
--- a/src/code/debug_malloc.c
+++ b/src/code/debug_malloc.c
@@ -1,5 +1,7 @@
-#include "global.h"
#include "libc64/os_malloc.h"
+#include "debug_arena.h"
+#include "printf.h"
+#include "translation.h"
#define LOG_SEVERITY_NOLOG 0
#define LOG_SEVERITY_ERROR 2
diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c
index 5a85d03ebb..b2bb9d13d4 100644
--- a/src/code/fault_gc.c
+++ b/src/code/fault_gc.c
@@ -40,14 +40,23 @@
* DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen.
* DPad-Down disables sending fault pages over osSyncPrintf.
*/
-#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-eu-mq-dbg:144 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160" \
+
+#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-eu-mq-dbg:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160" \
"gc-us-mq:160 ique-cn:160"
-#include "global.h"
+#include "libc64/sleep.h"
+#include "libc64/sprintf.h"
#include "alloca.h"
+#include "array_count.h"
+#include "controller.h"
+#include "gfx.h"
+#include "padmgr.h"
#include "fault.h"
#include "stack.h"
+#include "stackcheck.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64thread.h"
void Fault_Init(void);
void Fault_SetOsSyncPrintfEnabled(u32 enabled);
diff --git a/src/code/fault_gc_drawer.c b/src/code/fault_gc_drawer.c
index 9d3478a48f..9c2470b9b8 100644
--- a/src/code/fault_gc_drawer.c
+++ b/src/code/fault_gc_drawer.c
@@ -4,10 +4,13 @@
* Implements routines for drawing text with a fixed font directly to a framebuffer, used in displaying
* the crash screen implemented by fault.c
*/
-#include "global.h"
+
+#include "array_count.h"
#include "fault.h"
+#include "gfx.h"
#include "terminal.h"
-#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
+
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
typedef struct FaultDrawer {
/* 0x00 */ u16* fb;
@@ -101,7 +104,7 @@ FaultDrawer sFaultDrawerDefault = {
NULL,
};
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0"
FaultDrawer sFaultDrawer;
char D_8016B6C0[0x20];
diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c
index 720307c0a1..75fc704b91 100644
--- a/src/code/fault_n64.c
+++ b/src/code/fault_n64.c
@@ -1,12 +1,19 @@
-#pragma increment_block_number "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
-
-#include "global.h"
-#include "fault.h"
#include "libc64/os_malloc.h"
+#include "libc64/sleep.h"
+#include "libc64/sprintf.h"
+#include "array_count.h"
+#include "controller.h"
+#include "fault.h"
+#include "gfx.h"
+#include "padmgr.h"
+#include "segmented_address.h"
#include "stack.h"
+#include "stackcheck.h"
#include "terminal.h"
+#include "z64thread.h"
+#include "translation.h"
-#pragma increment_block_number "ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:144 pal-1.1:144"
typedef struct FaultMgr {
OSThread thread;
diff --git a/src/code/flg_set.c b/src/code/flg_set.c
index de5b2a3d3f..88f32a3e4e 100644
--- a/src/code/flg_set.c
+++ b/src/code/flg_set.c
@@ -1,4 +1,12 @@
-#include "global.h"
+#include "flag_set.h"
+
+#include "libu64/gfxprint.h"
+#include "libu64/pad.h"
+#include "gfx.h"
+#include "gfxalloc.h"
+#include "controller.h"
+#include "z64play.h"
+#include "z64save.h"
typedef struct FlagSetEntry {
/* 0x00 */ u16* value;
diff --git a/src/code/game.c b/src/code/game.c
index 4367839528..5b80355cbb 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -1,12 +1,36 @@
-#include "global.h"
-#include "fault.h"
+#include "libc64/malloc.h"
#include "libc64/os_malloc.h"
-#include "terminal.h"
-#include "versions.h"
+#include "libu64/debug.h"
+#include "libu64/gfxprint.h"
+#include "array_count.h"
+#include "audiomgr.h"
+#include "buffers.h"
+#include "controller.h"
+#include "debug_arena.h"
+#include "gfx.h"
+#include "gfxalloc.h"
+#include "fault.h"
+#include "idle.h"
#include "line_numbers.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "padmgr.h"
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "speed_meter.h"
+#include "sys_debug_controller.h"
+#include "terminal.h"
+#include "translation.h"
+#include "versions.h"
+#include "vi_mode.h"
+#include "zelda_arena.h"
+#include "z64debug.h"
+#include "z64dma.h"
+#include "z64game.h"
+#include "z64play.h"
+#include "z64vis.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
@@ -448,7 +472,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
gameState->running = 1;
startTime = osGetTime();
- // Thse assignments must be written this way for matching and to avoid a warning due to casting a pointer to an
+ // These assignments must be written this way for matching and to avoid a warning due to casting a pointer to an
// integer without a cast. This assigns init = NULL and size = 0.
gameState->size = (u32)(gameState->init = NULL);
diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c
index d625bc65f7..506ef7721e 100644
--- a/src/code/gamealloc.c
+++ b/src/code/gamealloc.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libu64/debug.h"
+#include "gamealloc.h"
+#include "printf.h"
void GameAlloc_Log(GameAlloc* this) {
GameAllocEntry* iter;
diff --git a/src/code/gfxalloc.c b/src/code/gfxalloc.c
index 79d8bb04e5..9e2fe9bb99 100644
--- a/src/code/gfxalloc.c
+++ b/src/code/gfxalloc.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "gfx.h"
Gfx* Gfx_Open(Gfx* gfx) {
return gfx + 1;
diff --git a/src/code/graph.c b/src/code/graph.c
index 046e04d374..86543cc50d 100644
--- a/src/code/graph.c
+++ b/src/code/graph.c
@@ -1,15 +1,40 @@
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libc64/sprintf.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "buffers.h"
+#include "console_logo_state.h"
+#include "controller.h"
+#include "gfx.h"
#include "fault.h"
+#include "file_select_state.h"
+#include "line_numbers.h"
+#include "map_select_state.h"
+#include "prenmi_buff.h"
+#include "prenmi_state.h"
+#include "printf.h"
+#include "regs.h"
+#include "setup_state.h"
+#include "speed_meter.h"
+#include "sys_cfb.h"
+#include "sys_debug_controller.h"
+#include "sys_ucode.h"
#include "terminal.h"
+#include "title_setup_state.h"
+#include "translation.h"
#include "ucode_disas.h"
#include "versions.h"
-#include "line_numbers.h"
+#include "vi_mode.h"
+#include "z_game_dlftbls.h"
+#include "z64audio.h"
+#include "z64save.h"
+#include "z64play.h"
#define GFXPOOL_HEAD_MAGIC 0x1234
#define GFXPOOL_TAIL_MAGIC 0x5678
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:160" \
- "ntsc-1.1:160 ntsc-1.2:160 pal-1.0:160 pal-1.1:160"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:128" \
+ "ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:224 pal-1.1:224"
/**
* The time at which the previous `Graph_Update` ended.
diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c
index 59d7a41cfa..ced883f7a0 100644
--- a/src/code/irqmgr.c
+++ b/src/code/irqmgr.c
@@ -32,9 +32,15 @@
*
* @see sched.c
*/
-#include "global.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "irqmgr.h"
+#include "printf.h"
+#include "stackcheck.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
+#include "z64thread.h"
vu32 gIrqMgrResetStatus = IRQ_RESET_STATUS_IDLE;
volatile OSTime sIrqMgrResetTime = 0;
diff --git a/src/code/jpegdecoder.c b/src/code/jpegdecoder.c
index a29752511c..338c6b15d9 100644
--- a/src/code/jpegdecoder.c
+++ b/src/code/jpegdecoder.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "jpeg.h"
s32 JpegDecoder_ProcessMcu(JpegHuffmanTable* hTable0, JpegHuffmanTable* hTable1, u16* mcu, s16* unk);
s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* outZeroCount);
diff --git a/src/code/jpegutils.c b/src/code/jpegutils.c
index 00c0406096..7f5442fd9b 100644
--- a/src/code/jpegutils.c
+++ b/src/code/jpegutils.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "jpeg.h"
void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count) {
u8 i;
diff --git a/src/code/listalloc.c b/src/code/listalloc.c
index 7560c20c64..9ccaa443d1 100644
--- a/src/code/listalloc.c
+++ b/src/code/listalloc.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "libc64/malloc.h"
+#include "listalloc.h"
ListAlloc* ListAlloc_Init(ListAlloc* this) {
this->prev = NULL;
diff --git a/src/code/main.c b/src/code/main.c
index d31f7cd211..cb936b2176 100644
--- a/src/code/main.c
+++ b/src/code/main.c
@@ -1,6 +1,10 @@
+#include "sys_cfb.h"
#include "ultra64.h"
#include "versions.h"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:0 ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
+
// Declared before including other headers for BSS ordering
extern uintptr_t gSegments[NUM_SEGMENTS];
@@ -12,19 +16,35 @@ extern struct Scheduler gScheduler;
extern struct PadMgr gPadMgr;
extern struct IrqMgr gIrqMgr;
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libu64/rcp_utils.h"
+#include "libu64/runtime.h"
+#include "array_count.h"
+#include "audiomgr.h"
+#include "debug_arena.h"
#include "fault.h"
+#include "gfx.h"
+#include "idle.h"
+#include "padmgr.h"
+#include "prenmi_buff.h"
+#include "printf.h"
+#include "regs.h"
+#include "segment_symbols.h"
#include "segmented_address.h"
#include "stack.h"
+#include "stackcheck.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
#if PLATFORM_N64
#include "cic6105.h"
#include "n64dd.h"
#endif
+#include "z64debug.h"
+#include "z64thread.h"
-#pragma increment_block_number "gc-eu:144 gc-eu-mq:144 gc-jp:144 gc-jp-ce:144 gc-jp-mq:144 gc-us:144 gc-us-mq:144" \
- "ique-cn:128 ntsc-1.0:122 ntsc-1.1:122 ntsc-1.2:122 pal-1.0:120 pal-1.1:120"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:0 ntsc-1.0:34 ntsc-1.1:34 ntsc-1.2:34 pal-1.0:32 pal-1.1:32"
extern u8 _buffersSegmentEnd[];
@@ -98,7 +118,7 @@ void Main(void* arg) {
gSystemHeapSize = fb - systemHeapStart;
PRINTF(T("システムヒープ初期化 %08x-%08x %08x\n", "System heap initialization %08x-%08x %08x\n"), systemHeapStart,
fb, gSystemHeapSize);
- SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap
+ Runtime_Init((void*)systemHeapStart, gSystemHeapSize);
#if DEBUG_FEATURES
{
diff --git a/src/code/mempak.c b/src/code/mempak.c
index 8d68be5ca3..850c478b93 100644
--- a/src/code/mempak.c
+++ b/src/code/mempak.c
@@ -7,7 +7,9 @@
* Each file is assigned an uppercase ASCII letter as an identifier, the game name for each is marked as
* 'ZELDA DEMO TOOL', encoded according to the N64 Font Code described in section 26.3 of the N64 Programming Manual.
*/
-#include "global.h"
+#include "mempak.h"
+#include "padmgr.h"
+#include "printf.h"
#define MEMPAK_MAX_FILES 11
diff --git a/src/code/object_table.c b/src/code/object_table.c
index d0f9e936dc..9ed6a1f44d 100644
--- a/src/code/object_table.c
+++ b/src/code/object_table.c
@@ -1,4 +1,8 @@
-#include "global.h"
+#include "array_count.h"
+#include "segment_symbols.h"
+#include "romfile.h"
+#include "ultra64.h"
+#include "z64object.h"
s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD };
diff --git a/src/code/padmgr.c b/src/code/padmgr.c
index 740f15b29a..01a952c876 100644
--- a/src/code/padmgr.c
+++ b/src/code/padmgr.c
@@ -30,9 +30,12 @@
*/
#include "libu64/debug.h"
#include "libu64/padsetup.h"
-#include "macros.h"
+#include "array_count.h"
+#include "padmgr.h"
+#include "printf.h"
#include "fault.h"
#include "terminal.h"
+#include "translation.h"
#include "line_numbers.h"
#define PADMGR_LOG(controllerNum, msg) \
diff --git a/src/code/sched.c b/src/code/sched.c
index b22f38b402..c573bf97f6 100644
--- a/src/code/sched.c
+++ b/src/code/sched.c
@@ -39,9 +39,20 @@
*
* @see irqmgr.c
*/
-#include "global.h"
+#include "libu64/debug.h"
+#include "libu64/rcp_utils.h"
+#include "array_count.h"
#include "fault.h"
+#include "irqmgr.h"
+#include "main.h"
+#include "printf.h"
+#include "regs.h"
+#include "sched.h"
+#include "speed_meter.h"
+#include "translation.h"
#include "versions.h"
+#include "vi_mode.h"
+#include "z64thread.h"
#define RSP_DONE_MSG 667
#define RDP_DONE_MSG 668
diff --git a/src/code/shrink_window.c b/src/code/shrink_window.c
index ad8da58d35..3c92ede0e1 100644
--- a/src/code/shrink_window.c
+++ b/src/code/shrink_window.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "letterbox.h"
+#include "printf.h"
+#include "regs.h"
typedef enum LetterboxState {
/* 0 */ LETTERBOX_STATE_IDLE,
diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c
index d282e34953..bb3624fa86 100644
--- a/src/code/speed_meter.c
+++ b/src/code/speed_meter.c
@@ -1,8 +1,16 @@
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
-
-#include "global.h"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0" \
+ "pal-1.0:0 pal-1.1:0"
+#include "libc64/malloc.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "printf.h"
+#include "regs.h"
+#include "speed_meter.h"
#include "terminal.h"
+#include "zelda_arena.h"
+#include "z64game.h"
+#include "z64view.h"
/**
* How much time the audio update on the audio thread (`AudioThread_Update`) took in total, between scheduling the last
diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c
index 4e4bc06f25..38fc9c65d8 100644
--- a/src/code/sys_cfb.c
+++ b/src/code/sys_cfb.c
@@ -1,8 +1,11 @@
-#include "ultra64.h"
+#include "sys_cfb.h"
+
#include "libu64/debug.h"
#include "attributes.h"
+#include "gfx.h"
#include "line_numbers.h"
-#include "global.h"
+#include "printf.h"
+#include "translation.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"pal-1.1:128"
diff --git a/src/code/sys_debug_controller.c b/src/code/sys_debug_controller.c
index eb1398ff24..06ce8bf6cd 100644
--- a/src/code/sys_debug_controller.c
+++ b/src/code/sys_debug_controller.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "sys_debug_controller.h"
+#include "stdbool.h"
+#include "ultra64/ultratypes.h"
+#include "padmgr.h"
u32 gIsCtrlr2Valid = false;
diff --git a/src/code/sys_freeze.c b/src/code/sys_freeze.c
index f7cb515cfe..2957155559 100644
--- a/src/code/sys_freeze.c
+++ b/src/code/sys_freeze.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "libc64/sleep.h"
+#include "attributes.h"
+#include "printf.h"
+#include "sys_freeze.h"
#include "terminal.h"
NORETURN void func_800D31A0(void) {
diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c
index 54ae8741e4..1ce651e9c9 100644
--- a/src/code/sys_math3d.c
+++ b/src/code/sys_math3d.c
@@ -1,12 +1,14 @@
+#include "sys_math3d.h"
+
+#include "printf.h"
+#include "terminal.h"
+#include "translation.h"
#include "ultra64.h"
#include "z_lib.h"
#include "z64math.h"
-#include "terminal.h"
-#include "macros.h"
-#include "sys_math3d.h"
-#pragma increment_block_number "gc-eu:97 gc-eu-mq:97 gc-jp:97 gc-jp-ce:97 gc-jp-mq:97 gc-us:97 gc-us-mq:97 ique-cn:97" \
- "ntsc-1.0:80 ntsc-1.1:80 ntsc-1.2:79 pal-1.0:80 pal-1.1:80"
+#pragma increment_block_number "gc-eu:77 gc-eu-mq:77 gc-jp:77 gc-jp-ce:77 gc-jp-mq:77 gc-us:77 gc-us-mq:77 ique-cn:67" \
+ "ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64"
s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB,
Vec3f* lineAClosestToB, Vec3f* lineBClosestToA);
diff --git a/src/code/sys_math3d_draw.c b/src/code/sys_math3d_draw.c
index 76651c825e..7781a79e2e 100644
--- a/src/code/sys_math3d_draw.c
+++ b/src/code/sys_math3d_draw.c
@@ -1,4 +1,5 @@
-#include "z64.h"
+#include "sys_math3d.h"
+#include "z64play.h"
void Math3D_DrawSphere(PlayState* play, Sphere16* sph) {
}
diff --git a/src/code/sys_math_atan.c b/src/code/sys_math_atan.c
index 0647745b06..0c99eaced4 100644
--- a/src/code/sys_math_atan.c
+++ b/src/code/sys_math_atan.c
@@ -1,5 +1,6 @@
+#include "array_count.h"
+#include "sys_math.h"
#include "z64math.h"
-#include "macros.h"
static u16 sAtan2Tbl[] = {
0x0000, 0x000A, 0x0014, 0x001F, 0x0029, 0x0033, 0x003D, 0x0047, 0x0051, 0x005C, 0x0066, 0x0070, 0x007A, 0x0084,
diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c
index 19db7799e6..2ca4882601 100644
--- a/src/code/sys_matrix.c
+++ b/src/code/sys_matrix.c
@@ -1,17 +1,24 @@
-#include "global.h"
+#include "libc64/math64.h"
+#include "gfx.h"
#if DEBUG_FEATURES
#include "fault.h"
#endif
+#include "printf.h"
+#include "sys_matrix.h"
+#include "ultra64.h"
+#include "z_lib.h"
+#include "z64game.h"
+#include "z64skin_matrix.h"
// clang-format off
-Mtx gMtxClear = gdSPDefMtx(
+Mtx gIdentityMtx = gdSPDefMtx(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f
);
-MtxF gMtxFClear = {
+MtxF gIdentityMtxF = {
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
@@ -19,9 +26,6 @@ MtxF gMtxFClear = {
};
// clang-format on
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "pal-1.1:128"
-
MtxF* sMatrixStack; // "Matrix_stack"
MtxF* sCurrentMatrix; // "Matrix_now"
diff --git a/src/code/sys_rumble.c b/src/code/sys_rumble.c
index 10844f3674..57f61c9214 100644
--- a/src/code/sys_rumble.c
+++ b/src/code/sys_rumble.c
@@ -12,7 +12,8 @@
*
* @note Original filename is likely sys_vibrate.c or similar as it is ordered after sys_ucode.c
*/
-#include "global.h"
+#include "rumble.h"
+#include "padmgr.h"
/**
* Rumble manager update, runs on Vertical Retrace on the padmgr thread.
diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c
index 2be2566e84..71ae003909 100644
--- a/src/code/sys_ucode.c
+++ b/src/code/sys_ucode.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "ultra64.h"
+#include "sys_ucode.h"
u64* sDefaultGSPUCodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart;
u64* sDefaultGSPUCodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
diff --git a/src/code/title_setup.c b/src/code/title_setup.c
index fcc6eaa239..0272022474 100644
--- a/src/code/title_setup.c
+++ b/src/code/title_setup.c
@@ -1,4 +1,8 @@
-#include "global.h"
+#include "console_logo_state.h"
+#include "setup_state.h"
+#include "printf.h"
+#include "translation.h"
+#include "z64save.h"
void Setup_InitImpl(SetupState* this) {
PRINTF(T("ゼルダ共通データ初期化\n", "Zelda common data initialization\n"));
diff --git a/src/code/ucode_disas.c b/src/code/ucode_disas.c
index ecfc7d7ac4..8d1ff6cd77 100644
--- a/src/code/ucode_disas.c
+++ b/src/code/ucode_disas.c
@@ -1,5 +1,11 @@
-#include "global.h"
+#include "libu64/mtxuty-cvt.h"
+#include "ultra64/gs2dex.h"
+#include "array_count.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "translation.h"
#include "ucode_disas.h"
+#include "ultra64.h"
#if DEBUG_FEATURES
@@ -54,7 +60,7 @@ typedef void (*UcodeDisasCallback)(UCodeDisas*, u32);
void* UCodeDisas_TranslateAddr(UCodeDisas* this, uintptr_t addr) {
uintptr_t physical = this->segments[SEGMENT_NUMBER(addr)] + SEGMENT_OFFSET(addr);
- return PHYSICAL_TO_VIRTUAL(physical);
+ return OS_PHYSICAL_TO_K0(physical);
}
F3dzexConst sUCodeDisasGeometryModes[] = {
diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c
index f56fcc742b..ad2cdff118 100644
--- a/src/code/z_DLF.c
+++ b/src/code/z_DLF.c
@@ -1,5 +1,10 @@
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libu64/overlay.h"
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
+#include "ultra64.h"
+#include "z_game_dlftbls.h"
void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
if (overlayEntry->loadedRamAddr != NULL) {
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index f59a996e6a..83105d23ec 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -1,19 +1,42 @@
-#include "global.h"
+#include "libc64/math64.h"
+#include "libu64/overlay.h"
+#include "array_count.h"
#include "fault.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
#include "quake.h"
#include "rand.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
+#include "z_actor_dlftbls.h"
+#include "z_lib.h"
+#include "zelda_arena.h"
+#include "z64actor.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64light.h"
#include "z64horse.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h"
#include "overlays/actors/ovl_En_Part/z_en_part.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "assets/objects/object_bdoor/object_bdoor.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:0" \
+ "ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
CollisionPoly* sCurCeilingPoly;
s32 sCurCeilingBgId;
@@ -571,7 +594,7 @@ void Attention_Update(Attention* attention, Player* player, Actor* playerFocusAc
attention->reticleFadeAlphaControl = 0;
}
- lockOnSfxId = CHECK_FLAG_ALL(playerFocusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
+ lockOnSfxId = ACTOR_FLAGS_CHECK_ALL(playerFocusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
? NA_SE_SY_LOCK_ON
: NA_SE_SY_LOCK_ON_HUMAN;
Sfx_PlaySfxCentered(lockOnSfxId);
@@ -907,7 +930,7 @@ void Actor_SetScale(Actor* actor, f32 scale) {
}
void Actor_SetObjectDependency(PlayState* play, Actor* actor) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[actor->objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[actor->objectSlot].segment);
}
void Actor_Init(Actor* actor, PlayState* play) {
@@ -2314,8 +2337,8 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* play
bzero(actorCtx, sizeof(ActorContext));
ActorOverlayTable_Init();
- Matrix_MtxFCopy(&play->billboardMtxF, &gMtxFClear);
- Matrix_MtxFCopy(&play->viewProjectionMtxF, &gMtxFClear);
+ Matrix_MtxFCopy(&play->billboardMtxF, &gIdentityMtxF);
+ Matrix_MtxFCopy(&play->viewProjectionMtxF, &gIdentityMtxF);
overlayEntry = &gActorOverlayTable[0];
for (i = 0; i < ARRAY_COUNT(gActorOverlayTable); i++) {
@@ -2835,7 +2858,20 @@ s32 Actor_CullingVolumeTest(PlayState* play, Actor* actor, Vec3f* projPos, f32 p
return false;
}
-void func_800315AC(PlayState* play, ActorContext* actorCtx) {
+/**
+ * Iterates through all category lists to draw every actor.
+ *
+ * In addition to actors, this function also draws:
+ * - Effects
+ * - EffectSs
+ * - Title Cards
+ * - Farores Wind Pointer
+ * - Light glow
+ * - Actor Collision (debug only)
+ *
+ * Note: If an actor is made visible by Lens of Truth, it will be drawn by `Actor_DrawLensActors` instead.
+ */
+void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
s32 invisibleActorCounter;
Actor* invisibleActors[INVISIBLE_ACTOR_MAX];
ActorListEntry* actorListEntry;
@@ -3430,9 +3466,9 @@ void Attention_FindActorInCategory(PlayState* play, ActorContext* actorCtx, Play
while (actor != NULL) {
if ((actor->update != NULL) && ((Player*)actor != player) &&
- CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED)) {
+ ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_ATTENTION_ENABLED)) {
if ((actorCategory == ACTORCAT_ENEMY) &&
- CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) &&
+ ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) &&
(actor->xyzDistToPlayerSq < SQ(500.0f)) && (actor->xyzDistToPlayerSq < sBgmEnemyDistSq)) {
actorCtx->attention.bgmEnemy = actor;
sBgmEnemyDistSq = actor->xyzDistToPlayerSq;
diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c
index 52d8ad8556..1e3c6c96ba 100644
--- a/src/code/z_actor_dlftbls.c
+++ b/src/code/z_actor_dlftbls.c
@@ -1,5 +1,7 @@
-#include "global.h"
#include "fault.h"
+#include "printf.h"
+#include "segment_symbols.h"
+#include "z_actor_dlftbls.h"
// Linker symbol declarations (used in the table below)
#define DEFINE_ACTOR(name, _1, _2, _3) DECLARE_OVERLAY_SEGMENT(name)
diff --git a/src/code/z_bg_collect.c b/src/code/z_bg_collect.c
index bd349765de..68966b74fc 100644
--- a/src/code/z_bg_collect.c
+++ b/src/code/z_bg_collect.c
@@ -1,5 +1,11 @@
-#include "global.h"
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
+#include "ultra64.h"
+#include "z64actor.h"
+#include "z64bgcheck.h"
+#include "z64player.h"
+#include "z64skin_matrix.h"
/**
* Update the `carriedActor`'s position based on the dynapoly actor identified by `bgId`.
@@ -76,7 +82,7 @@ void func_80043334(CollisionContext* colCtx, Actor* actor, s32 bgId) {
if (dynaActor != NULL) {
DynaPolyActor_SetActorOnTop(dynaActor);
- if (CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_CAN_PRESS_SWITCHES)) {
+ if (ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_CAN_PRESS_SWITCHES)) {
DynaPolyActor_SetSwitchPressed(dynaActor);
}
}
diff --git a/src/code/z_bg_item.c b/src/code/z_bg_item.c
index 1a4d9f58d5..43c32eb558 100644
--- a/src/code/z_bg_item.c
+++ b/src/code/z_bg_item.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "z_lib.h"
+#include "z64actor.h"
+#include "z64bgcheck.h"
+#include "z64play.h"
/**
* @param transformFlags How other actors standing on the dynapoly actor's collision move when the dynapoly actor moves.
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index a134591925..945051552a 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -1,8 +1,20 @@
-#include "global.h"
-#include "terminal.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "attributes.h"
#include "line_numbers.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sys_math3d.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64bgcheck.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64skin_matrix.h"
-#pragma increment_block_number "ntsc-1.0:108 ntsc-1.1:104 ntsc-1.2:104"
+#pragma increment_block_number "ntsc-1.0:152 ntsc-1.1:152 ntsc-1.2:152"
u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList);
void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector);
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index dda1f5ea30..cf18c3634a 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -1,7 +1,29 @@
-#include "ultra64.h"
-#include "global.h"
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "controller.h"
+#include "db_camera.h"
+#include "gfx.h"
+#include "letterbox.h"
+#include "one_point_cutscene.h"
#include "quake.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_math3d.h"
#include "terminal.h"
+#include "translation.h"
+#include "ultra64.h"
+#include "z_lib.h"
+#include "zelda_arena.h"
+#include "z64audio.h"
+#include "z64cutscene_spline.h"
+#include "z64debug.h"
+#include "z64olib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
@@ -3639,7 +3661,7 @@ s32 Camera_KeepOn3(Camera* camera) {
}
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ique-cn:128 ntsc-1.0:124 ntsc-1.1:124 ntsc-1.2:124 pal-1.0:122 pal-1.1:122"
+ "ique-cn:128 ntsc-1.0:86 ntsc-1.1:86 ntsc-1.2:86 pal-1.0:86 pal-1.1:86"
s32 Camera_KeepOn4(Camera* camera) {
static Vec3f D_8015BD50;
@@ -7532,7 +7554,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState
#if DEBUG_FEATURES
sDbgModeIdx = -1;
#endif
- D_8011D3F0 = 3;
+ sSceneInitLetterboxTimer = 3; // show letterbox for 3 frames at the start of a new scene
PRINTF(VT_FGCOL(BLUE) "camera: initialize --- " VT_RST " UID %d\n", camera->uid);
}
@@ -8141,8 +8163,8 @@ Vec3s Camera_Update(Camera* camera) {
if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_END_CREDITS)) {
sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0);
Camera_UpdateInterface(sCameraInterfaceField);
- } else if ((D_8011D3F0 != 0) && (camera->camId == CAM_ID_MAIN)) {
- D_8011D3F0--;
+ } else if ((sSceneInitLetterboxTimer != 0) && (camera->camId == CAM_ID_MAIN)) {
+ sSceneInitLetterboxTimer--;
sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_NOTHING_ALT, 0);
Camera_UpdateInterface(sCameraInterfaceField);
} else if (camera->play->transitionMode != TRANS_MODE_OFF) {
diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c
index fece55ea3d..9a9795f453 100644
--- a/src/code/z_camera_data.inc.c
+++ b/src/code/z_camera_data.inc.c
@@ -1,5 +1,5 @@
+#include "array_count.h"
#include "ultra64.h"
-#include "global.h"
typedef struct CameraModeValue {
s16 val;
@@ -2584,7 +2584,7 @@ s16 D_8011D3CC[] = {
s32 sUpdateCameraDirection = 0;
s32 D_8011D3EC = 0;
-s32 D_8011D3F0 = 0;
+s32 sSceneInitLetterboxTimer = 0;
s32 sDemo5PrevAction12Frame = -16;
diff --git a/src/code/z_cheap_proc.inc.c b/src/code/z_cheap_proc.inc.c
index 059f67c02b..e922c0832c 100644
--- a/src/code/z_cheap_proc.inc.c
+++ b/src/code/z_cheap_proc.inc.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z64play.h"
void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) {
OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 214);
diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c
index 1039371f7a..5c2a210bcc 100644
--- a/src/code/z_collision_btltbls.c
+++ b/src/code/z_collision_btltbls.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "array_count.h"
+#include "printf.h"
+#include "translation.h"
+#include "z64collision_check.h"
static DamageTable sDamageTablePresets[] = {
{ {
diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c
index 8af30ac7ff..dcf07766e6 100644
--- a/src/code/z_collision_check.c
+++ b/src/code/z_collision_check.c
@@ -1,10 +1,11 @@
#include "gfx.h"
-#include "macros.h"
+#include "printf.h"
#include "regs.h"
#include "sfx.h"
#include "sys_math3d.h"
#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
#include "z64collision_check.h"
#include "z64effect.h"
@@ -15,8 +16,8 @@
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
#include "z_lib.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ique-cn:128 ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
+ "ique-cn:192 ntsc-1.0:168 ntsc-1.1:168 ntsc-1.2:168 pal-1.0:168 pal-1.1:168"
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*);
@@ -46,7 +47,7 @@ void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC,
OPEN_DISPS(gfxCtx, "../z_collision_check.c", 713);
- gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_OPA_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0x00, 0xFF, r, g, b, 50);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c
index d5322bbd4f..97cb44a4f0 100644
--- a/src/code/z_common_data.c
+++ b/src/code/z_common_data.c
@@ -1,9 +1,14 @@
-#include "global.h"
+#include "alignment.h"
#include "region.h"
+#include "sequence.h"
#include "versions.h"
+#include "z_locale.h"
+#include "z64environment.h"
+#include "z64save.h"
+#include "z64transition.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.0:176 ntsc-1.1:176 ntsc-1.2:176 pal-1.0:160 pal-1.1:160"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
+ "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
ALIGNED(16) SaveContext gSaveContext;
#if PLATFORM_IQUE
diff --git a/src/code/z_construct.c b/src/code/z_construct.c
index b170884579..7561953684 100644
--- a/src/code/z_construct.c
+++ b/src/code/z_construct.c
@@ -1,5 +1,14 @@
-#include "global.h"
+#include "map.h"
+#include "printf.h"
+#include "regs.h"
+#include "segment_symbols.h"
+#include "translation.h"
#include "versions.h"
+#include "z64lifemeter.h"
+#include "z64interface.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64save.h"
void Interface_Destroy(PlayState* play) {
Map_Destroy(play);
diff --git a/src/code/z_cutscene_spline.c b/src/code/z_cutscene_spline.c
index 421f9a2809..137f9f544c 100644
--- a/src/code/z_cutscene_spline.c
+++ b/src/code/z_cutscene_spline.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "ultra64.h"
+#include "z64math.h"
+#include "z64camera.h"
+#include "z64cutscene_spline.h"
// The code in this file is very similar to a spline system used in Super Mario 64 for cutscene camera movement
diff --git a/src/code/z_debug.c b/src/code/z_debug.c
index 957b0364c3..af3c945b76 100644
--- a/src/code/z_debug.c
+++ b/src/code/z_debug.c
@@ -1,4 +1,15 @@
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libu64/gfxprint.h"
+#include "libu64/pad.h"
+#include "array_count.h"
+#include "color.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfxalloc.h"
+#include "regs.h"
+#include "rumble.h"
+#include "ultra64.h"
+#include "z64debug.h"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0"
@@ -14,8 +25,8 @@ typedef struct InputCombo {
/* 0x2 */ u16 press;
} InputCombo; // size = 0x4
-#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \
- "ique-cn:128 ntsc-1.0:160 ntsc-1.1:160 ntsc-1.2:160 pal-1.0:160 pal-1.1:160"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:0" \
+ "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
RegEditor* gRegEditor;
diff --git a/src/code/z_demo.c b/src/code/z_demo.c
index 6e35b82554..d5135b99d1 100644
--- a/src/code/z_demo.c
+++ b/src/code/z_demo.c
@@ -1,11 +1,34 @@
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
-#include "global.h"
-#include "quake.h"
-#include "z64camera.h"
+ "ique-cn:128 ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
+
+#include "libu64/gfxprint.h"
+#include "array_count.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfxalloc.h"
+#include "letterbox.h"
+#include "memory_utils.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "quake.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64camera.h"
+#include "z64cutscene.h"
+#include "z64cutscene_flags.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#include "assets/scenes/indoors/tokinoma/tokinoma_scene.h"
@@ -126,8 +149,8 @@ u16 gCamAtSplinePointsAppliedFrame;
u16 gCamEyePointAppliedFrame;
u16 gCamAtPointAppliedFrame;
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:188 gc-jp-ce:188 gc-jp-mq:0 gc-us:188 gc-us-mq:0" \
- "ntsc-1.0:128 ntsc-1.1:80 ntsc-1.2:80 pal-1.0:80 pal-1.1:80"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
// Cam ID to return to when a scripted cutscene is finished
s16 sReturnToCamId;
diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c
index 212f5ee7df..6e2023b67d 100644
--- a/src/code/z_eff_blure.c
+++ b/src/code/z_eff_blure.c
@@ -1,4 +1,14 @@
-#include "global.h"
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
@@ -805,7 +815,7 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_XLU_DISP++, &vtx[4 * i], 4, 0);
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
}
}
@@ -932,7 +942,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx, "../z_eff_blure.c", 1596);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (this->numElements != 0) {
if (this->flags == 0) {
diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c
index 74cd6a435a..865bd8ec93 100644
--- a/src/code/z_eff_shield_particle.c
+++ b/src/code/z_eff_shield_particle.c
@@ -1,5 +1,15 @@
-#include "global.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
static Vtx sVertices[5] = {
diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c
index a997caa129..57ce3d9ba1 100644
--- a/src/code/z_eff_spark.c
+++ b/src/code/z_eff_spark.c
@@ -1,4 +1,14 @@
-#include "global.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
// original name: "spark"
@@ -154,7 +164,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx, "../z_eff_spark.c", 293);
if (this != NULL) {
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_38);
gDPSetCycleType(POLY_XLU_DISP++, G_CYC_2CYCLE);
diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c
index 2a64a23f4a..c752738725 100644
--- a/src/code/z_eff_ss_dead.c
+++ b/src/code/z_eff_ss_dead.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "gfx.h"
+#include "z_lib.h"
+#include "z64play.h"
void func_80026230(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) {
f32 cos;
diff --git a/src/code/z_effect.c b/src/code/z_effect.c
index ac2141db0b..c0a39cc4bd 100644
--- a/src/code/z_effect.c
+++ b/src/code/z_effect.c
@@ -1,6 +1,9 @@
-#include "global.h"
-
+#include "gfx.h"
+#include "printf.h"
+#include "translation.h"
+#include "z64effect.h"
#include "z64frame_advance.h"
+#include "z64play.h"
EffectContext sEffectContext;
diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c
index 9a3df7eef3..061b6d70da 100644
--- a/src/code/z_effect_soft_sprite.c
+++ b/src/code/z_effect_soft_sprite.c
@@ -1,7 +1,13 @@
-#include "global.h"
+#include "libu64/overlay.h"
+#include "array_count.h"
+#include "printf.h"
+#include "sfx.h"
#include "terminal.h"
-
+#include "translation.h"
+#include "zelda_arena.h"
#include "z64frame_advance.h"
+#include "z64effect.h"
+#include "z64play.h"
EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info"
diff --git a/src/code/z_effect_soft_sprite_dlftbls.c b/src/code/z_effect_soft_sprite_dlftbls.c
index cb24257c87..7c9e228f63 100644
--- a/src/code/z_effect_soft_sprite_dlftbls.c
+++ b/src/code/z_effect_soft_sprite_dlftbls.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "segment_symbols.h"
+#include "z64effect.h"
// Linker symbol declarations (used in the table below)
#define DEFINE_EFFECT_SS(name, _1) DECLARE_OVERLAY_SEGMENT(name)
diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c
index 253996b625..1654ab3d0d 100644
--- a/src/code/z_effect_soft_sprite_old_init.c
+++ b/src/code/z_effect_soft_sprite_old_init.c
@@ -1,4 +1,17 @@
-#include "global.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64skin_matrix.h"
+
#include "overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h"
#include "overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h"
#include "overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h"
@@ -58,7 +71,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture) {
SkinMatrix_SetScale(&mfScale, scale, scale, scale);
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
+ gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c
index c90b4ee6f4..bb93099363 100644
--- a/src/code/z_elf_message.c
+++ b/src/code/z_elf_message.c
@@ -1,5 +1,10 @@
-#include "global.h"
+#include "libu64/debug.h"
+#include "rand.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64quest_hint.h"
#include "z64quest_hint_commands.h"
+#include "z64save.h"
QuestHintCmd sChildSariaQuestHints[] = {
QUEST_HINT_STRENGTH_UPG(SKIP, 0, false, 3),
diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c
index 23d77075dd..9b2bf7c0b7 100644
--- a/src/code/z_en_a_keep.c
+++ b/src/code/z_en_a_keep.c
@@ -1,4 +1,11 @@
-#include "global.h"
+#include "z_en_a_obj.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_d_hsblock/object_d_hsblock.h"
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index e91f09ac0e..f0c627b250 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -17,11 +17,12 @@
#include "z64item.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-eu-mq-dbg:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128" \
- "gc-us-mq:128 ntsc-1.2:128"
+ "gc-us-mq:128 ique-cn:128 ntsc-1.0:128 ntsc-1.2:128"
#define FLAGS 0
diff --git a/src/code/z_env_flags.c b/src/code/z_env_flags.c
index d277a5f752..164ff1dde4 100644
--- a/src/code/z_env_flags.c
+++ b/src/code/z_env_flags.c
@@ -1,4 +1,6 @@
+#include "array_count.h"
#include "ultra64.h"
+#include "z64cutscene_flags.h"
#include "z64play.h"
void CutsceneFlags_UnsetAll(PlayState* play) {
diff --git a/src/code/z_face_reaction.c b/src/code/z_face_reaction.c
index 9864944b1c..ea6313a762 100644
--- a/src/code/z_face_reaction.c
+++ b/src/code/z_face_reaction.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "ultra64.h"
+#include "z64face_reaction.h"
+#include "z64player.h"
u16 sMaskReactionSetTextIds[MASK_REACTION_SET_MAX][PLAYER_MASK_MAX] = {
// MASK_REACTION_SET_CARPENTER_BOSS
@@ -182,7 +184,7 @@ u16 sMaskReactionSetTextIds[MASK_REACTION_SET_MAX][PLAYER_MASK_MAX] = {
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 },
};
-u16 MaskReaction_GetTextId(PlayState* play, u32 maskReactionSet) {
+u16 MaskReaction_GetTextId(struct PlayState* play, u32 maskReactionSet) {
u8 currentMask = Player_GetMask(play);
return sMaskReactionSetTextIds[maskReactionSet][currentMask];
diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c
index a2b0fb8bf1..2621f1c129 100644
--- a/src/code/z_fbdemo.c
+++ b/src/code/z_fbdemo.c
@@ -9,7 +9,15 @@
* @note The only coded effect has a visual effect to blend the tiles to a single point, which looks like the screen
* gets sucked into.
*/
-#include "global.h"
+#include "transition_tile.h"
+
+#include "libc64/malloc.h"
+#include "libc64/sleep.h"
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "printf.h"
+#include "z64math.h"
+#include "z64transition_instances.h"
// color framebuffer
extern u16 D_0F000000[];
diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c
index 59f019e952..d8aa81df06 100644
--- a/src/code/z_fbdemo_circle.c
+++ b/src/code/z_fbdemo_circle.c
@@ -1,4 +1,9 @@
-#include "global.h"
+#include "transition_circle.h"
+
+#include "color.h"
+#include "gfx.h"
+#include "sfx.h"
+#include "z64transition.h"
typedef enum TransitionCircleDirection {
/* 0 */ TRANS_CIRCLE_DIR_IN,
@@ -10,34 +15,7 @@ Gfx sTransCircleEmptyDL[] = {
gsSPEndDisplayList(),
};
-#include "assets/code/fbdemo_circle/z_fbdemo_circle.c"
-
-Gfx sTransCircleDL[] = {
- gsDPPipeSync(),
- gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
- G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
- gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH),
- gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
- G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
- gsDPSetCombineMode(G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA),
- gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
- gsDPLoadTextureBlock(0x08000000, G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMIRROR | G_TX_CLAMP, 4, 6, G_TX_NOLOD, G_TX_NOLOD),
- gsSPDisplayList(0x09000000),
- gsSPVertex(sTransCircleVtx, 32, 0),
- gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
- gsSP2Triangles(3, 5, 6, 0, 5, 7, 8, 0),
- gsSP2Triangles(7, 9, 10, 0, 9, 11, 12, 0),
- gsSP2Triangles(11, 13, 14, 0, 13, 15, 16, 0),
- gsSP2Triangles(15, 17, 18, 0, 17, 19, 20, 0),
- gsSP2Triangles(19, 21, 22, 0, 21, 23, 24, 0),
- gsSP2Triangles(23, 25, 26, 0, 25, 27, 28, 0),
- gsSP1Triangle(27, 29, 30, 0),
- gsSPVertex(&sTransCircleVtx[31], 3, 0),
- gsSP1Triangle(0, 1, 2, 0),
- gsSPEndDisplayList(),
-};
+#include "assets/code/fbdemo_circle/code.c"
void TransitionCircle_Start(void* thisx) {
TransitionCircle* this = (TransitionCircle*)thisx;
diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c
index d2cb382f05..1be97d5f51 100644
--- a/src/code/z_fbdemo_fade.c
+++ b/src/code/z_fbdemo_fade.c
@@ -1,5 +1,13 @@
-#include "global.h"
+#include "transition_fade.h"
+
+#include "main.h"
+#include "printf.h"
+#include "regs.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64save.h"
+#include "z64transition_instances.h"
typedef enum TransitionFadeDirection {
/* 0 */ TRANS_FADE_DIR_IN,
diff --git a/src/code/z_fbdemo_triforce.c b/src/code/z_fbdemo_triforce.c
index 7bb8862b2d..6624a4373c 100644
--- a/src/code/z_fbdemo_triforce.c
+++ b/src/code/z_fbdemo_triforce.c
@@ -1,6 +1,10 @@
-#include "global.h"
+#include "transition_triforce.h"
-#include "assets/code/fbdemo_triforce/z_fbdemo_triforce.c"
+#include "printf.h"
+#include "z64math.h"
+#include "z64transition_instances.h"
+
+#include "assets/code/fbdemo_triforce/code.c"
void TransitionTriforce_Start(void* thisx) {
TransitionTriforce* this = (TransitionTriforce*)thisx;
diff --git a/src/code/z_fbdemo_wipe1.c b/src/code/z_fbdemo_wipe1.c
index e008f68613..25b45e7e2c 100644
--- a/src/code/z_fbdemo_wipe1.c
+++ b/src/code/z_fbdemo_wipe1.c
@@ -1,39 +1,15 @@
-#include "global.h"
+#include "transition_wipe.h"
+
+#include "gfx.h"
+#include "z64save.h"
+#include "z64transition_instances.h"
typedef enum TransitionWipeDirection {
/* 0 */ TRANS_WIPE_DIR_IN,
/* 1 */ TRANS_WIPE_DIR_OUT
} TransitionWipeDirection;
-#include "assets/code/fbdemo_wipe1/z_fbdemo_wipe1.c"
-
-Gfx sTransWipeDL[] = {
- gsDPPipeSync(),
- gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
- G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
- gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
- gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
- G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_1PRIMITIVE,
- G_AC_NONE | G_ZS_PRIM | G_RM_PASS | G_RM_AA_ZB_TEX_EDGE2),
- gsDPSetCombineLERP(TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, COMBINED, 0,
- PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0),
- gsDPSetPrimDepth(0, 0),
- gsDPLoadTextureBlock_4b(sTransWipeTex, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 6,
- 6, 11, G_TX_NOLOD),
- gsDPLoadMultiBlock_4b(sTransWipeTex, 0x0100, 1, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_MIRROR | G_TX_WRAP, 6, 6, 11, 1),
- gsDPSetTextureLUT(G_TT_NONE),
- gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
- gsSPDisplayList(0x08000000),
- gsSPVertex(sTransWipeVtx, 25, 0),
- gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
- gsSP2Triangles(5, 6, 7, 0, 6, 8, 9, 0),
- gsSP2Triangles(8, 10, 11, 0, 10, 12, 13, 0),
- gsSP2Triangles(12, 14, 15, 0, 14, 16, 17, 0),
- gsSP2Triangles(16, 18, 19, 0, 18, 20, 21, 0),
- gsSP2Triangles(20, 22, 23, 0, 22, 0, 24, 0),
- gsSPEndDisplayList(),
-};
+#include "assets/code/fbdemo_wipe1/code.c"
// unused.
Gfx sTransWipeSyncDL[] = {
diff --git a/src/code/z_fcurve_data.c b/src/code/z_fcurve_data.c
index a1c03a9278..a1950a568b 100644
--- a/src/code/z_fcurve_data.c
+++ b/src/code/z_fcurve_data.c
@@ -2,7 +2,6 @@
* File: z_fcurve_data.c
* Description: Interpolation functions for use with Curve SkelAnime
*/
-#include "global.h"
#include "z64curve.h"
#define FCURVE_INTERP_CUBIC 0 // Interpolate using a Hermite cubic spline
diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c
index 1086adb2ec..e5d1f1fbb3 100644
--- a/src/code/z_fcurve_data_skelanime.c
+++ b/src/code/z_fcurve_data_skelanime.c
@@ -25,8 +25,16 @@
* - higher detail draws both.
*/
-#include "global.h"
+#include "gfx.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "zelda_arena.h"
+#include "z64actor.h"
#include "z64curve.h"
+#include "z64play.h"
void SkelCurve_Clear(SkelCurve* skelCurve) {
skelCurve->limbCount = 0;
diff --git a/src/code/z_frame_advance.c b/src/code/z_frame_advance.c
index 486717a50f..6ca410a759 100644
--- a/src/code/z_frame_advance.c
+++ b/src/code/z_frame_advance.c
@@ -3,8 +3,7 @@
#include "stdbool.h"
#include "controller.h"
-#include "padmgr.h"
-#include "macros.h"
+#include "libu64/pad.h"
void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) {
frameAdvCtx->timer = 0;
diff --git a/src/code/z_game_dlftbls.c b/src/code/z_game_dlftbls.c
index 2cad84089d..57efe90dfc 100644
--- a/src/code/z_game_dlftbls.c
+++ b/src/code/z_game_dlftbls.c
@@ -1,4 +1,11 @@
-#include "global.h"
+#include "segment_symbols.h"
+#include "console_logo_state.h"
+#include "file_select_state.h"
+#include "map_select_state.h"
+#include "setup_state.h"
+#include "title_setup_state.h"
+#include "z_game_dlftbls.h"
+#include "z64play.h"
// Linker symbol declarations (used in the table below)
#define DEFINE_GAMESTATE(typeName, enumName, name) DECLARE_OVERLAY_SEGMENT(name)
diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c
index f0390a9611..f73616116d 100644
--- a/src/code/z_game_over.c
+++ b/src/code/z_game_over.c
@@ -1,7 +1,12 @@
-#include "z64game_over.h"
-
-#include "global.h"
+#include "array_count.h"
+#include "letterbox.h"
+#include "regs.h"
+#include "rumble.h"
+#include "sequence.h"
#include "versions.h"
+#include "z64game_over.h"
+#include "z64play.h"
+#include "z64save.h"
void GameOver_Init(PlayState* play) {
play->gameOverCtx.state = GAMEOVER_INACTIVE;
diff --git a/src/code/z_horse.c b/src/code/z_horse.c
index f6f55c9d06..d61af32e7e 100644
--- a/src/code/z_horse.c
+++ b/src/code/z_horse.c
@@ -1,10 +1,14 @@
+#include "array_count.h"
#include "terminal.h"
#include "z_lib.h"
+#include "printf.h"
#include "regs.h"
+#include "translation.h"
#include "z64horse.h"
#include "z64play.h"
#include "z64player.h"
-#include "src/overlays/actors/ovl_En_Horse/z_en_horse.h"
+#include "z64save.h"
+#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
/**
* Tests if the player horse can be spawned
diff --git a/src/code/z_inventory.c b/src/code/z_inventory.c
index 2f89c0565b..c31d4d926f 100644
--- a/src/code/z_inventory.c
+++ b/src/code/z_inventory.c
@@ -1,4 +1,10 @@
-#include "global.h"
+#include "ultra64.h"
+#include "printf.h"
+#include "translation.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/textures/icon_item_static/icon_item_static.h"
#include "assets/textures/icon_item_24_static/icon_item_24_static.h"
#include "assets/textures/parameter_static/parameter_static.h"
diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c
index 86a97183aa..4413e8ae69 100644
--- a/src/code/z_jpeg.c
+++ b/src/code/z_jpeg.c
@@ -1,5 +1,13 @@
-#include "global.h"
+#include "jpeg.h"
+
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "printf.h"
+#include "sys_ucode.h"
#include "terminal.h"
+#include "translation.h"
+#include "ultra64.h"
#define MARKER_ESCAPE 0x00
#define MARKER_SOI 0xD8
@@ -40,12 +48,12 @@ void Jpeg_ScheduleDecoderTask(JpegContext* ctx) {
JpegWork* workBuf = ctx->workBuf;
s32 pad[2];
- workBuf->taskData.address = VIRTUAL_TO_PHYSICAL(&workBuf->data);
+ workBuf->taskData.address = OS_K0_TO_PHYSICAL(&workBuf->data);
workBuf->taskData.mode = ctx->mode;
workBuf->taskData.mbCount = 4;
- workBuf->taskData.qTableYPtr = VIRTUAL_TO_PHYSICAL(&workBuf->qTableY);
- workBuf->taskData.qTableUPtr = VIRTUAL_TO_PHYSICAL(&workBuf->qTableU);
- workBuf->taskData.qTableVPtr = VIRTUAL_TO_PHYSICAL(&workBuf->qTableV);
+ workBuf->taskData.qTableYPtr = OS_K0_TO_PHYSICAL(&workBuf->qTableY);
+ workBuf->taskData.qTableUPtr = OS_K0_TO_PHYSICAL(&workBuf->qTableU);
+ workBuf->taskData.qTableVPtr = OS_K0_TO_PHYSICAL(&workBuf->qTableV);
sJpegTask.t.flags = 0;
sJpegTask.t.ucode_boot = SysUcode_GetUCodeBoot();
diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c
index 42ec59fd0a..d9bca732e5 100644
--- a/src/code/z_kaleido_manager.c
+++ b/src/code/z_kaleido_manager.c
@@ -1,5 +1,12 @@
-#include "global.h"
+#include "libu64/debug.h"
+#include "libu64/overlay.h"
+#include "array_count.h"
+#include "kaleido_manager.h"
+#include "printf.h"
+#include "segment_symbols.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64play.h"
#define KALEIDO_OVERLAY(name, nameString) \
{ NULL, ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, }
diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c
index 994c5ac205..2707db8265 100644
--- a/src/code/z_kaleido_scope_call.c
+++ b/src/code/z_kaleido_scope_call.c
@@ -1,8 +1,14 @@
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
- "ique-cn:192 ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:80 gc-eu-mq:80 gc-jp:80 gc-jp-ce:80 gc-jp-mq:80 gc-us:80 gc-us-mq:80 ique-cn:80" \
+ "ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96"
-#include "global.h"
+#include "libu64/debug.h"
+#include "kaleido_manager.h"
+#include "letterbox.h"
+#include "printf.h"
+#include "regs.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64play.h"
void (*sKaleidoScopeUpdateFunc)(PlayState* play);
void (*sKaleidoScopeDrawFunc)(PlayState* play);
diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c
index 59e1c6d7b7..11109c65bd 100644
--- a/src/code/z_kaleido_setup.c
+++ b/src/code/z_kaleido_setup.c
@@ -1,7 +1,13 @@
-#include "global.h"
+#include "controller.h"
+#include "letterbox.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "regs.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64save.h"
/*
* The following three arrays are effectively unused.
diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c
index fa038276fe..89f5bbd3b7 100644
--- a/src/code/z_kanfont.c
+++ b/src/code/z_kanfont.c
@@ -1,6 +1,12 @@
-#include "global.h"
+#include "kanread.h"
#include "message_data_static.h"
+#include "printf.h"
+#include "segment_symbols.h"
+#include "translation.h"
#include "versions.h"
+#include "z64dma.h"
+#include "z64font.h"
+#include "z64message.h"
/**
* Loads a texture from kanji for the requested `character` into the character texture buffer
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index 85e1e1ab61..c78fc5de87 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -1,12 +1,36 @@
-#pragma increment_block_number "gc-eu:208 gc-eu-mq:208 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
- "ique-cn:192 ntsc-1.0:208 ntsc-1.1:208 ntsc-1.2:208 pal-1.0:220 pal-1.1:220"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
-#include "global.h"
+#include "libc64/qrand.h"
+#include "libu64/gfxprint.h"
+#include "array_count.h"
+#include "buffers.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "gfxalloc.h"
#include "ultra64.h"
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segment_symbols.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
-
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64cutscene.h"
#include "z64frame_advance.h"
+#include "z64environment.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
@@ -214,8 +238,8 @@ s16 sLightningFlashAlpha;
s16 sSunDepthTestX;
s16 sSunDepthTestY;
-#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \
- "ique-cn:224 ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:240 pal-1.1:240"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:192 pal-1.1:192"
LightNode* sNGameOverLightNode;
LightInfo sNGameOverLightInfo;
@@ -882,9 +906,9 @@ void Environment_PrintDebugInfo(PlayState* play, Gfx** gfx) {
GfxPrint_SetPos(&printer, 22, 6);
if (!IS_DAY) {
- GfxPrint_Printf(&printer, "%s", "YORU"); // "night"
+ GfxPrint_Printf(&printer, "%s", T("YORU", "NIGHT"));
} else {
- GfxPrint_Printf(&printer, "%s", "HIRU"); // "day"
+ GfxPrint_Printf(&printer, "%s", T("HIRU", "DAY"));
}
*gfx = GfxPrint_Close(&printer);
diff --git a/src/code/z_lib.c b/src/code/z_lib.c
index d5f59a2a86..e4d56b8dad 100644
--- a/src/code/z_lib.c
+++ b/src/code/z_lib.c
@@ -1,8 +1,8 @@
#include "ultra64.h"
#include "z_lib.h"
#include "ichain.h"
+#include "printf.h"
#include "regs.h"
-#include "macros.h"
#include "sys_math.h"
#include "rand.h"
#include "sfx.h"
diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c
index efe7b92b83..cab9737ff7 100644
--- a/src/code/z_lifemeter.c
+++ b/src/code/z_lifemeter.c
@@ -1,4 +1,13 @@
-#include "global.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64lifemeter.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/textures/parameter_static/parameter_static.h"
static s16 sHeartsPrimColors[3][3] = {
diff --git a/src/code/z_lights.c b/src/code/z_lights.c
index 5ee208f705..d0b003f77c 100644
--- a/src/code/z_lights.c
+++ b/src/code/z_lights.c
@@ -1,4 +1,11 @@
-#include "global.h"
+#include "avoid_ub.h"
+#include "buffers.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z64light.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define LIGHTS_BUFFER_SIZE 32
diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c
index eaa1408bf4..513a61b31e 100644
--- a/src/code/z_malloc.c
+++ b/src/code/z_malloc.c
@@ -1,5 +1,6 @@
-#include "global.h"
#include "libc64/os_malloc.h"
+#include "printf.h"
+#include "translation.h"
#define LOG_SEVERITY_NOLOG 0
#define LOG_SEVERITY_ERROR 2
diff --git a/src/code/z_map_data.c b/src/code/z_map_data.c
index 24721c6234..502eb43c3c 100644
--- a/src/code/z_map_data.c
+++ b/src/code/z_map_data.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "map.h"
+#include "z64save.h"
static s16 sFloorTexIndexOffset[10][8] = {
{ 0, 0, 0, 0, 2, 4, 6, 8 }, { 0, 0, 0, 0, 0, 0, 0, 2 },
diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c
index c658775da3..e46c70bd10 100644
--- a/src/code/z_map_exp.c
+++ b/src/code/z_map_exp.c
@@ -1,10 +1,24 @@
-#include "global.h"
-#include "terminal.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
-#include "assets/textures/parameter_static/parameter_static.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "controller.h"
+#include "map.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "regs.h"
+#include "segment_symbols.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z64map_mark.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/textures/parameter_static/parameter_static.h"
MapData* gMapData;
@@ -356,7 +370,7 @@ void Minimap_DrawCompassIcons(PlayState* play) {
if (play->interfaceCtx.minimapAlpha >= 0xAA) {
Gfx_SetupDL_42Overlay(play->state.gfxCtx);
- gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(OVERLAY_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c
index 4d0ab0411b..402d942d66 100644
--- a/src/code/z_map_mark.c
+++ b/src/code/z_map_mark.c
@@ -1,9 +1,20 @@
-#include "global.h"
-#include "terminal.h"
-#include "assets/textures/parameter_static/parameter_static.h"
+#include "libu64/debug.h"
+#include "libu64/overlay.h"
+#include "map.h"
+#include "printf.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "regs.h"
+#include "romfile.h"
+#include "segment_symbols.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z64map_mark.h"
+#include "z64play.h"
+#include "z64save.h"
+
+#include "assets/textures/parameter_static/parameter_static.h"
typedef struct MapMarkInfo {
/* 0x00 */ void* texture;
diff --git a/src/code/z_message.c b/src/code/z_message.c
index a2c275b8ea..1d6fee156b 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -1,14 +1,33 @@
-#include "global.h"
+#include "libu64/gfxprint.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "gfxalloc.h"
+#include "language_array.h"
+#include "memory_utils.h"
#include "message_data_static.h"
-#include "terminal.h"
-#include "versions.h"
-#include "assets/textures/parameter_static/parameter_static.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "segment_symbols.h"
+#include "sequence.h"
+#include "regs.h"
+#include "terminal.h"
+#include "translation.h"
+#include "versions.h"
+#include "z64audio.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.0:80 ntsc-1.1:80 ntsc-1.2:80 pal-1.0:128 pal-1.1:128"
+#include "assets/textures/parameter_static/parameter_static.h"
+
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:32" \
+ "ntsc-1.1:32 ntsc-1.2:32 pal-1.0:0 pal-1.1:0"
#if !PLATFORM_IQUE
#define MSG_BUF_DECODED (msgCtx->msgBufDecoded)
diff --git a/src/code/z_moji.c b/src/code/z_moji.c
index c9cbbdda88..e26ce68e7f 100644
--- a/src/code/z_moji.c
+++ b/src/code/z_moji.c
@@ -2,7 +2,8 @@
* Unused. A very simple utility for drawing text on screen.
*/
-#include "global.h"
+#include "gfx.h"
+#include "printf.h"
// how big to draw the characters on screen
#define DISP_CHAR_WIDTH 8
diff --git a/src/code/z_nulltask.c b/src/code/z_nulltask.c
index 1f7dae689e..42ba3d86f9 100644
--- a/src/code/z_nulltask.c
+++ b/src/code/z_nulltask.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "ultra64.h"
+#include "sched.h"
/**
* Blocks the current thread until all queued scheduler tasks have completed.
diff --git a/src/code/z_olib.c b/src/code/z_olib.c
index 298f151e2c..66c767f68b 100644
--- a/src/code/z_olib.c
+++ b/src/code/z_olib.c
@@ -1,5 +1,6 @@
#include "z64math.h"
#include "libc64/math64.h"
+#include "z64olib.h"
#include "z_lib.h"
/**
diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c
index 04ffc2f463..94c3bc9e11 100644
--- a/src/code/z_onepointdemo.c
+++ b/src/code/z_onepointdemo.c
@@ -1,7 +1,18 @@
-#include "global.h"
+#include "one_point_cutscene.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "printf.h"
#include "quake.h"
+#include "sfx.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64olib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#include "overlays/actors/ovl_En_Sw/z_en_sw.h"
static s16 sDisableAttention = false;
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index 5b0629047c..1498db0fba 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -1,7 +1,30 @@
-#include "global.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "controller.h"
+#include "flag_set.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "language_array.h"
+#include "main.h"
+#include "map.h"
+#include "printf.h"
+#include "regs.h"
+#include "segment_symbols.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
+#include "z64audio.h"
+#include "z64lifemeter.h"
#include "z64horse.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/textures/parameter_static/parameter_static.h"
#include "assets/textures/do_action_static/do_action_static.h"
#include "assets/textures/icon_item_static/icon_item_static.h"
@@ -2140,7 +2163,7 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l
DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
} else {
- gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment);
+ gSegments[7] = OS_K0_TO_PHYSICAL(interfaceCtx->doActionSegment);
func_80086D5C(SEGMENTED_TO_VIRTUAL(sDoActionTextures[loadOffset]), DO_ACTION_TEX_SIZE / 4);
}
}
@@ -3429,7 +3452,7 @@ void Interface_Draw(PlayState* play) {
gSPSegment(OVERLAY_DISP++, 0x08, pauseCtx->iconItemSegment);
Gfx_SetupDL_42Overlay(play->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
- gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(OVERLAY_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
// PAUSE_CURSOR_QUAD_4
pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] = pauseCtx->equipAnimX / 10;
diff --git a/src/code/z_path.c b/src/code/z_path.c
index d27530eb3a..29b51a8f17 100644
--- a/src/code/z_path.c
+++ b/src/code/z_path.c
@@ -1,4 +1,9 @@
-#include "global.h"
+#include "ultra64.h"
+#include "libc64/math64.h"
+#include "segmented_address.h"
+#include "z64actor.h"
+#include "z64path.h"
+#include "z64play.h"
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max) {
Path* path;
diff --git a/src/code/z_play.c b/src/code/z_play.c
index d531a79110..d4d28422c3 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -1,18 +1,54 @@
-
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libc64/qrand.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "buffers.h"
+#include "color.h"
+#include "controller.h"
#include "fault.h"
-#include "quake.h"
-#include "terminal.h"
-#include "versions.h"
+#include "file_select_state.h"
+#include "gfx.h"
+#include "gfxalloc.h"
+#include "kaleido_manager.h"
+#include "letterbox.h"
#include "line_numbers.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
-
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "quake.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "title_setup_state.h"
+#include "transition_circle.h"
+#include "transition_fade.h"
+#include "transition_tile.h"
+#include "transition_triforce.h"
+#include "transition_wipe.h"
+#include "translation.h"
+#include "versions.h"
+#include "z_actor_dlftbls.h"
+#include "zelda_arena.h"
+#include "z64audio.h"
+#include "z64cutscene_flags.h"
#include "z64debug_display.h"
+#include "z64effect.h"
#include "z64frame_advance.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64vis.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:224" \
+ "ntsc-1.0:240 ntsc-1.1:240 ntsc-1.2:240 pal-1.0:240 pal-1.1:240"
TransitionTile gTransitionTile;
s32 gTransitionTileState;
@@ -301,7 +337,7 @@ void Play_Init(GameState* thisx) {
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_CHECK_BG_ALT | CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG |
CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_CAM_FUNC_FINISH |
CAM_STATE_LOCK_MODE | CAM_STATE_DISTORTION | CAM_STATE_PLAY_INIT);
- Sram_Init(this, &this->sramCtx);
+ Sram_Init(&this->state, &this->sramCtx);
Regs_InitData(this);
Message_Init(this);
GameOver_Init(this);
@@ -548,9 +584,9 @@ void Play_Update(PlayState* this) {
}
#endif
- gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment);
- gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment);
- gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment);
+ gSegments[4] = OS_K0_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment);
+ gSegments[5] = OS_K0_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment);
+ gSegments[2] = OS_K0_TO_PHYSICAL(this->sceneSegment);
if (FrameAdvance_Update(&this->frameAdvCtx, &input[1])) {
if ((this->transitionMode == TRANS_MODE_OFF) && (this->transitionTrigger != TRANS_TRIGGER_OFF)) {
@@ -1109,9 +1145,9 @@ void Play_Draw(PlayState* this) {
OPEN_DISPS(gfxCtx, "../z_play.c", 3907);
- gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment);
- gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment);
- gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment);
+ gSegments[4] = OS_K0_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment);
+ gSegments[5] = OS_K0_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment);
+ gSegments[2] = OS_K0_TO_PHYSICAL(this->sceneSegment);
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
gSPSegment(POLY_XLU_DISP++, 0x00, NULL);
@@ -1294,7 +1330,7 @@ void Play_Draw(PlayState* this) {
}
if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_ACTORS) {
- func_800315AC(this, &this->actorCtx);
+ Actor_DrawAll(this, &this->actorCtx);
}
if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_LENS_FLARES) {
@@ -1570,7 +1606,7 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
ASSERT(this->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960);
- gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment);
+ gSegments[2] = OS_K0_TO_PHYSICAL(this->sceneSegment);
Play_InitScene(this, spawn);
diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c
index b922f56638..eb52aff798 100644
--- a/src/code/z_player_call.c
+++ b/src/code/z_player_call.c
@@ -1,10 +1,14 @@
-#include "global.h"
+#include "kaleido_manager.h"
+#include "z64actor.h"
+#include "z64actor_profile.h"
+#include "z64play.h"
+#include "z64player.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA | ACTOR_FLAG_CAN_PRESS_SWITCHES)
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:128 pal-1.1:128"
void (*sPlayerCallInitFunc)(Actor* thisx, PlayState* play);
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c
index 0e34ff571a..1ac27fdb6c 100644
--- a/src/code/z_player_lib.c
+++ b/src/code/z_player_lib.c
@@ -1,12 +1,24 @@
-#include "global.h"
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
#include "z64draw.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_link_boy/object_link_boy.h"
#include "assets/objects/object_link_child/object_link_child.h"
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "pal-1.0:0 pal-1.1:0"
typedef struct BowSlingshotStringData {
/* 0x00 */ Gfx* dList;
@@ -1513,7 +1525,7 @@ void Player_DrawGetItemImpl(PlayState* play, Player* this, Vec3f* refPos, s32 dr
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2401);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(this->giObjectSegment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(this->giObjectSegment);
gSPSegment(POLY_OPA_DISP++, 0x06, this->giObjectSegment);
gSPSegment(POLY_XLU_DISP++, 0x06, this->giObjectSegment);
@@ -1867,9 +1879,9 @@ u32 Player_InitPauseDrawData(PlayState* play, u8* segment, SkelAnime* skelAnime)
ptr = (void*)ALIGN16((uintptr_t)ptr + size);
- gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE);
+ gSegments[4] = OS_K0_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE);
gSegments[6] =
- VIRTUAL_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE);
+ OS_K0_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE);
SkelAnime_InitLink(play, skelAnime, gPlayerSkelHeaders[(void)0, gSaveContext.save.linkAge],
&gPlayerAnim_link_normal_wait, 9, ptr, ptr, PLAYER_LIMB_MAX);
@@ -2045,9 +2057,9 @@ void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f*
Vec3s* srcTable;
s32 i;
- gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE);
+ gSegments[4] = OS_K0_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE);
gSegments[6] =
- VIRTUAL_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE);
+ OS_K0_TO_PHYSICAL(segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE);
if (!LINK_IS_ADULT) {
if (shield == PLAYER_SHIELD_DEKU) {
diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c
index e1bb151453..6bf73b0577 100644
--- a/src/code/z_prenmi.c
+++ b/src/code/z_prenmi.c
@@ -1,6 +1,11 @@
-#include "global.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "prenmi_state.h"
+#include "printf.h"
+#include "regs.h"
#include "terminal.h"
#include "versions.h"
+#include "vi_mode.h"
void func_80092320(PreNMIState* this) {
this->state.running = false;
diff --git a/src/code/z_prenmi_buff.c b/src/code/z_prenmi_buff.c
index c00d0513c0..3c45d7e540 100644
--- a/src/code/z_prenmi_buff.c
+++ b/src/code/z_prenmi_buff.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "prenmi_buff.h"
#define COLD_RESET 0
#define NMI 1
diff --git a/src/code/z_quake.c b/src/code/z_quake.c
index 4c318b9386..d3ba17810d 100644
--- a/src/code/z_quake.c
+++ b/src/code/z_quake.c
@@ -1,6 +1,11 @@
-#include "global.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "printf.h"
#include "quake.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64olib.h"
+#include "z64play.h"
typedef struct QuakeRequest {
/* 0x00 */ s16 index;
diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c
index 8f0f61ed34..6228b51cf1 100644
--- a/src/code/z_rcp.c
+++ b/src/code/z_rcp.c
@@ -1,4 +1,11 @@
-#include "global.h"
+#include "buffers.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "gfxalloc.h"
+#include "letterbox.h"
+#include "main.h"
+#include "regs.h"
+#include "z64play.h"
Gfx sSetupDL[SETUPDL_MAX][6] = {
{
diff --git a/src/code/z_room.c b/src/code/z_room.c
index 0c5d37f551..7bc9e4801d 100644
--- a/src/code/z_room.c
+++ b/src/code/z_room.c
@@ -1,11 +1,30 @@
-#include "global.h"
+#include "libu64/debug.h"
+#include "ultra64/gs2dex.h"
+#include "array_count.h"
+#include "buffers.h"
#include "fault.h"
-#include "terminal.h"
-#include "versions.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "jpeg.h"
#include "line_numbers.h"
+#include "map.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "sys_ucode.h"
+#include "terminal.h"
+#include "translation.h"
+#include "versions.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64room.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f };
@@ -48,14 +67,14 @@ void Room_DrawNormal(PlayState* play, Room* room, u32 flags) {
func_800342EC(&D_801270A0, play);
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
func_80093C80(play);
- gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_OPA_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
if (flags & ROOM_DRAW_XLU) {
func_8003435C(&D_801270A0, play);
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
roomShape = &room->roomShape->normal;
@@ -122,7 +141,7 @@ void Room_DrawCullable(PlayState* play, Room* room, u32 flags) {
func_800342EC(&D_801270A0, play);
gSPSegment(POLY_OPA_DISP++, 0x03, room->segment);
func_80093C80(play);
- gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_OPA_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
if (1) {}
@@ -131,7 +150,7 @@ void Room_DrawCullable(PlayState* play, Room* room, u32 flags) {
func_8003435C(&D_801270A0, play);
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
roomShape = &room->roomShape->cullable;
@@ -390,7 +409,7 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) {
if (drawOpa) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
- gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_OPA_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, entry->opa);
}
@@ -421,7 +440,7 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) {
if (drawXlu) {
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, entry->xlu);
}
@@ -499,7 +518,7 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) {
if (drawOpa) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
- gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_OPA_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, dListsEntry->opa);
}
@@ -530,7 +549,7 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) {
if (drawXlu) {
gSPSegment(POLY_XLU_DISP++, 0x03, room->segment);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, dListsEntry->xlu);
}
@@ -697,7 +716,7 @@ s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx) {
if (osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) {
roomCtx->status = 0;
roomCtx->curRoom.segment = roomCtx->roomRequestAddr;
- gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->curRoom.segment);
+ gSegments[3] = OS_K0_TO_PHYSICAL(roomCtx->curRoom.segment);
Scene_ExecuteCommands(play, roomCtx->curRoom.segment);
Player_SetBootData(play, GET_PLAYER(play));
@@ -712,7 +731,7 @@ s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx) {
void Room_Draw(PlayState* play, Room* room, u32 flags) {
if (room->segment != NULL) {
- gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
+ gSegments[3] = OS_K0_TO_PHYSICAL(room->segment);
ASSERT(room->roomShape->base.type < ARRAY_COUNTU(sRoomDrawHandlers),
"this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
sRoomDrawHandlers[room->roomShape->base.type](play, room, flags);
diff --git a/src/code/z_rumble.c b/src/code/z_rumble.c
index 49a54e7aab..fc811cfccb 100644
--- a/src/code/z_rumble.c
+++ b/src/code/z_rumble.c
@@ -11,8 +11,11 @@
*
* @note Original filename is likely z_vibrate.c or similar as it is ordered after z_ss_sram.c and before z_view.c
*/
-#include "global.h"
+#include "rumble.h"
+#include "padmgr.h"
+#include "z64math.h"
+static s32 sUnused[4];
RumbleMgr sRumbleMgr;
/**
diff --git a/src/code/z_sample.c b/src/code/z_sample.c
index 541771432b..63e0836bbc 100644
--- a/src/code/z_sample.c
+++ b/src/code/z_sample.c
@@ -1,4 +1,11 @@
-#include "global.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "controller.h"
+#include "regs.h"
+#include "sample_state.h"
+#include "segment_symbols.h"
+#include "z64dma.h"
+#include "z64play.h"
void Sample_HandleStateChange(SampleState* this) {
if (CHECK_BTN_ALL(this->state.input[0].press.button, BTN_START)) {
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index e285587d90..feef5ffc62 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -1,6 +1,20 @@
-#include "global.h"
+#include "array_count.h"
+#include "avoid_ub.h"
+#include "printf.h"
+#include "regs.h"
+#include "romfile.h"
+#include "seqcmd.h"
+#include "segment_symbols.h"
+#include "segmented_address.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
+#include "z_actor_dlftbls.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64scene.h"
SceneCmdHandlerFunc sSceneCmdHandlers[SCENE_CMD_ID_MAX];
RomFile sNaviQuestHintFiles[];
@@ -96,7 +110,7 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) {
objectCtx->spaceEnd = (void*)((uintptr_t)objectCtx->spaceStart + spaceSize);
objectCtx->mainKeepSlot = Object_SpawnPersistent(objectCtx, OBJECT_GAMEPLAY_KEEP);
- gSegments[4] = VIRTUAL_TO_PHYSICAL(objectCtx->slots[objectCtx->mainKeepSlot].segment);
+ gSegments[4] = OS_K0_TO_PHYSICAL(objectCtx->slots[objectCtx->mainKeepSlot].segment);
}
void Object_UpdateEntries(ObjectContext* objectCtx) {
@@ -252,7 +266,7 @@ BAD_RETURN(s32) Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
BAD_RETURN(s32) Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
if (cmd->specialFiles.keepObjectId != OBJECT_INVALID) {
play->objectCtx.subKeepSlot = Object_SpawnPersistent(&play->objectCtx, cmd->specialFiles.keepObjectId);
- gSegments[5] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[play->objectCtx.subKeepSlot].segment);
+ gSegments[5] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[play->objectCtx.subKeepSlot].segment);
}
if (cmd->specialFiles.naviQuestHintFileId != NAVI_QUEST_HINTS_NONE) {
diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c
index a6a08ccd16..5e096a262e 100644
--- a/src/code/z_scene_table.c
+++ b/src/code/z_scene_table.c
@@ -1,10 +1,20 @@
-#include "global.h"
-#include "quake.h"
-#include "versions.h"
-#include "z64frame_advance.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "quake.h"
+#include "regs.h"
+#include "segment_symbols.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "versions.h"
+#include "z_lib.h"
+#include "z64frame_advance.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#include "assets/scenes/indoors/miharigoya/miharigoya_scene.h"
#include "assets/scenes/indoors/souko/souko_scene.h"
diff --git a/src/code/z_sfx_source.c b/src/code/z_sfx_source.c
index 1dad386594..785afcde35 100644
--- a/src/code/z_sfx_source.c
+++ b/src/code/z_sfx_source.c
@@ -1,6 +1,9 @@
#include "z64sfx_source.h"
-#include "global.h"
+#include "array_count.h"
+#include "sfx.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
void SfxSource_InitAll(PlayState* play) {
SfxSource* sources = &play->sfxSources[0];
diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c
index 49502f4ec9..4e4fd97e9a 100644
--- a/src/code/z_skelanime.c
+++ b/src/code/z_skelanime.c
@@ -1,5 +1,18 @@
-#include "global.h"
+#include "libu64/debug.h"
+#include "avoid_ub.h"
+#include "gfx.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "segment_symbols.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "zelda_arena.h"
+#include "z64animation.h"
+#include "z64animation_legacy.h"
+#include "z64play.h"
#define ANIM_INTERP 1
diff --git a/src/code/z_skin.c b/src/code/z_skin.c
index 55af9b1e2d..7861acb897 100644
--- a/src/code/z_skin.c
+++ b/src/code/z_skin.c
@@ -1,12 +1,13 @@
-#include "global.h"
-
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "pal-1.1:128"
+#include "gfx.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64math.h"
+#include "z64play.h"
+#include "z64skin.h"
+#include "z64skin_matrix.h"
MtxF gSkinLimbMatrices[60]; // holds matrices for each limb of the skeleton currently being drawn
-static s32 sUnused;
-
void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* modifEntry, Vtx* vtxBuf, Vec3f* pos) {
Vtx* vtx;
SkinVertex* vertexEntry;
@@ -207,7 +208,7 @@ void Skin_DrawImpl(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postD
skeleton = SEGMENTED_TO_VIRTUAL(skin->skeletonHeader->segment);
if (!(drawFlags & SKIN_DRAW_FLAG_CUSTOM_MATRIX)) {
- gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_OPA_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &skin->mtx);
if (mtx == NULL) {
diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c
index 55633bc872..196ce9aae4 100644
--- a/src/code/z_skin_awb.c
+++ b/src/code/z_skin_awb.c
@@ -1,4 +1,11 @@
-#include "global.h"
+#include "array_count.h"
+#include "segmented_address.h"
+#include "zelda_arena.h"
+#include "z64actor.h"
+#include "z64play.h"
+#include "z64skin.h"
+#include "z64skin_matrix.h"
+
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
/**
diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c
index 689fe67107..36d7a02791 100644
--- a/src/code/z_skin_matrix.c
+++ b/src/code/z_skin_matrix.c
@@ -1,5 +1,10 @@
-#include "global.h"
+#include "z64skin_matrix.h"
+
+#include "gfx.h"
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
// clang-format off
MtxF sMtxFClear = {
diff --git a/src/code/z_sram.c b/src/code/z_sram.c
index 0531e29952..2eef6db036 100644
--- a/src/code/z_sram.c
+++ b/src/code/z_sram.c
@@ -1,6 +1,21 @@
-#include "global.h"
+#include "z64sram.h"
+
+#include "array_count.h"
+#include "file_select_state.h"
+#include "controller.h"
+#include "memory_utils.h"
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
+#include "z64audio.h"
+#include "z64game.h"
+#include "z64interface.h"
+#include "z64message.h"
+#include "z64ocarina.h"
+#include "z64save.h"
+#include "z64scene.h"
+#include "z64ss_sram.h"
#define SLOT_SIZE (sizeof(SaveContext) + 0x28)
#define CHECKSUM_SIZE (sizeof(Save) / 2)
@@ -52,10 +67,13 @@ u16 gSramSlotOffsets[] = {
};
static u8 sSramDefaultHeader[] = {
- // TODO: use enums for these
- 0, // SRAM_HEADER_SOUND
- 0, // SRAM_HEADER_ZTARGET
- 0, // SRAM_HEADER_LANGUAGE
+ SOUND_SETTING_STEREO, // SRAM_HEADER_SOUND
+ Z_TARGET_SETTING_SWITCH, // SRAM_HEADER_Z_TARGET
+#if OOT_NTSC
+ LANGUAGE_JPN, // SRAM_HEADER_LANGUAGE
+#else
+ LANGUAGE_ENG, // SRAM_HEADER_LANGUAGE
+#endif
// SRAM_HEADER_MAGIC
0x98,
@@ -1016,8 +1034,8 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
}
}
- gSaveContext.audioSetting = sramCtx->readBuff[SRAM_HEADER_SOUND] & 3;
- gSaveContext.zTargetSetting = sramCtx->readBuff[SRAM_HEADER_ZTARGET] & 1;
+ gSaveContext.soundSetting = sramCtx->readBuff[SRAM_HEADER_SOUND] & 3;
+ gSaveContext.zTargetSetting = sramCtx->readBuff[SRAM_HEADER_Z_TARGET] & 1;
#if OOT_PAL
gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE];
@@ -1042,11 +1060,11 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
PRINTF(T("GOOD!GOOD! サイズ=%d + %d = %d\n", "GOOD! GOOD! Size = %d + %d = %d\n"), sizeof(SaveInfo), 4,
sizeof(SaveInfo) + 4);
PRINTF_COLOR_BLUE();
- PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);
- PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);
- PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);
+ PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting);
+ PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting);
+ PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting);
PRINTF_RST();
- func_800F6700(gSaveContext.audioSetting);
+ Audio_SetSoundOutputMode(gSaveContext.soundSetting);
}
void Sram_Alloc(GameState* gameState, SramContext* sramCtx) {
@@ -1054,5 +1072,5 @@ void Sram_Alloc(GameState* gameState, SramContext* sramCtx) {
ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295);
}
-void Sram_Init(PlayState* play, SramContext* sramCtx) {
+void Sram_Init(GameState* gameState, SramContext* sramCtx) {
}
diff --git a/src/code/z_ss_sram.c b/src/code/z_ss_sram.c
index dd26d695cb..94e97639aa 100644
--- a/src/code/z_ss_sram.c
+++ b/src/code/z_ss_sram.c
@@ -1,5 +1,6 @@
#include "ultra64.h"
-#include "global.h"
+#include "printf.h"
+#include "z64ss_sram.h"
typedef struct SsSramContext {
/* 0x00 */ OSPiHandle piHandle;
diff --git a/src/code/z_view.c b/src/code/z_view.c
index 5b68f00bf4..6fe82aaeb3 100644
--- a/src/code/z_view.c
+++ b/src/code/z_view.c
@@ -1,5 +1,16 @@
-#include "global.h"
+#include "z64view.h"
+
+#include "libc64/malloc.h"
+#include "libu64/debug.h"
+#include "avoid_ub.h"
+#include "gfx.h"
+#include "letterbox.h"
+#include "main.h"
+#include "printf.h"
+#include "regs.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
vu32 sLogOnNextViewInit = true;
diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c
index 0d2f5716fa..6eceeaa7e7 100644
--- a/src/code/z_vimode.c
+++ b/src/code/z_vimode.c
@@ -1,5 +1,12 @@
-#include "global.h"
+#include "vi_mode.h"
+
+#include "libu64/debug.h"
#include "ultra64/viint.h"
+#include "controller.h"
+#include "gfx.h"
+#include "main.h"
+#include "printf.h"
+#include "regs.h"
#include "versions.h"
void ViMode_LogPrint(OSViMode* osViMode) {
diff --git a/src/code/z_viscvg.c b/src/code/z_viscvg.c
index 9caf39a3f8..51fc6f8e5d 100644
--- a/src/code/z_viscvg.c
+++ b/src/code/z_viscvg.c
@@ -20,7 +20,8 @@
* before the filter is applied.
*/
-#include "global.h"
+#include "gfx.h"
+#include "z64vis.h"
/**
* Draws only coverage: does not retain any of the original pixel RGB, primColor is used as background color.
diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c
index aac4fa84f9..517f2ada60 100644
--- a/src/code/z_vismono.c
+++ b/src/code/z_vismono.c
@@ -8,7 +8,12 @@
* comments.
*/
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libu64/debug.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfxalloc.h"
+#include "z64vis.h"
// Height of the fragments the color frame buffer (CFB) is split into.
// It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into
diff --git a/src/code/z_viszbuf.c b/src/code/z_viszbuf.c
index 5a542bc124..431d7f6d9a 100644
--- a/src/code/z_viszbuf.c
+++ b/src/code/z_viszbuf.c
@@ -32,7 +32,8 @@
* again ignored by the RenderMode.
*/
-#include "global.h"
+#include "gfx.h"
+#include "z64vis.h"
// Height of the fragments the z-buffer is split into.
// It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into TMEM.
diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c
index 2e7953362b..2fa2122acf 100644
--- a/src/code/z_vr_box.c
+++ b/src/code/z_vr_box.c
@@ -1,6 +1,14 @@
-#include "global.h"
+#include "z64skybox.h"
+
+#include "array_count.h"
+#include "printf.h"
+#include "segment_symbols.h"
#include "terminal.h"
+#include "ultra64.h"
#include "z64environment.h"
+#include "z64game.h"
+#include "z64play.h"
+#include "z64save.h"
typedef struct SkyboxFaceParams {
/* 0x000 */ s32 xStart;
diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c
index 45e3237deb..aa7fa1dae0 100644
--- a/src/code/z_vr_box_draw.c
+++ b/src/code/z_vr_box_draw.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z64skybox.h"
Mtx* sSkyboxDrawMatrix;
diff --git a/src/elf_message/elf_message_field.c b/src/elf_message/elf_message_field.c
index 505649afda..8c672ad50b 100644
--- a/src/elf_message/elf_message_field.c
+++ b/src/elf_message/elf_message_field.c
@@ -1,5 +1,5 @@
-#include "global.h"
#include "z64quest_hint_commands.h"
+#include "z64save.h"
QuestHintCmd gOverworldNaviQuestHints[] = {
QUEST_HINT_FLAG(CHECK, EVENTCHKINF_05, false, 0x40),
diff --git a/src/elf_message/elf_message_ydan.c b/src/elf_message/elf_message_ydan.c
index 21b5fe89fa..cde6410b22 100644
--- a/src/elf_message/elf_message_ydan.c
+++ b/src/elf_message/elf_message_ydan.c
@@ -1,4 +1,3 @@
-#include "global.h"
#include "z64quest_hint_commands.h"
QuestHintCmd gDungeonNaviQuestHints[] = {
diff --git a/src/gcc_fix/missing_gcc_functions.c b/src/gcc_fix/missing_gcc_functions.c
index 76bf8e9db6..615dd23549 100644
--- a/src/gcc_fix/missing_gcc_functions.c
+++ b/src/gcc_fix/missing_gcc_functions.c
@@ -5,7 +5,7 @@
/* This file is NOT a part of the original game and only exists to help gcc work. */
/* --------------------------------------------------------------------------------*/
-#include "global.h"
+#include "ultra64.h"
// Self-hosted libc memory functions, gcc assumes these exist even in a freestanding
// environment and there is no way to tell it otherwise.
diff --git a/src/libc/absf.s b/src/libc/fabsf.s
similarity index 82%
rename from src/libc/absf.s
rename to src/libc/fabsf.s
index 58450e7791..6f27b4ca1b 100644
--- a/src/libc/absf.s
+++ b/src/libc/fabsf.s
@@ -3,7 +3,7 @@
.text
-LEAF(absf)
+LEAF(fabsf)
abs.s fv0, fa0
jr ra
-END(absf)
+END(fabsf)
diff --git a/src/libc64/__osMalloc_gc.c b/src/libc64/__osMalloc_gc.c
index 025c21bff9..d6e4e17d13 100644
--- a/src/libc64/__osMalloc_gc.c
+++ b/src/libc64/__osMalloc_gc.c
@@ -1,7 +1,10 @@
-#include "global.h"
-#include "fault.h"
#include "libc64/os_malloc.h"
+
+#include "alignment.h"
+#include "fault.h"
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
#define FILL_ALLOC_BLOCK_FLAG (1 << 0)
#define FILL_FREE_BLOCK_FLAG (1 << 1)
diff --git a/src/libc64/__osMalloc_n64.c b/src/libc64/__osMalloc_n64.c
index 56996feac9..6b81212963 100644
--- a/src/libc64/__osMalloc_n64.c
+++ b/src/libc64/__osMalloc_n64.c
@@ -1,7 +1,9 @@
-#include "global.h"
-#include "fault.h"
#include "libc64/os_malloc.h"
+#include "alignment.h"
+#include "fault.h"
+#include "translation.h"
+
#define NODE_MAGIC 0x7373
#define NODE_IS_VALID(node) ((node)->magic == NODE_MAGIC)
diff --git a/src/libc64/malloc.c b/src/libc64/malloc.c
index f7a642ce9d..8b9c9b6705 100644
--- a/src/libc64/malloc.c
+++ b/src/libc64/malloc.c
@@ -1,7 +1,9 @@
#include "libc64/malloc.h"
-#include "ultra64.h"
-#include "macros.h"
+
#include "libc64/os_malloc.h"
+#include "printf.h"
+#include "translation.h"
+#include "ultra64.h"
#define LOG_SEVERITY_NOLOG 0
#define LOG_SEVERITY_ERROR 2
diff --git a/src/libc64/math64.c b/src/libc64/math64.c
index 85fb4cedf3..b51eb333ed 100644
--- a/src/libc64/math64.c
+++ b/src/libc64/math64.c
@@ -1,5 +1,5 @@
+#include "libc64/math64.h"
#include "z64math.h"
-#include "macros.h"
#if !PLATFORM_N64
s32 gUseAtanContFrac;
diff --git a/src/libc64/sleep.c b/src/libc64/sleep.c
index 2b67088a1b..17fd3b1e24 100644
--- a/src/libc64/sleep.c
+++ b/src/libc64/sleep.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void Sleep_Cycles(OSTime cycles) {
OSMesgQueue mq;
diff --git a/src/libleo/api/bytetolba.c b/src/libleo/api/bytetolba.c
index 9b28baf2f1..9b25ac840f 100644
--- a/src/libleo/api/bytetolba.c
+++ b/src/libleo/api/bytetolba.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/api/cacreateleomanager.c b/src/libleo/api/cacreateleomanager.c
index fc3235c08c..d4f6f5100b 100644
--- a/src/libleo/api/cacreateleomanager.c
+++ b/src/libleo/api/cacreateleomanager.c
@@ -1,9 +1,11 @@
-#include "global.h"
#include "ultra64/asm.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
#include "libc/stdint.h"
+#include "attributes.h"
+
+#include "ultra64.h"
s32 LeoCACreateLeoManager(s32 comPri, s32 intPri, OSMesg* cmdBuf, s32 cmdMsgCnt) {
OSPiHandle* driveRomHandle;
diff --git a/src/libleo/api/cjcreateleomanager.c b/src/libleo/api/cjcreateleomanager.c
index 26ced4f7db..23f9da8226 100644
--- a/src/libleo/api/cjcreateleomanager.c
+++ b/src/libleo/api/cjcreateleomanager.c
@@ -1,9 +1,11 @@
-#include "global.h"
#include "ultra64/asm.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
#include "libc/stdint.h"
+#include "attributes.h"
+
+#include "ultra64.h"
s32 LeoCJCreateLeoManager(s32 comPri, s32 intPri, OSMesg* cmdBuf, s32 cmdMsgCnt) {
OSPiHandle* driveRomHandle;
diff --git a/src/libleo/api/clearqueue.c b/src/libleo/api/clearqueue.c
index ed5b623280..1972b6080f 100644
--- a/src/libleo/api/clearqueue.c
+++ b/src/libleo/api/clearqueue.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/api/driveexist.c b/src/libleo/api/driveexist.c
index 314a67064e..f658817a3d 100644
--- a/src/libleo/api/driveexist.c
+++ b/src/libleo/api/driveexist.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/api/lbatobyte.c b/src/libleo/api/lbatobyte.c
index dc5b1f5dbe..e260fced18 100644
--- a/src/libleo/api/lbatobyte.c
+++ b/src/libleo/api/lbatobyte.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/api/readwrite.c b/src/libleo/api/readwrite.c
index a4c27d26f9..570b94b203 100644
--- a/src/libleo/api/readwrite.c
+++ b/src/libleo/api/readwrite.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/api/seek.c b/src/libleo/api/seek.c
index dbbc4651ac..8abbb0f0a5 100644
--- a/src/libleo/api/seek.c
+++ b/src/libleo/api/seek.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/api/spdlmotor.c b/src/libleo/api/spdlmotor.c
index 8c0ffa9ffa..21ef2b0223 100644
--- a/src/libleo/api/spdlmotor.c
+++ b/src/libleo/api/spdlmotor.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/api/testunitready.c b/src/libleo/api/testunitready.c
index f5770f86b7..2116bc9e2a 100644
--- a/src/libleo/api/testunitready.c
+++ b/src/libleo/api/testunitready.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leo_tbl.c b/src/libleo/leo/leo_tbl.c
index f4093fbd53..083fabb728 100644
--- a/src/libleo/leo/leo_tbl.c
+++ b/src/libleo/leo/leo_tbl.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoc2ecc.c b/src/libleo/leo/leoc2ecc.c
index 4d268df51b..5b770b138d 100644
--- a/src/libleo/leo/leoc2ecc.c
+++ b/src/libleo/leo/leoc2ecc.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leocmdex.c b/src/libleo/leo/leocmdex.c
index ca3101fb0a..d7887d4944 100644
--- a/src/libleo/leo/leocmdex.c
+++ b/src/libleo/leo/leocmdex.c
@@ -1,7 +1,9 @@
-#include "global.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
+#include "attributes.h"
+
+#include "ultra64.h"
extern vu16 LEOrw_flags;
diff --git a/src/libleo/leo/leodiskinit.c b/src/libleo/leo/leodiskinit.c
index 6c11f728e2..92020029ea 100644
--- a/src/libleo/leo/leodiskinit.c
+++ b/src/libleo/leo/leodiskinit.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leofunc.c b/src/libleo/leo/leofunc.c
index 20809e55f6..35ba14005f 100644
--- a/src/libleo/leo/leofunc.c
+++ b/src/libleo/leo/leofunc.c
@@ -1,7 +1,8 @@
-#include "global.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
+#include "array_count.h"
+#include "ultra64.h"
static s32 __leoResetCalled = false;
static s32 __leoQueuesCreated = false;
diff --git a/src/libleo/leo/leoglobals.c b/src/libleo/leo/leoglobals.c
index ca11ec6c4e..28a99f626d 100644
--- a/src/libleo/leo/leoglobals.c
+++ b/src/libleo/leo/leoglobals.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoinquiry.c b/src/libleo/leo/leoinquiry.c
index cfa4f1c27f..b23a9ab454 100644
--- a/src/libleo/leo/leoinquiry.c
+++ b/src/libleo/leo/leoinquiry.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoint.c b/src/libleo/leo/leoint.c
index f337b15080..33ac3d2010 100644
--- a/src/libleo/leo/leoint.c
+++ b/src/libleo/leo/leoint.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leointerrupt.c b/src/libleo/leo/leointerrupt.c
index d9e2175ad3..fc547cfd5c 100644
--- a/src/libleo/leo/leointerrupt.c
+++ b/src/libleo/leo/leointerrupt.c
@@ -1,11 +1,11 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
#include "ultra64/internal.h"
extern OSThread* __osRunQueue;
-extern OSHWIntr __OSGlobalIntMask;
+extern OSIntMask __OSGlobalIntMask;
void __osLeoAbnormalResume(void);
void __osLeoResume(void);
diff --git a/src/libleo/leo/leomecha.c b/src/libleo/leo/leomecha.c
index da141616c8..d0804f033c 100644
--- a/src/libleo/leo/leomecha.c
+++ b/src/libleo/leo/leomecha.c
@@ -1,7 +1,9 @@
-#include "global.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
+#include "attributes.h"
+
+#include "ultra64.h"
extern s32 currentCommand;
diff --git a/src/libleo/leo/leomode_sel.c b/src/libleo/leo/leomode_sel.c
index cd45fd8350..fe36bc16af 100644
--- a/src/libleo/leo/leomode_sel.c
+++ b/src/libleo/leo/leomode_sel.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leomotor.c b/src/libleo/leo/leomotor.c
index 251ac2a95b..652b626ee0 100644
--- a/src/libleo/leo/leomotor.c
+++ b/src/libleo/leo/leomotor.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leomseq_tbl.c b/src/libleo/leo/leomseq_tbl.c
index 4944e63336..f94979f623 100644
--- a/src/libleo/leo/leomseq_tbl.c
+++ b/src/libleo/leo/leomseq_tbl.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoram.c b/src/libleo/leo/leoram.c
index 7600632482..159aaaae27 100644
--- a/src/libleo/leo/leoram.c
+++ b/src/libleo/leo/leoram.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leord_capa.c b/src/libleo/leo/leord_capa.c
index d060a64936..86b71ac903 100644
--- a/src/libleo/leo/leord_capa.c
+++ b/src/libleo/leo/leord_capa.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leord_diskid.c b/src/libleo/leo/leord_diskid.c
index fde59bcc9c..df4d6bf24b 100644
--- a/src/libleo/leo/leord_diskid.c
+++ b/src/libleo/leo/leord_diskid.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoread.c b/src/libleo/leo/leoread.c
index 62017cd159..11dc28c41c 100644
--- a/src/libleo/leo/leoread.c
+++ b/src/libleo/leo/leoread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoreset.c b/src/libleo/leo/leoreset.c
index ff6e0f9439..40eb56482c 100644
--- a/src/libleo/leo/leoreset.c
+++ b/src/libleo/leo/leoreset.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leorezero.c b/src/libleo/leo/leorezero.c
index 73b58df765..9e28bf13a3 100644
--- a/src/libleo/leo/leorezero.c
+++ b/src/libleo/leo/leorezero.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoseek.c b/src/libleo/leo/leoseek.c
index 566866255e..2f530ac726 100644
--- a/src/libleo/leo/leoseek.c
+++ b/src/libleo/leo/leoseek.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leotestunit.c b/src/libleo/leo/leotestunit.c
index a6a6dbdb62..4c81d7970a 100644
--- a/src/libleo/leo/leotestunit.c
+++ b/src/libleo/leo/leotestunit.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leotimer.c b/src/libleo/leo/leotimer.c
index aadfc3b828..f6c7fdfc05 100644
--- a/src/libleo/leo/leotimer.c
+++ b/src/libleo/leo/leotimer.c
@@ -1,7 +1,9 @@
-#include "global.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
+#include "attributes.h"
+
+#include "ultra64.h"
typedef struct {
/* 0x0 */ u8 year;
diff --git a/src/libleo/leo/leotranslat.c b/src/libleo/leo/leotranslat.c
index 1f297a792b..6eb2011367 100644
--- a/src/libleo/leo/leotranslat.c
+++ b/src/libleo/leo/leotranslat.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libleo/leo/leoutil.c b/src/libleo/leo/leoutil.c
index 08f88938cf..e90ea1f678 100644
--- a/src/libleo/leo/leoutil.c
+++ b/src/libleo/leo/leoutil.c
@@ -1,7 +1,8 @@
-#include "global.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
+#include "array_count.h"
+#include "ultra64.h"
u16 leoLba_to_phys(u32 lba) {
u16 vzone_num;
diff --git a/src/libleo/leo/leowrite.c b/src/libleo/leo/leowrite.c
index deeafc9ad8..91b2163f0b 100644
--- a/src/libleo/leo/leowrite.c
+++ b/src/libleo/leo/leowrite.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"
diff --git a/src/libu64/debug.c b/src/libu64/debug.c
index 80be25f9d0..e1ed15fe45 100644
--- a/src/libu64/debug.c
+++ b/src/libu64/debug.c
@@ -1,6 +1,7 @@
-#include "global.h"
#include "fault.h"
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
#if PLATFORM_N64 || DEBUG_FEATURES
f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min,
diff --git a/src/libu64/gfxprint.c b/src/libu64/gfxprint.c
index b3ebfcd0ef..c47d52a3a5 100644
--- a/src/libu64/gfxprint.c
+++ b/src/libu64/gfxprint.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "libc64/aprintf.h"
+#include "libu64/gfxprint.h"
+#include "attributes.h"
+#include "translation.h"
u16 sGfxPrintFontTLUT[64] = {
0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000,
diff --git a/src/libu64/load_gc.c b/src/libu64/load_gc.c
index 39662cbcef..340780a130 100644
--- a/src/libu64/load_gc.c
+++ b/src/libu64/load_gc.c
@@ -1,4 +1,8 @@
-#include "global.h"
+#include "libu64/overlay.h"
+#include "ultra64.h"
+#include "printf.h"
+#include "translation.h"
+#include "z64dma.h"
size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) {
s32 pad[3];
diff --git a/src/libu64/loadfragment2_gc.c b/src/libu64/loadfragment2_gc.c
index 6befb8c9b9..5ad556e506 100644
--- a/src/libu64/loadfragment2_gc.c
+++ b/src/libu64/loadfragment2_gc.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libu64/overlay.h"
+#include "printf.h"
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) {
void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31);
diff --git a/src/libu64/loadfragment2_n64.c b/src/libu64/loadfragment2_n64.c
index 6a06b1ba09..be0e5295d9 100644
--- a/src/libu64/loadfragment2_n64.c
+++ b/src/libu64/loadfragment2_n64.c
@@ -6,7 +6,10 @@
*
* @see Overlay_Relocate
*/
-#include "global.h"
+#include "libc64/malloc.h"
+#include "libu64/overlay.h"
+#include "translation.h"
+#include "z64dma.h"
s32 gOverlayLogSeverity = 2;
diff --git a/src/libu64/logseverity_gc.c b/src/libu64/logseverity_gc.c
index 940aa87cc8..50c2eb4ab8 100644
--- a/src/libu64/logseverity_gc.c
+++ b/src/libu64/logseverity_gc.c
@@ -1,3 +1,3 @@
-#include "global.h"
+#include "libu64/overlay.h"
s32 gOverlayLogSeverity = 2;
diff --git a/src/libu64/mtxuty-cvt.c b/src/libu64/mtxuty-cvt.c
index 10f88f7827..759c686d95 100644
--- a/src/libu64/mtxuty-cvt.c
+++ b/src/libu64/mtxuty-cvt.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "ultra64.h"
+#include "libu64/debug.h"
+#include "libu64/mtxuty-cvt.h"
void MtxConv_F2L(Mtx* m1, MtxF* m2) {
s32 i;
diff --git a/src/libu64/padsetup.c b/src/libu64/padsetup.c
index 86f38c0adf..fde25418f6 100644
--- a/src/libu64/padsetup.c
+++ b/src/libu64/padsetup.c
@@ -1,4 +1,5 @@
#include "ultra64.h"
+#include "libu64/padsetup.h"
s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status) {
s32 ret;
diff --git a/src/libu64/rcp_utils.c b/src/libu64/rcp_utils.c
index 420ac51f98..27e929f7d1 100644
--- a/src/libu64/rcp_utils.c
+++ b/src/libu64/rcp_utils.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "libu64/rcp_utils.h"
+#include "ultra64.h"
+#include "printf.h"
#if PLATFORM_N64 || DEBUG_FEATURES
#define RCP_UTILS_PRINTF osSyncPrintf
@@ -55,9 +57,12 @@ void RcpUtils_PrintRegisterStatus(void) {
void RcpUtils_Reset(void) {
RcpUtils_PrintRegisterStatus();
+
// Flush the RDP pipeline and freeze clock counter
osDpSetStatus(DPC_SET_FREEZE | DPC_SET_FLUSH);
+
// Halt the RSP, disable interrupt on break and set "task done" signal
__osSpSetStatus(SP_SET_HALT | SP_SET_TASKDONE | SP_CLR_INTR_BREAK);
+
RcpUtils_PrintRegisterStatus();
}
diff --git a/src/libu64/relocation_gc.c b/src/libu64/relocation_gc.c
index 1d2f3193da..91d7eaf790 100644
--- a/src/libu64/relocation_gc.c
+++ b/src/libu64/relocation_gc.c
@@ -6,7 +6,10 @@
*
* @see Overlay_Relocate
*/
-#include "global.h"
+#include "libu64/overlay.h"
+#include "attributes.h"
+#include "printf.h"
+#include "ultra64.h"
// Extract MIPS register rs from an instruction word
#define MIPS_REG_RS(insn) (((insn) >> 0x15) & 0x1F)
diff --git a/src/libu64/system_heap.c b/src/libu64/runtime.c
similarity index 75%
rename from src/libu64/system_heap.c
rename to src/libu64/runtime.c
index 1ae93e868c..aa0c507b7d 100644
--- a/src/libu64/system_heap.c
+++ b/src/libu64/runtime.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "libu64/runtime.h"
+
+#include "libc64/malloc.h"
#include "libc64/os_malloc.h"
typedef void (*arg3_800FC868)(void*);
@@ -6,13 +8,12 @@ typedef void (*arg3_800FC8D8)(void*, u32);
typedef void (*arg3_800FC948)(void*, u32, u32, u32, u32, u32, u32, u32, u32);
typedef void (*arg3_800FCA18)(void*, u32);
-typedef struct InitFunc {
+typedef struct CtorEntry {
s32 nextOffset;
void (*func)(void);
-} InitFunc;
+} CtorEntry;
-// .data
-void* sInitFuncs = NULL;
+void* sGlobalCtorEntries = NULL;
#if DEBUG_FEATURES
char sNew[] = "new";
@@ -20,8 +21,7 @@ char sNew[] = "new";
char sNew[] = "";
#endif
-// possibly some kind of new() function
-void* func_800FC800(u32 size) {
+void* Runtime_New(u32 size) {
DECLARE_INTERRUPT_MASK
void* ptr;
@@ -41,8 +41,7 @@ void* func_800FC800(u32 size) {
return ptr;
}
-// possibly some kind of delete() function
-void func_800FC83C(void* ptr) {
+void Runtime_Delete(void* ptr) {
DECLARE_INTERRUPT_MASK
DISABLE_INTERRUPTS();
@@ -81,7 +80,7 @@ void* func_800FC948(void* blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) {
DISABLE_INTERRUPTS();
if (blk == NULL) {
- blk = func_800FC800(nBlk * blkSize);
+ blk = Runtime_New(nBlk * blkSize);
}
if (blk != NULL && arg3 != NULL) {
@@ -115,39 +114,39 @@ void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg
}
if (arg4 != 0) {
- func_800FC83C(blk);
+ Runtime_Delete(blk);
}
}
RESTORE_INTERRUPTS();
}
-void func_800FCB34(void) {
- InitFunc* initFunc = (InitFunc*)&sInitFuncs;
- u32 nextOffset = initFunc->nextOffset;
- InitFunc* prev = NULL;
+void Runtime_ExecuteGlobalCtors(void) {
+ CtorEntry* ctorEntry = (CtorEntry*)&sGlobalCtorEntries;
+ u32 nextOffset = ctorEntry->nextOffset;
+ CtorEntry* prevEntry = NULL;
while (nextOffset != 0) {
- initFunc = (InitFunc*)((s32)initFunc + nextOffset);
+ ctorEntry = (CtorEntry*)((s32)ctorEntry + nextOffset);
- if (initFunc->func != NULL) {
- initFunc->func();
+ if (ctorEntry->func != NULL) {
+ ctorEntry->func();
}
- nextOffset = initFunc->nextOffset;
- initFunc->nextOffset = (s32)prev;
- prev = initFunc;
+ nextOffset = ctorEntry->nextOffset;
+ ctorEntry->nextOffset = (s32)prevEntry;
+ prevEntry = ctorEntry;
}
- sInitFuncs = prev;
+ sGlobalCtorEntries = prevEntry;
}
-void SystemHeap_Init(void* start, u32 size) {
+void Runtime_Init(void* start, u32 size) {
#if PLATFORM_N64
__osMallocInit(&gSystemArena, start, size);
#else
SystemArena_Init(start, size);
#endif
- func_800FCB34();
+ Runtime_ExecuteGlobalCtors();
}
diff --git a/src/libu64/stackcheck.c b/src/libu64/stackcheck.c
index 787eb1c3e5..69fe224ee8 100644
--- a/src/libu64/stackcheck.c
+++ b/src/libu64/stackcheck.c
@@ -1,5 +1,9 @@
-#include "global.h"
+#include "libu64/debug.h"
+#include "attributes.h"
+#include "printf.h"
+#include "stackcheck.h"
#include "terminal.h"
+#include "translation.h"
StackEntry* sStackInfoListStart = NULL;
StackEntry* sStackInfoListEnd = NULL;
diff --git a/src/libultra/gu/cosf.c b/src/libultra/gu/cosf.c
index 639084093f..f217eec13a 100644
--- a/src/libultra/gu/cosf.c
+++ b/src/libultra/gu/cosf.c
@@ -1,5 +1,5 @@
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h" // TODO: libultra should not have access to game-side headers
static const du P[] = {
{ 0x3FF00000, 0x00000000 }, { 0xBFC55554, 0xBC83656D }, { 0x3F8110ED, 0x3804C2A0 },
diff --git a/src/libultra/gu/lookat.c b/src/libultra/gu/lookat.c
index e1c7500cf1..8d1df6bbe1 100644
--- a/src/libultra/gu/lookat.c
+++ b/src/libultra/gu/lookat.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "ultra64.h"
+#include "z64math.h" // TODO: libultra should not have access to game-side headers
void guLookAtF(f32 mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp) {
f32 length;
diff --git a/src/libultra/gu/lookathil.c b/src/libultra/gu/lookathil.c
index e9cf650a6e..5d14e59aba 100644
--- a/src/libultra/gu/lookathil.c
+++ b/src/libultra/gu/lookathil.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#define FTOFRAC8(x) ((s32)MIN(((x) * (128.0f)), 127.0f) & 0xFF)
diff --git a/src/libultra/gu/mtxutil.c b/src/libultra/gu/mtxutil.c
index e9e327f740..a6a3defa00 100644
--- a/src/libultra/gu/mtxutil.c
+++ b/src/libultra/gu/mtxutil.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void guMtxF2L(f32 mf[4][4], Mtx* m) {
s32 i, j;
diff --git a/src/libultra/gu/normalize.c b/src/libultra/gu/normalize.c
index 6a0cac0200..8b20110c8c 100644
--- a/src/libultra/gu/normalize.c
+++ b/src/libultra/gu/normalize.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "ultra64.h"
+#include "z64math.h" // TODO: libultra should not have access to game-side headers
void guNormalize(f32* x, f32* y, f32* z) {
f32 m = 1 / sqrtf(SQ(*x) + SQ(*y) + SQ(*z));
diff --git a/src/libultra/gu/ortho.c b/src/libultra/gu/ortho.c
index 62b6d79503..4ed717acfd 100644
--- a/src/libultra/gu/ortho.c
+++ b/src/libultra/gu/ortho.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void guOrthoF(f32 mf[4][4], f32 left, f32 right, f32 bottom, f32 top, f32 near, f32 far, f32 scale) {
s32 i, j;
diff --git a/src/libultra/gu/perspective.c b/src/libultra/gu/perspective.c
index 3f700a814a..e7a6bad2f5 100644
--- a/src/libultra/gu/perspective.c
+++ b/src/libultra/gu/perspective.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) {
f32 yscale;
diff --git a/src/libultra/gu/position.c b/src/libultra/gu/position.c
index 1b9a3525b2..b016c29a7c 100644
--- a/src/libultra/gu/position.c
+++ b/src/libultra/gu/position.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
/**
* guPositionF
diff --git a/src/libultra/gu/rotate.c b/src/libultra/gu/rotate.c
index dc50aba3c5..3f068f9417 100644
--- a/src/libultra/gu/rotate.c
+++ b/src/libultra/gu/rotate.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) {
static f32 dtor = M_PI / 180.0f;
diff --git a/src/libultra/gu/scale.c b/src/libultra/gu/scale.c
index 525f2fb4c5..6bfcd98c30 100644
--- a/src/libultra/gu/scale.c
+++ b/src/libultra/gu/scale.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void guScaleF(f32 m[4][4], f32 x, f32 y, f32 z) {
guMtxIdentF(m);
diff --git a/src/libultra/gu/sinf.c b/src/libultra/gu/sinf.c
index 49929e8436..23013731c4 100644
--- a/src/libultra/gu/sinf.c
+++ b/src/libultra/gu/sinf.c
@@ -1,5 +1,5 @@
-#include "global.h"
#include "ultra64.h"
+#include "z64math.h" // TODO: libultra should not have access to game-side headers
static const du P[] = {
{ 0x3FF00000, 0x00000000 }, { 0xBFC55554, 0xBC83656D }, { 0x3F8110ED, 0x3804C2A0 },
diff --git a/src/libultra/gu/translate.c b/src/libultra/gu/translate.c
index 2753063d5d..9843890628 100644
--- a/src/libultra/gu/translate.c
+++ b/src/libultra/gu/translate.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void guTranslateF(f32 m[4][4], f32 x, f32 y, f32 z) {
guMtxIdentF(m);
diff --git a/src/libultra/gu/us2dex.c b/src/libultra/gu/us2dex.c
index b8708c086c..bb2f50ae82 100644
--- a/src/libultra/gu/us2dex.c
+++ b/src/libultra/gu/us2dex.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "ultra64/ultratypes.h"
+#include "ultra64/gbi.h"
+#include "ultra64/gs2dex.h"
void guS2DInitBg(uObjBg* bg) {
u16 tmem = (bg->b.imageFmt == G_IM_FMT_CI) ? 0x100 : 0x200;
diff --git a/src/libultra/io/aigetlen.c b/src/libultra/io/aigetlen.c
index 45be442516..5787f10e33 100644
--- a/src/libultra/io/aigetlen.c
+++ b/src/libultra/io/aigetlen.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
/**
* Returns the number of bytes remaining in a currently ongoing audio DMA.
diff --git a/src/libultra/io/aisetfreq.c b/src/libultra/io/aisetfreq.c
index 9e1b8c44e2..ce79191e11 100644
--- a/src/libultra/io/aisetfreq.c
+++ b/src/libultra/io/aisetfreq.c
@@ -1,4 +1,6 @@
-#include "global.h"
+#include "ultra64.h"
+
+extern s32 osViClock;
/**
* Programs the operating frequency of the Audio DAC.
diff --git a/src/libultra/io/cartrominit.c b/src/libultra/io/cartrominit.c
index b2cf1d1e17..22dd36e631 100644
--- a/src/libultra/io/cartrominit.c
+++ b/src/libultra/io/cartrominit.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSPiHandle __CartRomHandle;
diff --git a/src/libultra/io/contpfs.c b/src/libultra/io/contpfs.c
index 20b2ea63ff..0506ca5d5a 100644
--- a/src/libultra/io/contpfs.c
+++ b/src/libultra/io/contpfs.c
@@ -1,5 +1,5 @@
+#include "array_count.h"
#include "ultra64.h"
-#include "global.h"
s32 __osPfsInodeCacheChannel = -1;
u8 __osPfsInodeCacheBank = 250;
diff --git a/src/libultra/io/contquery.c b/src/libultra/io/contquery.c
index 9a8370af31..b90ea2ff68 100644
--- a/src/libultra/io/contquery.c
+++ b/src/libultra/io/contquery.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
/**
* osContStartQuery:
diff --git a/src/libultra/io/contramread.c b/src/libultra/io/contramread.c
index 01e0703da6..d631d2fb6a 100644
--- a/src/libultra/io/contramread.c
+++ b/src/libultra/io/contramread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#define BLOCKSIZE 32
diff --git a/src/libultra/io/contramwrite.c b/src/libultra/io/contramwrite.c
index 4bd8ffaa30..b71a3d48b1 100644
--- a/src/libultra/io/contramwrite.c
+++ b/src/libultra/io/contramwrite.c
@@ -1,5 +1,6 @@
#include "ultra64.h"
-#include "global.h"
+
+extern s32 __osPfsLastChannel;
s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force) {
#ifndef BBPLAYER
diff --git a/src/libultra/io/contreaddata.c b/src/libultra/io/contreaddata.c
index f1f250e965..bafb2ad40a 100644
--- a/src/libultra/io/contreaddata.c
+++ b/src/libultra/io/contreaddata.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "array_count.h"
+#include "ultra64.h"
s32 osContStartReadData(OSMesgQueue* mq) {
s32 ret;
diff --git a/src/libultra/io/controller.c b/src/libultra/io/controller.c
index 3a2dc9a172..588e2ae9ac 100644
--- a/src/libultra/io/controller.c
+++ b/src/libultra/io/controller.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "array_count.h"
+#include "ultra64.h"
OSPifRam __osContPifRam;
u8 __osContLastCmd;
diff --git a/src/libultra/io/contsetch.c b/src/libultra/io/contsetch.c
index 5ced5b6de4..c5002ce6ac 100644
--- a/src/libultra/io/contsetch.c
+++ b/src/libultra/io/contsetch.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
/*
* s32 osContSetCh(u8 ch)
diff --git a/src/libultra/io/crc.c b/src/libultra/io/crc.c
index c1af0b12c5..485b6c0f54 100644
--- a/src/libultra/io/crc.c
+++ b/src/libultra/io/crc.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
// Valid addr up to 0x7FF
// It's the address of a block of 0x20 bytes in the mempak
diff --git a/src/libultra/io/devmgr.c b/src/libultra/io/devmgr.c
index 05dcb99519..7eb3197f81 100644
--- a/src/libultra/io/devmgr.c
+++ b/src/libultra/io/devmgr.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/internal.h"
#include "ultra64/leodrive.h"
diff --git a/src/libultra/io/dpgetstat.c b/src/libultra/io/dpgetstat.c
index 1a944b2c7a..1dbf5e09b8 100644
--- a/src/libultra/io/dpgetstat.c
+++ b/src/libultra/io/dpgetstat.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
u32 osDpGetStatus(void) {
return IO_READ(DPC_STATUS_REG);
diff --git a/src/libultra/io/dpsetstat.c b/src/libultra/io/dpsetstat.c
index 4275e1fde6..cfaa644b8d 100644
--- a/src/libultra/io/dpsetstat.c
+++ b/src/libultra/io/dpsetstat.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osDpSetStatus(u32 status) {
IO_WRITE(DPC_STATUS_REG, status);
diff --git a/src/libultra/io/epidma.c b/src/libultra/io/epidma.c
index ca57a9d170..f2a073cb48 100644
--- a/src/libultra/io/epidma.c
+++ b/src/libultra/io/epidma.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/internal.h"
s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) {
diff --git a/src/libultra/io/epirawdma.c b/src/libultra/io/epirawdma.c
index dbc072fbb2..3f238dd3fc 100644
--- a/src/libultra/io/epirawdma.c
+++ b/src/libultra/io/epirawdma.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/bcp.h"
s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size) {
diff --git a/src/libultra/io/epirawread.c b/src/libultra/io/epirawread.c
index 41997df66d..77d558958c 100644
--- a/src/libultra/io/epirawread.c
+++ b/src/libultra/io/epirawread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data) {
s32 status;
diff --git a/src/libultra/io/epirawwrite.c b/src/libultra/io/epirawwrite.c
index 4d704a1923..d9b1377656 100644
--- a/src/libultra/io/epirawwrite.c
+++ b/src/libultra/io/epirawwrite.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) {
s32 status;
diff --git a/src/libultra/io/epiread.c b/src/libultra/io/epiread.c
index d05604a589..a102bbc7e0 100644
--- a/src/libultra/io/epiread.c
+++ b/src/libultra/io/epiread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data) {
register s32 ret;
diff --git a/src/libultra/io/epiwrite.c b/src/libultra/io/epiwrite.c
index 0547e69991..c06e71f7a8 100644
--- a/src/libultra/io/epiwrite.c
+++ b/src/libultra/io/epiwrite.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) {
register s32 ret;
diff --git a/src/libultra/io/motor.c b/src/libultra/io/motor.c
index 7350ef9210..78ce191b7b 100644
--- a/src/libultra/io/motor.c
+++ b/src/libultra/io/motor.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#define MOTOR_ID 0x80
diff --git a/src/libultra/io/pfsallocatefile.c b/src/libultra/io/pfsallocatefile.c
index c20531224e..10684cc736 100644
--- a/src/libultra/io/pfsallocatefile.c
+++ b/src/libultra/io/pfsallocatefile.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
#include "ultra64/pfs.h"
s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 fileSize, s32* fileNo) {
diff --git a/src/libultra/io/pfschecker.c b/src/libultra/io/pfschecker.c
index b0a94f1ad4..fddb150d53 100644
--- a/src/libultra/io/pfschecker.c
+++ b/src/libultra/io/pfschecker.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
#include "ultra64/pfs.h"
#define CHECK_IPAGE(p) \
diff --git a/src/libultra/io/pfsdeletefile.c b/src/libultra/io/pfsdeletefile.c
index 573af6a724..864dbd6b81 100644
--- a/src/libultra/io/pfsdeletefile.c
+++ b/src/libultra/io/pfsdeletefile.c
@@ -1,5 +1,5 @@
#include "ultra64/pfs.h"
-#include "global.h"
+#include "ultra64.h"
s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName) {
s32 file_no;
diff --git a/src/libultra/io/pfsfilestate.c b/src/libultra/io/pfsfilestate.c
index 367a7f27d6..489e4b300e 100644
--- a/src/libultra/io/pfsfilestate.c
+++ b/src/libultra/io/pfsfilestate.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state) {
s32 ret;
diff --git a/src/libultra/io/pfsfindfile.c b/src/libultra/io/pfsfindfile.c
index ad0bde885a..06e6d57f3f 100644
--- a/src/libultra/io/pfsfindfile.c
+++ b/src/libultra/io/pfsfindfile.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo) {
s32 j;
diff --git a/src/libultra/io/pfsfreeblocks.c b/src/libultra/io/pfsfreeblocks.c
index 7210c65815..6bf8678bc1 100644
--- a/src/libultra/io/pfsfreeblocks.c
+++ b/src/libultra/io/pfsfreeblocks.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
#include "ultra64/pfs.h"
s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes) {
diff --git a/src/libultra/io/pfsgetstatus.c b/src/libultra/io/pfsgetstatus.c
index aa9851e6e7..a6f09fa63b 100644
--- a/src/libultra/io/pfsgetstatus.c
+++ b/src/libultra/io/pfsgetstatus.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
s32 __osPfsGetStatus(OSMesgQueue* queue, s32 channel) {
#ifndef BBPLAYER
diff --git a/src/libultra/io/pfsinitpak.c b/src/libultra/io/pfsinitpak.c
index 59fb8eda9b..9e03188dca 100644
--- a/src/libultra/io/pfsinitpak.c
+++ b/src/libultra/io/pfsinitpak.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel) {
s32 ret;
diff --git a/src/libultra/io/pfsisplug.c b/src/libultra/io/pfsisplug.c
index 9a144d0cb5..faa0752172 100644
--- a/src/libultra/io/pfsisplug.c
+++ b/src/libultra/io/pfsisplug.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
OSPifRam __osPfsPifRam;
diff --git a/src/libultra/io/pfsreadwritefile.c b/src/libultra/io/pfsreadwritefile.c
index b2c78a7464..b2579839ff 100644
--- a/src/libultra/io/pfsreadwritefile.c
+++ b/src/libultra/io/pfsreadwritefile.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
#define CHECK_IPAGE(p, pfs) \
(((p).ipage >= (pfs).inodeStartPage) && ((p).inode_t.bank < (pfs).banks) && ((p).inode_t.page >= 0x01) && \
diff --git a/src/libultra/io/pfsselectbank.c b/src/libultra/io/pfsselectbank.c
index d257e04911..1c89138546 100644
--- a/src/libultra/io/pfsselectbank.c
+++ b/src/libultra/io/pfsselectbank.c
@@ -1,5 +1,5 @@
#include "ultra64/pfs.h"
-#include "global.h"
+#include "ultra64.h"
s32 __osPfsSelectBank(OSPfs* pfs, u8 bank) {
u8 temp[BLOCKSIZE];
diff --git a/src/libultra/io/piacs.c b/src/libultra/io/piacs.c
index cff131f690..84cc4246be 100644
--- a/src/libultra/io/piacs.c
+++ b/src/libultra/io/piacs.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "array_count.h"
+#include "ultra64.h"
u32 __osPiAccessQueueEnabled = false;
static OSMesg piAccessBuf[1];
diff --git a/src/libultra/io/pigetcmdq.c b/src/libultra/io/pigetcmdq.c
index 3f6f173580..c0de3d088b 100644
--- a/src/libultra/io/pigetcmdq.c
+++ b/src/libultra/io/pigetcmdq.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/internal.h"
OSMesgQueue* osPiGetCmdQueue(void) {
diff --git a/src/libultra/io/pimgr.c b/src/libultra/io/pimgr.c
index 6b006d7aa8..58f5def6e9 100644
--- a/src/libultra/io/pimgr.c
+++ b/src/libultra/io/pimgr.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "stack.h"
#include "ultra64/internal.h"
diff --git a/src/libultra/io/pirawdma.c b/src/libultra/io/pirawdma.c
index 84f809c9c9..20a0e18a9b 100644
--- a/src/libultra/io/pirawdma.c
+++ b/src/libultra/io/pirawdma.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osPiRawStartDma(s32 dir, u32 cartAddr, void* dramAddr, size_t size) {
s32 status;
diff --git a/src/libultra/io/si.c b/src/libultra/io/si.c
index 4afee03405..65cab5e898 100644
--- a/src/libultra/io/si.c
+++ b/src/libultra/io/si.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osSiDeviceBusy(void) {
register u32 status = IO_READ(SI_STATUS_REG);
diff --git a/src/libultra/io/siacs.c b/src/libultra/io/siacs.c
index 9f528feeff..8359c1bdda 100644
--- a/src/libultra/io/siacs.c
+++ b/src/libultra/io/siacs.c
@@ -1,4 +1,5 @@
-#include "global.h"
+#include "array_count.h"
+#include "ultra64.h"
static OSMesg siAccessBuf[1];
OSMesgQueue __osSiAccessQueue;
diff --git a/src/libultra/io/sirawdma.c b/src/libultra/io/sirawdma.c
index 0aa2f86942..4e7d082fd7 100644
--- a/src/libultra/io/sirawdma.c
+++ b/src/libultra/io/sirawdma.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/bbskapi.h"
#define PIF_RAM_SIZE (PIF_RAM_END + 1 - PIF_RAM_START)
diff --git a/src/libultra/io/sirawread.c b/src/libultra/io/sirawread.c
index 8efa071efb..71646f0324 100644
--- a/src/libultra/io/sirawread.c
+++ b/src/libultra/io/sirawread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osSiRawReadIo(void* devAddr, u32* dst) {
if (__osSiDeviceBusy()) {
diff --git a/src/libultra/io/sirawwrite.c b/src/libultra/io/sirawwrite.c
index f0e4514d77..c4b688813d 100644
--- a/src/libultra/io/sirawwrite.c
+++ b/src/libultra/io/sirawwrite.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osSiRawWriteIo(void* devAddr, u32 val) {
if (__osSiDeviceBusy()) {
diff --git a/src/libultra/io/sp.c b/src/libultra/io/sp.c
index 1796dc8f6e..3f4bbca704 100644
--- a/src/libultra/io/sp.c
+++ b/src/libultra/io/sp.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
u32 __osSpDeviceBusy(void) {
register u32 status = IO_READ(SP_STATUS_REG);
diff --git a/src/libultra/io/spgetstat.c b/src/libultra/io/spgetstat.c
index e1545bdb7c..5b749e03f6 100644
--- a/src/libultra/io/spgetstat.c
+++ b/src/libultra/io/spgetstat.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
u32 __osSpGetStatus(void) {
return IO_READ(SP_STATUS_REG);
diff --git a/src/libultra/io/sprawdma.c b/src/libultra/io/sprawdma.c
index 795282c4a0..2faee64ca0 100644
--- a/src/libultra/io/sprawdma.c
+++ b/src/libultra/io/sprawdma.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, u32 size) {
if (__osSpDeviceBusy()) {
diff --git a/src/libultra/io/spsetpc.c b/src/libultra/io/spsetpc.c
index 944fc98631..5ffae42652 100644
--- a/src/libultra/io/spsetpc.c
+++ b/src/libultra/io/spsetpc.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 __osSpSetPc(void* pc) {
register u32 spStatus = IO_READ(SP_STATUS_REG);
diff --git a/src/libultra/io/spsetstat.c b/src/libultra/io/spsetstat.c
index 3fa7a49188..9becdb0ebe 100644
--- a/src/libultra/io/spsetstat.c
+++ b/src/libultra/io/spsetstat.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void __osSpSetStatus(u32 status) {
IO_WRITE(SP_STATUS_REG, status);
diff --git a/src/libultra/io/sptask.c b/src/libultra/io/sptask.c
index be805ab5ce..b728146bda 100644
--- a/src/libultra/io/sptask.c
+++ b/src/libultra/io/sptask.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#define _osVirtualToPhysical(ptr) \
if (ptr != NULL) { \
diff --git a/src/libultra/io/sptaskyield.c b/src/libultra/io/sptaskyield.c
index ec7a248bbb..1aaf3773b5 100644
--- a/src/libultra/io/sptaskyield.c
+++ b/src/libultra/io/sptaskyield.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osSpTaskYield(void) {
__osSpSetStatus(SP_SET_SIG0);
diff --git a/src/libultra/io/sptaskyielded.c b/src/libultra/io/sptaskyielded.c
index 8be0556c33..13acd4a5ff 100644
--- a/src/libultra/io/sptaskyielded.c
+++ b/src/libultra/io/sptaskyielded.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
u32 osSpTaskYielded(OSTask* task) {
u32 status = __osSpGetStatus();
diff --git a/src/libultra/io/vi.c b/src/libultra/io/vi.c
index dac56ed812..c2c91ba276 100644
--- a/src/libultra/io/vi.c
+++ b/src/libultra/io/vi.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
OSViContext vi[2] = { 0 };
diff --git a/src/libultra/io/viblack.c b/src/libultra/io/viblack.c
index 491522fb1f..7866f3fc9d 100644
--- a/src/libultra/io/viblack.c
+++ b/src/libultra/io/viblack.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
void osViBlack(u8 active) {
diff --git a/src/libultra/io/viextendvstart.c b/src/libultra/io/viextendvstart.c
index 9efb9dbc3a..a28a8386d5 100644
--- a/src/libultra/io/viextendvstart.c
+++ b/src/libultra/io/viextendvstart.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osViExtendVStart(u32 value) {
__additional_scanline = value;
diff --git a/src/libultra/io/vigetcurrcontext.c b/src/libultra/io/vigetcurrcontext.c
index 1e3c6ffa3c..24ebcc5745 100644
--- a/src/libultra/io/vigetcurrcontext.c
+++ b/src/libultra/io/vigetcurrcontext.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSViContext* __osViGetCurrentContext(void) {
return __osViCurr;
diff --git a/src/libultra/io/vigetcurrframebuf.c b/src/libultra/io/vigetcurrframebuf.c
index 442a1afa9d..3c7ec71183 100644
--- a/src/libultra/io/vigetcurrframebuf.c
+++ b/src/libultra/io/vigetcurrframebuf.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void* osViGetCurrentFramebuffer(void) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/io/vigetnextframebuf.c b/src/libultra/io/vigetnextframebuf.c
index 5e6bd2ac74..8c782ca54f 100644
--- a/src/libultra/io/vigetnextframebuf.c
+++ b/src/libultra/io/vigetnextframebuf.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void* osViGetNextFramebuffer(void) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/io/vimgr.c b/src/libultra/io/vimgr.c
index a075ebf4f7..b4857c334a 100644
--- a/src/libultra/io/vimgr.c
+++ b/src/libultra/io/vimgr.c
@@ -1,6 +1,7 @@
-#include "global.h"
-#include "stack.h"
#include "ultra64/internal.h"
+#include "array_count.h"
+#include "stack.h"
+#include "ultra64.h"
static OSThread viThread;
static STACK(viThreadStack, 0x1000);
diff --git a/src/libultra/io/visetevent.c b/src/libultra/io/visetevent.c
index 89e482cf84..789e044a60 100644
--- a/src/libultra/io/visetevent.c
+++ b/src/libultra/io/visetevent.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osViSetEvent(OSMesgQueue* mq, OSMesg msg, u32 retraceCount) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/io/visetmode.c b/src/libultra/io/visetmode.c
index 8c34a4ee31..38eae7522b 100644
--- a/src/libultra/io/visetmode.c
+++ b/src/libultra/io/visetmode.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
void osViSetMode(OSViMode* mode) {
diff --git a/src/libultra/io/visetspecial.c b/src/libultra/io/visetspecial.c
index d51e3479d3..ef053fee1f 100644
--- a/src/libultra/io/visetspecial.c
+++ b/src/libultra/io/visetspecial.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
/**
diff --git a/src/libultra/io/visetxscale.c b/src/libultra/io/visetxscale.c
index 5e5e04ee47..765ac43844 100644
--- a/src/libultra/io/visetxscale.c
+++ b/src/libultra/io/visetxscale.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
void osViSetXScale(f32 value) {
diff --git a/src/libultra/io/visetyscale.c b/src/libultra/io/visetyscale.c
index adea96fd23..95c3273580 100644
--- a/src/libultra/io/visetyscale.c
+++ b/src/libultra/io/visetyscale.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
void osViSetYScale(f32 scale) {
diff --git a/src/libultra/io/viswapbuf.c b/src/libultra/io/viswapbuf.c
index 99259c03c3..e1e42922d2 100644
--- a/src/libultra/io/viswapbuf.c
+++ b/src/libultra/io/viswapbuf.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
void osViSwapBuffer(void* frameBufPtr) {
diff --git a/src/libultra/io/viswapcontext.c b/src/libultra/io/viswapcontext.c
index d1a7d0c0e6..19892ece36 100644
--- a/src/libultra/io/viswapcontext.c
+++ b/src/libultra/io/viswapcontext.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/viint.h"
void __osViSwapContext(void) {
diff --git a/src/libultra/mgu/normalize.s b/src/libultra/mgu/normalize.s
index 8174527f2c..d94748bced 100644
--- a/src/libultra/mgu/normalize.s
+++ b/src/libultra/mgu/normalize.s
@@ -8,20 +8,24 @@ LEAF(guNormalize)
lwc1 ft0, (a0)
lwc1 ft1, (a1)
lwc1 ft2, (a2)
+.set noreorder
mul.s ft3, ft0, ft0
li.s t0, 1.0
mul.s ft4, ft1, ft1
add.s ft5, ft3, ft4
mul.s ft4, ft2, ft2
+.set reorder
add.s ft3, ft4, ft5
mtc1 t0, ft5
sqrt.s ft4, ft3
div.s ft3, ft5, ft4
+.set noreorder
mul.s ft4, ft0, ft3
nop
mul.s ft5, ft1, ft3
nop
mul.s ft0, ft2, ft3
+.set reorder
swc1 ft4, (a0)
swc1 ft5, (a1)
swc1 ft0, (a2)
diff --git a/src/libultra/os/afterprenmi.c b/src/libultra/os/afterprenmi.c
index b59814763f..6a9a83de33 100644
--- a/src/libultra/os/afterprenmi.c
+++ b/src/libultra/os/afterprenmi.c
@@ -1,5 +1,4 @@
#include "ultra64.h"
-#include "global.h"
s32 osAfterPreNMI(void) {
return __osSpSetPc(0);
diff --git a/src/libultra/os/createmesgqueue.c b/src/libultra/os/createmesgqueue.c
index a85eadb0d7..4598de6aaa 100644
--- a/src/libultra/os/createmesgqueue.c
+++ b/src/libultra/os/createmesgqueue.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count) {
mq->mtqueue = (OSThread*)&__osThreadTail;
diff --git a/src/libultra/os/createthread.c b/src/libultra/os/createthread.c
index 8d54fb9871..9332207971 100644
--- a/src/libultra/os/createthread.c
+++ b/src/libultra/os/createthread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/asm.h"
void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri) {
diff --git a/src/libultra/os/destroythread.c b/src/libultra/os/destroythread.c
index a3273cadee..0b74a4fcbc 100644
--- a/src/libultra/os/destroythread.c
+++ b/src/libultra/os/destroythread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osDestroyThread(OSThread* thread) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/getactivequeue.c b/src/libultra/os/getactivequeue.c
index de55d7f041..633e01814a 100644
--- a/src/libultra/os/getactivequeue.c
+++ b/src/libultra/os/getactivequeue.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSThread* __osGetActiveQueue(void) {
return __osActiveQueue;
diff --git a/src/libultra/os/getcurrfaultedthread.c b/src/libultra/os/getcurrfaultedthread.c
index f36799b26f..bf2edb92d3 100644
--- a/src/libultra/os/getcurrfaultedthread.c
+++ b/src/libultra/os/getcurrfaultedthread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSThread* __osGetCurrFaultedThread(void) {
return __osFaultedThread;
diff --git a/src/libultra/os/gethwintrroutine.c b/src/libultra/os/gethwintrroutine.c
index d7d8897803..64044e66d3 100644
--- a/src/libultra/os/gethwintrroutine.c
+++ b/src/libultra/os/gethwintrroutine.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/internal.h"
void __osGetHWIntrRoutine(OSHWIntr intr, s32 (**callbackOut)(void), void** spOut) {
diff --git a/src/libultra/os/getmemsize.c b/src/libultra/os/getmemsize.c
index 1adbd66ff4..9489b0f057 100644
--- a/src/libultra/os/getmemsize.c
+++ b/src/libultra/os/getmemsize.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#define STEP 0x100000
diff --git a/src/libultra/os/getthreadid.c b/src/libultra/os/getthreadid.c
index 792229c9bf..8cee7a2aa3 100644
--- a/src/libultra/os/getthreadid.c
+++ b/src/libultra/os/getthreadid.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSId osGetThreadId(OSThread* thread) {
if (thread == NULL) {
diff --git a/src/libultra/os/getthreadpri.c b/src/libultra/os/getthreadpri.c
index 6c36a7c3b1..8eed2024f9 100644
--- a/src/libultra/os/getthreadpri.c
+++ b/src/libultra/os/getthreadpri.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSPri osGetThreadPri(OSThread* thread) {
if (thread == NULL) {
diff --git a/src/libultra/os/gettime.c b/src/libultra/os/gettime.c
index e8943cd9e0..e0adcc9f80 100644
--- a/src/libultra/os/gettime.c
+++ b/src/libultra/os/gettime.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSTime osGetTime(void) {
u32 count;
diff --git a/src/libultra/os/initialize.c b/src/libultra/os/initialize.c
index 300f2743dc..1241a0ac8f 100644
--- a/src/libultra/os/initialize.c
+++ b/src/libultra/os/initialize.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/bcp.h"
typedef struct __osExceptionVector {
@@ -10,10 +10,13 @@ typedef struct __osExceptionVector {
extern __osExceptionVector __osExceptionPreamble;
+extern OSPiHandle __Dom1SpeedParam;
+extern OSPiHandle __Dom2SpeedParam;
+
u64 osClockRate = OS_CLOCK_RATE;
s32 osViClock = VI_NTSC_CLOCK;
u32 __osShutdown = false;
-OSHWIntr __OSGlobalIntMask = OS_IM_ALL;
+OSIntMask __OSGlobalIntMask = OS_IM_ALL;
u32 __osFinalrom;
@@ -55,7 +58,7 @@ void OSINITIALIZE_FUNC(void) {
__osFinalrom = true;
__osSetSR(__osGetSR() | SR_CU1);
- __osSetFpcCsr(FPCSR_FS | FPCSR_EV);
+ __osSetFpcCsr(FPCSR_FS | FPCSR_EV | FPCSR_RM_RN);
#if LIBULTRA_VERSION >= LIBULTRA_VERSION_K
__osSetWatchLo(0x04900000);
#endif
diff --git a/src/libultra/os/jammesg.c b/src/libultra/os/jammesg.c
index e0ca40fc68..b5d42895c2 100644
--- a/src/libultra/os/jammesg.c
+++ b/src/libultra/os/jammesg.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/recvmesg.c b/src/libultra/os/recvmesg.c
index 3254867cce..0e60519d18 100644
--- a/src/libultra/os/recvmesg.c
+++ b/src/libultra/os/recvmesg.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/resetglobalintmask.c b/src/libultra/os/resetglobalintmask.c
index c418731838..1dde3754ca 100644
--- a/src/libultra/os/resetglobalintmask.c
+++ b/src/libultra/os/resetglobalintmask.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void __osResetGlobalIntMask(OSHWIntr mask) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/sendmesg.c b/src/libultra/os/sendmesg.c
index df0bc2bee4..cba5dcee81 100644
--- a/src/libultra/os/sendmesg.c
+++ b/src/libultra/os/sendmesg.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flag) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/seteventmesg.c b/src/libultra/os/seteventmesg.c
index d105850ee1..d77dea8999 100644
--- a/src/libultra/os/seteventmesg.c
+++ b/src/libultra/os/seteventmesg.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/internal.h"
__OSEventState __osEventStateTab[OS_NUM_EVENTS];
diff --git a/src/libultra/os/setglobalintmask.c b/src/libultra/os/setglobalintmask.c
index 8c4aebb926..c75f846f1e 100644
--- a/src/libultra/os/setglobalintmask.c
+++ b/src/libultra/os/setglobalintmask.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void __osSetGlobalIntMask(OSHWIntr mask) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/sethwintrroutine.c b/src/libultra/os/sethwintrroutine.c
index e6bb74f0f3..5ceae62bb1 100644
--- a/src/libultra/os/sethwintrroutine.c
+++ b/src/libultra/os/sethwintrroutine.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
#include "ultra64/internal.h"
void __osSetHWIntrRoutine(OSHWIntr intr, s32 (*callback)(void), void* sp) {
diff --git a/src/libultra/os/setthreadpri.c b/src/libultra/os/setthreadpri.c
index a9a1b0eb6e..93ece6f5c8 100644
--- a/src/libultra/os/setthreadpri.c
+++ b/src/libultra/os/setthreadpri.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osSetThreadPri(OSThread* thread, OSPri pri) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/settime.c b/src/libultra/os/settime.c
index 2be47ed9ed..310809e2c4 100644
--- a/src/libultra/os/settime.c
+++ b/src/libultra/os/settime.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osSetTime(OSTime time) {
__osCurrentTime = time;
diff --git a/src/libultra/os/settimer.c b/src/libultra/os/settimer.c
index c5632e82c2..4ad8ccc820 100644
--- a/src/libultra/os/settimer.c
+++ b/src/libultra/os/settimer.c
@@ -1,4 +1,7 @@
-#include "global.h"
+#include "ultra64.h"
+#include "attributes.h"
+
+#include "ultra64.h"
s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg) {
UNUSED OSTime time;
diff --git a/src/libultra/os/startthread.c b/src/libultra/os/startthread.c
index 6594fd5ae5..eb84bd9461 100644
--- a/src/libultra/os/startthread.c
+++ b/src/libultra/os/startthread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osStartThread(OSThread* thread) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/stopthread.c b/src/libultra/os/stopthread.c
index 53aecd940a..6e24b5d83f 100644
--- a/src/libultra/os/stopthread.c
+++ b/src/libultra/os/stopthread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osStopThread(OSThread* thread) {
register u32 prevInt = __osDisableInt();
diff --git a/src/libultra/os/stoptimer.c b/src/libultra/os/stoptimer.c
index d6d20536a1..e8dbdbd2cf 100644
--- a/src/libultra/os/stoptimer.c
+++ b/src/libultra/os/stoptimer.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
s32 osStopTimer(OSTimer* timer) {
register u32 prevInt;
diff --git a/src/libultra/os/thread.c b/src/libultra/os/thread.c
index 0263acb454..a9429b6b9b 100644
--- a/src/libultra/os/thread.c
+++ b/src/libultra/os/thread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
__OSThreadTail __osThreadTail = { NULL, OS_PRIORITY_THREADTAIL };
OSThread* __osRunQueue = (OSThread*)&__osThreadTail;
diff --git a/src/libultra/os/timerintr.c b/src/libultra/os/timerintr.c
index 3f94368b20..2e6d6ba71b 100644
--- a/src/libultra/os/timerintr.c
+++ b/src/libultra/os/timerintr.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
OSTimer __osBaseTimer;
OSTime __osCurrentTime;
diff --git a/src/libultra/os/virtualtophysical.c b/src/libultra/os/virtualtophysical.c
index 0037572232..0906dc51af 100644
--- a/src/libultra/os/virtualtophysical.c
+++ b/src/libultra/os/virtualtophysical.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
u32 osVirtualToPhysical(void* vaddr) {
if (IS_KSEG0(vaddr)) {
diff --git a/src/libultra/os/yieldthread.c b/src/libultra/os/yieldthread.c
index af9e15a2c1..a0604f7183 100644
--- a/src/libultra/os/yieldthread.c
+++ b/src/libultra/os/yieldthread.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "ultra64.h"
void osYieldThread(void) {
register u32 prevInt = __osDisableInt();
diff --git a/src/n64dd/n64dd_801C8000.c b/src/n64dd/n64dd_801C8000.c
index 9b0a4b3adc..2212fe43fb 100644
--- a/src/n64dd/n64dd_801C8000.c
+++ b/src/n64dd/n64dd_801C8000.c
@@ -1,7 +1,10 @@
// Does some command processing
-#include "global.h"
+
#include "n64dd.h"
+
+#include "array_count.h"
#include "versions.h"
+#include "z_locale.h"
void func_801C8554(void);
void func_801C8578(void* arg0, void* arg1, OSId id, void* sp, OSPri pri);
diff --git a/src/n64dd/n64dd_801C8940.c b/src/n64dd/n64dd_801C8940.c
index 437a23dcf2..132222b689 100644
--- a/src/n64dd/n64dd_801C8940.c
+++ b/src/n64dd/n64dd_801C8940.c
@@ -1,7 +1,9 @@
// Lower-level command processing in a background thread
-#include "global.h"
#include "n64dd.h"
+#include "libc64/sleep.h"
+#include "attributes.h"
+
s32 D_801D2EA0 = 0;
u8* D_801D2EA4 = NULL;
s32 D_801D2EA8 = 0;
diff --git a/src/n64dd/n64dd_801C9440.c b/src/n64dd/n64dd_801C9440.c
index 2d0b1b5c01..ecab855d4a 100644
--- a/src/n64dd/n64dd_801C9440.c
+++ b/src/n64dd/n64dd_801C9440.c
@@ -1,5 +1,4 @@
// Some text-handling functions
-#include "global.h"
#include "n64dd.h"
#include "versions.h"
diff --git a/src/n64dd/n64dd_801C9B70.c b/src/n64dd/n64dd_801C9B70.c
index d7d2f63849..2437904c37 100644
--- a/src/n64dd/n64dd_801C9B70.c
+++ b/src/n64dd/n64dd_801C9B70.c
@@ -1,6 +1,6 @@
// User-facing error handling
-#include "global.h"
#include "n64dd.h"
+#include "z_locale.h"
u8 B_801E0F80[0x600];
u8 B_801E1580[0x2800];
diff --git a/src/n64dd/n64dd_801CA0B0.c b/src/n64dd/n64dd_801CA0B0.c
index 8758e0fd62..e3ba1be18d 100644
--- a/src/n64dd/n64dd_801CA0B0.c
+++ b/src/n64dd/n64dd_801CA0B0.c
@@ -1,6 +1,9 @@
-#include "global.h"
#include "n64dd.h"
+#include "libc64/aprintf.h"
+#include "attributes.h"
+#include "array_count.h"
+
// Draws text to framebuffer
typedef struct struct_801CA704 {
/* 0x00 */ PrintCallback callback;
diff --git a/src/n64dd/n64dd_data_buffer.c b/src/n64dd/n64dd_data_buffer.c
index 6aacae2d57..d4dfeb3363 100644
--- a/src/n64dd/n64dd_data_buffer.c
+++ b/src/n64dd/n64dd_data_buffer.c
@@ -1,4 +1,3 @@
-#include "global.h"
#include "n64dd.h"
// Buffer used for reading from the disk?
diff --git a/src/n64dd/n64dd_error_bodies.c b/src/n64dd/n64dd_error_bodies.c
index 757e1afb6b..9c990d76bf 100644
--- a/src/n64dd/n64dd_error_bodies.c
+++ b/src/n64dd/n64dd_error_bodies.c
@@ -1,4 +1,3 @@
-#include "global.h"
#include "n64dd.h"
const char* D_801D2EE0[2][8][4] = {
diff --git a/src/n64dd/n64dd_error_headers.c b/src/n64dd/n64dd_error_headers.c
index b14d80fba5..ee7d611c21 100644
--- a/src/n64dd/n64dd_error_headers.c
+++ b/src/n64dd/n64dd_error_headers.c
@@ -1,4 +1,3 @@
-#include "global.h"
#include "n64dd.h"
// Padding in .rodata suggests that these are in a separate file
diff --git a/src/n64dd/n64dd_error_textures.c b/src/n64dd/n64dd_error_textures.c
index d115fdd6ef..38b42de363 100644
--- a/src/n64dd/n64dd_error_textures.c
+++ b/src/n64dd/n64dd_error_textures.c
@@ -2,18 +2,18 @@
u64 gN64DDError41Texs[2][0x600 / sizeof(u64)] = {
{
-#include "assets/n64dd/error_textures/n64dd_error_41_jpn.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDError41JPNTex.i4.inc.c"
},
{
-#include "assets/n64dd/error_textures/n64dd_error_41_eng.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDError41ENGTex.i4.inc.c"
},
};
u64 gN64DDPleaseReadManualTexs[2][0x2800 / sizeof(u64)] = {
{
-#include "assets/n64dd/error_textures/n64dd_please_read_manual_jpn.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDPleaseReadManualJPNTex.i4.inc.c"
},
{
-#include "assets/n64dd/error_textures/n64dd_please_read_manual_eng.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDPleaseReadManualENGTex.i4.inc.c"
},
};
diff --git a/src/n64dd/z_n64dd.c b/src/n64dd/z_n64dd.c
index 3524cd348e..a8ce0674c7 100644
--- a/src/n64dd/z_n64dd.c
+++ b/src/n64dd/z_n64dd.c
@@ -1,13 +1,22 @@
// Main interface for the 64DD from the rest of the game. Starts background
// threads and provides functions to submit commands to them.
-#include "global.h"
-#include "fault.h"
-#include "n64dd.h"
-#include "stack.h"
-#include "versions.h"
-#include "line_numbers.h"
-#pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+#include "n64dd.h"
+
+#include "libc64/sleep.h"
+#include "array_count.h"
+#include "fault.h"
+#include "gfx.h"
+#include "irqmgr.h"
+#include "line_numbers.h"
+#include "stack.h"
+#include "stackcheck.h"
+#include "sys_freeze.h"
+#include "versions.h"
+#include "z64audio.h"
+#include "z64thread.h"
+
+#pragma increment_block_number "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
typedef struct struct_801D9C30 {
/* 0x000 */ s32 unk_000; // disk start
diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c
index f9c6f71d25..9ca642d4e9 100644
--- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c
+++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c
@@ -176,7 +176,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
if (this->collider.elem.atHitElem->acElemFlags & ACELEM_HOOKABLE) {
ArmsHook_AttachToActor(this, touchedActor);
- if (CHECK_FLAG_ALL(touchedActor->flags, ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER)) {
+ if (ACTOR_FLAGS_CHECK_ALL(touchedActor, ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER)) {
ArmsHook_PullPlayer(this);
}
}
@@ -202,7 +202,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
if (attachedActor != NULL) {
if ((attachedActor->update == NULL) ||
- !CHECK_FLAG_ALL(attachedActor->flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
+ !ACTOR_FLAGS_CHECK_ALL(attachedActor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
attachedActor = NULL;
this->attachedActor = NULL;
} else if (this->actor.child != NULL) {
diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c
index 67268e9e8a..a92c226117 100644
--- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c
+++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c
@@ -16,8 +16,6 @@
#include "z_lib.h"
#include "z64play.h"
-#include "z64.h"
-
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void ArrowFire_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c
index e84af1d7b7..953e0a333c 100644
--- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c
+++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c
@@ -16,8 +16,6 @@
#include "z_lib.h"
#include "z64play.h"
-#include "z64.h"
-
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void ArrowIce_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c
index 4f3f5572e1..100b8c20c1 100644
--- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c
+++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c
@@ -16,8 +16,6 @@
#include "z_lib.h"
#include "z64play.h"
-#include "z64.h"
-
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void ArrowLight_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c
index 2548f33e10..f8529bb775 100644
--- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c
+++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c
@@ -8,14 +8,17 @@
#include "ichain.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "quake.h"
#include "rumble.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64audio.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_bdan_objects/object_bdan_objects.h"
@@ -106,7 +109,9 @@ s32 BgBdanObjects_GetProperty(BgBdanObjects* this, s32 arg1) {
case JABU_OBJECTS_GET_PROP_CAM_SETTING_DUNGEON1:
return this->cameraSetting == CAM_SET_DUNGEON1;
default:
- PRINTF("Bg_Bdan_Objects_Get_Contact_Ru1\nそんな受信モードは無い%d!!!!!!!!\n", arg1);
+ PRINTF(T("Bg_Bdan_Objects_Get_Contact_Ru1\nそんな受信モードは無い%d!!!!!!!!\n",
+ "Bg_Bdan_Objects_Get_Contact_Ru1\nThere is no such receiving mode %d!!!!!!!!\n"),
+ arg1);
return -1;
}
}
@@ -123,7 +128,9 @@ void BgBdanObjects_SetProperty(BgBdanObjects* this, s32 arg1) {
SET_INFTABLE(INFTABLE_146);
break;
default:
- PRINTF("Bg_Bdan_Objects_Set_Contact_Ru1\nそんな送信モードは無い%d!!!!!!!!\n", arg1);
+ PRINTF(T("Bg_Bdan_Objects_Set_Contact_Ru1\nそんな送信モードは無い%d!!!!!!!!\n",
+ "Bg_Bdan_Objects_Set_Contact_Ru1\nThere is no such transmission mode %d!!!!!!!!\n"),
+ arg1);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c
index a28786d50f..0dcb302eaa 100644
--- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c
+++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c
@@ -7,10 +7,12 @@
#include "z_bg_bdan_switch.h"
#include "ichain.h"
-#include "rumble.h"
#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rumble.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
#include "z64player.h"
@@ -111,8 +113,9 @@ void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, PlayState* play, CollisionHea
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_bdan_switch.c", 325,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_bdan_switch.c", 325, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -120,7 +123,7 @@ void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, PlayState* play, CollisionHea
void BgBdanSwitch_InitCollision(BgBdanSwitch* this, PlayState* play) {
Actor* actor = &this->dyna.actor;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, actor, &sJntSphInit, this->colliderElements);
}
void func_8086D0EC(BgBdanSwitch* this) {
@@ -206,11 +209,13 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) {
}
break;
default:
- PRINTF("不正な ARG_DATA(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params, "../z_bg_bdan_switch.c", 454);
+ PRINTF(T("不正な", "Invalid") " ARG_DATA(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params,
+ "../z_bg_bdan_switch.c", 454);
Actor_Kill(&this->dyna.actor);
return;
}
- PRINTF("(巨大魚ダンジョン 専用スイッチ)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("(巨大魚ダンジョン 専用スイッチ)", "(Giant Fish Dungeon Special Switch)") "(arg_data 0x%04x)\n",
+ this->dyna.actor.params);
}
void BgBdanSwitch_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h
index e47a98e6c8..f86ef79e3e 100644
--- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h
+++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h
@@ -20,7 +20,7 @@ typedef struct BgBdanSwitch {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgBdanSwitchActionFunc actionFunc;
/* 0x0168 */ ColliderJntSph collider;
- /* 0x0188 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0188 */ ColliderJntSphElement colliderElements[1];
/* 0x01C8 */ f32 unk_1C8;
/* 0x01CC */ s16 unk_1CC;
/* 0x01CE */ char unk_1CE[0x2];
diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c
index ae816120b4..bee0e2484c 100644
--- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c
+++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c
@@ -7,8 +7,10 @@
#include "z_bg_bom_guard.h"
#include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h"
+#include "printf.h"
#include "regs.h"
#include "terminal.h"
+#include "translation.h"
#include "z64play.h"
#include "assets/objects/object_bowl/object_bowl.h"
@@ -47,7 +49,7 @@ void BgBomGuard_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
PRINTF("\n\n");
- PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 透明ガード出現 ☆☆☆☆☆ \n" VT_RST);
+ PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ " T("透明ガード出現", "Transparent guard appears") " ☆☆☆☆☆ \n" VT_RST);
thisx->scale.x = 1.0f;
thisx->scale.y = 1.0f;
diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c
index 0e5db9b283..6db143bdf8 100644
--- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c
+++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c
@@ -7,7 +7,9 @@
#include "z_bg_bombwall.h"
#include "libc64/qrand.h"
#include "ichain.h"
+#include "printf.h"
#include "sfx.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
@@ -97,9 +99,8 @@ void BgBombwall_InitDynapoly(BgBombwall* this, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.bgId == BG_ACTOR_MAX) {
- // "Warning : move BG login failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_bombwall.c", 243,
- this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗", "Warning : move BG registration failed") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_bombwall.c", 243, this->dyna.actor.params);
}
}
@@ -134,7 +135,7 @@ void BgBombwall_Init(Actor* thisx, PlayState* play) {
BgBombwall_InitDynapoly(this, play);
this->unk_2A2 |= 2;
Collider_InitTris(play, &this->collider);
- Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderItems);
+ Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderElements);
for (i = 0; i <= 2; i++) {
for (j = 0; j <= 2; j++) {
@@ -155,8 +156,8 @@ void BgBombwall_Init(Actor* thisx, PlayState* play) {
func_8086ED50(this, play);
}
- PRINTF("(field keep 汎用爆弾壁)(arg_data 0x%04x)(angY %d)\n", this->dyna.actor.params,
- this->dyna.actor.shape.rot.y);
+ PRINTF("(field keep " T("汎用爆弾壁", "general purpose bomb wall") ")(arg_data 0x%04x)(angY %d)\n",
+ this->dyna.actor.params, this->dyna.actor.shape.rot.y);
}
void BgBombwall_DestroyCollision(BgBombwall* this, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h
index 4c58b38788..8cd1bb879f 100644
--- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h
+++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h
@@ -11,7 +11,7 @@ typedef void (*BgBombwallActionFunc)(struct BgBombwall*, struct PlayState*);
typedef struct BgBombwall {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderTris collider;
- /* 0x0184 */ ColliderTrisElement colliderItems[3];
+ /* 0x0184 */ ColliderTrisElement colliderElements[3];
/* 0x0298 */ BgBombwallActionFunc actionFunc;
/* 0x029C */ Gfx* dList;
/* 0x02A0 */ s16 unk_2A0;
diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c
index 377efc13e8..e0c0e1c4fd 100644
--- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c
+++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c
@@ -10,11 +10,13 @@
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "printf.h"
+#include "quake.h"
#include "rand.h"
#include "sfx.h"
-#include "quake.h"
#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64effect.h"
#include "z64play.h"
@@ -72,7 +74,9 @@ void BgBowlWall_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
this->initPos = this->dyna.actor.world.pos;
PRINTF("\n\n");
- PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ ボーリングおじゃま壁発生 ☆☆☆☆☆ %d\n" VT_RST, this->dyna.actor.params);
+ PRINTF(
+ VT_FGCOL(GREEN) " ☆☆☆☆☆ " T("ボーリングおじゃま壁発生", "Bowling obstacle wall appears") " ☆☆☆☆☆ %d\n" VT_RST,
+ this->dyna.actor.params);
this->actionFunc = BgBowlWall_SpawnBullseyes;
this->dyna.actor.scale.x = this->dyna.actor.scale.y = this->dyna.actor.scale.z = 1.0f;
}
diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c
index e03e1f6299..f36d251f45 100644
--- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c
+++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c
@@ -17,6 +17,7 @@
#include "z_lib.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/scenes/dungeons/ddan/ddan_scene.h"
#include "assets/objects/object_bwall/object_bwall.h"
diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c
index 74e9b63fec..9a8669e535 100644
--- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c
+++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c
@@ -9,6 +9,7 @@
#include "libc64/qrand.h"
#include "ichain.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "rand.h"
#include "rumble.h"
#include "sfx.h"
diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c
index 46f40d3ec0..3764381c19 100644
--- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c
+++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c
@@ -7,21 +7,25 @@
#include "z_bg_dodoago.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
-#include "macros.h"
#include "one_point_cutscene.h"
#include "rand.h"
#include "rumble.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "z_en_item00.h"
#include "z_lib.h"
#include "z64effect.h"
#include "z64play.h"
+#include "z64save.h"
#include "assets/objects/object_ddan_objects/object_ddan_objects.h"
+#pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+
#define FLAGS 0
void BgDodoago_Init(Actor* thisx, PlayState* play);
@@ -139,12 +143,12 @@ void BgDodoago_Init(Actor* thisx, PlayState* play) {
return;
}
- Collider_InitCylinder(play, &this->colliderMain);
- Collider_InitCylinder(play, &this->colliderLeft);
- Collider_InitCylinder(play, &this->colliderRight);
- Collider_SetCylinder(play, &this->colliderMain, &this->dyna.actor, &sColCylinderInitMain);
- Collider_SetCylinder(play, &this->colliderLeft, &this->dyna.actor, &sColCylinderInitLeftRight);
- Collider_SetCylinder(play, &this->colliderRight, &this->dyna.actor, &sColCylinderInitLeftRight);
+ Collider_InitCylinder(play, &this->mainCollider);
+ Collider_InitCylinder(play, &this->leftCollider);
+ Collider_InitCylinder(play, &this->rightCollider);
+ Collider_SetCylinder(play, &this->mainCollider, &this->dyna.actor, &sColCylinderInitMain);
+ Collider_SetCylinder(play, &this->leftCollider, &this->dyna.actor, &sColCylinderInitLeftRight);
+ Collider_SetCylinder(play, &this->rightCollider, &this->dyna.actor, &sColCylinderInitLeftRight);
BgDodoago_SetupAction(this, BgDodoago_WaitExplosives);
sDisableBombCatcher = false;
@@ -154,13 +158,13 @@ void BgDodoago_Destroy(Actor* thisx, PlayState* play) {
BgDodoago* this = (BgDodoago*)thisx;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
- Collider_DestroyCylinder(play, &this->colliderMain);
- Collider_DestroyCylinder(play, &this->colliderLeft);
- Collider_DestroyCylinder(play, &this->colliderRight);
+ Collider_DestroyCylinder(play, &this->mainCollider);
+ Collider_DestroyCylinder(play, &this->leftCollider);
+ Collider_DestroyCylinder(play, &this->rightCollider);
}
void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) {
- Actor* explosive = Actor_GetCollidedExplosive(play, &this->colliderMain.base);
+ Actor* explosive = Actor_GetCollidedExplosive(play, &this->mainCollider.base);
if (explosive != NULL) {
this->state =
@@ -197,21 +201,21 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) {
sTimer = 50;
}
} else if (Flags_GetEventChkInf(EVENTCHKINF_B0)) {
- Collider_UpdateCylinder(&this->dyna.actor, &this->colliderMain);
- Collider_UpdateCylinder(&this->dyna.actor, &this->colliderLeft);
- Collider_UpdateCylinder(&this->dyna.actor, &this->colliderRight);
+ Collider_UpdateCylinder(&this->dyna.actor, &this->mainCollider);
+ Collider_UpdateCylinder(&this->dyna.actor, &this->leftCollider);
+ Collider_UpdateCylinder(&this->dyna.actor, &this->rightCollider);
- this->colliderMain.dim.pos.z += 200;
+ this->mainCollider.dim.pos.z += 200;
- this->colliderLeft.dim.pos.z += 215;
- this->colliderLeft.dim.pos.x += 90;
+ this->leftCollider.dim.pos.z += 215;
+ this->leftCollider.dim.pos.x += 90;
- this->colliderRight.dim.pos.z += 215;
- this->colliderRight.dim.pos.x -= 90;
+ this->rightCollider.dim.pos.z += 215;
+ this->rightCollider.dim.pos.x -= 90;
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderMain.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderLeft.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderRight.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->mainCollider.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->leftCollider.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->rightCollider.base);
}
}
@@ -289,15 +293,15 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) {
if (this->dyna.actor.parent == NULL) {
// this is a "bomb catcher", it kills the XZ speed and sets the timer for bombs that are dropped through the
// holes in the bridge above the skull
- if ((this->colliderLeft.base.ocFlags1 & OC1_HIT) || (this->colliderRight.base.ocFlags1 & OC1_HIT)) {
+ if ((this->leftCollider.base.ocFlags1 & OC1_HIT) || (this->rightCollider.base.ocFlags1 & OC1_HIT)) {
- if (this->colliderLeft.base.ocFlags1 & OC1_HIT) {
- actor = this->colliderLeft.base.oc;
+ if (this->leftCollider.base.ocFlags1 & OC1_HIT) {
+ actor = this->leftCollider.base.oc;
} else {
- actor = this->colliderRight.base.oc;
+ actor = this->rightCollider.base.oc;
}
- this->colliderLeft.base.ocFlags1 &= ~OC1_HIT;
- this->colliderRight.base.ocFlags1 &= ~OC1_HIT;
+ this->leftCollider.base.ocFlags1 &= ~OC1_HIT;
+ this->rightCollider.base.ocFlags1 &= ~OC1_HIT;
if (actor->category == ACTORCAT_EXPLOSIVE && actor->id == ACTOR_EN_BOM && actor->params == 0) {
bomb = (EnBom*)actor;
diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h
index c767ed5003..9f361a3ccb 100644
--- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h
+++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h
@@ -16,9 +16,9 @@ typedef void (*BgDodoagoActionFunc)(struct BgDodoago*, struct PlayState*);
typedef struct BgDodoago {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ s16 state; // BgDodoagoEye or a timer-like value
- /* 0x0168 */ ColliderCylinder colliderMain; // Used to detect explosions for lighting the eyes
- /* 0x01B4 */ ColliderCylinder colliderLeft; // OC-colliding bombs have their xz speed cleared and timer set
- /* 0x0200 */ ColliderCylinder colliderRight; // same as colliderLeft
+ /* 0x0168 */ ColliderCylinder mainCollider; // Used to detect explosions for lighting the eyes
+ /* 0x01B4 */ ColliderCylinder leftCollider; // OC-colliding bombs have their xz speed cleared and timer set
+ /* 0x0200 */ ColliderCylinder rightCollider; // same as colliderLeft
/* 0x024C */ BgDodoagoActionFunc actionFunc;
} BgDodoago; // size = 0x0250
diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c
index b20e6fc16e..006deb893e 100644
--- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c
+++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c
@@ -11,17 +11,20 @@
#include "gfx.h"
#include "gfx_setupdl.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "rand.h"
#include "regs.h"
#include "segmented_address.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "versions.h"
#include "z_lib.h"
#include "z64ocarina.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_dy_obj/object_dy_obj.h"
#include "assets/scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.h"
@@ -101,8 +104,7 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) {
this->actor.focus.pos = this->actor.world.pos;
if (play->sceneId == SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) {
- // "Great Fairy Fountain"
- PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 大妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->spawn);
+ PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ " T("大妖精の泉", "Great Fairy Fountain") " ☆☆☆☆☆ %d\n" VT_RST, play->spawn);
SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairySittingTransitionAnim,
this->jointTable, this->morphTable, 28);
#if OOT_VERSION < NTSC_1_1
@@ -112,8 +114,7 @@ void BgDyYoseizo_Init(Actor* thisx, PlayState* play2) {
}
#endif
} else {
- // "Stone/Jewel Fairy Fountain"
- PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 石妖精の泉 ☆☆☆☆☆ %d\n" VT_RST, play->spawn);
+ PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ " T("石妖精の泉", "Stone Fairy Fountain") " ☆☆☆☆☆ %d\n" VT_RST, play->spawn);
SkelAnime_InitFlex(play, &this->skelAnime, &gGreatFairySkel, &gGreatFairyLayingDownTransitionAnim,
this->jointTable, this->morphTable, 28);
#if OOT_VERSION < NTSC_1_1
@@ -250,8 +251,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
#endif
Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1);
- // "Mode"
- PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ もうど ☆☆☆☆☆ %d\n" VT_RST, play->msgCtx.ocarinaMode);
+ PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ " T("もうど", "Mode") " ☆☆☆☆☆ %d\n" VT_RST, play->msgCtx.ocarinaMode);
givingReward = false;
if (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) {
@@ -276,24 +276,22 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
switch (this->fountainType) {
case FAIRY_UPGRADE_MAGIC:
if (!gSaveContext.save.info.playerData.isMagicAcquired || BREG(2)) {
- // "Spin Attack speed UP"
- PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 回転切り速度UP ☆☆☆☆☆ \n" VT_RST);
+ PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ " T("回転切り速度UP", "Turning speed UP") " ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
givingReward = true;
}
break;
case FAIRY_UPGRADE_DOUBLE_MAGIC:
if (!gSaveContext.save.info.playerData.isDoubleMagicAcquired) {
- // "Magic Meter doubled"
- PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 魔法ゲージメーター倍増 ☆☆☆☆☆ \n" VT_RST);
+ PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ " T("魔法ゲージメーター倍増",
+ "Magic Gauge Meter Doubled") " ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
givingReward = true;
}
break;
case FAIRY_UPGRADE_DOUBLE_DEFENSE:
if (!gSaveContext.save.info.playerData.isDoubleDefenseAcquired) {
- // "Damage halved"
- PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ ダメージ半減 ☆☆☆☆☆ \n" VT_RST);
+ PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ " T("ダメージ半減", "Damage halved") " ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
givingReward = true;
}
diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c
index 7a84de3cb4..1df0e5b730 100644
--- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c
+++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c
@@ -7,9 +7,11 @@
#include "z_bg_ganon_otyuka.h"
#include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
+#include "printf.h"
#include "rand.h"
#include "sfx.h"
#include "sys_matrix.h"
diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c
index c4811a1d5a..c263ed5e3a 100644
--- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c
+++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c
@@ -8,11 +8,14 @@
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "printf.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
+#include "z64save.h"
#include "assets/objects/object_spot01_matoyab/object_spot01_matoyab.h"
@@ -59,7 +62,7 @@ void BgGateShutter_Init(Actor* thisx, PlayState* play) {
thisx->scale.y = 1.0f;
thisx->scale.z = 1.0f;
PRINTF("\n\n");
- PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 柵でたなぁ ☆☆☆☆☆ \n" VT_RST);
+ PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ " T("柵でたなぁ", "There's a fence") " ☆☆☆☆☆ \n" VT_RST);
this->actionFunc = func_8087828C;
}
diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c
index a4a64c2014..6c0f01b322 100644
--- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c
+++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c
@@ -13,6 +13,7 @@
#include "sys_matrix.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_gjyo_objects/object_gjyo_objects.h"
#include "assets/scenes/overworld/ganon_tou/ganon_tou_scene.h"
diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c
index ab2b0ce919..98824a94e0 100644
--- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c
+++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c
@@ -58,7 +58,7 @@ void BgGndNisekabe_Draw(Actor* thisx, PlayState* play) {
BgGndNisekabe* this = (BgGndNisekabe*)thisx;
u32 index = PARAMS_GET_U(this->actor.params, 0, 8);
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
Gfx_DrawDListXlu(play, dLists[index]);
} else {
Gfx_DrawDListOpa(play, dLists[index]);
diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c
index 6e0b045a8b..f20af0b9f8 100644
--- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c
+++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c
@@ -14,6 +14,7 @@
#include "z_lib.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_haka/object_haka.h"
diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c
index 9ef689694f..a209637949 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c
+++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c
@@ -355,7 +355,7 @@ void BgHakaGate_Draw(Actor* thisx, PlayState* play) {
BgHakaGate* this = (BgHakaGate*)thisx;
MtxF currentMtxF;
- if (CHECK_FLAG_ALL(thisx->flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (ACTOR_FLAGS_CHECK_ALL(thisx, ACTOR_FLAG_REACT_TO_LENS)) {
Gfx_DrawDListXlu(play, object_haka_objects_DL_00F1B0);
} else {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c
index c83de30010..a09195d6fe 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c
+++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c
@@ -9,8 +9,6 @@
#include "ichain.h"
#include "z64play.h"
-#include "z64.h"
-
#include "assets/objects/object_hakach_objects/object_hakach_objects.h"
#include "assets/objects/object_haka_objects/object_haka_objects.h"
@@ -135,7 +133,7 @@ void BgHakaMegane_Update(Actor* thisx, PlayState* play) {
void BgHakaMegane_Draw(Actor* thisx, PlayState* play) {
BgHakaMegane* this = (BgHakaMegane*)thisx;
- if (CHECK_FLAG_ALL(thisx->flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (ACTOR_FLAGS_CHECK_ALL(thisx, ACTOR_FLAG_REACT_TO_LENS)) {
Gfx_DrawDListXlu(play, sDLists[thisx->params]);
} else {
Gfx_DrawDListOpa(play, sDLists[thisx->params]);
diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c
index ce4da2a2ea..f11973a86f 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c
+++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c
@@ -155,12 +155,12 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) {
Collider_InitTris(play, colliderScythe);
Collider_SetTris(play, colliderScythe, thisx, &sTrisInit, this->colliderScytheItems);
- Collider_InitCylinder(play, &this->colliderScytheCenter);
- Collider_SetCylinder(play, &this->colliderScytheCenter, thisx, &sCylinderInit);
+ Collider_InitCylinder(play, &this->scytheCenterCollider);
+ Collider_SetCylinder(play, &this->scytheCenterCollider, thisx, &sCylinderInit);
- this->colliderScytheCenter.dim.pos.x = thisx->world.pos.x;
- this->colliderScytheCenter.dim.pos.y = thisx->world.pos.y;
- this->colliderScytheCenter.dim.pos.z = thisx->world.pos.z;
+ this->scytheCenterCollider.dim.pos.x = thisx->world.pos.x;
+ this->scytheCenterCollider.dim.pos.y = thisx->world.pos.y;
+ this->scytheCenterCollider.dim.pos.z = thisx->world.pos.z;
CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit);
@@ -181,8 +181,8 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) {
thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
} else {
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ICE_OBJECTS);
- this->colliderScytheCenter.dim.radius = 30;
- this->colliderScytheCenter.dim.height = 70;
+ this->scytheCenterCollider.dim.radius = 30;
+ this->scytheCenterCollider.dim.height = 70;
Actor_SetFocus(thisx, 40.0f);
}
@@ -200,7 +200,7 @@ void BgHakaSgami_Destroy(Actor* thisx, PlayState* play) {
Effect_Delete(play, this->blureEffectIndex[0]);
Effect_Delete(play, this->blureEffectIndex[1]);
Collider_DestroyTris(play, &this->colliderScythe);
- Collider_DestroyCylinder(play, &this->colliderScytheCenter);
+ Collider_DestroyCylinder(play, &this->scytheCenterCollider);
}
void BgHakaSgami_SetupSpin(BgHakaSgami* this, PlayState* play) {
@@ -289,7 +289,7 @@ void BgHakaSgami_Spin(BgHakaSgami* this, PlayState* play) {
}
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderScythe.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderScytheCenter.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->scytheCenterCollider.base);
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_ROLLCUTTER_MOTOR - SFX_FLAG);
}
diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h
index 2bbcd2dc0d..53c0b63400 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h
+++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h
@@ -15,7 +15,7 @@ typedef struct BgHakaSgami {
/* 0x0151 */ s8 unk_151;
/* 0x0152 */ s16 timer;
/* 0x0154 */ s32 blureEffectIndex[2];
- /* 0x015C */ ColliderCylinder colliderScytheCenter;
+ /* 0x015C */ ColliderCylinder scytheCenterCollider;
/* 0x01A8 */ ColliderTris colliderScythe;
/* 0x01C8 */ ColliderTrisElement colliderScytheItems[4];
} BgHakaSgami; // size = 0x0338
diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c
index b28c155edd..126dcc7ee1 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c
+++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c
@@ -10,8 +10,10 @@
#include "gfx_setupdl.h"
#include "ichain.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
#include "z64skin_matrix.h"
@@ -104,7 +106,7 @@ void BgHakaShip_WaitForSong(BgHakaShip* this, PlayState* play) {
if (this->counter == 0) {
this->counter = 130;
this->actionFunc = BgHakaShip_CutsceneStationary;
- PRINTF("シーン 外輪船 ... アァクション!!\n");
+ PRINTF(T("シーン 外輪船 ... アァクション!!\n", "Scene paddle steamer... action!!\n"));
OnePointCutscene_Init(play, 3390, 999, &this->dyna.actor, CAM_ID_MAIN);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c
index 8237009d97..df7c95b0e9 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c
+++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c
@@ -12,12 +12,11 @@
#include "ichain.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "z_en_item00.h"
#include "z_lib.h"
#include "z64effect.h"
#include "z64play.h"
-#include "global.h"
-
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_haka_objects/object_haka_objects.h"
diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c
index ba6d3f526a..90aeee4b87 100644
--- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c
+++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c
@@ -7,10 +7,12 @@
#include "z_bg_heavy_block.h"
#include "libu64/debug.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "quake.h"
#include "rand.h"
#include "rumble.h"
@@ -18,6 +20,7 @@
#include "sys_math.h"
#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64effect.h"
#include "z64play.h"
@@ -162,8 +165,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) {
this->actionFunc = BgHeavyBlock_Wait;
break;
}
- // "Largest Block Save Bit %x"
- PRINTF(VT_FGCOL(CYAN) " 最大 ブロック セーブビット %x\n" VT_RST, thisx->params);
+ PRINTF(VT_FGCOL(CYAN) T(" 最大 ブロック セーブビット %x\n", " Largest Block Save Bit %x\n") VT_RST, thisx->params);
}
void BgHeavyBlock_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c
index dfaca6232e..0f0f99da70 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c
@@ -10,10 +10,13 @@
#include "gfx.h"
#include "gfx_setupdl.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
+#include "z64save.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
@@ -84,9 +87,9 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) {
Actor_SetFocus(&this->actor, 20.0f);
this->type = PARAMS_GET_U(thisx->params, 12, 4);
if (this->type > 6) {
- // "Type is not set"
- PRINTF("Error : object のタイプが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", 352,
- this->actor.params);
+ PRINTF(T("Error : object のタイプが設定されていない",
+ "Error : object type is not set") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_hidan_curtain.c", 352, this->actor.params);
Actor_Kill(&this->actor);
return;
}
@@ -97,9 +100,9 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) {
thisx->params &= 0x3F;
if (DEBUG_FEATURES && ((this->actor.params < 0) || (this->actor.params > 0x3F))) {
- // "Save bit is not set"
- PRINTF("Warning : object のセーブビットが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c",
- 373, this->actor.params);
+ PRINTF(T("Warning : object のセーブビットが設定されていない",
+ "Warning : object save bit is not set") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_hidan_curtain.c", 373, this->actor.params);
}
Actor_SetScale(&this->actor, hcParams->scale);
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c
index b64979766c..885967c2bb 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c
@@ -114,7 +114,7 @@ void BgHidanDalm_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&gFireTempleHammerableTotemCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
Collider_InitTris(play, &this->collider);
- Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems);
+ Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderElements);
this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8);
thisx->params &= 0xFF;
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h
index 39a5d64c99..83cabfaab4 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h
@@ -13,7 +13,7 @@ typedef struct BgHidanDalm {
/* 0x0164 */ BgHidanDalmActionFunc actionFunc;
/* 0x0168 */ u8 switchFlag;
/* 0x016C */ ColliderTris collider;
- /* 0x018C */ ColliderTrisElement colliderItems[4];
+ /* 0x018C */ ColliderTrisElement colliderElements[4];
} BgHidanDalm; // size = 0x02FC
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c
index 26201b24c2..47849aa850 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c
@@ -17,6 +17,7 @@
#include "z_lib.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_hidan_objects/object_hidan_objects.h"
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c
index f882203bd5..d20bccdb71 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c
@@ -6,15 +6,18 @@
#include "z_bg_hidan_hamstep.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "quake.h"
#include "regs.h"
#include "rumble.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "versions.h"
#include "z_lib.h"
#include "z64play.h"
@@ -153,7 +156,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) {
if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) {
Collider_InitTris(play, &this->collider);
- Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderItems);
+ Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderElements);
for (i = 0; i < 2; i++) {
for (i2 = 0; i2 < 3; i2++) {
@@ -192,13 +195,11 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) {
this->dyna.actor.minVelocityY = -12.0f;
if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) {
- // "Fire Temple Object [Hammer Step] appears"
- PRINTF("◯◯◯炎の神殿オブジェクト【ハンマーステップ】出現\n");
+ PRINTF(T("◯◯◯炎の神殿オブジェクト【ハンマーステップ】出現\n", "◯◯◯Fire Temple object [Hammer Step] appears\n"));
if (BgHidanHamstep_SpawnChildren(this, play) == 0) {
step = this;
- // "[Hammer Step] I can't create a step!"
- PRINTF("【ハンマーステップ】 足場産れない!!\n");
+ PRINTF(T("【ハンマーステップ】 足場産れない!!\n", "[Hammer Step] I can't create a step!!\n"));
PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 425);
while (step != NULL) {
@@ -362,8 +363,9 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
#if DEBUG_FEATURES
if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) <= 0 || PARAMS_GET_U(this->dyna.actor.params, 0, 8) >= 6) {
- // "[Hammer Step] arg_data strange (arg_data = %d)"
- PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params);
+ PRINTF(T("【ハンマーステップ】 arg_data おかしい (arg_data = %d)",
+ "[Hammer Step] arg_data strange (arg_data = %d)"),
+ this->dyna.actor.params);
PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 696);
}
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h
index 34c2537203..faf1db7577 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h
@@ -11,7 +11,7 @@ typedef void (*BgHidanHamstepActionFunc)(struct BgHidanHamstep*, struct PlayStat
typedef struct BgHidanHamstep {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderTris collider;
- /* 0x0184 */ ColliderTrisElement colliderItems[2];
+ /* 0x0184 */ ColliderTrisElement colliderElements[2];
/* 0x023C */ BgHidanHamstepActionFunc actionFunc;
/* 0x0240 */ s32 action;
/* 0x0244 */ s32 unk_244;
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c
index 2fae07b984..a4fd5fab33 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c
@@ -95,7 +95,7 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) {
this->unk_16A = PARAMS_GET_U(thisx->params, 0, 6);
thisx->params = PARAMS_GET_U(thisx->params, 8, 8);
Collider_InitTris(play, &this->collider);
- Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems);
+ Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderElements);
DynaPolyActor_Init(&this->dyna, 0);
sinRotY = Math_SinS(thisx->shape.rot.y);
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h
index 892e44865b..955ddd5dfc 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h
@@ -14,7 +14,7 @@ typedef struct BgHidanHrock {
/* 0x0168 */ s16 unk_168;
/* 0x016A */ u8 unk_16A;
/* 0x016C */ ColliderTris collider;
- /* 0x018C */ ColliderTrisElement colliderItems[2];
+ /* 0x018C */ ColliderTrisElement colliderElements[2];
} BgHidanHrock; // size = 0x0244
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c
index bce57124eb..8148f8ca0d 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c
@@ -10,8 +10,10 @@
#include "gfx_setupdl.h"
#include "ichain.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
@@ -79,14 +81,15 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, 0);
Actor_SetFocus(thisx, 50.0f);
- PRINTF("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params,
- PARAMS_GET_U(thisx->params, 0, 8), PARAMS_GET_U((s32)thisx->params, 8, 8));
+ PRINTF(T("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n",
+ "◯◯◯ Fire Temple object [lattice (arg_data : %0x)] appeared (%d %d)\n"),
+ thisx->params, PARAMS_GET_U(thisx->params, 0, 8), PARAMS_GET_U((s32)thisx->params, 8, 8));
Actor_ProcessInitChain(thisx, sInitChain);
#if DEBUG_FEATURES
if (PARAMS_GET_U(thisx->params, 0, 8) < 0 || PARAMS_GET_U(thisx->params, 0, 8) >= 3) {
- PRINTF("arg_data おかしい 【格子】\n");
+ PRINTF(T("arg_data おかしい 【格子】\n", "arg_data is strange [lattice]\n"));
}
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c
index 25263fd571..7663c13aa0 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c
@@ -11,8 +11,10 @@
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
+#include "printf.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64effect.h"
#include "z64play.h"
@@ -103,7 +105,7 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, PlayState
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
this->collider.elements[0].dim.modelSphere.radius = sphereRadii[PARAMS_GET_U(this->dyna.actor.params, 0, 8)];
this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[PARAMS_GET_U(this->dyna.actor.params, 0, 8)];
@@ -129,9 +131,10 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) {
if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) < CRACKED_STONE_FLOOR ||
PARAMS_GET_U(this->dyna.actor.params, 0, 8) > LARGE_BOMBABLE_WALL) {
- // "Error: Fire Temple Breakable Walls. arg_data I can't determine the (%s %d)(arg_data 0x%04x)"
- PRINTF("Error : 炎の神殿 壊れる壁 の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n",
- "../z_bg_hidan_kowarerukabe.c", 254, this->dyna.actor.params);
+ PRINTF(
+ T("Error : 炎の神殿 壊れる壁 の arg_data が判別出来ない",
+ "Error : arg_data for the Fire Temple breakable wall cannot be determined") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_hidan_kowarerukabe.c", 254, this->dyna.actor.params);
Actor_Kill(&this->dyna.actor);
return;
}
@@ -145,8 +148,8 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->dyna.actor, 0.1f);
BgHidanKowarerukabe_InitColliderSphere(this, play);
BgHidanKowarerukabe_OffsetActorYPos(this);
- // "(fire walls, floors, destroyed by bombs)(arg_data 0x%04x)"
- PRINTF("(hidan 爆弾で壊れる 壁 床)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("(hidan 爆弾で壊れる 壁 床)", "(hidan bomb destroys walls and floors)") "(arg_data 0x%04x)\n",
+ this->dyna.actor.params);
}
void BgHidanKowarerukabe_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h
index 4fc6befab2..7257a210f1 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h
@@ -9,7 +9,7 @@ struct BgHidanKowarerukabe;
typedef struct BgHidanKowarerukabe {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderJntSph collider;
- /* 0x0184 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0184 */ ColliderJntSphElement colliderElements[1];
} BgHidanKowarerukabe; // size = 0x01C4
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c
index b162af3792..0b64a4ff6b 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c
@@ -6,6 +6,7 @@
#include "z_bg_hidan_rsekizou.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
@@ -141,8 +142,8 @@ void BgHidanRsekizou_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&gFireTempleSpinningFlamethrowerCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
- for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) {
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
+ for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius;
}
this->burnFrame = 0;
@@ -178,7 +179,7 @@ void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) {
yawSine = Math_SinS(this->dyna.actor.shape.rot.y);
yawCosine = Math_CosS(this->dyna.actor.shape.rot.y);
- for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) {
+ for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
sphere = &this->collider.elements[i];
sphere->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + yawCosine * sphere->dim.modelSphere.center.x +
yawSine * sphere->dim.modelSphere.center.z;
@@ -244,7 +245,7 @@ void BgHidanRsekizou_Draw(Actor* thisx, PlayState* play) {
MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_bg_hidan_rsekizou.c", 568);
gSPDisplayList(POLY_OPA_DISP++, gFireTempleSpinningFlamethrowerDL);
- Matrix_MtxFCopy(&mf, &gMtxFClear);
+ Matrix_MtxFCopy(&mf, &gIdentityMtxF);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20);
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h
index 13ce01a7f5..82725e4fc1 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h
@@ -11,7 +11,7 @@ typedef struct BgHidanRsekizou {
/* 0x0164 */ s16 bendFrame;
/* 0x0166 */ s16 burnFrame;
/* 0x0168 */ ColliderJntSph collider;
- /* 0x0188 */ ColliderJntSphElement colliderItems[6];
+ /* 0x0188 */ ColliderJntSphElement colliderElements[6];
} BgHidanRsekizou; // size = 0x0308
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c
index 117064ffb4..452c88f5f4 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c
@@ -6,6 +6,7 @@
#include "z_bg_hidan_sekizou.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
@@ -165,8 +166,8 @@ void BgHidanSekizou_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->elements);
- for (i = 0; i < ARRAY_COUNT(this->elements); i++) {
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
+ for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius;
}
if (this->dyna.actor.params == 0) {
@@ -221,7 +222,7 @@ void func_8088D434(BgHidanSekizou* this, PlayState* play) {
}
}
}
- for (i = 3 * phi_s4; i < ARRAY_COUNT(this->elements); i++) {
+ for (i = 3 * phi_s4; i < ARRAY_COUNT(this->colliderElements); i++) {
this->collider.elements[i].base.atElemFlags &= ~ATELEM_ON;
this->collider.elements[i].base.ocElemFlags &= ~OCELEM_ON;
}
@@ -360,7 +361,7 @@ Gfx* func_8088DC50(PlayState* play, BgHidanSekizou* this, s16 arg2, s16 arg3, Gf
}
temp_f20 = Math_SinS(arg2);
temp_f22 = Math_CosS(arg2);
- Matrix_MtxFCopy(&sp68, &gMtxFClear);
+ Matrix_MtxFCopy(&sp68, &gIdentityMtxF);
temp_v1 = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - arg2;
if (ABS(temp_v1) < 0x4000) {
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h
index 45aef4e922..c898f9d934 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h
@@ -14,7 +14,7 @@ typedef struct BgHidanSekizou {
/* 0x0168 */ s16 unk_168[4];
/* 0x0170 */ s16 unk_170;
/* 0x0174 */ ColliderJntSph collider;
- /* 0x0194 */ ColliderJntSphElement elements[6];
+ /* 0x0194 */ ColliderJntSphElement colliderElements[6];
} BgHidanSekizou; // size = 0x0314
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c
index 06f5b2a308..f166f9f4d8 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c
@@ -5,6 +5,19 @@
*/
#include "z_bg_hidan_sima.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_hidan_objects/object_hidan_objects.h"
#define FLAGS 0
@@ -95,7 +108,7 @@ void BgHidanSima_Init(Actor* thisx, PlayState* play) {
}
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->elements);
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
for (i = 0; i < ARRAY_COUNT(sJntSphElementsInit); i++) {
this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius;
}
@@ -233,7 +246,7 @@ Gfx* func_8088EB54(PlayState* play, BgHidanSima* this, Gfx* gfx) {
f32 sin;
s32 pad[2];
- Matrix_MtxFCopy(&mtxF, &gMtxFClear);
+ Matrix_MtxFCopy(&mtxF, &gIdentityMtxF);
cos = Math_CosS(this->dyna.actor.world.rot.y + 0x8000);
sin = Math_SinS(this->dyna.actor.world.rot.y + 0x8000);
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h
index 927391110b..dd64b556b0 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h
@@ -2,18 +2,18 @@
#define Z_BG_HIDAN_SIMA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgHidanSima;
-typedef void (*BgHidanSimaActionFunc)(struct BgHidanSima*, PlayState*);
+typedef void (*BgHidanSimaActionFunc)(struct BgHidanSima*, struct PlayState*);
typedef struct BgHidanSima {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgHidanSimaActionFunc actionFunc;
/* 0x0168 */ s16 timer;
/* 0x016C */ ColliderJntSph collider;
- /* 0x018C */ ColliderJntSphElement elements[2];
+ /* 0x018C */ ColliderJntSphElement colliderElements[2];
} BgHidanSima; // size = 0x020C
#endif
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c
index e1a7007068..d21b1e8212 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c
+++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c
@@ -5,6 +5,11 @@
*/
#include "z_bg_hidan_syoku.h"
+
+#include "ichain.h"
+#include "sfx.h"
+#include "z64play.h"
+
#include "assets/objects/object_hidan_objects/object_hidan_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h
index 61e3520b76..2ce3fbfd4e 100644
--- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h
+++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h
@@ -2,11 +2,11 @@
#define Z_BG_HIDAN_SYOKU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgHidanSyoku;
-typedef void (*BgHidanSyokuActionFunc)(struct BgHidanSyoku*, PlayState*);
+typedef void (*BgHidanSyokuActionFunc)(struct BgHidanSyoku*, struct PlayState*);
typedef struct BgHidanSyoku {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c
index 15163c9842..6bfd39e4e5 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c
+++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c
@@ -5,6 +5,16 @@
*/
#include "z_bg_ice_objects.h"
+
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_ice_objects/object_ice_objects.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h
index 13a2334c39..364b087852 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h
+++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h
@@ -2,11 +2,11 @@
#define Z_BG_ICE_OBJECTS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgIceObjects;
-typedef void (*BgIceObjectsActionFunc) (struct BgIceObjects*, PlayState*);
+typedef void (*BgIceObjectsActionFunc) (struct BgIceObjects*, struct PlayState*);
typedef struct BgIceObjects {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c
index 39c891ab4f..102e2e3ba5 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c
+++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c
@@ -5,6 +5,19 @@
*/
#include "z_bg_ice_shelter.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_ice_objects/object_ice_objects.h"
#define FLAGS 0
@@ -124,9 +137,9 @@ void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHea
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG registration failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_ice_shelter.c", 362,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_ice_shelter.c", 362, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h
index 765b017b32..30286a64d1 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h
+++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h
@@ -2,11 +2,11 @@
#define Z_BG_ICE_SHELTER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgIceShelter;
-typedef void (*BgIceShelterActionFunc)(struct BgIceShelter*, PlayState*);
+typedef void (*BgIceShelterActionFunc)(struct BgIceShelter*, struct PlayState*);
typedef enum RedIceType {
/* 0 */ RED_ICE_LARGE, // Large red ice block
diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c
index d00358e230..20176f2758 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c
+++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c
@@ -5,6 +5,13 @@
*/
#include "z_bg_ice_shutter.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_ice_objects/object_ice_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h
index db8a7ff61c..aad63d435b 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h
+++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h
@@ -2,11 +2,11 @@
#define Z_BG_ICE_SHUTTER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgIceShutter;
-typedef void (*BgIceShutterActionFunc)(struct BgIceShutter*, PlayState*);
+typedef void (*BgIceShutterActionFunc)(struct BgIceShutter*, struct PlayState*);
typedef struct BgIceShutter {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c
index 094f585645..8fb200aca5 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c
+++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c
@@ -5,6 +5,15 @@
*/
#include "z_bg_ice_turara.h"
+
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_ice_objects/object_ice_objects.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h
index eaa6cc843f..46a78eb738 100644
--- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h
+++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h
@@ -2,11 +2,11 @@
#define Z_BG_ICE_TURARA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgIceTurara;
-typedef void (*BgIceTuraraActionFunc)(struct BgIceTurara*, PlayState*);
+typedef void (*BgIceTuraraActionFunc)(struct BgIceTurara*, struct PlayState*);
typedef enum BgIceTuraraType {
/* 0 */ TURARA_STALAGMITE,
diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
index dc5b9323e3..e46139117c 100644
--- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
+++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_ingate.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_ingate/object_ingate.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h
index 2137cc6464..c9f46446ab 100644
--- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h
+++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h
@@ -2,11 +2,11 @@
#define Z_BG_INGATE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgInGate;
-typedef void (*BgInGateActionFunc)(struct BgInGate*, PlayState*);
+typedef void (*BgInGateActionFunc)(struct BgInGate*, struct PlayState*);
typedef struct BgInGate {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c
index 7963199d74..58cd7278ad 100644
--- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c
+++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c
@@ -5,6 +5,15 @@
*/
#include "z_bg_jya_1flift.h"
+
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -78,9 +87,9 @@ void BgJya1flift_InitDynapoly(BgJya1flift* this, PlayState* play, CollisionHeade
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG login failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_1flift.c", 179,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_1flift.c", 179, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -95,8 +104,7 @@ void BgJya1flift_InitCollision(Actor* thisx, PlayState* play) {
void BgJya1flift_Init(Actor* thisx, PlayState* play) {
BgJya1flift* this = (BgJya1flift*)thisx;
- // "1 F lift"
- PRINTF("(1Fリフト)(flag %d)(room %d)\n", sIsSpawned, play->roomCtx.curRoom.num);
+ PRINTF(T("(1Fリフト)", "1F lift") "(flag %d)(room %d)\n", sIsSpawned, play->roomCtx.curRoom.num);
this->hasInitialized = false;
if (sIsSpawned) {
Actor_Kill(thisx);
diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h
index 31ce5a7f4d..8d772757bf 100644
--- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h
+++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h
@@ -2,11 +2,11 @@
#define Z_BG_JYA_1FLIFT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJya1flift;
-typedef void (*BgJya1fliftActionFunc)(struct BgJya1flift*, PlayState*);
+typedef void (*BgJya1fliftActionFunc)(struct BgJya1flift*, struct PlayState*);
typedef struct BgJya1flift {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c
index 23f5658ce8..ee9487d2ef 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_jya_amishutter.h"
+
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0
@@ -54,8 +62,9 @@ void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, PlayState* play, Collis
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_amishutter.c", 129,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_amishutter.c", 129, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h
index e15a42fe88..1dad4c1543 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h
@@ -2,7 +2,7 @@
#define Z_BG_JYA_AMISHUTTER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaAmishutter;
diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c
index ecdf4aa4de..f2955f3050 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c
@@ -5,6 +5,15 @@
*/
#include "z_bg_jya_bigmirror.h"
+#include "overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z64play.h"
+
#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -76,8 +85,8 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, PlayState* play) {
#if DEBUG_FEATURES
if (curCobraInfo->cobra->dyna.actor.update == NULL) {
- // "Cobra deleted"
- PRINTF("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203);
+ PRINTF("Error : " T("コブラ削除された", "Cobra deleted") " (%s %d)\n", "../z_bg_jya_bigmirror.c",
+ 203);
}
#endif
} else {
@@ -87,8 +96,8 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, PlayState* play) {
this->actor.child = NULL;
if (curCobraInfo->cobra == NULL) {
- // "Cobra generation failed"
- PRINTF("Error : コブラ発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 221);
+ PRINTF("Error : " T("コブラ発生失敗", "Cobra generation failed") " (%s %d)\n",
+ "../z_bg_jya_bigmirror.c", 221);
}
}
}
@@ -155,8 +164,8 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
#if DEBUG_FEATURES
if (this->lightBeams[i] == NULL) {
- // "Mir Ray generation failed"
- PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310);
+ PRINTF("Error : " T("Mir Ray 発生失敗", "Mir Ray generation failed") " (%s %d)\n",
+ "../z_bg_jya_bigmirror.c", 310);
}
#endif
}
@@ -187,8 +196,7 @@ void BgJyaBigmirror_Init(Actor* thisx, PlayState* play) {
this->spawned = true;
this->mirRayObjectSlot = -1;
- // "jya Bigmirror"
- PRINTF("(jya 大鏡)(arg_data 0x%04x)\n", this->actor.params);
+ PRINTF("(jya " T("大鏡", "Big mirror") ")(arg_data 0x%04x)\n", this->actor.params);
}
void BgJyaBigmirror_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h
index 52f2b95930..56b6d8db07 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h
@@ -2,8 +2,7 @@
#define Z_BG_JYA_BIGMIRROR_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h"
+#include "z64actor.h"
#define BIGMIR_PUZZLE_COBRA1_SOLVED (1 << 0)
#define BIGMIR_PUZZLE_COBRA2_SOLVED (1 << 1)
@@ -15,7 +14,7 @@
struct BgJyaBigmirror;
typedef struct BigmirrorCobra {
- /* 0x00 */ BgJyaCobra* cobra;
+ /* 0x00 */ struct BgJyaCobra* cobra;
/* 0x04 */ s16 rotY;
} BigmirrorCobra; // size = 0x08
diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c
index eea63927ed..946db1b05c 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c
@@ -5,6 +5,16 @@
*/
#include "z_bg_jya_block.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h
index 2d58de5c12..641141945a 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h
@@ -2,7 +2,7 @@
#define Z_BG_JYA_BLOCK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaBlock;
diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c
index cd177d8044..73108e43d0 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c
@@ -1,5 +1,19 @@
#include "z_bg_jya_bombchuiwa.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS ACTOR_FLAG_ATTENTION_ENABLED
@@ -65,7 +79,7 @@ void BgJyaBombchuiwa_SetupCollider(BgJyaBombchuiwa* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, &this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
}
void BgJyaBombchuiwa_SetDrawFlags(BgJyaBombchuiwa* this, u8 drawFlags) {
@@ -181,9 +195,8 @@ void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, PlayState* play) {
BgJyaBombchuiwa_SetDrawFlags(this, 4);
if (Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 0) == NULL) {
- // "Occurrence failure"
- PRINTF("Error : Mir_Ray 発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_jya_bombchuiwa.c", 410,
- this->actor.params);
+ PRINTF(T("Error : Mir_Ray 発生失敗", "Error : Mir_Ray failed to occur") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_bombchuiwa.c", 410, this->actor.params);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h
index e936167100..ad9b9c33db 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h
@@ -2,17 +2,17 @@
#define Z_BG_JYA_BOMBCHUIWA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaBombchuiwa;
-typedef void (*BgJyaBombchuiwaActionFunc)(struct BgJyaBombchuiwa*, PlayState*);
+typedef void (*BgJyaBombchuiwaActionFunc)(struct BgJyaBombchuiwa*, struct PlayState*);
typedef struct BgJyaBombchuiwa {
/* 0x0000 */ Actor actor;
/* 0x014C */ BgJyaBombchuiwaActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement colliderItems;
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
/* 0x01B0 */ f32 lightRayIntensity;
/* 0x01B4 */ s16 timer;
/* 0x01B6 */ u8 drawFlags; // Used to determine how the actor is drawn.
diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c
index c94ee924b1..5a01066a3c 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c
@@ -6,8 +6,17 @@
#include "z_bg_jya_bombiwa.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
-#include "assets/objects/object_jya_obj/object_jya_obj.h"
+
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64effect.h"
+#include "z64play.h"
+
+#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0
@@ -74,9 +83,9 @@ void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHe
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning: move BG registration failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_bombiwa.c", 174,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_bombiwa.c", 174, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -85,7 +94,7 @@ void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
}
void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) {
@@ -93,10 +102,9 @@ void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) {
if (PARAMS_GET_U(this->dyna.actor.params, 0, 6) != 0x29) {
PRINTF_COLOR_WARNING();
-
- // "Warning: Switch Number changed (%s %d)(SW %d)"
- PRINTF("Warning : Switch Number が変更された(%s %d)(SW %d)\n", "../z_bg_jya_bombiwa.c", 218,
- PARAMS_GET_U(this->dyna.actor.params, 0, 6));
+ PRINTF(T("Warning : Switch Number が変更された",
+ "Warning : Switch Number has been changed") "(%s %d)(SW %d)\n",
+ "../z_bg_jya_bombiwa.c", 218, PARAMS_GET_U(this->dyna.actor.params, 0, 6));
PRINTF_RST();
}
BgJyaBombiwa_SetupDynaPoly(this, play, &gBombiwaCol, 0);
@@ -106,8 +114,7 @@ void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) {
} else {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
- // "Rock destroyed by jya bomb"
- PRINTF("(jya 爆弾で破壊岩)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("(jya 爆弾で破壊岩)", "(jya bomb destroys rocks)") "(arg_data 0x%04x)\n", this->dyna.actor.params);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h
index 879291f87c..9f06d9a1d6 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h
@@ -2,8 +2,7 @@
#define Z_BG_JYA_BOMBIWA_H
#include "ultra64.h"
-#include "global.h"
-
+#include "z64actor.h"
struct BgJyaBombiwa;
@@ -11,7 +10,7 @@ typedef struct BgJyaBombiwa {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ s32 unk_164;
/* 0x0168 */ ColliderJntSph collider;
- /* 0x0188 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0188 */ ColliderJntSphElement colliderElements[1];
} BgJyaBombiwa; // size = 0x01C8
#endif
diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c
index c32bd92896..0a087d91d9 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c
@@ -1,8 +1,20 @@
#include "z_bg_jya_cobra.h"
#include "overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h"
#include "overlays/actors/ovl_Mir_Ray/z_mir_ray.h"
-#include "assets/objects/object_jya_obj/object_jya_obj.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -127,9 +139,9 @@ void BgJyaCobra_InitDynapoly(BgJyaCobra* this, PlayState* play, CollisionHeader*
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG Registration Failure"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_cobra.c", 247,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_cobra.c", 247, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -141,8 +153,8 @@ void BgJyaCobra_SpawnRay(BgJyaCobra* this, PlayState* play) {
#if DEBUG_FEATURES
if (this->dyna.actor.child == NULL) {
PRINTF_COLOR_RED();
- // "Error : Mir Ray occurrence failure"
- PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_cobra.c", 270);
+ PRINTF(T("Error : Mir Ray 発生失敗", "Error : Mir Ray failed to occur") " (%s %d)\n",
+ "../z_bg_jya_cobra.c", 270);
PRINTF_RST();
}
#endif
@@ -427,8 +439,7 @@ void BgJyaCobra_Init(Actor* thisx, PlayState* play) {
BgJyaCobra_UpdateShadowFromTop(this);
}
- // "(jya cobra)"
- PRINTF("(jya コブラ)(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n", this->dyna.actor.params, this,
+ PRINTF("(jya " T("コブラ", "cobra") ")(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n", this->dyna.actor.params, this,
&this->shadowTextureBuffer, COBRA_SHADOW_TEX_PTR(this));
}
diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h
index 8722bcc2ce..32266e2ac4 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h
@@ -2,11 +2,11 @@
#define Z_BG_JYA_COBRA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaCobra;
-typedef void (*BgJyaCobraActionFunc)(struct BgJyaCobra*, PlayState*);
+typedef void (*BgJyaCobraActionFunc)(struct BgJyaCobra*, struct PlayState*);
#define COBRA_SHADOW_TEX_WIDTH 64
#define COBRA_SHADOW_TEX_HEIGHT 64
diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c
index 9122ebfcf9..6d6b13efb8 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c
@@ -6,6 +6,13 @@
*/
#include "z_bg_jya_goroiwa.h"
+
+#include "ichain.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_goroiwa/object_goroiwa.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -83,7 +90,7 @@ void BgJyaGoroiwa_InitCollider(BgJyaGoroiwa* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, &this->colliderItem);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
BgJyaGoroiwa_UpdateCollider(this);
this->collider.elements[0].dim.worldSphere.radius = 58;
}
diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h
index 2722475480..35f4c971c9 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h
@@ -2,17 +2,17 @@
#define Z_BG_JYA_GOROIWA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaGoroiwa;
-typedef void (*BgJyaGoroiwaFunc)(struct BgJyaGoroiwa*, PlayState*);
+typedef void (*BgJyaGoroiwaFunc)(struct BgJyaGoroiwa*, struct PlayState*);
typedef struct BgJyaGoroiwa {
/* 0x0000 */ Actor actor;
/* 0x014C */ BgJyaGoroiwaFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement colliderItem;
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
/* 0x01B0 */ f32 speedFactor;
/* 0x01B4 */ s16 hasHit;
/* 0x01B6 */ s16 waitTimer;
diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c
index f327e15f8c..b9350da300 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c
@@ -6,6 +6,15 @@
#include "z_bg_jya_haheniron.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_jya_iron/object_jya_iron.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -79,7 +88,7 @@ void BgJyaHaheniron_ColliderInit(BgJyaHaheniron* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
}
void BgJyaHaheniron_SpawnFragments(PlayState* play, Vec3f* vec1, Vec3f* vec2) {
diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h
index 60f9c6ef9e..2da7d3673f 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h
@@ -2,17 +2,17 @@
#define Z_BG_JYA_HAHENIRON_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaHaheniron;
-typedef void (*BgJyaHahenironActionFunc)(struct BgJyaHaheniron*, PlayState*);
+typedef void (*BgJyaHahenironActionFunc)(struct BgJyaHaheniron*, struct PlayState*);
typedef struct BgJyaHaheniron {
/* 0x0000 */ Actor actor;
/* 0x014C */ BgJyaHahenironActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
/* 0x01B0 */ s16 timer;
} BgJyaHaheniron; // size = 0x01B4
diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c
index e5a8e139ba..cb326593a7 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c
@@ -5,9 +5,20 @@
*/
#include "z_bg_jya_ironobj.h"
-#include "assets/objects/object_jya_iron/object_jya_iron.h"
#include "overlays/actors/ovl_En_Ik/z_en_ik.h"
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
+#include "assets/objects/object_jya_iron/object_jya_iron.h"
+
#define FLAGS 0
typedef void (*BgJyaIronobjIkFunc)(BgJyaIronobj*, PlayState*, EnIk*);
@@ -80,13 +91,13 @@ static InitChainEntry sInitChain[] = {
static CollisionHeader* sCollisionHeaders[] = { &gPillarCol, &gThroneCol };
void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) {
- ColliderCylinder* colCylinder = &this->colCylinder;
+ ColliderCylinder* colCylinder = &this->colliderCylinder;
Collider_InitCylinder(play, colCylinder);
Collider_SetCylinder(play, colCylinder, &this->dyna.actor, &sCylinderInit);
if (PARAMS_GET_U(this->dyna.actor.params, 0, 1) == 1) {
- this->colCylinder.dim.radius = 40;
- this->colCylinder.dim.height = 100;
+ this->colliderCylinder.dim.radius = 40;
+ this->colliderCylinder.dim.height = 100;
}
Collider_UpdateCylinder(&this->dyna.actor, colCylinder);
}
@@ -108,7 +119,8 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk
#if DEBUG_FEATURES
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
- PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233);
+ PRINTF(T("Error 攻撃方法が分からない(%s %d)\n", "Error I don't know how to attack(%s %d)\n"),
+ "../z_bg_jya_ironobj.c", 233);
return;
}
#endif
@@ -174,7 +186,8 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk
#if DEBUG_FEATURES
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
- PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362);
+ PRINTF(T("Error 攻撃方法が分からない(%s %d)\n", "Error I don't know how to attack(%s %d)\n"),
+ "../z_bg_jya_ironobj.c", 362);
return;
}
#endif
@@ -235,7 +248,7 @@ void BgJyaIronobj_Init(Actor* thisx, PlayState* play) {
void BgJyaIronobj_Destroy(Actor* thisx, PlayState* play) {
BgJyaIronobj* this = (BgJyaIronobj*)thisx;
- Collider_DestroyCylinder(play, &this->colCylinder);
+ Collider_DestroyCylinder(play, &this->colliderCylinder);
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
@@ -249,9 +262,9 @@ void func_808992E8(BgJyaIronobj* this, PlayState* play) {
Vec3f dropPos;
s32 i;
- if (this->colCylinder.base.acFlags & AC_HIT) {
- actor = this->colCylinder.base.ac;
- this->colCylinder.base.acFlags &= ~AC_HIT;
+ if (this->colliderCylinder.base.acFlags & AC_HIT) {
+ actor = this->colliderCylinder.base.ac;
+ this->colliderCylinder.base.acFlags &= ~AC_HIT;
if (actor != NULL && actor->id == ACTOR_EN_IK) {
particleFunc[PARAMS_GET_U(this->dyna.actor.params, 0, 1)](this, play, (EnIk*)actor);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR);
@@ -266,7 +279,7 @@ void func_808992E8(BgJyaIronobj* this, PlayState* play) {
return;
}
} else {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h
index a8189049af..9768aec2a5 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h
@@ -2,16 +2,16 @@
#define Z_BG_JYA_IRONOBJ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaIronobj;
-typedef void (*BgJyaIronobjActionFunc)(struct BgJyaIronobj*, PlayState*);
+typedef void (*BgJyaIronobjActionFunc)(struct BgJyaIronobj*, struct PlayState*);
typedef struct BgJyaIronobj {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgJyaIronobjActionFunc actionFunc;
- /* 0x0168 */ ColliderCylinder colCylinder;
+ /* 0x0168 */ ColliderCylinder colliderCylinder;
} BgJyaIronobj; // size = 0x01B4
#endif
diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c
index 459e3f11af..354c17b94b 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c
@@ -5,8 +5,17 @@
*/
#include "z_bg_jya_kanaami.h"
-#include "assets/objects/object_jya_obj/object_jya_obj.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
#include "quake.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
+#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0
@@ -52,8 +61,9 @@ void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, PlayState* play, CollisionHea
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_kanaami.c", 145, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -68,7 +78,7 @@ void BgJyaKanaami_Init(Actor* thisx, PlayState* play) {
} else {
func_80899880(this);
}
- PRINTF("(jya 金網)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF("(jya " T("金網", "wire mesh") ")(arg_data 0x%04x)\n", this->dyna.actor.params);
}
void BgJyaKanaami_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h
index 6e5d670fde..a125e8ef53 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h
@@ -2,11 +2,11 @@
#define Z_BG_JYA_KANAAMI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaKanaami;
-typedef void (*BgJyaKanaamiActionFunc)(struct BgJyaKanaami*, PlayState*);
+typedef void (*BgJyaKanaamiActionFunc)(struct BgJyaKanaami*, struct PlayState*);
typedef struct BgJyaKanaami {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c
index 2d1092c8e5..dd8b162bd7 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c
@@ -5,6 +5,15 @@
*/
#include "z_bg_jya_lift.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -59,8 +68,7 @@ void BgJyaLift_Init(Actor* thisx, PlayState* play) {
return;
}
- // "Goddess lift CT"
- PRINTF("女神リフト CT\n");
+ PRINTF(T("女神リフト CT\n", "Goddess lift CT\n"));
BgJyaLift_InitDynapoly(this, play, &gLiftCol, 0);
Actor_ProcessInitChain(thisx, sInitChain);
if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) {
@@ -78,8 +86,7 @@ void BgJyaLift_Destroy(Actor* thisx, PlayState* play) {
if (this->isSpawned) {
- // "Goddess Lift DT"
- PRINTF("女神リフト DT\n");
+ PRINTF(T("女神リフト DT\n", "Goddess lift DT\n"));
sIsSpawned = false;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h
index b6c951dc18..ea9abac2bf 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h
@@ -2,10 +2,10 @@
#define Z_BG_JYA_LIFT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaLift;
-typedef void (*BgJyaLiftActionFunc)(struct BgJyaLift*, PlayState*);
+typedef void (*BgJyaLiftActionFunc)(struct BgJyaLift*, struct PlayState*);
typedef struct BgJyaLift {
/* 0x000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c
index 546f8c8d64..a72f245e22 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c
@@ -6,6 +6,20 @@
#include "z_bg_jya_megami.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS 0
@@ -123,7 +137,7 @@ void BgJyaMegami_InitCollider(BgJyaMegami* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, &this->colliderItem);
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
}
void BgJyaMegami_SpawnEffect(PlayState* play, Vec3f* pos, Vec3f* velocity, s32 num, s32 arg4) {
diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h
index b24f236013..e297ebb63a 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h
@@ -2,11 +2,11 @@
#define Z_BG_JYA_MEGAMI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaMegami;
-typedef void (*BgJyaMegamiActionFunc)(struct BgJyaMegami*, PlayState*);
+typedef void (*BgJyaMegamiActionFunc)(struct BgJyaMegami*, struct PlayState*);
typedef struct BgJyaMegamiPiece {
/* 0x00 */ Vec3f pos;
@@ -19,7 +19,7 @@ typedef struct BgJyaMegami {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgJyaMegamiActionFunc actionFunc;
/* 0x0168 */ ColliderJntSph collider;
- /* 0x0188 */ ColliderJntSphElement colliderItem;
+ /* 0x0188 */ ColliderJntSphElement colliderElements[1];
/* 0x01C8 */ s16 lightTimer;
/* 0x01CA */ s16 explosionTimer;
/* 0x01CC */ s16 crumbleIndex;
diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c
index bbdc93c2f8..e9cfd701a2 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c
+++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c
@@ -5,8 +5,18 @@
*/
#include "z_bg_jya_zurerukabe.h"
-#include "assets/objects/object_jya_obj/object_jya_obj.h"
+
+#include "array_count.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_jya_obj/object_jya_obj.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -71,8 +81,9 @@ void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, PlayState* play, Collis
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_zurerukabe.c", 194,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_zurerukabe.c", 194, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -126,14 +137,14 @@ void BgJyaZurerukabe_Init(Actor* thisx, PlayState* play) {
if (i == ARRAY_COUNT(D_8089B9F0)) {
PRINTF_COLOR_ERROR();
- PRINTF("home pos が変更されたみたい(%s %d)(arg_data 0x%04x)\n", "../z_bg_jya_zurerukabe.c", 299,
- this->dyna.actor.params);
+ PRINTF(T("home pos が変更されたみたい", "It seems that the home pos has changed") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_jya_zurerukabe.c", 299, this->dyna.actor.params);
PRINTF_RST();
}
this->unk_16E = D_8089B9F8[this->unk_168];
func_8089B7B4(this);
- PRINTF("(jya ずれる壁)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF("(jya " T("ずれる壁", "sliding wall") ")(arg_data 0x%04x)\n", this->dyna.actor.params);
}
void BgJyaZurerukabe_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h
index 683f681999..d9d920f57b 100644
--- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h
+++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h
@@ -2,11 +2,11 @@
#define Z_BG_JYA_ZURERUKABE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgJyaZurerukabe;
-typedef void (*BgJyaZurerukabeActionFunc)(struct BgJyaZurerukabe*, PlayState*);
+typedef void (*BgJyaZurerukabeActionFunc)(struct BgJyaZurerukabe*, struct PlayState*);
typedef struct BgJyaZurerukabe {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c
index e44f561d83..79102a7c12 100644
--- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c
+++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c
@@ -5,6 +5,15 @@
*/
#include "z_bg_menkuri_eye.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_menkuri_objects/object_menkuri_objects.h"
#define FLAGS ACTOR_FLAG_DRAW_CULLING_DISABLED
@@ -65,7 +74,7 @@ void BgMenkuriEye_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h
index cf27ca1827..69f1e32eab 100644
--- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h
+++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h
@@ -2,7 +2,7 @@
#define Z_BG_MENKURI_EYE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMenkuriEye;
@@ -10,7 +10,7 @@ typedef struct BgMenkuriEye {
/* 0x0000 */ Actor actor;
/* 0x014C */ s16 framesUntilDisable;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
} BgMenkuriEye; // size = 0x01B0
#endif
diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c
index cb3c724cf5..ee3f35a1db 100644
--- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c
+++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c
@@ -5,6 +5,11 @@
*/
#include "z_bg_menkuri_kaiten.h"
+
+#include "ichain.h"
+#include "sfx.h"
+#include "z64play.h"
+
#include "assets/objects/object_menkuri_objects/object_menkuri_objects.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h
index c65b08d6e9..5bcdbf8ec4 100644
--- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h
+++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h
@@ -2,7 +2,7 @@
#define Z_BG_MENKURI_KAITEN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMenkuriKaiten;
diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c
index 589ecd6d7a..ff13454557 100644
--- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c
+++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c
@@ -5,6 +5,9 @@
*/
#include "z_bg_menkuri_nisekabe.h"
+
+#include "z64play.h"
+
#include "assets/objects/object_menkuri_objects/object_menkuri_objects.h"
#define FLAGS 0
@@ -51,7 +54,7 @@ void BgMenkuriNisekabe_Draw(Actor* thisx, PlayState* play) {
BgMenkuriNisekabe* this = (BgMenkuriNisekabe*)thisx;
u32 index = PARAMS_GET_U(this->actor.params, 0, 8);
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
Gfx_DrawDListXlu(play, sDLists[index]);
} else {
Gfx_DrawDListOpa(play, sDLists[index]);
diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h
index f7cb56a5bf..54cce56eff 100644
--- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h
+++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h
@@ -2,7 +2,7 @@
#define Z_BG_MENKURI_NISEKABE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMenkuriNisekabe;
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c
index 2bcc1974b2..7dc55fbe02 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c
+++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c
@@ -6,6 +6,19 @@
#include "z_bg_mizu_bwall.h"
#include "overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_mizu_objects/object_mizu_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -196,9 +209,11 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
this->actionFunc = BgMizuBwall_DoNothing;
} else {
Collider_InitTris(play, &this->collider);
- if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitFloor, this->elements)) {
- PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 484,
- this->dyna.actor.params);
+ if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitFloor,
+ this->colliderElements)) {
+ PRINTF(T("Error : コリジョンデータセット失敗",
+ "Error : Collision data set failure") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_mizu_bwall.c", 484, this->dyna.actor.params);
Actor_Kill(&this->dyna.actor);
} else {
sin = Math_SinS(this->dyna.actor.shape.rot.y);
@@ -235,9 +250,11 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
this->actionFunc = BgMizuBwall_DoNothing;
} else {
Collider_InitTris(play, &this->collider);
- if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitRutoWall, this->elements)) {
- PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 558,
- this->dyna.actor.params);
+ if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitRutoWall,
+ this->colliderElements)) {
+ PRINTF(T("Error : コリジョンデータセット失敗",
+ "Error : Collision data set failure") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_mizu_bwall.c", 558, this->dyna.actor.params);
Actor_Kill(&this->dyna.actor);
} else {
sin = Math_SinS(this->dyna.actor.shape.rot.y);
@@ -274,9 +291,11 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
this->actionFunc = BgMizuBwall_DoNothing;
} else {
Collider_InitTris(play, &this->collider);
- if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitUnusedWall, this->elements)) {
- PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 638,
- this->dyna.actor.params);
+ if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitUnusedWall,
+ this->colliderElements)) {
+ PRINTF(T("Error : コリジョンデータセット失敗",
+ "Error : Collision data set failure") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_mizu_bwall.c", 638, this->dyna.actor.params);
Actor_Kill(&this->dyna.actor);
} else {
sin = Math_SinS(this->dyna.actor.shape.rot.y);
@@ -316,9 +335,10 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
} else {
Collider_InitTris(play, &this->collider);
if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitStingerWall,
- this->elements)) {
- PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 724,
- this->dyna.actor.params);
+ this->colliderElements)) {
+ PRINTF(T("Error : コリジョンデータセット失敗",
+ "Error : Collision data set failure") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_mizu_bwall.c", 724, this->dyna.actor.params);
Actor_Kill(&this->dyna.actor);
} else {
sin = Math_SinS(this->dyna.actor.shape.rot.y);
@@ -358,9 +378,10 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
} else {
Collider_InitTris(play, &this->collider);
if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitStingerWall,
- this->elements)) {
- PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 798,
- this->dyna.actor.params);
+ this->colliderElements)) {
+ PRINTF(T("Error : コリジョンデータセット失敗",
+ "Error : Collision data set failure") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_mizu_bwall.c", 798, this->dyna.actor.params);
Actor_Kill(&this->dyna.actor);
} else {
sin = Math_SinS(this->dyna.actor.shape.rot.y);
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h
index d5eeaad344..aacbf321a5 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h
+++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h
@@ -2,16 +2,16 @@
#define Z_BG_MIZU_BWALL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMizuBwall;
-typedef void (*BgMizuBwallActionFunc)(struct BgMizuBwall*, PlayState*);
+typedef void (*BgMizuBwallActionFunc)(struct BgMizuBwall*, struct PlayState*);
typedef struct BgMizuBwall {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderTris collider;
- /* 0x0184 */ ColliderTrisElement elements[3]; // only ever uses 2
+ /* 0x0184 */ ColliderTrisElement colliderElements[3]; // only ever uses 2
/* 0x0298 */ BgMizuBwallActionFunc actionFunc;
/* 0x029C */ f32 yRot;
/* 0x02A0 */ s32 scrollAlpha1;
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c
index 095ab67e43..ae1dd32bc6 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c
+++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c
@@ -6,6 +6,16 @@
#include "z_bg_mizu_movebg.h"
#include "overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_mizu_objects/object_mizu_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h
index 1a378f13a5..75a50e864e 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h
+++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h
@@ -2,7 +2,7 @@
#define Z_BG_MIZU_MOVEBG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum BgMizuMovebgType {
/* 0 */ MIZUMOVEBG_TYPE_FLOATING_PLATFORM_OUTSIDE_CENTER_PILLAR,
@@ -18,7 +18,7 @@ typedef enum BgMizuMovebgType {
struct BgMizuMovebg;
-typedef void (*BgMizuMovebgActionFunc)(struct BgMizuMovebg*, PlayState*);
+typedef void (*BgMizuMovebgActionFunc)(struct BgMizuMovebg*, struct PlayState*);
typedef struct BgMizuMovebg {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c
index 585f85f6f5..ed8fae2784 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c
+++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c
@@ -1,4 +1,15 @@
#include "z_bg_mizu_shutter.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_mizu_objects/object_mizu_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h
index cc42e4ddf3..bcba73f531 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h
+++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h
@@ -2,7 +2,7 @@
#define Z_BG_MIZU_SHUTTER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#define BGMIZUSHUTTER_GET_SIZE(thisx) PARAMS_GET_U((u16)(thisx)->params, 12, 4)
#define BGMIZUSHUTTER_GET_TIMER(thisx) PARAMS_GET_U((u16)(thisx)->params, 6, 6)
@@ -12,7 +12,7 @@
struct BgMizuShutter;
-typedef void (*BgMizuShutterActionFunc)(struct BgMizuShutter*, PlayState*);
+typedef void (*BgMizuShutterActionFunc)(struct BgMizuShutter*, struct PlayState*);
typedef struct BgMizuShutter {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c
index 9f1884ea49..3072207ece 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c
+++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c
@@ -5,6 +5,12 @@
*/
#include "z_bg_mizu_uzu.h"
+
+#include "ichain.h"
+#include "sfx.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_mizu_objects/object_mizu_objects.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h
index 94e6b3c9d1..f8fe16ccd7 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h
+++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h
@@ -2,11 +2,11 @@
#define Z_BG_MIZU_UZU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMizuUzu;
-typedef void (*BgMizuUzuActionFunc)(struct BgMizuUzu*, PlayState*);
+typedef void (*BgMizuUzuActionFunc)(struct BgMizuUzu*, struct PlayState*);
typedef struct BgMizuUzu {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c
index 68f551be8b..2b5be14285 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c
+++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c
@@ -5,6 +5,20 @@
*/
#include "z_bg_mizu_water.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_mizu_objects/object_mizu_objects.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -108,7 +122,8 @@ void BgMizuWater_Init(Actor* thisx, PlayState* play) {
switch (this->type) {
case 0:
if (bREG(15) == 0) {
- PRINTF("<コンストラクト>%x %x %x\n", Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG),
+ PRINTF(T("<コンストラクト>", "") "%x %x %x\n",
+ Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG),
Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG),
Flags_GetSwitch(play, WATER_TEMPLE_WATER_F3_FLAG));
}
diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h
index 21196022f8..26eb33d0d8 100644
--- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h
+++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h
@@ -2,11 +2,11 @@
#define Z_BG_MIZU_WATER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMizuWater;
-typedef void (*BgMizuWaterActionFunc)(struct BgMizuWater*, PlayState*);
+typedef void (*BgMizuWaterActionFunc)(struct BgMizuWater*, struct PlayState*);
typedef struct BgMizuWater {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c
index 69bbc3506c..bf00812fc6 100644
--- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c
+++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_mjin.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+
#include "assets/objects/object_mjin/object_mjin.h"
#include "assets/objects/object_mjin_wind/object_mjin_wind.h"
#include "assets/objects/object_mjin_soul/object_mjin_soul.h"
@@ -109,7 +117,7 @@ void BgMjin_Draw(Actor* thisx, PlayState* play) {
s32 objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[thisx->params - 1]);
if (objectSlot >= 0) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
}
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06000000));
diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h
index 03e18fbb76..1ed19aa2a4 100644
--- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h
+++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h
@@ -2,11 +2,11 @@
#define Z_BG_MJIN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMjin;
-typedef void (*BgMjinActionFunc)(struct BgMjin*, PlayState*);
+typedef void (*BgMjinActionFunc)(struct BgMjin*, struct PlayState*);
typedef struct BgMjin {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c
index 7b02395228..c0b7314bcb 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c
@@ -5,8 +5,20 @@
*/
#include "z_bg_mori_bigst.h"
-#include "assets/objects/object_mori_objects/object_mori_objects.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
#include "quake.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_mori_objects/object_mori_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -62,9 +74,9 @@ void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeade
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG login failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_bigst.c", 190,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_mori_bigst.c", 190, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -73,17 +85,16 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) {
s32 pad;
BgMoriBigst* this = (BgMoriBigst*)thisx;
- // "mori (bigST.keyceiling)"
- PRINTF("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params,
- Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)),
+ PRINTF(T("mori (bigST.鍵型天井)",
+ "mori (bigST. key-shaped ceiling)") "(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n",
+ this->dyna.actor.params, Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)),
Flags_GetTempClear(play, this->dyna.actor.room), Flags_GetClear(play, this->dyna.actor.room),
GET_PLAYER(play)->actor.world.pos.y);
BgMoriBigst_InitDynapoly(this, play, &gMoriBigstCol, 0);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjectSlot < 0) {
- // "【Big Stalfos key ceiling】 bank danger!"
- PRINTF("【ビッグスタルフォス鍵型天井】 バンク危険!\n");
+ PRINTF(T("【ビッグスタルフォス鍵型天井】 バンク危険!\n", "[Big Stalfos Key-shaped Ceiling] Bank danger!\n"));
PRINTF("%s %d\n", "../z_bg_mori_bigst.c", 234);
Actor_Kill(&this->dyna.actor);
return;
@@ -140,8 +151,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, PlayState* play) {
this->dyna.actor.child = NULL;
this->dyna.actor.home.rot.z++;
} else {
- // "Second Stalfos failure"
- PRINTF("Warning : 第2スタルフォス発生失敗\n");
+ PRINTF(T("Warning : 第2スタルフォス発生失敗\n", "Warning : Second Stalfos failed to generate\n"));
}
Flags_SetClear(play, this->dyna.actor.room);
}
@@ -202,8 +212,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) {
this->dyna.actor.child = NULL;
this->dyna.actor.home.rot.z++;
} else {
- // "Warning: 3-1 Stalfos failure"
- PRINTF("Warning : 第3-1スタルフォス発生失敗\n");
+ PRINTF(T("Warning : 第3-1スタルフォス発生失敗\n", "Warning : 3-1 Stalfos generation failure\n"));
}
stalfos2 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_EN_TEST, 170.0f, 827.0f, -3260.0f, 0,
0, 0, 5);
@@ -211,8 +220,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) {
this->dyna.actor.child = NULL;
this->dyna.actor.home.rot.z++;
} else {
- // "Warning: 3-2 Stalfos failure"
- PRINTF("Warning : 第3-2スタルフォス発生失敗\n");
+ PRINTF(T("Warning : 第3-2スタルフォス発生失敗\n", "Warning : 3-2 Stalfos generation failure\n"));
}
Flags_SetClear(play, this->dyna.actor.room);
}
diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h
index c71eac7ab1..f37499b2f7 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h
@@ -2,11 +2,11 @@
#define Z_BG_MORI_BIGST_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriBigst;
-typedef void (*BgMoriBigstActionFunc)(struct BgMoriBigst*, PlayState*);
+typedef void (*BgMoriBigstActionFunc)(struct BgMoriBigst*, struct PlayState*);
typedef struct BgMoriBigst {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c
index b441ed008c..028606443f 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c
@@ -1,4 +1,17 @@
#include "z_bg_mori_elevator.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_mori_objects/object_mori_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -92,16 +105,16 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) {
#if DEBUG_FEATURES
if (this->moriTexObjectSlot < 0) {
Actor_Kill(thisx);
- // "Forest Temple obj elevator Bank Danger!"
- PRINTF("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n", "../z_bg_mori_elevator.c", 277);
+ PRINTF(T("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n",
+ "Error : Forest Temple obj elevator bank danger! (%s %d)\n"),
+ "../z_bg_mori_elevator.c", 277);
return;
}
#endif
switch (sIsSpawned) {
case false:
- // "Forest Temple elevator CT"
- PRINTF("森の神殿 elevator CT\n");
+ PRINTF(T("森の神殿 elevator CT\n", "Forest Temple elevator CT\n"));
sIsSpawned = true;
this->dyna.actor.room = -1;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
@@ -120,8 +133,7 @@ void BgMoriElevator_Destroy(Actor* thisx, PlayState* play) {
BgMoriElevator* this = (BgMoriElevator*)thisx;
if (this->unk_172 == 0) {
- // "Forest Temple elevator DT"
- PRINTF("森の神殿 elevator DT\n");
+ PRINTF(T("森の神殿 elevator DT\n", "Forest Temple elevator DT\n"));
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
sIsSpawned = false;
}
@@ -144,8 +156,9 @@ void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, PlayState* play) {
this->dyna.actor.world.pos.y = 73.0f;
BgMoriElevator_SetupSetPosition(this);
} else {
- // "Error: Forest Temple obj elevator Room setting is dangerous"
- PRINTF("Error : 森の神殿 obj elevator 部屋設定が危険(%s %d)\n", "../z_bg_mori_elevator.c", 371);
+ PRINTF(T("Error : 森の神殿 obj elevator 部屋設定が危険(%s %d)\n",
+ "Error : Forest Temple obj elevator room setting is dangerous(%s %d)\n"),
+ "../z_bg_mori_elevator.c", 371);
}
} else {
BgMoriElevator_SetupSetPosition(this);
@@ -205,8 +218,9 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, PlayState* play) {
this->targetY = 233.0f;
BgMoriElevator_StopMovement(this);
} else {
- // "Error:Forest Temple obj elevator Room setting is dangerous(%s %d)"
- PRINTF("Error : 森の神殿 obj elevator 部屋設定が危険(%s %d)\n", "../z_bg_mori_elevator.c", 479);
+ PRINTF(T("Error : 森の神殿 obj elevator 部屋設定が危険(%s %d)\n",
+ "Error : Forest Temple obj elevator room setting is dangerous(%s %d)\n"),
+ "../z_bg_mori_elevator.c", 479);
}
} else if ((play->roomCtx.curRoom.num == 2) && (this->dyna.actor.world.pos.y < -275.0f)) {
this->targetY = 233.0f;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h
index e7bcc5018e..42e45d56fc 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h
@@ -2,11 +2,11 @@
#define Z_BG_MORI_ELEVATOR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriElevator;
-typedef void (*BgMoriElevatorActionFunc)(struct BgMoriElevator*, PlayState*);
+typedef void (*BgMoriElevatorActionFunc)(struct BgMoriElevator*, struct PlayState*);
typedef struct BgMoriElevator {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c
index 53bc3b6b47..6bd947c3a0 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c
@@ -5,6 +5,17 @@
*/
#include "z_bg_mori_hashigo.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0
@@ -91,9 +102,9 @@ void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionH
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG login failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_hashigo.c", 164,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_mori_hashigo.c", 164, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -102,7 +113,7 @@ void BgMoriHashigo_InitCollider(BgMoriHashigo* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
this->collider.elements[0].dim.worldSphere.center.x = (s16)this->dyna.actor.world.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = (s16)this->dyna.actor.world.pos.y + 21;
@@ -129,9 +140,8 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, PlayState* play) {
if (ladder != NULL) {
return true;
} else {
- // "Ladder failure"
- PRINTF("Error : 梯子の発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mori_hashigo.c", 220,
- this->dyna.actor.params);
+ PRINTF("Error : " T("梯子の発生失敗", "Ladder spawn failure") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_mori_hashigo.c", 220, this->dyna.actor.params);
return false;
}
}
@@ -171,14 +181,13 @@ void BgMoriHashigo_Init(Actor* thisx, PlayState* play) {
}
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjectSlot < 0) {
- // "Bank danger!"
- PRINTF("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params, "../z_bg_mori_hashigo.c",
- 312);
+ PRINTF("Error : " T("バンク危険!", "Bank danger!") "(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params,
+ "../z_bg_mori_hashigo.c", 312);
Actor_Kill(&this->dyna.actor);
} else {
BgMoriHashigo_SetupWaitForMoriTex(this);
- // "(Forest Temple Ladder and its clasp)"
- PRINTF("(森の神殿 梯子とその留め金)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("(森の神殿 梯子とその留め金)", "(Forest Temple Ladder and its clasp)") "(arg_data 0x%04x)\n",
+ this->dyna.actor.params);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h
index 4e6e93a5de..e14aec45e1 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h
@@ -2,16 +2,16 @@
#define Z_BG_MORI_HASHIGO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriHashigo;
-typedef void (*BgMoriHashigoActionFunc)(struct BgMoriHashigo*, PlayState*);
+typedef void (*BgMoriHashigoActionFunc)(struct BgMoriHashigo*, struct PlayState*);
typedef struct BgMoriHashigo {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderJntSph collider;
- /* 0x0184 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0184 */ ColliderJntSphElement colliderElements[1];
/* 0x01C4 */ BgMoriHashigoActionFunc actionFunc;
/* 0x01C8 */ s16 hitTimer;
/* 0x01CA */ s16 bounceCounter;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c
index c5f634640e..21b561a770 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c
@@ -5,6 +5,18 @@
*/
#include "z_bg_mori_hashira4.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_mori_objects/object_mori_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -60,9 +72,9 @@ void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, Collisio
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG login failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_hashira4.c", 155,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_mori_hashira4.c", 155, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -83,9 +95,8 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) {
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjectSlot < 0) {
Actor_Kill(&this->dyna.actor);
- // "Bank danger!"
- PRINTF("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params, "../z_bg_mori_hashira4.c",
- 196);
+ PRINTF("Error : " T("バンク危険!", "Bank danger!") "(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params,
+ "../z_bg_mori_hashira4.c", 196);
return;
}
if ((this->dyna.actor.params != 0) && Flags_GetSwitch(play, this->switchFlag)) {
@@ -94,8 +105,7 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) {
}
Actor_SetFocus(&this->dyna.actor, 50.0f);
BgMoriHashira4_SetupWaitForMoriTex(this);
- // "(4 pillars of the Forest Temple) Bank danger"
- PRINTF("(森の神殿 4本柱)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("(森の神殿 4本柱)", "Forest Temple 4 Pillars") "(arg_data 0x%04x)\n", this->dyna.actor.params);
sUnkTimer = 0;
}
diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h
index a36a6ef36b..e4ab5a2d85 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h
@@ -2,11 +2,11 @@
#define Z_BG_MORI_HASHIRA4_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriHashira4;
-typedef void (*BgMoriHashira4ActionFunc)(struct BgMoriHashira4*, PlayState*);
+typedef void (*BgMoriHashira4ActionFunc)(struct BgMoriHashira4*, struct PlayState*);
typedef struct BgMoriHashira4 {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c
index 70e60eacf4..92fc3c57a8 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c
@@ -5,7 +5,19 @@
*/
#include "z_bg_mori_hineri.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64curve.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_box/object_box.h"
#include "assets/objects/object_mori_hineri1/object_mori_hineri1.h"
diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h
index 468bb29656..b9a29df504 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h
@@ -2,14 +2,14 @@
#define Z_BG_MORI_HINERI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriHineri;
// Due to a unique access pattern, this param cannot use the generic "PARAMS_GET_U" macros
#define TWISTED_HALLWAY_GET_PARAM_15(thisx) (((thisx)->params & (NBITS_TO_MASK(1) << (15))) >> ((15) - (1)))
-typedef void (*BgMoriHineriActionFunc)(struct BgMoriHineri*, PlayState*);
+typedef void (*BgMoriHineriActionFunc)(struct BgMoriHineri*, struct PlayState*);
typedef struct BgMoriHineri {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c
index 9af9f14f2f..eaeb6afc3e 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c
@@ -5,6 +5,17 @@
*/
#include "z_bg_mori_idomizu.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_mori_objects/object_mori_objects.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -69,16 +80,15 @@ void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) {
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjectSlot < 0) {
Actor_Kill(&this->actor);
- // "Bank danger!"
- PRINTF("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_bg_mori_idomizu.c", 202);
+ PRINTF("Error : " T("バンク危険!", "Bank danger!") "(arg_data 0x%04x)(%s %d)\n", this->actor.params,
+ "../z_bg_mori_idomizu.c", 202);
return;
}
BgMoriIdomizu_SetupWaitForMoriTex(this);
sIsSpawned = true;
this->isLoaded = true;
this->actor.room = -1;
- // "Forest Temple well water"
- PRINTF("(森の神殿 井戸水)(arg_data 0x%04x)\n", this->actor.params);
+ PRINTF(T("(森の神殿 井戸水)", "(Forest Temple well water)") "(arg_data 0x%04x)\n", this->actor.params);
}
void BgMoriIdomizu_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h
index 3e7036ec4b..4348622425 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h
@@ -2,11 +2,11 @@
#define Z_BG_MORI_IDOMIZU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriIdomizu;
-typedef void (*BgMoriIdomizuActionFunc)(struct BgMoriIdomizu*, PlayState*);
+typedef void (*BgMoriIdomizuActionFunc)(struct BgMoriIdomizu*, struct PlayState*);
typedef struct BgMoriIdomizu {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c
index 910a2bd285..c47a01879f 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c
@@ -5,6 +5,18 @@
*/
#include "z_bg_mori_kaitenkabe.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_mori_objects/object_mori_objects.h"
#define FLAGS 0
@@ -50,8 +62,9 @@ void BgMoriKaitenkabe_Init(Actor* thisx, PlayState* play) {
BgMoriKaitenkabe* this = (BgMoriKaitenkabe*)thisx;
CollisionHeader* colHeader = NULL;
- // "Forest Temple object 【Rotating Wall (arg_data: 0x% 04x)】 appears"
- PRINTF("◯◯◯森の神殿オブジェクト【回転壁(arg_data : 0x%04x)】出現 \n", this->dyna.actor.params);
+ PRINTF(T("◯◯◯森の神殿オブジェクト【回転壁(arg_data : 0x%04x)】出現 \n",
+ "◯◯◯Forest Temple object [Rotating wall(arg_data : 0x%04x)] appears \n"),
+ this->dyna.actor.params);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
CollisionHeader_GetVirtual(&gMoriKaitenkabeCol, &colHeader);
@@ -59,8 +72,8 @@ void BgMoriKaitenkabe_Init(Actor* thisx, PlayState* play) {
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjectSlot < 0) {
Actor_Kill(&this->dyna.actor);
- // "【Rotating wall】 Bank danger!"
- PRINTF("【回転壁】 バンク危険!(%s %d)\n", "../z_bg_mori_kaitenkabe.c", 176);
+ PRINTF(T("【回転壁】 バンク危険!(%s %d)\n", "[Rotating wall] Bank danger! (%s %d)\n"),
+ "../z_bg_mori_kaitenkabe.c", 176);
} else {
this->actionFunc = BgMoriKaitenkabe_WaitForMoriTex;
}
diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h
index 7bd6939d3f..91c0d65a80 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h
@@ -2,11 +2,11 @@
#define Z_BG_MORI_KAITENKABE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriKaitenkabe;
-typedef void (*BgMoriKaitenkabeActionFunc)(struct BgMoriKaitenkabe*, PlayState*);
+typedef void (*BgMoriKaitenkabeActionFunc)(struct BgMoriKaitenkabe*, struct PlayState*);
typedef struct BgMoriKaitenkabe {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c
index 61bbf6b9ef..dccddcf49a 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c
+++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c
@@ -5,8 +5,22 @@
*/
#include "z_bg_mori_rakkatenjo.h"
-#include "assets/objects/object_mori_objects/object_mori_objects.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
#include "quake.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_mori_objects/object_mori_objects.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -54,24 +68,25 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
#if DEBUG_FEATURES
- // "Forest Temple obj. Falling Ceiling"
- PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y);
+ PRINTF(T("森の神殿 obj. 落下天井", "Forest Temple obj. Falling Ceiling") " (home posY %f)\n",
+ this->dyna.actor.home.pos.y);
if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) ||
(fabsf(683.0f - this->dyna.actor.home.pos.y) > 0.001f) ||
(fabsf(-2520.0f - this->dyna.actor.home.pos.z) > 0.001f)) {
- // "The set position has been changed. Let's fix the program."
- PRINTF("Warning : セット位置が変更されています。プログラムを修正しましょう。\n");
+ PRINTF(T("Warning : セット位置が変更されています。プログラムを修正しましょう。\n",
+ "Warning : The set position has been changed. Let's fix the program.\n"));
}
if (this->dyna.actor.home.rot.y != 0x8000) {
- // "The set Angle has changed. Let's fix the program."
- PRINTF("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n");
+ PRINTF(T("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n",
+ "Warning : The set Angle has changed. Let's fix the program.\n"));
}
#endif
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
if (this->moriTexObjectSlot < 0) {
- // "Forest Temple obj Falling Ceiling Bank Danger!"
- PRINTF("Error : 森の神殿 obj 落下天井 バンク危険!(%s %d)\n", "../z_bg_mori_rakkatenjo.c", 205);
+ PRINTF(T("Error : 森の神殿 obj 落下天井 バンク危険!(%s %d)\n",
+ "Error : Forest Temple obj Falling Ceiling Bank danger! (%s %d)\n"),
+ "../z_bg_mori_rakkatenjo.c", 205);
Actor_Kill(&this->dyna.actor);
return;
}
diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h
index 97bdbc0bfd..657baefc53 100644
--- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h
+++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h
@@ -2,11 +2,11 @@
#define Z_BG_MORI_RAKKATENJO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgMoriRakkatenjo;
-typedef void (*BgMoriRakkatenjoActionFunction)(struct BgMoriRakkatenjo*, PlayState*);
+typedef void (*BgMoriRakkatenjoActionFunction)(struct BgMoriRakkatenjo*, struct PlayState*);
typedef struct BgMoriRakkatenjo {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c
index 7199ec25b5..eda5a530eb 100644
--- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c
+++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c
@@ -5,6 +5,21 @@
*/
#include "z_bg_po_event.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_po_sisters/object_po_sisters.h"
#define FLAGS 0
@@ -202,7 +217,7 @@ void BgPoEvent_Init(Actor* thisx, PlayState* play) {
if (this->type >= 2) {
Collider_InitTris(play, &this->collider);
- Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems);
+ Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderElements);
if (Flags_GetSwitch(play, thisx->params)) {
Actor_Kill(thisx);
} else {
diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h
index 412c187227..78fe7fc966 100644
--- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h
+++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h
@@ -2,11 +2,11 @@
#define Z_BG_PO_EVENT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgPoEvent;
-typedef void (*BgPoEventActionFunc)(struct BgPoEvent*, PlayState*);
+typedef void (*BgPoEventActionFunc)(struct BgPoEvent*, struct PlayState*);
typedef struct BgPoEvent {
/* 0x0000 */ DynaPolyActor dyna;
@@ -16,7 +16,7 @@ typedef struct BgPoEvent {
/* 0x016A */ s8 direction;
/* 0x016C */ s16 timer;
/* 0x0170 */ ColliderTris collider;
- /* 0x0190 */ ColliderTrisElement colliderItems[2];
+ /* 0x0190 */ ColliderTrisElement colliderElements[2];
} BgPoEvent; // size = 0x0248
#endif
diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c
index 9dae9b2a5d..e5b8edea9d 100644
--- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c
+++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c
@@ -5,6 +5,16 @@
*/
#include "z_bg_po_syokudai.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z64light.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_syokudai/object_syokudai.h"
diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h
index 8bb84f0fe5..a6186dcbe7 100644
--- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h
+++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h
@@ -2,7 +2,8 @@
#define Z_BG_PO_SYOKUDAI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct BgPoSyokudai;
diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c
index 7d9ef63e60..3392a15f60 100644
--- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c
+++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_pushbox.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_pu_box/object_pu_box.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h
index 577ebaabb6..38cd6857d9 100644
--- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h
+++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h
@@ -2,11 +2,11 @@
#define Z_BG_PUSHBOX_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgPushbox;
-typedef void (*BgPushboxActionFunc)(struct BgPushbox*, PlayState*);
+typedef void (*BgPushboxActionFunc)(struct BgPushbox*, struct PlayState*);
typedef struct BgPushbox {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c
index f6dfcc3d37..37591ae020 100644
--- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c
+++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c
@@ -5,6 +5,17 @@
*/
#include "z_bg_relay_objects.h"
+
+#include "ichain.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64cutscene_flags.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_relay_objects/object_relay_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h
index 802d840649..25db5cc5f6 100644
--- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h
+++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h
@@ -2,11 +2,11 @@
#define Z_BG_RELAY_OBJECTS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgRelayObjects;
-typedef void (*BgRelayObjectsActionFunc)(struct BgRelayObjects*, PlayState*);
+typedef void (*BgRelayObjectsActionFunc)(struct BgRelayObjects*, struct PlayState*);
typedef struct BgRelayObjects {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c
index 3eb461a52f..4a3a760d92 100644
--- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c
+++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c
@@ -5,6 +5,11 @@
*/
#include "z_bg_spot00_break.h"
+
+#include "ichain.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot00_break/object_spot00_break.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h
index de282476d9..17e45aa918 100644
--- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h
+++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT00_BREAK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot00Break;
diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c
index c60865af16..c305635b83 100644
--- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c
+++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c
@@ -5,8 +5,22 @@
*/
#include "z_bg_spot00_hanebasi.h"
-#include "assets/objects/object_spot00_objects/object_spot00_objects.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64cutscene_flags.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_spot00_objects/object_spot00_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h
index fc6427ae82..7780bea692 100644
--- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h
+++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h
@@ -2,11 +2,12 @@
#define Z_BG_SPOT00_HANEBASI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct BgSpot00Hanebasi;
-typedef void (*BgSpot00HanebasiActionFunc)(struct BgSpot00Hanebasi*, PlayState*);
+typedef void (*BgSpot00HanebasiActionFunc)(struct BgSpot00Hanebasi*, struct PlayState*);
typedef struct BgSpot00Hanebasi {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c
index d8b3cfaba7..413e0a49e0 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c
+++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c
@@ -5,6 +5,17 @@
*/
#include "z_bg_spot01_fusya.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot01_objects/object_spot01_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -64,7 +75,7 @@ void func_808AAA50(BgSpot01Fusya* this, PlayState* play) {
}
thisx->shape.rot.z += this->unk_154;
temp = ((this->unk_154 - 100.0f) / 1700.0f) + 1.0f;
- func_800F436C(&thisx->projectedPos, 0x2085, temp);
+ func_800F436C(&thisx->projectedPos, NA_SE_EV_WINDMILL_LEVEL - SFX_FLAG, temp);
Math_ApproachF(&this->unk_154, this->unk_158, this->unk_15C, 100.0f);
}
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h
index 1e7a831316..e232c6a907 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h
+++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT01_FUSYA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot01Fusya;
-typedef void (*BgSpot01FusyaActionFunc)(struct BgSpot01Fusya*, PlayState*);
+typedef void (*BgSpot01FusyaActionFunc)(struct BgSpot01Fusya*, struct PlayState*);
typedef struct BgSpot01Fusya {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c
index ba1ff57d87..e43acd7a1d 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c
+++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c
@@ -5,8 +5,22 @@
*/
#include "z_bg_spot01_idohashira.h"
-#include "assets/objects/object_spot01_objects/object_spot01_objects.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
+#include "assets/objects/object_spot01_objects/object_spot01_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -179,7 +193,8 @@ f32 func_808AB1DC(f32 arg0, f32 arg1, u16 arg2, u16 arg3, u16 arg4) {
temp_f12 = regFloat * diff43;
return (((((arg1 - arg0) - temp_f12) / SQ(diff23)) * diff43) * diff43) + temp_f12;
}
- PRINTF(VT_FGCOL(RED) "Bg_Spot01_Idohashira_Get_FreeFallで割り算出来ない!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("Bg_Spot01_Idohashira_Get_FreeFallで割り算出来ない!!!!!!!!!!!!!!\n",
+ "Bg_Spot01_Idohashira_Get_FreeFall Cannot divide by!!!!!!!!!!!!!!\n") VT_RST);
return 0.0f;
}
@@ -254,7 +269,8 @@ void func_808AB444(BgSpot01Idohashira* this, PlayState* play) {
Actor_Kill(&this->dyna.actor);
break;
default:
- PRINTF("Bg_Spot01_Idohashira_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Bg_Spot01_Idohashira_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Bg_Spot01_Idohashira_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
@@ -284,7 +300,8 @@ void BgSpot01Idohashira_Update(Actor* thisx, PlayState* play) {
BgSpot01Idohashira* this = (BgSpot01Idohashira*)thisx;
if (this->action < 0 || this->action >= 4 || sActionFuncs[this->action] == NULL) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -335,7 +352,8 @@ void BgSpot01Idohashira_Draw(Actor* thisx, PlayState* play) {
BgSpot01Idohashira* this = (BgSpot01Idohashira*)thisx;
if (this->drawConfig < 0 || this->drawConfig > 0 || sDrawFuncs[this->drawConfig] == NULL) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h
index ae456de8fb..8d177d3317 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h
+++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h
@@ -2,12 +2,12 @@
#define Z_BG_SPOT01_IDOHASHIRA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot01Idohashira;
-typedef void (*BgSpot01IdohashiraActionFunc)(struct BgSpot01Idohashira*, PlayState*);
-typedef void (*BgSpot01IdohashiraDrawFunc)(struct BgSpot01Idohashira*, PlayState*);
+typedef void (*BgSpot01IdohashiraActionFunc)(struct BgSpot01Idohashira*, struct PlayState*);
+typedef void (*BgSpot01IdohashiraDrawFunc)(struct BgSpot01Idohashira*, struct PlayState*);
typedef struct BgSpot01Idohashira {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c
index f2c89a41de..5329d2e0f6 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c
+++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c
@@ -5,6 +5,16 @@
*/
#include "z_bg_spot01_idomizu.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot01_objects/object_spot01_objects.h"
#define FLAGS ACTOR_FLAG_DRAW_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h
index 3c5929714a..3d4ff68a6f 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h
+++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT01_IDOMIZU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot01Idomizu;
-typedef void (*BgSpot01IdomizuActionFunc)(struct BgSpot01Idomizu*, PlayState*);
+typedef void (*BgSpot01IdomizuActionFunc)(struct BgSpot01Idomizu*, struct PlayState*);
typedef struct BgSpot01Idomizu {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c
index 1bad86dd46..6dbdd910d5 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c
+++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_spot01_idosoko.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot01_matoya/object_spot01_matoya.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h
index c17b0a43ed..44981abc07 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h
+++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT01_IDOSOKO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot01Idosoko;
-typedef void (*BgSpot01IdosokoActionFunc)(struct BgSpot01Idosoko*, PlayState*);
+typedef void (*BgSpot01IdosokoActionFunc)(struct BgSpot01Idosoko*, struct PlayState*);
typedef struct BgSpot01Idosoko {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c
index 2ee4c58283..af7dec9c5d 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c
+++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_spot01_objects2.h"
+
+#include "ichain.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "translation.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot01_matoya/object_spot01_matoya.h"
#include "assets/objects/object_spot01_matoyab/object_spot01_matoyab.h"
@@ -61,8 +69,8 @@ void BgSpot01Objects2_Init(Actor* thisx, PlayState* play) {
if (this->objectId >= 0) {
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, this->objectId);
if (this->requiredObjectSlot < 0) {
- // "There was no bank setting."
- PRINTF("-----------------------------バンク設定ありませんでした.");
+ PRINTF(T("-----------------------------バンク設定ありませんでした.",
+ "----------------------------- There was no bank setting."));
Actor_Kill(&this->dyna.actor);
return;
}
@@ -92,9 +100,8 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) {
Vec3f position;
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
- // "---- Successful bank switching!!"
- PRINTF("-----バンク切り換え成功!!\n");
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
+ PRINTF(T("-----バンク切り換え成功!!\n", "----- Successful bank switching!!\n"));
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
this->dyna.actor.objectSlot = this->requiredObjectSlot;
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h
index d1d96d045b..7ffc3094fe 100644
--- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h
+++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT01_OBJECTS2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot01Objects2;
-typedef void (*BgSpot01Objects2ActionFunc)(struct BgSpot01Objects2*, PlayState*);
+typedef void (*BgSpot01Objects2ActionFunc)(struct BgSpot01Objects2*, struct PlayState*);
typedef struct BgSpot01Objects2 {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c
index a0d74b4eda..795df90151 100644
--- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c
+++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c
@@ -5,6 +5,20 @@
*/
#include "z_bg_spot02_objects.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot02_objects/object_spot02_objects.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h
index 873fe15a52..42d4e45b08 100644
--- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h
+++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT02_OBJECTS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot02Objects;
-typedef void (*BgSpot02ObjectsActionFunc)(struct BgSpot02Objects*, PlayState*);
+typedef void (*BgSpot02ObjectsActionFunc)(struct BgSpot02Objects*, struct PlayState*);
typedef struct BgSpot02Objects {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c
index fccae09ba4..501a677359 100644
--- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c
+++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c
@@ -5,6 +5,16 @@
*/
#include "z_bg_spot03_taki.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64audio.h"
+#include "z64play.h"
+
#include "assets/objects/object_spot03_object/object_spot03_object.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h
index f6e3daab16..45ad4de4f2 100644
--- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h
+++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT03_TAKI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum BgSpot03TakiState {
WATERFALL_CLOSED,
@@ -14,7 +14,7 @@ typedef enum BgSpot03TakiState {
struct BgSpot03Taki;
-typedef void (*BgSpot03TakiActionFunc)(struct BgSpot03Taki*, PlayState*);
+typedef void (*BgSpot03TakiActionFunc)(struct BgSpot03Taki*, struct PlayState*);
typedef struct BgSpot03Taki {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c
index 93c30e65af..edb253568d 100644
--- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c
+++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_spot05_soko.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot05_objects/object_spot05_objects.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h
index 849e5b2263..1aae818797 100644
--- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h
+++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT05_SOKO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot05Soko;
-typedef void (*BgSpot05SokoActionFunc)(struct BgSpot05Soko*, PlayState*);
+typedef void (*BgSpot05SokoActionFunc)(struct BgSpot05Soko*, struct PlayState*);
typedef struct BgSpot05Soko {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c
index d06e292e12..7c6c943aa7 100644
--- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c
+++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c
@@ -5,6 +5,20 @@
*/
#include "z_bg_spot06_objects.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot06_objects/object_spot06_objects.h"
#define FLAGS ACTOR_FLAG_HOOKSHOT_PULLS_ACTOR
@@ -56,7 +70,7 @@ ActorProfile Bg_Spot06_Objects_Profile = {
/**/ BgSpot06Objects_Draw,
};
-static ColliderJntSphElementInit sJntSphItemsInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -80,7 +94,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- sJntSphItemsInit,
+ sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
@@ -121,7 +135,7 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) {
case LHO_WATER_TEMPLE_ENTRANCE_LOCK:
Actor_ProcessInitChain(thisx, sInitChain);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->colliderItem);
+ Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->colliderElements);
if (LINK_IS_ADULT && Flags_GetSwitch(play, this->switchFlag)) {
if (!GET_EVENTCHKINF(EVENTCHKINF_RESTORED_LAKE_HYLIA)) {
diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h
index 08fdf1e9af..cbdc1054f8 100644
--- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h
+++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT06_OBJECTS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot06Objects;
-typedef void (*BgSpot06ObjectsActionFunc)(struct BgSpot06Objects*, PlayState*);
+typedef void (*BgSpot06ObjectsActionFunc)(struct BgSpot06Objects*, struct PlayState*);
typedef struct BgSpot06Objects {
/* 0x0000 */ DynaPolyActor dyna;
@@ -15,7 +15,7 @@ typedef struct BgSpot06Objects {
/* 0x016A */ s16 timer;
/* 0x016C */ f32 lakeHyliaWaterLevel;
/* 0x0170 */ ColliderJntSph collider;
- /* 0x0190 */ ColliderJntSphElement colliderItem[1];
+ /* 0x0190 */ ColliderJntSphElement colliderElements[1];
} BgSpot06Objects; // size = 0x01D0
#endif
diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c
index 04d06a57a5..afb9d02972 100644
--- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c
+++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c
@@ -5,7 +5,15 @@
*/
#include "z_bg_spot07_taki.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot07_object/object_spot07_object.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h
index dcf6ef8edc..30872233ad 100644
--- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h
+++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT07_TAKI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot07Taki;
-typedef void (*BgSpot07TakiActionFunc)(struct BgSpot07Taki*, PlayState*);
+typedef void (*BgSpot07TakiActionFunc)(struct BgSpot07Taki*, struct PlayState*);
typedef struct BgSpot07Taki {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c
index 7d44d616d2..aa8d28b960 100644
--- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c
+++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c
@@ -5,9 +5,18 @@
*/
#include "z_bg_spot08_bakudankabe.h"
-#include "assets/objects/object_spot08_obj/object_spot08_obj.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
+#include "assets/objects/object_spot08_obj/object_spot08_obj.h"
#define FLAGS ACTOR_FLAG_IGNORE_POINT_LIGHTS
@@ -97,7 +106,7 @@ void func_808B02D0(BgSpot08Bakudankabe* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
}
void func_808B0324(BgSpot08Bakudankabe* this, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h
index 3be139505d..a0436ea9ea 100644
--- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h
+++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h
@@ -2,14 +2,14 @@
#define Z_BG_SPOT08_BAKUDANKABE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot08Bakudankabe;
typedef struct BgSpot08Bakudankabe {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderJntSph collider;
- /* 0x0184 */ ColliderJntSphElement colliderItems[3];
+ /* 0x0184 */ ColliderJntSphElement colliderElements[3];
} BgSpot08Bakudankabe; // size = 0x0244
#endif
diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c
index 6ac2bd0fd7..17d9385b00 100644
--- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c
+++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c
@@ -9,11 +9,14 @@
#include "libc64/math64.h"
#include "libc64/qrand.h"
#include "ichain.h"
+#include "printf.h"
#include "sys_math3d.h"
#include "sys_matrix.h"
+#include "translation.h"
#include "z_lib.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_spot08_obj/object_spot08_obj.h"
@@ -60,9 +63,9 @@ void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, Coll
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning: move BG registration failed"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot08_iceblock.c", 0xD9,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot08_iceblock.c", 0xD9, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -74,9 +77,9 @@ void BgSpot08Iceblock_CheckParams(BgSpot08Iceblock* this) {
this->dyna.actor.params = 0x10;
break;
default:
- // "Error: arg_data setting error"
- PRINTF("Error : arg_data 設定ミスです。(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot08_iceblock.c", 0xF6,
- this->dyna.actor.params);
+ PRINTF(
+ T("Error : arg_data 設定ミスです。", "Error : arg_data setting error. ") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot08_iceblock.c", 0xF6, this->dyna.actor.params);
this->dyna.actor.params = 0x10;
break;
case 1:
@@ -297,8 +300,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) {
BgSpot08Iceblock* this = (BgSpot08Iceblock*)thisx;
CollisionHeader* colHeader;
- // "spot08 ice floe"
- PRINTF("(spot08 流氷)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF("(spot08 " T("流氷", "ice floe") ")(arg_data 0x%04x)\n", this->dyna.actor.params);
BgSpot08Iceblock_CheckParams(this);
switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 9, 1)) {
diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c
index 00ca47644f..57b76c4147 100644
--- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c
+++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c
@@ -5,6 +5,17 @@
*/
#include "z_bg_spot09_obj.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot09_obj/object_spot09_obj.h"
#define FLAGS 0
@@ -137,12 +148,13 @@ s32 func_808B1D44(BgSpot09Obj* this, PlayState* play) {
void BgSpot09Obj_Init(Actor* thisx, PlayState* play) {
BgSpot09Obj* this = (BgSpot09Obj*)thisx;
- PRINTF("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params,
- GET_EVENTCHKINF_CARPENTERS_RESCUED_FLAGS());
+ PRINTF("Spot09 Object [arg_data : 0x%04x](" T("大工救出フラグ", "Carpenter Rescue Flag") " 0x%x)\n",
+ this->dyna.actor.params, GET_EVENTCHKINF_CARPENTERS_RESCUED_FLAGS());
this->dyna.actor.params &= 0xFF;
if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) {
- PRINTF("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot09_obj.c",
- 322, this->dyna.actor.params);
+ PRINTF(T("Error : Spot 09 object の arg_data が判別出来ない",
+ "Error : Spot 09 object arg_data cannot be determined") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot09_obj.c", 322, this->dyna.actor.params);
}
if (!func_808B1C70(this, play)) {
diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h
index a09ce32eda..491d7380c2 100644
--- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h
+++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT09_OBJ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot09Obj;
diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c
index d0568c23c8..f86d76a2fc 100644
--- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c
+++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c
@@ -6,6 +6,15 @@
#include "z_bg_spot11_bakudankabe.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_spot11_obj/object_spot11_obj.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
@@ -121,7 +130,7 @@ void BgSpot11Bakudankabe_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&gDesertColossusBombableWallCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
Actor_SetScale(&this->dyna.actor, 1.0f);
- PRINTF("(spot11 爆弾壁)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF("(spot11 " T("爆弾壁", "Bomb Wall") ")(arg_data 0x%04x)\n", this->dyna.actor.params);
}
void BgSpot11Bakudankabe_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h
index b18f5c084b..5dedab77d5 100644
--- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h
+++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT11_BAKUDANKABE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot11Bakudankabe;
diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c
index 05987f0921..574c2533d0 100644
--- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c
+++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c
@@ -6,6 +6,22 @@
#include "z_bg_spot11_oasis.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64cutscene_flags.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_spot11_obj/object_spot11_obj.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h
index cae716a00a..0f0ed97e6e 100644
--- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h
+++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT11_OASIS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot11Oasis;
-typedef void (*BgSpot11OasisActionFunc)(struct BgSpot11Oasis*, PlayState*);
+typedef void (*BgSpot11OasisActionFunc)(struct BgSpot11Oasis*, struct PlayState*);
typedef struct BgSpot11Oasis {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c
index b01eb98174..c4fc3fcdc4 100644
--- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c
+++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c
@@ -5,8 +5,17 @@
*/
#include "z_bg_spot12_gate.h"
-#include "assets/objects/object_spot12_obj/object_spot12_obj.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
#include "quake.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
+#include "assets/objects/object_spot12_obj/object_spot12_obj.h"
#define FLAGS 0
@@ -55,8 +64,9 @@ void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, PlayState* play, CollisionHea
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot12_gate.c", 145,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot12_gate.c", 145, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h
index 2e9989fc21..bb9ef25cf5 100644
--- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h
+++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT12_GATE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot12Gate;
-typedef void (*BgSpot12GateActionFunc)(struct BgSpot12Gate*, PlayState*);
+typedef void (*BgSpot12GateActionFunc)(struct BgSpot12Gate*, struct PlayState*);
typedef struct BgSpot12Gate {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c
index 7fc67b38df..f9a5253cea 100644
--- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c
+++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c
@@ -5,6 +5,15 @@
*/
#include "z_bg_spot12_saku.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_spot12_obj/object_spot12_obj.h"
#define FLAGS 0
@@ -52,8 +61,9 @@ void func_808B3420(BgSpot12Saku* this, PlayState* play, CollisionHeader* collisi
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot12_saku.c", 140,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot12_saku.c", 140, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h
index d96967300c..7ed7751ede 100644
--- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h
+++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT12_SAKU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot12Saku;
-typedef void (*BgSpot12SakuActionFunc)(struct BgSpot12Saku*, PlayState*);
+typedef void (*BgSpot12SakuActionFunc)(struct BgSpot12Saku*, struct PlayState*);
typedef struct BgSpot12Saku {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c
index b2c8f61b80..eb89d5f06a 100644
--- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c
+++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c
@@ -5,6 +5,18 @@
*/
#include "z_bg_spot15_rrbox.h"
+
+#include "array_count.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot15_obj/object_spot15_obj.h"
#define FLAGS 0
@@ -67,8 +79,9 @@ void func_808B3960(BgSpot15Rrbox* this, PlayState* play, CollisionHeader* collis
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot15_rrbox.c", 171,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot15_rrbox.c", 171, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -133,7 +146,7 @@ void BgSpot15Rrbox_Init(Actor* thisx, PlayState* play) {
} else {
func_808B4084(this, play);
}
- PRINTF("(spot15 ロンロン木箱)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF("(spot15 " T("ロンロン木箱", "Lon Lon Wooden Box") ")(arg_data 0x%04x)\n", this->dyna.actor.params);
}
void BgSpot15Rrbox_Destroy(Actor* thisx, PlayState* play) {
@@ -320,9 +333,8 @@ void func_808B43D0(BgSpot15Rrbox* this, PlayState* play) {
Actor_MoveXZGravity(actor);
if (actor->world.pos.y <= BGCHECK_Y_MIN + 10.0f) {
- // "Lon Lon wooden crate fell too much"
- PRINTF("Warning : ロンロン木箱落ちすぎた(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot15_rrbox.c", 599,
- actor->params);
+ PRINTF("Warning : " T("ロンロン木箱落ちすぎた", "Lon Lon Wooden Box fell too far") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot15_rrbox.c", 599, actor->params);
Actor_Kill(actor);
diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h
index 745c65629f..d0534e1e73 100644
--- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h
+++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT15_RRBOX_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot15Rrbox;
-typedef void (*BgSpot15RrboxActionFunc)(struct BgSpot15Rrbox*, PlayState*);
+typedef void (*BgSpot15RrboxActionFunc)(struct BgSpot15Rrbox*, struct PlayState*);
typedef struct BgSpot15Rrbox {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c
index ca52b057bb..c053a6c2d1 100644
--- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c
+++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_spot15_saku.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot15_obj/object_spot15_obj.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h
index f7ac8d09ca..35fcbee90e 100644
--- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h
+++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT15_SAKU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot15Saku;
-typedef void (*BgSpot15SakuActionFunc)(struct BgSpot15Saku*, PlayState*);
+typedef void (*BgSpot15SakuActionFunc)(struct BgSpot15Saku*, struct PlayState*);
typedef struct BgSpot15Saku {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c
index f7ba17ed02..759d2184e3 100644
--- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c
+++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c
@@ -1,9 +1,28 @@
#include "z_bg_spot16_bombstone.h"
-#include "assets/objects/object_spot16_obj/object_spot16_obj.h"
-#include "assets/objects/object_bombiwa/object_bombiwa.h"
#include "overlays/actors/ovl_En_Bombf/z_en_bombf.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_spot16_obj/object_spot16_obj.h"
+#include "assets/objects/object_bombiwa/object_bombiwa.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play);
@@ -152,7 +171,7 @@ void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->colliderJntSph);
- Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderElements);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
this->colliderJntSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
this->colliderJntSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y + 50.0f;
this->colliderJntSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
@@ -171,7 +190,7 @@ void func_808B4D04(BgSpot16Bombstone* this, PlayState* play) {
s32 func_808B4D9C(BgSpot16Bombstone* this, PlayState* play) {
if (Flags_GetSwitch(play, this->switchFlag)) {
- PRINTF("Spot16 obj 爆弾石 破壊済み\n");
+ PRINTF(T("Spot16 obj 爆弾石 破壊済み\n", "Spot16 obj Bomb Stone destroyed\n"));
return false;
}
Actor_ProcessInitChain(&this->actor, sInitChainBoulder);
@@ -221,7 +240,8 @@ s32 func_808B4E58(BgSpot16Bombstone* this, PlayState* play) {
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BOMBIWA);
if (this->requiredObjectSlot < 0) {
- PRINTF("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", actor->params, "../z_bg_spot16_bombstone.c", 589);
+ PRINTF("Error : " T("バンク危険!", "Bank danger! ") "(arg_data 0x%04x)(%s %d)\n", actor->params,
+ "../z_bg_spot16_bombstone.c", 589);
return false;
}
@@ -253,8 +273,8 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) {
#if DEBUG_FEATURES
default:
- PRINTF("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668,
- this->actor.params);
+ PRINTF(T("Error : arg_data おかしいな", "Error : arg_data is strange") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot16_bombstone.c", 668, this->actor.params);
shouldLive = false;
break;
#endif
@@ -264,7 +284,8 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->actor);
return;
}
- PRINTF("Spot16 obj 爆弾石 (scaleX %f)(arg_data 0x%04x)\n", this->actor.scale.x, this->actor.params);
+ PRINTF("Spot16 obj " T("爆弾石", "Bomb Stone") " (scaleX %f)(arg_data 0x%04x)\n", this->actor.scale.x,
+ this->actor.params);
}
void BgSpot16Bombstone_Destroy(Actor* thisx, PlayState* play) {
@@ -387,8 +408,8 @@ void func_808B56BC(BgSpot16Bombstone* this, PlayState* play) {
player->actor.world.pos.x += sinValue * this->sinRotation;
player->actor.world.pos.z += sinValue * this->cosRotation;
} else {
- PRINTF("Error 補正出来ない(%s %d)(arg_data 0x%04x)(hosei_angY %x)\n", "../z_bg_spot16_bombstone.c", 935,
- this->actor.params, adjustedYawDiff);
+ PRINTF(T("Error 補正出来ない", "Error Can't correct") "(%s %d)(arg_data 0x%04x)(hosei_angY %x)\n",
+ "../z_bg_spot16_bombstone.c", 935, this->actor.params, adjustedYawDiff);
}
}
}
diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h
index 01fb4cc3e0..577bd3863b 100644
--- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h
+++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT16_BOMBSTONE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot16Bombstone;
-typedef void (*BgSpot16BombstoneActionFunc)(struct BgSpot16Bombstone*, PlayState*);
+typedef void (*BgSpot16BombstoneActionFunc)(struct BgSpot16Bombstone*, struct PlayState*);
typedef struct BgSpot16Bombstone {
/* 0x0000 */ Actor actor;
@@ -18,7 +18,7 @@ typedef struct BgSpot16Bombstone {
/* 0x015C */ f32 sinRotation;
/* 0x0160 */ f32 cosRotation;
/* 0x0164 */ ColliderJntSph colliderJntSph;
- /* 0x0184 */ ColliderJntSphElement colliderElements[1];
+ /* 0x0184 */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x01C4 */ ColliderCylinder colliderCylinder;
/* 0x0210 */ s16 unk_210;
/* 0x0212 */ s16 unk_212;
diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c
index b71c0fd137..3ea3dd67ad 100644
--- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c
+++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c
@@ -5,8 +5,18 @@
*/
#include "z_bg_spot16_doughnut.h"
-#include "assets/objects/object_efc_doughnut/object_efc_doughnut.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64play.h"
+#include "z64save.h"
+
+#include "assets/objects/object_efc_doughnut/object_efc_doughnut.h"
#define FLAGS 0
@@ -75,7 +85,7 @@ void BgSpot16Doughnut_Init(Actor* thisx, PlayState* play) {
} else {
this->fireFlag |= 1;
}
- PRINTF("(spot16 ドーナツ雲)(arg_data 0x%04x)\n", this->actor.params);
+ PRINTF(T("(spot16 ドーナツ雲)", "(spot16 Donut Cloud)") "(arg_data 0x%04x)\n", this->actor.params);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h
index 051e45cf58..3b7008ef2d 100644
--- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h
+++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT16_DOUGHNUT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot16Doughnut;
diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c
index c6eafbdd47..03f7b4514b 100644
--- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c
+++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c
@@ -6,6 +6,17 @@
#include "z_bg_spot17_bakudankabe.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_spot17_obj/object_spot17_obj.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h
index 8928435408..fd88416ddf 100644
--- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h
+++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT17_BAKUDANKABE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot17Bakudankabe;
diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c
index 8ee2e9dadf..b03edd8aae 100644
--- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c
+++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c
@@ -5,6 +5,15 @@
*/
#include "z_bg_spot17_funen.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z64play.h"
+
#include "assets/objects/object_spot17_obj/object_spot17_obj.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -35,7 +44,7 @@ void BgSpot17Funen_Init(Actor* thisx, PlayState* play) {
BgSpot17Funen* this = (BgSpot17Funen*)thisx;
Actor_ProcessInitChain(&this->actor, sInitChain);
- PRINTF("spot17 obj. 噴煙 (arg_data 0x%04x)\n", this->actor.params);
+ PRINTF("spot17 obj. " T("噴煙", "volcanic smoke") " (arg_data 0x%04x)\n", this->actor.params);
}
void BgSpot17Funen_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h
index 6a44fa14cf..737719ea28 100644
--- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h
+++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT17_FUNEN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot17Funen;
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c
index 566d4342b5..66d8e2d509 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c
+++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c
@@ -1,6 +1,21 @@
#include "z_bg_spot18_basket.h"
-#include "assets/objects/object_spot18_obj/object_spot18_obj.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_math3d.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+
+#include "assets/objects/object_spot18_obj/object_spot18_obj.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -78,7 +93,7 @@ void func_808B7710(Actor* thisx, PlayState* play) {
BgSpot18Basket* this = (BgSpot18Basket*)thisx;
Collider_InitJntSph(play, &this->colliderJntSph);
- Collider_SetJntSph(play, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, this->ColliderJntSphElements);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, this->colliderJntSphElements);
this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
}
@@ -156,7 +171,8 @@ void BgSpot18Basket_Init(Actor* thisx, PlayState* play) {
if (this->dyna.actor.child == NULL) {
PRINTF_COLOR_RED();
- PRINTF("Error : 変化壷蓋発生失敗(%s %d)\n", "../z_bg_spot18_basket.c", 351);
+ PRINTF(T("Error : 変化壷蓋発生失敗", "Error : Failed to generate the change pot cover") "(%s %d)\n",
+ "../z_bg_spot18_basket.c", 351);
PRINTF_RST();
Actor_Kill(&this->dyna.actor);
}
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h
index 21f4bc4f23..460a56fb12 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h
+++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h
@@ -2,16 +2,16 @@
#define Z_BG_SPOT18_BASKET_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot18Basket;
-typedef void (*BgSpot18BasketActionFunc)(struct BgSpot18Basket*, PlayState*);
+typedef void (*BgSpot18BasketActionFunc)(struct BgSpot18Basket*, struct PlayState*);
typedef struct BgSpot18Basket {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderJntSph colliderJntSph;
- /* 0x0184 */ ColliderJntSphElement ColliderJntSphElements[2];
+ /* 0x0184 */ ColliderJntSphElement colliderJntSphElements[2];
/* 0x0204 */ BgSpot18BasketActionFunc actionFunc;
/* 0x0208 */ f32 unk_208;
/* 0x020C */ s16 unk_20C;
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c
index cec6266a2e..21bc50671c 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c
+++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c
@@ -5,6 +5,11 @@
*/
#include "z_bg_spot18_futa.h"
+
+#include "ichain.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_spot18_obj/object_spot18_obj.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h
index 1150611cd2..ff0c2cf8ac 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h
+++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h
@@ -2,7 +2,7 @@
#define Z_BG_SPOT18_FUTA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot18Futa;
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c
index 505797f7e9..d44a14de50 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c
+++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c
@@ -6,6 +6,18 @@
*/
#include "z_bg_spot18_obj.h"
+
+#include "array_count.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot18_obj/object_spot18_obj.h"
#define FLAGS 0
@@ -96,8 +108,8 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) {
} else if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
age = 0;
} else {
- PRINTF("Error : リンク年齢不詳 (%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 182,
- this->dyna.actor.params);
+ PRINTF(T("Error : リンク年齢不詳", "Error : Link age unknown") " (%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot18_obj.c", 182, this->dyna.actor.params);
return 0;
}
@@ -105,16 +117,17 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) {
case 0:
case 1:
if (D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age] == 0) {
- PRINTF("出現しない Object (0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("出現しない Object (0x%04x)\n", "Non-appearing Object (0x%04x)\n"), this->dyna.actor.params);
}
return D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age];
case 2:
- PRINTF("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202,
- this->dyna.actor.params);
+ PRINTF(T("Error : Obj出現判定が設定されていない",
+ "Error : Obj appearance detection is not set") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot18_obj.c", 202, this->dyna.actor.params);
return 0;
default:
- PRINTF("Error : Obj出現判定失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 210,
- this->dyna.actor.params);
+ PRINTF(T("Error : Obj出現判定失敗", "Error : Obj appearance check failed") "(%s %d)(arg_data 0x%04x)\n",
+ "../z_bg_spot18_obj.c", 210, this->dyna.actor.params);
}
return 0;
}
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h
index 5e000f646d..bfa758afd7 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h
+++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h
@@ -2,12 +2,12 @@
#define Z_BG_SPOT18_OBJ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot18Obj;
-typedef void (*BgSpot18ObjActionFunc)(struct BgSpot18Obj*, PlayState*);
-typedef s32 (*BgSpot18ObjInitFunc)(struct BgSpot18Obj*, PlayState*);
+typedef void (*BgSpot18ObjActionFunc)(struct BgSpot18Obj*, struct PlayState*);
+typedef s32 (*BgSpot18ObjInitFunc)(struct BgSpot18Obj*, struct PlayState*);
typedef struct BgSpot18Obj {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c
index a078991b46..a92e53a4f2 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c
+++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_spot18_shutter.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_spot18_obj/object_spot18_obj.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h
index 161fa9bc97..737d30bdbb 100644
--- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h
+++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h
@@ -2,11 +2,11 @@
#define Z_BG_SPOT18_SHUTTER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSpot18Shutter;
-typedef void (*BgSpot18ShutterActionFunc)(struct BgSpot18Shutter*, PlayState*);
+typedef void (*BgSpot18ShutterActionFunc)(struct BgSpot18Shutter*, struct PlayState*);
typedef struct BgSpot18Shutter {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c
index 5d96a0d750..1ddffb6c98 100644
--- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c
+++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c
@@ -5,6 +5,17 @@
*/
#include "z_bg_sst_floor.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_sst/object_sst.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h
index 9149f9214b..eb4abfa662 100644
--- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h
+++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h
@@ -2,7 +2,7 @@
#define Z_BG_SST_FLOOR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgSstFloor;
diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c
index 4ed9f8854c..47550f22bd 100644
--- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c
+++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c
@@ -5,6 +5,14 @@
*/
#include "z_bg_toki_hikari.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_toki_objects/object_toki_objects.h"
#define FLAGS ACTOR_FLAG_DRAW_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h
index b4c62dba99..3c49b61cca 100644
--- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h
+++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h
@@ -2,11 +2,11 @@
#define Z_BG_TOKI_HIKARI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgTokiHikari;
-typedef void (*BgTokiHikariActionFunc)(struct BgTokiHikari*, PlayState*);
+typedef void (*BgTokiHikariActionFunc)(struct BgTokiHikari*, struct PlayState*);
typedef struct BgTokiHikari {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c
index 8dcc00db30..a3a3856969 100644
--- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c
+++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c
@@ -5,6 +5,19 @@
*/
#include "z_bg_toki_swd.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z64cutscene_flags.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_toki_objects/object_toki_objects.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h
index 0a16201e60..5fdb9e0692 100644
--- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h
+++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h
@@ -2,11 +2,11 @@
#define Z_BG_TOKI_SWD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgTokiSwd;
-typedef void (*BgTokiSwdActionFunc)(struct BgTokiSwd*, PlayState*);
+typedef void (*BgTokiSwdActionFunc)(struct BgTokiSwd*, struct PlayState*);
typedef struct BgTokiSwd {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c
index f11a8a551a..123a797a73 100644
--- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c
+++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c
@@ -1,5 +1,5 @@
-#include "z_bg_toki_swd.h"
#include "z64cutscene_commands.h"
+#include "z64player.h"
// clang-format off
CutsceneData gPullMasterSwordCs[] = {
diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c
index de138790da..3e27901701 100644
--- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c
+++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c
@@ -1,5 +1,5 @@
-#include "z_bg_toki_swd.h"
#include "z64cutscene_commands.h"
+#include "z64player.h"
// clang-format off
CutsceneData gPlaceMasterSwordCs[] = {
diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c
index c6c5e4eb60..3e5ccb4ea6 100644
--- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c
+++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c
@@ -1,5 +1,5 @@
-#include "z_bg_toki_swd.h"
#include "z64cutscene_commands.h"
+#include "z64player.h"
// clang-format off
CutsceneData gRevealMasterSwordCs[] = {
diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c
index d245fce7cd..5a544c3015 100644
--- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c
+++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c
@@ -5,10 +5,22 @@
*/
#include "z_bg_treemouth.h"
-#include "versions.h"
-#include "assets/objects/object_spot04_objects/object_spot04_objects.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "versions.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_spot04_objects/object_spot04_objects.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void BgTreemouth_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h
index dc5a5f545f..7fea6f8e77 100644
--- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h
+++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h
@@ -2,11 +2,11 @@
#define Z_BG_TREEMOUTH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgTreemouth;
-typedef void (*BgTreemouthActionFunc)(struct BgTreemouth*, PlayState*);
+typedef void (*BgTreemouthActionFunc)(struct BgTreemouth*, struct PlayState*);
typedef struct BgTreemouth {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c
index 020b2972b1..c254318d42 100644
--- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c
+++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c
@@ -1,5 +1,6 @@
-#include "z_bg_treemouth.h"
+#include "sequence.h"
#include "z64cutscene_commands.h"
+#include "z64player.h"
// clang-format off
CutsceneData gDekuTreeMeetingCs[] = {
diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c
index dbd5148b74..63a73aaf4e 100644
--- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c
+++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c
@@ -5,6 +5,12 @@
*/
#include "z_bg_umajump.h"
+
+#include "ichain.h"
+#include "regs.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_umajump/object_umajump.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h
index 19142ec4c8..067b5195c8 100644
--- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h
+++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h
@@ -2,7 +2,7 @@
#define Z_BG_UMAJUMP_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgUmaJump;
diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c
index 87e6c54ed4..679519f1be 100644
--- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c
+++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c
@@ -5,9 +5,21 @@
*/
#include "z_bg_vb_sima.h"
-#include "assets/objects/object_fd/object_fd.h"
#include "overlays/actors/ovl_Boss_Fd/z_boss_fd.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
+#include "assets/objects/object_fd/object_fd.h"
+
#define FLAGS 0
void BgVbSima_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h
index c279ae393c..1dcee1b596 100644
--- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h
+++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h
@@ -2,7 +2,7 @@
#define Z_BG_VB_SIMA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgVbSima;
diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c
index df6e12f851..f759a98148 100644
--- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c
+++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c
@@ -5,6 +5,16 @@
*/
#include "z_bg_ydan_hasi.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_ydan_objects/object_ydan_objects.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h
index 616cd4250a..a308c6ebc0 100644
--- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h
+++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h
@@ -2,11 +2,11 @@
#define Z_BG_YDAN_HASI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgYdanHasi;
-typedef void (*BgYdanHasiActionFunc)(struct BgYdanHasi*, PlayState*);
+typedef void (*BgYdanHasiActionFunc)(struct BgYdanHasi*, struct PlayState*);
typedef struct BgYdanHasi {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c
index 2b799465ce..becd2a11cc 100644
--- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c
+++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c
@@ -5,6 +5,13 @@
*/
#include "z_bg_ydan_maruta.h"
+
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_ydan_objects/object_ydan_objects.h"
#define FLAGS 0
@@ -86,7 +93,7 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
Collider_InitTris(play, &this->collider);
- Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->elements);
+ Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderElements);
this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 16);
thisx->params = PARAMS_GET_U(thisx->params, 8, 8); // thisx is required to match here
diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h
index 72b753b83e..450c550b3a 100644
--- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h
+++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h
@@ -2,11 +2,11 @@
#define Z_BG_YDAN_MARUTA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgYdanMaruta;
-typedef void (*BgYdanMarutaActionFunc)(struct BgYdanMaruta*, PlayState*);
+typedef void (*BgYdanMarutaActionFunc)(struct BgYdanMaruta*, struct PlayState*);
typedef struct BgYdanMaruta {
/* 0x0000 */ DynaPolyActor dyna;
@@ -14,7 +14,7 @@ typedef struct BgYdanMaruta {
/* 0x0168 */ u8 switchFlag;
/* 0x016A */ s16 unk_16A;
/* 0x016C */ ColliderTris collider;
- /* 0x018C */ ColliderTrisElement elements[2];
+ /* 0x018C */ ColliderTrisElement colliderElements[2];
} BgYdanMaruta; // size = 0x0244
#endif
diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c
index 2d9b6f9296..0034cfb4ca 100644
--- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c
+++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c
@@ -5,6 +5,21 @@
*/
#include "z_bg_ydan_sp.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_ydan_objects/object_ydan_objects.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h
index e134ac6f2c..b2138e23a5 100644
--- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h
+++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h
@@ -2,11 +2,11 @@
#define Z_BG_YDAN_SP_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgYdanSp;
-typedef void (*BgYdanSpActionFunc)(struct BgYdanSp*, PlayState*);
+typedef void (*BgYdanSpActionFunc)(struct BgYdanSp*, struct PlayState*);
typedef struct BgYdanSp {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c
index 958e3c3f4f..7a12637b9d 100644
--- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c
+++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c
@@ -5,8 +5,19 @@
*/
#include "z_bg_zg.h"
-#include "assets/objects/object_zg/object_zg.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64play.h"
+
+#include "assets/objects/object_zg/object_zg.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -99,8 +110,8 @@ void BgZg_Update(Actor* thisx, PlayState* play) {
s32 action = this->action;
if (((action < 0) || (1 < action)) || (sActionFuncs[action] == NULL)) {
- // "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
sActionFuncs[action](this, play);
}
@@ -146,8 +157,8 @@ void BgZg_Draw(Actor* thisx, PlayState* play) {
s32 drawConfig = this->drawConfig;
if (((drawConfig < 0) || (drawConfig > 0)) || sDrawFuncs[drawConfig] == NULL) {
- // "Drawing mode is wrong !!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
sDrawFuncs[drawConfig](this, play);
}
diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h
index a5355defd5..c7f1add3a5 100644
--- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h
+++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h
@@ -2,12 +2,12 @@
#define Z_BG_ZG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BgZg;
-typedef void (*BgZgActionFunc)(struct BgZg*, PlayState*);
-typedef void (*BgZgDrawFunc)(struct BgZg*, PlayState*);
+typedef void (*BgZgActionFunc)(struct BgZg*, struct PlayState*);
+typedef void (*BgZgDrawFunc)(struct BgZg*, struct PlayState*);
typedef struct BgZg {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c
index ee1142b45a..bfc700c6dc 100644
--- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c
+++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c
@@ -1,6 +1,27 @@
#include "z_boss_dodongo.h"
-#include "assets/objects/object_kingdodongo/object_kingdodongo.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_kingdodongo/object_kingdodongo.h"
#include "assets/scenes/dungeons/ddan_boss/ddan_boss_room_1.h"
#define FLAGS \
@@ -48,6 +69,7 @@ ActorProfile Boss_Dodongo_Profile = {
};
#include "z_boss_dodongo_data.inc.c"
+#include "assets/overlays/ovl_Boss_Dodongo/ovl_Boss_Dodongo.c"
static InitChainEntry sInitChain[] = {
ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE),
@@ -200,7 +222,7 @@ void BossDodongo_Init(Actor* thisx, PlayState* play) {
this->unk_224 = 2.0f;
this->unk_228 = 9200.0f;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->items);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { // KD is dead
u16* temp_s1_3 = SEGMENTED_TO_VIRTUAL(gDodongosCavernBossLavaFloorTex);
diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h
index dc5398598d..191487f13f 100644
--- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h
+++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h
@@ -2,11 +2,11 @@
#define Z_BOSS_DODONGO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossDodongo;
-typedef void (*BossDodongoActionFunc)(struct BossDodongo*, PlayState*);
+typedef void (*BossDodongoActionFunc)(struct BossDodongo*, struct PlayState*);
#define BOSS_DODONGO_EFFECT_COUNT 80
@@ -96,7 +96,7 @@ typedef struct BossDodongo {
/* 0x0428 */ Vec3f subCamEye;
/* 0x0434 */ Vec3f subCamAt;
/* 0x0440 */ ColliderJntSph collider;
- /* 0x0460 */ ColliderJntSphElement items[19];
+ /* 0x0460 */ ColliderJntSphElement colliderElements[19];
/* 0x0920 */ BossDodongoEffect effects[BOSS_DODONGO_EFFECT_COUNT];
} BossDodongo; // size = 0x1820
diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c
index d4ac8f7f03..3d0061bb35 100644
--- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c
+++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.inc.c
@@ -1,4 +1,4 @@
-#include "z_boss_dodongo.h"
+#include "z64collision_check.h"
static u8 D_808C7000[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1,
@@ -236,5 +236,3 @@ static ColliderJntSphInit sJntSphInit = {
};
static Vec3f sUnkZeroVec = { 0.0f, 0.0f, 0.0f };
-
-#include "assets/overlays/ovl_Boss_Dodongo/ovl_Boss_Dodongo.c"
diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c
index 1dfc472a45..c66883ddd8 100644
--- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c
+++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c
@@ -5,12 +5,33 @@
*/
#include "z_boss_fd.h"
-#include "assets/objects/object_fd/object_fd.h"
#include "overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h"
#include "overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h"
#include "overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_fd/object_fd.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
@@ -193,7 +214,7 @@ void BossFd_Init(Actor* thisx, PlayState* play) {
this->actor.world.pos.x = this->actor.world.pos.z = 0.0f;
this->actor.world.pos.y = -200.0f;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->elements);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
for (i = 0; i < 100; i++) {
this->bodySegsPos[i].x = this->actor.world.pos.x;
diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h
index dd1cbc8f0a..1ec72040c9 100644
--- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h
+++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h
@@ -2,11 +2,11 @@
#define Z_BOSS_FD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossFd;
-typedef void (*BossFdActionFunc)(struct BossFd*, PlayState*);
+typedef void (*BossFdActionFunc)(struct BossFd*, struct PlayState*);
typedef enum BossFdActionState {
/* -1 */ BOSSFD_WAIT_INTRO = -1,
@@ -175,7 +175,7 @@ typedef struct BossFd {
/* 0x1488 */ f32 subCamAtYOffset;
/* 0x148C */ f32 subCamShake;
/* 0x1490 */ ColliderJntSph collider;
- /* 0x14B0 */ ColliderJntSphElement elements[19];
+ /* 0x14B0 */ ColliderJntSphElement colliderElements[19];
/* 0x1970 */ BossFdEffect effects[BOSSFD_EFFECT_COUNT];
} BossFd; // size = 0x43A0
diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c
index 83aa550fde..1012117e52 100644
--- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c
+++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.inc.c
@@ -1,6 +1,6 @@
-#include "global.h"
+#include "z64collision_check.h"
-static ColliderJntSphElementInit sJntSphItemsInit[19] = {
+static ColliderJntSphElementInit sJntSphElementsInit[19] = {
{
{
ELEM_MATERIAL_UNK3,
@@ -222,5 +222,5 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
19,
- sJntSphItemsInit,
+ sJntSphElementsInit,
};
diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c
index bf270508c4..856f9e34ea 100644
--- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c
+++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c
@@ -5,10 +5,28 @@
*/
#include "z_boss_fd2.h"
-#include "assets/objects/object_fd2/object_fd2.h"
#include "overlays/actors/ovl_Boss_Fd/z_boss_fd.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_fd2/object_fd2.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
@@ -185,7 +203,7 @@ void BossFd2_Init(Actor* thisx, PlayState* play) {
this->actionFunc = BossFd2_Wait;
}
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->elements);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
}
void BossFd2_Destroy(Actor* thisx, PlayState* play) {
@@ -816,7 +834,7 @@ void BossFd2_CollisionCheck(BossFd2* this, PlayState* play) {
if (this->actionFunc == BossFd2_ClawSwipe) {
Player* player = GET_PLAYER(play);
- for (i = 0; i < ARRAY_COUNT(this->elements); i++) {
+ for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
if (this->collider.elements[i].base.atElemFlags & ATELEM_HIT) {
this->collider.elements[i].base.atElemFlags &= ~ATELEM_HIT;
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h
index f2d3ff45ad..d9fbde0ada 100644
--- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h
+++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h
@@ -2,11 +2,11 @@
#define Z_BOSS_FD2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossFd2;
-typedef void (*BossFd2ActionFunc)(struct BossFd2*, PlayState*);
+typedef void (*BossFd2ActionFunc)(struct BossFd2*, struct PlayState*);
typedef enum BossFd2Signal {
/* 0 */ FD2_SIGNAL_NONE,
@@ -83,7 +83,7 @@ typedef struct BossFd2 {
/* 0x1414 */ f32 subCamAtYOffset;
/* 0x1418 */ f32 subCamShake;
/* 0x141C */ ColliderJntSph collider;
- /* 0x143C */ ColliderJntSphElement elements[9];
+ /* 0x143C */ ColliderJntSphElement colliderElements[9];
} BossFd2; // size = 0x167C
#endif
diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c
index 1098d44c3f..3a432692fe 100644
--- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c
+++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.inc.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "z64collision_check.h"
static ColliderJntSphElementInit sJntSphElementsInit[9] = {
{
diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
index 782d291b74..139d684deb 100644
--- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
+++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
@@ -6,6 +6,7 @@
#include "libc64/math64.h"
#include "libc64/qrand.h"
+#include "array_count.h"
#include "attributes.h"
#include "gfx.h"
#include "gfx_setupdl.h"
@@ -23,8 +24,7 @@
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
-
-#include "global.h"
+#include "z64save.h"
#include "assets/overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.h"
#include "assets/objects/object_ganon/object_ganon.h"
@@ -125,14 +125,14 @@ static ColliderCylinderInit sLightBallCylinderInit = {
static u8 D_808E4C58[] = { 0, 12, 10, 12, 14, 16, 12, 14, 16, 12, 14, 16, 12, 14, 16, 10, 16, 14 };
static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:0" \
- "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
static EnGanonMant* sCape;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
static s32 sSeed1;
@@ -360,7 +360,7 @@ void BossGanon_SetColliderPos(Vec3f* pos, ColliderCylinder* collider) {
void BossGanon_SetAnimationObject(BossGanon* this, PlayState* play, s32 objectId) {
this->animObjectSlot = Object_GetSlot(&play->objectCtx, objectId);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
}
static InitChainEntry sInitChain[] = {
@@ -523,7 +523,7 @@ void BossGanon_SetupIntroCutscene(BossGanon* this, PlayState* play) {
this->actionFunc = BossGanon_IntroCutscene;
this->unk_198 = 1;
this->animObjectSlot = animObjectSlot;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
Animation_MorphToLoop(&this->skelAnime, &gGanondorfPlayOrganAnim, 0.0f);
} else {
this->actionFunc = BossGanon_SetupIntroCutscene;
@@ -571,7 +571,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
f32 cos;
Camera* mainCam;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
sCape->backPush = -2.0f;
sCape->backSwayMagnitude = 0.25f;
@@ -1118,7 +1118,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
if (this->csTimer == 50) {
gSegments[6] =
- VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[Object_GetSlot(&play->objectCtx, OBJECT_GANON)].segment);
+ OS_K0_TO_PHYSICAL(play->objectCtx.slots[Object_GetSlot(&play->objectCtx, OBJECT_GANON)].segment);
if (!GET_EVENTCHKINF(EVENTCHKINF_BEGAN_GANONDORF_BATTLE)) {
TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gGanondorfTitleCardTex),
@@ -1208,7 +1208,7 @@ void BossGanon_SetupDeathCutscene(BossGanon* this, PlayState* play) {
this->csTimer = this->csState = 0;
this->unk_198 = 1;
this->animObjectSlot = animObjectSlot;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfDefeatedStartAnim, 0.0f);
this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gGanondorfDefeatedStartAnim);
this->unk_508 = 0.0f;
@@ -1221,7 +1221,7 @@ void BossGanon_SetupTowerCutscene(BossGanon* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, animObjectSlot)) {
this->animObjectSlot = animObjectSlot;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfDefeatedStartAnim, 0.0f);
this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gGanondorfDefeatedStartAnim);
this->actionFunc = BossGanon_DeathAndTowerCutscene;
@@ -1256,7 +1256,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 pad;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
this->csTimer++;
SkelAnime_Update(&this->skelAnime);
@@ -2835,7 +2835,7 @@ void BossGanon_Update(Actor* thisx, PlayState* play2) {
if ((this->actionFunc != BossGanon_IntroCutscene) && (this->actionFunc != BossGanon_DeathAndTowerCutscene)) {
BossGanon_SetAnimationObject(this, play, OBJECT_GANON_ANIME1);
} else {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
}
if (this->windowShatterState != GDF_WINDOW_SHATTER_OFF) {
diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c
index 8d73bf78c3..e2742e3bef 100644
--- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c
+++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c
@@ -4,9 +4,11 @@
#include "overlays/actors/ovl_En_Zl3/z_en_zl3.h"
#include "libc64/qrand.h"
+#include "array_count.h"
#include "attributes.h"
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "printf.h"
#include "rand.h"
#include "rumble.h"
#include "segmented_address.h"
@@ -20,6 +22,7 @@
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_ganon/object_ganon.h"
#include "assets/objects/object_ganon2/object_ganon2.h"
@@ -27,6 +30,9 @@
#include "assets/objects/object_geff/object_geff.h"
#include "assets/overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.h"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -87,7 +93,7 @@ static Vec3f D_80906D6C = { 0.0f, 0.0f, 500.0f };
static u8 D_80906D78 = 0;
-static ColliderJntSphElementInit sJntSphItemsInit1[] = {
+static ColliderJntSphElementInit sJntSphElementsInit1[] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -275,11 +281,11 @@ static ColliderJntSphInit sJntSphInit1 = {
OC2_FIRST_ONLY | OC2_TYPE_1,
COLSHAPE_JNTSPH,
},
- ARRAY_COUNT(sJntSphItemsInit1),
- sJntSphItemsInit1,
+ ARRAY_COUNT(sJntSphElementsInit1),
+ sJntSphElementsInit1,
};
-static ColliderJntSphElementInit sJntSphItemsInit2[] = {
+static ColliderJntSphElementInit sJntSphElementsInit2[] = {
{
{
ELEM_MATERIAL_UNK2,
@@ -313,8 +319,8 @@ static ColliderJntSphInit sJntSphInit2 = {
OC2_TYPE_1,
COLSHAPE_JNTSPH,
},
- ARRAY_COUNT(sJntSphItemsInit2),
- sJntSphItemsInit2,
+ ARRAY_COUNT(sJntSphElementsInit2),
+ sJntSphElementsInit2,
};
static Vec3f D_8090EB20;
@@ -375,7 +381,7 @@ void BossGanon2_SetObjectSegment(BossGanon2* this, PlayState* play, s32 objectId
s32 pad;
s32 objectSlot = Object_GetSlot(&play->objectCtx, objectId);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
if (setRSPSegment) {
OPEN_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 790);
@@ -1338,7 +1344,7 @@ void func_808FFDB0(BossGanon2* this, PlayState* play) {
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON2);
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
Animation_MorphToLoop(&this->skelAnime, &gGanonGuardIdleAnim, -10.0f);
this->actionFunc = func_808FFEBC;
diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c
index 7473f8d2d8..848707f002 100644
--- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c
+++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c
@@ -5,13 +5,34 @@
*/
#include "z_boss_ganondrof.h"
-#include "assets/objects/object_gnd/object_gnd.h"
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
#include "overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h"
#include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_gnd/object_gnd.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -294,10 +315,10 @@ void BossGanondrof_Init(Actor* thisx, PlayState* play) {
BossGanondrof_SetupPaintings(this);
}
- Collider_InitCylinder(play, &this->colliderBody);
- Collider_InitCylinder(play, &this->colliderSpear);
- Collider_SetCylinder(play, &this->colliderBody, &this->actor, &sCylinderInitBody);
- Collider_SetCylinder(play, &this->colliderSpear, &this->actor, &sCylinderInitSpear);
+ Collider_InitCylinder(play, &this->bodyCollider);
+ Collider_InitCylinder(play, &this->spearCollider);
+ Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sCylinderInitBody);
+ Collider_SetCylinder(play, &this->spearCollider, &this->actor, &sCylinderInitSpear);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
if (Flags_GetClear(play, play->roomCtx.curRoom.num)) {
Actor_Kill(&this->actor);
@@ -317,8 +338,8 @@ void BossGanondrof_Destroy(Actor* thisx, PlayState* play) {
PRINTF("DT1\n");
SkelAnime_Free(&this->skelAnime, play);
- Collider_DestroyCylinder(play, &this->colliderBody);
- Collider_DestroyCylinder(play, &this->colliderSpear);
+ Collider_DestroyCylinder(play, &this->bodyCollider);
+ Collider_DestroyCylinder(play, &this->spearCollider);
if (this->actor.params == GND_REAL_BOSS) {
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
}
@@ -461,9 +482,9 @@ void BossGanondrof_Paintings(BossGanondrof* this, PlayState* play) {
if (this->flyMode != GND_FLY_PAINTING) {
BossGanondrof_SetupNeutral(this, -20.0f);
this->timers[0] = 100;
- this->colliderBody.dim.radius = 20;
- this->colliderBody.dim.height = 60;
- this->colliderBody.dim.yShift = -33;
+ this->bodyCollider.dim.radius = 20;
+ this->bodyCollider.dim.height = 60;
+ this->bodyCollider.dim.yShift = -33;
Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_LAUGH);
this->actor.naviEnemyId = NAVI_ENEMY_PHANTOM_GANON_PHASE_2;
} else {
@@ -775,7 +796,7 @@ void BossGanondrof_SetupBlock(BossGanondrof* this, PlayState* play) {
}
void BossGanondrof_Block(BossGanondrof* this, PlayState* play) {
- this->colliderBody.base.colMaterial = COL_MATERIAL_METAL;
+ this->bodyCollider.base.colMaterial = COL_MATERIAL_METAL;
SkelAnime_Update(&this->skelAnime);
this->actor.world.pos.x += this->actor.velocity.x;
this->actor.world.pos.z += this->actor.velocity.z;
@@ -804,7 +825,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) {
f32 dxCenter = thisx->world.pos.x - GND_BOSSROOM_CENTER_X;
f32 dzCenter = thisx->world.pos.z - GND_BOSSROOM_CENTER_Z;
- this->colliderBody.base.colMaterial = COL_MATERIAL_METAL;
+ this->bodyCollider.base.colMaterial = COL_MATERIAL_METAL;
SkelAnime_Update(&this->skelAnime);
switch (this->work[GND_ACTION_STATE]) {
case CHARGE_WINDUP:
@@ -1231,13 +1252,13 @@ void BossGanondrof_CollisionCheck(BossGanondrof* this, PlayState* play) {
if (this->work[GND_INVINC_TIMER] != 0) {
this->work[GND_INVINC_TIMER]--;
this->returnCount = 0;
- this->colliderBody.base.acFlags &= ~AC_HIT;
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
} else {
- acHit = this->colliderBody.base.acFlags & AC_HIT;
+ acHit = this->bodyCollider.base.acFlags & AC_HIT;
if ((acHit && ((s8)this->actor.colChkInfo.health > 0)) || (this->returnCount != 0)) {
if (acHit) {
- this->colliderBody.base.acFlags &= ~AC_HIT;
- acHitElem = this->colliderBody.elem.acHitElem;
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
+ acHitElem = this->bodyCollider.elem.acHitElem;
}
if (this->flyMode != GND_FLY_PAINTING) {
if (acHit && (this->actionFunc != BossGanondrof_Stunned) &&
@@ -1300,7 +1321,7 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) {
PRINTF("MOVE START %d\n", this->actor.params);
this->actor.flags &= ~ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER;
- this->colliderBody.base.colMaterial = COL_MATERIAL_HIT3;
+ this->bodyCollider.base.colMaterial = COL_MATERIAL_HIT3;
if (this->killActor) {
Actor_Kill(&this->actor);
return;
@@ -1328,20 +1349,20 @@ void BossGanondrof_Update(Actor* thisx, PlayState* play) {
}
PRINTF("MOVE END\n");
- BossGanondrof_SetColliderPos(&this->targetPos, &this->colliderBody);
- BossGanondrof_SetColliderPos(&this->spearTip, &this->colliderSpear);
+ BossGanondrof_SetColliderPos(&this->targetPos, &this->bodyCollider);
+ BossGanondrof_SetColliderPos(&this->spearTip, &this->spearCollider);
if ((this->flyMode == GND_FLY_PAINTING) && !horse->bossGndInPainting) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
}
if ((this->actionFunc == BossGanondrof_Stunned) && (this->timers[0] > 1)) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base);
} else if (this->actionFunc == BossGanondrof_Block) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
} else if (this->actionFunc == BossGanondrof_Charge) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderBody.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSpear.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->bodyCollider.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->spearCollider.base);
}
this->actor.focus.pos = this->targetPos;
diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h
index 142aea02b6..1fed43e428 100644
--- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h
+++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h
@@ -2,11 +2,12 @@
#define Z_BOSS_GANONDROF_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct BossGanondrof;
-typedef void (*BossGanondrofActionFunc)(struct BossGanondrof*, PlayState*);
+typedef void (*BossGanondrofActionFunc)(struct BossGanondrof*, struct PlayState*);
#define GND_REAL_BOSS 1
#define GND_FAKE_BOSS 10
@@ -97,8 +98,8 @@ typedef struct BossGanondrof {
/* 0x0454 */ f32 rideRotY[30]; // possibly only 25 used
/* 0x04CC */ LightNode* lightNode;
/* 0x04D0 */ LightInfo lightInfo;
- /* 0x04E0 */ ColliderCylinder colliderBody;
- /* 0x052C */ ColliderCylinder colliderSpear;
+ /* 0x04E0 */ ColliderCylinder bodyCollider;
+ /* 0x052C */ ColliderCylinder spearCollider;
} BossGanondrof; // size = 0x0578
#endif
diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c
index 082b91a56f..bfd115b535 100644
--- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c
+++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c
@@ -5,11 +5,34 @@
*/
#include "z_boss_goma.h"
-#include "assets/objects/object_goma/object_goma.h"
#include "overlays/actors/ovl_En_Goma/z_en_goma.h"
#include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64environment.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_goma/object_goma.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -69,7 +92,7 @@ ActorProfile Boss_Goma_Profile = {
/**/ BossGoma_Draw,
};
-static ColliderJntSphElementInit sColliderJntSphElementInit[13] = {
+static ColliderJntSphElementInit sColliderJntSphElementsInit[13] = {
{
{
ELEM_MATERIAL_UNK3,
@@ -225,7 +248,7 @@ static ColliderJntSphInit sColliderJntSphInit = {
COLSHAPE_JNTSPH,
},
13,
- sColliderJntSphElementInit,
+ sColliderJntSphElementsInit,
};
static u8 sClearPixelTableFirstPass[16 * 16] = {
@@ -365,7 +388,7 @@ void BossGoma_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.health = 10;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements);
if (Flags_GetClear(play, play->roomCtx.curRoom.num)) {
Actor_Kill(&this->actor);
diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h
index 5931f9ca3d..4e4c8ea955 100644
--- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h
+++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h
@@ -2,11 +2,11 @@
#define Z_BOSS_GOMA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossGoma;
-typedef void (*BossGomaActionFunc)(struct BossGoma*, PlayState*);
+typedef void (*BossGomaActionFunc)(struct BossGoma*, struct PlayState*);
typedef enum BossGomaLimb {
/* 0 */ BOSSGOMA_LIMB_NONE,
@@ -150,7 +150,7 @@ typedef struct BossGoma {
/* 0x02A8 */ Vec3f defeatedLimbPositions[100]; // only 85/86 first indices actually used
/* 0x0758 */ u8 deadLimbsState[100]; // only 85/90 first indices actually used
/* 0x07BC */ ColliderJntSph collider;
- /* 0x07DC */ ColliderJntSphElement colliderItems[13];
+ /* 0x07DC */ ColliderJntSphElement colliderElements[13];
} BossGoma; // size = 0x0B1C
#endif
diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c
index fc82d8000e..c12ca1e950 100644
--- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c
+++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c
@@ -5,10 +5,38 @@
*/
#include "z_boss_mo.h"
-#include "assets/objects/object_mo/object_mo.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "letterbox.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
+
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_mo/object_mo.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"pal-1.0:128 pal-1.1:128"
@@ -389,7 +417,7 @@ void BossMo_Init(Actor* thisx, PlayState* play2) {
this->actor.world.pos.y = MO_WATER_LEVEL(play);
this->actor.prevPos = this->targetPos = this->actor.world.pos;
Collider_InitJntSph(play, &this->tentCollider);
- Collider_SetJntSph(play, &this->tentCollider, &this->actor, &sJntSphInit, this->tentElements);
+ Collider_SetJntSph(play, &this->tentCollider, &this->actor, &sJntSphInit, this->tentColliderElements);
this->tentMaxAngle = 1.0f;
}
}
@@ -1151,7 +1179,7 @@ void BossMo_TentCollisionCheck(BossMo* this, PlayState* play) {
s16 i2;
ColliderElement* acHitElem;
- for (i1 = 0; i1 < ARRAY_COUNT(this->tentElements); i1++) {
+ for (i1 = 0; i1 < ARRAY_COUNT(this->tentColliderElements); i1++) {
if (this->tentCollider.elements[i1].base.acElemFlags & ACELEM_HIT) {
for (i2 = 0; i2 < 19; i2++) {
@@ -1758,20 +1786,17 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
}
if (this->coreCollider.base.acFlags & AC_HIT) {
ColliderElement* acHitElem = this->coreCollider.elem.acHitElem;
- // "hit!!"
- PRINTF("Core_Damage_check 当り!!\n");
+ PRINTF(T("Core_Damage_check 当り!!\n", "Core_Damage_check hit!!\n"));
this->coreCollider.base.acFlags &= ~AC_HIT;
if ((acHitElem->atDmgInfo.dmgFlags & DMG_MAGIC_FIRE) && (this->work[MO_TENT_ACTION_STATE] == MO_CORE_ATTACK)) {
this->work[MO_TENT_ACTION_STATE] = MO_CORE_RETREAT;
}
- // "hit 2 !!"
- PRINTF("Core_Damage_check 当り 2 !!\n");
+ PRINTF(T("Core_Damage_check 当り 2 !!\n", "Core_Damage_check hit 2 !!\n"));
if ((this->work[MO_TENT_ACTION_STATE] != MO_CORE_UNDERWATER) && (this->work[MO_TENT_INVINC_TIMER] == 0)) {
u8 damage = CollisionCheck_GetSwordDamage(acHitElem->atDmgInfo.dmgFlags);
if ((damage != 0) && (this->work[MO_TENT_ACTION_STATE] < MO_CORE_ATTACK)) {
- // "sword hit !!"
- PRINTF("Core_Damage_check 剣 当り!!\n");
+ PRINTF(T("Core_Damage_check 剣 当り!!\n", "Core_Damage_check sword hit!!\n"));
this->work[MO_TENT_ACTION_STATE] = MO_CORE_STUNNED;
this->timers[0] = 25;
@@ -1841,8 +1866,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) {
}
}
}
- // "end !!"
- PRINTF("Core_Damage_check 終わり !!\n");
+ PRINTF(T("Core_Damage_check 終わり !!\n", "Core_Damage_check end !!\n"));
PRINTF_RST();
}
diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h
index 1b7641817e..88867ceeda 100644
--- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h
+++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h
@@ -2,11 +2,11 @@
#define Z_BOSS_MO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossMo;
-typedef void (*BossMoActionFunc)(struct BossMo*, PlayState*);
+typedef void (*BossMoActionFunc)(struct BossMo*, struct PlayState*);
typedef enum BossMoTentS16Var {
/* 0 */ MO_TENT_ACTION_STATE,
@@ -124,7 +124,7 @@ typedef struct BossMo {
/* 0x100C */ f32 subCamYawShake;
/* 0x1010 */ Vec3f tentTipPos;
/* 0x101C */ ColliderJntSph tentCollider;
- /* 0x103C */ ColliderJntSphElement tentElements[19];
+ /* 0x103C */ ColliderJntSphElement tentColliderElements[19];
/* 0x14FC */ ColliderCylinder coreCollider;
/* 0x1548 */ char unk_1548[0x44];
} BossMo; // size = 0x158C
diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c
index 58d807607c..1148cf1a99 100644
--- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c
+++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.inc.c
@@ -1,5 +1,4 @@
-#include "global.h"
-#include "z_boss_mo.h"
+#include "z64collision_check.h"
static ColliderJntSphElementInit sJntSphElementsInit[19] = {
{
diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c
index ea77056756..89ba5fab34 100644
--- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c
+++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c
@@ -5,14 +5,35 @@
*/
#include "z_boss_sst.h"
-#include "versions.h"
-#include "assets/objects/object_sst/object_sst.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "pal-1.0:128 pal-1.1:128"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
+
+#include "assets/objects/object_sst/object_sst.h"
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
+
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 pal-1.0:128 pal-1.1:128"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
@@ -274,7 +295,7 @@ void BossSst_Init(Actor* thisx, PlayState* play2) {
BossSst* this = (BossSst*)thisx;
Actor_ProcessInitChain(&this->actor, sInitChain);
- Collider_InitCylinder(play, &this->colliderCyl);
+ Collider_InitCylinder(play, &this->colliderCylinder);
Collider_InitJntSph(play, &this->colliderJntSph);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
Flags_SetSwitch(play, 0x14);
@@ -284,8 +305,8 @@ void BossSst_Init(Actor* thisx, PlayState* play2) {
SkelAnime_InitFlex(play, &this->skelAnime, &gBongoHeadSkel, &gBongoHeadEyeOpenIdleAnim, this->jointTable,
this->morphTable, 45);
ActorShape_Init(&this->actor.shape, 70000.0f, ActorShadow_DrawCircle, 95.0f);
- Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInitHead, this->colliderItems);
- Collider_SetCylinder(play, &this->colliderCyl, &this->actor, &sCylinderInitHead);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInitHead, this->colliderJntSphElements);
+ Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInitHead);
sHead = this;
this->actor.world.pos.x = ROOM_CENTER_X + 50.0f;
this->actor.world.pos.y = ROOM_CENTER_Y + 0.0f;
@@ -317,8 +338,8 @@ void BossSst_Init(Actor* thisx, PlayState* play2) {
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_BOSS);
}
} else {
- Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInitHand, this->colliderItems);
- Collider_SetCylinder(play, &this->colliderCyl, &this->actor, &sCylinderInitHand);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInitHand, this->colliderJntSphElements);
+ Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInitHand);
if (this->actor.params == BONGO_LEFT_HAND) {
SkelAnime_InitFlex(play, &this->skelAnime, &gBongoLeftHandSkel, &gBongoLeftHandIdleAnim, this->jointTable,
this->morphTable, 27);
@@ -343,7 +364,7 @@ void BossSst_Destroy(Actor* thisx, PlayState* play) {
BossSst* this = (BossSst*)thisx;
Collider_DestroyJntSph(play, &this->colliderJntSph);
- Collider_DestroyCylinder(play, &this->colliderCyl);
+ Collider_DestroyCylinder(play, &this->colliderCylinder);
Audio_StopSfxByPos(&this->center);
}
@@ -705,7 +726,7 @@ void BossSst_HeadDamagedHand(BossSst* this, PlayState* play) {
void BossSst_HeadSetupReadyCharge(BossSst* this) {
Animation_MorphToLoop(&this->skelAnime, &gBongoHeadEyeOpenIdleAnim, -5.0f);
this->actor.speed = 0.0f;
- this->colliderCyl.base.acFlags |= AC_ON;
+ this->colliderCylinder.base.acFlags |= AC_ON;
this->actionFunc = BossSst_HeadReadyCharge;
}
@@ -781,7 +802,7 @@ void BossSst_HeadSetupEndCharge(BossSst* this) {
Animation_MorphToLoop(&this->skelAnime, &gBongoHeadEyeCloseIdleAnim, -20.0f);
this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &sRoomCenter);
this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT);
- this->colliderCyl.base.acFlags &= ~AC_ON;
+ this->colliderCylinder.base.acFlags &= ~AC_ON;
this->radius *= -1.0f;
this->actionFunc = BossSst_HeadEndCharge;
}
@@ -798,7 +819,7 @@ void BossSst_HeadEndCharge(BossSst* this, PlayState* play) {
void BossSst_HeadSetupFrozenHand(BossSst* this) {
Animation_MorphToLoop(&this->skelAnime, &gBongoHeadEyeOpenIdleAnim, -5.0f);
this->ready = false;
- this->colliderCyl.base.acFlags |= AC_ON;
+ this->colliderCylinder.base.acFlags |= AC_ON;
this->actionFunc = BossSst_HeadFrozenHand;
}
@@ -811,7 +832,7 @@ void BossSst_HeadFrozenHand(BossSst* this, PlayState* play) {
void BossSst_HeadSetupUnfreezeHand(BossSst* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gBongoHeadEyeCloseAnim, -5.0f);
- this->colliderCyl.base.acFlags &= ~AC_ON;
+ this->colliderCylinder.base.acFlags &= ~AC_ON;
this->actionFunc = BossSst_HeadUnfreezeHand;
}
@@ -826,7 +847,7 @@ void BossSst_HeadSetupStunned(BossSst* this) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA,
Animation_GetLastFrame(&gBongoHeadKnockoutAnim));
this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT);
- this->colliderCyl.base.acFlags &= ~AC_ON;
+ this->colliderCylinder.base.acFlags &= ~AC_ON;
this->vVanish = false;
this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS;
BossSst_HeadSfx(this, NA_SE_EN_SHADEST_FREEZE);
@@ -878,8 +899,8 @@ void BossSst_HeadStunned(BossSst* this, PlayState* play) {
void BossSst_HeadSetupVulnerable(BossSst* this) {
Animation_MorphToLoop(&this->skelAnime, &gBongoHeadStunnedAnim, -5.0f);
- this->colliderCyl.base.acFlags |= AC_ON;
- this->colliderCyl.elem.acDmgInfo.dmgFlags = DMG_SWORD | DMG_DEKU_STICK;
+ this->colliderCylinder.base.acFlags |= AC_ON;
+ this->colliderCylinder.elem.acDmgInfo.dmgFlags = DMG_SWORD | DMG_DEKU_STICK;
this->actor.speed = 0.0f;
this->colliderJntSph.elements[10].base.acElemFlags |= (ACELEM_ON | ACELEM_HOOKABLE);
this->colliderJntSph.elements[0].base.acElemFlags &= ~ACELEM_ON;
@@ -896,7 +917,7 @@ void BossSst_HeadVulnerable(BossSst* this, PlayState* play) {
Math_StepToF(&sHandOffsets[RIGHT].z, 600.0f, 20.0f);
Math_StepToF(&sHandOffsets[LEFT].x, 200.0f, 20.0f);
Math_StepToF(&sHandOffsets[RIGHT].x, -200.0f, 20.0f);
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
this->timer += 2;
this->timer = CLAMP_MAX(this->timer, 50);
} else {
@@ -920,7 +941,7 @@ void BossSst_HeadSetupDamage(BossSst* this) {
Animation_GetLastFrame(&gBongoHeadDamageAnim));
Actor_SetColorFilter(&sHands[RIGHT]->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA,
Animation_GetLastFrame(&gBongoHeadDamageAnim));
- this->colliderCyl.base.acFlags &= ~AC_ON;
+ this->colliderCylinder.base.acFlags &= ~AC_ON;
BossSst_HeadSfx(this, NA_SE_EN_SHADEST_DAMAGE);
this->actionFunc = BossSst_HeadDamage;
}
@@ -937,8 +958,8 @@ void BossSst_HeadDamage(BossSst* this, PlayState* play) {
void BossSst_HeadSetupRecover(BossSst* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gBongoHeadRecoverAnim, -5.0f);
- this->colliderCyl.base.acFlags &= ~AC_ON;
- this->colliderCyl.elem.acDmgInfo.dmgFlags = DMG_DEFAULT;
+ this->colliderCylinder.base.acFlags &= ~AC_ON;
+ this->colliderCylinder.elem.acDmgInfo.dmgFlags = DMG_DEFAULT;
this->colliderJntSph.elements[10].base.acElemFlags &= ~(ACELEM_ON | ACELEM_HOOKABLE);
this->colliderJntSph.elements[0].base.acElemFlags |= ACELEM_ON;
this->vVanish = true;
@@ -1024,7 +1045,7 @@ void BossSst_HeadSetupDeath(BossSst* this, PlayState* play) {
Actor_SetColorFilter(&sHands[LEFT]->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 60);
Actor_SetColorFilter(&sHands[RIGHT]->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 60);
this->timer = 60;
- this->colliderCyl.base.acFlags &= ~AC_ON;
+ this->colliderCylinder.base.acFlags &= ~AC_ON;
this->colliderJntSph.base.ocFlags1 &= ~OC1_ON;
sHands[LEFT]->colliderJntSph.base.ocFlags1 &= ~OC1_ON;
sHands[RIGHT]->colliderJntSph.base.ocFlags1 &= ~OC1_ON;
@@ -1514,9 +1535,9 @@ void BossSst_HandSlam(BossSst* this, PlayState* play) {
this->ready = true;
Actor_PlaySfx(&this->actor, NA_SE_EN_SHADEST_TAIKO_LOW);
BossSst_SpawnShockwave(this);
- this->colliderCyl.base.atFlags |= AT_ON;
- Collider_UpdateCylinder(&this->actor, &this->colliderCyl);
- this->colliderCyl.dim.radius = sCylinderInitHand.dim.radius;
+ this->colliderCylinder.base.atFlags |= AT_ON;
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinder);
+ this->colliderCylinder.dim.radius = sCylinderInitHand.dim.radius;
}
}
@@ -2560,8 +2581,8 @@ void BossSst_HandCollisionCheck(BossSst* this, PlayState* play) {
}
void BossSst_HeadCollisionCheck(BossSst* this, PlayState* play) {
- if (this->colliderCyl.base.acFlags & AC_HIT) {
- this->colliderCyl.base.acFlags &= ~AC_HIT;
+ if (this->colliderCylinder.base.acFlags & AC_HIT) {
+ this->colliderCylinder.base.acFlags &= ~AC_HIT;
if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) {
if (this->actionFunc == BossSst_HeadVulnerable) {
if (Actor_ApplyDamage(&this->actor) == 0) {
@@ -2593,13 +2614,13 @@ void BossSst_UpdateHand(Actor* thisx, PlayState* play) {
BossSst* this = (BossSst*)thisx;
BossSstHandTrail* trail;
- if (this->colliderCyl.base.atFlags & AT_ON) {
+ if (this->colliderCylinder.base.atFlags & AT_ON) {
if ((this->effects[0].move < 5) ||
(this->actor.xzDistToPlayer < ((this->effects[2].scale * 0.01f) * sCylinderInitHand.dim.radius)) ||
- (this->colliderCyl.base.atFlags & AT_HIT)) {
- this->colliderCyl.base.atFlags &= ~(AT_ON | AT_HIT);
+ (this->colliderCylinder.base.atFlags & AT_HIT)) {
+ this->colliderCylinder.base.atFlags &= ~(AT_ON | AT_HIT);
} else {
- this->colliderCyl.dim.radius = (this->effects[0].scale * 0.01f) * sCylinderInitHand.dim.radius;
+ this->colliderCylinder.dim.radius = (this->effects[0].scale * 0.01f) * sCylinderInitHand.dim.radius;
}
}
@@ -2626,8 +2647,8 @@ void BossSst_UpdateHand(Actor* thisx, PlayState* play) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
- if (this->colliderCyl.base.atFlags & AT_ON) {
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCyl.base);
+ if (this->colliderCylinder.base.atFlags & AT_ON) {
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder.base);
}
if ((HAND_STATE(this) != HAND_DEATH) && (HAND_STATE(this) != HAND_WAIT) && (HAND_STATE(this) != HAND_BEAT) &&
@@ -2674,14 +2695,14 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play2) {
}
#if OOT_VERSION < NTSC_1_2
- if (this->colliderCyl.base.acFlags & AC_ON) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base);
+ if (this->colliderCylinder.base.acFlags & AC_ON) {
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
#else
if ((this->actionFunc != BossSst_HeadLurk) && (this->actionFunc != BossSst_HeadIntro)) {
- if (this->colliderCyl.base.acFlags & AC_ON) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base);
+ if (this->colliderCylinder.base.acFlags & AC_ON) {
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
@@ -2692,7 +2713,7 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play2) {
}
BossSst_MoveAround(this);
- if ((!this->vVanish || CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) &&
+ if ((!this->vVanish || ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) &&
((this->actionFunc == BossSst_HeadReadyCharge) || (this->actionFunc == BossSst_HeadCharge) ||
(this->actionFunc == BossSst_HeadFrozenHand) || (this->actionFunc == BossSst_HeadStunned) ||
(this->actionFunc == BossSst_HeadVulnerable) || (this->actionFunc == BossSst_HeadDamage))) {
@@ -2797,7 +2818,7 @@ s32 BossSst_OverrideHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
Gfx** gfx) {
BossSst* this = (BossSst*)thisx;
- if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) && this->vVanish) {
+ if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS) && this->vVanish) {
*dList = NULL;
} else if (this->actionFunc == BossSst_HeadThrash) { // Animation modifications for death cutscene
s32 shakeAmp = (this->timer / 10) + 1;
@@ -2862,9 +2883,9 @@ void BossSst_PostHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro
if (limbIndex == 8) {
Matrix_MultVec3f(&zeroVec, &this->actor.focus.pos);
Matrix_MultVec3f(&headVec, &headPos);
- this->colliderCyl.dim.pos.x = headPos.x;
- this->colliderCyl.dim.pos.y = headPos.y;
- this->colliderCyl.dim.pos.z = headPos.z;
+ this->colliderCylinder.dim.pos.x = headPos.x;
+ this->colliderCylinder.dim.pos.y = headPos.y;
+ this->colliderCylinder.dim.pos.z = headPos.z;
}
Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
@@ -2876,7 +2897,7 @@ void BossSst_DrawHead(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_boss_sst.c", 6810);
- if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gDPSetPrimColor(POLY_OPA_DISP++, 0x00, 0x80, sBodyColor.r, sBodyColor.g, sBodyColor.b, 255);
if (!sBodyStatic) {
@@ -2903,7 +2924,7 @@ void BossSst_DrawHead(Actor* thisx, PlayState* play) {
Matrix_RotateY(-randYaw, MTXMODE_APPLY);
}
- if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
POLY_OPA_DISP =
SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
BossSst_OverrideHeadDraw, BossSst_PostHeadDraw, this, POLY_OPA_DISP);
diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h
index f064f2b842..caf4891ccb 100644
--- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h
+++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h
@@ -2,11 +2,11 @@
#define Z_BOSS_SST_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossSst;
-typedef void (*BossSstActionFunc)(struct BossSst*, PlayState*);
+typedef void (*BossSstActionFunc)(struct BossSst*, struct PlayState*);
#define BOSS_SST_EFFECT_COUNT 18
@@ -46,8 +46,8 @@ typedef struct BossSst {
/* 0x03C4 */ f32 radius;
/* 0x03C8 */ Vec3f center;
/* 0x03D4 */ ColliderJntSph colliderJntSph;
- /* 0x03F4 */ ColliderJntSphElement colliderItems[11];
- /* 0x06B4 */ ColliderCylinder colliderCyl;
+ /* 0x03F4 */ ColliderJntSphElement colliderJntSphElements[11];
+ /* 0x06B4 */ ColliderCylinder colliderCylinder;
/* 0x0700 */ BossSstEffect effects[BOSS_SST_EFFECT_COUNT];
/* 0x09D0 */ s16 trailIndex;
/* 0x09D2 */ s16 trailCount;
diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c
index cc06356aa8..0016ff93d5 100644
--- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c
+++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.inc.c
@@ -1,6 +1,6 @@
-#include "z_boss_sst.h"
+#include "z64collision_check.h"
-static ColliderJntSphElementInit sJntSphItemsInitHand[11] = {
+static ColliderJntSphElementInit sJntSphElementsInitHand[11] = {
{
{
ELEM_MATERIAL_UNK1,
@@ -134,10 +134,10 @@ static ColliderJntSphInit sJntSphInitHand = {
COLSHAPE_JNTSPH,
},
11,
- sJntSphItemsInitHand,
+ sJntSphElementsInitHand,
};
-static ColliderJntSphElementInit sJntSphItemsInitHead[11] = {
+static ColliderJntSphElementInit sJntSphElementsInitHead[11] = {
{
{
ELEM_MATERIAL_UNK1,
@@ -271,7 +271,7 @@ static ColliderJntSphInit sJntSphInitHead = {
COLSHAPE_JNTSPH,
},
11,
- sJntSphItemsInitHead,
+ sJntSphElementsInitHead,
};
static ColliderCylinderInit sCylinderInitHead = {
diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c
index 110c3325e9..7000900b49 100644
--- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c
+++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c
@@ -1,7 +1,33 @@
#include "z_boss_tw.h"
+#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_tw/object_tw.h"
-#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h
index eb2a4ef74c..df62aeff37 100644
--- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h
+++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h
@@ -2,11 +2,11 @@
#define Z_BOSS_TW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossTw;
-typedef void (*BossTwActionFunc)(struct BossTw* this, PlayState* play);
+typedef void (*BossTwActionFunc)(struct BossTw* this, struct PlayState* play);
typedef enum TwWork {
/* 0 */ CS_TIMER_1,
diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c
index e6ac36d486..aec25c7cf2 100644
--- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c
+++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c
@@ -5,12 +5,32 @@
*/
#include "z_boss_va.h"
-#include "assets/objects/object_bv/object_bv.h"
#include "overlays/actors/ovl_En_Boom/z_en_boom.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_bv/object_bv.h"
+
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:0" \
+ "ntsc-1.1:0 ntsc-1.2:0 pal-1.0:128 pal-1.1:128"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
@@ -612,7 +632,9 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
break;
default:
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
- SkelAnime_Init(play, &this->skelAnime, &gBarinadeBariSkel, &gBarinadeBariAnim, NULL, NULL, 0);
+ //! @bug Flex skeleton is used as normal skeleton
+ SkelAnime_Init(play, &this->skelAnime, (SkeletonHeader*)&gBarinadeBariSkel, &gBarinadeBariAnim, NULL, NULL,
+ 0);
this->actor.shape.yOffset = 400.0f;
break;
case BOSSVA_DOOR:
@@ -680,8 +702,8 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
}
this->zapHeadPos.x = 1.0f;
- Collider_InitCylinder(play, &this->colliderBody);
- Collider_SetCylinder(play, &this->colliderBody, &this->actor, &sCylinderInit);
+ Collider_InitCylinder(play, &this->bodyCollider);
+ Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sCylinderInit);
for (i = BOSSVA_ZAPPER_3; i >= BOSSVA_SUPPORT_1; i--) {
Actor_SpawnAsChild(
@@ -702,8 +724,9 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
case BOSSVA_SUPPORT_1:
case BOSSVA_SUPPORT_2:
case BOSSVA_SUPPORT_3:
- Collider_InitJntSph(play, &this->colliderSph);
- Collider_SetJntSph(play, &this->colliderSph, &this->actor, &sJntSphInitSupport, this->elements);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInitSupport,
+ this->colliderJntSphElements);
if (sCsState < BOSSVA_BATTLE) {
BossVa_SetupSupportIntro(this, play);
} else {
@@ -731,8 +754,9 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
BossVa_SetupDoor(this, play);
break;
default:
- Collider_InitJntSph(play, &this->colliderSph);
- Collider_SetJntSph(play, &this->colliderSph, &this->actor, &sJntSphInitBari, this->elements);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInitBari,
+ this->colliderJntSphElements);
Collider_InitQuad(play, &this->colliderLightning);
Collider_SetQuad(play, &this->colliderLightning, &this->actor, &sQuadInit);
this->unk_1D8.x = 1.0f;
@@ -752,8 +776,8 @@ void BossVa_Destroy(Actor* thisx, PlayState* play) {
BossVa* this = (BossVa*)thisx;
SkelAnime_Free(&this->skelAnime, play);
- Collider_DestroyJntSph(play, &this->colliderSph);
- Collider_DestroyCylinder(play, &this->colliderBody);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
+ Collider_DestroyCylinder(play, &this->bodyCollider);
}
void BossVa_SetupIntro(BossVa* this) {
@@ -1071,9 +1095,9 @@ void BossVa_BodyPhase1(BossVa* this, PlayState* play) {
}
}
- if (this->colliderBody.base.atFlags & AT_HIT) {
- this->colliderBody.base.atFlags &= ~AT_HIT;
- if (this->colliderBody.base.at == &player->actor) {
+ if (this->bodyCollider.base.atFlags & AT_HIT) {
+ this->bodyCollider.base.atFlags &= ~AT_HIT;
+ if (this->bodyCollider.base.at == &player->actor) {
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f);
}
}
@@ -1101,9 +1125,9 @@ void BossVa_BodyPhase1(BossVa* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_BL_SPARK - SFX_FLAG);
}
- Collider_UpdateCylinder(&this->actor, &this->colliderBody);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderBody.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderBody.base);
+ Collider_UpdateCylinder(&this->actor, &this->bodyCollider);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->bodyCollider.base);
func_800F436C(&this->actor.projectedPos, NA_SE_EN_BALINADE_LEVEL - SFX_FLAG, 1.0f);
}
@@ -1133,17 +1157,17 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 160);
this->actor.colorFilterTimer = this->invincibilityTimer;
} else {
- this->colliderBody.elem.acDmgInfo.dmgFlags = DMG_BOOMERANG;
+ this->bodyCollider.elem.acDmgInfo.dmgFlags = DMG_BOOMERANG;
}
}
- if (this->colliderBody.base.acFlags & AC_HIT) {
- this->colliderBody.base.acFlags &= ~AC_HIT;
+ if (this->bodyCollider.base.acFlags & AC_HIT) {
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
- if (this->colliderBody.base.ac->id == ACTOR_EN_BOOM) {
+ if (this->bodyCollider.base.ac->id == ACTOR_EN_BOOM) {
sPhase2Timer &= 0xFE00;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 160);
- this->colliderBody.elem.acDmgInfo.dmgFlags = DMG_SWORD | DMG_BOOMERANG | DMG_DEKU_STICK;
+ this->bodyCollider.elem.acDmgInfo.dmgFlags = DMG_SWORD | DMG_BOOMERANG | DMG_DEKU_STICK;
} else {
sKillBari++;
if ((this->actor.colorFilterTimer != 0) && !(this->actor.colorFilterParams & 0x4000)) {
@@ -1161,11 +1185,11 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_FAINT);
}
- if (this->colliderBody.base.atFlags & AT_HIT) {
- this->colliderBody.base.atFlags &= ~AT_HIT;
+ if (this->bodyCollider.base.atFlags & AT_HIT) {
+ this->bodyCollider.base.atFlags &= ~AT_HIT;
sPhase2Timer = (sPhase2Timer + 0x18) & 0xFFF0;
- if (this->colliderBody.base.at == &player->actor) {
+ if (this->bodyCollider.base.at == &player->actor) {
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f);
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
}
@@ -1209,14 +1233,14 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 45.0f;
- Collider_UpdateCylinder(&this->actor, &this->colliderBody);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderBody.base);
+ Collider_UpdateCylinder(&this->actor, &this->bodyCollider);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base);
if (this->actor.colorFilterTimer == 0) {
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->bodyCollider.base);
}
if ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000)) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
}
func_800F436C(&this->actor.projectedPos, NA_SE_EN_BALINADE_LEVEL - SFX_FLAG,
@@ -1224,7 +1248,7 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
}
void BossVa_SetupBodyPhase3(BossVa* this) {
- this->colliderBody.elem.acDmgInfo.dmgFlags = DMG_BOOMERANG;
+ this->bodyCollider.elem.acDmgInfo.dmgFlags = DMG_BOOMERANG;
this->actor.speed = 0.0f;
sPhase3StopMoving = false;
BossVa_SetupAction(this, BossVa_BodyPhase3);
@@ -1239,16 +1263,16 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) {
sp62 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
this->unk_1B0 += 0xCE4;
this->bodyGlow = (s16)(Math_SinS(this->unk_1B0) * 50.0f) + 150;
- if (this->colliderBody.base.atFlags & AT_HIT) {
- this->colliderBody.base.atFlags &= ~AT_HIT;
- if (this->colliderBody.base.at == &player->actor) {
+ if (this->bodyCollider.base.atFlags & AT_HIT) {
+ this->bodyCollider.base.atFlags &= ~AT_HIT;
+ if (this->bodyCollider.base.at == &player->actor) {
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f);
this->actor.world.rot.y += (s16)Rand_CenteredFloat(0x2EE0) + 0x8000;
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
}
}
- if (this->colliderBody.base.acFlags & AC_HIT) {
+ if (this->bodyCollider.base.acFlags & AC_HIT) {
this->skelAnime.curFrame = 0.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 12);
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_FAINT);
@@ -1326,11 +1350,11 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_BL_SPARK - SFX_FLAG);
}
- Collider_UpdateCylinder(&this->actor, &this->colliderBody);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderBody.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderBody.base);
+ Collider_UpdateCylinder(&this->actor, &this->bodyCollider);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->bodyCollider.base);
if (this->timer == 0) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
}
func_800F436C(&this->actor.projectedPos, NA_SE_EN_BALINADE_LEVEL - SFX_FLAG,
@@ -1349,7 +1373,7 @@ void BossVa_SetupBodyPhase4(BossVa* this, PlayState* play) {
this->timer = -30;
}
- this->colliderBody.dim.radius = 55;
+ this->bodyCollider.dim.radius = 55;
BossVa_SetupAction(this, BossVa_BodyPhase4);
}
@@ -1360,9 +1384,9 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
this->unk_1B0 = (this->unk_1B0 + (s16)((sFightPhase - PHASE_4 + 1) * 1000.0f)) + 0xCE4;
this->bodyGlow = (s16)(Math_SinS(this->unk_1B0) * 50.0f) + 150;
- if (this->colliderBody.base.atFlags & AT_HIT) {
- this->colliderBody.base.atFlags &= ~AT_HIT;
- if (this->colliderBody.base.at == &player->actor) {
+ if (this->bodyCollider.base.atFlags & AT_HIT) {
+ this->bodyCollider.base.atFlags &= ~AT_HIT;
+ if (this->bodyCollider.base.at == &player->actor) {
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f);
this->actor.world.rot.y += (s16)Rand_CenteredFloat(0x2EE0) + 0x8000;
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
@@ -1372,8 +1396,8 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_BL_SPARK - SFX_FLAG);
}
- if (this->colliderBody.base.acFlags & AC_HIT) {
- this->colliderBody.base.acFlags &= ~AC_HIT;
+ if (this->bodyCollider.base.acFlags & AC_HIT) {
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
this->skelAnime.curFrame = 0.0f;
if (this->timer >= 0) {
if (this->invincibilityTimer == 0) {
@@ -1403,8 +1427,8 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_FAINT);
}
}
- } else if (this->colliderBody.base.ac->id == ACTOR_EN_BOOM) {
- boomerang = (EnBoom*)this->colliderBody.base.ac;
+ } else if (this->bodyCollider.base.ac->id == ACTOR_EN_BOOM) {
+ boomerang = (EnBoom*)this->bodyCollider.base.ac;
boomerang->returnTimer = 0;
boomerang->moveTo = &player->actor;
boomerang->actor.world.rot.y = boomerang->actor.yawTowardsPlayer;
@@ -1428,7 +1452,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
}
Math_SmoothStepToF(&this->actor.speed, ((sFightPhase - PHASE_4 + 1) * 1.5f) + 4.0f, 1.0f, 0.25f, 0.0f);
}
- this->colliderBody.elem.acDmgInfo.dmgFlags = DMG_BOOMERANG;
+ this->bodyCollider.elem.acDmgInfo.dmgFlags = DMG_BOOMERANG;
} else {
Math_SmoothStepToS(&this->vaBodySpinRate, 0, 1, 0x96, 0);
if (this->timer > 0) {
@@ -1436,7 +1460,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
this->timer = 35;
}
Math_SmoothStepToF(&this->actor.shape.yOffset, -480.0f, 1.0f, 30.0f, 0.0f);
- this->colliderBody.elem.acDmgInfo.dmgFlags = DMG_SWORD | DMG_BOOMERANG | DMG_DEKU_STICK;
+ this->bodyCollider.elem.acDmgInfo.dmgFlags = DMG_SWORD | DMG_BOOMERANG | DMG_DEKU_STICK;
this->timer--;
} else {
if ((player->stateFlags1 & PLAYER_STATE1_26) && (this->timer < -60)) {
@@ -1498,13 +1522,13 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) {
}
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 70.0f, 0.0f, UPDBGCHECKINFO_FLAG_0);
- Collider_UpdateCylinder(&this->actor, &this->colliderBody);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderBody.base);
+ Collider_UpdateCylinder(&this->actor, &this->bodyCollider);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base);
if (this->invincibilityTimer == 0) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
}
if ((this->vaBodySpinRate > 0x3E8) || (this->actor.shape.yOffset < -1200.0f)) {
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->bodyCollider.base);
}
func_800F436C(&this->actor.projectedPos, NA_SE_EN_BALINADE_LEVEL - SFX_FLAG,
(this->vaBodySpinRate * 0.00025f) + 1.0f);
@@ -1745,11 +1769,11 @@ void BossVa_SupportAttached(BossVa* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_BL_SPARK - SFX_FLAG);
}
- if (this->colliderSph.base.acFlags & AC_HIT) {
+ if (this->colliderJntSph.base.acFlags & AC_HIT) {
BossVa_SetupSupportCut(this, play);
} else {
if (this->actor.colorFilterTimer == 0) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
if ((this->timer % 2) == 0) {
@@ -2548,23 +2572,23 @@ void BossVa_BariPhase3Attack(BossVa* this, PlayState* play) {
Math_SmoothStepToS(&this->vaBariUnused.z, this->vaBariUnused.x, 1, 0x1E, 0);
this->vaBariUnused.y += this->vaBariUnused.z;
- if ((this->colliderLightning.base.atFlags & AT_HIT) || (this->colliderSph.base.atFlags & AT_HIT)) {
- if ((this->colliderLightning.base.at == &player->actor) || (this->colliderSph.base.at == &player->actor)) {
+ if ((this->colliderLightning.base.atFlags & AT_HIT) || (this->colliderJntSph.base.atFlags & AT_HIT)) {
+ if ((this->colliderLightning.base.at == &player->actor) || (this->colliderJntSph.base.at == &player->actor)) {
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, GET_BODY(this)->actor.yawTowardsPlayer,
8.0f);
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
- this->colliderSph.base.at = NULL;
+ this->colliderJntSph.base.at = NULL;
this->colliderLightning.base.at = NULL;
}
this->colliderLightning.base.atFlags &= ~AT_HIT;
- this->colliderSph.base.atFlags &= ~AT_HIT;
+ this->colliderJntSph.base.atFlags &= ~AT_HIT;
}
- if (this->colliderSph.base.acFlags & AC_HIT) {
- this->colliderSph.base.acFlags &= ~AC_HIT;
- if ((this->colliderSph.base.ac->id == ACTOR_EN_BOOM) && (sp52 >= 128)) {
- boomerang = (EnBoom*)this->colliderSph.base.ac;
+ if (this->colliderJntSph.base.acFlags & AC_HIT) {
+ this->colliderJntSph.base.acFlags &= ~AC_HIT;
+ if ((this->colliderJntSph.base.ac->id == ACTOR_EN_BOOM) && (sp52 >= 128)) {
+ boomerang = (EnBoom*)this->colliderJntSph.base.ac;
boomerang->returnTimer = 0;
boomerang->moveTo = &player->actor;
boomerang->actor.world.rot.y = boomerang->actor.yawTowardsPlayer;
@@ -2587,14 +2611,14 @@ void BossVa_BariPhase3Attack(BossVa* this, PlayState* play) {
if (sp52 >= 128) {
BossVa_Spark(play, this, 1, 75, 15.0f, 7.0f, SPARK_TETHER, 1.0f, true);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
sPhase3StopMoving = false;
} else {
sPhase3StopMoving = true;
}
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderLightning.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
if ((play->gameplayFrames % 4) == 0) {
Math_SmoothStepToS(&this->unk_1F0, 0x78, 1, 0xA, 0);
}
@@ -2644,17 +2668,17 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) {
return;
}
- if ((this->colliderLightning.base.atFlags & AT_HIT) || (this->colliderSph.base.atFlags & AT_HIT)) {
- if ((this->colliderLightning.base.at == &player->actor) || (this->colliderSph.base.at == &player->actor)) {
+ if ((this->colliderLightning.base.atFlags & AT_HIT) || (this->colliderJntSph.base.atFlags & AT_HIT)) {
+ if ((this->colliderLightning.base.at == &player->actor) || (this->colliderJntSph.base.at == &player->actor)) {
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, GET_BODY(this)->actor.yawTowardsPlayer,
8.0f);
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
- this->colliderSph.base.at = NULL;
+ this->colliderJntSph.base.at = NULL;
this->colliderLightning.base.at = NULL;
}
this->colliderLightning.base.atFlags &= ~AT_HIT;
- this->colliderSph.base.atFlags &= ~AT_HIT;
+ this->colliderJntSph.base.atFlags &= ~AT_HIT;
}
Math_SmoothStepToF(&this->actor.world.pos.y, 4.0f, 1.0f, 2.0f, 0.0f);
@@ -2675,11 +2699,11 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) {
Math_SmoothStepToF(&this->unk_1A0, (Math_SinS(sPhase2Timer * 0x190) * sp4C) + 320.0f, 1.0f, 10.0f, 0.0f);
Math_SmoothStepToS(&this->unk_1AC, sp50 + 0x1F4, 1, 0x3C, 0);
this->actor.world.pos.y += 2.0f * Math_SinF(this->unk_1A4);
- if (this->colliderSph.base.acFlags & AC_HIT) {
- this->colliderSph.base.acFlags &= ~AC_HIT;
+ if (this->colliderJntSph.base.acFlags & AC_HIT) {
+ this->colliderJntSph.base.acFlags &= ~AC_HIT;
- if ((this->colliderSph.base.ac->id == ACTOR_EN_BOOM) && (sp52 >= 64)) {
- boomerang = (EnBoom*)this->colliderSph.base.ac;
+ if ((this->colliderJntSph.base.ac->id == ACTOR_EN_BOOM) && (sp52 >= 64)) {
+ boomerang = (EnBoom*)this->colliderJntSph.base.ac;
boomerang->returnTimer = 0;
boomerang->moveTo = &player->actor;
boomerang->actor.world.rot.y = boomerang->actor.yawTowardsPlayer;
@@ -2688,7 +2712,7 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) {
}
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderLightning.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
} else {
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
Math_SmoothStepToS(&this->unk_1AC, sp50 + 150, 1, 0x3C, 0);
@@ -2703,13 +2727,13 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) {
}
this->actor.world.pos.y += Math_SinF(this->unk_1A4) * 4.0f;
- if (this->colliderSph.base.acFlags & AC_HIT) {
+ if (this->colliderJntSph.base.acFlags & AC_HIT) {
BossVa_KillBari(this, play);
}
}
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x5DC, 0);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
if ((play->gameplayFrames % 4) == 0) {
Math_SmoothStepToS(&this->unk_1F0, 0x78, 1, 0xA, 0);
}
@@ -2742,7 +2766,7 @@ void BossVa_BariPhase3Stunned(BossVa* this, PlayState* play) {
Vec3f sp40 = GET_BODY(this)->unk_1D8;
this->actor.world.rot.x = Math_Vec3f_Pitch(&GET_BODY(this)->actor.world.pos, &this->actor.world.pos);
- if (this->colliderSph.base.acFlags & AC_HIT) {
+ if (this->colliderJntSph.base.acFlags & AC_HIT) {
BossVa_KillBari(this, play);
return;
}
@@ -2750,7 +2774,7 @@ void BossVa_BariPhase3Stunned(BossVa* this, PlayState* play) {
this->unk_1A4 += Rand_ZeroOne() * 0.5f;
Math_SmoothStepToF(&this->actor.world.pos.y, 4.0f, 1.0f, 2.0f, 0.0f);
this->actor.world.pos.y += Math_SinF(this->unk_1A4) * 3.0f;
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
if ((play->gameplayFrames % 4) == 0) {
Math_SmoothStepToS(&this->unk_1F0, 0x28, 1, 0xA, 0);
BossVa_Spark(play, this, 1, this->unk_1F0, 25.0f, 20.0f, SPARK_BARI, 2.0f, true);
@@ -2819,10 +2843,10 @@ void BossVa_Update(Actor* thisx, PlayState* play2) {
switch (this->actor.params) {
case BOSSVA_BODY:
- if (this->colliderBody.base.acFlags & AC_HIT) {
- this->colliderBody.base.acFlags &= ~AC_HIT;
- if (this->colliderBody.base.ac->id == ACTOR_EN_BOOM) {
- boomerang = (EnBoom*)this->colliderBody.base.ac;
+ if (this->bodyCollider.base.acFlags & AC_HIT) {
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
+ if (this->bodyCollider.base.ac->id == ACTOR_EN_BOOM) {
+ boomerang = (EnBoom*)this->bodyCollider.base.ac;
boomerang->returnTimer = 0;
}
}
@@ -2972,7 +2996,7 @@ void BossVa_SupportPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
switch (limbIndex) {
case 4:
Matrix_MultVec3f(&sZeroVec, &this->actor.focus.pos);
- Collider_UpdateSpheres(0, &this->colliderSph);
+ Collider_UpdateSpheres(0, &this->colliderJntSph);
break;
case 7:
Matrix_MultVec3f(&sZeroVec, &this->armTip);
@@ -3228,7 +3252,7 @@ void BossVa_Draw(Actor* thisx, PlayState* play) {
if (!this->isDead) {
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
BossVa_BariOverrideLimbDraw, BossVa_BariPostLimbDraw, this);
- Collider_UpdateSpheres(0, &this->colliderSph);
+ Collider_UpdateSpheres(0, &this->colliderJntSph);
if (sCsState < BOSSVA_BATTLE) {
spBC = GET_BODY(this)->actor.world.pos;
} else {
diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h
index f5e6c8a896..628831ad2f 100644
--- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h
+++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h
@@ -2,11 +2,11 @@
#define Z_BOSS_VA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct BossVa;
-typedef void (*BossVaActionFunc)(struct BossVa*, PlayState*);
+typedef void (*BossVaActionFunc)(struct BossVa*, struct PlayState*);
typedef struct BossVa {
/* 0x0000 */ Actor actor;
@@ -41,9 +41,9 @@ typedef struct BossVa {
/* 0x01FC */ Vec3f effectPos[10];
/* 0x0274 */ Vec3f unk_274; // Unused body position
/* 0x0280 */ Vec3f unk_280; // Unused body position
- /* 0x028C */ ColliderCylinder colliderBody;
- /* 0x02D8 */ ColliderJntSph colliderSph;
- /* 0x02F8 */ ColliderJntSphElement elements[1];
+ /* 0x028C */ ColliderCylinder bodyCollider;
+ /* 0x02D8 */ ColliderJntSph colliderJntSph;
+ /* 0x02F8 */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x0338 */ ColliderQuad colliderLightning;
} BossVa; // size = 0x03B8
diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c
index 7657cf7432..1673a99601 100644
--- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c
+++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c
@@ -5,11 +5,27 @@
*/
#include "z_demo_6k.h"
+#include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_demo_6k/object_demo_6k.h"
#include "assets/objects/object_gnd_magic/object_gnd_magic.h"
-#include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h
index 09d9c175fb..5849ccc236 100644
--- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h
+++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h
@@ -2,11 +2,12 @@
#define Z_DEMO_6K_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct Demo6K;
-typedef void (*Demo6KActionFunc)(struct Demo6K*, PlayState*);
+typedef void (*Demo6KActionFunc)(struct Demo6K*, struct PlayState*);
typedef struct Demo6K {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c
index a5e7139f07..d3d275de9e 100644
--- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c
+++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c
@@ -1,8 +1,23 @@
#include "z_demo_du.h"
-#include "assets/objects/object_du/object_du.h"
#include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_du/object_du.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -907,8 +922,8 @@ void DemoDu_CsCredits_HandleCues(DemoDu* this, PlayState* play) {
DemoDu_CsCredits_AdvanceTo04(this);
break;
default:
- // "Demo_Du_inEnding_Check_DemoMode:There is no such operation!!!!!!!!"
- PRINTF("Demo_Du_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Du_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Du_inEnding_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->cueId = nextCueId;
@@ -964,8 +979,8 @@ void DemoDu_Update(Actor* thisx, PlayState* play) {
DemoDu* this = (DemoDu*)thisx;
if (this->updateIndex < 0 || this->updateIndex >= 29 || sUpdateFuncs[this->updateIndex] == NULL) {
- // "The main mode is abnormal!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sUpdateFuncs[this->updateIndex](this, play);
@@ -1035,8 +1050,8 @@ void DemoDu_Draw(Actor* thisx, PlayState* play) {
DemoDu* this = (DemoDu*)thisx;
if (this->drawIndex < 0 || this->drawIndex >= 3 || sDrawFuncs[this->drawIndex] == NULL) {
- // "The drawing mode is abnormal!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawIndex](thisx, play);
diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.h b/src/overlays/actors/ovl_Demo_Du/z_demo_du.h
index d46f03145e..ede2756e05 100644
--- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.h
+++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.h
@@ -2,7 +2,7 @@
#define Z_DEMO_DU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoDu;
diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du_cutscene_data.inc.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du_cutscene_data.inc.c
index 06dbb35c11..ad83a24185 100644
--- a/src/overlays/actors/ovl_Demo_Du/z_demo_du_cutscene_data.inc.c
+++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du_cutscene_data.inc.c
@@ -1,5 +1,6 @@
-#include "z_demo_du.h"
+#include "sequence.h"
#include "z64cutscene_commands.h"
+#include "z64player.h"
// clang-format off
static CutsceneData gFireMedallionCs[] = {
diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c
index 3f19529df0..c2c86d8a04 100644
--- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c
+++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c
@@ -5,7 +5,18 @@
*/
#include "z_demo_ec.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_zo/object_zo.h"
#include "assets/objects/object_ec/object_ec.h"
#include "assets/objects/object_ma2/object_ma2.h"
@@ -158,7 +169,8 @@ void DemoEc_Init(Actor* thisx, PlayState* play) {
DemoEc* this = (DemoEc*)thisx;
if ((this->actor.params < 0) || (this->actor.params > 34)) {
- PRINTF(VT_FGCOL(RED) "Demo_Ec_Actor_ct:arg_dataがおかしい!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("Demo_Ec_Actor_ct:arg_dataがおかしい!!!!!!!!!!!!\n",
+ "Demo_Ec_Actor_ct:arg_data is strange!!!!!!!!!!!!\n") VT_RST);
Actor_Kill(&this->actor);
} else {
this->updateMode = EC_UPDATE_COMMON;
@@ -320,7 +332,7 @@ void DemoEc_UseDrawObject(DemoEc* this, PlayState* play) {
OPEN_DISPS(gfxCtx, "../z_demo_ec.c", 662);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[drawObjectSlot].segment);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[drawObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[drawObjectSlot].segment);
if (!play) {}
CLOSE_DISPS(gfxCtx, "../z_demo_ec.c", 670);
@@ -329,7 +341,7 @@ void DemoEc_UseDrawObject(DemoEc* this, PlayState* play) {
void DemoEc_UseAnimationObject(DemoEc* this, PlayState* play) {
s32 animObjectSlot = this->animObjectSlot;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
}
CsCmdActorCue* DemoEc_GetCue(PlayState* play, s32 cueChannel) {
@@ -691,7 +703,7 @@ Gfx* DemoEc_GetCarpenterPostLimbDList(DemoEc* this) {
case 13:
return object_daiku_DL_005880;
default:
- PRINTF(VT_FGCOL(RED) "かつらが無い!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("かつらが無い!!!!!!!!!!!!!!!!\n", "No wig!!!!!!!!!!!!!!!!\n") VT_RST);
return NULL;
}
}
@@ -737,7 +749,7 @@ Gfx* DemoEc_GetGerudoPostLimbDList(DemoEc* this) {
case 18:
return gGerudoWhiteHairstyleSpikyDL;
default:
- PRINTF(VT_FGCOL(RED) "かつらが無い!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("かつらが無い!!!!!!!!!!!!!!!!\n", "No wig!!!!!!!!!!!!!!!!\n") VT_RST);
return NULL;
}
}
@@ -1248,8 +1260,9 @@ void DemoEc_InitNpc(DemoEc* this, PlayState* play) {
s16 type = this->actor.params;
if (sInitFuncs[type] == NULL) {
- // "Demo_Ec_main_init: Initialization process is wrong arg_data"
- PRINTF(VT_FGCOL(RED) " Demo_Ec_main_init:初期化処理がおかしいarg_data = %d!\n" VT_RST, type);
+ PRINTF(VT_FGCOL(RED) T(" Demo_Ec_main_init:初期化処理がおかしいarg_data = %d!\n",
+ " Demo_Ec_main_init: Initialization process is wrong arg_data = %d!\n") VT_RST,
+ type);
Actor_Kill(&this->actor);
return;
}
@@ -1273,8 +1286,9 @@ void DemoEc_InitCommon(DemoEc* this, PlayState* play) {
secondaryObjectSlot = Object_GetSlot(&play->objectCtx, sp28);
if ((secondaryObjectSlot < 0) || (primaryObjectSlot < 0)) {
- // "Demo_Ec_main_bank: Bank unreadable arg_data = %d!"
- PRINTF(VT_FGCOL(RED) "Demo_Ec_main_bank:バンクを読めない arg_data = %d!\n" VT_RST, type);
+ PRINTF(VT_FGCOL(RED) T("Demo_Ec_main_bank:バンクを読めない arg_data = %d!\n",
+ "Demo_Ec_main_bank: Bank unreadable arg_data = %d!\n") VT_RST,
+ type);
Actor_Kill(&this->actor);
return;
}
@@ -1326,8 +1340,8 @@ void DemoEc_Update(Actor* thisx, PlayState* play) {
s32 updateMode = this->updateMode;
if ((updateMode < 0) || (updateMode >= ARRAY_COUNT(sUpdateFuncs)) || sUpdateFuncs[updateMode] == NULL) {
- // "The main mode is strange !!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
if (updateMode != EC_UPDATE_COMMON) {
DemoEc_UseAnimationObject(this, play);
@@ -1359,8 +1373,8 @@ void DemoEc_Draw(Actor* thisx, PlayState* play) {
s32 drawConfig = this->drawConfig;
if ((drawConfig < 0) || (drawConfig >= ARRAY_COUNT(sDrawFuncs)) || sDrawFuncs[drawConfig] == NULL) {
- // "The main mode is strange !!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
if (drawConfig != EC_DRAW_COMMON) {
DemoEc_UseDrawObject(this, play);
diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h
index fe71483505..494338b27d 100644
--- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h
+++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h
@@ -2,13 +2,13 @@
#define Z_DEMO_EC_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoEc;
-typedef void (*DemoEcInitFunc)(struct DemoEc*, PlayState*);
-typedef void (*DemoEcUpdateFunc)(struct DemoEc*, PlayState*);
-typedef void (*DemoEcDrawFunc)(struct DemoEc*, PlayState*);
+typedef void (*DemoEcInitFunc)(struct DemoEc*, struct PlayState*);
+typedef void (*DemoEcUpdateFunc)(struct DemoEc*, struct PlayState*);
+typedef void (*DemoEcDrawFunc)(struct DemoEc*, struct PlayState*);
typedef struct DemoEc {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c
index df54812326..d422af550e 100644
--- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c
+++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c
@@ -5,6 +5,7 @@
#include "attributes.h"
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "printf.h"
#include "rand.h"
#include "segmented_address.h"
#include "sequence.h"
@@ -16,10 +17,11 @@
#include "z_lib.h"
#include "z64audio.h"
#include "z64curve.h"
+#include "z64draw.h"
+#include "z64cutscene_flags.h"
#include "z64effect.h"
#include "z64play.h"
-
-#include "global.h"
+#include "z64save.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_efc_crystal_light/object_efc_crystal_light.h"
diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c
index caae4cff14..8720d49df2 100644
--- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c
+++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c
@@ -5,7 +5,18 @@
*/
#include "z_demo_ext.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64play.h"
+#include "z64skin.h"
+
#include "assets/objects/object_fhg/object_fhg.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -111,8 +122,8 @@ void DemoExt_HandleCues(DemoExt* this, PlayState* play) {
DemoExt_SetupDispellVortex(this);
break;
default:
- // "Demo_Ext_Check_DemoMode: there is no such action!"
- PRINTF("Demo_Ext_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Ext_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Ext_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->cueId = nextCueId;
@@ -174,8 +185,8 @@ void DemoExt_Update(Actor* thisx, PlayState* play) {
DemoExt* this = (DemoExt*)thisx;
if ((this->action < EXT_WAIT) || (this->action > EXT_DISPELL) || sActionFuncs[this->action] == NULL) {
- // "Main mode is abnormal!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
sActionFuncs[this->action](this, play);
}
@@ -228,8 +239,8 @@ void DemoExt_Draw(Actor* thisx, PlayState* play) {
if ((this->drawMode < EXT_DRAW_NOTHING) || (this->drawMode > EXT_DRAW_VORTEX) ||
sDrawFuncs[this->drawMode] == NULL) {
- // "Draw mode is abnormal!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
sDrawFuncs[this->drawMode](thisx, play);
}
diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h
index dbed1bf1f9..2eadc4af69 100644
--- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h
+++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h
@@ -2,12 +2,12 @@
#define Z_DEMO_EXT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoExt;
-typedef void (*DemoExtActionFunc)(struct DemoExt*, PlayState*);
-typedef void (*DemoExtDrawFunc)(Actor*, PlayState*);
+typedef void (*DemoExtActionFunc)(struct DemoExt*, struct PlayState*);
+typedef void (*DemoExtDrawFunc)(Actor*, struct PlayState*);
typedef struct DemoExt {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c
index f0b240070d..5446d622fb 100644
--- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c
+++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c
@@ -5,8 +5,19 @@
*/
#include "z_demo_geff.h"
-#include "assets/objects/object_geff/object_geff.h"
+#include "overlays/actors/ovl_Demo_Gt/z_demo_gt.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64play.h"
+
+#include "assets/objects/object_geff/object_geff.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -61,7 +72,8 @@ void DemoGeff_Init(Actor* thisx, PlayState* play) {
DemoGeff* this = (DemoGeff*)thisx;
if (this->actor.params < 0 || this->actor.params >= 9) {
- PRINTF(VT_FGCOL(RED) "Demo_Geff_Actor_ct:arg_dataがおかしい!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("Demo_Geff_Actor_ct:arg_dataがおかしい!!!!!!!!!!!!\n",
+ "Demo_Geff_Actor_ct:arg_data is strange!!!!!!!!!!!!\n") VT_RST);
Actor_Kill(&this->actor);
return;
}
@@ -92,7 +104,7 @@ void func_80977F80(DemoGeff* this, PlayState* play) {
OPEN_DISPS(gfxCtx, "../z_demo_geff.c", 204);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
// Necessary to match
if (!play) {}
@@ -179,7 +191,9 @@ void func_80978370(DemoGeff* this, PlayState* play) {
s16 params = this->actor.params;
DemoGeffInitFunc initFunc = sInitFuncs[params];
if (initFunc == NULL) {
- PRINTF(VT_FGCOL(RED) " Demo_Geff_main_init:初期化処理がおかしいarg_data = %d!\n" VT_RST, params);
+ PRINTF(VT_FGCOL(RED) T(" Demo_Geff_main_init:初期化処理がおかしいarg_data = %d!\n",
+ " Demo_Geff_main_init: Initialization process is wrong arg_data = %d!\n") VT_RST,
+ params);
Actor_Kill(&this->actor);
return;
}
@@ -195,7 +209,9 @@ void func_809783D4(DemoGeff* this, PlayState* play) {
s32 pad;
if (objectSlot < 0) {
- PRINTF(VT_FGCOL(RED) "Demo_Geff_main_bank:バンクを読めない arg_data = %d!\n" VT_RST, params);
+ PRINTF(VT_FGCOL(RED) T("Demo_Geff_main_bank:バンクを読めない arg_data = %d!\n",
+ "Demo_Geff_main_bank: Bank unreadable arg_data = %d!\n") VT_RST,
+ params);
Actor_Kill(thisx);
return;
}
@@ -209,7 +225,8 @@ void DemoGeff_Update(Actor* thisx, PlayState* play) {
DemoGeff* this = (DemoGeff*)thisx;
if (this->action < 0 || this->action >= 2 || sActionFuncs[this->action] == NULL) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -223,7 +240,8 @@ void DemoGeff_Draw(Actor* thisx, PlayState* play) {
s32 drawConfig = this->drawConfig;
if (drawConfig < 0 || drawConfig >= 2 || sDrawFuncs[drawConfig] == NULL) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
if (drawConfig != 0) {
diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h
index ca719594ad..03c6110fae 100644
--- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h
+++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h
@@ -2,22 +2,20 @@
#define Z_DEMO_GEFF_H
#include "ultra64.h"
-#include "global.h"
-
-#include "../ovl_Demo_Gt/z_demo_gt.h"
+#include "z64actor.h"
struct DemoGeff;
-typedef void (*DemoGeffInitFunc)(struct DemoGeff*, PlayState*);
-typedef void (*DemoGeffActionFunc)(struct DemoGeff*, PlayState*);
-typedef void (*DemoGeffDrawFunc)(struct DemoGeff*, PlayState*);
+typedef void (*DemoGeffInitFunc)(struct DemoGeff*, struct PlayState*);
+typedef void (*DemoGeffActionFunc)(struct DemoGeff*, struct PlayState*);
+typedef void (*DemoGeffDrawFunc)(struct DemoGeff*, struct PlayState*);
typedef struct DemoGeff {
/* 0x0000 */ Actor actor;
/* 0x014C */ s32 action;
/* 0x0150 */ s32 drawConfig;
/* 0x0154 */ s32 objectSlot;
- /* 0x0158 */ DemoGt* demoGt;
+ /* 0x0158 */ struct DemoGt* demoGt;
/* 0x015C */ f32 deltaPosX;
/* 0x0160 */ f32 deltaPosY;
/* 0x0164 */ f32 deltaPosZ;
diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c
index 467f27aa3d..e7e6afe3a4 100644
--- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c
+++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c
@@ -7,19 +7,24 @@
#include "z_demo_gj.h"
#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
+#include "printf.h"
#include "regs.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_en_item00.h"
#include "z_lib.h"
+#include "z64draw.h"
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
-
-#include "global.h"
+#include "z64save.h"
#include "assets/objects/object_gj/object_gj.h"
@@ -127,19 +132,19 @@ s32 DemoGj_HitByExplosion(DemoGj* this, PlayState* play, ColliderCylinder* cylin
void DemoGj_DestroyCylinder(DemoGj* this, PlayState* play) {
switch (DemoGj_GetType(this)) {
case DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_1:
- Collider_DestroyCylinder(play, &this->cylinders[0]);
- Collider_DestroyCylinder(play, &this->cylinders[1]);
- Collider_DestroyCylinder(play, &this->cylinders[2]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[0]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[1]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[2]);
break;
case DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_2:
- Collider_DestroyCylinder(play, &this->cylinders[0]);
- Collider_DestroyCylinder(play, &this->cylinders[1]);
- Collider_DestroyCylinder(play, &this->cylinders[2]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[0]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[1]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[2]);
break;
case DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_TALL:
- Collider_DestroyCylinder(play, &this->cylinders[0]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[0]);
break;
}
}
@@ -234,15 +239,17 @@ s32 DemoGj_FindGanon(DemoGj* this, PlayState* play) {
if (actor->id == ACTOR_BOSS_GANON2) {
this->ganon = (BossGanon2*)actor;
- // "Demo_Gj_Search_Boss_Ganon %d: Discover Ganon !!!!"
- PRINTF("Demo_Gj_Search_Boss_Ganon %d:ガノン発見!!!!\n", this->dyna.actor.params);
+ PRINTF(T("Demo_Gj_Search_Boss_Ganon %d:ガノン発見!!!!\n",
+ "Demo_Gj_Search_Boss_Ganon %d: Ganon is discovered!!!!\n"),
+ this->dyna.actor.params);
return true;
}
actor = actor->next;
}
- // "Demo_Gj_Search_Boss_Ganon %d: I couldn't find Ganon"
- PRINTF("Demo_Gj_Search_Boss_Ganon %d:ガノン発見出来ず\n", this->dyna.actor.params);
+ PRINTF(T("Demo_Gj_Search_Boss_Ganon %d:ガノン発見出来ず\n",
+ "Demo_Gj_Search_Boss_Ganon %d: Unable to find Ganon\n"),
+ this->dyna.actor.params);
return false;
}
//! @bug Missing return value when `this->ganon` is already set. No caller uses the return value
@@ -399,8 +406,8 @@ void DemoGj_SetupRotation(DemoGj* this, PlayState* play) {
break;
default:
- // "Demo_Gj_common_Reflect : This arg_data is not supported = %d"
- PRINTF(VT_FGCOL(RED) "Demo_Gj_common_Reflect : そんなarg_dataには対応していない = %d\n" VT_RST,
+ PRINTF(VT_FGCOL(RED) T("Demo_Gj_common_Reflect : そんなarg_dataには対応していない = %d\n",
+ "Demo_Gj_common_Reflect : This arg_data is not supported = %d\n") VT_RST,
this->dyna.actor.params);
return;
}
@@ -553,8 +560,8 @@ void DemoGj_SetupMovement(DemoGj* this, PlayState* play) {
break;
default:
- // "Demo_Gj_Setup_Move_common : This arg_data is not supported = %d"
- PRINTF(VT_FGCOL(RED) "Demo_Gj_Setup_Move_common : そんなarg_dataには対応していない = %d\n" VT_RST,
+ PRINTF(VT_FGCOL(RED) T("Demo_Gj_Setup_Move_common : そんなarg_dataには対応していない = %d\n",
+ "Demo_Gj_Setup_Move_common : This arg_data is not supported = %d\n") VT_RST,
actor->params);
break;
}
@@ -986,9 +993,9 @@ void DemoGj_DrawRubbleAroundArena(DemoGj* this, PlayState* play) {
// Inits the three cylinders with `sCylinderInit1`
void DemoGj_InitDestructableRubble1(DemoGj* this, PlayState* play) {
DemoGj_InitSetIndices(this, play, 15, 0, NULL);
- DemoGj_InitCylinder(this, play, &this->cylinders[0], &sCylinderInit1);
- DemoGj_InitCylinder(this, play, &this->cylinders[1], &sCylinderInit1);
- DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit1);
+ DemoGj_InitCylinder(this, play, &this->colliderCylinders[0], &sCylinderInit1);
+ DemoGj_InitCylinder(this, play, &this->colliderCylinders[1], &sCylinderInit1);
+ DemoGj_InitCylinder(this, play, &this->colliderCylinders[2], &sCylinderInit1);
}
#if DEBUG_FEATURES
@@ -1001,9 +1008,9 @@ void DemoGj_DoNothing1(DemoGj* this, PlayState* play) {
* Used by DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_1
*/
void func_8097AEE8(DemoGj* this, PlayState* play) {
- ColliderCylinder* cylinder0 = &this->cylinders[0];
- ColliderCylinder* cylinder1 = &this->cylinders[1];
- ColliderCylinder* cylinder2 = &this->cylinders[2];
+ ColliderCylinder* cylinder0 = &this->colliderCylinders[0];
+ ColliderCylinder* cylinder1 = &this->colliderCylinders[1];
+ ColliderCylinder* cylinder2 = &this->colliderCylinders[2];
Vec3f* actorPos = &this->dyna.actor.world.pos;
s32 pad;
s16 theta = this->dyna.actor.world.rot.y;
@@ -1025,9 +1032,9 @@ void func_8097AEE8(DemoGj* this, PlayState* play) {
void DemoGj_SetCylindersAsAC(DemoGj* this, PlayState* play) {
s32 pad[2];
- Collider* cylinder0 = &this->cylinders[0].base;
- Collider* cylinder1 = &this->cylinders[1].base;
- Collider* cylinder2 = &this->cylinders[2].base;
+ Collider* cylinder0 = &this->colliderCylinders[0].base;
+ Collider* cylinder1 = &this->colliderCylinders[1].base;
+ Collider* cylinder2 = &this->colliderCylinders[2].base;
s32 pad2[3];
CollisionCheck_SetAC(play, &play->colChkCtx, cylinder0);
@@ -1059,13 +1066,13 @@ void func_8097B128(DemoGj* this, PlayState* play) {
}
s32 DemoGj_HasCylinderAnyExploded(DemoGj* this, PlayState* play) {
- if (DemoGj_HitByExplosion(this, play, &this->cylinders[0])) {
+ if (DemoGj_HitByExplosion(this, play, &this->colliderCylinders[0])) {
return true;
}
- if (DemoGj_HitByExplosion(this, play, &this->cylinders[1])) {
+ if (DemoGj_HitByExplosion(this, play, &this->colliderCylinders[1])) {
return true;
}
- if (DemoGj_HitByExplosion(this, play, &this->cylinders[2])) {
+ if (DemoGj_HitByExplosion(this, play, &this->colliderCylinders[2])) {
return true;
}
return false;
@@ -1123,9 +1130,9 @@ void DemoGj_DrawDestructableRubble1(DemoGj* this, PlayState* play) {
// Inits the three cylinders with `sCylinderInit2`
void DemoGj_InitDestructableRubble2(DemoGj* this, PlayState* play) {
DemoGj_InitSetIndices(this, play, 16, 0, NULL);
- DemoGj_InitCylinder(this, play, &this->cylinders[0], &sCylinderInit2);
- DemoGj_InitCylinder(this, play, &this->cylinders[1], &sCylinderInit2);
- DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit2);
+ DemoGj_InitCylinder(this, play, &this->colliderCylinders[0], &sCylinderInit2);
+ DemoGj_InitCylinder(this, play, &this->colliderCylinders[1], &sCylinderInit2);
+ DemoGj_InitCylinder(this, play, &this->colliderCylinders[2], &sCylinderInit2);
}
#if DEBUG_FEATURES
@@ -1135,9 +1142,9 @@ void DemoGj_DoNothing2(DemoGj* this, PlayState* play) {
// Moves the ColliderCylinder's relative to the actor's position.
void func_8097B450(DemoGj* this, PlayState* play) {
- ColliderCylinder* cylinder0 = &this->cylinders[0];
- ColliderCylinder* cylinder1 = &this->cylinders[1];
- ColliderCylinder* cylinder2 = &this->cylinders[2];
+ ColliderCylinder* cylinder0 = &this->colliderCylinders[0];
+ ColliderCylinder* cylinder1 = &this->colliderCylinders[1];
+ ColliderCylinder* cylinder2 = &this->colliderCylinders[2];
Vec3f* actorPos = &this->dyna.actor.world.pos;
s32 pad;
s16 theta = this->dyna.actor.world.rot.y;
@@ -1159,9 +1166,9 @@ void func_8097B450(DemoGj* this, PlayState* play) {
void DemoGj_SetCylindersAsAC2(DemoGj* this, PlayState* play) {
s32 pad[2];
- Collider* cylinder0 = &this->cylinders[0].base;
- Collider* cylinder1 = &this->cylinders[1].base;
- Collider* cylinder2 = &this->cylinders[2].base;
+ Collider* cylinder0 = &this->colliderCylinders[0].base;
+ Collider* cylinder1 = &this->colliderCylinders[1].base;
+ Collider* cylinder2 = &this->colliderCylinders[2].base;
s32 pad2[3];
CollisionCheck_SetAC(play, &play->colChkCtx, cylinder0);
@@ -1171,13 +1178,13 @@ void DemoGj_SetCylindersAsAC2(DemoGj* this, PlayState* play) {
// Does the same as `DemoGj_HasCylinderAnyExploded`
s32 DemoGj_HasCylinderAnyExploded2(DemoGj* this, PlayState* play) {
- if (DemoGj_HitByExplosion(this, play, &this->cylinders[0])) {
+ if (DemoGj_HitByExplosion(this, play, &this->colliderCylinders[0])) {
return true;
}
- if (DemoGj_HitByExplosion(this, play, &this->cylinders[1])) {
+ if (DemoGj_HitByExplosion(this, play, &this->colliderCylinders[1])) {
return true;
}
- if (DemoGj_HitByExplosion(this, play, &this->cylinders[2])) {
+ if (DemoGj_HitByExplosion(this, play, &this->colliderCylinders[2])) {
return true;
}
return false;
@@ -1258,7 +1265,7 @@ void DemoGj_DemoGj_InitDestructableRubble2(DemoGj* this, PlayState* play) {
// Inits the first cylinder (only that one) with `sCylinderInit3`
void DemoGj_InitDestructableRubbleTall(DemoGj* this, PlayState* play) {
DemoGj_InitSetIndices(this, play, 17, 0, NULL);
- DemoGj_InitCylinder(this, play, &this->cylinders[0], &sCylinderInit3);
+ DemoGj_InitCylinder(this, play, &this->colliderCylinders[0], &sCylinderInit3);
}
#if DEBUG_FEATURES
@@ -1300,7 +1307,7 @@ void func_8097B9BC(DemoGj* this, PlayState* play) {
*/
void func_8097BA48(DemoGj* this, PlayState* play) {
Actor* thisx = &this->dyna.actor;
- ColliderCylinder* cylinder = &this->cylinders[0];
+ ColliderCylinder* cylinder = &this->colliderCylinders[0];
s32 pad[2];
if (func_809797E4(this, 4)) {
@@ -1373,8 +1380,8 @@ void DemoGj_Update(Actor* thisx, PlayState* play) {
if (this->updateMode < 0 || this->updateMode >= ARRAY_COUNT(sUpdateFuncs) ||
sUpdateFuncs[this->updateMode] == NULL) {
- // "The main mode is abnormal!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
@@ -1430,8 +1437,8 @@ void DemoGj_Init(Actor* thisx, PlayState* play) {
break;
default:
- // "Demo_Gj_Actor_ct There is no such argument!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "Demo_Gj_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("Demo_Gj_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!\n",
+ "Demo_Gj_Actor_ct There is no such argument!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
Actor_Kill(&this->dyna.actor);
}
}
@@ -1465,8 +1472,8 @@ void DemoGj_Draw(Actor* thisx, PlayState* play) {
DemoGj* this = (DemoGj*)thisx;
if (this->drawConfig < 0 || this->drawConfig >= ARRAY_COUNT(sDrawFuncs) || sDrawFuncs[this->drawConfig] == NULL) {
- // "The drawing mode is abnormal!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h
index 01a829f4fc..313788893f 100644
--- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h
+++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h
@@ -17,7 +17,7 @@ typedef struct DemoGj {
/* 0x0178 */ BossGanon2* ganon;
/* 0x017C */ s32 isTransformedIntoGanon; // flag
/* 0x0180 */ s32 isRotated; // flag
- /* 0x0184 */ ColliderCylinder cylinders[3];
+ /* 0x0184 */ ColliderCylinder colliderCylinders[3];
/* 0x0268 */ s32 killFlag; // This actor never sets this flag, but it reads it. If set to `true` and the actor type is DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_1, DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_2 or DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_TALL, then the actor will be killed and will drop the specified amount of collectibles.
/* 0x026C */ Vec3f unk_26C; // This actor never sets this. Specifies which direction will this actor explode when killed using `killFlag`.
} DemoGj; // size = 0x0278
diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c
index 01c173dcc4..4ea8f4b685 100644
--- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c
+++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c
@@ -5,8 +5,20 @@
*/
#include "z_demo_go.h"
-#include "assets/objects/object_oF1d_map/object_oF1d_map.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
+#include "assets/objects/object_oF1d_map/object_oF1d_map.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -320,7 +332,8 @@ void DemoGo_Update(Actor* thisx, PlayState* play) {
DemoGo* this = (DemoGo*)thisx;
if (this->action < 0 || this->action >= 7 || D_8097D44C[this->action] == NULL) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
D_8097D44C[this->action](this, play);
@@ -361,7 +374,8 @@ void DemoGo_Draw(Actor* thisx, PlayState* play) {
DemoGo* this = (DemoGo*)thisx;
if (this->drawConfig < 0 || this->drawConfig >= 2 || D_8097D468[this->drawConfig] == NULL) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
D_8097D468[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.h b/src/overlays/actors/ovl_Demo_Go/z_demo_go.h
index 969fdd8e07..9abd5ed41c 100644
--- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.h
+++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.h
@@ -2,12 +2,12 @@
#define Z_DEMO_GO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoGo;
-typedef void (*DemoGoActionFunc)(struct DemoGo*, PlayState*);
-typedef void (*DemoGoDrawFunc)(struct DemoGo*, PlayState*);
+typedef void (*DemoGoActionFunc)(struct DemoGo*, struct PlayState*);
+typedef void (*DemoGoDrawFunc)(struct DemoGo*, struct PlayState*);
typedef struct DemoGo {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c
index a878a21f1f..006a9267d3 100644
--- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c
+++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c
@@ -1,11 +1,27 @@
#include "z_demo_gt.h"
+#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
#include "z64frame_advance.h"
+#include "z64play.h"
+#include "z64save.h"
#include "assets/objects/object_gt/object_gt.h"
#include "assets/objects/object_geff/object_geff.h"
-#include "terminal.h"
-#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -1721,8 +1737,8 @@ void DemoGt_Update(Actor* thisx, PlayState* play) {
DemoGtUpdateFunc updateFunc;
if ((this->updateMode < 0) || (this->updateMode >= 19) || (updateFunc = sUpdateFuncs[this->updateMode]) == NULL) {
- // "The main mode is strange!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
@@ -1758,8 +1774,8 @@ void DemoGt_Init(Actor* thisx, PlayState* play) {
func_80982054_Init24(this, play);
break;
default:
- // "Demo_Gt_Actor_ct There is no such argument !"
- PRINTF("Demo_Gt_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ PRINTF(T("Demo_Gt_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "Demo_Gt_Actor_ct There is no such argument!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"));
Actor_Kill(&this->dyna.actor);
}
}
@@ -1777,8 +1793,8 @@ void DemoGt_Draw(Actor* thisx, PlayState* play) {
DemoGtDrawFunc drawFunc;
if ((this->drawConfig < 0) || (this->drawConfig >= 9) || (drawFunc = sDrawFuncs[this->drawConfig]) == NULL) {
- // "The drawing mode is strange !!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h
index 18b968b15c..910c265939 100644
--- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h
+++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h
@@ -2,12 +2,12 @@
#define Z_DEMO_GT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoGt;
-typedef void (*DemoGtUpdateFunc)(struct DemoGt*, PlayState*);
-typedef void (*DemoGtDrawFunc)(Actor*, PlayState*);
+typedef void (*DemoGtUpdateFunc)(struct DemoGt*, struct PlayState*);
+typedef void (*DemoGtDrawFunc)(struct Actor*, struct PlayState*);
typedef struct DemoGt {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c
index 82db3d7fa6..a5dff0d4a3 100644
--- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c
+++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c
@@ -1,5 +1,16 @@
#include "z_demo_ik.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_ik/object_ik.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -159,7 +170,7 @@ void DemoIk_MoveToStartPos(DemoIk* this, PlayState* play, s32 cueChannel) {
void DemoIk_Type1Init(DemoIk* this, PlayState* play) {
s32 pad[3];
- SkeletonHeader* skeleton;
+ FlexSkeletonHeader* skeleton;
AnimationHeader* animation;
f32 phi_f0;
@@ -181,7 +192,8 @@ void DemoIk_Type1Init(DemoIk* this, PlayState* play) {
// No break is required for matching
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, phi_f0);
- SkelAnime_Init(play, &this->skelAnime, skeleton, NULL, this->jointTable, this->morphTable, 2);
+ //! @bug Flex skeleton is used as normal skeleton
+ SkelAnime_Init(play, &this->skelAnime, (SkeletonHeader*)skeleton, NULL, this->jointTable, this->morphTable, 2);
Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, 0.0f);
}
@@ -232,8 +244,8 @@ void func_809839D0(DemoIk* this, PlayState* play) {
case 6:
break;
default:
- // "there is no such action"
- PRINTF("Demo_Ik_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Ik_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Ik_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -381,8 +393,8 @@ void func_80984048(DemoIk* this, PlayState* play) {
Actor_Kill(&this->actor);
break;
default:
- // "there is no such action"
- PRINTF("Demo_Ik_inFace_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Ik_inFace_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Ik_inFace_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -469,8 +481,8 @@ void DemoIk_Update(Actor* thisx, PlayState* play) {
if (this->actionMode < 0 || this->actionMode >= ARRAY_COUNT(sActionFuncs) ||
sActionFuncs[this->actionMode] == NULL) {
- // "The main mode is strange"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->actionMode](this, play);
@@ -490,8 +502,8 @@ void DemoIk_Draw(Actor* thisx, PlayState* play) {
DemoIk* this = (DemoIk*)thisx;
if (this->drawMode < 0 || this->drawMode >= ARRAY_COUNT(sDrawFuncs) || sDrawFuncs[this->drawMode] == NULL) {
- // "The draw mode is strange"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawMode](this, play);
diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h
index 3b21af5665..b4f2ca74ea 100644
--- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h
+++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h
@@ -2,12 +2,12 @@
#define Z_DEMO_IK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoIk;
-typedef void (*DemoIkActionFunc)(struct DemoIk* this, PlayState* play);
-typedef void (*DemoIkDrawFunc)(struct DemoIk* this, PlayState* play);
+typedef void (*DemoIkActionFunc)(struct DemoIk* this, struct PlayState* play);
+typedef void (*DemoIkDrawFunc)(struct DemoIk* this, struct PlayState* play);
typedef struct DemoIk {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c
index 7e359f6625..508128f7be 100644
--- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c
+++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c
@@ -7,9 +7,23 @@
#include "z_demo_im.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/scenes/indoors/nakaniwa/nakaniwa_scene.h"
#include "assets/objects/object_im/object_im.h"
-#include "terminal.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -633,7 +647,8 @@ void func_809861C4(DemoIm* this, PlayState* play) {
this->action = 12;
break;
default:
- PRINTF("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Im_Ocarina_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -673,7 +688,8 @@ void func_809862E0(DemoIm* this, PlayState* play) {
func_80986148(this);
break;
default:
- PRINTF("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Im_Ocarina_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -801,7 +817,8 @@ void func_8098680C(DemoIm* this, PlayState* play) {
Actor_Kill(&this->actor);
break;
default:
- PRINTF("Demo_Im_Spot00_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Im_Spot00_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Im_Spot00_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -1071,7 +1088,8 @@ void func_809871E8(DemoIm* this, PlayState* play) {
func_80987174(this);
break;
default:
- PRINTF("Demo_Im_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Im_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Im_inEnding_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -1110,7 +1128,8 @@ void DemoIm_Update(Actor* thisx, PlayState* play) {
DemoIm* this = (DemoIm*)thisx;
if ((this->action < 0) || (this->action >= 31) || (sActionFuncs[this->action] == NULL)) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -1221,7 +1240,8 @@ void DemoIm_Draw(Actor* thisx, PlayState* play) {
DemoIm* this = (DemoIm*)thisx;
if ((this->drawConfig < 0) || (this->drawConfig >= 3) || (sDrawFuncs[this->drawConfig] == NULL)) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h
index 94744969be..9477c21d8f 100644
--- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h
+++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h
@@ -2,12 +2,12 @@
#define Z_DEMO_IM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoIm;
-typedef void (*DemoImActionFunc)(struct DemoIm*, PlayState*);
-typedef void (*DemoImDrawFunc)(struct DemoIm*, PlayState*);
+typedef void (*DemoImActionFunc)(struct DemoIm*, struct PlayState*);
+typedef void (*DemoImDrawFunc)(struct DemoIm*, struct PlayState*);
typedef enum ImpaLimb {
/* 0x00 */ IMPA_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.inc.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.inc.c
index f56097680c..7a9a0dde84 100644
--- a/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.inc.c
+++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.inc.c
@@ -1,4 +1,4 @@
-#include "z_demo_im.h"
+#include "sequence.h"
#include "z64cutscene_commands.h"
// clang-format off
diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
index 50ae630b5b..e975163403 100644
--- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
+++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
@@ -1,13 +1,29 @@
#include "z_demo_kankyo.h"
-#include "global.h"
+
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
#include "z64cutscene_commands.h"
+#include "z64cutscene_flags.h"
+#include "z64cutscene_spline.h"
+#include "z64olib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_efc_star_field/object_efc_star_field.h"
#include "assets/objects/object_toki_objects/object_toki_objects.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:128" \
+ "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:0 pal-1.1:0"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.c
index 3a0a95a907..4e17a4a53c 100644
--- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.c
+++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.c
@@ -1,4 +1,3 @@
-#include "z_demo_kankyo.h"
#include "z64cutscene_commands.h"
// clang-format off
diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c
index 8c6ded1651..2a79aef458 100644
--- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c
+++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c
@@ -5,6 +5,21 @@
*/
#include "z_demo_kekkai.h"
+
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_demo_kekkai/object_demo_kekkai.h"
#include "assets/scenes/dungeons/ganontika/ganontika_scene.h"
diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h
index 8e396c4ec6..182b1d587c 100644
--- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h
+++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h
@@ -2,11 +2,11 @@
#define Z_DEMO_KEKKAI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoKekkai;
-typedef void (*DemoKekkaiUpdateFunc)(struct DemoKekkai* this, PlayState* play);
+typedef void (*DemoKekkaiUpdateFunc)(struct DemoKekkai* this, struct PlayState* play);
typedef struct DemoKekkai {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c
index 36e521701b..5831c44b06 100644
--- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c
+++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c
@@ -7,9 +7,22 @@
#include "z_demo_sa.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
-#include "assets/objects/object_sa/object_sa.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sequence.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_sa/object_sa.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -579,7 +592,8 @@ void func_8098F654(DemoSa* this, PlayState* play) {
func_8098F5D0(this);
break;
default:
- PRINTF("Demo_Sa_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Sa_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Sa_inEnding_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -728,7 +742,8 @@ void func_8098FB68(DemoSa* this, PlayState* play) {
func_8098FAE0(this);
break;
default:
- PRINTF("Demo_Sa_inPresent_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("Demo_Sa_inPresent_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "Demo_Sa_inPresent_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -768,7 +783,8 @@ void DemoSa_Update(Actor* thisx, PlayState* play) {
DemoSa* this = (DemoSa*)thisx;
if (this->action < 0 || this->action >= 21 || sActionFuncs[this->action] == NULL) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -838,7 +854,8 @@ void DemoSa_Draw(Actor* thisx, PlayState* play) {
DemoSa* this = (DemoSa*)thisx;
if (this->drawConfig < 0 || this->drawConfig >= 3 || sDrawFuncs[this->drawConfig] == NULL) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h
index 1f66c4fec3..639d50a634 100644
--- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h
+++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h
@@ -2,12 +2,12 @@
#define Z_DEMO_SA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoSa;
-typedef void (*DemoSaActionFunc)(struct DemoSa*, PlayState*);
-typedef void (*DemoSaDrawFunc)(struct DemoSa*, PlayState*);
+typedef void (*DemoSaActionFunc)(struct DemoSa*, struct PlayState*);
+typedef void (*DemoSaDrawFunc)(struct DemoSa*, struct PlayState*);
typedef struct DemoSa {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c
index d5cb025e46..549daf0db7 100644
--- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c
+++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c
@@ -6,6 +6,13 @@
#include "z_demo_shd.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sequence.h"
+#include "sys_matrix.h"
+#include "z64audio.h"
+#include "z64play.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void DemoShd_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h
index fe9198f624..eb62a3983f 100644
--- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h
+++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h
@@ -2,11 +2,11 @@
#define Z_DEMO_SHD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DemoShd;
-typedef void (*DemoShdActionFunc)(struct DemoShd*, PlayState*);
+typedef void (*DemoShdActionFunc)(struct DemoShd*, struct PlayState*);
typedef struct DemoShd {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c
index 67adb46e78..992417b888 100644
--- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c
+++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c
@@ -1,5 +1,15 @@
#include "z_demo_tre_lgt.h"
#include "overlays/actors/ovl_En_Box/z_en_box.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z64curve.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_box/object_box.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -49,8 +59,7 @@ void DemoTreLgt_Init(Actor* thisx, PlayState* play) {
DemoTreLgt* this = (DemoTreLgt*)thisx;
if (!SkelCurve_Init(play, &this->skelCurve, &gTreasureChestCurveSkel, sAnimations[0])) {
- // "Demo_Tre_Lgt_Actor_ct (); Construct failed"
- PRINTF("Demo_Tre_Lgt_Actor_ct();コンストラクト失敗\n");
+ PRINTF(T("Demo_Tre_Lgt_Actor_ct();コンストラクト失敗\n", "Demo_Tre_Lgt_Actor_ct(); Construct failed\n"));
}
ASSERT(true, "1", "../z_demo_tre_lgt.c", UNK_LINE);
diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h
index 0cad6996d9..47f6c35642 100644
--- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h
+++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h
@@ -2,11 +2,12 @@
#define Z_DEMO_TRE_LGT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64curve.h"
struct DemoTreLgt;
-typedef void (*DemoTreLgtActionFunc)(struct DemoTreLgt*, PlayState*);
+typedef void (*DemoTreLgtActionFunc)(struct DemoTreLgt*, struct PlayState*);
typedef struct DemoTreLgt {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
index 40f4878831..4034dafc91 100644
--- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
+++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
@@ -5,6 +5,17 @@
*/
#include "z_door_ana.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64cutscene_flags.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS ACTOR_FLAG_UPDATE_DURING_OCARINA
diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h
index 51c24b84af..0092bd8f1a 100644
--- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h
+++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h
@@ -2,11 +2,11 @@
#define Z_DOOR_ANA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DoorAna;
-typedef void (*DoorAnaActionFunc)(struct DoorAna*, PlayState*);
+typedef void (*DoorAnaActionFunc)(struct DoorAna*, struct PlayState*);
typedef struct DoorAna {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c
index 360f4aedec..2f9f4e1183 100644
--- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c
+++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c
@@ -5,6 +5,17 @@
*/
#include "z_door_gerudo.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_door_gerudo/object_door_gerudo.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h
index c00a0fa669..efd2959767 100644
--- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h
+++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h
@@ -2,11 +2,11 @@
#define Z_DOOR_GERUDO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DoorGerudo;
-typedef void (*DoorGerudoActionFunc)(struct DoorGerudo*, PlayState*);
+typedef void (*DoorGerudoActionFunc)(struct DoorGerudo*, struct PlayState*);
typedef struct DoorGerudo {
/* 0x0000 */ SLIDING_DOOR_ACTOR_BASE;
diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c
index 0f2d3163ec..15d92cb18a 100644
--- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c
+++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c
@@ -5,6 +5,18 @@
*/
#include "z_door_killer.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_hidan_objects/object_hidan_objects.h"
#include "assets/objects/object_mizu_objects/object_mizu_objects.h"
@@ -61,7 +73,7 @@ static ColliderCylinderInit sCylinderInit = {
{ 20, 100, 0, { 0, 0, 0 } },
};
-static ColliderJntSphElementInit sJntSphItemsInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -85,7 +97,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- sJntSphItemsInit,
+ sJntSphElementsInit,
};
static DoorKillerTextureEntry sDoorTextures[4] = {
@@ -137,7 +149,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) {
Collider_InitCylinder(play, &this->colliderCylinder);
Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit);
Collider_InitJntSph(play, &this->colliderJntSph);
- Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphItems);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
this->colliderJntSph.elements[0].dim.worldSphere.radius = 80;
this->colliderJntSph.elements[0].dim.worldSphere.center.x = (s16)this->actor.world.pos.x;
this->colliderJntSph.elements[0].dim.worldSphere.center.y = (s16)this->actor.world.pos.y + 50;
@@ -460,9 +472,9 @@ void DoorKiller_Wait(DoorKiller* this, PlayState* play) {
void DoorKiller_UpdateTexture(Actor* thisx, PlayState* play) {
DoorKiller* this = (DoorKiller*)thisx;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
this->texture = SEGMENTED_TO_VIRTUAL(this->texture);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
}
/**
diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h
index 597624df1e..32eaaeb014 100644
--- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h
+++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h
@@ -2,7 +2,7 @@
#define Z_DOOR_KILLER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
/*
* Associated switch flag: (params >> 8) & 0x3F
@@ -16,7 +16,7 @@ typedef struct DoorKillerTextureEntry {
struct DoorKiller;
-typedef void (*DoorKillerActionFunc)(struct DoorKiller*, PlayState*);
+typedef void (*DoorKillerActionFunc)(struct DoorKiller*, struct PlayState*);
typedef struct DoorKiller {
/* 0x0000 */ DOOR_ACTOR_BASE;
@@ -28,7 +28,7 @@ typedef struct DoorKiller {
/* 0x021C */ u8 requiredObjectSlot;
/* 0x021D */ u8 textureEntryIndex;
/* 0x0220 */ ColliderJntSph colliderJntSph;
- /* 0x0240 */ ColliderJntSphElement colliderJntSphItems[1];
+ /* 0x0240 */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x0280 */ DoorKillerActionFunc actionFunc;
} DoorKiller; // size = 0x0284
diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
index 0bb5e1074a..05eec20ffa 100644
--- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
+++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
@@ -6,15 +6,31 @@
#include "z_door_shutter.h"
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "quake.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_gnd/object_gnd.h"
#include "assets/objects/object_goma/object_goma.h"
#include "assets/objects/object_ydan_objects/object_ydan_objects.h"
#include "assets/objects/object_ddan_objects/object_ddan_objects.h"
#include "assets/objects/object_bdan_objects/object_bdan_objects.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_bdoor/object_bdoor.h"
#include "assets/objects/object_hidan_objects/object_hidan_objects.h"
#include "assets/objects/object_ganon_objects/object_ganon_objects.h"
diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h
index 83660c5930..8ab1c8a4c7 100644
--- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h
+++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h
@@ -2,7 +2,7 @@
#define Z_DOOR_SHUTTER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
/**
* Actor Parameters
@@ -39,7 +39,7 @@ typedef enum DoorShutterType {
struct DoorShutter;
-typedef void (*DoorShutterActionFunc)(struct DoorShutter*, PlayState*);
+typedef void (*DoorShutterActionFunc)(struct DoorShutter*, struct PlayState*);
typedef struct DoorShutter {
/* 0x0000 */ SLIDING_DOOR_ACTOR_BASE;
diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c
index bf423a09b5..ceef1f93f6 100644
--- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c
+++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c
@@ -5,6 +5,11 @@
*/
#include "z_door_toki.h"
+
+#include "ichain.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_toki_objects/object_toki_objects.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.h b/src/overlays/actors/ovl_Door_Toki/z_door_toki.h
index 35d4d4f91c..8e276c56bd 100644
--- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.h
+++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.h
@@ -2,7 +2,7 @@
#define Z_DOOR_TOKI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct DoorToki;
diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
index 6927a0f16e..dc0f0cb92e 100644
--- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
+++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
@@ -4,6 +4,7 @@
#include "gfx_setupdl.h"
#include "ichain.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "seqcmd.h"
#include "sequence.h"
#include "sfx.h"
@@ -12,9 +13,13 @@
#include "z64light.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_warp1/object_warp1.h"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+
#define FLAGS 0
void DoorWarp1_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c
index ae7c4a807a..677458f186 100644
--- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c
+++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c
@@ -1,4 +1,16 @@
#include "z_efc_erupc.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sequence.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_efc_erupc/object_efc_erupc.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h
index 6d14c32d76..888d9580ef 100644
--- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h
+++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h
@@ -2,11 +2,11 @@
#define Z_EFC_ERUPC_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EfcErupc;
-typedef void (*EfcErupcActionFunc)(struct EfcErupc*, PlayState*);
+typedef void (*EfcErupcActionFunc)(struct EfcErupc*, struct PlayState*);
#define EFC_ERUPC_EFFECT_COUNT 100
diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
index f23a974a32..e8f9f26841 100644
--- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
+++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
@@ -5,6 +5,18 @@
*/
#include "z_eff_dust.h"
+
+#include "libc64/malloc.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h
index e77a8e0223..153b6d4e2a 100644
--- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h
+++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h
@@ -2,12 +2,12 @@
#define Z_EFF_DUST_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EffDust;
-typedef void (*EffDustActionFunc)(struct EffDust*, PlayState*);
-typedef void (*EffDustDrawFunc)(Actor*, PlayState*);
+typedef void (*EffDustActionFunc)(struct EffDust*, struct PlayState*);
+typedef void (*EffDustDrawFunc)(Actor*, struct PlayState*);
typedef struct EffDust {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c
index a4ebdfb131..22c96a08d4 100644
--- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c
+++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c
@@ -5,8 +5,18 @@
*/
#include "z_elf_msg.h"
-#include "global.h"
+
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c
index 0f0edc34e5..f6beb6cc82 100644
--- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c
+++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c
@@ -5,7 +5,16 @@
*/
#include "z_elf_msg2.h"
+
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z64play.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h
index 802769f2b7..5a0a693415 100644
--- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h
+++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h
@@ -2,11 +2,11 @@
#define Z_ELF_MSG2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ElfMsg2;
-typedef void (*ElfMsg2ActionFunc)(struct ElfMsg2*, PlayState*);
+typedef void (*ElfMsg2ActionFunc)(struct ElfMsg2*, struct PlayState*);
typedef struct ElfMsg2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c
index 6f793ba1a3..3f7649ea7e 100644
--- a/src/overlays/actors/ovl_En_Am/z_en_am.c
+++ b/src/overlays/actors/ovl_En_Am/z_en_am.c
@@ -5,9 +5,23 @@
*/
#include "z_en_am.h"
-#include "assets/objects/object_am/object_am.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_am/object_am.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_CAN_PRESS_SWITCHES)
diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.h b/src/overlays/actors/ovl_En_Am/z_en_am.h
index 8bac3338da..2903a3b6ea 100644
--- a/src/overlays/actors/ovl_En_Am/z_en_am.h
+++ b/src/overlays/actors/ovl_En_Am/z_en_am.h
@@ -2,11 +2,11 @@
#define Z_EN_AM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnAm;
-typedef void (*EnAmActionFunc)(struct EnAm*, PlayState*);
+typedef void (*EnAmActionFunc)(struct EnAm*, struct PlayState*);
typedef struct EnAm {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c
index 242afc095f..8bfcc38fac 100644
--- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c
+++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c
@@ -5,6 +5,18 @@
*/
#include "z_en_ani.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_ani/object_ani.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h
index 99bad6e1cc..454a7bd8d2 100644
--- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h
+++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h
@@ -2,11 +2,11 @@
#define Z_EN_ANI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnAni;
-typedef void (*EnAniActionFunc)(struct EnAni*, PlayState*);
+typedef void (*EnAniActionFunc)(struct EnAni*, struct PlayState*);
typedef struct EnAni {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c
index 5773eb17ba..5c03ab9632 100644
--- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c
+++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c
@@ -5,10 +5,25 @@
*/
#include "z_en_anubice.h"
-#include "assets/objects/object_anubice/object_anubice.h"
#include "overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h"
#include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h"
+
+#include "libc64/math64.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_anubice/object_anubice.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h
index 5f3ec8b134..51cd02d1ef 100644
--- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h
+++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h
@@ -2,8 +2,7 @@
#define Z_EN_ANUBICE_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h"
+#include "z64actor.h"
struct EnAnubice;
@@ -54,7 +53,7 @@ typedef struct EnAnubice {
/* 0x028C */ Vec3f fireballRot;
/* 0x0298 */ Vec3f home;
/* 0x02A4 */ Vec3f knockbackRecoveryVelocity;
- /* 0x02B0 */ BgHidanCurtain* flameCircles[5];
+ /* 0x02B0 */ struct BgHidanCurtain* flameCircles[5];
/* 0x02C4 */ char unk_2C4[0x4]; // Possibly another element of flameCircles
/* 0x02C8 */ ColliderCylinder collider;
} EnAnubice; // size = 0x0314
diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c
index 9e408a3350..480940dc44 100644
--- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c
+++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c
@@ -5,6 +5,19 @@
*/
#include "z_en_anubice_fire.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_anubice/object_anubice.h"
@@ -55,8 +68,8 @@ void EnAnubiceFire_Init(Actor* thisx, PlayState* play) {
EnAnubiceFire* this = (EnAnubiceFire*)thisx;
s32 i;
- Collider_InitCylinder(play, &this->cylinder);
- Collider_SetCylinder(play, &this->cylinder, &this->actor, &sCylinderInit);
+ Collider_InitCylinder(play, &this->colliderCylinder);
+ Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit);
this->unk_15A = 30;
this->unk_154 = 2.0f;
@@ -73,7 +86,7 @@ void EnAnubiceFire_Init(Actor* thisx, PlayState* play) {
void EnAnubiceFire_Destroy(Actor* thisx, PlayState* play) {
EnAnubiceFire* this = (EnAnubiceFire*)thisx;
- Collider_DestroyCylinder(play, &this->cylinder);
+ Collider_DestroyCylinder(play, &this->colliderCylinder);
}
void func_809B26EC(EnAnubiceFire* this, PlayState* play) {
@@ -108,12 +121,12 @@ void func_809B27D8(EnAnubiceFire* this, PlayState* play) {
Math_ApproachF(&this->scale, this->unk_154, 0.2f, 0.4f);
if ((this->unk_15A == 0) && (this->scale < 0.1f)) {
Actor_Kill(&this->actor);
- } else if ((this->actor.params == 0) && (this->cylinder.base.atFlags & AT_BOUNCED)) {
+ } else if ((this->actor.params == 0) && (this->colliderCylinder.base.atFlags & AT_BOUNCED)) {
if (Player_HasMirrorShieldEquipped(play)) {
Actor_PlaySfx(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW);
- this->cylinder.base.atFlags &= ~(AT_HIT | AT_BOUNCED | AT_TYPE_ENEMY);
- this->cylinder.base.atFlags |= AT_TYPE_PLAYER;
- this->cylinder.elem.atDmgInfo.dmgFlags = DMG_DEKU_STICK;
+ this->colliderCylinder.base.atFlags &= ~(AT_HIT | AT_BOUNCED | AT_TYPE_ENEMY);
+ this->colliderCylinder.base.atFlags |= AT_TYPE_PLAYER;
+ this->colliderCylinder.elem.atDmgInfo.dmgFlags = DMG_DEKU_STICK;
this->unk_15A = 30;
this->actor.params = 1;
this->actor.velocity.x *= -1.0f;
@@ -195,14 +208,14 @@ void EnAnubiceFire_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);
if (!(this->scale < 0.6f || this->actionFunc == func_809B2B48)) {
- this->cylinder.dim.radius = this->scale * 15.0f + 5.0f;
- this->cylinder.dim.height = this->scale * 15.0f + 5.0f;
- this->cylinder.dim.yShift = this->scale * -0.75f + -15.0f;
+ this->colliderCylinder.dim.radius = this->scale * 15.0f + 5.0f;
+ this->colliderCylinder.dim.height = this->scale * 15.0f + 5.0f;
+ this->colliderCylinder.dim.yShift = this->scale * -0.75f + -15.0f;
if (this->unk_15A != 0) {
- Collider_UpdateCylinder(&this->actor, &this->cylinder);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->cylinder.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->cylinder.base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinder);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
if (BgCheck_SphVsFirstPoly(&play->colCtx, &this->actor.world.pos, 30.0f)) {
diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h
index 8119efa7a5..34072a43b5 100644
--- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h
+++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h
@@ -2,11 +2,11 @@
#define Z_EN_ANUBICE_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnAnubiceFire;
-typedef void (*EnAnubiceFireActionFunc)(struct EnAnubiceFire*, PlayState*);
+typedef void (*EnAnubiceFireActionFunc)(struct EnAnubiceFire*, struct PlayState*);
typedef struct EnAnubiceFire {
/* 0x0000 */ Actor actor;
@@ -18,7 +18,7 @@ typedef struct EnAnubiceFire {
/* 0x015C */ s16 unk_15C;
/* 0x015E */ s16 unk_15E;
/* 0x0178 */ Vec3f unk_160[6];
- /* 0x01A8 */ ColliderCylinder cylinder;
+ /* 0x01A8 */ ColliderCylinder colliderCylinder;
} EnAnubiceFire; // size = 0x01F4
#endif
diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c
index b54dc180bc..4163b5d24f 100644
--- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c
+++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c
@@ -5,7 +5,14 @@
*/
#include "z_en_anubice_tag.h"
+#include "overlays/actors/ovl_En_Anubice/z_en_anubice.h"
+
+#include "printf.h"
+#include "regs.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64play.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h
index 0147b30cd5..026d4d0199 100644
--- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h
+++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h
@@ -2,17 +2,16 @@
#define Z_EN_ANUBICE_TAG_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_En_Anubice/z_en_anubice.h"
+#include "z64actor.h"
struct EnAnubiceTag;
-typedef void (*EnAnubiceTagActionFunc)(struct EnAnubiceTag*, PlayState*);
+typedef void (*EnAnubiceTagActionFunc)(struct EnAnubiceTag*, struct PlayState*);
typedef struct EnAnubiceTag {
/* 0x0000 */ Actor actor;
/* 0x014C */ EnAnubiceTagActionFunc actionFunc;
- /* 0x0150 */ EnAnubice* anubis;
+ /* 0x0150 */ struct EnAnubice* anubis;
/* 0x0154 */ f32 extraTriggerRange;
} EnAnubiceTag; // size = 0x0158
diff --git a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c
index d44d380430..d4de5191ef 100644
--- a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c
+++ b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c
@@ -6,6 +6,9 @@
#include "z_en_arow_trap.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
+
+#include "z64play.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void EnArowTrap_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h
index e29f84d2b2..ba91505088 100644
--- a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h
+++ b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h
@@ -2,8 +2,7 @@
#define Z_EN_AROW_TRAP_H
#include "ultra64.h"
-#include "global.h"
-#include "z64.h"
+#include "z64actor.h"
struct EnArowTrap;
diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
index 669e5ed1fb..9000417a23 100644
--- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
+++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
@@ -5,7 +5,21 @@
*/
#include "z_en_arrow.h"
-#include "global.h"
+
+#include "libc64/qrand.h"
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c
index d215d02cf3..4a3a32663a 100644
--- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c
+++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c
@@ -5,10 +5,22 @@
*/
#include "z_en_attack_niw.h"
-#include "versions.h"
-#include "assets/objects/object_niw/object_niw.h"
#include "overlays/actors/ovl_En_Niw/z_en_niw.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "versions.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_niw/object_niw.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void EnAttackNiw_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h
index 381b6a2aae..a4d361542d 100644
--- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h
+++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h
@@ -2,11 +2,11 @@
#define Z_EN_ATTACK_NIW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnAttackNiw;
-typedef void (*EnAttackNiwActionFunc)(struct EnAttackNiw*, PlayState*);
+typedef void (*EnAttackNiwActionFunc)(struct EnAttackNiw*, struct PlayState*);
typedef struct EnAttackNiw {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c
index 098980836e..a149d3c63d 100644
--- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c
+++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c
@@ -5,6 +5,20 @@
*/
#include "z_en_ba.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_bxa/object_bxa.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -37,7 +51,7 @@ ActorProfile En_Ba_Profile = {
static Vec3f D_809B8080 = { 0.0f, 0.0f, 32.0f };
-static ColliderJntSphElementInit sJntSphElementInit[2] = {
+static ColliderJntSphElementInit sJntSphElementsInit[2] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -72,7 +86,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
2,
- sJntSphElementInit,
+ sJntSphElementsInit,
};
void EnBa_SetupAction(EnBa* this, EnBaActionFunc actionFunc) {
@@ -118,7 +132,7 @@ void EnBa_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.health = 4;
this->actor.colChkInfo.mass = MASS_HEAVY;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
} else {
Actor_SetScale(&this->actor, 0.021f);
EnBa_SetupFallAsBlob(this);
diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.h b/src/overlays/actors/ovl_En_Ba/z_en_ba.h
index f39fa33995..dc3b8cb3f6 100644
--- a/src/overlays/actors/ovl_En_Ba/z_en_ba.h
+++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.h
@@ -2,11 +2,11 @@
#define Z_EN_BA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBa;
-typedef void (*EnBaActionFunc)(struct EnBa*, PlayState*);
+typedef void (*EnBaActionFunc)(struct EnBa*, struct PlayState*);
typedef enum EnBaType {
/* 0x00 */ EN_BA_TENTACLE_RED,
@@ -31,7 +31,7 @@ typedef struct EnBa {
/* 0x031A */ s16 unk_31A;
/* 0x031C */ s16 unk_31C;
/* 0x0320 */ ColliderJntSph collider;
- /* 0x0340 */ ColliderJntSphElement colliderItems[2];
+ /* 0x0340 */ ColliderJntSphElement colliderElements[2];
} EnBa; // size = 0x03C0
#endif
diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c
index 26af25354a..18dad81519 100644
--- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c
+++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c
@@ -5,6 +5,22 @@
*/
#include "z_en_bb.h"
+
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_Bb/object_Bb.h"
@@ -209,7 +225,7 @@ ActorProfile En_Bb_Profile = {
/**/ EnBb_Draw,
};
-static ColliderJntSphElementInit sJntSphElementInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -233,7 +249,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- sJntSphElementInit,
+ sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
@@ -319,7 +335,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) {
this->unk_254 = 0;
thisx->colChkInfo.health = 4;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->elements);
+ Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->colliderElements);
this->actionState = PARAMS_GET_NOMASK(thisx->params, 8);
diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/src/overlays/actors/ovl_En_Bb/z_en_bb.h
index 9908690e06..0b7e85c461 100644
--- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h
+++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h
@@ -2,11 +2,11 @@
#define Z_EN_BB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBb;
-typedef void (*EnBbActionFunc)(struct EnBb*, PlayState*);
+typedef void (*EnBbActionFunc)(struct EnBb*, struct PlayState*);
typedef struct EnBb {
/* 0x0000 */ Actor actor;
@@ -41,7 +41,7 @@ typedef struct EnBb {
/* 0x02A8 */ s16 fireIceTimer;
/* 0x02AA */ u8 dmgEffect;
/* 0x02AC */ ColliderJntSph collider;
- /* 0x02CC */ ColliderJntSphElement elements[1];
+ /* 0x02CC */ ColliderJntSphElement colliderElements[1];
/* 0x030C */ BodyBreak bodyBreak;
/* 0x0324 */ Actor* targetActor;
} EnBb; // size = 0x0328
diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c
index 58fcf61505..9c9d7bacfa 100644
--- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c
+++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c
@@ -5,6 +5,20 @@
*/
#include "z_en_bdfire.h"
+#include "overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_kingdodongo/object_kingdodongo.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h
index 93b37e3b1a..876a790d71 100644
--- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h
+++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h
@@ -2,13 +2,13 @@
#define Z_EN_BDFIRE_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnBdfire;
-typedef void (*EnBdfireActionFunc)(struct EnBdfire*, PlayState*);
-typedef void (*EnBdfireDrawFunc)(struct EnBdfire*, PlayState*);
+typedef void (*EnBdfireActionFunc)(struct EnBdfire*, struct PlayState*);
+typedef void (*EnBdfireDrawFunc)(struct EnBdfire*, struct PlayState*);
typedef struct EnBdfire {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
index 1bb808abaf..4243bbdf79 100644
--- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
+++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
@@ -1,4 +1,22 @@
#include "z_en_bigokuta.h"
+
+#include "array_count.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "rumble.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_bigokuta/object_bigokuta.h"
#define FLAGS \
@@ -44,7 +62,7 @@ ActorProfile En_Bigokuta_Profile = {
/**/ EnBigokuta_Draw,
};
-static ColliderJntSphElementInit sJntSphElementInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK1,
@@ -67,8 +85,8 @@ static ColliderJntSphInit sJntSphInit = {
OC2_TYPE_1,
COLSHAPE_JNTSPH,
},
- ARRAY_COUNT(sJntSphElementInit),
- sJntSphElementInit,
+ ARRAY_COUNT(sJntSphElementsInit),
+ sJntSphElementsInit,
};
static ColliderCylinderInit sCylinderInit[] = {
@@ -165,13 +183,13 @@ void EnBigokuta_Init(Actor* thisx, PlayState* play) {
this->jointTable, this->morphTable, 20);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, &this->element);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->collider.elements[0].dim.worldSphere.radius = this->collider.elements[0].dim.modelSphere.radius;
for (i = 0; i < ARRAY_COUNT(sCylinderInit); i++) {
- Collider_InitCylinder(play, &this->cylinder[i]);
- Collider_SetCylinder(play, &this->cylinder[i], &this->actor, &sCylinderInit[i]);
+ Collider_InitCylinder(play, &this->colliderCylinders[i]);
+ Collider_SetCylinder(play, &this->colliderCylinders[i], &this->actor, &sCylinderInit[i]);
}
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, sColChkInfoInit);
@@ -194,8 +212,8 @@ void EnBigokuta_Destroy(Actor* thisx, PlayState* play) {
s32 i;
Collider_DestroyJntSph(play, &this->collider);
- for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
- Collider_DestroyCylinder(play, &this->cylinder[i]);
+ for (i = 0; i < ARRAY_COUNT(this->colliderCylinders); i++) {
+ Collider_DestroyCylinder(play, &this->colliderCylinders[i]);
}
}
@@ -307,7 +325,7 @@ void func_809BD3F8(EnBigokuta* this) {
this->unk_198 = 80;
this->unk_19A = this->unk_194 * -0x200;
func_809BCE3C(this);
- this->cylinder[0].base.atFlags |= AT_ON;
+ this->colliderCylinders[0].base.atFlags |= AT_ON;
this->collider.base.acFlags |= AC_ON;
this->actionFunc = func_809BDC08;
}
@@ -325,7 +343,7 @@ void func_809BD4A4(EnBigokuta* this) {
this->actor.world.rot.x = this->actor.shape.rot.y + 0x8000;
this->unk_19A = this->unk_194 * 0x200;
this->collider.base.acFlags &= ~AC_ON;
- this->cylinder[0].base.atFlags |= AT_ON;
+ this->colliderCylinders[0].base.atFlags |= AT_ON;
this->actionFunc = func_809BDFC8;
}
@@ -333,7 +351,7 @@ void func_809BD524(EnBigokuta* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_bigokuta_Anim_000D1C, -5.0f);
this->unk_196 = 80;
this->unk_19A = 0;
- this->cylinder[0].base.atFlags |= AT_ON;
+ this->colliderCylinders[0].base.atFlags |= AT_ON;
Actor_PlaySfx(&this->actor, NA_SE_EN_DAIOCTA_MAHI);
if (this->collider.elements[0].base.acHitElem->atDmgInfo.dmgFlags & DMG_DEKU_NUT) {
this->unk_195 = true;
@@ -350,7 +368,7 @@ void func_809BD5E0(EnBigokuta* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &object_bigokuta_Anim_000444, -5.0f);
this->unk_196 = 24;
this->unk_19A = 0;
- this->cylinder[0].base.atFlags &= ~AT_ON;
+ this->colliderCylinders[0].base.atFlags &= ~AT_ON;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 24);
this->actionFunc = func_809BE180;
}
@@ -386,7 +404,7 @@ void func_809BD768(EnBigokuta* this) {
this->unk_194 = Rand_ZeroOne() < 0.5f ? -1 : 1;
this->unk_19A = 0;
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
- this->cylinder[0].base.atFlags &= ~AT_ON;
+ this->colliderCylinders[0].base.atFlags &= ~AT_ON;
Actor_PlaySfx(&this->actor, NA_SE_EN_DAIOCTA_SINK);
this->actionFunc = func_809BE4A4;
}
@@ -582,12 +600,12 @@ void func_809BE058(EnBigokuta* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
- if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->cylinder[0].base.ocFlags1 & OC1_HIT) ||
- (this->cylinder[1].base.ocFlags1 & OC1_HIT)) {
+ if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->colliderCylinders[0].base.ocFlags1 & OC1_HIT) ||
+ (this->colliderCylinders[1].base.ocFlags1 & OC1_HIT)) {
speedXZ = CLAMP_MIN(player->actor.speed, 1.0f);
if (!(this->collider.base.ocFlags1 & OC1_HIT)) {
- this->cylinder[0].base.ocFlags1 &= ~OC1_HIT;
- this->cylinder[1].base.ocFlags1 &= ~OC1_HIT;
+ this->colliderCylinders[0].base.ocFlags1 &= ~OC1_HIT;
+ this->colliderCylinders[1].base.ocFlags1 &= ~OC1_HIT;
speedXZ *= -1.0f;
}
player->actor.world.pos.x -= speedXZ * Math_SinS(this->actor.shape.rot.y);
@@ -705,12 +723,12 @@ void func_809BE568(EnBigokuta* this) {
this->collider.elements[0].dim.worldSphere.center.y =
this->actor.world.pos.y + this->collider.elements[0].dim.modelSphere.center.y;
- for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
- this->cylinder[i].dim.pos.x =
+ for (i = 0; i < ARRAY_COUNT(this->colliderCylinders); i++) {
+ this->colliderCylinders[i].dim.pos.x =
this->actor.world.pos.x + sCylinderInit[i].dim.pos.z * sin + sCylinderInit[i].dim.pos.x * cos;
- this->cylinder[i].dim.pos.z =
+ this->colliderCylinders[i].dim.pos.z =
this->actor.world.pos.z + sCylinderInit[i].dim.pos.z * cos - sCylinderInit[i].dim.pos.x * sin;
- this->cylinder[i].dim.pos.y = this->actor.world.pos.y;
+ this->colliderCylinders[i].dim.pos.y = this->actor.world.pos.y;
}
}
@@ -718,10 +736,10 @@ void func_809BE798(EnBigokuta* this, PlayState* play) {
s16 effectRot;
s16 yawDiff;
- if ((this->cylinder[0].base.atFlags & AT_HIT) || (this->cylinder[1].base.atFlags & AT_HIT) ||
+ if ((this->colliderCylinders[0].base.atFlags & AT_HIT) || (this->colliderCylinders[1].base.atFlags & AT_HIT) ||
(this->collider.base.atFlags & AT_HIT)) {
- this->cylinder[0].base.atFlags &= ~AT_HIT;
- this->cylinder[1].base.atFlags &= ~AT_HIT;
+ this->colliderCylinders[0].base.atFlags &= ~AT_HIT;
+ this->colliderCylinders[1].base.atFlags &= ~AT_HIT;
this->collider.base.atFlags &= ~AT_HIT;
yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
if (yawDiff > 0x4000) {
@@ -782,19 +800,19 @@ void EnBigokuta_Update(Actor* thisx, PlayState* play2) {
Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BIG_OCTO);
Camera_UnsetStateFlag(play->cameraPtrs[CAM_ID_MAIN], CAM_STATE_CHECK_BG);
- if (this->cylinder[0].base.atFlags & AT_ON) {
+ if (this->colliderCylinders[0].base.atFlags & AT_ON) {
if (this->actionFunc != func_809BE058) {
- for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->cylinder[i].base);
+ for (i = 0; i < ARRAY_COUNT(this->colliderCylinders); i++) {
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinders[i].base);
}
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
} else {
- for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->cylinder[i].base);
+ for (i = 0; i < ARRAY_COUNT(this->colliderCylinders); i++) {
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinders[i].base);
}
}
- for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->cylinder[i].base);
+ for (i = 0; i < ARRAY_COUNT(this->colliderCylinders); i++) {
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinders[i].base);
}
if (this->collider.base.acFlags & AC_ON) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h
index fc6ca9ac7a..c04da49c86 100644
--- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h
+++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h
@@ -2,11 +2,11 @@
#define Z_EN_BIGOKUTA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBigokuta;
-typedef void (*EnBigokutaActionFunc)(struct EnBigokuta*, PlayState*);
+typedef void (*EnBigokutaActionFunc)(struct EnBigokuta*, struct PlayState*);
typedef struct EnBigokuta {
/* 0x0000 */ Actor actor;
@@ -20,8 +20,8 @@ typedef struct EnBigokuta {
/* 0x019C */ Vec3s jointTable[20];
/* 0x0214 */ Vec3s morphTable[20];
/* 0x028C */ ColliderJntSph collider;
- /* 0x02AC */ ColliderJntSphElement element;
- /* 0x02EC */ ColliderCylinder cylinder[2];
+ /* 0x02AC */ ColliderJntSphElement colliderElements[1];
+ /* 0x02EC */ ColliderCylinder colliderCylinders[2];
} EnBigokuta; // size = 0x0384
#endif
diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c
index 8e9eba0c60..82f7b62796 100644
--- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c
+++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c
@@ -5,7 +5,21 @@
*/
#include "z_en_bili.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_bl/object_bl.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.h b/src/overlays/actors/ovl_En_Bili/z_en_bili.h
index 0882a288c0..3199639c9d 100644
--- a/src/overlays/actors/ovl_En_Bili/z_en_bili.h
+++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.h
@@ -2,11 +2,11 @@
#define Z_EN_BILI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBili;
-typedef void (*EnBiliActionFunc)(struct EnBili*, PlayState*);
+typedef void (*EnBiliActionFunc)(struct EnBili*, struct PlayState*);
typedef enum EnBiliLimb {
/* 0 */ EN_BILI_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.c b/src/overlays/actors/ovl_En_Bird/z_en_bird.c
index 6ca50edeeb..c93d682ee1 100644
--- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c
+++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c
@@ -5,6 +5,11 @@
*/
#include "z_en_bird.h"
+
+#include "ichain.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_bird/object_bird.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.h b/src/overlays/actors/ovl_En_Bird/z_en_bird.h
index 1cc9858b13..beaf60a3d4 100644
--- a/src/overlays/actors/ovl_En_Bird/z_en_bird.h
+++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.h
@@ -2,11 +2,11 @@
#define Z_EN_BIRD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBird;
-typedef void (*EnBirdActionFunc)(struct EnBird*, PlayState*);
+typedef void (*EnBirdActionFunc)(struct EnBird*, struct PlayState*);
typedef struct EnBird {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c
index 2e1141ffea..1d8d606cf3 100644
--- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c
+++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c
@@ -5,6 +5,14 @@
*/
#include "z_en_blkobj.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_blkobj/object_blkobj.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h
index 4218c64664..babddb4e5d 100644
--- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h
+++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h
@@ -2,11 +2,11 @@
#define Z_EN_BLKOBJ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBlkobj;
-typedef void (*EnBlkobjActionFunc)(struct EnBlkobj*, PlayState*);
+typedef void (*EnBlkobjActionFunc)(struct EnBlkobj*, struct PlayState*);
typedef struct EnBlkobj {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c
index 7fefe03243..31acad8cec 100644
--- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c
+++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c
@@ -112,8 +112,8 @@ void EnBom_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->bombCollider);
Collider_InitJntSph(play, &this->explosionCollider);
Collider_SetCylinder(play, &this->bombCollider, thisx, &sCylinderInit);
- Collider_SetJntSph(play, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderItems[0]);
- this->explosionColliderItems[0].base.atDmgInfo.damage += (thisx->shape.rot.z & 0xFF00) >> 8;
+ Collider_SetJntSph(play, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderElements[0]);
+ this->explosionColliderElements[0].base.atDmgInfo.damage += (thisx->shape.rot.z & 0xFF00) >> 8;
thisx->shape.rot.z &= 0xFF;
if (thisx->shape.rot.z & 0x80) {
diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h
index 9fcb0fe029..88c8feef5c 100644
--- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h
+++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h
@@ -12,7 +12,7 @@ typedef struct EnBom {
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderCylinder bombCollider;
/* 0x0198 */ ColliderJntSph explosionCollider;
- /* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1];
+ /* 0x01B8 */ ColliderJntSphElement explosionColliderElements[1];
/* 0x01F8 */ s16 timer;
/* 0x01FA */ s16 flashSpeedScale;
/* 0x01FC */ f32 flashIntensity;
diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c
index 2935faa451..1bbc6bbb7c 100644
--- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c
+++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c
@@ -4,6 +4,7 @@
#include "gfx.h"
#include "gfx_setupdl.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "rand.h"
#include "regs.h"
#include "segmented_address.h"
@@ -12,6 +13,7 @@
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_bg/object_bg.h"
diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c
index 81442e856a..a911548df0 100644
--- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c
+++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c
@@ -1,12 +1,14 @@
#include "z_en_bom_bowl_pit.h"
#include "overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h"
+#include "printf.h"
#include "regs.h"
#include "sfx.h"
#include "terminal.h"
#include "z_lib.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c
index 8d1df99a4d..7ce476d4ef 100644
--- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c
+++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c
@@ -2,6 +2,7 @@
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "libc64/math64.h"
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
@@ -41,7 +42,7 @@ ActorProfile En_Bom_Chu_Profile = {
/**/ EnBomChu_Draw,
};
-static ColliderJntSphElementInit sJntSphElemInit[] = {
+static ColliderJntSphElementInit sJntSphElementsInit[] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -64,8 +65,8 @@ static ColliderJntSphInit sJntSphInit = {
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
- ARRAY_COUNT(sJntSphElemInit),
- sJntSphElemInit,
+ ARRAY_COUNT(sJntSphElementsInit),
+ sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c
index 34dd30010e..ed1d7eed79 100644
--- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c
+++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c
@@ -5,9 +5,22 @@
*/
#include "z_en_bombf.h"
-#include "assets/objects/object_bombf/object_bombf.h"
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_bombf/object_bombf.h"
+
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
void EnBombf_Init(Actor* thisx, PlayState* play);
@@ -94,7 +107,7 @@ void EnBombf_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->bombCollider);
Collider_InitJntSph(play, &this->explosionCollider);
Collider_SetCylinder(play, &this->bombCollider, thisx, &sCylinderInit);
- Collider_SetJntSph(play, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderItems[0]);
+ Collider_SetJntSph(play, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderElements[0]);
if (thisx->params == BOMBFLOWER_BODY) {
shapeUnk10 = 1000.0f;
diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h
index 14bc9c6ece..840da79c19 100644
--- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h
+++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h
@@ -2,7 +2,7 @@
#define Z_EN_BOMBF_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBombf;
@@ -12,7 +12,7 @@ typedef struct EnBombf {
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderCylinder bombCollider;
/* 0x0198 */ ColliderJntSph explosionCollider;
- /* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1];
+ /* 0x01B8 */ ColliderJntSphElement explosionColliderElements[1];
/* 0x01F8 */ s16 timer;
/* 0x01FC */ EnBombfActionFunc actionFunc;
/* 0x0200 */ s32 isFuseEnabled; // enables the ability to ignite and tick down to explode
diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c
index 982df71a03..b9dcbacb76 100644
--- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c
+++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c
@@ -5,7 +5,16 @@
*/
#include "z_en_boom.h"
-#include "global.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c
index 2d7c748b47..c4ef15919a 100644
--- a/src/overlays/actors/ovl_En_Box/z_en_box.c
+++ b/src/overlays/actors/ovl_En_Box/z_en_box.c
@@ -1,6 +1,25 @@
#include "z_en_box.h"
-#include "global.h"
#include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64curve.h"
+#include "z64effect.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_box/object_box.h"
#define FLAGS 0
@@ -171,7 +190,9 @@ void EnBox_Init(Actor* thisx, PlayState* play2) {
this->dyna.actor.world.rot.y += 0x8000;
this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0;
- SkelAnime_Init(play, &this->skelanime, &gTreasureChestSkel, anim, this->jointTable, this->morphTable, 5);
+ //! @bug Flex skeleton is used as normal skeleton
+ SkelAnime_Init(play, &this->skelanime, (SkeletonHeader*)&gTreasureChestSkel, anim, this->jointTable,
+ this->morphTable, 5);
Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f);
switch (this->type) {
@@ -619,7 +640,7 @@ void EnBox_Draw(Actor* thisx, PlayState* play) {
and cleared by Open
*/
if ((this->alpha == 255 && !(this->type == ENBOX_TYPE_4 || this->type == ENBOX_TYPE_6)) ||
- (!CHECK_FLAG_ALL(this->dyna.actor.flags, ACTOR_FLAG_REACT_TO_LENS) &&
+ (!ACTOR_FLAGS_CHECK_ALL(&this->dyna.actor, ACTOR_FLAG_REACT_TO_LENS) &&
(this->type == ENBOX_TYPE_4 || this->type == ENBOX_TYPE_6))) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c
index 89edf9c5f6..436f4740c5 100644
--- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c
+++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c
@@ -5,6 +5,15 @@
*/
#include "z_en_brob.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_brob/object_brob.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.h b/src/overlays/actors/ovl_En_Brob/z_en_brob.h
index a3dd0c8f8a..02516f4e9b 100644
--- a/src/overlays/actors/ovl_En_Brob/z_en_brob.h
+++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.h
@@ -2,11 +2,11 @@
#define Z_EN_BROB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBrob;
-typedef void (*EnBrobActionFunc)(struct EnBrob* this, PlayState* play);
+typedef void (*EnBrobActionFunc)(struct EnBrob* this, struct PlayState* play);
typedef struct EnBrob {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c
index 466ebfce65..79860d7f7f 100644
--- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c
+++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c
@@ -1,4 +1,16 @@
#include "z_en_bubble.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_bubble/object_bubble.h"
#define FLAGS ACTOR_FLAG_ATTENTION_ENABLED
@@ -95,7 +107,7 @@ void EnBubble_SetDimensions(EnBubble* this, f32 dim) {
}
u32 func_809CBCBC(EnBubble* this) {
- ColliderElement* elem = &this->colliderSphere.elements[0].base;
+ ColliderElement* elem = &this->colliderJntSph.elements[0].base;
elem->atDmgInfo.dmgFlags = DMG_EXPLOSIVE;
elem->atDmgInfo.effect = 0;
@@ -112,7 +124,7 @@ u32 func_809CBCEC(EnBubble* this) {
}
void EnBubble_DamagePlayer(EnBubble* this, PlayState* play) {
- s32 damage = -this->colliderSphere.elements[0].base.atDmgInfo.damage;
+ s32 damage = -this->colliderJntSph.elements[0].base.atDmgInfo.damage;
play->damagePlayer(play, damage);
Actor_SetPlayerKnockbackSmallNoDamage(play, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f);
@@ -206,8 +218,8 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) {
s32 bgId;
u8 bounceCount;
- if (this->colliderSphere.elements[1].base.acElemFlags & ACELEM_HIT) {
- attackerActor = this->colliderSphere.base.ac;
+ if (this->colliderJntSph.elements[1].base.acElemFlags & ACELEM_HIT) {
+ attackerActor = this->colliderJntSph.base.ac;
this->normalizedAttackerVelocity = attackerActor->velocity;
EnBubble_Vec3fNormalize(&this->normalizedAttackerVelocity);
this->velocityFromAttack.x += (this->normalizedAttackerVelocity.x * 3.0f);
@@ -280,14 +292,14 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) {
}
u32 func_809CC648(EnBubble* this) {
- if (((this->colliderSphere.base.acFlags & AC_HIT) != 0) == false) {
+ if (((this->colliderJntSph.base.acFlags & AC_HIT) != 0) == false) {
return false;
}
- this->colliderSphere.base.acFlags &= ~AC_HIT;
- if (this->colliderSphere.elements[1].base.acElemFlags & ACELEM_HIT) {
- this->unk_1F0.x = this->colliderSphere.base.ac->velocity.x / 10.0f;
- this->unk_1F0.y = this->colliderSphere.base.ac->velocity.y / 10.0f;
- this->unk_1F0.z = this->colliderSphere.base.ac->velocity.z / 10.0f;
+ this->colliderJntSph.base.acFlags &= ~AC_HIT;
+ if (this->colliderJntSph.elements[1].base.acElemFlags & ACELEM_HIT) {
+ this->unk_1F0.x = this->colliderJntSph.base.ac->velocity.x / 10.0f;
+ this->unk_1F0.y = this->colliderJntSph.base.ac->velocity.y / 10.0f;
+ this->unk_1F0.z = this->colliderJntSph.base.ac->velocity.z / 10.0f;
this->graphicRotSpeed = 128.0f;
this->graphicEccentricity = 0.48f;
return false;
@@ -300,8 +312,8 @@ u32 EnBubble_DetectPop(EnBubble* this, PlayState* play) {
if (DECR(this->unk_208) != 0 || this->actionFunc == EnBubble_Pop) {
return false;
}
- if (this->colliderSphere.base.ocFlags2 & OC2_HIT_PLAYER) {
- this->colliderSphere.base.ocFlags2 &= ~OC2_HIT_PLAYER;
+ if (this->colliderJntSph.base.ocFlags2 & OC2_HIT_PLAYER) {
+ this->colliderJntSph.base.ocFlags2 &= ~OC2_HIT_PLAYER;
EnBubble_DamagePlayer(this, play);
this->unk_208 = 8;
return true;
@@ -314,7 +326,7 @@ void func_809CC774(EnBubble* this) {
Vec3f src;
Vec3f dest;
- dim = &this->colliderSphere.elements[0].dim;
+ dim = &this->colliderJntSph.elements[0].dim;
src.x = dim->modelSphere.center.x;
src.y = dim->modelSphere.center.y;
src.z = dim->modelSphere.center.z;
@@ -324,7 +336,7 @@ void func_809CC774(EnBubble* this) {
dim->worldSphere.center.y = dest.y;
dim->worldSphere.center.z = dest.z;
dim->worldSphere.radius = dim->modelSphere.radius * (1.0f + this->expansionWidth);
- this->colliderSphere.elements[1].dim = *dim;
+ this->colliderJntSph.elements[1].dim = *dim;
}
void EnBubble_Init(Actor* thisx, PlayState* play) {
@@ -332,8 +344,8 @@ void EnBubble_Init(Actor* thisx, PlayState* play) {
u32 pad;
ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawCircle, 0.2f);
- Collider_InitJntSph(play, &this->colliderSphere);
- Collider_SetJntSph(play, &this->colliderSphere, &this->actor, &sJntSphInit, this->colliderSphereItems);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(9), &sColChkInfoInit2);
this->actor.naviEnemyId = NAVI_ENEMY_SHABOM;
this->bounceDirection.x = Rand_ZeroOne();
@@ -350,7 +362,7 @@ void EnBubble_Init(Actor* thisx, PlayState* play) {
void EnBubble_Destroy(Actor* thisx, PlayState* play) {
EnBubble* this = (EnBubble*)thisx;
- Collider_DestroyJntSph(play, &this->colliderSphere);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
}
void EnBubble_Wait(EnBubble* this, PlayState* play) {
@@ -360,8 +372,8 @@ void EnBubble_Wait(EnBubble* this, PlayState* play) {
} else {
EnBubble_Fly(this, play);
this->actor.shape.yOffset = ((this->expansionHeight + 1.0f) * 16.0f);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSphere.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderSphere.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
}
@@ -389,8 +401,8 @@ void EnBubble_Regrow(EnBubble* this, PlayState* play) {
if (func_809CC020(this)) {
this->actionFunc = EnBubble_Wait;
}
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSphere.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderSphere.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
void EnBubble_Update(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h
index d753768811..9b183ae2bc 100644
--- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h
+++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h
@@ -2,17 +2,17 @@
#define Z_EN_BUBBLE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBubble;
-typedef void (*EnBubbleActionFunc)(struct EnBubble*, PlayState*);
+typedef void (*EnBubbleActionFunc)(struct EnBubble*, struct PlayState*);
typedef struct EnBubble {
/* 0x0000 */ Actor actor;
/* 0x014C */ EnBubbleActionFunc actionFunc;
- /* 0x0150 */ ColliderJntSph colliderSphere;
- /* 0x0170 */ ColliderJntSphElement colliderSphereItems[2];
+ /* 0x0150 */ ColliderJntSph colliderJntSph;
+ /* 0x0170 */ ColliderJntSphElement colliderJntSphElements[2];
/* 0x01F0 */ Vec3f unk_1F0; // set but never used
/* 0x01FC */ Vec3f unk_1FC; // randomly generated, set but never used
/* 0x0208 */ s16 unk_208; // set to 8 when about to pop
diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c
index b3deb35f9e..c206adfbf5 100644
--- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c
+++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c
@@ -6,6 +6,20 @@
#include "z_en_butte.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
@@ -159,7 +173,7 @@ void EnButte_Init(Actor* thisx, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gButterflySkel, &gButterflyAnim, this->jointTable, this->morphTable, 8);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->colliderElements);
this->actor.colChkInfo.mass = 0;
this->unk_25C = Rand_ZeroOne() * 0xFFFF;
this->unk_25E = Rand_ZeroOne() * 0xFFFF;
diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.h b/src/overlays/actors/ovl_En_Butte/z_en_butte.h
index 1a34747dbd..1a1764520c 100644
--- a/src/overlays/actors/ovl_En_Butte/z_en_butte.h
+++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.h
@@ -2,16 +2,16 @@
#define Z_EN_BUTTE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnButte;
-typedef void (*EnButteActionFunc)(struct EnButte*, PlayState*);
+typedef void (*EnButteActionFunc)(struct EnButte*, struct PlayState*);
typedef struct EnButte {
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderJntSph collider;
- /* 0x016C */ ColliderJntSphElement colliderItems[1];
+ /* 0x016C */ ColliderJntSphElement colliderElements[1];
/* 0x01AC */ SkelAnime skelAnime;
/* 0x01F0 */ Vec3s jointTable[8];
/* 0x0220 */ Vec3s morphTable[8];
diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c
index 6ab5fd6fcf..0aad9cccae 100644
--- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c
+++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c
@@ -5,7 +5,24 @@
*/
#include "z_en_bw.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_bw/object_bw.h"
diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.h b/src/overlays/actors/ovl_En_Bw/z_en_bw.h
index 5f74f70c4d..7c0698d22c 100644
--- a/src/overlays/actors/ovl_En_Bw/z_en_bw.h
+++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.h
@@ -2,10 +2,10 @@
#define Z_EN_BW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBw;
-typedef void (*EnBwActionFunc)(struct EnBw*, PlayState*);
+typedef void (*EnBwActionFunc)(struct EnBw*, struct PlayState*);
typedef enum TorchSlugLimb {
/* 0 */ TORCH_SLUG_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c
index efc4d4f5cf..51896cbb7d 100644
--- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c
+++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c
@@ -5,6 +5,19 @@
*/
#include "z_en_bx.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_bxa/object_bxa.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.h b/src/overlays/actors/ovl_En_Bx/z_en_bx.h
index 189349a0f1..077def413d 100644
--- a/src/overlays/actors/ovl_En_Bx/z_en_bx.h
+++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.h
@@ -2,7 +2,7 @@
#define Z_EN_BX_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnBx;
diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c
index 60594097ce..95debf0273 100644
--- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c
+++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c
@@ -5,9 +5,17 @@
*/
#include "z_en_changer.h"
-#include "terminal.h"
-#include "overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h"
+#include "overlays/actors/ovl_En_Box/z_en_box.h"
#include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h"
+#include "overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h"
+
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "terminal.h"
+#include "z64debug_display.h"
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.h b/src/overlays/actors/ovl_En_Changer/z_en_changer.h
index 75281b2343..6807287787 100644
--- a/src/overlays/actors/ovl_En_Changer/z_en_changer.h
+++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.h
@@ -2,19 +2,18 @@
#define Z_EN_CHANGER_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_En_Box/z_en_box.h"
+#include "z64actor.h"
struct EnChanger;
-typedef void (*EnChangerActionFunc)(struct EnChanger*, PlayState*);
+typedef void (*EnChangerActionFunc)(struct EnChanger*, struct PlayState*);
typedef struct EnChanger {
/* 0x0000 */ Actor actor;
/* 0x014C */ EnChangerActionFunc actionFunc;
- /* 0x0150 */ EnBox* leftChest;
- /* 0x0154 */ EnBox* rightChest;
- /* 0x0158 */ EnBox* finalChest;
+ /* 0x0150 */ struct EnBox* leftChest;
+ /* 0x0154 */ struct EnBox* rightChest;
+ /* 0x0158 */ struct EnBox* finalChest;
/* 0x015C */ s16 leftChestNum;
/* 0x015E */ s16 rightChestNum;
/* 0x0160 */ s16 leftChestGetItemId;
diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
index c6cf2c7ad3..6bcbd62323 100644
--- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
+++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
@@ -1,5 +1,18 @@
#include "z_en_clear_tag.h"
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h
index 945a5462d6..6978941868 100644
--- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h
+++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h
@@ -2,7 +2,7 @@
#define Z_EN_CLEAR_TAG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnClearTag;
diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c
index 30d16077f5..d459c93f6f 100644
--- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c
+++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c
@@ -6,6 +6,18 @@
#include "z_en_cow.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
void EnCow_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.h b/src/overlays/actors/ovl_En_Cow/z_en_cow.h
index cdec79fca8..e5602967e1 100644
--- a/src/overlays/actors/ovl_En_Cow/z_en_cow.h
+++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.h
@@ -2,7 +2,7 @@
#define Z_EN_COW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#include "assets/objects/object_cow/object_cow.h"
#define COW_FLAG_PLAYER_NEARBY (1 << 1)
@@ -23,7 +23,7 @@ typedef enum CowCollider {
struct EnCow;
-typedef void (*EnCowActionFunc)(struct EnCow*, PlayState*);
+typedef void (*EnCowActionFunc)(struct EnCow*, struct PlayState*);
typedef struct EnCow {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c
index a2533df3d5..3ce86ff9d3 100644
--- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c
+++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c
@@ -1,4 +1,16 @@
#include "z_en_crow.h"
+
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_crow/object_crow.h"
#define FLAGS \
@@ -112,7 +124,7 @@ void EnCrow_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitFlex(play, &this->skelAnime, &gGuaySkel, &gGuayFlyAnim, this->jointTable, this->morphTable, 9);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius;
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f);
diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/src/overlays/actors/ovl_En_Crow/z_en_crow.h
index 87e9ae0542..fb13e7bca6 100644
--- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h
+++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h
@@ -2,11 +2,11 @@
#define Z_EN_CROW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnCrow;
-typedef void (*EnCrowActionFunc)(struct EnCrow*, PlayState*);
+typedef void (*EnCrowActionFunc)(struct EnCrow*, struct PlayState*);
typedef struct EnCrow {
/* 0x0000 */ Actor actor;
@@ -19,7 +19,7 @@ typedef struct EnCrow {
/* 0x01CA */ Vec3s jointTable[9];
/* 0x0200 */ Vec3s morphTable[9];
/* 0x0238 */ ColliderJntSph collider;
- /* 0x0258 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0258 */ ColliderJntSphElement colliderElements[1];
} EnCrow; // size = 0x0298
#endif
diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c
index 807abac5ec..8b74a6063e 100644
--- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c
+++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c
@@ -1,4 +1,18 @@
#include "z_en_cs.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_cs/object_cs.h"
#include "assets/objects/object_link_child/object_link_child.h"
diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.h b/src/overlays/actors/ovl_En_Cs/z_en_cs.h
index 843c8ad510..8e1d665f54 100644
--- a/src/overlays/actors/ovl_En_Cs/z_en_cs.h
+++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.h
@@ -2,11 +2,11 @@
#define Z_EN_CS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnCs;
-typedef void (*EnCsActionFunc)(struct EnCs*, PlayState*);
+typedef void (*EnCsActionFunc)(struct EnCs*, struct PlayState*);
typedef struct EnCs {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
index 64b3cc1088..98a09bb25e 100644
--- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
+++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
@@ -1,10 +1,27 @@
#include "z_en_daiku.h"
#include "overlays/actors/ovl_En_GeldB/z_en_geldb.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_daiku/object_daiku.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
#define ENDAIKU_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 2)
+#define ENDAIKU_GET_PATH_INDEX(thisx) PARAMS_GET_U((thisx)->params, 4, 4)
+#define ENDAIKU_GET_DOOR_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 8, 6)
typedef struct EnDaikuEscapeSubCamParam {
Vec3f eyePosDeltaLocal;
@@ -13,10 +30,10 @@ typedef struct EnDaikuEscapeSubCamParam {
// state flags
-// probably related to animating torso and head to look towards the player
-#define ENDAIKU_STATEFLAG_1 (1 << 1)
-// same
-#define ENDAIKU_STATEFLAG_2 (1 << 2)
+// the carpenter tracks the player position
+#define ENDAIKU_STATEFLAG_TRACK_PLAYER (1 << 1)
+// if tracking the player, track with the carpenter's full body
+#define ENDAIKU_STATEFLAG_TRACK_WITH_FULL_BODY (1 << 2)
// the gerudo guard appeared (after talking to the carpenter)
#define ENDAIKU_STATEFLAG_GERUDOFIGHTING (1 << 3)
// the gerudo guard was defeated
@@ -121,9 +138,9 @@ typedef enum EnDaikuAnimation {
} EnDaikuAnimation;
static AnimationFrameCountInfo sAnimationInfo[] = {
- { &object_daiku_Anim_001AB0, 1.0f, 0, 0 }, { &object_daiku_Anim_007DE0, 1.0f, 0, 0 },
- { &object_daiku_Anim_00885C, 1.0f, 0, 0 }, { &object_daiku_Anim_000C44, 1.0f, 0, 0 },
- { &object_daiku_Anim_008164, 1.0f, 0, 0 },
+ { &object_daiku_Anim_001AB0, 1.0f, ANIMMODE_LOOP, 0 }, { &object_daiku_Anim_007DE0, 1.0f, ANIMMODE_LOOP, 0 },
+ { &object_daiku_Anim_00885C, 1.0f, ANIMMODE_LOOP, 0 }, { &object_daiku_Anim_000C44, 1.0f, ANIMMODE_LOOP, 0 },
+ { &object_daiku_Anim_008164, 1.0f, ANIMMODE_LOOP, 0 },
};
static EnDaikuEscapeSubCamParam sEscapeSubCamParams[] = {
@@ -199,15 +216,15 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) {
if (play->sceneId == SCENE_THIEVES_HIDEOUT) {
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_STAND, &this->currentAnimIndex);
- this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2;
+ this->stateFlags |= ENDAIKU_STATEFLAG_TRACK_PLAYER | ENDAIKU_STATEFLAG_TRACK_WITH_FULL_BODY;
this->actionFunc = EnDaiku_Jailed;
} else {
if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE1 || ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE3) {
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SIT, &this->currentAnimIndex);
- this->stateFlags |= ENDAIKU_STATEFLAG_1;
+ this->stateFlags |= ENDAIKU_STATEFLAG_TRACK_PLAYER;
} else {
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SHOUT, &this->currentAnimIndex);
- this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2;
+ this->stateFlags |= ENDAIKU_STATEFLAG_TRACK_PLAYER | ENDAIKU_STATEFLAG_TRACK_WITH_FULL_BODY;
}
this->skelAnime.curFrame = (s32)(Rand_ZeroOne() * this->skelAnime.endFrame);
@@ -257,17 +274,17 @@ s32 EnDaiku_UpdateTalking(EnDaiku* this, PlayState* play) {
void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) {
s32 carpenterType;
s32 rescuedCount;
- s16 sp2E;
- s16 sp2C;
+ s16 screenX;
+ s16 screenY;
if (this->talkState == ENDAIKU_STATE_TALKING) {
this->talkState = EnDaiku_UpdateTalking(this, play);
} else if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->talkState = ENDAIKU_STATE_TALKING;
} else {
- Actor_GetScreenPos(play, &this->actor, &sp2E, &sp2C);
- if (sp2E >= 0 && sp2E <= 320 && sp2C >= 0 && sp2C <= 240 && this->talkState == ENDAIKU_STATE_CAN_TALK &&
- Actor_OfferTalk(&this->actor, play, 100.0f) == 1) {
+ Actor_GetScreenPos(play, &this->actor, &screenX, &screenY);
+ if ((screenX >= 0) && (screenX <= SCREEN_WIDTH) && (screenY >= 0) && (screenY <= SCREEN_HEIGHT) &&
+ (this->talkState == ENDAIKU_STATE_CAN_TALK) && (Actor_OfferTalk(&this->actor, play, 100.0f) == true)) {
if (play->sceneId == SCENE_THIEVES_HIDEOUT) {
if (this->stateFlags & ENDAIKU_STATEFLAG_GERUDODEFEATED) {
rescuedCount = 0;
@@ -352,8 +369,6 @@ void EnDaiku_TentIdle(EnDaiku* this, PlayState* play) {
*/
void EnDaiku_Jailed(EnDaiku* this, PlayState* play) {
EnGeldB* gerudo;
- s32 temp_t9;
- s32 temp_v1;
if (!(this->stateFlags & ENDAIKU_STATEFLAG_GERUDOFIGHTING)) {
EnDaiku_UpdateText(this, play);
@@ -379,7 +394,7 @@ void EnDaiku_Jailed(EnDaiku* this, PlayState* play) {
void EnDaiku_WaitFreedom(EnDaiku* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
- if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) {
+ if (Flags_GetSwitch(play, ENDAIKU_GET_DOOR_SWITCH_FLAG(&this->actor))) {
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY;
EnDaiku_UpdateText(this, play);
}
@@ -398,7 +413,7 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) {
Audio_PlayFanfare(NA_BGM_APPEAR);
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_RUN, &this->currentAnimIndex);
- this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2);
+ this->stateFlags &= ~(ENDAIKU_STATEFLAG_TRACK_PLAYER | ENDAIKU_STATEFLAG_TRACK_WITH_FULL_BODY);
ENDAIKU_SET_CARPENTER_RESCUED(ENDAIKU_GET_TYPE(&this->actor));
@@ -407,7 +422,7 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) {
EnDaiku_InitSubCamera(this, play);
exitLoop = false;
- path = &play->pathList[PARAMS_GET_U(this->actor.params, 4, 4)];
+ path = &play->pathList[ENDAIKU_GET_PATH_INDEX(&this->actor)];
while (!exitLoop) {
pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint;
dx = pointPos->x - this->actor.world.pos.x;
@@ -524,7 +539,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) {
f32 dxz;
Vec3s* pointPos;
- path = &play->pathList[PARAMS_GET_U(this->actor.params, 4, 4)];
+ path = &play->pathList[ENDAIKU_GET_PATH_INDEX(&this->actor)];
pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint;
dx = pointPos->x - this->actor.world.pos.x;
dz = pointPos->z - this->actor.world.pos.z;
@@ -574,12 +589,12 @@ void EnDaiku_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
- if (this->stateFlags & ENDAIKU_STATEFLAG_1) {
+ if (this->stateFlags & ENDAIKU_STATEFLAG_TRACK_PLAYER) {
this->interactInfo.trackPos.x = player->actor.focus.pos.x;
this->interactInfo.trackPos.y = player->actor.focus.pos.y;
this->interactInfo.trackPos.z = player->actor.focus.pos.z;
- if (this->stateFlags & ENDAIKU_STATEFLAG_2) {
+ if (this->stateFlags & ENDAIKU_STATEFLAG_TRACK_WITH_FULL_BODY) {
Npc_TrackPoint(&this->actor, &this->interactInfo, 0, NPC_TRACKING_FULL_BODY);
} else {
Npc_TrackPoint(&this->actor, &this->interactInfo, 0, NPC_TRACKING_HEAD_AND_TORSO);
diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h
index 69136f6a92..b191c1d79f 100644
--- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h
+++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h
@@ -2,11 +2,11 @@
#define Z_EN_DAIKU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDaiku;
-typedef void (*EnDaikuActionFunc)(struct EnDaiku*, PlayState*);
+typedef void (*EnDaikuActionFunc)(struct EnDaiku*, struct PlayState*);
typedef enum EnDaikuType {
ENDAIKU_TYPE0,
diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c
index 6b27191f79..f469d5626f 100644
--- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c
+++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c
@@ -5,10 +5,28 @@
*/
#include "z_en_daiku_kakariko.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_daiku/object_daiku.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
+#define ENDAIKUKAKARIKO_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 2)
+#define ENDAIKUKAKARIKO_GET_PATH_INDEX(thisx) PARAMS_GET_U((thisx)->params, 8, 8)
+
typedef enum KakarikoCarpenterType {
/* 0x0 */ CARPENTER_ICHIRO, // Red and purple pants, normal hair
/* 0x1 */ CARPENTER_SABOORO, // Light blue pants
@@ -103,9 +121,12 @@ typedef enum EnDaikuKakarikoAnimation {
} EnDaikuKakarikoAnimation;
static AnimationFrameCountInfo sAnimationInfo[] = {
- { &object_daiku_Anim_001AB0, 1.0f, 2, -7.0f }, { &object_daiku_Anim_007DE0, 1.0f, 0, -7.0f },
- { &object_daiku_Anim_00885C, 1.0f, 0, -7.0f }, { &object_daiku_Anim_000C44, 1.0f, 0, -7.0f },
- { &object_daiku_Anim_000600, 1.0f, 0, -7.0f }, { &object_daiku_Anim_008164, 1.0f, 0, -7.0f },
+ { &object_daiku_Anim_001AB0, 1.0f, ANIMMODE_ONCE, -7.0f },
+ { &object_daiku_Anim_007DE0, 1.0f, ANIMMODE_LOOP, -7.0f },
+ { &object_daiku_Anim_00885C, 1.0f, ANIMMODE_LOOP, -7.0f },
+ { &object_daiku_Anim_000C44, 1.0f, ANIMMODE_LOOP, -7.0f },
+ { &object_daiku_Anim_000600, 1.0f, ANIMMODE_LOOP, -7.0f },
+ { &object_daiku_Anim_008164, 1.0f, ANIMMODE_LOOP, -7.0f },
};
void EnDaikuKakariko_ChangeAnim(EnDaikuKakariko* this, s32 index, s32* currentIndex) {
@@ -133,7 +154,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) {
case SCENE_KAKARIKO_VILLAGE:
if (IS_DAY) {
this->flags |= 1;
- this->flags |= initFlags[PARAMS_GET_U(this->actor.params, 0, 2)];
+ this->flags |= initFlags[ENDAIKUKAKARIKO_GET_TYPE(&this->actor)];
}
break;
case SCENE_KAKARIKO_CENTER_GUEST_HOUSE:
@@ -184,8 +205,8 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) {
this->actionFunc = EnDaikuKakariko_Run;
} else {
if (this->flags & 8) {
- if ((PARAMS_GET_U(this->actor.params, 0, 2) == CARPENTER_SABOORO) ||
- (PARAMS_GET_U(this->actor.params, 0, 2) == CARPENTER_SHIRO)) {
+ if ((ENDAIKUKAKARIKO_GET_TYPE(&this->actor) == CARPENTER_SABOORO) ||
+ (ENDAIKUKAKARIKO_GET_TYPE(&this->actor) == CARPENTER_SHIRO)) {
EnDaikuKakariko_ChangeAnim(this, ENDAIKUKAKARIKO_ANIM_5, &this->currentAnimIndex);
this->flags |= 0x800;
} else {
@@ -233,23 +254,23 @@ void EnDaikuKakariko_HandleTalking(EnDaikuKakariko* this, PlayState* play) {
MASK_REACTION_SET_CARPENTER_3,
MASK_REACTION_SET_CARPENTER_4,
};
- s16 sp26;
- s16 sp24;
+ s16 screenX;
+ s16 screenY;
if (this->talkState == 2) {
this->talkState = EnDaikuKakariko_GetTalkState(this, play);
} else if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->talkState = 2;
} else {
- Actor_GetScreenPos(play, &this->actor, &sp26, &sp24);
+ Actor_GetScreenPos(play, &this->actor, &screenX, &screenY);
- if ((sp26 >= 0) && (sp26 <= 320) && (sp24 >= 0) && (sp24 <= 240) && (this->talkState == 0) &&
- (Actor_OfferTalk(&this->actor, play, 100.0f) == 1)) {
+ if ((screenX >= 0) && (screenX <= SCREEN_WIDTH) && (screenY >= 0) && (screenY <= SCREEN_HEIGHT) &&
+ (this->talkState == 0) && (Actor_OfferTalk(&this->actor, play, 100.0f) == true)) {
this->actor.textId =
- MaskReaction_GetTextId(play, sMaskReactionSets[PARAMS_GET_U(this->actor.params, 0, 2)]);
+ MaskReaction_GetTextId(play, sMaskReactionSets[ENDAIKUKAKARIKO_GET_TYPE(&this->actor)]);
if (this->actor.textId == 0) {
- switch (PARAMS_GET_U(this->actor.params, 0, 2)) {
+ switch (ENDAIKUKAKARIKO_GET_TYPE(&this->actor)) {
case 0:
if (this->flags & 8) {
this->actor.textId = 0x5076;
@@ -366,7 +387,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) {
s32 run;
do {
- path = &play->pathList[PARAMS_GET_U(this->actor.params, 8, 8)];
+ path = &play->pathList[ENDAIKUKAKARIKO_GET_PATH_INDEX(&this->actor)];
pathPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->waypoint];
xDist = pathPos->x - this->actor.world.pos.x;
zDist = pathPos->z - this->actor.world.pos.z;
@@ -538,7 +559,7 @@ void EnDaikuKakariko_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V
if (limbIndex == 15) {
Matrix_MultVec3f(&unkVec, &this->actor.focus.pos);
- gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[PARAMS_GET_U(this->actor.params, 0, 2)]);
+ gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[ENDAIKUKAKARIKO_GET_TYPE(&this->actor)]);
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku_kakariko.c", 1113);
@@ -551,13 +572,13 @@ void EnDaikuKakariko_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
- if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_ICHIRO) {
+ if (ENDAIKUKAKARIKO_GET_TYPE(thisx) == CARPENTER_ICHIRO) {
gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255);
- } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_SABOORO) {
+ } else if (ENDAIKUKAKARIKO_GET_TYPE(thisx) == CARPENTER_SABOORO) {
gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255);
- } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_JIRO) {
+ } else if (ENDAIKUKAKARIKO_GET_TYPE(thisx) == CARPENTER_JIRO) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255);
- } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_SHIRO) {
+ } else if (ENDAIKUKAKARIKO_GET_TYPE(thisx) == CARPENTER_SHIRO) {
gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255);
}
diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h
index 5d3596d58f..1395b6e259 100644
--- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h
+++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h
@@ -2,11 +2,11 @@
#define Z_EN_DAIKU_KAKARIKO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDaikuKakariko;
-typedef void (*EnDaikuKakarikoActionFunc)(struct EnDaikuKakariko*, PlayState*);
+typedef void (*EnDaikuKakarikoActionFunc)(struct EnDaikuKakariko*, struct PlayState*);
typedef struct EnDaikuKakariko {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
index a770abcb63..df9b566f87 100644
--- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
+++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
@@ -1,8 +1,22 @@
#include "z_en_dekubaba.h"
-#include "assets/objects/object_dekubaba/object_dekubaba.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_dekubaba/object_dekubaba.h"
+
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
void EnDekubaba_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h
index b1d53307ce..46a8b8dbdf 100644
--- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h
+++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h
@@ -2,11 +2,11 @@
#define Z_EN_DEKUBABA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDekubaba;
-typedef void (*EnDekubabaActionFunc)(struct EnDekubaba*, PlayState*);
+typedef void (*EnDekubabaActionFunc)(struct EnDekubaba*, struct PlayState*);
typedef enum DekuBabaType {
/* 0 */ DEKUBABA_NORMAL,
@@ -25,7 +25,7 @@ typedef struct EnDekubaba {
/* 0x01D0 */ Vec3s jointTable[8];
/* 0x0200 */ Vec3s morphTable[8];
/* 0x0230 */ f32 size; // Used everywhere to rescale offsets etc. for Big ones
- /* 0x0234 */ CollisionPoly* boundFloor;
+ /* 0x0234 */ struct CollisionPoly* boundFloor;
/* 0x0238 */ ColliderJntSph collider;
/* 0x0258 */ ColliderJntSphElement colliderElements[7];
} EnDekubaba; // size = 0x0418
diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c
index c21d760eb9..cf498eb726 100644
--- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c
+++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c
@@ -6,6 +6,15 @@
#include "z_en_dekunuts.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_dekunuts/object_dekunuts.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h
index 6beefc7c3b..76f23bdecf 100644
--- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h
+++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h
@@ -2,11 +2,11 @@
#define Z_EN_DEKUNUTS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDekunuts;
-typedef void (*EnDekunutsActionFunc)(struct EnDekunuts*, PlayState*);
+typedef void (*EnDekunutsActionFunc)(struct EnDekunuts*, struct PlayState*);
typedef struct EnDekunuts {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c
index d0b44336bf..34acb2d982 100644
--- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c
+++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c
@@ -1,4 +1,29 @@
+/*
+ * File: z_en_dh.c
+ * Overlay: ovl_En_Dh
+ * Description: Dead Hand
+ */
+
#include "z_en_dh.h"
+
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_dh/object_dh.h"
#define FLAGS \
@@ -153,8 +178,8 @@ void EnDh_Init(Actor* thisx, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
Collider_InitCylinder(play, &this->collider1);
Collider_SetCylinder(play, &this->collider1, &this->actor, &sCylinderInit);
- Collider_InitJntSph(play, &this->collider2);
- Collider_SetJntSph(play, &this->collider2, &this->actor, &sJntSphInit, this->elements);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
EnDh_SetupWait(this);
}
@@ -164,7 +189,7 @@ void EnDh_Destroy(Actor* thisx, PlayState* play) {
func_800F5B58();
Collider_DestroyCylinder(play, &this->collider1);
- Collider_DestroyJntSph(play, &this->collider2);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
}
void EnDh_SpawnDebris(PlayState* play, EnDh* this, Vec3f* spawnPos, f32 spread, s32 arg4, f32 accelXZ, f32 scale) {
@@ -304,8 +329,10 @@ void EnDh_Attack(EnDh* this, PlayState* play) {
Animation_Change(&this->skelAnime, &object_dh_Anim_004658, -1.0f, this->skelAnime.curFrame, 0.0f, ANIMMODE_ONCE,
-4.0f);
this->actionState = 4;
- this->collider2.base.atFlags = this->collider2.elements[0].base.atElemFlags = AT_NONE; // also ATELEM_NONE
- this->collider2.elements[0].base.atDmgInfo.dmgFlags = this->collider2.elements[0].base.atDmgInfo.damage = 0;
+ this->colliderJntSph.base.atFlags = this->colliderJntSph.elements[0].base.atElemFlags =
+ AT_NONE; // also ATELEM_NONE
+ this->colliderJntSph.elements[0].base.atDmgInfo.dmgFlags =
+ this->colliderJntSph.elements[0].base.atDmgInfo.damage = 0;
}
switch (this->actionState) {
case 1:
@@ -318,20 +345,20 @@ void EnDh_Attack(EnDh* this, PlayState* play) {
break;
case 2:
if (this->skelAnime.curFrame >= 4.0f) {
- this->collider2.base.atFlags = this->collider2.elements[0].base.atElemFlags =
+ this->colliderJntSph.base.atFlags = this->colliderJntSph.elements[0].base.atElemFlags =
AT_ON | AT_TYPE_ENEMY; // also ATELEM_ON | ATELEM_SFX_WOOD
- this->collider2.elements[0].base.atDmgInfo.dmgFlags = DMG_DEFAULT;
- this->collider2.elements[0].base.atDmgInfo.damage = 8;
+ this->colliderJntSph.elements[0].base.atDmgInfo.dmgFlags = DMG_DEFAULT;
+ this->colliderJntSph.elements[0].base.atDmgInfo.damage = 8;
}
- if (this->collider2.base.atFlags & AT_BOUNCED) {
- this->collider2.base.atFlags &= ~(AT_HIT | AT_BOUNCED);
- this->collider2.base.atFlags = this->collider2.elements[0].base.atElemFlags =
+ if (this->colliderJntSph.base.atFlags & AT_BOUNCED) {
+ this->colliderJntSph.base.atFlags &= ~(AT_HIT | AT_BOUNCED);
+ this->colliderJntSph.base.atFlags = this->colliderJntSph.elements[0].base.atElemFlags =
AT_NONE; // also ATELEM_NONE
- this->collider2.elements[0].base.atDmgInfo.dmgFlags =
- this->collider2.elements[0].base.atDmgInfo.damage = 0;
+ this->colliderJntSph.elements[0].base.atDmgInfo.dmgFlags =
+ this->colliderJntSph.elements[0].base.atDmgInfo.damage = 0;
this->actionState++;
- } else if (this->collider2.base.atFlags & AT_HIT) {
- this->collider2.base.atFlags &= ~AT_HIT;
+ } else if (this->colliderJntSph.base.atFlags & AT_HIT) {
+ this->colliderJntSph.base.atFlags &= ~AT_HIT;
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 8.0f, this->actor.shape.rot.y, 8.0f);
}
break;
@@ -346,10 +373,10 @@ void EnDh_Attack(EnDh* this, PlayState* play) {
Animation_Change(&this->skelAnime, &object_dh_Anim_004658, -1.0f,
Animation_GetLastFrame(&object_dh_Anim_004658), 0.0f, ANIMMODE_ONCE, -4.0f);
this->actionState++;
- this->collider2.base.atFlags = this->collider2.elements[0].base.atElemFlags =
+ this->colliderJntSph.base.atFlags = this->colliderJntSph.elements[0].base.atElemFlags =
AT_NONE; // also ATELEM_NONE
- this->collider2.elements[0].base.atDmgInfo.dmgFlags =
- this->collider2.elements[0].base.atDmgInfo.damage = 0;
+ this->colliderJntSph.elements[0].base.atDmgInfo.dmgFlags =
+ this->colliderJntSph.elements[0].base.atDmgInfo.damage = 0;
}
break;
case 5:
@@ -478,11 +505,13 @@ void EnDh_CollisionCheck(EnDh* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 lastHealth;
- if ((this->collider2.base.acFlags & AC_HIT) && !this->retreat) {
- this->collider2.base.acFlags &= ~AC_HIT;
+ if ((this->colliderJntSph.base.acFlags & AC_HIT) && !this->retreat) {
+ this->colliderJntSph.base.acFlags &= ~AC_HIT;
if ((this->actor.colChkInfo.damageEffect != 0) && (this->actor.colChkInfo.damageEffect != 6)) {
- this->collider2.base.atFlags = this->collider2.elements[0].base.atElemFlags = AT_NONE; // also ATELEM_NONE
- this->collider2.elements[0].base.atDmgInfo.dmgFlags = this->collider2.elements[0].base.atDmgInfo.damage = 0;
+ this->colliderJntSph.base.atFlags = this->colliderJntSph.elements[0].base.atElemFlags =
+ AT_NONE; // also ATELEM_NONE
+ this->colliderJntSph.elements[0].base.atDmgInfo.dmgFlags =
+ this->colliderJntSph.elements[0].base.atDmgInfo.damage = 0;
if (player->unk_844 != 0) {
this->unk_258 = player->unk_845;
}
@@ -527,13 +556,13 @@ void EnDh_Update(Actor* thisx, PlayState* play) {
if (((this->curAction != DH_DAMAGE) && (this->actor.shape.yOffset == 0.0f)) ||
((player->unk_844 != 0) && (player->unk_845 != this->unk_258))) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider2.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base);
}
} else {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider2.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
}
@@ -545,7 +574,7 @@ void EnDh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
Matrix_MultVec3f(&headOffset, &this->headPos);
Matrix_Push();
Matrix_Translate(headOffset.x, headOffset.y, headOffset.z, MTXMODE_APPLY);
- Collider_UpdateSpheres(1, &this->collider2);
+ Collider_UpdateSpheres(1, &this->colliderJntSph);
Matrix_Pop();
}
}
diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.h b/src/overlays/actors/ovl_En_Dh/z_en_dh.h
index 21872aafce..0feb3069b5 100644
--- a/src/overlays/actors/ovl_En_Dh/z_en_dh.h
+++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.h
@@ -2,11 +2,11 @@
#define Z_EN_DH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDh;
-typedef void (*EnDhActionFunc)(struct EnDh*, PlayState*);
+typedef void (*EnDhActionFunc)(struct EnDh*, struct PlayState*);
typedef struct EnDh {
/* 0x0000 */ Actor actor;
@@ -24,8 +24,8 @@ typedef struct EnDh {
/* 0x025C */ s16 timer;
/* 0x025E */ s16 dirtWavePhase;
/* 0x0260 */ ColliderCylinder collider1;
- /* 0x02AC */ ColliderJntSph collider2;
- /* 0x02CC */ ColliderJntSphElement elements[1];
+ /* 0x02AC */ ColliderJntSph colliderJntSph;
+ /* 0x02CC */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x030C */ Vec3f headPos;
/* 0x0318 */ f32 dirtWaveSpread;
/* 0x031C */ f32 dirtWaveHeight;
diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c
index 8ecca0200a..5754d8ae1e 100644
--- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c
+++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c
@@ -5,8 +5,21 @@
*/
#include "z_en_dha.h"
-#include "versions.h"
#include "overlays/actors/ovl_En_Dh/z_en_dh.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_dh/object_dh.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -166,7 +179,7 @@ void EnDha_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.health = 8;
this->limbAngleX[0] = -0x4000;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItem);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
EnDha_SetupWait(this);
diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.h b/src/overlays/actors/ovl_En_Dha/z_en_dha.h
index 2ef37c54c9..f7cbd78d7b 100644
--- a/src/overlays/actors/ovl_En_Dha/z_en_dha.h
+++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.h
@@ -2,11 +2,11 @@
#define Z_EN_DHA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDha;
-typedef void (*EnDhaActionFunc)(struct EnDha*, PlayState*);
+typedef void (*EnDhaActionFunc)(struct EnDha*, struct PlayState*);
typedef struct EnDha {
/* 0x0000 */ Actor actor;
@@ -24,7 +24,7 @@ typedef struct EnDha {
/* 0x01DC */ Vec3f handPos[2];
/* 0x01F4 */ Vec3f armPos;
/* 0x0200 */ ColliderJntSph collider;
- /* 0x0220 */ ColliderJntSphElement colliderItem[5];
+ /* 0x0220 */ ColliderJntSphElement colliderElements[5];
} EnDha; // size = 0x0360
#endif
diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c
index 504b26eaa9..a946c33bf2 100644
--- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c
+++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c
@@ -6,8 +6,26 @@
#include "z_en_diving_game.h"
#include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h"
-#include "assets/objects/object_zo/object_zo.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_zo/object_zo.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h
index c873e075e3..ccc211dc8b 100644
--- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h
+++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h
@@ -2,11 +2,11 @@
#define Z_EN_DIVING_GAME_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDivingGame;
-typedef void (*EnDivingGameActionFunc)(struct EnDivingGame*, PlayState*);
+typedef void (*EnDivingGameActionFunc)(struct EnDivingGame*, struct PlayState*);
typedef struct EnDivingGame {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c
index 5aa697f494..c690638570 100644
--- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c
+++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c
@@ -5,7 +5,21 @@
*/
#include "z_en_dns.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_shopnuts/object_shopnuts.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h
index d86e96eb43..3a91a5362a 100644
--- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h
+++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h
@@ -2,7 +2,7 @@
#define Z_EN_DNS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#include "assets/objects/object_shopnuts/object_shopnuts.h"
#define DNS_GET_TYPE(thisx) ((thisx)->params)
@@ -37,7 +37,7 @@ typedef enum EnDnsAnimation {
struct EnDns;
-typedef void (*EnDnsActionFunc)(struct EnDns*, PlayState*);
+typedef void (*EnDnsActionFunc)(struct EnDns*, struct PlayState*);
typedef u32 (*EnDnsCanBuyFunc)(struct EnDns*);
typedef void (*EnDnsPaymentFunc)(struct EnDns*);
diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c
index ad1eb7e58f..f0b940a744 100644
--- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c
+++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c
@@ -5,10 +5,24 @@
*/
#include "z_en_dnt_demo.h"
-
#include "overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h"
#include "overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h"
+
+#include "attributes.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64debug_display.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h
index 607810629c..29c302aed2 100644
--- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h
+++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h
@@ -2,11 +2,11 @@
#define Z_EN_DNT_DEMO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDntDemo;
-typedef void (*EnDntDemoActionFunc)(struct EnDntDemo*, PlayState*);
+typedef void (*EnDntDemoActionFunc)(struct EnDntDemo*, struct PlayState*);
typedef struct EnDntDemo {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c
index 9f88469f2b..442c0a3569 100644
--- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c
+++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c
@@ -5,10 +5,29 @@
*/
#include "z_en_dnt_jiji.h"
-#include "assets/objects/object_dns/object_dns.h"
#include "overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_dns/object_dns.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h
index 20199a7c2e..540a8951a3 100644
--- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h
+++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h
@@ -2,11 +2,11 @@
#define Z_EN_DNT_JIJI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDntJiji;
-typedef void (*EnDntJijiActionFunc)(struct EnDntJiji*, PlayState*);
+typedef void (*EnDntJijiActionFunc)(struct EnDntJiji*, struct PlayState*);
typedef struct EnDntJiji {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c
index b1631fe434..f5d3f0b9dd 100644
--- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c
+++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c
@@ -5,14 +5,31 @@
*/
#include "z_en_dnt_nomal.h"
-#include "assets/objects/object_dnk/object_dnk.h"
#include "overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h"
#include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h"
#include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
-#include "assets/objects/object_hintnuts/object_hintnuts.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_dnk/object_dnk.h"
+#include "assets/objects/object_hintnuts/object_hintnuts.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -134,16 +151,16 @@ void EnDntNomal_Init(Actor* thisx, PlayState* play) {
PRINTF("\n\n");
// "Deku Scrub target"
PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ デグナッツ的当て ☆☆☆☆☆ \n" VT_RST);
- Collider_InitQuad(play, &this->targetQuad);
- Collider_SetQuad(play, &this->targetQuad, &this->actor, &sTargetQuadInit);
+ Collider_InitQuad(play, &this->targetColliderQuad);
+ Collider_SetQuad(play, &this->targetColliderQuad, &this->actor, &sTargetQuadInit);
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->objectId = OBJECT_HINTNUTS;
} else {
PRINTF("\n\n");
// "Deku Scrub mask show audience"
PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ デグナッツお面品評会一般人 ☆☆☆☆☆ \n" VT_RST);
- Collider_InitCylinder(play, &this->bodyCyl);
- Collider_SetCylinder(play, &this->bodyCyl, &this->actor, &sBodyCylinderInit);
+ Collider_InitCylinder(play, &this->bodyColliderCylinder);
+ Collider_SetCylinder(play, &this->bodyColliderCylinder, &this->actor, &sBodyCylinderInit);
this->objectId = OBJECT_DNK;
}
if (this->objectId >= 0) {
@@ -167,22 +184,23 @@ void EnDntNomal_Destroy(Actor* thisx, PlayState* play) {
EnDntNomal* this = (EnDntNomal*)thisx;
if (this->type == ENDNTNOMAL_TARGET) {
- Collider_DestroyQuad(play, &this->targetQuad);
+ Collider_DestroyQuad(play, &this->targetColliderQuad);
} else {
- Collider_DestroyCylinder(play, &this->bodyCyl);
+ Collider_DestroyCylinder(play, &this->bodyColliderCylinder);
}
}
void EnDntNomal_WaitForObject(EnDntNomal* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
this->actor.objectSlot = this->requiredObjectSlot;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
this->actor.gravity = -2.0f;
Actor_SetScale(&this->actor, 0.01f);
if (this->type == ENDNTNOMAL_TARGET) {
- SkelAnime_Init(play, &this->skelAnime, &gHintNutsSkel, &gHintNutsBurrowAnim, this->jointTable,
- this->morphTable, 10);
+ //! @bug Flex skeleton is used as normal skeleton
+ SkelAnime_Init(play, &this->skelAnime, (SkeletonHeader*)&gHintNutsSkel, &gHintNutsBurrowAnim,
+ this->jointTable, this->morphTable, 10);
this->actor.draw = EnDntNomal_DrawTargetScrub;
} else {
SkelAnime_Init(play, &this->skelAnime, &gDntStageSkel, &gDntStageHideAnim, this->jointTable,
@@ -241,16 +259,16 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
#if OOT_VERSION < PAL_1_0
- if (this->targetQuad.base.acFlags & AC_HIT)
+ if (this->targetColliderQuad.base.acFlags & AC_HIT)
#else
- if ((this->targetQuad.base.acFlags & AC_HIT) || BREG(0))
+ if ((this->targetColliderQuad.base.acFlags & AC_HIT) || BREG(0))
#endif
{
- this->targetQuad.base.acFlags &= ~AC_HIT;
+ this->targetColliderQuad.base.acFlags &= ~AC_HIT;
- dx = fabsf(targetX - this->targetQuad.elem.acDmgInfo.hitPos.x);
- dy = fabsf(targetY - this->targetQuad.elem.acDmgInfo.hitPos.y);
- dz = fabsf(targetZ - this->targetQuad.elem.acDmgInfo.hitPos.z);
+ dx = fabsf(targetX - this->targetColliderQuad.elem.acDmgInfo.hitPos.x);
+ dy = fabsf(targetY - this->targetColliderQuad.elem.acDmgInfo.hitPos.y);
+ dz = fabsf(targetZ - this->targetColliderQuad.elem.acDmgInfo.hitPos.z);
scoreVel.y = 5.0f;
@@ -839,13 +857,13 @@ void EnDntNomal_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
UPDBGCHECKINFO_FLAG_4);
if (this->type == ENDNTNOMAL_TARGET) {
- Collider_SetQuadVertices(&this->targetQuad, &this->targetVtx[0], &this->targetVtx[1], &this->targetVtx[2],
- &this->targetVtx[3]);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->targetQuad.base);
+ Collider_SetQuadVertices(&this->targetColliderQuad, &this->targetVtx[0], &this->targetVtx[1],
+ &this->targetVtx[2], &this->targetVtx[3]);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->targetColliderQuad.base);
} else {
- Collider_UpdateCylinder(&this->actor, &this->bodyCyl);
+ Collider_UpdateCylinder(&this->actor, &this->bodyColliderCylinder);
if (this->isSolid) {
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCyl.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyColliderCylinder.base);
}
}
}
diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h
index 13974bb1b1..21f77798a0 100644
--- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h
+++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h
@@ -2,11 +2,11 @@
#define Z_EN_DNT_NOMAL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDntNomal;
-typedef void (*EnDntNomalActionFunc)(struct EnDntNomal*, PlayState*);
+typedef void (*EnDntNomalActionFunc)(struct EnDntNomal*, struct PlayState*);
typedef struct EnDntNomal {
/* 0x0000 */ Actor actor;
@@ -38,8 +38,8 @@ typedef struct EnDntNomal {
/* 0x0279 */ s8 requiredObjectSlot;
/* 0x027C */ Vec3f mouthPos;
/* 0x0288 */ Vec3f targetPos;
- /* 0x0294 */ ColliderQuad targetQuad;
- /* 0x0314 */ ColliderCylinder bodyCyl;
+ /* 0x0294 */ ColliderQuad targetColliderQuad;
+ /* 0x0314 */ ColliderCylinder bodyColliderCylinder;
} EnDntNomal; // size = 0x0360
#define ENDNTNOMAL_TARGET 0
diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c
index 5438c03f4b..1d967ed5fa 100644
--- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c
+++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c
@@ -6,6 +6,18 @@
#include "z_en_dodojr.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_dodojr/object_dodojr.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h
index bef171c584..615304cb01 100644
--- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h
+++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h
@@ -2,11 +2,11 @@
#define Z_EN_DODOJR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDodojr;
-typedef void (*EnDodojrActionFunc)(struct EnDodojr*, PlayState*);
+typedef void (*EnDodojrActionFunc)(struct EnDodojr*, struct PlayState*);
typedef struct EnDodojr {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
index 5cd7fec6c5..5d013911eb 100644
--- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
+++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
@@ -1,6 +1,21 @@
#include "z_en_dodongo.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_En_Bombf/z_en_bombf.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_dodongo/object_dodongo.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -322,10 +337,10 @@ void EnDodongo_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.damageTable = &sDamageTable;
Collider_InitQuad(play, &this->colliderAT);
Collider_InitTris(play, &this->colliderHard);
- Collider_InitJntSph(play, &this->colliderBody);
+ Collider_InitJntSph(play, &this->bodyCollider);
Collider_SetQuad(play, &this->colliderAT, &this->actor, &sAttackQuadInit);
Collider_SetTris(play, &this->colliderHard, &this->actor, &sHardTrisInit, this->trisElements);
- Collider_SetJntSph(play, &this->colliderBody, &this->actor, &sBodyJntSphInit, this->sphElements);
+ Collider_SetJntSph(play, &this->bodyCollider, &this->actor, &sBodyJntSphInit, this->bodyColliderElements);
blureInit.p1StartColor[0] = blureInit.p1StartColor[1] = blureInit.p1StartColor[2] = blureInit.p1StartColor[3] =
blureInit.p2StartColor[0] = blureInit.p2StartColor[1] = blureInit.p2StartColor[2] = blureInit.p1EndColor[0] =
@@ -351,7 +366,7 @@ void EnDodongo_Destroy(Actor* thisx, PlayState* play) {
Effect_Delete(play, this->blureIdx);
Collider_DestroyTris(play, &this->colliderHard);
- Collider_DestroyJntSph(play, &this->colliderBody);
+ Collider_DestroyJntSph(play, &this->bodyCollider);
Collider_DestroyQuad(play, &this->colliderAT);
}
@@ -490,9 +505,9 @@ void EnDodongo_SwallowBomb(EnDodongo* this, PlayState* play) {
deathFireAccel.x = deathFireVel.x * -0.1f;
deathFireAccel.y = deathFireVel.y * -0.1f;
deathFireAccel.z = deathFireVel.z * -0.1f;
- pos.x = this->sphElements[0].dim.worldSphere.center.x + deathFireVel.x;
- pos.y = this->sphElements[0].dim.worldSphere.center.y + deathFireVel.y;
- pos.z = this->sphElements[0].dim.worldSphere.center.z + deathFireVel.z;
+ pos.x = this->bodyColliderElements[0].dim.worldSphere.center.x + deathFireVel.x;
+ pos.y = this->bodyColliderElements[0].dim.worldSphere.center.y + deathFireVel.y;
+ pos.z = this->bodyColliderElements[0].dim.worldSphere.center.z + deathFireVel.z;
func_8002836C(play, &pos, &deathFireVel, &deathFireAccel, &this->bombSmokePrimColor,
&this->bombSmokeEnvColor, 400, 10, 10);
}
@@ -605,13 +620,13 @@ void EnDodongo_SweepTail(EnDodongo* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) {
if ((this->timer != 0) || (ABS(yawDiff1) < 0x4000)) {
- this->sphElements[2].base.atElemFlags = ATELEM_NONE;
- this->sphElements[1].base.atElemFlags = ATELEM_NONE;
- this->colliderBody.base.atFlags = AT_NONE;
- this->sphElements[2].base.atDmgInfo.dmgFlags = 0;
- this->sphElements[1].base.atDmgInfo.dmgFlags = 0;
- this->sphElements[2].base.atDmgInfo.damage = 0;
- this->sphElements[1].base.atDmgInfo.damage = 0;
+ this->bodyColliderElements[2].base.atElemFlags = ATELEM_NONE;
+ this->bodyColliderElements[1].base.atElemFlags = ATELEM_NONE;
+ this->bodyCollider.base.atFlags = AT_NONE;
+ this->bodyColliderElements[2].base.atDmgInfo.dmgFlags = 0;
+ this->bodyColliderElements[1].base.atDmgInfo.dmgFlags = 0;
+ this->bodyColliderElements[2].base.atDmgInfo.damage = 0;
+ this->bodyColliderElements[1].base.atDmgInfo.damage = 0;
EnDodongo_SetupBreatheFire(this);
this->timer = Rand_S16Offset(5, 10);
} else {
@@ -628,33 +643,36 @@ void EnDodongo_SweepTail(EnDodongo* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_TAIL);
Animation_PlayOnceSetSpeed(&this->skelAnime, animation, 2.0f);
this->timer = 18;
- this->colliderBody.base.atFlags = this->sphElements[1].base.atElemFlags =
- this->sphElements[2].base.atElemFlags = AT_ON | AT_TYPE_ENEMY; // also ATELEM_ON | ATELEM_SFX_WOOD
- this->sphElements[1].base.atDmgInfo.dmgFlags = this->sphElements[2].base.atDmgInfo.dmgFlags = DMG_DEFAULT;
- this->sphElements[1].base.atDmgInfo.damage = this->sphElements[2].base.atDmgInfo.damage = 8;
+ this->bodyCollider.base.atFlags = this->bodyColliderElements[1].base.atElemFlags =
+ this->bodyColliderElements[2].base.atElemFlags =
+ AT_ON | AT_TYPE_ENEMY; // also ATELEM_ON | ATELEM_SFX_WOOD
+ this->bodyColliderElements[1].base.atDmgInfo.dmgFlags =
+ this->bodyColliderElements[2].base.atDmgInfo.dmgFlags = DMG_DEFAULT;
+ this->bodyColliderElements[1].base.atDmgInfo.damage = this->bodyColliderElements[2].base.atDmgInfo.damage =
+ 8;
}
} else if (this->timer > 1) {
Vec3f tailPos;
this->timer--;
this->actor.shape.rot.y = this->actor.world.rot.y += this->tailSwipeSpeed;
- tailPos.x = this->sphElements[1].dim.worldSphere.center.x;
- tailPos.y = this->sphElements[1].dim.worldSphere.center.y;
- tailPos.z = this->sphElements[1].dim.worldSphere.center.z;
+ tailPos.x = this->bodyColliderElements[1].dim.worldSphere.center.x;
+ tailPos.y = this->bodyColliderElements[1].dim.worldSphere.center.y;
+ tailPos.z = this->bodyColliderElements[1].dim.worldSphere.center.z;
Actor_SpawnFloorDustRing(play, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, false);
- tailPos.x = this->sphElements[2].dim.worldSphere.center.x;
- tailPos.y = this->sphElements[2].dim.worldSphere.center.y;
- tailPos.z = this->sphElements[2].dim.worldSphere.center.z;
+ tailPos.x = this->bodyColliderElements[2].dim.worldSphere.center.x;
+ tailPos.y = this->bodyColliderElements[2].dim.worldSphere.center.y;
+ tailPos.z = this->bodyColliderElements[2].dim.worldSphere.center.z;
Actor_SpawnFloorDustRing(play, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, false);
- if (this->colliderBody.base.atFlags & AT_HIT) {
+ if (this->bodyCollider.base.atFlags & AT_HIT) {
Player* player = GET_PLAYER(play);
- if (this->colliderBody.base.at == &player->actor) {
+ if (this->bodyCollider.base.at == &player->actor) {
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
}
}
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->bodyCollider.base);
}
}
@@ -711,10 +729,10 @@ void EnDodongo_Stunned(EnDodongo* this, PlayState* play) {
void EnDodongo_CollisionCheck(EnDodongo* this, PlayState* play) {
if (this->colliderHard.base.acFlags & AC_BOUNCED) {
this->colliderHard.base.acFlags &= ~AC_BOUNCED;
- this->colliderBody.base.acFlags &= ~AC_HIT;
- } else if ((this->colliderBody.base.acFlags & AC_HIT) && (this->actionState > DODONGO_DEATH)) {
- this->colliderBody.base.acFlags &= ~AC_HIT;
- Actor_SetDropFlagJntSph(&this->actor, &this->colliderBody, false);
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
+ } else if ((this->bodyCollider.base.acFlags & AC_HIT) && (this->actionState > DODONGO_DEATH)) {
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
+ Actor_SetDropFlagJntSph(&this->actor, &this->bodyCollider, false);
if (this->actor.colChkInfo.damageEffect != 0xE) {
this->damageEffect = this->actor.colChkInfo.damageEffect;
if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 0xF)) {
@@ -775,12 +793,12 @@ void EnDodongo_Update(Actor* thisx, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_DOWN);
}
}
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base);
if (this->actionState != DODONGO_DEATH) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderHard.base);
}
if (this->actionState > DODONGO_DEATH) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderBody.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
}
if ((this->actionState >= DODONGO_IDLE) && EnDodongo_AteBomb(this, play)) {
EnDodongo_SetupSwallowBomb(this);
@@ -837,7 +855,7 @@ void EnDodongo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
Vec3f mouthOffset = { 1800.0f, 1200.0f, 0.0f };
Vec3f headOffset = { 1500.0f, 300.0f, 0.0f };
- Collider_UpdateSpheres(limbIndex, &this->colliderBody);
+ Collider_UpdateSpheres(limbIndex, &this->bodyCollider);
switch (limbIndex) {
case 2:
diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h
index 664b175799..7785030d49 100644
--- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h
+++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h
@@ -2,11 +2,11 @@
#define Z_EN_DODONGO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDodongo;
-typedef void (*EnDodongoActionFunc)(struct EnDodongo*, PlayState*);
+typedef void (*EnDodongoActionFunc)(struct EnDodongo*, struct PlayState*);
typedef struct EnDodongo {
/* 0x0000 */ Actor actor;
@@ -35,8 +35,8 @@ typedef struct EnDodongo {
/* 0x03D4 */ ColliderQuad colliderAT;
/* 0x0454 */ ColliderTris colliderHard;
/* 0x0474 */ ColliderTrisElement trisElements[3];
- /* 0x0588 */ ColliderJntSph colliderBody;
- /* 0x05A8 */ ColliderJntSphElement sphElements[6];
+ /* 0x0588 */ ColliderJntSph bodyCollider;
+ /* 0x05A8 */ ColliderJntSphElement bodyColliderElements[6];
} EnDodongo; // size = 0x0728
typedef enum EnDodongoParam {
diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c
index 49b8c83ba3..0255b01626 100644
--- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c
+++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c
@@ -5,6 +5,14 @@
*/
#include "z_en_dog.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_dog/object_dog.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.h b/src/overlays/actors/ovl_En_Dog/z_en_dog.h
index dec2b5c180..c3cdfd913b 100644
--- a/src/overlays/actors/ovl_En_Dog/z_en_dog.h
+++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.h
@@ -2,18 +2,18 @@
#define Z_EN_DOG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDog;
-typedef void (*EnDogActionFunc)(struct EnDog*, PlayState*);
+typedef void (*EnDogActionFunc)(struct EnDog*, struct PlayState*);
typedef struct EnDog {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnDogActionFunc actionFunc;
/* 0x0194 */ ColliderCylinder collider;
- /* 0x01E0 */ Path* path;
+ /* 0x01E0 */ struct Path* path;
/* 0x01E4 */ u8 reverse;
/* 0x01E6 */ s16 waypoint;
/* 0x01E8 */ s16 unusedAngle;
diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c
index 4d650f0a1b..9f5bd8723e 100644
--- a/src/overlays/actors/ovl_En_Door/z_en_door.c
+++ b/src/overlays/actors/ovl_En_Door/z_en_door.c
@@ -5,7 +5,19 @@
*/
#include "z_en_door.h"
-#include "global.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#include "assets/objects/object_hidan_objects/object_hidan_objects.h"
diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c
index c76713a756..3c879ee1ac 100644
--- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c
+++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c
@@ -5,6 +5,16 @@
*/
#include "z_en_ds.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ds/object_ds.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.h b/src/overlays/actors/ovl_En_Ds/z_en_ds.h
index 8f10ce8285..9c7df969c6 100644
--- a/src/overlays/actors/ovl_En_Ds/z_en_ds.h
+++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.h
@@ -2,11 +2,11 @@
#define Z_EN_DS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDs;
-typedef void (*EnDsActionFunc)(struct EnDs*, PlayState*);
+typedef void (*EnDsActionFunc)(struct EnDs*, struct PlayState*);
typedef struct EnDs {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c
index f77bec5a85..1f716b977d 100644
--- a/src/overlays/actors/ovl_En_Du/z_en_du.c
+++ b/src/overlays/actors/ovl_En_Du/z_en_du.c
@@ -1,4 +1,19 @@
#include "z_en_du.h"
+
+#include "gfx.h"
+#include "one_point_cutscene.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_du/object_du.h"
#include "assets/scenes/overworld/spot18/spot18_scene.h"
diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.h b/src/overlays/actors/ovl_En_Du/z_en_du.h
index 541b4368e8..9e3ecb8805 100644
--- a/src/overlays/actors/ovl_En_Du/z_en_du.h
+++ b/src/overlays/actors/ovl_En_Du/z_en_du.h
@@ -2,11 +2,11 @@
#define Z_EN_DU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnDu;
-typedef void (*EnDuActionFunc)(struct EnDu*, PlayState*);
+typedef void (*EnDuActionFunc)(struct EnDu*, struct PlayState*);
typedef struct EnDu {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c
index 59a8b41ec6..d65d703e68 100644
--- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c
+++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c
@@ -8,6 +8,7 @@
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "printf.h"
#include "segmented_address.h"
#include "sfx.h"
#include "sys_matrix.h"
diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c
index c646cdf249..b4da54551d 100644
--- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c
+++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c
@@ -5,7 +5,17 @@
*/
#include "z_en_eg.h"
+
+#include "printf.h"
+#include "regs.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -65,8 +75,8 @@ void EnEg_Update(Actor* thisx, PlayState* play) {
s32 action = this->action;
if (((action < 0) || (0 < action)) || (sActionFuncs[action] == NULL)) {
- // "Main Mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
sActionFuncs[action](this, play);
}
diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.h b/src/overlays/actors/ovl_En_Eg/z_en_eg.h
index ad02d8a6b7..c42994f61c 100644
--- a/src/overlays/actors/ovl_En_Eg/z_en_eg.h
+++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.h
@@ -2,11 +2,11 @@
#define Z_EN_EG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnEg;
-typedef void (*EnEgActionFunc)(struct EnEg*, PlayState*);
+typedef void (*EnEgActionFunc)(struct EnEg*, struct PlayState*);
typedef struct EnEg {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c
index 554512b148..d60d91c222 100644
--- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c
+++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c
@@ -1,4 +1,16 @@
#include "z_en_eiyer.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_ei/object_ei.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h
index 7f756596aa..7626924496 100644
--- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h
+++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h
@@ -2,11 +2,11 @@
#define Z_EN_EIYER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnEiyer;
-typedef void (*EnEiyerActionFunc)(struct EnEiyer*, PlayState*);
+typedef void (*EnEiyerActionFunc)(struct EnEiyer*, struct PlayState*);
typedef struct EnEiyer {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c
index cd3658756e..58cd30f3ff 100644
--- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c
+++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c
@@ -5,7 +5,28 @@
*/
#include "z_en_elf.h"
-#include "global.h"
+#include "overlays/actors/ovl_Elf_Msg/z_elf_msg.h"
+
+#include "libc64/qrand.h"
+#include "libu64/debug.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64quest_hint.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.h b/src/overlays/actors/ovl_En_Elf/z_en_elf.h
index 2190065f71..60e9940d75 100644
--- a/src/overlays/actors/ovl_En_Elf/z_en_elf.h
+++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.h
@@ -4,7 +4,6 @@
#include "ultra64.h"
#include "z64actor.h"
#include "z64light.h"
-#include "overlays/actors/ovl_Elf_Msg/z_elf_msg.h"
struct EnElf;
@@ -23,7 +22,7 @@ typedef struct EnElf {
/* 0x0278 */ LightInfo lightInfoNoGlow;
/* 0x0288 */ LightNode* lightNodeNoGlow;
/* 0x028C */ Vec3f unk_28C;
- /* 0x0298 */ ElfMsg* elfMsg;
+ /* 0x0298 */ struct ElfMsg* elfMsg;
/* 0x029C */ f32 unk_29C;
/* 0x02A0 */ f32 unk_2A0;
/* 0x02A4 */ f32 unk_2A4;
diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
index e513de558e..92374ad12a 100644
--- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
+++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
@@ -1,6 +1,17 @@
#include "z_en_encount1.h"
-#include "terminal.h"
#include "overlays/actors/ovl_En_Tite/z_en_tite.h"
+#include "overlays/actors/ovl_En_Reeba/z_en_reeba.h"
+
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_LOCK_ON_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h
index 2dc033f98c..b9c8c1d882 100644
--- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h
+++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h
@@ -2,14 +2,13 @@
#define Z_EN_ENCOUNT1_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_En_Reeba/z_en_reeba.h"
+#include "z64actor.h"
#define SPAWNER_PARAMS(type, number, total) ((type << 0xB) | (number << 0x6) | total)
struct EnEncount1;
-typedef void (*EnEncount1UpdateFunc)(struct EnEncount1*, PlayState*);
+typedef void (*EnEncount1UpdateFunc)(struct EnEncount1*, struct PlayState*);
typedef struct EnEncount1 {
/* 0x0000 */ Actor actor;
@@ -27,7 +26,7 @@ typedef struct EnEncount1 {
/* 0x0164 */ s16 timer;
/* 0x0166 */ u8 reduceLeevers;
/* 0x0168 */ f32 spawnRange;
- /* 0x016C */ EnReeba* bigLeever;
+ /* 0x016C */ struct EnReeba* bigLeever;
} EnEncount1; // size = 0x0170
typedef enum EnEncount1type {
diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c
index 6ff21c428c..847f5d34a1 100644
--- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c
+++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c
@@ -4,6 +4,7 @@
#include "libc64/qrand.h"
#include "attributes.h"
#include "gfx.h"
+#include "printf.h"
#include "quake.h"
#include "rand.h"
#include "sfx.h"
@@ -12,6 +13,7 @@
#include "z_lib.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/object_efc_star_field/object_efc_star_field.h"
diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c
index 40f0b99eb8..cbbb4fa0ee 100644
--- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c
+++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c
@@ -10,6 +10,7 @@
#include "attributes.h"
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "printf.h"
#include "segmented_address.h"
#include "sfx.h"
#include "sys_matrix.h"
@@ -18,6 +19,7 @@
#include "z64draw.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c
index 55f97c3686..8cd6e5c4a1 100644
--- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c
+++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c
@@ -1,6 +1,21 @@
#include "z_en_ex_ruppy.h"
+#include "overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
-#include "../ovl_En_Diving_Game/z_en_diving_game.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h
index 33dcca4447..7ba20450e8 100644
--- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h
+++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h
@@ -2,11 +2,11 @@
#define Z_EN_EX_RUPPY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnExRuppy;
-typedef void (*EnExRuppyActionFunc)(struct EnExRuppy*, PlayState*);
+typedef void (*EnExRuppyActionFunc)(struct EnExRuppy*, struct PlayState*);
typedef struct EnExRuppy {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c
index 785b4937aa..475c476bb5 100644
--- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c
+++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c
@@ -5,7 +5,21 @@
*/
#include "z_en_fd.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_fw/object_fw.h"
@@ -230,7 +244,7 @@ s32 EnFd_SpawnCore(EnFd* this, PlayState* play) {
this->actor.child->colChkInfo.health = 8;
}
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
Actor_SwapHookshotAttachment(play, &this->actor, this->actor.child);
}
@@ -460,7 +474,7 @@ void EnFd_Init(Actor* thisx, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gFlareDancerSkel, NULL, this->jointTable, this->morphTable, 27);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 32.0f);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colSphs);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
@@ -670,7 +684,7 @@ void EnFd_Update(Actor* thisx, PlayState* play) {
EnFd_SpawnDot(this, play);
}
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
if (EnFd_SpawnCore(this, play)) {
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->invincibilityTimer = 30;
diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.h b/src/overlays/actors/ovl_En_Fd/z_en_fd.h
index 3559410526..3fc40a54cf 100644
--- a/src/overlays/actors/ovl_En_Fd/z_en_fd.h
+++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.h
@@ -2,11 +2,11 @@
#define Z_EN_FD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnFd;
-typedef void (*EnFdActionFunc)(struct EnFd* this, PlayState* play);
+typedef void (*EnFdActionFunc)(struct EnFd* this, struct PlayState* play);
typedef enum FDEffectType {
FD_EFFECT_NONE,
@@ -34,7 +34,7 @@ typedef struct EnFd {
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnFdActionFunc actionFunc;
/* 0x0194 */ ColliderJntSph collider;
- /* 0x01B4 */ ColliderJntSphElement colSphs[12];
+ /* 0x01B4 */ ColliderJntSphElement colliderElements[12];
/* 0x04B4 */ u8 coreActive;
/* 0x04B6 */ s16 initYawToInitPos;
/* 0x04B8 */ s16 curYawToInitPos;
diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c
index d408b7b9ac..b124094a2c 100644
--- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c
+++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c
@@ -1,4 +1,14 @@
#include "z_en_fd_fire.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h
index 414fdf997a..d027a07972 100644
--- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h
+++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h
@@ -2,11 +2,11 @@
#define Z_EN_FD_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnFdFire;
-typedef void (*EnFdFireActionFunc)(struct EnFdFire* this, PlayState* play);
+typedef void (*EnFdFireActionFunc)(struct EnFdFire* this, struct PlayState* play);
typedef struct EnFdFire {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c
index aa3f190cee..2fdf9525d7 100644
--- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c
+++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c
@@ -5,12 +5,29 @@
*/
#include "z_en_fhg_fire.h"
-#include "assets/objects/object_fhg/object_fhg.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h"
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
#include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h"
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_fhg/object_fhg.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
typedef enum StrikeMode {
diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h
index ac2682aaf1..59136f7dfd 100644
--- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h
+++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h
@@ -2,11 +2,12 @@
#define Z_EN_FHG_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnFhgFire;
-typedef void (*EnFhgFireUpdateFunc)(struct EnFhgFire*, PlayState*);
+typedef void (*EnFhgFireUpdateFunc)(struct EnFhgFire*, struct PlayState*);
typedef enum FhgFireParam {
/* 1 */ FHGFIRE_LIGHTNING_STRIKE = 1,
diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c
index e4d6d3e049..60f7198875 100644
--- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c
+++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c
@@ -4,18 +4,18 @@
#include "attributes.h"
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "printf.h"
#include "rand.h"
#include "regs.h"
#include "sfx.h"
#include "sys_matrix.h"
#include "terminal.h"
#include "z_lib.h"
+#include "z64debug_display.h"
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
-#include "global.h"
-
#include "assets/objects/object_efc_star_field/object_efc_star_field.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c
index 6a72e29224..e674ee9bf5 100644
--- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c
+++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c
@@ -5,10 +5,24 @@
*/
#include "z_en_firefly.h"
-#include "versions.h"
-#include "assets/objects/object_firefly/object_firefly.h"
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_firefly/object_firefly.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_CAN_ATTACH_TO_ARROW)
@@ -145,7 +159,7 @@ void EnFirefly_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
SkelAnime_Init(play, &this->skelAnime, &gKeeseSkeleton, &gKeeseFlyAnim, this->jointTable, this->morphTable, 28);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1) != 0) {
diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h
index 165cc5c26e..7638036a82 100644
--- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h
+++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h
@@ -2,11 +2,11 @@
#define Z_EN_FIREFLY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnFirefly;
-typedef void (*EnFireflyActionFunc)(struct EnFirefly*, PlayState*);
+typedef void (*EnFireflyActionFunc)(struct EnFirefly*, struct PlayState*);
typedef struct EnFirefly {
/* 0x0000 */ Actor actor;
@@ -21,7 +21,7 @@ typedef struct EnFirefly {
/* 0x0266 */ Vec3s morphTable[28];
/* 0x0310 */ f32 maxAltitude;
/* 0x0314 */ ColliderJntSph collider;
- /* 0x0344 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0344 */ ColliderJntSphElement colliderElements[1];
} EnFirefly; // size = 0x0374
typedef enum KeeseType {
diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c
index 8ef16187f3..9de3dbe4f8 100644
--- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c
+++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c
@@ -5,9 +5,20 @@
*/
#include "z_en_fish.h"
-#include "global.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64item.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS 0
@@ -135,7 +146,7 @@ void EnFish_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitFlex(play, &this->skelAnime, &gFishSkel, &gFishInWaterAnim, this->jointTable, this->morphTable, 7);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->actor.colChkInfo.mass = 50;
this->slowPhase = Rand_ZeroOne() * (0xFFFF + 0.5f);
this->fastPhase = Rand_ZeroOne() * (0xFFFF + 0.5f);
diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.h b/src/overlays/actors/ovl_En_Fish/z_en_fish.h
index 01cdbd0b36..d75de5b0a5 100644
--- a/src/overlays/actors/ovl_En_Fish/z_en_fish.h
+++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.h
@@ -11,7 +11,7 @@ typedef void (*EnFishActionFunc)(struct EnFish*, struct PlayState*);
typedef struct EnFish {
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderJntSph collider;
- /* 0x016C */ ColliderJntSphElement colliderItems[1];
+ /* 0x016C */ ColliderJntSphElement colliderElements[1];
/* 0x01AC */ SkelAnime skelAnime;
/* 0x01F0 */ Vec3s jointTable[7];
/* 0x021A */ Vec3s morphTable[7];
diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c
index 035a825073..a9d9036e9f 100644
--- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c
+++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c
@@ -5,6 +5,19 @@
*/
#include "z_en_floormas.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_wallmaster/object_wallmaster.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER)
@@ -280,7 +293,7 @@ void EnFloormas_SetupLand(EnFloormas* this) {
void EnFloormas_SetupSplit(EnFloormas* this) {
Actor_SetScale(&this->actor, 0.004f);
this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
this->actor.draw = EnFloormas_DrawHighlighted;
} else {
this->actor.draw = EnFloormas_Draw;
diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h
index 4c30b8773b..4aefd1ad97 100644
--- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h
+++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h
@@ -2,11 +2,11 @@
#define Z_EN_FLOORMAS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef struct EnFloormas EnFloormas;
-typedef void (*EnFloormasActionFunc)(EnFloormas* this, PlayState* play);
+typedef void (*EnFloormasActionFunc)(EnFloormas* this, struct PlayState* play);
struct EnFloormas{
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c
index ee133164c2..2d741172b2 100644
--- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c
+++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c
@@ -1,6 +1,29 @@
#include "z_en_fr.h"
-#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
+
+#include "array_count.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64debug_display.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#include "assets/objects/object_fr/object_fr.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/src/overlays/actors/ovl_En_Fr/z_en_fr.h
index 95a365dd9b..2bed02b4a0 100644
--- a/src/overlays/actors/ovl_En_Fr/z_en_fr.h
+++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.h
@@ -2,11 +2,12 @@
#define Z_EN_FR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnFr;
-typedef void (*EnFrActionFunc)(struct EnFr*, PlayState*);
+typedef void (*EnFrActionFunc)(struct EnFr*, struct PlayState*);
typedef void (*EnFrBlinkFunc)(struct EnFr*);
typedef enum FrogType {
diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c
index 8069e6cb26..24818477d7 100644
--- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c
+++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c
@@ -5,6 +5,19 @@
*/
#include "z_en_fu.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_fu/object_fu.h"
#include "assets/scenes/indoors/hakasitarelay/hakasitarelay_scene.h"
diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/src/overlays/actors/ovl_En_Fu/z_en_fu.h
index dbbcacfc54..af90b2cf05 100644
--- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h
+++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h
@@ -2,11 +2,11 @@
#define Z_EN_FU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnFu;
-typedef void (*EnFuActionFunc)(struct EnFu*, PlayState*);
+typedef void (*EnFuActionFunc)(struct EnFu*, struct PlayState*);
typedef enum EnFuLimb {
/* 0x00 */ FU_LIMB_ROOT,
diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c
index bb11ab8f58..ba002aefbe 100644
--- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c
+++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c
@@ -5,9 +5,22 @@
*/
#include "z_en_fw.h"
-#include "assets/objects/object_fw/object_fw.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_fw/object_fw.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
@@ -193,7 +206,7 @@ void EnFw_Init(Actor* thisx, PlayState* play) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENFW_ANIM_0);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->sphs);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94);
Actor_SetScale(&this->actor, 0.01f);
this->runDirection = -this->actor.params;
@@ -363,7 +376,7 @@ void EnFw_Update(Actor* thisx, PlayState* play) {
EnFw* this = (EnFw*)thisx;
SkelAnime_Update(&this->skelAnime);
- if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
+ if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
Actor_MoveXZGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 20.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
this->actionFunc(this, play);
diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.h b/src/overlays/actors/ovl_En_Fw/z_en_fw.h
index 7940a98157..b19f967111 100644
--- a/src/overlays/actors/ovl_En_Fw/z_en_fw.h
+++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.h
@@ -2,11 +2,11 @@
#define Z_EN_FW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnFw;
-typedef void (*EnFwActionFunc)(struct EnFw* this, PlayState* play);
+typedef void (*EnFwActionFunc)(struct EnFw* this, struct PlayState* play);
#define EN_FW_EFFECT_COUNT 20
@@ -28,7 +28,7 @@ typedef struct EnFw {
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnFwActionFunc actionFunc;
/* 0x0194 */ ColliderJntSph collider;
- /* 0x01B4 */ ColliderJntSphElement sphs[1];
+ /* 0x01B4 */ ColliderJntSphElement colliderElements[1];
/* 0x01F4 */ Vec3f bompPos;
/* 0x0200 */ u8 lastDmgHook;
/* 0x0202 */ s16 runDirection;
diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c
index af3ca60170..6ded127aef 100644
--- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c
+++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c
@@ -1,4 +1,17 @@
#include "z_en_fz.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_fz/object_fz.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.h b/src/overlays/actors/ovl_En_Fz/z_en_fz.h
index a7fa2d7134..277e039e2d 100644
--- a/src/overlays/actors/ovl_En_Fz/z_en_fz.h
+++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.h
@@ -2,11 +2,11 @@
#define Z_EN_FZ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnFz;
-typedef void (*EnFzActionFunc)(struct EnFz*, PlayState*);
+typedef void (*EnFzActionFunc)(struct EnFz*, struct PlayState*);
typedef void (*EnFzSpawnIceSmokeFunc)(struct EnFz*);
typedef struct EnFzEffect {
diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c
index 8cfec63ce1..8bca3e607a 100644
--- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c
+++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c
@@ -5,10 +5,29 @@
*/
#include "z_en_g_switch.h"
-#include "terminal.h"
#include "overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64debug_display.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_tsubo/object_tsubo.h"
@@ -202,7 +221,7 @@ void EnGSwitch_Break(EnGSwitch* this, PlayState* play) {
void EnGSwitch_WaitForObject(EnGSwitch* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
this->actor.objectSlot = this->requiredObjectSlot;
this->actor.draw = EnGSwitch_DrawPot;
this->actionFunc = EnGSwitch_ArcheryPot;
diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h
index 58e19ea9c1..c680fb1440 100644
--- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h
+++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h
@@ -2,11 +2,11 @@
#define Z_EN_G_SWITCH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGSwitch;
-typedef void (*EnGSwitchActionFunc)(struct EnGSwitch*, PlayState*);
+typedef void (*EnGSwitchActionFunc)(struct EnGSwitch*, struct PlayState*);
typedef enum EnGSwitchMoveMode {
/* 0 */ GSWITCH_NONE,
diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c
index ca06391dcf..d40a9a446d 100644
--- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c
+++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c
@@ -6,6 +6,7 @@
#include "z_en_ganon_mant.h"
+#include "array_count.h"
#include "gfx.h"
#include "rand.h"
#include "segmented_address.h"
diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c
index d64111fb9d..a002ce5e1b 100644
--- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c
+++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c
@@ -5,6 +5,13 @@
*/
#include "z_en_ganon_organ.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+
#include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h
index 0c301bddca..8d20bee4d3 100644
--- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h
+++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h
@@ -2,7 +2,7 @@
#define Z_EN_GANON_ORGAN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGanonOrgan;
diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c
index 388a11cc30..9565ceba98 100644
--- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c
+++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c
@@ -5,6 +5,22 @@
*/
#include "z_en_gb.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ps/object_ps.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.h b/src/overlays/actors/ovl_En_Gb/z_en_gb.h
index 4005075c4c..24b7d30560 100644
--- a/src/overlays/actors/ovl_En_Gb/z_en_gb.h
+++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.h
@@ -2,11 +2,12 @@
#define Z_EN_GB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnGb;
-typedef void (*EnGbActionFunc)(struct EnGb*, PlayState*);
+typedef void (*EnGbActionFunc)(struct EnGb*, struct PlayState*);
typedef struct EnGbCagedSoulInfo {
/* 0x00 */ Color_RGBA8 prim;
diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
index 8082c7d87c..c47c8271e5 100644
--- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
+++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
@@ -5,8 +5,22 @@
*/
#include "z_en_ge1.h"
-#include "z64horse.h"
+
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64horse.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ge1/object_ge1.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h
index 7fb1692f62..6aaaf2ab37 100644
--- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h
+++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h
@@ -2,12 +2,12 @@
#define Z_EN_GE1_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGe1;
typedef void (*EnGe1AnimFunc)(struct EnGe1*);
-typedef void (*EnGe1ActionFunc)(struct EnGe1*, PlayState*);
+typedef void (*EnGe1ActionFunc)(struct EnGe1*, struct PlayState*);
typedef enum EnGe1Type {
/* 0x00 */ GE1_TYPE_GATE_GUARD,
diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c
index 0df133fe4f..cae8d14bf1 100644
--- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c
+++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c
@@ -5,8 +5,21 @@
*/
#include "z_en_ge2.h"
-#include "z64horse.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64horse.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_gla/object_gla.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h
index 7c78ad91a6..b453531040 100644
--- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h
+++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h
@@ -2,11 +2,11 @@
#define Z_EN_GE2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGe2;
-typedef void (*EnGe2ActionFunc)(struct EnGe2*, PlayState*);
+typedef void (*EnGe2ActionFunc)(struct EnGe2*, struct PlayState*);
typedef struct EnGe2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c
index 614936d3bc..5e0783bc30 100644
--- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c
+++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c
@@ -5,8 +5,19 @@
*/
#include "z_en_ge3.h"
-#include "assets/objects/object_geldb/object_geldb.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64item.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_geldb/object_geldb.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h
index 4bb5c7b3fc..d767ba6d9a 100644
--- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h
+++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h
@@ -2,12 +2,12 @@
#define Z_EN_GE3_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#include "overlays/actors/ovl_En_GeldB/z_en_geldb.h"
struct EnGe3;
-typedef void (*EnGe3ActionFunc)(struct EnGe3*, PlayState*);
+typedef void (*EnGe3ActionFunc)(struct EnGe3*, struct PlayState*);
typedef struct EnGe3 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c
index 8ecd36af5e..33b53f4dcd 100644
--- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c
+++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c
@@ -5,6 +5,24 @@
*/
#include "z_en_geldb.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_geldb/object_geldb.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h
index 8ca9f1ac6a..e1a7ff3ea0 100644
--- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h
+++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h
@@ -2,7 +2,7 @@
#define Z_EN_GELDB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGeldB;
@@ -34,7 +34,7 @@ typedef enum EnGeldBLimb {
/* 0x18 */ GELDB_LIMB_MAX
} EnGeldBLimb;
-typedef void (*EnGeldBActionFunc)(struct EnGeldB*, PlayState*);
+typedef void (*EnGeldBActionFunc)(struct EnGeldB*, struct PlayState*);
typedef struct EnGeldB {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c
index 47e40b5af1..aebb758cd7 100644
--- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c
+++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c
@@ -5,8 +5,15 @@
*/
#include "z_en_girla.h"
+
+#include "printf.h"
+#include "rand.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
#include "z64draw.h"
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h
index 971d0109c4..504837044e 100644
--- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h
+++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h
@@ -2,14 +2,14 @@
#define Z_EN_GIRLA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGirlA;
-typedef void (*EnGirlAActionFunc)(struct EnGirlA*, PlayState*);
-typedef void (*EnGirlA2Func)(PlayState*, struct EnGirlA*);
-typedef void (*EnGirlA3Func)(Actor*, PlayState*, s32);
-typedef s32 (*EnGirlA4Func)(PlayState*, struct EnGirlA*);
+typedef void (*EnGirlAActionFunc)(struct EnGirlA*, struct PlayState*);
+typedef void (*EnGirlA2Func)(struct PlayState*, struct EnGirlA*);
+typedef void (*EnGirlA3Func)(Actor*, struct PlayState*, s32);
+typedef s32 (*EnGirlA4Func)(struct PlayState*, struct EnGirlA*);
typedef struct EnGirlA {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c
index 3ed42e5119..4b6a979b58 100644
--- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c
+++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c
@@ -5,9 +5,22 @@
*/
#include "z_en_gm.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_oF1d_map/object_oF1d_map.h"
#include "assets/objects/object_gm/object_gm.h"
-#include "terminal.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -105,7 +118,7 @@ void func_80A3D838(EnGm* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->gmObjectSlot)) {
this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED;
SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, 18);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->gmObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->gmObjectSlot].segment);
Animation_Change(&this->skelAnime, &object_gm_Anim_0002B8, 1.0f, 0.0f,
Animation_GetLastFrame(&object_gm_Anim_0002B8), ANIMMODE_LOOP, 0.0f);
this->actor.draw = EnGm_Draw;
@@ -274,7 +287,7 @@ void func_80A3DF60(EnGm* this, PlayState* play) {
}
void func_80A3DFBC(EnGm* this, PlayState* play) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->gmObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->gmObjectSlot].segment);
this->timer++;
this->actionFunc(this, play);
this->actor.focus.rot.x = this->actor.world.rot.x;
diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/src/overlays/actors/ovl_En_Gm/z_en_gm.h
index 3cfedca015..d5234bde14 100644
--- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h
+++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h
@@ -2,12 +2,12 @@
#define Z_EN_GM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGm;
-typedef void (*EnGmUpdateFunc)(struct EnGm*, PlayState*);
-typedef void (*EnGmActionFunc)(struct EnGm*, PlayState*);
+typedef void (*EnGmUpdateFunc)(struct EnGm*, struct PlayState*);
+typedef void (*EnGmActionFunc)(struct EnGm*, struct PlayState*);
typedef struct EnGm {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c
index 7a50157de5..4f7f47630f 100644
--- a/src/overlays/actors/ovl_En_Go/z_en_go.c
+++ b/src/overlays/actors/ovl_En_Go/z_en_go.c
@@ -1,5 +1,20 @@
#include "z_en_go.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_oF1d_map/object_oF1d_map.h"
diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h
index bd673c9521..691472aef6 100644
--- a/src/overlays/actors/ovl_En_Go/z_en_go.h
+++ b/src/overlays/actors/ovl_En_Go/z_en_go.h
@@ -2,13 +2,13 @@
#define Z_EN_GO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGo;
-typedef void (*EnGoActionFunc)(struct EnGo*, PlayState*);
-typedef u16 (*callback1_80A3ED24)(PlayState*, struct EnGo*);
-typedef s16 (*callback2_80A3ED24)(PlayState*, struct EnGo*);
+typedef void (*EnGoActionFunc)(struct EnGo*, struct PlayState*);
+typedef u16 (*callback1_80A3ED24)(struct PlayState*, struct EnGo*);
+typedef s16 (*callback2_80A3ED24)(struct PlayState*, struct EnGo*);
// WIP type docs
// /* 0x00 */ GORON1_CITY_LINK,
diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c
index 50680850d0..61c3d5f6e1 100644
--- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c
+++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c
@@ -1,9 +1,27 @@
#include "z_en_go2.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "quake.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_oF1d_map/object_oF1d_map.h"
-#include "quake.h"
-#include "versions.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h
index 6fb6229355..0c49a30363 100644
--- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h
+++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h
@@ -2,12 +2,12 @@
#define Z_EN_GO2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#include "overlays/actors/ovl_En_Go/z_en_go.h"
struct EnGo2;
-typedef void (*EnGo2ActionFunc)(struct EnGo2*, PlayState*);
+typedef void (*EnGo2ActionFunc)(struct EnGo2*, struct PlayState*);
typedef enum GoronType {
/* 0x00 */ GORON_CITY_ROLLING_BIG,
@@ -73,7 +73,7 @@ typedef struct EnGo2 {
/* 0x0190 */ EnGo2ActionFunc actionFunc;
/* 0x0194 */ NpcInteractInfo interactInfo;
/* 0x01BC */ ColliderCylinder collider;
- /* 0x0208 */ Path* path;
+ /* 0x0208 */ struct Path* path;
/* 0x020C */ u8 unk_20C; // counter for GORON_CITY_LINK animation
/* 0x020D */ u8 dialogState;
/* 0x020E */ u8 reverse;
diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c
index 575df93e53..82175795bd 100644
--- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c
+++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c
@@ -5,11 +5,26 @@
*/
#include "z_en_goma.h"
-#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
-#include "assets/objects/object_gol/object_gol.h"
#include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
+#include "assets/objects/object_gol/object_gol.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -170,10 +185,10 @@ void EnGoma_Init(Actor* thisx, PlayState* play) {
this->eggScale = 1.0f;
this->eggSquishAngle = Rand_ZeroOne() * 1000.0f;
this->actionTimer = 50;
- Collider_InitCylinder(play, &this->colCyl1);
- Collider_SetCylinder(play, &this->colCyl1, &this->actor, &D_80A4B7A0);
- Collider_InitCylinder(play, &this->colCyl2);
- Collider_SetCylinder(play, &this->colCyl2, &this->actor, &D_80A4B7CC);
+ Collider_InitCylinder(play, &this->colliderCylinder1);
+ Collider_SetCylinder(play, &this->colliderCylinder1, &this->actor, &D_80A4B7A0);
+ Collider_InitCylinder(play, &this->colliderCylinder2);
+ Collider_SetCylinder(play, &this->colliderCylinder2, &this->actor, &D_80A4B7CC);
}
}
@@ -181,8 +196,8 @@ void EnGoma_Destroy(Actor* thisx, PlayState* play) {
EnGoma* this = (EnGoma*)thisx;
if (this->actor.params < 10) {
- Collider_DestroyCylinder(play, &this->colCyl1);
- Collider_DestroyCylinder(play, &this->colCyl2);
+ Collider_DestroyCylinder(play, &this->colliderCylinder1);
+ Collider_DestroyCylinder(play, &this->colliderCylinder2);
}
}
@@ -620,15 +635,15 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) {
ColliderElement* acHitElem;
u8 swordDamage;
- if ((this->colCyl1.base.atFlags & AT_HIT) && this->actionFunc == EnGoma_Jump) {
+ if ((this->colliderCylinder1.base.atFlags & AT_HIT) && this->actionFunc == EnGoma_Jump) {
EnGoma_SetupLand(this);
this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f;
}
- if ((this->colCyl2.base.acFlags & AC_HIT) && (s8)this->actor.colChkInfo.health > 0) {
- acHitElem = this->colCyl2.elem.acHitElem;
- this->colCyl2.base.acFlags &= ~AC_HIT;
+ if ((this->colliderCylinder2.base.acFlags & AC_HIT) && (s8)this->actor.colChkInfo.health > 0) {
+ acHitElem = this->colliderCylinder2.elem.acHitElem;
+ this->colliderCylinder2.base.acFlags &= ~AC_HIT;
if (this->gomaType == ENGOMA_NORMAL) {
u32 dmgFlags = acHitElem->atDmgInfo.dmgFlags;
@@ -738,20 +753,20 @@ void EnGoma_Update(Actor* thisx, PlayState* play) {
EnGoma_UpdateEyeEnvColor(this);
this->visualState = 1;
if (player->meleeWeaponState != 0) {
- this->colCyl2.dim.radius = 35;
- this->colCyl2.dim.height = 35;
- this->colCyl2.dim.yShift = 0;
+ this->colliderCylinder2.dim.radius = 35;
+ this->colliderCylinder2.dim.height = 35;
+ this->colliderCylinder2.dim.yShift = 0;
} else {
- this->colCyl2.dim.radius = 15;
- this->colCyl2.dim.height = 30;
- this->colCyl2.dim.yShift = 10;
+ this->colliderCylinder2.dim.radius = 15;
+ this->colliderCylinder2.dim.height = 30;
+ this->colliderCylinder2.dim.yShift = 10;
}
if (this->invincibilityTimer == 0) {
- Collider_UpdateCylinder(&this->actor, &this->colCyl1);
- Collider_UpdateCylinder(&this->actor, &this->colCyl2);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colCyl1.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCyl2.base);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colCyl1.base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinder1);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinder2);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder1.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder2.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder1.base);
}
}
}
diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.h b/src/overlays/actors/ovl_En_Goma/z_en_goma.h
index a0a97f20fb..6b2f7cf309 100644
--- a/src/overlays/actors/ovl_En_Goma/z_en_goma.h
+++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.h
@@ -2,7 +2,7 @@
#define Z_EN_GOMA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum GomaType {
/* 0 */ ENGOMA_NORMAL,
@@ -13,7 +13,7 @@ typedef enum GomaType {
struct EnGoma;
-typedef void (*EnGomaActionFunc)(struct EnGoma*, PlayState*);
+typedef void (*EnGomaActionFunc)(struct EnGoma*, struct PlayState*);
typedef enum EnGomaLimb {
/* 0 */ GOMA_LIMB_NONE,
@@ -73,8 +73,8 @@ typedef struct EnGoma {
/* 0x2F8 */ s16 stunTimer;
/* 0x2FC */ Vec3f shieldKnockbackVel;
/* 0x308 */ Gfx* bossLimbDL; // set by z_boss_goma
- /* 0x30C */ ColliderCylinder colCyl1;
- /* 0x358 */ ColliderCylinder colCyl2;
+ /* 0x30C */ ColliderCylinder colliderCylinder1;
+ /* 0x358 */ ColliderCylinder colliderCylinder2;
} EnGoma; // size = 0x03A4
#endif
diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c
index 56f7b6d975..10ba10d18d 100644
--- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c
+++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c
@@ -6,10 +6,24 @@
#include "z_en_goroiwa.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "printf.h"
+#include "quake.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_goroiwa/object_goroiwa.h"
-#include "quake.h"
-#include "terminal.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -105,7 +119,7 @@ void EnGoroiwa_InitCollider(EnGoroiwa* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
EnGoroiwa_UpdateCollider(this);
this->collider.elements[0].dim.worldSphere.radius = 58;
}
diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h
index 6285432936..26a5810a2d 100644
--- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h
+++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h
@@ -2,17 +2,17 @@
#define Z_EN_GOROIWA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGoroiwa;
-typedef void (*EnGoroiwaActionFunc)(struct EnGoroiwa*, PlayState*);
+typedef void (*EnGoroiwaActionFunc)(struct EnGoroiwa*, struct PlayState*);
typedef struct EnGoroiwa {
/* 0x0000 */ Actor actor;
/* 0x014C */ EnGoroiwaActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
/* 0x01B0 */ Vec3f prevUnitRollAxis;
/* 0x01BC */ f32 prevRollAngleDiff;
/* 0x01C0 */ f32 rollRotSpeed;
diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c
index 46d470c330..4e590217f0 100644
--- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c
+++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c
@@ -5,9 +5,23 @@
*/
#include "z_en_gs.h"
-#include "assets/objects/object_gs/object_gs.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_gs/object_gs.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h
index 47edd278db..d7abdc676f 100644
--- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h
+++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h
@@ -2,11 +2,11 @@
#define Z_EN_GS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGs;
-typedef void (*EnGsActionFunc)(struct EnGs*, PlayState*);
+typedef void (*EnGsActionFunc)(struct EnGs*, struct PlayState*);
typedef struct EnGs {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c
index 5c0a14f9d0..474912abb6 100644
--- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c
+++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c
@@ -5,9 +5,22 @@
*/
#include "z_en_guest.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_os_anime/object_os_anime.h"
#include "assets/objects/object_boj/object_boj.h"
-#include "terminal.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -81,7 +94,7 @@ void EnGuest_Update(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitFlex(play, &this->skelAnime, &gHylianMan2Skel, NULL, this->jointTable, this->morphTable, 16);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
Animation_Change(&this->skelAnime, &gObjOsAnim_42AC, 1.0f, 0.0f, Animation_GetLastFrame(&gObjOsAnim_42AC),
ANIMMODE_LOOP, 0.0f);
@@ -159,7 +172,7 @@ void func_80A505CC(Actor* thisx, PlayState* play) {
Actor_UpdateFidgetTables(play, this->fidgetTableY, this->fidgetTableZ, 16);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
SkelAnime_Update(&this->skelAnime);
Actor_SetFocus(&this->actor, 60.0f);
diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.h b/src/overlays/actors/ovl_En_Guest/z_en_guest.h
index 2130ebc74e..92dbc72d5c 100644
--- a/src/overlays/actors/ovl_En_Guest/z_en_guest.h
+++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.h
@@ -2,11 +2,11 @@
#define Z_EN_GUEST_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnGuest;
-typedef void (*EnGuestActionFunc)(struct EnGuest* this, PlayState* play);
+typedef void (*EnGuestActionFunc)(struct EnGuest* this, struct PlayState* play);
typedef struct EnGuest {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c
index 6cdb51f59b..27cd1341ce 100644
--- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c
+++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c
@@ -5,6 +5,15 @@
*/
#include "z_en_hata.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_hata/object_hata.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/src/overlays/actors/ovl_En_Hata/z_en_hata.h
index e098bcaab3..82f6ba1a8b 100644
--- a/src/overlays/actors/ovl_En_Hata/z_en_hata.h
+++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.h
@@ -2,7 +2,7 @@
#define Z_EN_HATA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum EnHataLimb {
diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c
index 0bc4ac8119..0736896895 100644
--- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c
+++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c
@@ -5,8 +5,26 @@
*/
#include "z_en_heishi1.h"
-#include "assets/objects/object_sd/object_sd.h"
+
+#include "libc64/math64.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_sd/object_sd.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h
index 93bc570223..bc1837241e 100644
--- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h
+++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h
@@ -2,11 +2,11 @@
#define Z_EN_HEISHI1_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHeishi1;
-typedef void (*EnHeishi1ActionFunc)(struct EnHeishi1*, PlayState*);
+typedef void (*EnHeishi1ActionFunc)(struct EnHeishi1*, struct PlayState*);
typedef struct EnHeishi1 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c
index b31974f3b3..c071d40c53 100644
--- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c
+++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c
@@ -4,13 +4,26 @@
* Description: Hyrulian Guards
*/
-#include "terminal.h"
#include "z_en_heishi2.h"
+#include "overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h"
+#include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h"
+#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_sd/object_sd.h"
#include "assets/objects/object_link_child/object_link_child.h"
-#include "overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h"
-#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
-#include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h
index b4f6ea5e7b..3753012bee 100644
--- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h
+++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h
@@ -2,12 +2,12 @@
#define Z_EN_HEISHI2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHeishi2;
-typedef void (*EnHeishi2ActionFunc)(struct EnHeishi2*, PlayState*);
+typedef void (*EnHeishi2ActionFunc)(struct EnHeishi2*, struct PlayState*);
typedef struct EnHeishi2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c
index 8a10e8f96e..354c3f3058 100644
--- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c
+++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c
@@ -5,9 +5,19 @@
*/
#include "z_en_heishi3.h"
-#include "assets/objects/object_sd/object_sd.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sfx.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_sd/object_sd.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h
index 63b4311393..57eb11c61c 100644
--- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h
+++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h
@@ -2,11 +2,11 @@
#define Z_EN_HEISHI3_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHeishi3;
-typedef void (*EnHeishi3ActionFunc)(struct EnHeishi3*, PlayState*);
+typedef void (*EnHeishi3ActionFunc)(struct EnHeishi3*, struct PlayState*);
typedef struct EnHeishi3 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c
index 51588714c8..b90c778114 100644
--- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c
+++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c
@@ -1,6 +1,15 @@
#include "z_en_heishi4.h"
-#include "assets/objects/object_sd/object_sd.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
#include "terminal.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_sd/object_sd.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h
index 48e09ca458..9ab928fe3e 100644
--- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h
+++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h
@@ -2,7 +2,7 @@
#define Z_EN_HEISHI4_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum Heishi4Type {
/* 0x00 */ HEISHI4_AT_KAKARIKO_ENTRANCE,
@@ -13,7 +13,7 @@ typedef enum Heishi4Type {
struct EnHeishi4;
-typedef void (*EnHeishi4ActionFunc)(struct EnHeishi4*, PlayState*);
+typedef void (*EnHeishi4ActionFunc)(struct EnHeishi4*, struct PlayState*);
typedef struct EnHeishi4 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c
index 541e8b8519..454f83c2d0 100644
--- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c
+++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c
@@ -5,6 +5,13 @@
*/
#include "z_en_hintnuts.h"
+
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_hintnuts/object_hintnuts.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
@@ -78,8 +85,9 @@ void EnHintnuts_Init(Actor* thisx, PlayState* play) {
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE);
} else {
ActorShape_Init(&this->actor.shape, 0x0, ActorShadow_DrawCircle, 35.0f);
- SkelAnime_Init(play, &this->skelAnime, &gHintNutsSkel, &gHintNutsStandAnim, this->jointTable, this->morphTable,
- 10);
+ //! @bug Flex skeleton is used as normal skeleton
+ SkelAnime_Init(play, &this->skelAnime, (SkeletonHeader*)&gHintNutsSkel, &gHintNutsStandAnim, this->jointTable,
+ this->morphTable, 10);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h
index fcc0201659..a24b387fe1 100644
--- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h
+++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h
@@ -2,11 +2,11 @@
#define Z_EN_HINTNUTS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHintnuts;
-typedef void (*EnHintnutsActionFunc)(struct EnHintnuts*, PlayState*);
+typedef void (*EnHintnutsActionFunc)(struct EnHintnuts*, struct PlayState*);
typedef struct EnHintnuts {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c
index c17ff7e58f..c3f8fa40ad 100644
--- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c
+++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c
@@ -1,5 +1,14 @@
#include "z_en_holl.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
/*
diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/src/overlays/actors/ovl_En_Holl/z_en_holl.h
index 2c87dc346b..4a9409373a 100644
--- a/src/overlays/actors/ovl_En_Holl/z_en_holl.h
+++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.h
@@ -2,7 +2,7 @@
#define Z_EN_HOLL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#define ENHOLL_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 6, 3)
#define ENHOLL_GET_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 0, 6)
@@ -35,7 +35,7 @@ typedef enum EnHollType {
struct EnHoll;
-typedef void (*EnHollActionFunc)(struct EnHoll*, PlayState*);
+typedef void (*EnHollActionFunc)(struct EnHoll*, struct PlayState*);
typedef struct EnHoll {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c
index 9a77366416..5f884f8997 100644
--- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c
+++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c
@@ -5,6 +5,22 @@
*/
#include "z_en_honotrap.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h
index f1b085686c..debd2bfb7c 100644
--- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h
+++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h
@@ -2,11 +2,11 @@
#define Z_EN_HONOTRAP_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHonotrap;
-typedef void (*EnHonotrapActionFunc)(struct EnHonotrap*, PlayState*);
+typedef void (*EnHonotrapActionFunc)(struct EnHonotrap*, struct PlayState*);
typedef union EnHonotrapCollider {
struct {
diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c
index 075facff4d..dded516560 100644
--- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c
+++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c
@@ -5,10 +5,32 @@
*/
#include "z_en_horse.h"
-#include "z64horse.h"
-#include "global.h"
-#include "versions.h"
#include "overlays/actors/ovl_En_In/z_en_in.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64horse.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/object_horse/object_horse.h"
#include "assets/objects/object_hni/object_hni.h"
#include "assets/scenes/overworld/spot09/spot09_scene.h"
@@ -121,7 +143,7 @@ static ColliderCylinderInit sCylinderInit2 = {
{ 20, 70, 0, { 0, 0, 0 } },
};
-static ColliderJntSphElementInit sJntSphItemsInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -145,7 +167,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- sJntSphItemsInit,
+ sJntSphElementsInit,
};
static CollisionCheckInfoInit D_80A65F38 = { 10, 35, 100, MASS_HEAVY };
@@ -561,7 +583,7 @@ void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceIn
EnHorse_RotateToPoint(this, play, &curWaypointPos, 400);
if (distSq < SQ(300.0f)) {
- if (this->actor.xzDistToPlayer < 130.0f || this->jntSph.elements[0].base.ocElemFlags & OCELEM_HIT) {
+ if (this->actor.xzDistToPlayer < 130.0f || this->colliderJntSph.elements[0].base.ocElemFlags & OCELEM_HIT) {
s32 pad;
if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) {
@@ -818,12 +840,12 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f);
this->action = ENHORSE_ACT_IDLE;
this->actor.speed = 0.0f;
- Collider_InitCylinder(play, &this->cyl1);
- Collider_SetCylinder(play, &this->cyl1, &this->actor, &sCylinderInit1);
- Collider_InitCylinder(play, &this->cyl2);
- Collider_SetCylinder(play, &this->cyl2, &this->actor, &sCylinderInit2);
- Collider_InitJntSph(play, &this->jntSph);
- Collider_SetJntSph(play, &this->jntSph, &this->actor, &sJntSphInit, &this->jntSphList);
+ Collider_InitCylinder(play, &this->colliderCylinder1);
+ Collider_SetCylinder(play, &this->colliderCylinder1, &this->actor, &sCylinderInit1);
+ Collider_InitCylinder(play, &this->colliderCylinder2);
+ Collider_SetCylinder(play, &this->colliderCylinder2, &this->actor, &sCylinderInit2);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
CollisionCheck_SetInfo(&this->actor.colChkInfo, DamageTable_Get(0xB), &D_80A65F38);
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 70.0f;
@@ -906,9 +928,9 @@ void EnHorse_Destroy(Actor* thisx, PlayState* play) {
Audio_StopSfxByPos(&this->unk_21C);
}
Skin_Free(play, &this->skin);
- Collider_DestroyCylinder(play, &this->cyl1);
- Collider_DestroyCylinder(play, &this->cyl2);
- Collider_DestroyJntSph(play, &this->jntSph);
+ Collider_DestroyCylinder(play, &this->colliderCylinder1);
+ Collider_DestroyCylinder(play, &this->colliderCylinder2);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
}
void EnHorse_RotateToPlayer(EnHorse* this, PlayState* play) {
@@ -927,9 +949,9 @@ void EnHorse_Freeze(EnHorse* this) {
}
this->prevAction = this->action;
this->action = ENHORSE_ACT_FROZEN;
- this->cyl1.base.ocFlags1 &= ~OC1_ON;
- this->cyl2.base.ocFlags1 &= ~OC1_ON;
- this->jntSph.base.ocFlags1 &= ~OC1_ON;
+ this->colliderCylinder1.base.ocFlags1 &= ~OC1_ON;
+ this->colliderCylinder2.base.ocFlags1 &= ~OC1_ON;
+ this->colliderJntSph.base.ocFlags1 &= ~OC1_ON;
this->animationIdx = ENHORSE_ANIM_IDLE;
}
}
@@ -943,9 +965,9 @@ void EnHorse_Frozen(EnHorse* this, PlayState* play) {
this->actor.speed = 0.0f;
this->noInputTimer--;
if (this->noInputTimer < 0) {
- this->cyl1.base.ocFlags1 |= OC1_ON;
- this->cyl2.base.ocFlags1 |= OC1_ON;
- this->jntSph.base.ocFlags1 |= OC1_ON;
+ this->colliderCylinder1.base.ocFlags1 |= OC1_ON;
+ this->colliderCylinder2.base.ocFlags1 |= OC1_ON;
+ this->colliderJntSph.base.ocFlags1 |= OC1_ON;
if (this->playerControlled == true) {
this->stateFlags &= ~ENHORSE_FLAG_7;
if (this->actor.params == HORSE_PTYPE_4) {
@@ -1728,9 +1750,9 @@ void EnHorse_HighJump(EnHorse* this, PlayState* play) {
}
void EnHorse_InitInactive(EnHorse* this) {
- this->cyl1.base.ocFlags1 &= ~OC1_ON;
- this->cyl2.base.ocFlags1 &= ~OC1_ON;
- this->jntSph.base.ocFlags1 &= ~OC1_ON;
+ this->colliderCylinder1.base.ocFlags1 &= ~OC1_ON;
+ this->colliderCylinder2.base.ocFlags1 &= ~OC1_ON;
+ this->colliderJntSph.base.ocFlags1 &= ~OC1_ON;
this->action = ENHORSE_ACT_INACTIVE;
this->animationIdx = ENHORSE_ANIM_WALK;
this->stateFlags |= ENHORSE_INACTIVE;
@@ -1762,9 +1784,9 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) {
this->followTimer = 0;
EnHorse_SetFollowAnimation(this, play);
this->actor.params = HORSE_PTYPE_0;
- this->cyl1.base.ocFlags1 |= OC1_ON;
- this->cyl2.base.ocFlags1 |= OC1_ON;
- this->jntSph.base.ocFlags1 |= OC1_ON;
+ this->colliderCylinder1.base.ocFlags1 |= OC1_ON;
+ this->colliderCylinder2.base.ocFlags1 |= OC1_ON;
+ this->colliderJntSph.base.ocFlags1 |= OC1_ON;
}
}
@@ -3548,12 +3570,12 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
this->rider->shape.rot.y = thisx->shape.rot.y;
}
}
- if (this->jntSph.elements[0].base.ocElemFlags & OCELEM_HIT) {
+ if (this->colliderJntSph.elements[0].base.ocElemFlags & OCELEM_HIT) {
if (thisx->speed > 6.0f) {
thisx->speed -= 1.0f;
}
}
- if (this->jntSph.base.acFlags & AC_HIT) {
+ if (this->colliderJntSph.base.acFlags & AC_HIT) {
this->unk_21C = this->unk_228;
if (this->stateFlags & ENHORSE_DRAW) {
Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->unk_21C, 4, &gSfxDefaultFreqAndVolScale,
@@ -3563,17 +3585,21 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
if (this->action != ENHORSE_ACT_INGO_RACE) {
EnHorse_TiltBody(this, play);
}
- Collider_UpdateCylinder(thisx, &this->cyl1);
- Collider_UpdateCylinder(thisx, &this->cyl2);
+ Collider_UpdateCylinder(thisx, &this->colliderCylinder1);
+ Collider_UpdateCylinder(thisx, &this->colliderCylinder2);
// Required to match
- this->cyl1.dim.pos.x = this->cyl1.dim.pos.x + (s16)(Math_SinS(thisx->shape.rot.y) * 11.0f);
- this->cyl1.dim.pos.z = this->cyl1.dim.pos.z + (s16)(Math_CosS(thisx->shape.rot.y) * 11.0f);
- this->cyl2.dim.pos.x = this->cyl2.dim.pos.x + (s16)(Math_SinS(thisx->shape.rot.y) * -18.0f);
- this->cyl2.dim.pos.z = this->cyl2.dim.pos.z + (s16)(Math_CosS(thisx->shape.rot.y) * -18.0f);
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->cyl1.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->cyl1.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->cyl2.base);
+ this->colliderCylinder1.dim.pos.x =
+ this->colliderCylinder1.dim.pos.x + (s16)(Math_SinS(thisx->shape.rot.y) * 11.0f);
+ this->colliderCylinder1.dim.pos.z =
+ this->colliderCylinder1.dim.pos.z + (s16)(Math_CosS(thisx->shape.rot.y) * 11.0f);
+ this->colliderCylinder2.dim.pos.x =
+ this->colliderCylinder2.dim.pos.x + (s16)(Math_SinS(thisx->shape.rot.y) * -18.0f);
+ this->colliderCylinder2.dim.pos.z =
+ this->colliderCylinder2.dim.pos.z + (s16)(Math_CosS(thisx->shape.rot.y) * -18.0f);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder1.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder1.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder2.base);
if ((player->stateFlags1 & PLAYER_STATE1_0) && player->rideActor != NULL) {
if (play->sceneId != SCENE_LON_LON_RANCH ||
(play->sceneId == SCENE_LON_LON_RANCH && (thisx->world.pos.z < -2400.0f))) {
@@ -3617,9 +3643,9 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
}
if (thisx->speed >= 5.0f) {
- this->cyl1.base.atFlags |= AT_ON;
+ this->colliderCylinder1.base.atFlags |= AT_ON;
} else {
- this->cyl1.base.atFlags &= ~AT_ON;
+ this->colliderCylinder1.base.atFlags &= ~AT_ON;
}
if (gSaveContext.save.entranceIndex != ENTR_LON_LON_RANCH_0 || gSaveContext.sceneLayer != 9) {
@@ -3814,17 +3840,17 @@ void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
}
}
- for (i = 0; i < this->jntSph.count; i++) {
- center.x = this->jntSph.elements[i].dim.modelSphere.center.x;
- center.y = this->jntSph.elements[i].dim.modelSphere.center.y;
- center.z = this->jntSph.elements[i].dim.modelSphere.center.z;
+ for (i = 0; i < this->colliderJntSph.count; i++) {
+ center.x = this->colliderJntSph.elements[i].dim.modelSphere.center.x;
+ center.y = this->colliderJntSph.elements[i].dim.modelSphere.center.y;
+ center.z = this->colliderJntSph.elements[i].dim.modelSphere.center.z;
- Skin_GetLimbPos(skin, this->jntSph.elements[i].dim.limb, ¢er, &newCenter);
- this->jntSph.elements[i].dim.worldSphere.center.x = newCenter.x;
- this->jntSph.elements[i].dim.worldSphere.center.y = newCenter.y;
- this->jntSph.elements[i].dim.worldSphere.center.z = newCenter.z;
- this->jntSph.elements[i].dim.worldSphere.radius =
- this->jntSph.elements[i].dim.modelSphere.radius * this->jntSph.elements[i].dim.scale;
+ Skin_GetLimbPos(skin, this->colliderJntSph.elements[i].dim.limb, ¢er, &newCenter);
+ this->colliderJntSph.elements[i].dim.worldSphere.center.x = newCenter.x;
+ this->colliderJntSph.elements[i].dim.worldSphere.center.y = newCenter.y;
+ this->colliderJntSph.elements[i].dim.worldSphere.center.z = newCenter.z;
+ this->colliderJntSph.elements[i].dim.worldSphere.radius =
+ this->colliderJntSph.elements[i].dim.modelSphere.radius * this->colliderJntSph.elements[i].dim.scale;
}
//! @bug Setting colliders in a draw function allows for duplicate entries to be added to their respective lists
@@ -3832,8 +3858,8 @@ void EnHorse_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
//! Actors will draw for a couple of frames between the pauses, but some important logic updates will not occur.
//! In the case of OC, this can cause unwanted effects such as a very large amount of displacement being applied to
//! a colliding actor.
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->jntSph.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->jntSph.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
// unused
diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h
index 059cf67682..0eed5c001c 100644
--- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h
+++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h
@@ -140,10 +140,10 @@ typedef struct EnHorse {
/* 0x0264 */ Vec2f curStick;
/* 0x026C */ Vec2f lastStick;
/* 0x0274 */ f32 jumpStartY;
- /* 0x0278 */ ColliderCylinder cyl1;
- /* 0x02C4 */ ColliderCylinder cyl2;
- /* 0x0310 */ ColliderJntSph jntSph;
- /* 0x0330 */ ColliderJntSphElement jntSphList;
+ /* 0x0278 */ ColliderCylinder colliderCylinder1;
+ /* 0x02C4 */ ColliderCylinder colliderCylinder2;
+ /* 0x0310 */ ColliderJntSph colliderJntSph;
+ /* 0x0330 */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x0370 */ u32 playerDir;
/* 0x0374 */ s16 unk_374;
/* 0x0376 */ s16 angleToPlayer;
diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
index 9675ab1218..eefef20798 100644
--- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
+++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
@@ -6,8 +6,19 @@
#include "z_en_horse_game_check.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
+
#include "libu64/debug.h"
#include "line_numbers.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sys_math3d.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h
index 96834860e3..84ab117216 100644
--- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h
+++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h
@@ -2,11 +2,11 @@
#define Z_EN_HORSE_GAME_CHECK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHorseGameCheckBase;
-typedef s32 (*EnHorseGameCheckFunc)(struct EnHorseGameCheckBase* this, PlayState* play);
+typedef s32 (*EnHorseGameCheckFunc)(struct EnHorseGameCheckBase* this, struct PlayState* play);
typedef struct EnHorseGameCheckBase {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c
index 0ce01f2d6e..e1991688a1 100644
--- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c
+++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c
@@ -5,6 +5,18 @@
*/
#include "z_en_horse_ganon.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64skin.h"
+
#include "assets/objects/object_horse_ganon/object_horse_ganon.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -181,10 +193,10 @@ void EnHorseGanon_Init(Actor* thisx, PlayState* play) {
this->currentAnimation = 0;
Animation_PlayOnce(&this->skin.skelAnime, sAnimations[0]);
- Collider_InitCylinder(play, &this->colliderBody);
- Collider_SetCylinder(play, &this->colliderBody, &this->actor, &sCylinderInit);
- Collider_InitJntSph(play, &this->colliderHead);
- Collider_SetJntSph(play, &this->colliderHead, &this->actor, &sJntSphInit, this->headElements);
+ Collider_InitCylinder(play, &this->bodyCollider);
+ Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sCylinderInit);
+ Collider_InitJntSph(play, &this->headCollider);
+ Collider_SetJntSph(play, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderElements);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
func_80A68AC4(this);
@@ -194,8 +206,8 @@ void EnHorseGanon_Destroy(Actor* thisx, PlayState* play) {
EnHorseGanon* this = (EnHorseGanon*)thisx;
Skin_Free(play, &this->skin);
- Collider_DestroyCylinder(play, &this->colliderBody);
- Collider_DestroyJntSph(play, &this->colliderHead);
+ Collider_DestroyCylinder(play, &this->bodyCollider);
+ Collider_DestroyJntSph(play, &this->headCollider);
}
void func_80A68AC4(EnHorseGanon* this) {
@@ -293,8 +305,8 @@ void EnHorseGanon_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_4);
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 70.0f;
- Collider_UpdateCylinder(&this->actor, &this->colliderBody);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderBody.base);
+ Collider_UpdateCylinder(&this->actor, &this->bodyCollider);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->bodyCollider.base);
}
void EnHorseGanon_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
@@ -303,23 +315,23 @@ void EnHorseGanon_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
EnHorseGanon* this = (EnHorseGanon*)thisx;
s32 index;
- for (index = 0; index < this->colliderHead.count; index++) {
- sp4C.x = this->colliderHead.elements[index].dim.modelSphere.center.x;
- sp4C.y = this->colliderHead.elements[index].dim.modelSphere.center.y;
- sp4C.z = this->colliderHead.elements[index].dim.modelSphere.center.z;
+ for (index = 0; index < this->headCollider.count; index++) {
+ sp4C.x = this->headCollider.elements[index].dim.modelSphere.center.x;
+ sp4C.y = this->headCollider.elements[index].dim.modelSphere.center.y;
+ sp4C.z = this->headCollider.elements[index].dim.modelSphere.center.z;
- Skin_GetLimbPos(skin, this->colliderHead.elements[index].dim.limb, &sp4C, &sp40);
+ Skin_GetLimbPos(skin, this->headCollider.elements[index].dim.limb, &sp4C, &sp40);
- this->colliderHead.elements[index].dim.worldSphere.center.x = sp40.x;
- this->colliderHead.elements[index].dim.worldSphere.center.y = sp40.y;
- this->colliderHead.elements[index].dim.worldSphere.center.z = sp40.z;
+ this->headCollider.elements[index].dim.worldSphere.center.x = sp40.x;
+ this->headCollider.elements[index].dim.worldSphere.center.y = sp40.y;
+ this->headCollider.elements[index].dim.worldSphere.center.z = sp40.z;
- this->colliderHead.elements[index].dim.worldSphere.radius =
- this->colliderHead.elements[index].dim.modelSphere.radius * this->colliderHead.elements[index].dim.scale;
+ this->headCollider.elements[index].dim.worldSphere.radius =
+ this->headCollider.elements[index].dim.modelSphere.radius * this->headCollider.elements[index].dim.scale;
}
//! @bug see relevant comment in `EnHorse_SkinCallback1`
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderHead.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->headCollider.base);
}
void EnHorseGanon_Draw(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h
index 8083adeee6..473f6cecb4 100644
--- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h
+++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h
@@ -2,11 +2,12 @@
#define Z_EN_HORSE_GANON_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64skin.h"
struct EnHorseGanon;
-typedef void (*EnHorseGanonActionFunc)(struct EnHorseGanon*, PlayState*);
+typedef void (*EnHorseGanonActionFunc)(struct EnHorseGanon*, struct PlayState*);
typedef struct EnHorseGanon {
/* 0x0000 */ Actor actor;
@@ -19,9 +20,9 @@ typedef struct EnHorseGanon {
/* 0x01F0 */ u8 unk_1F0[0x04];
/* 0x01F4 */ f32 unk_1F4;
/* 0x01F8 */ u8 unk_1F8[0x04];
- /* 0x01FC */ ColliderCylinder colliderBody;
- /* 0x0248 */ ColliderJntSph colliderHead;
- /* 0x0268 */ ColliderJntSphElement headElements[1];
+ /* 0x01FC */ ColliderCylinder bodyCollider;
+ /* 0x0248 */ ColliderJntSph headCollider;
+ /* 0x0268 */ ColliderJntSphElement headColliderElements[1];
} EnHorseGanon; // size = 0x02A8
#endif
diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c
index 755916a390..1610147130 100644
--- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c
+++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c
@@ -4,18 +4,25 @@
* Description: Young Epona
*/
-#include "global.h"
+#include "z_en_horse_link_child.h"
+
+#include "array_count.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
#include "rand.h"
#include "regs.h"
+#include "segmented_address.h"
#include "sfx.h"
+#include "sys_math3d.h"
+#include "z_lib.h"
#include "z64actor.h"
#include "z64horse.h"
#include "z64player.h"
#include "z64play.h"
-#include "z_en_horse_link_child.h"
+#include "z64save.h"
+#include "z64skin.h"
+
#include "assets/objects/object_horse_link_child/object_horse_link_child.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
@@ -66,7 +73,7 @@ static ColliderCylinderInitType1 sCylinderInit = {
{ 20, 100, 0, { 0, 0, 0 } },
};
-static ColliderJntSphElementInit sJntSphElementInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -90,7 +97,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- sJntSphElementInit,
+ sJntSphElementsInit,
};
static CollisionCheckInfoInit sColCheckInfoInit = { 10, 35, 100, MASS_HEAVY };
@@ -168,7 +175,7 @@ void EnHorseLinkChild_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->bodyCollider);
Collider_SetCylinderType1(play, &this->bodyCollider, &this->actor, &sCylinderInit);
Collider_InitJntSph(play, &this->headCollider);
- Collider_SetJntSph(play, &this->headCollider, &this->actor, &sJntSphInit, this->headElements);
+ Collider_SetJntSph(play, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderElements);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColCheckInfoInit);
this->unk_1F0 = 0;
this->eyeTexIndex = 0;
diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h
index 3ad5a449af..a4e9b512d7 100644
--- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h
+++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h
@@ -20,7 +20,7 @@ typedef struct EnHorseLinkChild {
/* 0x01F0 */ s32 unk_1F0;
/* 0x01F4 */ ColliderCylinder bodyCollider;
/* 0x0240 */ ColliderJntSph headCollider;
- /* 0x0260 */ ColliderJntSphElement headElements[1];
+ /* 0x0260 */ ColliderJntSphElement headColliderElements[1];
/* 0x02A0 */ s32 unk_2A0;
} EnHorseLinkChild; // size = 0x02A4
diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c
index c760dc54d7..300711ff37 100644
--- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c
+++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c
@@ -5,6 +5,23 @@
*/
#include "z_en_horse_normal.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64skin.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_horse_normal/object_horse_normal.h"
@@ -197,7 +214,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->bodyCollider);
Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sCylinderInit1);
Collider_InitJntSph(play, &this->headCollider);
- Collider_SetJntSph(play, &this->headCollider, &this->actor, &sJntSphInit, this->headElements);
+ Collider_SetJntSph(play, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderElements);
Collider_InitCylinder(play, &this->cloneCollider);
Collider_SetCylinder(play, &this->cloneCollider, &this->actor, &sCylinderInit2);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
@@ -706,7 +723,7 @@ void EnHorseNormal_Draw(Actor* thisx, PlayState* play2) {
if (mtx == NULL) {
return;
}
- gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_OPA_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_800A63CC(&this->actor, play, &this->skin, NULL, NULL, true, 0,
SKIN_DRAW_FLAG_CUSTOM_TRANSFORMS | SKIN_DRAW_FLAG_CUSTOM_MATRIX);
diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h
index f9445eb186..01ddd44608 100644
--- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h
+++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h
@@ -2,11 +2,12 @@
#define Z_EN_HORSE_NORMAL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64skin.h"
struct EnHorseNormal;
-typedef void (*EnHorseNormalActionFunc)(struct EnHorseNormal*, PlayState*);
+typedef void (*EnHorseNormalActionFunc)(struct EnHorseNormal*, struct PlayState*);
typedef struct EnHorseNormal {
/* 0x0000 */ Actor actor;
@@ -26,7 +27,7 @@ typedef struct EnHorseNormal {
/* 0x0224 */ char unk_224[0x04];
/* 0x0228 */ ColliderCylinder bodyCollider;
/* 0x0274 */ ColliderJntSph headCollider;
- /* 0x0294 */ ColliderJntSphElement headElements[1];
+ /* 0x0294 */ ColliderJntSphElement headColliderElements[1];
/* 0x02D4 */ ColliderCylinder cloneCollider;
/* 0x0320 */ char unk_320[0x04];
/* 0x0324 */ s32 waypoint;
diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c
index 04b7b19336..fb59c5b84a 100644
--- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c
+++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c
@@ -5,6 +5,18 @@
*/
#include "z_en_horse_zelda.h"
+
+#include "libc64/math64.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_horse_zelda/object_horse_zelda.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -163,8 +175,8 @@ void EnHorseZelda_Init(Actor* thisx, PlayState* play) {
Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[0]);
Collider_InitCylinder(play, &this->colliderCylinder);
Collider_SetCylinderType1(play, &this->colliderCylinder, &this->actor, &sCylinderInit);
- Collider_InitJntSph(play, &this->colliderSphere);
- Collider_SetJntSph(play, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
this->animationIndex = 0;
EnHorseZelda_SetupStop(this);
@@ -174,7 +186,7 @@ void EnHorseZelda_Destroy(Actor* thisx, PlayState* play) {
EnHorseZelda* this = (EnHorseZelda*)thisx;
Collider_DestroyCylinder(play, &this->colliderCylinder);
- Collider_DestroyJntSph(play, &this->colliderSphere);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
Skin_Free(play, &this->skin);
}
@@ -250,23 +262,23 @@ void EnHorseZelda_PostDraw(Actor* thisx, PlayState* play, Skin* skin) {
EnHorseZelda* this = (EnHorseZelda*)thisx;
s32 i;
- for (i = 0; i < this->colliderSphere.count; i++) {
- offset.x = this->colliderSphere.elements[i].dim.modelSphere.center.x;
- offset.y = this->colliderSphere.elements[i].dim.modelSphere.center.y;
- offset.z = this->colliderSphere.elements[i].dim.modelSphere.center.z;
+ for (i = 0; i < this->colliderJntSph.count; i++) {
+ offset.x = this->colliderJntSph.elements[i].dim.modelSphere.center.x;
+ offset.y = this->colliderJntSph.elements[i].dim.modelSphere.center.y;
+ offset.z = this->colliderJntSph.elements[i].dim.modelSphere.center.z;
- Skin_GetLimbPos(skin, this->colliderSphere.elements[i].dim.limb, &offset, &dst);
+ Skin_GetLimbPos(skin, this->colliderJntSph.elements[i].dim.limb, &offset, &dst);
- this->colliderSphere.elements[i].dim.worldSphere.center.x = dst.x;
- this->colliderSphere.elements[i].dim.worldSphere.center.y = dst.y;
- this->colliderSphere.elements[i].dim.worldSphere.center.z = dst.z;
+ this->colliderJntSph.elements[i].dim.worldSphere.center.x = dst.x;
+ this->colliderJntSph.elements[i].dim.worldSphere.center.y = dst.y;
+ this->colliderJntSph.elements[i].dim.worldSphere.center.z = dst.z;
- this->colliderSphere.elements[i].dim.worldSphere.radius =
- this->colliderSphere.elements[i].dim.modelSphere.radius * this->colliderSphere.elements[i].dim.scale;
+ this->colliderJntSph.elements[i].dim.worldSphere.radius =
+ this->colliderJntSph.elements[i].dim.modelSphere.radius * this->colliderJntSph.elements[i].dim.scale;
}
//! @bug see relevant comment in `EnHorse_SkinCallback1`
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderSphere.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
void EnHorseZelda_Draw(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h
index 7ce6cace3a..86b851c77b 100644
--- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h
+++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h
@@ -2,11 +2,12 @@
#define Z_EN_HORSE_ZELDA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64skin.h"
struct EnHorseZelda;
-typedef void (*EnHorseZeldaActionFunc)(struct EnHorseZelda*, PlayState*);
+typedef void (*EnHorseZeldaActionFunc)(struct EnHorseZelda*, struct PlayState*);
typedef struct EnHorseZelda {
/* 0x0000 */ Actor actor;
@@ -19,8 +20,8 @@ typedef struct EnHorseZelda {
/* 0x01F4 */ f32 floorYForwards;
/* 0x01F8 */ char unk_1F8[0x4];
/* 0x01FC */ ColliderCylinder colliderCylinder;
- /* 0x0248 */ ColliderJntSph colliderSphere;
- /* 0x0268 */ ColliderJntSphElement colliderSphereItem;
+ /* 0x0248 */ ColliderJntSph colliderJntSph;
+ /* 0x0268 */ ColliderJntSphElement colliderJntSphElements[1];
} EnHorseZelda; // size = 0x02A8
#endif
diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c
index 66d12bafb2..935fdedd97 100644
--- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c
+++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c
@@ -5,7 +5,18 @@
*/
#include "z_en_hs.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_hs/object_hs.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.h b/src/overlays/actors/ovl_En_Hs/z_en_hs.h
index f4b89ce153..f938b51518 100644
--- a/src/overlays/actors/ovl_En_Hs/z_en_hs.h
+++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.h
@@ -2,11 +2,11 @@
#define Z_EN_HS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHs;
-typedef void (*EnHsActionFunc)(struct EnHs*, PlayState*);
+typedef void (*EnHsActionFunc)(struct EnHs*, struct PlayState*);
typedef struct EnHs {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
index b1b04107f0..71005a3afb 100644
--- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
+++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
@@ -5,7 +5,16 @@
*/
#include "z_en_hs2.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+
#include "assets/objects/object_hs/object_hs.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h
index e2f66f79c3..dec1533f89 100644
--- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h
+++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h
@@ -2,11 +2,11 @@
#define Z_EN_HS2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnHs2;
-typedef void (*EnHs2ActionFunc)(struct EnHs2*, PlayState*);
+typedef void (*EnHs2ActionFunc)(struct EnHs2*, struct PlayState*);
typedef struct EnHs2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c
index 2aa163d0fb..655ebd4789 100644
--- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c
+++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c
@@ -5,7 +5,22 @@
*/
#include "z_en_hy.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_aob/object_aob.h"
#include "assets/objects/object_ahg/object_ahg.h"
#include "assets/objects/object_bob/object_bob.h"
@@ -1147,12 +1162,12 @@ void EnHy_Destroy(Actor* thisx, PlayState* play) {
void EnHy_WaitForObjects(EnHy* this, PlayState* play) {
if (EnHy_IsOsAnimeObjectLoaded(this, play) && EnHy_AreSkelAndHeadObjectsLoaded(this, play)) {
this->actor.objectSlot = this->objectSlotLowerSkel;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
SkelAnime_InitFlex(play, &this->skelAnime,
sSkeletonInfo[sModelInfo[ENHY_GET_TYPE(&this->actor)].lowerSkelInfoIndex].skeleton, NULL,
this->jointTable, this->morphTable, ENHY_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit);
EnHy_InitCollider(this);
@@ -1335,7 +1350,7 @@ void EnHy_Update(Actor* thisx, PlayState* play) {
EnHy* this = (EnHy*)thisx;
if (this->actionFunc != EnHy_WaitForObjects) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment);
SkelAnime_Update(&this->skelAnime);
EnHy_UpdateEyes(this);
@@ -1362,7 +1377,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
if (limbIndex == ENHY_LIMB_HEAD) {
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotHead].segment);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotHead].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotHead].segment);
headInfoIndex = sModelInfo[ENHY_GET_TYPE(&this->actor)].headInfoIndex;
*dList = sHeadInfo[headInfoIndex].headDList;
@@ -1371,7 +1386,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(eyeTex));
}
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotLowerSkel].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotLowerSkel].segment);
}
if (limbIndex == ENHY_LIMB_HEAD) {
@@ -1408,7 +1423,7 @@ void EnHy_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
if (limbIndex == ENHY_LIMB_RIGHT_FOOT) {
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotUpperSkel].segment);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotUpperSkel].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotUpperSkel].segment);
}
if (ENHY_GET_TYPE(&this->actor) == ENHY_TYPE_MAN_2_BALD && limbIndex == ENHY_LIMB_TORSO) {
diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.h b/src/overlays/actors/ovl_En_Hy/z_en_hy.h
index a5c04ed3ab..50bdc90933 100644
--- a/src/overlays/actors/ovl_En_Hy/z_en_hy.h
+++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.h
@@ -2,7 +2,7 @@
#define Z_EN_HY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#define ENHY_GET_TYPE(thisx) PARAMS_GET_S((thisx)->params, 0, 7)
#define ENHY_GET_PATH_INDEX(thisx) PARAMS_GET_S((thisx)->params, 7, 4)
@@ -54,7 +54,7 @@ typedef enum EnHyLimb {
struct EnHy;
-typedef void (*EnHyActionFunc)(struct EnHy*, PlayState*);
+typedef void (*EnHyActionFunc)(struct EnHy*, struct PlayState*);
typedef struct EnHy {
/* 0x0000 */ Actor actor;
@@ -68,7 +68,7 @@ typedef struct EnHy {
/* 0x0199 */ s8 objectSlotOsAnime;
/* 0x019C */ ColliderCylinder collider;
/* 0x01E8 */ NpcInteractInfo interactInfo;
- /* 0x0210 */ Path* path;
+ /* 0x0210 */ struct Path* path;
/* 0x0214 */ s8 waypoint;
/* 0x0215 */ s8 playedSfx;
/* 0x0216 */ char unk_216[2]; // unused
diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c
index a0fc6e7bde..8db6b38d0f 100644
--- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c
+++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c
@@ -5,6 +5,20 @@
*/
#include "z_en_ice_hono.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64item.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h
index e5ad5fd1cf..ea975199aa 100644
--- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h
+++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h
@@ -2,11 +2,12 @@
#define Z_EN_ICE_HONO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnIceHono;
-typedef void (*EnIceHonoActionFunc)(struct EnIceHono*, PlayState*);
+typedef void (*EnIceHonoActionFunc)(struct EnIceHono*, struct PlayState*);
typedef struct EnIceHono {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c
index e95e5d4fac..a0533d4569 100644
--- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c
+++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c
@@ -5,10 +5,31 @@
*/
#include "z_en_ik.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sequence.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
+
#include "assets/scenes/dungeons/jyasinboss/jyasinboss_scene.h"
#include "assets/objects/object_ik/object_ik.h"
-#include "terminal.h"
-#include "versions.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -1359,7 +1380,8 @@ void EnIk_HandleCsCues(EnIk* this, PlayState* play) {
break;
default:
- PRINTF("En_Ik_inConfrontion_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Ik_inConfrontion_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Ik_inConfrontion_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
@@ -1394,7 +1416,8 @@ void EnIk_UpdateCutscene(Actor* thisx, PlayState* play) {
EnIk* this = (EnIk*)thisx;
if (this->csAction < 0 || this->csAction >= ARRAY_COUNT(sCsActionFuncs) || sCsActionFuncs[this->csAction] == NULL) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
@@ -1488,7 +1511,8 @@ void EnIk_DrawCutscene(Actor* thisx, PlayState* play) {
if (this->csDrawMode < 0 || this->csDrawMode >= ARRAY_COUNT(sCsDrawFuncs) ||
sCsDrawFuncs[this->csDrawMode] == NULL) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h
index 70c45063b5..a0ecd34d0f 100644
--- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h
+++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h
@@ -2,11 +2,11 @@
#define Z_EN_IK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnIk;
-typedef void (*EnIkActionFunc)(struct EnIk*, PlayState*);
+typedef void (*EnIkActionFunc)(struct EnIk*, struct PlayState*);
#define IK_GET_UPPER_PARAMS(thisx) PARAMS_GET_NOSHIFT(this->actor.params, 8, 8)
#define IK_GET_ARMOR_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 8)
diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c
index 7ce346f633..521b8dcbfa 100644
--- a/src/overlays/actors/ovl_En_In/z_en_in.c
+++ b/src/overlays/actors/ovl_En_In/z_en_in.c
@@ -1,6 +1,25 @@
#include "z_en_in.h"
-#include "versions.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "letterbox.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_in/object_in.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h
index 84b5db8bac..00774d0ddb 100644
--- a/src/overlays/actors/ovl_En_In/z_en_in.h
+++ b/src/overlays/actors/ovl_En_In/z_en_in.h
@@ -2,11 +2,11 @@
#define Z_EN_IN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnIn;
-typedef void (*EnInActionFunc)(struct EnIn*, PlayState*);
+typedef void (*EnInActionFunc)(struct EnIn*, struct PlayState*);
typedef enum IngoLimb {
/* 0x00 */ INGO_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c
index 4740bbc791..bc3640c4ac 100644
--- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c
+++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c
@@ -5,8 +5,22 @@
*/
#include "z_en_insect.h"
-#include "global.h"
+#include "overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_math3d.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS 0
@@ -55,7 +69,7 @@ ActorProfile En_Insect_Profile = {
/**/ EnInsect_Draw,
};
-static ColliderJntSphElementInit sColliderItemInit[1] = {
+static ColliderJntSphElementInit sColliderElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -79,7 +93,7 @@ static ColliderJntSphInit sColliderInit = {
COLSHAPE_JNTSPH,
},
1,
- sColliderItemInit,
+ sColliderElementsInit,
};
/**
@@ -192,7 +206,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) {
SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, &this->colliderItem);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->colliderElements);
this->actor.colChkInfo.mass = 30;
diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/src/overlays/actors/ovl_En_Insect/z_en_insect.h
index 31d2c1d050..7bf443a2ea 100644
--- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h
+++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h
@@ -3,7 +3,6 @@
#include "ultra64.h"
#include "z64actor.h"
-#include "overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h"
struct EnInsect;
@@ -22,7 +21,7 @@ typedef void (*EnInsectActionFunc)(struct EnInsect*, struct PlayState*);
typedef struct EnInsect {
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderJntSph collider;
- /* 0x016C */ ColliderJntSphElement colliderItem;
+ /* 0x016C */ ColliderJntSphElement colliderElements[1];
/* 0x01AC */ SkelAnime skelAnime;
/* 0x01F0 */ Vec3s jointTable[24];
/* 0x0280 */ Vec3s morphTable[24];
@@ -33,7 +32,7 @@ typedef struct EnInsect {
/* 0x031A */ s16 actionTimer;
/* 0x031C */ s16 lifeTimer;
/* 0x031E */ s16 crawlSoundDelay;
- /* 0x0320 */ ObjMakekinsuta* soilActor;
+ /* 0x0320 */ struct ObjMakekinsuta* soilActor;
/* 0x0324 */ f32 unk_324;
/* 0x0328 */ s16 unk_328;
/* 0x032A */ u8 unk_32A;
diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c
index 7e84670426..bcf59dfbe7 100644
--- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c
+++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c
@@ -7,9 +7,26 @@
#include "z_en_ishi.h"
#include "overlays/actors/ovl_En_Insect/z_en_insect.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
-#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "quake.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64item.h"
+#include "z64play.h"
+
+#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS ACTOR_FLAG_THROW_ONLY
diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h
index f4469ea7bc..731929a384 100644
--- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h
+++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h
@@ -2,7 +2,7 @@
#define Z_EN_ISHI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
// The switch flag value for this actor is constructed in a unique way.
// There are two separate param values which get OR'd together to create one final switch flag index.
@@ -25,9 +25,9 @@ typedef enum EnIshiType {
struct EnIshi;
-typedef void (*EnIshiActionFunc)(struct EnIshi*, PlayState*);
-typedef void (*EnIshiEffectSpawnFunc)(struct EnIshi*, PlayState*);
-typedef void (*EnIshiDrawFunc)(struct EnIshi*, PlayState*);
+typedef void (*EnIshiActionFunc)(struct EnIshi*, struct PlayState*);
+typedef void (*EnIshiEffectSpawnFunc)(struct EnIshi*, struct PlayState*);
+typedef void (*EnIshiDrawFunc)(struct EnIshi*, struct PlayState*);
typedef struct EnIshi {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c
index 312ceec96e..975fe8411f 100644
--- a/src/overlays/actors/ovl_En_It/z_en_it.c
+++ b/src/overlays/actors/ovl_En_It/z_en_it.c
@@ -6,6 +6,8 @@
#include "z_en_it.h"
+#include "z64play.h"
+
#define FLAGS 0
void EnIt_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_It/z_en_it.h b/src/overlays/actors/ovl_En_It/z_en_it.h
index fb150fcb0d..9f1f794e4f 100644
--- a/src/overlays/actors/ovl_En_It/z_en_it.h
+++ b/src/overlays/actors/ovl_En_It/z_en_it.h
@@ -2,7 +2,7 @@
#define Z_EN_IT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnIt;
diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c
index a03c20c9ea..3f6b3c587c 100644
--- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c
+++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c
@@ -5,9 +5,21 @@
*/
#include "z_en_jj.h"
-#include "assets/objects/object_jj/object_jj.h"
#include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_jj/object_jj.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
typedef enum EnJjEyeState {
diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.h b/src/overlays/actors/ovl_En_Jj/z_en_jj.h
index c5d6241204..9ac2df8bb4 100644
--- a/src/overlays/actors/ovl_En_Jj/z_en_jj.h
+++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.h
@@ -2,11 +2,11 @@
#define Z_EN_JJ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnJj;
-typedef void (*EnJjActionFunc)(struct EnJj*, PlayState*);
+typedef void (*EnJjActionFunc)(struct EnJj*, struct PlayState*);
typedef struct EnJj {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c
index 6cd5163aec..f5aee34c6a 100644
--- a/src/overlays/actors/ovl_En_Js/z_en_js.c
+++ b/src/overlays/actors/ovl_En_Js/z_en_js.c
@@ -5,6 +5,15 @@
*/
#include "z_en_js.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "regs.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_js/object_js.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.h b/src/overlays/actors/ovl_En_Js/z_en_js.h
index f1e356b2c1..e1e22f547d 100644
--- a/src/overlays/actors/ovl_En_Js/z_en_js.h
+++ b/src/overlays/actors/ovl_En_Js/z_en_js.h
@@ -2,11 +2,11 @@
#define Z_EN_JS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnJs;
-typedef void (*EnJsActionFunc)(struct EnJs*, PlayState*);
+typedef void (*EnJsActionFunc)(struct EnJs*, struct PlayState*);
typedef struct EnJs {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c
index 6650e31715..fce6c4ef03 100644
--- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c
+++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c
@@ -7,6 +7,17 @@
#include "z_en_jsjutan.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
void EnJsjutan_Init(Actor* thisx, PlayState* play);
@@ -27,6 +38,8 @@ ActorProfile En_Jsjutan_Profile = {
};
// Shadow texture. 32x64 I8.
+#define sShadowTex_WIDTH 32
+#define sShadowTex_HEIGHT 64
static u8 sShadowTex[0x800];
static Vec3s D_80A8EE10[0x90];
diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h
index 63a694bad6..b6c4b07591 100644
--- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h
+++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h
@@ -2,7 +2,7 @@
#define Z_EN_JSJUTAN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnJsjutan;
diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
index d5ada18305..d2d807cd28 100644
--- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
+++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
@@ -5,7 +5,22 @@
*/
#include "z_en_kakasi.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ka/object_ka.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h
index ceef6afe9c..c2eff368ca 100644
--- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h
+++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h
@@ -2,11 +2,11 @@
#define Z_EN_KAKASI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnKakasi;
-typedef void (*EnKakasiFunc)(struct EnKakasi*, PlayState*);
+typedef void (*EnKakasiFunc)(struct EnKakasi*, struct PlayState*);
typedef struct EnKakasi {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c
index 45a9390f63..7651842925 100644
--- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c
+++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c
@@ -5,7 +5,20 @@
*/
#include "z_en_kakasi2.h"
+
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ka/object_ka.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h
index 9309c16725..c3398d7e7f 100644
--- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h
+++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h
@@ -2,11 +2,11 @@
#define Z_EN_KAKASI2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnKakasi2;
-typedef void (*EnKakasi2ActionFunc)(struct EnKakasi2*, PlayState*);
+typedef void (*EnKakasi2ActionFunc)(struct EnKakasi2*, struct PlayState*);
typedef struct EnKakasi2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c
index c670a19efb..8f4d21e36d 100644
--- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c
+++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c
@@ -5,7 +5,22 @@
*/
#include "z_en_kakasi3.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ka/object_ka.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h
index f402ab5ded..e09b98a9fb 100644
--- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h
+++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h
@@ -2,11 +2,11 @@
#define Z_EN_KAKASI3_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnKakasi3;
-typedef void (*EnKakasi3ActionFunc)(struct EnKakasi3*, PlayState*);
+typedef void (*EnKakasi3ActionFunc)(struct EnKakasi3*, struct PlayState*);
typedef struct EnKakasi3 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
index 03242220e0..844a7ee2a8 100644
--- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
+++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
@@ -5,10 +5,28 @@
*/
#include "z_en_kanban.h"
-#include "global.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_kanban/object_kanban.h"
-#include "terminal.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban_gfx.inc.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban_gfx.inc.c
index c38e9df942..3dca1d6259 100644
--- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban_gfx.inc.c
+++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban_gfx.inc.c
@@ -1,4 +1,4 @@
-#include "z_en_kanban.h"
+#include "ultra64.h"
static u16 sShadowTexFlags[] = {
0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x100,
diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c
index cdba59e661..be3b0eacb5 100644
--- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c
+++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c
@@ -5,9 +5,21 @@
*/
#include "z_en_karebaba.h"
+#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_dekubaba/object_dekubaba.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
-#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h
index 0687ade588..97b04f1a7f 100644
--- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h
+++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h
@@ -2,11 +2,11 @@
#define Z_EN_KAREBABA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnKarebaba;
-typedef void (*EnKarebabaActionFunc)(struct EnKarebaba*, PlayState*);
+typedef void (*EnKarebabaActionFunc)(struct EnKarebaba*, struct PlayState*);
typedef struct EnKarebaba {
/* 0x0000 */ Actor actor;
@@ -14,7 +14,7 @@ typedef struct EnKarebaba {
/* 0x0190 */ EnKarebabaActionFunc actionFunc;
/* 0x0194 */ Vec3s jointTable[8];
/* 0x01C4 */ Vec3s morphTable[8];
- /* 0x01F4 */ CollisionPoly* boundFloor;
+ /* 0x01F4 */ struct CollisionPoly* boundFloor;
/* 0x01F8 */ ColliderCylinder headCollider;
/* 0x0244 */ ColliderCylinder bodyCollider;
} EnKarebaba; // size = 0x0290
diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c
index 32f3829721..2ba0af36ef 100644
--- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c
+++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c
@@ -5,12 +5,25 @@
*/
#include "z_en_ko.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "versions.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_fa/object_fa.h"
#include "assets/objects/object_os_anime/object_os_anime.h"
#include "assets/objects/object_km1/object_km1.h"
#include "assets/objects/object_kw1/object_kw1.h"
-#include "terminal.h"
-#include "versions.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -1173,11 +1186,11 @@ void func_80A99048(EnKo* this, PlayState* play) {
if (EnKo_IsOsAnimeLoaded(this, play) && EnKo_AreObjectsLoaded(this, play)) {
this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED;
this->actor.objectSlot = this->legsObjectSlot;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
SkelAnime_InitFlex(play, &this->skelAnime, sSkeleton[sModelInfo[ENKO_TYPE].legsId].flexSkeletonHeader, NULL,
this->jointTable, this->morphTable, 16);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
@@ -1292,7 +1305,7 @@ void EnKo_Update(Actor* thisx, PlayState* play) {
if (this->actionFunc != func_80A99048) {
if ((s32)this->modelAlpha != 0) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
SkelAnime_Update(&this->skelAnime);
func_80A98DB4(this, play);
EnKo_Blink(this);
@@ -1325,7 +1338,7 @@ s32 EnKo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
if (limbIndex == 15) {
gSPSegment((*gfx)++, 0x06, play->objectCtx.slots[this->headObjectSlot].segment);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->headObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->headObjectSlot].segment);
headId = sModelInfo[ENKO_TYPE].headId;
*dList = sHead[headId].dList;
@@ -1333,7 +1346,7 @@ s32 EnKo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
eyeTexture = sHead[headId].eyeTextures[this->eyeTextureIndex];
gSPSegment((*gfx)++, 0x0A, SEGMENTED_TO_VIRTUAL(eyeTexture));
}
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->legsObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->legsObjectSlot].segment);
}
if (limbIndex == 8) {
limbRot = this->interactInfo.torsoRot;
@@ -1361,7 +1374,7 @@ void EnKo_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s* rot,
if (limbIndex == 7) {
gSPSegment((*gfx)++, 0x06, play->objectCtx.slots[this->bodyObjectSlot].segment);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->bodyObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->bodyObjectSlot].segment);
}
if (limbIndex == 15) {
Matrix_MultVec3f(&D_80A9A774, &this->actor.focus.pos);
diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.h b/src/overlays/actors/ovl_En_Ko/z_en_ko.h
index 085e9aca54..d9531e57e6 100644
--- a/src/overlays/actors/ovl_En_Ko/z_en_ko.h
+++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.h
@@ -2,11 +2,11 @@
#define Z_EN_KO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnKo;
-typedef void (*EnKoActionFunc)(struct EnKo*, PlayState*);
+typedef void (*EnKoActionFunc)(struct EnKo*, struct PlayState*);
typedef struct EnKo {
/* 0x0000 */ Actor actor;
@@ -17,7 +17,7 @@ typedef struct EnKo {
/* 0x0196 */ s8 legsObjectSlot;
/* 0x0197 */ s8 osAnimeObjectSlot;
/* 0x0198 */ ColliderCylinder collider;
- /* 0x01E4 */ Path* path;
+ /* 0x01E4 */ struct Path* path;
/* 0x01E8 */ NpcInteractInfo interactInfo;
/* 0x0210 */ u8 unk_210; // block trade quest sfx
/* 0x0212 */ s16 forestQuestState;
diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c
index e46125878e..aa955365dd 100644
--- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c
+++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c
@@ -7,10 +7,22 @@
#include "z_en_kusa.h"
#include "overlays/actors/ovl_En_Insect/z_en_insect.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "sfx.h"
+#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#include "assets/objects/object_kusa/object_kusa.h"
-#include "terminal.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_THROW_ONLY)
diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h
index 4a895fe15a..a375581cf9 100644
--- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h
+++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h
@@ -2,11 +2,11 @@
#define Z_EN_KUSA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnKusa;
-typedef void (*EnKusaActionFunc)(struct EnKusa*, PlayState*);
+typedef void (*EnKusaActionFunc)(struct EnKusa*, struct PlayState*);
typedef enum EnKusaType {
/* 0 */ ENKUSA_TYPE_0,
diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c
index a4aaf4e1ca..7caa735739 100644
--- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c
+++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c
@@ -5,7 +5,21 @@
*/
#include "z_en_kz.h"
+
+#include "libc64/math64.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_kz/object_kz.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.h b/src/overlays/actors/ovl_En_Kz/z_en_kz.h
index b5cd380791..933fbe2617 100644
--- a/src/overlays/actors/ovl_En_Kz/z_en_kz.h
+++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.h
@@ -2,11 +2,11 @@
#define Z_EN_KZ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnKz;
-typedef void (*EnKzActionFunc)(struct EnKz*, PlayState*);
+typedef void (*EnKzActionFunc)(struct EnKz*, struct PlayState*);
typedef struct EnKz {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c
index 33d671a95f..f0cc5dddc6 100644
--- a/src/overlays/actors/ovl_En_Light/z_en_light.c
+++ b/src/overlays/actors/ovl_En_Light/z_en_light.c
@@ -5,6 +5,17 @@
*/
#include "z_en_light.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.h b/src/overlays/actors/ovl_En_Light/z_en_light.h
index 1cbf786b00..035471f47d 100644
--- a/src/overlays/actors/ovl_En_Light/z_en_light.h
+++ b/src/overlays/actors/ovl_En_Light/z_en_light.h
@@ -2,7 +2,8 @@
#define Z_EN_LIGHT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnLight;
diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c
index c2b6ca1d6c..b4bd3af91b 100644
--- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c
+++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c
@@ -5,6 +5,12 @@
*/
#include "z_en_lightbox.h"
+
+#include "regs.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_lightbox/object_lightbox.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h
index e24afd44e1..c09c77f850 100644
--- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h
+++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h
@@ -2,7 +2,7 @@
#define Z_EN_LIGHTBOX_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnLightbox;
diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c
index 9acedc1552..2097bb9d26 100644
--- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c
+++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c
@@ -6,6 +6,9 @@
#include "z_en_m_fire1.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#define FLAGS 0
void EnMFire1_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h
index 10d3e3fef7..59ebb44318 100644
--- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h
+++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h
@@ -2,7 +2,7 @@
#define Z_EN_M_FIRE1_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMFire1;
diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c
index eb7745aa86..ba34f9adcc 100644
--- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c
+++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c
@@ -1,4 +1,17 @@
#include "z_en_m_thunder.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h
index 4cb7ad215c..8c7cdd7a1f 100644
--- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h
+++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h
@@ -2,11 +2,12 @@
#define Z_EN_M_THUNDER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnMThunder;
-typedef void (*EnMThunderActionFunc)(struct EnMThunder*, PlayState*);
+typedef void (*EnMThunderActionFunc)(struct EnMThunder*, struct PlayState*);
typedef struct EnMThunder {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c
index d0c16c3a72..9c1689a524 100644
--- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c
+++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c
@@ -5,6 +5,20 @@
*/
#include "z_en_ma1.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ma1/object_ma1.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h
index ef69c0c8e4..3664fc98a8 100644
--- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h
+++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h
@@ -2,11 +2,11 @@
#define Z_EN_MA1_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMa1;
-typedef void (*EnMa1ActionFunc)(struct EnMa1*, PlayState*);
+typedef void (*EnMa1ActionFunc)(struct EnMa1*, struct PlayState*);
typedef struct EnMa1 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c
index a4a4a17049..aed88bb92c 100644
--- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c
+++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c
@@ -1,4 +1,19 @@
#include "z_en_ma2.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ma2/object_ma2.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h
index 390c61da21..81fddf7672 100644
--- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h
+++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h
@@ -2,11 +2,11 @@
#define Z_EN_MA2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMa2;
-typedef void (*EnMa2ActionFunc)(struct EnMa2*, PlayState*);
+typedef void (*EnMa2ActionFunc)(struct EnMa2*, struct PlayState*);
typedef enum AdultMalonLimb {
/* 0x00 */ MALON_ADULT_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c
index 69dc0d907a..cdac009221 100644
--- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c
+++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c
@@ -5,8 +5,21 @@
*/
#include "z_en_ma3.h"
-#include "assets/objects/object_ma2/object_ma2.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
#include "versions.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_ma2/object_ma2.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h
index 2b9dea812d..ecf637561e 100644
--- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h
+++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h
@@ -2,11 +2,11 @@
#define Z_EN_MA3_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMa3;
-typedef void (*EnMa3ActionFunc)(struct EnMa3*, PlayState*);
+typedef void (*EnMa3ActionFunc)(struct EnMa3*, struct PlayState*);
typedef enum AdultMalonLimb {
/* 0x00 */ MALON_ADULT_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c
index a56c9e5fd1..ef02aacdd3 100644
--- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c
+++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c
@@ -5,12 +5,29 @@
*/
#include "z_en_mag.h"
-#include "versions.h"
-#include "assets/objects/object_mag/object_mag.h"
+
+#include "array_count.h"
+#include "avoid_ub.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "gfxalloc.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "translation.h"
#include "versions.h"
+#include "z64audio.h"
+#include "z64cutscene_flags.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64ss_sram.h"
+
+#include "assets/objects/object_mag/object_mag.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -58,8 +75,8 @@ void EnMag_ResetSram(void) {
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8007000), buffer, 0x800, 1);
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8007800), buffer, 0x800, 1);
- gSaveContext.audioSetting = gSaveContext.zTargetSetting = 0;
- func_800F6700(gSaveContext.audioSetting);
+ gSaveContext.soundSetting = gSaveContext.zTargetSetting = 0; // SOUND_SETTING_STEREO/Z_TARGET_SETTING_SWITCH
+ Audio_SetSoundOutputMode(gSaveContext.soundSetting);
}
#endif
diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.h b/src/overlays/actors/ovl_En_Mag/z_en_mag.h
index e7c516c629..ace8427278 100644
--- a/src/overlays/actors/ovl_En_Mag/z_en_mag.h
+++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.h
@@ -2,7 +2,8 @@
#define Z_EN_MAG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64message.h"
struct EnMag;
diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c
index 1e97b32486..485052002e 100644
--- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c
+++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c
@@ -5,8 +5,24 @@
*/
#include "z_en_mb.h"
-#include "assets/objects/object_mb/object_mb.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_mb/object_mb.h"
/*
* This actor can have three behaviors:
diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.h b/src/overlays/actors/ovl_En_Mb/z_en_mb.h
index 66afb9eeb1..8c3ddc6029 100644
--- a/src/overlays/actors/ovl_En_Mb/z_en_mb.h
+++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.h
@@ -2,11 +2,11 @@
#define Z_EN_MB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMb;
-typedef void (*EnMbActionFunc)(struct EnMb*, PlayState*);
+typedef void (*EnMbActionFunc)(struct EnMb*, struct PlayState*);
typedef enum EnMbState {
/* 0 */ ENMB_STATE_SPEAR_SPEARPATH_DAMAGED,
diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c
index 93ba4f894c..296f4d42af 100644
--- a/src/overlays/actors/ovl_En_Md/z_en_md.c
+++ b/src/overlays/actors/ovl_En_Md/z_en_md.c
@@ -5,9 +5,23 @@
*/
#include "z_en_md.h"
-#include "assets/objects/object_md/object_md.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
+#include "libc64/math64.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_md/object_md.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.h b/src/overlays/actors/ovl_En_Md/z_en_md.h
index 6a78a24904..bfd9b0450a 100644
--- a/src/overlays/actors/ovl_En_Md/z_en_md.h
+++ b/src/overlays/actors/ovl_En_Md/z_en_md.h
@@ -2,7 +2,7 @@
#define Z_EN_MD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMd;
@@ -27,7 +27,7 @@ typedef enum EnMdLimb {
ENMD_LIMB_MAX
} EnMdLimb;
-typedef void (*EnMdActionFunc)(struct EnMd*, PlayState*);
+typedef void (*EnMdActionFunc)(struct EnMd*, struct PlayState*);
#define ENMD_GET_PATH_INDEX(this) PARAMS_GET_S(this->actor.params, 8, 8)
#define ENMD_GET_PATH_INDEX_NOSHIFT(this) PARAMS_GET_NOSHIFT(this->actor.params, 8, 8)
diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c
index df7708a699..f035f2d331 100644
--- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c
+++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c
@@ -5,6 +5,17 @@
*/
#include "z_en_mk.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_mk/object_mk.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.h b/src/overlays/actors/ovl_En_Mk/z_en_mk.h
index 5b8a438a00..53df56b76a 100644
--- a/src/overlays/actors/ovl_En_Mk/z_en_mk.h
+++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.h
@@ -2,11 +2,11 @@
#define Z_EN_MK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMk;
-typedef void (*EnMkActionFunc)(struct EnMk*, PlayState*);
+typedef void (*EnMkActionFunc)(struct EnMk*, struct PlayState*);
typedef struct EnMk {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c
index b081f8304c..75969dd224 100644
--- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c
+++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c
@@ -5,6 +5,20 @@
*/
#include "z_en_mm.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_mm/object_mm.h"
#include "assets/objects/object_link_child/object_link_child.h"
diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.h b/src/overlays/actors/ovl_En_Mm/z_en_mm.h
index 7646e1f044..555073753f 100644
--- a/src/overlays/actors/ovl_En_Mm/z_en_mm.h
+++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.h
@@ -2,11 +2,11 @@
#define Z_EN_MM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMm;
-typedef void (*EnMmActionFunc)(struct EnMm*, PlayState*);
+typedef void (*EnMmActionFunc)(struct EnMm*, struct PlayState*);
typedef struct EnMm {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
index 3082b5c35d..d2f444a193 100644
--- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
+++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
@@ -5,7 +5,19 @@
*/
#include "z_en_mm2.h"
+
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_mm/object_mm.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h
index a5edeb9cb5..8e48261d7c 100644
--- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h
+++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h
@@ -2,11 +2,11 @@
#define Z_EN_MM2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMm2;
-typedef void (*EnMm2ActionFunc)(struct EnMm2*, PlayState*);
+typedef void (*EnMm2ActionFunc)(struct EnMm2*, struct PlayState*);
typedef struct EnMm2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c
index 35796e1eb7..18ebac054a 100644
--- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c
+++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c
@@ -5,6 +5,15 @@
*/
#include "z_en_ms.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_ms/object_ms.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.h b/src/overlays/actors/ovl_En_Ms/z_en_ms.h
index 53c6bbeaca..9ace7bc2d0 100644
--- a/src/overlays/actors/ovl_En_Ms/z_en_ms.h
+++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.h
@@ -2,11 +2,11 @@
#define Z_EN_MS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMs;
-typedef void (*EnMsActionFunc)(struct EnMs*, PlayState*);
+typedef void (*EnMsActionFunc)(struct EnMs*, struct PlayState*);
typedef struct EnMs {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c
index 4f4221820f..7360dd7f18 100644
--- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c
+++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c
@@ -5,6 +5,15 @@
*/
#include "z_en_mu.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_mu/object_mu.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.h b/src/overlays/actors/ovl_En_Mu/z_en_mu.h
index 1b098eb417..417ce242b1 100644
--- a/src/overlays/actors/ovl_En_Mu/z_en_mu.h
+++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.h
@@ -2,7 +2,7 @@
#define Z_EN_MU_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnMu;
diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c
index 983af06780..2a00eb9ef6 100644
--- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c
+++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c
@@ -5,10 +5,29 @@
*/
#include "z_en_nb.h"
-#include "terminal.h"
-#include "assets/objects/object_nb/object_nb.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+#include "libc64/math64.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_nb/object_nb.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
typedef enum EnNbAction {
@@ -676,8 +695,8 @@ void EnNb_CheckKidnapCsMode(EnNb* this, PlayState* play) {
Actor_Kill(&this->actor);
break;
default:
- // "Operation Doesn't Exist!!!!!!!!"
- PRINTF("En_Nb_Kidnap_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Nb_Kidnap_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Nb_Kidnap_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->cueId = nextCueId;
@@ -895,8 +914,8 @@ void EnNb_CheckConfrontationCsMode(EnNb* this, PlayState* play) {
EnNb_SetupConfrontationDestroy(this);
break;
default:
- // "En_Nb_Confrontion_Check_DemoMode: Operation doesn't exist!!!!!!!!"
- PRINTF("En_Nb_Confrontion_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Nb_Confrontion_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Nb_Confrontion_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->cueId = nextCueId;
@@ -1083,8 +1102,8 @@ void EnNb_CheckCreditsCsModeImpl(EnNb* this, PlayState* play) {
EnNb_SetupCreditsHeadTurn(this);
break;
default:
- // "En_Nb_inEnding_Check_DemoMode: Operation doesn't exist!!!!!!!!"
- PRINTF("En_Nb_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Nb_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Nb_inEnding_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->cueId = nextCueId;
@@ -1442,8 +1461,8 @@ void EnNb_Update(Actor* thisx, PlayState* play) {
EnNb* this = (EnNb*)thisx;
if (this->action < 0 || this->action > 30 || sActionFuncs[this->action] == NULL) {
- // "Main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
@@ -1550,8 +1569,8 @@ void EnNb_Draw(Actor* thisx, PlayState* play) {
EnNb* this = (EnNb*)thisx;
if (this->drawMode < 0 || this->drawMode >= 5 || sDrawFuncs[this->drawMode] == NULL) {
- // "Draw mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/src/overlays/actors/ovl_En_Nb/z_en_nb.h
index 997af0f573..3ed08cbf8e 100644
--- a/src/overlays/actors/ovl_En_Nb/z_en_nb.h
+++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.h
@@ -2,7 +2,7 @@
#define Z_EN_NB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnNb;
@@ -29,8 +29,8 @@ typedef enum EnNbLimb {
/* 0x13 */ NB_LIMB_MAX
} EnNbLimb;
-typedef void (*EnNbActionFunc)(struct EnNb*, PlayState*);
-typedef void (*EnNbDrawFunc)(struct EnNb*, PlayState*);
+typedef void (*EnNbActionFunc)(struct EnNb*, struct PlayState*);
+typedef void (*EnNbDrawFunc)(struct EnNb*, struct PlayState*);
typedef struct EnNb {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c
index 144c76b2cb..6be5e39db0 100644
--- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c
+++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c
@@ -5,10 +5,30 @@
*/
#include "z_en_niw.h"
-#include "assets/objects/object_niw/object_niw.h"
#include "overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_niw/object_niw.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_THROW_ONLY)
diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.h b/src/overlays/actors/ovl_En_Niw/z_en_niw.h
index 283b6a52cd..a0f58d0a35 100644
--- a/src/overlays/actors/ovl_En_Niw/z_en_niw.h
+++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.h
@@ -2,11 +2,11 @@
#define Z_EN_NIW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnNiw;
-typedef void (*EnNiwActionFunc)(struct EnNiw*, PlayState*);
+typedef void (*EnNiwActionFunc)(struct EnNiw*, struct PlayState*);
typedef struct EnNiwEffect {
/* 0x0000 */ u8 type;
diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c
index 6af946ddeb..6a2468f93f 100644
--- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c
+++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c
@@ -5,8 +5,22 @@
*/
#include "z_en_niw_girl.h"
-#include "assets/objects/object_gr/object_gr.h"
+#include "overlays/actors/ovl_En_Niw/z_en_niw.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_gr/object_gr.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h
index e63e2df72f..422cf33e48 100644
--- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h
+++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h
@@ -2,12 +2,11 @@
#define Z_EN_NIW_GIRL_H
#include "ultra64.h"
-#include "global.h"
-#include "../ovl_En_Niw/z_en_niw.h"
+#include "z64actor.h"
struct EnNiwGirl;
-typedef void (*EnNiwGirlActionFunc)(struct EnNiwGirl*, PlayState*);
+typedef void (*EnNiwGirlActionFunc)(struct EnNiwGirl*, struct PlayState*);
typedef struct EnNiwGirl {
/* 0x0000 */ Actor actor;
@@ -27,7 +26,7 @@ typedef struct EnNiwGirl {
/* 0x027A */ s16 unk_27A;
/* 0x027C */ f32 unk_27C;
/* 0x0280 */ f32 unk_280;
- /* 0x0284 */ EnNiw* chasedEnNiw;
+ /* 0x0284 */ struct EnNiw* chasedEnNiw;
/* 0x0288 */ ColliderCylinder collider;
/* 0x02D4 */ NpcInteractInfo interactInfo;
} EnNiwGirl; // size = 0x02FC
diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c
index 0415f95bb9..2d00504577 100644
--- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c
+++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c
@@ -1,9 +1,24 @@
#include "z_en_niw_lady.h"
-#include "assets/objects/object_ane/object_ane.h"
-#include "assets/objects/object_os_anime/object_os_anime.h"
#include "overlays/actors/ovl_En_Niw/z_en_niw.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_ane/object_ane.h"
+#include "assets/objects/object_os_anime/object_os_anime.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -156,9 +171,9 @@ void func_80AB9F24(EnNiwLady* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->aneObjectSlot) &&
Object_IsLoaded(&play->objectCtx, this->osAnimeObjectSlot)) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->aneObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->aneObjectSlot].segment);
SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoLadySkel, NULL, this->jointTable, this->morphTable, 16);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
this->unk_27E = 1;
this->actor.gravity = -3.0f;
Actor_SetScale(&this->actor, 0.01f);
@@ -519,7 +534,7 @@ void EnNiwLady_Update(Actor* thisx, PlayState* play) {
if (this->unk_276 == 0) {
Math_SmoothStepToS(&this->headRot.y, 0, 5, 3000, 0);
}
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
if (this->osAnimeObjectSlot >= 0) {
if (this->unk_27E != 0) {
if (this->unk_26E != 0) {
diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h
index 7ecb165cca..a6167454da 100644
--- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h
+++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h
@@ -2,11 +2,11 @@
#define Z_EN_NIW_LADY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnNiwLady;
-typedef void (*EnNiwLadyActionFunc)(struct EnNiwLady*, PlayState*);
+typedef void (*EnNiwLadyActionFunc)(struct EnNiwLady*, struct PlayState*);
typedef struct EnNiwLady {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c
index 114971a1de..3511a3c45d 100644
--- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c
+++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c
@@ -6,6 +6,16 @@
#include "z_en_nutsball.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_dekunuts/object_dekunuts.h"
#include "assets/objects/object_hintnuts/object_hintnuts.h"
#include "assets/objects/object_shopnuts/object_shopnuts.h"
diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h
index 00fe77a05c..bcd4e0a936 100644
--- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h
+++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h
@@ -2,7 +2,7 @@
#define Z_EN_NUTSBALL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#define NUTSBALL_GET_TYPE(thisx) ((thisx)->params)
@@ -16,7 +16,7 @@ typedef enum EnNutsballType {
struct EnNutsball;
-typedef void (*EnNutsballActionFunc)(struct EnNutsball*, PlayState*);
+typedef void (*EnNutsballActionFunc)(struct EnNutsball*, struct PlayState*);
typedef struct EnNutsball {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
index a990438adb..a5f322def6 100644
--- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
+++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
@@ -5,6 +5,14 @@
*/
#include "z_en_nwc.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_nwc/object_nwc.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h
index e927cb3b66..fbb64d1ca2 100644
--- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h
+++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h
@@ -2,13 +2,13 @@
#define Z_EN_NWC_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnNwc;
struct EnNwcChick;
-typedef void (*EnNwcUpdateFunc)(struct EnNwc*, PlayState*);
-typedef void (*EnNwcChickFunc)(struct EnNwcChick*, struct EnNwc*, PlayState*);
+typedef void (*EnNwcUpdateFunc)(struct EnNwc*, struct PlayState*);
+typedef void (*EnNwcChickFunc)(struct EnNwcChick*, struct EnNwc*, struct PlayState*);
typedef struct EnNwcChick {
/* 0x00 */ s8 type;
@@ -21,8 +21,8 @@ typedef struct EnNwcChick {
/* 0x2C */ f32 velY;
/* 0x30 */ Vec3s rot;
/* 0x36 */ u16 height;
- /* 0x38 */ CollisionPoly* floorPoly;
- /* 0x44 */ char unk_3C[0x20];
+ /* 0x38 */ struct CollisionPoly* floorPoly;
+ /* 0x3C */ char unk_3C[0x20];
} EnNwcChick; // size = 0x5C
typedef struct EnNwc {
diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c
index e31bd37d52..d7f4537512 100644
--- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c
+++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c
@@ -1,4 +1,19 @@
#include "z_en_ny.h"
+
+#include "libc64/math64.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_ny/object_ny.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
@@ -110,7 +125,7 @@ void EnNy_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.damageTable = &sDamageTable;
this->actor.colChkInfo.health = 2;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->elements);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->colliderElements);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
this->unk_1CA = 0;
this->unk_1D0 = 0;
diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.h b/src/overlays/actors/ovl_En_Ny/z_en_ny.h
index 18c109cc51..03cace42fb 100644
--- a/src/overlays/actors/ovl_En_Ny/z_en_ny.h
+++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.h
@@ -2,17 +2,17 @@
#define Z_EN_NY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnNy;
-typedef void (*EnNyActionFunc)(struct EnNy*, PlayState*);
+typedef void (*EnNyActionFunc)(struct EnNy*, struct PlayState*);
typedef struct EnNy {
/* 0x0000 */ Actor actor;
/* 0x014C */ EnNyActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement elements[1];
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
/* 0x01B0 */ char unk_1B0[0x18];
/* 0x01C8 */ s16 timer;
/* 0x01CA */ s16 unk_1CA;
diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c
index f89eb3ce99..f568d1812b 100644
--- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c
+++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c
@@ -6,6 +6,8 @@
#include "z_en_oe2.h"
+#include "z64play.h"
+
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
void EnOE2_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.h b/src/overlays/actors/ovl_En_OE2/z_en_oe2.h
index 635495bb7d..062e103819 100644
--- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.h
+++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.h
@@ -2,11 +2,11 @@
#define Z_EN_OE2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnOE2;
-typedef void (*EnOE2ActionFunc)(struct EnOE2*, PlayState*);
+typedef void (*EnOE2ActionFunc)(struct EnOE2*, struct PlayState*);
typedef struct EnOE2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c
index 40eef58eb4..eb9941b46b 100644
--- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c
+++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c
@@ -5,10 +5,18 @@
*/
#include "z_en_okarina_effect.h"
+
+#include "printf.h"
+#include "regs.h"
+#include "sequence.h"
#include "terminal.h"
#include "versions.h"
-
+#include "z64audio.h"
+#include "z64cutscene_flags.h"
+#include "z64debug_display.h"
#include "z64frame_advance.h"
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h
index f45c4a88ee..bca8c99234 100644
--- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h
+++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h
@@ -2,11 +2,11 @@
#define Z_EN_OKARINA_EFFECT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnOkarinaEffect;
-typedef void (*EnOkarinaEffectActionFunc)(struct EnOkarinaEffect*, PlayState*);
+typedef void (*EnOkarinaEffectActionFunc)(struct EnOkarinaEffect*, struct PlayState*);
typedef struct EnOkarinaEffect {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c
index 96928130ae..2ec4c8f08f 100644
--- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c
+++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c
@@ -5,10 +5,24 @@
*/
#include "z_en_okarina_tag.h"
-#include "assets/scenes/misc/hakaana_ouke/hakaana_ouke_scene.h"
-#include "assets/scenes/overworld/spot02/spot02_scene.h"
+
+#include "attributes.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64debug_display.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/scenes/misc/hakaana_ouke/hakaana_ouke_scene.h"
+#include "assets/scenes/overworld/spot02/spot02_scene.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h
index 1192d0cfce..76ac1581a5 100644
--- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h
+++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h
@@ -2,11 +2,11 @@
#define Z_EN_OKARINA_TAG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnOkarinaTag;
-typedef void (*EnOkarinaTagActionFunc)(struct EnOkarinaTag*, PlayState*);
+typedef void (*EnOkarinaTagActionFunc)(struct EnOkarinaTag*, struct PlayState*);
typedef struct EnOkarinaTag {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c
index f0c0b4d3b3..2ff69c780e 100644
--- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c
+++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c
@@ -1,5 +1,6 @@
-#include "z_en_okarina_tag.h"
+#include "sequence.h"
#include "z64cutscene_commands.h"
+#include "z64player.h"
// clang-format off
CutsceneData gWindmillSpinningFasterCs[] = {
diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c
index 0baff94145..b7063e0f00 100644
--- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c
+++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c
@@ -1,4 +1,18 @@
#include "z_en_okuta.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_okuta/object_okuta.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h
index 01c2ba1140..5409481022 100644
--- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h
+++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h
@@ -2,11 +2,11 @@
#define Z_EN_OKUTA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnOkuta;
-typedef void (*EnOkutaActionFunc)(struct EnOkuta*, PlayState*);
+typedef void (*EnOkutaActionFunc)(struct EnOkuta*, struct PlayState*);
typedef struct EnOkuta {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c
index a083ef85d7..9d70c9019a 100644
--- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c
+++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c
@@ -1,5 +1,23 @@
#include "z_en_ossan.h"
+#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
+#include "overlays/actors/ovl_En_GirlA/z_en_girla.h"
+#include "overlays/actors/ovl_En_Tana/z_en_tana.h"
+
+#include "libc64/qrand.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_ossan/object_ossan.h"
#include "assets/objects/object_oF1d_map/object_oF1d_map.h"
@@ -7,7 +25,6 @@
#include "assets/objects/object_zo/object_zo.h"
#include "assets/objects/object_rs/object_rs.h"
#include "assets/objects/object_ds2/object_ds2.h"
-#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "assets/objects/object_masterkokiri/object_masterkokiri.h"
#include "assets/objects/object_km1/object_km1.h"
#include "assets/objects/object_mastergolon/object_mastergolon.h"
@@ -2008,7 +2025,7 @@ void EnOssan_InitBazaarShopkeeper(EnOssan* this, PlayState* play) {
void EnOssan_InitKokiriShopkeeper(EnOssan* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gKm1Skel, NULL, NULL, NULL, 0);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
Animation_Change(&this->skelAnime, &object_masterkokiri_Anim_0004A8, 1.0f, 0.0f,
Animation_GetLastFrame(&object_masterkokiri_Anim_0004A8), 0, 0.0f);
this->actor.draw = EnOssan_DrawKokiriShopkeeper;
@@ -2019,7 +2036,7 @@ void EnOssan_InitKokiriShopkeeper(EnOssan* this, PlayState* play) {
void EnOssan_InitGoronShopkeeper(EnOssan* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, NULL, NULL, 0);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
Animation_Change(&this->skelAnime, &gGoronShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGoronShopkeeperAnim),
0, 0.0f);
this->actor.draw = EnOssan_DrawGoronShopkeeper;
@@ -2028,7 +2045,7 @@ void EnOssan_InitGoronShopkeeper(EnOssan* this, PlayState* play) {
void EnOssan_InitZoraShopkeeper(EnOssan* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, NULL, NULL, NULL, 0);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
Animation_Change(&this->skelAnime, &gZoraShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gZoraShopkeeperAnim),
0, 0.0f);
this->actor.draw = EnOssan_DrawZoraShopkeeper;
@@ -2211,7 +2228,7 @@ void EnOssan_InitActionFunc(EnOssan* this, PlayState* play) {
}
void EnOssan_Obj3ToSeg6(EnOssan* this, PlayState* play) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
}
void EnOssan_MainActionFunc(EnOssan* this, PlayState* play) {
@@ -2381,7 +2398,7 @@ s32 EnOssan_OverrideLimbDrawKokiriShopkeeper(PlayState* play, s32 limbIndex, Gfx
if (limbIndex == 15) {
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlot2].segment);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot2].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot2].segment);
*dList = gKokiriShopkeeperHeadDL;
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(sKokiriShopkeeperEyeTextures[this->eyeTextureIdx]));
}
diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h
index c2101e9d9e..7df4be57b8 100644
--- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h
+++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h
@@ -2,17 +2,15 @@
#define Z_EN_OSSAN_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_En_Tana/z_en_tana.h"
-#include "overlays/actors/ovl_En_GirlA/z_en_girla.h"
+#include "z64actor.h"
struct EnOssan;
-typedef void (*EnOssanActionFunc)(struct EnOssan*, PlayState*);
-typedef void (*EnOssanTalkOwnerFunc)(PlayState*);
-typedef void (*EnOssanInitFunc)(struct EnOssan*, PlayState*);
+typedef void (*EnOssanActionFunc)(struct EnOssan*, struct PlayState*);
+typedef void (*EnOssanTalkOwnerFunc)(struct PlayState*);
+typedef void (*EnOssanInitFunc)(struct EnOssan*, struct PlayState*);
typedef s16 (*EnOssanGetGirlAParamsFunc)(s16);
-typedef void (*EnOssanStateFunc)(struct EnOssan*, PlayState*, Player*);
+typedef void (*EnOssanStateFunc)(struct EnOssan*, struct PlayState*, struct Player*);
typedef struct StickDirectionPrompt {
/* 0x00 */ u32 stickColorR;
@@ -37,7 +35,7 @@ typedef struct EnOssan {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnOssanActionFunc actionFunc;
- /* 0x0194 */ void (*obj3ToSeg6Func)(struct EnOssan*, PlayState*);
+ /* 0x0194 */ void (*obj3ToSeg6Func)(struct EnOssan*, struct PlayState*);
/* 0x0198 */ ColliderCylinder collider; // unused
/* 0x01E4 */ s16 timer;
/* 0x01E6 */ s16 delayTimer;
@@ -53,11 +51,11 @@ typedef struct EnOssan {
/* 0x01F8 */ void (*blinkFunc)(struct EnOssan*);
/* 0x01FC */ s16 stateFlag;
/* 0x01FE */ s16 tempStateFlag;
- /* 0x0200 */ EnGirlA* shelfSlots[8];
+ /* 0x0200 */ struct EnGirlA* shelfSlots[8];
// Shelves are indexed as such:
/* 7 5 3 1 */
/* 6 4 2 0 */
- /* 0x0220 */ EnTana* shelves;
+ /* 0x0220 */ struct EnTana* shelves;
/* 0x0224 */ s32 stickAccumX;
/* 0x0228 */ s32 stickAccumY;
/* 0x022C */ u8 moveHorizontal;
diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c
index 46696027f4..3ec065c696 100644
--- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c
+++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c
@@ -5,10 +5,31 @@
*/
#include "z_en_owl.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_owl/object_owl.h"
#include "assets/scenes/overworld/spot06/spot06_scene.h"
#include "assets/scenes/overworld/spot16/spot16_scene.h"
-#include "terminal.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.h b/src/overlays/actors/ovl_En_Owl/z_en_owl.h
index 4f92ef1b41..2f9e0939f8 100644
--- a/src/overlays/actors/ovl_En_Owl/z_en_owl.h
+++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.h
@@ -2,11 +2,11 @@
#define Z_EN_OWL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnOwl;
-typedef void (*EnOwlActionFunc)(struct EnOwl*, PlayState*);
+typedef void (*EnOwlActionFunc)(struct EnOwl*, struct PlayState*);
typedef void (*OwlFunc)(struct EnOwl*);
typedef struct EnOwl {
diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c
index 215442f52e..c10a8edcb4 100644
--- a/src/overlays/actors/ovl_En_Part/z_en_part.c
+++ b/src/overlays/actors/ovl_En_Part/z_en_part.c
@@ -5,6 +5,20 @@
*/
#include "z_en_part.h"
+
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_tite/object_tite.h"
#include "assets/objects/object_ik/object_ik.h"
diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.h b/src/overlays/actors/ovl_En_Part/z_en_part.h
index 3502d80a80..405e795e75 100644
--- a/src/overlays/actors/ovl_En_Part/z_en_part.h
+++ b/src/overlays/actors/ovl_En_Part/z_en_part.h
@@ -2,11 +2,11 @@
#define Z_EN_PART_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnPart;
-typedef void (*EnPartActionFunc)(struct EnPart*, PlayState*);
+typedef void (*EnPartActionFunc)(struct EnPart*, struct PlayState*);
typedef struct EnPart {
/* 0x000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c
index 6265f2c5f3..2246b3df16 100644
--- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c
+++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c
@@ -1,8 +1,24 @@
#include "z_en_peehat.h"
-#include "assets/objects/object_peehat/object_peehat.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_peehat/object_peehat.h"
+
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT)
@@ -74,7 +90,7 @@ static ColliderCylinderInit sCylinderInit = {
{ 50, 160, -70, { 0, 0, 0 } },
};
-static ColliderJntSphElementInit sJntSphElemInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -98,7 +114,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- sJntSphElemInit,
+ sJntSphElementsInit,
};
static ColliderQuadInit sQuadInit = {
@@ -203,12 +219,12 @@ void EnPeehat_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.health = 6;
this->actor.colChkInfo.damageTable = &sDamageTable;
this->actor.floorHeight = this->actor.world.pos.y;
- Collider_InitCylinder(play, &this->colCylinder);
- Collider_SetCylinder(play, &this->colCylinder, &this->actor, &sCylinderInit);
- Collider_InitQuad(play, &this->colQuad);
- Collider_SetQuad(play, &this->colQuad, &this->actor, &sQuadInit);
- Collider_InitJntSph(play, &this->colJntSph);
- Collider_SetJntSph(play, &this->colJntSph, &this->actor, &sJntSphInit, this->colJntSphItemList);
+ Collider_InitCylinder(play, &this->colliderCylinder);
+ Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit);
+ Collider_InitQuad(play, &this->colliderQuad);
+ Collider_SetQuad(play, &this->colliderQuad, &this->actor, &sQuadInit);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
this->actor.naviEnemyId = NAVI_ENEMY_PEAHAT;
this->xzDistToRise = 740.0f;
@@ -230,12 +246,12 @@ void EnPeehat_Init(Actor* thisx, PlayState* play) {
case PEAHAT_TYPE_LARVA:
this->actor.scale.x = this->actor.scale.z = 0.006f;
this->actor.scale.y = 0.003f;
- this->colCylinder.dim.radius = 25;
- this->colCylinder.dim.height = 15;
- this->colCylinder.dim.yShift = -5;
- this->colCylinder.elem.acDmgInfo.dmgFlags = DMG_ARROW | DMG_SLINGSHOT;
- this->colQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY;
- this->colQuad.base.acFlags = AC_ON | AC_TYPE_PLAYER;
+ this->colliderCylinder.dim.radius = 25;
+ this->colliderCylinder.dim.height = 15;
+ this->colliderCylinder.dim.yShift = -5;
+ this->colliderCylinder.elem.acDmgInfo.dmgFlags = DMG_ARROW | DMG_SLINGSHOT;
+ this->colliderQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY;
+ this->colliderQuad.base.acFlags = AC_ON | AC_TYPE_PLAYER;
this->actor.naviEnemyId = NAVI_ENEMY_PEAHAT_LARVA;
EnPeehat_Larva_SetStateSeekPlayer(this);
break;
@@ -246,8 +262,8 @@ void EnPeehat_Destroy(Actor* thisx, PlayState* play) {
EnPeehat* this = (EnPeehat*)thisx;
EnPeehat* parent;
- Collider_DestroyCylinder(play, &this->colCylinder);
- Collider_DestroyJntSph(play, &this->colJntSph);
+ Collider_DestroyCylinder(play, &this->colliderCylinder);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
// If PEAHAT_TYPE_LARVA, decrement total larva spawned
if (this->actor.params > 0) {
@@ -280,7 +296,7 @@ void EnPeehat_SpawnDust(PlayState* play, EnPeehat* this, Vec3f* pos, f32 arg3, s
* Handles being hit when on the ground
*/
void EnPeehat_HitWhenGrounded(EnPeehat* this, PlayState* play) {
- this->colCylinder.base.acFlags &= ~AC_HIT;
+ this->colliderCylinder.base.acFlags &= ~AC_HIT;
if ((play->gameplayFrames & 0xF) == 0) {
Vec3f itemDropPos = this->actor.world.pos;
@@ -292,7 +308,7 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, PlayState* play) {
} else {
s32 i;
- this->colCylinder.base.acFlags &= ~AC_HIT;
+ this->colliderCylinder.base.acFlags &= ~AC_HIT;
for (i = MAX_LARVA - this->unk_2FA; i > 0; i--) {
Actor* larva =
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_PEEHAT,
@@ -318,7 +334,7 @@ void EnPeehat_Ground_SetStateGround(EnPeehat* this) {
this->unk_2D4 = 0;
this->unk_2FA = 0;
this->state = PEAHAT_STATE_3;
- this->colCylinder.base.acFlags &= ~AC_HIT;
+ this->colliderCylinder.base.acFlags &= ~AC_HIT;
EnPeehat_SetupAction(this, EnPeehat_Ground_StateGround);
}
@@ -343,7 +359,7 @@ void EnPeehat_Ground_StateGround(EnPeehat* this, PlayState* play) {
} else {
Math_SmoothStepToF(&this->scaleShift, 0.0f, 1.0f, 0.005f, 0.0f);
}
- } else if (this->colCylinder.base.acFlags & AC_HIT) {
+ } else if (this->colliderCylinder.base.acFlags & AC_HIT) {
EnPeehat_HitWhenGrounded(this, play);
}
}
@@ -373,7 +389,7 @@ void EnPeehat_Flying_StateGrounded(EnPeehat* this, PlayState* play) {
} else {
Math_SmoothStepToF(&this->scaleShift, 0.0f, 1.0f, 0.005f, 0.0f);
}
- } else if (this->colCylinder.base.acFlags & AC_HIT) {
+ } else if (this->colliderCylinder.base.acFlags & AC_HIT) {
EnPeehat_HitWhenGrounded(this, play);
}
}
@@ -560,22 +576,22 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) {
this->bladeRot += this->bladeRotVel;
Math_SmoothStepToF(&this->scaleShift, 0.075f, 1.0f, 0.005f, 0.0f);
Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_SM_FLY - SFX_FLAG);
- if (this->colQuad.base.atFlags & AT_BOUNCED) {
+ if (this->colliderQuad.base.atFlags & AT_BOUNCED) {
this->actor.colChkInfo.health = 0;
- this->colQuad.base.acFlags &= ~AC_BOUNCED;
+ this->colliderQuad.base.acFlags &= ~AC_BOUNCED;
EnPeehat_SetStateAttackRecoil(this);
- } else if ((this->colQuad.base.atFlags & AT_HIT) || (this->colCylinder.base.acFlags & AC_HIT) ||
+ } else if ((this->colliderQuad.base.atFlags & AT_HIT) || (this->colliderCylinder.base.acFlags & AC_HIT) ||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Player* player = GET_PLAYER(play);
- this->colQuad.base.atFlags &= ~AT_HIT;
- if (!(this->colCylinder.base.acFlags & AC_HIT) && &player->actor == this->colQuad.base.at) {
+ this->colliderQuad.base.atFlags &= ~AT_HIT;
+ if (!(this->colliderCylinder.base.acFlags & AC_HIT) && &player->actor == this->colliderQuad.base.at) {
if (Rand_ZeroOne() > 0.5f) {
this->actor.world.rot.y += 0x2000;
} else {
this->actor.world.rot.y -= 0x2000;
}
this->unk_2D4 = 40;
- } else if (this->colCylinder.base.acFlags & AC_HIT || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
+ } else if (this->colliderCylinder.base.acFlags & AC_HIT || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Vec3f zeroVec = { 0, 0, 0 };
s32 i;
for (i = 4; i >= 0; i--) {
@@ -586,7 +602,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) {
EffectSsDeadDb_Spawn(play, &pos, &zeroVec, &zeroVec, 40, 7, 255, 255, 255, 255, 255, 0, 0, 1, 9, 1);
}
}
- if (&player->actor != this->colQuad.base.at || this->colCylinder.base.acFlags & AC_HIT) {
+ if (&player->actor != this->colliderQuad.base.at || this->colliderCylinder.base.acFlags & AC_HIT) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_PIHAT_SM_DEAD, 1, 1, 40);
}
@@ -879,13 +895,13 @@ void EnPeehat_StateExplode(EnPeehat* this, PlayState* play) {
}
void EnPeehat_Adult_CollisionCheck(EnPeehat* this, PlayState* play) {
- if ((this->colCylinder.base.acFlags & AC_BOUNCED) || (this->colQuad.base.acFlags & AC_BOUNCED)) {
- this->colQuad.base.acFlags &= ~AC_BOUNCED;
- this->colCylinder.base.acFlags &= ~AC_BOUNCED;
- this->colJntSph.base.acFlags &= ~AC_HIT;
- } else if (this->colJntSph.base.acFlags & AC_HIT) {
- this->colJntSph.base.acFlags &= ~AC_HIT;
- Actor_SetDropFlagJntSph(&this->actor, &this->colJntSph, true);
+ if ((this->colliderCylinder.base.acFlags & AC_BOUNCED) || (this->colliderQuad.base.acFlags & AC_BOUNCED)) {
+ this->colliderQuad.base.acFlags &= ~AC_BOUNCED;
+ this->colliderCylinder.base.acFlags &= ~AC_BOUNCED;
+ this->colliderJntSph.base.acFlags &= ~AC_HIT;
+ } else if (this->colliderJntSph.base.acFlags & AC_HIT) {
+ this->colliderJntSph.base.acFlags &= ~AC_HIT;
+ Actor_SetDropFlagJntSph(&this->actor, &this->colliderJntSph, true);
if (this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_NUT ||
this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_LIGHT_ICE_ARROW) {
return;
@@ -948,9 +964,9 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) {
// if PEAHAT_TYPE_GROUNDED
if (thisx->params < 0) {
// Set the Z-Target point on the Peahat's weak point
- thisx->focus.pos.x = this->colJntSph.elements[0].dim.worldSphere.center.x;
- thisx->focus.pos.y = this->colJntSph.elements[0].dim.worldSphere.center.y;
- thisx->focus.pos.z = this->colJntSph.elements[0].dim.worldSphere.center.z;
+ thisx->focus.pos.x = this->colliderJntSph.elements[0].dim.worldSphere.center.x;
+ thisx->focus.pos.y = this->colliderJntSph.elements[0].dim.worldSphere.center.y;
+ thisx->focus.pos.z = this->colliderJntSph.elements[0].dim.worldSphere.center.z;
if (this->state == PEAHAT_STATE_SEEK_PLAYER) {
Math_SmoothStepToS(&thisx->shape.rot.x, 6000, 1, 300, 0);
} else {
@@ -959,21 +975,21 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) {
} else {
thisx->focus.pos = thisx->world.pos;
}
- Collider_UpdateCylinder(thisx, &this->colCylinder);
+ Collider_UpdateCylinder(thisx, &this->colliderCylinder);
if (thisx->colChkInfo.health > 0) {
// If Adult Peahat
if (thisx->params <= 0) {
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colCylinder.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colJntSph.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
if (thisx->colorFilterTimer == 0 || !(thisx->colorFilterParams & 0x4000)) {
if (this->state != PEAHAT_STATE_EXPLODE) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colJntSph.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
}
}
- if (thisx->params != PEAHAT_TYPE_FLYING && this->colQuad.base.atFlags & AT_HIT) {
- this->colQuad.base.atFlags &= ~AT_HIT;
- if (&player->actor == this->colQuad.base.at) {
+ if (thisx->params != PEAHAT_TYPE_FLYING && this->colliderQuad.base.atFlags & AT_HIT) {
+ this->colliderQuad.base.atFlags &= ~AT_HIT;
+ if (&player->actor == this->colliderQuad.base.at) {
EnPeehat_SetStateAttackRecoil(this);
}
}
@@ -981,8 +997,8 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) {
if (this->state == PEAHAT_STATE_15 || this->state == PEAHAT_STATE_SEEK_PLAYER || this->state == PEAHAT_STATE_FLY ||
this->state == PEAHAT_STATE_RETURN_HOME || this->state == PEAHAT_STATE_EXPLODE) {
if (thisx->params != PEAHAT_TYPE_FLYING) {
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colQuad.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colQuad.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderQuad.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderQuad.base);
}
// if PEAHAT_TYPE_GROUNDED
if (thisx->params < 0 && (thisx->flags & ACTOR_FLAG_INSIDE_CULLING_VOLUME)) {
@@ -997,10 +1013,10 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) {
}
}
} else if (thisx->params != PEAHAT_TYPE_FLYING) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
} else {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
Math_SmoothStepToF(&this->scaleShift, 0.0f, 1.0f, 0.001f, 0.0f);
}
@@ -1049,7 +1065,7 @@ void EnPeehat_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r
OPEN_DISPS(play->state.gfxCtx, "../z_en_peehat.c", 1981);
Matrix_Push();
Matrix_Translate(-1000.0f, 0.0f, 0.0f, MTXMODE_APPLY);
- Collider_UpdateSpheres(0, &this->colJntSph);
+ Collider_UpdateSpheres(0, &this->colliderJntSph);
Matrix_Translate(500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
if (this->actor.colorFilterTimer != 0 && (this->actor.colorFilterParams & 0x4000)) {
damageYRot = Math_SinS(this->actor.colorFilterTimer * 0x4E20) * 0.35f;
@@ -1073,11 +1089,11 @@ void EnPeehat_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnPeehat_OverrideLimbDraw,
EnPeehat_PostLimbDraw, this);
if (this->actor.speed != 0.0f || this->actor.velocity.y != 0.0f) {
- Matrix_MultVec3f(&D_80AD285C[0], &this->colQuad.dim.quad[1]);
- Matrix_MultVec3f(&D_80AD285C[1], &this->colQuad.dim.quad[0]);
- Matrix_MultVec3f(&D_80AD285C[2], &this->colQuad.dim.quad[3]);
- Matrix_MultVec3f(&D_80AD285C[3], &this->colQuad.dim.quad[2]);
- Collider_SetQuadVertices(&this->colQuad, &this->colQuad.dim.quad[0], &this->colQuad.dim.quad[1],
- &this->colQuad.dim.quad[2], &this->colQuad.dim.quad[3]);
+ Matrix_MultVec3f(&D_80AD285C[0], &this->colliderQuad.dim.quad[1]);
+ Matrix_MultVec3f(&D_80AD285C[1], &this->colliderQuad.dim.quad[0]);
+ Matrix_MultVec3f(&D_80AD285C[2], &this->colliderQuad.dim.quad[3]);
+ Matrix_MultVec3f(&D_80AD285C[3], &this->colliderQuad.dim.quad[2]);
+ Collider_SetQuadVertices(&this->colliderQuad, &this->colliderQuad.dim.quad[0], &this->colliderQuad.dim.quad[1],
+ &this->colliderQuad.dim.quad[2], &this->colliderQuad.dim.quad[3]);
}
}
diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h
index 2449fc3405..deb24089f6 100644
--- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h
+++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h
@@ -2,7 +2,7 @@
#define Z_EN_PEEHAT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum PeahatType {
/* -1 */ PEAHAT_TYPE_GROUNDED = -1,
@@ -12,7 +12,7 @@ typedef enum PeahatType {
struct EnPeehat;
-typedef void (*EnPeehatActionFunc)(struct EnPeehat*, PlayState*);
+typedef void (*EnPeehatActionFunc)(struct EnPeehat*, struct PlayState*);
typedef struct EnPeehat {
/* 0x0000 */ Actor actor;
@@ -38,10 +38,10 @@ typedef struct EnPeehat {
/* 0x02FA */ s16 unk_2FA; // larva count (PEAHAT_TYPE_FLYING, PEAHAT_TYPE_GROUNDED),
// shape rotation direction (PEAHAT_TYPE_GROUNDED)
/* 0x02FC */ s16 animTimer;
- /* 0x0300 */ ColliderCylinder colCylinder;
- /* 0x034C */ ColliderJntSph colJntSph;
- /* 0x036C */ ColliderJntSphElement colJntSphItemList[1];
- /* 0x03AC */ ColliderQuad colQuad;
+ /* 0x0300 */ ColliderCylinder colliderCylinder;
+ /* 0x034C */ ColliderJntSph colliderJntSph;
+ /* 0x036C */ ColliderJntSphElement colliderJntSphElements[1];
+ /* 0x03AC */ ColliderQuad colliderQuad;
} EnPeehat; // size = 0x042C
#endif
diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c
index fefa80aecc..282d6249f1 100644
--- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c
+++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c
@@ -5,6 +5,18 @@
*/
#include "z_en_po_desert.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64light.h"
+#include "z64play.h"
+
#include "assets/objects/object_po_field/object_po_field.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_REACT_TO_LENS | ACTOR_FLAG_IGNORE_QUAKE)
@@ -214,7 +226,7 @@ s32 EnPoDesert_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
mtxScale = this->actionTimer / 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
}
- if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
*dList = NULL;
}
return false;
@@ -234,7 +246,7 @@ void EnPoDesert_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
color.r = (s16)(rand * 30.0f) + 225;
color.g = (s16)(rand * 100.0f) + 155;
color.b = (s16)(rand * 160.0f) + 95;
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
gDPPipeSync((*gfxP)++);
gDPSetEnvColor((*gfxP)++, color.r, color.g, color.b, 255);
MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_po_desert.c", 523);
diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h
index aeb2503edc..3f93eeb01d 100644
--- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h
+++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h
@@ -2,11 +2,12 @@
#define Z_EN_PO_DESERT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnPoDesert;
-typedef void (*EnPoDesertActionFunc)(struct EnPoDesert*, PlayState*);
+typedef void (*EnPoDesertActionFunc)(struct EnPoDesert*, struct PlayState*);
typedef struct EnPoDesert {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c
index 00eff4a39f..30218e20e5 100644
--- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c
+++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c
@@ -5,6 +5,21 @@
*/
#include "z_en_po_field.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_po_field/object_po_field.h"
@@ -143,8 +158,8 @@ static EnPoFieldInfo sPoFieldInfo[2] = {
static Vec3f D_80AD714C = { 0.0f, 1400.0f, 0.0f };
-#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128 ntsc-1.2:128 pal-1.0:128" \
- "pal-1.1:128"
+#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128 ntsc-1.0:128 ntsc-1.1:128" \
+ "ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
static Vec3s sSpawnPositions[10];
static u8 sSpawnSwitchFlags[10];
diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h
index f07a9233d7..17e08ee999 100644
--- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h
+++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h
@@ -2,11 +2,12 @@
#define Z_EN_PO_FIELD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnPoField;
-typedef void (*EnPoFieldActionFunc)(struct EnPoField*, PlayState*);
+typedef void (*EnPoFieldActionFunc)(struct EnPoField*, struct PlayState*);
typedef enum EnPoFieldSize {
EN_PO_FIELD_SMALL,
diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c
index e515efabed..983dbf0d71 100644
--- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c
+++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c
@@ -6,6 +6,23 @@
#include "z_en_po_relay.h"
#include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_tk/object_tk.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h
index 70567ada79..e4a440d940 100644
--- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h
+++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h
@@ -2,11 +2,12 @@
#define Z_EN_PO_RELAY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnPoRelay;
-typedef void (*EnPoRelayActionFunc)(struct EnPoRelay*, PlayState*);
+typedef void (*EnPoRelayActionFunc)(struct EnPoRelay*, struct PlayState*);
typedef struct EnPoRelay {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
index 3af363a28f..ba165bd3ad 100644
--- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
+++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
@@ -5,6 +5,24 @@
*/
#include "z_en_po_sisters.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "rand.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_po_sisters/object_po_sisters.h"
diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h
index 524f8a867f..bc25e9d035 100644
--- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h
+++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h
@@ -2,11 +2,12 @@
#define Z_EN_PO_SISTERS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnPoSisters;
-typedef void (*EnPoSistersActionFunc)(struct EnPoSisters*, PlayState*);
+typedef void (*EnPoSistersActionFunc)(struct EnPoSisters*, struct PlayState*);
typedef struct EnPoSisters {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c
index 2168c89e6b..fceb18ef7c 100644
--- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c
+++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c
@@ -5,6 +5,21 @@
*/
#include "z_en_poh.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_poh/object_poh.h"
#include "assets/objects/object_po_composer/object_po_composer.h"
@@ -75,7 +90,7 @@ static ColliderCylinderInit sCylinderInit = {
{ 20, 40, 20, { 0, 0, 0 } },
};
-static ColliderJntSphElementInit D_80AE1AA0[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -99,7 +114,7 @@ static ColliderJntSphInit sJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- D_80AE1AA0,
+ sJntSphElementsInit,
};
static CollisionCheckInfoInit sColChkInfoInit = { 4, 25, 50, 40 };
@@ -189,14 +204,14 @@ void EnPoh_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
- Collider_InitJntSph(play, &this->colliderSph);
- Collider_SetJntSph(play, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem);
- this->colliderSph.elements[0].dim.worldSphere.radius = 0;
- this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
- this->colliderSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
- this->colliderSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
- Collider_InitCylinder(play, &this->colliderCyl);
- Collider_SetCylinder(play, &this->colliderCyl, &this->actor, &sCylinderInit);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
+ this->colliderJntSph.elements[0].dim.worldSphere.radius = 0;
+ this->colliderJntSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
+ this->colliderJntSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
+ this->colliderJntSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
+ Collider_InitCylinder(play, &this->colliderCylinder);
+ Collider_SetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->unk_194 = 0;
this->unk_195 = 32;
@@ -249,8 +264,8 @@ void EnPoh_Destroy(Actor* thisx, PlayState* play) {
EnPoh* this = (EnPoh*)thisx;
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
- Collider_DestroyJntSph(play, &this->colliderSph);
- Collider_DestroyCylinder(play, &this->colliderCyl);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
+ Collider_DestroyCylinder(play, &this->colliderCylinder);
if (this->actor.params == EN_POH_RUPEE) {
D_80AE1A50--;
}
@@ -294,12 +309,12 @@ void func_80ADE28C(EnPoh* this) {
} else {
Animation_PlayOnce(&this->skelAnime, &gPoeComposerDamagedAnim);
}
- if (this->colliderCyl.elem.acHitElem->atDmgInfo.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT)) {
- this->actor.world.rot.y = this->colliderCyl.base.ac->world.rot.y;
+ if (this->colliderCylinder.elem.acHitElem->atDmgInfo.dmgFlags & (DMG_ARROW | DMG_SLINGSHOT)) {
+ this->actor.world.rot.y = this->colliderCylinder.base.ac->world.rot.y;
} else {
- this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->colliderCyl.base.ac) + 0x8000;
+ this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->colliderCylinder.base.ac) + 0x8000;
}
- this->colliderCyl.base.acFlags &= ~AC_ON;
+ this->colliderCylinder.base.acFlags &= ~AC_ON;
this->actor.speed = 5.0f;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 16);
this->actionFunc = func_80ADEECC;
@@ -309,7 +324,7 @@ void func_80ADE368(EnPoh* this) {
Animation_MorphToLoop(&this->skelAnime, this->info->fleeAnim, -5.0f);
this->actor.speed = 5.0f;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000;
- this->colliderCyl.base.acFlags |= AC_ON;
+ this->colliderCylinder.base.acFlags |= AC_ON;
this->unk_198 = 200;
this->actionFunc = func_80ADF894;
}
@@ -413,13 +428,13 @@ void func_80ADE6D4(EnPoh* this) {
void EnPoh_Talk(EnPoh* this, PlayState* play) {
this->actor.home.pos.y = this->actor.world.pos.y;
Actor_SetFocus(&this->actor, -10.0f);
- this->colliderCyl.dim.radius = 13;
- this->colliderCyl.dim.height = 30;
- this->colliderCyl.dim.yShift = 0;
- this->colliderCyl.dim.pos.x = this->actor.world.pos.x;
- this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f;
- this->colliderCyl.dim.pos.z = this->actor.world.pos.z;
- this->colliderCyl.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER;
+ this->colliderCylinder.dim.radius = 13;
+ this->colliderCylinder.dim.height = 30;
+ this->colliderCylinder.dim.yShift = 0;
+ this->colliderCylinder.dim.pos.x = this->actor.world.pos.x;
+ this->colliderCylinder.dim.pos.y = this->actor.world.pos.y - 20.0f;
+ this->colliderCylinder.dim.pos.z = this->actor.world.pos.z;
+ this->colliderCylinder.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER;
if (this->actor.params == EN_POH_FLAT || this->actor.params == EN_POH_SHARP) {
if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
this->actor.textId = 0x5000;
@@ -777,12 +792,12 @@ void func_80ADFE80(EnPoh* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
return;
}
- if (this->colliderCyl.base.ocFlags1 & OC1_HIT) {
+ if (this->colliderCylinder.base.ocFlags1 & OC1_HIT) {
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play);
} else {
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCyl.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.home.pos.y;
if (this->unk_195 != 0) {
@@ -791,7 +806,7 @@ void func_80ADFE80(EnPoh* this, PlayState* play) {
if (this->unk_195 == 0) {
this->unk_195 = 32;
}
- this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f;
+ this->colliderCylinder.dim.pos.y = this->actor.world.pos.y - 20.0f;
Actor_SetFocus(&this->actor, -10.0f);
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, this->info->lightColor.r, this->info->lightColor.g,
@@ -863,8 +878,8 @@ void EnPoh_TalkComposer(EnPoh* this, PlayState* play) {
}
void func_80AE032C(EnPoh* this, PlayState* play) {
- if (this->colliderCyl.base.acFlags & AC_HIT) {
- this->colliderCyl.base.acFlags &= ~AC_HIT;
+ if (this->colliderCylinder.base.acFlags & AC_HIT) {
+ this->colliderCylinder.base.acFlags &= ~AC_HIT;
if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) {
if (Actor_ApplyDamage(&this->actor) == 0) {
Enemy_StartFinishingBlow(play, &this->actor);
@@ -918,12 +933,12 @@ void EnPoh_Update(Actor* thisx, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gPoeComposerSkel, &gPoeComposerFloatAnim, this->jointTable,
this->morphTable, 12);
this->actor.draw = EnPoh_DrawComposer;
- this->colliderSph.elements[0].dim.limb = 9;
- this->colliderSph.elements[0].dim.modelSphere.center.y *= -1;
+ this->colliderJntSph.elements[0].dim.limb = 9;
+ this->colliderJntSph.elements[0].dim.modelSphere.center.y *= -1;
this->actor.shape.rot.y = this->actor.world.rot.y = -0x4000;
- this->colliderCyl.dim.radius = 20;
- this->colliderCyl.dim.height = 55;
- this->colliderCyl.dim.yShift = 15;
+ this->colliderCylinder.dim.radius = 20;
+ this->colliderCylinder.dim.height = 55;
+ this->colliderCylinder.dim.yShift = 15;
}
this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED;
EnPoh_SetupInitialAction(this);
@@ -988,8 +1003,8 @@ void EnPoh_UpdateLiving(Actor* thisx, PlayState* play) {
Vec3f checkPos;
s32 bgId;
- if (this->colliderSph.base.atFlags & AT_HIT) {
- this->colliderSph.base.atFlags &= ~AT_HIT;
+ if (this->colliderJntSph.base.atFlags & AT_HIT) {
+ this->colliderJntSph.base.atFlags &= ~AT_HIT;
func_80ADE4C8(this);
}
func_80AE032C(this, play);
@@ -998,14 +1013,14 @@ void EnPoh_UpdateLiving(Actor* thisx, PlayState* play) {
Actor_MoveXZGravity(&this->actor);
if (this->actionFunc == EnPoh_Attack && this->unk_198 < 10) {
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
}
- Collider_UpdateCylinder(&this->actor, &this->colliderCyl);
- if ((this->colliderCyl.base.acFlags & AC_ON) && this->lightColor.a == 255) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCyl.base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinder);
+ if ((this->colliderCylinder.base.acFlags & AC_ON) && this->lightColor.a == 255) {
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinder.base);
}
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCyl.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
Actor_SetFocus(&this->actor, 42.0f);
if (this->actionFunc != func_80ADEECC && this->actionFunc != func_80ADF574) {
if (this->actionFunc == func_80ADF894) {
@@ -1044,7 +1059,7 @@ s32 EnPoh_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
void EnPoh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfxP) {
EnPoh* this = (EnPoh*)thisx;
- Collider_UpdateSpheres(limbIndex, &this->colliderSph);
+ Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
if (this->actionFunc == func_80ADF15C && this->unk_198 >= 2 && limbIndex == this->info->unk_7) {
MATRIX_FINALIZE_AND_LOAD((*gfxP)++, play->state.gfxCtx, "../z_en_poh.c", 2460);
gSPDisplayList((*gfxP)++, this->info->burnDisplayList);
@@ -1060,9 +1075,9 @@ void EnPoh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
this->actor.world.pos.y = this->unk_368.yw;
this->actor.world.pos.z = this->unk_368.zw;
}
- Lights_PointGlowSetInfo(&this->lightInfo, this->colliderSph.elements[0].dim.worldSphere.center.x,
- this->colliderSph.elements[0].dim.worldSphere.center.y,
- this->colliderSph.elements[0].dim.worldSphere.center.z, this->envColor.r,
+ Lights_PointGlowSetInfo(&this->lightInfo, this->colliderJntSph.elements[0].dim.worldSphere.center.x,
+ this->colliderJntSph.elements[0].dim.worldSphere.center.y,
+ this->colliderJntSph.elements[0].dim.worldSphere.center.z, this->envColor.r,
this->envColor.g, this->envColor.b, this->envColor.a * (200.0f / 255));
}
}
diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h
index 749047b75f..7e7db7d997 100644
--- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h
+++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h
@@ -2,11 +2,12 @@
#define Z_EN_POH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct EnPoh;
-typedef void (*EnPohActionFunc)(struct EnPoh*, PlayState*);
+typedef void (*EnPohActionFunc)(struct EnPoh*, struct PlayState*);
typedef enum EnPohType {
EN_POH_NORMAL,
@@ -53,9 +54,9 @@ typedef struct EnPoh {
/* 0x02A4 */ EnPohInfo* info;
/* 0x02A8 */ LightNode* lightNode;
/* 0x02AC */ LightInfo lightInfo;
- /* 0x02BC */ ColliderCylinder colliderCyl;
- /* 0x0308 */ ColliderJntSph colliderSph;
- /* 0x0328 */ ColliderJntSphElement colliderSphItem;
+ /* 0x02BC */ ColliderCylinder colliderCylinder;
+ /* 0x0308 */ ColliderJntSph colliderJntSph;
+ /* 0x0328 */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x0368 */ MtxF unk_368;
} EnPoh; // size = 0x03A8
diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c
index 495046f95d..e984f316f7 100644
--- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c
+++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c
@@ -5,6 +5,11 @@
*/
#include "z_en_pu_box.h"
+
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_pu_box/object_pu_box.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h
index 0aa0aaaf4b..cd15c66c18 100644
--- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h
+++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h
@@ -2,7 +2,7 @@
#define Z_EN_PU_BOX_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnPubox;
diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c
index d5766aaf9c..af9ed8f112 100644
--- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c
+++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c
@@ -14,12 +14,12 @@
#include "rumble.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "z_en_item00.h"
#include "z_lib.h"
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
-
-#include "global.h"
+#include "z64save.h"
#include "assets/objects/object_rd/object_rd.h"
diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c
index 1fbcc178ad..856958e81e 100644
--- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c
+++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c
@@ -7,7 +7,23 @@
#include "z_en_reeba.h"
#include "overlays/actors/ovl_En_Encount1/z_en_encount1.h"
+
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_reeba/object_reeba.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h
index 36173bf355..a357af86ef 100644
--- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h
+++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h
@@ -2,11 +2,11 @@
#define Z_EN_REEBA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnReeba;
-typedef void (*EnReebaActionFunc)(struct EnReeba*, PlayState*);
+typedef void (*EnReebaActionFunc)(struct EnReeba*, struct PlayState*);
typedef struct EnReeba {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c
index a3861adec4..871cf6668f 100644
--- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c
+++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c
@@ -6,6 +6,15 @@
#include "z_en_river_sound.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void EnRiverSound_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h
index c647185217..4332af6021 100644
--- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h
+++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h
@@ -2,7 +2,7 @@
#define Z_EN_RIVER_SOUND_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnRiverSound;
diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c
index 6d79ef6288..ff57761161 100644
--- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c
+++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c
@@ -5,7 +5,19 @@
*/
#include "z_en_rl.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_rl/object_rl.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -339,7 +351,8 @@ void EnRl_Update(Actor* thisx, PlayState* play) {
EnRl* this = (EnRl*)thisx;
if ((this->action < 0) || (this->action > 7) || (sActionFuncs[this->action] == NULL)) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -388,7 +401,8 @@ void EnRl_Draw(Actor* thisx, PlayState* play) {
EnRl* this = (EnRl*)thisx;
if (this->drawConfig < 0 || this->drawConfig >= 3 || sDrawFuncs[this->drawConfig] == NULL) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.h b/src/overlays/actors/ovl_En_Rl/z_en_rl.h
index 9aa6b9ae6c..9ce9949aa6 100644
--- a/src/overlays/actors/ovl_En_Rl/z_en_rl.h
+++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.h
@@ -2,12 +2,12 @@
#define Z_EN_RL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnRl;
-typedef void (*EnRlActionFunc)(struct EnRl*, PlayState*);
-typedef void (*EnRlDrawFunc)(struct EnRl*, PlayState*);
+typedef void (*EnRlActionFunc)(struct EnRl*, struct PlayState*);
+typedef void (*EnRlDrawFunc)(struct EnRl*, struct PlayState*);
typedef struct EnRl {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c
index ff67d09329..b4e136a75a 100644
--- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c
+++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c
@@ -5,9 +5,26 @@
*/
#include "z_en_rr.h"
-#include "assets/objects/object_rr/object_rr.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_rr/object_rr.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.h b/src/overlays/actors/ovl_En_Rr/z_en_rr.h
index 44ac232668..f0ed5b5c30 100644
--- a/src/overlays/actors/ovl_En_Rr/z_en_rr.h
+++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.h
@@ -2,11 +2,11 @@
#define Z_EN_RR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnRr;
-typedef void (*EnRrActionFunc)(struct EnRr*, PlayState*);
+typedef void (*EnRrActionFunc)(struct EnRr*, struct PlayState*);
typedef struct EnRrBodySegment {
/* 0x00 */ f32 height;
diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c
index 3586ed73d7..85ef778479 100644
--- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c
+++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c
@@ -5,11 +5,31 @@
*/
#include "z_en_ru1.h"
-#include "assets/objects/object_ru1/object_ru1.h"
-#include "terminal.h"
-#include "versions.h"
#include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h"
+#include "libc64/math64.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "versions.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_ru1/object_ru1.h"
+
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_CAN_PRESS_SWITCHES)
void EnRu1_Init(Actor* thisx, PlayState* play);
@@ -2249,8 +2269,8 @@ void EnRu1_Update(Actor* thisx, PlayState* play) {
EnRu1* this = (EnRu1*)thisx;
if (this->action < 0 || this->action >= ARRAY_COUNT(sActionFuncs) || sActionFuncs[this->action] == NULL) {
- // "Main mode is improper!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
@@ -2403,8 +2423,8 @@ void EnRu1_Draw(Actor* thisx, PlayState* play) {
EnRu1* this = (EnRu1*)thisx;
if (this->drawConfig < 0 || this->drawConfig >= ARRAY_COUNT(sDrawFuncs) || sDrawFuncs[this->drawConfig] == NULL) {
- // "Draw mode is improper!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h
index 8223bfda43..8778174ef5 100644
--- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h
+++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h
@@ -2,16 +2,16 @@
#define Z_EN_RU1_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#include "overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
struct EnRu1;
-typedef void (*EnRu1ActionFunc)(struct EnRu1*, PlayState*);
-typedef void (*EnRu1DrawFunc)(struct EnRu1*, PlayState*);
-typedef void (*EnRu1PreLimbDrawFunc)(struct EnRu1*, PlayState*, s32, Vec3s*);
+typedef void (*EnRu1ActionFunc)(struct EnRu1*, struct PlayState*);
+typedef void (*EnRu1DrawFunc)(struct EnRu1*, struct PlayState*);
+typedef void (*EnRu1PreLimbDrawFunc)(struct EnRu1*, struct PlayState*, s32, Vec3s*);
typedef struct EnRu1 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c
index eff82bc1ec..b6c7405a03 100644
--- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c
+++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c
@@ -5,9 +5,26 @@
*/
#include "z_en_ru2.h"
-#include "assets/objects/object_ru2/object_ru2.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_ru2/object_ru2.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -686,8 +703,8 @@ void EnRu2_NextCreditsAction(EnRu2* this, PlayState* play) {
EnRu2_SetupTurnHeadDownLeftAnimation(this);
break;
default:
- // "There is no such action!"
- PRINTF("En_Ru2_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Ru2_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Ru2_inEnding_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->cueId = nextCueId;
@@ -907,8 +924,8 @@ void EnRu2_Update(Actor* thisx, PlayState* play) {
EnRu2* this = (EnRu2*)thisx;
if ((this->action < 0) || (this->action >= ARRAY_COUNT(sActionFuncs)) || (sActionFuncs[this->action] == NULL)) {
- // "Main Mode is improper!"
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -968,8 +985,8 @@ void EnRu2_Draw(Actor* thisx, PlayState* play) {
if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) ||
(sDrawFuncs[this->drawConfig] == NULL)) {
- // "Draw Mode is improper!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h
index 12333051b6..ca051d1800 100644
--- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h
+++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h
@@ -2,15 +2,15 @@
#define Z_EN_RU2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
#define ENRU2_GET_SWITCH_FLAG(thisx) PARAMS_GET_U(thisx->actor.params, 8, 8)
#define ENRU2_GET_TYPE(thisx) PARAMS_GET_U(thisx->actor.params, 0, 8)
struct EnRu2;
-typedef void (*EnRu2ActionFunc)(struct EnRu2*, PlayState*);
-typedef void (*EnRu2DrawFunc)(struct EnRu2*, PlayState*);
+typedef void (*EnRu2ActionFunc)(struct EnRu2*, struct PlayState*);
+typedef void (*EnRu2DrawFunc)(struct EnRu2*, struct PlayState*);
typedef struct EnRu2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c
index b2543c317e..fb834576fb 100644
--- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c
+++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c
@@ -1,5 +1,17 @@
#include "z_en_sa.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_sa/object_sa.h"
#include "assets/scenes/overworld/spot04/spot04_scene.h"
#include "assets/scenes/overworld/spot05/spot05_scene.h"
diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.h b/src/overlays/actors/ovl_En_Sa/z_en_sa.h
index 27c2c740f0..0132877731 100644
--- a/src/overlays/actors/ovl_En_Sa/z_en_sa.h
+++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.h
@@ -2,11 +2,11 @@
#define Z_EN_SA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSa;
-typedef void (*EnSaActionFunc)(struct EnSa*, PlayState*);
+typedef void (*EnSaActionFunc)(struct EnSa*, struct PlayState*);
typedef struct EnSa {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c
index 647d321273..152f5ea753 100644
--- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c
+++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c
@@ -5,7 +5,18 @@
*/
#include "z_en_sb.h"
+
+#include "attributes.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_sb/object_sb.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.h b/src/overlays/actors/ovl_En_Sb/z_en_sb.h
index a6dbd2cdf8..f2f0e42adb 100644
--- a/src/overlays/actors/ovl_En_Sb/z_en_sb.h
+++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.h
@@ -2,11 +2,11 @@
#define Z_EN_SB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSb;
-typedef void (*EnSbActionFunc)(struct EnSb*, PlayState*);
+typedef void (*EnSbActionFunc)(struct EnSb*, struct PlayState*);
typedef struct EnSb {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c
index 26d322f9b5..425b30b8f4 100644
--- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c
+++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c
@@ -6,6 +6,10 @@
#include "z_en_scene_change.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "z64play.h"
+
#define FLAGS 0
void EnSceneChange_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h
index 4add7d11ee..d1fcb16d90 100644
--- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h
+++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h
@@ -2,11 +2,11 @@
#define Z_ITEM_SCENE_CHANGE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSceneChange;
-typedef void (*EnSceneChangeActionFunc)(struct EnSceneChange*, PlayState*);
+typedef void (*EnSceneChangeActionFunc)(struct EnSceneChange*, struct PlayState*);
typedef struct EnSceneChange {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.c b/src/overlays/actors/ovl_En_Sda/z_en_sda.c
index 62bd38cc11..7cec1579b8 100644
--- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c
+++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c
@@ -6,6 +6,14 @@
#include "z_en_sda.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64player.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void EnSda_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.h b/src/overlays/actors/ovl_En_Sda/z_en_sda.h
index 4dd2abd3a6..27cba99665 100644
--- a/src/overlays/actors/ovl_En_Sda/z_en_sda.h
+++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.h
@@ -2,7 +2,7 @@
#define Z_EN_SDA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSda;
diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c
index 8eb853a808..4e082fcd47 100644
--- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c
+++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c
@@ -5,6 +5,18 @@
*/
#include "z_en_shopnuts.h"
+#include "overlays/actors/ovl_En_Dns/z_en_dns.h"
+#include "overlays/actors/ovl_En_Nutsball/z_en_nutsball.h"
+
+#include "gfx.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
+#include "assets/objects/object_shopnuts/object_shopnuts.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h
index 33971269f7..8bea3a0a68 100644
--- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h
+++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h
@@ -2,15 +2,14 @@
#define Z_EN_SHOPNUTS_H
#include "ultra64.h"
-#include "global.h"
-#include "overlays/actors/ovl_En_Dns/z_en_dns.h"
-#include "overlays/actors/ovl_En_Nutsball/z_en_nutsball.h"
+#include "z64actor.h"
+#include "assets/objects/object_shopnuts/object_shopnuts.h"
struct EnShopnuts;
#define SHOPNUTS_GET_TYPE(thisx) ((thisx)->params)
-typedef void (*EnShopnutsActionFunc)(struct EnShopnuts*, PlayState*);
+typedef void (*EnShopnutsActionFunc)(struct EnShopnuts*, struct PlayState*);
typedef struct EnShopnuts {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c
index 38735ea340..b5bf27be16 100644
--- a/src/overlays/actors/ovl_En_Si/z_en_si.c
+++ b/src/overlays/actors/ovl_En_Si/z_en_si.c
@@ -5,7 +5,14 @@
*/
#include "z_en_si.h"
+
+#include "sequence.h"
+#include "z_lib.h"
+#include "z64audio.h"
#include "z64draw.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOOKSHOT_PULLS_ACTOR)
@@ -81,7 +88,7 @@ s32 func_80AFB748(EnSi* this, PlayState* play) {
void func_80AFB768(EnSi* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
this->actionFunc = func_80AFB89C;
} else {
Math_SmoothStepToF(&this->actor.scale.x, 0.25f, 0.4f, 1.0f, 0.0f);
@@ -114,7 +121,7 @@ void func_80AFB89C(EnSi* this, PlayState* play) {
Actor_SetScale(&this->actor, this->actor.scale.x);
this->actor.shape.rot.y += 0x400;
- if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
+ if (!ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_HOOKSHOT_ATTACHED)) {
Item_Give(play, ITEM_SKULL_TOKEN);
player->actor.freezeTimer = 10;
Message_StartTextbox(play, 0xB4, NULL);
diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.h b/src/overlays/actors/ovl_En_Si/z_en_si.h
index b52e831a30..a4ec863028 100644
--- a/src/overlays/actors/ovl_En_Si/z_en_si.h
+++ b/src/overlays/actors/ovl_En_Si/z_en_si.h
@@ -2,11 +2,11 @@
#define Z_EN_SI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSi;
-typedef void (*EnSiActionFunc)(struct EnSi*, PlayState*);
+typedef void (*EnSiActionFunc)(struct EnSi*, struct PlayState*);
typedef struct EnSi {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c
index 1a1093f229..ecdab8d5b2 100644
--- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c
+++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c
@@ -5,6 +5,20 @@
*/
#include "z_en_siofuki.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_siofuki/object_siofuki.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h
index 23074bfac1..56a08bff6f 100644
--- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h
+++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h
@@ -2,7 +2,7 @@
#define Z_EN_SIOFUKI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum EnSiofukiType {
/* 0x00 */ EN_SIOFUKI_RAISING,
@@ -11,7 +11,7 @@ typedef enum EnSiofukiType {
struct EnSiofuki;
-typedef void (*EnSiofukiActionFunc)(struct EnSiofuki*, PlayState*);
+typedef void (*EnSiofukiActionFunc)(struct EnSiofuki*, struct PlayState*);
typedef struct EnSiofuki {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c
index 1a61fcfb9d..52e521df9c 100644
--- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c
+++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c
@@ -6,6 +6,21 @@
#include "z_en_skb.h"
#include "overlays/actors/ovl_En_Encount1/z_en_encount1.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_skb/object_skb.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -168,7 +183,7 @@ void EnSkb_Init(Actor* thisx, PlayState* play) {
this->actor.naviEnemyId = NAVI_ENEMY_STALCHILD;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItem);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
Actor_SetScale(&this->actor, ((this->actor.params * 0.1f) + 1.0f) * 0.01f);
this->collider.elements[0].dim.modelSphere.radius = this->collider.elements[0].dim.worldSphere.radius =
diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.h b/src/overlays/actors/ovl_En_Skb/z_en_skb.h
index 216b5848cc..dd96d9e16e 100644
--- a/src/overlays/actors/ovl_En_Skb/z_en_skb.h
+++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.h
@@ -2,11 +2,11 @@
#define Z_EN_SKB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSkb;
-typedef void (*EnSkbActionFunc)(struct EnSkb*, PlayState*);
+typedef void (*EnSkbActionFunc)(struct EnSkb*, struct PlayState*);
typedef struct EnSkb {
/* 0x0000 */ Actor actor;
@@ -21,7 +21,7 @@ typedef struct EnSkb {
/* 0x0288 */ s16 headlessYawOffset;
/* 0x028C */ BodyBreak bodyBreak;
/* 0x02A4 */ ColliderJntSph collider;
- /* 0x02C4 */ ColliderJntSphElement colliderItem[2];
+ /* 0x02C4 */ ColliderJntSphElement colliderElements[2];
} EnSkb; // size = 0x0344
#endif
diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c
index 2c576afbcb..52b1c4ae3f 100644
--- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c
+++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c
@@ -1,5 +1,26 @@
#include "z_en_skj.h"
#include "overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64debug_display.h"
+#include "z64face_reaction.h"
+#include "z64ocarina.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_skj/object_skj.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.h b/src/overlays/actors/ovl_En_Skj/z_en_skj.h
index dc0f97cc92..1d49c81c42 100644
--- a/src/overlays/actors/ovl_En_Skj/z_en_skj.h
+++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.h
@@ -2,11 +2,11 @@
#define Z_EN_SKJ_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSkj;
-typedef void (*EnSkjActionFunc)(struct EnSkj*, PlayState*);
+typedef void (*EnSkjActionFunc)(struct EnSkj*, struct PlayState*);
typedef struct EnSkj {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c
index 0804263355..91e9273054 100644
--- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c
+++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c
@@ -5,6 +5,13 @@
*/
#include "z_en_skjneedle.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+
#include "assets/objects/object_skj/object_skj.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_HOOKSHOT_PULLS_ACTOR)
diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h
index 1c4f444946..08ec8f4639 100644
--- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h
+++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h
@@ -2,7 +2,7 @@
#define Z_EN_SKJNEEDLE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSkjneedle;
diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c
index 09b9df91c1..43a59dce46 100644
--- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c
+++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c
@@ -1,4 +1,17 @@
#include "z_en_ssh.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ssh/object_ssh.h"
#define FLAGS \
@@ -198,25 +211,25 @@ void EnSsh_InitColliders(EnSsh* this, PlayState* play) {
s32 pad;
for (i = 0; i < ARRAY_COUNT(cylinders); i++) {
- Collider_InitCylinder(play, &this->colCylinder[i]);
- Collider_SetCylinder(play, &this->colCylinder[i], &this->actor, cylinders[i]);
+ Collider_InitCylinder(play, &this->colliderCylinders[i]);
+ Collider_SetCylinder(play, &this->colliderCylinders[i], &this->actor, cylinders[i]);
}
- this->colCylinder[0].elem.acDmgInfo.dmgFlags =
+ this->colliderCylinders[0].elem.acDmgInfo.dmgFlags =
DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT;
- this->colCylinder[1].elem.acDmgInfo.dmgFlags =
+ this->colliderCylinders[1].elem.acDmgInfo.dmgFlags =
DMG_DEFAULT & ~(DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT) &
~(DMG_MAGIC_LIGHT | DMG_MAGIC_ICE);
- this->colCylinder[2].base.colMaterial = COL_MATERIAL_METAL;
- this->colCylinder[2].elem.acElemFlags = ACELEM_ON | ACELEM_HOOKABLE | ACELEM_NO_AT_INFO;
- this->colCylinder[2].elem.elemMaterial = ELEM_MATERIAL_UNK2;
- this->colCylinder[2].elem.acDmgInfo.dmgFlags =
+ this->colliderCylinders[2].base.colMaterial = COL_MATERIAL_METAL;
+ this->colliderCylinders[2].elem.acElemFlags = ACELEM_ON | ACELEM_HOOKABLE | ACELEM_NO_AT_INFO;
+ this->colliderCylinders[2].elem.elemMaterial = ELEM_MATERIAL_UNK2;
+ this->colliderCylinders[2].elem.acDmgInfo.dmgFlags =
DMG_DEFAULT & ~(DMG_ARROW | DMG_MAGIC_FIRE | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_EXPLOSIVE | DMG_DEKU_NUT);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInfoInit);
- Collider_InitJntSph(play, &this->colSph);
- Collider_SetJntSph(play, &this->colSph, &this->actor, &sJntSphInit, this->colSphElements);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
}
f32 EnSsh_SetAnimation(EnSsh* this, s32 animIndex) {
@@ -270,21 +283,21 @@ void EnSsh_SetColliderScale(EnSsh* this, f32 scale, f32 radiusMod) {
f32 yShift;
s32 i;
- radius = this->colSph.elements[0].dim.modelSphere.radius;
+ radius = this->colliderJntSph.elements[0].dim.modelSphere.radius;
radius *= scale;
- this->colSph.elements[0].dim.modelSphere.radius = radius;
+ this->colliderJntSph.elements[0].dim.modelSphere.radius = radius;
for (i = 0; i < 6; i++) {
- yShift = this->colCylinder[i].dim.yShift;
- radius = this->colCylinder[i].dim.radius;
- height = this->colCylinder[i].dim.height;
+ yShift = this->colliderCylinders[i].dim.yShift;
+ radius = this->colliderCylinders[i].dim.radius;
+ height = this->colliderCylinders[i].dim.height;
yShift *= scale;
radius *= scale * radiusMod;
height *= scale;
- this->colCylinder[i].dim.yShift = yShift;
- this->colCylinder[i].dim.radius = radius;
- this->colCylinder[i].dim.height = height;
+ this->colliderCylinders[i].dim.yShift = yShift;
+ this->colliderCylinders[i].dim.radius = radius;
+ this->colliderCylinders[i].dim.height = height;
}
Actor_SetScale(&this->actor, 0.04f * scale);
this->floorHeightOffset = 40.0f * scale;
@@ -436,17 +449,17 @@ void EnSsh_Sway(EnSsh* this) {
}
void EnSsh_CheckBodyStickHit(EnSsh* this, PlayState* play) {
- ColliderElement* elem = &this->colCylinder[0].elem;
+ ColliderElement* elem = &this->colliderCylinders[0].elem;
Player* player = GET_PLAYER(play);
if (player->unk_860 != 0) {
elem->acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
- this->colCylinder[1].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
- this->colCylinder[2].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
+ this->colliderCylinders[1].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
+ this->colliderCylinders[2].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
} else {
elem->acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
- this->colCylinder[1].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
- this->colCylinder[2].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
+ this->colliderCylinders[1].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
+ this->colliderCylinders[2].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
}
}
@@ -458,8 +471,8 @@ s32 EnSsh_CheckHitPlayer(EnSsh* this, PlayState* play) {
return false;
}
for (i = 0; i < 3; i++) {
- if (this->colCylinder[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) {
- this->colCylinder[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER;
+ if (this->colliderCylinders[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) {
+ this->colliderCylinders[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER;
hit = true;
}
}
@@ -481,13 +494,13 @@ s32 EnSsh_CheckHitPlayer(EnSsh* this, PlayState* play) {
s32 EnSsh_CheckHitFront(EnSsh* this) {
u32 acFlags;
- if (this->colCylinder[2].base.acFlags) {} // Needed for matching
- acFlags = this->colCylinder[2].base.acFlags;
+ if (this->colliderCylinders[2].base.acFlags) {} // Needed for matching
+ acFlags = this->colliderCylinders[2].base.acFlags;
if (!!(acFlags & AC_HIT) == 0) {
return 0;
} else {
- this->colCylinder[2].base.acFlags &= ~AC_HIT;
+ this->colliderCylinders[2].base.acFlags &= ~AC_HIT;
this->invincibilityTimer = 8;
if ((this->swayTimer == 0) && (this->hitTimer == 0) && (this->stunTimer == 0)) {
this->swayTimer = 60;
@@ -497,14 +510,14 @@ s32 EnSsh_CheckHitFront(EnSsh* this) {
}
s32 EnSsh_CheckHitBack(EnSsh* this, PlayState* play) {
- ColliderCylinder* cyl = &this->colCylinder[0];
+ ColliderCylinder* cyl = &this->colliderCylinders[0];
s32 hit = false;
if (cyl->base.acFlags & AC_HIT) {
cyl->base.acFlags &= ~AC_HIT;
hit = true;
}
- cyl = &this->colCylinder[1];
+ cyl = &this->colliderCylinders[1];
if (cyl->base.acFlags & AC_HIT) {
cyl->base.acFlags &= ~AC_HIT;
hit = true;
@@ -547,19 +560,19 @@ s32 EnSsh_CollisionCheck(EnSsh* this, PlayState* play) {
}
void EnSsh_SetBodyCylinderAC(EnSsh* this, PlayState* play) {
- Collider_UpdateCylinder(&this->actor, &this->colCylinder[0]);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder[0].base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinders[0]);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinders[0].base);
}
void EnSsh_SetLegsCylinderAC(EnSsh* this, PlayState* play) {
s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y));
if (angleTowardsLink < 90 * (0x10000 / 360)) {
- Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder[2].base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinders[2]);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinders[2].base);
} else {
- Collider_UpdateCylinder(&this->actor, &this->colCylinder[1]);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder[1].base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinders[1]);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinders[1].base);
}
}
@@ -582,18 +595,18 @@ s32 EnSsh_SetCylinderOC(EnSsh* this, PlayState* play) {
Matrix_RotateY(BINANG_TO_RAD_ALT(this->initialYaw), MTXMODE_APPLY);
Matrix_MultVec3f(&cyloffsets[i], &cylPos);
Matrix_Pop();
- this->colCylinder[i + 3].dim.pos.x = cylPos.x;
- this->colCylinder[i + 3].dim.pos.y = cylPos.y;
- this->colCylinder[i + 3].dim.pos.z = cylPos.z;
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colCylinder[i + 3].base);
+ this->colliderCylinders[i + 3].dim.pos.x = cylPos.x;
+ this->colliderCylinders[i + 3].dim.pos.y = cylPos.y;
+ this->colliderCylinders[i + 3].dim.pos.z = cylPos.z;
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinders[i + 3].base);
}
return 1;
}
void EnSsh_SetColliders(EnSsh* this, PlayState* play) {
if (this->actor.colChkInfo.health == 0) {
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colSph.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colSph.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
} else {
if (this->hitTimer == 0) {
EnSsh_SetCylinderOC(this, play);
@@ -645,9 +658,9 @@ void EnSsh_Destroy(Actor* thisx, PlayState* play) {
Effect_Delete(play, this->blureIdx);
for (i = 0; i < 6; i++) {
- Collider_DestroyCylinder(play, &this->colCylinder[i]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[i]);
}
- Collider_DestroyJntSph(play, &this->colSph);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
}
void EnSsh_Wait(EnSsh* this, PlayState* play) {
@@ -869,7 +882,7 @@ s32 EnSsh_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
void EnSsh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
EnSsh* this = (EnSsh*)thisx;
- Collider_UpdateSpheres(limbIndex, &this->colSph);
+ Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
}
void EnSsh_Draw(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h
index 3060fb6fb7..741770cec5 100644
--- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h
+++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h
@@ -2,11 +2,11 @@
#define Z_EN_SSH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSsh;
-typedef void (*EnSshActionFunc)(struct EnSsh*, PlayState*);
+typedef void (*EnSshActionFunc)(struct EnSsh*, struct PlayState*);
typedef struct EnSsh {
/* 0x0000 */ Actor actor;
@@ -14,9 +14,9 @@ typedef struct EnSsh {
/* 0x0190 */ Vec3s jointTable[30];
/* 0x0244 */ Vec3s morphTable[30];
/* 0x02F8 */ EnSshActionFunc actionFunc;
- /* 0x02FC */ ColliderCylinder colCylinder[6];
- /* 0x04C4 */ ColliderJntSph colSph;
- /* 0x04E4 */ ColliderJntSphElement colSphElements[1];
+ /* 0x02FC */ ColliderCylinder colliderCylinders[6];
+ /* 0x04C4 */ ColliderJntSph colliderJntSph;
+ /* 0x04E4 */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x0524 */ s16 initialYaw;
/* 0x0526 */ s16 maxTurnRate;
/* 0x0528 */ s16 unkTimer;
diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c
index d7b6a20e50..7f8bf6497a 100644
--- a/src/overlays/actors/ovl_En_St/z_en_st.c
+++ b/src/overlays/actors/ovl_En_St/z_en_st.c
@@ -5,6 +5,19 @@
*/
#include "z_en_st.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_st/object_st.h"
#define FLAGS \
@@ -283,58 +296,58 @@ void EnSt_InitColliders(EnSt* this, PlayState* play) {
s32 pad;
for (i = 0; i < ARRAY_COUNT(cylinders); i++) {
- Collider_InitCylinder(play, &this->colCylinder[i]);
- Collider_SetCylinder(play, &this->colCylinder[i], &this->actor, cylinders[i]);
+ Collider_InitCylinder(play, &this->colliderCylinders[i]);
+ Collider_SetCylinder(play, &this->colliderCylinders[i], &this->actor, cylinders[i]);
}
- this->colCylinder[0].elem.acDmgInfo.dmgFlags =
+ this->colliderCylinders[0].elem.acDmgInfo.dmgFlags =
DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT;
- this->colCylinder[1].elem.acDmgInfo.dmgFlags =
+ this->colliderCylinders[1].elem.acDmgInfo.dmgFlags =
DMG_DEFAULT &
~(DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT) &
~(DMG_MAGIC_LIGHT | DMG_MAGIC_ICE);
- this->colCylinder[2].base.colMaterial = COL_MATERIAL_METAL;
- this->colCylinder[2].elem.acElemFlags = ACELEM_ON | ACELEM_HOOKABLE | ACELEM_NO_AT_INFO;
- this->colCylinder[2].elem.elemMaterial = ELEM_MATERIAL_UNK2;
- this->colCylinder[2].elem.acDmgInfo.dmgFlags =
+ this->colliderCylinders[2].base.colMaterial = COL_MATERIAL_METAL;
+ this->colliderCylinders[2].elem.acElemFlags = ACELEM_ON | ACELEM_HOOKABLE | ACELEM_NO_AT_INFO;
+ this->colliderCylinders[2].elem.elemMaterial = ELEM_MATERIAL_UNK2;
+ this->colliderCylinders[2].elem.acDmgInfo.dmgFlags =
DMG_DEFAULT &
~(DMG_MAGIC_FIRE | DMG_ARROW | DMG_HOOKSHOT | DMG_HAMMER_SWING | DMG_BOOMERANG | DMG_EXPLOSIVE | DMG_DEKU_NUT);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInit);
- Collider_InitJntSph(play, &this->colSph);
- Collider_SetJntSph(play, &this->colSph, &this->actor, &sJntSphInit, this->colSphItems);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
}
void EnSt_CheckBodyStickHit(EnSt* this, PlayState* play) {
- ColliderElement* bodyElem = &this->colCylinder[0].elem;
+ ColliderElement* bodyElem = &this->colliderCylinders[0].elem;
Player* player = GET_PLAYER(play);
if (player->unk_860 != 0) {
bodyElem->acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
- this->colCylinder[1].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
- this->colCylinder[2].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
+ this->colliderCylinders[1].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
+ this->colliderCylinders[2].elem.acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
} else {
bodyElem->acDmgInfo.dmgFlags &= ~DMG_DEKU_STICK;
- this->colCylinder[1].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
- this->colCylinder[2].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
+ this->colliderCylinders[1].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
+ this->colliderCylinders[2].elem.acDmgInfo.dmgFlags |= DMG_DEKU_STICK;
}
}
void EnSt_SetBodyCylinderAC(EnSt* this, PlayState* play) {
- Collider_UpdateCylinder(&this->actor, &this->colCylinder[0]);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder[0].base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinders[0]);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinders[0].base);
}
void EnSt_SetLegsCylinderAC(EnSt* this, PlayState* play) {
s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y));
if (angleTowardsLink < 0x3FFC) {
- Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder[2].base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinders[2]);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinders[2].base);
} else {
- Collider_UpdateCylinder(&this->actor, &this->colCylinder[1]);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colCylinder[1].base);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinders[1]);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinders[1].base);
}
}
@@ -357,10 +370,10 @@ s32 EnSt_SetCylinderOC(EnSt* this, PlayState* play) {
Matrix_RotateY(BINANG_TO_RAD_ALT(this->initialYaw), MTXMODE_APPLY);
Matrix_MultVec3f(&cyloffsets[i], &cylPos);
Matrix_Pop();
- this->colCylinder[i + 3].dim.pos.x = cylPos.x;
- this->colCylinder[i + 3].dim.pos.y = cylPos.y;
- this->colCylinder[i + 3].dim.pos.z = cylPos.z;
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colCylinder[i + 3].base);
+ this->colliderCylinders[i + 3].dim.pos.x = cylPos.x;
+ this->colliderCylinders[i + 3].dim.pos.y = cylPos.y;
+ this->colliderCylinders[i + 3].dim.pos.z = cylPos.z;
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinders[i + 3].base);
}
return true;
@@ -388,10 +401,10 @@ s32 EnSt_CheckHitPlayer(EnSt* this, PlayState* play) {
s32 i;
for (i = 0, hit = 0; i < 3; i++) {
- if (((this->colCylinder[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) != 0) == 0) {
+ if (((this->colliderCylinders[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) != 0) == 0) {
continue;
}
- this->colCylinder[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER;
+ this->colliderCylinders[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER;
hit = true;
}
@@ -411,13 +424,13 @@ s32 EnSt_CheckHitPlayer(EnSt* this, PlayState* play) {
}
s32 EnSt_CheckHitFrontside(EnSt* this) {
- u8 acFlags = this->colCylinder[2].base.acFlags;
+ u8 acFlags = this->colliderCylinders[2].base.acFlags;
if (!!(acFlags & AC_HIT) == 0) {
// not hit
return false;
} else {
- this->colCylinder[2].base.acFlags &= ~AC_HIT;
+ this->colliderCylinders[2].base.acFlags &= ~AC_HIT;
this->invulnerableTimer = 8;
this->playSwayFlag = 0;
this->swayTimer = 60;
@@ -426,7 +439,7 @@ s32 EnSt_CheckHitFrontside(EnSt* this) {
}
s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) {
- ColliderCylinder* cyl = &this->colCylinder[0];
+ ColliderCylinder* cyl = &this->colliderCylinders[0];
s32 flags = 0; // damage flags from colliders 0 and 1
s32 hit = false;
@@ -436,7 +449,7 @@ s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) {
flags |= cyl->elem.acHitElem->atDmgInfo.dmgFlags;
}
- cyl = &this->colCylinder[1];
+ cyl = &this->colliderCylinders[1];
if (cyl->base.acFlags & AC_HIT) {
cyl->base.acFlags &= ~AC_HIT;
hit = true;
@@ -521,21 +534,21 @@ void EnSt_SetColliderScale(EnSt* this) {
scaleAmount = 1.4f;
}
- radius = this->colSph.elements[0].dim.modelSphere.radius;
+ radius = this->colliderJntSph.elements[0].dim.modelSphere.radius;
radius *= scaleAmount;
- this->colSph.elements[0].dim.modelSphere.radius = radius;
+ this->colliderJntSph.elements[0].dim.modelSphere.radius = radius;
for (i = 0; i < 6; i++) {
- yShift = this->colCylinder[i].dim.yShift;
- radius = this->colCylinder[i].dim.radius;
- height = this->colCylinder[i].dim.height;
+ yShift = this->colliderCylinders[i].dim.yShift;
+ radius = this->colliderCylinders[i].dim.radius;
+ height = this->colliderCylinders[i].dim.height;
yShift *= scaleAmount;
radius *= scaleAmount;
height *= scaleAmount;
- this->colCylinder[i].dim.yShift = yShift;
- this->colCylinder[i].dim.radius = radius;
- this->colCylinder[i].dim.height = height;
+ this->colliderCylinders[i].dim.yShift = yShift;
+ this->colliderCylinders[i].dim.radius = radius;
+ this->colliderCylinders[i].dim.height = height;
}
Actor_SetScale(&this->actor, 0.04f * scaleAmount);
this->colliderScale = scaleAmount;
@@ -816,9 +829,9 @@ void EnSt_Destroy(Actor* thisx, PlayState* play) {
Effect_Delete(play, this->blureIdx);
for (i = 0; i < 6; i++) {
- Collider_DestroyCylinder(play, &this->colCylinder[i]);
+ Collider_DestroyCylinder(play, &this->colliderCylinders[i]);
}
- Collider_DestroyJntSph(play, &this->colSph);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
}
void EnSt_WaitOnCeiling(EnSt* this, PlayState* play) {
@@ -1085,7 +1098,7 @@ s32 EnSt_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dListP, Vec3f* p
void EnSt_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dListP, Vec3s* rot, void* thisx) {
EnSt* this = (EnSt*)thisx;
- Collider_UpdateSpheres(limbIndex, &this->colSph);
+ Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
}
void EnSt_Draw(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h
index 4200ca0d32..08e9e8bd8d 100644
--- a/src/overlays/actors/ovl_En_St/z_en_st.h
+++ b/src/overlays/actors/ovl_En_St/z_en_st.h
@@ -2,19 +2,19 @@
#define Z_EN_ST_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSt;
-typedef void (*EnStActionFunc)(struct EnSt* this, PlayState* play);
+typedef void (*EnStActionFunc)(struct EnSt* this, struct PlayState* play);
typedef struct EnSt {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnStActionFunc actionFunc;
- /* 0x0194 */ ColliderCylinder colCylinder[6];
- /* 0x035C */ ColliderJntSph colSph;
- /* 0x037C */ ColliderJntSphElement colSphItems[1];
+ /* 0x0194 */ ColliderCylinder colliderCylinders[6];
+ /* 0x035C */ ColliderJntSph colliderJntSph;
+ /* 0x037C */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x03BC */ s16 initialYaw;
/* 0x03BE */ s16 deathYawTarget;
/* 0x03C0 */ s16 groundBounces;
diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c
index ac10651812..9eb1679a56 100644
--- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c
+++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c
@@ -4,8 +4,18 @@
* Description: Uncursed House of Skulltula People
*/
-#include "terminal.h"
#include "z_en_sth.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_ahg/object_ahg.h"
#include "assets/objects/object_boj/object_boj.h"
@@ -148,7 +158,7 @@ void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) {
s16* params;
EnSth_SetupShapeColliderUpdate2AndDraw(this, play);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
SkelAnime_InitFlex(play, &this->skelAnime, sSkeletons[this->actor.params], NULL, this->jointTable, this->morphTable,
16);
Animation_PlayLoop(&this->skelAnime, sAnimations[this->actor.params]);
@@ -391,7 +401,7 @@ void EnSth_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_sth.c", 2133);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
Gfx_SetupDL_37Opa(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08,
diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.h b/src/overlays/actors/ovl_En_Sth/z_en_sth.h
index 9408c542dd..a135fea2aa 100644
--- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h
+++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h
@@ -2,11 +2,11 @@
#define Z_EN_STH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSth;
-typedef void (*EnSthActionFunc)(struct EnSth*, PlayState*);
+typedef void (*EnSthActionFunc)(struct EnSth*, struct PlayState*);
typedef struct EnSth {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c
index dc73048393..118328e793 100644
--- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c
+++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c
@@ -5,6 +5,17 @@
*/
#include "z_en_stream.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_stream/object_stream.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.h b/src/overlays/actors/ovl_En_Stream/z_en_stream.h
index 199d1c6797..0a21d54d84 100644
--- a/src/overlays/actors/ovl_En_Stream/z_en_stream.h
+++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.h
@@ -2,11 +2,11 @@
#define Z_EN_STREAM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnStream;
-typedef void (*EnStreamActionFunc)(struct EnStream*, PlayState*);
+typedef void (*EnStreamActionFunc)(struct EnStream*, struct PlayState*);
typedef struct EnStream {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c
index b9b6b47c94..8e10154c10 100644
--- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c
+++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c
@@ -1,4 +1,20 @@
#include "z_en_sw.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_st/object_st.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -32,7 +48,7 @@ ActorProfile En_Sw_Profile = {
/**/ EnSw_Draw,
};
-static ColliderJntSphElementInit sJntSphItemsInit[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{ ELEM_MATERIAL_UNK0, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFC3FFFE, 0x00, 0x00 }, 0x01, 0x05, 0x01 },
{ 2, { { 0, -300, 0 }, 21 }, 100 },
@@ -42,7 +58,7 @@ static ColliderJntSphElementInit sJntSphItemsInit[1] = {
static ColliderJntSphInit sJntSphInit = {
{ COL_MATERIAL_HIT6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH },
1,
- sJntSphItemsInit,
+ sJntSphElementsInit,
};
static CollisionCheckInfoInit2 D_80B0F074 = { 1, 2, 25, 25, MASS_IMMOVABLE };
@@ -240,7 +256,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENSW_ANIM_0);
ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->sphs);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xE), &D_80B0F074);
this->actor.scale.x = 0.02f;
diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.h b/src/overlays/actors/ovl_En_Sw/z_en_sw.h
index c766e9f9e9..fe68092667 100644
--- a/src/overlays/actors/ovl_En_Sw/z_en_sw.h
+++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.h
@@ -2,18 +2,18 @@
#define Z_EN_SW_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSw;
-typedef void (*EnSwActionFunc)(struct EnSw* this, PlayState* play);
+typedef void (*EnSwActionFunc)(struct EnSw* this, struct PlayState* play);
typedef struct EnSw {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnSwActionFunc actionFunc;
/* 0x0194 */ ColliderJntSph collider;
- /* 0x01B4 */ ColliderJntSphElement sphs[1];
+ /* 0x01B4 */ ColliderJntSphElement colliderElements[1];
/* 0x01F4 */ Color_RGBA8 unk_1F4;
/* 0x01F8 */ Vec3s jointTable[30];
/* 0x02AC */ Vec3s morphTable[30];
@@ -34,7 +34,7 @@ typedef struct EnSw {
/* 0x0420 */ f32 unk_420;
/* 0x0424 */ char unk_424[0x8];
/* 0x042C */ u8 unk_42C;
- /* 0x0430 */ CollisionPoly* unk_430;
+ /* 0x0430 */ struct CollisionPoly* unk_430;
/* 0x0434 */ Vec3f unk_434;
/* 0x0440 */ s16 unk_440;
/* 0x0442 */ s16 unk_442;
diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c
index ed7d99541f..e409e9c246 100644
--- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c
+++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c
@@ -1,9 +1,19 @@
#include "z_en_syateki_itm.h"
-#include "terminal.h"
#include "overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h"
#include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h"
#include "overlays/actors/ovl_En_G_Switch/z_en_g_switch.h"
+#include "printf.h"
+#include "rand.h"
+#include "regs.h"
+#include "sfx.h"
+#include "terminal.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
typedef enum EnSyatekItemRound {
diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h
index c670208bec..46f54b7c79 100644
--- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h
+++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h
@@ -2,11 +2,11 @@
#define Z_EN_SYATEKI_ITM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSyatekiItm;
-typedef void (*EnSyatekiItmActionFunc)(struct EnSyatekiItm*, PlayState*);
+typedef void (*EnSyatekiItmActionFunc)(struct EnSyatekiItm*, struct PlayState*);
typedef enum EnSyatekiSignal {
/* 0 */ ENSYATEKI_NONE,
diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
index 5575182fe6..f2744b5d57 100644
--- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
+++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
@@ -1,6 +1,19 @@
#include "z_en_syateki_man.h"
-#include "terminal.h"
#include "overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "regs.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "terminal.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ossan/object_ossan.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h
index eea46817ff..306c33104f 100644
--- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h
+++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h
@@ -2,11 +2,11 @@
#define Z_EN_SYATEKI_MAN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnSyatekiMan;
-typedef void (*EnSyatekiManActionFunc) (struct EnSyatekiMan*, PlayState*);
+typedef void (*EnSyatekiManActionFunc) (struct EnSyatekiMan*, struct PlayState*);
typedef void (*EnSyatekiManOtherFunc) (struct EnSyatekiMan*);
typedef struct EnSyatekiMan {
diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c
index a55d234477..970ebb32d3 100644
--- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c
+++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c
@@ -10,6 +10,7 @@
#include "gfx.h"
#include "gfx_setupdl.h"
#include "ichain.h"
+#include "printf.h"
#include "rand.h"
#include "sfx.h"
#include "sys_matrix.h"
@@ -18,8 +19,8 @@
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
-#include "z64.h"
#include "assets/objects/object_niw/object_niw.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c
index bea60cf889..68335d64b2 100644
--- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c
+++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c
@@ -5,7 +5,28 @@
*/
#include "z_en_ta.h"
+#include "overlays/actors/ovl_En_Niw/z_en_niw.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_ta/object_ta.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.h b/src/overlays/actors/ovl_En_Ta/z_en_ta.h
index eeab7dc775..d230c2b757 100644
--- a/src/overlays/actors/ovl_En_Ta/z_en_ta.h
+++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.h
@@ -2,13 +2,11 @@
#define Z_EN_TA_H
#include "ultra64.h"
-#include "global.h"
-
-#include "overlays/actors/ovl_En_Niw/z_en_niw.h"
+#include "z64actor.h"
struct EnTa;
-typedef void (*EnTaActionFunc)(struct EnTa*, PlayState*);
+typedef void (*EnTaActionFunc)(struct EnTa*, struct PlayState*);
typedef void (*EnTaBlinkFunc)(struct EnTa*);
typedef void (*EnTaAnimFunc)(struct EnTa*);
@@ -50,7 +48,7 @@ typedef struct EnTa {
/* 0x02B0 */ EnTaBlinkFunc blinkFunc;
/* 0x02B4 */ s16 eyeIndex;
/* 0x02B6 */ s16 blinkTimer;
- /* 0x02B8 */ EnNiw* superCuccos[3];
+ /* 0x02B8 */ struct EnNiw* superCuccos[3];
/* 0x02C4 */ s16 superCuccoTimers[3]; // This is used to time animations and actions for super-cuccos
/* 0x02CA */ u8 lastFoundSuperCuccoIdx;
/* 0x02CC */ s16 timer;
diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c
index bcc60b5f1a..8d51dae459 100644
--- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c
+++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c
@@ -5,8 +5,17 @@
*/
#include "z_en_takara_man.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
#include "terminal.h"
#include "versions.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_ts/object_ts.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h
index 48898909bc..e7d51c4b07 100644
--- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h
+++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h
@@ -2,11 +2,11 @@
#define Z_EN_TAKARA_MAN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTakaraMan;
-typedef void (*EnTakaraManActionFunc)(struct EnTakaraMan*, PlayState*);
+typedef void (*EnTakaraManActionFunc)(struct EnTakaraMan*, struct PlayState*);
typedef struct EnTakaraMan {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c
index 866329c2ab..ddb9e8d8d9 100644
--- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c
+++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c
@@ -5,6 +5,14 @@
*/
#include "z_en_tana.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+
#include "assets/objects/object_shop_dungen/object_shop_dungen.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.h b/src/overlays/actors/ovl_En_Tana/z_en_tana.h
index 763d1303c6..1804bcd798 100644
--- a/src/overlays/actors/ovl_En_Tana/z_en_tana.h
+++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.h
@@ -2,7 +2,7 @@
#define Z_EN_TANA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTana;
diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c
index c8257aa85e..61628f342c 100644
--- a/src/overlays/actors/ovl_En_Test/z_en_test.c
+++ b/src/overlays/actors/ovl_En_Test/z_en_test.c
@@ -13,13 +13,13 @@
#include "ichain.h"
#include "sfx.h"
#include "sys_matrix.h"
+#include "z_en_item00.h"
#include "z_lib.h"
#include "z64audio.h"
#include "z64effect.h"
#include "z64play.h"
#include "z64player.h"
-#include "global.h"
#include "assets/objects/object_sk2/object_sk2.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -1853,7 +1853,7 @@ s32 EnTest_OverrideLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3f*
}
if ((this->actor.params == STALFOS_TYPE_INVISIBLE) &&
- !CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) {
+ !ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_REACT_TO_LENS)) {
*dList = NULL;
}
diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c
index 42f32f0eb7..1fc830181b 100644
--- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c
+++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c
@@ -5,6 +5,12 @@
*/
#include "z_en_tg.h"
+
+#include "gfx.h"
+#include "sys_matrix.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+
#include "assets/objects/object_mu/object_mu.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.h b/src/overlays/actors/ovl_En_Tg/z_en_tg.h
index 4571638d77..b4d9bfe063 100644
--- a/src/overlays/actors/ovl_En_Tg/z_en_tg.h
+++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.h
@@ -2,11 +2,11 @@
#define Z_EN_TG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTg;
-typedef void (*EnTgActionFunc)(struct EnTg*, PlayState*);
+typedef void (*EnTgActionFunc)(struct EnTg*, struct PlayState*);
typedef struct EnTg {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c
index b253b7ea0b..3435b040fc 100644
--- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c
+++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c
@@ -7,7 +7,22 @@
#include "z_en_tite.h"
#include "overlays/actors/ovl_En_Encount1/z_en_encount1.h"
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_tite/object_tite.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -191,7 +206,7 @@ void EnTite_Init(Actor* thisx, PlayState* play) {
thisx->colChkInfo.health = 2;
thisx->colChkInfo.mass = MASS_HEAVY;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, &this->colliderItem);
+ Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->colliderElements);
this->unk_2DC = UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4;
if (this->actor.params == TEKTITE_BLUE) {
this->unk_2DC |= UPDBGCHECKINFO_FLAG_6; // Don't use the actor engine's ripple spawning code
diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/src/overlays/actors/ovl_En_Tite/z_en_tite.h
index a049cabaae..d4ec9ab8dd 100755
--- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h
+++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h
@@ -2,11 +2,11 @@
#define Z_EN_TITE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTite;
-typedef void (*EnTiteActionFunc)(struct EnTite*, PlayState*);
+typedef void (*EnTiteActionFunc)(struct EnTite*, struct PlayState*);
typedef enum EnTiteType {
/* -2 */ TEKTITE_BLUE = -2,
@@ -28,7 +28,7 @@ typedef struct EnTite {
/* 0x02E3 */ u8 spawnIceTimer;
/* 0x02E4 */ u8 damageEffect;
/* 0x02E8 */ ColliderJntSph collider;
- /* 0x0308 */ ColliderJntSphElement colliderItem;
+ /* 0x0308 */ ColliderJntSphElement colliderElements[1];
/* 0x0348 */ Vec3f frontLeftFootPos;
/* 0x0354 */ Vec3f frontRightFootPos;
/* 0x0360 */ Vec3f backRightFootPos;
diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c
index 747b0085c6..4f697c29b8 100644
--- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c
+++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c
@@ -5,6 +5,22 @@
*/
#include "z_en_tk.h"
+
+#include "libc64/math64.h"
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_tk/object_tk.h"
diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h
index 208b4e81d7..2ce0b9ef87 100644
--- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h
+++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h
@@ -2,8 +2,7 @@
#define Z_EN_TK_H
#include "ultra64.h"
-#include "global.h"
-#include "z64.h"
+#include "z64actor.h"
/* Dirt particle effect */
struct EnTkEff;
@@ -22,7 +21,7 @@ typedef struct EnTkEff {
struct EnTk;
-typedef void (*EnTkActionFunc)(struct EnTk*, PlayState*);
+typedef void (*EnTkActionFunc)(struct EnTk*, struct PlayState*);
typedef struct EnTk {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.c b/src/overlays/actors/ovl_En_Torch/z_en_torch.c
index e60e16c0de..6e406c6bab 100644
--- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c
+++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c
@@ -1,10 +1,14 @@
/*
* File: z_en_torch.c
* Overlay: ovl_En_Torch
- * Description: Spawns a chest with the appropriate contents then unloads. Used in grottos.
+ * Description: Spawns a chest with the appropriate contents then dies. Used in grottos.
*/
#include "z_en_torch.h"
+#include "overlays/actors/ovl_En_Box/z_en_box.h"
+
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.h b/src/overlays/actors/ovl_En_Torch/z_en_torch.h
index 78be1fb2dd..fc3e2dabac 100644
--- a/src/overlays/actors/ovl_En_Torch/z_en_torch.h
+++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.h
@@ -2,7 +2,7 @@
#define Z_EN_TORCH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTorch;
diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
index 8e69a1537f..a02e9bc3bb 100644
--- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
+++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
@@ -5,9 +5,25 @@
*/
#include "z_en_torch2.h"
-#include "assets/objects/object_torch2/object_torch2.h"
+
+#include "libc64/qrand.h"
#include "libu64/pad.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sequence.h"
#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/object_torch2/object_torch2.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h
index d96b08527e..bb132bc91e 100644
--- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h
+++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h
@@ -2,7 +2,7 @@
#define Z_EN_TORCH2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
// Uses the Player struct (from z64player.h)
diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c
index 5b31c32f84..2ac84162c6 100644
--- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c
+++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c
@@ -5,6 +5,17 @@
*/
#include "z_en_toryo.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_toryo/object_toryo.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h
index 769ea637b9..f8d04e74ac 100644
--- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h
+++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h
@@ -2,11 +2,11 @@
#define Z_EN_TORYO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnToryo;
-typedef void (*EnToryoActionFunc)(struct EnToryo* this, PlayState* play);
+typedef void (*EnToryoActionFunc)(struct EnToryo* this, struct PlayState* play);
typedef struct EnToryo {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c
index 79500059b5..a1ce22995c 100644
--- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c
+++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c
@@ -5,7 +5,23 @@
*/
#include "z_en_tp.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_tp/object_tp.h"
#define FLAGS 0
@@ -145,7 +161,7 @@ void EnTp_Init(Actor* thisx, PlayState* play2) {
now = this;
this->alpha = 255;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
if (this->actor.params <= TAILPASARAN_HEAD) {
this->actor.naviEnemyId = NAVI_ENEMY_TAILPASARAN;
diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.h b/src/overlays/actors/ovl_En_Tp/z_en_tp.h
index f878ab934a..71fdca8188 100644
--- a/src/overlays/actors/ovl_En_Tp/z_en_tp.h
+++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.h
@@ -2,11 +2,11 @@
#define Z_EN_TP_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTp;
-typedef void (*EnTpActionFunc)(struct EnTp*, PlayState*);
+typedef void (*EnTpActionFunc)(struct EnTp*, struct PlayState*);
typedef struct EnTp {
/* 0x0000 */ Actor actor;
@@ -24,7 +24,7 @@ typedef struct EnTp {
/* 0x016C */ f32 horizontalVariation;
/* 0x0170 */ f32 extraHeightVariation;
/* 0x0174 */ ColliderJntSph collider;
- /* 0x0194 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0194 */ ColliderJntSphElement colliderElements[1];
/* 0x01D4 */ struct EnTp* head;
} EnTp; // size = 0x01D8
diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c
index 6cd63e00f8..3f2672cde4 100644
--- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c
+++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c
@@ -5,6 +5,18 @@
*/
#include "z_en_tr.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_tr/object_tr.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.h b/src/overlays/actors/ovl_En_Tr/z_en_tr.h
index faf45d7400..091aa5c52f 100644
--- a/src/overlays/actors/ovl_En_Tr/z_en_tr.h
+++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.h
@@ -2,11 +2,11 @@
#define Z_EN_TR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTr;
-typedef void (*EnTrActionFunc)(struct EnTr*, PlayState*);
+typedef void (*EnTrActionFunc)(struct EnTr*, struct PlayState*);
typedef enum KotakeKoumeLimb {
/* 0 */ KOTAKE_KOUME_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c
index 640332ecba..848e6701b0 100644
--- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c
+++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c
@@ -5,6 +5,12 @@
*/
#include "z_en_trap.h"
+
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_trap/object_trap.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.h b/src/overlays/actors/ovl_En_Trap/z_en_trap.h
index 6f69707aca..fcd62dd170 100644
--- a/src/overlays/actors/ovl_En_Trap/z_en_trap.h
+++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.h
@@ -2,7 +2,7 @@
#define Z_EN_TRAP_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
// Different movement modes (set in params):
#define SPIKETRAP_MODE_LINEAR 0x10
diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c
index 8db28db170..31ae178197 100644
--- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c
+++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c
@@ -5,9 +5,21 @@
*/
#include "z_en_tubo_trap.h"
-#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h
index 17dc2f2054..3abe8b625a 100644
--- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h
+++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h
@@ -2,11 +2,11 @@
#define Z_EN_TUBO_TRAP_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnTuboTrap;
-typedef void (*EnTuboTrapActionFunc)(struct EnTuboTrap*, PlayState*);
+typedef void (*EnTuboTrapActionFunc)(struct EnTuboTrap*, struct PlayState*);
typedef struct EnTuboTrap {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c
index fa83618611..011b004b68 100644
--- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c
+++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c
@@ -5,6 +5,19 @@
*/
#include "z_en_vali.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_vali/object_vali.h"
#define FLAGS \
diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.h b/src/overlays/actors/ovl_En_Vali/z_en_vali.h
index c5df42825b..1a031d964b 100644
--- a/src/overlays/actors/ovl_En_Vali/z_en_vali.h
+++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.h
@@ -2,11 +2,11 @@
#define Z_EN_VALI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnVali;
-typedef void (*EnValiActionFunc)(struct EnVali*, PlayState*);
+typedef void (*EnValiActionFunc)(struct EnVali*, struct PlayState*);
typedef enum EnValiLimb {
/* 0x00 */ EN_VALI_LIMB_NONE,
diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.c b/src/overlays/actors/ovl_En_Vase/z_en_vase.c
index 9861413414..30f8b32b18 100644
--- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c
+++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c
@@ -5,6 +5,9 @@
*/
#include "z_en_vase.h"
+
+#include "z64play.h"
+
#include "assets/objects/object_vase/object_vase.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.h b/src/overlays/actors/ovl_En_Vase/z_en_vase.h
index 57ee0d5779..04a8381e29 100644
--- a/src/overlays/actors/ovl_En_Vase/z_en_vase.h
+++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.h
@@ -2,7 +2,7 @@
#define Z_EN_VASE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnVase;
diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c
index e31e9ca9a7..8791409d01 100644
--- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c
+++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c
@@ -5,9 +5,21 @@
*/
#include "z_en_vb_ball.h"
+#include "overlays/actors/ovl_Boss_Fd/z_boss_fd.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_fd/object_fd.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
-#include "overlays/actors/ovl_Boss_Fd/z_boss_fd.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h
index 8675b440c4..e81bc1ac25 100644
--- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h
+++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h
@@ -2,7 +2,7 @@
#define Z_EN_VB_BALL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnVbBall;
diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c
index c7a231c0a2..165065d714 100644
--- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c
+++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c
@@ -7,6 +7,24 @@
#include "z_en_viewer.h"
#include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h"
#include "overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64skin.h"
+
#include "assets/objects/object_zl4/object_zl4.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_horse_zelda/object_horse_zelda.h"
@@ -123,7 +141,7 @@ void EnViewer_InitAnimGanondorfOrZelda(EnViewer* this, PlayState* play, void* sk
SkelAnime_Init(play, &this->skin.skelAnime, skeletonHeaderSeg, NULL, NULL, NULL, 0);
}
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF ||
type == ENVIEWER_TYPE_9_GANONDORF) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, anim, 1.0f);
@@ -134,7 +152,7 @@ void EnViewer_InitAnimGanondorfOrZelda(EnViewer* this, PlayState* play, void* sk
void EnViewer_InitAnimImpa(EnViewer* this, PlayState* play, void* skeletonHeaderSeg, AnimationHeader* anim) {
SkelAnime_InitFlex(play, &this->skin.skelAnime, skeletonHeaderSeg, NULL, NULL, NULL, 0);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, anim, 3.0f);
}
@@ -487,7 +505,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
void EnViewer_Update(Actor* thisx, PlayState* play) {
EnViewer* this = (EnViewer*)thisx;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
this->actionFunc(this, play);
}
diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h
index de2bf8ba27..a06435d553 100644
--- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h
+++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h
@@ -2,13 +2,14 @@
#define Z_EN_VIEWER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64skin.h"
struct EnViewer;
-typedef void (*EnViewerActionFunc)(struct EnViewer*, PlayState*);
-typedef void (*EnViewerDrawFunc)(struct EnViewer*, PlayState*);
-typedef void (*EnViewerInitAnimFunc)(struct EnViewer*, PlayState*, void*, AnimationHeader*);
+typedef void (*EnViewerActionFunc)(struct EnViewer*, struct PlayState*);
+typedef void (*EnViewerDrawFunc)(struct EnViewer*, struct PlayState*);
+typedef void (*EnViewerInitAnimFunc)(struct EnViewer*, struct PlayState*, void*, AnimationHeader*);
typedef enum EnViewerType {
/* 0 */ ENVIEWER_TYPE_0_HORSE_ZELDA,
diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c
index 9847d4fa8d..2ee230d9bd 100644
--- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c
+++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c
@@ -5,8 +5,23 @@
*/
#include "z_en_vm.h"
-#include "assets/objects/object_vm/object_vm.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_vm/object_vm.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.h b/src/overlays/actors/ovl_En_Vm/z_en_vm.h
index 5b0fe1629e..7705d87032 100644
--- a/src/overlays/actors/ovl_En_Vm/z_en_vm.h
+++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.h
@@ -2,11 +2,11 @@
#define Z_EN_VM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnVm;
-typedef void (*EnVmActionFunc)(struct EnVm*, PlayState*);
+typedef void (*EnVmActionFunc)(struct EnVm*, struct PlayState*);
typedef struct EnVm {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c
index c650e79e85..149eba4700 100644
--- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c
+++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c
@@ -12,14 +12,14 @@
#include "rand.h"
#include "regs.h"
#include "sfx.h"
+#include "printf.h"
#include "quake.h"
#include "terminal.h"
#include "z_lib.h"
+#include "z64debug_display.h"
#include "z64effect.h"
#include "z64play.h"
-#include "global.h"
-
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void EnWallTubo_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c
index abbf3ecaa0..abb91c80b9 100644
--- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c
+++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c
@@ -5,8 +5,22 @@
*/
#include "z_en_wallmas.h"
-#include "assets/objects/object_wallmaster/object_wallmaster.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_wallmaster/object_wallmaster.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h
index c82df375dc..76ee52d9e0 100644
--- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h
+++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h
@@ -2,7 +2,7 @@
#define Z_EN_WALLMAS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum WallmasType {
/* 0x00 */ WMT_TIMER,
@@ -12,7 +12,7 @@ typedef enum WallmasType {
struct EnWallmas;
-typedef void (*EnWallmasActionFunc)(struct EnWallmas*, PlayState*);
+typedef void (*EnWallmasActionFunc)(struct EnWallmas*, struct PlayState*);
typedef struct EnWallmas {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c
index a7268efc97..04082aa10f 100644
--- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c
+++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c
@@ -5,8 +5,16 @@
*/
#include "z_en_weather_tag.h"
+
+#include "printf.h"
+#include "regs.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h
index ccfc0e3f67..52b617a0e7 100644
--- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h
+++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h
@@ -2,11 +2,11 @@
#define Z_EN_WEATHER_TAG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnWeatherTag;
-typedef void (*EnWeatherTagActionFunc)(struct EnWeatherTag*, PlayState*);
+typedef void (*EnWeatherTagActionFunc)(struct EnWeatherTag*, struct PlayState*);
typedef struct EnWeatherTag {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c
index 3d3387fcd2..2e19328961 100644
--- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c
+++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c
@@ -5,6 +5,18 @@
*/
#include "z_en_weiyer.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_ei/object_ei.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)
diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h
index fbaefbd9a5..ab1b81c34f 100644
--- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h
+++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h
@@ -2,11 +2,11 @@
#define Z_EN_WEIYER_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnWeiyer;
-typedef void (*EnWeiyerActionFunc)(struct EnWeiyer*, PlayState*);
+typedef void (*EnWeiyerActionFunc)(struct EnWeiyer*, struct PlayState*);
typedef struct EnWeiyer {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c
index 36aaac2344..4014597de7 100644
--- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c
+++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c
@@ -5,8 +5,27 @@
*/
#include "z_en_wf.h"
-#include "terminal.h"
#include "overlays/actors/ovl_En_Encount1/z_en_encount1.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_wf/object_wf.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
@@ -43,7 +62,7 @@ void EnWf_SetupDie(EnWf* this);
void EnWf_Die(EnWf* this, PlayState* play);
s32 EnWf_DodgeRanged(PlayState* play, EnWf* this);
-static ColliderJntSphElementInit sJntSphItemsInit[4] = {
+static ColliderJntSphElementInit sJntSphElementsInit[4] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -99,8 +118,8 @@ static ColliderJntSphInit sJntSphInit = {
OC2_TYPE_1,
COLSHAPE_JNTSPH,
},
- ARRAY_COUNT(sJntSphItemsInit),
- sJntSphItemsInit,
+ ARRAY_COUNT(sJntSphElementsInit),
+ sJntSphElementsInit,
};
static ColliderCylinderInit sBodyCylinderInit = {
@@ -225,12 +244,12 @@ void EnWf_Init(Actor* thisx, PlayState* play) {
this->eyeIndex = 0;
this->unk_2F4 = 10.0f; // Set and not used
- Collider_InitJntSph(play, &this->colliderSpheres);
- Collider_SetJntSph(play, &this->colliderSpheres, thisx, &sJntSphInit, this->colliderSpheresElements);
- Collider_InitCylinder(play, &this->colliderCylinderBody);
- Collider_SetCylinder(play, &this->colliderCylinderBody, thisx, &sBodyCylinderInit);
- Collider_InitCylinder(play, &this->colliderCylinderTail);
- Collider_SetCylinder(play, &this->colliderCylinderTail, thisx, &sTailCylinderInit);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, thisx, &sJntSphInit, this->colliderJntSphElements);
+ Collider_InitCylinder(play, &this->bodyColliderCylinder);
+ Collider_SetCylinder(play, &this->bodyColliderCylinder, thisx, &sBodyCylinderInit);
+ Collider_InitCylinder(play, &this->tailColliderCylinder);
+ Collider_SetCylinder(play, &this->tailColliderCylinder, thisx, &sTailCylinderInit);
if (thisx->params == WOLFOS_NORMAL) {
SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosNormalSkel, &gWolfosWaitingAnim, this->jointTable,
@@ -241,8 +260,8 @@ void EnWf_Init(Actor* thisx, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosWhiteSkel, &gWolfosWaitingAnim, this->jointTable,
this->morphTable, WOLFOS_LIMB_MAX);
Actor_SetScale(thisx, 0.01f);
- this->colliderSpheres.elements[0].base.atDmgInfo.damage =
- this->colliderSpheres.elements[1].base.atDmgInfo.damage = 8;
+ this->colliderJntSph.elements[0].base.atDmgInfo.damage =
+ this->colliderJntSph.elements[1].base.atDmgInfo.damage = 8;
thisx->naviEnemyId = NAVI_ENEMY_WHITE_WOLFOS;
}
@@ -256,9 +275,9 @@ void EnWf_Init(Actor* thisx, PlayState* play) {
void EnWf_Destroy(Actor* thisx, PlayState* play) {
EnWf* this = (EnWf*)thisx;
- Collider_DestroyJntSph(play, &this->colliderSpheres);
- Collider_DestroyCylinder(play, &this->colliderCylinderBody);
- Collider_DestroyCylinder(play, &this->colliderCylinderTail);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
+ Collider_DestroyCylinder(play, &this->bodyColliderCylinder);
+ Collider_DestroyCylinder(play, &this->tailColliderCylinder);
if ((this->actor.params != WOLFOS_NORMAL) && (this->switchFlag != 0xFF)) {
func_800F5B58();
@@ -716,7 +735,7 @@ void EnWf_RunAroundPlayer(EnWf* this, PlayState* play) {
void EnWf_SetupSlash(EnWf* this) {
Animation_PlayOnce(&this->skelAnime, &gWolfosSlashingAnim);
- this->colliderSpheres.base.atFlags &= ~AT_BOUNCED;
+ this->colliderJntSph.base.atFlags &= ~AT_BOUNCED;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->action = WOLFOS_ACTION_SLASH;
this->unk_2FA = 0; // Set and not used
@@ -1246,27 +1265,27 @@ void func_80B36F40(EnWf* this, PlayState* play) {
}
void EnWf_UpdateDamage(EnWf* this, PlayState* play) {
- if (this->colliderSpheres.base.acFlags & AC_BOUNCED) {
- this->colliderSpheres.base.acFlags &= ~(AC_HIT | AC_BOUNCED);
- this->colliderCylinderBody.base.acFlags &= ~AC_HIT;
- this->colliderCylinderTail.base.acFlags &= ~AC_HIT;
- } else if ((this->colliderCylinderBody.base.acFlags & AC_HIT) ||
- (this->colliderCylinderTail.base.acFlags & AC_HIT)) {
+ if (this->colliderJntSph.base.acFlags & AC_BOUNCED) {
+ this->colliderJntSph.base.acFlags &= ~(AC_HIT | AC_BOUNCED);
+ this->bodyColliderCylinder.base.acFlags &= ~AC_HIT;
+ this->tailColliderCylinder.base.acFlags &= ~AC_HIT;
+ } else if ((this->bodyColliderCylinder.base.acFlags & AC_HIT) ||
+ (this->tailColliderCylinder.base.acFlags & AC_HIT)) {
if (this->action >= WOLFOS_ACTION_WAIT) {
s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
- if ((!(this->colliderCylinderBody.base.acFlags & AC_HIT) &&
- (this->colliderCylinderTail.base.acFlags & AC_HIT)) ||
+ if ((!(this->bodyColliderCylinder.base.acFlags & AC_HIT) &&
+ (this->tailColliderCylinder.base.acFlags & AC_HIT)) ||
(ABS(yawDiff) > 19000)) {
this->actor.colChkInfo.damage *= 4;
}
- this->colliderCylinderBody.base.acFlags &= ~AC_HIT;
- this->colliderCylinderTail.base.acFlags &= ~AC_HIT;
+ this->bodyColliderCylinder.base.acFlags &= ~AC_HIT;
+ this->tailColliderCylinder.base.acFlags &= ~AC_HIT;
if (this->actor.colChkInfo.damageEffect != ENWF_DMGEFF_ICE_MAGIC) {
this->damageEffect = this->actor.colChkInfo.damageEffect;
- Actor_SetDropFlag(&this->actor, &this->colliderCylinderBody.elem, true);
+ Actor_SetDropFlag(&this->actor, &this->bodyColliderCylinder.elem, true);
#if OOT_VERSION >= PAL_1_0
this->slashStatus = 0;
#endif
@@ -1320,23 +1339,23 @@ void EnWf_Update(Actor* thisx, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.z, 0, 1, 1000, 0);
}
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderSpheres.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base);
if (this->action >= WOLFOS_ACTION_WAIT) {
if ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000)) {
- Collider_UpdateCylinder(&this->actor, &this->colliderCylinderBody);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinderTail.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderCylinderBody.base);
+ Collider_UpdateCylinder(&this->actor, &this->bodyColliderCylinder);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->tailColliderCylinder.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyColliderCylinder.base);
}
}
if (this->action == WOLFOS_ACTION_BLOCKING) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSpheres.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
}
if (this->slashStatus > 0) {
- if (!(this->colliderSpheres.base.atFlags & AT_BOUNCED)) {
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSpheres.base);
+ if (!(this->colliderJntSph.base.atFlags & AT_BOUNCED)) {
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
} else {
EnWf_SetupRecoilFromBlockedSlash(this);
}
@@ -1370,16 +1389,16 @@ void EnWf_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
EnWf* this = (EnWf*)thisx;
s32 bodyPartIndex = -1;
- Collider_UpdateSpheres(limbIndex, &this->colliderSpheres);
+ Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
if (limbIndex == WOLFOS_LIMB_TAIL) {
Vec3f colliderPos;
bodyPartIndex = -1;
Matrix_MultVec3f(&colliderVec, &colliderPos);
- this->colliderCylinderTail.dim.pos.x = colliderPos.x;
- this->colliderCylinderTail.dim.pos.y = colliderPos.y;
- this->colliderCylinderTail.dim.pos.z = colliderPos.z;
+ this->tailColliderCylinder.dim.pos.x = colliderPos.x;
+ this->tailColliderCylinder.dim.pos.y = colliderPos.y;
+ this->tailColliderCylinder.dim.pos.z = colliderPos.z;
}
if ((this->fireTimer != 0) || ((this->actor.colorFilterTimer != 0) && (this->actor.colorFilterParams & 0x4000))) {
diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.h b/src/overlays/actors/ovl_En_Wf/z_en_wf.h
index 83e46e6d19..afc18f7d01 100644
--- a/src/overlays/actors/ovl_En_Wf/z_en_wf.h
+++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.h
@@ -2,11 +2,11 @@
#define Z_EN_WF_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnWf;
-typedef void (*EnWfActionFunc)(struct EnWf*, PlayState*);
+typedef void (*EnWfActionFunc)(struct EnWf*, struct PlayState*);
typedef enum EnWfLimb {
/* 0 */ WOLFOS_LIMB_NONE,
@@ -74,10 +74,10 @@ typedef struct EnWf {
/* 0x02FE */ s16 runAngle;
/* 0x0300 */ s16 unk_300; // Set, but ineffectual (see comment in Draw)
/* 0x0302 */ u8 eyeIndex;
- /* 0x0304 */ ColliderJntSph colliderSpheres;
- /* 0x0324 */ ColliderJntSphElement colliderSpheresElements[4];
- /* 0x0424 */ ColliderCylinder colliderCylinderBody;
- /* 0x0470 */ ColliderCylinder colliderCylinderTail;
+ /* 0x0304 */ ColliderJntSph colliderJntSph;
+ /* 0x0324 */ ColliderJntSphElement colliderJntSphElements[4];
+ /* 0x0424 */ ColliderCylinder bodyColliderCylinder;
+ /* 0x0470 */ ColliderCylinder tailColliderCylinder;
/* 0x04BC */ Vec3f unk_4BC;
/* 0x04C8 */ Vec3f unk_4C8;
/* 0x04D4 */ Vec3s unk_4D4;
diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c
index b60361d810..a1cf8f5be6 100644
--- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c
+++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c
@@ -5,7 +5,17 @@
*/
#include "z_en_wonder_item.h"
+
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64debug_display.h"
+#include "z64play.h"
+#include "z64player.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h
index 4aca3ffe0a..5b99e235c3 100644
--- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h
+++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h
@@ -2,11 +2,11 @@
#define Z_EN_WONDER_ITEM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnWonderItem;
-typedef void (*EnWonderItemUpdateFunc)(struct EnWonderItem*, PlayState*);
+typedef void (*EnWonderItemUpdateFunc)(struct EnWonderItem*, struct PlayState*);
typedef struct EnWonderItem {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c
index ba76e3877b..fb455390a7 100644
--- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c
+++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c
@@ -5,7 +5,13 @@
*/
#include "z_en_wonder_talk.h"
+
+#include "printf.h"
+#include "regs.h"
#include "terminal.h"
+#include "z64debug_display.h"
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h
index ae21c5b41f..a42c3febfc 100644
--- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h
+++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h
@@ -2,11 +2,11 @@
#define Z_EN_WONDER_TALK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnWonderTalk;
-typedef void (*EnWonderTalkFunc)(struct EnWonderTalk*, PlayState*);
+typedef void (*EnWonderTalkFunc)(struct EnWonderTalk*, struct PlayState*);
typedef struct EnWonderTalk {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c
index 578c9851dc..bb58339fc1 100644
--- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c
+++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c
@@ -5,7 +5,14 @@
*/
#include "z_en_wonder_talk2.h"
+
+#include "printf.h"
+#include "regs.h"
#include "terminal.h"
+#include "z64debug_display.h"
+#include "z64item.h"
+#include "z64play.h"
+#include "z64player.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h
index f58775426f..0dad49d375 100644
--- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h
+++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h
@@ -2,11 +2,11 @@
#define Z_EN_WONDER_TALK2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnWonderTalk2;
-typedef void (*EnWonderTalk2Func)(struct EnWonderTalk2*, PlayState*);
+typedef void (*EnWonderTalk2Func)(struct EnWonderTalk2*, struct PlayState*);
typedef struct EnWonderTalk2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c
index c66a2232dd..bf32807226 100644
--- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c
+++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c
@@ -5,6 +5,21 @@
*/
#include "z_en_wood02.h"
+
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/object_wood02/object_wood02.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h
index 14ca5b967e..89242188ae 100644
--- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h
+++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h
@@ -2,7 +2,7 @@
#define Z_EN_WOOD02_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnWood02;
diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c
index f9c4cfb632..c8b6685587 100644
--- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c
+++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c
@@ -7,15 +7,34 @@
#include "z_en_xc.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/object_xc/object_xc.h"
#include "assets/scenes/overworld/spot05/spot05_scene.h"
#include "assets/scenes/overworld/spot17/spot17_scene.h"
#include "assets/scenes/indoors/tokinoma/tokinoma_scene.h"
#include "assets/scenes/dungeons/ice_doukutu/ice_doukutu_scene.h"
-#include "terminal.h"
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:128" \
- "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -1396,8 +1415,8 @@ void func_80B3F3D8(void) {
Sfx_PlaySfxCentered2(NA_SE_PL_SKIP);
}
-#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64" \
- "ique-cn:128 ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64"
+#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64 ique-cn:64" \
+ "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
void EnXc_PlayDiveSFX(Vec3f* src, PlayState* play) {
static Vec3f D_80B42DA0;
@@ -2024,7 +2043,8 @@ s32 EnXc_SetupNocturneState(Actor* thisx, PlayState* play) {
Actor_Kill(thisx);
break;
default:
- PRINTF("En_Oa2_Stalker_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Oa2_Stalker_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Oa2_Stalker_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
@@ -2333,7 +2353,8 @@ void EnXc_Update(Actor* thisx, PlayState* play) {
s32 action = this->action;
if ((action < 0) || (action >= ARRAY_COUNT(sActionFuncs)) || (sActionFuncs[action] == NULL)) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
sActionFuncs[action](this, play);
}
@@ -2450,8 +2471,8 @@ void EnXc_Draw(Actor* thisx, PlayState* play) {
EnXc* this = (EnXc*)thisx;
if (this->drawMode < 0 || this->drawMode > 5 || sDrawFuncs[this->drawMode] == NULL) {
- // "Draw mode is abnormal!!!!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
} else {
sDrawFuncs[this->drawMode](thisx, play);
}
diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.h b/src/overlays/actors/ovl_En_Xc/z_en_xc.h
index c01b98a842..1cc56f68e6 100644
--- a/src/overlays/actors/ovl_En_Xc/z_en_xc.h
+++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.h
@@ -2,12 +2,12 @@
#define Z_EN_XC_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnXc;
-typedef void (*EnXcActionFunc)(struct EnXc*, PlayState*);
-typedef void (*EnXcDrawFunc)(struct Actor*, PlayState*);
+typedef void (*EnXcActionFunc)(struct EnXc*, struct PlayState*);
+typedef void (*EnXcDrawFunc)(struct Actor*, struct PlayState*);
typedef enum EnXcType {
/* 0 */ SHEIK_TYPE_0,
diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c
index f294fb60c2..e5f75d60df 100644
--- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c
+++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c
@@ -5,7 +5,18 @@
*/
#include "z_en_yabusame_mark.h"
+
+#include "printf.h"
+#include "regs.h"
+#include "sequence.h"
+#include "sfx.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64debug_display.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h
index f4ec71bec5..12cfb46cbb 100644
--- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h
+++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h
@@ -2,11 +2,11 @@
#define Z_EN_YABUSAME_MARK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnYabusameMark;
-typedef void (*EnYabusameMarkActionFunc)(struct EnYabusameMark*, PlayState*);
+typedef void (*EnYabusameMarkActionFunc)(struct EnYabusameMark*, struct PlayState*);
typedef struct EnYabusameMark {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c
index 4a6d3bc397..22d454fb61 100644
--- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c
+++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c
@@ -5,6 +5,17 @@
*/
#include "z_en_yukabyun.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_yukabyun/object_yukabyun.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h
index 773237fbce..a695fb4c1f 100644
--- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h
+++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h
@@ -2,11 +2,11 @@
#define Z_EN_YUKABYUN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnYukabyun;
-typedef void (*EnYukabyunActionFunc)(struct EnYukabyun*, PlayState*);
+typedef void (*EnYukabyunActionFunc)(struct EnYukabyun*, struct PlayState*);
typedef struct EnYukabyun {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c
index 70812e3f0f..b49481e881 100644
--- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c
+++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c
@@ -5,6 +5,24 @@
*/
#include "z_en_zf.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "regs.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_zf/object_zf.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.h b/src/overlays/actors/ovl_En_Zf/z_en_zf.h
index c5ade78544..9dfb3119b9 100644
--- a/src/overlays/actors/ovl_En_Zf/z_en_zf.h
+++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.h
@@ -2,11 +2,11 @@
#define Z_EN_ZF_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnZf;
-typedef void (*EnZfActionFunc)(struct EnZf*, PlayState*);
+typedef void (*EnZfActionFunc)(struct EnZf*, struct PlayState*);
typedef enum EnZfType {
/* -2 */ ENZF_TYPE_DINOLFOS = -2,
diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c
index 8a01936fff..5c60653b4e 100644
--- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c
+++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c
@@ -5,6 +5,20 @@
*/
#include "z_en_zl1.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "letterbox.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_zl1/object_zl1.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h
index 4b9f2984e0..ada1335819 100644
--- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h
+++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h
@@ -2,11 +2,11 @@
#define Z_EN_ZL1_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnZl1;
-typedef void (*EnZl1ActionFunc)(struct EnZl1*, PlayState*);
+typedef void (*EnZl1ActionFunc)(struct EnZl1*, struct PlayState*);
typedef struct EnZl1 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c
index fb4776673e..f6fac8940a 100644
--- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c
+++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.inc.c
@@ -1,4 +1,3 @@
-#include "z_en_zl1.h"
#include "z64cutscene_commands.h"
static CutsceneCameraDirection D_80B4D5C0[] = {
diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c
index 6c268600ec..4a8622cbba 100644
--- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c
+++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c
@@ -1,5 +1,6 @@
-#include "z_en_zl1.h"
+#include "sequence.h"
#include "z64cutscene_commands.h"
+#include "z64player.h"
// clang-format off
CutsceneData gTriforceCreationStartCs[] = {
diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c
index dbc45b62c6..c00790e02c 100644
--- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c
+++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c
@@ -5,11 +5,24 @@
*/
#include "z_en_zl2.h"
-#include "terminal.h"
-
-#include "z64frame_advance.h"
-
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
+
+#include "libc64/math64.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64frame_advance.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_zl2/object_zl2.h"
#include "assets/objects/object_zl2_anime1/object_zl2_anime1.h"
@@ -579,7 +592,7 @@ void EnZl2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
void func_80B4FCCC(EnZl2* this, PlayState* play) {
s32 objectSlot = this->zl2Anime1ObjectSlot;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
}
void func_80B4FD00(EnZl2* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) {
@@ -992,7 +1005,8 @@ void func_80B50A04(EnZl2* this, PlayState* play) {
func_80B50644(this, play);
break;
default:
- PRINTF("En_Zl2_inAgain_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Zl2_inAgain_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Zl2_inAgain_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -1383,7 +1397,8 @@ void func_80B51948(EnZl2* this, PlayState* play) {
func_80B513A8(this, play);
break;
default:
- PRINTF("En_Zl2_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Zl2_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Zl2_inEnding_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->cueId = nextCueId;
}
@@ -1547,7 +1562,8 @@ void func_80B51FA8(EnZl2* this, PlayState* play) {
Actor_Kill(&this->actor);
break;
default:
- PRINTF("En_Zl2_inRunning_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Zl2_inRunning_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Zl2_inRunning_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->cueId = nextCueId;
@@ -1617,7 +1633,8 @@ void EnZl2_Update(Actor* thisx, PlayState* play) {
EnZl2* this = (EnZl2*)thisx;
if (this->action < 0 || this->action >= 0x24 || sActionFuncs[this->action] == NULL) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -1713,7 +1730,8 @@ void EnZl2_Draw(Actor* thisx, PlayState* play) {
EnZl2* this = (EnZl2*)thisx;
if ((this->drawConfig < 0) || (this->drawConfig >= 3) || (sDrawFuncs[this->drawConfig] == NULL)) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h
index c477ea57e1..4bd0730de7 100644
--- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h
+++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h
@@ -2,12 +2,12 @@
#define Z_EN_ZL2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnZl2;
-typedef void (*EnZl2ActionFunc)(struct EnZl2*, PlayState*);
-typedef void (*EnZl2DrawFunc)(struct EnZl2*, PlayState*);
+typedef void (*EnZl2ActionFunc)(struct EnZl2*, struct PlayState*);
+typedef void (*EnZl2DrawFunc)(struct EnZl2*, struct PlayState*);
typedef struct EnZl2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c
index dfefdf63b9..ca44cb5731 100644
--- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c
+++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c
@@ -8,10 +8,12 @@
#include "libc64/math64.h"
#include "libc64/qrand.h"
+#include "array_count.h"
#include "attributes.h"
#include "gfx.h"
#include "gfx_setupdl.h"
#include "one_point_cutscene.h"
+#include "printf.h"
#include "regs.h"
#include "segmented_address.h"
#include "seqcmd.h"
@@ -19,13 +21,14 @@
#include "sfx.h"
#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_en_item00.h"
#include "z_lib.h"
#include "z64audio.h"
#include "z64frame_advance.h"
#include "z64play.h"
#include "z64player.h"
-
-#include "global.h"
+#include "z64save.h"
#include "overlays/actors/ovl_En_Encount2/z_en_encount2.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
@@ -763,7 +766,7 @@ s32 func_80B54DD4(EnZl3* this) {
void func_80B54DE0(EnZl3* this, PlayState* play) {
s32 objectSlot = this->zl2Anime2ObjectSlot;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
}
void func_80B54E14(EnZl3* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) {
@@ -965,7 +968,8 @@ void func_80B55444(EnZl3* this, PlayState* play) {
this->unk_328 = 1;
FALLTHROUGH;
default:
- PRINTF("En_Zl3_inFinal_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Zl3_inFinal_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Zl3_inFinal_Check_DemoMode: There is no such action!!!!!!!!\n"));
break;
}
this->unk_2F0 = temp_v0;
@@ -1381,7 +1385,8 @@ void func_80B564A8(EnZl3* this, PlayState* play) {
Actor_Kill(&this->actor);
break;
default:
- PRINTF("En_Zl3_inFinal2_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
+ PRINTF(T("En_Zl3_inFinal2_Check_DemoMode:そんな動作は無い!!!!!!!!\n",
+ "En_Zl3_inFinal2_Check_DemoMode: There is no such action!!!!!!!!\n"));
}
this->unk_2F0 = temp_v0;
}
@@ -2690,7 +2695,8 @@ void EnZl3_Update(Actor* thisx, PlayState* play) {
EnZl3* this = (EnZl3*)thisx;
if (this->action < 0 || this->action >= ARRAY_COUNT(sActionFuncs) || sActionFuncs[this->action] == NULL) {
- PRINTF(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The main mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sActionFuncs[this->action](this, play);
@@ -2799,7 +2805,8 @@ void EnZl3_Draw(Actor* thisx, PlayState* play) {
EnZl3* this = (EnZl3*)thisx;
if (this->drawConfig < 0 || this->drawConfig >= 3 || sDrawFuncs[this->drawConfig] == NULL) {
- PRINTF(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
+ PRINTF(VT_FGCOL(RED) T("描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n",
+ "The drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, play);
diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
index e3b8a51af3..a18efd4ba9 100644
--- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
+++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
@@ -5,6 +5,23 @@
*/
#include "z_en_zl4.h"
+
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "letterbox.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_zl4/object_zl4.h"
#include "assets/scenes/indoors/nakaniwa/nakaniwa_scene.h"
diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h
index 8710cc9cf9..b371092e08 100644
--- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h
+++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h
@@ -2,12 +2,12 @@
#define Z_EN_ZL4_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnZl4;
-typedef void (*EnZl4ActionFunc)(struct EnZl4*, PlayState*);
-typedef void (*EnZl4DrawFunc)(struct EnZl4*, PlayState*);
+typedef void (*EnZl4ActionFunc)(struct EnZl4*, struct PlayState*);
+typedef void (*EnZl4DrawFunc)(struct EnZl4*, struct PlayState*);
typedef struct EnZl4 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4_cutscene_data.inc.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4_cutscene_data.inc.c
index 3ad3b996be..933f7e0aaa 100644
--- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4_cutscene_data.inc.c
+++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4_cutscene_data.inc.c
@@ -1,4 +1,4 @@
-#include "z_en_zl4.h"
+#include "z64cutscene_commands.h"
static CutsceneCameraDirection sCamDirections[] = {
{ { -490.0f, 120.0f, 0.0f }, { -440.0f, 117.0f, 0.0f }, 0, 45 },
diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c
index 6eb051e47a..95a9f6e07c 100644
--- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c
+++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c
@@ -5,6 +5,20 @@
*/
#include "z_en_zo.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64face_reaction.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_zo/object_zo.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/src/overlays/actors/ovl_En_Zo/z_en_zo.h
index 4d7a02ddf0..5f26a20230 100644
--- a/src/overlays/actors/ovl_En_Zo/z_en_zo.h
+++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.h
@@ -2,7 +2,7 @@
#define Z_EN_ZO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EnZo;
@@ -19,7 +19,7 @@ typedef struct EnZoEffect {
/* 0x2C */ Vec3f vec; // Usage specific
} EnZoEffect; // size = 0x38
-typedef void (*EnZoActionFunc)(struct EnZo*, PlayState*);
+typedef void (*EnZoActionFunc)(struct EnZo*, struct PlayState*);
typedef struct EnZo {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c
index bce528552b..02e24ff540 100644
--- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c
+++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c
@@ -5,11 +5,28 @@
*/
#include "z_en_fhg.h"
-#include "assets/objects/object_fhg/object_fhg.h"
#include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
#include "overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h"
#include "overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h"
+#include "libc64/qrand.h"
+#include "attributes.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+#include "z64skin.h"
+
+#include "assets/objects/object_fhg/object_fhg.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
typedef struct EnfHGPainting {
diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h
index 5432f82341..dca6eeb82a 100644
--- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h
+++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h
@@ -2,11 +2,12 @@
#define Z_EN_FHG_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64skin.h"
struct EnfHG;
-typedef void (*EnfHGActionFunc)(struct EnfHG*, PlayState*);
+typedef void (*EnfHGActionFunc)(struct EnfHG*, struct PlayState*);
typedef enum EnfHGSignal {
/* 0 */ FHG_NO_SIGNAL,
diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c
index 961f96f64f..3e2d26e509 100644
--- a/src/overlays/actors/ovl_End_Title/z_end_title.c
+++ b/src/overlays/actors/ovl_End_Title/z_end_title.c
@@ -5,7 +5,13 @@
*/
#include "z_end_title.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z64play.h"
+#include "z64player.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.h b/src/overlays/actors/ovl_End_Title/z_end_title.h
index 9897c0fbf2..cd29ff507c 100644
--- a/src/overlays/actors/ovl_End_Title/z_end_title.h
+++ b/src/overlays/actors/ovl_End_Title/z_end_title.h
@@ -2,7 +2,7 @@
#define Z_END_TITLE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct EndTitle;
diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c
index 2034187934..58929bd248 100644
--- a/src/overlays/actors/ovl_Fishing/z_fishing.c
+++ b/src/overlays/actors/ovl_Fishing/z_fishing.c
@@ -15,6 +15,7 @@
#include "gfx_setupdl.h"
#include "ichain.h"
#include "letterbox.h"
+#include "printf.h"
#include "rand.h"
#include "regs.h"
#include "rumble.h"
@@ -26,17 +27,18 @@
#include "sys_matrix.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
#include "z64audio.h"
#include "z64play.h"
#include "z64player.h"
+#include "z64save.h"
#include "z64skin_matrix.h"
-#include "z_lib.h"
#if PLATFORM_N64
#include "cic6105.h"
#endif
-#pragma increment_block_number "gc-eu:170 gc-eu-mq:170 gc-jp:170 gc-jp-ce:170 gc-jp-mq:170 gc-us:170 gc-us-mq:170" \
- "ntsc-1.0:121 ntsc-1.1:121 ntsc-1.2:121 pal-1.0:121 pal-1.1:121"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:0" \
+ "ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c
index da8ddad524..a690bfa73f 100644
--- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c
+++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c
@@ -5,6 +5,15 @@
*/
#include "z_item_b_heart.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64item.h"
+#include "z64play.h"
+
#include "assets/objects/object_gi_hearts/object_gi_hearts.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h
index 432a7ef499..ef92f86b86 100644
--- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h
+++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h
@@ -2,7 +2,7 @@
#define Z_ITEM_B_HEART_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ItemBHeart;
diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c
index e845f465a5..3909fb72f9 100644
--- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c
+++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c
@@ -5,7 +5,15 @@
*/
#include "z_item_etcetera.h"
+
+#include "libc64/qrand.h"
+#include "libu64/debug.h"
+#include "printf.h"
+#include "rand.h"
#include "z64draw.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h
index c5054884bd..e938c81267 100644
--- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h
+++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h
@@ -2,11 +2,11 @@
#define Z_ITEM_ETC_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ItemEtcetera;
-typedef void (*ItemEtceteraActionFunc)(struct ItemEtcetera*, PlayState*);
+typedef void (*ItemEtceteraActionFunc)(struct ItemEtcetera*, struct PlayState*);
typedef struct ItemEtcetera {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c
index 3f36c3da17..40594c86f6 100644
--- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c
+++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c
@@ -6,6 +6,7 @@
#include "z_item_inbox.h"
#include "z64draw.h"
+#include "z64play.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h
index 3bf3cf1570..d13bad0053 100644
--- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h
+++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h
@@ -2,11 +2,11 @@
#define Z_ITEM_INBOX_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ItemInbox;
-typedef void (*ItemInboxActionFunc)(struct ItemInbox*, PlayState*);
+typedef void (*ItemInboxActionFunc)(struct ItemInbox*, struct PlayState*);
typedef struct ItemInbox {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c
index 434322abc5..fa4f500c87 100644
--- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c
+++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c
@@ -5,7 +5,15 @@
*/
#include "z_item_ocarina.h"
+
+#include "libu64/debug.h"
+#include "segmented_address.h"
+#include "sfx.h"
#include "z64draw.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/scenes/overworld/spot00/spot00_scene.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h
index 9a02b99ed0..3ae598e7d1 100644
--- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h
+++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h
@@ -2,11 +2,11 @@
#define Z_ITEM_OCARINA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ItemOcarina;
-typedef void (*ItemOcarinaActionFunc)(struct ItemOcarina*, PlayState*);
+typedef void (*ItemOcarinaActionFunc)(struct ItemOcarina*, struct PlayState*);
typedef struct ItemOcarina {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c
index 0307862327..2f281a17d2 100644
--- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c
+++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c
@@ -4,8 +4,22 @@
* Description: Deku Shield
*/
-#include "terminal.h"
#include "z_item_shield.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64item.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_link_child/object_link_child.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.h b/src/overlays/actors/ovl_Item_Shield/z_item_shield.h
index c7984f4a4d..564170e465 100644
--- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.h
+++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.h
@@ -2,11 +2,11 @@
#define Z_ITEM_SHIELD_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ItemShield;
-typedef void (*ItemShieldActionFunc)(struct ItemShield*, PlayState*);
+typedef void (*ItemShieldActionFunc)(struct ItemShield*, struct PlayState*);
typedef struct ItemShield {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c
index d809a82ebe..d2912c7ea5 100644
--- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c
+++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c
@@ -5,6 +5,17 @@
*/
#include "z_magic_dark.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h
index 3d7ef82298..59344baff1 100644
--- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h
+++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h
@@ -2,7 +2,7 @@
#define Z_MAGIC_DARK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct MagicDark;
diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c
index ede5f3691c..e60e524b84 100644
--- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c
+++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c
@@ -6,6 +6,15 @@
#include "z_magic_fire.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void MagicFire_Init(Actor* thisx, PlayState* play);
@@ -232,7 +241,7 @@ void MagicFire_Draw(Actor* thisx, PlayState* play) {
(u8)(s32)(120 * this->screenTintIntensity));
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
- gDPFillRectangle(POLY_XLU_DISP++, 0, 0, 319, 239);
+ gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, 255, 200, 0, (u8)(this->alphaMultiplier * 255));
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, (u8)(this->alphaMultiplier * 255));
diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h
index 4a9cb5188c..ae953c0d3c 100644
--- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h
+++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h
@@ -2,7 +2,7 @@
#define Z_MAGIC_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct MagicFire;
diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c
index 0694e07128..57761244ba 100644
--- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c
+++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c
@@ -6,6 +6,16 @@
#include "z_magic_wind.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sfx.h"
+#include "z64curve.h"
+#include "z64play.h"
+#include "z64player.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void MagicWind_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h
index e9521f7002..b7ba93c264 100644
--- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h
+++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h
@@ -2,11 +2,12 @@
#define Z_MAGIC_WIND_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64curve.h"
struct MagicWind;
-typedef void (*MagicWindFunc)(struct MagicWind* this, PlayState* play);
+typedef void (*MagicWindFunc)(struct MagicWind* this, struct PlayState* play);
typedef struct MagicWind {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c
index 1915999df6..861d72881f 100644
--- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c
+++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c
@@ -5,6 +5,20 @@
*/
#include "z_mir_ray.h"
+
+#include "libu64/debug.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64light.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/object_mir_ray/object_mir_ray.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -118,10 +132,11 @@ void MirRay_SetupCollider(MirRay* this) {
colliderOffset.x = (this->poolPt.x - this->sourcePt.x) * dataEntry->unk_10;
colliderOffset.y = (this->poolPt.y - this->sourcePt.y) * dataEntry->unk_10;
colliderOffset.z = (this->poolPt.z - this->sourcePt.z) * dataEntry->unk_10;
- this->colliderSph.elements[0].dim.worldSphere.center.x = colliderOffset.x + this->sourcePt.x;
- this->colliderSph.elements[0].dim.worldSphere.center.y = colliderOffset.y + this->sourcePt.y;
- this->colliderSph.elements[0].dim.worldSphere.center.z = colliderOffset.z + this->sourcePt.z;
- this->colliderSph.elements[0].dim.worldSphere.radius = dataEntry->unk_14 * this->colliderSph.elements->dim.scale;
+ this->colliderJntSph.elements[0].dim.worldSphere.center.x = colliderOffset.x + this->sourcePt.x;
+ this->colliderJntSph.elements[0].dim.worldSphere.center.y = colliderOffset.y + this->sourcePt.y;
+ this->colliderJntSph.elements[0].dim.worldSphere.center.z = colliderOffset.z + this->sourcePt.z;
+ this->colliderJntSph.elements[0].dim.worldSphere.radius =
+ dataEntry->unk_14 * this->colliderJntSph.elements->dim.scale;
}
// Set up a light point between source point and reflection point. Reflection point is the pool point (for windows) or
@@ -208,8 +223,8 @@ void MirRay_Init(Actor* thisx, PlayState* play) {
this->shieldCorners[5].y = -800.0f;
if (PARAMS_GET_NOSHIFT(dataEntry->params, 1, 1)) {
- Collider_InitJntSph(play, &this->colliderSph);
- Collider_SetJntSph(play, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem);
+ Collider_InitJntSph(play, &this->colliderJntSph);
+ Collider_SetJntSph(play, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElements);
if (!PARAMS_GET_NOSHIFT(dataEntry->params, 2, 1)) { // Beams not from mirrors
MirRay_SetupCollider(this);
}
@@ -230,7 +245,7 @@ void MirRay_Destroy(Actor* thisx, PlayState* play) {
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
if (sMirRayData[this->actor.params].params & 2) {
- Collider_DestroyJntSph(play, &this->colliderSph);
+ Collider_DestroyJntSph(play, &this->colliderJntSph);
}
Collider_DestroyQuad(play, &this->shieldRay);
@@ -248,7 +263,7 @@ void MirRay_Update(Actor* thisx, PlayState* play) {
if (sMirRayData[this->actor.params].params & 4) { // Beams from mirrors
MirRay_SetupCollider(this);
}
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSph.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
}
if (this->reflectIntensity > 0.0f) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->shieldRay.base);
diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h
index 4e93149075..245cf1007b 100644
--- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h
+++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h
@@ -2,7 +2,8 @@
#define Z_MIR_RAY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct MirRay;
@@ -22,14 +23,14 @@ typedef struct MirRayDataEntry {
typedef struct MirRayShieldReflection {
/* 0x00 */ Vec3f pos;
/* 0x0C */ MtxF mtx;
- /* 0x4C */ CollisionPoly* reflectionPoly;
+ /* 0x4C */ struct CollisionPoly* reflectionPoly;
/* 0x50 */ u8 opacity;
} MirRayShieldReflection; // size = 0x54
typedef struct MirRay {
/* 0x0000 */ Actor actor;
- /* 0x014C */ ColliderJntSph colliderSph;
- /* 0x016C */ ColliderJntSphElement colliderSphItem;
+ /* 0x014C */ ColliderJntSph colliderJntSph;
+ /* 0x016C */ ColliderJntSphElement colliderJntSphElements[1];
/* 0x01AC */ ColliderQuad shieldRay;
/* 0x022C */ f32 reflectIntensity; // Reflection occurs if it is positive, brightness depends on it
/* 0x0230 */ Vec3f shieldCorners[6];
diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c
index a7bf1716d7..88638e1ed8 100644
--- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c
+++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c
@@ -5,9 +5,27 @@
*/
#include "z_obj_bean.h"
-#include "assets/objects/object_mamenoki/object_mamenoki.h"
-#include "assets/objects/gameplay_keep/gameplay_keep.h"
+
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64cutscene_flags.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64save.h"
+
+#include "assets/objects/gameplay_keep/gameplay_keep.h"
+#include "assets/objects/object_mamenoki/object_mamenoki.h"
#define FLAGS ACTOR_FLAG_IGNORE_POINT_LIGHTS
@@ -145,8 +163,9 @@ void ObjBean_InitDynaPoly(ObjBean* this, PlayState* play, CollisionHeader* colli
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_bean.c", 374,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_obj_bean.c", 374, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -473,16 +492,17 @@ void ObjBean_Init(Actor* thisx, PlayState* play) {
path = PARAMS_GET_U(this->dyna.actor.params, 8, 5);
if (path == 0x1F) {
PRINTF_COLOR_ERROR();
- // "No path data?"
- PRINTF("パスデータが無い?(%s %d)(arg_data %xH)\n", "../z_obj_bean.c", 909, this->dyna.actor.params);
+ PRINTF(T("パスデータが無い?(%s %d)(arg_data %xH)\n", "No path data? (%s %d)(arg_data %xH)\n"),
+ "../z_obj_bean.c", 909, this->dyna.actor.params);
PRINTF_RST();
Actor_Kill(&this->dyna.actor);
return;
}
if (play->pathList[path].count < 3) {
PRINTF_COLOR_ERROR();
- // "Incorrect number of path data"
- PRINTF("パスデータ数が不正(%s %d)(arg_data %xH)\n", "../z_obj_bean.c", 921, this->dyna.actor.params);
+ PRINTF(T("パスデータ数が不正(%s %d)(arg_data %xH)\n",
+ "Path data count is invalid (%s %d)(arg_data %xH)\n"),
+ "../z_obj_bean.c", 921, this->dyna.actor.params);
PRINTF_RST();
Actor_Kill(&this->dyna.actor);
return;
@@ -511,8 +531,8 @@ void ObjBean_Init(Actor* thisx, PlayState* play) {
ObjBean_SetupWaitForBean(this);
}
this->dyna.actor.world.rot.z = this->dyna.actor.home.rot.z = this->dyna.actor.shape.rot.z = 0;
- // "Magic bean tree lift"
- PRINTF("(魔法の豆の木リフト)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("(魔法の豆の木リフト)(arg_data 0x%04x)\n", "(Magic beanstalk lift)(arg_data 0x%04x)\n"),
+ this->dyna.actor.params);
}
void ObjBean_Destroy(Actor* thisx, PlayState* play) {
@@ -889,8 +909,7 @@ void ObjBean_Update(Actor* thisx, PlayState* play) {
if (ObjBean_CheckForHorseTrample(this, play)) {
PRINTF_COLOR_CYAN();
- // "Horse and bean tree lift collision"
- PRINTF("馬と豆の木リフト衝突!!!\n");
+ PRINTF(T("馬と豆の木リフト衝突!!!\n", "Horse and beanstalk lift collide!!!\n"));
PRINTF_RST();
ObjBean_Break(this, play);
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h
index 317db48216..42ba39261c 100644
--- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h
+++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h
@@ -2,11 +2,11 @@
#define Z_OBJ_BEAN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjBean;
-typedef void (*ObjBeanActionFunc)(struct ObjBean*, PlayState*);
+typedef void (*ObjBeanActionFunc)(struct ObjBean*, struct PlayState*);
typedef void (*ObjBeanTransformFunc)(struct ObjBean*);
typedef struct ObjBean {
diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c
index cb7cba62c0..8f24b7e647 100644
--- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c
+++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c
@@ -7,6 +7,10 @@
#include "z_obj_blockstop.h"
#include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#define FLAGS 0
void ObjBlockstop_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h
index f6ff149e9d..e0159e0f97 100644
--- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h
+++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h
@@ -2,7 +2,7 @@
#define Z_OBJ_BLOCKSTOP_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjBlockstop;
diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c
index 68e1687aa8..c6d7b1da3f 100644
--- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c
+++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c
@@ -6,6 +6,16 @@
#include "z_obj_bombiwa.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_bombiwa/object_bombiwa.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h
index 33597276b0..9c5c38d127 100644
--- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h
+++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h
@@ -2,7 +2,7 @@
#define Z_OBJ_BOMBIWA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjBombiwa;
diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
index 6f86b829a4..d3affc90a9 100644
--- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
+++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
@@ -6,6 +6,17 @@
#include "z_obj_comb.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "sys_matrix.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0
@@ -151,7 +162,7 @@ void ObjComb_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
ObjComb_SetupWait(this);
}
diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
index 3a6ce86413..acda97f16d 100644
--- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
+++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
@@ -2,17 +2,17 @@
#define Z_OBJ_COMB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjComb;
-typedef void (*ObjCombActionFunc)(struct ObjComb*, PlayState*);
+typedef void (*ObjCombActionFunc)(struct ObjComb*, struct PlayState*);
typedef struct ObjComb {
/* 0x0000 */ Actor actor;
/* 0x014C */ ObjCombActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
/* 0x01B0 */ s16 unk_1B0;
/* 0x01B2 */ s16 unk_1B2;
} ObjComb; // size = 0x01B4
diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c
index 3a0d603aae..2c77570a41 100644
--- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c
+++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c
@@ -5,6 +5,14 @@
*/
#include "z_obj_dekujr.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/object_dekujr/object_dekujr.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h
index 88818776a2..68b483f8dc 100644
--- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h
+++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h
@@ -2,7 +2,7 @@
#define Z_OBJ_DEKUJR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjDekujr;
diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c
index 411d3e2ad9..2163114cd2 100644
--- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c
+++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c
@@ -5,6 +5,14 @@
*/
#include "z_obj_elevator.h"
+
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_d_elevator/object_d_elevator.h"
#define FLAGS 0
@@ -55,8 +63,9 @@ void func_80B92B08(ObjElevator* this, PlayState* play, CollisionHeader* collisio
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_elevator.c", 136,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_obj_elevator.c", 136, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h
index e77d04a9ae..e6b8d4b6d8 100644
--- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h
+++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h
@@ -2,11 +2,11 @@
#define Z_OBJ_ELEVATOR_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjElevator;
-typedef void (*ObjElevatorActionFunc)(struct ObjElevator*, PlayState*);
+typedef void (*ObjElevatorActionFunc)(struct ObjElevator*, struct PlayState*);
typedef struct ObjElevator {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c
index 3f45341e30..39d6de7d65 100644
--- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c
+++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c
@@ -5,6 +5,19 @@
*/
#include "z_obj_hamishi.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "rand.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h
index a897177f64..8a2256bf04 100644
--- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h
+++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h
@@ -2,7 +2,7 @@
#define Z_OBJ_HAMISHI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjHamishi;
diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c
index badd99186d..f1f8000063 100644
--- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c
+++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c
@@ -5,6 +5,11 @@
*/
#include "z_obj_hana.h"
+
+#include "ichain.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h
index 7fdd3bfa89..69c08b4cb6 100644
--- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h
+++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h
@@ -2,7 +2,7 @@
#define Z_OBJ_HANA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjHana;
diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c
index d946077670..c057c6b875 100644
--- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c
+++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c
@@ -5,6 +5,17 @@
*/
#include "z_obj_hsblock.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/object_d_hsblock/object_d_hsblock.h"
#define FLAGS 0
@@ -64,8 +75,9 @@ void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_hsblock.c", 163,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_obj_hsblock.c", 163, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h
index 6548ca9b97..299ba7d3d6 100644
--- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h
+++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h
@@ -2,11 +2,11 @@
#define Z_OBJ_HSBLOCK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjHsblock;
-typedef void (*ObjHsblockActionFunc)(struct ObjHsblock*, PlayState*);
+typedef void (*ObjHsblockActionFunc)(struct ObjHsblock*, struct PlayState*);
typedef struct ObjHsblock {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
index 23b1728fcc..71ff43d277 100644
--- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
+++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
@@ -5,6 +5,17 @@
*/
#include "z_obj_ice_poly.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -85,18 +96,18 @@ void ObjIcePoly_Init(Actor* thisx, PlayState* play) {
}
Actor_SetScale(thisx, sScale[thisx->params]);
thisx->world.pos.y = sOffsetY[thisx->params] + thisx->home.pos.y;
- Collider_InitCylinder(play, &this->colliderIce);
- Collider_SetCylinder(play, &this->colliderIce, thisx, &sCylinderInitIce);
- Collider_InitCylinder(play, &this->colliderHard);
- Collider_SetCylinder(play, &this->colliderHard, thisx, &sCylinderInitHard);
- Collider_UpdateCylinder(thisx, &this->colliderIce);
- Collider_UpdateCylinder(thisx, &this->colliderHard);
+ Collider_InitCylinder(play, &this->iceCollider);
+ Collider_SetCylinder(play, &this->iceCollider, thisx, &sCylinderInitIce);
+ Collider_InitCylinder(play, &this->hardCollider);
+ Collider_SetCylinder(play, &this->hardCollider, thisx, &sCylinderInitHard);
+ Collider_UpdateCylinder(thisx, &this->iceCollider);
+ Collider_UpdateCylinder(thisx, &this->hardCollider);
thisx->colChkInfo.mass = MASS_IMMOVABLE;
this->alpha = 255;
- this->colliderIce.dim.radius *= thisx->scale.x;
- this->colliderIce.dim.height *= thisx->scale.y;
- this->colliderHard.dim.radius *= thisx->scale.x;
- this->colliderHard.dim.height *= thisx->scale.y;
+ this->iceCollider.dim.radius *= thisx->scale.x;
+ this->iceCollider.dim.height *= thisx->scale.y;
+ this->hardCollider.dim.radius *= thisx->scale.x;
+ this->hardCollider.dim.height *= thisx->scale.y;
Actor_SetFocus(thisx, thisx->scale.y * 30.0f);
this->actionFunc = ObjIcePoly_Idle;
}
@@ -106,8 +117,8 @@ void ObjIcePoly_Destroy(Actor* thisx, PlayState* play) {
ObjIcePoly* this = (ObjIcePoly*)thisx;
if ((this->actor.params >= 0) && (this->actor.params < 3)) {
- Collider_DestroyCylinder(play, &this->colliderIce);
- Collider_DestroyCylinder(play, &this->colliderHard);
+ Collider_DestroyCylinder(play, &this->iceCollider);
+ Collider_DestroyCylinder(play, &this->hardCollider);
}
}
@@ -116,17 +127,17 @@ void ObjIcePoly_Idle(ObjIcePoly* this, PlayState* play) {
s32 pad;
Vec3f pos;
- if (this->colliderIce.base.acFlags & AC_HIT) {
- this->meltTimer = -this->colliderIce.elem.acHitElem->atDmgInfo.damage;
+ if (this->iceCollider.base.acFlags & AC_HIT) {
+ this->meltTimer = -this->iceCollider.elem.acHitElem->atDmgInfo.damage;
this->actor.focus.rot.y = this->actor.yawTowardsPlayer;
OnePointCutscene_Init(play, 5120, 40, &this->actor, CAM_ID_MAIN);
this->actionFunc = ObjIcePoly_Melt;
} else if (this->actor.parent != NULL) {
this->actor.parent->freezeTimer = 40;
- CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderIce.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderIce.base);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderIce.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderHard.base);
+ CollisionCheck_SetAT(play, &play->colChkCtx, &this->iceCollider.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->iceCollider.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->iceCollider.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->hardCollider.base);
} else {
Actor_Kill(&this->actor);
}
diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h
index 8ebbe8d128..c6a56d16f1 100644
--- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h
+++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h
@@ -2,11 +2,11 @@
#define Z_OBJ_ICE_POLY_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjIcePoly;
-typedef void (*ObjIcePolyActionFunc)(struct ObjIcePoly*, PlayState*);
+typedef void (*ObjIcePolyActionFunc)(struct ObjIcePoly*, struct PlayState*);
typedef struct ObjIcePoly {
/* 0x0000 */ Actor actor;
@@ -14,8 +14,8 @@ typedef struct ObjIcePoly {
/* 0x0150 */ u8 alpha;
/* 0x0151 */ u8 unk_151; // Unused. Probably intended to be a switch flag.
/* 0x0152 */ s16 meltTimer;
- /* 0x0154 */ ColliderCylinder colliderIce;
- /* 0x01A0 */ ColliderCylinder colliderHard;
+ /* 0x0154 */ ColliderCylinder iceCollider;
+ /* 0x01A0 */ ColliderCylinder hardCollider;
} ObjIcePoly; // size = 0x01EC
#endif
diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c
index 0f26d40611..8501c29f5b 100644
--- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c
+++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c
@@ -5,9 +5,21 @@
*/
#include "z_obj_kibako.h"
-#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_CAN_PRESS_SWITCHES)
void ObjKibako_Init(Actor* thisx, PlayState* play);
@@ -97,8 +109,8 @@ void ObjKibako_Init(Actor* thisx, PlayState* play) {
ObjKibako_InitCollider(&this->actor, play);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sCCInfoInit);
ObjKibako_SetupIdle(this);
- // "wooden box"
- PRINTF("(dungeon keep 木箱)(arg_data 0x%04x)\n", this->actor.params);
+ PRINTF(T("(dungeon keep 木箱)(arg_data 0x%04x)\n", "(dungeon keep wooden box)(arg_data 0x%04x)\n"),
+ this->actor.params);
}
void ObjKibako_Destroy(Actor* thisx, PlayState* play2) {
diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h
index 9378a51ce7..7538b53705 100644
--- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h
+++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h
@@ -2,11 +2,11 @@
#define Z_OBJ_KIBAKO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjKibako;
-typedef void (*ObjKibakoActionFunc)(struct ObjKibako*, PlayState*);
+typedef void (*ObjKibakoActionFunc)(struct ObjKibako*, struct PlayState*);
typedef struct ObjKibako {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c
index 035dbb9b09..9233f00c7a 100644
--- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c
+++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c
@@ -5,9 +5,20 @@
*/
#include "z_obj_kibako2.h"
-#include "assets/objects/object_kibako2/object_kibako2.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
+#include "assets/objects/object_kibako2/object_kibako2.h"
+
#define FLAGS 0
void ObjKibako2_Init(Actor* thisx, PlayState* play);
@@ -130,9 +141,8 @@ void ObjKibako2_Init(Actor* thisx, PlayState* play) {
this->actionFunc = ObjKibako2_Idle;
this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z =
this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0;
- // "Wooden box (stationary)"
- PRINTF("木箱(据置)(arg %04xH)(item %04xH %d)\n", this->dyna.actor.params, this->collectibleFlag,
- this->dyna.actor.home.rot.x);
+ PRINTF(T("木箱(据置)(arg %04xH)(item %04xH %d)\n", "Wooden box (stationary)(arg %04xH)(item %04xH %d)\n"),
+ this->dyna.actor.params, this->collectibleFlag, this->dyna.actor.home.rot.x);
}
void ObjKibako2_Destroy(Actor* thisx, PlayState* play) {
diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h
index 73f0e90b67..177ef0b04c 100644
--- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h
+++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h
@@ -2,11 +2,11 @@
#define Z_OBJ_KIBAKO2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjKibako2;
-typedef void (*ObjKibako2ActionFunc)(struct ObjKibako2*, PlayState*);
+typedef void (*ObjKibako2ActionFunc)(struct ObjKibako2*, struct PlayState*);
typedef struct ObjKibako2 {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c
index e13352a5a3..0a5866d1d1 100644
--- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c
+++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c
@@ -5,9 +5,20 @@
*/
#include "z_obj_lift.h"
-#include "assets/objects/object_d_lift/object_d_lift.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "ichain.h"
+#include "printf.h"
#include "quake.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
+#include "assets/objects/object_d_lift/object_d_lift.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -73,8 +84,9 @@ void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* colli
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_lift.c", 188,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_obj_lift.c", 188, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h
index 6ca27dddac..e3f217b930 100644
--- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h
+++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h
@@ -2,11 +2,11 @@
#define Z_OBJ_LIFT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjLift;
-typedef void (*ObjLiftActionFunc)(struct ObjLift*, PlayState*);
+typedef void (*ObjLiftActionFunc)(struct ObjLift*, struct PlayState*);
typedef struct ObjLift {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c
index adecf7e08b..05fe7a206f 100644
--- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c
+++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c
@@ -5,8 +5,23 @@
*/
#include "z_obj_lightswitch.h"
-#include "terminal.h"
#include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_lightswitch/object_lightswitch.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -47,7 +62,7 @@ ActorProfile Obj_Lightswitch_Profile = {
/**/ ObjLightswitch_Draw,
};
-static ColliderJntSphElementInit sColliderJntSphElementInit[] = {
+static ColliderJntSphElementInit sColliderJntSphElementsInit[] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -70,7 +85,7 @@ static ColliderJntSphInit sColliderJntSphInit = {
COLSHAPE_JNTSPH,
},
1,
- sColliderJntSphElementInit,
+ sColliderJntSphElementsInit,
};
static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE };
@@ -92,7 +107,7 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, PlayState* play) {
s32 pad;
Collider_InitJntSph(play, &this->collider);
- Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderItems);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements);
Matrix_SetTranslateRotateYXZ(this->actor.world.pos.x,
this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y),
this->actor.world.pos.z, &this->actor.shape.rot);
@@ -189,8 +204,9 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) {
this->actor.home.pos.y, this->actor.home.pos.z, 0, this->actor.home.rot.y, 0,
(0xFF << 8) | PUSHBLOCK_SMALL_START_ON) == NULL) {
PRINTF_COLOR_ERROR();
- // "Push-pull block occurrence failure"
- PRINTF("押引ブロック発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_obj_lightswitch.c", 452, this->actor.params);
+ PRINTF(T("押引ブロック発生失敗(%s %d)(arg_data 0x%04x)\n",
+ "Push/pull block failure(%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_lightswitch.c", 452, this->actor.params);
PRINTF_RST();
removeSelf = true;
}
@@ -200,8 +216,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) {
if (removeSelf) {
Actor_Kill(&this->actor);
}
- // "Light switch"
- PRINTF("(光スイッチ)(arg_data 0x%04x)\n", this->actor.params);
+ PRINTF(T("(光スイッチ)(arg_data 0x%04x)\n", "(Light switch)(arg_data 0x%04x)\n"), this->actor.params);
}
void ObjLightswitch_Destroy(Actor* thisx, PlayState* play2) {
diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h
index 78af71ed99..7f0834a240 100644
--- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h
+++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h
@@ -2,11 +2,11 @@
#define Z_OBJ_LIGHTSWITCH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjLightswitch;
-typedef void (*ObjLightswitchActionFunc)(struct ObjLightswitch*, PlayState*);
+typedef void (*ObjLightswitchActionFunc)(struct ObjLightswitch*, struct PlayState*);
typedef enum ObjLightswitch_Type {
/* 0 */ OBJLIGHTSWITCH_TYPE_STAY_ON, // doesn't turn off unless the switch flag is cleared some other way
@@ -19,7 +19,7 @@ typedef struct ObjLightswitch {
/* 0x0000 */ Actor actor;
/* 0x014C */ ObjLightswitchActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
- /* 0x0170 */ ColliderJntSphElement colliderItems[1];
+ /* 0x0170 */ ColliderJntSphElement colliderElements[1];
/* 0x01B0 */ s16 timer; // collision-related threshold and controls animation/logic when turning on/off
/* 0x01B2 */ s16 toggleDelay; // timer ticking down used for delaying tuning on/off or disappearing, can be bypassed
/* 0x01B4 */ s16 faceTextureIndex; // texture used by the center part of the sun
diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c
index 7ac997ae62..cc7651b6b4 100644
--- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c
+++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c
@@ -5,8 +5,12 @@
*/
#include "z_obj_makekinsuta.h"
-#include "global.h"
+
+#include "printf.h"
#include "terminal.h"
+#include "translation.h"
+#include "z64play.h"
+#include "z64player.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -33,13 +37,12 @@ void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) {
if (PARAMS_GET_NOSHIFT(this->actor.params, 13, 2) == 0x4000) {
PRINTF_COLOR_BLUE();
- // "Gold Star Enemy(arg_data %x)"
- PRINTF("金スタ発生敵(arg_data %x)\n", this->actor.params);
+ PRINTF(T("金スタ発生敵(arg_data %x)\n", "Gold Star Enemy(arg_data %x)\n"), this->actor.params);
PRINTF_RST();
} else {
PRINTF_COLOR_WARNING();
- // "Invalid Argument (arg_data %x)(%s %d)"
- PRINTF("引数不正 (arg_data %x)(%s %d)\n", this->actor.params, "../z_obj_makekinsuta.c", 119);
+ PRINTF(T("引数不正 (arg_data %x)(%s %d)\n", "Invalid Argument (arg_data %x)(%s %d)\n"), this->actor.params,
+ "../z_obj_makekinsuta.c", 119);
PRINTF_RST();
}
this->actionFunc = func_80B98320;
diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c
index 3ea20567ef..ee2e8801c5 100644
--- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c
+++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c
@@ -6,7 +6,15 @@
#include "z_obj_makeoshihiki.h"
#include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h"
+
+#include "printf.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
#define FLAGS ACTOR_FLAG_DRAW_CULLING_DISABLED
@@ -71,9 +79,9 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) {
if (Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_OBJ_OSHIHIKI, spawnPos->x, spawnPos->y, spawnPos->z, 0,
block->rotY, 0, ((block->color << 6) & 0xC0) | (block->type & 0xF) | 0xFF00) == NULL) {
- // "Push-pull block failure"
PRINTF_COLOR_ERROR();
- PRINTF("Error : 押し引きブロック発生失敗(%s %d)\n", "../z_obj_makeoshihiki.c", 194);
+ PRINTF(T("Error : 押し引きブロック発生失敗(%s %d)\n", "Error : Push/pull block failure (%s %d)\n"),
+ "../z_obj_makeoshihiki.c", 194);
PRINTF_RST();
Actor_Kill(thisx);
return;
diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h
index 16dc3ba470..84938f578a 100644
--- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h
+++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h
@@ -2,7 +2,7 @@
#define Z_OBJ_MAKEOSHIHIKI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjMakeoshihiki;
diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
index 90e1b5dda7..126e2c42ec 100644
--- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
+++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
@@ -7,6 +7,12 @@
#include "z_obj_mure.h"
#include "overlays/actors/ovl_En_Insect/z_en_insect.h"
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "printf.h"
+#include "translation.h"
+#include "z64play.h"
+
#define FLAGS 0
void ObjMure_Init(Actor* thisx, PlayState* play);
@@ -71,9 +77,9 @@ s32 ObjMure_SetCullingImpl(Actor* thisx, PlayState* play) {
result = true;
break;
default:
- // "Error : Culling is not set.(%s %d)(arg_data 0x%04x)"
- PRINTF("Error : カリングの設定がされていません。(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 204,
- this->actor.params);
+ PRINTF(T("Error : カリングの設定がされていません。(%s %d)(arg_data 0x%04x)\n",
+ "Error : Culling is not set. (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_mure.c", 204, this->actor.params);
return false;
}
return result;
@@ -95,11 +101,13 @@ void ObjMure_Init(Actor* thisx, PlayState* play) {
this->type = PARAMS_GET_U(thisx->params, 0, 5);
if (this->ptn >= 4) {
- PRINTF("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 237, thisx->params);
+ PRINTF(T("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "Error Swarm of enemies (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_mure.c", 237, thisx->params);
Actor_Kill(&this->actor);
return;
} else if (this->type >= 5) {
- PRINTF("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 245, thisx->params);
+ PRINTF(T("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "Error Swarm of enemies (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_mure.c", 245, thisx->params);
Actor_Kill(&this->actor);
return;
} else if (!ObjMure_SetCulling(thisx, play)) {
@@ -107,12 +115,15 @@ void ObjMure_Init(Actor* thisx, PlayState* play) {
return;
}
this->actionFunc = ObjMure_InitialAction;
- PRINTF("群れな敵 (arg_data 0x%04x)(chNum(%d) ptn(%d) svNum(%d) type(%d))\n", thisx->params, this->chNum, this->ptn,
- this->svNum, this->type);
+ PRINTF(T("群れな敵 (arg_data 0x%04x)(chNum(%d) ptn(%d) svNum(%d) type(%d))\n",
+ "Swarm of enemies (arg_data 0x%04x)(chNum(%d) ptn(%d) svNum(%d) type(%d))\n"),
+ thisx->params, this->chNum, this->ptn, this->svNum, this->type);
#if DEBUG_FEATURES
if (ObjMure_GetMaxChildSpawns(this) <= 0) {
- PRINTF("Warning : 個体数が設定されていません(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 268, thisx->params);
+ PRINTF(T("Warning : 個体数が設定されていません(%s %d)(arg_data 0x%04x)\n",
+ "Warning : The number of individuals is not set(%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_mure.c", 268, thisx->params);
}
#endif
}
@@ -130,7 +141,7 @@ s32 ObjMure_GetMaxChildSpawns(ObjMure* this) {
void ObjMure_GetSpawnPos(Vec3f* outPos, Vec3f* inPos, s32 ptn, s32 idx) {
#if DEBUG_FEATURES
if (ptn >= 4) {
- PRINTF("おかしなの (%s %d)\n", "../z_obj_mure.c", 307);
+ PRINTF(T("おかしなの (%s %d)\n", "That's strange (%s %d)\n"), "../z_obj_mure.c", 307);
}
#endif
@@ -147,8 +158,9 @@ void ObjMure_SpawnActors0(ObjMure* this, PlayState* play) {
for (i = 0; i < maxChildren; i++) {
#if DEBUG_FEATURES
if (this->children[i] != NULL) {
- // "Error: I already have a child(%s %d)(arg_data 0x%04x)"
- PRINTF("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 333, actor->params);
+ PRINTF(T("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n",
+ "Error : I already have a child (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_mure.c", 333, actor->params);
}
#endif
@@ -164,7 +176,8 @@ void ObjMure_SpawnActors0(ObjMure* this, PlayState* play) {
this->children[i]->flags |= ACTOR_FLAG_GRASS_DESTROYED;
this->children[i]->room = actor->room;
} else {
- PRINTF("warning 発生失敗 (%s %d)\n", "../z_obj_mure.c", 359);
+ PRINTF(T("warning 発生失敗 (%s %d)\n", "warning failed to occur (%s %d)\n"), "../z_obj_mure.c",
+ 359);
}
break;
default:
@@ -175,7 +188,8 @@ void ObjMure_SpawnActors0(ObjMure* this, PlayState* play) {
if (this->children[i] != NULL) {
this->children[i]->room = actor->room;
} else {
- PRINTF("warning 発生失敗 (%s %d)\n", "../z_obj_mure.c", 382);
+ PRINTF(T("warning 発生失敗 (%s %d)\n", "warning failed to occur (%s %d)\n"), "../z_obj_mure.c",
+ 382);
}
break;
}
@@ -192,7 +206,9 @@ void ObjMure_SpawnActors1(ObjMure* this, PlayState* play2) {
for (i = 0; i < maxChildren; i++) {
#if DEBUG_FEATURES
if (this->children[i] != NULL) {
- PRINTF("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 407, actor->params);
+ PRINTF(T("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n",
+ "Error : I already have a child (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_mure.c", 407, actor->params);
}
#endif
@@ -205,7 +221,7 @@ void ObjMure_SpawnActors1(ObjMure* this, PlayState* play2) {
this->children[i]->room = actor->room;
} else {
this->childrenStates[i] = OBJMURE_CHILD_STATE_1;
- PRINTF("warning 発生失敗 (%s %d)\n", "../z_obj_mure.c", 438);
+ PRINTF(T("warning 発生失敗 (%s %d)\n", "warning failed to occur (%s %d)\n"), "../z_obj_mure.c", 438);
}
}
}
diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h
index 386c6ed0d8..20cf667daa 100644
--- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h
+++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h
@@ -2,11 +2,11 @@
#define Z_OBJ_MURE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjMure;
-typedef void (*ObjMureActionFunc)(struct ObjMure*, PlayState*);
+typedef void (*ObjMureActionFunc)(struct ObjMure*, struct PlayState*);
#define OBJMURE_MAX_SPAWNS 15
diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c
index bcdb0558e7..eca8b0d933 100644
--- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c
+++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c
@@ -6,6 +6,13 @@
#include "z_obj_mure2.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sys_math3d.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#define FLAGS 0
typedef void (*ObjMure2SetPosFunc)(Vec3f* vec, ObjMure2* this);
@@ -111,8 +118,9 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) {
for (i = 0; i < D_80B9A818[actorNum]; i++) {
if (this->actorSpawnPtrList[i] != NULL) {
- // "Warning : I already have a child (%s %d)(arg_data 0x%04x)"
- PRINTF("Warning : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure2.c", 269, this->actor.params);
+ PRINTF(T("Warning : 既に子供がいる(%s %d)(arg_data 0x%04x)\n",
+ "Warning : I already have a child (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_mure2.c", 269, this->actor.params);
continue;
}
diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h
index a197e9f7b0..8643d477e1 100644
--- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h
+++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h
@@ -2,11 +2,11 @@
#define Z_OBJ_MURE2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjMure2;
-typedef void (*ObjMure2ActionFunc)(struct ObjMure2*, PlayState*);
+typedef void (*ObjMure2ActionFunc)(struct ObjMure2*, struct PlayState*);
typedef struct ObjMure2 {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c
index c9ed01e3c9..51035c0678 100644
--- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c
+++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c
@@ -6,6 +6,12 @@
#include "z_obj_mure3.h"
+#include "ichain.h"
+#include "sys_math3d.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#define FLAGS 0
void ObjMure3_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h
index 415babc61b..fc9a3e83aa 100644
--- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h
+++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h
@@ -2,17 +2,17 @@
#define Z_OBJ_MURE3_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjMure3;
-typedef void (*ObjMure3ActionFunc)(struct ObjMure3*, PlayState*);
-typedef void (*ObjMure3SpawnFunc)(struct ObjMure3*, PlayState*);
+typedef void (*ObjMure3ActionFunc)(struct ObjMure3*, struct PlayState*);
+typedef void (*ObjMure3SpawnFunc)(struct ObjMure3*, struct PlayState*);
typedef struct ObjMure3 {
/* 0x0000 */ Actor actor;
/* 0x014C */ ObjMure3ActionFunc actionFunc;
- /* 0x0150 */ EnItem00* unk_150[7];
+ /* 0x0150 */ struct EnItem00* unk_150[7];
/* 0x016C */ u16 unk_16C;
} ObjMure3; // size = 0x0170
diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c
index 2d4457d3e8..efa0fe3f46 100644
--- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c
+++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c
@@ -6,6 +6,21 @@
#include "z_obj_oshihiki.h"
#include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -96,9 +111,9 @@ void ObjOshihiki_InitDynapoly(ObjOshihiki* this, PlayState* play, CollisionHeade
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG registration failure"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_oshihiki.c", 280,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_obj_oshihiki.c", 280, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
@@ -215,9 +230,9 @@ void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) {
ObjOshihiki_InitDynapoly(this, play, &gPushBlockCol, 1);
break;
default:
- // "Error : type cannot be determined"
- PRINTF("Error : タイプが判別できない(%s %d)(arg_data 0x%04x)\n", "../z_obj_oshihiki.c", 444,
- this->dyna.actor.params);
+ PRINTF(T("Error : タイプが判別できない(%s %d)(arg_data 0x%04x)\n",
+ "Error : type cannot be determined (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_oshihiki.c", 444, this->dyna.actor.params);
break;
}
}
@@ -259,8 +274,9 @@ void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play2) {
}
if (i >= ARRAY_COUNT(sColors)) {
- // "Error : scene_data_ID cannot be determined"
- PRINTF("Error : scene_data_ID が判別できない。(%s %d)\n", "../z_obj_oshihiki.c", 579);
+ PRINTF(T("Error : scene_data_ID が判別できない。(%s %d)\n",
+ "Error : scene_data_ID cannot be determined. (%s %d)\n"),
+ "../z_obj_oshihiki.c", 579);
color->r = color->g = color->b = 255;
} else {
src = &sColors[i][paramsColorIdx];
@@ -305,8 +321,8 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) {
ObjOshihiki_SetColor(this, play);
ObjOshihiki_ResetFloors(this);
ObjOshihiki_SetupOnActor(this, play);
- // "(dungeon keep push-pull block)"
- PRINTF("(dungeon keep 押し引きブロック)(arg_data 0x%04x)\n", this->dyna.actor.params);
+ PRINTF(T("(dungeon keep 押し引きブロック)(arg_data 0x%04x)\n", "(dungeon keep push/pull block)(arg_data 0x%04x)\n"),
+ this->dyna.actor.params);
}
void ObjOshihiki_Destroy(Actor* thisx, PlayState* play) {
@@ -372,9 +388,9 @@ s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, PlayState* play) {
s32 ObjOshihiki_CheckGround(ObjOshihiki* this, PlayState* play) {
if (this->dyna.actor.world.pos.y <= BGCHECK_Y_MIN + 10.0f) {
- // "Warning : Push-pull block fell too much"
- PRINTF("Warning : 押し引きブロック落ちすぎた(%s %d)(arg_data 0x%04x)\n", "../z_obj_oshihiki.c", 809,
- this->dyna.actor.params);
+ PRINTF(T("Warning : 押し引きブロック落ちすぎた(%s %d)(arg_data 0x%04x)\n",
+ "Warning : Push/pull block fell too much (%s %d)(arg_data 0x%04x)\n"),
+ "../z_obj_oshihiki.c", 809, this->dyna.actor.params);
Actor_Kill(&this->dyna.actor);
return 0;
}
diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h
index 90dce5ca45..265ba4691c 100644
--- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h
+++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h
@@ -2,7 +2,7 @@
#define Z_OBJ_OSHIHIKI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjOshihiki;
@@ -27,7 +27,7 @@ typedef enum PushBlockType {
#define PUSHBLOCK_SETUP_FALL (1 << 7)
#define PUSHBLOCK_MOVE_UNDER (1 << 8)
-typedef void (*ObjOshihikiActionFunc)(struct ObjOshihiki*, PlayState*);
+typedef void (*ObjOshihikiActionFunc)(struct ObjOshihiki*, struct PlayState*);
typedef struct ObjOshihiki {
/* 0x0000 */ DynaPolyActor dyna;
@@ -40,7 +40,7 @@ typedef struct ObjOshihiki {
/* 0x0178 */ f32 pushDist;
/* 0x017C */ f32 direction;
/* 0x0180 */ s32 floorBgIds[5];
- /* 0x0194 */ CollisionPoly* floorPolys[5];
+ /* 0x0194 */ struct CollisionPoly* floorPolys[5];
/* 0x01A8 */ f32 floorHeights[5];
/* 0x01BC */ s16 highestFloor;
/* 0x01BE */ u8 cantMove;
diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c
index 8ed5e8558e..6eca379686 100644
--- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c
+++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c
@@ -6,6 +6,11 @@
#include "z_obj_roomtimer.h"
+#include "sfx.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64save.h"
+
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void ObjRoomtimer_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h
index 2f1b08d9c9..ee8e74eaa2 100644
--- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h
+++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h
@@ -2,12 +2,11 @@
#define Z_OBJ_ROOMTIMER_H
#include "ultra64.h"
-#include "global.h"
-#include "z64.h"
+#include "z64actor.h"
struct ObjRoomtimer;
-typedef void (*ObjRoomtimerActionFunc)(struct ObjRoomtimer*, PlayState*);
+typedef void (*ObjRoomtimerActionFunc)(struct ObjRoomtimer*, struct PlayState*);
typedef struct ObjRoomtimer {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
index e791de6297..2ad4bbf09a 100644
--- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
+++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
@@ -5,8 +5,24 @@
*/
#include "z_obj_switch.h"
-#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
+
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "rumble.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@@ -147,7 +163,7 @@ static ColliderTrisInit sEyeTrisInit = {
sEyeTrisElementsInit,
};
-static ColliderJntSphElementInit sCrystalJntSphElementInit[1] = {
+static ColliderJntSphElementInit sCrystalJntSphElementsInit[1] = {
{
{
ELEM_MATERIAL_UNK0,
@@ -170,8 +186,8 @@ static ColliderJntSphInit sCrystalJntSphInit = {
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
- ARRAY_COUNT(sCrystalJntSphElementInit),
- sCrystalJntSphElementInit,
+ ARRAY_COUNT(sCrystalJntSphElementsInit),
+ sCrystalJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
@@ -202,18 +218,18 @@ void ObjSwitch_InitDynaPoly(ObjSwitch* this, PlayState* play, CollisionHeader* c
if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2;
- // "Warning : move BG registration failure"
- PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_switch.c", 531,
- this->dyna.actor.id, this->dyna.actor.params);
+ PRINTF(T("Warning : move BG 登録失敗",
+ "Warning : move BG registration failed") "(%s %d)(name %d)(arg_data 0x%04x)\n",
+ "../z_obj_switch.c", 531, this->dyna.actor.id, this->dyna.actor.params);
}
#endif
}
void ObjSwitch_InitJntSphCollider(ObjSwitch* this, PlayState* play, ColliderJntSphInit* colliderJntSphInit) {
- ColliderJntSph* colliderJntSph = &this->jntSph.col;
+ ColliderJntSph* colliderJntSph = &this->jntSph.collider;
Collider_InitJntSph(play, colliderJntSph);
- Collider_SetJntSph(play, colliderJntSph, &this->dyna.actor, colliderJntSphInit, this->jntSph.items);
+ Collider_SetJntSph(play, colliderJntSph, &this->dyna.actor, colliderJntSphInit, this->jntSph.colliderElements);
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y +
this->dyna.actor.shape.yOffset * this->dyna.actor.scale.y,
@@ -223,13 +239,13 @@ void ObjSwitch_InitJntSphCollider(ObjSwitch* this, PlayState* play, ColliderJntS
}
void ObjSwitch_InitTrisCollider(ObjSwitch* this, PlayState* play, ColliderTrisInit* colliderTrisInit) {
- ColliderTris* colliderTris = &this->tris.col;
+ ColliderTris* colliderTris = &this->tris.collider;
s32 i;
s32 j;
Vec3f pos[3];
Collider_InitTris(play, colliderTris);
- Collider_SetTris(play, colliderTris, &this->dyna.actor, colliderTrisInit, this->tris.items);
+ Collider_SetTris(play, colliderTris, &this->dyna.actor, colliderTrisInit, this->tris.colliderElements);
for (i = 0; i < 2; i++) {
for (j = 0; j < 3; j++) {
@@ -323,7 +339,7 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) {
if (OBJSWITCH_FROZEN(&this->dyna.actor) && (ObjSwitch_SpawnIce(this, play) == NULL)) {
PRINTF_COLOR_RED();
- PRINTF("Error : 氷発生失敗 (%s %d)\n", "../z_obj_switch.c", 732);
+ PRINTF(T("Error : 氷発生失敗 (%s %d)\n", "Error : Ice generation failure (%s %d)\n"), "../z_obj_switch.c", 732);
PRINTF_RST();
this->dyna.actor.params &= ~OBJSWITCH_FROZEN_FLAG;
}
@@ -368,12 +384,12 @@ void ObjSwitch_Destroy(Actor* thisx, PlayState* play) {
switch (OBJSWITCH_TYPE(&this->dyna.actor)) {
case OBJSWITCH_TYPE_FLOOR_RUSTY:
case OBJSWITCH_TYPE_EYE:
- Collider_DestroyTris(play, &this->tris.col);
+ Collider_DestroyTris(play, &this->tris.collider);
break;
case OBJSWITCH_TYPE_CRYSTAL:
case OBJSWITCH_TYPE_CRYSTAL_TARGETABLE:
- Collider_DestroyJntSph(play, &this->jntSph.col);
+ Collider_DestroyJntSph(play, &this->jntSph.collider);
break;
}
}
@@ -385,12 +401,12 @@ void ObjSwitch_FloorUpInit(ObjSwitch* this) {
void ObjSwitch_FloorUp(ObjSwitch* this, PlayState* play) {
if (OBJSWITCH_TYPE(&this->dyna.actor) == OBJSWITCH_TYPE_FLOOR_RUSTY) {
- if (this->tris.col.base.acFlags & AC_HIT) {
+ if (this->tris.collider.base.acFlags & AC_HIT) {
ObjSwitch_FloorPressInit(this);
ObjSwitch_SetOn(this, play);
- this->tris.col.base.acFlags &= ~AC_HIT;
+ this->tris.collider.base.acFlags &= ~AC_HIT;
} else {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->tris.col.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->tris.collider.base);
}
} else {
switch (OBJSWITCH_SUBTYPE(&this->dyna.actor)) {
@@ -509,8 +525,8 @@ s32 ObjSwitch_EyeIsHit(ObjSwitch* this) {
Actor* collidingActor;
s16 yawDiff;
- if ((this->tris.col.base.acFlags & AC_HIT) && !(this->prevColFlags & AC_HIT)) {
- collidingActor = this->tris.col.base.ac;
+ if ((this->tris.collider.base.acFlags & AC_HIT) && !(this->prevColFlags & AC_HIT)) {
+ collidingActor = this->tris.collider.base.ac;
if (collidingActor != NULL) {
yawDiff = collidingActor->world.rot.y - this->dyna.actor.shape.rot.y;
if (ABS(yawDiff) > 0x5000) {
@@ -613,7 +629,7 @@ void ObjSwitch_CrystalOffInit(ObjSwitch* this) {
void ObjSwitch_CrystalOff(ObjSwitch* this, PlayState* play) {
switch (OBJSWITCH_SUBTYPE(&this->dyna.actor)) {
case OBJSWITCH_SUBTYPE_ONCE:
- if ((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) {
+ if ((this->jntSph.collider.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) {
this->disableAcTimer = 10;
ObjSwitch_SetOn(this, play);
ObjSwitch_CrystalTurnOnInit(this);
@@ -621,7 +637,7 @@ void ObjSwitch_CrystalOff(ObjSwitch* this, PlayState* play) {
break;
case OBJSWITCH_SUBTYPE_SYNC:
- if (((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) ||
+ if (((this->jntSph.collider.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) ||
Flags_GetSwitch(play, OBJSWITCH_SWITCH_FLAG(&this->dyna.actor))) {
this->disableAcTimer = 10;
@@ -631,7 +647,7 @@ void ObjSwitch_CrystalOff(ObjSwitch* this, PlayState* play) {
break;
case OBJSWITCH_SUBTYPE_TOGGLE:
- if ((this->jntSph.col.base.acFlags & AC_HIT) && !(this->prevColFlags & AC_HIT) &&
+ if ((this->jntSph.collider.base.acFlags & AC_HIT) && !(this->prevColFlags & AC_HIT) &&
this->disableAcTimer <= 0) {
this->disableAcTimer = 10;
ObjSwitch_SetOn(this, play);
@@ -675,7 +691,7 @@ void ObjSwitch_CrystalOn(ObjSwitch* this, PlayState* play) {
break;
case OBJSWITCH_SUBTYPE_TOGGLE:
- if ((this->jntSph.col.base.acFlags & AC_HIT) && !(this->prevColFlags & AC_HIT) &&
+ if ((this->jntSph.collider.base.acFlags & AC_HIT) && !(this->prevColFlags & AC_HIT) &&
this->disableAcTimer <= 0) {
this->disableAcTimer = 10;
ObjSwitch_CrystalTurnOffInit(this);
@@ -719,9 +735,9 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) {
break;
case OBJSWITCH_TYPE_EYE:
- this->prevColFlags = this->tris.col.base.acFlags;
- this->tris.col.base.acFlags &= ~AC_HIT;
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->tris.col.base);
+ this->prevColFlags = this->tris.collider.base.acFlags;
+ this->tris.collider.base.acFlags &= ~AC_HIT;
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->tris.collider.base);
break;
case OBJSWITCH_TYPE_CRYSTAL:
@@ -729,12 +745,12 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) {
if (!Player_InCsMode(play) && this->disableAcTimer > 0) {
this->disableAcTimer--;
}
- this->prevColFlags = this->jntSph.col.base.acFlags;
- this->jntSph.col.base.acFlags &= ~AC_HIT;
+ this->prevColFlags = this->jntSph.collider.base.acFlags;
+ this->jntSph.collider.base.acFlags &= ~AC_HIT;
if (this->disableAcTimer <= 0) {
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->jntSph.col.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->jntSph.collider.base);
}
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->jntSph.col.base);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->jntSph.collider.base);
break;
}
}
diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h
index b6fb243f70..b4d3ae8b20 100644
--- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h
+++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h
@@ -2,12 +2,12 @@
#define Z_OBJ_SWITCH_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjSwitch;
-typedef void (*ObjSwitchActionFunc)(struct ObjSwitch*, PlayState*);
-typedef void (*ObjSwitchDrawFunc)(Actor*, PlayState*);
+typedef void (*ObjSwitchActionFunc)(struct ObjSwitch*, struct PlayState*);
+typedef void (*ObjSwitchDrawFunc)(Actor*, struct PlayState*);
typedef enum ObjSwitchType {
/* 0 */ OBJSWITCH_TYPE_FLOOR,
@@ -26,13 +26,13 @@ typedef enum ObjSwitchSubType {
} ObjSwitchSubType;
typedef struct ObjSwitchJntSph {
- /* 0x00 */ ColliderJntSph col;
- /* 0x20 */ ColliderJntSphElement items[1];
+ /* 0x00 */ ColliderJntSph collider;
+ /* 0x20 */ ColliderJntSphElement colliderElements[1];
} ObjSwitchJntSph;
typedef struct ObjSwitchTris {
- /* 0x00 */ ColliderTris col;
- /* 0x20 */ ColliderTrisElement items[2];
+ /* 0x00 */ ColliderTris collider;
+ /* 0x20 */ ColliderTrisElement colliderElements[2];
} ObjSwitchTris;
typedef struct ObjSwitch {
diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c
index 7c221da0b8..a189fe4345 100644
--- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c
+++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c
@@ -6,6 +6,17 @@
#include "z_obj_syokudai.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_syokudai/object_syokudai.h"
@@ -86,12 +97,12 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
- Collider_InitCylinder(play, &this->colliderStand);
- Collider_SetCylinder(play, &this->colliderStand, &this->actor, &sCylInitStand);
- this->colliderStand.base.colMaterial = sColMaterialsStand[PARAMS_GET_NOMASK(this->actor.params, 12)];
+ Collider_InitCylinder(play, &this->standCollider);
+ Collider_SetCylinder(play, &this->standCollider, &this->actor, &sCylInitStand);
+ this->standCollider.base.colMaterial = sColMaterialsStand[PARAMS_GET_NOMASK(this->actor.params, 12)];
- Collider_InitCylinder(play, &this->colliderFlame);
- Collider_SetCylinder(play, &this->colliderFlame, &this->actor, &sCylInitFlame);
+ Collider_InitCylinder(play, &this->flameCollider);
+ Collider_SetCylinder(play, &this->flameCollider, &this->actor, &sCylInitFlame);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
@@ -113,8 +124,8 @@ void ObjSyokudai_Destroy(Actor* thisx, PlayState* play) {
s32 pad;
ObjSyokudai* this = (ObjSyokudai*)thisx;
- Collider_DestroyCylinder(play, &this->colliderStand);
- Collider_DestroyCylinder(play, &this->colliderFlame);
+ Collider_DestroyCylinder(play, &this->standCollider);
+ Collider_DestroyCylinder(play, &this->flameCollider);
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
}
@@ -171,8 +182,8 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
this->litTimer = 20;
}
}
- if (this->colliderFlame.base.acFlags & AC_HIT) {
- dmgFlags = this->colliderFlame.elem.acHitElem->atDmgInfo.dmgFlags;
+ if (this->flameCollider.base.acFlags & AC_HIT) {
+ dmgFlags = this->flameCollider.elem.acHitElem->atDmgInfo.dmgFlags;
if (dmgFlags & (DMG_FIRE | DMG_ARROW_NORMAL)) {
interactionType = 1;
}
@@ -195,7 +206,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
player->unk_860 = 200;
}
} else if (dmgFlags & DMG_ARROW_NORMAL) {
- arrow = (EnArrow*)this->colliderFlame.base.ac;
+ arrow = (EnArrow*)this->flameCollider.base.ac;
if ((arrow->actor.update != NULL) && (arrow->actor.id == ACTOR_EN_ARROW)) {
arrow->actor.params = 0;
arrow->collider.elem.atDmgInfo.dmgFlags = DMG_ARROW_FIRE;
@@ -232,12 +243,12 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
}
}
- Collider_UpdateCylinder(&this->actor, &this->colliderStand);
- CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderStand.base);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderStand.base);
+ Collider_UpdateCylinder(&this->actor, &this->standCollider);
+ CollisionCheck_SetOC(play, &play->colChkCtx, &this->standCollider.base);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->standCollider.base);
- Collider_UpdateCylinder(&this->actor, &this->colliderFlame);
- CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderFlame.base);
+ Collider_UpdateCylinder(&this->actor, &this->flameCollider);
+ CollisionCheck_SetAC(play, &play->colChkCtx, &this->flameCollider.base);
if (this->litTimer > 0) {
this->litTimer--;
diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h
index 8c4e1b7d16..4dee2ba671 100644
--- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h
+++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h
@@ -2,14 +2,15 @@
#define Z_OBJ_SYOKUDAI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct ObjSyokudai;
typedef struct ObjSyokudai {
/* 0x0000 */ Actor actor;
- /* 0x014C */ ColliderCylinder colliderStand;
- /* 0x0198 */ ColliderCylinder colliderFlame;
+ /* 0x014C */ ColliderCylinder standCollider;
+ /* 0x0198 */ ColliderCylinder flameCollider;
/* 0x01E4 */ s16 litTimer;
/* 0x01E6 */ u8 flameTexScroll;
/* 0x01E8 */ LightNode* lightNode;
diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c
index bc231076ce..b3dc890ca8 100644
--- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c
+++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c
@@ -5,6 +5,21 @@
*/
#include "z_obj_timeblock.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_timeblock/object_timeblock.h"
#define FLAGS \
@@ -135,10 +150,10 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) {
ObjTimeblock_SetupAltBehaviourNotVisible(this);
}
- // "Block of time"
- PRINTF("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params,
- this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET_U(this->dyna.actor.params, 11, 3),
- PARAMS_GET_U(this->dyna.actor.params, 10, 1));
+ PRINTF(T("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n",
+ "Time Block ( %04xH save:%d color:%d range:%d move:%d)\n"),
+ (u16)this->dyna.actor.params, this->unk_177, this->dyna.actor.home.rot.z & 7,
+ PARAMS_GET_U(this->dyna.actor.params, 11, 3), PARAMS_GET_U(this->dyna.actor.params, 10, 1));
}
void ObjTimeblock_Destroy(Actor* thisx, PlayState* play) {
@@ -219,8 +234,9 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) {
// Possibly points the camera to this actor
OnePointCutscene_Attention(play, &this->dyna.actor);
- // "◯◯◯◯ Time Block Attention Camera (frame counter %d)\n"
- PRINTF("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n", play->state.frames);
+ PRINTF(T("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n",
+ "◯◯◯◯ Time Block Attention Camera (frame counter %d)\n"),
+ play->state.frames);
this->demoEffectFirstPartTimer = 12;
@@ -277,8 +293,9 @@ void ObjTimeblock_AltBehaviorVisible(ObjTimeblock* this, PlayState* play) {
ObjTimeblock_SpawnDemoEffect(this, play);
this->demoEffectTimer = 160;
OnePointCutscene_Attention(play, &this->dyna.actor);
- // "Time Block Attention Camera (frame counter)"
- PRINTF("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n", play->state.frames);
+ PRINTF(T("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n",
+ "◯◯◯◯ Time Block Attention Camera (frame counter %d)\n"),
+ play->state.frames);
ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6));
}
diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h
index 9bd393b194..966f474496 100644
--- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h
+++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h
@@ -2,12 +2,12 @@
#define Z_OBJ_TIMEBLOCK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjTimeblock;
-typedef s32 (*ObjTimeblockSongObserverFunc)(struct ObjTimeblock*, PlayState*);
-typedef void (*ObjTimeblockActionFunc)(struct ObjTimeblock*, PlayState*);
+typedef s32 (*ObjTimeblockSongObserverFunc)(struct ObjTimeblock*, struct PlayState*);
+typedef void (*ObjTimeblockActionFunc)(struct ObjTimeblock*, struct PlayState*);
typedef struct ObjTimeblock {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c
index a5911678e4..9afd53ae53 100644
--- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c
+++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c
@@ -6,6 +6,19 @@
#include "z_obj_tsubo.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
+
+#include "libc64/qrand.h"
+#include "ichain.h"
+#include "printf.h"
+#include "sfx.h"
+#include "translation.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64item.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "assets/objects/object_tsubo/object_tsubo.h"
@@ -112,7 +125,7 @@ s32 ObjTsubo_SnapToFloor(ObjTsubo* this, PlayState* play) {
Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos);
return true;
} else {
- PRINTF("地面に付着失敗\n");
+ PRINTF(T("地面に付着失敗\n", "Failed to attach to ground\n"));
return false;
}
}
@@ -137,11 +150,12 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) {
}
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)]);
if (this->requiredObjectSlot < 0) {
- PRINTF("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_obj_tsubo.c", 410);
+ PRINTF(T("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", "Error : Bank danger! (arg_data 0x%04x)(%s %d)\n"),
+ this->actor.params, "../z_obj_tsubo.c", 410);
Actor_Kill(&this->actor);
} else {
ObjTsubo_SetupWaitForObject(this);
- PRINTF("(dungeon keep 壷)(arg_data 0x%04x)\n", this->actor.params);
+ PRINTF(T("(dungeon keep 壷)(arg_data 0x%04x)\n", "(dungeon keep pot)(arg_data 0x%04x)\n"), this->actor.params);
}
}
diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h
index aa30398c78..8e27cc8310 100644
--- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h
+++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h
@@ -2,11 +2,11 @@
#define Z_OBJ_TSUBO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjTsubo;
-typedef void (*ObjTsuboActionFunc)(struct ObjTsubo*, PlayState*);
+typedef void (*ObjTsuboActionFunc)(struct ObjTsubo*, struct PlayState*);
typedef struct ObjTsubo {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c
index 94c6618470..55023cccc1 100644
--- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c
+++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c
@@ -5,8 +5,23 @@
*/
#include "z_obj_warp2block.h"
-#include "assets/objects/object_timeblock/object_timeblock.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "translation.h"
+#include "z_lib.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+
+#include "assets/objects/object_timeblock/object_timeblock.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA | \
@@ -220,7 +235,8 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) {
ObjWarp2block_SetInactive(this);
}
- PRINTF("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n",
+ PRINTF(T("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n",
+ "Time Block (Warp 2) ( %04xH color:%d range:%d)\n"),
PARAMS_GET_U(this->dyna.actor.params, 0, 16), this->dyna.actor.home.rot.z & 7,
PARAMS_GET_U(this->dyna.actor.params, 11, 3));
}
@@ -265,7 +281,9 @@ void func_80BA24F8(ObjWarp2block* this, PlayState* play) {
this->unk_174++;
if (this->unk_174 > 60) {
PRINTF_COLOR_ERROR();
- PRINTF("Error : 時のブロック(ワープ2)が対でセットされていません(%s %d)\n", "../z_obj_warp2block.c", 505);
+ PRINTF(T("Error : 時のブロック(ワープ2)が対でセットされていません(%s %d)\n",
+ "Error : Time Blocks (Warp 2) are not set in pairs (%s %d)\n"),
+ "../z_obj_warp2block.c", 505);
PRINTF_RST();
Actor_Kill(&this->dyna.actor);
}
diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h
index 3e09d976c2..8f22398db7 100644
--- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h
+++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h
@@ -2,12 +2,12 @@
#define Z_OBJ_WARP2BLOCK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjWarp2block;
-typedef void (*ObjWarp2blockActionFunc)(struct ObjWarp2block*, PlayState*);
-typedef s32 (*ObjWarp2blockFunc168)(struct ObjWarp2block*, PlayState*);
+typedef void (*ObjWarp2blockActionFunc)(struct ObjWarp2block*, struct PlayState*);
+typedef s32 (*ObjWarp2blockFunc168)(struct ObjWarp2block*, struct PlayState*);
typedef struct ObjWarp2block {
/* 0x0000 */ DynaPolyActor dyna;
diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c
index 25048f5349..c170279758 100644
--- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c
+++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c
@@ -5,6 +5,22 @@
*/
#include "z_object_kankyo.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_demo_kekkai/object_demo_kekkai.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_spot02_objects/object_spot02_objects.h"
diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h
index 4449fa013c..40307f5e91 100644
--- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h
+++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h
@@ -2,11 +2,11 @@
#define Z_OBJECT_KANKYO_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ObjectKankyo;
-typedef void (*ObjectKankyoActionFunc)(struct ObjectKankyo*, PlayState*);
+typedef void (*ObjectKankyoActionFunc)(struct ObjectKankyo*, struct PlayState*);
typedef struct ObjectKankyoEffect {
/* 0x00 */ u8 state;
diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c
index 5aeb61031a..8a24d5cf2c 100644
--- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c
+++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c
@@ -5,7 +5,20 @@
*/
#include "z_oceff_spot.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "printf.h"
+#include "regs.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64light.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h
index a96f1878af..222c977fc2 100644
--- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h
+++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h
@@ -2,11 +2,12 @@
#define Z_OCEFF_SPOT_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
+#include "z64light.h"
struct OceffSpot;
-typedef void (*OceffSpotActionFunc)(struct OceffSpot*, PlayState*);
+typedef void (*OceffSpotActionFunc)(struct OceffSpot*, struct PlayState*);
typedef struct OceffSpot {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c
index c7c63690b7..5e236c86f4 100644
--- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c
+++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c
@@ -6,6 +6,13 @@
#include "z_oceff_storm.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void OceffStorm_Init(Actor* thisx, PlayState* play);
diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h
index e4b831a208..aebc002780 100644
--- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h
+++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h
@@ -2,11 +2,11 @@
#define Z_OCEFF_STORM_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct OceffStorm;
-typedef void (*OceffStormActionFunc)(struct OceffStorm*, PlayState*);
+typedef void (*OceffStormActionFunc)(struct OceffStorm*, struct PlayState*);
typedef struct OceffStorm {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c
index f9b14bc7de..36177c0729 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c
@@ -5,7 +5,16 @@
*/
#include "z_oceff_wipe.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h
index 9e5131737c..65a18468a3 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h
+++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h
@@ -2,7 +2,7 @@
#define Z_OCEFF_WIPE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum OceffWipeType {
/* 0x00 */ OCEFF_WIPE_ZL,
diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c
index 9e3b03a8f9..db8171b362 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c
@@ -5,7 +5,16 @@
*/
#include "z_oceff_wipe2.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h
index c7f9c7b870..6276bb33c4 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h
+++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h
@@ -2,7 +2,7 @@
#define Z_OCEFF_WIPE2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct OceffWipe2;
diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
index 757e9b116d..7aec9136f2 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
@@ -5,7 +5,16 @@
*/
#include "z_oceff_wipe3.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h
index a5bc2bbe4c..5e6abb0456 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h
+++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h
@@ -2,7 +2,7 @@
#define Z_OCEFF_WIPE3_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct OceffWipe3;
diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c
index 9ad0dbf68e..0828ba289f 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c
@@ -5,7 +5,14 @@
*/
#include "z_oceff_wipe4.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "sys_matrix.h"
#include "terminal.h"
+#include "z_lib.h"
+#include "z64play.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h
index 3986c1fce5..bd82ddc7c4 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h
+++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h
@@ -2,7 +2,7 @@
#define Z_OCEFF_WIPE4_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
typedef enum OceffWipe4Type {
/* 0x00 */ OCEFF_WIPE4_SCARECROWS,
diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c
index a91fb67154..7a38b72139 100644
--- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c
+++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c
@@ -7,8 +7,22 @@
#include "z_shot_sun.h"
#include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
-#include "assets/scenes/overworld/spot06/spot06_scene.h"
+
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "sys_math3d.h"
#include "terminal.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "z64environment.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
+#include "assets/scenes/overworld/spot06/spot06_scene.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h
index 9687e5940e..4415e6e98f 100644
--- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h
+++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h
@@ -2,11 +2,11 @@
#define Z_SHOT_SUN_H
#include "ultra64.h"
-#include "global.h"
+#include "z64actor.h"
struct ShotSun;
-typedef void (*ShotSunActionFunc)(struct ShotSun*, PlayState*);
+typedef void (*ShotSunActionFunc)(struct ShotSun*, struct PlayState*);
typedef struct ShotSun {
/* 0x0000 */ Actor actor;
diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c
index 8ec56b193c..e8b9428026 100644
--- a/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/src/overlays/actors/ovl_player_actor/z_player.c
@@ -4,11 +4,6 @@
* Description: Link
*/
-#include "ultra64.h"
-#include "global.h"
-#include "quake.h"
-#include "versions.h"
-
#include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h"
#include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h"
#include "overlays/actors/ovl_En_Boom/z_en_boom.h"
@@ -20,6 +15,42 @@
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
#include "overlays/actors/ovl_En_Insect/z_en_insect.h"
#include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h"
+
+#include "libc64/qrand.h"
+#include "libu64/debug.h"
+#include "array_count.h"
+#include "avoid_ub.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "ichain.h"
+#include "letterbox.h"
+#include "map.h"
+#include "one_point_cutscene.h"
+#include "printf.h"
+#include "quake.h"
+#include "rand.h"
+#include "regs.h"
+#include "rumble.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_math.h"
+#include "sys_math3d.h"
+#include "sys_matrix.h"
+#include "ultra64.h"
+#include "versions.h"
+#include "z_en_item00.h"
+#include "z_lib.h"
+#include "zelda_arena.h"
+#include "z64audio.h"
+#include "z64debug.h"
+#include "z64effect.h"
+#include "z64lifemeter.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_link_child/object_link_child.h"
@@ -331,15 +362,15 @@ void Player_Action_CsAction(Player* this, PlayState* play);
// .bss part 1
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ique-cn:128 ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
static s32 D_80858AA0;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ique-cn:128 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
+ "ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
static s32 sSavedCurrentMask;
static Vec3f sInteractWallCheckResult;
@@ -1708,7 +1739,7 @@ BAD_RETURN(s32) func_80832224(Player* this) {
s32 Player_IsTalking(PlayState* play) {
Player* this = GET_PLAYER(play);
- return CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK);
+ return ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_TALK);
}
void Player_AnimPlayOnce(PlayState* play, Player* this, LinkAnimationHeader* anim) {
@@ -2527,7 +2558,7 @@ s32 Player_FriendlyLockOnOrParallel(Player* this) {
*/
s32 Player_UpdateHostileLockOn(Player* this) {
if ((this->focusActor != NULL) &&
- CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) {
+ ACTOR_FLAGS_CHECK_ALL(this->focusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) {
this->stateFlags1 |= PLAYER_STATE1_HOSTILE_LOCK_ON;
return true;
@@ -3972,7 +4003,7 @@ void Player_UpdateZTargeting(Player* this, PlayState* play) {
// is hostile. This is a special case to allow Player to have more freedom of movement and be able
// to throw a carried actor at the lock-on actor, even if it is hostile.
if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) ||
- !CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) {
+ !ACTOR_FLAGS_CHECK_ALL(this->focusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) {
this->stateFlags1 |= PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS;
}
} else {
@@ -6146,7 +6177,7 @@ s32 Player_ActionHandler_Talk(Player* this, PlayState* play) {
canTalkToLockOnWithCUp =
(lockOnActor != NULL) &&
- (CHECK_FLAG_ALL(lockOnActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) ||
+ (ACTOR_FLAGS_CHECK_ALL(lockOnActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) ||
(lockOnActor->naviEnemyId != NAVI_ENEMY_NONE));
if (canTalkToLockOnWithCUp || (this->naviTextId != 0)) {
@@ -6261,7 +6292,7 @@ s32 Player_ActionHandler_0(Player* this, PlayState* play) {
}
if ((this->focusActor != NULL) &&
- (CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) ||
+ (ACTOR_FLAGS_CHECK_ALL(this->focusActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) ||
(this->focusActor->naviEnemyId != NAVI_ENEMY_NONE))) {
this->stateFlags2 |= PLAYER_STATE2_21;
} else if ((this->naviTextId == 0) && !Player_CheckHostileLockOn(this) &&
@@ -11347,7 +11378,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) {
} else if (this->stateFlags2 & PLAYER_STATE2_8) {
camMode = CAM_MODE_PUSH_PULL;
} else if ((focusActor = this->focusActor) != NULL) {
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_TALK)) {
camMode = CAM_MODE_TALK;
} else if (this->stateFlags1 & PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS) {
if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) {
@@ -11969,7 +12000,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
Player_UpdateShapeYaw(this, play);
- if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_TALK)) {
+ if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_TALK)) {
this->talkActorDistance = 0.0f;
} else {
this->talkActor = NULL;
@@ -12533,7 +12564,7 @@ void Player_Action_Talk(Player* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
this->actor.flags &= ~ACTOR_FLAG_TALK;
- if (!CHECK_FLAG_ALL(this->talkActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) {
+ if (!ACTOR_FLAGS_CHECK_ALL(this->talkActor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)) {
this->stateFlags2 &= ~PLAYER_STATE2_LOCK_ON_WITH_SWITCH;
}
@@ -16124,7 +16155,7 @@ void Player_StartTalking(PlayState* play, Actor* actor) {
s32 pad;
if ((this->talkActor != NULL) || (actor == this->naviActor) ||
- CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP)) {
+ ACTOR_FLAGS_CHECK_ALL(actor, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP)) {
actor->flags |= ACTOR_FLAG_TALK;
}
diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c
index f107473306..9ff1bd5a96 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c
@@ -5,6 +5,15 @@
*/
#include "z_eff_ss_blast.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rInnerColorR regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h
index b38f343e8e..bfceec5856 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_BLAST_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsBlastParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c
index 4fd99e3626..2ab88a16b1 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c
@@ -5,6 +5,18 @@
*/
#include "z_eff_ss_bomb.h"
+
+#include "libc64/qrand.h"
+#include "array_count.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define EFFSSBOMB_LIFESPAN 20
@@ -67,7 +79,7 @@ void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this) {
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h
index 5d42b118c8..923739819b 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_BOMB_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsBombInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c
index e848dd47b8..4ec61bc8ea 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c
@@ -5,6 +5,16 @@
*/
#include "z_eff_ss_bomb2.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rScale regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h
index 249a2a6507..8aea4d3cc5 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_BOMB2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsBomb2InitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c
index be7d160712..f23d0a9aab 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c
@@ -5,6 +5,16 @@
*/
#include "z_eff_ss_bubble.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rScale regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h
index 3c3c8f80df..7701365bdc 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_BUBBLE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsBubbleInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c
index 5b178002d1..c32349e1fa 100644
--- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c
+++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c
@@ -5,6 +5,14 @@
*/
#include "z_eff_ss_d_fire.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/object_dodongo/object_dodongo.h"
#define rScale regs[0]
@@ -79,7 +87,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
OPEN_DISPS(gfxCtx, "../z_eff_ss_d_fire.c", 276);
if (Object_GetSlot(&play->objectCtx, OBJECT_DODONGO) >= 0) {
- gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
+ gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
scale = this->rScale / 100.0f;
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
@@ -95,7 +103,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,
this->rPrimColorA);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
+ gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIndex]));
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
}
diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h
index c59c9add92..fbaa8aa28c 100644
--- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h
+++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_D_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsDFireInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c
index 56b7b4db36..e8b904a4b6 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c
@@ -5,6 +5,15 @@
*/
#include "z_eff_ss_dead_db.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sfx.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rScale regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h
index 0ea6bd0fda..fb7fc84af1 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_DEAD_DB_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsDeadDbInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c
index ac0df1b437..9343e7a549 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c
@@ -5,6 +5,15 @@
*/
#include "z_eff_ss_dead_dd.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rScale regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h
index 80d46899e7..c9c91ec609 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_DEAD_DD_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsDeadDdInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c
index 9d9c695d88..4d649d4be4 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c
@@ -5,6 +5,13 @@
*/
#include "z_eff_ss_dead_ds.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rScale regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h
index 3714bf41ba..7a7d57363a 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_DEAD_DS_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsDeadDsInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c
index c0e0e9babb..f0b3c8fce4 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c
@@ -5,6 +5,7 @@
*/
#include "z_eff_ss_dead_sound.h"
+#include "printf.h"
#include "sfx.h"
#include "z64effect.h"
#include "z64play.h"
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c
index 07335e2488..2f5901ca2e 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c
@@ -5,6 +5,16 @@
*/
#include "z_eff_ss_dt_bubble.h"
+
+#include "libc64/qrand.h"
+#include "color.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rPrimColorR regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h
index cac4c1a08c..6138c86046 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_DT_BUBBLE_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsDtBubbleInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c
index cdb56fc74e..899e9f2a2d 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c
@@ -5,6 +5,17 @@
*/
#include "z_eff_ss_dust.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rPrimColorR regs[0]
@@ -96,7 +107,7 @@ void EffectSsDust_Draw(PlayState* play, u32 index, EffectSs* this) {
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h
index 5cb686ae94..958bde91f8 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_DUST_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsDustInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c
index 73795ab2d4..56dc375337 100644
--- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c
+++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c
@@ -5,6 +5,15 @@
*/
#include "z_eff_ss_en_fire.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rScaleMax regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h
index c511827ecf..14acb95e40 100644
--- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h
+++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h
@@ -2,10 +2,10 @@
#define Z_EFF_SS_EN_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsEnFireInitParams {
- /* 0x00 */ Actor* actor;
+ /* 0x00 */ struct Actor* actor;
/* 0x04 */ Vec3f pos;
/* 0x10 */ s16 scale;
/* 0x12 */ s16 unk_12;
diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c
index 4a2d5a584c..17af3ac9eb 100644
--- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c
+++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c
@@ -5,7 +5,18 @@
*/
#include "z_eff_ss_en_ice.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rLifespan regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h
index 22929d39dd..238b005bcc 100644
--- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h
+++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h
@@ -2,10 +2,11 @@
#define Z_EFF_SS_EN_ICE_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsEnIceInitParams {
- /* 0x00 */ Actor* actor;
+ /* 0x00 */ struct Actor* actor;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 scale;
/* 0x14 */ Vec3f velocity;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c
index e3506295da..c5cee8db21 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c
@@ -5,6 +5,14 @@
*/
#include "z_eff_ss_extra.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_yabusame_point/object_yabusame_point.h"
#define rObjectSlot regs[0]
@@ -31,7 +39,7 @@ u32 EffectSsExtra_Init(PlayState* play, u32 index, EffectSs* this, void* initPar
if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) {
uintptr_t oldSeg6 = gSegments[6];
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
this->pos = initParams->pos;
this->velocity = initParams->velocity;
this->accel = initParams->accel;
@@ -63,7 +71,7 @@ void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) {
OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_extra.c", 168);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
+ gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h
index c8047d21fa..1bf5a5d30c 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_EXTRA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsExtraInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c
index 6b07df0582..9f00f52e30 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c
@@ -5,6 +5,14 @@
*/
#include "z_eff_ss_fcircle.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rUnused regs[3] // probably supposed to be an alpha
diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h
index 2e3eb74184..fc2a4ec2de 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h
@@ -2,10 +2,10 @@
#define Z_EFF_SS_FCIRCLE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsFcircleInitParams {
- /* 0x00 */ Actor* actor;
+ /* 0x00 */ struct Actor* actor;
/* 0x04 */ Vec3f pos;
/* 0x10 */ s16 radius;
/* 0x12 */ s16 height;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
index c4ab534692..60cad10d01 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
@@ -6,6 +6,19 @@
#include "z_eff_ss_fhg_flash.h"
#include "overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64skin.h"
+
#include "assets/objects/object_fhg/object_fhg.h"
#define rAlpha regs[0]
@@ -42,7 +55,7 @@ u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* init
if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) {
prevSeg6 = gSegments[6];
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
this->rObjectSlot = objectSlot;
this->pos = initParams->pos;
this->velocity = initParams->velocity;
@@ -98,7 +111,7 @@ void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this)
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
+ gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, this->rAlpha);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c
index 089c7f73eb..de4ae887bb 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c
@@ -5,6 +5,15 @@
*/
#include "z_eff_ss_fire_tail.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rScale regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h
index 70f5df7e19..ebe8a7203d 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h
@@ -2,10 +2,11 @@
#define Z_EFF_SS_FIRE_TAIL_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsFireTailInitParams {
- /* 0x00 */ Actor* actor;
+ /* 0x00 */ struct Actor* actor;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 scale;
/* 0x14 */ Vec3f unk_14;
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c
index 351fadab7c..05e4a3d8bf 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c
@@ -5,6 +5,11 @@
*/
#include "z_eff_ss_g_fire.h"
+
+#include "segmented_address.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
u32 EffectSsGFire_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h
index cfb5dcfafb..52312527d9 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_G_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsGFireInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c
index f93bb0e7d6..9610917043 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c
@@ -5,6 +5,12 @@
*/
#include "z_eff_ss_g_magma.h"
+
+#include "libc64/qrand.h"
+#include "segmented_address.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
u32 EffectSsGMagma_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h
index ab1b97a1de..55215239d2 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_G_MAGMA_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsGMagmaInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c
index 11fc08606b..316f65258a 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c
@@ -5,6 +5,14 @@
*/
#include "z_eff_ss_g_magma2.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_kingdodongo/object_kingdodongo.h"
#define rPrimColorR regs[0]
@@ -45,7 +53,7 @@ u32 EffectSsGMagma2_Init(PlayState* play, u32 index, EffectSs* this, void* initP
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
EffectSsGMagma2InitParams* initParams = (EffectSsGMagma2InitParams*)initParamsx;
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
this->rObjectSlot = objectSlot;
this->pos = initParams->pos;
this->velocity = zeroVec;
@@ -84,7 +92,7 @@ void EffectSsGMagma2_Draw(PlayState* play, u32 index, EffectSs* this) {
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
+ gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, gfxCtx, "../z_eff_ss_g_magma2.c", 282);
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h
index 715e01e7db..2ddc9f4ce7 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_G_MAGMA2_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsGMagma2InitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c
index 48a2eec4f0..2c83108d35 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c
@@ -5,6 +5,15 @@
*/
#include "z_eff_ss_g_ripple.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rWaterBoxNum regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h
index 63487ee0ca..86a7d8378e 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_G_RIPPLE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsGRippleInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c
index f43f4f3a52..a5472c29fa 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c
@@ -5,6 +5,16 @@
*/
#include "z_eff_ss_g_spk.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rPrimColorR regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h
index 8627bc0528..0d94bd7e0a 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h
@@ -2,10 +2,11 @@
#define Z_EFF_SS_G_SPK_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsGSpkInitParams {
- /* 0x00 */ Actor* actor;
+ /* 0x00 */ struct Actor* actor;
/* 0x04 */ Vec3f pos;
/* 0x10 */ Vec3f velocity;
/* 0x1C */ Vec3f accel;
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c
index 4e7c26308c..3baab32db9 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c
@@ -5,6 +5,11 @@
*/
#include "z_eff_ss_g_splash.h"
+
+#include "segmented_address.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
//! @bug the reuse of regs[11] means that EffectSs_DrawGEffect will treat the type as an object slot (`rgObjectSlot`)
diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h
index c13e19cd1c..fa1907f667 100644
--- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h
+++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_G_SPLASH_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsGSplashInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c
index 2e279a5b12..9be42db8d9 100644
--- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c
+++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c
@@ -5,7 +5,15 @@
*/
#include "z_eff_ss_hitmark.h"
-#include "global.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rTexIndex regs[0]
@@ -87,7 +95,7 @@ void EffectSsHitMark_Draw(PlayState* play, u32 index, EffectSs* this) {
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c
index 7f0fc02fa1..9ce9885de3 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c
@@ -5,6 +5,15 @@
*/
#include "z_eff_ss_ice_piece.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "sys_math.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rLifespan regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h
index f7b376a7ad..afb96c213c 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_ICE_PIECE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsIcePieceInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c
index 9997240be7..1445e61d02 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c
@@ -5,6 +5,16 @@
*/
#include "z_eff_ss_ice_smoke.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/object_fz/object_fz.h"
#define rObjectSlot regs[0]
@@ -30,7 +40,7 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init
if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) {
uintptr_t prevSeg6 = gSegments[6];
- gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
+ gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
Math_Vec3f_Copy(&this->pos, &initParams->pos);
Math_Vec3f_Copy(&this->velocity, &initParams->velocity);
Math_Vec3f_Copy(&this->accel, &initParams->accel);
@@ -66,7 +76,7 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) {
if ((objectSlot >= 0) && Object_IsLoaded(&play2->objectCtx, objectSlot)) {
gDPPipeSync(POLY_XLU_DISP++);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
- gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr);
+ gSegments[6] = OS_K0_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamStartDL));
gDPPipeSync(POLY_XLU_DISP++);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h
index 64833be518..24c27f1cf6 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_ICE_SMOKE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsIceSmokeInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c
index 10a3b668ab..12d9c5a5eb 100644
--- a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c
+++ b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c
@@ -5,6 +5,14 @@
*/
#include "z_eff_ss_k_fire.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rAlpha regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h
index 1896b47a73..eb8e8764d7 100644
--- a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h
+++ b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_K_FIRE_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsKFireInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c
index 4fbd637855..fda08ca8b8 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c
@@ -11,6 +11,7 @@
#include "gfx.h"
#include "gfx_setupdl.h"
#include "line_numbers.h"
+#include "printf.h"
#include "sys_matrix.h"
#include "versions.h"
#include "z64effect.h"
diff --git a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c
index 5973ca9e1e..f7c22aaa19 100644
--- a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c
+++ b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c
@@ -5,6 +5,18 @@
*/
#include "z_eff_ss_kirakira.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "rand.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rRotSpeed regs[0]
@@ -97,7 +109,7 @@ void EffectSsKiraKira_Draw(PlayState* play, u32 index, EffectSs* this) {
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfRotY, &mfTransBillboardRotY);
SkinMatrix_MtxFMtxFMult(&mfTransBillboardRotY, &mfScale, &mfResult);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
diff --git a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h
index 7f8c18da3e..0c128ff7ab 100644
--- a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h
+++ b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_KIRAKIRA_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsKiraKiraInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c
index 0e2560e34f..f44ac38496 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c
@@ -5,6 +5,17 @@
*/
#include "z_eff_ss_lightning.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rPrimColorR regs[0]
@@ -100,7 +111,7 @@ void EffectSsLightning_Draw(PlayState* play, u32 index, EffectSs* this) {
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfRotate, &mfTransBillboardRotate);
SkinMatrix_MtxFMtxFMult(&mfTransBillboardRotate, &mfScale, &mfResult);
- gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h
index ad352e9013..39f5d51841 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h
@@ -2,7 +2,8 @@
#define Z_EFF_SS_LIGHTNING_H
#include "ultra64.h"
-#include "global.h"
+#include "color.h"
+#include "z64math.h"
typedef struct EffectSsLightningInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c
index f707251cba..1dadd7f069 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c
@@ -5,6 +5,18 @@
*/
#include "z_eff_ss_sibuki.h"
+
+#include "libc64/qrand.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rPrimColorR regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h
index 18aaf0d200..e45c2c6f2a 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_SIBUKI_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsSibukiInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c
index e85a53e890..8566be1623 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c
@@ -5,6 +5,14 @@
*/
#include "z_eff_ss_sibuki2.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rPrimColorR regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h
index 7fb20d8b33..37a9425dc7 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_SIBUKI2_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsSibuki2InitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c
index ed1d5edccf..2277a71d85 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c
@@ -6,6 +6,11 @@
#include "z_eff_ss_solder_srch_ball.h"
+#include "z64bgcheck.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+
#define rUnused regs[1]
u32 EffectSsSolderSrchBall_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h
index 70aa558b65..b105f063d5 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_SOLDERSRCHBALL_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsSolderSrchBallInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c
index ba327e465a..520f8af02a 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c
@@ -5,6 +5,16 @@
*/
#include "z_eff_ss_stick.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "sys_matrix.h"
+#include "z_lib.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/objects/object_link_boy/object_link_boy.h"
#include "assets/objects/object_link_child/object_link_child.h"
diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h
index 8e01aeb003..4b5ccda965 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_STICK_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsStickInitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c
index e1083373b8..5ecd83add1 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c
@@ -5,6 +5,17 @@
*/
#include "z_eff_ss_stone1.h"
+
+#include "color.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "regs.h"
+#include "segmented_address.h"
+#include "sys_matrix.h"
+#include "z64effect.h"
+#include "z64play.h"
+#include "z64skin_matrix.h"
+
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#define rReg0 regs[0]
diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h
index d329161277..efb8df225d 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h
@@ -2,7 +2,7 @@
#define Z_EFF_SS_STONE1_H
#include "ultra64.h"
-#include "global.h"
+#include "z64math.h"
typedef struct EffectSsStone1InitParams {
/* 0x00 */ Vec3f pos;
diff --git a/src/overlays/gamestates/ovl_file_choose/file_select.h b/src/overlays/gamestates/ovl_file_choose/file_select.h
index 122ba09af0..ae41c4dced 100644
--- a/src/overlays/gamestates/ovl_file_choose/file_select.h
+++ b/src/overlays/gamestates/ovl_file_choose/file_select.h
@@ -3,8 +3,9 @@
#include "libc/stddef.h"
#include "ultra64.h"
-#include "global.h"
+#include "gfx.h"
#include "versions.h"
+#include "z64game.h"
#define GET_NEWF(sramCtx, slotNum, index) (sramCtx->readBuff[gSramSlotOffsets[slotNum] + offsetof(SaveContext, save.info.playerData.newf[index])])
@@ -154,13 +155,6 @@ typedef enum SettingIndex {
/* */ FS_SETTING_MAX
} SettingIndex;
-typedef enum AudioOption {
- /* 0 */ FS_AUDIO_STEREO,
- /* 1 */ FS_AUDIO_MONO,
- /* 2 */ FS_AUDIO_HEADSET,
- /* 3 */ FS_AUDIO_SURROUND
-} AudioOption;
-
typedef enum CharPage {
/* 0 */ FS_CHAR_PAGE_HIRA,
/* 1 */ FS_CHAR_PAGE_KATA,
diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
index 6c641e1da5..e8934c3731 100644
--- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
+++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c
@@ -1,14 +1,43 @@
#include "file_select.h"
+#include "file_select_state.h"
+
+#include "attributes.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "language_array.h"
+#include "letterbox.h"
+#include "main.h"
+#include "map_select_state.h"
+#include "memory_utils.h"
+#if PLATFORM_N64
+#include "n64dd.h"
+#endif
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "segment_symbols.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
#include "versions.h"
+#include "z_lib.h"
+#include "z64audio.h"
+#include "z64environment.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64skybox.h"
+#include "z64sram.h"
+#include "z64ss_sram.h"
+#include "z64view.h"
+
#if OOT_PAL_N64
#include "assets/objects/object_mag/object_mag.h"
#endif
#include "assets/textures/title_static/title_static.h"
#include "assets/textures/parameter_static/parameter_static.h"
-#if PLATFORM_N64
-#include "n64dd.h"
-#endif
#if OOT_PAL_N64
static s32 sInitialLanguageAlphaAsInt = 100;
@@ -721,12 +750,12 @@ void FileSelect_PulsateCursor(GameState* thisx) {
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, 3, OS_WRITE);
PRINTF("1:read_buff[]=%x, %x, %x, %x\n", sramCtx->readBuff[SRAM_HEADER_SOUND],
- sramCtx->readBuff[SRAM_HEADER_ZTARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
+ sramCtx->readBuff[SRAM_HEADER_Z_TARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
sramCtx->readBuff[SRAM_HEADER_MAGIC]);
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_READ);
PRINTF("read_buff[]=%x, %x, %x, %x\n", sramCtx->readBuff[SRAM_HEADER_SOUND],
- sramCtx->readBuff[SRAM_HEADER_ZTARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
+ sramCtx->readBuff[SRAM_HEADER_Z_TARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
sramCtx->readBuff[SRAM_HEADER_MAGIC]);
} else if (CHECK_BTN_ALL(debugInput->press.button, BTN_DUP)) {
sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language = LANGUAGE_GER;
@@ -734,11 +763,11 @@ void FileSelect_PulsateCursor(GameState* thisx) {
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, 3, OS_WRITE);
PRINTF("1:read_buff[]=%x, %x, %x, %x\n", sramCtx->readBuff[SRAM_HEADER_SOUND],
- sramCtx->readBuff[SRAM_HEADER_ZTARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
+ sramCtx->readBuff[SRAM_HEADER_Z_TARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
sramCtx->readBuff[SRAM_HEADER_MAGIC]);
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_READ);
PRINTF("read_buff[]=%x, %x, %x, %x\n", sramCtx->readBuff[SRAM_HEADER_SOUND],
- sramCtx->readBuff[SRAM_HEADER_ZTARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
+ sramCtx->readBuff[SRAM_HEADER_Z_TARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
sramCtx->readBuff[SRAM_HEADER_MAGIC]);
} else if (CHECK_BTN_ALL(debugInput->press.button, BTN_DRIGHT)) {
sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language = LANGUAGE_FRA;
@@ -746,12 +775,12 @@ void FileSelect_PulsateCursor(GameState* thisx) {
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, 3, OS_WRITE);
PRINTF("1:read_buff[]=%x, %x, %x, %x\n", sramCtx->readBuff[SRAM_HEADER_SOUND],
- sramCtx->readBuff[SRAM_HEADER_ZTARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
+ sramCtx->readBuff[SRAM_HEADER_Z_TARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
sramCtx->readBuff[SRAM_HEADER_MAGIC]);
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_READ);
PRINTF("read_buff[]=%x, %x, %x, %x\n", sramCtx->readBuff[SRAM_HEADER_SOUND],
- sramCtx->readBuff[SRAM_HEADER_ZTARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
+ sramCtx->readBuff[SRAM_HEADER_Z_TARGET], sramCtx->readBuff[SRAM_HEADER_LANGUAGE],
sramCtx->readBuff[SRAM_HEADER_MAGIC]);
}
#endif
@@ -1926,7 +1955,16 @@ void FileSelect_LoadGame(GameState* thisx) {
swordEquipValue =
(gEquipMasks[EQUIP_TYPE_SWORD] & gSaveContext.save.info.equips.equipment) >> (EQUIP_TYPE_SWORD * 4);
gSaveContext.save.info.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD];
+#ifndef AVOID_UB
+ //! @bug swordEquipValue can be 0 (EQUIP_VALUE_SWORD_NONE) here (typically, when first starting the game).
+ //! This leads to reading gBitFlags[-1] (out of bounds).
+ // gBitFlags[-1] turns out to be 0 in matching versions so this is inconsequential.
gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1);
+#else
+ if (swordEquipValue != EQUIP_VALUE_SWORD_NONE) {
+ gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1);
+ }
+#endif
}
#if PLATFORM_N64
diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c
index 9c6e8ff2db..03fb5d0f12 100644
--- a/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c
+++ b/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c
@@ -1,4 +1,13 @@
#include "file_select.h"
+#include "file_select_state.h"
+
+#include "controller.h"
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "z64save.h"
+#include "z64sram.h"
// In iQue versions, this file contains many workarounds for EGCS internal
// compiler errors (see docs/compilers.md)
diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c
index 9bafd123bd..bc7ae7edc1 100644
--- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c
+++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c
@@ -1,6 +1,21 @@
#include "file_select.h"
+#include "file_select_state.h"
+
+#include "array_count.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "language_array.h"
+#include "printf.h"
+#include "regs.h"
+#include "rumble.h"
+#include "sfx.h"
+#include "sys_matrix.h"
#include "terminal.h"
#include "versions.h"
+#include "z64audio.h"
+#include "z64save.h"
+
#include "assets/textures/title_static/title_static.h"
#include "assets/overlays/ovl_file_choose/ovl_file_choose.h"
@@ -1340,7 +1355,7 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) {
Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->configMode = CM_OPTIONS_TO_MAIN;
- sramCtx->readBuff[0] = gSaveContext.audioSetting;
+ sramCtx->readBuff[0] = gSaveContext.soundSetting;
sramCtx->readBuff[1] = gSaveContext.zTargetSetting;
#if OOT_PAL_N64
sramCtx->readBuff[2] = gSaveContext.language;
@@ -1350,11 +1365,11 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) {
PRINTF_COLOR_YELLOW();
PRINTF("sram->read_buff[2] = J_N = %x\n", sramCtx->readBuff[2]);
PRINTF("sram->read_buff[2] = J_N = %x\n", &sramCtx->readBuff[2]);
- PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);
- PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);
- PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);
+ PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting);
+ PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting);
+ PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting);
PRINTF_RST();
- func_800F6700(gSaveContext.audioSetting);
+ Audio_SetSoundOutputMode(gSaveContext.soundSetting);
PRINTF("終了\n");
return;
}
@@ -1364,11 +1379,11 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (sSelectedSetting == FS_SETTING_AUDIO) {
- gSaveContext.audioSetting--;
+ gSaveContext.soundSetting--;
// because audio setting is unsigned, can't check for < 0
- if (gSaveContext.audioSetting > 0xF0) {
- gSaveContext.audioSetting = FS_AUDIO_SURROUND;
+ if (gSaveContext.soundSetting > 0xF0) {
+ gSaveContext.soundSetting = SOUND_SETTING_SURROUND;
}
} else {
#if !OOT_PAL_N64
@@ -1389,10 +1404,10 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
if (sSelectedSetting == FS_SETTING_AUDIO) {
- gSaveContext.audioSetting++;
+ gSaveContext.soundSetting++;
- if (gSaveContext.audioSetting > FS_AUDIO_SURROUND) {
- gSaveContext.audioSetting = FS_AUDIO_STEREO;
+ if (gSaveContext.soundSetting > SOUND_SETTING_SURROUND) {
+ gSaveContext.soundSetting = SOUND_SETTING_STEREO;
}
} else {
#if !OOT_PAL_N64
@@ -1706,7 +1721,7 @@ void FileSelect_DrawOptionsImpl(GameState* thisx) {
for (i = 0, vtx = 0; i < 4; i++, vtx += 4) {
gDPPipeSync(POLY_OPA_DISP++);
- if (i == gSaveContext.audioSetting) {
+ if (i == gSaveContext.soundSetting) {
if (sSelectedSetting == FS_SETTING_AUDIO) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, cursorPrimRed, cursorPrimGreen, cursorPrimBlue,
this->titleAlpha[0]);
diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c
index 7b24564cfc..ad36b6e205 100644
--- a/src/overlays/gamestates/ovl_opening/z_opening.c
+++ b/src/overlays/gamestates/ovl_opening/z_opening.c
@@ -4,7 +4,15 @@
* Description: Initializes the game into the title screen
*/
-#include "global.h"
+#include "gfx.h"
+#include "regs.h"
+#include "sys_matrix.h"
+#include "title_setup_state.h"
+#include "z64game.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64sram.h"
+#include "z64view.h"
void TitleSetup_SetupTitleScreen(TitleSetupState* this) {
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c
index 6a9b1e1b3d..84b1cb69ae 100644
--- a/src/overlays/gamestates/ovl_select/z_select.c
+++ b/src/overlays/gamestates/ovl_select/z_select.c
@@ -4,15 +4,30 @@
* Description: Debug Scene Select Menu
*/
-#include "ultra64.h"
-#include "global.h"
-#include "terminal.h"
+#include "libc64/qrand.h"
+#include "libu64/gfxprint.h"
#include "alloca.h"
-#include "z64.h"
-
+#include "array_count.h"
+#include "console_logo_state.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "map_select_state.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "printf.h"
+#include "regs.h"
+#include "segment_symbols.h"
+#include "seqcmd.h"
+#include "sequence.h"
+#include "sfx.h"
+#include "terminal.h"
+#include "translation.h"
+#include "ultra64.h"
+#include "z64play.h"
+#include "z64save.h"
+#include "z64sram.h"
void MapSelect_LoadTitle(MapSelectState* this) {
this->state.running = false;
@@ -63,7 +78,7 @@ void func_80800B08_unknown(MapSelectState* this, s32 arg1) {
}
#endif
-static SceneSelectEntry sScenes[] = {
+static MapSelectEntry sMapSelectEntries[] = {
{ " 1:SPOT00", MapSelect_LoadGame, ENTR_HYRULE_FIELD_0 },
{ " 2:SPOT01", MapSelect_LoadGame, ENTR_KAKARIKO_VILLAGE_0 },
{ " 3:SPOT02", MapSelect_LoadGame, ENTR_GRAVEYARD_0 },
@@ -276,13 +291,13 @@ static SceneSelectEntry sScenes[] = {
void MapSelect_UpdateMenu(MapSelectState* this) {
Input* input = &this->state.input[0];
s32 pad;
- SceneSelectEntry* selectedScene;
+ MapSelectEntry* selectedEntry;
if (this->verticalInputAccumulator == 0) {
if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) {
- selectedScene = &this->scenes[this->currentScene];
- if (selectedScene->loadFunc != NULL) {
- selectedScene->loadFunc(this, selectedScene->entranceIndex);
+ selectedEntry = &this->entries[this->currentEntry];
+ if (selectedEntry->loadFunc != NULL) {
+ selectedEntry->loadFunc(this, selectedEntry->entranceIndex);
}
}
@@ -420,7 +435,7 @@ void MapSelect_UpdateMenu(MapSelectState* this) {
this->pageDownIndex++;
this->pageDownIndex =
(this->pageDownIndex + ARRAY_COUNT(this->pageDownStops)) % ARRAY_COUNT(this->pageDownStops);
- this->currentScene = this->topDisplayedScene = this->pageDownStops[this->pageDownIndex];
+ this->currentEntry = this->topDisplayedEntry = this->pageDownStops[this->pageDownIndex];
}
this->verticalInputAccumulator += this->verticalInput;
@@ -429,12 +444,12 @@ void MapSelect_UpdateMenu(MapSelectState* this) {
this->verticalInput = 0;
this->verticalInputAccumulator = 0;
- this->currentScene++;
- this->currentScene = (this->currentScene + this->count) % this->count;
+ this->currentEntry++;
+ this->currentEntry = (this->currentEntry + this->count) % this->count;
- if (this->currentScene == ((this->topDisplayedScene + this->count + 19) % this->count)) {
- this->topDisplayedScene++;
- this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
+ if (this->currentEntry == ((this->topDisplayedEntry + this->count + 19) % this->count)) {
+ this->topDisplayedEntry++;
+ this->topDisplayedEntry = (this->topDisplayedEntry + this->count) % this->count;
}
}
@@ -442,25 +457,25 @@ void MapSelect_UpdateMenu(MapSelectState* this) {
this->verticalInput = 0;
this->verticalInputAccumulator = 0;
- if (this->currentScene == this->topDisplayedScene) {
- this->topDisplayedScene -= 2;
- this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
+ if (this->currentEntry == this->topDisplayedEntry) {
+ this->topDisplayedEntry -= 2;
+ this->topDisplayedEntry = (this->topDisplayedEntry + this->count) % this->count;
}
- this->currentScene--;
- this->currentScene = (this->currentScene + this->count) % this->count;
+ this->currentEntry--;
+ this->currentEntry = (this->currentEntry + this->count) % this->count;
- if (this->currentScene == ((this->topDisplayedScene + this->count) % this->count)) {
- this->topDisplayedScene--;
- this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
+ if (this->currentEntry == ((this->topDisplayedEntry + this->count) % this->count)) {
+ this->topDisplayedEntry--;
+ this->topDisplayedEntry = (this->topDisplayedEntry + this->count) % this->count;
}
}
- this->currentScene = (this->currentScene + this->count) % this->count;
- this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
+ this->currentEntry = (this->currentEntry + this->count) % this->count;
+ this->topDisplayedEntry = (this->topDisplayedEntry + this->count) % this->count;
- dREG(80) = this->currentScene;
- dREG(81) = this->topDisplayedScene;
+ dREG(80) = this->currentEntry;
+ dREG(81) = this->topDisplayedEntry;
dREG(82) = this->pageDownIndex;
if (this->timerUp != 0) {
@@ -493,14 +508,14 @@ void MapSelect_PrintMenu(MapSelectState* this, GfxPrint* printer) {
for (i = 0; i < 20; i++) {
GfxPrint_SetPos(printer, 9, i + 4);
- scene = (this->topDisplayedScene + i + this->count) % this->count;
- if (scene == this->currentScene) {
+ scene = (this->topDisplayedEntry + i + this->count) % this->count;
+ if (scene == this->currentEntry) {
GfxPrint_SetColor(printer, 255, 20, 20, 255);
} else {
GfxPrint_SetColor(printer, 200, 200, 55, 255);
}
- name = this->scenes[scene].name;
+ name = this->entries[scene].name;
if (name == NULL) {
name = "**Null**";
}
@@ -689,9 +704,9 @@ void MapSelect_Init(GameState* thisx) {
this->state.main = MapSelect_Main;
this->state.destroy = MapSelect_Destroy;
- this->scenes = sScenes;
- this->topDisplayedScene = 0;
- this->currentScene = 0;
+ this->entries = sMapSelectEntries;
+ this->topDisplayedEntry = 0;
+ this->currentEntry = 0;
this->pageDownStops[0] = 0; // Hyrule Field
this->pageDownStops[1] = 19; // Temple Of Time
this->pageDownStops[2] = 37; // Treasure Chest Game
@@ -701,7 +716,7 @@ void MapSelect_Init(GameState* thisx) {
this->pageDownStops[6] = 91; // Escaping Ganon's Tower 3
this->pageDownIndex = 0;
this->opt = 0;
- this->count = ARRAY_COUNT(sScenes);
+ this->count = ARRAY_COUNT(sMapSelectEntries);
View_Init(&this->view, this->state.gfxCtx);
this->view.flags = (VIEW_PROJECTION_ORTHO | VIEW_VIEWPORT);
this->verticalInputAccumulator = 0;
@@ -713,8 +728,8 @@ void MapSelect_Init(GameState* thisx) {
this->unk_234 = 0;
if ((dREG(80) >= 0) && (dREG(80) < this->count)) {
- this->currentScene = dREG(80);
- this->topDisplayedScene = dREG(81);
+ this->currentEntry = dREG(80);
+ this->topDisplayedEntry = dREG(81);
this->pageDownIndex = dREG(82);
}
diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c
index 8613d7bd37..588588b243 100644
--- a/src/overlays/gamestates/ovl_title/z_title.c
+++ b/src/overlays/gamestates/ovl_title/z_title.c
@@ -4,15 +4,31 @@
* Description: Displays the Nintendo Logo
*/
-#include "global.h"
-#include "alloca.h"
-#include "versions.h"
-
+#include "libu64/gfxprint.h"
#if PLATFORM_N64
#include "cic6105.h"
#include "n64dd.h"
#endif
+#include "alloca.h"
+#include "build.h"
+#include "console_logo_state.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "padmgr.h"
+#include "printf.h"
+#include "regs.h"
+#include "segment_symbols.h"
+#include "sequence.h"
+#include "sys_matrix.h"
+#include "sys_debug_controller.h"
+#include "sys_freeze.h"
+#include "title_setup_state.h"
+#include "versions.h"
+#include "z64actor.h"
+#include "z64environment.h"
+#include "z64save.h"
+
#include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h"
#if DEBUG_FEATURES
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c
index 26ba15dccc..aefe4b3a60 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c
@@ -1,4 +1,15 @@
#include "z_kaleido_scope.h"
+
+#include "array_count.h"
+#include "controller.h"
+#include "gfx.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/textures/parameter_static/parameter_static.h"
#include "assets/textures/icon_item_static/icon_item_static.h"
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c
index 6cf75817a5..a8433e9f2e 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c
@@ -1,4 +1,14 @@
#include "z_kaleido_scope.h"
+
+#include "libu64/gfxprint.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "gfxalloc.h"
+#include "printf.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/textures/parameter_static/parameter_static.h"
// Positions of each input section in the editor
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c
index 88931f745b..6b7da76bbd 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c
@@ -1,4 +1,15 @@
#include "z_kaleido_scope.h"
+
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/textures/icon_item_static/icon_item_static.h"
#include "assets/textures/parameter_static/parameter_static.h"
@@ -156,8 +167,10 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) {
BOOTS_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_BOOTS)));
}
+#ifndef AVOID_UB
// Wrong prototype; this function is called with `play` even though it has no arguments
void KaleidoScope_ProcessPlayerPreRender(PlayState* play);
+#endif
void KaleidoScope_DrawEquipment(PlayState* play) {
static s16 sEquipTimer = 0;
@@ -678,8 +691,12 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
if ((pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_CHANGED) && (sEquipTimer == 9)) {
+#ifndef AVOID_UB
//! @bug: This function shouldn't take any arguments
KaleidoScope_ProcessPlayerPreRender(play);
+#else
+ KaleidoScope_ProcessPlayerPreRender();
+#endif
}
gSPSegment(POLY_OPA_DISP++, 0x07, pauseCtx->playerSegment);
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c
index 543f679bd9..f01d2d6137 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c
@@ -1,4 +1,15 @@
#include "z_kaleido_scope.h"
+
+#include "libu64/pad.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/textures/parameter_static/parameter_static.h"
u8 gAmmoItems[] = {
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c
index 29bb488b3b..8c58493ccf 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c
@@ -1,5 +1,17 @@
#include "z_kaleido_scope.h"
+
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "language_array.h"
+#include "map.h"
+#include "printf.h"
+#include "regs.h"
+#include "sfx.h"
+#include "sys_ucode.h"
#include "versions.h"
+#include "z64play.h"
+#include "z64save.h"
+
#include "assets/textures/icon_item_24_static/icon_item_24_static.h"
#if OOT_NTSC
#include "assets/textures/icon_item_jpn_static/icon_item_jpn_static.h"
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c
index c784ab0b4a..6264c4147c 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c
@@ -1,5 +1,10 @@
#include "z_kaleido_scope.h"
+#include "libu64/pad.h"
+#include "regs.h"
+#include "sfx.h"
+#include "z64play.h"
+
static s16 sKaleidoPromptCursorAlphaVals[] = { 100, 255 };
void KaleidoScope_UpdatePrompt(PlayState* play) {
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c
index 0df4c60a95..48a1b60cfc 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c
@@ -1,7 +1,32 @@
+#include "z_kaleido_scope.h"
+
+#include "libc64/sleep.h"
+#include "array_count.h"
+#include "controller.h"
+#include "gfx.h"
+#include "gfx_setupdl.h"
+#include "gfxalloc.h"
+#include "language_array.h"
+#include "map.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
-#include "z_kaleido_scope.h"
+#include "printf.h"
+#include "regs.h"
+#include "segment_symbols.h"
+#include "segmented_address.h"
+#include "seqcmd.h"
+#include "sfx.h"
+#include "sys_matrix.h"
+#include "terminal.h"
+#include "title_setup_state.h"
+#include "versions.h"
+#include "z64audio.h"
+#include "z64ocarina.h"
+#include "z64play.h"
+#include "z64player.h"
+#include "z64save.h"
+
#include "assets/textures/icon_item_static/icon_item_static.h"
#include "assets/textures/icon_item_24_static/icon_item_24_static.h"
#if OOT_NTSC
@@ -13,10 +38,9 @@
#include "assets/textures/icon_item_fra_static/icon_item_fra_static.h"
#endif
#include "assets/textures/icon_item_gameover_static/icon_item_gameover_static.h"
-#include "terminal.h"
-#include "versions.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
#if !PLATFORM_GC
#define KALEIDO_PROMPT_CURSOR_R 100
@@ -3724,7 +3748,7 @@ void KaleidoScope_Update(PlayState* play) {
DMA_REQUEST_SYNC(pauseCtx->iconItemSegment, (uintptr_t)_icon_item_staticSegmentRomStart, iconItemStaticSize,
"../z_kaleido_scope_PAL.c", 3662);
- gSegments[8] = VIRTUAL_TO_PHYSICAL(pauseCtx->iconItemSegment);
+ gSegments[8] = OS_K0_TO_PHYSICAL(pauseCtx->iconItemSegment);
for (i = 0; i < ARRAY_COUNTU(gItemAgeReqs); i++) {
if (!CHECK_AGE_REQ_ITEM(i)) {
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h
index 916b8f826f..fcc84c5395 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h
@@ -2,7 +2,11 @@
#define Z_KALEIDO_SCOPE_H
#include "ultra64.h"
-#include "global.h"
+#include "gfx.h"
+#include "z64inventory.h"
+#include "z64pause.h"
+
+struct PlayState;
extern u8 gAmmoItems[];
extern s16 gVtxPageMapWorldQuadsWidth[];
@@ -214,26 +218,28 @@ typedef enum ItemQuad {
/* 41 */ ITEM_QUAD_MAX
} ItemQuad;
-void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx);
+void KaleidoScope_DrawQuestStatus(struct PlayState* play, GraphicsContext* gfxCtx);
s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s32 point);
-void KaleidoScope_DrawDebugEditor(PlayState* play);
-void KaleidoScope_DrawPlayerWork(PlayState* play);
-void KaleidoScope_DrawEquipment(PlayState* play);
+void KaleidoScope_DrawDebugEditor(struct PlayState* play);
+void KaleidoScope_DrawPlayerWork(struct PlayState* play);
+void KaleidoScope_DrawEquipment(struct PlayState* play);
void KaleidoScope_SetCursorPos(PauseContext* pauseCtx, u16 index, Vtx* vtx);
-void KaleidoScope_DrawItemSelect(PlayState* play);
-void KaleidoScope_UpdateItemEquip(PlayState* play);
-void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx);
-void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx);
-void KaleidoScope_UpdatePrompt(PlayState* play);
+void KaleidoScope_DrawItemSelect(struct PlayState* play);
+void KaleidoScope_UpdateItemEquip(struct PlayState* play);
+void KaleidoScope_DrawDungeonMap(struct PlayState* play, GraphicsContext* gfxCtx);
+void KaleidoScope_DrawWorldMap(struct PlayState* play, GraphicsContext* gfxCtx);
+void KaleidoScope_UpdatePrompt(struct PlayState* play);
Gfx* KaleidoScope_QuadTextureIA4(Gfx* gfx, void* texture, s16 width, s16 height, u16 point);
Gfx* KaleidoScope_QuadTextureIA8(Gfx* gfx, void* texture, s16 width, s16 height, u16 point);
-void KaleidoScope_MoveCursorToSpecialPos(PlayState* play, u16 specialPos);
+void KaleidoScope_MoveCursorToSpecialPos(struct PlayState* play, u16 specialPos);
void KaleidoScope_DrawQuadTextureRGBA32(GraphicsContext* gfxCtx, void* texture, u16 width, u16 height, u16 point);
-void KaleidoScope_ProcessPlayerPreRender();
-void KaleidoScope_SetupPlayerPreRender(PlayState* play);
-void KaleidoScope_DrawCursor(PlayState* play, u16 pageIndex);
-void KaleidoScope_UpdateDungeonMap(PlayState* play);
+#ifdef AVOID_UB
+void KaleidoScope_ProcessPlayerPreRender(void);
+#endif
+void KaleidoScope_SetupPlayerPreRender(struct PlayState* play);
+void KaleidoScope_DrawCursor(struct PlayState* play, u16 pageIndex);
+void KaleidoScope_UpdateDungeonMap(struct PlayState* play);
-void PauseMapMark_Draw(PlayState* play);
+void PauseMapMark_Draw(struct PlayState* play);
#endif
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c
index 89283bfc16..ec2c566ece 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c
@@ -1,7 +1,12 @@
#if PLATFORM_N64
#include "n64dd.h"
#endif
+#include "regs.h"
+#include "sys_matrix.h"
#include "z_kaleido_scope.h"
+#include "z_lib.h"
+#include "z64play.h"
+
#include "assets/textures/parameter_static/parameter_static.h"
typedef struct PauseMapMarkInfo {
diff --git a/sym_info.py b/sym_info.py
index 9fec30b581..0b8936bb54 100755
--- a/sym_info.py
+++ b/sym_info.py
@@ -1,42 +1,362 @@
#!/usr/bin/env python3
-import argparse
-from pathlib import Path
+# SPDX-FileCopyrightText: © 2025 ZeldaRET
+# SPDX-License-Identifier: CC0-1.0
+import argparse
+import bisect
+from dataclasses import dataclass
+import os
+from pathlib import Path
+from typing import Optional
+import struct
+import sys
+
+import colorama
+import elftools.elf.elffile
import mapfile_parser
-def symInfoMain():
- parser = argparse.ArgumentParser(description="Display various information about a symbol or address.")
- parser.add_argument("symname", help="symbol name or VROM/VRAM address to lookup")
- parser.add_argument("-v", "--version", dest="oot_version", help="Which version should be processed", default="gc-eu-mq-dbg")
- parser.add_argument("-e", "--expected", dest="use_expected", action="store_true", help="use the map file in expected/build/ instead of build/")
+@dataclass
+class MdebugSymbolicHeader:
+ magic: int
+ vstamp: int
+ ilineMax: int
+ cbLine: int
+ cbLineOffset: int
+ idnMax: int
+ cbDnOffset: int
+ ipdMax: int
+ cbPdOffset: int
+ isymMax: int
+ cbSymOffset: int
+ ioptMax: int
+ cbOptOffset: int
+ iauxMax: int
+ cbAuxOffset: int
+ issMax: int
+ cbSsOffset: int
+ issExtMax: int
+ cbSsExtOffset: int
+ ifdMax: int
+ cbFdOffset: int
+ crfd: int
+ cbRfdOffset: int
+ iextMax: int
+ cbExtOffset: int
- args = parser.parse_args()
- BUILTMAP = Path("build") / args.oot_version / f"oot-{args.oot_version}.map"
+@dataclass
+class MdebugFileDescriptor:
+ adr: int
+ rss: int
+ issBase: int
+ cbSs: int
+ isymBase: int
+ csym: int
+ ilineBase: int
+ cline: int
+ ioptBase: int
+ copt: int
+ ipdFirst: int
+ cpd: int
+ iauxBase: int
+ caux: int
+ rfdBase: int
+ crfd: int
+ bitfield: int
+ cbLineOffset: int
+ cbLine: int
- mapPath = BUILTMAP
- if args.use_expected:
- mapPath = "expected" / BUILTMAP
- # Guess if the input is an VROM/VRAM or a symbol name
- as_vram = False
- as_vrom = False
- as_name = False
- try:
- address = int(args.symname, 0)
- if address >= 0x01000000:
- as_vram = True
- else:
- as_vrom = True
- except ValueError:
- as_name = True
+@dataclass
+class MdebugSymbol:
+ iss: int
+ value: int
+ st: int
+ sc: int
+ index: int
- mapfile_parser.frontends.sym_info.doSymInfo(
- mapPath, args.symname, as_vram=as_vram, as_vrom=as_vrom, as_name=as_name
+
+@dataclass
+class LocalSymbol:
+ name: str
+ address: int
+
+
+def read_mdebug_symbolic_header(f, offset: int) -> MdebugSymbolicHeader:
+ f.seek(offset)
+ data = f.read(96)
+ return MdebugSymbolicHeader(*struct.unpack(">2H23I", data))
+
+
+def read_mdebug_file_descriptor(f, offset: int) -> MdebugFileDescriptor:
+ f.seek(offset)
+ data = f.read(72)
+ return MdebugFileDescriptor(*struct.unpack(">I2iI6iHh4iI2I", data))
+
+
+def read_mdebug_symbol(f, offset: int) -> MdebugSymbol:
+ f.seek(offset)
+ data = f.read(12)
+ word0, word1, word2 = struct.unpack(">III", data)
+ return MdebugSymbol(
+ word0, word1, (word2 >> 26) & 0x3F, (word2 >> 21) & 0x1F, word2 & 0xFFFFF
)
+def read_mdebug_string(f, offset: int) -> str:
+ f.seek(offset)
+ data = bytearray()
+ while True:
+ char = f.read(1)[0]
+ if char == 0:
+ break
+ data.append(char)
+ return data.decode("ascii")
+
+
+def read_local_symbols_from_mdebug(elf_path: Path) -> list[LocalSymbol]:
+ local_symbols = []
+
+ with open(elf_path, "r+b") as f:
+ elf = elftools.elf.elffile.ELFFile(f)
+
+ mdebug_offset = 0
+ for section in elf.iter_sections():
+ if section.name == ".mdebug":
+ mdebug_offset = section["sh_offset"]
+ break
+
+ if mdebug_offset == 0:
+ print(f"No .mdebug section found in '{elf_path}'")
+ return []
+
+ symbolic_header = read_mdebug_symbolic_header(f, mdebug_offset)
+
+ for fd_num in range(symbolic_header.ifdMax):
+ fd = read_mdebug_file_descriptor(
+ f, symbolic_header.cbFdOffset + fd_num * 72
+ )
+
+ for sym_num in range(fd.isymBase, fd.isymBase + fd.csym):
+ sym = read_mdebug_symbol(f, symbolic_header.cbSymOffset + sym_num * 12)
+ if sym.st == 2: # stStatic
+ if not (
+ sym.sc == 2 or sym.sc == 3 or sym.sc == 15
+ ): # scData, scBss, scRData
+ continue
+
+ sym_name = read_mdebug_string(
+ f, symbolic_header.cbSsOffset + fd.issBase + sym.iss
+ )
+
+ # EGCS mangles names of internal variables, and seemingly ":V" is for in-function static variables
+ if "." in sym_name:
+ continue
+ if ":" in sym_name:
+ sym_name, rest = sym_name.split(":", 1)
+ if not rest.startswith("V"):
+ continue
+
+ local_symbols.append(LocalSymbol(sym_name, sym.value))
+ elif sym.st == 14: # stStaticProc
+ sym_name = read_mdebug_string(
+ f, symbolic_header.cbSsOffset + fd.issBase + sym.iss
+ )
+ local_symbols.append(LocalSymbol(sym_name, sym.value))
+
+ return local_symbols
+
+
+def merge_local_symbols(
+ map_file: mapfile_parser.mapfile.MapFile, local_symbols: list[LocalSymbol]
+):
+ local_symbols.sort(key=lambda s: s.address)
+
+ for segment in map_file:
+ for file in segment:
+ # TODO: handle segmented addresses?
+ if file.vram < 0x80000000:
+ continue
+
+ start_address = file.vram
+ end_address = file.vram + file.size
+
+ start_index = bisect.bisect_left(
+ local_symbols, start_address, key=lambda s: s.address
+ )
+ end_index = bisect.bisect_left(
+ local_symbols, end_address, key=lambda s: s.address
+ )
+ if start_index == end_index:
+ continue
+
+ symbols = file.copySymbolList()
+ for sym in local_symbols[start_index:end_index]:
+ if file.vrom is None:
+ vrom = None
+ else:
+ vrom = sym.address - start_address + file.vrom
+ symbols.append(
+ mapfile_parser.mapfile.Symbol(
+ sym.name, sym.address, None, vrom, None
+ )
+ )
+
+ symbols.sort(key=lambda s: s.vram)
+
+ # Recompute symbol sizes
+ for i in range(len(symbols)):
+ if i == len(symbols) - 1:
+ symbols[i].size = end_address - symbols[i].vram
+ else:
+ symbols[i].size = symbols[i + 1].vram - symbols[i].vram
+
+ file.setSymbolList(symbols)
+
+
+def find_symbols_by_name(
+ map_file: mapfile_parser.mapfile.MapFile, sym_name: str
+) -> list[mapfile_parser.mapfile.FoundSymbolInfo]:
+ infos = []
+
+ for segment in map_file:
+ for file in segment:
+ for sym in file:
+ if sym.name == sym_name:
+ infos.append(mapfile_parser.mapfile.FoundSymbolInfo(file, sym))
+
+ return infos
+
+
+def print_map_file(map_file: mapfile_parser.mapfile.MapFile, *, colors: bool):
+ for segment in map_file:
+ print(
+ f"{colorama.Fore.GREEN if colors else ""}"
+ f"{segment.name}"
+ f"{colorama.Fore.RESET if colors else ""}"
+ )
+ for file in segment:
+ # Ignore debug sections
+ if (
+ file.sectionType in (".pdr", ".line", ".gnu.attributes")
+ or file.sectionType.startswith(".debug")
+ or file.sectionType.startswith(".mdebug")
+ ):
+ continue
+ print(
+ f"{colorama.Fore.CYAN if colors else ""}"
+ f" {file.asStr()}"
+ f"{colorama.Fore.RESET if colors else ""}"
+ )
+ for sym in file:
+ vram_str = f"{sym.vram:08X}"
+ if sym.vrom is None:
+ vrom_str = " "
+ else:
+ vrom_str = f"{sym.vrom:06X}"
+ print(f" {vram_str} {vrom_str} {sym.name}")
+
+
+def sym_info_main():
+ parser = argparse.ArgumentParser(
+ description="Display various information about symbol or addresses."
+ )
+ parser.add_argument(
+ "symname",
+ nargs="?",
+ help="symbol name or VROM/VRAM address to lookup. If not given, all symbols will be printed.",
+ )
+ parser.add_argument(
+ "-e",
+ "--expected",
+ dest="use_expected",
+ action="store_true",
+ help="use the map file and elf in expected/build/ instead of build/",
+ )
+ parser.add_argument(
+ "--color",
+ help="Whether to print using colors or not",
+ choices=("never", "always", "auto"),
+ default="auto",
+ )
+ parser.add_argument(
+ "-v",
+ "--version",
+ dest="oot_version",
+ help="which version should be processed (default: gc-eu-mq-dbg)",
+ default="gc-eu-mq-dbg",
+ )
+
+ args = parser.parse_args()
+
+ if args.color == "never":
+ colors = False
+ elif args.color == "always":
+ colors = True
+ else:
+ # auto
+ if os.getenv("NO_COLOR"):
+ colors = False
+ else:
+ colors = sys.stdout.isatty()
+
+ BUILTMAP = Path("build") / args.oot_version / f"oot-{args.oot_version}.map"
+ BUILTELF = Path("build") / args.oot_version / f"oot-{args.oot_version}.elf"
+
+ map_path = BUILTMAP
+ elf_path = BUILTELF
+ if args.use_expected:
+ map_path = "expected" / BUILTMAP
+ elf_path = "expected" / BUILTELF
+
+ if not map_path.exists():
+ print(f"Could not find map_file at '{map_path}'")
+ sys.exit(1)
+
+ map_file = mapfile_parser.mapfile.MapFile()
+ map_file.readMapFile(map_path)
+
+ if elf_path.exists():
+ local_symbols = read_local_symbols_from_mdebug(elf_path)
+ merge_local_symbols(map_file, local_symbols)
+ else:
+ print(
+ f"Could not find ELF file at '{elf_path}', local symbols will not be available"
+ )
+
+ sym_name = args.symname
+ if sym_name is None:
+ print_map_file(map_file, colors=colors)
+ sys.exit(0)
+
+ infos: list[mapfile_parser.mapfile.FoundSymbolInfo] = []
+ possible_files: list[mapfile_parser.mapfile.File] = []
+ try:
+ address = int(sym_name, 0)
+ if address >= 0x01000000:
+ info, possible_files = map_file.findSymbolByVram(address)
+ if info is not None:
+ infos = [info]
+ else:
+ info, possible_files = map_file.findSymbolByVrom(address)
+ if info is not None:
+ infos = [info]
+ except ValueError:
+ infos = find_symbols_by_name(map_file, sym_name)
+
+ if not infos:
+ print(f"'{sym_name}' not found in map file '{map_path}'")
+ if len(possible_files) > 0:
+ print("But it may be a local symbol of either of the following files:")
+ for f in possible_files:
+ print(f" {f.asStr()})")
+ sys.exit(1)
+
+ for info in infos:
+ print(info.getAsStrPlusOffset(sym_name))
+
+
if __name__ == "__main__":
- symInfoMain()
+ sym_info_main()
diff --git a/tools/.gitignore b/tools/.gitignore
index 8d3a321faa..5345868178 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -1,5 +1,6 @@
# Output files
*.exe
+bin2c
elf2rom
makeromfs
mkdmadata
diff --git a/tools/Makefile b/tools/Makefile
index dae70625d5..7f6eef55a1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,5 +1,5 @@
-CFLAGS := -Wall -Wextra -pedantic -std=c99 -g -O2
-PROGRAMS := elf2rom makeromfs mkdmadata mkldscript preprocess_pragmas reloc_prereq vtxdis
+CFLAGS := -Wall -Wextra -pedantic -std=gnu99 -g -O2
+PROGRAMS := bin2c elf2rom makeromfs mkdmadata mkldscript preprocess_pragmas reloc_prereq vtxdis
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
@@ -35,25 +35,27 @@ ifneq ($(LLD),0)
endif
all: $(PROGRAMS) $(IDO_RECOMP_5_3_DIR) $(IDO_RECOMP_7_1_DIR) $(EGCS_DIR)
- $(MAKE) -C ZAPD
$(MAKE) -C fado
$(MAKE) -C audio
$(MAKE) -C com-plugin
+ $(MAKE) -C assets
clean:
$(RM) $(PROGRAMS) $(addsuffix .exe,$(PROGRAMS))
$(RM) -r ido_recomp egcs
- $(MAKE) -C ZAPD clean
$(MAKE) -C fado clean
$(MAKE) -C audio clean
$(MAKE) -C com-plugin clean
+ $(MAKE) -C assets clean
distclean: clean
$(MAKE) -C audio distclean
+ $(MAKE) -C assets distclean
.PHONY: all clean distclean
elf2rom_SOURCES := elf2rom.c elf32.c n64chksum.c util.c
+bin2c_SOURCES := bin2c.c
makeromfs_SOURCES := makeromfs.c n64chksum.c util.c
mkdmadata_SOURCES := mkdmadata.c spec.c util.c
mkldscript_SOURCES := mkldscript.c spec.c util.c
diff --git a/tools/ZAPD/.clang-format b/tools/ZAPD/.clang-format
deleted file mode 100644
index 5ba1c4a955..0000000000
--- a/tools/ZAPD/.clang-format
+++ /dev/null
@@ -1,84 +0,0 @@
----
-AccessModifierOffset: -4
-AlignAfterOpenBracket: Align
-AlignConsecutiveAssignments: false
-AlignConsecutiveDeclarations: false
-AlignEscapedNewlinesLeft: false
-AlignOperands: true
-AlignTrailingComments: true
-AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: InlineOnly
-AllowShortIfStatementsOnASingleLine: false
-AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
-AlwaysBreakAfterReturnType: None
-AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: true
-BinPackArguments: true
-BinPackParameters: true
-BraceWrapping:
- AfterCaseLabel: true
- AfterClass: true
- AfterControlStatement: true
- AfterEnum: true
- AfterFunction: true
- AfterNamespace: true
- AfterStruct: true
- AfterUnion: true
- BeforeCatch: true
- BeforeElse: true
- IndentBraces: false
-BreakBeforeBinaryOperators: None
-BreakBeforeBraces: Custom
-BreakBeforeTernaryOperators: false
-BreakConstructorInitializersBeforeComma: false
-ColumnLimit: 100
-CommentPragmas: '^ (IWYU pragma:|NOLINT)'
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
-ConstructorInitializerIndentWidth: 4
-ContinuationIndentWidth: 4
-Cpp11BracedListStyle: true
-DerivePointerAlignment: false
-DisableFormat: false
-ForEachMacros: [ ]
-IncludeCategories:
- - Regex: '^<[Ww]indows\.h>$'
- Priority: 1
- - Regex: '^<'
- Priority: 2
- - Regex: '^"'
- Priority: 3
-IndentCaseLabels: false
-IndentWidth: 4
-IndentWrappedFunctionNames: false
-KeepEmptyLinesAtTheStartOfBlocks: false
-MacroBlockBegin: ''
-MacroBlockEnd: ''
-MaxEmptyLinesToKeep: 1
-NamespaceIndentation: None
-PenaltyBreakBeforeFirstCallParameter: 19
-PenaltyBreakComment: 300
-PenaltyBreakFirstLessLess: 120
-PenaltyBreakString: 1000
-PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 60
-PointerAlignment: Left
-ReflowComments: true
-SortIncludes: false
-SpaceAfterCStyleCast: false
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeParens: ControlStatements
-SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 2
-SpacesInAngles: false
-SpacesInContainerLiterals: true
-SpacesInCStyleCastParentheses: false
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-Standard: Latest
-TabWidth: 4
-UseTab: AlignWithSpaces
-...
-
diff --git a/tools/ZAPD/.github/workflows/main.yml b/tools/ZAPD/.github/workflows/main.yml
deleted file mode 100644
index 604c18c961..0000000000
--- a/tools/ZAPD/.github/workflows/main.yml
+++ /dev/null
@@ -1,98 +0,0 @@
-name: Build ZAPD
-
-on:
- push:
- pull_request:
- branches:
- - master
-
-jobs:
- build:
- runs-on: self-hosted-runner
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- - name: Build ZAPD
- run: make -j WERROR=1
-
- - name: Checkout Repos
- run: echo "Checkout Repos"
-
- - name: Checkout oot
- run: |
- cd ../
- rm -rf oot/
- git clone https://github.com/zeldaret/oot.git
- cd oot
- echo $(pwd)
- git submodule update --init --recursive
-
- - name: Checkout mm
- run: |
- cd ../
- rm -rf mm/
- git clone https://github.com/zeldaret/mm.git
- cd mm
- echo $(pwd)
-
- - name: Set up repos
- run: echo "Set up repos"
-
- - name: Setup OOT
- run: |
- cd ../
- cd oot
- echo $(pwd)
- mkdir -p baseroms/gc-eu-mq-dbg/segments
- cp ~/baserom_original.z64 ./baseroms/gc-eu-mq-dbg/baserom.z64
- cd tools
- rm -rf ZAPD/
- ln -s ../../ZAPD
- cd ../
- make -j $(nproc) setup
-
- - name: Setup MM
- run: |
- cd ../
- cd mm
- echo $(pwd)
- python3 -m venv .mm-env
- source .mm-env/bin/activate
- python3 -m pip install -r requirements.txt
- cp ~/baserom.mm.us.rev1.z64 ./baserom.mm.us.rev1.z64
- cd tools
- rm -rf ZAPD/
- ln -s ../../ZAPD
- cd ../
- make -C tools -j
- python3 tools/fixbaserom.py
- python3 tools/extract_baserom.py
- python3 tools/decompress_yars.py
- python3 extract_assets.py -j $(nproc)
-
- - name: Build Repos
- run: echo "Build Repos"
-
- - name: Build oot
- run: |
- cd ../
- cd oot
- echo $(pwd)
- make venv
- make -j
-
- - name: Build mm
- run: |
- cd ../
- cd mm
- echo $(pwd)
- python3 -m venv .mm-env
- source .mm-env/bin/activate
- python3 -m pip install -r requirements.txt
- make -j disasm
- make -j
-
- - name: Clean workspace
- run: git clean -fdX
diff --git a/tools/ZAPD/.gitignore b/tools/ZAPD/.gitignore
deleted file mode 100644
index 68c502e36a..0000000000
--- a/tools/ZAPD/.gitignore
+++ /dev/null
@@ -1,341 +0,0 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
-
-# User-specific files
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-*.userprefs
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-bld/
-[Bb]in/
-[Oo]bj/
-[Ll]og/
-
-# Visual Studio 2015/2017 cache/options directory
-.vs/
-# Uncomment if you have tasks that create the project's static files in wwwroot
-#wwwroot/
-
-# Visual Studio 2017 auto generated files
-Generated\ Files/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-# NUNIT
-*.VisualState.xml
-TestResult.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-# Benchmark Results
-BenchmarkDotNet.Artifacts/
-
-# .NET Core
-project.lock.json
-project.fragment.lock.json
-artifacts/
-**/Properties/launchSettings.json
-
-# StyleCop
-StyleCopReport.xml
-
-# Files built by Visual Studio
-*_i.c
-*_p.c
-*_i.h
-*.ilk
-*.meta
-*.obj
-*.iobj
-*.pch
-*.pdb
-*.ipdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-
-# Chutzpah Test files
-_Chutzpah*
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opendb
-*.opensdf
-*.sdf
-*.cachefile
-*.VC.db
-*.VC.VC.opendb
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
-
-# Visual Studio Trace Files
-*.e2e
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# JustCode is a .NET coding add-in
-.JustCode
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# AxoCover is a Code Coverage Tool
-.axoCover/*
-!.axoCover/settings.json
-
-# Visual Studio code coverage results
-*.coverage
-*.coveragexml
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-nCrunchTemp_*
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-PublishScripts/
-
-# NuGet Packages
-*.nupkg
-# The packages folder can be ignored because of Package Restore
-**/[Pp]ackages/*
-# except build/, which is used as an MSBuild target.
-!**/[Pp]ackages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/[Pp]ackages/repositories.config
-# NuGet v3's project.json files produces more ignorable files
-*.nuget.props
-*.nuget.targets
-
-# Microsoft Azure Build Output
-csx/
-*.build.csdef
-
-# Microsoft Azure Emulator
-ecf/
-rcf/
-
-# Windows Store app package directories and files
-AppPackages/
-BundleArtifacts/
-Package.StoreAssociation.xml
-_pkginfo.txt
-*.appx
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-*.[Cc]ache
-# but keep track of directories ending in .cache
-!*.[Cc]ache/
-
-# Others
-ClientBin/
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.jfm
-*.pfx
-*.publishsettings
-orleans.codegen.cs
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-#bower_components/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-ServiceFabricBackup/
-*.rptproj.bak
-
-# SQL Server files
-*.mdf
-*.ldf
-*.ndf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-*.rptproj.rsuser
-
-# Microsoft Fakes
-FakesAssemblies/
-
-# GhostDoc plugin setting file
-*.GhostDoc.xml
-
-# Node.js Tools for Visual Studio
-.ntvs_analysis.dat
-node_modules/
-
-# Visual Studio 6 build log
-*.plg
-
-# Visual Studio 6 workspace options file
-*.opt
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-*.vbw
-
-# Visual Studio LightSwitch build output
-**/*.HTMLClient/GeneratedArtifacts
-**/*.DesktopClient/GeneratedArtifacts
-**/*.DesktopClient/ModelManifest.xml
-**/*.Server/GeneratedArtifacts
-**/*.Server/ModelManifest.xml
-_Pvt_Extensions
-
-# Paket dependency manager
-.paket/paket.exe
-paket-files/
-
-# FAKE - F# Make
-.fake/
-
-# JetBrains Rider
-.idea/
-*.sln.iml
-
-# CodeRush
-.cr/
-
-# Python Tools for Visual Studio (PTVS)
-__pycache__/
-*.pyc
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-*.tss
-
-# Telerik's JustMock configuration file
-*.jmconfig
-
-# BizTalk build output
-*.btp.cs
-*.btm.cs
-*.odx.cs
-*.xsd.cs
-
-# OpenCover UI analysis results
-OpenCover/
-
-# Azure Stream Analytics local run output
-ASALocalRun/
-
-# MSBuild Binary and Structured Log
-*.binlog
-
-# NVidia Nsight GPU debugger configuration file
-*.nvuser
-
-# MFractors (Xamarin productivity tool) working folder
-.mfractor/
-
-*.out
-*.o
-*.d
-lib/libgfxd/libgfxd.a
-ExporterTest/ExporterTest.a
-ZAPDUtils/ZAPDUtils.a
-.vscode/
-build/
-ZAPDUtils/build/
-ZAPD/BuildInfo.h
diff --git a/tools/ZAPD/.gitrepo b/tools/ZAPD/.gitrepo
deleted file mode 100644
index 801b2b6383..0000000000
--- a/tools/ZAPD/.gitrepo
+++ /dev/null
@@ -1,12 +0,0 @@
-; DO NOT EDIT (unless you know what you are doing)
-;
-; This subdirectory is a git "subrepo", and this file is maintained by the
-; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
-;
-[subrepo]
- remote = https://github.com/zeldaret/ZAPD.git
- branch = master
- commit = 35ea376daf003fdd3297a2e7355ad82e70ec1e8c
- parent = b97a21c2532622a83e9153996e303c3edc2727a8
- method = merge
- cmdver = 0.4.6
diff --git a/tools/ZAPD/ExporterTest/CollisionExporter.cpp b/tools/ZAPD/ExporterTest/CollisionExporter.cpp
deleted file mode 100644
index 6431a4593c..0000000000
--- a/tools/ZAPD/ExporterTest/CollisionExporter.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "CollisionExporter.h"
-
-void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] fs::path outPath,
- BinaryWriter* writer)
-{
- ZCollisionHeader* col = (ZCollisionHeader*)res;
-
- writer->Write(col->absMinX);
- writer->Write(col->absMinY);
- writer->Write(col->absMinZ);
-
- writer->Write(col->absMaxX);
- writer->Write(col->absMaxY);
- writer->Write(col->absMaxZ);
-
- writer->Write(col->numVerts);
- writer->Write(col->vtxAddress);
-
- writer->Write(col->numPolygons);
- writer->Write(col->polyAddress);
- writer->Write(col->polyTypeDefAddress);
- writer->Write(col->camDataAddress);
-
- writer->Write(col->numWaterBoxes);
- writer->Write(col->waterBoxAddress);
-
- writer->Write(col->vtxSegmentOffset);
- writer->Write(col->polySegmentOffset);
- writer->Write(col->polyTypeDefSegmentOffset);
- writer->Write(col->camDataSegmentOffset);
- writer->Write(col->waterBoxSegmentOffset);
-
- uint32_t oldOffset = writer->GetBaseAddress();
-
- writer->Seek(col->vtxSegmentOffset, SeekOffsetType::Start);
-
- for (uint16_t i = 0; i < col->vertices.size(); i++)
- {
- for (uint32_t j = 0; j < col->vertices[i].dimensions; j++)
- {
- writer->Write(col->vertices[i].scalars[j].scalarData.s16);
- }
- }
-
- writer->Seek(col->polySegmentOffset, SeekOffsetType::Start);
-
- for (uint16_t i = 0; i < col->polygons.size(); i++)
- {
- writer->Write(col->polygons[i].type);
- writer->Write(col->polygons[i].vtxA);
- writer->Write(col->polygons[i].vtxB);
- writer->Write(col->polygons[i].vtxC);
- writer->Write(col->polygons[i].normX);
- writer->Write(col->polygons[i].normY);
- writer->Write(col->polygons[i].normZ);
- writer->Write(col->polygons[i].dist);
- }
-
- writer->Seek(col->polyTypeDefSegmentOffset, SeekOffsetType::Start);
-
- for (const auto& poly : col->polygonTypes)
- {
- writer->Write(poly.data[0]);
- writer->Write(poly.data[1]);
- }
- writer->Seek(col->camDataSegmentOffset, SeekOffsetType::Start);
-
- for (auto entry : col->camData->entries)
- {
- writer->Write(entry.cameraSType);
- writer->Write(entry.numData);
- writer->Write(entry.cameraPosDataSeg);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
-}
diff --git a/tools/ZAPD/ExporterTest/CollisionExporter.h b/tools/ZAPD/ExporterTest/CollisionExporter.h
deleted file mode 100644
index 5f48e6557e..0000000000
--- a/tools/ZAPD/ExporterTest/CollisionExporter.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include "ZCollision.h"
-#include "ZResource.h"
-
-class ExporterExample_Collision : public ZResourceExporter
-{
-public:
- void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj b/tools/ZAPD/ExporterTest/ExporterTest.vcxproj
deleted file mode 100644
index 341f72ceb1..0000000000
--- a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- 16.0
- Win32Proj
- {65608eb0-1a47-45ad-ab66-192fb64c762c}
- ExporterTest
- 10.0
- ExporterExample
-
-
-
- Application
- true
- v142
- Unicode
-
-
- Application
- false
- v143
- true
- Unicode
-
-
- StaticLibrary
- true
- v142
- Unicode
-
-
- Application
- false
- v143
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- false
-
-
- true
- $(ProjectDir)..\ZAPD\;$(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath)
-
-
- false
-
-
-
- Level3
- true
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
-
-
-
-
- Level3
- true
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
- true
- true
-
-
-
-
- Level3
- true
- _DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- stdcpp17
- stdc11
- MultiThreadedDebug
-
-
- Console
- true
-
-
-
-
- Level3
- true
- true
- true
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj.filters b/tools/ZAPD/ExporterTest/ExporterTest.vcxproj.filters
deleted file mode 100644
index 166f563a17..0000000000
--- a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj.filters
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/Main.cpp b/tools/ZAPD/ExporterTest/Main.cpp
deleted file mode 100644
index 07fdbeeced..0000000000
--- a/tools/ZAPD/ExporterTest/Main.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-#include "CollisionExporter.h"
-#include "Globals.h"
-#include "RoomExporter.h"
-#include "TextureExporter.h"
-
-enum class ExporterFileMode
-{
- ModeExample1 = (int)ZFileMode::Custom + 1,
- ModeExample2 = (int)ZFileMode::Custom + 2,
- ModeExample3 = (int)ZFileMode::Custom + 3,
-};
-
-static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileMode)
-{
- if (buildMode == "me1")
- fileMode = (ZFileMode)ExporterFileMode::ModeExample1;
- else if (buildMode == "me2")
- fileMode = (ZFileMode)ExporterFileMode::ModeExample2;
- else if (buildMode == "me3")
- fileMode = (ZFileMode)ExporterFileMode::ModeExample3;
-}
-
-static void ExporterParseArgs([[maybe_unused]] int argc, char* argv[], int& i)
-{
- std::string arg = argv[i];
-
- if (arg == "--do-x")
- {
- }
- else if (arg == "--do-y")
- {
- }
-}
-
-static bool ExporterProcessFileMode(ZFileMode fileMode)
-{
- // Do whatever work is associated with these custom file modes...
- // Return true to indicate one of our own file modes is being processed
- if (fileMode == (ZFileMode)ExporterFileMode::ModeExample1)
- return true;
- else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample2)
- return true;
- else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample3)
- return true;
-
- return false;
-}
-
-static void ExporterFileBegin(ZFile* file)
-{
- printf("ExporterFileBegin() called on ZFile %s.\n", file->GetName().c_str());
-}
-
-static void ExporterFileEnd(ZFile* file)
-{
- printf("ExporterFileEnd() called on ZFile %s.\n", file->GetName().c_str());
-}
-
-static void ImportExporters()
-{
- // In this example we set up a new exporter called "EXAMPLE".
- // By running ZAPD with the argument -se EXAMPLE, we tell it that we want to use this exporter
- // for our resources.
- ExporterSet* exporterSet = new ExporterSet();
- exporterSet->processFileModeFunc = ExporterProcessFileMode;
- exporterSet->parseFileModeFunc = ExporterParseFileMode;
- exporterSet->parseArgsFunc = ExporterParseArgs;
- exporterSet->beginFileFunc = ExporterFileBegin;
- exporterSet->endFileFunc = ExporterFileEnd;
- exporterSet->exporters[ZResourceType::Texture] = new ExporterExample_Texture();
- exporterSet->exporters[ZResourceType::Room] = new ExporterExample_Room();
- exporterSet->exporters[ZResourceType::CollisionHeader] = new ExporterExample_Collision();
-
- Globals::AddExporter("EXAMPLE", exporterSet);
-}
-
-// When ZAPD starts up, it will automatically call the below function, which in turn sets up our
-// exporters.
-REGISTER_EXPORTER(ImportExporters);
diff --git a/tools/ZAPD/ExporterTest/Makefile b/tools/ZAPD/ExporterTest/Makefile
deleted file mode 100644
index 98e0475254..0000000000
--- a/tools/ZAPD/ExporterTest/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Only used for standalone compilation, usually inherits these from the main makefile
-CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17
-
-SRC_DIRS := $(shell find . -type d -not -path "*build*")
-CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
-H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
-
-O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
-LIB := ExporterTest.a
-
-# create build directories
-$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
-
-all: $(LIB)
-
-clean:
- rm -rf build $(LIB)
-
-format:
- clang-format-14 -i $(CPP_FILES) $(H_FILES)
-
-.PHONY: all clean format
-
-build/%.o: %.cpp
- $(CXX) $(CXXFLAGS) $(OPTFLAGS) -I ./ -I ../ZAPD -I ../ZAPDUtils -I ../lib/tinyxml2 -c $(OUTPUT_OPTION) $<
-
-$(LIB): $(O_FILES)
- $(AR) rcs $@ $^
diff --git a/tools/ZAPD/ExporterTest/RoomExporter.cpp b/tools/ZAPD/ExporterTest/RoomExporter.cpp
deleted file mode 100644
index 4cc06b76f5..0000000000
--- a/tools/ZAPD/ExporterTest/RoomExporter.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-#include "RoomExporter.h"
-#include "CollisionExporter.h"
-#include "Utils/BinaryWriter.h"
-#include "Utils/File.h"
-#include "Utils/MemoryStream.h"
-#include "ZRoom/Commands/SetCameraSettings.h"
-#include "ZRoom/Commands/SetCollisionHeader.h"
-#include "ZRoom/Commands/SetCsCamera.h"
-#include "ZRoom/Commands/SetEchoSettings.h"
-#include "ZRoom/Commands/SetEntranceList.h"
-#include "ZRoom/Commands/SetLightingSettings.h"
-#include "ZRoom/Commands/SetMesh.h"
-#include "ZRoom/Commands/SetRoomBehavior.h"
-#include "ZRoom/Commands/SetRoomList.h"
-#include "ZRoom/Commands/SetSkyboxModifier.h"
-#include "ZRoom/Commands/SetSkyboxSettings.h"
-#include "ZRoom/Commands/SetSoundSettings.h"
-#include "ZRoom/Commands/SetSpecialObjects.h"
-#include "ZRoom/Commands/SetStartPositionList.h"
-#include "ZRoom/Commands/SetTimeSettings.h"
-#include "ZRoom/Commands/SetWind.h"
-
-void ExporterExample_Room::Save(ZResource* res, fs::path outPath, BinaryWriter* writer)
-{
- ZRoom* room = dynamic_cast(res);
-
- // MemoryStream* memStream = new MemoryStream();
- // BinaryWriter* writer = new BinaryWriter(memStream);
-
- for (size_t i = 0; i < room->commands.size() * 8; i++)
- writer->Write((uint8_t)0);
-
- for (size_t i = 0; i < room->commands.size(); i++)
- {
- ZRoomCommand* cmd = room->commands[i];
-
- writer->Seek(i * 8, SeekOffsetType::Start);
-
- writer->Write((uint8_t)cmd->cmdID);
-
- switch (cmd->cmdID)
- {
- case RoomCommand::SetWind:
- {
- SetWind* cmdSetWind = (SetWind*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdSetWind->windWest); // 0x04
- writer->Write(cmdSetWind->windVertical); // 0x05
- writer->Write(cmdSetWind->windSouth); // 0x06
- writer->Write(cmdSetWind->clothFlappingStrength); // 0x07
- }
- break;
- case RoomCommand::SetTimeSettings:
- {
- SetTimeSettings* cmdTime = (SetTimeSettings*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdTime->hour); // 0x04
- writer->Write(cmdTime->min); // 0x05
- writer->Write(cmdTime->unk); // 0x06
- writer->Write((uint8_t)0); // 0x07
- }
- break;
- case RoomCommand::SetSkyboxModifier:
- {
- SetSkyboxModifier* cmdSkybox = (SetSkyboxModifier*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdSkybox->disableSky); // 0x04
- writer->Write(cmdSkybox->disableSunMoon); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)0); // 0x07
- }
- break;
- case RoomCommand::SetEchoSettings:
- {
- SetEchoSettings* cmdEcho = (SetEchoSettings*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)cmdEcho->echo); // 0x07
- }
- break;
- case RoomCommand::SetSoundSettings:
- {
- SetSoundSettings* cmdSound = (SetSoundSettings*)cmd;
-
- writer->Write((uint8_t)cmdSound->reverb); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
-
- writer->Write(cmdSound->nightTimeSFX); // 0x06
- writer->Write(cmdSound->musicSequence); // 0x07
- }
- break;
- case RoomCommand::SetSkyboxSettings:
- {
- SetSkyboxSettings* cmdSkybox = (SetSkyboxSettings*)cmd;
-
- writer->Write((uint8_t)cmdSkybox->unk1); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)cmdSkybox->skyboxNumber); // 0x04
- writer->Write((uint8_t)cmdSkybox->cloudsType); // 0x05
- writer->Write((uint8_t)cmdSkybox->isIndoors); // 0x06
- }
- break;
- case RoomCommand::SetRoomBehavior:
- {
- SetRoomBehavior* cmdRoom = (SetRoomBehavior*)cmd;
-
- writer->Write((uint8_t)cmdRoom->gameplayFlags); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(cmdRoom->gameplayFlags2); // 0x04
- }
- break;
- case RoomCommand::SetCsCamera:
- {
- SetCsCamera* cmdCsCam = (SetCsCamera*)cmd;
-
- writer->Write((uint8_t)cmdCsCam->cameras.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdCsCam->segmentOffset); // 0x04
- }
- break;
- case RoomCommand::SetMesh:
- {
- SetMesh* cmdMesh = (SetMesh*)cmd;
-
- int baseStreamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)cmdMesh->data); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- // TODO: NOT DONE
-
- writer->Write(cmdMesh->meshHeaderType);
-
- if (cmdMesh->meshHeaderType == 0)
- {
- // writer->Write(cmdMesh->)
- }
- else if (cmdMesh->meshHeaderType == 1)
- {
- }
- else if (cmdMesh->meshHeaderType == 2)
- {
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetCameraSettings:
- {
- SetCameraSettings* cmdCam = (SetCameraSettings*)cmd;
-
- writer->Write((uint8_t)cmdCam->cameraMovement); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(cmdCam->mapHighlight); // 0x04
- }
- break;
- case RoomCommand::SetLightingSettings:
- {
- SetLightingSettings* cmdLight = (SetLightingSettings*)cmd;
-
- writer->Write((uint8_t)cmdLight->settings.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(cmdLight->segmentOffset); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(cmdLight->segmentOffset, SeekOffsetType::Start);
-
- for (LightingSettings setting : cmdLight->settings)
- {
- writer->Write(setting.ambientClrR);
- writer->Write(setting.ambientClrG);
- writer->Write(setting.ambientClrB);
-
- writer->Write(setting.diffuseClrA_R);
- writer->Write(setting.diffuseClrA_G);
- writer->Write(setting.diffuseClrA_B);
-
- writer->Write(setting.diffuseDirA_X);
- writer->Write(setting.diffuseDirA_Y);
- writer->Write(setting.diffuseDirA_Z);
-
- writer->Write(setting.diffuseClrB_R);
- writer->Write(setting.diffuseClrB_G);
- writer->Write(setting.diffuseClrB_B);
-
- writer->Write(setting.diffuseDirB_X);
- writer->Write(setting.diffuseDirB_Y);
- writer->Write(setting.diffuseDirB_Z);
-
- writer->Write(setting.fogClrR);
- writer->Write(setting.fogClrG);
- writer->Write(setting.fogClrB);
-
- writer->Write(setting.unk);
- writer->Write(setting.drawDistance);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetRoomList:
- {
- SetRoomList* cmdRoom = (SetRoomList*)cmd;
-
- writer->Write((uint8_t)cmdRoom->romfile->rooms.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- auto baseStreamEnd = writer->GetLength();
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- for (const auto& entry : cmdRoom->romfile->rooms)
- {
- writer->Write(entry.virtualAddressStart);
- writer->Write(entry.virtualAddressEnd);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetCollisionHeader:
- {
- SetCollisionHeader* cmdCollHeader = (SetCollisionHeader*)cmd;
-
- int streamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(streamEnd); // 0x04
-
- // TODO: NOT DONE
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(streamEnd, SeekOffsetType::Start);
-
- ExporterExample_Collision colExp = ExporterExample_Collision();
-
- colExp.Save(cmdCollHeader->collisionHeader, outPath, writer);
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetEntranceList:
- {
- SetEntranceList* cmdEntrance = (SetEntranceList*)cmd;
-
- uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- for (Spawn entry : cmdEntrance->entrances)
- {
- writer->Write((uint8_t)entry.startPositionIndex);
- writer->Write((uint8_t)entry.roomToLoad);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetSpecialObjects:
- {
- SetSpecialObjects* cmdSpecObj = (SetSpecialObjects*)cmd;
-
- writer->Write((uint8_t)cmdSpecObj->elfMessage); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint16_t)cmdSpecObj->globalObject); // 0x06
- }
- break;
- case RoomCommand::SetStartPositionList:
- {
- SetStartPositionList* cmdStartPos = (SetStartPositionList*)cmd;
-
- uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)cmdStartPos->actors.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- for (ActorSpawnEntry entry : cmdStartPos->actors)
- {
- writer->Write(entry.actorNum);
- writer->Write(entry.posX);
- writer->Write(entry.posY);
- writer->Write(entry.posZ);
- writer->Write(entry.rotX);
- writer->Write(entry.rotY);
- writer->Write(entry.rotZ);
- writer->Write(entry.params);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::EndMarker:
- {
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)0); // 0x07
- }
- break;
- default:
- printf("UNIMPLEMENTED COMMAND: %i\n", (int)cmd->cmdID);
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)0); // 0x07
-
- break;
- }
- }
-
- // writer->Close();
- // File::WriteAllBytes(StringHelper::Sprintf("%s", res->GetName().c_str()),
- // memStream->ToVector());
-}
diff --git a/tools/ZAPD/ExporterTest/RoomExporter.h b/tools/ZAPD/ExporterTest/RoomExporter.h
deleted file mode 100644
index ee531dc87b..0000000000
--- a/tools/ZAPD/ExporterTest/RoomExporter.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include "ZResource.h"
-#include "ZRoom/ZRoom.h"
-
-class ExporterExample_Room : public ZResourceExporter
-{
-public:
- void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/TextureExporter.cpp b/tools/ZAPD/ExporterTest/TextureExporter.cpp
deleted file mode 100644
index 6488bed3a2..0000000000
--- a/tools/ZAPD/ExporterTest/TextureExporter.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "TextureExporter.h"
-#include "../ZAPD/ZFile.h"
-
-void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]] fs::path outPath,
- BinaryWriter* writer)
-{
- ZTexture* tex = (ZTexture*)res;
-
- auto data = tex->parent->GetRawData();
-
- for (offset_t i = tex->GetRawDataIndex(); i < tex->GetRawDataIndex() + tex->GetRawDataSize();
- i++)
- writer->Write(data[i]);
-}
diff --git a/tools/ZAPD/ExporterTest/TextureExporter.h b/tools/ZAPD/ExporterTest/TextureExporter.h
deleted file mode 100644
index 41c4e79be2..0000000000
--- a/tools/ZAPD/ExporterTest/TextureExporter.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#pragma once
-
-#include "Utils/BinaryWriter.h"
-#include "ZResource.h"
-#include "ZTexture.h"
-
-class ExporterExample_Texture : public ZResourceExporter
-{
-public:
- void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/Jenkinsfile b/tools/ZAPD/Jenkinsfile
deleted file mode 100644
index 48535a51cf..0000000000
--- a/tools/ZAPD/Jenkinsfile
+++ /dev/null
@@ -1,106 +0,0 @@
-pipeline {
- agent {
- label 'ZAPD'
- }
-
- stages {
- // Non-parallel ZAPD stage
- stage('Build ZAPD') {
- steps {
- sh 'make -j WERROR=1'
- }
- }
-
- // CHECKOUT THE REPOS
- stage('Checkout Repos') {
- parallel {
- stage('Checkout oot') {
- steps {
- dir('oot') {
- git url: 'https://github.com/zeldaret/oot.git'
- }
- }
- }
-
- stage('Checkout mm') {
- steps{
- dir('mm') {
- git url: 'https://github.com/zeldaret/mm.git'
- }
- }
- }
- }
- }
-
- // SETUP THE REPOS
- stage('Set up repos') {
- parallel {
- stage('Setup OOT') {
- steps {
- dir('oot') {
- sh 'cp /usr/local/etc/roms/baserom_oot.z64 baserom_original.z64'
-
- // Identical to `make setup` except for copying our newer ZAPD.out into oot
- sh 'git submodule update --init --recursive'
- sh 'make -C tools'
- sh 'cp ../ZAPD.out tools/ZAPD/'
- sh 'python3 fixbaserom.py'
- sh 'python3 extract_baserom.py'
- sh 'python3 extract_assets.py'
- }
- }
- }
-
- stage('Setup MM') {
- steps {
- dir('mm') {
- sh 'cp /usr/local/etc/roms/mm.us.rev1.z64 baserom.mm.us.rev1.z64'
-
- // Identical to `make setup` except for copying our newer ZAPD.out into mm
- sh 'make -C tools'
- sh 'cp ../ZAPD.out tools/ZAPD/'
- sh 'python3 tools/fixbaserom.py'
- sh 'python3 tools/extract_baserom.py'
- sh 'python3 extract_assets.py -j $(nproc)'
- }
- }
- }
- }
- }
-
- // INSTALL PYTHON DEPENDENCIES, currently MM only
- stage('Install Python dependencies') {
- steps {
- dir('mm') {
- sh 'python3 -m pip install -r requirements.txt'
- }
- }
- }
-
- // BUILD THE REPOS
- stage('Build repos') {
- parallel {
- stage('Build oot') {
- steps {
- dir('oot') {
- sh 'make -j'
- }
- }
- }
- stage('Build mm') {
- steps {
- dir('mm') {
- sh 'make -j disasm'
- sh 'make -j'
- }
- }
- }
- }
- }
- }
- post {
- always {
- cleanWs()
- }
- }
-}
diff --git a/tools/ZAPD/LICENSE b/tools/ZAPD/LICENSE
deleted file mode 100644
index 90b734bde8..0000000000
--- a/tools/ZAPD/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2020 Zelda Reverse Engineering Team
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/tools/ZAPD/Makefile b/tools/ZAPD/Makefile
deleted file mode 100644
index 36331937a7..0000000000
--- a/tools/ZAPD/Makefile
+++ /dev/null
@@ -1,151 +0,0 @@
-# use variables in submakes
-export
-OPTIMIZATION_ON ?= 1
-ASAN ?= 0
-DEPRECATION_ON ?= 1
-DEBUG ?= 0
-COPYCHECK_ARGS ?=
-LLD ?= 0
-WERROR ?= 0
-
-# On MacOS 10.14, use boost::filesystem, because
-# the system doesn't supply std::filesystem.
-ifneq ($(OS),Windows_NT)
- ifeq ($(shell uname -s),Darwin)
- MACOS_VERSION := $(shell sw_vers -productVersion | cut -d . -f 1,2)
- ifeq ($(MACOS_VERSION),10.14)
- USE_BOOST_FS ?= 1
- endif
- endif
-endif
-USE_BOOST_FS ?= 0
-
-# Use clang++ if available, else use g++
-ifeq ($(shell command -v clang++ >/dev/null 2>&1; echo $$?),0)
- CXX := clang++
-else
- CXX := g++
-endif
-
-INC := -I ZAPD -I lib/libgfxd -I lib/tinyxml2 -I ZAPDUtils
-CXXFLAGS := -fpic -std=c++17 -Wall -Wextra -fno-omit-frame-pointer
-OPTFLAGS :=
-
-ifneq ($(DEBUG),0)
- OPTIMIZATION_ON = 0
- CXXFLAGS += -g3 -DDEVELOPMENT -D_DEBUG
- COPYCHECK_ARGS += --devel
- DEPRECATION_ON = 0
-endif
-
-ifneq ($(WERROR),0)
- CXXFLAGS += -Werror
-endif
-
-ifeq ($(OPTIMIZATION_ON),0)
- OPTFLAGS := -O0
-else
- OPTFLAGS := -O2
-endif
-
-ifneq ($(ASAN),0)
- CXXFLAGS += -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined
-endif
-ifneq ($(DEPRECATION_ON),0)
- CXXFLAGS += -DDEPRECATION_ON
-endif
-# CXXFLAGS += -DTEXTURE_DEBUG
-
-LDFLAGS := -lm -ldl -lpng
-
-ifneq ($(USE_BOOST_FS),0)
- CXXFLAGS += -DUSE_BOOST_FS
- LDFLAGS += -lboost_filesystem
-endif
-
-# Use LLD if available. Set LLD=0 to not use it
-ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
- LLD := 1
-endif
-
-ifneq ($(LLD),0)
- LDFLAGS += -fuse-ld=lld
-endif
-
-UNAME := $(shell uname)
-UNAMEM := $(shell uname -m)
-ifneq ($(UNAME), Darwin)
- LDFLAGS += -Wl,-export-dynamic -lstdc++fs
- EXPORTERS := -Wl,--whole-archive ExporterTest/ExporterTest.a -Wl,--no-whole-archive
-else
- EXPORTERS := -Wl,-force_load ExporterTest/ExporterTest.a
- ifeq ($(UNAMEM),arm64)
- ifeq ($(shell brew list libpng > /dev/null 2>&1; echo $$?),0)
- LDFLAGS += -L $(shell brew --prefix)/lib
- INC += -I $(shell brew --prefix)/include
- else
- $(error Please install libpng via Homebrew)
- endif
- endif
-endif
-
-
-ZAPD_SRC_DIRS := $(shell find ZAPD -type d)
-SRC_DIRS = $(ZAPD_SRC_DIRS) lib/tinyxml2
-
-ZAPD_CPP_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.cpp))
-ZAPD_H_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.h))
-
-CPP_FILES += $(ZAPD_CPP_FILES) lib/tinyxml2/tinyxml2.cpp
-O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
-O_FILES += build/ZAPD/BuildInfo.o
-
-# create build directories
-$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
-
-
-# Main targets
-all: ZAPD.out copycheck
-
-build/ZAPD/BuildInfo.o:
- python3 ZAPD/genbuildinfo.py $(COPYCHECK_ARGS)
- $(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) build/ZAPD/BuildInfo.cpp
-
-copycheck: ZAPD.out
- python3 copycheck.py
-
-clean:
- rm -rf build ZAPD.out
- $(MAKE) -C lib/libgfxd clean
- $(MAKE) -C ZAPDUtils clean
- $(MAKE) -C ExporterTest clean
-
-rebuild: clean all
-
-format:
- clang-format-14 -i $(ZAPD_CPP_FILES) $(ZAPD_H_FILES)
- $(MAKE) -C ZAPDUtils format
- $(MAKE) -C ExporterTest format
-
-.PHONY: all build/ZAPD/BuildInfo.o copycheck clean rebuild format
-
-build/%.o: %.cpp
- $(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) $<
-
-
-# Submakes
-lib/libgfxd/libgfxd.a:
- $(MAKE) -C lib/libgfxd
-
-.PHONY: ExporterTest
-ExporterTest:
- $(MAKE) -C ExporterTest
-
-.PHONY: ZAPDUtils
-ZAPDUtils:
- $(MAKE) -C ZAPDUtils
-
-
-# Linking
-ZAPD.out: $(O_FILES) lib/libgfxd/libgfxd.a ExporterTest ZAPDUtils
- $(CXX) $(CXXFLAGS) $(O_FILES) lib/libgfxd/libgfxd.a ZAPDUtils/ZAPDUtils.a $(EXPORTERS) $(LDFLAGS) $(OUTPUT_OPTION)
diff --git a/tools/ZAPD/README.md b/tools/ZAPD/README.md
deleted file mode 100644
index 5006f8d4b5..0000000000
--- a/tools/ZAPD/README.md
+++ /dev/null
@@ -1,174 +0,0 @@
-# ZAPD: Zelda Asset Processor for Decomp
-
-## Compiling
-
-### Dependencies
-
-ZAPD needs a compiler with C++17 support.
-
-ZAPD has the following library dependencies:
-
-- `libpng`
-
-In a Debian/Ubuntu based environment, those could be installed with the following command:
-
-```bash
-sudo apt install libpng-dev
-```
-
-On a Mac, you will need to install libpng with Homebrew or MacPorts; we currently only support Homebrew. You can run
-
-```bash
-brew install libpng
-```
-
-to install it via Homebrew.
-
-### Building
-
-#### Linux / *nix
-
-ZAPD uses the classic `Makefile` approach. To build just run `make` (or even better `make -j` for faster compilations).
-
-You can configure a bit your ZAPD build with the following options:
-
-- `OPTIMIZATION_ON`: If set to `0` optimizations will be disabled (compile with `-O0`). Any other value compiles with `-O2`. Defaults to `1`.
-- `ASAN`: If it is set to a non-zero then ZAPD will be compiled with Address Sanitizer enabled (`-fsanitize=address`). Defaults to `0`.
-- `DEPRECATION_ON`: If it is set to a zero then deprecation warnings will be disabled. Defaults to `1`.
-- `DEBUG`: If non-zero, ZAPD will be compiled in _development mode_. This implies the following:
- - Debugging symbols enabled (`-g3`). They are disabled by default.
- - `OPTIMIZATION_ON=0`: Disables optimizations (`-O0`).
- - `DEPRECATION_ON=0`: Disables deprecation warnings.
-- `LLD=1`: builds with the LLVM linker `ld.lld` instead of the system default.
-
-As an example, if you want to build ZAPD with optimizations disabled and use the address sanitizer, you could use the following command:
-
-```bash
-make -j OPTIMIZATION_ON=0 ASAN=1
-```
-
-#### Windows
-
-This repository contains `vcxproj` files for compiling under Visual Studio environments. See `ZAPD/ZAPD.vcxproj`.
-
-## Invoking ZAPD
-
-ZAPD needs a _File parsing mode_ to be passed as first parameter. The options are:
-
-- `e`: "Extraction" mode.
- - In this mode, ZAPD expects a XML file as input, a folder as ouput and a path to the baserom files.
- - ZAPD will read the XML and use it as a guide to extract the contents of the specified asset file from the baserom folder.
- - For more info of the format of those XMLs, see the [ZAPD extraction XML reference](docs/zapd_extraction_xml_reference.md).
-- `bsf`: "Build source file" mode.
- - This is an experimental mode.
- - It was going to be used to let you have XMLs that aren't just for extraction. Might get used, might not. Still need to experiment on that.
-- `btex`: "Build texture" mode.
- - In this mode, ZAPD expects a PNG file as input, a filename as ouput and a texture type parameter (`-tt`).
- - ZAPD will try to convert the given PNG into the contents of a `uint64_t` C array.
-- `bren`: "Build (render) background" mode.
- - In this mode, ZAPD expects a JPG file as input and a filename as ouput.
- - ZAPD will try to convert the given JPG into the contents of a `uint64_t` C array.
-- `blb`: "Build blob" mode.
- - In this mode, ZAPD expects a BIN file as input and a filename as ouput.
- - ZAPD will try to convert the given BIN into the contents of a `uint8_t` C array.
-
-ZAPD also accepts the following list of extra parameters:
-
-- `-i PATH` / `--inputpath PATH`: Set input path.
-- `-o PATH` / `--outputpath PATH`: Set output path.
-- `-b PATH` / `--baserompath`: Set baserom path.
- - Can be used only in `e` or `bsf` modes.
-- `-osf PATH`: Set source output path. This is the path where the `.c` and `.h` files will be extracted to. If omitted, it will use the value passed to `--outputpath` parameter.
-- `-gsf MODE`: Generate source file during extraction. If `MODE` is `1`, C source files will be generated.
- - Can be used only in `e` mode.
-- `-crc` / `--output-crc`: Outputs a CRC file for each extracted texture.
- - Can be used only in `e` or `bsf` modes.
-- `-ulzdl MODE`: Use "Legacy ZDisplayList" instead of `libgfxd`. Set `MODE` to `1` to enable it.
- - Can be used only in `e` or `bsf` modes.
-- `-profile MODE`: Enable profiling. Set `MODE` to `1` to enable it.
-- `-uer MODE`: Split resources into their individual components (enabled by default). Set `MODE` to non-`1` to disable it.
-- `-tt TYPE`: Set texture type.
- - Can be used only in mode `btex`.
- - Valid values:
- - `rgba32`
- - `rgb5a1`
- - `i4`
- - `i8`
- - `ia4`
- - `ia8`
- - `ia16`
- - `ci4`
- - `ci8`
-- `-rconf PATH` Read Config File.
-- `-eh`: Enable error handler.
- - Only available in non-Windows environments.
-- `-v MODE`: Enable verbosity. Currently there are 3 possible values:
- - `0`: Default. Completely silent (except for warnings and errors).
- - `1`: Information.
- - `2` (and higher): Debug.
-- `-wu` / `--warn-unaccounted`: Enable warnings for each unaccounted block of data found.
- - Can be used only in `e` or `bsf` modes.
-- `-vu` / `--verbose-unaccounted`: Changes how unaccounteds are outputted. Max 4 bytes per line (a word) and add a comment with the offset of each of those lines.
- - Could be useful for looking at raw data or testing.
- - Can be used only in `e` or `bsf` modes.
-- `-tm MODE`: Test Mode (enables certain experimental features). To enable it, set `MODE` to `1`.
-- `-se` / `--set-exporter` : Sets which exporter to use.
-- `--gcc-compat` : Enables GCC compatibly mode. Slower.
-- `-us` / `--unaccounted-static` : Mark unaccounted data as `static`
-- `-s` / `--static` : Mark every asset as `static`.
- - This behaviour can be overridden per asset using `Static=` in the respective XML node.
-- `--cs-float` : How cutscene floats should be extracted.
-- Valid values:
- - `hex`: `0x42280000`
- - `float`: `42.0f`
- - `both`: `CS_FLOAT(0x42280000, 42.0f)`
- - `hex-commented-left`: `/* 42.0f */ 0x42280000`
- - `hex-commented-right`: `0x42280000 /* 42.0f */`
-- `--base-address ADDRESS`: Override base virtual address for input files.
-- `--start-offset OFFSET`: Override start offset for input files.
-- `--end-offset OFFSET`: Override end offset for input files.
-- `-W...`: warning flags, see below
-
-Additionally, you can pass the flag `--version` to see the current ZAPD version. If that flag is passed, ZAPD will ignore any other parameter passed.
-
-### Warning flags
-
-ZAPD contains a variety of warning types, with similar syntax to GCC or Clang's compiler warnings. Warnings can have three levels:
-
-- Off (does not display anything)
-- Warn (print a warning but continue processing)
-- Err (behave like an error, i.e. print and throw an exception to crash ZAPD when occurs)
-
-Each warning type uses one of these by default, but can be modified with flags, similarly to GCC or Clang:
-
-- `-Wfoo` enables warnings of type `foo`
-- `-Wno-foo` disables warnings of type `foo`
-- `-Werror=foo` escalates `foo` to behave like an error
-- `-Weverything` enables all warnings (they may be turned off using `-Wno-` flags afterwards)
-- `-Werror` escalates all enabled warnings to errors
-
-All warning types currently implemented, with their default levels:
-
-| Warning type | Default level | Description |
-| ----------------------------- | ------------- | ------------------------------------------------------------------------ |
-| `-Wdeprecated` | Warn | Deprecated features |
-| `-Whardcoded-generic-pointer` | Off | A generic segmented pointer must be produced |
-| `-Whardcoded-pointer` | Warn | ZAPD lacks the info to make a symbol, so must output a hardcoded pointer |
-| `-Wintersection` | Warn | Two assets intersect |
-| `-Winvalid-attribute-value` | Err | Attribute declared in XML is wrong |
-| `-Winvalid-extracted-data` | Err | Extracted data does not have correct form |
-| `-Winvalid-jpeg` | Err | JPEG file does not conform to the game's format requirements |
-| `-Winvalid-png` | Err | Issues arising when processing PNG data |
-| `-Winvalid-xml` | Err | XML has syntax errors |
-| `-Wmissing-attribute` | Warn | Required attribute missing in XML tag |
-| `-Wmissing-offsets` | Warn | Offset attribute missing in XML tag |
-| `-Wmissing-segment` | Warn | Segment not given in File tag in XML |
-| `-Wnot-implemented` | Warn | ZAPD does not currently support this feature |
-| `-Wunaccounted` | Off | Large blocks of unaccounted |
-| `-Wunknown-attribute` | Warn | Unknown attribute in XML entry tag |
-
-There are also errors that do not have a type, and cannot be disabled.
-
-For example, here we have invoked ZAPD in the usual way to extract using a (rather badly-written) XML, but escalating `-Wintersection` to an error:
-
-
diff --git a/tools/ZAPD/ZAPD.sln b/tools/ZAPD/ZAPD.sln
deleted file mode 100644
index 82538dd9f4..0000000000
--- a/tools/ZAPD/ZAPD.sln
+++ /dev/null
@@ -1,82 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30320.27
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPD", "ZAPD\ZAPD.vcxproj", "{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExporterExample", "ExporterTest\ExporterTest.vcxproj", "{65608EB0-1A47-45AD-AB66-192FB64C762C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPDUtils", "ZAPDUtils\ZAPDUtils.vcxproj", "{A2E01C3E-D647-45D1-9788-043DEBC1A908}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- MinSizeRel|x64 = MinSizeRel|x64
- MinSizeRel|x86 = MinSizeRel|x86
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- RelWithDebInfo|x64 = RelWithDebInfo|x64
- RelWithDebInfo|x86 = RelWithDebInfo|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.ActiveCfg = Debug|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.Build.0 = Debug|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.ActiveCfg = Debug|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.Build.0 = Debug|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x64.ActiveCfg = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x64.Build.0 = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x86.ActiveCfg = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x86.Build.0 = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.ActiveCfg = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.Build.0 = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.ActiveCfg = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.Build.0 = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x64.ActiveCfg = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x64.Build.0 = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.Build.0 = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.ActiveCfg = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.Build.0 = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.ActiveCfg = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.Build.0 = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.ActiveCfg = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.Build.0 = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.ActiveCfg = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.Build.0 = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.ActiveCfg = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.Build.0 = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.ActiveCfg = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.Build.0 = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.ActiveCfg = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.Build.0 = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.Build.0 = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.ActiveCfg = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.Build.0 = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.ActiveCfg = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.Build.0 = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.ActiveCfg = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.Build.0 = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.ActiveCfg = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.Build.0 = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.ActiveCfg = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.Build.0 = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.ActiveCfg = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.Build.0 = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.ActiveCfg = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.Build.0 = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {C2E1CC72-7A50-3249-AFD5-DFF6FE25CDCA}
- EndGlobalSection
- GlobalSection(Performance) = preSolution
- HasPerformanceSessions = true
- EndGlobalSection
-EndGlobal
diff --git a/tools/ZAPD/ZAPD/CRC32.h b/tools/ZAPD/ZAPD/CRC32.h
deleted file mode 100644
index 1f82c75c58..0000000000
--- a/tools/ZAPD/ZAPD/CRC32.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-
-static uint32_t CRC32B(const unsigned char* message, int32_t size)
-{
- int32_t byte, crc;
- int32_t mask;
-
- crc = 0xFFFFFFFF;
-
- for (int32_t i = 0; i < size; i++)
- {
- byte = message[i];
- crc = crc ^ byte;
-
- for (int32_t j = 7; j >= 0; j--)
- {
- mask = -(crc & 1);
- crc = (crc >> 1) ^ (0xEDB88320 & mask);
- }
- }
-
- return ~(uint32_t)(crc);
-}
\ No newline at end of file
diff --git a/tools/ZAPD/ZAPD/CrashHandler.cpp b/tools/ZAPD/ZAPD/CrashHandler.cpp
deleted file mode 100644
index 7ddec5a7e8..0000000000
--- a/tools/ZAPD/ZAPD/CrashHandler.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-#include "CrashHandler.h"
-#include "Utils/StringHelper.h"
-
-#if __has_include()
-#define HAS_POSIX 1
-#else
-#define HAS_POSIX 0
-#endif
-
-#include
-#include
-#include
-#include
-#include
-
-#if HAS_POSIX == 1
-#include
-#include // for __cxa_demangle
-#include // for dladdr
-#include
-#include
-#elif defined(_MSC_VER)
-#include
-#include
-
-#include
-
-#pragma comment(lib, "Dbghelp.lib")
-#endif
-
-// Feel free to add more crash messages.
-static std::array crashEasterEgg = {
- "\tYou've met with a terrible fate, haven't you?",
- "\tSEA BEARS FOAM. SLEEP BEARS DREAMS. \n\tBOTH END IN THE SAME WAY: CRASSSH!",
- "\tZAPD has fallen and cannot get up.",
- "\tIT'S A SECRET TO EVERYBODY. \n\tBut it shouldn't be, you'd better ask about it!",
- "\tI AM ERROR.",
- "\tGRUMBLE,GRUMBLE...",
- "\tDODONGO DISLIKES SMOKE \n\tAnd ZAPD dislikes whatever you fed it.",
- "\tMay the way of the Hero lead \n\tto the debugger.",
- "\tTHE WIND FISH SLUMBERS LONG... \n\tTHE HERO'S LIFE GONE... ",
- "\tSEA BEARS FOAM, SLEEP BEARS DREAMS. \n\tBOTH END IN THE SAME WAY CRASSSH!",
- "\tYou've met with a terrible fate, haven't you?",
- "\tMaster, I calculate a 100% probability that ZAPD has crashed. \n\tAdditionally, the "
- "batteries in your Wii Remote are nearly depleted.",
- "\t CONGRATURATIONS! \n"
- "\tAll Pages are displayed.\n"
- "\t THANK YOU! \n"
- "\t You are great debugger!",
- "\tRCP is HUNG UP!!\n"
- "\tOh! MY GOD!!",
-};
-
-#if HAS_POSIX == 1
-void ErrorHandler(int sig)
-{
- std::array arr;
- constexpr size_t nMaxFrames = arr.size();
- size_t size = backtrace(arr.data(), nMaxFrames);
- char** symbols = backtrace_symbols(arr.data(), nMaxFrames);
-
- fprintf(stderr, "\nZAPD crashed. (Signal: %i)\n", sig);
-
- srand(time(nullptr));
- auto easterIndex = rand() % crashEasterEgg.size();
-
- fprintf(stderr, "\n%s\n\n", crashEasterEgg[easterIndex]);
-
- fprintf(stderr, "Traceback:\n");
- for (size_t i = 1; i < size; i++)
- {
- Dl_info info;
- uint32_t gotAddress = dladdr(arr[i], &info);
- std::string functionName(symbols[i]);
-
- if (gotAddress != 0 && info.dli_sname != nullptr)
- {
- int32_t status;
- char* demangled = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, &status);
- const char* nameFound = info.dli_sname;
-
- if (status == 0)
- {
- nameFound = demangled;
- }
-
- functionName = StringHelper::Sprintf("%s (+0x%X)", nameFound,
- (char*)arr[i] - (char*)info.dli_saddr);
- free(demangled);
- }
-
- fprintf(stderr, "%-3zd %s\n", i, functionName.c_str());
- }
-
- fprintf(stderr, "\n");
-
- free(symbols);
- exit(1);
-}
-#elif defined(_MSC_VER)
-
-void printStack(CONTEXT* ctx)
-{
- BOOL result;
- HANDLE process;
- HANDLE thread;
- HMODULE hModule;
- ULONG frame;
- DWORD64 displacement;
- DWORD disp;
-
- srand(time(nullptr));
- auto easterIndex = rand() % crashEasterEgg.size();
-
- fprintf(stderr, "\n%s\n\n", crashEasterEgg[easterIndex]);
-
-#if defined(_M_AMD64)
- STACKFRAME64 stack;
- memset(&stack, 0, sizeof(STACKFRAME64));
-#else
- STACKFRAME stack;
- memset(&stack, 0, sizeof(STACKFRAME));
-#endif
-
- char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME + sizeof(TCHAR)];
- char module[512];
-
- PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
-
- CONTEXT ctx2;
- memcpy(&ctx2, ctx, sizeof(CONTEXT));
-
- process = GetCurrentProcess();
- thread = GetCurrentThread();
- SymInitialize(process, nullptr, TRUE);
-
- constexpr DWORD machineType =
-#if defined(_M_AMD64)
- IMAGE_FILE_MACHINE_AMD64;
-#else
- IMAGE_FILE_MACHINE_I386;
-#endif
-
- displacement = 0;
-
- for (frame = 0;; frame++)
- {
- result = StackWalk(machineType, process, thread, &stack, &ctx2, nullptr,
- SymFunctionTableAccess, SymGetModuleBase, nullptr);
- if (!result)
- {
- break;
- }
- symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
- symbol->MaxNameLen = MAX_SYM_NAME;
- SymFromAddr(process, (ULONG64)stack.AddrPC.Offset, &displacement, symbol);
-#if defined(_M_AMD64)
- IMAGEHLP_LINE64 line;
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
-#else
- IMAGEHLP_LINE line;
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE);
-#endif
- if (SymGetLineFromAddr(process, stack.AddrPC.Offset, &disp, &line))
- {
- fprintf(stderr, "%u\t %s in %s: line: %lu: \n", frame, symbol->Name, line.FileName,
- line.LineNumber);
- }
-
- else
- {
- fprintf(stderr, "%u\tat % s\n", frame, symbol->Name);
- hModule = nullptr;
- GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
- GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
- (LPCTSTR)(stack.AddrPC.Offset), &hModule);
-
- if (hModule != nullptr)
- {
- GetModuleFileNameA(hModule, module, 512 - 1);
- }
- fprintf(stderr, "%u\tIn %s\n", frame, module);
- }
- }
-}
-
-LONG seh_filter(_EXCEPTION_POINTERS* ex)
-{
- fprintf(stderr, "EXCEPTION 0x%x occured\n", ex->ExceptionRecord->ExceptionCode);
- printStack(ex->ContextRecord);
- return EXCEPTION_EXECUTE_HANDLER;
-}
-#endif
-
-void CrashHandler_Init()
-{
-#if HAS_POSIX == 1
- signal(SIGSEGV, ErrorHandler);
- signal(SIGABRT, ErrorHandler);
-#elif defined(_MSC_VER)
- SetUnhandledExceptionFilter(seh_filter);
-#else
- HANDLE_WARNING(WarningType::Always,
- "tried to set error handler, but this ZAPD build lacks support for one", "");
-#endif
-}
diff --git a/tools/ZAPD/ZAPD/CrashHandler.h b/tools/ZAPD/ZAPD/CrashHandler.h
deleted file mode 100644
index 102778bec1..0000000000
--- a/tools/ZAPD/ZAPD/CrashHandler.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CRASH_HANDLER_H
-#define CRASH_HANDLER_H
-
-void CrashHandler_Init();
-
-#endif
diff --git a/tools/ZAPD/ZAPD/Declaration.cpp b/tools/ZAPD/ZAPD/Declaration.cpp
deleted file mode 100644
index 30863803a2..0000000000
--- a/tools/ZAPD/ZAPD/Declaration.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-#include "Declaration.h"
-
-#include "Globals.h"
-#include "Utils/StringHelper.h"
-
-Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
- const std::string& nBody)
-{
- address = nAddress;
- alignment = nAlignment;
- size = nSize;
- declBody = nBody;
-}
-
-Declaration* Declaration::Create(offset_t declAddr, DeclarationAlignment declAlign, size_t declSize,
- const std::string& declType, const std::string& declName,
- const std::string& declBody)
-{
- Declaration* decl = new Declaration(declAddr, declAlign, declSize, declBody);
-
- decl->declType = declType;
- decl->declName = declName;
- decl->declBody = declBody;
-
- return decl;
-}
-
-Declaration* Declaration::CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- size_t declArrayItemCnt, bool isDeclExternal)
-{
- Declaration* decl = new Declaration(declAddr, declAlign, declSize, declBody);
-
- decl->declName = declName;
- decl->declType = declType;
- decl->arrayItemCnt = declArrayItemCnt;
- decl->isExternal = isDeclExternal;
- decl->isArray = true;
-
- return decl;
-}
-
-Declaration* Declaration::CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- const std::string& declArrayItemCntStr, bool isDeclExternal)
-{
- Declaration* decl = new Declaration(declAddr, declAlign, declSize, declBody);
-
- decl->declName = declName;
- decl->declType = declType;
- decl->arrayItemCntStr = declArrayItemCntStr;
- decl->isExternal = isDeclExternal;
- decl->isArray = true;
-
- return decl;
-}
-
-Declaration* Declaration::CreateInclude(offset_t declAddr, const std::string& includePath,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& defines)
-{
- Declaration* decl = new Declaration(declAddr, DeclarationAlignment::Align4, declSize, "");
- decl->includePath = includePath;
- decl->declType = declType;
- decl->declName = declName;
- decl->defines = defines;
-
- return decl;
-}
-
-Declaration* Declaration::CreatePlaceholder(offset_t declAddr, const std::string& declName)
-{
- Declaration* decl = new Declaration(declAddr, DeclarationAlignment::Align4, 0, "");
- decl->declName = declName;
- decl->isPlaceholder = true;
-
- return decl;
-}
-
-bool Declaration::IsStatic() const
-{
- switch (staticConf)
- {
- case StaticConfig::Off:
- return false;
-
- case StaticConfig::Global:
- return Globals::Instance->forceStatic;
-
- case StaticConfig::On:
- return true;
- }
-
- return false;
-}
-
-std::string Declaration::GetNormalDeclarationStr() const
-{
- std::string output;
-
- if (IsStatic())
- {
- output += "static ";
- }
-
- if (isArray)
- {
- bool includeArraySize = (IsStatic() || forceArrayCnt);
-
- if (includeArraySize)
- {
- if (arrayItemCntStr != "")
- output += StringHelper::Sprintf("%s %s[%s];\n", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- else
- output += StringHelper::Sprintf("%s %s[%i] = {\n", declType.c_str(),
- declName.c_str(), arrayItemCnt);
- }
- else
- {
- output += StringHelper::Sprintf("%s %s[] = {\n", declType.c_str(), declName.c_str());
- }
-
- output += declBody + "\n";
- }
- else
- {
- output += StringHelper::Sprintf("%s %s = { ", declType.c_str(), declName.c_str());
- output += declBody;
- }
-
- if (output.back() == '\n')
- output += "};";
- else
- output += " };";
-
- output += "\n";
-
- output += "\n";
-
- return output;
-}
-
-std::string Declaration::GetExternalDeclarationStr() const
-{
- std::string output;
-
- if (IsStatic())
- output += "static ";
-
- bool includeArraySize = (IsStatic() || forceArrayCnt);
-
- if (includeArraySize)
- {
- if (arrayItemCntStr != "")
- output += StringHelper::Sprintf("%s %s[%s] = ", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- else
- output += StringHelper::Sprintf("%s %s[%i] = ", declType.c_str(), declName.c_str(),
- arrayItemCnt);
- }
- else
- {
- output += StringHelper::Sprintf("%s %s[] = ", declType.c_str(), declName.c_str());
- }
-
- output += StringHelper::Sprintf("{\n#include \"%s\"\n};", includePath.c_str());
- output += "\n\n";
-
- return output;
-}
-
-std::string Declaration::GetExternStr() const
-{
- if (IsStatic() || declType == "" || isUnaccounted)
- {
- return "";
- }
-
- if (isArray)
- {
- if (arrayItemCntStr != "" && (IsStatic() || forceArrayCnt))
- {
- return StringHelper::Sprintf("extern %s %s[%s];\n", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- }
- else if (arrayItemCnt != 0 && (IsStatic() || forceArrayCnt))
- {
- return StringHelper::Sprintf("extern %s %s[%i];\n", declType.c_str(), declName.c_str(),
- arrayItemCnt);
- }
- else
- return StringHelper::Sprintf("extern %s %s[];\n", declType.c_str(), declName.c_str());
- }
-
- return StringHelper::Sprintf("extern %s %s;\n", declType.c_str(), declName.c_str());
-}
-
-std::string Declaration::GetDefinesStr() const
-{
- if (IsStatic() || (declType == ""))
- {
- return "";
- }
- return StringHelper::Sprintf("%s", defines.c_str());
-}
-
-std::string Declaration::GetStaticForwardDeclarationStr() const
-{
- if (!IsStatic() || isUnaccounted)
- return "";
-
- if (isArray)
- {
- if (arrayItemCntStr == "" && arrayItemCnt == 0)
- {
- // Forward declaring static arrays without specifying the size is not allowed.
- return "";
- }
-
- if (arrayItemCntStr != "")
- {
- return StringHelper::Sprintf("static %s %s[%s];\n", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- }
- else
- {
- return StringHelper::Sprintf("static %s %s[%i];\n", declType.c_str(), declName.c_str(),
- arrayItemCnt);
- }
- }
-
- return StringHelper::Sprintf("static %s %s;\n", declType.c_str(), declName.c_str());
-}
diff --git a/tools/ZAPD/ZAPD/Declaration.h b/tools/ZAPD/ZAPD/Declaration.h
deleted file mode 100644
index d079cb8dce..0000000000
--- a/tools/ZAPD/ZAPD/Declaration.h
+++ /dev/null
@@ -1,182 +0,0 @@
-#pragma once
-
-#include
-#include
-#include
-
-// TODO: should we drop the `_t` suffix because of UNIX compliance?
-typedef uint32_t segptr_t;
-typedef uint32_t offset_t;
-
-#define SEGMENTED_NULL ((segptr_t)0)
-
-enum class DeclarationAlignment
-{
- Align4,
- Align8
-};
-
-enum class StaticConfig
-{
- Off,
- Global,
- On
-};
-
-///
-/// A declaration is contains the C contents of a symbol for a file.
-/// It contains at a minimum the address where the symbol would be in the binary file, alignment
-/// settings, the size of the binary data, and the C code that makes it up. Optionally it can also
-/// contain comments.
-///
-class Declaration
-{
-public:
- // Where in the binary file (segment) will this C code end up being?
- offset_t address = 0;
-
- // How is this C code aligned?
- DeclarationAlignment alignment = DeclarationAlignment::Align4;
-
- // How many bytes will this C code take up in the resulting binary when compiled?
- size_t size = 0;
-
- // The C type of this declaration
- std::string declType = "";
-
- // The C variable name of this declaration
- std::string declName = "";
-
- // The body of the declaration containing the data.
- // In "int j = 7;", "7" would be text.
- std::string declBody = "";
-
- // #define's to be included in the header
- std::string defines = "";
-
- std::string includePath = "";
-
- // Is this declaration in an external file? (ie. a gameplay_keep reference being found in
- // another file that wishes to use its data)
- bool isExternal = false;
-
- bool isArray = false;
-
- // If true, will ensure that the arrays size is included in the declaration
- bool forceArrayCnt = false;
-
- // If this declaration is an array, how many items make it up?
- size_t arrayItemCnt = 0;
-
- // Overrides the brackets for the arrays size with a custom string
- std::string arrayItemCntStr = "";
-
- std::vector references;
-
- // If true, this declaration represents data inside the file which we do not understand it's
- // purpose for. It will be outputted as just a byte array.
- bool isUnaccounted = false;
-
- // Is this declaration a placeholder that will be replaced later?
- bool isPlaceholder = false;
-
- // Does this declaration come straight from the XML?
- // If false, this means that the declaration was created by ZAPD when it was parsing the
- // resources.
- bool declaredInXml = false;
-
- StaticConfig staticConf = StaticConfig::Global;
-
- ///
- /// Creates a regular declaration.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The alignment of this declaration in the compiled
- /// binary file. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. The contents of the C variable
- /// declaration.
- static Declaration* Create(offset_t declAddr, DeclarationAlignment declAlign, size_t declSize,
- const std::string& declType, const std::string& declName,
- const std::string& declBody);
-
- ///
- /// Creates an array declaration.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The alignment of this declaration in the compiled
- /// binary file. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. The contents of the C variable
- /// declaration. The number of items in the
- /// array. (Optional) Is this declaration from another
- /// segment?
- static Declaration* CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- size_t declArrayItemCnt = 0, bool isDeclExternal = false);
-
- ///
- /// Creates an array declaration who's size in the C code uses a custom string.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The alignment of this declaration in the compiled
- /// binary file. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. The contents of the C variable
- /// declaration. The string to be put in the C array's
- /// size inbetween the brackets. (Optional) Is this
- /// declaration from another segment?
- static Declaration* CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- const std::string& declArrayItemCntStr,
- bool isDeclExternal = false);
-
- ///
- /// Creates a declaration who's body uses a #include to include another file
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The path to the file this declaration will be
- /// #including. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. (Optional) Any #define's we want to have
- /// outputted by this declaration.
- static Declaration* CreateInclude(offset_t declAddr, const std::string& includePath,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& defines = "");
-
- ///
- /// Creates a placeholder declaration to be replaced later.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The C variable name this declaration will be
- /// declared as.
- static Declaration* CreatePlaceholder(offset_t declAddr, const std::string& declName);
-
- bool IsStatic() const;
-
- // Returns the declaration as C code as it would be in the code file when the body contains the
- // needed data
- std::string GetNormalDeclarationStr() const;
-
- // Returns the declaration as C code as it would be in the code file when the body #include's
- // another file
- std::string GetExternalDeclarationStr() const;
-
- // Generates the extern for this item to be placed in header files.
- std::string GetExternStr() const;
-
- // Generates any #define's needed
- std::string GetDefinesStr() const;
-
- std::string GetStaticForwardDeclarationStr() const;
-
-protected:
- Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
- const std::string& nBody);
-};
diff --git a/tools/ZAPD/ZAPD/ExporterSet.h b/tools/ZAPD/ZAPD/ExporterSet.h
deleted file mode 100644
index c4dd93445a..0000000000
--- a/tools/ZAPD/ZAPD/ExporterSet.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-typedef void (*ExporterSetFunc)(ZFile*);
-typedef bool (*ExporterSetFuncBool)(ZFileMode fileMode);
-typedef void (*ExporterSetFuncVoid)(int argc, char* argv[], int& i);
-typedef void (*ExporterSetFuncVoid2)(const std::string& buildMode, ZFileMode& fileMode);
-typedef void (*ExporterSetFuncVoid3)();
-typedef void (*ExporterSetResSave)(ZResource* res, BinaryWriter& writer);
-
-class ExporterSet
-{
-public:
- ~ExporterSet();
-
- std::map exporters;
- ExporterSetFuncVoid parseArgsFunc = nullptr;
- ExporterSetFuncVoid2 parseFileModeFunc = nullptr;
- ExporterSetFuncBool processFileModeFunc = nullptr;
- ExporterSetFunc beginFileFunc = nullptr;
- ExporterSetFunc endFileFunc = nullptr;
- ExporterSetFuncVoid3 beginXMLFunc = nullptr;
- ExporterSetFuncVoid3 endXMLFunc = nullptr;
- ExporterSetResSave resSaveFunc = nullptr;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/ZAPD/GameConfig.cpp b/tools/ZAPD/ZAPD/GameConfig.cpp
deleted file mode 100644
index 2140464ec6..0000000000
--- a/tools/ZAPD/ZAPD/GameConfig.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-#include "GameConfig.h"
-
-#include
-#include
-#include
-
-#include "Utils/Directory.h"
-#include "Utils/File.h"
-#include "Utils/Path.h"
-#include "ZFile.h"
-#include "tinyxml2.h"
-
-using ConfigFunc = void (GameConfig::*)(const tinyxml2::XMLElement&);
-
-GameConfig::~GameConfig()
-{
- for (auto& declPair : segmentRefFiles)
- {
- for (auto& file : declPair.second)
- {
- delete file;
- }
- }
-}
-
-void GameConfig::ReadTexturePool(const fs::path& texturePoolXmlPath)
-{
- tinyxml2::XMLDocument doc;
- tinyxml2::XMLError eResult = doc.LoadFile(texturePoolXmlPath.string().c_str());
-
- if (eResult != tinyxml2::XML_SUCCESS)
- {
- fprintf(stderr, "Warning: Unable to read texture pool XML with error code %i\n", eResult);
- return;
- }
-
- tinyxml2::XMLNode* root = doc.FirstChild();
-
- if (root == nullptr)
- return;
-
- for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != nullptr;
- child = child->NextSiblingElement())
- {
- if (std::string_view(child->Name()) == "Texture")
- {
- std::string crcStr = child->Attribute("CRC");
- fs::path texPath = child->Attribute("Path");
- std::string texName;
-
- uint32_t crc = strtoul(crcStr.c_str(), nullptr, 16);
-
- texturePool[crc].path = texPath;
- }
- }
-}
-
-void GameConfig::GenSymbolMap(const fs::path& symbolMapPath)
-{
- auto symbolLines = File::ReadAllLines(symbolMapPath);
-
- for (std::string& symbolLine : symbolLines)
- {
- auto split = StringHelper::Split(symbolLine, " ");
- uint32_t addr = strtoul(split[0].c_str(), nullptr, 16);
- std::string symbolName = split[1];
-
- symbolMap[addr] = std::move(symbolName);
- }
-}
-
-void GameConfig::ConfigFunc_SymbolMap(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- GenSymbolMap(Path::GetDirectoryName(configFilePath) / fileName);
-}
-
-void GameConfig::ConfigFunc_ActorList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- actorList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_ObjectList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- objectList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_EntranceList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- entranceList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_specialEntranceList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- specialEntranceList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_TexturePool(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- ReadTexturePool(Path::GetDirectoryName(configFilePath) / fileName);
-}
-
-void GameConfig::ConfigFunc_BGConfig(const tinyxml2::XMLElement& element)
-{
- bgScreenWidth = element.IntAttribute("ScreenWidth", 320);
- bgScreenHeight = element.IntAttribute("ScreenHeight", 240);
- useScreenWidthHeightConstants = element.BoolAttribute("UseScreenWidthHeightConstants", true);
-}
-
-void GameConfig::ConfigFunc_ExternalXMLFolder(const tinyxml2::XMLElement& element)
-{
- const char* pathValue = element.Attribute("Path");
- if (pathValue == nullptr)
- {
- throw std::runtime_error(
- StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t Missing 'Path' attribute in `ExternalXMLFolder` element.\n"));
- }
- if (externalXmlFolder != "")
- {
- throw std::runtime_error(StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t `ExternalXMLFolder` is duplicated.\n"));
- }
- externalXmlFolder = pathValue;
-}
-
-void GameConfig::ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element)
-{
- const char* xmlPathValue = element.Attribute("XmlPath");
- if (xmlPathValue == nullptr)
- {
- throw std::runtime_error(
- StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t Missing 'XmlPath' attribute in `ExternalFile` element.\n"));
- }
- const char* outPathValue = element.Attribute("OutPath");
- if (outPathValue == nullptr)
- {
- throw std::runtime_error(
- StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t Missing 'OutPath' attribute in `ExternalFile` element.\n"));
- }
-
- externalFiles.push_back(ExternalFile(fs::path(xmlPathValue), fs::path(outPathValue)));
-}
-
-void GameConfig::ConfigFunc_EnumData(const tinyxml2::XMLElement& element)
-{
- std::string path = Path::GetDirectoryName(configFilePath).string();
- path = path.append("/").append(element.Attribute("File"));
- tinyxml2::XMLDocument doc;
- tinyxml2::XMLError eResult = doc.LoadFile(path.c_str());
-
- if (eResult != tinyxml2::XML_SUCCESS)
- {
- throw std::runtime_error("Error: Unable to read enum data.");
- }
-
- tinyxml2::XMLNode* root = doc.FirstChild();
-
- if (root == nullptr)
- return;
-
- for (tinyxml2::XMLElement* csEnum = root->FirstChildElement(); csEnum != nullptr;
- csEnum = csEnum->NextSiblingElement())
- {
- for (tinyxml2::XMLElement* item = csEnum->FirstChildElement(); item != nullptr;
- item = item->NextSiblingElement())
- {
- std::string enumKey = csEnum->Attribute("Key");
- uint16_t itemIndex = atoi(item->Attribute("Index"));
- const char* itemID = item->Attribute("ID");
-
- // Common
- if (enumKey == "cmd")
- enumData.cutsceneCmd[itemIndex] = itemID;
-
- else if (enumKey == "miscType")
- enumData.miscType[itemIndex] = itemID;
-
- else if (enumKey == "textType")
- enumData.textType[itemIndex] = itemID;
-
- else if (enumKey == "fadeOutSeqPlayer")
- enumData.fadeOutSeqPlayer[itemIndex] = itemID;
-
- else if (enumKey == "transitionType")
- enumData.transitionType[itemIndex] = itemID;
-
- else if (enumKey == "destination")
- enumData.destination[itemIndex] = itemID;
-
- else if (enumKey == "naviQuestHintType")
- enumData.naviQuestHintType[itemIndex] = itemID;
-
- else if (enumKey == "ocarinaSongActionId")
- enumData.ocarinaSongActionId[itemIndex] = itemID;
-
- else if (enumKey == "seqId")
- enumData.seqId[itemIndex] = itemID;
-
- else if (enumKey == "playerCueId")
- enumData.playerCueId[itemIndex] = itemID;
-
- // MM
- else if (enumKey == "modifySeqType")
- enumData.modifySeqType[itemIndex] = itemID;
-
- else if (enumKey == "chooseCreditsSceneType")
- enumData.chooseCreditsSceneType[itemIndex] = itemID;
-
- else if (enumKey == "destinationType")
- enumData.destinationType[itemIndex] = itemID;
-
- else if (enumKey == "motionBlurType")
- enumData.motionBlurType[itemIndex] = itemID;
-
- else if (enumKey == "transitionGeneralType")
- enumData.transitionGeneralType[itemIndex] = itemID;
-
- else if (enumKey == "rumbleType")
- enumData.rumbleType[itemIndex] = itemID;
-
- else if (enumKey == "spawnFlag")
- enumData.spawnFlag[itemIndex] = itemID;
-
- else if (enumKey == "endSfx")
- enumData.endSfx[itemIndex] = itemID;
-
- else if (enumKey == "csSplineInterpType")
- enumData.interpType[itemIndex] = itemID;
-
- else if (enumKey == "csSplineRelTo")
- enumData.relTo[itemIndex] = itemID;
- }
- }
-}
-
-void GameConfig::ReadConfigFile(const fs::path& argConfigFilePath)
-{
- static const std::unordered_map ConfigFuncDictionary = {
- {"SymbolMap", &GameConfig::ConfigFunc_SymbolMap},
- {"ActorList", &GameConfig::ConfigFunc_ActorList},
- {"ObjectList", &GameConfig::ConfigFunc_ObjectList},
- {"EntranceList", &GameConfig::ConfigFunc_EntranceList},
- {"SpecialEntranceList", &GameConfig::ConfigFunc_specialEntranceList},
- {"TexturePool", &GameConfig::ConfigFunc_TexturePool},
- {"BGConfig", &GameConfig::ConfigFunc_BGConfig},
- {"EnumData", &GameConfig::ConfigFunc_EnumData},
- {"ExternalXMLFolder", &GameConfig::ConfigFunc_ExternalXMLFolder},
- {"ExternalFile", &GameConfig::ConfigFunc_ExternalFile},
- };
-
- configFilePath = argConfigFilePath.string();
- tinyxml2::XMLDocument doc;
- tinyxml2::XMLError eResult = doc.LoadFile(configFilePath.c_str());
-
- if (eResult != tinyxml2::XML_SUCCESS)
- {
- throw std::runtime_error("Error: Unable to read config file.");
- }
-
- tinyxml2::XMLNode* root = doc.FirstChild();
-
- if (root == nullptr)
- return;
-
- for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != nullptr;
- child = child->NextSiblingElement())
- {
- auto it = ConfigFuncDictionary.find(child->Name());
- if (it == ConfigFuncDictionary.end())
- {
- fprintf(stderr, "Unsupported configuration variable: %s\n", child->Name());
- continue;
- }
-
- std::invoke(it->second, *this, *child);
- }
-}
diff --git a/tools/ZAPD/ZAPD/GameConfig.h b/tools/ZAPD/ZAPD/GameConfig.h
deleted file mode 100644
index 4f3b91f8c7..0000000000
--- a/tools/ZAPD/ZAPD/GameConfig.h
+++ /dev/null
@@ -1,97 +0,0 @@
-#pragma once
-
-#include
-#include