diff --git a/Makefile b/Makefile index 35623679de..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! @@ -368,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 @@ -387,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 @@ -396,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 @@ -468,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)) @@ -502,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)) @@ -538,7 +536,7 @@ 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/lib/seqplayer.o: CPP_DEFINES += -DMML_VERSION=MML_VERSION_OOT +$(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 @@ -622,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) @@ -793,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) @@ -833,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 \ @@ -858,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) $< $@ @@ -870,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 @@ -879,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 $@ $< @@ -904,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 @@ -925,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 @@ -942,6 +946,8 @@ $(BUILD_DIR)/src/code/z_message_z_game_over.o: $(BUILD_DIR)/src/code/z_message.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 @@ -949,34 +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) $(PYTHON) tools/patch_data_with_rodata_mdebug.py $@ - @$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s) + $(OBJDUMP_CMD) ifeq ($(PLATFORM),IQUE) ifneq ($(NON_MATCHING),1) @@ -989,21 +979,25 @@ $(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 - $(N64TEXCONV) $(subst .,,$(suffix $*)) "$(findstring u32,$(subst .,,$(suffix $(basename $*))))" $< $@ $(@:.inc.c=.pal.inc.c) +# Assets from assets/ -$(BUILD_DIR)/assets/%.inc.c: $(EXTRACTED_DIR)/assets/%.png - $(N64TEXCONV) $(subst .,,$(suffix $*)) "$(findstring u32,$(subst .,,$(suffix $(basename $*))))" $< $@ $(@:.inc.c=.pal.inc.c) +$(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 $(BIN2C) -t 1 $< $@ -$(BUILD_DIR)/assets/%.bin.inc.c: $(EXTRACTED_DIR)/assets/%.bin - $(BIN2C) -t 1 $< $@ - $(BUILD_DIR)/assets/%.jpg.inc.c: assets/%.jpg $(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 $(N64TEXCONV) JFIF "" $< $@ @@ -1073,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 @@ -1098,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) @@ -1136,9 +1131,7 @@ $(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 $@ diff --git a/assets/audio/sequences/seq_0.prg.seq b/assets/audio/sequences/seq_0.prg.seq index 252711429c..b5f8a2906d 100644 --- a/assets/audio/sequences/seq_0.prg.seq +++ b/assets/audio/sequences/seq_0.prg.seq @@ -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 @@ -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 @@ -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 +/* 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 UNK_541C +/* 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 @@ -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 (ASEQ_OP_LAYER_NOTEDV | 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 @@ -14080,7 +14087,7 @@ CHAN_613E: // Reads the byte at (PTR + 0) into TR (the note) /* 0x6147 [0xB6 ] */ dyntblv // Store ASEQ_OP_LAYER_NOTEDV + TR into the pitch -/* 0x6148 [0xC7 0x40 0x61 0x2D ] */ stseq (ASEQ_OP_LAYER_NOTEDV | PITCH_A0), LAYER_612D + STSEQ_NOTEDV_OPCODE_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 (ASEQ_OP_LAYER_NOTEDV | 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 (ASEQ_OP_LAYER_NOTEDV | 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 (ASEQ_OP_LAYER_NOTEDV | 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 +/* 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 UNK_653B +/* 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 +/* 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 UNK_657B +/* 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/objects/object_link_boy/object_link_boy.c b/assets/objects/object_link_boy/object_link_boy.c new file mode 100644 index 0000000000..ea6fe8c9f2 --- /dev/null +++ b/assets/objects/object_link_boy/object_link_boy.c @@ -0,0 +1,1314 @@ +#include "object_link_boy.h" +#include "assets/objects/gameplay_keep/gameplay_keep.h" + +#include "array_count.h" +#include "gfx.h" +#include "player.h" + +// Eyes textures + +u64 gLinkAdultEyesOpenTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesOpenTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultEyesHalfTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesHalfTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultEyesClosedfTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesClosedfTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultEyesRightTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesRightTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultEyesLeftTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesLeftTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultEyesWideTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesWideTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultEyesDownTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesDownTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultEyesWincingTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEyesWincingTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +// Mouth textures + +u64 gLinkAdultMouthClosedTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultMouthClosedTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultMouthHalfTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultMouthHalfTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultMouthOpenTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultMouthOpenTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultMouthSmileTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultMouthSmileTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +// Textures + +#define gLinkAdultEarTex_WIDTH 16 +#define gLinkAdultEarTex_HEIGHT 16 +u64 gLinkAdultEarTex[TEX_LEN(u64, gLinkAdultEarTex_WIDTH, gLinkAdultEarTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultEarTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +#define gLinkAdultNoseTex_WIDTH 16 +#define gLinkAdultNoseTex_HEIGHT 16 +u64 gLinkAdultNoseTex[TEX_LEN(u64, gLinkAdultNoseTex_WIDTH, gLinkAdultNoseTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultNoseTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +#define gLinkAdultNose2Tex_WIDTH 16 +#define gLinkAdultNose2Tex_HEIGHT 16 +u64 gLinkAdultNose2Tex[TEX_LEN(u64, gLinkAdultNose2Tex_WIDTH, gLinkAdultNose2Tex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultNose2Tex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +#define gLinkAdultUnusedHandTex_WIDTH 16 +#define gLinkAdultUnusedHandTex_HEIGHT 16 +u64 gLinkAdultUnusedHandTex[TEX_LEN(u64, gLinkAdultUnusedHandTex_WIDTH, gLinkAdultUnusedHandTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedHandTex.ci8.tlut_gLinkAdultHeadTLUT.inc.c" +}; + +u64 gLinkAdultTLUT1[] = { +#include "assets/objects/object_link_boy/gLinkAdultBootFarTex.tlut.rgba16.inc.c" +}; + +#define gLinkAdultBootFarTex_WIDTH 16 +#define gLinkAdultBootFarTex_HEIGHT 32 +u64 gLinkAdultBootFarTex[TEX_LEN(u64, gLinkAdultBootFarTex_WIDTH, gLinkAdultBootFarTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultBootFarTex.ci8.inc.c" +}; + +u64 gLinkAdultTLUT2[] = { +#include "assets/objects/object_link_boy/gLinkAdultTLUT2.tlut.rgba16.inc.c" +}; + +u64 gLinkAdultTLUT3[] = { +#include "assets/objects/object_link_boy/gLinkAdultTLUT3.tlut.rgba16.inc.c" +}; + +u8 gLinkAdult_5AB0_Blob[] = { +#include "assets/objects/object_link_boy/gLinkAdult_5AB0_Blob.bin.inc.c" +}; + +u64 gLinkAdultHeadTLUT[] = { +#include "assets/objects/object_link_boy/gLinkAdultHeadTLUT.tlut.rgba16.inc.c" +}; + +u64 gLinkAdultTlut_005E00[] = { +#include "assets/objects/object_link_boy/gLinkAdultTlut_005E00.tlut.rgba16.inc.c" +}; + +#define gLinkAdultBootTex_WIDTH 16 +#define gLinkAdultBootTex_HEIGHT 16 +u64 gLinkAdultBootTex[TEX_LEN(u64, gLinkAdultBootTex_WIDTH, gLinkAdultBootTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultBootTex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultLegTex_WIDTH 16 +#define gLinkAdultLegTex_HEIGHT 32 +u64 gLinkAdultLegTex[TEX_LEN(u64, gLinkAdultLegTex_WIDTH, gLinkAdultLegTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultLegTex.ci8.tlut_gLinkAdultTLUT3.inc.c" +}; + +#define gLinkAdultBoot2Tex_WIDTH 16 +#define gLinkAdultBoot2Tex_HEIGHT 32 +u64 gLinkAdultBoot2Tex[TEX_LEN(u64, gLinkAdultBoot2Tex_WIDTH, gLinkAdultBoot2Tex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultBoot2Tex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultBootBuckleTex_WIDTH 32 +#define gLinkAdultBootBuckleTex_HEIGHT 16 +u64 gLinkAdultBootBuckleTex[TEX_LEN(u64, gLinkAdultBootBuckleTex_WIDTH, gLinkAdultBootBuckleTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultBootBuckleTex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultSkirtAndHatTex_WIDTH 32 +#define gLinkAdultSkirtAndHatTex_HEIGHT 32 +u64 gLinkAdultSkirtAndHatTex[TEX_LEN(u64, gLinkAdultSkirtAndHatTex_WIDTH, gLinkAdultSkirtAndHatTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultSkirtAndHatTex.rgba16.inc.c" +}; + +#define gLinkAdultBeltTex_WIDTH 8 +#define gLinkAdultBeltTex_HEIGHT 16 +u64 gLinkAdultBeltTex[TEX_LEN(u64, gLinkAdultBeltTex_WIDTH, gLinkAdultBeltTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultBeltTex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultBeltClaspTex_WIDTH 32 +#define gLinkAdultBeltClaspTex_HEIGHT 16 +u64 gLinkAdultBeltClaspTex[TEX_LEN(u64, gLinkAdultBeltClaspTex_WIDTH, gLinkAdultBeltClaspTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultBeltClaspTex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultEarringTex_WIDTH 32 +#define gLinkAdultEarringTex_HEIGHT 32 +u64 gLinkAdultEarringTex[TEX_LEN(u64, gLinkAdultEarringTex_WIDTH, gLinkAdultEarringTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultEarringTex.ia16.inc.c" +}; + +#define gLinkAdultNeckTex_WIDTH 16 +#define gLinkAdultNeckTex_HEIGHT 32 +u64 gLinkAdultNeckTex[TEX_LEN(u64, gLinkAdultNeckTex_WIDTH, gLinkAdultNeckTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultNeckTex.ci8.tlut_gLinkAdultTLUT3.inc.c" +}; + +#define gLinkAdultUnusedGauntlet1Tex_WIDTH 16 +#define gLinkAdultUnusedGauntlet1Tex_HEIGHT 32 +u64 gLinkAdultUnusedGauntlet1Tex[TEX_LEN(u64, gLinkAdultUnusedGauntlet1Tex_WIDTH, gLinkAdultUnusedGauntlet1Tex_HEIGHT, + 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedGauntlet1Tex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultUnusedGauntlet2Tex_WIDTH 16 +#define gLinkAdultUnusedGauntlet2Tex_HEIGHT 32 +u64 gLinkAdultUnusedGauntlet2Tex[TEX_LEN(u64, gLinkAdultUnusedGauntlet2Tex_WIDTH, gLinkAdultUnusedGauntlet2Tex_HEIGHT, + 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedGauntlet2Tex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultArmGauntletTex_WIDTH 32 +#define gLinkAdultArmGauntletTex_HEIGHT 32 +u64 gLinkAdultArmGauntletTex[TEX_LEN(u64, gLinkAdultArmGauntletTex_WIDTH, gLinkAdultArmGauntletTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultArmGauntletTex.ci8.tlut_gLinkAdultTLUT2.inc.c" +}; + +#define gLinkAdultUnusedSheathTex_WIDTH 32 +#define gLinkAdultUnusedSheathTex_HEIGHT 64 +u64 gLinkAdultUnusedSheathTex[TEX_LEN(u64, gLinkAdultUnusedSheathTex_WIDTH, gLinkAdultUnusedSheathTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedSheathTex.ci8.tlut_gLinkAdultTlut_005E00.inc.c" +}; + +#define gLinkAdultUnusedSheathBandTex_WIDTH 32 +#define gLinkAdultUnusedSheathBandTex_HEIGHT 16 +u64 gLinkAdultUnusedSheathBandTex[TEX_LEN(u64, gLinkAdultUnusedSheathBandTex_WIDTH, + gLinkAdultUnusedSheathBandTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedSheathBandTex.ci8.tlut_gLinkAdultTlut_005E00.inc.c" +}; + +#define gLinkAdultUnusedSwordPommelTex_WIDTH 16 +#define gLinkAdultUnusedSwordPommelTex_HEIGHT 16 +u64 gLinkAdultUnusedSwordPommelTex[TEX_LEN(u64, gLinkAdultUnusedSwordPommelTex_WIDTH, + gLinkAdultUnusedSwordPommelTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedSwordPommelTex.ci8.tlut_gLinkAdultTlut_005E00.inc.c" +}; + +#define gLinkAdultUnusedSwordGuardTex_WIDTH 32 +#define gLinkAdultUnusedSwordGuardTex_HEIGHT 32 +u64 gLinkAdultUnusedSwordGuardTex[TEX_LEN(u64, gLinkAdultUnusedSwordGuardTex_WIDTH, + gLinkAdultUnusedSwordGuardTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedSwordGuardTex.ci8.tlut_gLinkAdultTlut_005E00.inc.c" +}; + +#define gLinkAdultUnusedSwordEmblemTex_WIDTH 16 +#define gLinkAdultUnusedSwordEmblemTex_HEIGHT 16 +u64 gLinkAdultUnusedSwordEmblemTex[TEX_LEN(u64, gLinkAdultUnusedSwordEmblemTex_WIDTH, + gLinkAdultUnusedSwordEmblemTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultUnusedSwordEmblemTex.ci8.tlut_gLinkAdultTlut_005E00.inc.c" +}; + +#define gLinkAdultTunicTex_WIDTH 16 +#define gLinkAdultTunicTex_HEIGHT 32 +u64 gLinkAdultTunicTex[TEX_LEN(u64, gLinkAdultTunicTex_WIDTH, gLinkAdultTunicTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultTunicTex.ci8.tlut_gLinkAdultTLUT3.inc.c" +}; + +#define gLinkAdultCollarTex_WIDTH 16 +#define gLinkAdultCollarTex_HEIGHT 32 +u64 gLinkAdultCollarTex[TEX_LEN(u64, gLinkAdultCollarTex_WIDTH, gLinkAdultCollarTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultCollarTex.rgba16.inc.c" +}; + +#define gLinkAdultGauntletPlate1Tex_WIDTH 16 +#define gLinkAdultGauntletPlate1Tex_HEIGHT 32 +u64 gLinkAdultGauntletPlate1Tex[TEX_LEN(u64, gLinkAdultGauntletPlate1Tex_WIDTH, gLinkAdultGauntletPlate1Tex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultGauntletPlate1Tex.rgba16.inc.c" +}; + +#define gLinkAdultGauntletPlate2Tex_WIDTH 32 +#define gLinkAdultGauntletPlate2Tex_HEIGHT 32 +u64 gLinkAdultGauntletPlate2Tex[TEX_LEN(u64, gLinkAdultGauntletPlate2Tex_WIDTH, gLinkAdultGauntletPlate2Tex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultGauntletPlate2Tex.rgba16.inc.c" +}; + +#define gLinkAdultHoverBootsHeelTex_WIDTH 16 +#define gLinkAdultHoverBootsHeelTex_HEIGHT 8 +u64 gLinkAdultHoverBootsHeelTex[TEX_LEN(u64, gLinkAdultHoverBootsHeelTex_WIDTH, gLinkAdultHoverBootsHeelTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultHoverBootsHeelTex.rgba16.inc.c" +}; + +#define gLinkAdultHoverBootsJetTex_WIDTH 32 +#define gLinkAdultHoverBootsJetTex_HEIGHT 32 +u64 gLinkAdultHoverBootsJetTex[TEX_LEN(u64, gLinkAdultHoverBootsJetTex_WIDTH, gLinkAdultHoverBootsJetTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultHoverBootsJetTex.rgba16.inc.c" +}; + +#define gLinkAdultHoverBootsFeatherTex_WIDTH 32 +#define gLinkAdultHoverBootsFeatherTex_HEIGHT 16 +u64 gLinkAdultHoverBootsFeatherTex[TEX_LEN(u64, gLinkAdultHoverBootsFeatherTex_WIDTH, + gLinkAdultHoverBootsFeatherTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultHoverBootsFeatherTex.rgba16.inc.c" +}; + +#define gLinkAdultMirrorShieldLowerDesignTex_WIDTH 32 +#define gLinkAdultMirrorShieldLowerDesignTex_HEIGHT 64 +u64 gLinkAdultMirrorShieldLowerDesignTex[TEX_LEN(u64, gLinkAdultMirrorShieldLowerDesignTex_WIDTH, + gLinkAdultMirrorShieldLowerDesignTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldLowerDesignTex.ia16.inc.c" +}; + +#define gLinkAdultMirrorShieldUpperDesignTex_WIDTH 64 +#define gLinkAdultMirrorShieldUpperDesignTex_HEIGHT 32 +u64 gLinkAdultMirrorShieldUpperDesignTex[TEX_LEN(u64, gLinkAdultMirrorShieldUpperDesignTex_WIDTH, + gLinkAdultMirrorShieldUpperDesignTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldUpperDesignTex.ia8.inc.c" +}; + +#define gLinkAdultHookshotMetalTex_WIDTH 8 +#define gLinkAdultHookshotMetalTex_HEIGHT 8 +u64 gLinkAdultHookshotMetalTex[TEX_LEN(u64, gLinkAdultHookshotMetalTex_WIDTH, gLinkAdultHookshotMetalTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotMetalTex.rgba16.inc.c" +}; + +#define gLinkAdultBowBodyTex_WIDTH 8 +#define gLinkAdultBowBodyTex_HEIGHT 8 +u64 gLinkAdultBowBodyTex[TEX_LEN(u64, gLinkAdultBowBodyTex_WIDTH, gLinkAdultBowBodyTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultBowBodyTex.i8.inc.c" +}; + +u64 gLinkAdultTLUT4[] = { +#include "assets/objects/object_link_boy/gLinkAdultTLUT4.tlut.rgba16.inc.c" +}; + +u8 gLinkAdult_CD40_Blob[] = { +#include "assets/objects/object_link_boy/gLinkAdult_CD40_Blob.bin.inc.c" +}; + +u64 gLinkAdultTLUT5[] = { +#include "assets/objects/object_link_boy/gLinkAdultTLUT5.tlut.rgba16.inc.c" +}; + +u8 gLinkAdult_CF48_Blob[] = { +#include "assets/objects/object_link_boy/gLinkAdult_CF48_Blob.bin.inc.c" +}; + +u64 gLinkAdultTLUT6[] = { +#include "assets/objects/object_link_boy/gLinkAdultTLUT6.tlut.rgba16.inc.c" +}; + +u8 gLinkAdult_D070_Blob[] = { +#include "assets/objects/object_link_boy/gLinkAdult_D070_Blob.bin.inc.c" +}; + +u64 gLinkAdultTLUT7[] = { +#include "assets/objects/object_link_boy/gLinkAdultArmOutSleeveTex.tlut.rgba16.inc.c" +}; + +#define gLinkAdultSwordPommelTex_WIDTH 16 +#define gLinkAdultSwordPommelTex_HEIGHT 16 +u64 gLinkAdultSwordPommelTex[TEX_LEN(u64, gLinkAdultSwordPommelTex_WIDTH, gLinkAdultSwordPommelTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultSwordPommelTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultIronBootTex_WIDTH 16 +#define gLinkAdultIronBootTex_HEIGHT 16 +u64 gLinkAdultIronBootTex[TEX_LEN(u64, gLinkAdultIronBootTex_WIDTH, gLinkAdultIronBootTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultIronBootTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultDefaultGauntlet1Tex_WIDTH 16 +#define gLinkAdultDefaultGauntlet1Tex_HEIGHT 32 +u64 gLinkAdultDefaultGauntlet1Tex[TEX_LEN(u64, gLinkAdultDefaultGauntlet1Tex_WIDTH, + gLinkAdultDefaultGauntlet1Tex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultDefaultGauntlet1Tex.ci8.tlut_gLinkAdultTLUT5.inc.c" +}; + +#define gLinkAdultShieldHandleTex_WIDTH 8 +#define gLinkAdultShieldHandleTex_HEIGHT 16 +u64 gLinkAdultShieldHandleTex[TEX_LEN(u64, gLinkAdultShieldHandleTex_WIDTH, gLinkAdultShieldHandleTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultShieldHandleTex.ci8.tlut_gLinkAdultTLUT5.inc.c" +}; + +#define gLinkAdultDefaultGauntlet2Tex_WIDTH 16 +#define gLinkAdultDefaultGauntlet2Tex_HEIGHT 32 +u64 gLinkAdultDefaultGauntlet2Tex[TEX_LEN(u64, gLinkAdultDefaultGauntlet2Tex_WIDTH, + gLinkAdultDefaultGauntlet2Tex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultDefaultGauntlet2Tex.ci8.tlut_gLinkAdultTLUT5.inc.c" +}; + +#define gLinkAdultHandTex_WIDTH 16 +#define gLinkAdultHandTex_HEIGHT 16 +u64 gLinkAdultHandTex[TEX_LEN(u64, gLinkAdultHandTex_WIDTH, gLinkAdultHandTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultHandTex.ci8.tlut_gLinkAdultTLUT6.inc.c" +}; + +#define gLinkAdultClosedHandThumbTex_WIDTH 16 +#define gLinkAdultClosedHandThumbTex_HEIGHT 16 +u64 gLinkAdultClosedHandThumbTex[TEX_LEN(u64, gLinkAdultClosedHandThumbTex_WIDTH, gLinkAdultClosedHandThumbTex_HEIGHT, + 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultClosedHandThumbTex.ci8.tlut_gLinkAdultTLUT6.inc.c" +}; + +#define gLinkAdultHylianShieldBackTex_WIDTH 16 +#define gLinkAdultHylianShieldBackTex_HEIGHT 32 +u64 gLinkAdultHylianShieldBackTex[TEX_LEN(u64, gLinkAdultHylianShieldBackTex_WIDTH, + gLinkAdultHylianShieldBackTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldBackTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultClosedHandSideTex_WIDTH 16 +#define gLinkAdultClosedHandSideTex_HEIGHT 16 +u64 gLinkAdultClosedHandSideTex[TEX_LEN(u64, gLinkAdultClosedHandSideTex_WIDTH, gLinkAdultClosedHandSideTex_HEIGHT, + 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultClosedHandSideTex.ci8.tlut_gLinkAdultTLUT6.inc.c" +}; + +#define gLinkAdultSheathTex_WIDTH 32 +#define gLinkAdultSheathTex_HEIGHT 32 +u64 gLinkAdultSheathTex[TEX_LEN(u64, gLinkAdultSheathTex_WIDTH, gLinkAdultSheathTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultSheathTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultArmOutUpperGauntletTex_WIDTH 32 +#define gLinkAdultArmOutUpperGauntletTex_HEIGHT 32 +u64 gLinkAdultArmOutUpperGauntletTex[TEX_LEN(u64, gLinkAdultArmOutUpperGauntletTex_WIDTH, + gLinkAdultArmOutUpperGauntletTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultArmOutUpperGauntletTex.ci8.tlut_gLinkAdultTLUT5.inc.c" +}; + +#define gLinkAdultSwordGuardTex_WIDTH 32 +#define gLinkAdultSwordGuardTex_HEIGHT 32 +u64 gLinkAdultSwordGuardTex[TEX_LEN(u64, gLinkAdultSwordGuardTex_WIDTH, gLinkAdultSwordGuardTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultSwordGuardTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultSheathBandTex_WIDTH 32 +#define gLinkAdultSheathBandTex_HEIGHT 16 +u64 gLinkAdultSheathBandTex[TEX_LEN(u64, gLinkAdultSheathBandTex_WIDTH, gLinkAdultSheathBandTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultSheathBandTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultSwordEmblemTex_WIDTH 16 +#define gLinkAdultSwordEmblemTex_HEIGHT 16 +u64 gLinkAdultSwordEmblemTex[TEX_LEN(u64, gLinkAdultSwordEmblemTex_WIDTH, gLinkAdultSwordEmblemTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultSwordEmblemTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultHookshotHandleTex_WIDTH 16 +#define gLinkAdultHookshotHandleTex_HEIGHT 8 +u64 gLinkAdultHookshotHandleTex[TEX_LEN(u64, gLinkAdultHookshotHandleTex_WIDTH, gLinkAdultHookshotHandleTex_HEIGHT, + 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotHandleTex.ci8.tlut_gLinkAdultTLUT5.inc.c" +}; + +#define gLinkAdultHookshotDesignTex_WIDTH 16 +#define gLinkAdultHookshotDesignTex_HEIGHT 32 +u64 gLinkAdultHookshotDesignTex[TEX_LEN(u64, gLinkAdultHookshotDesignTex_WIDTH, gLinkAdultHookshotDesignTex_HEIGHT, + 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotDesignTex.ci8.tlut_gLinkAdultTLUT4.inc.c" +}; + +#define gLinkAdultArmOutSleeveTex_WIDTH 16 +#define gLinkAdultArmOutSleeveTex_HEIGHT 32 +u64 gLinkAdultArmOutSleeveTex[TEX_LEN(u64, gLinkAdultArmOutSleeveTex_WIDTH, gLinkAdultArmOutSleeveTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultArmOutSleeveTex.ci8.inc.c" +}; + +// Various vertices and DLs + +Vtx gLinkAdultHylianShieldSwordAndSheathNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldSwordAndSheathNearVtx.inc.c" +}; + +Vtx gLinkAdultHylianShieldAndSheathNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldAndSheathNearVtx.inc.c" +}; + +Vtx gLinkAdultMirrorShieldSwordAndSheathNearVtx1[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldSwordAndSheathNearVtx1.inc.c" +}; + +Vtx gLinkAdultMirrorShieldAndSheathNearVtx1[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldAndSheathNearVtx1.inc.c" +}; + +Vtx gLinkAdultLeftHandNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandClosedNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandClosedNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandHoldingMasterSwordNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingMasterSwordNearVtx.inc.c" +}; + +Vtx gLinkAdultRightHandNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandNearVtx.inc.c" +}; + +Vtx gLinkAdultRightHandClosedNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandClosedNearVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingHylianShieldNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHylianShieldNearVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingBowNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingBowNearVtx.inc.c" +}; + +Vtx gLinkAdultMasterSwordAndSheathNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultMasterSwordAndSheathNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandHoldingHammerNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingHammerNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandHoldingBgsNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingBgsNearVtx.inc.c" +}; + +Vtx gLinkAdultHandHoldingBrokenGiantsKnifeVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHandHoldingBrokenGiantsKnifeVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingMirrorShieldNearVtx1[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingMirrorShieldNearVtx1.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingOotNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingOotNearVtx.inc.c" +}; + +Vtx gLinkAdultSheathNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultSheathNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandOutNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandOutNearVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingHookshotNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHookshotNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftGauntletPlate1Vtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftGauntletPlate1Vtx.inc.c" +}; + +Vtx gLinkAdultLeftGauntletPlate2Vtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftGauntletPlate2Vtx.inc.c" +}; + +Vtx gLinkAdultLeftGauntletPlate3Vtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftGauntletPlate3Vtx.inc.c" +}; + +Vtx gLinkAdultRightGauntletPlate1Vtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightGauntletPlate1Vtx.inc.c" +}; + +Vtx gLinkAdultRightGauntletPlate2Vtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightGauntletPlate2Vtx.inc.c" +}; + +Vtx gLinkAdultRightGauntletPlate3Vtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightGauntletPlate3Vtx.inc.c" +}; + +Vtx gLinkAdultLeftIronBootVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftIronBootVtx.inc.c" +}; + +Vtx gLinkAdultRightIronBootVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightIronBootVtx.inc.c" +}; + +Vtx gLinkAdultLeftHoverBootVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHoverBootVtx.inc.c" +}; + +Vtx gLinkAdultRightHoverBootVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHoverBootVtx.inc.c" +}; + +Vtx gLinkAdultHylianShieldSwordAndSheathFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldSwordAndSheathFarVtx.inc.c" +}; + +Vtx gLinkAdultHylianShieldAndSheathFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldAndSheathFarVtx.inc.c" +}; + +Vtx gLinkAdultMirrorShieldSwordAndSheathFarVtx1[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldSwordAndSheathFarVtx1.inc.c" +}; + +Vtx gLinkAdultMirrorShieldAndSheathFarVtx1[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldAndSheathFarVtx1.inc.c" +}; + +Vtx gLinkAdultLeftHandFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandClosedFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandClosedFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandHoldingMasterSwordFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingMasterSwordFarVtx.inc.c" +}; + +Vtx gLinkAdultRightHandFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandFarVtx.inc.c" +}; + +Vtx gLinkAdultRightHandClosedFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandClosedFarVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingHylianShieldFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHylianShieldFarVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingBowFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingBowFarVtx.inc.c" +}; + +Vtx gLinkAdultMasterSwordAndSheathFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultMasterSwordAndSheathFarVtx.inc.c" +}; + +Vtx gLinkAdultSheathFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultSheathFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandHoldingHammerFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingHammerFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftHandHoldingBgsFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingBgsFarVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingMirrorShieldFarVtx1[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingMirrorShieldFarVtx1.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingOotFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingOotFarVtx.inc.c" +}; + +Vtx gLinkAdultHandHoldingBrokenGiantsKnifeFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHandHoldingBrokenGiantsKnifeFarVtx.inc.c" +}; + +Vtx gLinkAdultHandHoldingBottleVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHandHoldingBottleVtx.inc.c" +}; + +Vtx gLinkAdultRightArmOutNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightArmOutNearVtx.inc.c" +}; + +Vtx gLinkAdultRightHandOutNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandOutNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftArmOutNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftArmOutNearVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingBowFirstPersonVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingBowFirstPersonVtx.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingHookshotFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHookshotFarVtx.inc.c" +}; + +Vtx gLinkAdultMirrorShieldSwordAndSheathNearVtx2[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldSwordAndSheathNearVtx2.inc.c" +}; + +Vtx gLinkAdultMirrorShieldAndSheathNearVtx2[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldAndSheathNearVtx2.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingMirrorShieldNearVtx2[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingMirrorShieldNearVtx2.inc.c" +}; + +Vtx gLinkAdultBottleVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultBottleVtx.inc.c" +}; + +Vtx gLinkAdultMirrorShieldSwordAndSheathFarVtx2[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldSwordAndSheathFarVtx2.inc.c" +}; + +Vtx gLinkAdultMirrorShieldAndSheathFarVtx2[] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldAndSheathFarVtx2.inc.c" +}; + +Vtx gLinkAdultRightHandHoldingMirrorShieldFarVtx2[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingMirrorShieldFarVtx2.inc.c" +}; + +Gfx gLinkAdultHylianShieldSwordAndSheathNearDL[127] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldSwordAndSheathNearDL.inc.c" +}; + +Gfx gLinkAdultHylianShieldAndSheathNearDL[105] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldAndSheathNearDL.inc.c" +}; + +Gfx gLinkAdultMirrorShieldSwordAndSheathNearDL[159] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldSwordAndSheathNearDL.inc.c" +}; + +Gfx gLinkAdultMirrorShieldAndSheathNearDL[127] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldAndSheathNearDL.inc.c" +}; + +Gfx gLinkAdultLeftHandNearDL[72] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandNearDL.inc.c" +}; + +Gfx gLinkAdultLeftHandClosedNearDL[82] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandClosedNearDL.inc.c" +}; + +Gfx gLinkAdultLeftHandHoldingMasterSwordNearDL[164] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingMasterSwordNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandNearDL[73] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandClosedNearDL[82] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandClosedNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingHylianShieldNearDL[135] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHylianShieldNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingBowNearDL[119] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingBowNearDL.inc.c" +}; + +Gfx gLinkAdultMasterSwordAndSheathNearDL[80] = { +#include "assets/objects/object_link_boy/gLinkAdultMasterSwordAndSheathNearDL.inc.c" +}; + +Gfx gLinkAdultLeftHandHoldingHammerNearDL[157] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingHammerNearDL.inc.c" +}; + +Gfx gLinkAdultLeftHandHoldingBgsNearDL[145] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingBgsNearDL.inc.c" +}; + +Gfx gLinkAdultHandHoldingBrokenGiantsKnifeDL[142] = { +#include "assets/objects/object_link_boy/gLinkAdultHandHoldingBrokenGiantsKnifeDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingMirrorShieldNearDL[155] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingMirrorShieldNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingOotNearDL[104] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingOotNearDL.inc.c" +}; + +Gfx gLinkAdultSheathNearDL[48] = { +#include "assets/objects/object_link_boy/gLinkAdultSheathNearDL.inc.c" +}; + +Gfx gLinkAdultLeftHandOutNearDL[67] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandOutNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingHookshotNearDL[149] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHookshotNearDL.inc.c" +}; + +Gfx gLinkAdultLeftGauntletPlate1DL[24] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftGauntletPlate1DL.inc.c" +}; + +Gfx gLinkAdultLeftGauntletPlate2DL[44] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftGauntletPlate2DL.inc.c" +}; + +Gfx gLinkAdultLeftGauntletPlate3DL[44] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftGauntletPlate3DL.inc.c" +}; + +Gfx gLinkAdultRightGauntletPlate1DL[24] = { +#include "assets/objects/object_link_boy/gLinkAdultRightGauntletPlate1DL.inc.c" +}; + +Gfx gLinkAdultRightGauntletPlate2DL[44] = { +#include "assets/objects/object_link_boy/gLinkAdultRightGauntletPlate2DL.inc.c" +}; + +Gfx gLinkAdultRightGauntletPlate3DL[44] = { +#include "assets/objects/object_link_boy/gLinkAdultRightGauntletPlate3DL.inc.c" +}; + +Gfx gLinkAdultLeftIronBootDL[41] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftIronBootDL.inc.c" +}; + +Gfx gLinkAdultRightIronBootDL[41] = { +#include "assets/objects/object_link_boy/gLinkAdultRightIronBootDL.inc.c" +}; + +Gfx gLinkAdultLeftHoverBootDL[65] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHoverBootDL.inc.c" +}; + +Gfx gLinkAdultRightHoverBootDL[65] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHoverBootDL.inc.c" +}; + +Gfx gLinkAdultHylianShieldSwordAndSheathFarDL[96] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldSwordAndSheathFarDL.inc.c" +}; + +Gfx gLinkAdultHylianShieldAndSheathFarDL[71] = { +#include "assets/objects/object_link_boy/gLinkAdultHylianShieldAndSheathFarDL.inc.c" +}; + +Gfx gLinkAdultMirrorShieldSwordAndSheathFarDL[132] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldSwordAndSheathFarDL.inc.c" +}; + +Gfx gLinkAdultMirrorShieldAndSheathFarDL[105] = { +#include "assets/objects/object_link_boy/gLinkAdultMirrorShieldAndSheathFarDL.inc.c" +}; + +Gfx gLinkAdultLeftHandFarDL[51] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandFarDL.inc.c" +}; + +Gfx gLinkAdultLeftHandClosedFarDL[81] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandClosedFarDL.inc.c" +}; + +Gfx gLinkAdultLeftHandHoldingMasterSwordFarDL[144] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingMasterSwordFarDL.inc.c" +}; + +Gfx gLinkAdultRightHandFarDL[51] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandFarDL.inc.c" +}; + +Gfx gLinkAdultRightHandClosedFarDL[81] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandClosedFarDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingHylianShieldFarDL[78] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHylianShieldFarDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingBowFarDL[111] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingBowFarDL.inc.c" +}; + +Gfx gLinkAdultMasterSwordAndSheathFarDL[74] = { +#include "assets/objects/object_link_boy/gLinkAdultMasterSwordAndSheathFarDL.inc.c" +}; + +Gfx gLinkAdultSheathFarDL[39] = { +#include "assets/objects/object_link_boy/gLinkAdultSheathFarDL.inc.c" +}; + +Gfx gLinkAdultLeftHandHoldingHammerFarDL[134] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingHammerFarDL.inc.c" +}; + +Gfx gLinkAdultLeftHandHoldingBgsFarDL[145] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandHoldingBgsFarDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingMirrorShieldFarDL[131] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingMirrorShieldFarDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingOotFarDL[82] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingOotFarDL.inc.c" +}; + +Gfx gLinkAdultHandHoldingBrokenGiantsKnifeFarDL[131] = { +#include "assets/objects/object_link_boy/gLinkAdultHandHoldingBrokenGiantsKnifeFarDL.inc.c" +}; + +Gfx gLinkAdultHandHoldingBottleDL[99] = { +#include "assets/objects/object_link_boy/gLinkAdultHandHoldingBottleDL.inc.c" +}; + +Gfx gLinkAdultRightArmOutNearDL[97] = { +#include "assets/objects/object_link_boy/gLinkAdultRightArmOutNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandOutNearDL[112] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandOutNearDL.inc.c" +}; + +Gfx gLinkAdultLeftArmOutNearDL[85] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftArmOutNearDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingBowFirstPersonDL[158] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingBowFirstPersonDL.inc.c" +}; + +Gfx gLinkAdultRightHandHoldingHookshotFarDL[196] = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandHoldingHookshotFarDL.inc.c" +}; + +Gfx gLinkAdultBottleDL[35] = { +#include "assets/objects/object_link_boy/gLinkAdultBottleDL.inc.c" +}; + +// Hookshot, bow, broken giant's knife + +Vtx gLinkAdultHookshotChainVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotChainVtx.inc.c" +}; + +#define gLinkAdultHookshotChainTex_WIDTH 16 +#define gLinkAdultHookshotChainTex_HEIGHT 32 +u64 gLinkAdultHookshotChainTex[TEX_LEN(u64, gLinkAdultHookshotChainTex_WIDTH, gLinkAdultHookshotChainTex_HEIGHT, 16)]; + +Gfx gLinkAdultHookshotChainDL[23] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotChainDL.inc.c" +}; + +Vtx gLinkAdultBowStringVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultBowStringVtx.inc.c" +}; + +Gfx gLinkAdultBowStringDL[12] = { +#include "assets/objects/object_link_boy/gLinkAdultBowStringDL.inc.c" +}; + +Vtx gLinkAdultHookshotTipVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotTipVtx.inc.c" +}; + +Gfx gLinkAdultHookshotTipDL[22] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotTipDL.inc.c" +}; + +u64 gLinkAdultHookshotChainTex[TEX_LEN(u64, gLinkAdultHookshotChainTex_WIDTH, gLinkAdultHookshotChainTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotChainTex.rgba16.inc.c" +}; + +Vtx gLinkAdultBrokenGiantsKnifeBladeVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultBrokenGiantsKnifeBladeVtx.inc.c" +}; + +Gfx gLinkAdultBrokenGiantsKnifeBladeDL[28] = { +#include "assets/objects/object_link_boy/gLinkAdultBrokenGiantsKnifeBladeDL.inc.c" +}; + +// Hookshot reticle + +#define gLinkAdultHookshotReticleTex_WIDTH 64 +#define gLinkAdultHookshotReticleTex_HEIGHT 64 +u64 gLinkAdultHookshotReticleTex[TEX_LEN(u64, gLinkAdultHookshotReticleTex_WIDTH, gLinkAdultHookshotReticleTex_HEIGHT, + 8)] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotReticleTex.i8.inc.c" +}; + +Vtx gLinkAdultHookshotReticleVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotReticleVtx.inc.c" +}; + +Gfx gLinkAdultHookshotReticleDL[13] = { +#include "assets/objects/object_link_boy/gLinkAdultHookshotReticleDL.inc.c" +}; + +// Far skeleton vertices and DLs + +Vtx gLinkAdultRightFootFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightFootFarVtx.inc.c" +}; + +Vtx gLinkAdultRightLegFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightLegFarVtx.inc.c" +}; + +Vtx gLinkAdultRightThighFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightThighFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftFootFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftFootFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftLegFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftLegFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftThighFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftThighFarVtx.inc.c" +}; + +Vtx gLinkAdultWaistFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultWaistFarVtx.inc.c" +}; + +Vtx gLinkAdultHatFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHatFarVtx.inc.c" +}; + +Vtx gLinkAdultHeadFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHeadFarVtx.inc.c" +}; + +Vtx gLinkAdultVtx_02E120[] = { +#include "assets/objects/object_link_boy/gLinkAdultVtx_02E120.inc.c" +}; + +Vtx gLinkAdultLeftArmFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftArmFarVtx.inc.c" +}; + +Vtx gLinkAdultLeftShoulderFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftShoulderFarVtx.inc.c" +}; + +Vtx gLinkAdultVtx_02E7E0[] = { +#include "assets/objects/object_link_boy/gLinkAdultVtx_02E7E0.inc.c" +}; + +Vtx gLinkAdultRightArmFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightArmFarVtx.inc.c" +}; + +Vtx gLinkAdultRightShoulderFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightShoulderFarVtx.inc.c" +}; + +Vtx gLinkAdultTorsoFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultTorsoFarVtx.inc.c" +}; + +Vtx gLinkAdultCollarFarVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultCollarFarVtx.inc.c" +}; + +Gfx gLinkAdultWaistFarDL[78] = { +#include "assets/objects/object_link_boy/gLinkAdultWaistFarDL.inc.c" +}; + +Gfx gLinkAdultRightThighFarDL[67] = { +#include "assets/objects/object_link_boy/gLinkAdultRightThighFarDL.inc.c" +}; + +Gfx gLinkAdultRightLegFarDL[57] = { +#include "assets/objects/object_link_boy/gLinkAdultRightLegFarDL.inc.c" +}; + +Gfx gLinkAdultRightFootFarDL[36] = { +#include "assets/objects/object_link_boy/gLinkAdultRightFootFarDL.inc.c" +}; + +Gfx gLinkAdultLeftThighFarDL[68] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftThighFarDL.inc.c" +}; + +Gfx gLinkAdultLeftLegFarDL[57] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftLegFarDL.inc.c" +}; + +Gfx gLinkAdultLeftFootFarDL[36] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftFootFarDL.inc.c" +}; + +Gfx gLinkAdultCollarFarDL[21] = { +#include "assets/objects/object_link_boy/gLinkAdultCollarFarDL.inc.c" +}; + +Gfx gLinkAdultTorsoFarDL[54] = { +#include "assets/objects/object_link_boy/gLinkAdultTorsoFarDL.inc.c" +}; + +Gfx gLinkAdultHeadFarDL[182] = { +#include "assets/objects/object_link_boy/gLinkAdultHeadFarDL.inc.c" +}; + +Gfx gLinkAdultHatFarDL[30] = { +#include "assets/objects/object_link_boy/gLinkAdultHatFarDL.inc.c" +}; + +Gfx gLinkAdultRightShoulderFarDL[53] = { +#include "assets/objects/object_link_boy/gLinkAdultRightShoulderFarDL.inc.c" +}; + +Gfx gLinkAdultRightArmFarDL[86] = { +#include "assets/objects/object_link_boy/gLinkAdultRightArmFarDL.inc.c" +}; + +Gfx gLinkAdultLeftShoulderFarDL[53] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftShoulderFarDL.inc.c" +}; + +Gfx gLinkAdultLeftArmFarDL[86] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftArmFarDL.inc.c" +}; + +// Near skeleton vertices and DLs + +Vtx gLinkAdultRightFootNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightFootNearVtx.inc.c" +}; + +Vtx gLinkAdultRightLegNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightLegNearVtx.inc.c" +}; + +Vtx gLinkAdultRightThighNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightThighNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftFootNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftFootNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftLegNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftLegNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftThighNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftThighNearVtx.inc.c" +}; + +Vtx gLinkAdultWaistNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultWaistNearVtx.inc.c" +}; + +Vtx gLinkAdultHatNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHatNearVtx.inc.c" +}; + +Vtx gLinkAdultHeadNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultHeadNearVtx.inc.c" +}; + +Vtx gLinkAdultVtx_033760[] = { +#include "assets/objects/object_link_boy/gLinkAdultVtx_033760.inc.c" +}; + +Vtx gLinkAdultLeftArmNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftArmNearVtx.inc.c" +}; + +Vtx gLinkAdultLeftShoulderNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftShoulderNearVtx.inc.c" +}; + +Vtx gLinkAdultVtx_0340A0[] = { +#include "assets/objects/object_link_boy/gLinkAdultVtx_0340A0.inc.c" +}; + +Vtx gLinkAdultRightArmNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightArmNearVtx.inc.c" +}; + +Vtx gLinkAdultRightShoulderNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultRightShoulderNearVtx.inc.c" +}; + +Vtx gLinkAdultTorsoNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultTorsoNearVtx.inc.c" +}; + +Vtx gLinkAdultCollarNearVtx[] = { +#include "assets/objects/object_link_boy/gLinkAdultCollarNearVtx.inc.c" +}; + +Gfx gLinkAdultWaistNearDL[105] = { +#include "assets/objects/object_link_boy/gLinkAdultWaistNearDL.inc.c" +}; + +Gfx gLinkAdultRightThighNearDL[71] = { +#include "assets/objects/object_link_boy/gLinkAdultRightThighNearDL.inc.c" +}; + +Gfx gLinkAdultRightLegNearDL[86] = { +#include "assets/objects/object_link_boy/gLinkAdultRightLegNearDL.inc.c" +}; + +Gfx gLinkAdultRightFootNearDL[43] = { +#include "assets/objects/object_link_boy/gLinkAdultRightFootNearDL.inc.c" +}; + +Gfx gLinkAdultLeftThighNearDL[71] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftThighNearDL.inc.c" +}; + +Gfx gLinkAdultLeftLegNearDL[86] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftLegNearDL.inc.c" +}; + +Gfx gLinkAdultLeftFootNearDL[43] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftFootNearDL.inc.c" +}; + +Gfx gLinkAdultCollarNearDL[24] = { +#include "assets/objects/object_link_boy/gLinkAdultCollarNearDL.inc.c" +}; + +Gfx gLinkAdultTorsoNearDL[70] = { +#include "assets/objects/object_link_boy/gLinkAdultTorsoNearDL.inc.c" +}; + +Gfx gLinkAdultHeadNearDL[233] = { +#include "assets/objects/object_link_boy/gLinkAdultHeadNearDL.inc.c" +}; + +Gfx gLinkAdultHatNearDL[37] = { +#include "assets/objects/object_link_boy/gLinkAdultHatNearDL.inc.c" +}; + +Gfx gLinkAdultRightShoulderNearDL[56] = { +#include "assets/objects/object_link_boy/gLinkAdultRightShoulderNearDL.inc.c" +}; + +Gfx gLinkAdultRightArmNearDL[63] = { +#include "assets/objects/object_link_boy/gLinkAdultRightArmNearDL.inc.c" +}; + +Gfx gLinkAdultLeftShoulderNearDL[57] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftShoulderNearDL.inc.c" +}; + +Gfx gLinkAdultLeftArmNearDL[79] = { +#include "assets/objects/object_link_boy/gLinkAdultLeftArmNearDL.inc.c" +}; + +// Skeleton + +LodLimb gLinkAdultRootLimb = { +#include "assets/objects/object_link_boy/gLinkAdultRootLimb.inc.c" +}; + +LodLimb gLinkAdultWaistLimb = { +#include "assets/objects/object_link_boy/gLinkAdultWaistLimb.inc.c" +}; + +LodLimb gLinkAdultLowerControlLimb = { +#include "assets/objects/object_link_boy/gLinkAdultLowerControlLimb.inc.c" +}; + +LodLimb gLinkAdultRightThighLimb = { +#include "assets/objects/object_link_boy/gLinkAdultRightThighLimb.inc.c" +}; + +LodLimb gLinkAdultRightLegLimb = { +#include "assets/objects/object_link_boy/gLinkAdultRightLegLimb.inc.c" +}; + +LodLimb gLinkAdultRightFootLimb = { +#include "assets/objects/object_link_boy/gLinkAdultRightFootLimb.inc.c" +}; + +LodLimb gLinkAdultLeftThighLimb = { +#include "assets/objects/object_link_boy/gLinkAdultLeftThighLimb.inc.c" +}; + +LodLimb gLinkAdultLeftLegLimb = { +#include "assets/objects/object_link_boy/gLinkAdultLeftLegLimb.inc.c" +}; + +LodLimb gLinkAdultLeftFootLimb = { +#include "assets/objects/object_link_boy/gLinkAdultLeftFootLimb.inc.c" +}; + +LodLimb gLinkAdultUpperControlLimb = { +#include "assets/objects/object_link_boy/gLinkAdultUpperControlLimb.inc.c" +}; + +LodLimb gLinkAdultHeadLimb = { +#include "assets/objects/object_link_boy/gLinkAdultHeadLimb.inc.c" +}; + +LodLimb gLinkAdultHatLimb = { +#include "assets/objects/object_link_boy/gLinkAdultHatLimb.inc.c" +}; + +LodLimb gLinkAdultCollarLimb = { +#include "assets/objects/object_link_boy/gLinkAdultCollarLimb.inc.c" +}; + +LodLimb gLinkAdultLeftShoulderLimb = { +#include "assets/objects/object_link_boy/gLinkAdultLeftShoulderLimb.inc.c" +}; + +LodLimb gLinkAdultLeftArmLimb = { +#include "assets/objects/object_link_boy/gLinkAdultLeftArmLimb.inc.c" +}; + +LodLimb gLinkAdultLeftHandLimb = { +#include "assets/objects/object_link_boy/gLinkAdultLeftHandLimb.inc.c" +}; + +LodLimb gLinkAdultRightShoulderLimb = { +#include "assets/objects/object_link_boy/gLinkAdultRightShoulderLimb.inc.c" +}; + +LodLimb gLinkAdultRightArmLimb = { +#include "assets/objects/object_link_boy/gLinkAdultRightArmLimb.inc.c" +}; + +LodLimb gLinkAdultRightHandLimb = { +#include "assets/objects/object_link_boy/gLinkAdultRightHandLimb.inc.c" +}; + +LodLimb gLinkAdultSwordAndSheathLimb = { +#include "assets/objects/object_link_boy/gLinkAdultSwordAndSheathLimb.inc.c" +}; + +LodLimb gLinkTorsoLimb = { +#include "assets/objects/object_link_boy/gLinkTorsoLimb.inc.c" +}; + +void* gLinkAdultLimbs[] = { +#include "assets/objects/object_link_boy/gLinkAdultLimbs.inc.c" +}; + +FlexSkeletonHeader gLinkAdultSkel = { +#include "assets/objects/object_link_boy/gLinkAdultSkel.inc.c" +}; diff --git a/assets/objects/object_link_boy/object_link_boy.h b/assets/objects/object_link_boy/object_link_boy.h new file mode 100644 index 0000000000..349c36adeb --- /dev/null +++ b/assets/objects/object_link_boy/object_link_boy.h @@ -0,0 +1,94 @@ +#ifndef OBJECT_LINK_BOY_H +#define OBJECT_LINK_BOY_H + +#include "ultra64.h" +#include "tex_len.h" +#include "animation.h" + +#define LINK_ADULT_EYES_TEX_WIDTH 64 +#define LINK_ADULT_EYES_TEX_HEIGHT 32 +extern u64 gLinkAdultEyesOpenTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultEyesHalfTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultEyesClosedfTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultEyesRightTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultEyesLeftTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultEyesWideTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultEyesDownTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultEyesWincingTex[TEX_LEN(u64, LINK_ADULT_EYES_TEX_WIDTH, LINK_ADULT_EYES_TEX_HEIGHT, 8)]; + +#define LINK_ADULT_MOUTH_TEX_WIDTH 32 +#define LINK_ADULT_MOUTH_TEX_HEIGHT 32 +extern u64 gLinkAdultMouthClosedTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultMouthHalfTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultMouthOpenTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)]; +extern u64 gLinkAdultMouthSmileTex[TEX_LEN(u64, LINK_ADULT_MOUTH_TEX_WIDTH, LINK_ADULT_MOUTH_TEX_HEIGHT, 8)]; + +extern Gfx gLinkAdultHylianShieldSwordAndSheathNearDL[127]; +extern Gfx gLinkAdultHylianShieldAndSheathNearDL[105]; +extern Gfx gLinkAdultMirrorShieldSwordAndSheathNearDL[159]; +extern Gfx gLinkAdultMirrorShieldAndSheathNearDL[127]; +extern Gfx gLinkAdultLeftHandNearDL[72]; +extern Gfx gLinkAdultLeftHandClosedNearDL[82]; +extern Gfx gLinkAdultLeftHandHoldingMasterSwordNearDL[164]; +extern Gfx gLinkAdultRightHandNearDL[73]; +extern Gfx gLinkAdultRightHandClosedNearDL[82]; +extern Gfx gLinkAdultRightHandHoldingHylianShieldNearDL[135]; +extern Gfx gLinkAdultRightHandHoldingBowNearDL[119]; +extern Gfx gLinkAdultMasterSwordAndSheathNearDL[80]; +extern Gfx gLinkAdultLeftHandHoldingHammerNearDL[157]; +extern Gfx gLinkAdultLeftHandHoldingBgsNearDL[145]; +extern Gfx gLinkAdultHandHoldingBrokenGiantsKnifeDL[142]; +extern Gfx gLinkAdultRightHandHoldingMirrorShieldNearDL[155]; +extern Gfx gLinkAdultRightHandHoldingOotNearDL[104]; +extern Gfx gLinkAdultSheathNearDL[48]; +extern Gfx gLinkAdultLeftHandOutNearDL[67]; +extern Gfx gLinkAdultRightHandHoldingHookshotNearDL[149]; +extern Gfx gLinkAdultLeftGauntletPlate1DL[24]; +extern Gfx gLinkAdultLeftGauntletPlate2DL[44]; +extern Gfx gLinkAdultLeftGauntletPlate3DL[44]; +extern Gfx gLinkAdultRightGauntletPlate1DL[24]; +extern Gfx gLinkAdultRightGauntletPlate2DL[44]; +extern Gfx gLinkAdultRightGauntletPlate3DL[44]; +extern Gfx gLinkAdultLeftIronBootDL[41]; +extern Gfx gLinkAdultRightIronBootDL[41]; +extern Gfx gLinkAdultLeftHoverBootDL[65]; +extern Gfx gLinkAdultRightHoverBootDL[65]; +extern Gfx gLinkAdultHylianShieldSwordAndSheathFarDL[96]; +extern Gfx gLinkAdultHylianShieldAndSheathFarDL[71]; +extern Gfx gLinkAdultMirrorShieldSwordAndSheathFarDL[132]; +extern Gfx gLinkAdultMirrorShieldAndSheathFarDL[105]; +extern Gfx gLinkAdultLeftHandFarDL[51]; +extern Gfx gLinkAdultLeftHandClosedFarDL[81]; +extern Gfx gLinkAdultLeftHandHoldingMasterSwordFarDL[144]; +extern Gfx gLinkAdultRightHandFarDL[51]; +extern Gfx gLinkAdultRightHandClosedFarDL[81]; +extern Gfx gLinkAdultRightHandHoldingHylianShieldFarDL[78]; +extern Gfx gLinkAdultRightHandHoldingBowFarDL[111]; +extern Gfx gLinkAdultMasterSwordAndSheathFarDL[74]; +extern Gfx gLinkAdultSheathFarDL[39]; +extern Gfx gLinkAdultLeftHandHoldingHammerFarDL[134]; +extern Gfx gLinkAdultLeftHandHoldingBgsFarDL[145]; +extern Gfx gLinkAdultRightHandHoldingMirrorShieldFarDL[131]; +extern Gfx gLinkAdultRightHandHoldingOotFarDL[82]; +extern Gfx gLinkAdultHandHoldingBrokenGiantsKnifeFarDL[131]; +extern Gfx gLinkAdultHandHoldingBottleDL[99]; +extern Gfx gLinkAdultRightArmOutNearDL[97]; +extern Gfx gLinkAdultRightHandOutNearDL[112]; +extern Gfx gLinkAdultLeftArmOutNearDL[85]; +extern Gfx gLinkAdultRightHandHoldingBowFirstPersonDL[158]; +extern Gfx gLinkAdultRightHandHoldingHookshotFarDL[196]; +extern Gfx gLinkAdultBottleDL[35]; +extern Gfx gLinkAdultHookshotChainDL[23]; +extern Gfx gLinkAdultBowStringDL[12]; +extern Gfx gLinkAdultHookshotTipDL[22]; +extern Gfx gLinkAdultBrokenGiantsKnifeBladeDL[28]; +extern Gfx gLinkAdultHookshotReticleDL[13]; + +extern Gfx gLinkAdultWaistFarDL[78]; + +extern Gfx gLinkAdultWaistNearDL[105]; +extern Gfx gLinkAdultRightShoulderNearDL[56]; + +extern FlexSkeletonHeader gLinkAdultSkel; + +#endif diff --git a/assets/objects/object_link_child/object_link_child.c b/assets/objects/object_link_child/object_link_child.c new file mode 100644 index 0000000000..30411ab0b4 --- /dev/null +++ b/assets/objects/object_link_child/object_link_child.c @@ -0,0 +1,1195 @@ +#include "object_link_child.h" +#include "assets/objects/gameplay_keep/gameplay_keep.h" + +#include "array_count.h" +#include "gfx.h" +#include "player.h" + +// Eyes textures + +u64 gLinkChildEyesOpenTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesOpenTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildEyesHalfTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesHalfTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildEyesClosedfTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesClosedfTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildEyesLeftTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesLeftTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildEyesRightTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesRightTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildEyesWideTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesWideTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildEyesDownTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesDownTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildEyesWincingTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEyesWincingTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +// Mouth textures + +u64 gLinkChildMouthClosedTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildMouthClosedTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildMouthHalfTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildMouthHalfTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildMouthOpenTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildMouthOpenTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildMouthSmileTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildMouthSmileTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +// Textures + +#define gLinkChildNoseTex_WIDTH 16 +#define gLinkChildNoseTex_HEIGHT 16 +u64 gLinkChildNoseTex[TEX_LEN(u64, gLinkChildNoseTex_WIDTH, gLinkChildNoseTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildNoseTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +#define gLinkChildUnusedHandTex_WIDTH 16 +#define gLinkChildUnusedHandTex_HEIGHT 16 +u64 gLinkChildUnusedHandTex[TEX_LEN(u64, gLinkChildUnusedHandTex_WIDTH, gLinkChildUnusedHandTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildUnusedHandTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +#define gLinkChildEarTex_WIDTH 16 +#define gLinkChildEarTex_HEIGHT 16 +u64 gLinkChildEarTex[TEX_LEN(u64, gLinkChildEarTex_WIDTH, gLinkChildEarTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildEarTex.ci8.tlut_gLinkChildSkinTLUT.inc.c" +}; + +u64 gLinkChildBeltTLUT[] = { +#include "assets/objects/object_link_child/gLinkChildBeltTLUT.tlut.rgba16.inc.c" +}; + +u64 gLinkChildSkinTLUT[] = { +#include "assets/objects/object_link_child/gLinkChildSkinTLUT.tlut.rgba16.inc.c" +}; + +u64 gLinkChildUnusedTLUT[] = { +#include "assets/objects/object_link_child/gLinkChildUnused1Tex.tlut.rgba16.inc.c" +}; + +#define gLinkChildUnused1Tex_WIDTH 16 +#define gLinkChildUnused1Tex_HEIGHT 16 +u64 gLinkChildUnused1Tex[TEX_LEN(u64, gLinkChildUnused1Tex_WIDTH, gLinkChildUnused1Tex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildUnused1Tex.ci8.inc.c" +}; + +#define gLinkChildUnused2Tex_WIDTH 32 +#define gLinkChildUnused2Tex_HEIGHT 16 +u64 gLinkChildUnused2Tex[TEX_LEN(u64, gLinkChildUnused2Tex_WIDTH, gLinkChildUnused2Tex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildUnused2Tex.ci8.tlut_gLinkChildBeltTLUT.inc.c" +}; + +#define gLinkChildLowerBootTex_WIDTH 32 +#define gLinkChildLowerBootTex_HEIGHT 32 +u64 gLinkChildLowerBootTex[TEX_LEN(u64, gLinkChildLowerBootTex_WIDTH, gLinkChildLowerBootTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildLowerBootTex.ci8.tlut_gLinkChildBeltTLUT.inc.c" +}; + +#define gLinkChildBootTex_WIDTH 32 +#define gLinkChildBootTex_HEIGHT 32 +u64 gLinkChildBootTex[TEX_LEN(u64, gLinkChildBootTex_WIDTH, gLinkChildBootTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildBootTex.ci8.tlut_gLinkChildBeltTLUT.inc.c" +}; + +#define gLinkChildWaistTex_WIDTH 32 +#define gLinkChildWaistTex_HEIGHT 32 +u64 gLinkChildWaistTex[TEX_LEN(u64, gLinkChildWaistTex_WIDTH, gLinkChildWaistTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildWaistTex.i8.inc.c" +}; + +#define gLinkChildBeltTex_WIDTH 8 +#define gLinkChildBeltTex_HEIGHT 16 +u64 gLinkChildBeltTex[TEX_LEN(u64, gLinkChildBeltTex_WIDTH, gLinkChildBeltTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildBeltTex.ci8.tlut_gLinkChildBeltTLUT.inc.c" +}; + +#define gLinkChildBeltClaspTex_WIDTH 32 +#define gLinkChildBeltClaspTex_HEIGHT 16 +u64 gLinkChildBeltClaspTex[TEX_LEN(u64, gLinkChildBeltClaspTex_WIDTH, gLinkChildBeltClaspTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildBeltClaspTex.ci8.tlut_gLinkChildBeltTLUT.inc.c" +}; + +// Deku stick + +Vtx gLinkChildLinkDekuStickVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLinkDekuStickVtx.inc.c" +}; + +Gfx gLinkChildLinkDekuStickDL[41] = { +#include "assets/objects/object_link_child/gLinkChildLinkDekuStickDL.inc.c" +}; + +// Textures + +#define gLinkChildFairyOcarinaTex_WIDTH 32 +#define gLinkChildFairyOcarinaTex_HEIGHT 16 +u64 gLinkChildFairyOcarinaTex[TEX_LEN(u64, gLinkChildFairyOcarinaTex_WIDTH, gLinkChildFairyOcarinaTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildFairyOcarinaTex.rgba16.inc.c" +}; + +#define gLinkChildGoronBraceletTex_WIDTH 8 +#define gLinkChildGoronBraceletTex_HEIGHT 8 +u64 gLinkChildGoronBraceletTex[TEX_LEN(u64, gLinkChildGoronBraceletTex_WIDTH, gLinkChildGoronBraceletTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGoronBraceletTex.rgba16.inc.c" +}; + +#define gLinkChildGoronSymbolTex_WIDTH 16 +#define gLinkChildGoronSymbolTex_HEIGHT 32 +u64 gLinkChildGoronSymbolTex[TEX_LEN(u64, gLinkChildGoronSymbolTex_WIDTH, gLinkChildGoronSymbolTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildGoronSymbolTex.ia16.inc.c" +}; + +#define gLinkChildDekuShieldBackTex_WIDTH 32 +#define gLinkChildDekuShieldBackTex_HEIGHT 32 +u64 gLinkChildDekuShieldBackTex[TEX_LEN(u64, gLinkChildDekuShieldBackTex_WIDTH, gLinkChildDekuShieldBackTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldBackTex.rgba16.inc.c" +}; + +#define gLinkChildDekuShieldFrontTex_WIDTH 32 +#define gLinkChildDekuShieldFrontTex_HEIGHT 64 +u64 gLinkChildDekuShieldFrontTex[TEX_LEN(u64, gLinkChildDekuShieldFrontTex_WIDTH, gLinkChildDekuShieldFrontTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldFrontTex.rgba16.inc.c" +}; + +#define gLinkChildHylianShieldBackTex_WIDTH 16 +#define gLinkChildHylianShieldBackTex_HEIGHT 32 +u64 gLinkChildHylianShieldBackTex[TEX_LEN(u64, gLinkChildHylianShieldBackTex_WIDTH, + gLinkChildHylianShieldBackTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldBackTex.rgba16.inc.c" +}; + +#define gLinkChildSlingshotTex_WIDTH 16 +#define gLinkChildSlingshotTex_HEIGHT 32 +u64 gLinkChildSlingshotTex[TEX_LEN(u64, gLinkChildSlingshotTex_WIDTH, gLinkChildSlingshotTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildSlingshotTex.rgba16.inc.c" +}; + +#define gLinkChildSlingshotSeedTex_WIDTH 32 +#define gLinkChildSlingshotSeedTex_HEIGHT 32 +u64 gLinkChildSlingshotSeedTex[TEX_LEN(u64, gLinkChildSlingshotSeedTex_WIDTH, gLinkChildSlingshotSeedTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildSlingshotSeedTex.rgba16.inc.c" +}; + +u64 gLinkChildHandTLUT[] = { +#include "assets/objects/object_link_child/gLinkChildHandTex.tlut.rgba16.inc.c" +}; + +u64 gLinkChildSwordsTLUT[] = { +#include "assets/objects/object_link_child/gLinkChildSwordsTLUT.tlut.rgba16.inc.c" +}; + +u8 gLinkChild_A110_Blob[] = { +#include "assets/objects/object_link_child/gLinkChild_A110_Blob.bin.inc.c" +}; + +u64 gLinkChildSwordTLUT[] = { +#include "assets/objects/object_link_child/gLinkChildSwordJewelTex.tlut.rgba16.inc.c" +}; + +#define gLinkChildHandTex_WIDTH 16 +#define gLinkChildHandTex_HEIGHT 16 +u64 gLinkChildHandTex[TEX_LEN(u64, gLinkChildHandTex_WIDTH, gLinkChildHandTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildHandTex.ci8.inc.c" +}; + +#define gLinkChildKokiriSwordSheathTex_WIDTH 16 +#define gLinkChildKokiriSwordSheathTex_HEIGHT 16 +u64 gLinkChildKokiriSwordSheathTex[TEX_LEN(u64, gLinkChildKokiriSwordSheathTex_WIDTH, + gLinkChildKokiriSwordSheathTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildKokiriSwordSheathTex.ci8.tlut_gLinkChildSwordsTLUT.inc.c" +}; + +#define gLinkChildSwordJewelTex_WIDTH 32 +#define gLinkChildSwordJewelTex_HEIGHT 16 +u64 gLinkChildSwordJewelTex[TEX_LEN(u64, gLinkChildSwordJewelTex_WIDTH, gLinkChildSwordJewelTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildSwordJewelTex.ci8.inc.c" +}; + +#define gLinkChildMasterSwordPommelTex_WIDTH 16 +#define gLinkChildMasterSwordPommelTex_HEIGHT 16 +u64 gLinkChildMasterSwordPommelTex[TEX_LEN(u64, gLinkChildMasterSwordPommelTex_WIDTH, + gLinkChildMasterSwordPommelTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildMasterSwordPommelTex.ci8.tlut_gLinkChildSwordsTLUT.inc.c" +}; + +#define gLinkChildMasterSwordGuardTex_WIDTH 32 +#define gLinkChildMasterSwordGuardTex_HEIGHT 32 +u64 gLinkChildMasterSwordGuardTex[TEX_LEN(u64, gLinkChildMasterSwordGuardTex_WIDTH, + gLinkChildMasterSwordGuardTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildMasterSwordGuardTex.ci8.tlut_gLinkChildSwordsTLUT.inc.c" +}; + +#define gLinkChildMasterSwordEmblemTex_WIDTH 16 +#define gLinkChildMasterSwordEmblemTex_HEIGHT 16 +u64 gLinkChildMasterSwordEmblemTex[TEX_LEN(u64, gLinkChildMasterSwordEmblemTex_WIDTH, + gLinkChildMasterSwordEmblemTex_HEIGHT, 8)] = { +#include "assets/objects/object_link_child/gLinkChildMasterSwordEmblemTex.ci8.tlut_gLinkChildSwordsTLUT.inc.c" +}; + +// Various vertices and DLs + +Vtx gLinkChildLeftHandNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandNearVtx.inc.c" +}; + +Vtx gLinkChildLeftFistNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistNearVtx.inc.c" +}; + +Vtx gLinkChildLeftFistAndKokiriSwordNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndKokiriSwordNearVtx.inc.c" +}; + +Vtx gLinkChildRightHandNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandNearVtx.inc.c" +}; + +Vtx gLinkChildRightHandClosedNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandClosedNearVtx.inc.c" +}; + +Vtx gLinkChildRightFistAndDekuShieldNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightFistAndDekuShieldNearVtx.inc.c" +}; + +Vtx gLinkChildLeftFistAndBoomerangNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndBoomerangNearVtx.inc.c" +}; + +Vtx gLinkChildHylianShieldSwordAndSheathNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldSwordAndSheathNearVtx.inc.c" +}; + +Vtx gLinkChildHylianShieldAndSheathNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldAndSheathNearVtx.inc.c" +}; + +Vtx gLinkChildDekuShieldSwordAndSheathNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldSwordAndSheathNearVtx.inc.c" +}; + +Vtx gLinkChildDekuShieldAndSheathNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldAndSheathNearVtx.inc.c" +}; + +Vtx gLinkChildSwordAndSheathNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildSwordAndSheathNearVtx.inc.c" +}; + +Vtx gLinkChildSheathNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildSheathNearVtx.inc.c" +}; + +Vtx gLinkChildLeftHandHoldingMasterSwordVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandHoldingMasterSwordVtx.inc.c" +}; + +Vtx gLinkChildRightHandAndOotNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandAndOotNearVtx.inc.c" +}; + +Vtx gLinkChildRightHandHoldingFairyOcarinaNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingFairyOcarinaNearVtx.inc.c" +}; + +Vtx gLinkChildRightHandHoldingSlingshotNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingSlingshotNearVtx.inc.c" +}; + +Vtx gLinkChildLeftHandUpNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandUpNearVtx.inc.c" +}; + +Vtx gLinkChildGoronBraceletVtx1[] = { +#include "assets/objects/object_link_child/gLinkChildGoronBraceletVtx1.inc.c" +}; + +Vtx gLinkChildLeftHandFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandFarVtx.inc.c" +}; + +Vtx gLinkChildLeftFistFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistFarVtx.inc.c" +}; + +Vtx gLinkChildRightHandFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandFarVtx.inc.c" +}; + +Vtx gLinkChildRightHandClosedFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandClosedFarVtx.inc.c" +}; + +Vtx gLinkChildRightFistAndDekuShieldFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightFistAndDekuShieldFarVtx.inc.c" +}; + +Vtx gLinkChildLeftFistAndBoomerangFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndBoomerangFarVtx.inc.c" +}; + +Vtx gLinkChildHylianShieldSwordAndSheathFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldSwordAndSheathFarVtx.inc.c" +}; + +Vtx gLinkChildHylianShieldAndSheathFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldAndSheathFarVtx.inc.c" +}; + +Vtx gLinkChildDekuShieldSwordAndSheathFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldSwordAndSheathFarVtx.inc.c" +}; + +Vtx gLinkChildDekuShieldAndSheathFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldAndSheathFarVtx.inc.c" +}; + +Vtx gLinkChildSwordAndSheathFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildSwordAndSheathFarVtx.inc.c" +}; + +Vtx gLinkChildSheathFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildSheathFarVtx.inc.c" +}; + +Vtx gLinkChildLeftFistAndKokiriSwordFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndKokiriSwordFarVtx.inc.c" +}; + +Vtx gLinkChildRightHandHoldingOOTFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingOOTFarVtx.inc.c" +}; + +Vtx gLinkChildRightHandHoldingFairyOcarinaFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingFairyOcarinaFarVtx.inc.c" +}; + +Vtx gLinkChildRightHandHoldingSlingshotFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingSlingshotFarVtx.inc.c" +}; + +Vtx gLinkChildLeftHandUpFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandUpFarVtx.inc.c" +}; + +Vtx gLinkChildRightArmStretchedSlingshotVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightArmStretchedSlingshotVtx.inc.c" +}; + +Vtx gLinkChildBottleVtx[] = { +#include "assets/objects/object_link_child/gLinkChildBottleVtx.inc.c" +}; + +Vtx gLinkChildGoronBraceletVtx2[] = { +#include "assets/objects/object_link_child/gLinkChildGoronBraceletVtx2.inc.c" +}; + +Vtx gLinkChildDL_18580_Vtx[] = { +#include "assets/objects/object_link_child/gLinkChildDL_18580_Vtx.inc.c" +}; + +Vtx gLinkChildBottle2Vtx[] = { +#include "assets/objects/object_link_child/gLinkChildBottle2Vtx.inc.c" +}; + +Gfx gLinkChildLeftHandNearDL[45] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandNearDL.inc.c" +}; + +Gfx gLinkChildLeftFistNearDL[36] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistNearDL.inc.c" +}; + +Gfx gLinkChildLeftFistAndKokiriSwordNearDL[81] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndKokiriSwordNearDL.inc.c" +}; + +Gfx gLinkChildRightHandNearDL[44] = { +#include "assets/objects/object_link_child/gLinkChildRightHandNearDL.inc.c" +}; + +Gfx gLinkChildRightHandClosedNearDL[36] = { +#include "assets/objects/object_link_child/gLinkChildRightHandClosedNearDL.inc.c" +}; + +Gfx gLinkChildRightFistAndDekuShieldNearDL[68] = { +#include "assets/objects/object_link_child/gLinkChildRightFistAndDekuShieldNearDL.inc.c" +}; + +Gfx gLinkChildLeftFistAndBoomerangNearDL[73] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndBoomerangNearDL.inc.c" +}; + +Gfx gLinkChildHylianShieldSwordAndSheathNearDL[83] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldSwordAndSheathNearDL.inc.c" +}; + +Gfx gLinkChildHylianShieldAndSheathNearDL[69] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldAndSheathNearDL.inc.c" +}; + +Gfx gLinkChildDekuShieldSwordAndSheathNearDL[85] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldSwordAndSheathNearDL.inc.c" +}; + +Gfx gLinkChildDekuShieldAndSheathNearDL[71] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldAndSheathNearDL.inc.c" +}; + +Gfx gLinkChildSwordAndSheathNearDL[56] = { +#include "assets/objects/object_link_child/gLinkChildSwordAndSheathNearDL.inc.c" +}; + +Gfx gLinkChildSheathNearDL[39] = { +#include "assets/objects/object_link_child/gLinkChildSheathNearDL.inc.c" +}; + +Gfx gLinkChildLeftHandHoldingMasterSwordDL[131] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandHoldingMasterSwordDL.inc.c" +}; + +Gfx gLinkChildRightHandAndOotNearDL[74] = { +#include "assets/objects/object_link_child/gLinkChildRightHandAndOotNearDL.inc.c" +}; + +Gfx gLinkChildRightHandHoldingFairyOcarinaNearDL[73] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingFairyOcarinaNearDL.inc.c" +}; + +Gfx gLinkChildRightHandHoldingSlingshotNearDL[60] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingSlingshotNearDL.inc.c" +}; + +Gfx gLinkChildLeftHandUpNearDL[41] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandUpNearDL.inc.c" +}; + +Gfx gLinkChildGoronBraceletDL[45] = { +#include "assets/objects/object_link_child/gLinkChildGoronBraceletDL.inc.c" +}; + +Gfx gLinkChildLeftHandFarDL[40] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandFarDL.inc.c" +}; + +Gfx gLinkChildLeftFistFarDL[36] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistFarDL.inc.c" +}; + +Gfx gLinkChildRightHandFarDL[40] = { +#include "assets/objects/object_link_child/gLinkChildRightHandFarDL.inc.c" +}; + +Gfx gLinkChildRightHandClosedFarDL[36] = { +#include "assets/objects/object_link_child/gLinkChildRightHandClosedFarDL.inc.c" +}; + +Gfx gLinkChildRightFistAndDekuShieldFarDL[57] = { +#include "assets/objects/object_link_child/gLinkChildRightFistAndDekuShieldFarDL.inc.c" +}; + +Gfx gLinkChildLeftFistAndBoomerangFarDL[50] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndBoomerangFarDL.inc.c" +}; + +Gfx gLinkChildHylianShieldSwordAndSheathFarDL[76] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldSwordAndSheathFarDL.inc.c" +}; + +Gfx gLinkChildHylianShieldAndSheathFarDL[62] = { +#include "assets/objects/object_link_child/gLinkChildHylianShieldAndSheathFarDL.inc.c" +}; + +Gfx gLinkChildDekuShieldSwordAndSheathFarDL[77] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldSwordAndSheathFarDL.inc.c" +}; + +Gfx gLinkChildDekuShieldAndSheathFarDL[66] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldAndSheathFarDL.inc.c" +}; + +Gfx gLinkChildSwordAndSheathFarDL[52] = { +#include "assets/objects/object_link_child/gLinkChildSwordAndSheathFarDL.inc.c" +}; + +Gfx gLinkChildSheathFarDL[38] = { +#include "assets/objects/object_link_child/gLinkChildSheathFarDL.inc.c" +}; + +Gfx gLinkChildLeftFistAndKokiriSwordFarDL[78] = { +#include "assets/objects/object_link_child/gLinkChildLeftFistAndKokiriSwordFarDL.inc.c" +}; + +Gfx gLinkChildRightHandHoldingOOTFarDL[74] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingOOTFarDL.inc.c" +}; + +Gfx gLinkChildRightHandHoldingFairyOcarinaFarDL[73] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingFairyOcarinaFarDL.inc.c" +}; + +Gfx gLinkChildRightHandHoldingSlingshotFarDL[57] = { +#include "assets/objects/object_link_child/gLinkChildRightHandHoldingSlingshotFarDL.inc.c" +}; + +Gfx gLinkChildLeftHandUpFarDL[41] = { +#include "assets/objects/object_link_child/gLinkChildLeftHandUpFarDL.inc.c" +}; + +Gfx gLinkChildRightArmStretchedSlingshotDL[134] = { +#include "assets/objects/object_link_child/gLinkChildRightArmStretchedSlingshotDL.inc.c" +}; + +Gfx gLinkChildBottleDL[33] = { +#include "assets/objects/object_link_child/gLinkChildBottleDL.inc.c" +}; + +Gfx gLinkChildDL_18580[25] = { +#include "assets/objects/object_link_child/gLinkChildDL_18580.inc.c" +}; + +Gfx gLinkChildBottle2DL[34] = { +#include "assets/objects/object_link_child/gLinkChildBottle2DL.inc.c" +}; + +// Far skeleton vertices and DLs + +Vtx gLinkChildRightFootFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightFootFarVtx.inc.c" +}; + +Vtx gLinkChildRightShinFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightShinFarVtx.inc.c" +}; + +Vtx gLinkChildRightThighFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightThighFarVtx.inc.c" +}; + +Vtx gLinkChildLeftFootFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFootFarVtx.inc.c" +}; + +Vtx gLinkChildLeftShinFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftShinFarVtx.inc.c" +}; + +Vtx gLinkChildLeftThighFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftThighFarVtx.inc.c" +}; + +Vtx gLinkChildWaistFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildWaistFarVtx.inc.c" +}; + +Vtx gLinkChildHatFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHatFarVtx.inc.c" +}; + +Vtx gLinkChildHeadFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHeadFarVtx.inc.c" +}; + +Vtx gLinkChildCollarFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildCollarFarVtx.inc.c" +}; + +Vtx gLinkChildVtx_019E08[] = { +#include "assets/objects/object_link_child/gLinkChildVtx_019E08.inc.c" +}; + +Vtx gLinkChildLeftForearmFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftForearmFarVtx.inc.c" +}; + +Vtx gLinkChildLeftShoulderFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftShoulderFarVtx.inc.c" +}; + +Vtx gLinkChildVtx_01A428[] = { +#include "assets/objects/object_link_child/gLinkChildVtx_01A428.inc.c" +}; + +Vtx gLinkChildRightForearmFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightForearmFarVtx.inc.c" +}; + +Vtx gLinkChildRightShoulderFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightShoulderFarVtx.inc.c" +}; + +Vtx gLinkChildVtx_01AA98[] = { +#include "assets/objects/object_link_child/gLinkChildVtx_01AA98.inc.c" +}; + +Vtx gLinkChildTorsoFarVtx[] = { +#include "assets/objects/object_link_child/gLinkChildTorsoFarVtx.inc.c" +}; + +Gfx gLinkChildWaistFarDL[70] = { +#include "assets/objects/object_link_child/gLinkChildWaistFarDL.inc.c" +}; + +Gfx gLinkChildRightThighFarDL[56] = { +#include "assets/objects/object_link_child/gLinkChildRightThighFarDL.inc.c" +}; + +Gfx gLinkChildRightShinFarDL[75] = { +#include "assets/objects/object_link_child/gLinkChildRightShinFarDL.inc.c" +}; + +Gfx gLinkChildRightFootFarDL[37] = { +#include "assets/objects/object_link_child/gLinkChildRightFootFarDL.inc.c" +}; + +Gfx gLinkChildLeftThighFarDL[56] = { +#include "assets/objects/object_link_child/gLinkChildLeftThighFarDL.inc.c" +}; + +Gfx gLinkChildLeftShinFarDL[75] = { +#include "assets/objects/object_link_child/gLinkChildLeftShinFarDL.inc.c" +}; + +Gfx gLinkChildLeftFootFarDL[37] = { +#include "assets/objects/object_link_child/gLinkChildLeftFootFarDL.inc.c" +}; + +Gfx gLinkChildCollarFarDL[12] = { +#include "assets/objects/object_link_child/gLinkChildCollarFarDL.inc.c" +}; + +Gfx gLinkChildTorsoFarDL[57] = { +#include "assets/objects/object_link_child/gLinkChildTorsoFarDL.inc.c" +}; + +Gfx gLinkChildHeadFarDL[161] = { +#include "assets/objects/object_link_child/gLinkChildHeadFarDL.inc.c" +}; + +Gfx gLinkChildHatFarDL[30] = { +#include "assets/objects/object_link_child/gLinkChildHatFarDL.inc.c" +}; + +Gfx gLinkChildRightShoulderFarDL[56] = { +#include "assets/objects/object_link_child/gLinkChildRightShoulderFarDL.inc.c" +}; + +Gfx gLinkChildRightForearmFarDL[38] = { +#include "assets/objects/object_link_child/gLinkChildRightForearmFarDL.inc.c" +}; + +Gfx gLinkChildLeftShoulderFarDL[56] = { +#include "assets/objects/object_link_child/gLinkChildLeftShoulderFarDL.inc.c" +}; + +Gfx gLinkChildLeftForearmFarDL[38] = { +#include "assets/objects/object_link_child/gLinkChildLeftForearmFarDL.inc.c" +}; + +// Near skeleton vertices and DLs + +Vtx gLinkChildRightFootNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightFootNearVtx.inc.c" +}; + +Vtx gLinkChildRightShinNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightShinNearVtx.inc.c" +}; + +Vtx gLinkChildRightThighNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightThighNearVtx.inc.c" +}; + +Vtx gLinkChildLeftFootNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftFootNearVtx.inc.c" +}; + +Vtx gLinkChildLeftShinNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftShinNearVtx.inc.c" +}; + +Vtx gLinkChildLeftThighNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftThighNearVtx.inc.c" +}; + +Vtx gLinkChildWaistNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildWaistNearVtx.inc.c" +}; + +Vtx gLinkChildHatNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHatNearVtx.inc.c" +}; + +Vtx gLinkChildHeadNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildHeadNearVtx.inc.c" +}; + +Vtx gLinkChildCollarNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildCollarNearVtx.inc.c" +}; + +Vtx gLinkChildVtx_01EB38[] = { +#include "assets/objects/object_link_child/gLinkChildVtx_01EB38.inc.c" +}; + +Vtx gLinkChildLeftForearmNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftForearmNearVtx.inc.c" +}; + +Vtx gLinkChildLeftShoulderNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildLeftShoulderNearVtx.inc.c" +}; + +Vtx gLinkChildVtx_01F2B8[] = { +#include "assets/objects/object_link_child/gLinkChildVtx_01F2B8.inc.c" +}; + +Vtx gLinkChildRightForearmNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightForearmNearVtx.inc.c" +}; + +Vtx gLinkChildRightShoulderNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildRightShoulderNearVtx.inc.c" +}; + +Vtx gLinkChildVtx_01FA28[] = { +#include "assets/objects/object_link_child/gLinkChildVtx_01FA28.inc.c" +}; + +Vtx gLinkChildTorsoNearVtx[] = { +#include "assets/objects/object_link_child/gLinkChildTorsoNearVtx.inc.c" +}; + +Gfx gLinkChildWaistNearDL[73] = { +#include "assets/objects/object_link_child/gLinkChildWaistNearDL.inc.c" +}; + +Gfx gLinkChildRightThighNearDL[63] = { +#include "assets/objects/object_link_child/gLinkChildRightThighNearDL.inc.c" +}; + +Gfx gLinkChildRightShinNearDL[82] = { +#include "assets/objects/object_link_child/gLinkChildRightShinNearDL.inc.c" +}; + +Gfx gLinkChildRightFootNearDL[44] = { +#include "assets/objects/object_link_child/gLinkChildRightFootNearDL.inc.c" +}; + +Gfx gLinkChildLeftThighNearDL[63] = { +#include "assets/objects/object_link_child/gLinkChildLeftThighNearDL.inc.c" +}; + +Gfx gLinkChildLeftShinNearDL[82] = { +#include "assets/objects/object_link_child/gLinkChildLeftShinNearDL.inc.c" +}; + +Gfx gLinkChildLeftFootNearDL[44] = { +#include "assets/objects/object_link_child/gLinkChildLeftFootNearDL.inc.c" +}; + +Gfx gLinkChildCollarNearDL[14] = { +#include "assets/objects/object_link_child/gLinkChildCollarNearDL.inc.c" +}; + +Gfx gLinkChildTorsoNearDL[70] = { +#include "assets/objects/object_link_child/gLinkChildTorsoNearDL.inc.c" +}; + +Gfx gLinkChildHeadNearDL[202] = { +#include "assets/objects/object_link_child/gLinkChildHeadNearDL.inc.c" +}; + +Gfx gLinkChildHatNearDL[39] = { +#include "assets/objects/object_link_child/gLinkChildHatNearDL.inc.c" +}; + +Gfx gLinkChildRightShoulderNearDL[58] = { +#include "assets/objects/object_link_child/gLinkChildRightShoulderNearDL.inc.c" +}; + +Gfx gLinkChildRightForearmNearDL[44] = { +#include "assets/objects/object_link_child/gLinkChildRightForearmNearDL.inc.c" +}; + +Gfx gLinkChildLeftShoulderNearDL[58] = { +#include "assets/objects/object_link_child/gLinkChildLeftShoulderNearDL.inc.c" +}; + +Gfx gLinkChildLeftForearmNearDL[44] = { +#include "assets/objects/object_link_child/gLinkChildLeftForearmNearDL.inc.c" +}; + +// Slingshot string + +Vtx gLinkChildSlingshotStringVtx[] = { +#include "assets/objects/object_link_child/gLinkChildSlingshotStringVtx.inc.c" +}; + +Gfx gLinkChildSlingshotStringDL[12] = { +#include "assets/objects/object_link_child/gLinkChildSlingshotStringDL.inc.c" +}; + +// Deku shield + +Vtx gLinkChildDekuShieldVtx[] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldVtx.inc.c" +}; + +Gfx gLinkChildDekuShieldDL[42] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldDL.inc.c" +}; + +Mtx gLinkChildDekuShieldMtx = +#include "assets/objects/object_link_child/gLinkChildDekuShieldMtx.inc.c" + ; + +Gfx gLinkChildDekuShieldWithMatrixDL[3] = { +#include "assets/objects/object_link_child/gLinkChildDekuShieldWithMatrixDL.inc.c" +}; + +// Masks + +#define gLinkChildSpookyMaskTex_WIDTH 32 +#define gLinkChildSpookyMaskTex_HEIGHT 64 +u64 gLinkChildSpookyMaskTex[TEX_LEN(u64, gLinkChildSpookyMaskTex_WIDTH, gLinkChildSpookyMaskTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildSpookyMaskTex.ia16.inc.c" +}; + +#define gLinkChildKeatonMaskEyeBrowTex_WIDTH 32 +#define gLinkChildKeatonMaskEyeBrowTex_HEIGHT 16 +u64 gLinkChildKeatonMaskEyeBrowTex[TEX_LEN(u64, gLinkChildKeatonMaskEyeBrowTex_WIDTH, + gLinkChildKeatonMaskEyeBrowTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildKeatonMaskEyeBrowTex.rgba16.inc.c" +}; + +#define gLinkChildKeatonMaskEarTex_WIDTH 8 +#define gLinkChildKeatonMaskEarTex_HEIGHT 8 +u64 gLinkChildKeatonMaskEarTex[TEX_LEN(u64, gLinkChildKeatonMaskEarTex_WIDTH, gLinkChildKeatonMaskEarTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildKeatonMaskEarTex.rgba16.inc.c" +}; + +#define gLinkChildSkullMaskEyeTex_WIDTH 16 +#define gLinkChildSkullMaskEyeTex_HEIGHT 16 +u64 gLinkChildSkullMaskEyeTex[TEX_LEN(u64, gLinkChildSkullMaskEyeTex_WIDTH, gLinkChildSkullMaskEyeTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildSkullMaskEyeTex.rgba16.inc.c" +}; + +#define gLinkChildMaskOfTruthTex_WIDTH 32 +#define gLinkChildMaskOfTruthTex_HEIGHT 64 +u64 gLinkChildMaskOfTruthTex[TEX_LEN(u64, gLinkChildMaskOfTruthTex_WIDTH, gLinkChildMaskOfTruthTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildMaskOfTruthTex.rgba16.inc.c" +}; + +#define gLinkChildMaskOfTruthCurveTex_WIDTH 16 +#define gLinkChildMaskOfTruthCurveTex_HEIGHT 32 +u64 gLinkChildMaskOfTruthCurveTex[TEX_LEN(u64, gLinkChildMaskOfTruthCurveTex_WIDTH, + gLinkChildMaskOfTruthCurveTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildMaskOfTruthCurveTex.rgba16.inc.c" +}; + +#define gLinkChildGoronMaskMouthTex_WIDTH 64 +#define gLinkChildGoronMaskMouthTex_HEIGHT 32 +u64 gLinkChildGoronMaskMouthTex[TEX_LEN(u64, gLinkChildGoronMaskMouthTex_WIDTH, gLinkChildGoronMaskMouthTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGoronMaskMouthTex.rgba16.inc.c" +}; + +#define gLinkChildGoronMaskEyeTex_WIDTH 32 +#define gLinkChildGoronMaskEyeTex_HEIGHT 32 +u64 gLinkChildGoronMaskEyeTex[TEX_LEN(u64, gLinkChildGoronMaskEyeTex_WIDTH, gLinkChildGoronMaskEyeTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildGoronMaskEyeTex.rgba16.inc.c" +}; + +#define gLinkChildGoronMaskNoseTex_WIDTH 8 +#define gLinkChildGoronMaskNoseTex_HEIGHT 8 +u64 gLinkChildGoronMaskNoseTex[TEX_LEN(u64, gLinkChildGoronMaskNoseTex_WIDTH, gLinkChildGoronMaskNoseTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGoronMaskNoseTex.rgba16.inc.c" +}; + +#define gLinkChildGoronMaskHairTex_WIDTH 16 +#define gLinkChildGoronMaskHairTex_HEIGHT 16 +u64 gLinkChildGoronMaskHairTex[TEX_LEN(u64, gLinkChildGoronMaskHairTex_WIDTH, gLinkChildGoronMaskHairTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGoronMaskHairTex.rgba16.inc.c" +}; + +#define gLinkChildSkullMaskTeethTex_WIDTH 8 +#define gLinkChildSkullMaskTeethTex_HEIGHT 8 +u64 gLinkChildSkullMaskTeethTex[TEX_LEN(u64, gLinkChildSkullMaskTeethTex_WIDTH, gLinkChildSkullMaskTeethTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildSkullMaskTeethTex.rgba16.inc.c" +}; + +#define gLinkChildGoronMaskEarTex_WIDTH 8 +#define gLinkChildGoronMaskEarTex_HEIGHT 8 +u64 gLinkChildGoronMaskEarTex[TEX_LEN(u64, gLinkChildGoronMaskEarTex_WIDTH, gLinkChildGoronMaskEarTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildGoronMaskEarTex.rgba16.inc.c" +}; + +#define gLinkChildZoraMaskEyeBoarderTex_WIDTH 8 +#define gLinkChildZoraMaskEyeBoarderTex_HEIGHT 8 +u64 gLinkChildZoraMaskEyeBoarderTex[TEX_LEN(u64, gLinkChildZoraMaskEyeBoarderTex_WIDTH, + gLinkChildZoraMaskEyeBoarderTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildZoraMaskEyeBoarderTex.rgba16.inc.c" +}; + +#define gLinkChildZoraMaskEarTex_WIDTH 32 +#define gLinkChildZoraMaskEarTex_HEIGHT 32 +u64 gLinkChildZoraMaskEarTex[TEX_LEN(u64, gLinkChildZoraMaskEarTex_WIDTH, gLinkChildZoraMaskEarTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildZoraMaskEarTex.rgba16.inc.c" +}; + +#define gLinkChildSkullMaskNoseTex_WIDTH 8 +#define gLinkChildSkullMaskNoseTex_HEIGHT 8 +u64 gLinkChildSkullMaskNoseTex[TEX_LEN(u64, gLinkChildSkullMaskNoseTex_WIDTH, gLinkChildSkullMaskNoseTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildSkullMaskNoseTex.rgba16.inc.c" +}; + +#define gLinkChildZoraMaskEyeTex_WIDTH 32 +#define gLinkChildZoraMaskEyeTex_HEIGHT 32 +u64 gLinkChildZoraMaskEyeTex[TEX_LEN(u64, gLinkChildZoraMaskEyeTex_WIDTH, gLinkChildZoraMaskEyeTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildZoraMaskEyeTex.rgba16.inc.c" +}; + +#define gLinkChildZoraMaskMouthTex_WIDTH 32 +#define gLinkChildZoraMaskMouthTex_HEIGHT 32 +u64 gLinkChildZoraMaskMouthTex[TEX_LEN(u64, gLinkChildZoraMaskMouthTex_WIDTH, gLinkChildZoraMaskMouthTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildZoraMaskMouthTex.rgba16.inc.c" +}; + +#define gLinkChildGerudoMaskEyeTex_WIDTH 32 +#define gLinkChildGerudoMaskEyeTex_HEIGHT 32 +u64 gLinkChildGerudoMaskEyeTex[TEX_LEN(u64, gLinkChildGerudoMaskEyeTex_WIDTH, gLinkChildGerudoMaskEyeTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGerudoMaskEyeTex.rgba16.inc.c" +}; + +#define gLinkChildGerudoMaskMouthTex_WIDTH 16 +#define gLinkChildGerudoMaskMouthTex_HEIGHT 16 +u64 gLinkChildGerudoMaskMouthTex[TEX_LEN(u64, gLinkChildGerudoMaskMouthTex_WIDTH, gLinkChildGerudoMaskMouthTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGerudoMaskMouthTex.rgba16.inc.c" +}; + +#define gLinkChildGerudoMaskHairTex_WIDTH 16 +#define gLinkChildGerudoMaskHairTex_HEIGHT 16 +u64 gLinkChildGerudoMaskHairTex[TEX_LEN(u64, gLinkChildGerudoMaskHairTex_WIDTH, gLinkChildGerudoMaskHairTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGerudoMaskHairTex.rgba16.inc.c" +}; + +#define gLinkChildGerudoMaskNoseTex_WIDTH 8 +#define gLinkChildGerudoMaskNoseTex_HEIGHT 8 +u64 gLinkChildGerudoMaskNoseTex[TEX_LEN(u64, gLinkChildGerudoMaskNoseTex_WIDTH, gLinkChildGerudoMaskNoseTex_HEIGHT, + 16)] = { +#include "assets/objects/object_link_child/gLinkChildGerudoMaskNoseTex.rgba16.inc.c" +}; + +Vtx gLinkChildSkullMaskVtx[] = { +#include "assets/objects/object_link_child/gLinkChildSkullMaskVtx.inc.c" +}; + +Vtx gLinkChildSpookyMaskVtx[] = { +#include "assets/objects/object_link_child/gLinkChildSpookyMaskVtx.inc.c" +}; + +Vtx gLinkChildKeatonMaskVtx[] = { +#include "assets/objects/object_link_child/gLinkChildKeatonMaskVtx.inc.c" +}; + +Vtx gLinkChildMaskOfTruthVtx[] = { +#include "assets/objects/object_link_child/gLinkChildMaskOfTruthVtx.inc.c" +}; + +Vtx gLinkChildGoronMaskVtx[] = { +#include "assets/objects/object_link_child/gLinkChildGoronMaskVtx.inc.c" +}; + +Vtx gLinkChildZoraMaskVtx[] = { +#include "assets/objects/object_link_child/gLinkChildZoraMaskVtx.inc.c" +}; + +Vtx gLinkChildGerudoMaskVtx[] = { +#include "assets/objects/object_link_child/gLinkChildGerudoMaskVtx.inc.c" +}; + +Gfx gLinkChildSkullMaskDL[70] = { +#include "assets/objects/object_link_child/gLinkChildSkullMaskDL.inc.c" +}; + +Gfx gLinkChildSpookyMaskDL[30] = { +#include "assets/objects/object_link_child/gLinkChildSpookyMaskDL.inc.c" +}; + +Gfx gLinkChildKeatonMaskDL[50] = { +#include "assets/objects/object_link_child/gLinkChildKeatonMaskDL.inc.c" +}; + +Gfx gLinkChildMaskOfTruthDL[44] = { +#include "assets/objects/object_link_child/gLinkChildMaskOfTruthDL.inc.c" +}; + +Gfx gLinkChildGoronMaskDL[70] = { +#include "assets/objects/object_link_child/gLinkChildGoronMaskDL.inc.c" +}; + +Gfx gLinkChildZoraMaskDL[65] = { +#include "assets/objects/object_link_child/gLinkChildZoraMaskDL.inc.c" +}; + +Gfx gLinkChildGerudoMaskDL[84] = { +#include "assets/objects/object_link_child/gLinkChildGerudoMaskDL.inc.c" +}; + +// Bunny hood + +#define gLinkChildBunnyHoodEyeTex_WIDTH 16 +#define gLinkChildBunnyHoodEyeTex_HEIGHT 16 +u64 gLinkChildBunnyHoodEyeTex[TEX_LEN(u64, gLinkChildBunnyHoodEyeTex_WIDTH, gLinkChildBunnyHoodEyeTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildBunnyHoodEyeTex.rgba16.inc.c" +}; + +#define gLinkChildBunnyHoodTex_WIDTH 16 +#define gLinkChildBunnyHoodTex_HEIGHT 32 +u64 gLinkChildBunnyHoodTex[TEX_LEN(u64, gLinkChildBunnyHoodTex_WIDTH, gLinkChildBunnyHoodTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildBunnyHoodTex.rgba16.inc.c" +}; + +#define gLinkChildBunnyHoodEarTex_WIDTH 16 +#define gLinkChildBunnyHoodEarTex_HEIGHT 32 +u64 gLinkChildBunnyHoodEarTex[TEX_LEN(u64, gLinkChildBunnyHoodEarTex_WIDTH, gLinkChildBunnyHoodEarTex_HEIGHT, 16)] = { +#include "assets/objects/object_link_child/gLinkChildBunnyHoodEarTex.rgba16.inc.c" +}; + +Vtx gLinkChildBunnyHoodVtx[] = { +#include "assets/objects/object_link_child/gLinkChildBunnyHoodVtx.inc.c" +}; + +Gfx gLinkChildBunnyHoodDL[114] = { +#include "assets/objects/object_link_child/gLinkChildBunnyHoodDL.inc.c" +}; + +// Skeleton + +LodLimb gLinkChildRootLimb = { +#include "assets/objects/object_link_child/gLinkChildRootLimb.inc.c" +}; + +LodLimb gLinkChildWaistLimb = { +#include "assets/objects/object_link_child/gLinkChildWaistLimb.inc.c" +}; + +LodLimb gLinkChildLowerControlLimb = { +#include "assets/objects/object_link_child/gLinkChildLowerControlLimb.inc.c" +}; + +LodLimb gLinkChildRightThighLimb = { +#include "assets/objects/object_link_child/gLinkChildRightThighLimb.inc.c" +}; + +LodLimb gLinkChildRightShinLimb = { +#include "assets/objects/object_link_child/gLinkChildRightShinLimb.inc.c" +}; + +LodLimb gLinkChildRightFootLimb = { +#include "assets/objects/object_link_child/gLinkChildRightFootLimb.inc.c" +}; + +LodLimb gLinkChildLeftThighLimb = { +#include "assets/objects/object_link_child/gLinkChildLeftThighLimb.inc.c" +}; + +LodLimb gLinkChildLeftShinLimb = { +#include "assets/objects/object_link_child/gLinkChildLeftShinLimb.inc.c" +}; + +LodLimb gLinkChildLeftFootLimb = { +#include "assets/objects/object_link_child/gLinkChildLeftFootLimb.inc.c" +}; + +LodLimb gLinkChildUpperControlLimb = { +#include "assets/objects/object_link_child/gLinkChildUpperControlLimb.inc.c" +}; + +LodLimb gLinkChildHeadLimb = { +#include "assets/objects/object_link_child/gLinkChildHeadLimb.inc.c" +}; + +LodLimb gLinkChildHatLimb = { +#include "assets/objects/object_link_child/gLinkChildHatLimb.inc.c" +}; + +LodLimb gLinkChildCollarLimb = { +#include "assets/objects/object_link_child/gLinkChildCollarLimb.inc.c" +}; + +LodLimb gLinkChildLeftshoulderLimb = { +#include "assets/objects/object_link_child/gLinkChildLeftshoulderLimb.inc.c" +}; + +LodLimb gLinkChildLeftForearmLimb = { +#include "assets/objects/object_link_child/gLinkChildLeftForearmLimb.inc.c" +}; + +LodLimb gLinkChildLeftHandLimb = { +#include "assets/objects/object_link_child/gLinkChildLeftHandLimb.inc.c" +}; + +LodLimb gLinkChildRightshoulderLimb = { +#include "assets/objects/object_link_child/gLinkChildRightshoulderLimb.inc.c" +}; + +LodLimb gLinkChildRightForearmLimb = { +#include "assets/objects/object_link_child/gLinkChildRightForearmLimb.inc.c" +}; + +LodLimb gLinkChildRightHandLimb = { +#include "assets/objects/object_link_child/gLinkChildRightHandLimb.inc.c" +}; + +LodLimb gLinkChildSwordAndSheathLimb = { +#include "assets/objects/object_link_child/gLinkChildSwordAndSheathLimb.inc.c" +}; + +LodLimb gLinkChildTorsoLimb = { +#include "assets/objects/object_link_child/gLinkChildTorsoLimb.inc.c" +}; + +void* gLinkChildLimbs[] = { +#include "assets/objects/object_link_child/gLinkChildLimbs.inc.c" +}; + +FlexSkeletonHeader gLinkChildSkel = { +#include "assets/objects/object_link_child/gLinkChildSkel.inc.c" +}; diff --git a/assets/objects/object_link_child/object_link_child.h b/assets/objects/object_link_child/object_link_child.h new file mode 100644 index 0000000000..0641714080 --- /dev/null +++ b/assets/objects/object_link_child/object_link_child.h @@ -0,0 +1,87 @@ +#ifndef OBJECT_LINK_CHILD_H +#define OBJECT_LINK_CHILD_H + +#include "ultra64.h" +#include "tex_len.h" +#include "animation.h" + +#define LINK_CHILD_EYES_TEX_WIDTH 64 +#define LINK_CHILD_EYES_TEX_HEIGHT 32 +extern u64 gLinkChildEyesOpenTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkChildEyesHalfTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkChildEyesClosedfTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkChildEyesLeftTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkChildEyesRightTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkChildEyesWideTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkChildEyesDownTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; +extern u64 gLinkChildEyesWincingTex[TEX_LEN(u64, LINK_CHILD_EYES_TEX_WIDTH, LINK_CHILD_EYES_TEX_HEIGHT, 8)]; + +#define LINK_CHILD_MOUTH_TEX_WIDTH 32 +#define LINK_CHILD_MOUTH_TEX_HEIGHT 32 +extern u64 gLinkChildMouthClosedTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)]; +extern u64 gLinkChildMouthHalfTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)]; +extern u64 gLinkChildMouthOpenTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)]; +extern u64 gLinkChildMouthSmileTex[TEX_LEN(u64, LINK_CHILD_MOUTH_TEX_WIDTH, LINK_CHILD_MOUTH_TEX_HEIGHT, 8)]; + +extern Gfx gLinkChildLinkDekuStickDL[41]; + +extern Gfx gLinkChildLeftHandNearDL[45]; +extern Gfx gLinkChildLeftFistNearDL[36]; +extern Gfx gLinkChildLeftFistAndKokiriSwordNearDL[81]; +extern Gfx gLinkChildRightHandNearDL[44]; +extern Gfx gLinkChildRightHandClosedNearDL[36]; +extern Gfx gLinkChildRightFistAndDekuShieldNearDL[68]; +extern Gfx gLinkChildLeftFistAndBoomerangNearDL[73]; +extern Gfx gLinkChildHylianShieldSwordAndSheathNearDL[83]; +extern Gfx gLinkChildHylianShieldAndSheathNearDL[69]; +extern Gfx gLinkChildDekuShieldSwordAndSheathNearDL[85]; +extern Gfx gLinkChildDekuShieldAndSheathNearDL[71]; +extern Gfx gLinkChildSwordAndSheathNearDL[56]; +extern Gfx gLinkChildSheathNearDL[39]; +extern Gfx gLinkChildLeftHandHoldingMasterSwordDL[131]; +extern Gfx gLinkChildRightHandAndOotNearDL[74]; +extern Gfx gLinkChildRightHandHoldingFairyOcarinaNearDL[73]; +extern Gfx gLinkChildRightHandHoldingSlingshotNearDL[60]; +extern Gfx gLinkChildLeftHandUpNearDL[41]; +extern Gfx gLinkChildGoronBraceletDL[45]; +extern Gfx gLinkChildLeftHandFarDL[40]; +extern Gfx gLinkChildLeftFistFarDL[36]; +extern Gfx gLinkChildRightHandFarDL[40]; +extern Gfx gLinkChildRightHandClosedFarDL[36]; +extern Gfx gLinkChildRightFistAndDekuShieldFarDL[57]; +extern Gfx gLinkChildLeftFistAndBoomerangFarDL[50]; +extern Gfx gLinkChildHylianShieldSwordAndSheathFarDL[76]; +extern Gfx gLinkChildHylianShieldAndSheathFarDL[62]; +extern Gfx gLinkChildDekuShieldSwordAndSheathFarDL[77]; +extern Gfx gLinkChildDekuShieldAndSheathFarDL[66]; +extern Gfx gLinkChildSwordAndSheathFarDL[52]; +extern Gfx gLinkChildSheathFarDL[38]; +extern Gfx gLinkChildLeftFistAndKokiriSwordFarDL[78]; +extern Gfx gLinkChildRightHandHoldingOOTFarDL[74]; +extern Gfx gLinkChildRightHandHoldingFairyOcarinaFarDL[73]; +extern Gfx gLinkChildRightHandHoldingSlingshotFarDL[57]; +extern Gfx gLinkChildRightArmStretchedSlingshotDL[134]; +extern Gfx gLinkChildBottleDL[33]; + +extern Gfx gLinkChildWaistFarDL[70]; + +extern Gfx gLinkChildWaistNearDL[73]; +extern Gfx gLinkChildRightShoulderNearDL[58]; + +extern Gfx gLinkChildSlingshotStringDL[12]; + +extern Gfx gLinkChildDekuShieldDL[42]; +extern Gfx gLinkChildDekuShieldWithMatrixDL[3]; + +extern Gfx gLinkChildSkullMaskDL[70]; +extern Gfx gLinkChildSpookyMaskDL[30]; +extern Gfx gLinkChildKeatonMaskDL[50]; +extern Gfx gLinkChildMaskOfTruthDL[44]; +extern Gfx gLinkChildGoronMaskDL[70]; +extern Gfx gLinkChildZoraMaskDL[65]; +extern Gfx gLinkChildGerudoMaskDL[84]; +extern Gfx gLinkChildBunnyHoodDL[114]; + +extern FlexSkeletonHeader gLinkChildSkel; + +#endif diff --git a/assets/textures/icon_item_24_static/icon_item_24_static.c b/assets/textures/icon_item_24_static/icon_item_24_static.c new file mode 100644 index 0000000000..5afa6764c0 --- /dev/null +++ b/assets/textures/icon_item_24_static/icon_item_24_static.c @@ -0,0 +1,81 @@ +#include "icon_item_24_static.h" + +u64 gQuestIconMedallionForestTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMedallionForestTex.rgba32.inc.c" +}; + +u64 gQuestIconMedallionFireTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMedallionFireTex.rgba32.inc.c" +}; + +u64 gQuestIconMedallionWaterTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMedallionWaterTex.rgba32.inc.c" +}; + +u64 gQuestIconMedallionSpiritTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMedallionSpiritTex.rgba32.inc.c" +}; + +u64 gQuestIconMedallionShadowTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMedallionShadowTex.rgba32.inc.c" +}; + +u64 gQuestIconMedallionLightTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMedallionLightTex.rgba32.inc.c" +}; + +u64 gQuestIconKokiriEmeraldTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconKokiriEmeraldTex.rgba32.inc.c" +}; + +u64 gQuestIconGoronRubyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconGoronRubyTex.rgba32.inc.c" +}; + +u64 gQuestIconZoraSapphireTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconZoraSapphireTex.rgba32.inc.c" +}; + +u64 gQuestIconStoneOfAgonyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconStoneOfAgonyTex.rgba32.inc.c" +}; + +u64 gQuestIconGerudosCardTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconGerudosCardTex.rgba32.inc.c" +}; + +u64 gQuestIconGoldSkulltulaTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconGoldSkulltulaTex.rgba32.inc.c" +}; + +u64 gQuestIconHeartContainerTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconHeartContainerTex.rgba32.inc.c" +}; + +u64 gQuestIconHeartPieceTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconHeartPieceTex.rgba32.inc.c" +}; + +u64 gQuestIconDungeonBossKeyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconDungeonBossKeyTex.rgba32.inc.c" +}; + +u64 gQuestIconDungeonCompassTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconDungeonCompassTex.rgba32.inc.c" +}; + +u64 gQuestIconDungeonMapTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconDungeonMapTex.rgba32.inc.c" +}; + +u64 gQuestIconSmallKeyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconSmallKeyTex.rgba32.inc.c" +}; + +u64 gQuestIconMagicJarSmallTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMagicJarSmallTex.rgba32.inc.c" +}; + +u64 gQuestIconMagicJarBigTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_24_static/gQuestIconMagicJarBigTex.rgba32.inc.c" +}; diff --git a/assets/textures/icon_item_24_static/icon_item_24_static.h b/assets/textures/icon_item_24_static/icon_item_24_static.h new file mode 100644 index 0000000000..2b9a1bc88b --- /dev/null +++ b/assets/textures/icon_item_24_static/icon_item_24_static.h @@ -0,0 +1,29 @@ +#ifndef ICON_ITEM_24_STATIC_H +#define ICON_ITEM_24_STATIC_H + +#include "ultra64.h" +#include "tex_len.h" +#include "interface.h" + +extern u64 gQuestIconMedallionForestTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconMedallionFireTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconMedallionWaterTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconMedallionSpiritTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconMedallionShadowTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconMedallionLightTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconKokiriEmeraldTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconGoronRubyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconZoraSapphireTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconStoneOfAgonyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconGerudosCardTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconGoldSkulltulaTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconHeartContainerTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconHeartPieceTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconDungeonBossKeyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconDungeonCompassTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconDungeonMapTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconSmallKeyTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconMagicJarSmallTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; +extern u64 gQuestIconMagicJarBigTex[TEX_LEN(u64, QUEST_ICON_WIDTH, QUEST_ICON_HEIGHT, 32)]; + +#endif diff --git a/assets/textures/icon_item_fra_static/icon_item_fra_static.c b/assets/textures/icon_item_fra_static/icon_item_fra_static.c new file mode 100644 index 0000000000..80dae50a8d --- /dev/null +++ b/assets/textures/icon_item_fra_static/icon_item_fra_static.c @@ -0,0 +1,135 @@ +#include "icon_item_fra_static.h" + +u64 gPauseDekuTitleFRATex[TEX_LEN(u64, gPauseDekuTitleFRATex_WIDTH, gPauseDekuTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseDekuTitleFRATex.ia8.inc.c" +}; + +u64 gPauseDodongoTitleFRATex[TEX_LEN(u64, gPauseDodongoTitleFRATex_WIDTH, gPauseDodongoTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseDodongoTitleFRATex.ia8.inc.c" +}; + +u64 gPauseJabuTitleFRATex[TEX_LEN(u64, gPauseJabuTitleFRATex_WIDTH, gPauseJabuTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseJabuTitleFRATex.ia8.inc.c" +}; + +u64 gPauseForestTitleFRATex[TEX_LEN(u64, gPauseForestTitleFRATex_WIDTH, gPauseForestTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseForestTitleFRATex.ia8.inc.c" +}; + +u64 gPauseFireTitleFRATex[TEX_LEN(u64, gPauseFireTitleFRATex_WIDTH, gPauseFireTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseFireTitleFRATex.ia8.inc.c" +}; + +u64 gPauseWaterTitleFRATex[TEX_LEN(u64, gPauseWaterTitleFRATex_WIDTH, gPauseWaterTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseWaterTitleFRATex.ia8.inc.c" +}; + +u64 gPauseSpiritTitleFRATex[TEX_LEN(u64, gPauseSpiritTitleFRATex_WIDTH, gPauseSpiritTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSpiritTitleFRATex.ia8.inc.c" +}; + +u64 gPauseShadowTitleFRATex[TEX_LEN(u64, gPauseShadowTitleFRATex_WIDTH, gPauseShadowTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseShadowTitleFRATex.ia8.inc.c" +}; + +u64 gPauseBotWTitleFRATex[TEX_LEN(u64, gPauseBotWTitleFRATex_WIDTH, gPauseBotWTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseBotWTitleFRATex.ia8.inc.c" +}; + +u64 gPauseIceCavernTitleFRATex[TEX_LEN(u64, gPauseIceCavernTitleFRATex_WIDTH, gPauseIceCavernTitleFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseIceCavernTitleFRATex.ia8.inc.c" +}; + +u64 gPauseToEquipFRATex[TEX_LEN(u64, gPauseToEquipFRATex_WIDTH, gPauseToEquipFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseToEquipFRATex.ia8.inc.c" +}; + +u64 gPauseToDecideFRATex[TEX_LEN(u64, gPauseToDecideFRATex_WIDTH, gPauseToDecideFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseToDecideFRATex.ia8.inc.c" +}; + +u64 gPauseToPlayMelodyFRATex[TEX_LEN(u64, gPauseToPlayMelodyFRATex_WIDTH, gPauseToPlayMelodyFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseToPlayMelodyFRATex.ia8.inc.c" +}; + +u64 gPauseToSelectItemFRATex[TEX_LEN(u64, gPauseToSelectItemFRATex_WIDTH, gPauseToSelectItemFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseToSelectItemFRATex.ia8.inc.c" +}; + +u64 gPauseToMapFRATex[TEX_LEN(u64, gPauseToMapFRATex_WIDTH, gPauseToMapFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseToMapFRATex.ia8.inc.c" +}; + +u64 gPauseToQuestStatusFRATex[TEX_LEN(u64, gPauseToQuestStatusFRATex_WIDTH, gPauseToQuestStatusFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseToQuestStatusFRATex.ia8.inc.c" +}; + +u64 gPauseToEquipmentFRATex[TEX_LEN(u64, gPauseToEquipmentFRATex_WIDTH, gPauseToEquipmentFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseToEquipmentFRATex.ia8.inc.c" +}; + +u64 gPauseSavePromptFRATex[TEX_LEN(u64, gPauseSavePromptFRATex_WIDTH, gPauseSavePromptFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSavePromptFRATex.ia8.inc.c" +}; + +u64 gPauseSaveConfirmationFRATex[TEX_LEN(u64, gPauseSaveConfirmationFRATex_WIDTH, gPauseSaveConfirmationFRATex_HEIGHT, + 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSaveConfirmationFRATex.ia8.inc.c" +}; + +u64 gPauseYesFRATex[TEX_LEN(u64, gPauseYesFRATex_WIDTH, gPauseYesFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseYesFRATex.ia8.inc.c" +}; + +u64 gPauseNoFRATex[TEX_LEN(u64, gPauseNoFRATex_WIDTH, gPauseNoFRATex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseNoFRATex.ia8.inc.c" +}; + +u64 gPauseCurrentPositionFRATex[TEX_LEN(u64, gPauseCurrentPositionFRATex_WIDTH, gPauseCurrentPositionFRATex_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_fra_static/gPauseCurrentPositionFRATex.i4.inc.c" +}; + +u64 gPauseEquipment00FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseEquipment00FRATex.ia8.inc.c" +}; + +u64 gPauseEquipment10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseEquipment10FRATex.ia8.inc.c" +}; + +u64 gPauseEquipment20FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseEquipment20FRATex.ia8.inc.c" +}; + +u64 gPauseSelectItem00FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSelectItem00FRATex.ia8.inc.c" +}; + +u64 gPauseSelectItem10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSelectItem10FRATex.ia8.inc.c" +}; + +u64 gPauseSelectItem20FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSelectItem20FRATex.ia8.inc.c" +}; + +u64 gPauseMap10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseMap10FRATex.ia8.inc.c" +}; + +u64 gPauseQuestStatus10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseQuestStatus10FRATex.ia8.inc.c" +}; + +u64 gPauseSave00FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSave00FRATex.ia8.inc.c" +}; + +u64 gPauseSave10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSave10FRATex.ia8.inc.c" +}; + +u64 gPauseSave20FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_fra_static/gPauseSave20FRATex.ia8.inc.c" +}; diff --git a/assets/textures/icon_item_fra_static/icon_item_fra_static.h b/assets/textures/icon_item_fra_static/icon_item_fra_static.h new file mode 100644 index 0000000000..2a7152a416 --- /dev/null +++ b/assets/textures/icon_item_fra_static/icon_item_fra_static.h @@ -0,0 +1,87 @@ +#ifndef ICON_ITEM_FRA_STATIC_H +#define ICON_ITEM_FRA_STATIC_H + +#include "ultra64.h" +#include "tex_len.h" +#include "src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h" + +#define gPauseDekuTitleFRATex_WIDTH 96 +#define gPauseDekuTitleFRATex_HEIGHT 16 +extern u64 gPauseDekuTitleFRATex[TEX_LEN(u64, gPauseDekuTitleFRATex_WIDTH, gPauseDekuTitleFRATex_HEIGHT, 8)]; +#define gPauseDodongoTitleFRATex_WIDTH 96 +#define gPauseDodongoTitleFRATex_HEIGHT 16 +extern u64 gPauseDodongoTitleFRATex[TEX_LEN(u64, gPauseDodongoTitleFRATex_WIDTH, gPauseDodongoTitleFRATex_HEIGHT, 8)]; +#define gPauseJabuTitleFRATex_WIDTH 96 +#define gPauseJabuTitleFRATex_HEIGHT 16 +extern u64 gPauseJabuTitleFRATex[TEX_LEN(u64, gPauseJabuTitleFRATex_WIDTH, gPauseJabuTitleFRATex_HEIGHT, 8)]; +#define gPauseForestTitleFRATex_WIDTH 96 +#define gPauseForestTitleFRATex_HEIGHT 16 +extern u64 gPauseForestTitleFRATex[TEX_LEN(u64, gPauseForestTitleFRATex_WIDTH, gPauseForestTitleFRATex_HEIGHT, 8)]; +#define gPauseFireTitleFRATex_WIDTH 96 +#define gPauseFireTitleFRATex_HEIGHT 16 +extern u64 gPauseFireTitleFRATex[TEX_LEN(u64, gPauseFireTitleFRATex_WIDTH, gPauseFireTitleFRATex_HEIGHT, 8)]; +#define gPauseWaterTitleFRATex_WIDTH 96 +#define gPauseWaterTitleFRATex_HEIGHT 16 +extern u64 gPauseWaterTitleFRATex[TEX_LEN(u64, gPauseWaterTitleFRATex_WIDTH, gPauseWaterTitleFRATex_HEIGHT, 8)]; +#define gPauseSpiritTitleFRATex_WIDTH 96 +#define gPauseSpiritTitleFRATex_HEIGHT 16 +extern u64 gPauseSpiritTitleFRATex[TEX_LEN(u64, gPauseSpiritTitleFRATex_WIDTH, gPauseSpiritTitleFRATex_HEIGHT, 8)]; +#define gPauseShadowTitleFRATex_WIDTH 96 +#define gPauseShadowTitleFRATex_HEIGHT 16 +extern u64 gPauseShadowTitleFRATex[TEX_LEN(u64, gPauseShadowTitleFRATex_WIDTH, gPauseShadowTitleFRATex_HEIGHT, 8)]; +#define gPauseBotWTitleFRATex_WIDTH 96 +#define gPauseBotWTitleFRATex_HEIGHT 16 +extern u64 gPauseBotWTitleFRATex[TEX_LEN(u64, gPauseBotWTitleFRATex_WIDTH, gPauseBotWTitleFRATex_HEIGHT, 8)]; +#define gPauseIceCavernTitleFRATex_WIDTH 96 +#define gPauseIceCavernTitleFRATex_HEIGHT 16 +extern u64 gPauseIceCavernTitleFRATex[TEX_LEN(u64, gPauseIceCavernTitleFRATex_WIDTH, gPauseIceCavernTitleFRATex_HEIGHT, 8)]; +#define gPauseToEquipFRATex_WIDTH 80 +#define gPauseToEquipFRATex_HEIGHT 16 +extern u64 gPauseToEquipFRATex[TEX_LEN(u64, gPauseToEquipFRATex_WIDTH, gPauseToEquipFRATex_HEIGHT, 8)]; +#define gPauseToDecideFRATex_WIDTH 72 +#define gPauseToDecideFRATex_HEIGHT 16 +extern u64 gPauseToDecideFRATex[TEX_LEN(u64, gPauseToDecideFRATex_WIDTH, gPauseToDecideFRATex_HEIGHT, 8)]; +#define gPauseToPlayMelodyFRATex_WIDTH 112 +#define gPauseToPlayMelodyFRATex_HEIGHT 16 +extern u64 gPauseToPlayMelodyFRATex[TEX_LEN(u64, gPauseToPlayMelodyFRATex_WIDTH, gPauseToPlayMelodyFRATex_HEIGHT, 8)]; +#define gPauseToSelectItemFRATex_WIDTH 128 +#define gPauseToSelectItemFRATex_HEIGHT 16 +extern u64 gPauseToSelectItemFRATex[TEX_LEN(u64, gPauseToSelectItemFRATex_WIDTH, gPauseToSelectItemFRATex_HEIGHT, 8)]; +#define gPauseToMapFRATex_WIDTH 128 +#define gPauseToMapFRATex_HEIGHT 16 +extern u64 gPauseToMapFRATex[TEX_LEN(u64, gPauseToMapFRATex_WIDTH, gPauseToMapFRATex_HEIGHT, 8)]; +#define gPauseToQuestStatusFRATex_WIDTH 128 +#define gPauseToQuestStatusFRATex_HEIGHT 16 +extern u64 gPauseToQuestStatusFRATex[TEX_LEN(u64, gPauseToQuestStatusFRATex_WIDTH, gPauseToQuestStatusFRATex_HEIGHT, 8)]; +#define gPauseToEquipmentFRATex_WIDTH 128 +#define gPauseToEquipmentFRATex_HEIGHT 16 +extern u64 gPauseToEquipmentFRATex[TEX_LEN(u64, gPauseToEquipmentFRATex_WIDTH, gPauseToEquipmentFRATex_HEIGHT, 8)]; +#define gPauseSavePromptFRATex_WIDTH 152 +#define gPauseSavePromptFRATex_HEIGHT 16 +extern u64 gPauseSavePromptFRATex[TEX_LEN(u64, gPauseSavePromptFRATex_WIDTH, gPauseSavePromptFRATex_HEIGHT, 8)]; +#define gPauseSaveConfirmationFRATex_WIDTH 152 +#define gPauseSaveConfirmationFRATex_HEIGHT 16 +extern u64 gPauseSaveConfirmationFRATex[TEX_LEN(u64, gPauseSaveConfirmationFRATex_WIDTH, gPauseSaveConfirmationFRATex_HEIGHT, 8)]; +#define gPauseYesFRATex_WIDTH 48 +#define gPauseYesFRATex_HEIGHT 16 +extern u64 gPauseYesFRATex[TEX_LEN(u64, gPauseYesFRATex_WIDTH, gPauseYesFRATex_HEIGHT, 8)]; +#define gPauseNoFRATex_WIDTH 48 +#define gPauseNoFRATex_HEIGHT 16 +extern u64 gPauseNoFRATex[TEX_LEN(u64, gPauseNoFRATex_WIDTH, gPauseNoFRATex_HEIGHT, 8)]; +#define gPauseCurrentPositionFRATex_WIDTH 64 +#define gPauseCurrentPositionFRATex_HEIGHT 8 +extern u64 gPauseCurrentPositionFRATex[TEX_LEN(u64, gPauseCurrentPositionFRATex_WIDTH, gPauseCurrentPositionFRATex_HEIGHT, 4)]; + +extern u64 gPauseEquipment00FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment20FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem00FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem20FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave00FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave10FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave20FRATex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; + +#endif diff --git a/assets/textures/icon_item_ger_static/icon_item_ger_static.c b/assets/textures/icon_item_ger_static/icon_item_ger_static.c new file mode 100644 index 0000000000..379f7f6816 --- /dev/null +++ b/assets/textures/icon_item_ger_static/icon_item_ger_static.c @@ -0,0 +1,131 @@ +#include "icon_item_ger_static.h" + +u64 gPauseDekuTitleGERTex[TEX_LEN(u64, gPauseDekuTitleGERTex_WIDTH, gPauseDekuTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseDekuTitleGERTex.ia8.inc.c" +}; + +u64 gPauseDodongoTitleGERTex[TEX_LEN(u64, gPauseDodongoTitleGERTex_WIDTH, gPauseDodongoTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseDodongoTitleGERTex.ia8.inc.c" +}; + +u64 gPauseJabuTitleGERTex[TEX_LEN(u64, gPauseJabuTitleGERTex_WIDTH, gPauseJabuTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseJabuTitleGERTex.ia8.inc.c" +}; + +u64 gPauseForestTitleGERTex[TEX_LEN(u64, gPauseForestTitleGERTex_WIDTH, gPauseForestTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseForestTitleGERTex.ia8.inc.c" +}; + +u64 gPauseFireTitleGERTex[TEX_LEN(u64, gPauseFireTitleGERTex_WIDTH, gPauseFireTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseFireTitleGERTex.ia8.inc.c" +}; + +u64 gPauseWaterTitleGERTex[TEX_LEN(u64, gPauseWaterTitleGERTex_WIDTH, gPauseWaterTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseWaterTitleGERTex.ia8.inc.c" +}; + +u64 gPauseSpiritTitleGERTex[TEX_LEN(u64, gPauseSpiritTitleGERTex_WIDTH, gPauseSpiritTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSpiritTitleGERTex.ia8.inc.c" +}; + +u64 gPauseShadowTitleGERTex[TEX_LEN(u64, gPauseShadowTitleGERTex_WIDTH, gPauseShadowTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseShadowTitleGERTex.ia8.inc.c" +}; + +u64 gPauseBotWTitleGERTex[TEX_LEN(u64, gPauseBotWTitleGERTex_WIDTH, gPauseBotWTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseBotWTitleGERTex.ia8.inc.c" +}; + +u64 gPauseIceCavernTitleGERTex[TEX_LEN(u64, gPauseIceCavernTitleGERTex_WIDTH, gPauseIceCavernTitleGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseIceCavernTitleGERTex.ia8.inc.c" +}; + +u64 gPauseToEquipGERTex[TEX_LEN(u64, gPauseToEquipGERTex_WIDTH, gPauseToEquipGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseToEquipGERTex.ia8.inc.c" +}; + +u64 gPauseToDecideGERTex[TEX_LEN(u64, gPauseToDecideGERTex_WIDTH, gPauseToDecideGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseToDecideGERTex.ia8.inc.c" +}; + +u64 gPauseToPlayMelodyGERTex[TEX_LEN(u64, gPauseToPlayMelodyGERTex_WIDTH, gPauseToPlayMelodyGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseToPlayMelodyGERTex.ia8.inc.c" +}; + +u64 gPauseToSelectItemGERTex[TEX_LEN(u64, gPauseToSelectItemGERTex_WIDTH, gPauseToSelectItemGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseToSelectItemGERTex.ia8.inc.c" +}; + +u64 gPauseToMapGERTex[TEX_LEN(u64, gPauseToMapGERTex_WIDTH, gPauseToMapGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseToMapGERTex.ia8.inc.c" +}; + +u64 gPauseToQuestStatusGERTex[TEX_LEN(u64, gPauseToQuestStatusGERTex_WIDTH, gPauseToQuestStatusGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseToQuestStatusGERTex.ia8.inc.c" +}; + +u64 gPauseToEquipmentGERTex[TEX_LEN(u64, gPauseToEquipmentGERTex_WIDTH, gPauseToEquipmentGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseToEquipmentGERTex.ia8.inc.c" +}; + +u64 gPauseSavePromptGERTex[TEX_LEN(u64, gPauseSavePromptGERTex_WIDTH, gPauseSavePromptGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSavePromptGERTex.ia8.inc.c" +}; + +u64 gPauseSaveConfirmationGERTex[TEX_LEN(u64, gPauseSaveConfirmationGERTex_WIDTH, gPauseSaveConfirmationGERTex_HEIGHT, + 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSaveConfirmationGERTex.ia8.inc.c" +}; + +u64 gPauseYesGERTex[TEX_LEN(u64, gPauseYesGERTex_WIDTH, gPauseYesGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseYesGERTex.ia8.inc.c" +}; + +u64 gPauseNoGERTex[TEX_LEN(u64, gPauseNoGERTex_WIDTH, gPauseNoGERTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseNoGERTex.ia8.inc.c" +}; + +u64 gPauseCurrentPositionGERTex[TEX_LEN(u64, gPauseCurrentPositionGERTex_WIDTH, gPauseCurrentPositionGERTex_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_ger_static/gPauseCurrentPositionGERTex.i4.inc.c" +}; + +u64 gPauseEquipment00GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseEquipment00GERTex.ia8.inc.c" +}; + +u64 gPauseEquipment10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseEquipment10GERTex.ia8.inc.c" +}; + +u64 gPauseEquipment20GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseEquipment20GERTex.ia8.inc.c" +}; + +u64 gPauseSelectItem00GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSelectItem00GERTex.ia8.inc.c" +}; + +u64 gPauseSelectItem10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSelectItem10GERTex.ia8.inc.c" +}; + +u64 gPauseSelectItem20GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSelectItem20GERTex.ia8.inc.c" +}; + +u64 gPauseMap10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseMap10GERTex.ia8.inc.c" +}; + +u64 gPauseQuestStatus10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseQuestStatus10GERTex.ia8.inc.c" +}; + +u64 gPauseSave10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSave10GERTex.ia8.inc.c" +}; + +u64 gPauseSave20GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_ger_static/gPauseSave20GERTex.ia8.inc.c" +}; diff --git a/assets/textures/icon_item_ger_static/icon_item_ger_static.h b/assets/textures/icon_item_ger_static/icon_item_ger_static.h new file mode 100644 index 0000000000..bd69237b9a --- /dev/null +++ b/assets/textures/icon_item_ger_static/icon_item_ger_static.h @@ -0,0 +1,86 @@ +#ifndef ICON_ITEM_GER_STATIC_H +#define ICON_ITEM_GER_STATIC_H + +#include "ultra64.h" +#include "tex_len.h" +#include "src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h" + +#define gPauseDekuTitleGERTex_WIDTH 96 +#define gPauseDekuTitleGERTex_HEIGHT 16 +extern u64 gPauseDekuTitleGERTex[TEX_LEN(u64, gPauseDekuTitleGERTex_WIDTH, gPauseDekuTitleGERTex_HEIGHT, 8)]; +#define gPauseDodongoTitleGERTex_WIDTH 96 +#define gPauseDodongoTitleGERTex_HEIGHT 16 +extern u64 gPauseDodongoTitleGERTex[TEX_LEN(u64, gPauseDodongoTitleGERTex_WIDTH, gPauseDodongoTitleGERTex_HEIGHT, 8)]; +#define gPauseJabuTitleGERTex_WIDTH 96 +#define gPauseJabuTitleGERTex_HEIGHT 16 +extern u64 gPauseJabuTitleGERTex[TEX_LEN(u64, gPauseJabuTitleGERTex_WIDTH, gPauseJabuTitleGERTex_HEIGHT, 8)]; +#define gPauseForestTitleGERTex_WIDTH 96 +#define gPauseForestTitleGERTex_HEIGHT 16 +extern u64 gPauseForestTitleGERTex[TEX_LEN(u64, gPauseForestTitleGERTex_WIDTH, gPauseForestTitleGERTex_HEIGHT, 8)]; +#define gPauseFireTitleGERTex_WIDTH 96 +#define gPauseFireTitleGERTex_HEIGHT 16 +extern u64 gPauseFireTitleGERTex[TEX_LEN(u64, gPauseFireTitleGERTex_WIDTH, gPauseFireTitleGERTex_HEIGHT, 8)]; +#define gPauseWaterTitleGERTex_WIDTH 96 +#define gPauseWaterTitleGERTex_HEIGHT 16 +extern u64 gPauseWaterTitleGERTex[TEX_LEN(u64, gPauseWaterTitleGERTex_WIDTH, gPauseWaterTitleGERTex_HEIGHT, 8)]; +#define gPauseSpiritTitleGERTex_WIDTH 96 +#define gPauseSpiritTitleGERTex_HEIGHT 16 +extern u64 gPauseSpiritTitleGERTex[TEX_LEN(u64, gPauseSpiritTitleGERTex_WIDTH, gPauseSpiritTitleGERTex_HEIGHT, 8)]; +#define gPauseShadowTitleGERTex_WIDTH 96 +#define gPauseShadowTitleGERTex_HEIGHT 16 +extern u64 gPauseShadowTitleGERTex[TEX_LEN(u64, gPauseShadowTitleGERTex_WIDTH, gPauseShadowTitleGERTex_HEIGHT, 8)]; +#define gPauseBotWTitleGERTex_WIDTH 96 +#define gPauseBotWTitleGERTex_HEIGHT 16 +extern u64 gPauseBotWTitleGERTex[TEX_LEN(u64, gPauseBotWTitleGERTex_WIDTH, gPauseBotWTitleGERTex_HEIGHT, 8)]; +#define gPauseIceCavernTitleGERTex_WIDTH 96 +#define gPauseIceCavernTitleGERTex_HEIGHT 16 +extern u64 gPauseIceCavernTitleGERTex[TEX_LEN(u64, gPauseIceCavernTitleGERTex_WIDTH, gPauseIceCavernTitleGERTex_HEIGHT, 8)]; +#define gPauseToEquipGERTex_WIDTH 88 +#define gPauseToEquipGERTex_HEIGHT 16 +extern u64 gPauseToEquipGERTex[TEX_LEN(u64, gPauseToEquipGERTex_WIDTH, gPauseToEquipGERTex_HEIGHT, 8)]; +#define gPauseToDecideGERTex_WIDTH 88 +#define gPauseToDecideGERTex_HEIGHT 16 +extern u64 gPauseToDecideGERTex[TEX_LEN(u64, gPauseToDecideGERTex_WIDTH, gPauseToDecideGERTex_HEIGHT, 8)]; +#define gPauseToPlayMelodyGERTex_WIDTH 104 +#define gPauseToPlayMelodyGERTex_HEIGHT 16 +extern u64 gPauseToPlayMelodyGERTex[TEX_LEN(u64, gPauseToPlayMelodyGERTex_WIDTH, gPauseToPlayMelodyGERTex_HEIGHT, 8)]; +#define gPauseToSelectItemGERTex_WIDTH 128 +#define gPauseToSelectItemGERTex_HEIGHT 16 +extern u64 gPauseToSelectItemGERTex[TEX_LEN(u64, gPauseToSelectItemGERTex_WIDTH, gPauseToSelectItemGERTex_HEIGHT, 8)]; +#define gPauseToMapGERTex_WIDTH 128 +#define gPauseToMapGERTex_HEIGHT 16 +extern u64 gPauseToMapGERTex[TEX_LEN(u64, gPauseToMapGERTex_WIDTH, gPauseToMapGERTex_HEIGHT, 8)]; +#define gPauseToQuestStatusGERTex_WIDTH 128 +#define gPauseToQuestStatusGERTex_HEIGHT 16 +extern u64 gPauseToQuestStatusGERTex[TEX_LEN(u64, gPauseToQuestStatusGERTex_WIDTH, gPauseToQuestStatusGERTex_HEIGHT, 8)]; +#define gPauseToEquipmentGERTex_WIDTH 128 +#define gPauseToEquipmentGERTex_HEIGHT 16 +extern u64 gPauseToEquipmentGERTex[TEX_LEN(u64, gPauseToEquipmentGERTex_WIDTH, gPauseToEquipmentGERTex_HEIGHT, 8)]; +#define gPauseSavePromptGERTex_WIDTH 152 +#define gPauseSavePromptGERTex_HEIGHT 16 +extern u64 gPauseSavePromptGERTex[TEX_LEN(u64, gPauseSavePromptGERTex_WIDTH, gPauseSavePromptGERTex_HEIGHT, 8)]; +#define gPauseSaveConfirmationGERTex_WIDTH 152 +#define gPauseSaveConfirmationGERTex_HEIGHT 16 +extern u64 gPauseSaveConfirmationGERTex[TEX_LEN(u64, gPauseSaveConfirmationGERTex_WIDTH, gPauseSaveConfirmationGERTex_HEIGHT, 8)]; +#define gPauseYesGERTex_WIDTH 48 +#define gPauseYesGERTex_HEIGHT 16 +extern u64 gPauseYesGERTex[TEX_LEN(u64, gPauseYesGERTex_WIDTH, gPauseYesGERTex_HEIGHT, 8)]; +#define gPauseNoGERTex_WIDTH 48 +#define gPauseNoGERTex_HEIGHT 16 +extern u64 gPauseNoGERTex[TEX_LEN(u64, gPauseNoGERTex_WIDTH, gPauseNoGERTex_HEIGHT, 8)]; +#define gPauseCurrentPositionGERTex_WIDTH 64 +#define gPauseCurrentPositionGERTex_HEIGHT 8 +extern u64 gPauseCurrentPositionGERTex[TEX_LEN(u64, gPauseCurrentPositionGERTex_WIDTH, gPauseCurrentPositionGERTex_HEIGHT, 4)]; + +extern u64 gPauseEquipment00GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment20GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem00GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem20GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave10GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave20GERTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; + +#endif diff --git a/assets/textures/icon_item_jpn_static/icon_item_jpn_static.c b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.c new file mode 100644 index 0000000000..92d56b0724 --- /dev/null +++ b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.c @@ -0,0 +1,127 @@ +#include "icon_item_jpn_static.h" + +u64 gPauseDekuTitleJPNTex[TEX_LEN(u64, gPauseDekuTitleJPNTex_WIDTH, gPauseDekuTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseDekuTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseDodongoTitleJPNTex[TEX_LEN(u64, gPauseDodongoTitleJPNTex_WIDTH, gPauseDodongoTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseDodongoTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseJabuTitleJPNTex[TEX_LEN(u64, gPauseJabuTitleJPNTex_WIDTH, gPauseJabuTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseJabuTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseForestTitleJPNTex[TEX_LEN(u64, gPauseForestTitleJPNTex_WIDTH, gPauseForestTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseForestTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseFireTitleJPNTex[TEX_LEN(u64, gPauseFireTitleJPNTex_WIDTH, gPauseFireTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseFireTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseWaterTitleJPNTex[TEX_LEN(u64, gPauseWaterTitleJPNTex_WIDTH, gPauseWaterTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseWaterTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseSpiritTitleJPNTex[TEX_LEN(u64, gPauseSpiritTitleJPNTex_WIDTH, gPauseSpiritTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseSpiritTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseShadowTitleJPNTex[TEX_LEN(u64, gPauseShadowTitleJPNTex_WIDTH, gPauseShadowTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseShadowTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseBotWTitleJPNTex[TEX_LEN(u64, gPauseBotWTitleJPNTex_WIDTH, gPauseBotWTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseBotWTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseIceCavernTitleJPNTex[TEX_LEN(u64, gPauseIceCavernTitleJPNTex_WIDTH, gPauseIceCavernTitleJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseIceCavernTitleJPNTex.ia8.inc.c" +}; + +u64 gPauseToEquipJPNTex[TEX_LEN(u64, gPauseToEquipJPNTex_WIDTH, gPauseToEquipJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseToEquipJPNTex.ia8.inc.c" +}; + +u64 gPauseToDecideJPNTex[TEX_LEN(u64, gPauseToDecideJPNTex_WIDTH, gPauseToDecideJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseToDecideJPNTex.ia8.inc.c" +}; + +u64 gPauseToPlayMelodyJPNTex[TEX_LEN(u64, gPauseToPlayMelodyJPNTex_WIDTH, gPauseToPlayMelodyJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseToPlayMelodyJPNTex.ia8.inc.c" +}; + +u64 gPauseToSelectItemJPNTex[TEX_LEN(u64, gPauseToSelectItemJPNTex_WIDTH, gPauseToSelectItemJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseToSelectItemJPNTex.ia8.inc.c" +}; + +u64 gPauseToMapJPNTex[TEX_LEN(u64, gPauseToMapJPNTex_WIDTH, gPauseToMapJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseToMapJPNTex.ia8.inc.c" +}; + +u64 gPauseToQuestStatusJPNTex[TEX_LEN(u64, gPauseToQuestStatusJPNTex_WIDTH, gPauseToQuestStatusJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseToQuestStatusJPNTex.ia8.inc.c" +}; + +u64 gPauseToEquipmentJPNTex[TEX_LEN(u64, gPauseToEquipmentJPNTex_WIDTH, gPauseToEquipmentJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseToEquipmentJPNTex.ia8.inc.c" +}; + +u64 gPauseSavePromptJPNTex[TEX_LEN(u64, gPauseSavePromptJPNTex_WIDTH, gPauseSavePromptJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseSavePromptJPNTex.ia8.inc.c" +}; + +u64 gPauseSaveConfirmationJPNTex[TEX_LEN(u64, gPauseSaveConfirmationJPNTex_WIDTH, gPauseSaveConfirmationJPNTex_HEIGHT, + 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseSaveConfirmationJPNTex.ia8.inc.c" +}; + +u64 gPauseYesJPNTex[TEX_LEN(u64, gPauseYesJPNTex_WIDTH, gPauseYesJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseYesJPNTex.ia8.inc.c" +}; + +u64 gPauseNoJPNTex[TEX_LEN(u64, gPauseNoJPNTex_WIDTH, gPauseNoJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseNoJPNTex.ia8.inc.c" +}; + +u64 gPauseCurrentPositionJPNTex[TEX_LEN(u64, gPauseCurrentPositionJPNTex_WIDTH, gPauseCurrentPositionJPNTex_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_jpn_static/gPauseCurrentPositionJPNTex.i4.inc.c" +}; + +u64 gPauseEquipment10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseEquipment10JPNTex.ia8.inc.c" +}; + +u64 gPauseSelectItem00JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseSelectItem00JPNTex.ia8.inc.c" +}; + +u64 gPauseSelectItem10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseSelectItem10JPNTex.ia8.inc.c" +}; + +u64 gPauseSelectItem20JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseSelectItem20JPNTex.ia8.inc.c" +}; + +u64 gPauseMap10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseMap10JPNTex.ia8.inc.c" +}; + +u64 gPauseQuestStatus00JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseQuestStatus00JPNTex.ia8.inc.c" +}; + +u64 gPauseQuestStatus10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseQuestStatus10JPNTex.ia8.inc.c" +}; + +u64 gPauseQuestStatus20JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseQuestStatus20JPNTex.ia8.inc.c" +}; + +u64 gPauseSave10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_jpn_static/gPauseSave10JPNTex.ia8.inc.c" +}; diff --git a/assets/textures/icon_item_jpn_static/icon_item_jpn_static.h b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.h new file mode 100644 index 0000000000..bd21c0a74e --- /dev/null +++ b/assets/textures/icon_item_jpn_static/icon_item_jpn_static.h @@ -0,0 +1,85 @@ +#ifndef ICON_ITEM_JPN_STATIC_H +#define ICON_ITEM_JPN_STATIC_H + +#include "ultra64.h" +#include "tex_len.h" +#include "src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h" + +#define gPauseDekuTitleJPNTex_WIDTH 96 +#define gPauseDekuTitleJPNTex_HEIGHT 16 +extern u64 gPauseDekuTitleJPNTex[TEX_LEN(u64, gPauseDekuTitleJPNTex_WIDTH, gPauseDekuTitleJPNTex_HEIGHT, 8)]; +#define gPauseDodongoTitleJPNTex_WIDTH 96 +#define gPauseDodongoTitleJPNTex_HEIGHT 16 +extern u64 gPauseDodongoTitleJPNTex[TEX_LEN(u64, gPauseDodongoTitleJPNTex_WIDTH, gPauseDodongoTitleJPNTex_HEIGHT, 8)]; +#define gPauseJabuTitleJPNTex_WIDTH 96 +#define gPauseJabuTitleJPNTex_HEIGHT 16 +extern u64 gPauseJabuTitleJPNTex[TEX_LEN(u64, gPauseJabuTitleJPNTex_WIDTH, gPauseJabuTitleJPNTex_HEIGHT, 8)]; +#define gPauseForestTitleJPNTex_WIDTH 96 +#define gPauseForestTitleJPNTex_HEIGHT 16 +extern u64 gPauseForestTitleJPNTex[TEX_LEN(u64, gPauseForestTitleJPNTex_WIDTH, gPauseForestTitleJPNTex_HEIGHT, 8)]; +#define gPauseFireTitleJPNTex_WIDTH 96 +#define gPauseFireTitleJPNTex_HEIGHT 16 +extern u64 gPauseFireTitleJPNTex[TEX_LEN(u64, gPauseFireTitleJPNTex_WIDTH, gPauseFireTitleJPNTex_HEIGHT, 8)]; +#define gPauseWaterTitleJPNTex_WIDTH 96 +#define gPauseWaterTitleJPNTex_HEIGHT 16 +extern u64 gPauseWaterTitleJPNTex[TEX_LEN(u64, gPauseWaterTitleJPNTex_WIDTH, gPauseWaterTitleJPNTex_HEIGHT, 8)]; +#define gPauseSpiritTitleJPNTex_WIDTH 96 +#define gPauseSpiritTitleJPNTex_HEIGHT 16 +extern u64 gPauseSpiritTitleJPNTex[TEX_LEN(u64, gPauseSpiritTitleJPNTex_WIDTH, gPauseSpiritTitleJPNTex_HEIGHT, 8)]; +#define gPauseShadowTitleJPNTex_WIDTH 96 +#define gPauseShadowTitleJPNTex_HEIGHT 16 +extern u64 gPauseShadowTitleJPNTex[TEX_LEN(u64, gPauseShadowTitleJPNTex_WIDTH, gPauseShadowTitleJPNTex_HEIGHT, 8)]; +#define gPauseBotWTitleJPNTex_WIDTH 96 +#define gPauseBotWTitleJPNTex_HEIGHT 16 +extern u64 gPauseBotWTitleJPNTex[TEX_LEN(u64, gPauseBotWTitleJPNTex_WIDTH, gPauseBotWTitleJPNTex_HEIGHT, 8)]; +#define gPauseIceCavernTitleJPNTex_WIDTH 96 +#define gPauseIceCavernTitleJPNTex_HEIGHT 16 +extern u64 gPauseIceCavernTitleJPNTex[TEX_LEN(u64, gPauseIceCavernTitleJPNTex_WIDTH, gPauseIceCavernTitleJPNTex_HEIGHT, 8)]; +#define gPauseToEquipJPNTex_WIDTH 56 +#define gPauseToEquipJPNTex_HEIGHT 16 +extern u64 gPauseToEquipJPNTex[TEX_LEN(u64, gPauseToEquipJPNTex_WIDTH, gPauseToEquipJPNTex_HEIGHT, 8)]; +#define gPauseToDecideJPNTex_WIDTH 48 +#define gPauseToDecideJPNTex_HEIGHT 16 +extern u64 gPauseToDecideJPNTex[TEX_LEN(u64, gPauseToDecideJPNTex_WIDTH, gPauseToDecideJPNTex_HEIGHT, 8)]; +#define gPauseToPlayMelodyJPNTex_WIDTH 96 +#define gPauseToPlayMelodyJPNTex_HEIGHT 16 +extern u64 gPauseToPlayMelodyJPNTex[TEX_LEN(u64, gPauseToPlayMelodyJPNTex_WIDTH, gPauseToPlayMelodyJPNTex_HEIGHT, 8)]; +#define gPauseToSelectItemJPNTex_WIDTH 128 +#define gPauseToSelectItemJPNTex_HEIGHT 16 +extern u64 gPauseToSelectItemJPNTex[TEX_LEN(u64, gPauseToSelectItemJPNTex_WIDTH, gPauseToSelectItemJPNTex_HEIGHT, 8)]; +#define gPauseToMapJPNTex_WIDTH 128 +#define gPauseToMapJPNTex_HEIGHT 16 +extern u64 gPauseToMapJPNTex[TEX_LEN(u64, gPauseToMapJPNTex_WIDTH, gPauseToMapJPNTex_HEIGHT, 8)]; +#define gPauseToQuestStatusJPNTex_WIDTH 128 +#define gPauseToQuestStatusJPNTex_HEIGHT 16 +extern u64 gPauseToQuestStatusJPNTex[TEX_LEN(u64, gPauseToQuestStatusJPNTex_WIDTH, gPauseToQuestStatusJPNTex_HEIGHT, 8)]; +#define gPauseToEquipmentJPNTex_WIDTH 128 +#define gPauseToEquipmentJPNTex_HEIGHT 16 +extern u64 gPauseToEquipmentJPNTex[TEX_LEN(u64, gPauseToEquipmentJPNTex_WIDTH, gPauseToEquipmentJPNTex_HEIGHT, 8)]; +#define gPauseSavePromptJPNTex_WIDTH 152 +#define gPauseSavePromptJPNTex_HEIGHT 16 +extern u64 gPauseSavePromptJPNTex[TEX_LEN(u64, gPauseSavePromptJPNTex_WIDTH, gPauseSavePromptJPNTex_HEIGHT, 8)]; +#define gPauseSaveConfirmationJPNTex_WIDTH 152 +#define gPauseSaveConfirmationJPNTex_HEIGHT 16 +extern u64 gPauseSaveConfirmationJPNTex[TEX_LEN(u64, gPauseSaveConfirmationJPNTex_WIDTH, gPauseSaveConfirmationJPNTex_HEIGHT, 8)]; +#define gPauseYesJPNTex_WIDTH 48 +#define gPauseYesJPNTex_HEIGHT 16 +extern u64 gPauseYesJPNTex[TEX_LEN(u64, gPauseYesJPNTex_WIDTH, gPauseYesJPNTex_HEIGHT, 8)]; +#define gPauseNoJPNTex_WIDTH 48 +#define gPauseNoJPNTex_HEIGHT 16 +extern u64 gPauseNoJPNTex[TEX_LEN(u64, gPauseNoJPNTex_WIDTH, gPauseNoJPNTex_HEIGHT, 8)]; +#define gPauseCurrentPositionJPNTex_WIDTH 64 +#define gPauseCurrentPositionJPNTex_HEIGHT 8 +extern u64 gPauseCurrentPositionJPNTex[TEX_LEN(u64, gPauseCurrentPositionJPNTex_WIDTH, gPauseCurrentPositionJPNTex_HEIGHT, 4)]; + +extern u64 gPauseEquipment10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem00JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem20JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus00JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus20JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave10JPNTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; + +#endif diff --git a/assets/textures/icon_item_nes_static/icon_item_nes_static.c b/assets/textures/icon_item_nes_static/icon_item_nes_static.c new file mode 100644 index 0000000000..5e84c69162 --- /dev/null +++ b/assets/textures/icon_item_nes_static/icon_item_nes_static.c @@ -0,0 +1,127 @@ +#include "icon_item_nes_static.h" + +u64 gPauseDekuTitleENGTex[TEX_LEN(u64, gPauseDekuTitleENGTex_WIDTH, gPauseDekuTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseDekuTitleENGTex.ia8.inc.c" +}; + +u64 gPauseDodongoTitleENGTex[TEX_LEN(u64, gPauseDodongoTitleENGTex_WIDTH, gPauseDodongoTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseDodongoTitleENGTex.ia8.inc.c" +}; + +u64 gPauseJabuTitleENGTex[TEX_LEN(u64, gPauseJabuTitleENGTex_WIDTH, gPauseJabuTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseJabuTitleENGTex.ia8.inc.c" +}; + +u64 gPauseForestTitleENGTex[TEX_LEN(u64, gPauseForestTitleENGTex_WIDTH, gPauseForestTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseForestTitleENGTex.ia8.inc.c" +}; + +u64 gPauseFireTitleENGTex[TEX_LEN(u64, gPauseFireTitleENGTex_WIDTH, gPauseFireTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseFireTitleENGTex.ia8.inc.c" +}; + +u64 gPauseWaterTitleENGTex[TEX_LEN(u64, gPauseWaterTitleENGTex_WIDTH, gPauseWaterTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseWaterTitleENGTex.ia8.inc.c" +}; + +u64 gPauseSpiritTitleENGTex[TEX_LEN(u64, gPauseSpiritTitleENGTex_WIDTH, gPauseSpiritTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseSpiritTitleENGTex.ia8.inc.c" +}; + +u64 gPauseShadowTitleENGTex[TEX_LEN(u64, gPauseShadowTitleENGTex_WIDTH, gPauseShadowTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseShadowTitleENGTex.ia8.inc.c" +}; + +u64 gPauseBotWTitleENGTex[TEX_LEN(u64, gPauseBotWTitleENGTex_WIDTH, gPauseBotWTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseBotWTitleENGTex.ia8.inc.c" +}; + +u64 gPauseIceCavernTitleENGTex[TEX_LEN(u64, gPauseIceCavernTitleENGTex_WIDTH, gPauseIceCavernTitleENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseIceCavernTitleENGTex.ia8.inc.c" +}; + +u64 gPauseToEquipENGTex[TEX_LEN(u64, gPauseToEquipENGTex_WIDTH, gPauseToEquipENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseToEquipENGTex.ia8.inc.c" +}; + +u64 gPauseToDecideENGTex[TEX_LEN(u64, gPauseToDecideENGTex_WIDTH, gPauseToDecideENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseToDecideENGTex.ia8.inc.c" +}; + +u64 gPauseToPlayMelodyENGTex[TEX_LEN(u64, gPauseToPlayMelodyENGTex_WIDTH, gPauseToPlayMelodyENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseToPlayMelodyENGTex.ia8.inc.c" +}; + +u64 gPauseToSelectItemENGTex[TEX_LEN(u64, gPauseToSelectItemENGTex_WIDTH, gPauseToSelectItemENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseToSelectItemENGTex.ia8.inc.c" +}; + +u64 gPauseToMapENGTex[TEX_LEN(u64, gPauseToMapENGTex_WIDTH, gPauseToMapENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseToMapENGTex.ia8.inc.c" +}; + +u64 gPauseToQuestStatusENGTex[TEX_LEN(u64, gPauseToQuestStatusENGTex_WIDTH, gPauseToQuestStatusENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseToQuestStatusENGTex.ia8.inc.c" +}; + +u64 gPauseToEquipmentENGTex[TEX_LEN(u64, gPauseToEquipmentENGTex_WIDTH, gPauseToEquipmentENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseToEquipmentENGTex.ia8.inc.c" +}; + +u64 gPauseSavePromptENGTex[TEX_LEN(u64, gPauseSavePromptENGTex_WIDTH, gPauseSavePromptENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseSavePromptENGTex.ia8.inc.c" +}; + +u64 gPauseSaveConfirmationENGTex[TEX_LEN(u64, gPauseSaveConfirmationENGTex_WIDTH, gPauseSaveConfirmationENGTex_HEIGHT, + 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseSaveConfirmationENGTex.ia8.inc.c" +}; + +u64 gPauseYesENGTex[TEX_LEN(u64, gPauseYesENGTex_WIDTH, gPauseYesENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseYesENGTex.ia8.inc.c" +}; + +u64 gPauseNoENGTex[TEX_LEN(u64, gPauseNoENGTex_WIDTH, gPauseNoENGTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseNoENGTex.ia8.inc.c" +}; + +u64 gPauseCurrentPositionENGTex[TEX_LEN(u64, gPauseCurrentPositionENGTex_WIDTH, gPauseCurrentPositionENGTex_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_nes_static/gPauseCurrentPositionENGTex.i4.inc.c" +}; + +u64 gPauseEquipment10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseEquipment10ENGTex.ia8.inc.c" +}; + +u64 gPauseSelectItem00ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseSelectItem00ENGTex.ia8.inc.c" +}; + +u64 gPauseSelectItem10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseSelectItem10ENGTex.ia8.inc.c" +}; + +u64 gPauseSelectItem20ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseSelectItem20ENGTex.ia8.inc.c" +}; + +u64 gPauseMap10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseMap10ENGTex.ia8.inc.c" +}; + +u64 gPauseQuestStatus00ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseQuestStatus00ENGTex.ia8.inc.c" +}; + +u64 gPauseQuestStatus10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseQuestStatus10ENGTex.ia8.inc.c" +}; + +u64 gPauseQuestStatus20ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseQuestStatus20ENGTex.ia8.inc.c" +}; + +u64 gPauseSave10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_nes_static/gPauseSave10ENGTex.ia8.inc.c" +}; diff --git a/assets/textures/icon_item_nes_static/icon_item_nes_static.h b/assets/textures/icon_item_nes_static/icon_item_nes_static.h new file mode 100644 index 0000000000..007bebf3bc --- /dev/null +++ b/assets/textures/icon_item_nes_static/icon_item_nes_static.h @@ -0,0 +1,85 @@ +#ifndef ICON_ITEM_NES_STATIC_H +#define ICON_ITEM_NES_STATIC_H + +#include "ultra64.h" +#include "tex_len.h" +#include "src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h" + +#define gPauseDekuTitleENGTex_WIDTH 96 +#define gPauseDekuTitleENGTex_HEIGHT 16 +extern u64 gPauseDekuTitleENGTex[TEX_LEN(u64, gPauseDekuTitleENGTex_WIDTH, gPauseDekuTitleENGTex_HEIGHT, 8)]; +#define gPauseDodongoTitleENGTex_WIDTH 96 +#define gPauseDodongoTitleENGTex_HEIGHT 16 +extern u64 gPauseDodongoTitleENGTex[TEX_LEN(u64, gPauseDodongoTitleENGTex_WIDTH, gPauseDodongoTitleENGTex_HEIGHT, 8)]; +#define gPauseJabuTitleENGTex_WIDTH 96 +#define gPauseJabuTitleENGTex_HEIGHT 16 +extern u64 gPauseJabuTitleENGTex[TEX_LEN(u64, gPauseJabuTitleENGTex_WIDTH, gPauseJabuTitleENGTex_HEIGHT, 8)]; +#define gPauseForestTitleENGTex_WIDTH 96 +#define gPauseForestTitleENGTex_HEIGHT 16 +extern u64 gPauseForestTitleENGTex[TEX_LEN(u64, gPauseForestTitleENGTex_WIDTH, gPauseForestTitleENGTex_HEIGHT, 8)]; +#define gPauseFireTitleENGTex_WIDTH 96 +#define gPauseFireTitleENGTex_HEIGHT 16 +extern u64 gPauseFireTitleENGTex[TEX_LEN(u64, gPauseFireTitleENGTex_WIDTH, gPauseFireTitleENGTex_HEIGHT, 8)]; +#define gPauseWaterTitleENGTex_WIDTH 96 +#define gPauseWaterTitleENGTex_HEIGHT 16 +extern u64 gPauseWaterTitleENGTex[TEX_LEN(u64, gPauseWaterTitleENGTex_WIDTH, gPauseWaterTitleENGTex_HEIGHT, 8)]; +#define gPauseSpiritTitleENGTex_WIDTH 96 +#define gPauseSpiritTitleENGTex_HEIGHT 16 +extern u64 gPauseSpiritTitleENGTex[TEX_LEN(u64, gPauseSpiritTitleENGTex_WIDTH, gPauseSpiritTitleENGTex_HEIGHT, 8)]; +#define gPauseShadowTitleENGTex_WIDTH 96 +#define gPauseShadowTitleENGTex_HEIGHT 16 +extern u64 gPauseShadowTitleENGTex[TEX_LEN(u64, gPauseShadowTitleENGTex_WIDTH, gPauseShadowTitleENGTex_HEIGHT, 8)]; +#define gPauseBotWTitleENGTex_WIDTH 96 +#define gPauseBotWTitleENGTex_HEIGHT 16 +extern u64 gPauseBotWTitleENGTex[TEX_LEN(u64, gPauseBotWTitleENGTex_WIDTH, gPauseBotWTitleENGTex_HEIGHT, 8)]; +#define gPauseIceCavernTitleENGTex_WIDTH 96 +#define gPauseIceCavernTitleENGTex_HEIGHT 16 +extern u64 gPauseIceCavernTitleENGTex[TEX_LEN(u64, gPauseIceCavernTitleENGTex_WIDTH, gPauseIceCavernTitleENGTex_HEIGHT, 8)]; +#define gPauseToEquipENGTex_WIDTH 56 +#define gPauseToEquipENGTex_HEIGHT 16 +extern u64 gPauseToEquipENGTex[TEX_LEN(u64, gPauseToEquipENGTex_WIDTH, gPauseToEquipENGTex_HEIGHT, 8)]; +#define gPauseToDecideENGTex_WIDTH 64 +#define gPauseToDecideENGTex_HEIGHT 16 +extern u64 gPauseToDecideENGTex[TEX_LEN(u64, gPauseToDecideENGTex_WIDTH, gPauseToDecideENGTex_HEIGHT, 8)]; +#define gPauseToPlayMelodyENGTex_WIDTH 80 +#define gPauseToPlayMelodyENGTex_HEIGHT 16 +extern u64 gPauseToPlayMelodyENGTex[TEX_LEN(u64, gPauseToPlayMelodyENGTex_WIDTH, gPauseToPlayMelodyENGTex_HEIGHT, 8)]; +#define gPauseToSelectItemENGTex_WIDTH 128 +#define gPauseToSelectItemENGTex_HEIGHT 16 +extern u64 gPauseToSelectItemENGTex[TEX_LEN(u64, gPauseToSelectItemENGTex_WIDTH, gPauseToSelectItemENGTex_HEIGHT, 8)]; +#define gPauseToMapENGTex_WIDTH 128 +#define gPauseToMapENGTex_HEIGHT 16 +extern u64 gPauseToMapENGTex[TEX_LEN(u64, gPauseToMapENGTex_WIDTH, gPauseToMapENGTex_HEIGHT, 8)]; +#define gPauseToQuestStatusENGTex_WIDTH 128 +#define gPauseToQuestStatusENGTex_HEIGHT 16 +extern u64 gPauseToQuestStatusENGTex[TEX_LEN(u64, gPauseToQuestStatusENGTex_WIDTH, gPauseToQuestStatusENGTex_HEIGHT, 8)]; +#define gPauseToEquipmentENGTex_WIDTH 128 +#define gPauseToEquipmentENGTex_HEIGHT 16 +extern u64 gPauseToEquipmentENGTex[TEX_LEN(u64, gPauseToEquipmentENGTex_WIDTH, gPauseToEquipmentENGTex_HEIGHT, 8)]; +#define gPauseSavePromptENGTex_WIDTH 152 +#define gPauseSavePromptENGTex_HEIGHT 16 +extern u64 gPauseSavePromptENGTex[TEX_LEN(u64, gPauseSavePromptENGTex_WIDTH, gPauseSavePromptENGTex_HEIGHT, 8)]; +#define gPauseSaveConfirmationENGTex_WIDTH 152 +#define gPauseSaveConfirmationENGTex_HEIGHT 16 +extern u64 gPauseSaveConfirmationENGTex[TEX_LEN(u64, gPauseSaveConfirmationENGTex_WIDTH, gPauseSaveConfirmationENGTex_HEIGHT, 8)]; +#define gPauseYesENGTex_WIDTH 48 +#define gPauseYesENGTex_HEIGHT 16 +extern u64 gPauseYesENGTex[TEX_LEN(u64, gPauseYesENGTex_WIDTH, gPauseYesENGTex_HEIGHT, 8)]; +#define gPauseNoENGTex_WIDTH 48 +#define gPauseNoENGTex_HEIGHT 16 +extern u64 gPauseNoENGTex[TEX_LEN(u64, gPauseNoENGTex_WIDTH, gPauseNoENGTex_HEIGHT, 8)]; +#define gPauseCurrentPositionENGTex_WIDTH 64 +#define gPauseCurrentPositionENGTex_HEIGHT 8 +extern u64 gPauseCurrentPositionENGTex[TEX_LEN(u64, gPauseCurrentPositionENGTex_WIDTH, gPauseCurrentPositionENGTex_HEIGHT, 4)]; + +extern u64 gPauseEquipment10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem00ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem20ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus00ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus20ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave10ENGTex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; + +#endif diff --git a/assets/textures/icon_item_static/icon_item_static.c b/assets/textures/icon_item_static/icon_item_static.c new file mode 100644 index 0000000000..2adb277ebd --- /dev/null +++ b/assets/textures/icon_item_static/icon_item_static.c @@ -0,0 +1,781 @@ +#include "icon_item_static.h" + +// Item icons textures + +u64 gItemIconDekuStickTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconDekuStickTex.rgba32.inc.c" +}; + +u64 gItemIconDekuNutTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconDekuNutTex.rgba32.inc.c" +}; + +u64 gItemIconBombTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBombTex.rgba32.inc.c" +}; + +u64 gItemIconBowTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBowTex.rgba32.inc.c" +}; + +u64 gItemIconArrowFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconArrowFireTex.rgba32.inc.c" +}; + +u64 gItemIconDinsFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconDinsFireTex.rgba32.inc.c" +}; + +u64 gItemIconSlingshotTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconSlingshotTex.rgba32.inc.c" +}; + +u64 gItemIconOcarinaFairyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconOcarinaFairyTex.rgba32.inc.c" +}; + +u64 gItemIconOcarinaOfTimeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconOcarinaOfTimeTex.rgba32.inc.c" +}; + +u64 gItemIconBombchuTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBombchuTex.rgba32.inc.c" +}; + +u64 gItemIconHookshotTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconHookshotTex.rgba32.inc.c" +}; + +u64 gItemIconLongshotTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconLongshotTex.rgba32.inc.c" +}; + +u64 gItemIconArrowIceTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconArrowIceTex.rgba32.inc.c" +}; + +u64 gItemIconFaroresWindTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconFaroresWindTex.rgba32.inc.c" +}; + +u64 gItemIconBoomerangTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBoomerangTex.rgba32.inc.c" +}; + +u64 gItemIconLensOfTruthTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconLensOfTruthTex.rgba32.inc.c" +}; + +u64 gItemIconMagicBeanTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMagicBeanTex.rgba32.inc.c" +}; + +u64 gItemIconHammerTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconHammerTex.rgba32.inc.c" +}; + +u64 gItemIconArrowLightTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconArrowLightTex.rgba32.inc.c" +}; + +u64 gItemIconNayrusLoveTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconNayrusLoveTex.rgba32.inc.c" +}; + +u64 gItemIconBottleEmptyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleEmptyTex.rgba32.inc.c" +}; + +u64 gItemIconBottlePotionRedTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottlePotionRedTex.rgba32.inc.c" +}; + +u64 gItemIconBottlePotionGreenTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottlePotionGreenTex.rgba32.inc.c" +}; + +u64 gItemIconBottlePotionBlueTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottlePotionBlueTex.rgba32.inc.c" +}; + +u64 gItemIconBottleFairyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleFairyTex.rgba32.inc.c" +}; + +u64 gItemIconBottleFishTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleFishTex.rgba32.inc.c" +}; + +u64 gItemIconBottleMilkFullTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleMilkFullTex.rgba32.inc.c" +}; + +u64 gItemIconBottleRutosLetterTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleRutosLetterTex.rgba32.inc.c" +}; + +u64 gItemIconBottleBlueFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleBlueFireTex.rgba32.inc.c" +}; + +u64 gItemIconBottleBugTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleBugTex.rgba32.inc.c" +}; + +u64 gItemIconBottleBigPoeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleBigPoeTex.rgba32.inc.c" +}; + +u64 gItemIconBottleMilkHalfTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottleMilkHalfTex.rgba32.inc.c" +}; + +u64 gItemIconBottlePoeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBottlePoeTex.rgba32.inc.c" +}; + +u64 gItemIconWeirdEggTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconWeirdEggTex.rgba32.inc.c" +}; + +u64 gItemIconChickenTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconChickenTex.rgba32.inc.c" +}; + +u64 gItemIconZeldasLetterTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconZeldasLetterTex.rgba32.inc.c" +}; + +u64 gItemIconMaskKeatonTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskKeatonTex.rgba32.inc.c" +}; + +u64 gItemIconMaskSkullTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskSkullTex.rgba32.inc.c" +}; + +u64 gItemIconMaskSpookyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskSpookyTex.rgba32.inc.c" +}; + +u64 gItemIconMaskBunnyHoodTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskBunnyHoodTex.rgba32.inc.c" +}; + +u64 gItemIconMaskGoronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskGoronTex.rgba32.inc.c" +}; + +u64 gItemIconMaskZoraTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskZoraTex.rgba32.inc.c" +}; + +u64 gItemIconMaskGerudoTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskGerudoTex.rgba32.inc.c" +}; + +u64 gItemIconMaskTruthTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconMaskTruthTex.rgba32.inc.c" +}; + +u64 gItemIconSoldOutTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconSoldOutTex.rgba32.inc.c" +}; + +u64 gItemIconPocketEggTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconPocketEggTex.rgba32.inc.c" +}; + +u64 gItemIconPocketCuccoTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconPocketCuccoTex.rgba32.inc.c" +}; + +u64 gItemIconCojiroTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconCojiroTex.rgba32.inc.c" +}; + +u64 gItemIconOddMushroomTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconOddMushroomTex.rgba32.inc.c" +}; + +u64 gItemIconOddPotionTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconOddPotionTex.rgba32.inc.c" +}; + +u64 gItemIconPoachersSawTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconPoachersSawTex.rgba32.inc.c" +}; + +u64 gItemIconBrokenGoronsSwordTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBrokenGoronsSwordTex.rgba32.inc.c" +}; + +u64 gItemIconPrescriptionTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconPrescriptionTex.rgba32.inc.c" +}; + +u64 gItemIconEyeballFrogTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconEyeballFrogTex.rgba32.inc.c" +}; + +u64 gItemIconEyeDropsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconEyeDropsTex.rgba32.inc.c" +}; + +u64 gItemIconClaimCheckTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconClaimCheckTex.rgba32.inc.c" +}; + +u64 gItemIconBowFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBowFireTex.rgba32.inc.c" +}; + +u64 gItemIconBowIceTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBowIceTex.rgba32.inc.c" +}; + +u64 gItemIconBowLightTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBowLightTex.rgba32.inc.c" +}; + +u64 gItemIconSwordKokiriTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconSwordKokiriTex.rgba32.inc.c" +}; + +u64 gItemIconSwordMasterTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconSwordMasterTex.rgba32.inc.c" +}; + +u64 gItemIconSwordBiggoronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconSwordBiggoronTex.rgba32.inc.c" +}; + +u64 gItemIconShieldDekuTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconShieldDekuTex.rgba32.inc.c" +}; + +u64 gItemIconShieldHylianTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconShieldHylianTex.rgba32.inc.c" +}; + +u64 gItemIconShieldMirrorTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconShieldMirrorTex.rgba32.inc.c" +}; + +u64 gItemIconTunicKokiriTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconTunicKokiriTex.rgba32.inc.c" +}; + +u64 gItemIconTunicGoronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconTunicGoronTex.rgba32.inc.c" +}; + +u64 gItemIconTunicZoraTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconTunicZoraTex.rgba32.inc.c" +}; + +u64 gItemIconBootsKokiriTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBootsKokiriTex.rgba32.inc.c" +}; + +u64 gItemIconBootsIronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBootsIronTex.rgba32.inc.c" +}; + +u64 gItemIconBootsHoverTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBootsHoverTex.rgba32.inc.c" +}; + +u64 gItemIconBulletBag30Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBulletBag30Tex.rgba32.inc.c" +}; + +u64 gItemIconBulletBag40Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBulletBag40Tex.rgba32.inc.c" +}; + +u64 gItemIconBulletBag50Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBulletBag50Tex.rgba32.inc.c" +}; + +u64 gItemIconQuiver30Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconQuiver30Tex.rgba32.inc.c" +}; + +u64 gItemIconQuiver40Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconQuiver40Tex.rgba32.inc.c" +}; + +u64 gItemIconQuiver50Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconQuiver50Tex.rgba32.inc.c" +}; + +u64 gItemIconBombBag20Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBombBag20Tex.rgba32.inc.c" +}; + +u64 gItemIconBombBag30Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBombBag30Tex.rgba32.inc.c" +}; + +u64 gItemIconBombBag40Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBombBag40Tex.rgba32.inc.c" +}; + +u64 gItemIconGoronsBraceletTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconGoronsBraceletTex.rgba32.inc.c" +}; + +u64 gItemIconSilverGauntletsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconSilverGauntletsTex.rgba32.inc.c" +}; + +u64 gItemIconGoldenGauntletsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconGoldenGauntletsTex.rgba32.inc.c" +}; + +u64 gItemIconScaleSilverTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconScaleSilverTex.rgba32.inc.c" +}; + +u64 gItemIconScaleGoldenTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconScaleGoldenTex.rgba32.inc.c" +}; + +u64 gItemIconBrokenGiantsKnifeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconBrokenGiantsKnifeTex.rgba32.inc.c" +}; + +u64 gItemIconAdultsWalletTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconAdultsWalletTex.rgba32.inc.c" +}; + +u64 gItemIconGiantsWalletTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconGiantsWalletTex.rgba32.inc.c" +}; + +u64 gItemIconDekuSeedsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconDekuSeedsTex.rgba32.inc.c" +}; + +u64 gItemIconFishingPoleTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)] = { +#include "assets/textures/icon_item_static/gItemIconFishingPoleTex.rgba32.inc.c" +}; + +// Heart piece icons textures + +u64 gHeartPieceIcon1Tex[TEX_LEN(u64, HEART_PIECE_ICON_TEX_WIDTH, HEART_PIECE_ICON_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gHeartPieceIcon1Tex.ia8.inc.c" +}; + +u64 gHeartPieceIcon2Tex[TEX_LEN(u64, HEART_PIECE_ICON_TEX_WIDTH, HEART_PIECE_ICON_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gHeartPieceIcon2Tex.ia8.inc.c" +}; + +u64 gHeartPieceIcon3Tex[TEX_LEN(u64, HEART_PIECE_ICON_TEX_WIDTH, HEART_PIECE_ICON_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gHeartPieceIcon3Tex.ia8.inc.c" +}; + +// Pause menu cursor textures + +#define gPausePromptCursorTex_WIDTH 48 +#define gPausePromptCursorTex_HEIGHT 48 +u64 gPausePromptCursorTex[TEX_LEN(u64, gPausePromptCursorTex_WIDTH, gPausePromptCursorTex_HEIGHT, 4)] = { +#include "assets/textures/icon_item_static/gPausePromptCursorTex.i4.inc.c" +}; + +#define gPauseUnusedCursorTex_WIDTH 24 +#define gPauseUnusedCursorTex_HEIGHT 24 +u64 gPauseUnusedCursorTex[TEX_LEN(u64, gPauseUnusedCursorTex_WIDTH, gPauseUnusedCursorTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseUnusedCursorTex.i8.inc.c" +}; + +u64 gPauseMenuCursorTopLeftTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_static/gPauseMenuCursorTopLeftTex.ia4.inc.c" +}; + +u64 gPauseMenuCursorTopRightTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_static/gPauseMenuCursorTopRightTex.ia4.inc.c" +}; + +u64 gPauseMenuCursorBottomLeftTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_static/gPauseMenuCursorBottomLeftTex.ia4.inc.c" +}; + +u64 gPauseMenuCursorBottomRightTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, + 4)] = { +#include "assets/textures/icon_item_static/gPauseMenuCursorBottomRightTex.ia4.inc.c" +}; + +// Pause menu pages background textures + +u64 gPauseEquipment00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment00Tex.ia8.inc.c" +}; + +u64 gPauseEquipment20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment20Tex.ia8.inc.c" +}; + +u64 gPauseMap00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap00Tex.ia8.inc.c" +}; + +u64 gPauseMap20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap20Tex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gPauseQuestStatus00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus00Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus20Tex.ia8.inc.c" +}; +#endif + +u64 gPauseSave00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave00Tex.ia8.inc.c" +}; + +u64 gPauseSave20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave20Tex.ia8.inc.c" +}; + +u64 gPauseEquipment01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment01Tex.ia8.inc.c" +}; + +u64 gPauseEquipment11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment11Tex.ia8.inc.c" +}; + +u64 gPauseEquipment21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment21Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem01Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem11Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem21Tex.ia8.inc.c" +}; + +u64 gPauseMap01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap01Tex.ia8.inc.c" +}; + +u64 gPauseMap11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap11Tex.ia8.inc.c" +}; + +u64 gPauseMap21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap21Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus01Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus11Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus21Tex.ia8.inc.c" +}; + +u64 gPauseSave01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave01Tex.ia8.inc.c" +}; + +u64 gPauseSave11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave11Tex.ia8.inc.c" +}; + +u64 gPauseSave21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave21Tex.ia8.inc.c" +}; + +u64 gPauseEquipment02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment02Tex.ia8.inc.c" +}; + +u64 gPauseEquipment12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment12Tex.ia8.inc.c" +}; + +u64 gPauseEquipment22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment22Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem02Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem12Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem22Tex.ia8.inc.c" +}; + +u64 gPauseMap02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap02Tex.ia8.inc.c" +}; + +u64 gPauseMap12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap12Tex.ia8.inc.c" +}; + +u64 gPauseMap22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap22Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus02Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus12Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus22Tex.ia8.inc.c" +}; + +u64 gPauseSave02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave02Tex.ia8.inc.c" +}; + +u64 gPauseSave12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave12Tex.ia8.inc.c" +}; + +u64 gPauseSave22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave22Tex.ia8.inc.c" +}; + +u64 gPauseEquipment03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment03Tex.ia8.inc.c" +}; + +u64 gPauseEquipment13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment13Tex.ia8.inc.c" +}; + +u64 gPauseEquipment23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment23Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem03Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem13Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem23Tex.ia8.inc.c" +}; + +u64 gPauseMap03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap03Tex.ia8.inc.c" +}; + +u64 gPauseMap13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap13Tex.ia8.inc.c" +}; + +u64 gPauseMap23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap23Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus03Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus13Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus23Tex.ia8.inc.c" +}; + +u64 gPauseSave03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave03Tex.ia8.inc.c" +}; + +u64 gPauseSave13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave13Tex.ia8.inc.c" +}; + +u64 gPauseSave23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave23Tex.ia8.inc.c" +}; + +u64 gPauseEquipment04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment04Tex.ia8.inc.c" +}; + +u64 gPauseEquipment14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment14Tex.ia8.inc.c" +}; + +u64 gPauseEquipment24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseEquipment24Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem04Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem14Tex.ia8.inc.c" +}; + +u64 gPauseSelectItem24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSelectItem24Tex.ia8.inc.c" +}; + +u64 gPauseMap04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap04Tex.ia8.inc.c" +}; + +u64 gPauseMap14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap14Tex.ia8.inc.c" +}; + +u64 gPauseMap24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseMap24Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus04Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus14Tex.ia8.inc.c" +}; + +u64 gPauseQuestStatus24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseQuestStatus24Tex.ia8.inc.c" +}; + +u64 gPauseSave04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave04Tex.ia8.inc.c" +}; + +u64 gPauseSave14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave14Tex.ia8.inc.c" +}; + +u64 gPauseSave24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseSave24Tex.ia8.inc.c" +}; + +u64 gPauseGameOver10Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gPauseGameOver10Tex.ia8.inc.c" +}; + +// Various textures and DLs + +#define gABtnSymbolTex_WIDTH 24 +#define gABtnSymbolTex_HEIGHT 16 +u64 gABtnSymbolTex[TEX_LEN(u64, gABtnSymbolTex_WIDTH, gABtnSymbolTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gABtnSymbolTex.ia8.inc.c" +}; + +#define gBBtnSymbolTex_WIDTH 24 +#define gBBtnSymbolTex_HEIGHT 16 +u64 gBBtnSymbolTex[TEX_LEN(u64, gBBtnSymbolTex_WIDTH, gBBtnSymbolTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gBBtnSymbolTex.ia8.inc.c" +}; + +#define gCBtnSymbolsTex_WIDTH 48 +#define gCBtnSymbolsTex_HEIGHT 16 +u64 gCBtnSymbolsTex[TEX_LEN(u64, gCBtnSymbolsTex_WIDTH, gCBtnSymbolsTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gCBtnSymbolsTex.ia8.inc.c" +}; + +#define gNamePanelLeftTex_WIDTH 72 +#define gNamePanelLeftTex_HEIGHT 24 +u64 gNamePanelLeftTex[TEX_LEN(u64, gNamePanelLeftTex_WIDTH, gNamePanelLeftTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gNamePanelLeftTex.ia8.inc.c" +}; + +#define gNamePanelRightTex_WIDTH 72 +#define gNamePanelRightTex_HEIGHT 24 +u64 gNamePanelRightTex[TEX_LEN(u64, gNamePanelRightTex_WIDTH, gNamePanelRightTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gNamePanelRightTex.ia8.inc.c" +}; + +#define gLButtonTex_WIDTH 24 +#define gLButtonTex_HEIGHT 32 +u64 gLButtonTex[TEX_LEN(u64, gLButtonTex_WIDTH, gLButtonTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gLButtonTex.ia8.inc.c" +}; + +#define gRButtonTex_WIDTH 24 +#define gRButtonTex_HEIGHT 32 +u64 gRButtonTex[TEX_LEN(u64, gRButtonTex_WIDTH, gRButtonTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gRButtonTex.ia8.inc.c" +}; + +#define gUnknownJPNTex_WIDTH 80 +#define gUnknownJPNTex_HEIGHT 16 +u64 gUnknownJPNTex[TEX_LEN(u64, gUnknownJPNTex_WIDTH, gUnknownJPNTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gUnknownJPNTex.ia8.inc.c" +}; + +u64 gSongNoteTex[TEX_LEN(u64, gSongNoteTex_WIDTH, gSongNoteTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gSongNoteTex.ia8.inc.c" +}; + +u64 gMagicArrowEquipEffectTex[TEX_LEN(u64, gMagicArrowEquipEffectTex_WIDTH, gMagicArrowEquipEffectTex_HEIGHT, 8)] = { +#include "assets/textures/icon_item_static/gMagicArrowEquipEffectTex.ia8.inc.c" +}; + +Gfx gItemNamePanelDL[18] = { +#include "assets/textures/icon_item_static/gItemNamePanelDL.inc.c" +}; + +Gfx gLButtonIconDL[10] = { +#include "assets/textures/icon_item_static/gLButtonIconDL.inc.c" +}; + +Gfx gRButtonIconDL[10] = { +#include "assets/textures/icon_item_static/gRButtonIconDL.inc.c" +}; + +Gfx gCButtonIconsDL[11] = { +#include "assets/textures/icon_item_static/gCButtonIconsDL.inc.c" +}; + +Gfx gAButtonIconDL[11] = { +#include "assets/textures/icon_item_static/gAButtonIconDL.inc.c" +}; + +Gfx gBButtonIconDL[11] = { +#include "assets/textures/icon_item_static/gBButtonIconDL.inc.c" +}; + +Gfx gPromptCursorLeftDL[10] = { +#include "assets/textures/icon_item_static/gPromptCursorLeftDL.inc.c" +}; + +Gfx gPromptCursorRightDL[10] = { +#include "assets/textures/icon_item_static/gPromptCursorRightDL.inc.c" +}; diff --git a/assets/textures/icon_item_static/icon_item_static.h b/assets/textures/icon_item_static/icon_item_static.h new file mode 100644 index 0000000000..e8aff38236 --- /dev/null +++ b/assets/textures/icon_item_static/icon_item_static.h @@ -0,0 +1,204 @@ +#ifndef ICON_ITEM_STATIC_H +#define ICON_ITEM_STATIC_H + +#include "ultra64.h" +#include "src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h" +#include "tex_len.h" +#include "versions.h" +#include "interface.h" + +extern u64 gItemIconDekuStickTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconDekuNutTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBombTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBowTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconArrowFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconDinsFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconSlingshotTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconOcarinaFairyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconOcarinaOfTimeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBombchuTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconHookshotTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconLongshotTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconArrowIceTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconFaroresWindTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBoomerangTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconLensOfTruthTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMagicBeanTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconHammerTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconArrowLightTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconNayrusLoveTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleEmptyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottlePotionRedTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottlePotionGreenTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottlePotionBlueTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleFairyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleFishTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleMilkFullTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleRutosLetterTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleBlueFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleBugTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleBigPoeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottleMilkHalfTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBottlePoeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconWeirdEggTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconChickenTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconZeldasLetterTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskKeatonTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskSkullTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskSpookyTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskBunnyHoodTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskGoronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskZoraTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskGerudoTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconMaskTruthTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconSoldOutTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconPocketEggTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconPocketCuccoTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconCojiroTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconOddMushroomTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconOddPotionTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconPoachersSawTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBrokenGoronsSwordTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconPrescriptionTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconEyeballFrogTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconEyeDropsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconClaimCheckTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBowFireTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBowIceTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBowLightTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconSwordKokiriTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconSwordMasterTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconSwordBiggoronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconShieldDekuTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconShieldHylianTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconShieldMirrorTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconTunicKokiriTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconTunicGoronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconTunicZoraTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBootsKokiriTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBootsIronTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBootsHoverTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBulletBag30Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBulletBag40Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBulletBag50Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconQuiver30Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconQuiver40Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconQuiver50Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBombBag20Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBombBag30Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBombBag40Tex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconGoronsBraceletTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconSilverGauntletsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconGoldenGauntletsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconScaleSilverTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconScaleGoldenTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconBrokenGiantsKnifeTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconAdultsWalletTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconGiantsWalletTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconDekuSeedsTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; +extern u64 gItemIconFishingPoleTex[TEX_LEN(u64, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 32)]; + +#define HEART_PIECE_ICON_TEX_WIDTH 48 +#define HEART_PIECE_ICON_TEX_HEIGHT 48 +extern u64 gHeartPieceIcon1Tex[TEX_LEN(u64, HEART_PIECE_ICON_TEX_WIDTH, HEART_PIECE_ICON_TEX_HEIGHT, 8)]; +extern u64 gHeartPieceIcon2Tex[TEX_LEN(u64, HEART_PIECE_ICON_TEX_WIDTH, HEART_PIECE_ICON_TEX_HEIGHT, 8)]; +extern u64 gHeartPieceIcon3Tex[TEX_LEN(u64, HEART_PIECE_ICON_TEX_WIDTH, HEART_PIECE_ICON_TEX_HEIGHT, 8)]; + +#define PAUSE_MENU_CURSOR_CORNER_TEX_SIZE 16 +#define PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH PAUSE_MENU_CURSOR_CORNER_TEX_SIZE +#define PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT PAUSE_MENU_CURSOR_CORNER_TEX_SIZE +extern u64 gPauseMenuCursorTopLeftTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, 4)]; +extern u64 gPauseMenuCursorTopRightTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, 4)]; +extern u64 gPauseMenuCursorBottomLeftTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, 4)]; +extern u64 gPauseMenuCursorBottomRightTex[TEX_LEN(u64, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, 4)]; + +extern u64 gPauseEquipment00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +#if OOT_PAL +extern u64 gPauseQuestStatus00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +#endif +extern u64 gPauseSave00Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave20Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave01Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave11Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave21Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave02Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave12Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave22Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave03Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave13Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave23Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseEquipment24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSelectItem24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseMap24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseQuestStatus24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave04Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave14Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseSave24Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; +extern u64 gPauseGameOver10Tex[TEX_LEN(u64, PAGE_BG_QUAD_TEX_WIDTH, PAGE_BG_QUAD_TEX_HEIGHT, 8)]; + +#define gSongNoteTex_WIDTH 16 +#define gSongNoteTex_HEIGHT 24 +extern u64 gSongNoteTex[TEX_LEN(u64, gSongNoteTex_WIDTH, gSongNoteTex_HEIGHT, 8)]; + +#define gMagicArrowEquipEffectTex_SIZE 32 +#define gMagicArrowEquipEffectTex_WIDTH gMagicArrowEquipEffectTex_SIZE +#define gMagicArrowEquipEffectTex_HEIGHT gMagicArrowEquipEffectTex_SIZE +extern u64 gMagicArrowEquipEffectTex[TEX_LEN(u64, gMagicArrowEquipEffectTex_WIDTH, gMagicArrowEquipEffectTex_HEIGHT, 8)]; + +extern Gfx gItemNamePanelDL[18]; +extern Gfx gLButtonIconDL[10]; +extern Gfx gRButtonIconDL[10]; +extern Gfx gCButtonIconsDL[11]; +extern Gfx gAButtonIconDL[11]; +extern Gfx gPromptCursorLeftDL[10]; +extern Gfx gPromptCursorRightDL[10]; + +#endif diff --git a/assets/textures/item_name_static/item_name_static.c b/assets/textures/item_name_static/item_name_static.c new file mode 100644 index 0000000000..30443f4aa2 --- /dev/null +++ b/assets/textures/item_name_static/item_name_static.c @@ -0,0 +1,1985 @@ +#include "item_name_static.h" + +#if OOT_NTSC + +// Japanese + +u64 gDekuStickItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuStickItemNameJPNTex.ia4.inc.c" +}; + +u64 gDekuNutItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuNutItemNameJPNTex.ia4.inc.c" +}; + +u64 gBombItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombItemNameJPNTex.ia4.inc.c" +}; + +u64 gFairyBowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyBowItemNameJPNTex.ia4.inc.c" +}; + +u64 gFireArrowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireArrowItemNameJPNTex.ia4.inc.c" +}; + +u64 gDinsFireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDinsFireItemNameJPNTex.ia4.inc.c" +}; + +u64 gFairySlingshotItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairySlingshotItemNameJPNTex.ia4.inc.c" +}; + +u64 gFairyOcarinaItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyOcarinaItemNameJPNTex.ia4.inc.c" +}; + +u64 gOcarinaOfTimeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOcarinaOfTimeItemNameJPNTex.ia4.inc.c" +}; + +u64 gBombchuItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombchuItemNameJPNTex.ia4.inc.c" +}; + +u64 gHookshotItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHookshotItemNameJPNTex.ia4.inc.c" +}; + +u64 gLongshotItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLongshotItemNameJPNTex.ia4.inc.c" +}; + +u64 gIceArrowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIceArrowItemNameJPNTex.ia4.inc.c" +}; + +u64 gFaroresWindItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFaroresWindItemNameJPNTex.ia4.inc.c" +}; + +u64 gBoomerangItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoomerangItemNameJPNTex.ia4.inc.c" +}; + +u64 gLensItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLensItemNameJPNTex.ia4.inc.c" +}; + +u64 gMagicBeansItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMagicBeansItemNameJPNTex.ia4.inc.c" +}; + +u64 gMegatonHammerItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMegatonHammerItemNameJPNTex.ia4.inc.c" +}; + +u64 gLightArrowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightArrowItemNameJPNTex.ia4.inc.c" +}; + +u64 gNayrusLoveItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNayrusLoveItemNameJPNTex.ia4.inc.c" +}; + +u64 gEmptyBottleItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEmptyBottleItemNameJPNTex.ia4.inc.c" +}; + +u64 gRedPotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRedPotionItemNameJPNTex.ia4.inc.c" +}; + +u64 gGreenPotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGreenPotionItemNameJPNTex.ia4.inc.c" +}; + +u64 gBluePotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBluePotionItemNameJPNTex.ia4.inc.c" +}; + +u64 gBottledFairyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBottledFairyItemNameJPNTex.ia4.inc.c" +}; + +u64 gFishItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFishItemNameJPNTex.ia4.inc.c" +}; + +u64 gFullMilkItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFullMilkItemNameJPNTex.ia4.inc.c" +}; + +u64 gRutosLetterItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRutosLetterItemNameJPNTex.ia4.inc.c" +}; + +u64 gBlueFireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBlueFireItemNameJPNTex.ia4.inc.c" +}; + +u64 gBugItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBugItemNameJPNTex.ia4.inc.c" +}; + +u64 gBigPoeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBigPoeItemNameJPNTex.ia4.inc.c" +}; + +u64 gHalfMilkItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHalfMilkItemNameJPNTex.ia4.inc.c" +}; + +u64 gPoeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoeItemNameJPNTex.ia4.inc.c" +}; + +u64 gWeirdEggItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWeirdEggItemNameJPNTex.ia4.inc.c" +}; + +u64 gCuccoItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCuccoItemNameJPNTex.ia4.inc.c" +}; + +u64 gZeldasLetterItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLetterItemNameJPNTex.ia4.inc.c" +}; + +u64 gKeatonMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKeatonMaskItemNameJPNTex.ia4.inc.c" +}; + +u64 gSkullMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSkullMaskItemNameJPNTex.ia4.inc.c" +}; + +u64 gSpookyMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpookyMaskItemNameJPNTex.ia4.inc.c" +}; + +u64 gBunnyHoodItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBunnyHoodItemNameJPNTex.ia4.inc.c" +}; + +u64 gGoronMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronMaskItemNameJPNTex.ia4.inc.c" +}; + +u64 gZoraMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraMaskItemNameJPNTex.ia4.inc.c" +}; + +u64 gGerudoMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudoMaskItemNameJPNTex.ia4.inc.c" +}; + +u64 gMaskofTruthItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMaskofTruthItemNameJPNTex.ia4.inc.c" +}; + +u64 gSOLDOUTItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSOLDOUTItemNameJPNTex.ia4.inc.c" +}; + +u64 gPocketEggItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketEggItemNameJPNTex.ia4.inc.c" +}; + +u64 gPocketCuccoItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketCuccoItemNameJPNTex.ia4.inc.c" +}; + +u64 gCojiroItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCojiroItemNameJPNTex.ia4.inc.c" +}; + +u64 gOddMushroomItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddMushroomItemNameJPNTex.ia4.inc.c" +}; + +u64 gOddPotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddPotionItemNameJPNTex.ia4.inc.c" +}; + +u64 gPoachersSawItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoachersSawItemNameJPNTex.ia4.inc.c" +}; + +u64 gBrokenGoronsSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGoronsSwordItemNameJPNTex.ia4.inc.c" +}; + +u64 gPrescriptionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPrescriptionItemNameJPNTex.ia4.inc.c" +}; + +u64 gEyeBallFrogItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeBallFrogItemNameJPNTex.ia4.inc.c" +}; + +u64 gEyeDropsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeDropsItemNameJPNTex.ia4.inc.c" +}; + +u64 gClaimCheckItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gClaimCheckItemNameJPNTex.ia4.inc.c" +}; + +u64 gUnusedWindMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedWindMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gUnusedFireMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedFireMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gUnusedIceMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedIceMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gKokiriSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriSwordItemNameJPNTex.ia4.inc.c" +}; + +u64 gMasterSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMasterSwordItemNameJPNTex.ia4.inc.c" +}; + +u64 gGiantsKnifeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGiantsKnifeItemNameJPNTex.ia4.inc.c" +}; + +u64 gDekuShieldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuShieldItemNameJPNTex.ia4.inc.c" +}; + +u64 gHylianShieldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHylianShieldItemNameJPNTex.ia4.inc.c" +}; + +u64 gMirrorShieldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMirrorShieldItemNameJPNTex.ia4.inc.c" +}; + +u64 gKokiriTunicItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriTunicItemNameJPNTex.ia4.inc.c" +}; + +u64 gGoronTunicItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronTunicItemNameJPNTex.ia4.inc.c" +}; + +u64 gZoraTunicItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraTunicItemNameJPNTex.ia4.inc.c" +}; + +u64 gKokiriBootsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriBootsItemNameJPNTex.ia4.inc.c" +}; + +u64 gIronBootsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIronBootsItemNameJPNTex.ia4.inc.c" +}; + +u64 gHoverBootsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHoverBootsItemNameJPNTex.ia4.inc.c" +}; + +u64 gBulletBag30ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag30ItemNameJPNTex.ia4.inc.c" +}; + +u64 gBulletBag40ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag40ItemNameJPNTex.ia4.inc.c" +}; + +u64 gBulletBag50ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag50ItemNameJPNTex.ia4.inc.c" +}; + +u64 gQuiver30ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver30ItemNameJPNTex.ia4.inc.c" +}; + +u64 gQuiver40ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver40ItemNameJPNTex.ia4.inc.c" +}; + +u64 gQuiver50ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver50ItemNameJPNTex.ia4.inc.c" +}; + +u64 gBombBag20ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag20ItemNameJPNTex.ia4.inc.c" +}; + +u64 gBombBag30ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag30ItemNameJPNTex.ia4.inc.c" +}; + +u64 gBombBag40ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag40ItemNameJPNTex.ia4.inc.c" +}; + +u64 gGoronsBraceletItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsBraceletItemNameJPNTex.ia4.inc.c" +}; + +u64 gSilverGauntletsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverGauntletsItemNameJPNTex.ia4.inc.c" +}; + +u64 gGoldenGauntletsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenGauntletsItemNameJPNTex.ia4.inc.c" +}; + +u64 gSilverScaleItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverScaleItemNameJPNTex.ia4.inc.c" +}; + +u64 gGoldenScaleItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenScaleItemNameJPNTex.ia4.inc.c" +}; + +u64 gBrokenGiantsKnifeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGiantsKnifeItemNameJPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName1JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName2JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName3JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName4JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName4JPNTex.ia4.inc.c" +}; + +u64 gMinuetOfForestItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMinuetOfForestItemNameJPNTex.ia4.inc.c" +}; + +u64 gBoleroOfFireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoleroOfFireItemNameJPNTex.ia4.inc.c" +}; + +u64 gSerenadeOfWaterItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSerenadeOfWaterItemNameJPNTex.ia4.inc.c" +}; + +u64 gRequiemOfSpiritItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRequiemOfSpiritItemNameJPNTex.ia4.inc.c" +}; + +u64 gNocturneOfShadowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNocturneOfShadowItemNameJPNTex.ia4.inc.c" +}; + +u64 gPreludeOfLightItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPreludeOfLightItemNameJPNTex.ia4.inc.c" +}; + +u64 gZeldasLullabyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLullabyItemNameJPNTex.ia4.inc.c" +}; + +u64 gEponasSongItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEponasSongItemNameJPNTex.ia4.inc.c" +}; + +u64 gSariasSongItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSariasSongItemNameJPNTex.ia4.inc.c" +}; + +u64 gSunsSongItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSunsSongItemNameJPNTex.ia4.inc.c" +}; + +u64 gSongOfTimeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfTimeItemNameJPNTex.ia4.inc.c" +}; + +u64 gSongOfStormsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfStormsItemNameJPNTex.ia4.inc.c" +}; + +u64 gForestMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gForestMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gFireMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gWaterMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWaterMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gSpiritMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpiritMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gShadowMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gShadowMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gLightMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightMedallionItemNameJPNTex.ia4.inc.c" +}; + +u64 gKokiriEmeraldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriEmeraldItemNameJPNTex.ia4.inc.c" +}; + +u64 gGoronsRubyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsRubyItemNameJPNTex.ia4.inc.c" +}; + +u64 gZorasSapphireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZorasSapphireItemNameJPNTex.ia4.inc.c" +}; + +u64 gStoneofAgonyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gStoneofAgonyItemNameJPNTex.ia4.inc.c" +}; + +u64 gGerudosCardItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudosCardItemNameJPNTex.ia4.inc.c" +}; + +u64 gGoldSkulltulaItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldSkulltulaItemNameJPNTex.ia4.inc.c" +}; + +u64 gPieceOfHeartItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPieceOfHeartItemNameJPNTex.ia4.inc.c" +}; + +u64 gUnusedPieceOfHeartItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedPieceOfHeartItemNameJPNTex.ia4.inc.c" +}; + +u64 gUnusedBigKeyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBigKeyItemNameJPNTex.ia4.inc.c" +}; + +u64 gCompassItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCompassItemNameJPNTex.ia4.inc.c" +}; + +u64 gDungeonMapItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDungeonMapItemNameJPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName5JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName5JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName6JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName6JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName7JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName7JPNTex.ia4.inc.c" +}; + +u64 gBiggoronsSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBiggoronsSwordItemNameJPNTex.ia4.inc.c" +}; + +#endif + +// English + +u64 gDekuStickItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuStickItemNameENGTex.ia4.inc.c" +}; + +u64 gDekuNutItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuNutItemNameENGTex.ia4.inc.c" +}; + +u64 gBombItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombItemNameENGTex.ia4.inc.c" +}; + +u64 gFairyBowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyBowItemNameENGTex.ia4.inc.c" +}; + +u64 gFireArrowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireArrowItemNameENGTex.ia4.inc.c" +}; + +u64 gDinsFireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDinsFireItemNameENGTex.ia4.inc.c" +}; + +u64 gFairySlingshotItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairySlingshotItemNameENGTex.ia4.inc.c" +}; + +u64 gFairyOcarinaItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyOcarinaItemNameENGTex.ia4.inc.c" +}; + +u64 gOcarinaOfTimeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOcarinaOfTimeItemNameENGTex.ia4.inc.c" +}; + +u64 gBombchuItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombchuItemNameENGTex.ia4.inc.c" +}; + +u64 gHookshotItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHookshotItemNameENGTex.ia4.inc.c" +}; + +u64 gLongshotItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLongshotItemNameENGTex.ia4.inc.c" +}; + +u64 gIceArrowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIceArrowItemNameENGTex.ia4.inc.c" +}; + +u64 gFaroresWindItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFaroresWindItemNameENGTex.ia4.inc.c" +}; + +u64 gBoomerangItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoomerangItemNameENGTex.ia4.inc.c" +}; + +u64 gLensItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLensItemNameENGTex.ia4.inc.c" +}; + +u64 gMagicBeansItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMagicBeansItemNameENGTex.ia4.inc.c" +}; + +u64 gMegatonHammerItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMegatonHammerItemNameENGTex.ia4.inc.c" +}; + +u64 gLightArrowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightArrowItemNameENGTex.ia4.inc.c" +}; + +u64 gNayrusLoveItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNayrusLoveItemNameENGTex.ia4.inc.c" +}; + +u64 gEmptyBottleItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEmptyBottleItemNameENGTex.ia4.inc.c" +}; + +u64 gRedPotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRedPotionItemNameENGTex.ia4.inc.c" +}; + +u64 gGreenPotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGreenPotionItemNameENGTex.ia4.inc.c" +}; + +u64 gBluePotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBluePotionItemNameENGTex.ia4.inc.c" +}; + +u64 gBottledFairyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBottledFairyItemNameENGTex.ia4.inc.c" +}; + +u64 gFishItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFishItemNameENGTex.ia4.inc.c" +}; + +u64 gFullMilkItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFullMilkItemNameENGTex.ia4.inc.c" +}; + +u64 gRutosLetterItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRutosLetterItemNameENGTex.ia4.inc.c" +}; + +u64 gBlueFireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBlueFireItemNameENGTex.ia4.inc.c" +}; + +u64 gBugItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBugItemNameENGTex.ia4.inc.c" +}; + +u64 gBigPoeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBigPoeItemNameENGTex.ia4.inc.c" +}; + +u64 gHalfMilkItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHalfMilkItemNameENGTex.ia4.inc.c" +}; + +u64 gPoeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoeItemNameENGTex.ia4.inc.c" +}; + +u64 gWeirdEggItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWeirdEggItemNameENGTex.ia4.inc.c" +}; + +u64 gCuccoItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCuccoItemNameENGTex.ia4.inc.c" +}; + +u64 gZeldasLetterItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLetterItemNameENGTex.ia4.inc.c" +}; + +u64 gKeatonMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKeatonMaskItemNameENGTex.ia4.inc.c" +}; + +u64 gSkullMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSkullMaskItemNameENGTex.ia4.inc.c" +}; + +u64 gSpookyMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpookyMaskItemNameENGTex.ia4.inc.c" +}; + +u64 gBunnyHoodItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBunnyHoodItemNameENGTex.ia4.inc.c" +}; + +u64 gGoronMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronMaskItemNameENGTex.ia4.inc.c" +}; + +u64 gZoraMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraMaskItemNameENGTex.ia4.inc.c" +}; + +u64 gGerudoMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudoMaskItemNameENGTex.ia4.inc.c" +}; + +u64 gMaskofTruthItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMaskofTruthItemNameENGTex.ia4.inc.c" +}; + +u64 gSOLDOUTItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSOLDOUTItemNameENGTex.ia4.inc.c" +}; + +u64 gPocketEggItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketEggItemNameENGTex.ia4.inc.c" +}; + +u64 gPocketCuccoItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketCuccoItemNameENGTex.ia4.inc.c" +}; + +u64 gCojiroItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCojiroItemNameENGTex.ia4.inc.c" +}; + +u64 gOddMushroomItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddMushroomItemNameENGTex.ia4.inc.c" +}; + +u64 gOddPotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddPotionItemNameENGTex.ia4.inc.c" +}; + +u64 gPoachersSawItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoachersSawItemNameENGTex.ia4.inc.c" +}; + +u64 gBrokenGoronsSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGoronsSwordItemNameENGTex.ia4.inc.c" +}; + +u64 gPrescriptionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPrescriptionItemNameENGTex.ia4.inc.c" +}; + +u64 gEyeBallFrogItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeBallFrogItemNameENGTex.ia4.inc.c" +}; + +u64 gEyeDropsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeDropsItemNameENGTex.ia4.inc.c" +}; + +u64 gClaimCheckItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gClaimCheckItemNameENGTex.ia4.inc.c" +}; + +u64 gUnusedWindMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedWindMedallionItemName1JPNTex.ia4.inc.c" +}; + +u64 gUnusedFireMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedFireMedallionItemName1JPNTex.ia4.inc.c" +}; + +u64 gUnusedIceMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedIceMedallionItemName1JPNTex.ia4.inc.c" +}; + +u64 gKokiriSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriSwordItemNameENGTex.ia4.inc.c" +}; + +u64 gMasterSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMasterSwordItemNameENGTex.ia4.inc.c" +}; + +u64 gGiantsKnifeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGiantsKnifeItemNameENGTex.ia4.inc.c" +}; + +u64 gDekuShieldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuShieldItemNameENGTex.ia4.inc.c" +}; + +u64 gHylianShieldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHylianShieldItemNameENGTex.ia4.inc.c" +}; + +u64 gMirrorShieldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMirrorShieldItemNameENGTex.ia4.inc.c" +}; + +u64 gKokiriTunicItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriTunicItemNameENGTex.ia4.inc.c" +}; + +u64 gGoronTunicItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronTunicItemNameENGTex.ia4.inc.c" +}; + +u64 gZoraTunicItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraTunicItemNameENGTex.ia4.inc.c" +}; + +u64 gKokiriBootsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriBootsItemNameENGTex.ia4.inc.c" +}; + +u64 gIronBootsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIronBootsItemNameENGTex.ia4.inc.c" +}; + +u64 gHoverBootsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHoverBootsItemNameENGTex.ia4.inc.c" +}; + +u64 gBulletBag30ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag30ItemNameENGTex.ia4.inc.c" +}; + +u64 gBulletBag40ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag40ItemNameENGTex.ia4.inc.c" +}; + +u64 gBulletBag50ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag50ItemNameENGTex.ia4.inc.c" +}; + +u64 gQuiver30ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver30ItemNameENGTex.ia4.inc.c" +}; + +u64 gQuiver40ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver40ItemNameENGTex.ia4.inc.c" +}; + +u64 gQuiver50ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver50ItemNameENGTex.ia4.inc.c" +}; + +u64 gBombBag20ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag20ItemNameENGTex.ia4.inc.c" +}; + +u64 gBombBag30ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag30ItemNameENGTex.ia4.inc.c" +}; + +u64 gBombBag40ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag40ItemNameENGTex.ia4.inc.c" +}; + +u64 gGoronsBraceletItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsBraceletItemNameENGTex.ia4.inc.c" +}; + +u64 gSilverGauntletsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverGauntletsItemNameENGTex.ia4.inc.c" +}; + +u64 gGoldenGauntletsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenGauntletsItemNameENGTex.ia4.inc.c" +}; + +u64 gSilverScaleItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverScaleItemNameENGTex.ia4.inc.c" +}; + +u64 gGoldenScaleItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenScaleItemNameENGTex.ia4.inc.c" +}; + +u64 gBrokenGiantsKnifeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGiantsKnifeItemNameENGTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName11JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName11JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName21JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName21JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName31JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName31JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName41JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName41JPNTex.ia4.inc.c" +}; + +u64 gMinuetOfForestItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMinuetOfForestItemNameENGTex.ia4.inc.c" +}; + +u64 gBoleroOfFireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoleroOfFireItemNameENGTex.ia4.inc.c" +}; + +u64 gSerenadeOfWaterItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSerenadeOfWaterItemNameENGTex.ia4.inc.c" +}; + +u64 gRequiemOfSpiritItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRequiemOfSpiritItemNameENGTex.ia4.inc.c" +}; + +u64 gNocturneOfShadowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNocturneOfShadowItemNameENGTex.ia4.inc.c" +}; + +u64 gPreludeOfLightItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPreludeOfLightItemNameENGTex.ia4.inc.c" +}; + +u64 gZeldasLullabyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLullabyItemNameENGTex.ia4.inc.c" +}; + +u64 gEponasSongItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEponasSongItemNameENGTex.ia4.inc.c" +}; + +u64 gSariasSongItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSariasSongItemNameENGTex.ia4.inc.c" +}; + +u64 gSunsSongItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSunsSongItemNameENGTex.ia4.inc.c" +}; + +u64 gSongOfTimeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfTimeItemNameENGTex.ia4.inc.c" +}; + +u64 gSongOfStormsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfStormsItemNameENGTex.ia4.inc.c" +}; + +u64 gForestMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gForestMedallionItemNameENGTex.ia4.inc.c" +}; + +u64 gFireMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireMedallionItemNameENGTex.ia4.inc.c" +}; + +u64 gWaterMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWaterMedallionItemNameENGTex.ia4.inc.c" +}; + +u64 gSpiritMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpiritMedallionItemNameENGTex.ia4.inc.c" +}; + +u64 gShadowMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gShadowMedallionItemNameENGTex.ia4.inc.c" +}; + +u64 gLightMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightMedallionItemNameENGTex.ia4.inc.c" +}; + +u64 gKokiriEmeraldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriEmeraldItemNameENGTex.ia4.inc.c" +}; + +u64 gGoronsRubyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsRubyItemNameENGTex.ia4.inc.c" +}; + +u64 gZorasSapphireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZorasSapphireItemNameENGTex.ia4.inc.c" +}; + +u64 gStoneofAgonyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gStoneofAgonyItemNameENGTex.ia4.inc.c" +}; + +u64 gGerudosCardItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudosCardItemNameENGTex.ia4.inc.c" +}; + +u64 gGoldSkulltulaItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldSkulltulaItemNameENGTex.ia4.inc.c" +}; + +u64 gPieceOfHeartItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPieceOfHeartItemNameENGTex.ia4.inc.c" +}; + +u64 gUnusedPieceOfHeartItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedPieceOfHeartItemName1JPNTex.ia4.inc.c" +}; + +u64 gUnusedBigKeyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBigKeyItemNameENGTex.ia4.inc.c" +}; + +u64 gCompassItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCompassItemNameENGTex.ia4.inc.c" +}; + +u64 gDungeonMapItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDungeonMapItemNameENGTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName51JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName51JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName61JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName61JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName71JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName71JPNTex.ia4.inc.c" +}; + +u64 gBiggoronsSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBiggoronsSwordItemNameENGTex.ia4.inc.c" +}; + +#if OOT_PAL + +// German + +u64 gDekuStickItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuStickItemNameGERTex.ia4.inc.c" +}; + +u64 gDekuNutItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuNutItemNameGERTex.ia4.inc.c" +}; + +u64 gBombItemNameItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombItemNameItemNameGERTex.ia4.inc.c" +}; + +u64 gFairyBowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyBowItemNameGERTex.ia4.inc.c" +}; + +u64 gFireArrowItemNameUnk2GERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireArrowItemNameUnk2GERTex.ia4.inc.c" +}; + +u64 gDinsFireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDinsFireItemNameGERTex.ia4.inc.c" +}; + +u64 gFairySlingshotItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairySlingshotItemNameGERTex.ia4.inc.c" +}; + +u64 gFairyOcarinaItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyOcarinaItemNameGERTex.ia4.inc.c" +}; + +u64 gOcarinaOfTimeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOcarinaOfTimeItemNameGERTex.ia4.inc.c" +}; + +u64 gBombchuItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombchuItemNameGERTex.ia4.inc.c" +}; + +u64 gHookshotItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHookshotItemNameGERTex.ia4.inc.c" +}; + +u64 gLongshotItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLongshotItemNameGERTex.ia4.inc.c" +}; + +u64 gIceArrowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIceArrowItemNameGERTex.ia4.inc.c" +}; + +u64 gFaroresWindItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFaroresWindItemNameGERTex.ia4.inc.c" +}; + +u64 gBoomerangItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoomerangItemNameGERTex.ia4.inc.c" +}; + +u64 gLensItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLensItemNameGERTex.ia4.inc.c" +}; + +u64 gMagicBeansItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMagicBeansItemNameGERTex.ia4.inc.c" +}; + +u64 gMegatonHammerItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMegatonHammerItemNameGERTex.ia4.inc.c" +}; + +u64 gLightArrowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightArrowItemNameGERTex.ia4.inc.c" +}; + +u64 gNayrusLoveItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNayrusLoveItemNameGERTex.ia4.inc.c" +}; + +u64 gEmptyBottleItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEmptyBottleItemNameGERTex.ia4.inc.c" +}; + +u64 gRedPotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRedPotionItemNameGERTex.ia4.inc.c" +}; + +u64 gGreenPotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGreenPotionItemNameGERTex.ia4.inc.c" +}; + +u64 gBluePotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBluePotionItemNameGERTex.ia4.inc.c" +}; + +u64 gBottledFairyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBottledFairyItemNameGERTex.ia4.inc.c" +}; + +u64 gFishItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFishItemNameGERTex.ia4.inc.c" +}; + +u64 gFullMilkItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFullMilkItemNameGERTex.ia4.inc.c" +}; + +u64 gRutosLetterItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRutosLetterItemNameGERTex.ia4.inc.c" +}; + +u64 gBlueFireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBlueFireItemNameGERTex.ia4.inc.c" +}; + +u64 gBugItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBugItemNameGERTex.ia4.inc.c" +}; + +u64 gBigPoeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBigPoeItemNameGERTex.ia4.inc.c" +}; + +u64 gHalfMilkItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHalfMilkItemNameGERTex.ia4.inc.c" +}; + +u64 gPoeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoeItemNameGERTex.ia4.inc.c" +}; + +u64 gWeirdEggItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWeirdEggItemNameGERTex.ia4.inc.c" +}; + +u64 gCuccoItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCuccoItemNameGERTex.ia4.inc.c" +}; + +u64 gZeldasLetterItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLetterItemNameGERTex.ia4.inc.c" +}; + +u64 gKeatonMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKeatonMaskItemNameGERTex.ia4.inc.c" +}; + +u64 gSkullMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSkullMaskItemNameGERTex.ia4.inc.c" +}; + +u64 gSpookyMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpookyMaskItemNameGERTex.ia4.inc.c" +}; + +u64 gBunnyHoodItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBunnyHoodItemNameGERTex.ia4.inc.c" +}; + +u64 gGoronMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronMaskItemNameGERTex.ia4.inc.c" +}; + +u64 gZoraMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraMaskItemNameGERTex.ia4.inc.c" +}; + +u64 gGerudoMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudoMaskItemNameGERTex.ia4.inc.c" +}; + +u64 gMaskofTruthItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMaskofTruthItemNameGERTex.ia4.inc.c" +}; + +u64 gSOLDOUTItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSOLDOUTItemNameGERTex.ia4.inc.c" +}; + +u64 gPocketEggItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketEggItemNameGERTex.ia4.inc.c" +}; + +u64 gPocketCuccoItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketCuccoItemNameGERTex.ia4.inc.c" +}; + +u64 gCojiroItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCojiroItemNameGERTex.ia4.inc.c" +}; + +u64 gOddMushroomItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddMushroomItemNameGERTex.ia4.inc.c" +}; + +u64 gOddPotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddPotionItemNameGERTex.ia4.inc.c" +}; + +u64 gPoachersSawItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoachersSawItemNameGERTex.ia4.inc.c" +}; + +u64 gBrokenGoronsSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGoronsSwordItemNameGERTex.ia4.inc.c" +}; + +u64 gPrescriptionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPrescriptionItemNameGERTex.ia4.inc.c" +}; + +u64 gEyeBallFrogItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeBallFrogItemNameGERTex.ia4.inc.c" +}; + +u64 gEyeDropsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeDropsItemNameGERTex.ia4.inc.c" +}; + +u64 gClaimCheckItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gClaimCheckItemNameGERTex.ia4.inc.c" +}; + +u64 gUnusedWindMedallionItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedWindMedallionItemName2JPNTex.ia4.inc.c" +}; + +u64 gUnusedFireMedallionItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedFireMedallionItemName2JPNTex.ia4.inc.c" +}; + +u64 gUnusedIceMedallionItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedIceMedallionItemName2JPNTex.ia4.inc.c" +}; + +u64 gKokiriSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriSwordItemNameGERTex.ia4.inc.c" +}; + +u64 gMasterSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMasterSwordItemNameGERTex.ia4.inc.c" +}; + +u64 gGiantsKnifeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGiantsKnifeItemNameGERTex.ia4.inc.c" +}; + +u64 gDekuShieldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuShieldItemNameGERTex.ia4.inc.c" +}; + +u64 gHylianShieldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHylianShieldItemNameGERTex.ia4.inc.c" +}; + +u64 gMirrorShieldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMirrorShieldItemNameGERTex.ia4.inc.c" +}; + +u64 gKokiriTunicItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriTunicItemNameGERTex.ia4.inc.c" +}; + +u64 gGoronTunicItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronTunicItemNameGERTex.ia4.inc.c" +}; + +u64 gZoraTunicItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraTunicItemNameGERTex.ia4.inc.c" +}; + +u64 gKokiriBootsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriBootsItemNameGERTex.ia4.inc.c" +}; + +u64 gIronBootsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIronBootsItemNameGERTex.ia4.inc.c" +}; + +u64 gHoverBootsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHoverBootsItemNameGERTex.ia4.inc.c" +}; + +u64 gBulletBag30ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag30ItemNameGERTex.ia4.inc.c" +}; + +u64 gBulletBag40ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag40ItemNameGERTex.ia4.inc.c" +}; + +u64 gBulletBag50ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag50ItemNameGERTex.ia4.inc.c" +}; + +u64 gQuiver30ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver30ItemNameGERTex.ia4.inc.c" +}; + +u64 gQuiver40ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver40ItemNameGERTex.ia4.inc.c" +}; + +u64 gQuiver50ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver50ItemNameGERTex.ia4.inc.c" +}; + +u64 gBombBag20ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag20ItemNameGERTex.ia4.inc.c" +}; + +u64 gBombBag30ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag30ItemNameGERTex.ia4.inc.c" +}; + +u64 gBombBag40ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag40ItemNameGERTex.ia4.inc.c" +}; + +u64 gGoronsBraceletItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsBraceletItemNameGERTex.ia4.inc.c" +}; + +u64 gSilverGauntletsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverGauntletsItemNameGERTex.ia4.inc.c" +}; + +u64 gGoldenGauntletsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenGauntletsItemNameGERTex.ia4.inc.c" +}; + +u64 gSilverScaleItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverScaleItemNameGERTex.ia4.inc.c" +}; + +u64 gGoldenScaleItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenScaleItemNameGERTex.ia4.inc.c" +}; + +u64 gBrokenGiantsKnifeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGiantsKnifeItemNameGERTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName12JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName12JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName22JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName22JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName32JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName32JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName42JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName42JPNTex.ia4.inc.c" +}; + +u64 gMinuetOfForestItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMinuetOfForestItemNameGERTex.ia4.inc.c" +}; + +u64 gBoleroOfFireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoleroOfFireItemNameGERTex.ia4.inc.c" +}; + +u64 gSerenadeOfWaterItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSerenadeOfWaterItemNameGERTex.ia4.inc.c" +}; + +u64 gRequiemOfSpiritItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRequiemOfSpiritItemNameGERTex.ia4.inc.c" +}; + +u64 gNocturneOfShadowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNocturneOfShadowItemNameGERTex.ia4.inc.c" +}; + +u64 gPreludeOfLightItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPreludeOfLightItemNameGERTex.ia4.inc.c" +}; + +u64 gZeldasLullabyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLullabyItemNameGERTex.ia4.inc.c" +}; + +u64 gEponasSongItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEponasSongItemNameGERTex.ia4.inc.c" +}; + +u64 gSariasSongItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSariasSongItemNameGERTex.ia4.inc.c" +}; + +u64 gSunsSongItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSunsSongItemNameGERTex.ia4.inc.c" +}; + +u64 gSongOfTimeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfTimeItemNameGERTex.ia4.inc.c" +}; + +u64 gSongOfStormsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfStormsItemNameGERTex.ia4.inc.c" +}; + +u64 gForestMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gForestMedallionItemNameGERTex.ia4.inc.c" +}; + +u64 gFireMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireMedallionItemNameGERTex.ia4.inc.c" +}; + +u64 gWaterMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWaterMedallionItemNameGERTex.ia4.inc.c" +}; + +u64 gSpiritMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpiritMedallionItemNameGERTex.ia4.inc.c" +}; + +u64 gShadowMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gShadowMedallionItemNameGERTex.ia4.inc.c" +}; + +u64 gLightMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightMedallionItemNameGERTex.ia4.inc.c" +}; + +u64 gKokiriEmeraldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriEmeraldItemNameGERTex.ia4.inc.c" +}; + +u64 gGoronsRubyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsRubyItemNameGERTex.ia4.inc.c" +}; + +u64 gZorasSapphireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZorasSapphireItemNameGERTex.ia4.inc.c" +}; + +u64 gStoneofAgonyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gStoneofAgonyItemNameGERTex.ia4.inc.c" +}; + +u64 gGerudosCardItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudosCardItemNameGERTex.ia4.inc.c" +}; + +u64 gGoldSkulltulaItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldSkulltulaItemNameGERTex.ia4.inc.c" +}; + +u64 gHeartContainerItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHeartContainerItemNameGERTex.ia4.inc.c" +}; + +u64 gUnusedPieceOfHeartItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedPieceOfHeartItemName2JPNTex.ia4.inc.c" +}; + +u64 gBigKeyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBigKeyItemNameGERTex.ia4.inc.c" +}; + +u64 gCompassItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCompassItemNameGERTex.ia4.inc.c" +}; + +u64 gDungeonMapItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDungeonMapItemNameGERTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName52JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName52JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName62JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName62JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName72JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName72JPNTex.ia4.inc.c" +}; + +u64 gBiggoronsSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBiggoronsSwordItemNameGERTex.ia4.inc.c" +}; + +// French + +u64 gDekuStickItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuStickItemNameFRATex.ia4.inc.c" +}; + +u64 gDekuNutItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuNutItemNameFRATex.ia4.inc.c" +}; + +u64 gBombItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombItemNameFRATex.ia4.inc.c" +}; + +u64 gFairyBowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyBowItemNameFRATex.ia4.inc.c" +}; + +u64 gFireArrowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireArrowItemNameFRATex.ia4.inc.c" +}; + +u64 gDinsFireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDinsFireItemNameFRATex.ia4.inc.c" +}; + +u64 gFairySlingshotItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairySlingshotItemNameFRATex.ia4.inc.c" +}; + +u64 gFairyOcarinaItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFairyOcarinaItemNameFRATex.ia4.inc.c" +}; + +u64 gOcarinaOfTimeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOcarinaOfTimeItemNameFRATex.ia4.inc.c" +}; + +u64 gBombchuItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombchuItemNameFRATex.ia4.inc.c" +}; + +u64 gHookshotItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHookshotItemNameFRATex.ia4.inc.c" +}; + +u64 gLongshotItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLongshotItemNameFRATex.ia4.inc.c" +}; + +u64 gIceArrowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIceArrowItemNameFRATex.ia4.inc.c" +}; + +u64 gFaroresWindItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFaroresWindItemNameFRATex.ia4.inc.c" +}; + +u64 gBoomerangItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoomerangItemNameFRATex.ia4.inc.c" +}; + +u64 gLensItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLensItemNameFRATex.ia4.inc.c" +}; + +u64 gMagicBeansItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMagicBeansItemNameFRATex.ia4.inc.c" +}; + +u64 gMegatonHammerItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMegatonHammerItemNameFRATex.ia4.inc.c" +}; + +u64 gLightArrowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightArrowItemNameFRATex.ia4.inc.c" +}; + +u64 gNayrusLoveItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNayrusLoveItemNameFRATex.ia4.inc.c" +}; + +u64 gEmptyBottleItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEmptyBottleItemNameFRATex.ia4.inc.c" +}; + +u64 gRedPotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRedPotionItemNameFRATex.ia4.inc.c" +}; + +u64 gGreenPotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGreenPotionItemNameFRATex.ia4.inc.c" +}; + +u64 gBluePotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBluePotionItemNameFRATex.ia4.inc.c" +}; + +u64 gBottledFairyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBottledFairyItemNameFRATex.ia4.inc.c" +}; + +u64 gFishItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFishItemNameFRATex.ia4.inc.c" +}; + +u64 gFullMilkItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFullMilkItemNameFRATex.ia4.inc.c" +}; + +u64 gRutosLetterItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRutosLetterItemNameFRATex.ia4.inc.c" +}; + +u64 gBlueFireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBlueFireItemNameFRATex.ia4.inc.c" +}; + +u64 gBugItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBugItemNameFRATex.ia4.inc.c" +}; + +u64 gBigPoeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBigPoeItemNameFRATex.ia4.inc.c" +}; + +u64 gHalfMilkItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHalfMilkItemNameFRATex.ia4.inc.c" +}; + +u64 gPoeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoeItemNameFRATex.ia4.inc.c" +}; + +u64 gWeirdEggItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWeirdEggItemNameFRATex.ia4.inc.c" +}; + +u64 gCuccoItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCuccoItemNameFRATex.ia4.inc.c" +}; + +u64 gZeldasLetterItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLetterItemNameFRATex.ia4.inc.c" +}; + +u64 gKeatonMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKeatonMaskItemNameFRATex.ia4.inc.c" +}; + +u64 gSkullMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSkullMaskItemNameFRATex.ia4.inc.c" +}; + +u64 gSpookyMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpookyMaskItemNameFRATex.ia4.inc.c" +}; + +u64 gBunnyHoodItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBunnyHoodItemNameFRATex.ia4.inc.c" +}; + +u64 gGoronMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronMaskItemNameFRATex.ia4.inc.c" +}; + +u64 gZoraMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraMaskItemNameFRATex.ia4.inc.c" +}; + +u64 gGerudoMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudoMaskItemNameFRATex.ia4.inc.c" +}; + +u64 gMaskofTruthItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMaskofTruthItemNameFRATex.ia4.inc.c" +}; + +u64 gSOLDOUTItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSOLDOUTItemNameFRATex.ia4.inc.c" +}; + +u64 gPocketEggItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketEggItemNameFRATex.ia4.inc.c" +}; + +u64 gPocketCuccoItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPocketCuccoItemNameFRATex.ia4.inc.c" +}; + +u64 gCojiroItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCojiroItemNameFRATex.ia4.inc.c" +}; + +u64 gOddMushroomItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddMushroomItemNameFRATex.ia4.inc.c" +}; + +u64 gOddPotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gOddPotionItemNameFRATex.ia4.inc.c" +}; + +u64 gPoachersSawItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPoachersSawItemNameFRATex.ia4.inc.c" +}; + +u64 gBrokenGoronsSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGoronsSwordItemNameFRATex.ia4.inc.c" +}; + +u64 gPrescriptionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPrescriptionItemNameFRATex.ia4.inc.c" +}; + +u64 gEyeBallFrogItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeBallFrogItemNameFRATex.ia4.inc.c" +}; + +u64 gEyeDropsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEyeDropsItemNameFRATex.ia4.inc.c" +}; + +u64 gClaimCheckItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gClaimCheckItemNameFRATex.ia4.inc.c" +}; + +u64 gUnusedWindMedallionItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedWindMedallionItemName3JPNTex.ia4.inc.c" +}; + +u64 gUnusedFireMedallionItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedFireMedallionItemName3JPNTex.ia4.inc.c" +}; + +u64 gUnusedIceMedallionItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedIceMedallionItemName3JPNTex.ia4.inc.c" +}; + +u64 gKokiriSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriSwordItemNameFRATex.ia4.inc.c" +}; + +u64 gMasterSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMasterSwordItemNameFRATex.ia4.inc.c" +}; + +u64 gGiantsKnifeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGiantsKnifeItemNameFRATex.ia4.inc.c" +}; + +u64 gDekuShieldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDekuShieldItemNameFRATex.ia4.inc.c" +}; + +u64 gHylianShieldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHylianShieldItemNameFRATex.ia4.inc.c" +}; + +u64 gMirrorShieldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMirrorShieldItemNameFRATex.ia4.inc.c" +}; + +u64 gKokiriTunicItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriTunicItemNameFRATex.ia4.inc.c" +}; + +u64 gGoronTunicItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronTunicItemNameFRATex.ia4.inc.c" +}; + +u64 gZoraTunicItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZoraTunicItemNameFRATex.ia4.inc.c" +}; + +u64 gKokiriBootsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriBootsItemNameFRATex.ia4.inc.c" +}; + +u64 gIronBootsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gIronBootsItemNameFRATex.ia4.inc.c" +}; + +u64 gHoverBootsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHoverBootsItemNameFRATex.ia4.inc.c" +}; + +u64 gBulletBag30ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag30ItemNameFRATex.ia4.inc.c" +}; + +u64 gBulletBag40ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag40ItemNameFRATex.ia4.inc.c" +}; + +u64 gBulletBag50ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBulletBag50ItemNameFRATex.ia4.inc.c" +}; + +u64 gQuiver30ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver30ItemNameFRATex.ia4.inc.c" +}; + +u64 gQuiver40ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver40ItemNameFRATex.ia4.inc.c" +}; + +u64 gQuiver50ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gQuiver50ItemNameFRATex.ia4.inc.c" +}; + +u64 gBombBag20ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag20ItemNameFRATex.ia4.inc.c" +}; + +u64 gBombBag30ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag30ItemNameFRATex.ia4.inc.c" +}; + +u64 gBombBag40ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBombBag40ItemNameFRATex.ia4.inc.c" +}; + +u64 gGoronsBraceletItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsBraceletItemNameFRATex.ia4.inc.c" +}; + +u64 gSilverGauntletsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverGauntletsItemNameFRATex.ia4.inc.c" +}; + +u64 gGoldenGauntletsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenGauntletsItemNameFRATex.ia4.inc.c" +}; + +u64 gSilverScaleItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSilverScaleItemNameFRATex.ia4.inc.c" +}; + +u64 gGoldenScaleItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldenScaleItemNameFRATex.ia4.inc.c" +}; + +u64 gBrokenGiantsKnifeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBrokenGiantsKnifeItemNameFRATex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName13JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName13JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName23JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName23JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName33JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName33JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName43JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName43JPNTex.ia4.inc.c" +}; + +u64 gMinuetOfForestItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gMinuetOfForestItemNameFRATex.ia4.inc.c" +}; + +u64 gBoleroOfFireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBoleroOfFireItemNameFRATex.ia4.inc.c" +}; + +u64 gSerenadeOfWaterItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSerenadeOfWaterItemNameFRATex.ia4.inc.c" +}; + +u64 gRequiemOfSpiritItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gRequiemOfSpiritItemNameFRATex.ia4.inc.c" +}; + +u64 gNocturneOfShadowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gNocturneOfShadowItemNameFRATex.ia4.inc.c" +}; + +u64 gPreludeOfLightItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gPreludeOfLightItemNameFRATex.ia4.inc.c" +}; + +u64 gZeldasLullabyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZeldasLullabyItemNameFRATex.ia4.inc.c" +}; + +u64 gEponasSongItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gEponasSongItemNameFRATex.ia4.inc.c" +}; + +u64 gSariasSongItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSariasSongItemNameFRATex.ia4.inc.c" +}; + +u64 gSunsSongItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSunsSongItemNameFRATex.ia4.inc.c" +}; + +u64 gSongOfTimeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfTimeItemNameFRATex.ia4.inc.c" +}; + +u64 gSongOfStormsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSongOfStormsItemNameFRATex.ia4.inc.c" +}; + +u64 gForestMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gForestMedallionItemNameFRATex.ia4.inc.c" +}; + +u64 gFireMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gFireMedallionItemNameFRATex.ia4.inc.c" +}; + +u64 gWaterMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gWaterMedallionItemNameFRATex.ia4.inc.c" +}; + +u64 gSpiritMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gSpiritMedallionItemNameFRATex.ia4.inc.c" +}; + +u64 gShadowMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gShadowMedallionItemNameFRATex.ia4.inc.c" +}; + +u64 gLightMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gLightMedallionItemNameFRATex.ia4.inc.c" +}; + +u64 gKokiriEmeraldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gKokiriEmeraldItemNameFRATex.ia4.inc.c" +}; + +u64 gGoronsRubyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoronsRubyItemNameFRATex.ia4.inc.c" +}; + +u64 gZorasSapphireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gZorasSapphireItemNameFRATex.ia4.inc.c" +}; + +u64 gStoneofAgonyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gStoneofAgonyItemNameFRATex.ia4.inc.c" +}; + +u64 gGerudosCardItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGerudosCardItemNameFRATex.ia4.inc.c" +}; + +u64 gGoldSkulltulaItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gGoldSkulltulaItemNameFRATex.ia4.inc.c" +}; + +u64 gHeartContainerItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gHeartContainerItemNameFRATex.ia4.inc.c" +}; + +u64 gUnusedPieceOfHeartItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedPieceOfHeartItemName3JPNTex.ia4.inc.c" +}; + +u64 gBossKeyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBossKeyItemNameFRATex.ia4.inc.c" +}; + +u64 gCompassItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gCompassItemNameFRATex.ia4.inc.c" +}; + +u64 gDungeonMapItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gDungeonMapItemNameFRATex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName53JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName53JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName63JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName63JPNTex.ia4.inc.c" +}; + +u64 gUnusedBossKeyItemName73JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gUnusedBossKeyItemName73JPNTex.ia4.inc.c" +}; + +u64 gBiggoronsSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)] = { +#include "assets/textures/item_name_static/gBiggoronsSwordItemNameFRATex.ia4.inc.c" +}; + +#endif diff --git a/assets/textures/item_name_static/item_name_static.h b/assets/textures/item_name_static/item_name_static.h new file mode 100644 index 0000000000..22806a4670 --- /dev/null +++ b/assets/textures/item_name_static/item_name_static.h @@ -0,0 +1,513 @@ +#ifndef ITEM_NAME_STATIC_H +#define ITEM_NAME_STATIC_H + +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "item.h" + +#if OOT_NTSC + +extern u64 gDekuStickItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuNutItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyBowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireArrowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDinsFireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairySlingshotItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyOcarinaItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOcarinaOfTimeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombchuItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHookshotItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLongshotItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIceArrowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFaroresWindItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoomerangItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLensItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMagicBeansItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMegatonHammerItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightArrowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNayrusLoveItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEmptyBottleItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRedPotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGreenPotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBluePotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBottledFairyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFishItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFullMilkItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRutosLetterItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBlueFireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBugItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBigPoeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHalfMilkItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWeirdEggItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCuccoItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLetterItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKeatonMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSkullMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpookyMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBunnyHoodItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudoMaskItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMaskofTruthItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSOLDOUTItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketEggItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketCuccoItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCojiroItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddMushroomItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddPotionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoachersSawItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGoronsSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPrescriptionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeBallFrogItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeDropsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gClaimCheckItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedWindMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedFireMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedIceMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMasterSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGiantsKnifeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuShieldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHylianShieldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMirrorShieldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriTunicItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronTunicItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraTunicItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriBootsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIronBootsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHoverBootsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag30ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag40ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag50ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver30ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver40ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver50ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag20ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag30ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag40ItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsBraceletItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverGauntletsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenGauntletsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverScaleItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenScaleItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGiantsKnifeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName4JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMinuetOfForestItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoleroOfFireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSerenadeOfWaterItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRequiemOfSpiritItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNocturneOfShadowItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPreludeOfLightItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLullabyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEponasSongItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSariasSongItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSunsSongItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfTimeItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfStormsItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gForestMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWaterMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpiritMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gShadowMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightMedallionItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriEmeraldItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsRubyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZorasSapphireItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gStoneofAgonyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudosCardItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldSkulltulaItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPieceOfHeartItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedPieceOfHeartItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBigKeyItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCompassItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDungeonMapItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName5JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName6JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName7JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBiggoronsSwordItemNameJPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; + +#endif + +extern u64 gDekuStickItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuNutItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyBowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireArrowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDinsFireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairySlingshotItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyOcarinaItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOcarinaOfTimeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombchuItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHookshotItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLongshotItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIceArrowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFaroresWindItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoomerangItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLensItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMagicBeansItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMegatonHammerItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightArrowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNayrusLoveItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEmptyBottleItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRedPotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGreenPotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBluePotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBottledFairyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFishItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFullMilkItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRutosLetterItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBlueFireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBugItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBigPoeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHalfMilkItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWeirdEggItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCuccoItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLetterItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKeatonMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSkullMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpookyMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBunnyHoodItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudoMaskItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMaskofTruthItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSOLDOUTItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketEggItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketCuccoItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCojiroItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddMushroomItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddPotionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoachersSawItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGoronsSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPrescriptionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeBallFrogItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeDropsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gClaimCheckItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedWindMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedFireMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedIceMedallionItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMasterSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGiantsKnifeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuShieldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHylianShieldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMirrorShieldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriTunicItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronTunicItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraTunicItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriBootsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIronBootsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHoverBootsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag30ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag40ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag50ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver30ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver40ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver50ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag20ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag30ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag40ItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsBraceletItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverGauntletsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenGauntletsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverScaleItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenScaleItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGiantsKnifeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName4JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMinuetOfForestItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoleroOfFireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSerenadeOfWaterItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRequiemOfSpiritItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNocturneOfShadowItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPreludeOfLightItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLullabyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEponasSongItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSariasSongItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSunsSongItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfTimeItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfStormsItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gForestMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWaterMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpiritMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gShadowMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightMedallionItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriEmeraldItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsRubyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZorasSapphireItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gStoneofAgonyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudosCardItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldSkulltulaItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPieceOfHeartItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedPieceOfHeartItemName1JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBigKeyItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCompassItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDungeonMapItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName5JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName6JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName7JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBiggoronsSwordItemNameENGTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; + +#if OOT_PAL + +extern u64 gDekuStickItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuNutItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombItemNameItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyBowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireArrowItemNameUnk2GERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDinsFireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairySlingshotItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyOcarinaItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOcarinaOfTimeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombchuItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHookshotItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLongshotItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIceArrowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFaroresWindItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoomerangItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLensItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMagicBeansItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMegatonHammerItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightArrowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNayrusLoveItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEmptyBottleItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRedPotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGreenPotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBluePotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBottledFairyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFishItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFullMilkItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRutosLetterItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBlueFireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBugItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBigPoeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHalfMilkItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWeirdEggItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCuccoItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLetterItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKeatonMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSkullMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpookyMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBunnyHoodItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudoMaskItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMaskofTruthItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSOLDOUTItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketEggItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketCuccoItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCojiroItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddMushroomItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddPotionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoachersSawItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGoronsSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPrescriptionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeBallFrogItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeDropsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gClaimCheckItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedWindMedallionItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedFireMedallionItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedIceMedallionItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMasterSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGiantsKnifeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuShieldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHylianShieldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMirrorShieldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriTunicItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronTunicItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraTunicItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriBootsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIronBootsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHoverBootsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag30ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag40ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag50ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver30ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver40ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver50ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag20ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag30ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag40ItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsBraceletItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverGauntletsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenGauntletsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverScaleItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenScaleItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGiantsKnifeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName8JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName9JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName10JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName11JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMinuetOfForestItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoleroOfFireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSerenadeOfWaterItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRequiemOfSpiritItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNocturneOfShadowItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPreludeOfLightItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLullabyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEponasSongItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSariasSongItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSunsSongItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfTimeItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfStormsItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gForestMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWaterMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpiritMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gShadowMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightMedallionItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriEmeraldItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsRubyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZorasSapphireItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gStoneofAgonyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudosCardItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldSkulltulaItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHeartContainerItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedPieceOfHeartItemName2JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBigKeyItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCompassItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDungeonMapItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName12JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName13JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName14JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBiggoronsSwordItemNameGERTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; + +extern u64 gDekuStickItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuNutItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyBowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireArrowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDinsFireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairySlingshotItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFairyOcarinaItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOcarinaOfTimeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombchuItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHookshotItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLongshotItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIceArrowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFaroresWindItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoomerangItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLensItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMagicBeansItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMegatonHammerItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightArrowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNayrusLoveItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEmptyBottleItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRedPotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGreenPotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBluePotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBottledFairyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFishItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFullMilkItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRutosLetterItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBlueFireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBugItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBigPoeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHalfMilkItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWeirdEggItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCuccoItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLetterItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKeatonMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSkullMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpookyMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBunnyHoodItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudoMaskItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMaskofTruthItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSOLDOUTItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketEggItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPocketCuccoItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCojiroItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddMushroomItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gOddPotionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPoachersSawItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGoronsSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPrescriptionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeBallFrogItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEyeDropsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gClaimCheckItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedWindMedallionItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedFireMedallionItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedIceMedallionItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMasterSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGiantsKnifeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDekuShieldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHylianShieldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMirrorShieldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriTunicItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronTunicItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZoraTunicItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriBootsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gIronBootsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHoverBootsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag30ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag40ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBulletBag50ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver30ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver40ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gQuiver50ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag20ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag30ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBombBag40ItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsBraceletItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverGauntletsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenGauntletsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSilverScaleItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldenScaleItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBrokenGiantsKnifeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName15JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName16JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName17JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName18JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gMinuetOfForestItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBoleroOfFireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSerenadeOfWaterItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gRequiemOfSpiritItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gNocturneOfShadowItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gPreludeOfLightItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZeldasLullabyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gEponasSongItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSariasSongItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSunsSongItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfTimeItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSongOfStormsItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gForestMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gFireMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gWaterMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gSpiritMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gShadowMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gLightMedallionItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gKokiriEmeraldItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoronsRubyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gZorasSapphireItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gStoneofAgonyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGerudosCardItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gGoldSkulltulaItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gHeartContainerItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedPieceOfHeartItemName3JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBossKeyItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gCompassItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gDungeonMapItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName19JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName20JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gUnusedBossKeyItemName21JPNTex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; +extern u64 gBiggoronsSwordItemNameFRATex[TEX_LEN(u64, ITEM_NAME_TEX_WIDTH, ITEM_NAME_TEX_HEIGHT, 4)]; + +#endif + +#endif diff --git a/assets/textures/place_title_cards/g_pn_01.c b/assets/textures/place_title_cards/g_pn_01.c new file mode 100644 index 0000000000..e91c30dd8c --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_01.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gForestTempleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gForestTempleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gForestTempleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gForestTempleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gForestTempleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gForestTempleTitleCardGERTex.ia8.inc.c" +}; + +u64 gForestTempleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gForestTempleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_02.c b/assets/textures/place_title_cards/g_pn_02.c new file mode 100644 index 0000000000..f7a0153764 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_02.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gShadowTempleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShadowTempleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gShadowTempleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShadowTempleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gShadowTempleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShadowTempleTitleCardGERTex.ia8.inc.c" +}; + +u64 gShadowTempleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShadowTempleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_03.c b/assets/textures/place_title_cards/g_pn_03.c new file mode 100644 index 0000000000..8f56f98522 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_03.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gFireTempleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFireTempleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gFireTempleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFireTempleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gFireTempleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFireTempleTitleCardGERTex.ia8.inc.c" +}; + +u64 gFireTempleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFireTempleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_04.c b/assets/textures/place_title_cards/g_pn_04.c new file mode 100644 index 0000000000..e7844ff898 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_04.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gWaterTempleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gWaterTempleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gWaterTempleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gWaterTempleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gWaterTempleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gWaterTempleTitleCardGERTex.ia8.inc.c" +}; + +u64 gWaterTempleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gWaterTempleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_05.c b/assets/textures/place_title_cards/g_pn_05.c new file mode 100644 index 0000000000..70dfa83325 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_05.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gSpiritTempleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSpiritTempleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gSpiritTempleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSpiritTempleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gSpiritTempleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSpiritTempleTitleCardGERTex.ia8.inc.c" +}; + +u64 gSpiritTempleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSpiritTempleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_06.c b/assets/textures/place_title_cards/g_pn_06.c new file mode 100644 index 0000000000..4d1dfadc06 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_06.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gDekuTreeTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDekuTreeTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gDekuTreeTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDekuTreeTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gDekuTreeTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDekuTreeTitleCardGERTex.ia8.inc.c" +}; + +u64 gDekuTreeTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDekuTreeTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_07.c b/assets/textures/place_title_cards/g_pn_07.c new file mode 100644 index 0000000000..0eab2f3868 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_07.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gJabuJabuTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gJabuJabuTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gJabuJabuTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gJabuJabuTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gJabuJabuTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gJabuJabuTitleCardGERTex.ia8.inc.c" +}; + +u64 gJabuJabuTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gJabuJabuTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_08.c b/assets/textures/place_title_cards/g_pn_08.c new file mode 100644 index 0000000000..bb5b3617b9 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_08.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gDodongosCavernTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDodongosCavernTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gDodongosCavernTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDodongosCavernTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gDodongosCavernTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDodongosCavernTitleCardGERTex.ia8.inc.c" +}; + +u64 gDodongosCavernTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDodongosCavernTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_09.c b/assets/textures/place_title_cards/g_pn_09.c new file mode 100644 index 0000000000..37116ca729 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_09.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gInsideGanonsCastleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gInsideGanonsCastleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gInsideGanonsCastleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gInsideGanonsCastleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gInsideGanonsCastleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gInsideGanonsCastleTitleCardGERTex.ia8.inc.c" +}; + +u64 gInsideGanonsCastleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gInsideGanonsCastleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_10.c b/assets/textures/place_title_cards/g_pn_10.c new file mode 100644 index 0000000000..9b183245f4 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_10.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gIceCavernTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gIceCavernTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gIceCavernTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gIceCavernTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gIceCavernTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gIceCavernTitleCardGERTex.ia8.inc.c" +}; + +u64 gIceCavernTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gIceCavernTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_11.c b/assets/textures/place_title_cards/g_pn_11.c new file mode 100644 index 0000000000..d24673a514 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_11.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGERudoTrainingGroundTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoTrainingGroundTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGERudoTrainingGroundTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoTrainingGroundTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGERudoTrainingGroundTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoTrainingGroundTitleCardGERTex.ia8.inc.c" +}; + +u64 gGERudoTrainingGroundTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoTrainingGroundTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_12.c b/assets/textures/place_title_cards/g_pn_12.c new file mode 100644 index 0000000000..e362af21c7 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_12.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gCastleCourtyardTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gCastleCourtyardTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gCastleCourtyardTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gCastleCourtyardTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gCastleCourtyardTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gCastleCourtyardTitleCardGERTex.ia8.inc.c" +}; + +u64 gCastleCourtyardTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gCastleCourtyardTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_13.c b/assets/textures/place_title_cards/g_pn_13.c new file mode 100644 index 0000000000..57b78e009c --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_13.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGreatFairysFountainTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGreatFairysFountainTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGreatFairysFountainTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGreatFairysFountainTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGreatFairysFountainTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGreatFairysFountainTitleCardGERTex.ia8.inc.c" +}; + +u64 gGreatFairysFountainTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGreatFairysFountainTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_14.c b/assets/textures/place_title_cards/g_pn_14.c new file mode 100644 index 0000000000..cd8bff53f4 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_14.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gChamberOfTheSagesTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gChamberOfTheSagesTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gChamberOfTheSagesTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gChamberOfTheSagesTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gChamberOfTheSagesTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gChamberOfTheSagesTitleCardGERTex.ia8.inc.c" +}; + +u64 gChamberOfTheSagesTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gChamberOfTheSagesTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_15.c b/assets/textures/place_title_cards/g_pn_15.c new file mode 100644 index 0000000000..8b16867359 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_15.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gShootingGalleryTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShootingGalleryTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gShootingGalleryTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShootingGalleryTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gShootingGalleryTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShootingGalleryTitleCardGERTex.ia8.inc.c" +}; + +u64 gShootingGalleryTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gShootingGalleryTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_16.c b/assets/textures/place_title_cards/g_pn_16.c new file mode 100644 index 0000000000..02346a9235 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_16.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gTempleOfTimeTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTempleOfTimeTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gTempleOfTimeTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTempleOfTimeTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gTempleOfTimeTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTempleOfTimeTitleCardGERTex.ia8.inc.c" +}; + +u64 gTempleOfTimeTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTempleOfTimeTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_17.c b/assets/textures/place_title_cards/g_pn_17.c new file mode 100644 index 0000000000..e87e0a86a0 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_17.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gMarketTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gMarketTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gMarketTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gMarketTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gMarketTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gMarketTitleCardGERTex.ia8.inc.c" +}; + +u64 gMarketTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gMarketTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_18.c b/assets/textures/place_title_cards/g_pn_18.c new file mode 100644 index 0000000000..5be4bc5d40 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_18.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gBackAlleyTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBackAlleyTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gBackAlleyTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBackAlleyTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gBackAlleyTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBackAlleyTitleCardGERTex.ia8.inc.c" +}; + +u64 gBackAlleyTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBackAlleyTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_19.c b/assets/textures/place_title_cards/g_pn_19.c new file mode 100644 index 0000000000..dc051b288f --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_19.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gKokiriShopTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriShopTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gKokiriShopTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriShopTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gKokiriShopTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriShopTitleCardGERTex.ia8.inc.c" +}; + +u64 gKokiriShopTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriShopTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_20.c b/assets/textures/place_title_cards/g_pn_20.c new file mode 100644 index 0000000000..dc682320ca --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_20.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGoronShopTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronShopTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGoronShopTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronShopTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGoronShopTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronShopTitleCardGERTex.ia8.inc.c" +}; + +u64 gGoronShopTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronShopTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_21.c b/assets/textures/place_title_cards/g_pn_21.c new file mode 100644 index 0000000000..e856049995 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_21.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gZoraShopTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZoraShopTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gZoraShopTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZoraShopTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gZoraShopTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZoraShopTitleCardGERTex.ia8.inc.c" +}; + +u64 gZoraShopTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZoraShopTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_22.c b/assets/textures/place_title_cards/g_pn_22.c new file mode 100644 index 0000000000..6ae7e0e81d --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_22.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gHouseOfSkulltulaTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHouseOfSkulltulaTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gHouseOfSkulltulaTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHouseOfSkulltulaTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gHouseOfSkulltulaTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHouseOfSkulltulaTitleCardGERTex.ia8.inc.c" +}; + +u64 gHouseOfSkulltulaTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHouseOfSkulltulaTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_23.c b/assets/textures/place_title_cards/g_pn_23.c new file mode 100644 index 0000000000..dd086ab4e1 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_23.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gBazaarTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBazaarTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gBazaarTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBazaarTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gBazaarTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBazaarTitleCardGERTex.ia8.inc.c" +}; + +u64 gBazaarTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBazaarTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_24.c b/assets/textures/place_title_cards/g_pn_24.c new file mode 100644 index 0000000000..580b545955 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_24.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gPotionShopTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gPotionShopTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gPotionShopTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gPotionShopTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gPotionShopTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gPotionShopTitleCardGERTex.ia8.inc.c" +}; + +u64 gPotionShopTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gPotionShopTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_25.c b/assets/textures/place_title_cards/g_pn_25.c new file mode 100644 index 0000000000..de6c8e8bb1 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_25.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGravekeepersHutTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGravekeepersHutTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGravekeepersHutTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGravekeepersHutTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGravekeepersHutTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGravekeepersHutTitleCardGERTex.ia8.inc.c" +}; + +u64 gGravekeepersHutTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGravekeepersHutTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_26.c b/assets/textures/place_title_cards/g_pn_26.c new file mode 100644 index 0000000000..f0d9adaaf9 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_26.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gLakesideLaboratoryTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakesideLaboratoryTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gLakesideLaboratoryTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakesideLaboratoryTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gLakesideLaboratoryTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakesideLaboratoryTitleCardGERTex.ia8.inc.c" +}; + +u64 gLakesideLaboratoryTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakesideLaboratoryTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_27.c b/assets/textures/place_title_cards/g_pn_27.c new file mode 100644 index 0000000000..e7608e08dd --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_27.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gHyruleFieldTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleFieldTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gHyruleFieldTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleFieldTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gHyruleFieldTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleFieldTitleCardGERTex.ia8.inc.c" +}; + +u64 gHyruleFieldTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleFieldTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_28.c b/assets/textures/place_title_cards/g_pn_28.c new file mode 100644 index 0000000000..905ab306b0 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_28.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gKakarikoVillageTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKakarikoVillageTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gKakarikoVillageTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKakarikoVillageTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gKakarikoVillageTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKakarikoVillageTitleCardGERTex.ia8.inc.c" +}; + +u64 gKakarikoVillageTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKakarikoVillageTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_29.c b/assets/textures/place_title_cards/g_pn_29.c new file mode 100644 index 0000000000..80833d7586 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_29.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGraveyardTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGraveyardTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGraveyardTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGraveyardTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGraveyardTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGraveyardTitleCardGERTex.ia8.inc.c" +}; + +u64 gGraveyardTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGraveyardTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_30.c b/assets/textures/place_title_cards/g_pn_30.c new file mode 100644 index 0000000000..d4122a403a --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_30.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gZorasRiverTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasRiverTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gZorasRiverTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasRiverTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gZorasRiverTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasRiverTitleCardGERTex.ia8.inc.c" +}; + +u64 gZorasRiverTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasRiverTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_31.c b/assets/textures/place_title_cards/g_pn_31.c new file mode 100644 index 0000000000..94096efe1f --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_31.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gKokiriForestTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriForestTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gKokiriForestTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriForestTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gKokiriForestTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriForestTitleCardGERTex.ia8.inc.c" +}; + +u64 gKokiriForestTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gKokiriForestTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_32.c b/assets/textures/place_title_cards/g_pn_32.c new file mode 100644 index 0000000000..b0405f6584 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_32.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gLakeHyliaTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakeHyliaTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gLakeHyliaTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakeHyliaTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gLakeHyliaTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakeHyliaTitleCardGERTex.ia8.inc.c" +}; + +u64 gLakeHyliaTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLakeHyliaTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_33.c b/assets/textures/place_title_cards/g_pn_33.c new file mode 100644 index 0000000000..2437fba398 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_33.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gZorasDomainTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasDomainTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gZorasDomainTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasDomainTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gZorasDomainTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasDomainTitleCardGERTex.ia8.inc.c" +}; + +u64 gZorasDomainTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasDomainTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_34.c b/assets/textures/place_title_cards/g_pn_34.c new file mode 100644 index 0000000000..ebfc794a55 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_34.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gZorasFountainTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasFountainTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gZorasFountainTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasFountainTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gZorasFountainTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasFountainTitleCardGERTex.ia8.inc.c" +}; + +u64 gZorasFountainTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gZorasFountainTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_35.c b/assets/textures/place_title_cards/g_pn_35.c new file mode 100644 index 0000000000..3884e64722 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_35.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGERudoValleyTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoValleyTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGERudoValleyTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoValleyTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGERudoValleyTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoValleyTitleCardGERTex.ia8.inc.c" +}; + +u64 gGERudoValleyTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudoValleyTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_36.c b/assets/textures/place_title_cards/g_pn_36.c new file mode 100644 index 0000000000..d3cef30a4e --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_36.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gLostWoodsTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLostWoodsTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gLostWoodsTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLostWoodsTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gLostWoodsTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLostWoodsTitleCardGERTex.ia8.inc.c" +}; + +u64 gLostWoodsTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLostWoodsTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_37.c b/assets/textures/place_title_cards/g_pn_37.c new file mode 100644 index 0000000000..b71c93c778 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_37.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gHauntedWastelandTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHauntedWastelandTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gHauntedWastelandTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHauntedWastelandTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gHauntedWastelandTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHauntedWastelandTitleCardGERTex.ia8.inc.c" +}; + +u64 gHauntedWastelandTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHauntedWastelandTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_38.c b/assets/textures/place_title_cards/g_pn_38.c new file mode 100644 index 0000000000..a44641fe76 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_38.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gHyruleCastleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleCastleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gHyruleCastleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleCastleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gHyruleCastleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleCastleTitleCardGERTex.ia8.inc.c" +}; + +u64 gHyruleCastleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHyruleCastleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_39.c b/assets/textures/place_title_cards/g_pn_39.c new file mode 100644 index 0000000000..c17a329fc0 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_39.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gDeathMountainTrailTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainTrailTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gDeathMountainTrailTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainTrailTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gDeathMountainTrailTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainTrailTitleCardGERTex.ia8.inc.c" +}; + +u64 gDeathMountainTrailTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainTrailTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_40.c b/assets/textures/place_title_cards/g_pn_40.c new file mode 100644 index 0000000000..8ee973d9fa --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_40.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gDeathMountainCraterTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainCraterTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gDeathMountainCraterTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainCraterTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gDeathMountainCraterTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainCraterTitleCardGERTex.ia8.inc.c" +}; + +u64 gDeathMountainCraterTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDeathMountainCraterTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_41.c b/assets/textures/place_title_cards/g_pn_41.c new file mode 100644 index 0000000000..a4303898e5 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_41.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGoronCityTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronCityTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGoronCityTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronCityTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGoronCityTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronCityTitleCardGERTex.ia8.inc.c" +}; + +u64 gGoronCityTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGoronCityTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_42.c b/assets/textures/place_title_cards/g_pn_42.c new file mode 100644 index 0000000000..ab396dae5e --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_42.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gLonLonRanchTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLonLonRanchTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gLonLonRanchTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLonLonRanchTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gLonLonRanchTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLonLonRanchTitleCardGERTex.ia8.inc.c" +}; + +u64 gLonLonRanchTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gLonLonRanchTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_43.c b/assets/textures/place_title_cards/g_pn_43.c new file mode 100644 index 0000000000..2e76c15aac --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_43.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGanonsCastleTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGanonsCastleTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGanonsCastleTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGanonsCastleTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGanonsCastleTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGanonsCastleTitleCardGERTex.ia8.inc.c" +}; + +u64 gGanonsCastleTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGanonsCastleTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_44.c b/assets/textures/place_title_cards/g_pn_44.c new file mode 100644 index 0000000000..e00b852631 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_44.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gRoyalFamilysTombTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gRoyalFamilysTombTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gRoyalFamilysTombTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gRoyalFamilysTombTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gRoyalFamilysTombTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gRoyalFamilysTombTitleCardGERTex.ia8.inc.c" +}; + +u64 gRoyalFamilysTombTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gRoyalFamilysTombTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_45.c b/assets/textures/place_title_cards/g_pn_45.c new file mode 100644 index 0000000000..a900502094 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_45.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gFairysFountainTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFairysFountainTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gFairysFountainTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFairysFountainTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gFairysFountainTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFairysFountainTitleCardGERTex.ia8.inc.c" +}; + +u64 gFairysFountainTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFairysFountainTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_46.c b/assets/textures/place_title_cards/g_pn_46.c new file mode 100644 index 0000000000..23f91cde98 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_46.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gFishingPondTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFishingPondTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gFishingPondTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFishingPondTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gFishingPondTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFishingPondTitleCardGERTex.ia8.inc.c" +}; + +u64 gFishingPondTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gFishingPondTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_47.c b/assets/textures/place_title_cards/g_pn_47.c new file mode 100644 index 0000000000..83feefdec6 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_47.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gBombchuBowlingAlleyCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuBowlingAlleyCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gBombchuBowlingAlleyCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuBowlingAlleyCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gBombchuBowlingAlleyCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuBowlingAlleyCardGERTex.ia8.inc.c" +}; + +u64 gBombchuBowlingAlleyCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuBowlingAlleyCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_48.c b/assets/textures/place_title_cards/g_pn_48.c new file mode 100644 index 0000000000..e73e110171 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_48.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gStableTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gStableTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gStableTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gStableTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gStableTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gStableTitleCardGERTex.ia8.inc.c" +}; + +u64 gStableTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gStableTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_49.c b/assets/textures/place_title_cards/g_pn_49.c new file mode 100644 index 0000000000..3459eb447f --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_49.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gThievesHideoutTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gThievesHideoutTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gThievesHideoutTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gThievesHideoutTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gThievesHideoutTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gThievesHideoutTitleCardGERTex.ia8.inc.c" +}; + +u64 gThievesHideoutTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gThievesHideoutTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_50.c b/assets/textures/place_title_cards/g_pn_50.c new file mode 100644 index 0000000000..fc96b5b4d4 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_50.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gHappyMaskShopTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHappyMaskShopTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gHappyMaskShopTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHappyMaskShopTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gHappyMaskShopTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHappyMaskShopTitleCardGERTex.ia8.inc.c" +}; + +u64 gHappyMaskShopTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gHappyMaskShopTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_51.c b/assets/textures/place_title_cards/g_pn_51.c new file mode 100644 index 0000000000..19eec8cbae --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_51.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gTreasureBoxShopTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTreasureBoxShopTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gTreasureBoxShopTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTreasureBoxShopTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gTreasureBoxShopTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTreasureBoxShopTitleCardGERTex.ia8.inc.c" +}; + +u64 gTreasureBoxShopTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gTreasureBoxShopTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_52.c b/assets/textures/place_title_cards/g_pn_52.c new file mode 100644 index 0000000000..29b2515037 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_52.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gSacredForestMeadowTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSacredForestMeadowTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gSacredForestMeadowTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSacredForestMeadowTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gSacredForestMeadowTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSacredForestMeadowTitleCardGERTex.ia8.inc.c" +}; + +u64 gSacredForestMeadowTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gSacredForestMeadowTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_53.c b/assets/textures/place_title_cards/g_pn_53.c new file mode 100644 index 0000000000..028a643edf --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_53.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gGERudosFortressTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudosFortressTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gGERudosFortressTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudosFortressTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gGERudosFortressTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudosFortressTitleCardGERTex.ia8.inc.c" +}; + +u64 gGERudosFortressTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gGERudosFortressTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_54.c b/assets/textures/place_title_cards/g_pn_54.c new file mode 100644 index 0000000000..63a0d22755 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_54.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gBottomOfTheWellTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBottomOfTheWellTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gBottomOfTheWellTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBottomOfTheWellTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gBottomOfTheWellTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBottomOfTheWellTitleCardGERTex.ia8.inc.c" +}; + +u64 gBottomOfTheWellTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBottomOfTheWellTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_55.c b/assets/textures/place_title_cards/g_pn_55.c new file mode 100644 index 0000000000..1f2c654cf5 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_55.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gDesertColossusTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDesertColossusTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gDesertColossusTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDesertColossusTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gDesertColossusTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDesertColossusTitleCardGERTex.ia8.inc.c" +}; + +u64 gDesertColossusTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gDesertColossusTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_56.c b/assets/textures/place_title_cards/g_pn_56.c new file mode 100644 index 0000000000..ba0e77af02 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_56.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gBombchuShopTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuShopTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gBombchuShopTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuShopTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gBombchuShopTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuShopTitleCardGERTex.ia8.inc.c" +}; + +u64 gBombchuShopTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gBombchuShopTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/textures/place_title_cards/g_pn_57.c b/assets/textures/place_title_cards/g_pn_57.c new file mode 100644 index 0000000000..7318f30fb7 --- /dev/null +++ b/assets/textures/place_title_cards/g_pn_57.c @@ -0,0 +1,24 @@ +#include "ultra64.h" +#include "tex_len.h" +#include "versions.h" +#include "actor.h" + +#if OOT_NTSC +u64 gQuestionMarkTitleCardJPNTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gQuestionMarkTitleCardJPNTex.ia8.inc.c" +}; +#endif + +u64 gQuestionMarkTitleCardENGTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gQuestionMarkTitleCardENGTex.ia8.inc.c" +}; + +#if OOT_PAL +u64 gQuestionMarkTitleCardGERTex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gQuestionMarkTitleCardGERTex.ia8.inc.c" +}; + +u64 gQuestionMarkTitleCardFRATex[TEX_LEN(u64, PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 8)] = { +#include "assets/textures/place_title_cards/gQuestionMarkTitleCardFRATex.ia8.inc.c" +}; +#endif diff --git a/assets/xml/code/fbdemo_circle.xml b/assets/xml/code/fbdemo_circle.xml index 530506369c..5120f49ccf 100644 --- a/assets/xml/code/fbdemo_circle.xml +++ b/assets/xml/code/fbdemo_circle.xml @@ -1,13 +1,12 @@ - - - - - + + + + + - - + diff --git a/assets/xml/code/fbdemo_triforce.xml b/assets/xml/code/fbdemo_triforce.xml index 613f7995d2..db7e23019a 100644 --- a/assets/xml/code/fbdemo_triforce.xml +++ b/assets/xml/code/fbdemo_triforce.xml @@ -1,5 +1,5 @@ - + diff --git a/assets/xml/code/fbdemo_wipe1.xml b/assets/xml/code/fbdemo_wipe1.xml index 74f129776b..79217fce93 100644 --- a/assets/xml/code/fbdemo_wipe1.xml +++ b/assets/xml/code/fbdemo_wipe1.xml @@ -1,10 +1,9 @@ - + - - - + + diff --git a/assets/xml/n64dd/error_textures.xml b/assets/xml/n64dd/error_textures.xml index 6db2ab37d5..82b997cb26 100644 --- a/assets/xml/n64dd/error_textures.xml +++ b/assets/xml/n64dd/error_textures.xml @@ -1,8 +1,8 @@ - - - - - + + + + + diff --git a/assets/xml/objects/gameplay_dangeon_keep.xml b/assets/xml/objects/gameplay_dangeon_keep.xml index 2670b752d5..015e400e41 100644 --- a/assets/xml/objects/gameplay_dangeon_keep.xml +++ b/assets/xml/objects/gameplay_dangeon_keep.xml @@ -1,52 +1,153 @@ + + + + + + + + - + + + + + + + + - - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/gameplay_field_keep.xml b/assets/xml/objects/gameplay_field_keep.xml index 3c0f18d74e..432a963c80 100644 --- a/assets/xml/objects/gameplay_field_keep.xml +++ b/assets/xml/objects/gameplay_field_keep.xml @@ -8,55 +8,72 @@ - - + + - + - + - - - + + + - - - + + + - - - + + + - + - + - - - - + + + + - - + + - + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index 008497601a..ce2c7fb7d4 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -1,16 +1,16 @@ - + - - - - - - - - - - + + + + + + + + + + @@ -603,400 +603,763 @@ + + + - - - - + + + + + + + + + + + + + - + + + + - - + + + + + + + + + + + + - - + + + + + - + + + + - + + + + - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + + + + - + - - - + + + + + + - - + + + + + + + + + + + + + + - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + - - + + + + + - - + + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + - + - + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + - - - + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - + + - + - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + - + - - - + + + - - - - - - - - - - - + + + + + + + + + + + + + + - + + + + - + + + + + + + - + + + + - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/gameplay_keep_pal.xml b/assets/xml/objects/gameplay_keep_pal.xml index c7485d73fd..9e792020bf 100644 --- a/assets/xml/objects/gameplay_keep_pal.xml +++ b/assets/xml/objects/gameplay_keep_pal.xml @@ -1,16 +1,16 @@ - + - - - - - - - - - - + + + + + + + + + + @@ -603,366 +603,705 @@ + + + - - - - + + + + + + + + + + + + + - + + + + - - + + + + + + + + + + + + - - + + + + + - + + + + - + + + + - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + + + + - + + + + - - - + + + + + + - - + + + + + + + + + + + + + + - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + - - + + + + + - - + + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + - + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - - - + + + + + + + + + + - - - + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + - + + + + - + + + + + + + - + + + + - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_Bb.xml b/assets/xml/objects/object_Bb.xml index 5d04bde451..cc64dc95ce 100644 --- a/assets/xml/objects/object_Bb.xml +++ b/assets/xml/objects/object_Bb.xml @@ -3,20 +3,38 @@ + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_ahg.xml b/assets/xml/objects/object_ahg.xml index 8147abb75f..44c02a7edc 100644 --- a/assets/xml/objects/object_ahg.xml +++ b/assets/xml/objects/object_ahg.xml @@ -21,19 +21,66 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -53,13 +100,19 @@ - - - - - + + + + + - + + + + + + + diff --git a/assets/xml/objects/object_am.xml b/assets/xml/objects/object_am.xml index 2467baf6ab..faf6c5576a 100644 --- a/assets/xml/objects/object_am.xml +++ b/assets/xml/objects/object_am.xml @@ -6,5 +6,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ane.xml b/assets/xml/objects/object_ane.xml index 1e29b351e0..be1acf5637 100644 --- a/assets/xml/objects/object_ane.xml +++ b/assets/xml/objects/object_ane.xml @@ -38,22 +38,69 @@ - + - - - - - - - - - + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ani.xml b/assets/xml/objects/object_ani.xml index d83aa7656a..33dc215ba2 100644 --- a/assets/xml/objects/object_ani.xml +++ b/assets/xml/objects/object_ani.xml @@ -38,31 +38,78 @@ - - + + - - - - - - - - + + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_anubice.xml b/assets/xml/objects/object_anubice.xml index 2140187e4e..492a8e4235 100644 --- a/assets/xml/objects/object_anubice.xml +++ b/assets/xml/objects/object_anubice.xml @@ -16,5 +16,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_aob.xml b/assets/xml/objects/object_aob.xml index 74838f6af3..e7bcfb05ff 100644 --- a/assets/xml/objects/object_aob.xml +++ b/assets/xml/objects/object_aob.xml @@ -38,21 +38,68 @@ - + - - - - - - - - + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_b_heart.xml b/assets/xml/objects/object_b_heart.xml index 00f7cd6773..9b7b81bb75 100644 --- a/assets/xml/objects/object_b_heart.xml +++ b/assets/xml/objects/object_b_heart.xml @@ -1,8 +1,14 @@ + + + + + + - - + + diff --git a/assets/xml/objects/object_bba.xml b/assets/xml/objects/object_bba.xml index f988d8fbe4..6ab5be4e34 100644 --- a/assets/xml/objects/object_bba.xml +++ b/assets/xml/objects/object_bba.xml @@ -19,16 +19,63 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bdan_objects.xml b/assets/xml/objects/object_bdan_objects.xml index dcd56d3856..781f33eafb 100644 --- a/assets/xml/objects/object_bdan_objects.xml +++ b/assets/xml/objects/object_bdan_objects.xml @@ -1,39 +1,41 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + @@ -57,5 +59,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bdoor.xml b/assets/xml/objects/object_bdoor.xml index e926ae40bd..632baa6330 100644 --- a/assets/xml/objects/object_bdoor.xml +++ b/assets/xml/objects/object_bdoor.xml @@ -1,22 +1,31 @@ - + - + - + + + + + + + + + + - - - - - + + + + + - + diff --git a/assets/xml/objects/object_bg.xml b/assets/xml/objects/object_bg.xml index 791226b71d..133de136f6 100644 --- a/assets/xml/objects/object_bg.xml +++ b/assets/xml/objects/object_bg.xml @@ -34,17 +34,47 @@ - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bigokuta.xml b/assets/xml/objects/object_bigokuta.xml index 1c7d39e319..ec2b7d8dc6 100644 --- a/assets/xml/objects/object_bigokuta.xml +++ b/assets/xml/objects/object_bigokuta.xml @@ -5,6 +5,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -24,16 +81,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_bird.xml b/assets/xml/objects/object_bird.xml index c0b5cac3e4..800a8a6b58 100644 --- a/assets/xml/objects/object_bird.xml +++ b/assets/xml/objects/object_bird.xml @@ -4,18 +4,27 @@ + + + + + + + + + - - - + + + diff --git a/assets/xml/objects/object_bji.xml b/assets/xml/objects/object_bji.xml index 8dd89dd875..8e82b0a0d8 100644 --- a/assets/xml/objects/object_bji.xml +++ b/assets/xml/objects/object_bji.xml @@ -21,17 +21,64 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51,11 +98,14 @@ - - - + + + + + + diff --git a/assets/xml/objects/object_bl.xml b/assets/xml/objects/object_bl.xml index 1c2ef4ec63..a987840a31 100644 --- a/assets/xml/objects/object_bl.xml +++ b/assets/xml/objects/object_bl.xml @@ -5,22 +5,33 @@ + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_blkobj.xml b/assets/xml/objects/object_blkobj.xml index 9527292838..a2f22813b9 100644 --- a/assets/xml/objects/object_blkobj.xml +++ b/assets/xml/objects/object_blkobj.xml @@ -3,13 +3,47 @@ + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bob.xml b/assets/xml/objects/object_bob.xml index ad59e56ea3..41f9b10562 100644 --- a/assets/xml/objects/object_bob.xml +++ b/assets/xml/objects/object_bob.xml @@ -19,18 +19,65 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_boj.xml b/assets/xml/objects/object_boj.xml index d43332de00..ff2a57a986 100644 --- a/assets/xml/objects/object_boj.xml +++ b/assets/xml/objects/object_boj.xml @@ -21,18 +21,65 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -52,16 +99,31 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bombf.xml b/assets/xml/objects/object_bombf.xml index 83e60248d1..853e4b3385 100644 --- a/assets/xml/objects/object_bombf.xml +++ b/assets/xml/objects/object_bombf.xml @@ -1,10 +1,10 @@ - - - - + + + + diff --git a/assets/xml/objects/object_bombiwa.xml b/assets/xml/objects/object_bombiwa.xml index 26ab6b4f33..88769bba17 100644 --- a/assets/xml/objects/object_bombiwa.xml +++ b/assets/xml/objects/object_bombiwa.xml @@ -1,7 +1,10 @@ - - + + + + + diff --git a/assets/xml/objects/object_bowl.xml b/assets/xml/objects/object_bowl.xml index ffe6d43db7..31fd9eb841 100644 --- a/assets/xml/objects/object_bowl.xml +++ b/assets/xml/objects/object_bowl.xml @@ -1,9 +1,9 @@ - - - + + + @@ -14,5 +14,16 @@ + + + + + + + + + + + diff --git a/assets/xml/objects/object_box.xml b/assets/xml/objects/object_box.xml index 7ab9d9e7f4..515f76c571 100644 --- a/assets/xml/objects/object_box.xml +++ b/assets/xml/objects/object_box.xml @@ -9,19 +9,47 @@ + + + - + + + + - + + + + - + + + + - + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_brob.xml b/assets/xml/objects/object_brob.xml index bef5bbc55f..35eaec3427 100644 --- a/assets/xml/objects/object_brob.xml +++ b/assets/xml/objects/object_brob.xml @@ -1,12 +1,27 @@ + + + + + + + + + + + + + + + - + diff --git a/assets/xml/objects/object_bubble.xml b/assets/xml/objects/object_bubble.xml index f5de186920..a502b4480e 100644 --- a/assets/xml/objects/object_bubble.xml +++ b/assets/xml/objects/object_bubble.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/objects/object_bv.xml b/assets/xml/objects/object_bv.xml index 5a8e6c594d..b7d6d01b89 100644 --- a/assets/xml/objects/object_bv.xml +++ b/assets/xml/objects/object_bv.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_bv_pal.xml b/assets/xml/objects/object_bv_pal.xml index 8de7492663..fa6b3a538f 100644 --- a/assets/xml/objects/object_bv_pal.xml +++ b/assets/xml/objects/object_bv_pal.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_bw.xml b/assets/xml/objects/object_bw.xml index c2b76fd91e..27a84f18f2 100644 --- a/assets/xml/objects/object_bw.xml +++ b/assets/xml/objects/object_bw.xml @@ -3,19 +3,34 @@ - + + + + + + + + + + + + + + + + - - - - - + + + + + diff --git a/assets/xml/objects/object_bwall.xml b/assets/xml/objects/object_bwall.xml index d4f43ddc14..02320cc65c 100644 --- a/assets/xml/objects/object_bwall.xml +++ b/assets/xml/objects/object_bwall.xml @@ -1,7 +1,10 @@ + + + - + diff --git a/assets/xml/objects/object_bxa.xml b/assets/xml/objects/object_bxa.xml index fb78c117e0..98b43d7a24 100644 --- a/assets/xml/objects/object_bxa.xml +++ b/assets/xml/objects/object_bxa.xml @@ -1,13 +1,22 @@ + + + - - + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_cne.xml b/assets/xml/objects/object_cne.xml index ecf151d641..82181568ef 100644 --- a/assets/xml/objects/object_cne.xml +++ b/assets/xml/objects/object_cne.xml @@ -21,14 +21,61 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48,10 +95,13 @@ - - + + + + + diff --git a/assets/xml/objects/object_cob.xml b/assets/xml/objects/object_cob.xml index b5047b4993..7aad9dc661 100644 --- a/assets/xml/objects/object_cob.xml +++ b/assets/xml/objects/object_cob.xml @@ -1,12 +1,59 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_cow.xml b/assets/xml/objects/object_cow.xml index 3cdad5ef93..48d1defdd1 100644 --- a/assets/xml/objects/object_cow.xml +++ b/assets/xml/objects/object_cow.xml @@ -41,15 +41,47 @@ - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_crow.xml b/assets/xml/objects/object_crow.xml index 5304246a00..4322992884 100644 --- a/assets/xml/objects/object_crow.xml +++ b/assets/xml/objects/object_crow.xml @@ -2,10 +2,49 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_cs.xml b/assets/xml/objects/object_cs.xml index 83804ccaf4..9be0327a92 100644 --- a/assets/xml/objects/object_cs.xml +++ b/assets/xml/objects/object_cs.xml @@ -17,6 +17,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,22 +85,22 @@ - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_d_elevator.xml b/assets/xml/objects/object_d_elevator.xml index 6be59c154b..4dd6ef4ee5 100644 --- a/assets/xml/objects/object_d_elevator.xml +++ b/assets/xml/objects/object_d_elevator.xml @@ -1,7 +1,10 @@ + + + - + diff --git a/assets/xml/objects/object_d_hsblock.xml b/assets/xml/objects/object_d_hsblock.xml index 4bb50c2b4f..3d78728fe0 100644 --- a/assets/xml/objects/object_d_hsblock.xml +++ b/assets/xml/objects/object_d_hsblock.xml @@ -4,7 +4,14 @@ - - + + + + + + + + + diff --git a/assets/xml/objects/object_d_lift.xml b/assets/xml/objects/object_d_lift.xml index 2912385190..00945ba7c4 100644 --- a/assets/xml/objects/object_d_lift.xml +++ b/assets/xml/objects/object_d_lift.xml @@ -1,8 +1,11 @@ + + + - - + + diff --git a/assets/xml/objects/object_daiku.xml b/assets/xml/objects/object_daiku.xml index 1524c7a26c..e70af879c6 100644 --- a/assets/xml/objects/object_daiku.xml +++ b/assets/xml/objects/object_daiku.xml @@ -3,19 +3,79 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ddan_objects.xml b/assets/xml/objects/object_ddan_objects.xml index b7df6ed847..1857c31e5f 100644 --- a/assets/xml/objects/object_ddan_objects.xml +++ b/assets/xml/objects/object_ddan_objects.xml @@ -1,21 +1,23 @@ - - - - - - - - - - + + + + + + + + + + - - - + + + + + @@ -28,5 +30,22 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dekubaba.xml b/assets/xml/objects/object_dekubaba.xml index 7202a833fc..e099d4e6c9 100644 --- a/assets/xml/objects/object_dekubaba.xml +++ b/assets/xml/objects/object_dekubaba.xml @@ -4,20 +4,38 @@ - + + + + + + + + + + + + + + + + + + + - - - - - + + + + + @@ -32,7 +50,10 @@ + + + - + diff --git a/assets/xml/objects/object_dekujr.xml b/assets/xml/objects/object_dekujr.xml index e906bf61c4..b593dcbbdd 100644 --- a/assets/xml/objects/object_dekujr.xml +++ b/assets/xml/objects/object_dekujr.xml @@ -1,12 +1,18 @@ - - - - - - - + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dekunuts.xml b/assets/xml/objects/object_dekunuts.xml index 4a4508ee0b..6cccc444b1 100644 --- a/assets/xml/objects/object_dekunuts.xml +++ b/assets/xml/objects/object_dekunuts.xml @@ -16,17 +16,86 @@ - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_demo_6k.xml b/assets/xml/objects/object_demo_6k.xml index 73058d5e46..726fd2384b 100644 --- a/assets/xml/objects/object_demo_6k.xml +++ b/assets/xml/objects/object_demo_6k.xml @@ -1,10 +1,17 @@ + - + + + + - + + + + - + diff --git a/assets/xml/objects/object_demo_kekkai.xml b/assets/xml/objects/object_demo_kekkai.xml index 1b9c9b4027..b35f9d0422 100644 --- a/assets/xml/objects/object_demo_kekkai.xml +++ b/assets/xml/objects/object_demo_kekkai.xml @@ -1,41 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dh.xml b/assets/xml/objects/object_dh.xml index 7a52d7dbe7..9790fbb743 100644 --- a/assets/xml/objects/object_dh.xml +++ b/assets/xml/objects/object_dh.xml @@ -1,5 +1,14 @@ + + + + + + + + + @@ -7,8 +16,8 @@ - - + + @@ -17,11 +26,53 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -52,8 +103,11 @@ + + + - - + + diff --git a/assets/xml/objects/object_dnk.xml b/assets/xml/objects/object_dnk.xml index 1efec46aad..f4850e6aa1 100644 --- a/assets/xml/objects/object_dnk.xml +++ b/assets/xml/objects/object_dnk.xml @@ -12,9 +12,9 @@ - - - + + + @@ -22,9 +22,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dns.xml b/assets/xml/objects/object_dns.xml index e66a639874..f934b6b125 100644 --- a/assets/xml/objects/object_dns.xml +++ b/assets/xml/objects/object_dns.xml @@ -23,6 +23,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31,5 +75,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dodojr.xml b/assets/xml/objects/object_dodojr.xml index 4dfd7d6e45..f28c4dd760 100644 --- a/assets/xml/objects/object_dodojr.xml +++ b/assets/xml/objects/object_dodojr.xml @@ -5,15 +5,30 @@ + + + + + + + + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_dodongo.xml b/assets/xml/objects/object_dodongo.xml index 779e20e9dc..9ec37d74a8 100644 --- a/assets/xml/objects/object_dodongo.xml +++ b/assets/xml/objects/object_dodongo.xml @@ -19,23 +19,107 @@ - - - - - - + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dog.xml b/assets/xml/objects/object_dog.xml index ef00442b60..431c11c809 100644 --- a/assets/xml/objects/object_dog.xml +++ b/assets/xml/objects/object_dog.xml @@ -6,14 +6,44 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_door_gerudo.xml b/assets/xml/objects/object_door_gerudo.xml index 2f17262041..090582d3b2 100644 --- a/assets/xml/objects/object_door_gerudo.xml +++ b/assets/xml/objects/object_door_gerudo.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_door_killer.xml b/assets/xml/objects/object_door_killer.xml index fbee0e5f70..8ef83cd9fa 100644 --- a/assets/xml/objects/object_door_killer.xml +++ b/assets/xml/objects/object_door_killer.xml @@ -1,5 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -8,10 +32,30 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ds.xml b/assets/xml/objects/object_ds.xml index b2fb1a5c26..cccf04d937 100644 --- a/assets/xml/objects/object_ds.xml +++ b/assets/xml/objects/object_ds.xml @@ -17,22 +17,36 @@ - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ds2.xml b/assets/xml/objects/object_ds2.xml index 683bcc68d4..d044d8208d 100644 --- a/assets/xml/objects/object_ds2.xml +++ b/assets/xml/objects/object_ds2.xml @@ -1,6 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -9,18 +33,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/assets/xml/objects/object_du.xml b/assets/xml/objects/object_du.xml index 0babd962b9..feeafc83f8 100644 --- a/assets/xml/objects/object_du.xml +++ b/assets/xml/objects/object_du.xml @@ -40,42 +40,42 @@ - - - - + + + + - - - - + + + + - - + + - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + diff --git a/assets/xml/objects/object_du_pal.xml b/assets/xml/objects/object_du_pal.xml index 44bbd1aa04..4e4ae09eb4 100644 --- a/assets/xml/objects/object_du_pal.xml +++ b/assets/xml/objects/object_du_pal.xml @@ -40,42 +40,42 @@ - - - - + + + + - - - - + + + + - - + + - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + diff --git a/assets/xml/objects/object_dy_obj.xml b/assets/xml/objects/object_dy_obj.xml index 4c6eb5871d..42b2f6340a 100644 --- a/assets/xml/objects/object_dy_obj.xml +++ b/assets/xml/objects/object_dy_obj.xml @@ -70,34 +70,34 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + - - + + @@ -117,5 +117,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_efc_crystal_light.xml b/assets/xml/objects/object_efc_crystal_light.xml index 9215b6a394..dbd0936191 100644 --- a/assets/xml/objects/object_efc_crystal_light.xml +++ b/assets/xml/objects/object_efc_crystal_light.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_efc_doughnut.xml b/assets/xml/objects/object_efc_doughnut.xml index 7f12c56f53..b948bab151 100644 --- a/assets/xml/objects/object_efc_doughnut.xml +++ b/assets/xml/objects/object_efc_doughnut.xml @@ -1,8 +1,14 @@ - - + + + + + + + + diff --git a/assets/xml/objects/object_efc_erupc.xml b/assets/xml/objects/object_efc_erupc.xml index 800d9535f1..6df65546cf 100644 --- a/assets/xml/objects/object_efc_erupc.xml +++ b/assets/xml/objects/object_efc_erupc.xml @@ -1,12 +1,22 @@ + - - + + + + + - + + + + + + + - + diff --git a/assets/xml/objects/object_efc_fire_ball.xml b/assets/xml/objects/object_efc_fire_ball.xml index 2fc65b16ff..2c9ec2cab9 100644 --- a/assets/xml/objects/object_efc_fire_ball.xml +++ b/assets/xml/objects/object_efc_fire_ball.xml @@ -1,7 +1,10 @@ + + + - - + + diff --git a/assets/xml/objects/object_efc_lgt_shower.xml b/assets/xml/objects/object_efc_lgt_shower.xml index 67ef5ce7e0..81d3d5e17d 100644 --- a/assets/xml/objects/object_efc_lgt_shower.xml +++ b/assets/xml/objects/object_efc_lgt_shower.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_efc_star_field.xml b/assets/xml/objects/object_efc_star_field.xml index 00b47c460f..0fb6763f50 100644 --- a/assets/xml/objects/object_efc_star_field.xml +++ b/assets/xml/objects/object_efc_star_field.xml @@ -1,8 +1,14 @@ + + + - + + + + - + diff --git a/assets/xml/objects/object_efc_tw.xml b/assets/xml/objects/object_efc_tw.xml index de53765696..cfc539111f 100644 --- a/assets/xml/objects/object_efc_tw.xml +++ b/assets/xml/objects/object_efc_tw.xml @@ -8,6 +8,6 @@ - + diff --git a/assets/xml/objects/object_ei.xml b/assets/xml/objects/object_ei.xml index cabad17ff8..bffc17aaf7 100644 --- a/assets/xml/objects/object_ei.xml +++ b/assets/xml/objects/object_ei.xml @@ -37,14 +37,14 @@ - - - - - - - - + + + + + + + + @@ -52,5 +52,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fa.xml b/assets/xml/objects/object_fa.xml index 2f1bf9a5e8..c13b195ec4 100644 --- a/assets/xml/objects/object_fa.xml +++ b/assets/xml/objects/object_fa.xml @@ -1,15 +1,18 @@ - - - - - - - - - - + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fd.xml b/assets/xml/objects/object_fd.xml index 4a5ce9fafa..b18bfe25ce 100644 --- a/assets/xml/objects/object_fd.xml +++ b/assets/xml/objects/object_fd.xml @@ -1,7 +1,7 @@ - + @@ -20,9 +20,9 @@ - - - + + + @@ -62,7 +62,7 @@ - + diff --git a/assets/xml/objects/object_fd2.xml b/assets/xml/objects/object_fd2.xml index 8d2b3dcdb6..51fe70772f 100644 --- a/assets/xml/objects/object_fd2.xml +++ b/assets/xml/objects/object_fd2.xml @@ -22,9 +22,9 @@ - - - + + + @@ -38,5 +38,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fd_pal.xml b/assets/xml/objects/object_fd_pal.xml index be375399f6..23fd822c65 100644 --- a/assets/xml/objects/object_fd_pal.xml +++ b/assets/xml/objects/object_fd_pal.xml @@ -1,7 +1,7 @@ - + @@ -20,9 +20,9 @@ - - - + + + @@ -62,7 +62,7 @@ - + diff --git a/assets/xml/objects/object_fhg.xml b/assets/xml/objects/object_fhg.xml index 5f69fcb5a1..2186056a22 100644 --- a/assets/xml/objects/object_fhg.xml +++ b/assets/xml/objects/object_fhg.xml @@ -18,7 +18,7 @@ - + diff --git a/assets/xml/objects/object_fhg_pal.xml b/assets/xml/objects/object_fhg_pal.xml index d12a90cb08..e4b5f3fee2 100644 --- a/assets/xml/objects/object_fhg_pal.xml +++ b/assets/xml/objects/object_fhg_pal.xml @@ -18,7 +18,7 @@ - + diff --git a/assets/xml/objects/object_fire.xml b/assets/xml/objects/object_fire.xml index 49bf620cb8..82b438138c 100644 --- a/assets/xml/objects/object_fire.xml +++ b/assets/xml/objects/object_fire.xml @@ -1,14 +1,17 @@ + + + - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_firefly.xml b/assets/xml/objects/object_firefly.xml index 8c26a43418..34c45196f9 100644 --- a/assets/xml/objects/object_firefly.xml +++ b/assets/xml/objects/object_firefly.xml @@ -6,16 +6,87 @@ - - - - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fish.xml b/assets/xml/objects/object_fish.xml index f5ad4f6da0..8cc28c0229 100644 --- a/assets/xml/objects/object_fish.xml +++ b/assets/xml/objects/object_fish.xml @@ -1,6 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -13,13 +50,13 @@ - - - - - - - + + + + + + + @@ -37,32 +74,83 @@ - - + + + + + - - + + + + + - + + + + - + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -86,38 +174,83 @@ - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + + + + - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -129,12 +262,12 @@ - - - - - - + + + + + + @@ -148,32 +281,59 @@ - - - + + + + + + - - + + + + + + + + - - + + + + + + + + - + + + + + + + - - - + + + + + + + + + diff --git a/assets/xml/objects/object_fr.xml b/assets/xml/objects/object_fr.xml index 25ee2ad42e..df113d49cc 100644 --- a/assets/xml/objects/object_fr.xml +++ b/assets/xml/objects/object_fr.xml @@ -3,18 +3,84 @@ - + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fu.xml b/assets/xml/objects/object_fu.xml index 3947e438c0..1bc18759a5 100644 --- a/assets/xml/objects/object_fu.xml +++ b/assets/xml/objects/object_fu.xml @@ -17,24 +17,24 @@ - - - - - - - - - - + + + + + + + + + + - - + + - - + + - + @@ -51,5 +51,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fw.xml b/assets/xml/objects/object_fw.xml index 51462a3166..ffbc70bd57 100644 --- a/assets/xml/objects/object_fw.xml +++ b/assets/xml/objects/object_fw.xml @@ -85,12 +85,13 @@ - - - - - - + + + + + + + @@ -101,5 +102,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fz.xml b/assets/xml/objects/object_fz.xml index dad6fec5ce..00fe154fcc 100644 --- a/assets/xml/objects/object_fz.xml +++ b/assets/xml/objects/object_fz.xml @@ -1,4 +1,5 @@ + @@ -7,6 +8,25 @@ - + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ganon.xml b/assets/xml/objects/object_ganon.xml index 412acb66e0..01d0f7ab77 100644 --- a/assets/xml/objects/object_ganon.xml +++ b/assets/xml/objects/object_ganon.xml @@ -1,6 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -25,38 +90,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -68,7 +149,7 @@ - + diff --git a/assets/xml/objects/object_ganon2.xml b/assets/xml/objects/object_ganon2.xml index cebdf819b5..dd84b7efe0 100644 --- a/assets/xml/objects/object_ganon2.xml +++ b/assets/xml/objects/object_ganon2.xml @@ -13,6 +13,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51,46 +158,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -105,7 +244,7 @@ - + diff --git a/assets/xml/objects/object_ganon2_pal.xml b/assets/xml/objects/object_ganon2_pal.xml index 93f3a05e5e..b6658c7aec 100644 --- a/assets/xml/objects/object_ganon2_pal.xml +++ b/assets/xml/objects/object_ganon2_pal.xml @@ -13,6 +13,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51,46 +158,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -105,7 +244,7 @@ - + diff --git a/assets/xml/objects/object_ganon_objects.xml b/assets/xml/objects/object_ganon_objects.xml index 5e32610ffc..fc38ccfd35 100644 --- a/assets/xml/objects/object_ganon_objects.xml +++ b/assets/xml/objects/object_ganon_objects.xml @@ -1,6 +1,9 @@ + + + - + diff --git a/assets/xml/objects/object_ganon_pal.xml b/assets/xml/objects/object_ganon_pal.xml index c5dd938235..83ebb85ea7 100644 --- a/assets/xml/objects/object_ganon_pal.xml +++ b/assets/xml/objects/object_ganon_pal.xml @@ -1,6 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -25,38 +90,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -68,7 +149,7 @@ - + diff --git a/assets/xml/objects/object_ge1.xml b/assets/xml/objects/object_ge1.xml index c3c3e0db39..bbb5d82a0d 100644 --- a/assets/xml/objects/object_ge1.xml +++ b/assets/xml/objects/object_ge1.xml @@ -39,22 +39,22 @@ - - + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -62,17 +62,73 @@ - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_geff.xml b/assets/xml/objects/object_geff.xml index f0667743b0..268535892d 100644 --- a/assets/xml/objects/object_geff.xml +++ b/assets/xml/objects/object_geff.xml @@ -1,7 +1,10 @@ - - + + + + + diff --git a/assets/xml/objects/object_geldb.xml b/assets/xml/objects/object_geldb.xml index a1dbd18f40..f80ad410a6 100644 --- a/assets/xml/objects/object_geldb.xml +++ b/assets/xml/objects/object_geldb.xml @@ -17,12 +17,131 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_arrow.xml b/assets/xml/objects/object_gi_arrow.xml index 4b58787a9d..e041351008 100644 --- a/assets/xml/objects/object_gi_arrow.xml +++ b/assets/xml/objects/object_gi_arrow.xml @@ -1,7 +1,17 @@ + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_arrowcase.xml b/assets/xml/objects/object_gi_arrowcase.xml index 267b0a734d..7939423ba4 100644 --- a/assets/xml/objects/object_gi_arrowcase.xml +++ b/assets/xml/objects/object_gi_arrowcase.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_bean.xml b/assets/xml/objects/object_gi_bean.xml index e74247816f..6a2f1e7a7d 100644 --- a/assets/xml/objects/object_gi_bean.xml +++ b/assets/xml/objects/object_gi_bean.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_bomb_1.xml b/assets/xml/objects/object_gi_bomb_1.xml index bae86c11d8..396d09f5d9 100644 --- a/assets/xml/objects/object_gi_bomb_1.xml +++ b/assets/xml/objects/object_gi_bomb_1.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_bomb_2.xml b/assets/xml/objects/object_gi_bomb_2.xml index 1400c4a4d4..78df129962 100644 --- a/assets/xml/objects/object_gi_bomb_2.xml +++ b/assets/xml/objects/object_gi_bomb_2.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_bombpouch.xml b/assets/xml/objects/object_gi_bombpouch.xml index 07134748c3..7109816459 100644 --- a/assets/xml/objects/object_gi_bombpouch.xml +++ b/assets/xml/objects/object_gi_bombpouch.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_boomerang.xml b/assets/xml/objects/object_gi_boomerang.xml index 3c1a0fe7fc..bf20bb3429 100644 --- a/assets/xml/objects/object_gi_boomerang.xml +++ b/assets/xml/objects/object_gi_boomerang.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_boots_2.xml b/assets/xml/objects/object_gi_boots_2.xml index 8e9cd1028d..ae5d148421 100644 --- a/assets/xml/objects/object_gi_boots_2.xml +++ b/assets/xml/objects/object_gi_boots_2.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_bosskey.xml b/assets/xml/objects/object_gi_bosskey.xml index e5e4bc86c9..cd5ae92094 100644 --- a/assets/xml/objects/object_gi_bosskey.xml +++ b/assets/xml/objects/object_gi_bosskey.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_bottle.xml b/assets/xml/objects/object_gi_bottle.xml index 3b0884a03f..22bece4f0b 100644 --- a/assets/xml/objects/object_gi_bottle.xml +++ b/assets/xml/objects/object_gi_bottle.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_bottle_letter.xml b/assets/xml/objects/object_gi_bottle_letter.xml index 443219caf5..209d053f83 100644 --- a/assets/xml/objects/object_gi_bottle_letter.xml +++ b/assets/xml/objects/object_gi_bottle_letter.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_bow.xml b/assets/xml/objects/object_gi_bow.xml index 946e9c4965..ebf7a95559 100644 --- a/assets/xml/objects/object_gi_bow.xml +++ b/assets/xml/objects/object_gi_bow.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_bracelet.xml b/assets/xml/objects/object_gi_bracelet.xml index 5a0b62a60a..c0d9c7f855 100644 --- a/assets/xml/objects/object_gi_bracelet.xml +++ b/assets/xml/objects/object_gi_bracelet.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_brokensword.xml b/assets/xml/objects/object_gi_brokensword.xml index 408741ac54..e99b487a81 100644 --- a/assets/xml/objects/object_gi_brokensword.xml +++ b/assets/xml/objects/object_gi_brokensword.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_butterfly.xml b/assets/xml/objects/object_gi_butterfly.xml index 76ac706096..65eed5b0e8 100644 --- a/assets/xml/objects/object_gi_butterfly.xml +++ b/assets/xml/objects/object_gi_butterfly.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_clothes.xml b/assets/xml/objects/object_gi_clothes.xml index 2a10dce11b..be9853eb8f 100644 --- a/assets/xml/objects/object_gi_clothes.xml +++ b/assets/xml/objects/object_gi_clothes.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_coin.xml b/assets/xml/objects/object_gi_coin.xml index 22e29f255f..e69e1dcd94 100644 --- a/assets/xml/objects/object_gi_coin.xml +++ b/assets/xml/objects/object_gi_coin.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_compass.xml b/assets/xml/objects/object_gi_compass.xml index 076229b11e..748597c65f 100644 --- a/assets/xml/objects/object_gi_compass.xml +++ b/assets/xml/objects/object_gi_compass.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_dekupouch.xml b/assets/xml/objects/object_gi_dekupouch.xml index 3d6d95d98a..d717edb8ba 100644 --- a/assets/xml/objects/object_gi_dekupouch.xml +++ b/assets/xml/objects/object_gi_dekupouch.xml @@ -1,5 +1,17 @@ + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_egg.xml b/assets/xml/objects/object_gi_egg.xml index 2b2e2847db..967b128a45 100644 --- a/assets/xml/objects/object_gi_egg.xml +++ b/assets/xml/objects/object_gi_egg.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_eye_lotion.xml b/assets/xml/objects/object_gi_eye_lotion.xml index 5128c5f6ff..46cadb117e 100644 --- a/assets/xml/objects/object_gi_eye_lotion.xml +++ b/assets/xml/objects/object_gi_eye_lotion.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_fire.xml b/assets/xml/objects/object_gi_fire.xml index a57fba6e86..0211f60187 100644 --- a/assets/xml/objects/object_gi_fire.xml +++ b/assets/xml/objects/object_gi_fire.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gi_fish.xml b/assets/xml/objects/object_gi_fish.xml index edb39dc297..e5def6ebbe 100644 --- a/assets/xml/objects/object_gi_fish.xml +++ b/assets/xml/objects/object_gi_fish.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_frog.xml b/assets/xml/objects/object_gi_frog.xml index f180fd267b..53384429b4 100644 --- a/assets/xml/objects/object_gi_frog.xml +++ b/assets/xml/objects/object_gi_frog.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_gerudo.xml b/assets/xml/objects/object_gi_gerudo.xml index 3be8d34620..34986a295e 100644 --- a/assets/xml/objects/object_gi_gerudo.xml +++ b/assets/xml/objects/object_gi_gerudo.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/assets/xml/objects/object_gi_gerudomask.xml b/assets/xml/objects/object_gi_gerudomask.xml index b53bf24af6..94576b0406 100644 --- a/assets/xml/objects/object_gi_gerudomask.xml +++ b/assets/xml/objects/object_gi_gerudomask.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gi_ghost.xml b/assets/xml/objects/object_gi_ghost.xml index 186f4c74b7..5dbf39480f 100644 --- a/assets/xml/objects/object_gi_ghost.xml +++ b/assets/xml/objects/object_gi_ghost.xml @@ -1,5 +1,17 @@ + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_glasses.xml b/assets/xml/objects/object_gi_glasses.xml index 63d32ab5ac..f6cb981845 100644 --- a/assets/xml/objects/object_gi_glasses.xml +++ b/assets/xml/objects/object_gi_glasses.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_gloves.xml b/assets/xml/objects/object_gi_gloves.xml index 1b4282dcaa..85ad6ddeff 100644 --- a/assets/xml/objects/object_gi_gloves.xml +++ b/assets/xml/objects/object_gi_gloves.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_goddess.xml b/assets/xml/objects/object_gi_goddess.xml index 50cbdd8918..cd693a5f45 100644 --- a/assets/xml/objects/object_gi_goddess.xml +++ b/assets/xml/objects/object_gi_goddess.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_golonmask.xml b/assets/xml/objects/object_gi_golonmask.xml index 98f53f1c25..68dbddb365 100644 --- a/assets/xml/objects/object_gi_golonmask.xml +++ b/assets/xml/objects/object_gi_golonmask.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gi_grass.xml b/assets/xml/objects/object_gi_grass.xml index ae7834201a..9ee7482729 100644 --- a/assets/xml/objects/object_gi_grass.xml +++ b/assets/xml/objects/object_gi_grass.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_hammer.xml b/assets/xml/objects/object_gi_hammer.xml index feb5c8659d..70f0a17c20 100644 --- a/assets/xml/objects/object_gi_hammer.xml +++ b/assets/xml/objects/object_gi_hammer.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_heart.xml b/assets/xml/objects/object_gi_heart.xml index 48e78b1b5c..0a8dfee2b1 100644 --- a/assets/xml/objects/object_gi_heart.xml +++ b/assets/xml/objects/object_gi_heart.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_hearts.xml b/assets/xml/objects/object_gi_hearts.xml index d2e763e631..aaa87d00f1 100644 --- a/assets/xml/objects/object_gi_hearts.xml +++ b/assets/xml/objects/object_gi_hearts.xml @@ -1,5 +1,15 @@ + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_hookshot.xml b/assets/xml/objects/object_gi_hookshot.xml index a6b3b0fdac..1d43f927e5 100644 --- a/assets/xml/objects/object_gi_hookshot.xml +++ b/assets/xml/objects/object_gi_hookshot.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_hoverboots.xml b/assets/xml/objects/object_gi_hoverboots.xml index c4a67877b2..fed584e742 100644 --- a/assets/xml/objects/object_gi_hoverboots.xml +++ b/assets/xml/objects/object_gi_hoverboots.xml @@ -1,5 +1,11 @@ + + + + + + diff --git a/assets/xml/objects/object_gi_insect.xml b/assets/xml/objects/object_gi_insect.xml index 7af5b5b3b2..8eb59b9c1b 100644 --- a/assets/xml/objects/object_gi_insect.xml +++ b/assets/xml/objects/object_gi_insect.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_jewel.xml b/assets/xml/objects/object_gi_jewel.xml index e83c651164..1d919b6ef6 100644 --- a/assets/xml/objects/object_gi_jewel.xml +++ b/assets/xml/objects/object_gi_jewel.xml @@ -1,14 +1,33 @@ + - + + + + + + + - + + + + + + + - + + + + + + + diff --git a/assets/xml/objects/object_gi_key.xml b/assets/xml/objects/object_gi_key.xml index a37d45a71c..874cd6e698 100644 --- a/assets/xml/objects/object_gi_key.xml +++ b/assets/xml/objects/object_gi_key.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_ki_tan_mask.xml b/assets/xml/objects/object_gi_ki_tan_mask.xml index f66535af37..b888acfe73 100644 --- a/assets/xml/objects/object_gi_ki_tan_mask.xml +++ b/assets/xml/objects/object_gi_ki_tan_mask.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_letter.xml b/assets/xml/objects/object_gi_letter.xml index 167a7ff5d8..098b8cca79 100644 --- a/assets/xml/objects/object_gi_letter.xml +++ b/assets/xml/objects/object_gi_letter.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_liquid.xml b/assets/xml/objects/object_gi_liquid.xml index 5eeeca0fd2..133d8ce902 100644 --- a/assets/xml/objects/object_gi_liquid.xml +++ b/assets/xml/objects/object_gi_liquid.xml @@ -1,5 +1,18 @@ + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_longsword.xml b/assets/xml/objects/object_gi_longsword.xml index 7161e42e38..dc7773c692 100644 --- a/assets/xml/objects/object_gi_longsword.xml +++ b/assets/xml/objects/object_gi_longsword.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_m_arrow.xml b/assets/xml/objects/object_gi_m_arrow.xml index 0fd659ae95..a9a6cb7f3f 100644 --- a/assets/xml/objects/object_gi_m_arrow.xml +++ b/assets/xml/objects/object_gi_m_arrow.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_magicpot.xml b/assets/xml/objects/object_gi_magicpot.xml index 7623e6353e..3dc92c16a1 100644 --- a/assets/xml/objects/object_gi_magicpot.xml +++ b/assets/xml/objects/object_gi_magicpot.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_map.xml b/assets/xml/objects/object_gi_map.xml index 8887dd22c9..b88e6de859 100644 --- a/assets/xml/objects/object_gi_map.xml +++ b/assets/xml/objects/object_gi_map.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_medal.xml b/assets/xml/objects/object_gi_medal.xml index d2cb6191d9..7fafeb5d53 100644 --- a/assets/xml/objects/object_gi_medal.xml +++ b/assets/xml/objects/object_gi_medal.xml @@ -1,23 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_melody.xml b/assets/xml/objects/object_gi_melody.xml index b01fca9538..31dc495bd8 100644 --- a/assets/xml/objects/object_gi_melody.xml +++ b/assets/xml/objects/object_gi_melody.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_milk.xml b/assets/xml/objects/object_gi_milk.xml index 00b9530d95..cc72cec9d1 100644 --- a/assets/xml/objects/object_gi_milk.xml +++ b/assets/xml/objects/object_gi_milk.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_mushroom.xml b/assets/xml/objects/object_gi_mushroom.xml index 5b19bca743..0933f2158a 100644 --- a/assets/xml/objects/object_gi_mushroom.xml +++ b/assets/xml/objects/object_gi_mushroom.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_niwatori.xml b/assets/xml/objects/object_gi_niwatori.xml index 713cc1ce5a..edf67f88d8 100644 --- a/assets/xml/objects/object_gi_niwatori.xml +++ b/assets/xml/objects/object_gi_niwatori.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gi_nuts.xml b/assets/xml/objects/object_gi_nuts.xml index 5508fe8569..d4a2f0e9cd 100644 --- a/assets/xml/objects/object_gi_nuts.xml +++ b/assets/xml/objects/object_gi_nuts.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/assets/xml/objects/object_gi_ocarina.xml b/assets/xml/objects/object_gi_ocarina.xml index 7693cc122f..dafcb92424 100644 --- a/assets/xml/objects/object_gi_ocarina.xml +++ b/assets/xml/objects/object_gi_ocarina.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_ocarina_0.xml b/assets/xml/objects/object_gi_ocarina_0.xml index 336d338946..e43bb3a87c 100644 --- a/assets/xml/objects/object_gi_ocarina_0.xml +++ b/assets/xml/objects/object_gi_ocarina_0.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_pachinko.xml b/assets/xml/objects/object_gi_pachinko.xml index 5f808baf92..bc8872d685 100644 --- a/assets/xml/objects/object_gi_pachinko.xml +++ b/assets/xml/objects/object_gi_pachinko.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_powder.xml b/assets/xml/objects/object_gi_powder.xml index fb7dc0155d..b49593cb1d 100644 --- a/assets/xml/objects/object_gi_powder.xml +++ b/assets/xml/objects/object_gi_powder.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_prescription.xml b/assets/xml/objects/object_gi_prescription.xml index 081de301c4..1b4e54ec5d 100644 --- a/assets/xml/objects/object_gi_prescription.xml +++ b/assets/xml/objects/object_gi_prescription.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_purse.xml b/assets/xml/objects/object_gi_purse.xml index 3034942ff4..70ec500508 100644 --- a/assets/xml/objects/object_gi_purse.xml +++ b/assets/xml/objects/object_gi_purse.xml @@ -1,5 +1,18 @@ + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_rabit_mask.xml b/assets/xml/objects/object_gi_rabit_mask.xml index 75f855550d..65b6cdd4bc 100644 --- a/assets/xml/objects/object_gi_rabit_mask.xml +++ b/assets/xml/objects/object_gi_rabit_mask.xml @@ -1,5 +1,13 @@ + + + + + + + + diff --git a/assets/xml/objects/object_gi_redead_mask.xml b/assets/xml/objects/object_gi_redead_mask.xml index 7de08487f8..2168b23e91 100644 --- a/assets/xml/objects/object_gi_redead_mask.xml +++ b/assets/xml/objects/object_gi_redead_mask.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_rupy.xml b/assets/xml/objects/object_gi_rupy.xml index 0a1af96d0f..0305ae68b8 100644 --- a/assets/xml/objects/object_gi_rupy.xml +++ b/assets/xml/objects/object_gi_rupy.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_saw.xml b/assets/xml/objects/object_gi_saw.xml index dcc038b7c1..3fb4cb8d3d 100644 --- a/assets/xml/objects/object_gi_saw.xml +++ b/assets/xml/objects/object_gi_saw.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_scale.xml b/assets/xml/objects/object_gi_scale.xml index 1cf5de5b99..dd9200dc96 100644 --- a/assets/xml/objects/object_gi_scale.xml +++ b/assets/xml/objects/object_gi_scale.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_seed.xml b/assets/xml/objects/object_gi_seed.xml index 82c15c82d2..88c224f24b 100644 --- a/assets/xml/objects/object_gi_seed.xml +++ b/assets/xml/objects/object_gi_seed.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_shield_1.xml b/assets/xml/objects/object_gi_shield_1.xml index 2e93695699..c7a5c7cb42 100644 --- a/assets/xml/objects/object_gi_shield_1.xml +++ b/assets/xml/objects/object_gi_shield_1.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/assets/xml/objects/object_gi_shield_2.xml b/assets/xml/objects/object_gi_shield_2.xml index 176ae025fe..6c1f983b19 100644 --- a/assets/xml/objects/object_gi_shield_2.xml +++ b/assets/xml/objects/object_gi_shield_2.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_shield_3.xml b/assets/xml/objects/object_gi_shield_3.xml index 250bf7fea3..3550bd0d89 100644 --- a/assets/xml/objects/object_gi_shield_3.xml +++ b/assets/xml/objects/object_gi_shield_3.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gi_skj_mask.xml b/assets/xml/objects/object_gi_skj_mask.xml index e6c90f76f1..7405e66222 100644 --- a/assets/xml/objects/object_gi_skj_mask.xml +++ b/assets/xml/objects/object_gi_skj_mask.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_soldout.xml b/assets/xml/objects/object_gi_soldout.xml index ae3f4685f9..ba45784761 100644 --- a/assets/xml/objects/object_gi_soldout.xml +++ b/assets/xml/objects/object_gi_soldout.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_soul.xml b/assets/xml/objects/object_gi_soul.xml index 76ffc56852..519226270d 100644 --- a/assets/xml/objects/object_gi_soul.xml +++ b/assets/xml/objects/object_gi_soul.xml @@ -1,5 +1,16 @@ + + + + + + + + + + + diff --git a/assets/xml/objects/object_gi_stick.xml b/assets/xml/objects/object_gi_stick.xml index fed89f4659..3da363f7cf 100644 --- a/assets/xml/objects/object_gi_stick.xml +++ b/assets/xml/objects/object_gi_stick.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_sutaru.xml b/assets/xml/objects/object_gi_sutaru.xml index a2606afbe3..5217cf300d 100644 --- a/assets/xml/objects/object_gi_sutaru.xml +++ b/assets/xml/objects/object_gi_sutaru.xml @@ -1,5 +1,12 @@ + + + + + + + diff --git a/assets/xml/objects/object_gi_sword_1.xml b/assets/xml/objects/object_gi_sword_1.xml index e1119abca0..fcf8550224 100644 --- a/assets/xml/objects/object_gi_sword_1.xml +++ b/assets/xml/objects/object_gi_sword_1.xml @@ -1,5 +1,9 @@ + + + + diff --git a/assets/xml/objects/object_gi_ticketstone.xml b/assets/xml/objects/object_gi_ticketstone.xml index 0fa37fe11e..ce756e3abc 100644 --- a/assets/xml/objects/object_gi_ticketstone.xml +++ b/assets/xml/objects/object_gi_ticketstone.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gi_truth_mask.xml b/assets/xml/objects/object_gi_truth_mask.xml index f28c7cbcad..32c550560c 100644 --- a/assets/xml/objects/object_gi_truth_mask.xml +++ b/assets/xml/objects/object_gi_truth_mask.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gi_zoramask.xml b/assets/xml/objects/object_gi_zoramask.xml index 096fdeedfc..0788f67f0d 100644 --- a/assets/xml/objects/object_gi_zoramask.xml +++ b/assets/xml/objects/object_gi_zoramask.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/assets/xml/objects/object_gj.xml b/assets/xml/objects/object_gj.xml index 50d6337b4a..581bf93c7d 100644 --- a/assets/xml/objects/object_gj.xml +++ b/assets/xml/objects/object_gj.xml @@ -1,35 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gjyo_objects.xml b/assets/xml/objects/object_gjyo_objects.xml index ea4f8444fb..3903235948 100644 --- a/assets/xml/objects/object_gjyo_objects.xml +++ b/assets/xml/objects/object_gjyo_objects.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_gla.xml b/assets/xml/objects/object_gla.xml index dbbfcb58ff..cf92179a79 100644 --- a/assets/xml/objects/object_gla.xml +++ b/assets/xml/objects/object_gla.xml @@ -47,29 +47,29 @@ - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + @@ -81,5 +81,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gnd.xml b/assets/xml/objects/object_gnd.xml index d073b8b973..d340135433 100644 --- a/assets/xml/objects/object_gnd.xml +++ b/assets/xml/objects/object_gnd.xml @@ -39,38 +39,38 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + @@ -82,5 +82,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gnd_magic.xml b/assets/xml/objects/object_gnd_magic.xml index a88d419d7a..5ce187a1cf 100644 --- a/assets/xml/objects/object_gnd_magic.xml +++ b/assets/xml/objects/object_gnd_magic.xml @@ -1,7 +1,10 @@ - - + + + + + diff --git a/assets/xml/objects/object_gndd.xml b/assets/xml/objects/object_gndd.xml index 8bf5d770c4..d284893579 100644 --- a/assets/xml/objects/object_gndd.xml +++ b/assets/xml/objects/object_gndd.xml @@ -17,12 +17,78 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40,40 +106,43 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_god_lgt.xml b/assets/xml/objects/object_god_lgt.xml index 60df9e4693..e6f38dfdc2 100644 --- a/assets/xml/objects/object_god_lgt.xml +++ b/assets/xml/objects/object_god_lgt.xml @@ -1,9 +1,16 @@ + + + + - - - + + + + + + diff --git a/assets/xml/objects/object_gol.xml b/assets/xml/objects/object_gol.xml index 7e04508cb6..257662024b 100644 --- a/assets/xml/objects/object_gol.xml +++ b/assets/xml/objects/object_gol.xml @@ -25,12 +25,12 @@ - - + + - - - + + + @@ -55,5 +55,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_goma.xml b/assets/xml/objects/object_goma.xml index bfe6df0fca..be843c7ea2 100644 --- a/assets/xml/objects/object_goma.xml +++ b/assets/xml/objects/object_goma.xml @@ -151,19 +151,19 @@ - - - - - - + + + + + + - + - + diff --git a/assets/xml/objects/object_goma_pal.xml b/assets/xml/objects/object_goma_pal.xml index 543d9ce2a1..95c7f6ce0b 100644 --- a/assets/xml/objects/object_goma_pal.xml +++ b/assets/xml/objects/object_goma_pal.xml @@ -151,19 +151,19 @@ - - - - - - + + + + + + - + - + diff --git a/assets/xml/objects/object_goroiwa.xml b/assets/xml/objects/object_goroiwa.xml index 5d406e9578..6ca4f064bc 100644 --- a/assets/xml/objects/object_goroiwa.xml +++ b/assets/xml/objects/object_goroiwa.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_gr.xml b/assets/xml/objects/object_gr.xml index 103d4412e9..8f84870967 100644 --- a/assets/xml/objects/object_gr.xml +++ b/assets/xml/objects/object_gr.xml @@ -3,14 +3,58 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_gs.xml b/assets/xml/objects/object_gs.xml index 145be16653..4895c63c07 100644 --- a/assets/xml/objects/object_gs.xml +++ b/assets/xml/objects/object_gs.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_gt.xml b/assets/xml/objects/object_gt.xml index dd48318d1d..97b6c1b666 100644 --- a/assets/xml/objects/object_gt.xml +++ b/assets/xml/objects/object_gt.xml @@ -1,33 +1,54 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_haka.xml b/assets/xml/objects/object_haka.xml index f6b263c375..8a6c0b7d14 100644 --- a/assets/xml/objects/object_haka.xml +++ b/assets/xml/objects/object_haka.xml @@ -1,9 +1,15 @@ - - - + + + + + + + + + diff --git a/assets/xml/objects/object_haka_door.xml b/assets/xml/objects/object_haka_door.xml index 1376d03569..9d7ba15f58 100644 --- a/assets/xml/objects/object_haka_door.xml +++ b/assets/xml/objects/object_haka_door.xml @@ -1,12 +1,27 @@ - + + + + + + + + + + - + + + + - + + + + diff --git a/assets/xml/objects/object_haka_objects.xml b/assets/xml/objects/object_haka_objects.xml index 3ca6d27c08..2325e663a8 100644 --- a/assets/xml/objects/object_haka_objects.xml +++ b/assets/xml/objects/object_haka_objects.xml @@ -1,85 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_hakach_objects.xml b/assets/xml/objects/object_hakach_objects.xml index b978e77a31..92679bc8de 100644 --- a/assets/xml/objects/object_hakach_objects.xml +++ b/assets/xml/objects/object_hakach_objects.xml @@ -1,13 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15,14 +42,15 @@ - - + + - + + diff --git a/assets/xml/objects/object_hata.xml b/assets/xml/objects/object_hata.xml index b0324c3be3..98887b030d 100644 --- a/assets/xml/objects/object_hata.xml +++ b/assets/xml/objects/object_hata.xml @@ -31,6 +31,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,8 +72,8 @@ - - - + + + diff --git a/assets/xml/objects/object_heavy_object.xml b/assets/xml/objects/object_heavy_object.xml index ecc7953211..f1f3e446ac 100644 --- a/assets/xml/objects/object_heavy_object.xml +++ b/assets/xml/objects/object_heavy_object.xml @@ -1,8 +1,17 @@ - + + + + + + + + + + diff --git a/assets/xml/objects/object_hidan_objects.xml b/assets/xml/objects/object_hidan_objects.xml index fe0405d9dd..2d926e7c0d 100644 --- a/assets/xml/objects/object_hidan_objects.xml +++ b/assets/xml/objects/object_hidan_objects.xml @@ -1,89 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_hintnuts.xml b/assets/xml/objects/object_hintnuts.xml index d3595d85e8..fe02e8adbe 100644 --- a/assets/xml/objects/object_hintnuts.xml +++ b/assets/xml/objects/object_hintnuts.xml @@ -19,5 +19,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_hni.xml b/assets/xml/objects/object_hni.xml index 763f6892c0..5027583aeb 100644 --- a/assets/xml/objects/object_hni.xml +++ b/assets/xml/objects/object_hni.xml @@ -13,28 +13,28 @@ - - - - + + + + - - - - - + + + + + - - + + - - + + @@ -42,10 +42,10 @@ - - + + - + diff --git a/assets/xml/objects/object_horse.xml b/assets/xml/objects/object_horse.xml index 74619e5977..e4b2a067e3 100644 --- a/assets/xml/objects/object_horse.xml +++ b/assets/xml/objects/object_horse.xml @@ -12,28 +12,28 @@ - - + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -43,17 +43,17 @@ - + - - - - + + + + diff --git a/assets/xml/objects/object_horse_ganon.xml b/assets/xml/objects/object_horse_ganon.xml index 98babb0806..e9d04e8cc9 100644 --- a/assets/xml/objects/object_horse_ganon.xml +++ b/assets/xml/objects/object_horse_ganon.xml @@ -15,8 +15,8 @@ - - - + + + diff --git a/assets/xml/objects/object_horse_link_child.xml b/assets/xml/objects/object_horse_link_child.xml index 1491189a13..e15317da66 100644 --- a/assets/xml/objects/object_horse_link_child.xml +++ b/assets/xml/objects/object_horse_link_child.xml @@ -13,9 +13,9 @@ - - - - + + + + diff --git a/assets/xml/objects/object_horse_normal.xml b/assets/xml/objects/object_horse_normal.xml index 2bc2cb0c60..5e6a4fe461 100644 --- a/assets/xml/objects/object_horse_normal.xml +++ b/assets/xml/objects/object_horse_normal.xml @@ -21,6 +21,6 @@ - + diff --git a/assets/xml/objects/object_horse_zelda.xml b/assets/xml/objects/object_horse_zelda.xml index 9595c32453..628e043877 100644 --- a/assets/xml/objects/object_horse_zelda.xml +++ b/assets/xml/objects/object_horse_zelda.xml @@ -5,10 +5,10 @@ - - - + + + - + diff --git a/assets/xml/objects/object_hs.xml b/assets/xml/objects/object_hs.xml index cf5d06e1a2..bf5cbf047f 100644 --- a/assets/xml/objects/object_hs.xml +++ b/assets/xml/objects/object_hs.xml @@ -3,6 +3,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15,18 +48,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/assets/xml/objects/object_human.xml b/assets/xml/objects/object_human.xml index 05795cb332..ae5fb63c06 100644 --- a/assets/xml/objects/object_human.xml +++ b/assets/xml/objects/object_human.xml @@ -1,58 +1,58 @@ - - - + + + - - + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - - - - - - - - + + + + + + + + + - + @@ -76,90 +76,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - - + + - - - - + + + + - + - - + + diff --git a/assets/xml/objects/object_ice_objects.xml b/assets/xml/objects/object_ice_objects.xml index d21164bc15..97ce9b782c 100644 --- a/assets/xml/objects/object_ice_objects.xml +++ b/assets/xml/objects/object_ice_objects.xml @@ -1,26 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/assets/xml/objects/object_ik.xml b/assets/xml/objects/object_ik.xml index 50f47e9d7c..a3578f27f6 100644 --- a/assets/xml/objects/object_ik.xml +++ b/assets/xml/objects/object_ik.xml @@ -37,22 +37,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -73,13 +73,13 @@ - - - - - - - + + + + + + + @@ -96,9 +96,74 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_im.xml b/assets/xml/objects/object_im.xml index a628a113a4..c6ce6b6890 100644 --- a/assets/xml/objects/object_im.xml +++ b/assets/xml/objects/object_im.xml @@ -4,21 +4,53 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -29,23 +61,46 @@ - - - - - + + + + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - diff --git a/assets/xml/objects/object_in.xml b/assets/xml/objects/object_in.xml index 155b9c9ad1..4530adc370 100644 --- a/assets/xml/objects/object_in.xml +++ b/assets/xml/objects/object_in.xml @@ -4,38 +4,99 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -58,28 +119,83 @@ - - - - - - - - - + + + + + + + + + - - - + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ingate.xml b/assets/xml/objects/object_ingate.xml index e6be42bebf..cccb797511 100644 --- a/assets/xml/objects/object_ingate.xml +++ b/assets/xml/objects/object_ingate.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_jj.xml b/assets/xml/objects/object_jj.xml index 96ff7dc02a..816b7d706c 100644 --- a/assets/xml/objects/object_jj.xml +++ b/assets/xml/objects/object_jj.xml @@ -5,13 +5,48 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -26,46 +61,45 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_js.xml b/assets/xml/objects/object_js.xml index ff7bd3efa1..1e309f1cb1 100644 --- a/assets/xml/objects/object_js.xml +++ b/assets/xml/objects/object_js.xml @@ -17,6 +17,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31,19 +66,19 @@ - + - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_jya_door.xml b/assets/xml/objects/object_jya_door.xml index 60a7b37886..b29c8ff771 100644 --- a/assets/xml/objects/object_jya_door.xml +++ b/assets/xml/objects/object_jya_door.xml @@ -1,8 +1,14 @@ + + + + + + - - + + diff --git a/assets/xml/objects/object_jya_iron.xml b/assets/xml/objects/object_jya_iron.xml index c6f6773c6a..6cf7681630 100644 --- a/assets/xml/objects/object_jya_iron.xml +++ b/assets/xml/objects/object_jya_iron.xml @@ -1,13 +1,28 @@ + + + + + + + + + + + + + + + - - + + diff --git a/assets/xml/objects/object_jya_obj.xml b/assets/xml/objects/object_jya_obj.xml index 50c2700db1..1e203941f5 100644 --- a/assets/xml/objects/object_jya_obj.xml +++ b/assets/xml/objects/object_jya_obj.xml @@ -2,42 +2,42 @@ - - + + - + - - + + - - - - - - + + + + + + - - + + - - - + + + @@ -55,26 +55,34 @@ - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ka.xml b/assets/xml/objects/object_ka.xml index eb952732b4..ee9dfd6dd7 100644 --- a/assets/xml/objects/object_ka.xml +++ b/assets/xml/objects/object_ka.xml @@ -1,6 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -24,13 +93,13 @@ - - - - - - - + + + + + + + diff --git a/assets/xml/objects/object_kanban.xml b/assets/xml/objects/object_kanban.xml index 9ffc7a2ceb..13ce2fbaff 100644 --- a/assets/xml/objects/object_kanban.xml +++ b/assets/xml/objects/object_kanban.xml @@ -1,5 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12,7 +46,10 @@ + + + - + diff --git a/assets/xml/objects/object_kibako2.xml b/assets/xml/objects/object_kibako2.xml index a701b294de..c406b1d8ac 100644 --- a/assets/xml/objects/object_kibako2.xml +++ b/assets/xml/objects/object_kibako2.xml @@ -1,17 +1,25 @@ + + + + + + + + - - + + - - - + + + diff --git a/assets/xml/objects/object_kingdodongo.xml b/assets/xml/objects/object_kingdodongo.xml index 3ada2822c9..1e0b94cf97 100644 --- a/assets/xml/objects/object_kingdodongo.xml +++ b/assets/xml/objects/object_kingdodongo.xml @@ -10,45 +10,108 @@ + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -102,37 +165,49 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_kingdodongo_pal.xml b/assets/xml/objects/object_kingdodongo_pal.xml index a0790a6db5..b9ec4d4387 100644 --- a/assets/xml/objects/object_kingdodongo_pal.xml +++ b/assets/xml/objects/object_kingdodongo_pal.xml @@ -10,45 +10,108 @@ + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -102,37 +165,49 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_km1.xml b/assets/xml/objects/object_km1.xml index 4d17119251..086666bf2d 100644 --- a/assets/xml/objects/object_km1.xml +++ b/assets/xml/objects/object_km1.xml @@ -21,19 +21,22 @@ - - - - - - - - + + + + + + + + - - - - + + + + + + + diff --git a/assets/xml/objects/object_kusa.xml b/assets/xml/objects/object_kusa.xml index 67291a5543..b6bb8fcd0a 100644 --- a/assets/xml/objects/object_kusa.xml +++ b/assets/xml/objects/object_kusa.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/assets/xml/objects/object_kw1.xml b/assets/xml/objects/object_kw1.xml index 534c223b29..39120b108e 100644 --- a/assets/xml/objects/object_kw1.xml +++ b/assets/xml/objects/object_kw1.xml @@ -21,28 +21,28 @@ - - + + - - + + - - + + - - + + - - - - - - - - - + + + + + + + + + diff --git a/assets/xml/objects/object_kz.xml b/assets/xml/objects/object_kz.xml index 1077c824ca..0e75d9094c 100644 --- a/assets/xml/objects/object_kz.xml +++ b/assets/xml/objects/object_kz.xml @@ -2,22 +2,55 @@ - - - - - - - + + + + + + + - - - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_light_ring.xml b/assets/xml/objects/object_light_ring.xml index babe7d2aa7..b2183f32fc 100644 --- a/assets/xml/objects/object_light_ring.xml +++ b/assets/xml/objects/object_light_ring.xml @@ -1,6 +1,9 @@ + + + - + diff --git a/assets/xml/objects/object_lightbox.xml b/assets/xml/objects/object_lightbox.xml index c67059b89d..fcada5c40d 100644 --- a/assets/xml/objects/object_lightbox.xml +++ b/assets/xml/objects/object_lightbox.xml @@ -1,14 +1,26 @@ + + + + + + + + + - - + + + + + diff --git a/assets/xml/objects/object_lightswitch.xml b/assets/xml/objects/object_lightswitch.xml index cfd5dcfb40..267897eb3b 100644 --- a/assets/xml/objects/object_lightswitch.xml +++ b/assets/xml/objects/object_lightswitch.xml @@ -1,14 +1,23 @@ + + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_link_boy.xml b/assets/xml/objects/object_link_boy.xml index 77254f5557..a0052722f3 100644 --- a/assets/xml/objects/object_link_boy.xml +++ b/assets/xml/objects/object_link_boy.xml @@ -1,265 +1,560 @@ + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - - + + + - + - + - - - + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + - + + + + + + + - - - + + + - - - + + + - - - - - - - - + + + + + + + + - - - - + + + + - - + + - - + + - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_link_child.xml b/assets/xml/objects/object_link_child.xml index 36baf5aa6e..476c5f568d 100644 --- a/assets/xml/objects/object_link_child.xml +++ b/assets/xml/objects/object_link_child.xml @@ -1,203 +1,453 @@ + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - + + + - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_ma1.xml b/assets/xml/objects/object_ma1.xml index 11509ad6aa..4b2b7869a1 100644 --- a/assets/xml/objects/object_ma1.xml +++ b/assets/xml/objects/object_ma1.xml @@ -25,26 +25,78 @@ - - - - - - - - - - - + + + + + + + + + + + - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ma2.xml b/assets/xml/objects/object_ma2.xml index 0b6eabff70..960e9485bf 100644 --- a/assets/xml/objects/object_ma2.xml +++ b/assets/xml/objects/object_ma2.xml @@ -1,33 +1,85 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag.xml b/assets/xml/objects/object_mag.xml index 1a59b4092b..59a0613548 100644 --- a/assets/xml/objects/object_mag.xml +++ b/assets/xml/objects/object_mag.xml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_ique.xml b/assets/xml/objects/object_mag_ique.xml index 005fc2462d..3a2bed9682 100644 --- a/assets/xml/objects/object_mag_ique.xml +++ b/assets/xml/objects/object_mag_ique.xml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_v2.xml b/assets/xml/objects/object_mag_v2.xml index 69ce890a7a..9897422cbd 100644 --- a/assets/xml/objects/object_mag_v2.xml +++ b/assets/xml/objects/object_mag_v2.xml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_v2_mq.xml b/assets/xml/objects/object_mag_v2_mq.xml index 9f0543ea8a..0b14571ca7 100644 --- a/assets/xml/objects/object_mag_v2_mq.xml +++ b/assets/xml/objects/object_mag_v2_mq.xml @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_v3.xml b/assets/xml/objects/object_mag_v3.xml index 66874b0c07..eb95e103be 100644 --- a/assets/xml/objects/object_mag_v3.xml +++ b/assets/xml/objects/object_mag_v3.xml @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mag_v3_mq.xml b/assets/xml/objects/object_mag_v3_mq.xml index 541dc6c389..b0b54fe739 100644 --- a/assets/xml/objects/object_mag_v3_mq.xml +++ b/assets/xml/objects/object_mag_v3_mq.xml @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mamenoki.xml b/assets/xml/objects/object_mamenoki.xml index 819d890225..78683e565c 100644 --- a/assets/xml/objects/object_mamenoki.xml +++ b/assets/xml/objects/object_mamenoki.xml @@ -1,15 +1,27 @@ + + + + + + + + + + + + - - - - - - + + + + + + diff --git a/assets/xml/objects/object_masterkokirihead.xml b/assets/xml/objects/object_masterkokirihead.xml index 1e489323c2..9187df7014 100644 --- a/assets/xml/objects/object_masterkokirihead.xml +++ b/assets/xml/objects/object_masterkokirihead.xml @@ -1,14 +1,19 @@ + + + - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_mb.xml b/assets/xml/objects/object_mb.xml index a8471429db..c3ec222706 100644 --- a/assets/xml/objects/object_mb.xml +++ b/assets/xml/objects/object_mb.xml @@ -39,7 +39,7 @@ - + @@ -55,5 +55,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_md.xml b/assets/xml/objects/object_md.xml index 45527ca1b9..ea1fca3cda 100644 --- a/assets/xml/objects/object_md.xml +++ b/assets/xml/objects/object_md.xml @@ -21,6 +21,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,36 +86,36 @@ - - - + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_medal.xml b/assets/xml/objects/object_medal.xml index eeb433c400..35beef0487 100644 --- a/assets/xml/objects/object_medal.xml +++ b/assets/xml/objects/object_medal.xml @@ -1,17 +1,36 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + diff --git a/assets/xml/objects/object_menkuri_objects.xml b/assets/xml/objects/object_menkuri_objects.xml index 4c2b51df5b..8776de699e 100644 --- a/assets/xml/objects/object_menkuri_objects.xml +++ b/assets/xml/objects/object_menkuri_objects.xml @@ -1,17 +1,32 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mir_ray.xml b/assets/xml/objects/object_mir_ray.xml index 2acc9391ab..90d93a999c 100644 --- a/assets/xml/objects/object_mir_ray.xml +++ b/assets/xml/objects/object_mir_ray.xml @@ -1,13 +1,21 @@ + + + + + + + + - - - + + + diff --git a/assets/xml/objects/object_mizu_objects.xml b/assets/xml/objects/object_mizu_objects.xml index 5882b20501..b0abf34ec5 100644 --- a/assets/xml/objects/object_mizu_objects.xml +++ b/assets/xml/objects/object_mizu_objects.xml @@ -20,7 +20,7 @@ - + @@ -37,5 +37,20 @@ + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mjin.xml b/assets/xml/objects/object_mjin.xml index daf9b05412..45a2f1cd99 100644 --- a/assets/xml/objects/object_mjin.xml +++ b/assets/xml/objects/object_mjin.xml @@ -1,8 +1,11 @@ + + + - - + + diff --git a/assets/xml/objects/object_mjin_dark.xml b/assets/xml/objects/object_mjin_dark.xml index 2fa0bdbe4c..8f98d2c495 100644 --- a/assets/xml/objects/object_mjin_dark.xml +++ b/assets/xml/objects/object_mjin_dark.xml @@ -1,5 +1,5 @@ - + diff --git a/assets/xml/objects/object_mjin_flame.xml b/assets/xml/objects/object_mjin_flame.xml index 6274feaee1..87fb3a2435 100644 --- a/assets/xml/objects/object_mjin_flame.xml +++ b/assets/xml/objects/object_mjin_flame.xml @@ -1,5 +1,5 @@ - + diff --git a/assets/xml/objects/object_mjin_flash.xml b/assets/xml/objects/object_mjin_flash.xml index c1040ea118..f8cf72756a 100644 --- a/assets/xml/objects/object_mjin_flash.xml +++ b/assets/xml/objects/object_mjin_flash.xml @@ -1,5 +1,5 @@ - + diff --git a/assets/xml/objects/object_mjin_ice.xml b/assets/xml/objects/object_mjin_ice.xml index 1aaeea193d..6686296f73 100644 --- a/assets/xml/objects/object_mjin_ice.xml +++ b/assets/xml/objects/object_mjin_ice.xml @@ -1,5 +1,5 @@ - + diff --git a/assets/xml/objects/object_mjin_oka.xml b/assets/xml/objects/object_mjin_oka.xml index 0f823b9237..322b6808dc 100644 --- a/assets/xml/objects/object_mjin_oka.xml +++ b/assets/xml/objects/object_mjin_oka.xml @@ -1,8 +1,11 @@ + + + - - + + diff --git a/assets/xml/objects/object_mjin_soul.xml b/assets/xml/objects/object_mjin_soul.xml index 6386f7f9ea..5ce15c1f2e 100644 --- a/assets/xml/objects/object_mjin_soul.xml +++ b/assets/xml/objects/object_mjin_soul.xml @@ -1,5 +1,5 @@ - + diff --git a/assets/xml/objects/object_mjin_wind.xml b/assets/xml/objects/object_mjin_wind.xml index 8bba7eb91b..6eadf588b9 100644 --- a/assets/xml/objects/object_mjin_wind.xml +++ b/assets/xml/objects/object_mjin_wind.xml @@ -1,5 +1,5 @@ - + diff --git a/assets/xml/objects/object_mk.xml b/assets/xml/objects/object_mk.xml index 0b4aaae8aa..7371743d0b 100644 --- a/assets/xml/objects/object_mk.xml +++ b/assets/xml/objects/object_mk.xml @@ -4,6 +4,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16,17 +52,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_mm.xml b/assets/xml/objects/object_mm.xml index 834afe5ef0..04963a6c6b 100644 --- a/assets/xml/objects/object_mm.xml +++ b/assets/xml/objects/object_mm.xml @@ -9,8 +9,48 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mori_hineri1.xml b/assets/xml/objects/object_mori_hineri1.xml index a2033a6f97..d99fa0759a 100644 --- a/assets/xml/objects/object_mori_hineri1.xml +++ b/assets/xml/objects/object_mori_hineri1.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_mori_hineri1a.xml b/assets/xml/objects/object_mori_hineri1a.xml index d7e3489044..941c53fc4a 100644 --- a/assets/xml/objects/object_mori_hineri1a.xml +++ b/assets/xml/objects/object_mori_hineri1a.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_mori_hineri2.xml b/assets/xml/objects/object_mori_hineri2.xml index 9f1c892afb..8f44a82af9 100644 --- a/assets/xml/objects/object_mori_hineri2.xml +++ b/assets/xml/objects/object_mori_hineri2.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_mori_hineri2a.xml b/assets/xml/objects/object_mori_hineri2a.xml index 6fd6818562..52dd3a0916 100644 --- a/assets/xml/objects/object_mori_hineri2a.xml +++ b/assets/xml/objects/object_mori_hineri2a.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/assets/xml/objects/object_mori_objects.xml b/assets/xml/objects/object_mori_objects.xml index aa24a38d70..1ee708091e 100644 --- a/assets/xml/objects/object_mori_objects.xml +++ b/assets/xml/objects/object_mori_objects.xml @@ -1,25 +1,52 @@ - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mori_tex.xml b/assets/xml/objects/object_mori_tex.xml index 756347bcc6..b3b6611346 100644 --- a/assets/xml/objects/object_mori_tex.xml +++ b/assets/xml/objects/object_mori_tex.xml @@ -1,28 +1,28 @@ - - - + + + - - - + + + - - + + - - + + - + - - - - - - + + + + + + - + diff --git a/assets/xml/objects/object_ms.xml b/assets/xml/objects/object_ms.xml index 66923df8ae..847b674d54 100644 --- a/assets/xml/objects/object_ms.xml +++ b/assets/xml/objects/object_ms.xml @@ -13,6 +13,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -23,19 +46,19 @@ - + - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_mu.xml b/assets/xml/objects/object_mu.xml index 7251ff7212..e1037a370b 100644 --- a/assets/xml/objects/object_mu.xml +++ b/assets/xml/objects/object_mu.xml @@ -1,17 +1,56 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -42,18 +81,69 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_nb.xml b/assets/xml/objects/object_nb.xml index 74de9e2859..cf2dba8da4 100644 --- a/assets/xml/objects/object_nb.xml +++ b/assets/xml/objects/object_nb.xml @@ -24,6 +24,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45,46 +98,46 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_niw.xml b/assets/xml/objects/object_niw.xml index 4eafec9566..0b672f940b 100644 --- a/assets/xml/objects/object_niw.xml +++ b/assets/xml/objects/object_niw.xml @@ -20,6 +20,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -29,19 +52,22 @@ - + + + + - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_nwc.xml b/assets/xml/objects/object_nwc.xml index 96ffa32383..2f3f8705b4 100644 --- a/assets/xml/objects/object_nwc.xml +++ b/assets/xml/objects/object_nwc.xml @@ -1,15 +1,28 @@ + - - - + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ny.xml b/assets/xml/objects/object_ny.xml index e2e8187ff8..f92549311c 100644 --- a/assets/xml/objects/object_ny.xml +++ b/assets/xml/objects/object_ny.xml @@ -1,10 +1,20 @@ + - - - + + + + + + + + + + + + - - + + diff --git a/assets/xml/objects/object_oA1.xml b/assets/xml/objects/object_oA1.xml index 1d665f1010..fe7eced252 100644 --- a/assets/xml/objects/object_oA1.xml +++ b/assets/xml/objects/object_oA1.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,16 +99,16 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oA10.xml b/assets/xml/objects/object_oA10.xml index 65d0808349..0e17150e2c 100644 --- a/assets/xml/objects/object_oA10.xml +++ b/assets/xml/objects/object_oA10.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,13 +99,13 @@ - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_oA11.xml b/assets/xml/objects/object_oA11.xml index 92ae474b60..b1b4b9a4fe 100644 --- a/assets/xml/objects/object_oA11.xml +++ b/assets/xml/objects/object_oA11.xml @@ -51,6 +51,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -58,9 +79,9 @@ - - - - + + + + diff --git a/assets/xml/objects/object_oA2.xml b/assets/xml/objects/object_oA2.xml index ffdcd79896..81c97bed89 100644 --- a/assets/xml/objects/object_oA2.xml +++ b/assets/xml/objects/object_oA2.xml @@ -39,20 +39,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oA3.xml b/assets/xml/objects/object_oA3.xml index 176ad09315..38becb819c 100644 --- a/assets/xml/objects/object_oA3.xml +++ b/assets/xml/objects/object_oA3.xml @@ -1,10 +1,13 @@ - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_oA4.xml b/assets/xml/objects/object_oA4.xml index dcdbbfff9b..83fa41f434 100644 --- a/assets/xml/objects/object_oA4.xml +++ b/assets/xml/objects/object_oA4.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,11 +99,11 @@ - - - - - - + + + + + + diff --git a/assets/xml/objects/object_oA5.xml b/assets/xml/objects/object_oA5.xml index 55072176dd..1ec4b6f876 100644 --- a/assets/xml/objects/object_oA5.xml +++ b/assets/xml/objects/object_oA5.xml @@ -39,26 +39,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + diff --git a/assets/xml/objects/object_oA6.xml b/assets/xml/objects/object_oA6.xml index c17a510881..1d80b31f3d 100644 --- a/assets/xml/objects/object_oA6.xml +++ b/assets/xml/objects/object_oA6.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,11 +99,11 @@ - - - - - - + + + + + + diff --git a/assets/xml/objects/object_oA7.xml b/assets/xml/objects/object_oA7.xml index 52c68f6394..3f63c3cc06 100644 --- a/assets/xml/objects/object_oA7.xml +++ b/assets/xml/objects/object_oA7.xml @@ -39,24 +39,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_oA8.xml b/assets/xml/objects/object_oA8.xml index 8ed2d3df50..5d2fd06f9e 100644 --- a/assets/xml/objects/object_oA8.xml +++ b/assets/xml/objects/object_oA8.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,8 +99,8 @@ - - - + + + diff --git a/assets/xml/objects/object_oA9.xml b/assets/xml/objects/object_oA9.xml index d5c16abfcd..07eb20ce7b 100644 --- a/assets/xml/objects/object_oA9.xml +++ b/assets/xml/objects/object_oA9.xml @@ -1,7 +1,10 @@ + + + - - + + diff --git a/assets/xml/objects/object_oB1.xml b/assets/xml/objects/object_oB1.xml index 2f50c967b2..1012ce3a40 100644 --- a/assets/xml/objects/object_oB1.xml +++ b/assets/xml/objects/object_oB1.xml @@ -39,31 +39,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oB2.xml b/assets/xml/objects/object_oB2.xml index 230783ceae..1e018af222 100644 --- a/assets/xml/objects/object_oB2.xml +++ b/assets/xml/objects/object_oB2.xml @@ -54,6 +54,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -62,15 +86,15 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_oB3.xml b/assets/xml/objects/object_oB3.xml index 1c42ddaccc..b5f569cb92 100644 --- a/assets/xml/objects/object_oB3.xml +++ b/assets/xml/objects/object_oB3.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,17 +99,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oB4.xml b/assets/xml/objects/object_oB4.xml index 2924c9e753..c0bdb1e30b 100644 --- a/assets/xml/objects/object_oB4.xml +++ b/assets/xml/objects/object_oB4.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,11 +99,11 @@ - - - - - - + + + + + + diff --git a/assets/xml/objects/object_oE1.xml b/assets/xml/objects/object_oE1.xml index 5b3234893e..166efb7002 100644 --- a/assets/xml/objects/object_oE1.xml +++ b/assets/xml/objects/object_oE1.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,18 +99,18 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE10.xml b/assets/xml/objects/object_oE10.xml index 04ce914372..a501165fb7 100644 --- a/assets/xml/objects/object_oE10.xml +++ b/assets/xml/objects/object_oE10.xml @@ -1,15 +1,18 @@ + + + - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_oE11.xml b/assets/xml/objects/object_oE11.xml index 26ff739cd0..2e165702f9 100644 --- a/assets/xml/objects/object_oE11.xml +++ b/assets/xml/objects/object_oE11.xml @@ -1,16 +1,19 @@ + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE12.xml b/assets/xml/objects/object_oE12.xml index 4b89954e0d..2576a4ad49 100644 --- a/assets/xml/objects/object_oE12.xml +++ b/assets/xml/objects/object_oE12.xml @@ -1,16 +1,19 @@ + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE1s.xml b/assets/xml/objects/object_oE1s.xml index faf6ab7342..51daef5317 100644 --- a/assets/xml/objects/object_oE1s.xml +++ b/assets/xml/objects/object_oE1s.xml @@ -19,18 +19,63 @@ - + - - - - - + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE2.xml b/assets/xml/objects/object_oE2.xml index ea3ba91fc6..fae1a87d1d 100644 --- a/assets/xml/objects/object_oE2.xml +++ b/assets/xml/objects/object_oE2.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,19 +99,19 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE3.xml b/assets/xml/objects/object_oE3.xml index 4a6cb3d926..07d27cd715 100644 --- a/assets/xml/objects/object_oE3.xml +++ b/assets/xml/objects/object_oE3.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,21 +99,21 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE4.xml b/assets/xml/objects/object_oE4.xml index ae48d2adef..3f25c5e58e 100644 --- a/assets/xml/objects/object_oE4.xml +++ b/assets/xml/objects/object_oE4.xml @@ -39,6 +39,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,16 +99,16 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE4s.xml b/assets/xml/objects/object_oE4s.xml index 584019568a..aa59751331 100644 --- a/assets/xml/objects/object_oE4s.xml +++ b/assets/xml/objects/object_oE4s.xml @@ -18,15 +18,62 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE5.xml b/assets/xml/objects/object_oE5.xml index c05917dc9a..fd5ebb1b55 100644 --- a/assets/xml/objects/object_oE5.xml +++ b/assets/xml/objects/object_oE5.xml @@ -39,6 +39,30 @@ --> + + + + + + + + + + + + + + + + + + + + + + + + @@ -47,19 +71,19 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE6.xml b/assets/xml/objects/object_oE6.xml index d253130af1..e6902a1121 100644 --- a/assets/xml/objects/object_oE6.xml +++ b/assets/xml/objects/object_oE6.xml @@ -1,16 +1,19 @@ + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE7.xml b/assets/xml/objects/object_oE7.xml index 2b6b5cf316..58c9c2a77a 100644 --- a/assets/xml/objects/object_oE7.xml +++ b/assets/xml/objects/object_oE7.xml @@ -1,15 +1,18 @@ + + + - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_oE8.xml b/assets/xml/objects/object_oE8.xml index 8b1333fa9c..28f9005c5e 100644 --- a/assets/xml/objects/object_oE8.xml +++ b/assets/xml/objects/object_oE8.xml @@ -1,16 +1,19 @@ + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oE9.xml b/assets/xml/objects/object_oE9.xml index e43cee426b..ea818dbf2b 100644 --- a/assets/xml/objects/object_oE9.xml +++ b/assets/xml/objects/object_oE9.xml @@ -1,16 +1,19 @@ + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_oF1d_map.xml b/assets/xml/objects/object_oF1d_map.xml index 821149a7bf..dfc3ebe75c 100644 --- a/assets/xml/objects/object_oF1d_map.xml +++ b/assets/xml/objects/object_oF1d_map.xml @@ -62,17 +62,35 @@ - + - - - - + + + + - - + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_oF1s.xml b/assets/xml/objects/object_oF1s.xml index fe41dde630..dcc1d1060a 100644 --- a/assets/xml/objects/object_oF1s.xml +++ b/assets/xml/objects/object_oF1s.xml @@ -22,22 +22,70 @@ - - - - - - - - - - + + + + + + + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_okuta.xml b/assets/xml/objects/object_okuta.xml index b4fccea6f3..65d7dfd75c 100644 --- a/assets/xml/objects/object_okuta.xml +++ b/assets/xml/objects/object_okuta.xml @@ -9,21 +9,75 @@ - - - - - - - - - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_os.xml b/assets/xml/objects/object_os.xml index d98b3a0f52..1b05a523af 100644 --- a/assets/xml/objects/object_os.xml +++ b/assets/xml/objects/object_os.xml @@ -3,6 +3,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -14,20 +40,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ossan.xml b/assets/xml/objects/object_ossan.xml index 7e51c33bce..909c7798fe 100644 --- a/assets/xml/objects/object_ossan.xml +++ b/assets/xml/objects/object_ossan.xml @@ -4,13 +4,66 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ouke_haka.xml b/assets/xml/objects/object_ouke_haka.xml index 11da9b26ef..26b9788cc2 100644 --- a/assets/xml/objects/object_ouke_haka.xml +++ b/assets/xml/objects/object_ouke_haka.xml @@ -1,6 +1,9 @@ + + + - + diff --git a/assets/xml/objects/object_owl.xml b/assets/xml/objects/object_owl.xml index 24be378985..36011ecd29 100644 --- a/assets/xml/objects/object_owl.xml +++ b/assets/xml/objects/object_owl.xml @@ -59,13 +59,51 @@ - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_peehat.xml b/assets/xml/objects/object_peehat.xml index 42ee66cdef..98737cff33 100644 --- a/assets/xml/objects/object_peehat.xml +++ b/assets/xml/objects/object_peehat.xml @@ -28,6 +28,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,10 +65,10 @@ - - - - + + + + diff --git a/assets/xml/objects/object_po_composer.xml b/assets/xml/objects/object_po_composer.xml index 2ab8d64d85..cb08b64b06 100644 --- a/assets/xml/objects/object_po_composer.xml +++ b/assets/xml/objects/object_po_composer.xml @@ -1,4 +1,5 @@ + @@ -6,11 +7,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_po_field.xml b/assets/xml/objects/object_po_field.xml index 10b402e2c7..aa9b96b9d5 100644 --- a/assets/xml/objects/object_po_field.xml +++ b/assets/xml/objects/object_po_field.xml @@ -1,4 +1,5 @@ + @@ -6,15 +7,88 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_po_sisters.xml b/assets/xml/objects/object_po_sisters.xml index 7752843444..f82b24286a 100644 --- a/assets/xml/objects/object_po_sisters.xml +++ b/assets/xml/objects/object_po_sisters.xml @@ -7,22 +7,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_poh.xml b/assets/xml/objects/object_poh.xml index 009d0fca3f..30cd1c4a62 100644 --- a/assets/xml/objects/object_poh.xml +++ b/assets/xml/objects/object_poh.xml @@ -1,4 +1,5 @@ + @@ -6,9 +7,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ps.xml b/assets/xml/objects/object_ps.xml index 043e232d64..cf875572e2 100644 --- a/assets/xml/objects/object_ps.xml +++ b/assets/xml/objects/object_ps.xml @@ -1,17 +1,96 @@ + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_pu_box.xml b/assets/xml/objects/object_pu_box.xml index e1d686e979..0535781401 100644 --- a/assets/xml/objects/object_pu_box.xml +++ b/assets/xml/objects/object_pu_box.xml @@ -8,6 +8,6 @@ - + diff --git a/assets/xml/objects/object_rd.xml b/assets/xml/objects/object_rd.xml index 22c7d33738..c7e8de8a32 100644 --- a/assets/xml/objects/object_rd.xml +++ b/assets/xml/objects/object_rd.xml @@ -2,8 +2,55 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -64,13 +111,60 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_reeba.xml b/assets/xml/objects/object_reeba.xml index 32c697bd9d..e8ac5c66e8 100644 --- a/assets/xml/objects/object_reeba.xml +++ b/assets/xml/objects/object_reeba.xml @@ -4,24 +4,59 @@ + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_relay_objects.xml b/assets/xml/objects/object_relay_objects.xml index 47b92fcd2d..fafa93da7c 100644 --- a/assets/xml/objects/object_relay_objects.xml +++ b/assets/xml/objects/object_relay_objects.xml @@ -1,16 +1,22 @@ - + + + + + + + - + - - - + + + diff --git a/assets/xml/objects/object_rl.xml b/assets/xml/objects/object_rl.xml index 8453935b1f..9f30bbd899 100644 --- a/assets/xml/objects/object_rl.xml +++ b/assets/xml/objects/object_rl.xml @@ -3,6 +3,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -11,27 +35,32 @@ - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/xml/objects/object_rr.xml b/assets/xml/objects/object_rr.xml index 98726b14bb..43e7330ea8 100644 --- a/assets/xml/objects/object_rr.xml +++ b/assets/xml/objects/object_rr.xml @@ -1,8 +1,11 @@ + + + - - - + + + diff --git a/assets/xml/objects/object_rs.xml b/assets/xml/objects/object_rs.xml index a5f7536590..503033cf32 100644 --- a/assets/xml/objects/object_rs.xml +++ b/assets/xml/objects/object_rs.xml @@ -2,6 +2,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -11,16 +35,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/assets/xml/objects/object_ru1.xml b/assets/xml/objects/object_ru1.xml index 482949c903..df982f447e 100644 --- a/assets/xml/objects/object_ru1.xml +++ b/assets/xml/objects/object_ru1.xml @@ -18,11 +18,57 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,27 +85,27 @@ - - + + - - - - - - + + + + + + - + - - - + + + - - - - - + + + + + diff --git a/assets/xml/objects/object_ru2.xml b/assets/xml/objects/object_ru2.xml index d6cea22915..01d85915d2 100644 --- a/assets/xml/objects/object_ru2.xml +++ b/assets/xml/objects/object_ru2.xml @@ -27,6 +27,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51,32 +116,34 @@ - - + + - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_sa.xml b/assets/xml/objects/object_sa.xml index e87cd793dd..fbc29d6f72 100644 --- a/assets/xml/objects/object_sa.xml +++ b/assets/xml/objects/object_sa.xml @@ -49,6 +49,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -66,34 +115,35 @@ - - - - + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_sb.xml b/assets/xml/objects/object_sb.xml index 3adf2c17ee..e79cef0065 100644 --- a/assets/xml/objects/object_sb.xml +++ b/assets/xml/objects/object_sb.xml @@ -1,4 +1,5 @@ + @@ -9,14 +10,20 @@ - - - - - + + + + + + + + + + + - + diff --git a/assets/xml/objects/object_sd.xml b/assets/xml/objects/object_sd.xml index 0228b48690..d95d5d513f 100644 --- a/assets/xml/objects/object_sd.xml +++ b/assets/xml/objects/object_sd.xml @@ -25,6 +25,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,28 +92,28 @@ - + - - - + + + - - + + - - - - - - - - - - + + + + + + + + + + - + diff --git a/assets/xml/objects/object_shop_dungen.xml b/assets/xml/objects/object_shop_dungen.xml index 027207402c..3c52d0a039 100644 --- a/assets/xml/objects/object_shop_dungen.xml +++ b/assets/xml/objects/object_shop_dungen.xml @@ -1,10 +1,16 @@ + + + - - - + + + + + + - + diff --git a/assets/xml/objects/object_shopnuts.xml b/assets/xml/objects/object_shopnuts.xml index 105ce88247..5ee09fee80 100644 --- a/assets/xml/objects/object_shopnuts.xml +++ b/assets/xml/objects/object_shopnuts.xml @@ -22,6 +22,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -42,13 +98,13 @@ - - - - - - - + + + + + + + diff --git a/assets/xml/objects/object_siofuki.xml b/assets/xml/objects/object_siofuki.xml index a23240a728..2932879233 100644 --- a/assets/xml/objects/object_siofuki.xml +++ b/assets/xml/objects/object_siofuki.xml @@ -1,6 +1,10 @@ + - + + + + diff --git a/assets/xml/objects/object_sk2.xml b/assets/xml/objects/object_sk2.xml index f2e7ef6d89..87e7a37831 100644 --- a/assets/xml/objects/object_sk2.xml +++ b/assets/xml/objects/object_sk2.xml @@ -1,5 +1,79 @@  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -27,19 +101,19 @@ - - - - - - - - + + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_skb.xml b/assets/xml/objects/object_skb.xml index 1220ddf6d9..a7d5798c61 100644 --- a/assets/xml/objects/object_skb.xml +++ b/assets/xml/objects/object_skb.xml @@ -24,6 +24,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -44,15 +97,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/assets/xml/objects/object_skj.xml b/assets/xml/objects/object_skj.xml index 958301d2e8..ec07397ac7 100644 --- a/assets/xml/objects/object_skj.xml +++ b/assets/xml/objects/object_skj.xml @@ -23,6 +23,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -58,8 +117,19 @@ - - - + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_spot00_break.xml b/assets/xml/objects/object_spot00_break.xml index bee1361fab..67ec2ff956 100644 --- a/assets/xml/objects/object_spot00_break.xml +++ b/assets/xml/objects/object_spot00_break.xml @@ -1,13 +1,19 @@ + + + - - - + + + + + + - + diff --git a/assets/xml/objects/object_spot00_objects.xml b/assets/xml/objects/object_spot00_objects.xml index 10fb13aeac..2126eddce3 100644 --- a/assets/xml/objects/object_spot00_objects.xml +++ b/assets/xml/objects/object_spot00_objects.xml @@ -1,14 +1,20 @@ + + + - - + + + + + - + diff --git a/assets/xml/objects/object_spot01_matoya.xml b/assets/xml/objects/object_spot01_matoya.xml index d44b944e0e..825eb31bdd 100644 --- a/assets/xml/objects/object_spot01_matoya.xml +++ b/assets/xml/objects/object_spot01_matoya.xml @@ -1,30 +1,46 @@ + + + + + + - - - - - + + + + + + + + - + + + + - + + + + - + - - + + + diff --git a/assets/xml/objects/object_spot01_matoyab.xml b/assets/xml/objects/object_spot01_matoyab.xml index 720f50cd3e..3a4179dfa2 100644 --- a/assets/xml/objects/object_spot01_matoyab.xml +++ b/assets/xml/objects/object_spot01_matoyab.xml @@ -4,15 +4,16 @@ - + - - - - - + + + + + + diff --git a/assets/xml/objects/object_spot01_objects.xml b/assets/xml/objects/object_spot01_objects.xml index 413e032a9c..c976129d24 100644 --- a/assets/xml/objects/object_spot01_objects.xml +++ b/assets/xml/objects/object_spot01_objects.xml @@ -2,15 +2,15 @@ - + - + - + diff --git a/assets/xml/objects/object_spot02_objects.xml b/assets/xml/objects/object_spot02_objects.xml index 3dfaf227d3..04ac2476c5 100644 --- a/assets/xml/objects/object_spot02_objects.xml +++ b/assets/xml/objects/object_spot02_objects.xml @@ -1,7 +1,7 @@ - - + + @@ -12,32 +12,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_spot03_object.xml b/assets/xml/objects/object_spot03_object.xml index f182e7d99a..cf3b709b2b 100644 --- a/assets/xml/objects/object_spot03_object.xml +++ b/assets/xml/objects/object_spot03_object.xml @@ -1,6 +1,6 @@ - + @@ -10,7 +10,10 @@ - + + + + diff --git a/assets/xml/objects/object_spot04_objects.xml b/assets/xml/objects/object_spot04_objects.xml index 66293d7523..8c2e62b066 100644 --- a/assets/xml/objects/object_spot04_objects.xml +++ b/assets/xml/objects/object_spot04_objects.xml @@ -1,9 +1,12 @@ - - - - + + + + + + + diff --git a/assets/xml/objects/object_spot05_objects.xml b/assets/xml/objects/object_spot05_objects.xml index 6e70791493..cd7a4995e0 100644 --- a/assets/xml/objects/object_spot05_objects.xml +++ b/assets/xml/objects/object_spot05_objects.xml @@ -1,9 +1,15 @@ - + + + + - + + + + diff --git a/assets/xml/objects/object_spot06_objects.xml b/assets/xml/objects/object_spot06_objects.xml index 5084fd244e..102772cd6c 100644 --- a/assets/xml/objects/object_spot06_objects.xml +++ b/assets/xml/objects/object_spot06_objects.xml @@ -5,20 +5,20 @@ - + - + - + - + diff --git a/assets/xml/objects/object_spot07_object.xml b/assets/xml/objects/object_spot07_object.xml index 5bc2bfb6bf..5477e187ea 100644 --- a/assets/xml/objects/object_spot07_object.xml +++ b/assets/xml/objects/object_spot07_object.xml @@ -1,23 +1,41 @@ + + + + + + - - + + + + + + + + - - + + + + + + + + - - - - - - - + + + + + + + diff --git a/assets/xml/objects/object_spot08_obj.xml b/assets/xml/objects/object_spot08_obj.xml index 8d2aa760ce..f0d76701e7 100644 --- a/assets/xml/objects/object_spot08_obj.xml +++ b/assets/xml/objects/object_spot08_obj.xml @@ -2,26 +2,26 @@ - - - - - + + + + + - - - - - + + + + + - - + + diff --git a/assets/xml/objects/object_spot09_obj.xml b/assets/xml/objects/object_spot09_obj.xml index b4d9ae42a1..d86cf59874 100644 --- a/assets/xml/objects/object_spot09_obj.xml +++ b/assets/xml/objects/object_spot09_obj.xml @@ -10,5 +10,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_spot11_obj.xml b/assets/xml/objects/object_spot11_obj.xml index 257298f7cc..4ce3bdcb2e 100644 --- a/assets/xml/objects/object_spot11_obj.xml +++ b/assets/xml/objects/object_spot11_obj.xml @@ -1,8 +1,14 @@ - + + + + - + + + + diff --git a/assets/xml/objects/object_spot12_obj.xml b/assets/xml/objects/object_spot12_obj.xml index d619c781e4..4bdf8dce11 100644 --- a/assets/xml/objects/object_spot12_obj.xml +++ b/assets/xml/objects/object_spot12_obj.xml @@ -2,12 +2,12 @@ - + - + diff --git a/assets/xml/objects/object_spot15_obj.xml b/assets/xml/objects/object_spot15_obj.xml index bd59b8cd18..e1544bebd9 100644 --- a/assets/xml/objects/object_spot15_obj.xml +++ b/assets/xml/objects/object_spot15_obj.xml @@ -2,12 +2,12 @@ - + - + diff --git a/assets/xml/objects/object_spot16_obj.xml b/assets/xml/objects/object_spot16_obj.xml index b7a6ff4d54..88af8eeb7b 100644 --- a/assets/xml/objects/object_spot16_obj.xml +++ b/assets/xml/objects/object_spot16_obj.xml @@ -4,8 +4,8 @@ - - + + diff --git a/assets/xml/objects/object_spot17_obj.xml b/assets/xml/objects/object_spot17_obj.xml index 73a4ca5203..54151b4cd8 100644 --- a/assets/xml/objects/object_spot17_obj.xml +++ b/assets/xml/objects/object_spot17_obj.xml @@ -1,12 +1,21 @@ - - + + + + + + + + + + + - - + + diff --git a/assets/xml/objects/object_spot18_obj.xml b/assets/xml/objects/object_spot18_obj.xml index cc12b78946..ca9d6ea485 100644 --- a/assets/xml/objects/object_spot18_obj.xml +++ b/assets/xml/objects/object_spot18_obj.xml @@ -8,23 +8,23 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ssh.xml b/assets/xml/objects/object_ssh.xml index 6283f8e9f2..2aebe9f949 100644 --- a/assets/xml/objects/object_ssh.xml +++ b/assets/xml/objects/object_ssh.xml @@ -1,17 +1,56 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_sst.xml b/assets/xml/objects/object_sst.xml index c142c50f43..12f27e4321 100644 --- a/assets/xml/objects/object_sst.xml +++ b/assets/xml/objects/object_sst.xml @@ -1,7 +1,8 @@ + - + @@ -49,7 +50,7 @@ - - + + diff --git a/assets/xml/objects/object_sst_pal.xml b/assets/xml/objects/object_sst_pal.xml index 9a9199b58f..fdbe2e799c 100644 --- a/assets/xml/objects/object_sst_pal.xml +++ b/assets/xml/objects/object_sst_pal.xml @@ -1,7 +1,8 @@ + - + @@ -49,7 +50,7 @@ - - + + diff --git a/assets/xml/objects/object_st.xml b/assets/xml/objects/object_st.xml index 9556f081d0..42a586987d 100644 --- a/assets/xml/objects/object_st.xml +++ b/assets/xml/objects/object_st.xml @@ -1,13 +1,44 @@ + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -18,10 +49,10 @@ - - - - + + + + @@ -35,6 +66,12 @@ + + + + + + diff --git a/assets/xml/objects/object_stream.xml b/assets/xml/objects/object_stream.xml index 59b0838e47..fb2cef4da6 100644 --- a/assets/xml/objects/object_stream.xml +++ b/assets/xml/objects/object_stream.xml @@ -1,6 +1,10 @@ + - + + + + diff --git a/assets/xml/objects/object_syokudai.xml b/assets/xml/objects/object_syokudai.xml index 11af7e9a3a..6c919ad46f 100644 --- a/assets/xml/objects/object_syokudai.xml +++ b/assets/xml/objects/object_syokudai.xml @@ -1,13 +1,22 @@ - + + + + + + + + + + - - - - - + + + + + diff --git a/assets/xml/objects/object_ta.xml b/assets/xml/objects/object_ta.xml index 4f339fc951..d73e28972a 100644 --- a/assets/xml/objects/object_ta.xml +++ b/assets/xml/objects/object_ta.xml @@ -25,6 +25,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40,32 +87,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_timeblock.xml b/assets/xml/objects/object_timeblock.xml index 1d6b9e698c..cfc47d3fe1 100644 --- a/assets/xml/objects/object_timeblock.xml +++ b/assets/xml/objects/object_timeblock.xml @@ -1,7 +1,7 @@ - + diff --git a/assets/xml/objects/object_tite.xml b/assets/xml/objects/object_tite.xml index 1be65c4950..c01d117df4 100644 --- a/assets/xml/objects/object_tite.xml +++ b/assets/xml/objects/object_tite.xml @@ -9,14 +9,41 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_tk.xml b/assets/xml/objects/object_tk.xml index 5c9d0a0a6f..85b97e0b3e 100644 --- a/assets/xml/objects/object_tk.xml +++ b/assets/xml/objects/object_tk.xml @@ -5,16 +5,130 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_toki_objects.xml b/assets/xml/objects/object_toki_objects.xml index 3cada31f89..f539558f9b 100644 --- a/assets/xml/objects/object_toki_objects.xml +++ b/assets/xml/objects/object_toki_objects.xml @@ -1,26 +1,57 @@  + - + + + + + + + - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_torch2.xml b/assets/xml/objects/object_torch2.xml index ec55bbe26d..09d9ff8a40 100644 --- a/assets/xml/objects/object_torch2.xml +++ b/assets/xml/objects/object_torch2.xml @@ -7,5 +7,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_toryo.xml b/assets/xml/objects/object_toryo.xml index 73f3dcb1e2..f04c57f358 100644 --- a/assets/xml/objects/object_toryo.xml +++ b/assets/xml/objects/object_toryo.xml @@ -1,21 +1,69 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_tp.xml b/assets/xml/objects/object_tp.xml index 8ea908825e..62abff312c 100644 --- a/assets/xml/objects/object_tp.xml +++ b/assets/xml/objects/object_tp.xml @@ -1,17 +1,26 @@ - + + + + + + + + + + - - - - - + + + + + diff --git a/assets/xml/objects/object_tr.xml b/assets/xml/objects/object_tr.xml index 827b85bfe6..30978596d5 100644 --- a/assets/xml/objects/object_tr.xml +++ b/assets/xml/objects/object_tr.xml @@ -31,26 +31,53 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,11 +88,11 @@ - + - + @@ -121,10 +148,37 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -135,7 +189,7 @@ - + diff --git a/assets/xml/objects/object_trap.xml b/assets/xml/objects/object_trap.xml index 56195cf41b..d250939feb 100644 --- a/assets/xml/objects/object_trap.xml +++ b/assets/xml/objects/object_trap.xml @@ -1,9 +1,10 @@ + - - - - + + + + diff --git a/assets/xml/objects/object_triforce_spot.xml b/assets/xml/objects/object_triforce_spot.xml index a9d52dd963..f645f2859f 100644 --- a/assets/xml/objects/object_triforce_spot.xml +++ b/assets/xml/objects/object_triforce_spot.xml @@ -1,14 +1,16 @@ - + + + + - - - - + + + diff --git a/assets/xml/objects/object_ts.xml b/assets/xml/objects/object_ts.xml index 567277bc39..9fd3327fa5 100644 --- a/assets/xml/objects/object_ts.xml +++ b/assets/xml/objects/object_ts.xml @@ -1,16 +1,43 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_tsubo.xml b/assets/xml/objects/object_tsubo.xml index ee2c5e1846..ccfe70c7e3 100644 --- a/assets/xml/objects/object_tsubo.xml +++ b/assets/xml/objects/object_tsubo.xml @@ -1,9 +1,15 @@ - - - + + + + + + + + + diff --git a/assets/xml/objects/object_tw.xml b/assets/xml/objects/object_tw.xml index c528fb4518..e99bd2c2aa 100644 --- a/assets/xml/objects/object_tw.xml +++ b/assets/xml/objects/object_tw.xml @@ -51,30 +51,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -129,8 +129,8 @@ - - + + @@ -155,32 +155,32 @@ - + - + - - + + - + - - + + - + @@ -192,7 +192,7 @@ - + @@ -203,16 +203,16 @@ - - + + - - + + - - + + @@ -225,19 +225,19 @@ - + - + - + @@ -276,7 +276,7 @@ - + @@ -286,11 +286,11 @@ - - - - - + + + + + @@ -323,16 +323,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -354,7 +354,7 @@ - + @@ -416,6 +416,6 @@ - + diff --git a/assets/xml/objects/object_tw_pal.xml b/assets/xml/objects/object_tw_pal.xml index 126926356f..e77e3c247e 100644 --- a/assets/xml/objects/object_tw_pal.xml +++ b/assets/xml/objects/object_tw_pal.xml @@ -51,30 +51,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -127,8 +127,8 @@ - - + + @@ -151,32 +151,32 @@ - + - + - - + + - + - - + + - + @@ -188,7 +188,7 @@ - + @@ -199,16 +199,16 @@ - - + + - - + + - - + + @@ -221,19 +221,19 @@ - + - + - + @@ -272,7 +272,7 @@ - + @@ -282,11 +282,11 @@ - - - - - + + + + + @@ -319,16 +319,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -350,7 +350,7 @@ - + @@ -412,6 +412,6 @@ - + diff --git a/assets/xml/objects/object_umajump.xml b/assets/xml/objects/object_umajump.xml index 2ee4ade46a..5a371dc82d 100644 --- a/assets/xml/objects/object_umajump.xml +++ b/assets/xml/objects/object_umajump.xml @@ -1,7 +1,10 @@ - - + + + + + diff --git a/assets/xml/objects/object_vali.xml b/assets/xml/objects/object_vali.xml index 2bab5efaa6..5e511a1494 100644 --- a/assets/xml/objects/object_vali.xml +++ b/assets/xml/objects/object_vali.xml @@ -7,6 +7,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -23,11 +64,11 @@ - - - - - + + + + + diff --git a/assets/xml/objects/object_vase.xml b/assets/xml/objects/object_vase.xml index 091d4c51e3..ddb61620c5 100644 --- a/assets/xml/objects/object_vase.xml +++ b/assets/xml/objects/object_vase.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/objects/object_vm.xml b/assets/xml/objects/object_vm.xml index c5b949b36e..88f23bbeb8 100644 --- a/assets/xml/objects/object_vm.xml +++ b/assets/xml/objects/object_vm.xml @@ -15,6 +15,20 @@ + + + + + + + + + + + + + + @@ -22,20 +36,23 @@ - - - - - - - - - + + + + + + + + + - + + + + diff --git a/assets/xml/objects/object_wallmaster.xml b/assets/xml/objects/object_wallmaster.xml index fbbc4f4af3..f6729fbe28 100644 --- a/assets/xml/objects/object_wallmaster.xml +++ b/assets/xml/objects/object_wallmaster.xml @@ -12,13 +12,13 @@ - - - - - - - + + + + + + + @@ -31,5 +31,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_warp1.xml b/assets/xml/objects/object_warp1.xml index 1497d7a108..f640333691 100644 --- a/assets/xml/objects/object_warp1.xml +++ b/assets/xml/objects/object_warp1.xml @@ -1,10 +1,34 @@ + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -12,7 +36,7 @@ - + diff --git a/assets/xml/objects/object_wf.xml b/assets/xml/objects/object_wf.xml index d5d70639d7..cd9a297c9e 100644 --- a/assets/xml/objects/object_wf.xml +++ b/assets/xml/objects/object_wf.xml @@ -1,12 +1,54 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -22,9 +64,24 @@ - - + + + + + + + + + + + + + + + + + @@ -64,6 +121,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -79,17 +178,32 @@ - + - - - - - + + + + + - - + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_wood02.xml b/assets/xml/objects/object_wood02.xml index bdcc2d2e38..acb18fb57e 100644 --- a/assets/xml/objects/object_wood02.xml +++ b/assets/xml/objects/object_wood02.xml @@ -1,33 +1,78 @@ - + + + + + + + + + + + + + - + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_xc.xml b/assets/xml/objects/object_xc.xml index 7a69f52f38..fbc458058f 100644 --- a/assets/xml/objects/object_xc.xml +++ b/assets/xml/objects/object_xc.xml @@ -8,7 +8,7 @@ - + @@ -22,10 +22,10 @@ - - - - + + + + diff --git a/assets/xml/objects/object_xc_pal.xml b/assets/xml/objects/object_xc_pal.xml index 7fae3a0875..5576e4740d 100644 --- a/assets/xml/objects/object_xc_pal.xml +++ b/assets/xml/objects/object_xc_pal.xml @@ -8,7 +8,7 @@ - + @@ -22,10 +22,10 @@ - - - - + + + + diff --git a/assets/xml/objects/object_yabusame_point.xml b/assets/xml/objects/object_yabusame_point.xml index bed9e8a609..33e4237897 100644 --- a/assets/xml/objects/object_yabusame_point.xml +++ b/assets/xml/objects/object_yabusame_point.xml @@ -1,8 +1,11 @@ - - - + + + + + + diff --git a/assets/xml/objects/object_ydan_objects.xml b/assets/xml/objects/object_ydan_objects.xml index baf7ca4c9c..b779e46661 100644 --- a/assets/xml/objects/object_ydan_objects.xml +++ b/assets/xml/objects/object_ydan_objects.xml @@ -1,19 +1,23 @@ + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_yukabyun.xml b/assets/xml/objects/object_yukabyun.xml index d594ebbb89..d03c960175 100644 --- a/assets/xml/objects/object_yukabyun.xml +++ b/assets/xml/objects/object_yukabyun.xml @@ -1,8 +1,8 @@ - - - + + + diff --git a/assets/xml/objects/object_zf.xml b/assets/xml/objects/object_zf.xml index 7f20eb7866..3a64ee7266 100644 --- a/assets/xml/objects/object_zf.xml +++ b/assets/xml/objects/object_zf.xml @@ -1,15 +1,76 @@ + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -86,39 +147,105 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_zg.xml b/assets/xml/objects/object_zg.xml index 79005516c4..3aa2c142ab 100644 --- a/assets/xml/objects/object_zg.xml +++ b/assets/xml/objects/object_zg.xml @@ -1,7 +1,10 @@ - - + + + + + diff --git a/assets/xml/objects/object_zl1.xml b/assets/xml/objects/object_zl1.xml index 1b83550605..0ba5fdde0f 100644 --- a/assets/xml/objects/object_zl1.xml +++ b/assets/xml/objects/object_zl1.xml @@ -22,6 +22,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -41,61 +92,68 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - - - + + + + diff --git a/assets/xml/objects/object_zl2.xml b/assets/xml/objects/object_zl2.xml index 2503b811d3..51e18228ea 100644 --- a/assets/xml/objects/object_zl2.xml +++ b/assets/xml/objects/object_zl2.xml @@ -4,41 +4,100 @@ - - - - - - - - - - + + + + + + + + + + - + - - - - + + + + - + - - - - - - - - + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_zl4.xml b/assets/xml/objects/object_zl4.xml index 99cc12ea2a..211c8339e2 100644 --- a/assets/xml/objects/object_zl4.xml +++ b/assets/xml/objects/object_zl4.xml @@ -40,23 +40,86 @@ - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_zo.xml b/assets/xml/objects/object_zo.xml index 77465760ef..45c9601284 100644 --- a/assets/xml/objects/object_zo.xml +++ b/assets/xml/objects/object_zo.xml @@ -1,55 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -59,27 +117,33 @@ - - - + + + - - - - - - + + + + + + - + - + + + + - + + + + diff --git a/assets/xml/overlays/ovl_Arrow_Fire.xml b/assets/xml/overlays/ovl_Arrow_Fire.xml index 061e11f84b..58e8853f7f 100644 --- a/assets/xml/overlays/ovl_Arrow_Fire.xml +++ b/assets/xml/overlays/ovl_Arrow_Fire.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/overlays/ovl_Arrow_Ice.xml b/assets/xml/overlays/ovl_Arrow_Ice.xml index d2a0df3be8..d7657506b1 100644 --- a/assets/xml/overlays/ovl_Arrow_Ice.xml +++ b/assets/xml/overlays/ovl_Arrow_Ice.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/overlays/ovl_Arrow_Light.xml b/assets/xml/overlays/ovl_Arrow_Light.xml index 1f449dd7b9..101e37f227 100644 --- a/assets/xml/overlays/ovl_Arrow_Light.xml +++ b/assets/xml/overlays/ovl_Arrow_Light.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml b/assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml index 7b294e65b2..dd87558e16 100644 --- a/assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml +++ b/assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml @@ -1,6 +1,6 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/assets/xml/overlays/ovl_Boss_Dodongo.xml b/assets/xml/overlays/ovl_Boss_Dodongo.xml index 78d2f8e5b3..9b65f1f181 100644 --- a/assets/xml/overlays/ovl_Boss_Dodongo.xml +++ b/assets/xml/overlays/ovl_Boss_Dodongo.xml @@ -1,6 +1,6 @@ - - + + diff --git a/assets/xml/overlays/ovl_Boss_Ganon.xml b/assets/xml/overlays/ovl_Boss_Ganon.xml index a6ed9c66eb..229ab58e1b 100644 --- a/assets/xml/overlays/ovl_Boss_Ganon.xml +++ b/assets/xml/overlays/ovl_Boss_Ganon.xml @@ -1,19 +1,20 @@ + - - - - - - - - - - - - + + + + + + + + + + + + - + diff --git a/assets/xml/overlays/ovl_Boss_Ganon2.xml b/assets/xml/overlays/ovl_Boss_Ganon2.xml index 00f985786c..6b92b19a09 100644 --- a/assets/xml/overlays/ovl_Boss_Ganon2.xml +++ b/assets/xml/overlays/ovl_Boss_Ganon2.xml @@ -1,28 +1,29 @@ + - + - - + + - + - + - + - + - + - - + + diff --git a/assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml b/assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml index b8c0613ee4..f35bd62a15 100644 --- a/assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml +++ b/assets/xml/overlays/ovl_Effect_Ss_Fhg_Flash.xml @@ -4,6 +4,6 @@ - + diff --git a/assets/xml/overlays/ovl_En_Ganon_Mant.xml b/assets/xml/overlays/ovl_En_Ganon_Mant.xml index a9242f1781..219729809c 100644 --- a/assets/xml/overlays/ovl_En_Ganon_Mant.xml +++ b/assets/xml/overlays/ovl_En_Ganon_Mant.xml @@ -1,8 +1,8 @@ - + - + diff --git a/assets/xml/overlays/ovl_En_Ganon_Organ.xml b/assets/xml/overlays/ovl_En_Ganon_Organ.xml index 05257fb6f6..639d68ad38 100644 --- a/assets/xml/overlays/ovl_En_Ganon_Organ.xml +++ b/assets/xml/overlays/ovl_En_Ganon_Organ.xml @@ -1,17 +1,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/assets/xml/overlays/ovl_En_Jsjutan.xml b/assets/xml/overlays/ovl_En_Jsjutan.xml index b3b012b1f5..f535ce9292 100644 --- a/assets/xml/overlays/ovl_En_Jsjutan.xml +++ b/assets/xml/overlays/ovl_En_Jsjutan.xml @@ -1,7 +1,7 @@ - + @@ -16,9 +16,6 @@ - - - diff --git a/assets/xml/overlays/ovl_En_Mag_ique.xml b/assets/xml/overlays/ovl_En_Mag_ique.xml index bd239b7f0c..da89ca042e 100644 --- a/assets/xml/overlays/ovl_En_Mag_ique.xml +++ b/assets/xml/overlays/ovl_En_Mag_ique.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/overlays/ovl_En_Sth.xml b/assets/xml/overlays/ovl_En_Sth.xml index 46a30a7185..93d211cb99 100644 --- a/assets/xml/overlays/ovl_En_Sth.xml +++ b/assets/xml/overlays/ovl_En_Sth.xml @@ -1,12 +1,12 @@ - - - - - - - + + + + + + + diff --git a/assets/xml/overlays/ovl_End_Title.xml b/assets/xml/overlays/ovl_End_Title.xml index 53d085681d..0f0bf74048 100644 --- a/assets/xml/overlays/ovl_End_Title.xml +++ b/assets/xml/overlays/ovl_End_Title.xml @@ -1,11 +1,11 @@ - - - - - - + + + + + + diff --git a/assets/xml/overlays/ovl_End_Title_ique.xml b/assets/xml/overlays/ovl_End_Title_ique.xml index 300448cabf..89f6f77847 100644 --- a/assets/xml/overlays/ovl_End_Title_ique.xml +++ b/assets/xml/overlays/ovl_End_Title_ique.xml @@ -1,20 +1,20 @@ - - + + - + - + - + - + - + - + diff --git a/assets/xml/overlays/ovl_Magic_Dark.xml b/assets/xml/overlays/ovl_Magic_Dark.xml index 965d140db4..640642adb6 100644 --- a/assets/xml/overlays/ovl_Magic_Dark.xml +++ b/assets/xml/overlays/ovl_Magic_Dark.xml @@ -1,6 +1,7 @@ + - + diff --git a/assets/xml/overlays/ovl_Magic_Fire.xml b/assets/xml/overlays/ovl_Magic_Fire.xml index 81de7a989f..fb9282a816 100644 --- a/assets/xml/overlays/ovl_Magic_Fire.xml +++ b/assets/xml/overlays/ovl_Magic_Fire.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/overlays/ovl_Magic_Wind.xml b/assets/xml/overlays/ovl_Magic_Wind.xml index 7da59209b8..8a43d0a2fd 100644 --- a/assets/xml/overlays/ovl_Magic_Wind.xml +++ b/assets/xml/overlays/ovl_Magic_Wind.xml @@ -8,7 +8,7 @@ - + diff --git a/assets/xml/overlays/ovl_Oceff_Spot.xml b/assets/xml/overlays/ovl_Oceff_Spot.xml index 6c81549060..8d5b359938 100644 --- a/assets/xml/overlays/ovl_Oceff_Spot.xml +++ b/assets/xml/overlays/ovl_Oceff_Spot.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/overlays/ovl_Oceff_Storm.xml b/assets/xml/overlays/ovl_Oceff_Storm.xml index 385f56dbff..7cdb735909 100644 --- a/assets/xml/overlays/ovl_Oceff_Storm.xml +++ b/assets/xml/overlays/ovl_Oceff_Storm.xml @@ -1,6 +1,7 @@ + - + diff --git a/assets/xml/overlays/ovl_Oceff_Wipe.xml b/assets/xml/overlays/ovl_Oceff_Wipe.xml index 64b3f1332e..0ed7257bf8 100644 --- a/assets/xml/overlays/ovl_Oceff_Wipe.xml +++ b/assets/xml/overlays/ovl_Oceff_Wipe.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/overlays/ovl_Oceff_Wipe2.xml b/assets/xml/overlays/ovl_Oceff_Wipe2.xml index 0166d1909f..c2db2a6b11 100644 --- a/assets/xml/overlays/ovl_Oceff_Wipe2.xml +++ b/assets/xml/overlays/ovl_Oceff_Wipe2.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/overlays/ovl_Oceff_Wipe3.xml b/assets/xml/overlays/ovl_Oceff_Wipe3.xml index d797d1675f..6d8a1fea84 100644 --- a/assets/xml/overlays/ovl_Oceff_Wipe3.xml +++ b/assets/xml/overlays/ovl_Oceff_Wipe3.xml @@ -1,6 +1,6 @@ - + diff --git a/assets/xml/overlays/ovl_Oceff_Wipe4.xml b/assets/xml/overlays/ovl_Oceff_Wipe4.xml index 6446beedb2..0aa0c729f6 100644 --- a/assets/xml/overlays/ovl_Oceff_Wipe4.xml +++ b/assets/xml/overlays/ovl_Oceff_Wipe4.xml @@ -1,6 +1,7 @@ + - + diff --git a/assets/xml/scenes/dungeons/Bmori1.xml b/assets/xml/scenes/dungeons/Bmori1.xml index 70aac34646..8b35f856d2 100644 --- a/assets/xml/scenes/dungeons/Bmori1.xml +++ b/assets/xml/scenes/dungeons/Bmori1.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/scenes/dungeons/Bmori1_mq.xml b/assets/xml/scenes/dungeons/Bmori1_mq.xml index 70aac34646..8b35f856d2 100644 --- a/assets/xml/scenes/dungeons/Bmori1_mq.xml +++ b/assets/xml/scenes/dungeons/Bmori1_mq.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/scenes/dungeons/MIZUsin.xml b/assets/xml/scenes/dungeons/MIZUsin.xml index e48f534d88..8ebcd35476 100644 --- a/assets/xml/scenes/dungeons/MIZUsin.xml +++ b/assets/xml/scenes/dungeons/MIZUsin.xml @@ -1,12 +1,13 @@ - - + + + diff --git a/assets/xml/scenes/dungeons/MIZUsin_mq.xml b/assets/xml/scenes/dungeons/MIZUsin_mq.xml index bd0e260ace..6ff9ea461c 100644 --- a/assets/xml/scenes/dungeons/MIZUsin_mq.xml +++ b/assets/xml/scenes/dungeons/MIZUsin_mq.xml @@ -1,12 +1,13 @@ - - + + + diff --git a/assets/xml/scenes/dungeons/ddan.xml b/assets/xml/scenes/dungeons/ddan.xml index d78f8dabee..9a7a29995f 100644 --- a/assets/xml/scenes/dungeons/ddan.xml +++ b/assets/xml/scenes/dungeons/ddan.xml @@ -1,24 +1,25 @@ - - + + - - - - - - - - + + + + + + + + + diff --git a/assets/xml/scenes/dungeons/ddan_boss.xml b/assets/xml/scenes/dungeons/ddan_boss.xml index 86a34e6d9a..5e8d324d9a 100644 --- a/assets/xml/scenes/dungeons/ddan_boss.xml +++ b/assets/xml/scenes/dungeons/ddan_boss.xml @@ -6,7 +6,7 @@ - + diff --git a/assets/xml/scenes/dungeons/ddan_boss_v2.xml b/assets/xml/scenes/dungeons/ddan_boss_v2.xml index 2b61024906..0e93072588 100644 --- a/assets/xml/scenes/dungeons/ddan_boss_v2.xml +++ b/assets/xml/scenes/dungeons/ddan_boss_v2.xml @@ -6,7 +6,7 @@ - + diff --git a/assets/xml/scenes/dungeons/ddan_mq.xml b/assets/xml/scenes/dungeons/ddan_mq.xml index d78f8dabee..9a7a29995f 100644 --- a/assets/xml/scenes/dungeons/ddan_mq.xml +++ b/assets/xml/scenes/dungeons/ddan_mq.xml @@ -1,24 +1,25 @@ - - + + - - - - - - - - + + + + + + + + + diff --git a/assets/xml/scenes/dungeons/gerudoway.xml b/assets/xml/scenes/dungeons/gerudoway.xml index d6abe7ed05..c42df3370b 100644 --- a/assets/xml/scenes/dungeons/gerudoway.xml +++ b/assets/xml/scenes/dungeons/gerudoway.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/scenes/dungeons/ice_doukutu.xml b/assets/xml/scenes/dungeons/ice_doukutu.xml index f816d7ca24..3a1f53b168 100644 --- a/assets/xml/scenes/dungeons/ice_doukutu.xml +++ b/assets/xml/scenes/dungeons/ice_doukutu.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/scenes/dungeons/ice_doukutu_mq.xml b/assets/xml/scenes/dungeons/ice_doukutu_mq.xml index a6e6b415df..ed80898b83 100644 --- a/assets/xml/scenes/dungeons/ice_doukutu_mq.xml +++ b/assets/xml/scenes/dungeons/ice_doukutu_mq.xml @@ -2,8 +2,8 @@ - - + + diff --git a/assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml b/assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml index 9f08f559ed..e811e8b709 100644 --- a/assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml +++ b/assets/xml/scenes/dungeons/ice_doukutu_pal_n64.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/scenes/dungeons/ice_doukutu_v2.xml b/assets/xml/scenes/dungeons/ice_doukutu_v2.xml index 4d25aa74f4..1ad4512abc 100644 --- a/assets/xml/scenes/dungeons/ice_doukutu_v2.xml +++ b/assets/xml/scenes/dungeons/ice_doukutu_v2.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/scenes/dungeons/jyasinzou.xml b/assets/xml/scenes/dungeons/jyasinzou.xml index 1a44e14d72..c51b943e88 100644 --- a/assets/xml/scenes/dungeons/jyasinzou.xml +++ b/assets/xml/scenes/dungeons/jyasinzou.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/scenes/dungeons/jyasinzou_mq.xml b/assets/xml/scenes/dungeons/jyasinzou_mq.xml index 6a99888abb..b95dce6bbd 100644 --- a/assets/xml/scenes/dungeons/jyasinzou_mq.xml +++ b/assets/xml/scenes/dungeons/jyasinzou_mq.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/scenes/dungeons/men.xml b/assets/xml/scenes/dungeons/men.xml index dc495b0c97..a99eb0ad84 100644 --- a/assets/xml/scenes/dungeons/men.xml +++ b/assets/xml/scenes/dungeons/men.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/scenes/dungeons/men_mq.xml b/assets/xml/scenes/dungeons/men_mq.xml index e87b44d8ea..a7426775f9 100644 --- a/assets/xml/scenes/dungeons/men_mq.xml +++ b/assets/xml/scenes/dungeons/men_mq.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/scenes/indoors/miharigoya.xml b/assets/xml/scenes/indoors/miharigoya.xml index 41ff2db9f9..5586c44953 100644 --- a/assets/xml/scenes/indoors/miharigoya.xml +++ b/assets/xml/scenes/indoors/miharigoya.xml @@ -1,9 +1,9 @@ - - - - + + + + diff --git a/assets/xml/scenes/indoors/souko.xml b/assets/xml/scenes/indoors/souko.xml index bc6336b360..0eca29e8e2 100644 --- a/assets/xml/scenes/indoors/souko.xml +++ b/assets/xml/scenes/indoors/souko.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot01.xml b/assets/xml/scenes/overworld/spot01.xml index 0074733cc4..2634dd5927 100644 --- a/assets/xml/scenes/overworld/spot01.xml +++ b/assets/xml/scenes/overworld/spot01.xml @@ -7,8 +7,8 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot01_pal_n64.xml b/assets/xml/scenes/overworld/spot01_pal_n64.xml index 8b2651c1ff..3b92309aea 100644 --- a/assets/xml/scenes/overworld/spot01_pal_n64.xml +++ b/assets/xml/scenes/overworld/spot01_pal_n64.xml @@ -7,8 +7,8 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot07.xml b/assets/xml/scenes/overworld/spot07.xml index 857cab9f01..770b598e03 100644 --- a/assets/xml/scenes/overworld/spot07.xml +++ b/assets/xml/scenes/overworld/spot07.xml @@ -3,8 +3,8 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot07_pal_n64.xml b/assets/xml/scenes/overworld/spot07_pal_n64.xml index f856e54438..fcb4c8c7b9 100644 --- a/assets/xml/scenes/overworld/spot07_pal_n64.xml +++ b/assets/xml/scenes/overworld/spot07_pal_n64.xml @@ -3,8 +3,8 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot18.xml b/assets/xml/scenes/overworld/spot18.xml index affece84b7..ab3a88ccef 100644 --- a/assets/xml/scenes/overworld/spot18.xml +++ b/assets/xml/scenes/overworld/spot18.xml @@ -9,8 +9,8 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot18_pal_n64.xml b/assets/xml/scenes/overworld/spot18_pal_n64.xml index 809e099cfc..afa4915ffb 100644 --- a/assets/xml/scenes/overworld/spot18_pal_n64.xml +++ b/assets/xml/scenes/overworld/spot18_pal_n64.xml @@ -9,8 +9,8 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot20.xml b/assets/xml/scenes/overworld/spot20.xml index d3dd77a41e..af77f5b898 100644 --- a/assets/xml/scenes/overworld/spot20.xml +++ b/assets/xml/scenes/overworld/spot20.xml @@ -12,8 +12,8 @@ - - + + diff --git a/assets/xml/scenes/overworld/spot20_pal.xml b/assets/xml/scenes/overworld/spot20_pal.xml index 297b1c316e..d698fba77e 100644 --- a/assets/xml/scenes/overworld/spot20_pal.xml +++ b/assets/xml/scenes/overworld/spot20_pal.xml @@ -12,8 +12,8 @@ - - + + diff --git a/assets/xml/textures/backgrounds.xml b/assets/xml/textures/backgrounds.xml index c60ff57a8a..1fb4f8828f 100644 --- a/assets/xml/textures/backgrounds.xml +++ b/assets/xml/textures/backgrounds.xml @@ -1,246 +1,246 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - + + - - - - + + + + - - - - + + + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + diff --git a/assets/xml/textures/do_action_static.xml b/assets/xml/textures/do_action_static.xml index f628496c12..c448dbfdf1 100644 --- a/assets/xml/textures/do_action_static.xml +++ b/assets/xml/textures/do_action_static.xml @@ -1,65 +1,65 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/do_action_static_pal.xml b/assets/xml/textures/do_action_static_pal.xml index a821e7b2a7..7de3b55b53 100644 --- a/assets/xml/textures/do_action_static_pal.xml +++ b/assets/xml/textures/do_action_static_pal.xml @@ -1,96 +1,96 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_24_static.xml b/assets/xml/textures/icon_item_24_static.xml index 395da30bb7..d4b33dbe59 100644 --- a/assets/xml/textures/icon_item_24_static.xml +++ b/assets/xml/textures/icon_item_24_static.xml @@ -1,24 +1,24 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_dungeon_static.xml b/assets/xml/textures/icon_item_dungeon_static.xml index 873c490fc5..e832d35298 100644 --- a/assets/xml/textures/icon_item_dungeon_static.xml +++ b/assets/xml/textures/icon_item_dungeon_static.xml @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_field_static.xml b/assets/xml/textures/icon_item_field_static.xml index 1ee2483501..252721f31e 100644 --- a/assets/xml/textures/icon_item_field_static.xml +++ b/assets/xml/textures/icon_item_field_static.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_fra_static.xml b/assets/xml/textures/icon_item_fra_static.xml index 2c8ccad5bf..3630ea9703 100644 --- a/assets/xml/textures/icon_item_fra_static.xml +++ b/assets/xml/textures/icon_item_fra_static.xml @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_gameover_static.xml b/assets/xml/textures/icon_item_gameover_static.xml index ffd3928680..d5d893e6b6 100644 --- a/assets/xml/textures/icon_item_gameover_static.xml +++ b/assets/xml/textures/icon_item_gameover_static.xml @@ -1,10 +1,10 @@ - - - - - - + + + + + + diff --git a/assets/xml/textures/icon_item_gameover_static_pal.xml b/assets/xml/textures/icon_item_gameover_static_pal.xml index fc2a506422..cb80b1ac25 100644 --- a/assets/xml/textures/icon_item_gameover_static_pal.xml +++ b/assets/xml/textures/icon_item_gameover_static_pal.xml @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + diff --git a/assets/xml/textures/icon_item_ger_static.xml b/assets/xml/textures/icon_item_ger_static.xml index ea71dda35e..6aa1b34143 100644 --- a/assets/xml/textures/icon_item_ger_static.xml +++ b/assets/xml/textures/icon_item_ger_static.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_jpn_static.xml b/assets/xml/textures/icon_item_jpn_static.xml index f2fe854b8e..1358212ce8 100644 --- a/assets/xml/textures/icon_item_jpn_static.xml +++ b/assets/xml/textures/icon_item_jpn_static.xml @@ -1,35 +1,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_nes_static.xml b/assets/xml/textures/icon_item_nes_static.xml index 6cd92acfca..fb95c69045 100644 --- a/assets/xml/textures/icon_item_nes_static.xml +++ b/assets/xml/textures/icon_item_nes_static.xml @@ -1,35 +1,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_static.xml b/assets/xml/textures/icon_item_static.xml index ca772fddda..2d67bfa108 100644 --- a/assets/xml/textures/icon_item_static.xml +++ b/assets/xml/textures/icon_item_static.xml @@ -1,181 +1,181 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/icon_item_static_pal.xml b/assets/xml/textures/icon_item_static_pal.xml index 474a13f249..161d4039a0 100644 --- a/assets/xml/textures/icon_item_static_pal.xml +++ b/assets/xml/textures/icon_item_static_pal.xml @@ -1,183 +1,183 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/item_name_static.xml b/assets/xml/textures/item_name_static.xml index 0740038d9b..eff98015ec 100644 --- a/assets/xml/textures/item_name_static.xml +++ b/assets/xml/textures/item_name_static.xml @@ -1,250 +1,251 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/item_name_static_pal.xml b/assets/xml/textures/item_name_static_pal.xml index adf66fcb9b..a990c2620d 100644 --- a/assets/xml/textures/item_name_static_pal.xml +++ b/assets/xml/textures/item_name_static_pal.xml @@ -1,373 +1,375 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/kanji.xml b/assets/xml/textures/kanji.xml index 25987b86de..87dc2bf96c 100644 --- a/assets/xml/textures/kanji.xml +++ b/assets/xml/textures/kanji.xml @@ -1,3984 +1,3984 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/map_48x85_static.xml b/assets/xml/textures/map_48x85_static.xml index b8795bd07d..d70f247356 100644 --- a/assets/xml/textures/map_48x85_static.xml +++ b/assets/xml/textures/map_48x85_static.xml @@ -2,73 +2,73 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/map_grand_static.xml b/assets/xml/textures/map_grand_static.xml index 201955bfc3..306fc76d83 100644 --- a/assets/xml/textures/map_grand_static.xml +++ b/assets/xml/textures/map_grand_static.xml @@ -1,28 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/map_i_static.xml b/assets/xml/textures/map_i_static.xml index 1721f6d848..64eed0b2a9 100644 --- a/assets/xml/textures/map_i_static.xml +++ b/assets/xml/textures/map_i_static.xml @@ -1,243 +1,243 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/map_name_static.xml b/assets/xml/textures/map_name_static.xml index dd705eab60..c35abf0b1d 100644 --- a/assets/xml/textures/map_name_static.xml +++ b/assets/xml/textures/map_name_static.xml @@ -3,78 +3,78 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/map_name_static_pal.xml b/assets/xml/textures/map_name_static_pal.xml index 780609b18c..f62a4d7981 100644 --- a/assets/xml/textures/map_name_static_pal.xml +++ b/assets/xml/textures/map_name_static_pal.xml @@ -3,114 +3,114 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/message_static.xml b/assets/xml/textures/message_static.xml index afdde60def..e63d65a2a6 100644 --- a/assets/xml/textures/message_static.xml +++ b/assets/xml/textures/message_static.xml @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + diff --git a/assets/xml/textures/message_texture_static.xml b/assets/xml/textures/message_texture_static.xml index bbf7e1259e..34cfb07ed3 100644 --- a/assets/xml/textures/message_texture_static.xml +++ b/assets/xml/textures/message_texture_static.xml @@ -1,6 +1,6 @@ - - + + diff --git a/assets/xml/textures/nes_font_static.xml b/assets/xml/textures/nes_font_static.xml index f1b80ee045..9561fb1036 100644 --- a/assets/xml/textures/nes_font_static.xml +++ b/assets/xml/textures/nes_font_static.xml @@ -1,144 +1,144 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/nes_font_static_ique_cn.xml b/assets/xml/textures/nes_font_static_ique_cn.xml index 484707b05d..1e2dc97184 100644 --- a/assets/xml/textures/nes_font_static_ique_cn.xml +++ b/assets/xml/textures/nes_font_static_ique_cn.xml @@ -2,1918 +2,1918 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/nes_font_static_v2.xml b/assets/xml/textures/nes_font_static_v2.xml index b01646cb54..9e037d45bc 100644 --- a/assets/xml/textures/nes_font_static_v2.xml +++ b/assets/xml/textures/nes_font_static_v2.xml @@ -1,145 +1,145 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/nintendo_rogo_static.xml b/assets/xml/textures/nintendo_rogo_static.xml index 295bbfcfa2..c5e555fb18 100644 --- a/assets/xml/textures/nintendo_rogo_static.xml +++ b/assets/xml/textures/nintendo_rogo_static.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/textures/nintendo_rogo_static_v2.xml b/assets/xml/textures/nintendo_rogo_static_v2.xml index 7a60524b20..56792cf47f 100644 --- a/assets/xml/textures/nintendo_rogo_static_v2.xml +++ b/assets/xml/textures/nintendo_rogo_static_v2.xml @@ -1,8 +1,8 @@ - - + + diff --git a/assets/xml/textures/parameter_static.xml b/assets/xml/textures/parameter_static.xml index 41f110180a..7d25201cfb 100644 --- a/assets/xml/textures/parameter_static.xml +++ b/assets/xml/textures/parameter_static.xml @@ -1,60 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/parameter_static_ique.xml b/assets/xml/textures/parameter_static_ique.xml index 98449e6746..0eb9409da0 100644 --- a/assets/xml/textures/parameter_static_ique.xml +++ b/assets/xml/textures/parameter_static_ique.xml @@ -1,60 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/textures/place_title_cards.xml b/assets/xml/textures/place_title_cards.xml index c9023bc4ee..30851a3694 100644 --- a/assets/xml/textures/place_title_cards.xml +++ b/assets/xml/textures/place_title_cards.xml @@ -1,230 +1,230 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/assets/xml/textures/place_title_cards_pal.xml b/assets/xml/textures/place_title_cards_pal.xml index 44bd6c8fb4..2d2a6170da 100644 --- a/assets/xml/textures/place_title_cards_pal.xml +++ b/assets/xml/textures/place_title_cards_pal.xml @@ -1,287 +1,287 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + diff --git a/assets/xml/textures/skyboxes.xml b/assets/xml/textures/skyboxes.xml index 104ffb2a3f..69b5e5dad3 100644 --- a/assets/xml/textures/skyboxes.xml +++ b/assets/xml/textures/skyboxes.xml @@ -1,113 +1,113 @@ - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - - + + + + + + - + - - - - - - + + + + + + - + diff --git a/assets/xml/textures/title_static.xml b/assets/xml/textures/title_static.xml index c0f3f2908d..e7d320d448 100644 --- a/assets/xml/textures/title_static.xml +++ b/assets/xml/textures/title_static.xml @@ -1,166 +1,166 @@ - - - - - + + + + + - + - - - - - - + + + + + + - - - - + + + + - - + + - - - + + + - - + + - - - + + + - + - + - - - + + + - + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - + + + - + - + - - - + + + - + - + - + - - - - - + + + + + - - + + - - - + + + - + - - - - + + + + - - - + + + - - - - - + + + + + - - - - + + + + - - + + - - - + + + - + - + - - - - + + + + - - - + + + - + - + - + - - - + + + - + - + - + - + - + diff --git a/assets/xml/textures/title_static_pal_gc.xml b/assets/xml/textures/title_static_pal_gc.xml index 5f26d7f8de..9460bcacb5 100644 --- a/assets/xml/textures/title_static_pal_gc.xml +++ b/assets/xml/textures/title_static_pal_gc.xml @@ -1,191 +1,191 @@ - + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - + + - - - - - + + + + + - - - - - - - + + + + + + + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + - - - + + + - + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - + diff --git a/assets/xml/textures/title_static_pal_n64.xml b/assets/xml/textures/title_static_pal_n64.xml index ad3bf9dbbe..48276ba5db 100644 --- a/assets/xml/textures/title_static_pal_n64.xml +++ b/assets/xml/textures/title_static_pal_n64.xml @@ -1,201 +1,201 @@ - + - - - - - - + + + + + + - + - - - + + + - + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - 0x1d480 + + 0x1d480 - - - - - + + + + + - - - - - - - + + + + + + + - - - + + + - - - - - + + + + + - - - - + + + + - - + + - - - + + + - - - - - - - - - + + + + + + + + + - - + + - + - - - - - + + + + + - - - - + + + + - - + + - - - + + + - - - - - - - - - + + + + + + + + + - + - - - - - + + + + + - - - - + + + + - - + + - - - + + + - - - - - - - - + + + + + + + + - + - - - + + + - + - + diff --git a/baseroms/gc-eu-mq-dbg/config.yml b/baseroms/gc-eu-mq-dbg/config.yml index 44bbdae424..e457028060 100644 --- a/baseroms/gc-eu-mq-dbg/config.yml +++ b/baseroms/gc-eu-mq-dbg/config.yml @@ -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 e42e48c75f..0093015d7e 100644 --- a/baseroms/gc-eu-mq/config.yml +++ b/baseroms/gc-eu-mq/config.yml @@ -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 b6471875f7..9aef9891f9 100644 --- a/baseroms/gc-eu/config.yml +++ b/baseroms/gc-eu/config.yml @@ -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 a4592544ff..f3c0541a62 100644 --- a/baseroms/gc-jp-ce/config.yml +++ b/baseroms/gc-jp-ce/config.yml @@ -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 597e2cff66..41d1721f3d 100644 --- a/baseroms/gc-jp-mq/config.yml +++ b/baseroms/gc-jp-mq/config.yml @@ -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 582fd894eb..73285664c6 100644 --- a/baseroms/gc-jp/config.yml +++ b/baseroms/gc-jp/config.yml @@ -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 691aaa1ff9..1057e49b2e 100644 --- a/baseroms/gc-us-mq/config.yml +++ b/baseroms/gc-us-mq/config.yml @@ -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 9a64c84646..620d550631 100644 --- a/baseroms/gc-us/config.yml +++ b/baseroms/gc-us/config.yml @@ -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/config.yml b/baseroms/ique-cn/config.yml index af570e0f0a..6236b0cf51 100644 --- a/baseroms/ique-cn/config.yml +++ b/baseroms/ique-cn/config.yml @@ -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 667845d383..948bbd179a 100644 --- a/baseroms/ntsc-1.0/config.yml +++ b/baseroms/ntsc-1.0/config.yml @@ -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 66e74a17a4..2317ae2dac 100644 --- a/baseroms/ntsc-1.1/config.yml +++ b/baseroms/ntsc-1.1/config.yml @@ -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 4b3b33db46..6fc7896db0 100644 --- a/baseroms/ntsc-1.2/config.yml +++ b/baseroms/ntsc-1.2/config.yml @@ -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 782e4ce152..37ffb7500b 100644 --- a/baseroms/pal-1.0/config.yml +++ b/baseroms/pal-1.0/config.yml @@ -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 c7f278dfe2..45bf82b877 100644 --- a/baseroms/pal-1.1/config.yml +++ b/baseroms/pal-1.1/config.yml @@ -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/z64actor.h b/include/actor.h similarity index 99% rename from include/z64actor.h rename to include/actor.h index 2709356b99..985f32abb3 100644 --- a/include/z64actor.h +++ b/include/actor.h @@ -1,12 +1,11 @@ -#ifndef Z64ACTOR_H -#define Z64ACTOR_H +#ifndef ACTOR_H +#define ACTOR_H #include "color.h" -#include "romfile.h" -#include "z64actor_profile.h" -#include "z64animation.h" -#include "z64math.h" -#include "z64collision_check.h" +#include "actor_profile.h" +#include "animation.h" +#include "z_math.h" +#include "collision_check.h" #define ACTOR_NUMBER_MAX 200 @@ -160,6 +159,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) @@ -451,6 +452,9 @@ typedef enum AttentionRangeType { /* 10 */ ATTENTION_RANGE_MAX } AttentionRangeType; +#define PLACE_NAME_TEX_WIDTH 144 +#define PLACE_NAME_TEX_HEIGHT 24 + typedef struct TitleCardContext { /* 0x00 */ void* texture; /* 0x04 */ s16 x; diff --git a/include/z64actor_profile.h b/include/actor_profile.h similarity index 96% rename from include/z64actor_profile.h rename to include/actor_profile.h index 82ec9f957b..d02ce03cf2 100644 --- a/include/z64actor_profile.h +++ b/include/actor_profile.h @@ -1,5 +1,5 @@ -#ifndef Z64ACTOR_PROFILE_H -#define Z64ACTOR_PROFILE_H +#ifndef ACTOR_PROFILE_H +#define ACTOR_PROFILE_H #include "ultra64.h" diff --git a/include/z64animation.h b/include/animation.h similarity index 99% rename from include/z64animation.h rename to include/animation.h index 17b42e1a0f..fdf14843b9 100644 --- a/include/z64animation.h +++ b/include/animation.h @@ -1,10 +1,10 @@ -#ifndef Z64_ANIMATION_H -#define Z64_ANIMATION_H +#ifndef ANIMATION_H +#define ANIMATION_H +#include "avoid_ub.h" #include "ultra64.h" -#include "z64dma.h" -#include "z64math.h" -#include "macros.h" +#include "dma.h" +#include "z_math.h" struct PlayState; struct Actor; diff --git a/include/z64animation_legacy.h b/include/animation_legacy.h similarity index 92% rename from include/z64animation_legacy.h rename to include/animation_legacy.h index 066a8faa33..5b5c0399ff 100644 --- a/include/z64animation_legacy.h +++ b/include/animation_legacy.h @@ -1,8 +1,8 @@ -#ifndef Z64_ANIMATION_LEGACY_H -#define Z64_ANIMATION_LEGACY_H +#ifndef ANIMATION_LEGACY_H +#define ANIMATION_LEGACY_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" typedef struct LegacyLimb { /* 0x000 */ Gfx* dList; 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/attributes.h b/include/attributes.h index 3276c84325..acfaf3edc0 100644 --- a/include/attributes.h +++ b/include/attributes.h @@ -1,8 +1,6 @@ #ifndef ATTRIBUTES_H #define ATTRIBUTES_H -#include "versions.h" - #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(x) #endif diff --git a/include/z64audio.h b/include/audio.h similarity index 96% rename from include/z64audio.h rename to include/audio.h index 3673811ac9..2dbf107501 100644 --- a/include/z64audio.h +++ b/include/audio.h @@ -1,9 +1,9 @@ -#ifndef Z64_AUDIO_H -#define Z64_AUDIO_H +#ifndef AUDIO_H +#define AUDIO_H #include "ultra64.h" #include "sequence.h" -#include "z64math.h" +#include "z_math.h" struct GfxPrint; @@ -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 @@ -75,12 +73,12 @@ typedef enum SoundSetting { /* 3 */ SOUND_SETTING_SURROUND } SoundSetting; -typedef enum SoundMode { - /* 0 */ SOUNDMODE_STEREO, - /* 1 */ SOUNDMODE_HEADSET, - /* 2 */ SOUNDMODE_SURROUND, - /* 3 */ SOUNDMODE_MONO -} SoundMode; +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, @@ -936,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; @@ -1204,7 +1202,7 @@ void func_800F64E0(u8 arg0); void Audio_ToggleMalonSinging(u8 malonSingingDisabled); void Audio_SetEnvReverb(s8 reverb); void Audio_SetCodeReverb(s8 reverb); -void Audio_SetSoundMode(s8 soundSetting); +void Audio_SetSoundOutputMode(s8 soundSetting); void Audio_SetBaseFilter(u8); void Audio_SetExtraFilter(u8); void Audio_SetCutsceneFlag(s8 flag); @@ -1221,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/audio/aseq.h b/include/audio/aseq.h index ce14abfa22..99df3248f7 100644 --- a/include/audio/aseq.h +++ b/include/audio/aseq.h @@ -741,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. */ @@ -826,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 @@ -1847,7 +1848,7 @@ $reladdr\@: .endm /** - * ptraddi + * ptraddi * * Like ptradd but for immediates instead of labels * @@ -1855,7 +1856,7 @@ $reladdr\@: */ .macro ptraddi value _wr_cmd_id ptradd, ,ASEQ_OP_CHAN_PTRADD,,,,,,, 0, 0 - _wr_u16 \value + _wr_s16 \value .endm /** diff --git a/include/audio/soundfont_file.h b/include/audio/soundfont_file.h index 3f320a6e56..3de4595090 100644 --- a/include/audio/soundfont_file.h +++ b/include/audio/soundfont_file.h @@ -1,10 +1,10 @@ #ifndef SOUNDFONT_FILE_H #define SOUNDFONT_FILE_H -#include "libc/stdbool.h" +#include "stdbool.h" #include "alignment.h" #include "attributes.h" -#include "z64audio.h" +#include "audio.h" // Envelope definitions diff --git a/include/audiomgr.h b/include/audiomgr.h index b518c976a5..66a9050266 100644 --- a/include/audiomgr.h +++ b/include/audiomgr.h @@ -2,7 +2,7 @@ #define AUDIOMGR_H #include "sched.h" -#include "z64audio.h" +#include "audio.h" typedef enum AudioMgrDebugLevel { /* 0 */ AUDIOMGR_DEBUG_LEVEL_NONE, 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/z64bgcheck.h b/include/bgcheck.h similarity index 99% rename from include/z64bgcheck.h rename to include/bgcheck.h index bb9e9cf148..13b8570582 100644 --- a/include/z64bgcheck.h +++ b/include/bgcheck.h @@ -1,8 +1,8 @@ -#ifndef Z64BGCHECK_H -#define Z64BGCHECK_H +#ifndef BGCHECK_H +#define BGCHECK_H #include "ultra64/ultratypes.h" -#include "z64math.h" +#include "z_math.h" struct PlayState; struct Actor; @@ -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/buffers.h b/include/buffers.h index e74719c440..2a690d2730 100644 --- a/include/buffers.h +++ b/include/buffers.h @@ -2,7 +2,6 @@ #define BUFFERS_H #include "gfx.h" -#include "macros.h" #include "ultra64.h" extern u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; // 0x25800 bytes 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/z64camera.h b/include/camera.h similarity index 99% rename from include/z64camera.h rename to include/camera.h index 2fcbffdf5a..9d4783de06 100644 --- a/include/z64camera.h +++ b/include/camera.h @@ -1,9 +1,9 @@ -#ifndef Z64CAMERA_H -#define Z64CAMERA_H +#ifndef CAMERA_H +#define CAMERA_H #include "ultra64.h" -#include "z64cutscene.h" -#include "z64math.h" +#include "cutscene.h" +#include "z_math.h" struct CollisionContext; struct View; 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/z64collision_check.h b/include/collision_check.h similarity index 99% rename from include/z64collision_check.h rename to include/collision_check.h index 2c27563766..ddcafb24e9 100644 --- a/include/z64collision_check.h +++ b/include/collision_check.h @@ -1,8 +1,8 @@ -#ifndef Z64COLLISION_CHECK_H -#define Z64COLLISION_CHECK_H +#ifndef COLLISION_CHECK_H +#define COLLISION_CHECK_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" #define COLLISION_CHECK_AT_MAX 50 #define COLLISION_CHECK_AC_MAX 60 @@ -391,7 +391,7 @@ typedef struct CollisionCheckContext { #define OCLINE_NONE 0 // Did not have an OcLine collision #define OCLINE_HIT (1 << 0) // Had an OcLine collision -#define DMG_ENTRY(damage, effect) ((damage) | ((effect) << 4)) +#define DMG_ENTRY(damage, reaction) ((damage) | ((reaction) << 4)) #define DMG_DEKU_NUT (1 << 0) #define DMG_DEKU_STICK (1 << 1) @@ -464,7 +464,7 @@ typedef struct CollisionCheckInfo { /* 0x16 */ u8 mass; // Used to compute displacement for OC collisions /* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one /* 0x18 */ u8 damage; // Amount to decrement health by - /* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon + /* 0x19 */ u8 damageReaction; // Stores what reaction should occur after being hit /* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT } CollisionCheckInfo; // size = 0x1C 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 index 09b7d66546..da9509b72d 100644 --- a/include/console_logo_state.h +++ b/include/console_logo_state.h @@ -2,9 +2,9 @@ #define CONSOLE_LOGO_STATE_H #include "ultra64.h" -#include "z64game.h" -#include "z64sram.h" -#include "z64view.h" +#include "game.h" +#include "sram.h" +#include "view.h" typedef struct ConsoleLogoState { /* 0x0000 */ GameState state; diff --git a/include/z64curve.h b/include/curve.h similarity index 91% rename from include/z64curve.h rename to include/curve.h index 2f35aec967..8779b04b47 100644 --- a/include/z64curve.h +++ b/include/curve.h @@ -1,10 +1,10 @@ -#ifndef Z64_CURVE_H -#define Z64_CURVE_H +#ifndef CURVE_H +#define CURVE_H -#include "ultra64/ultratypes.h" -#include "z64math.h" +#include "ultra64.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 +56,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/cutscene.h similarity index 99% rename from include/z64cutscene.h rename to include/cutscene.h index f8aed368d4..e3bf4a1c84 100644 --- a/include/z64cutscene.h +++ b/include/cutscene.h @@ -1,8 +1,8 @@ -#ifndef Z64CUTSCENE_H -#define Z64CUTSCENE_H +#ifndef CUTSCENE_H +#define CUTSCENE_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct PlayState; diff --git a/include/z64cutscene_commands.h b/include/cutscene_commands.h similarity index 99% rename from include/z64cutscene_commands.h rename to include/cutscene_commands.h index f0c8146cd1..14ec25c496 100644 --- a/include/z64cutscene_commands.h +++ b/include/cutscene_commands.h @@ -1,8 +1,8 @@ -#ifndef Z64CUTSCENE_COMMANDS_H -#define Z64CUTSCENE_COMMANDS_H +#ifndef CUTSCENE_COMMANDS_H +#define CUTSCENE_COMMANDS_H #include "command_macros_base.h" -#include "z64cutscene.h" +#include "cutscene.h" /** * Cutscene scripts are arrays of `CutsceneData` words, including bit-packed integers and floats. diff --git a/include/z64cutscene_flags.h b/include/cutscene_flags.h similarity index 83% rename from include/z64cutscene_flags.h rename to include/cutscene_flags.h index 5a3c7c2a7a..a6e34762af 100644 --- a/include/z64cutscene_flags.h +++ b/include/cutscene_flags.h @@ -1,5 +1,5 @@ -#ifndef Z64CUTSCENE_FLAGS_H -#define Z64CUTSCENE_FLAGS_H +#ifndef CUTSCENE_FLAGS_H +#define CUTSCENE_FLAGS_H #include "ultra64.h" diff --git a/include/z64cutscene_spline.h b/include/cutscene_spline.h similarity index 78% rename from include/z64cutscene_spline.h rename to include/cutscene_spline.h index 3a73949453..00a815a614 100644 --- a/include/z64cutscene_spline.h +++ b/include/cutscene_spline.h @@ -1,8 +1,8 @@ -#ifndef Z64CUTSCENE_SPLINE_H -#define Z64CUTSCENE_SPLINE_H +#ifndef CUTSCENE_SPLINE_H +#define CUTSCENE_SPLINE_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" union CutsceneCameraPoint; diff --git a/include/db_camera.h b/include/db_camera.h index 81d8515d0b..fd11f56fdb 100644 --- a/include/db_camera.h +++ b/include/db_camera.h @@ -2,8 +2,8 @@ #define DB_CAMERA_H #include "ultra64.h" -#include "z64cutscene.h" -#include "z64math.h" +#include "cutscene.h" +#include "z_math.h" struct Camera; diff --git a/include/z64debug.h b/include/debug.h similarity index 90% rename from include/z64debug.h rename to include/debug.h index 0e2c7334ee..9c12f82429 100644 --- a/include/z64debug.h +++ b/include/debug.h @@ -1,5 +1,5 @@ -#ifndef Z64DEBUG_H -#define Z64DEBUG_H +#ifndef DEBUG_H +#define DEBUG_H #include "ultra64.h" diff --git a/include/z64debug_display.h b/include/debug_display.h similarity index 90% rename from include/z64debug_display.h rename to include/debug_display.h index 9cb1198067..0623224fef 100644 --- a/include/z64debug_display.h +++ b/include/debug_display.h @@ -1,8 +1,8 @@ -#ifndef Z64_DEBUG_DISPLAY_H -#define Z64_DEBUG_DISPLAY_H +#ifndef DEBUG_DISPLAY_H +#define DEBUG_DISPLAY_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" #include "color.h" struct GraphicsContext; diff --git a/include/z64dma.h b/include/dma.h similarity index 76% rename from include/z64dma.h rename to include/dma.h index b9cbf6a42d..83a79619c8 100755 --- a/include/z64dma.h +++ b/include/dma.h @@ -1,5 +1,5 @@ -#ifndef Z64_DMA_H -#define Z64_DMA_H +#ifndef DMA_H +#define DMA_H #include "ultra64.h" #include "alignment.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/draw.h b/include/draw.h new file mode 100644 index 0000000000..66658817e2 --- /dev/null +++ b/include/draw.h @@ -0,0 +1,10 @@ +#ifndef DRAW_H +#define DRAW_H + +#include "ultra64.h" + +struct PlayState; + +void GetItem_Draw(struct PlayState* play, s16 giDrawId); + +#endif diff --git a/include/z64effect.h b/include/effect.h similarity index 99% rename from include/z64effect.h rename to include/effect.h index 0c07cc5124..060b6cd090 100644 --- a/include/z64effect.h +++ b/include/effect.h @@ -1,10 +1,10 @@ -#ifndef Z64EFFECT_H -#define Z64EFFECT_H +#ifndef EFFECT_H +#define EFFECT_H #include "color.h" #include "romfile.h" -#include "z64light.h" -#include "z64math.h" +#include "light.h" +#include "z_math.h" struct Actor; struct GraphicsContext; diff --git a/include/z64environment.h b/include/environment.h similarity index 99% rename from include/z64environment.h rename to include/environment.h index 4c4bc770cd..6c23dfb336 100644 --- a/include/z64environment.h +++ b/include/environment.h @@ -1,9 +1,9 @@ -#ifndef _Z64ENVIRONMENT_H_ -#define _Z64ENVIRONMENT_H_ +#ifndef ENVIRONMENT_H_ +#define ENVIRONMENT_H_ -#include "z64math.h" -#include "z64light.h" -#include "z64dma.h" +#include "z_math.h" +#include "light.h" +#include "dma.h" struct GameOverContext; struct MessageContext; diff --git a/include/face_change.h b/include/face_change.h index 5a0c8d8566..b612641813 100644 --- a/include/face_change.h +++ b/include/face_change.h @@ -1,6 +1,8 @@ #ifndef FACE_CHANGE_H #define FACE_CHANGE_H +#include "ultra64.h" + typedef struct FaceChange { /* 0x00 */ s16 face; /* 0x02 */ s16 timer; diff --git a/include/z64face_reaction.h b/include/face_reaction.h similarity index 98% rename from include/z64face_reaction.h rename to include/face_reaction.h index 274340ebcb..7dc89f864e 100644 --- a/include/z64face_reaction.h +++ b/include/face_reaction.h @@ -1,5 +1,5 @@ -#ifndef Z64FACE_REACTION_H -#define Z64FACE_REACTION_H +#ifndef FACE_REACTION_H +#define FACE_REACTION_H #include "ultra64.h" diff --git a/include/fault.h b/include/fault.h index 7418246f46..af895927d0 100644 --- a/include/fault.h +++ b/include/fault.h @@ -1,9 +1,10 @@ #ifndef FAULT_H #define FAULT_H -#include "ultra64.h" -#include "attributes.h" +#include "libu64/debug.h" #include "libu64/pad.h" +#include "attributes.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 index 0a831caa0f..6dc7cfadcb 100644 --- a/include/file_select_state.h +++ b/include/file_select_state.h @@ -2,12 +2,12 @@ #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" +#include "environment.h" +#include "game.h" +#include "message.h" +#include "skybox.h" +#include "sram.h" +#include "view.h" typedef struct FileSelectState { /* 0x00000 */ GameState state; 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/z64font.h b/include/font.h similarity index 97% rename from include/z64font.h rename to include/font.h index 72f97fddd6..b379d32e16 100644 --- a/include/z64font.h +++ b/include/font.h @@ -1,5 +1,5 @@ -#ifndef Z64FONT_H -#define Z64FONT_H +#ifndef FONT_H +#define FONT_H #include "ultra64.h" diff --git a/include/z64frame_advance.h b/include/frame_advance.h similarity index 87% rename from include/z64frame_advance.h rename to include/frame_advance.h index edefb0b47d..0736b09d56 100644 --- a/include/z64frame_advance.h +++ b/include/frame_advance.h @@ -1,5 +1,5 @@ -#ifndef Z64FRAME_ADVANCE_H -#define Z64FRAME_ADVANCE_H +#ifndef FRAME_ADVANCE_H +#define FRAME_ADVANCE_H #include "ultra64.h" diff --git a/include/functions.h b/include/functions.h deleted file mode 100644 index 63255443dc..0000000000 --- a/include/functions.h +++ /dev/null @@ -1,107 +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 -#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 SaveContext_Init(void); - -void* MemCpy(void* dest, const void* src, s32 len); - -void MapMark_Init(PlayState* play); -void MapMark_ClearPointers(PlayState* play); -void MapMark_Draw(PlayState* play); -void Sched_FlushTaskQueue(void); - -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 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 Graph_ThreadEntry(void*); - -void SysCfb_Init(s32 n64dd); -void* SysCfb_GetFbPtr(s32 idx); -void* SysCfb_GetFbEnd(void); - -void RcpUtils_PrintRegisterStatus(void); -void RcpUtils_Reset(void); - -void SystemHeap_Init(void* start, u32 size); - -f32 absf(f32); - -void Regs_InitData(PlayState* play); - -#endif diff --git a/include/z64game.h b/include/game.h similarity index 97% rename from include/z64game.h rename to include/game.h index fe683777b7..d15a3fcdc0 100644 --- a/include/z64game.h +++ b/include/game.h @@ -1,11 +1,10 @@ -#ifndef Z64GAME_H -#define Z64GAME_H +#ifndef GAME_H +#define GAME_H // This file is named "game" after game.c for now, this may change later with the system name #include "ultra64/ultratypes.h" #include "libu64/pad.h" #include "gamealloc.h" -#include "romfile.h" #include "tha.h" struct GraphicsContext; diff --git a/include/z64game_over.h b/include/game_over.h similarity index 95% rename from include/z64game_over.h rename to include/game_over.h index 03697c1f50..e91ad0413a 100644 --- a/include/z64game_over.h +++ b/include/game_over.h @@ -1,5 +1,5 @@ -#ifndef Z64GAME_OVER_H -#define Z64GAME_OVER_H +#ifndef GAME_OVER_H +#define GAME_OVER_H #include "ultra64.h" diff --git a/include/gfx.h b/include/gfx.h index a4c17281ca..6e1fcabe17 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -3,10 +3,14 @@ #include "ultra64.h" #include "ultra64/gbi.h" +#include "alignment.h" #include "sched.h" #include "thga.h" #include "versions.h" +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 240 + // Texture memory size, 4 KiB #define TMEM_SIZE 0x1000 @@ -119,4 +123,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/z64horse.h b/include/horse.h similarity index 85% rename from include/z64horse.h rename to include/horse.h index d58de4b6d4..e3e5502a81 100644 --- a/include/z64horse.h +++ b/include/horse.h @@ -1,8 +1,8 @@ -#ifndef Z64HORSE_H -#define Z64HORSE_H +#ifndef HORSE_H +#define HORSE_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct PlayState; struct Actor; 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..6da7255f55 --- /dev/null +++ b/include/inflate.h @@ -0,0 +1,10 @@ +#ifndef INFLATE_H +#define INFLATE_H + +#include "stddef.h" +#include "stdint.h" +#include "ultra64.h" + +void gzip_decompress(uintptr_t romStart, u8* dst, size_t size); + +#endif diff --git a/include/z64interface.h b/include/interface.h similarity index 98% rename from include/z64interface.h rename to include/interface.h index 5bcad2bc11..84834b3df6 100644 --- a/include/z64interface.h +++ b/include/interface.h @@ -1,9 +1,9 @@ -#ifndef Z64INTERFACE_H -#define Z64INTERFACE_H +#ifndef INTERFACE_H +#define INTERFACE_H #include "ultra64.h" -#include "z64dma.h" -#include "z64view.h" +#include "dma.h" +#include "view.h" struct PlayState; @@ -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/inventory.h similarity index 90% rename from include/z64inventory.h rename to include/inventory.h index 8c1a5a90d8..3ad5c1bbbd 100644 --- a/include/z64inventory.h +++ b/include/inventory.h @@ -1,8 +1,8 @@ -#ifndef Z64INVENTORY_H -#define Z64INVENTORY_H +#ifndef INVENTORY_H +#define INVENTORY_H #include "ultra64.h" -#include "z64item.h" +#include "item.h" struct PlayState; diff --git a/include/is_debug.h b/include/is_debug.h new file mode 100644 index 0000000000..18125dc16c --- /dev/null +++ b/include/is_debug.h @@ -0,0 +1,18 @@ +#ifndef IS_DEBUG_H +#define IS_DEBUG_H + +#include "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/z64item.h b/include/item.h similarity index 99% rename from include/z64item.h rename to include/item.h index 60344f326c..f5d4a530af 100644 --- a/include/z64item.h +++ b/include/item.h @@ -1,5 +1,5 @@ -#ifndef Z64ITEM_H -#define Z64ITEM_H +#ifndef ITEM_H +#define ITEM_H // Note that z_kaleido_scope.c assumes that the dimensions and texture format here also matches the dimensions and // texture format for MAP_NAME_TEX1_* 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 25233c51c5..02540e3530 100644 --- a/include/libc64/malloc.h +++ b/include/libc64/malloc.h @@ -32,5 +32,6 @@ void SystemArena_Display(void); #endif extern Arena gSystemArena; +extern s32 gSystemArenaLogSeverity; #endif diff --git a/include/libc64/sprintf.h b/include/libc64/sprintf.h index 485f938f58..55e10045ea 100644 --- a/include/libc64/sprintf.h +++ b/include/libc64/sprintf.h @@ -1,8 +1,6 @@ #ifndef LIBC64_SPRINTF_H #define LIBC64_SPRINTF_H -#include "ultra64.h" - #include "stdarg.h" int vsprintf(char* dst, const char* fmt, va_list args); 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/z64lifemeter.h b/include/lifemeter.h similarity index 86% rename from include/z64lifemeter.h rename to include/lifemeter.h index 29b2656b88..d88ae6902d 100644 --- a/include/z64lifemeter.h +++ b/include/lifemeter.h @@ -1,5 +1,5 @@ -#ifndef Z64LIFEMETER_H -#define Z64LIFEMETER_H +#ifndef LIFEMETER_H +#define LIFEMETER_H #include "ultra64/ultratypes.h" diff --git a/include/z64light.h b/include/light.h similarity index 97% rename from include/z64light.h rename to include/light.h index cb666ff752..fa4a306b64 100644 --- a/include/z64light.h +++ b/include/light.h @@ -1,10 +1,9 @@ -#ifndef Z64LIGHT_H -#define Z64LIGHT_H +#ifndef LIGHT_H +#define LIGHT_H #include "ultra64.h" #include "ultra64/gbi.h" -#include "z64math.h" -#include "color.h" +#include "z_math.h" struct GraphicsContext; struct PlayState; diff --git a/include/macros.h b/include/macros.h deleted file mode 100644 index aa81ef061b..0000000000 --- a/include/macros.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef MACROS_H -#define MACROS_H - -#include "terminal.h" -#include "versions.h" - -#define SCREEN_WIDTH 320 -#define SCREEN_HEIGHT 240 - -#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 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 - -#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 88c5d9279a..ef82c03554 100644 --- a/include/map.h +++ b/include/map.h @@ -68,6 +68,7 @@ typedef struct MapData { #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); diff --git a/include/z64map_mark.h b/include/map_mark.h similarity index 78% rename from include/z64map_mark.h rename to include/map_mark.h index 0c55efa3ae..2f22ee0f5b 100644 --- a/include/z64map_mark.h +++ b/include/map_mark.h @@ -1,8 +1,10 @@ -#ifndef Z64MAP_MARK_H -#define Z64MAP_MARK_H +#ifndef MAP_MARK_H +#define MAP_MARK_H #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/map_select_state.h b/include/map_select_state.h index d2a6b43d19..01e57dd1d0 100644 --- a/include/map_select_state.h +++ b/include/map_select_state.h @@ -2,8 +2,8 @@ #define MAP_SELECT_STATE_H #include "ultra64.h" -#include "z64game.h" -#include "z64view.h" +#include "game.h" +#include "view.h" struct MapSelectState; 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/z64message.h b/include/message.h similarity index 98% rename from include/z64message.h rename to include/message.h index 3758b690fd..3948f2dd09 100644 --- a/include/z64message.h +++ b/include/message.h @@ -1,9 +1,9 @@ -#ifndef Z64MESSAGE_H -#define Z64MESSAGE_H +#ifndef MESSAGE_H +#define MESSAGE_H -#include "z64view.h" +#include "view.h" #include "versions.h" -#include "z64font.h" +#include "font.h" struct OcarinaStaff; struct Actor; @@ -203,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/message_data_fmt.h b/include/message_data_fmt.h index ac798d9346..375ac281e6 100644 --- a/include/message_data_fmt.h +++ b/include/message_data_fmt.h @@ -1,8 +1,8 @@ #ifndef MESSAGE_DATA_FMT_H #define MESSAGE_DATA_FMT_H -#include "z64save.h" // For highscores -#include "z64item.h" // For item ids +#include "save.h" // For highscores +#include "item.h" // For item ids #include "sfx.h" // For sfx ids /* 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/n64dd.h b/include/n64dd.h index 6a353c3172..f7a3f649ca 100644 --- a/include/n64dd.h +++ b/include/n64dd.h @@ -3,9 +3,9 @@ #include "ultra64.h" #include "ultra64/leo.h" -#include "z64pause.h" -#include "z64scene.h" -#include "z64map_mark.h" +#include "pause.h" +#include "scene.h" +#include "map_mark.h" #include "versions.h" struct Font; diff --git a/include/z64object.h b/include/object.h similarity index 96% rename from include/z64object.h rename to include/object.h index 016eda00d7..e40e671120 100644 --- a/include/z64object.h +++ b/include/object.h @@ -1,8 +1,8 @@ -#ifndef Z64OBJECT_H -#define Z64OBJECT_H +#ifndef OBJECT_H +#define OBJECT_H #include "ultra64.h" -#include "z64dma.h" +#include "dma.h" struct PlayState; diff --git a/include/z64ocarina.h b/include/ocarina.h similarity index 97% rename from include/z64ocarina.h rename to include/ocarina.h index afad53811b..b3d502836a 100644 --- a/include/z64ocarina.h +++ b/include/ocarina.h @@ -1,5 +1,5 @@ -#ifndef Z64OCARINA_H -#define Z64OCARINA_H +#ifndef OCARINA_H +#define OCARINA_H #include "ultra64.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/z64olib.h b/include/olib.h similarity index 88% rename from include/z64olib.h rename to include/olib.h index 1b704b0e69..88b918987d 100644 --- a/include/z64olib.h +++ b/include/olib.h @@ -1,7 +1,7 @@ -#ifndef Z64OLIB_H -#define Z64OLIB_H +#ifndef OLIB_H +#define OLIB_H -#include "z64math.h" +#include "z_math.h" f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b); f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b); diff --git a/include/padmgr.h b/include/padmgr.h index 4b9e6890cd..9859b501a6 100644 --- a/include/padmgr.h +++ b/include/padmgr.h @@ -4,7 +4,6 @@ #include "ultra64.h" #include "libu64/pad.h" #include "irqmgr.h" -#include "versions.h" typedef enum ControllerPakType { CONT_PAK_NONE, diff --git a/include/z64path.h b/include/path.h similarity index 88% rename from include/z64path.h rename to include/path.h index 0f9243974a..56918762d7 100644 --- a/include/z64path.h +++ b/include/path.h @@ -1,8 +1,8 @@ -#ifndef Z64PATH_H -#define Z64PATH_H +#ifndef PATH_H +#define PATH_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct PlayState; struct Actor; diff --git a/include/z64pause.h b/include/pause.h similarity index 93% rename from include/z64pause.h rename to include/pause.h index 3a698f5328..f8a54fc5dd 100644 --- a/include/z64pause.h +++ b/include/pause.h @@ -1,9 +1,9 @@ -#ifndef Z64PAUSE_H -#define Z64PAUSE_H +#ifndef PAUSE_H +#define PAUSE_H -#include "z64animation.h" -#include "z64message.h" -#include "z64view.h" +#include "animation.h" +#include "message.h" +#include "view.h" struct OcarinaStaff; struct PlayState; @@ -50,6 +50,8 @@ typedef enum PauseMenuPage { #define PAUSE_EQUIP_PLAYER_WIDTH 64 #define PAUSE_EQUIP_PLAYER_HEIGHT 112 +#define PAUSE_EQUIP_PLAYER_FRAG_HEIGHT (TMEM_SIZE / (PAUSE_EQUIP_PLAYER_WIDTH * G_IM_SIZ_16b_BYTES)) +#define PAUSE_EQUIP_PLAYER_FRAG_NUM (((PAUSE_EQUIP_PLAYER_HEIGHT - 1) / PAUSE_EQUIP_PLAYER_FRAG_HEIGHT) + 1) #define PAUSE_EQUIP_BUFFER_SIZE sizeof(u16[PAUSE_EQUIP_PLAYER_HEIGHT][PAUSE_EQUIP_PLAYER_WIDTH]) #define PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE 0x5000 @@ -77,11 +79,18 @@ typedef enum PauseState { /* 19 */ PAUSE_STATE_RESUME_GAMEPLAY // Handles returning to normal gameplay once the pause menu is visually closed } PauseState; +typedef enum PauseDebugState { + /* 0 */ PAUSE_DEBUG_STATE_CLOSED, + /* 1 */ PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPENING, + /* 2 */ PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPEN, + /* 3 */ PAUSE_DEBUG_STATE_FLAG_SET_OPEN +} PauseDebugState; + #define IS_PAUSE_STATE_GAMEOVER(pauseCtx) \ (((pauseCtx)->state >= PAUSE_STATE_GAME_OVER_START) && ((pauseCtx)->state <= PAUSE_STATE_GAME_OVER_FINISH)) #define IS_PAUSED(pauseCtx) \ - (((pauseCtx)->state != PAUSE_STATE_OFF) || ((pauseCtx)->debugState != 0)) + (((pauseCtx)->state != PAUSE_STATE_OFF) || ((pauseCtx)->debugState != PAUSE_DEBUG_STATE_CLOSED)) // Sub-states of PAUSE_STATE_MAIN typedef enum PauseMainState { @@ -92,7 +101,7 @@ typedef enum PauseMainState { /* 4 */ PAUSE_MAIN_STATE_SONG_PROMPT_INIT, // Start the prompt for the player to play the song. /* 5 */ PAUSE_MAIN_STATE_SONG_PROMPT, // Waiting for the player to play the song. /* 6 */ PAUSE_MAIN_STATE_SONG_PROMPT_DONE, // The song prompt is done, the player either played the song successfully or made a mistake. - /* 7 */ PAUSE_MAIN_STATE_7, + /* 7 */ PAUSE_MAIN_STATE_EQUIP_CHANGED, /* 8 */ PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG, // Like PAUSE_MAIN_STATE_IDLE, but the quest page is active and the cursor is positioned on a song. /* 9 */ PAUSE_MAIN_STATE_SONG_PLAYBACK_START // Start playing the song back to the player. } PauseMainState; @@ -250,4 +259,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/play_state.h similarity index 93% rename from include/z64play.h rename to include/play_state.h index 4ca9e0b024..fa5e4839f3 100644 --- a/include/z64play.h +++ b/include/play_state.h @@ -1,29 +1,30 @@ -#ifndef Z64PLAY_H -#define Z64PLAY_H +#ifndef PLAY_STATE_H +#define PLAY_STATE_H #include "ultra64.h" #include "prerender.h" -#include "z64actor.h" -#include "z64bgcheck.h" -#include "z64camera.h" -#include "z64cutscene.h" -#include "z64environment.h" -#include "z64frame_advance.h" -#include "z64game.h" -#include "z64game_over.h" -#include "z64interface.h" -#include "z64light.h" -#include "z64message.h" -#include "z64object.h" -#include "z64pause.h" -#include "z64room.h" -#include "z64scene.h" -#include "z64sfx_source.h" -#include "z64skybox.h" -#include "z64sram.h" -#include "z64transition.h" -#include "z64view.h" +#include "transition_tile.h" +#include "actor.h" +#include "bgcheck.h" +#include "camera.h" +#include "cutscene.h" +#include "environment.h" +#include "frame_advance.h" +#include "game.h" +#include "game_over.h" +#include "interface.h" +#include "light.h" +#include "message.h" +#include "object.h" +#include "pause.h" +#include "room.h" +#include "scene.h" +#include "sfx_source.h" +#include "skybox.h" +#include "sram.h" +#include "transition.h" +#include "view.h" union Color_RGBA8_u32; struct Path; diff --git a/include/z64player.h b/include/player.h similarity index 98% rename from include/z64player.h rename to include/player.h index 368a6cf032..74a129a254 100644 --- a/include/z64player.h +++ b/include/player.h @@ -1,7 +1,7 @@ -#ifndef Z64PLAYER_H -#define Z64PLAYER_H +#ifndef PLAYER_H +#define PLAYER_H -#include "z64actor.h" +#include "actor.h" #include "alignment.h" #include "face_change.h" @@ -269,18 +269,17 @@ typedef enum PlayerDoorType { /* 3 */ PLAYER_DOORTYPE_FAKE } PlayerDoorType; -typedef enum PlayerFacePart { - /* 0 */ PLAYER_FACEPART_EYES, - /* 1 */ PLAYER_FACEPART_MOUTH, - /* 2 */ PLAYER_FACEPART_MAX -} PlayerFacePart; +typedef struct PlayerFaceIndices { + /* 0x0 */ u8 eyeIndex; + /* 0x1 */ u8 mouthIndex; +} PlayerFaceIndices; // size = 0x2 typedef enum PlayerEyes { /* 0 */ PLAYER_EYES_OPEN, /* 1 */ PLAYER_EYES_HALF, /* 2 */ PLAYER_EYES_CLOSED, - /* 3 */ PLAYER_EYES_LEFT, - /* 4 */ PLAYER_EYES_RIGHT, + /* 3 */ PLAYER_EYES_RIGHT, + /* 4 */ PLAYER_EYES_LEFT, /* 5 */ PLAYER_EYES_WIDE, /* 6 */ PLAYER_EYES_DOWN, /* 7 */ PLAYER_EYES_WINCING, @@ -302,12 +301,12 @@ typedef enum PlayerFace { /* 3 */ PLAYER_FACE_NEUTRAL_2, // same as `PLAYER_FACE_NEUTRAL` /* 4 */ PLAYER_FACE_NEUTRAL_BLINKING_HALF_2, // same as `PLAYER_FACE_NEUTRAL_BLINKING_HALF` /* 5 */ PLAYER_FACE_NEUTRAL_BLINKING_CLOSED_2, // same as `PLAYER_FACE_NEUTRAL_BLINKING_CLOSED` - /* 6 */ PLAYER_FACE_LOOK_RIGHT, // eyes looking right and mouth closed + /* 6 */ PLAYER_FACE_LOOK_LEFT, // eyes looking left and mouth closed /* 7 */ PLAYER_FACE_SURPRISED, // wide eyes and grimacing mouth /* 8 */ PLAYER_FACE_HURT, // eyes wincing in pain and mouth open /* 9 */ PLAYER_FACE_GASP, // eyes and mouth open - /* 10 */ PLAYER_FACE_LOOK_LEFT, // eyes looking left and mouth closed - /* 11 */ PLAYER_FACE_LOOK_RIGHT_2, // duplicate of `PLAYER_FACE_LOOK_RIGHT` + /* 10 */ PLAYER_FACE_LOOK_RIGHT, // eyes looking right and mouth closed + /* 11 */ PLAYER_FACE_LOOK_LEFT_2, // duplicate of `PLAYER_FACE_LOOK_LEFT` /* 12 */ PLAYER_FACE_EYES_CLOSED_MOUTH_OPEN, // eyes closed and mouth open /* 13 */ PLAYER_FACE_OPENING, // eyes and mouth both halfway open /* 14 */ PLAYER_FACE_EYES_AND_MOUTH_OPEN, // eyes and mouth open diff --git a/include/prenmi_state.h b/include/prenmi_state.h index 3710425ca9..950eb94dea 100644 --- a/include/prenmi_state.h +++ b/include/prenmi_state.h @@ -2,7 +2,7 @@ #define PRENMI_STATE_H #include "ultra64.h" -#include "z64game.h" +#include "game.h" typedef struct PreNMIState { /* 0x00 */ GameState state; diff --git a/include/prerender.h b/include/prerender.h index 4231234a8d..0674fac020 100644 --- a/include/prerender.h +++ b/include/prerender.h @@ -26,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/quake.h b/include/quake.h index 0d97a5bf45..c6259c7675 100644 --- a/include/quake.h +++ b/include/quake.h @@ -1,8 +1,8 @@ #ifndef QUAKE_H #define QUAKE_H -#include "z64camera.h" -#include "z64math.h" +#include "camera.h" +#include "z_math.h" typedef struct ShakeInfo { /* 0x00 */ Vec3f atOffset; diff --git a/include/z64quest_hint.h b/include/quest_hint.h similarity index 76% rename from include/z64quest_hint.h rename to include/quest_hint.h index b592a07c34..71d909b3f3 100644 --- a/include/z64quest_hint.h +++ b/include/quest_hint.h @@ -1,5 +1,5 @@ -#ifndef Z64QUEST_HINT_H -#define Z64QUEST_HINT_H +#ifndef QUEST_HINT_H +#define QUEST_HINT_H #include "ultra64.h" diff --git a/include/z64quest_hint_commands.h b/include/quest_hint_commands.h similarity index 98% rename from include/z64quest_hint_commands.h rename to include/quest_hint_commands.h index 8b99510160..8ce19aa7dd 100644 --- a/include/z64quest_hint_commands.h +++ b/include/quest_hint_commands.h @@ -1,5 +1,5 @@ -#ifndef Z64QUEST_HINT_COMMANDS_H -#define Z64QUEST_HINT_COMMANDS_H +#ifndef QUEST_HINT_COMMANDS_H +#define QUEST_HINT_COMMANDS_H #include "ultra64.h" diff --git a/include/regs.h b/include/regs.h index 6eccca7701..8ea4e058ec 100644 --- a/include/regs.h +++ b/include/regs.h @@ -4,6 +4,8 @@ #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 @@ -410,6 +412,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/romfile.h b/include/romfile.h index 49b5f202dc..31edd72f33 100644 --- a/include/romfile.h +++ b/include/romfile.h @@ -1,7 +1,7 @@ #ifndef ROMFILE_H #define ROMFILE_H -#include "ultra64.h" +#include "stdint.h" typedef struct RomFile { /* 0x00 */ uintptr_t vromStart; diff --git a/include/z64room.h b/include/room.h similarity index 98% rename from include/z64room.h rename to include/room.h index 72c6f0982b..836b94b31e 100644 --- a/include/z64room.h +++ b/include/room.h @@ -1,9 +1,9 @@ -#ifndef Z64ROOM_H -#define Z64ROOM_H +#ifndef ROOM_H +#define ROOM_H #include "ultra64.h" -#include "z64dma.h" -#include "z64math.h" +#include "dma.h" +#include "z_math.h" struct Input; struct PlayState; diff --git a/include/sample_state.h b/include/sample_state.h index b568a83f95..adf9e2a466 100644 --- a/include/sample_state.h +++ b/include/sample_state.h @@ -2,8 +2,8 @@ #define SAMPLE_STATE_H #include "ultra64.h" -#include "z64game.h" -#include "z64view.h" +#include "game.h" +#include "view.h" typedef struct SampleState { /* 0x0000 */ GameState state; diff --git a/include/z64save.h b/include/save.h similarity index 98% rename from include/z64save.h rename to include/save.h index 5edfc35d92..a4e99546fb 100644 --- a/include/z64save.h +++ b/include/save.h @@ -1,10 +1,10 @@ -#ifndef Z64SAVE_H -#define Z64SAVE_H +#ifndef SAVE_H +#define SAVE_H #include "ultra64.h" #include "versions.h" -#include "z64inventory.h" -#include "z64math.h" +#include "inventory.h" +#include "z_math.h" typedef enum ZTargetSetting { /* 0 */ Z_TARGET_SETTING_SWITCH, @@ -592,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)) @@ -996,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/scene.h similarity index 98% rename from include/z64scene.h rename to include/scene.h index eacd62ed8a..8e5b1a100c 100644 --- a/include/z64scene.h +++ b/include/scene.h @@ -1,13 +1,13 @@ -#ifndef Z64SCENE_H -#define Z64SCENE_H +#ifndef SCENE_H +#define SCENE_H -#include "macros.h" +#include "avoid_ub.h" #include "ultra64.h" -#include "z64bgcheck.h" -#include "z64environment.h" -#include "z64light.h" -#include "z64math.h" -#include "z64path.h" +#include "bgcheck.h" +#include "environment.h" +#include "light.h" +#include "z_math.h" +#include "path.h" #include "command_macros_base.h" 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/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 index 863b71401e..2ec4c1000b 100644 --- a/include/setup_state.h +++ b/include/setup_state.h @@ -1,7 +1,7 @@ #ifndef SETUP_STATE_H #define SETUP_STATE_H -#include "z64game.h" +#include "game.h" typedef struct SetupState { /* 0x00 */ GameState state; diff --git a/include/sfx.h b/include/sfx.h index 16d0b122d3..91f24c1c84 100644 --- a/include/sfx.h +++ b/include/sfx.h @@ -3,8 +3,10 @@ #include "ultra64.h" #include "versions.h" -#include "z64math.h" -#include "libc/assert.h" +#include "z_math.h" +#include "assert.h" + +#define MAX_CHANNELS_PER_BANK 3 typedef enum SfxBankType { /* 0 */ BANK_PLAYER, @@ -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/z64sfx_source.h b/include/sfx_source.h similarity index 86% rename from include/z64sfx_source.h rename to include/sfx_source.h index 0034bc90aa..62011872ef 100644 --- a/include/z64sfx_source.h +++ b/include/sfx_source.h @@ -1,8 +1,8 @@ -#ifndef Z64SFX_SOURCE_H -#define Z64SFX_SOURCE_H +#ifndef SFX_SOURCE_H +#define SFX_SOURCE_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct PlayState; diff --git a/include/z64skin.h b/include/skin.h similarity index 98% rename from include/z64skin.h rename to include/skin.h index 641a980925..8843e5a230 100644 --- a/include/z64skin.h +++ b/include/skin.h @@ -1,7 +1,7 @@ -#ifndef Z64_SKIN_H -#define Z64_SKIN_H +#ifndef SKIN_H +#define SKIN_H -#include "z64animation.h" +#include "animation.h" struct Actor; struct GraphicsContext; diff --git a/include/z64skin_matrix.h b/include/skin_matrix.h similarity index 94% rename from include/z64skin_matrix.h rename to include/skin_matrix.h index 647790abff..a2ba0255fb 100644 --- a/include/z64skin_matrix.h +++ b/include/skin_matrix.h @@ -1,8 +1,8 @@ -#ifndef Z64SKIN_MATRIX_H -#define Z64SKIN_MATRIX_H +#ifndef SKIN_MATRIX_H +#define SKIN_MATRIX_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct GraphicsContext; diff --git a/include/z64skybox.h b/include/skybox.h similarity index 96% rename from include/z64skybox.h rename to include/skybox.h index e0ebcf0c03..1e1b3f12c1 100644 --- a/include/z64skybox.h +++ b/include/skybox.h @@ -1,11 +1,11 @@ -#ifndef Z64_SKYBOX_H -#define Z64_SKYBOX_H +#ifndef SKYBOX_H +#define SKYBOX_H #include "ultra64/ultratypes.h" #include "ultra64/gbi.h" -#include "z64math.h" -#include "z64dma.h" // for RomFile +#include "romfile.h" +#include "z_math.h" struct GameState; struct GraphicsContext; diff --git a/include/z64sram.h b/include/sram.h similarity index 97% rename from include/z64sram.h rename to include/sram.h index f1d05b7775..f683be8a03 100644 --- a/include/z64sram.h +++ b/include/sram.h @@ -1,5 +1,5 @@ -#ifndef Z64SRAM_H -#define Z64SRAM_H +#ifndef SRAM_H +#define SRAM_H #include "ultra64/ultratypes.h" diff --git a/include/z64ss_sram.h b/include/ss_sram.h similarity index 83% rename from include/z64ss_sram.h rename to include/ss_sram.h index ffd628239d..7a87c90fd5 100644 --- a/include/z64ss_sram.h +++ b/include/ss_sram.h @@ -1,7 +1,7 @@ -#ifndef Z64SS_SRAM_H -#define Z64SS_SRAM_H +#ifndef SS_SRAM_H +#define SS_SRAM_H -#include "libc/stddef.h" +#include "stddef.h" #include "ultra64/ultratypes.h" void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration, 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_math3d.h b/include/sys_math3d.h index deeb093f4e..11f699c17f 100644 --- a/include/sys_math3d.h +++ b/include/sys_math3d.h @@ -2,7 +2,7 @@ #define SYS_MATH3D_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct PlayState; diff --git a/include/sys_matrix.h b/include/sys_matrix.h index 11d494c8c8..3af75a18de 100644 --- a/include/sys_matrix.h +++ b/include/sys_matrix.h @@ -1,7 +1,7 @@ #ifndef SYS_MATRIX_H #define SYS_MATRIX_H -#include "z64math.h" +#include "z_math.h" struct GraphicsContext; struct GameState; @@ -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/tex_len.h b/include/tex_len.h new file mode 100644 index 0000000000..f6e54a82d1 --- /dev/null +++ b/include/tex_len.h @@ -0,0 +1,14 @@ +#ifndef TEX_LEN_H +#define TEX_LEN_H + +/** + * Compute a length for an array holding a texture. + * `type` is the array's element type. + * `width`, `height` are the texture dimensions. + * `bpp` is the texture's pixel size, in bits per pixels. + * The calculation computes the size of the texture in bits `width * height * bpp`, + * then divides by 8 to get the size in bytes, then divides by the element type size. + */ +#define TEX_LEN(type, width, height, bpp) ((width) * (height) * (bpp) / 8 / sizeof(type)) + +#endif diff --git a/include/tha.h b/include/tha.h index 941321b820..6a40db54cd 100644 --- a/include/tha.h +++ b/include/tha.h @@ -2,7 +2,6 @@ #define THA_H #include "ultra64.h" -#include "alignment.h" typedef struct TwoHeadArena { /* 0x00 */ size_t size; diff --git a/include/z64thread.h b/include/thread.h similarity index 95% rename from include/z64thread.h rename to include/thread.h index c4ab827b42..c3e52a407a 100644 --- a/include/z64thread.h +++ b/include/thread.h @@ -1,5 +1,5 @@ -#ifndef Z64THREAD_H -#define Z64THREAD_H +#ifndef THREAD_H +#define THREAD_H #include "ultra64.h" diff --git a/include/title_setup_state.h b/include/title_setup_state.h index 30219872a8..3d6a52445f 100644 --- a/include/title_setup_state.h +++ b/include/title_setup_state.h @@ -1,8 +1,8 @@ #ifndef TITLE_SETUP_STATE_H #define TITLE_SETUP_STATE_H -#include "z64game.h" -#include "z64view.h" +#include "game.h" +#include "view.h" typedef struct TitleSetupState { /* 0x0000 */ GameState state; diff --git a/include/z64transition.h b/include/transition.h similarity index 93% rename from include/z64transition.h rename to include/transition.h index 569b8fb328..ae7d329514 100644 --- a/include/z64transition.h +++ b/include/transition.h @@ -1,9 +1,13 @@ -#ifndef Z64TRANSITION_H -#define Z64TRANSITION_H +#ifndef TRANSITION_H +#define TRANSITION_H #include "ultra64/ultratypes.h" -#include "ultra64/gbi.h" // for Gfx -#include "z64transition_instances.h" +#include "ultra64/gbi.h" +#include "transition_circle.h" +#include "transition_fade.h" +#include "transition_triforce.h" +#include "transition_wipe.h" +#include "transition_instances.h" #define TRANS_TRIGGER_OFF 0 // transition is not active #define TRANS_TRIGGER_START 20 // start transition (exiting an area) 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_instances.h b/include/transition_instances.h new file mode 100644 index 0000000000..08e4672712 --- /dev/null +++ b/include/transition_instances.h @@ -0,0 +1,10 @@ +#ifndef TRANSITION_INSTANCES_H +#define TRANSITION_INSTANCES_H + +typedef enum TransitionInstanceType { + /* 1 */ TRANS_INSTANCE_TYPE_FILL_OUT = 1, + /* 2 */ TRANS_INSTANCE_TYPE_FILL_IN, + /* 3 */ TRANS_INSTANCE_TYPE_FADE_FLASH +} TransitionInstanceType; + +#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..51fb34f841 --- /dev/null +++ b/include/translation.h @@ -0,0 +1,20 @@ +#ifndef TRANSLATION_H +#define TRANSLATION_H + +#include "libu64/debug.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 + +#define LOG_STRING_T(stringJP, stringEN, file, line) LOG(#stringJP, stringJP, "%s", file, line) + +#endif diff --git a/include/ultra64.h b/include/ultra64.h index 9972a4dfe8..c7607ac921 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -1,14 +1,14 @@ #ifndef ULTRA64_H #define ULTRA64_H -#include "libc/assert.h" -#include "libc/math.h" -#include "libc/stdarg.h" -#include "libc/stdbool.h" -#include "libc/stddef.h" -#include "libc/stdint.h" -#include "libc/stdlib.h" -#include "libc/string.h" +#include "assert.h" +#include "math.h" +#include "stdarg.h" +#include "stdbool.h" +#include "stddef.h" +#include "stdint.h" +#include "stdlib.h" +#include "string.h" #include "ultra64/ultratypes.h" #include "unk.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); 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/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 612b3051b1..0000000000 --- a/include/variables.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef VARIABLES_H -#define VARIABLES_H - -#include "z64.h" -#include "libc64/os_malloc.h" -#include "segment_symbols.h" - -struct MapData; - -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 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 s16 gSpoilingItems[3]; -extern s16 gSpoilingItemReverts[3]; - -// 4 16-colors palettes -extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut" -extern u64 gMojiFontTex[]; // original name: "font_ff" -extern u8 gBossMarkState; - -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 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 struct MapData* gMapData; -extern f32 gBossMarkScale; -extern u32 D_8016139C; -extern PauseMapMarksData* gLoadedPauseMarkDataTable; - -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; - -#endif diff --git a/include/vi_mode.h b/include/vi_mode.h index 89de610a88..5c2f1bace2 100644 --- a/include/vi_mode.h +++ b/include/vi_mode.h @@ -42,4 +42,14 @@ 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/z64view.h b/include/view.h similarity index 98% rename from include/z64view.h rename to include/view.h index 3832eb5f6f..b2dadd3db4 100644 --- a/include/z64view.h +++ b/include/view.h @@ -1,9 +1,9 @@ -#ifndef Z64VIEW_H -#define Z64VIEW_H +#ifndef VIEW_H +#define VIEW_H -#include "macros.h" +#include "avoid_ub.h" #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct GraphicsContext; diff --git a/include/z64vis.h b/include/vis.h similarity index 98% rename from include/z64vis.h rename to include/vis.h index 86e286c325..52b1f0a690 100644 --- a/include/z64vis.h +++ b/include/vis.h @@ -1,5 +1,5 @@ -#ifndef Z64_VIS_H -#define Z64_VIS_H +#ifndef VIS_H +#define VIS_H #include "ultra64.h" #include "color.h" diff --git a/include/yaz0.h b/include/yaz0.h new file mode 100644 index 0000000000..b42c8e3ff8 --- /dev/null +++ b/include/yaz0.h @@ -0,0 +1,10 @@ +#ifndef YAZ0_H +#define YAZ0_H + +#include "stddef.h" +#include "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 a0ba2873d7..0000000000 --- a/include/z64.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef Z64_H -#define Z64_H - -#include "ultra64.h" -#include "ultra64/gs2dex.h" -#include "attributes.h" -#include "versions.h" -#include "z64player.h" -#include "z64audio.h" -#include "z64ocarina.h" -#include "z64curve.h" -#include "z64effect.h" -#include "z64animation.h" -#include "z64animation_legacy.h" -#include "z64play.h" -#include "z64skin.h" -#include "z64skin_matrix.h" -#include "alignment.h" -#include "audiothread_cmd.h" -#include "sfx.h" -#include "color.h" -#include "sys_matrix.h" // in room assets, gIdentityMtx - -// TODO: include all files listed above into the right place, and then delete this file. - -#endif diff --git a/include/z64draw.h b/include/z64draw.h deleted file mode 100644 index 51250ed8c8..0000000000 --- a/include/z64draw.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef Z64_DRAW_H -#define Z64_DRAW_H - -#include "ultra64.h" - -struct PlayState; - -void GetItem_Draw(struct PlayState* play, s16 drawId); - -#endif diff --git a/include/z64transition_instances.h b/include/z64transition_instances.h deleted file mode 100644 index 154b98d008..0000000000 --- a/include/z64transition_instances.h +++ /dev/null @@ -1,104 +0,0 @@ -#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 -} 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/z_actor_dlftbls.h b/include/z_actor_dlftbls.h index e9e2dc7d93..cabfc91916 100644 --- a/include/z_actor_dlftbls.h +++ b/include/z_actor_dlftbls.h @@ -2,7 +2,7 @@ #define Z_ACTOR_DLFTBLS_H #include "romfile.h" -#include "z64actor_profile.h" +#include "actor_profile.h" /** * @see ACTOROVL_ALLOC_ABSOLUTE diff --git a/include/z_en_a_obj.h b/include/z_en_a_obj.h index bd65f88f13..7db18aaf92 100644 --- a/include/z_en_a_obj.h +++ b/include/z_en_a_obj.h @@ -2,7 +2,7 @@ #define Z_EN_A_OBJ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" // Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files. typedef enum AObjType { diff --git a/include/z_en_item00.h b/include/z_en_item00.h index 483f666f5f..4eb1ae735b 100644 --- a/include/z_en_item00.h +++ b/include/z_en_item00.h @@ -2,7 +2,7 @@ #define Z_EN_ITEM00_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" typedef enum Item00Type { /* 0x00 */ ITEM00_RUPEE_GREEN, diff --git a/include/z_lib.h b/include/z_lib.h index 1e9052f93b..c2e36e7cc3 100644 --- a/include/z_lib.h +++ b/include/z_lib.h @@ -1,9 +1,9 @@ #ifndef Z_LIB_H #define Z_LIB_H -#include "libc/stddef.h" +#include "stddef.h" #include "libu64/pad.h" -#include "z64math.h" +#include "z_math.h" #include "color.h" void Lib_MemSet(u8* dest, size_t len, u8 val); diff --git a/include/z_locale.h b/include/z_locale.h index 7afcb33db4..5be416e823 100644 --- a/include/z_locale.h +++ b/include/z_locale.h @@ -2,7 +2,6 @@ #define Z_LOCALE_H #include "ultra64/ultratypes.h" -#include "region.h" extern s32 gCurrentRegion; diff --git a/include/z64math.h b/include/z_math.h similarity index 88% rename from include/z64math.h rename to include/z_math.h index 95a494a693..ebe364d886 100644 --- a/include/z64math.h +++ b/include/z_math.h @@ -1,11 +1,10 @@ -#ifndef Z64MATH_H -#define Z64MATH_H +#ifndef Z_MATH_H +#define Z_MATH_H + +// This file has a z_ prefix to indicate that it is the game-side math header, not libc -#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 +94,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 +130,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 +166,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/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 90% rename from src/audio/data.c rename to src/audio/game/data.c index 5f8bfa71f3..213c53dbbf 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 "audio.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 a41254001e..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: - Audio_SetSoundMode(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 99% rename from src/audio/general.c rename to src/audio/game/general.c index ddf13f4cff..0e1ca6df5c 100644 --- a/src/audio/general.c +++ b/src/audio/game/general.c @@ -1,13 +1,17 @@ #include "libu64/gfxprint.h" -#include "ultra64.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 "versions.h" - -#include "global.h" +#include "audio.h" +#include "ocarina.h" #define ABS_ALT(x) ((x) < 0 ? -(x) : (x)) @@ -141,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; @@ -2631,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; @@ -2643,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) { @@ -2675,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; @@ -2882,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) { @@ -3773,32 +3777,40 @@ void Audio_SetCodeReverb(s8 reverb) { } } -void Audio_SetSoundMode(s8 soundSetting) { - 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 (soundSetting) { case SOUND_SETTING_STEREO: - soundModeIndex = SOUNDMODE_STEREO; - sSoundMode = SOUNDMODE_STEREO; + soundOutputMode = SOUND_OUTPUT_STEREO; + sSoundOutputMode = SOUND_OUTPUT_STEREO; break; case SOUND_SETTING_MONO: - soundModeIndex = SOUNDMODE_MONO; - sSoundMode = SOUNDMODE_MONO; + soundOutputMode = SOUND_OUTPUT_MONO; + sSoundOutputMode = SOUND_OUTPUT_MONO; break; case SOUND_SETTING_HEADSET: - soundModeIndex = SOUNDMODE_HEADSET; - sSoundMode = SOUNDMODE_HEADSET; + soundOutputMode = SOUND_OUTPUT_HEADSET; + sSoundOutputMode = SOUND_OUTPUT_HEADSET; break; case SOUND_SETTING_SURROUND: - soundModeIndex = SOUNDMODE_STEREO; - sSoundMode = SOUNDMODE_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) { @@ -4046,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 a6d5003cc4..ec9a36e299 100644 --- a/src/audio/sequence.c +++ b/src/audio/game/sequence.c @@ -17,10 +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 "ultra64.h" -#include "global.h" -#include "ultra64/abi.h" +#include "array_count.h" +#include "audiothread_cmd.h" #include "seqcmd.h" +#include "sfx.h" +#include "ultra64.h" +#include "ultra64/abi.h" +#include "audio.h" // Direct audio command (skips the queueing system) #define SEQCMD_SET_SEQPLAYER_VOLUME_NOW(seqPlayerIndex, duration, volume) \ @@ -370,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..6530901ef0 100644 --- a/src/audio/session_config.c +++ b/src/audio/game/session_config.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "audio.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 d04a955bca..ebac33b4a8 100644 --- a/src/audio/session_init.c +++ b/src/audio/game/session_init.c @@ -1,7 +1,7 @@ +#include "alignment.h" +#include "array_count.h" #include "buffers.h" -#include "z64audio.h" - -#include "global.h" +#include "audio.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..aef0a8eb58 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 "audio.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..d95b05fc9a 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 "audio.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 e6d2324886..162b72ce6b 100644 --- a/src/audio/lib/effects.c +++ b/src/audio/internal/effects.c @@ -1,7 +1,6 @@ #include "ultra64.h" #include "attributes.h" - -#include "global.h" +#include "audio.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..36674ded24 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 "audio.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 d4c1ea8644..9989d14075 100644 --- a/src/audio/lib/load.c +++ b/src/audio/internal/load.c @@ -1,9 +1,15 @@ -#include "ultra64.h" +/** + * Original Filename: system.c + */ + +#include "alignment.h" +#include "array_count.h" #include "attributes.h" #include "buffers.h" +#include "segment_symbols.h" +#include "ultra64.h" #include "versions.h" - -#include "global.h" +#include "audio.h" #define MK_ASYNC_MSG(retData, tableType, id, loadStatus) \ (((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (loadStatus)) @@ -76,6 +82,9 @@ void* sUnusedHandler = NULL; s32 gAudioContextInitialized = false; +/** + * original name: Nas_WaveDmaFrameWork + */ void AudioLoad_DecreaseSampleDmaTtls(void) { u32 i; @@ -108,6 +117,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; @@ -202,6 +214,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; @@ -271,6 +286,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; @@ -283,6 +301,9 @@ s32 AudioLoad_IsFontLoadComplete(s32 fontId) { } } +/** + * original name: Nas_CheckIDseq + */ s32 AudioLoad_IsSeqLoadComplete(s32 seqId) { if (seqId == 0xFF) { return true; @@ -295,6 +316,9 @@ s32 AudioLoad_IsSeqLoadComplete(s32 seqId) { } } +/** + * original name: Nas_CheckIDwave + */ s32 AudioLoad_IsSampleLoadComplete(s32 sampleBankId) { if (sampleBankId == 0xFF) { return true; @@ -308,18 +332,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) { @@ -333,12 +366,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; @@ -352,6 +391,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; @@ -378,6 +420,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; @@ -392,6 +437,9 @@ void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1) { } } +/** + * original name: __Nas_LoadVoice_Inner + */ s32 AudioLoad_SyncLoadSample(Sample* sample, s32 fontId) { void* sampleAddr; @@ -416,6 +464,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); @@ -442,24 +493,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]; @@ -470,6 +536,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]; @@ -485,6 +554,9 @@ void AudioLoad_DiscardSeqFonts(s32 seqId) { } } +/** + * original name: __Kill_Bank + */ void AudioLoad_DiscardFont(s32 fontId) { u32 i; AudioCache* pool = &gAudioCtx.fontCache; @@ -506,6 +578,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; @@ -519,6 +594,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; @@ -529,6 +607,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; @@ -571,6 +652,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; @@ -582,10 +666,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; @@ -618,6 +708,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; @@ -657,6 +750,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; @@ -741,6 +837,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); @@ -751,6 +850,9 @@ u32 AudioLoad_GetRealTableIndex(s32 tableType, u32 id) { return id; } +/** + * original name: __Check_Cache + */ void* AudioLoad_SearchCaches(s32 tableType, s32 id) { void* ramAddr; @@ -767,6 +869,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; @@ -792,7 +898,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 @@ -922,6 +1030,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; @@ -946,9 +1057,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; @@ -986,15 +1103,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; @@ -1101,20 +1227,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]; @@ -1126,6 +1264,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; @@ -1192,7 +1333,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; @@ -1228,7 +1369,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; @@ -1261,11 +1402,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; @@ -1316,6 +1463,9 @@ s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status) { return 0; } +/** + * original name: __GetWaveTable + */ Sample* AudioLoad_GetFontSample(s32 fontId, s32 instId) { Sample* sample; @@ -1347,6 +1497,9 @@ Sample* AudioLoad_GetFontSample(s32 fontId, s32 instId) { void AudioLoad_Unused2(void) { } +/** + * original name: __SwapLoadLps + */ void AudioLoad_FinishSlowLoad(AudioSlowLoad* slowLoad) { Sample* sample; @@ -1364,6 +1517,9 @@ void AudioLoad_FinishSlowLoad(AudioSlowLoad* slowLoad) { sample->medium = MEDIUM_RAM; } +/** + * original name: LpsDma + */ void AudioLoad_ProcessSlowLoads(s32 resetStatus) { AudioSlowLoad* slowLoad; s32 i; @@ -1413,6 +1569,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); @@ -1420,9 +1579,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; @@ -1460,6 +1625,9 @@ s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status) { return 0; } +/** + * original name: Nas_BgCopyInit + */ void AudioLoad_InitAsyncLoads(void) { s32 i; @@ -1468,6 +1636,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; @@ -1483,6 +1654,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; @@ -1525,6 +1699,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; @@ -1559,9 +1736,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; @@ -1602,6 +1785,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; @@ -1650,6 +1836,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); @@ -1658,6 +1847,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) { } @@ -1667,6 +1859,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 @@ -1723,6 +1917,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 @@ -1830,6 +2026,9 @@ void AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, SoundFontData* fontData } } +/** + * original name: Nas_CheckBgWave + */ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { Sample* sample; AudioPreloadReq* preload; @@ -1892,6 +2091,9 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { return true; } +/** + * original name: __AddList + */ s32 AudioLoad_AddToSampleSet(Sample* sample, s32 numSamples, Sample** sampleSet) { s32 i; @@ -1909,6 +2111,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; @@ -1942,6 +2147,9 @@ s32 AudioLoad_GetSamplesForFont(s32 fontId, Sample** sampleSet) { return numSamples; } +/** + * original name: __Reload + */ void AudioLoad_AddUsedSample(TunedSample* tunedSample) { Sample* sample = tunedSample->sample; @@ -1950,6 +2158,9 @@ void AudioLoad_AddUsedSample(TunedSample* tunedSample) { } } +/** + * original name: WaveReload + */ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* sampleBankReloc) { s32 numDrums; s32 numInstruments; @@ -2085,6 +2296,9 @@ void AudioLoad_PreloadSamplesForFont(s32 fontId, s32 async, SampleBankRelocInfo* } } +/** + * original name: EmemReload + */ void AudioLoad_LoadPermanentSamples(void) { s32 pad; u32 fontId; @@ -2117,15 +2331,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; @@ -2137,6 +2363,9 @@ void AudioLoad_ScriptLoad(s32 tableType, s32 id, s8* status) { } } +/** + * original name: MK_FrameWork + */ void AudioLoad_ProcessScriptLoads(void) { u32 temp; u32 sp20; @@ -2151,6 +2380,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..384588959a 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 "audio.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..0329f0ec16 100644 --- a/src/audio/lib/playback.c +++ b/src/audio/internal/playback.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "ultra64.h" +#include "audio.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 98% rename from src/audio/lib/seqplayer.c rename to src/audio/internal/seqplayer.c index 1a1d40c4d2..083acf8899 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,12 +14,12 @@ * - All three sets share a common pool of control flow instructions (>= 0xF2). * Otherwise, each set of instructions has its own command interpreter */ -#include "ultra64.h" +#include "audio/aseq.h" +#include "array_count.h" #include "assert.h" #include "attributes.h" -#include "audio/aseq.h" - -#include "global.h" +#include "ultra64.h" +#include "audio.h" static_assert(MML_VERSION == MML_VERSION_OOT, "This file implements the OoT version of the MML"); @@ -163,6 +164,8 @@ u8 sSeqInstructionArgsTable[] = { * Read and return the argument from the sequence script for a control flow instruction. * 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]; @@ -184,6 +187,8 @@ 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) { @@ -255,6 +260,9 @@ s32 AudioSeq_HandleScriptFlowControl(SequencePlayer* seqPlayer, SeqScriptState* return 0; } +/** + * original name: Nas_InitSubTrack + */ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) { s32 i; @@ -310,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; @@ -357,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) { @@ -369,6 +383,9 @@ void AudioSeq_SeqLayerDisable(SequenceLayer* layer) { } } +/** + * original name: Nas_CloseNoteTrack + */ void AudioSeq_SeqLayerFree(SequenceChannel* channel, s32 layerIndex) { SequenceLayer* layer = channel->layers[layerIndex]; @@ -379,6 +396,9 @@ void AudioSeq_SeqLayerFree(SequenceChannel* channel, s32 layerIndex) { } } +/** + * original name: Nas_ReleaseSubTrack + */ void AudioSeq_SequenceChannelDisable(SequenceChannel* channel) { s32 i; @@ -391,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; @@ -406,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; @@ -418,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; @@ -435,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; @@ -478,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; @@ -489,6 +527,9 @@ void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item) { } } +/** + * original name: Nas_GetList + */ void* AudioSeq_AudioListPopBack(AudioListItem* list) { AudioListItem* item = list->prev; @@ -504,6 +545,9 @@ void* AudioSeq_AudioListPopBack(AudioListItem* list) { return item->u.value; } +/** + * original name: Nas_InitNoteList + */ void AudioSeq_InitLayerFreelist(void) { s32 i; @@ -519,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; @@ -530,6 +580,9 @@ s16 AudioSeq_ScriptReadS16(SeqScriptState* state) { return ret; } +/** + * original name: Nas_ReadLengthData + */ u16 AudioSeq_ScriptReadCompressedU16(SeqScriptState* state) { u16 ret = *(state->pc++); @@ -540,6 +593,9 @@ u16 AudioSeq_ScriptReadCompressedU16(SeqScriptState* state) { return ret; } +/** + * original name: Nas_NoteSeq + */ void AudioSeq_SeqLayerProcessScript(SequenceLayer* layer) { s32 cmd; @@ -581,6 +637,9 @@ void AudioSeq_SeqLayerProcessScript(SequenceLayer* layer) { } } +/** + * original name: __Stop_Note + */ void AudioSeq_SeqLayerProcessScriptStep1(SequenceLayer* layer) { if (!layer->continuousNotes) { Audio_SeqLayerNoteDecay(layer); @@ -595,6 +654,9 @@ void AudioSeq_SeqLayerProcessScriptStep1(SequenceLayer* layer) { layer->notePropertiesNeedInit = true; } +/** + * original name: __SetChannel + */ s32 AudioSeq_SeqLayerProcessScriptStep5(SequenceLayer* layer, s32 sameTunedSample) { Note* note; @@ -633,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; @@ -789,6 +854,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) { } } +/** + * original name: __SetVoice + */ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) { s32 sameTunedSample = true; s32 instOrWave; @@ -997,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; @@ -1110,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; @@ -1121,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); @@ -1140,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 @@ -1165,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; @@ -1728,6 +1814,9 @@ exit_loop: } } +/** + * original name: Nas_GroupSeq + */ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { u8 cmd; u8 cmdLowBits; @@ -2055,6 +2144,9 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { } } +/** + * original name: Nas_MySeqMain + */ void AudioSeq_ProcessSequences(s32 arg0) { SequencePlayer* seqPlayer; u32 i; @@ -2072,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); @@ -2080,6 +2175,9 @@ void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer) { } } +/** + * original name: Nas_InitMySeq + */ void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer) { s32 i; @@ -2107,6 +2205,9 @@ void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer) { } } +/** + * original name: Nas_AssignSubTrack + */ void AudioSeq_InitSequencePlayerChannels(s32 playerIdx) { SequenceChannel* channel; SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[playerIdx]; @@ -2129,6 +2230,9 @@ void AudioSeq_InitSequencePlayerChannels(s32 playerIdx) { } } +/** + * original name: __InitGroup + */ void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) { s32 i; s32 j; @@ -2154,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..e01fbcc96c 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 "audio.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..d021c4386b 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 "audio.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..1e0983d772 100644 --- a/src/audio/tables/samplebank_table.c +++ b/src/audio/tables/samplebank_table.c @@ -1,9 +1,8 @@ #include "attributes.h" -#include "z64audio.h" +#include "audio.h" // 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..c7ab5c0555 100644 --- a/src/audio/tables/sequence_table.c +++ b/src/audio/tables/sequence_table.c @@ -1,10 +1,9 @@ #include "attributes.h" -#include "z64audio.h" +#include "audio.h" #include "versions.h" // 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..046f049bb1 100644 --- a/src/audio/tables/soundfont_table.c +++ b/src/audio/tables/soundfont_table.c @@ -1,9 +1,8 @@ #include "attributes.h" -#include "z64audio.h" +#include "audio.h" // Symbol definition -extern AudioTable gSoundFontTable; #pragma weak gSoundFontTable = sSoundFontTableHeader // Externs for table diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index 75c1b9cf89..cfe011ac33 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -1,13 +1,16 @@ #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" - -#include "global.h" +#include "thread.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" 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 29b04f2a8a..fadae3a181 100644 --- a/src/boot/cic6105.c +++ b/src/boot/cic6105.c @@ -1,10 +1,11 @@ -#pragma increment_block_number "ntsc-1.2:0" -#include "global.h" +#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 "audiomgr.h" +#include "build.h" #include "cic6105.h" +#include "fault.h" #include "regs.h" #include "sched.h" -#include "fault.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 be4c9f7cbf..648ce48cf7 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -1,16 +1,21 @@ +#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 "z64thread.h" +#include "vi_mode.h" +#include "thread.h" +#include "dma.h" -#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" \ - "ntsc-1.0:138 ntsc-1.1:138 ntsc-1.2:138 pal-1.0:136 pal-1.1:136" +#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..188c3f235a 100644 --- a/src/boot/inflate.c +++ b/src/boot/inflate.c @@ -95,12 +95,14 @@ the two sets of lengths. */ +#include "inflate.h" + #include "ultra64/ultratypes.h" -#include "libc/stddef.h" -#include "libc/stdint.h" +#include "stddef.h" +#include "stdint.h" #include "alignment.h" #include "attributes.h" -#include "z64dma.h" +#include "dma.h" typedef u8 uch; typedef u16 ush; diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index 912b759843..185ee77c62 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -1,5 +1,7 @@ -#include "global.h" -#include "attributes.h" +#include "is_debug.h" + +#include "ultra64.h" +#include "versions.h" typedef struct ISVDbg { /* 0x00 */ u32 magic; // "IS64" 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 2d6a4ec7c5..601d5145eb 100644 --- a/src/boot/yaz0.c +++ b/src/boot/yaz0.c @@ -1,4 +1,8 @@ -#include "global.h" +#include "yaz0.h" + +#include "alignment.h" +#include "ultra64.h" +#include "dma.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" diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index f54be014ba..a517f561ce 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -1,15 +1,16 @@ #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 "vi_mode.h" #include "z_locale.h" -#include "macros.h" -#include "global.h" - s32 gCurrentRegion = 0; typedef struct LocaleCartInfo { diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 7cbf009946..226465a3f6 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -21,22 +21,32 @@ #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 "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 "z64thread.h" +#include "translation.h" +#if !PLATFORM_IQUE +#include "yaz0.h" +#endif +#include "dma.h" +#include "thread.h" -#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" \ - "ntsc-1.2:12 pal-1.0:10 pal-1.1:10" +#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:82" \ + "pal-1.0:80 pal-1.1:80" StackEntry sDmaMgrStackInfo; OSMesgQueue sDmaMgrMsgQueue; @@ -509,7 +519,7 @@ void DmaMgr_ThreadEntry(void* arg) { } if (0) { - PRINTF(T("DMA登録受付", "DMA registration acceptance") " dmap=%08x\n", req); + PRINTF(T("DMA登録受付 dmap=%08x\n", "DMA registration acceptance dmap=%08x\n"), req); } // Process the DMA request diff --git a/src/buffers/zbuffer.c b/src/buffers/zbuffer.c index 0eda889219..69c445b633 100644 --- a/src/buffers/zbuffer.c +++ b/src/buffers/zbuffer.c @@ -1,6 +1,5 @@ #include "alignment.h" #include "buffers.h" -#include "macros.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 9dcb28f3a4..ddf6b473ea 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -10,11 +10,9 @@ #include "color.h" #include "gfx.h" #include "prerender.h" +#include "printf.h" #include "regs.h" -#include "macros.h" -#include "global.h" - void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) { this->widthSave = width; this->heightSave = height; diff --git a/src/code/TwoHeadArena.c b/src/code/TwoHeadArena.c index 271c2ae7ff..23ef69a910 100644 --- a/src/code/TwoHeadArena.c +++ b/src/code/TwoHeadArena.c @@ -9,7 +9,8 @@ * 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" +#include "alignment.h" void* THA_GetHead(TwoHeadArena* tha) { return tha->head; 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 8837601f8f..01b0072d9b 100644 --- a/src/code/audio_thread_manager.c +++ b/src/code/audio_thread_manager.c @@ -5,12 +5,13 @@ * and sending the audio rsp tasks generated by the driver to the task scheduler. */ +#include "array_count.h" #include "audiomgr.h" +#include "printf.h" #include "regs.h" #include "speed_meter.h" -#include "z64dma.h" - -#include "macros.h" +#include "translation.h" +#include "dma.h" void AudioMgr_NotifyTaskDone(AudioMgr* audioMgr) { AudioTask* task = audioMgr->rspTask; diff --git a/src/code/code_n64dd_800AD410.c b/src/code/code_n64dd_800AD410.c index 979a95afbb..1509b7223b 100644 --- a/src/code/code_n64dd_800AD410.c +++ b/src/code/code_n64dd_800AD410.c @@ -1,5 +1,5 @@ #include "ultra64.h" -#include "z64dma.h" +#include "dma.h" #include "segment_symbols.h" #include "n64dd.h" diff --git a/src/code/code_n64dd_800AD4C0.c b/src/code/code_n64dd_800AD4C0.c index 4c4e0db0e3..4b2d17e72c 100644 --- a/src/code/code_n64dd_800AD4C0.c +++ b/src/code/code_n64dd_800AD4C0.c @@ -2,9 +2,9 @@ #include "n64dd.h" #include "regs.h" #include "segmented_address.h" -#include "z64actor.h" -#include "z64cutscene.h" -#include "z64save.h" +#include "actor.h" +#include "cutscene.h" +#include "save.h" n64ddStruct_800FEE70_pointers D_800FEE70 = { func_801C7C1C, diff --git a/src/code/db_camera.c b/src/code/db_camera.c index f316505872..34599c9a1c 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -1,21 +1,23 @@ #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" +#include "camera.h" +#include "cutscene.h" +#include "cutscene_spline.h" +#include "debug.h" +#include "debug_display.h" +#include "olib.h" +#include "play_state.h" +#include "save.h" #define DEBUG_CAM_CONTROLLER_PORT 2 diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index acfca47ca5..772a9a8876 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -1,7 +1,7 @@ #include "libc64/os_malloc.h" #include "debug_arena.h" - -#include "macros.h" +#include "printf.h" +#include "translation.h" #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 @@ -34,7 +34,7 @@ void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* void* DebugArena_Malloc(u32 size) { void* ptr = __osMalloc(&sDebugArena, size); - DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc", "確保"); // "Secure" + DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc", T("確保", "Secure")); return ptr; } @@ -42,7 +42,7 @@ void* DebugArena_Malloc(u32 size) { void* DebugArena_MallocDebug(u32 size, const char* file, int line) { void* ptr = __osMallocDebug(&sDebugArena, size, file, line); - DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_DEBUG", "確保"); // "Secure" + DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_DEBUG", T("確保", "Secure")); return ptr; } #endif @@ -50,7 +50,7 @@ void* DebugArena_MallocDebug(u32 size, const char* file, int line) { void* DebugArena_MallocR(u32 size) { void* ptr = __osMallocR(&sDebugArena, size); - DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_r", "確保"); // "Secure" + DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_r", T("確保", "Secure")); return ptr; } @@ -58,21 +58,21 @@ void* DebugArena_MallocR(u32 size) { void* DebugArena_MallocRDebug(u32 size, const char* file, int line) { void* ptr = __osMallocRDebug(&sDebugArena, size, file, line); - DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_r_DEBUG", "確保"); // "Secure" + DEBUG_ARENA_CHECK_POINTER(ptr, size, "debug_malloc_r_DEBUG", T("確保", "Secure")); return ptr; } #endif void* DebugArena_Realloc(void* ptr, u32 newSize) { ptr = __osRealloc(&sDebugArena, ptr, newSize); - DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc", "再確保"); // "Re-securing" + DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc", T("再確保", "Re-secure")); return ptr; } #if DEBUG_FEATURES void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line); - DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // "Re-securing" + DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", T("再確保", "Re-secure")); return ptr; } #endif @@ -96,7 +96,7 @@ void* DebugArena_Calloc(u32 num, u32 size) { bzero(ret, n); } - DEBUG_ARENA_CHECK_POINTER(ret, n, "debug_calloc", "確保"); + DEBUG_ARENA_CHECK_POINTER(ret, n, "debug_calloc", T("確保", "Secure")); return ret; } diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index 29d04071c6..e7afa4ec81 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -40,21 +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:128 gc-eu-mq:128 gc-eu-mq-dbg:96 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128" \ - "gc-us-mq:128 ique-cn:128" -#include "global.h" +#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 "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 "z64thread.h" - -#include "macros.h" +#include "translation.h" +#include "thread.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 ecfc87f10f..2d31b0f323 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -1,19 +1,19 @@ #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 "thread.h" +#include "translation.h" -#include "macros.h" -#include "global.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" +#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 5f4316d7f0..f102d702c8 100644 --- a/src/code/flg_set.c +++ b/src/code/flg_set.c @@ -1,10 +1,12 @@ +#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" +#include "play_state.h" +#include "save.h" typedef struct FlagSetEntry { /* 0x00 */ u16* value; @@ -182,7 +184,7 @@ void FlagSet_Update(PlayState* play) { } if (CHECK_BTN_ALL(input->press.button, BTN_L)) { - play->pauseCtx.debugState = 0; + play->pauseCtx.debugState = PAUSE_DEBUG_STATE_CLOSED; } CLOSE_DISPS(gfxCtx, "../flg_set.c", 241); diff --git a/src/code/game.c b/src/code/game.c index 6db35e5630..1f4ff8cdbf 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -1,6 +1,8 @@ #include "libc64/malloc.h" +#include "libc64/os_malloc.h" #include "libu64/debug.h" #include "libu64/gfxprint.h" +#include "array_count.h" #include "audiomgr.h" #include "buffers.h" #include "controller.h" @@ -8,27 +10,27 @@ #include "gfx.h" #include "gfxalloc.h" #include "fault.h" -#include "libc64/os_malloc.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 "z64vis.h" - -#include "macros.h" -#include "global.h" +#include "debug.h" +#include "dma.h" +#include "game.h" +#include "play_state.h" +#include "vis.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" @@ -470,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 47591fd00b..506ef7721e 100644 --- a/src/code/gamealloc.c +++ b/src/code/gamealloc.c @@ -1,8 +1,7 @@ #include "libc64/malloc.h" #include "libu64/debug.h" #include "gamealloc.h" - -#include "macros.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..3b4d72f057 100644 --- a/src/code/gfxalloc.c +++ b/src/code/gfxalloc.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "gfxalloc.h" +#include "alignment.h" Gfx* Gfx_Open(Gfx* gfx) { return gfx + 1; diff --git a/src/code/graph.c b/src/code/graph.c index 4fc7a56ac9..56fc7af60c 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,7 +1,7 @@ #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" @@ -12,28 +12,29 @@ #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 "vi_mode.h" #include "z_game_dlftbls.h" -#include "z64audio.h" -#include "z64save.h" -#include "z64play.h" - -#include "macros.h" -#include "global.h" +#include "audio.h" +#include "save.h" +#include "play_state.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 ique-cn:128" \ - "ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96" + "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. @@ -330,10 +331,10 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { #if DEBUG_FEATURES OPEN_DISPS(gfxCtx, "../graph.c", 966); - gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0); - gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 開始", 0); - gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 開始", 0); - gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 開始", 0); + gDPNoOpString(WORK_DISP++, T("WORK_DISP 開始", "WORK_DISP start"), 0); + gDPNoOpString(POLY_OPA_DISP++, T("POLY_OPA_DISP 開始", "POLY_OPA_DISP start"), 0); + gDPNoOpString(POLY_XLU_DISP++, T("POLY_XLU_DISP 開始", "POLY_XLU_DISP start"), 0); + gDPNoOpString(OVERLAY_DISP++, T("OVERLAY_DISP 開始", "OVERLAY_DISP start"), 0); CLOSE_DISPS(gfxCtx, "../graph.c", 975); #endif @@ -344,10 +345,10 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { #if DEBUG_FEATURES OPEN_DISPS(gfxCtx, "../graph.c", 987); - gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0); - gDPNoOpString(POLY_OPA_DISP++, "POLY_OPA_DISP 終了", 0); - gDPNoOpString(POLY_XLU_DISP++, "POLY_XLU_DISP 終了", 0); - gDPNoOpString(OVERLAY_DISP++, "OVERLAY_DISP 終了", 0); + gDPNoOpString(WORK_DISP++, T("WORK_DISP 終了", "WORK_DISP end"), 0); + gDPNoOpString(POLY_OPA_DISP++, T("POLY_OPA_DISP 終了", "POLY_OPA_DISP end"), 0); + gDPNoOpString(POLY_XLU_DISP++, T("POLY_XLU_DISP 終了", "POLY_XLU_DISP end"), 0); + gDPNoOpString(OVERLAY_DISP++, T("OVERLAY_DISP 終了", "OVERLAY_DISP end"), 0); CLOSE_DISPS(gfxCtx, "../graph.c", 996); #endif diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index d741612e28..bb9fc7841e 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -33,13 +33,14 @@ * @see sched.c */ #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" - -#include "macros.h" +#include "thread.h" vu32 gIrqMgrResetStatus = IRQ_RESET_STATUS_IDLE; volatile OSTime sIrqMgrResetTime = 0; diff --git a/src/code/main.c b/src/code/main.c index 8a52882d07..e137cff750 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]; @@ -13,28 +17,34 @@ extern struct PadMgr gPadMgr; extern struct IrqMgr gIrqMgr; #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" +#include "debug.h" +#include "thread.h" -#include "global.h" - -#pragma increment_block_number "gc-eu:32 gc-eu-mq:32 gc-jp:32 gc-jp-ce:32 gc-jp-mq:32 gc-us:32 gc-us-mq:32 ique-cn:32" \ - "ntsc-1.0:13 ntsc-1.1:13 ntsc-1.2:13 pal-1.0:11 pal-1.1:11" +#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:51 ntsc-1.1:51 ntsc-1.2:51 pal-1.0:49 pal-1.1:49" extern u8 _buffersSegmentEnd[]; @@ -108,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 f316f0ea31..850c478b93 100644 --- a/src/code/mempak.c +++ b/src/code/mempak.c @@ -9,8 +9,7 @@ */ #include "mempak.h" #include "padmgr.h" - -#include "macros.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..3bb45a0073 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 "object.h" s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD }; diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 9e6d1ae14a..01a952c876 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -30,10 +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 4fb5a33760..fe1d14a0c2 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -40,17 +40,19 @@ * @see irqmgr.c */ #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 "z64thread.h" - -#include "macros.h" -#include "global.h" +#include "vi_mode.h" +#include "thread.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 e952a0c3fd..3c92ede0e1 100644 --- a/src/code/shrink_window.c +++ b/src/code/shrink_window.c @@ -1,8 +1,7 @@ #include "letterbox.h" +#include "printf.h" #include "regs.h" -#include "macros.h" - typedef enum LetterboxState { /* 0 */ LETTERBOX_STATE_IDLE, /* 1 */ LETTERBOX_STATE_GROWING, diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index dabfac7aaa..0216275f17 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -1,14 +1,16 @@ -#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.0:128 pal-1.1: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: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" +#include "game.h" +#include "view.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_freeze.c b/src/code/sys_freeze.c index ea50a89491..2957155559 100644 --- a/src/code/sys_freeze.c +++ b/src/code/sys_freeze.c @@ -1,10 +1,9 @@ #include "libc64/sleep.h" #include "attributes.h" +#include "printf.h" #include "sys_freeze.h" #include "terminal.h" -#include "macros.h" - NORETURN void func_800D31A0(void) { PRINTF(VT_FGCOL(RED) "\n**** Freeze!! ****\n" VT_RST); for (;;) { diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 4a1ddaf0bb..5f41973ffe 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -1,12 +1,14 @@ -#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:120 gc-eu-mq:120 gc-jp:120 gc-jp-ce:120 gc-jp-mq:120 gc-us:120 gc-us-mq:120" \ - "ique-cn:120 ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96" +#include "printf.h" +#include "terminal.h" +#include "translation.h" +#include "ultra64.h" +#include "z_lib.h" +#include "z_math.h" + +#pragma increment_block_number "gc-eu:76 gc-eu-mq:76 gc-jp:76 gc-jp-ce:76 gc-jp-mq:76 gc-us:76 gc-us-mq:76 ique-cn:66" \ + "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 7781a79e2e..2b8776ec68 100644 --- a/src/code/sys_math3d_draw.c +++ b/src/code/sys_math3d_draw.c @@ -1,5 +1,5 @@ #include "sys_math3d.h" -#include "z64play.h" +#include "play_state.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 8dabed7d72..2e344d3910 100644 --- a/src/code/sys_math_atan.c +++ b/src/code/sys_math_atan.c @@ -1,6 +1,6 @@ +#include "array_count.h" #include "sys_math.h" -#include "z64math.h" -#include "macros.h" +#include "z_math.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 081a292765..b773d20e47 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -3,12 +3,12 @@ #if DEBUG_FEATURES #include "fault.h" #endif -#include "macros.h" +#include "printf.h" #include "sys_matrix.h" #include "ultra64.h" #include "z_lib.h" -#include "z64game.h" -#include "z64skin_matrix.h" +#include "game.h" +#include "skin_matrix.h" // clang-format off Mtx gIdentityMtx = gdSPDefMtx( diff --git a/src/code/title_setup.c b/src/code/title_setup.c index ba259e72a1..c4020bbd14 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -1,7 +1,8 @@ #include "console_logo_state.h" #include "setup_state.h" - -#include "global.h" +#include "printf.h" +#include "translation.h" +#include "save.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 0684dcd5dc..8d1ff6cd77 100644 --- a/src/code/ucode_disas.c +++ b/src/code/ucode_disas.c @@ -1,10 +1,11 @@ +#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" -#include "ultra64/gs2dex.h" -#include "libu64/mtxuty-cvt.h" -#include "segmented_address.h" - -#include "macros.h" #if DEBUG_FEATURES @@ -59,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 501fed21a6..ad2cdff118 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -1,11 +1,11 @@ #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" -#include "macros.h" - void Overlay_LoadGameState(GameStateOverlay* overlayEntry) { if (overlayEntry->loadedRamAddr != NULL) { PRINTF(T("既にリンクされています\n", "Already linked\n")); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 798d8a036a..5a0fe9b1c3 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,8 +1,10 @@ #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" @@ -12,19 +14,19 @@ #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 "z64effect.h" -#include "z64light.h" -#include "z64horse.h" -#include "z64play.h" -#include "z64save.h" -#include "z64skin_matrix.h" - -#include "global.h" +#include "actor.h" +#include "audio.h" +#include "effect.h" +#include "light.h" +#include "horse.h" +#include "play_state.h" +#include "save.h" +#include "skin_matrix.h" #include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" @@ -33,7 +35,7 @@ #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:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0: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 ntsc-1.0:0" \ "ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" CollisionPoly* sCurCeilingPoly; @@ -592,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); @@ -928,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) { @@ -2686,7 +2688,7 @@ void Actor_DrawLensActors(PlayState* play, s32 numInvisibleActors, Actor** invis OPEN_DISPS(gfxCtx, "../z_actor.c", 6197); - gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ START", 0); // "Magic lens START" + gDPNoOpString(POLY_OPA_DISP++, T("魔法のメガネ START", "Magic lens START"), 0); gDPPipeSync(POLY_XLU_DISP++); @@ -2726,23 +2728,25 @@ void Actor_DrawLensActors(PlayState* play, s32 numInvisibleActors, Actor** invis // The z-buffer will be updated where the mask is not fully transparent. Actor_DrawLensOverlay(gfxCtx); - // "Magic lens invisible Actor display START" - gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないActor表示 START", numInvisibleActors); + gDPNoOpString(POLY_OPA_DISP++, + T("魔法のメガネ 見えないActor表示 START", "Magic lens invisible Actor display START"), + numInvisibleActors); invisibleActor = &invisibleActors[0]; for (i = 0; i < numInvisibleActors; i++) { - // "Magic lens invisible Actor display" - gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないActor表示", i); + gDPNoOpString(POLY_OPA_DISP++, T("魔法のメガネ 見えないActor表示", "Magic lens invisible Actor display"), + i); Actor_Draw(play, *(invisibleActor++)); } - // "Magic lens invisible Actor display END" - gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ 見えないActor表示 END", numInvisibleActors); + gDPNoOpString(POLY_OPA_DISP++, + T("魔法のメガネ 見えないActor表示 END", "Magic lens invisible Actor display END"), + numInvisibleActors); if (play->roomCtx.curRoom.lensMode != LENS_MODE_SHOW_ACTORS) { // Draw the lens overlay to the color frame buffer - gDPNoOpString(POLY_OPA_DISP++, "青い眼鏡(外側)", 0); // "Blue spectacles (exterior)" + gDPNoOpString(POLY_OPA_DISP++, T("青い眼鏡(外側)", "Blue glasses (outside)"), 0); gDPPipeSync(POLY_XLU_DISP++); @@ -2755,10 +2759,10 @@ void Actor_DrawLensActors(PlayState* play, s32 numInvisibleActors, Actor** invis Actor_DrawLensOverlay(gfxCtx); - gDPNoOpString(POLY_OPA_DISP++, "青い眼鏡(外側)", 1); // "Blue spectacles (exterior)" + gDPNoOpString(POLY_OPA_DISP++, T("青い眼鏡(外側)", "Blue glasses (outside)"), 1); } - gDPNoOpString(POLY_OPA_DISP++, "魔法のメガネ END", 0); // "Magic lens END" + gDPNoOpString(POLY_OPA_DISP++, T("魔法のメガネ END", "Magic lens END"), 0); CLOSE_DISPS(gfxCtx, "../z_actor.c", 6284); } @@ -3464,9 +3468,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 accce471cb..1e3c6c96ba 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -1,9 +1,8 @@ #include "fault.h" +#include "printf.h" #include "segment_symbols.h" #include "z_actor_dlftbls.h" -#include "macros.h" - // Linker symbol declarations (used in the table below) #define DEFINE_ACTOR(name, _1, _2, _3) DECLARE_OVERLAY_SEGMENT(name) #define DEFINE_ACTOR_INTERNAL(_0, _1, _2, _3) diff --git a/src/code/z_bg_collect.c b/src/code/z_bg_collect.c index bd349765de..01114d835a 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 "actor.h" +#include "bgcheck.h" +#include "player.h" +#include "skin_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 43c32eb558..33cb0fbe82 100644 --- a/src/code/z_bg_item.c +++ b/src/code/z_bg_item.c @@ -1,7 +1,7 @@ #include "z_lib.h" -#include "z64actor.h" -#include "z64bgcheck.h" -#include "z64play.h" +#include "actor.h" +#include "bgcheck.h" +#include "play_state.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 71733baef5..9e71fa6287 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,17 +1,20 @@ #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" +#include "bgcheck.h" +#include "play_state.h" +#include "player.h" +#include "skin_matrix.h" -#pragma increment_block_number "ntsc-1.0:208 ntsc-1.1:208 ntsc-1.2:208" +#pragma increment_block_number "ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144" 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 79516f0171..36c3f0b15f 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -1,30 +1,33 @@ #include "libc64/math64.h" #include "libc64/qrand.h" -#include "ultra64.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 "audio.h" +#include "cutscene_spline.h" +#include "debug.h" +#include "olib.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" -#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: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: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" s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags); s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange); @@ -3658,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:95 ntsc-1.1:95 ntsc-1.2:95 pal-1.0:93 pal-1.1:93" + "ique-cn:128 ntsc-1.0:82 ntsc-1.1:82 ntsc-1.2:82 pal-1.0:82 pal-1.1:82" s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 07a527afe8..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; diff --git a/src/code/z_cheap_proc.inc.c b/src/code/z_cheap_proc.inc.c index e922c0832c..2daaa97601 100644 --- a/src/code/z_cheap_proc.inc.c +++ b/src/code/z_cheap_proc.inc.c @@ -1,7 +1,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" -#include "z64play.h" +#include "play_state.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..5b305764e6 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 "collision_check.h" static DamageTable sDamageTablePresets[] = { { { diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index e05bb44d17..158948a2eb 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,21 +1,23 @@ #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" -#include "z64frame_advance.h" +#include "collision_check.h" +#include "effect.h" +#include "frame_advance.h" #include "zelda_arena.h" -#include "z64play.h" +#include "play_state.h" #include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" #include "z_lib.h" -#pragma increment_block_number "ique-cn:0 ntsc-1.0:248 ntsc-1.1:248 ntsc-1.2:248 pal-1.0:248 pal-1.1:248" +#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*); @@ -3025,7 +3027,7 @@ void CollisionCheck_InitInfo(CollisionCheckInfo* info) { */ void CollisionCheck_ResetDamage(CollisionCheckInfo* info) { info->damage = 0; - info->damageEffect = 0; + info->damageReaction = 0; info->atHitEffect = 0; info->acHitEffect = 0; info->displacement.x = info->displacement.y = info->displacement.z = 0.0f; @@ -3106,7 +3108,7 @@ void CollisionCheck_ApplyDamage(PlayState* play, CollisionCheckContext* colChkCt } damage = tbl->table[i] & 0xF; - col->actor->colChkInfo.damageEffect = tbl->table[i] >> 4 & 0xF; + col->actor->colChkInfo.damageReaction = tbl->table[i] >> 4 & 0xF; } if (!(col->acFlags & AC_HARD)) { col->actor->colChkInfo.damage += damage; diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 97cb44a4f0..1dfd4d2419 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -3,11 +3,11 @@ #include "sequence.h" #include "versions.h" #include "z_locale.h" -#include "z64environment.h" -#include "z64save.h" -#include "z64transition.h" +#include "environment.h" +#include "save.h" +#include "transition.h" -#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" \ "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0" ALIGNED(16) SaveContext gSaveContext; diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 4696cb76e4..fd34ce6733 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -1,12 +1,14 @@ #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" +#include "lifemeter.h" +#include "interface.h" +#include "ocarina.h" +#include "play_state.h" +#include "save.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 d95b2ca7fd..6ff03fdf91 100644 --- a/src/code/z_cutscene_spline.c +++ b/src/code/z_cutscene_spline.c @@ -1,8 +1,7 @@ #include "ultra64.h" -#include "z64math.h" -#include "z64camera.h" -#include "z64cutscene_spline.h" -#include "macros.h" +#include "z_math.h" +#include "camera.h" +#include "cutscene_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 ed02754fc1..6de85056c2 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -1,6 +1,7 @@ #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" @@ -8,9 +9,7 @@ #include "regs.h" #include "rumble.h" #include "ultra64.h" -#include "z64debug.h" - -#include "macros.h" +#include "debug.h" typedef struct DebugCamTextBufferEntry { /* 0x0 */ u8 x; @@ -24,8 +23,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:160 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_debug_display.c b/src/code/z_debug_display.c index 9d15663a67..1481e22fe7 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -1,8 +1,8 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64debug_display.h" +#include "play_state.h" +#include "debug_display.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 921613bd80..5adc6ca48a 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,14 +1,17 @@ -#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" -#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" \ + "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" @@ -16,14 +19,16 @@ #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 "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "camera.h" +#include "cutscene.h" +#include "cutscene_flags.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/scenes/indoors/tokinoma/tokinoma_scene.h" @@ -144,8 +149,8 @@ u16 gCamAtSplinePointsAppliedFrame; u16 gCamEyePointAppliedFrame; u16 gCamAtPointAppliedFrame; -#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:128 ntsc-1.1:128 ntsc-1.2:0 pal-1.0:128 pal-1.1:128" +#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; @@ -383,7 +388,8 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { case CS_MISC_SHOW_TITLE_CARD: if (isFirstFrame) { - TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, player->giObjectSegment, 160, 120, 144, 24, 20); + TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, player->giObjectSegment, 160, 120, + PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 20); } break; diff --git a/src/code/z_draw.c b/src/code/z_draw.c index 9e0dd236eb..f2c600f6a2 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -1,8 +1,8 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" -#include "z64draw.h" -#include "z64play.h" +#include "draw.h" +#include "play_state.h" #include "assets/objects/object_gi_key/object_gi_key.h" #include "assets/objects/object_gi_jewel/object_gi_jewel.h" @@ -84,32 +84,32 @@ #include "assets/objects/object_st/object_st.h" // "Get Item" Model Draw Functions -void GetItem_DrawMaskOrBombchu(PlayState* play, s16 drawId); -void GetItem_DrawSoldOut(PlayState* play, s16 drawId); -void GetItem_DrawBlueFire(PlayState* play, s16 drawId); -void GetItem_DrawPoes(PlayState* play, s16 drawId); -void GetItem_DrawFairy(PlayState* play, s16 drawId); -void GetItem_DrawMirrorShield(PlayState* play, s16 drawId); -void GetItem_DrawSkullToken(PlayState* play, s16 drawId); -void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId); -void GetItem_DrawCompass(PlayState* play, s16 drawId); -void GetItem_DrawPotion(PlayState* play, s16 drawId); -void GetItem_DrawGoronSword(PlayState* play, s16 drawId); -void GetItem_DrawDekuNuts(PlayState* play, s16 drawId); -void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId); -void GetItem_DrawFish(PlayState* play, s16 drawId); -void GetItem_DrawOpa0(PlayState* play, s16 drawId); -void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId); -void GetItem_DrawXlu01(PlayState* play, s16 drawId); -void GetItem_DrawOpa10Xlu2(PlayState* play, s16 drawId); -void GetItem_DrawMagicArrow(PlayState* play, s16 drawId); -void GetItem_DrawMagicSpell(PlayState* play, s16 drawId); -void GetItem_DrawOpa1023(PlayState* play, s16 drawId); -void GetItem_DrawOpa10Xlu32(PlayState* play, s16 drawId); -void GetItem_DrawSmallRupee(PlayState* play, s16 drawId); -void GetItem_DrawScale(PlayState* play, s16 drawId); -void GetItem_DrawBulletBag(PlayState* play, s16 drawId); -void GetItem_DrawWallet(PlayState* play, s16 drawId); +void GetItem_DrawMaskOrBombchu(PlayState* play, s16 giDrawId); +void GetItem_DrawSoldOut(PlayState* play, s16 giDrawId); +void GetItem_DrawBlueFire(PlayState* play, s16 giDrawId); +void GetItem_DrawPoes(PlayState* play, s16 giDrawId); +void GetItem_DrawFairy(PlayState* play, s16 giDrawId); +void GetItem_DrawMirrorShield(PlayState* play, s16 giDrawId); +void GetItem_DrawSkullToken(PlayState* play, s16 giDrawId); +void GetItem_DrawEggOrMedallion(PlayState* play, s16 giDrawId); +void GetItem_DrawCompass(PlayState* play, s16 giDrawId); +void GetItem_DrawPotion(PlayState* play, s16 giDrawId); +void GetItem_DrawGoronSword(PlayState* play, s16 giDrawId); +void GetItem_DrawDekuNuts(PlayState* play, s16 giDrawId); +void GetItem_DrawRecoveryHeart(PlayState* play, s16 giDrawId); +void GetItem_DrawFish(PlayState* play, s16 giDrawId); +void GetItem_DrawOpa0(PlayState* play, s16 giDrawId); +void GetItem_DrawOpa0Xlu1(PlayState* play, s16 giDrawId); +void GetItem_DrawXlu01(PlayState* play, s16 giDrawId); +void GetItem_DrawOpa10Xlu2(PlayState* play, s16 giDrawId); +void GetItem_DrawMagicArrow(PlayState* play, s16 giDrawId); +void GetItem_DrawMagicSpell(PlayState* play, s16 giDrawId); +void GetItem_DrawOpa1023(PlayState* play, s16 giDrawId); +void GetItem_DrawOpa10Xlu32(PlayState* play, s16 giDrawId); +void GetItem_DrawSmallRupee(PlayState* play, s16 giDrawId); +void GetItem_DrawScale(PlayState* play, s16 giDrawId); +void GetItem_DrawBulletBag(PlayState* play, s16 giDrawId); +void GetItem_DrawWallet(PlayState* play, s16 giDrawId); typedef struct DrawItemTableEntry { /* 0x00 */ void (*drawFunc)(PlayState*, s16); @@ -117,260 +117,260 @@ typedef struct DrawItemTableEntry { } DrawItemTableEntry; // size = 0x24 DrawItemTableEntry sDrawItemTable[] = { - // bottle, OBJECT_GI_BOTTLE + // GID_BOTTLE_EMPTY { GetItem_DrawOpa0Xlu1, { gGiBottleStopperDL, gGiBottleDL } }, - // small key, OBJECT_GI_KEY + // GID_SMALL_KEY { GetItem_DrawOpa0, { gGiSmallKeyDL } }, - // minuet of forest, OBJECT_GI_MELODY + // GID_SONG_MINUET { GetItem_DrawXlu01, { gGiMinuetColorDL, gGiSongNoteDL } }, - // bolero of fire, OBJECT_GI_MELODY + // GID_SONG_BOLERO { GetItem_DrawXlu01, { gGiBoleroColorDL, gGiSongNoteDL } }, - // serenade of water, OBJECT_GI_MELODY + // GID_SONG_SERENADE { GetItem_DrawXlu01, { gGiSerenadeColorDL, gGiSongNoteDL } }, - // requiem of spirit, OBJECT_GI_MELODY + // GID_SONG_REQUIEM { GetItem_DrawXlu01, { gGiRequiemColorDL, gGiSongNoteDL } }, - // nocturne of shadow, OBJECT_GI_MELODY + // GID_SONG_NOCTURNE { GetItem_DrawXlu01, { gGiNocturneColorDL, gGiSongNoteDL } }, - // prelude of light, OBJECT_GI_MELODY + // GID_SONG_PRELUDE { GetItem_DrawXlu01, { gGiPreludeColorDL, gGiSongNoteDL } }, - // recovery heart, OBJECT_GI_HEART + // GID_RECOVERY_HEART { GetItem_DrawRecoveryHeart, { gGiRecoveryHeartDL } }, - // boss key, OBJECT_GI_BOSSKEY + // GID_BOSS_KEY { GetItem_DrawOpa0Xlu1, { gGiBossKeyDL, gGiBossKeyGemDL } }, - // compass, OBJECT_GI_COMPASS + // GID_COMPASS { GetItem_DrawCompass, { gGiCompassDL, gGiCompassGlassDL } }, - // forest medallion, OBJECT_GI_MEDAL + // GID_MEDALLION_FOREST { GetItem_DrawEggOrMedallion, { gGiForestMedallionFaceDL, gGiMedallionDL } }, - // fire medallion, OBJECT_GI_MEDAL + // GID_MEDALLION_FIRE { GetItem_DrawEggOrMedallion, { gGiFireMedallionFaceDL, gGiMedallionDL } }, - // water medallion, OBJECT_GI_MEDAL + // GID_MEDALLION_WATER { GetItem_DrawEggOrMedallion, { gGiWaterMedallionFaceDL, gGiMedallionDL } }, - // spirit medallion, OBJECT_GI_MEDAL + // GID_MEDALLION_SPIRIT { GetItem_DrawEggOrMedallion, { gGiSpiritMedallionFaceDL, gGiMedallionDL } }, - // shadow medallion, OBJECT_GI_MEDAL + // GID_MEDALLION_SHADOW { GetItem_DrawEggOrMedallion, { gGiShadowMedallionFaceDL, gGiMedallionDL } }, - // light medallion, OBJECT_GI_MEDAL + // GID_MEDALLION_LIGHT { GetItem_DrawEggOrMedallion, { gGiLightMedallionFaceDL, gGiMedallionDL } }, - // deku nuts, OBJECT_GI_NUTS + // GID_DEKU_NUTS { GetItem_DrawDekuNuts, { gGiNutDL } }, - // heart container, OBJECT_GI_HEARTS + // GID_HEART_CONTAINER { GetItem_DrawXlu01, { gGiHeartBorderDL, gGiHeartContainerDL } }, - // heart piece, OBJECT_GI_HEARTS + // GID_HEART_PIECE { GetItem_DrawXlu01, { gGiHeartBorderDL, gGiHeartPieceDL } }, - // quiver 30, OBJECT_GI_ARROWCASE + // GID_QUIVER_30 { GetItem_DrawOpa1023, { gGiQuiverInnerDL, gGiQuiver30InnerColorDL, gGiQuiver30OuterColorDL, gGiQuiverOuterDL } }, - // quiver 40, OBJECT_GI_ARROWCASE + // GID_QUIVER_40 { GetItem_DrawOpa1023, { gGiQuiverInnerDL, gGiQuiver40InnerColorDL, gGiQuiver40OuterColorDL, gGiQuiverOuterDL } }, - // quiver 50, OBJECT_GI_ARROWCASE + // GID_QUIVER_50 { GetItem_DrawOpa1023, { gGiQuiverInnerDL, gGiQuiver50InnerColorDL, gGiQuiver50OuterColorDL, gGiQuiverOuterDL } }, - // bomb bag 20, OBJECT_GI_BOMBPOUCH + // GID_BOMB_BAG_20 { GetItem_DrawOpa1023, { gGiBombBagDL, gGiBombBag20BagColorDL, gGiBombBag20RingColorDL, gGiBombBagRingDL } }, - // bomb bag 30, OBJECT_GI_BOMBPOUCH + // GID_BOMB_BAG_30 { GetItem_DrawOpa1023, { gGiBombBagDL, gGiBombBag30BagColorDL, gGiBombBag30RingColorDL, gGiBombBagRingDL } }, - // bomb bag 40, OBJECT_GI_BOMBPOUCH + // GID_BOMB_BAG_40 { GetItem_DrawOpa1023, { gGiBombBagDL, gGiBombBag40BagColorDL, gGiBombBag40RingColorDL, gGiBombBagRingDL } }, - // stick, OBJECT_GI_STICK + // GID_DEKU_STICK { GetItem_DrawOpa0, { gGiStickDL } }, - // dungeon map, OBJECT_GI_MAP + // GID_DUNGEON_MAP { GetItem_DrawOpa0, { gGiDungeonMapDL } }, - // deku shield, OBJECT_GI_SHIELD_1 + // GID_SHIELD_DEKU { GetItem_DrawOpa0, { gGiDekuShieldDL } }, - // small magic jar, OBJECT_GI_MAGICPOT + // GID_MAGIC_JAR_SMALL { GetItem_DrawOpa0, { gGiMagicJarSmallDL } }, - // large magic jar, OBJECT_GI_MAGICPOT + // GID_MAGIC_JAR_LARGE { GetItem_DrawOpa0, { gGiMagicJarLargeDL } }, - // bombs, OBJECT_GI_BOMB_1 + // GID_BOMB { GetItem_DrawOpa0, { gGiBombDL } }, - // stone of agony, OBJECT_GI_MAP + // GID_STONE_OF_AGONY { GetItem_DrawOpa0, { gGiStoneOfAgonyDL } }, - // adult's wallet, OBJECT_GI_PURSE + // GID_WALLET_ADULT { GetItem_DrawWallet, { gGiWalletDL, gGiAdultWalletColorDL, gGiAdultWalletRupeeOuterColorDL, gGiWalletRupeeOuterDL, gGiAdultWalletStringColorDL, gGiWalletStringDL, gGiAdultWalletRupeeInnerColorDL, gGiWalletRupeeInnerDL } }, - // giant's wallet, OBJECT_GI_PURSE + // GID_WALLET_GIANT { GetItem_DrawWallet, { gGiWalletDL, gGiGiantsWalletColorDL, gGiGiantsWalletRupeeOuterColorDL, gGiWalletRupeeOuterDL, gGiGiantsWalletStringColorDL, gGiWalletStringDL, gGiGiantsWalletRupeeInnerColorDL, gGiWalletRupeeInnerDL } }, - // gerudo card, OBJECT_GI_GERUDO + // GID_GERUDOS_CARD { GetItem_DrawOpa0, { gGiGerudoCardDL } }, - // arrows (small), OBJECT_GI_ARROW + // GID_ARROWS_5 { GetItem_DrawOpa0, { gGiArrowSmallDL } }, - // arrows (medium), OBJECT_GI_ARROW + // GID_ARROWS_10 { GetItem_DrawOpa0, { gGiArrowMediumDL } }, - // arrows (large), OBJECT_GI_ARROW + // GID_ARROWS_30 { GetItem_DrawOpa0, { gGiArrowLargeDL } }, - // bombchus, OBJECT_GI_BOMB_2 + // GID_BOMBCHU { GetItem_DrawMaskOrBombchu, { gGiBombchuDL } }, - // egg, OBJECT_GI_EGG + // GID_EGG { GetItem_DrawEggOrMedallion, { gGiEggMaterialDL, gGiEggDL } }, - // silver scale, OBJECT_GI_SCALE + // GID_SCALE_SILVER { GetItem_DrawScale, { gGiScaleWaterDL, gGiSilverScaleWaterColorDL, gGiSilverScaleColorDL, gGiScaleDL } }, - // gold scale, OBJECT_GI_SCALE + // GID_SCALE_GOLDEN { GetItem_DrawScale, { gGiScaleWaterDL, gGiGoldenScaleWaterColorDL, gGiGoldenScaleColorDL, gGiScaleDL } }, - // hylian shield, OBJECT_GI_SHIELD_2 + // GID_SHIELD_HYLIAN { GetItem_DrawOpa0, { gGiHylianShieldDL } }, - // hookshot, OBJECT_GI_HOOKSHOT + // GID_HOOKSHOT { GetItem_DrawOpa0, { gGiHookshotDL } }, - // longshot, OBJECT_GI_HOOKSHOT + // GID_LONGSHOT { GetItem_DrawOpa0, { gGiLongshotDL } }, - // ocarina of time, OBJECT_GI_OCARINA + // GID_OCARINA_OF_TIME { GetItem_DrawOpa0Xlu1, { gGiOcarinaTimeDL, gGiOcarinaTimeHolesDL } }, - // milk, OBJECT_GI_MILK + // GID_BOTTLE_MILK_FULL { GetItem_DrawOpa0Xlu1, { gGiMilkBottleContentsDL, gGiMilkBottleDL } }, - // keaton mask, OBJECT_GI_KI_TAN_MASK + // GID_MASK_KEATON { GetItem_DrawOpa0Xlu1, { gGiKeatonMaskDL, gGiKeatonMaskEyesDL } }, - // spooky mask, OBJECT_GI_REDEAD_MASK + // GID_MASK_SPOOKY { GetItem_DrawOpa0, { gGiSpookyMaskDL } }, - // slingshot, OBJECT_GI_PACHINKO + // GID_SLINGSHOT { GetItem_DrawOpa0, { gGiSlingshotDL } }, - // boomerang, OBJECT_GI_BOOMERANG + // GID_BOOMERANG { GetItem_DrawOpa0, { gGiBoomerangDL } }, - // bow, OBJECT_GI_BOW + // GID_BOW { GetItem_DrawOpa0, { gGiBowDL } }, - // lens, OBJECT_GI_GLASSES + // GID_LENS_OF_TRUTH { GetItem_DrawOpa0Xlu1, { gGiLensDL, gGiLensGlassDL } }, - // green potion, OBJECT_GI_LIQUID + // GID_BOTTLE_POTION_GREEN { GetItem_DrawPotion, { gGiPotionPotDL, gGiGreenPotColorDL, gGiGreenLiquidColorDL, gGiPotionLiquidDL, gGiGreenPatternColorDL, gGiPotionPatternDL } }, - // red potion, OBJECT_GI_LIQUID + // GID_BOTTLE_POTION_RED { GetItem_DrawPotion, { gGiPotionPotDL, gGiRedPotColorDL, gGiRedLiquidColorDL, gGiPotionLiquidDL, gGiRedPatternColorDL, gGiPotionPatternDL } }, - // blue potion, OBJECT_GI_LIQUID + // GID_BOTTLE_POTION_BLUE { GetItem_DrawPotion, { gGiPotionPotDL, gGiBluePotColorDL, gGiBlueLiquidColorDL, gGiPotionLiquidDL, gGiBluePatternColorDL, gGiPotionPatternDL } }, - // mirror shield, OBJECT_GI_SHIELD_3 + // GID_SHIELD_MIRROR { GetItem_DrawMirrorShield, { gGiMirrorShieldDL, gGiMirrorShieldSymbolDL } }, - // zelda's letter, OBJECT_GI_LETTER + // GID_ZELDAS_LETTER { GetItem_DrawOpa0Xlu1, { gGiLetterDL, gGiLetterWritingDL } }, - // goron tunic, OBJECT_GI_CLOTHES + // GID_TUNIC_GORON { GetItem_DrawOpa1023, { gGiTunicCollarDL, gGiGoronCollarColorDL, gGiGoronTunicColorDL, gGiTunicDL } }, - // zora tunic, OBJECT_GI_CLOTHES + // GID_TUNIC_ZORA { GetItem_DrawOpa1023, { gGiTunicCollarDL, gGiZoraCollarColorDL, gGiZoraTunicColorDL, gGiTunicDL } }, - // beans, OBJECT_GI_BEAN + // GID_MAGIC_BEAN { GetItem_DrawOpa0, { gGiBeanDL } }, - // fish, OBJECT_GI_FISH + // GID_FISH { GetItem_DrawFish, { gGiFishDL } }, - // saw, OBJECT_GI_SAW + // GID_POACHERS_SAW { GetItem_DrawOpa0, { gGiSawDL } }, - // hammer, OBJECT_GI_HAMMER + // GID_HAMMER { GetItem_DrawOpa0, { gGiHammerDL } }, - // grass, OBJECT_GI_GRASS + // GID_GRASS { GetItem_DrawOpa0, { gGiGrassDL } }, - // biggorons sword, OBJECT_GI_LONGSWORD + // GID_SWORD_BIGGORON { GetItem_DrawGoronSword, { gGiBiggoronSwordDL } }, - // chicken, OBJECT_GI_NIWATORI + // GID_CUCCO { GetItem_DrawOpa10Xlu2, { gGiChickenDL, gGiChickenColorDL, gGiChickenEyesDL } }, - // ruto's letter, OBJECT_GI_BOTTLE_LETTER + // GID_BOTTLE_RUTOS_LETTER { GetItem_DrawOpa0Xlu1, { gGiLetterBottleContentsDL, gGiLetterBottleDL } }, - // fairy ocarina, OBJECT_GI_OCARINA_0 + // GID_OCARINA_FAIRY { GetItem_DrawOpa0Xlu1, { gGiOcarinaFairyDL, gGiOcarinaFairyHolesDL } }, - // iron boots, OBJECT_GI_BOOTS_2 + // GID_BOOTS_IRON { GetItem_DrawOpa0Xlu1, { gGiIronBootsDL, gGiIronBootsRivetsDL } }, - // seeds, OBJECT_GI_SEED + // GID_DEKU_SEEDS { GetItem_DrawOpa0, { gGiSeedDL } }, - // silver gauntlets, OBJECT_GI_GLOVES + // GID_SILVER_GAUNTLETS { GetItem_DrawOpa10Xlu32, { gGiGauntletsDL, gGiSilverGauntletsColorDL, gGiGauntletsPlateDL, gGiSilverGauntletsPlateColorDL } }, - // golden gauntlets, OBJECT_GI_GLOVES + // GID_GOLD_GAUNTLETS { GetItem_DrawOpa10Xlu32, { gGiGauntletsDL, gGiGoldenGauntletsColorDL, gGiGauntletsPlateDL, gGiGoldenGauntletsPlateColorDL } }, - // yellow n coin, OBJECT_GI_COIN + // GID_NCOIN_YELLOW { GetItem_DrawOpa10Xlu2, { gGiCoinDL, gGiYellowCoinColorDL, gGiNDL } }, - // red n coin, OBJECT_GI_COIN + // GID_NCOIN_RED { GetItem_DrawOpa10Xlu2, { gGiCoinDL, gGiRedCoinColorDL, gGiNDL } }, - // green n coin, OBJECT_GI_COIN + // GID_NCOIN_GREEN { GetItem_DrawOpa10Xlu2, { gGiCoinDL, gGiGreenCoinColorDL, gGiNDL } }, - // blue n coin, OBJECT_GI_COIN + // GID_NCOIN_BLUE { GetItem_DrawOpa10Xlu2, { gGiCoinDL, gGiBlueCoinColorDL, gGiNDL } }, - // skull mask, OBJECT_GI_SKJ_MASK + // GID_MASK_SKULL { GetItem_DrawOpa0, { gGiSkullMaskDL } }, - // bunny hood OBJECT_GI_RABIT_MASK + // GID_MASK_BUNNY_HOOD { GetItem_DrawOpa0Xlu1, { gGiBunnyHoodDL, gGiBunnyHoodEyesDL } }, - // mask of truth, OBJECT_GI_TRUTH_MASK + // GID_MASK_TRUTH { GetItem_DrawOpa0Xlu1, { gGiMaskOfTruthDL, gGiMaskOfTruthAccentsDL } }, - // eyedrops, OBJECT_GI_EYE_LOTION + // GID_EYE_DROPS { GetItem_DrawOpa0Xlu1, { gGiEyeDropsCapDL, gGiEyeDropsBottleDL } }, - // odd potion, OBJECT_GI_POWDER + // GID_ODD_POTION { GetItem_DrawOpa0, { gGiOddPotionDL } }, - // odd mushroom, OBJECT_GI_MUSHROOM + // GID_ODD_MUSHROOM { GetItem_DrawOpa0, { gGiOddMushroomDL } }, - // claim check, OBJECT_GI_TICKETSTONE + // GID_CLAIM_CHECK { GetItem_DrawOpa0Xlu1, { gGiClaimCheckDL, gGiClaimCheckWritingDL } }, - // broken goron's sword, OBJECT_GI_BROKENSWORD + // GID_BROKEN_GORONS_SWORD { GetItem_DrawGoronSword, { gGiBrokenGoronSwordDL } }, - // prescription, OBJECT_GI_PRESCRIPTION + // GID_PRESCRIPTION { GetItem_DrawOpa0Xlu1, { gGiPrescriptionDL, gGiPrescriptionWritingDL } }, - // goron bracelet, OBJECT_GI_BRACELET + // GID_GORONS_BRACELET { GetItem_DrawOpa0, { gGiGoronBraceletDL } }, - // sold out, OBJECT_GI_SOLDOUT + // GID_SOLDOUT { GetItem_DrawSoldOut, { gGiSoldOutDL } }, - // frog, OBJECT_GI_FROG + // GID_EYEBALL_FROG { GetItem_DrawOpa0Xlu1, { gGiFrogDL, gGiFrogEyesDL } }, - // goron mask, OBJECT_GI_GOLONMASK + // GID_MASK_GORON { GetItem_DrawMaskOrBombchu, { gGiGoronMaskDL } }, - // zora mask, OBJECT_GI_ZORAMASK + // GID_MASK_ZORA { GetItem_DrawMaskOrBombchu, { gGiZoraMaskDL } }, - // gerudo mask, OBJECT_GI_GERUDOMASK + // GID_MASK_GERUDO { GetItem_DrawMaskOrBombchu, { gGiGerudoMaskDL } }, - // cojiro, OBJECT_GI_NIWATORI + // GID_COJIRO { GetItem_DrawOpa10Xlu2, { gGiChickenDL, gGiCojiroColorDL, gGiChickenEyesDL } }, - // hover boots, OBJECT_GI_HOVERBOOTS + // GID_BOOTS_HOVER { GetItem_DrawOpa0, { gGiHoverBootsDL } }, - // fire arrows, OBJECT_GI_M_ARROW + // GID_ARROW_FIRE { GetItem_DrawMagicArrow, { gGiMagicArrowDL, gGiFireArrowColorDL, gGiArrowMagicDL } }, - // ice arrows, OBJECT_GI_M_ARROW + // GID_ARROW_ICE { GetItem_DrawMagicArrow, { gGiMagicArrowDL, gGiIceArrowColorDL, gGiArrowMagicDL } }, - // light arrows, OBJECT_GI_M_ARROW + // GID_ARROW_LIGHT { GetItem_DrawMagicArrow, { gGiMagicArrowDL, gGiLightArrowColorDL, gGiArrowMagicDL } }, - // skulltula token, OBJECT_GI_SUTARU + // GID_SKULL_TOKEN { GetItem_DrawSkullToken, { gGiSkulltulaTokenDL, gGiSkulltulaTokenFlameDL } }, - // din's fire, OBJECT_GI_GODDESS + // GID_DINS_FIRE { GetItem_DrawMagicSpell, { gGiMagicSpellDiamondDL, gGiDinsFireColorDL, gGiMagicSpellOrbDL } }, - // farore's wind, OBJECT_GI_GODDESS + // GID_FARORES_WIND { GetItem_DrawMagicSpell, { gGiMagicSpellDiamondDL, gGiFaroresWindColorDL, gGiMagicSpellOrbDL } }, - // nayru's Love, OBJECT_GI_GODDESS + // GID_NAYRUS_LOVE { GetItem_DrawMagicSpell, { gGiMagicSpellDiamondDL, gGiNayrusLoveColorDL, gGiMagicSpellOrbDL } }, - // blue fire, OBJECT_GI_FIRE + // GID_BLUE_FIRE { GetItem_DrawBlueFire, { gGiBlueFireChamberstickDL, gGiBlueFireFlameDL } }, - // bugs, OBJECT_GI_INSECT + // GID_BUG { GetItem_DrawOpa0Xlu1, { gGiBugsContainerDL, gGiBugsGlassDL } }, - // butterfly, OBJECT_GI_BUTTERFLY + // GID_BUTTERFLY { GetItem_DrawOpa0Xlu1, { gGiButterflyContainerDL, gGiButterflyGlassDL } }, - // poe, OBJECT_GI_GHOST + // GID_POE { GetItem_DrawPoes, { gGiGhostContainerLidDL, gGiGhostContainerGlassDL, gGiGhostContainerContentsDL, gGiPoeColorDL } }, - // fairy, OBJECT_GI_SOUL + // GID_FAIRY { GetItem_DrawFairy, { gGiFairyContainerBaseCapDL, gGiFairyContainerGlassDL, gGiFairyContainerContentsDL } }, - // bullet bag 40, OBJECT_GI_DEKUPOUCH + // GID_BULLET_BAG { GetItem_DrawBulletBag, { gGiBulletBagDL, gGiBulletBagColorDL, gGiBulletBagStringDL, gGiBulletBagStringColorDL, gGiBulletBagWritingDL } }, - // green rupee, OBJECT_GI_RUPY + // GID_RUPEE_GREEN { GetItem_DrawSmallRupee, { gGiRupeeInnerDL, gGiGreenRupeeInnerColorDL, gGiRupeeOuterDL, gGiGreenRupeeOuterColorDL } }, - // blue rupee, OBJECT_GI_RUPY + // GID_RUPEE_BLUE { GetItem_DrawSmallRupee, { gGiRupeeInnerDL, gGiBlueRupeeInnerColorDL, gGiRupeeOuterDL, gGiBlueRupeeOuterColorDL } }, - // red rupee, OBJECT_GI_RUPY + // GID_RUPEE_RED { GetItem_DrawSmallRupee, { gGiRupeeInnerDL, gGiRedRupeeInnerColorDL, gGiRupeeOuterDL, gGiRedRupeeOuterColorDL } }, - // big poe, OBJECT_GI_GHOST + // GID_BIG_POE { GetItem_DrawPoes, { gGiGhostContainerLidDL, gGiGhostContainerGlassDL, gGiGhostContainerContentsDL, gGiBigPoeColorDL } }, - // purple rupee, OBJECT_GI_RUPY + // GID_RUPEE_PURPLE { GetItem_DrawOpa10Xlu32, { gGiRupeeInnerDL, gGiPurpleRupeeInnerColorDL, gGiRupeeOuterDL, gGiPurpleRupeeOuterColorDL } }, - // gold rupee, OBJECT_GI_RUPY + // GID_RUPEE_GOLD { GetItem_DrawOpa10Xlu32, { gGiRupeeInnerDL, gGiGoldRupeeInnerColorDL, gGiRupeeOuterDL, gGiGoldRupeeOuterColorDL } }, - // bullet bag 50, OBJECT_GI_DEKUPOUCH + // GID_BULLET_BAG_50 { GetItem_DrawBulletBag, { gGiBulletBagDL, gGiBulletBag50ColorDL, gGiBulletBagStringDL, gGiBulletBag50StringColorDL, gGiBulletBagWritingDL } }, - // kokiri sword, OBJECT_GI_SWORD_1 + // GID_SWORD_KOKIRI { GetItem_DrawOpa0, { gGiKokiriSwordDL } }, - // gold skulltula token, OBJECT_ST + // GID_SKULL_TOKEN_2 { GetItem_DrawSkullToken, { gSkulltulaTokenDL, gSkulltulaTokenFlameDL } }, }; @@ -378,44 +378,44 @@ DrawItemTableEntry sDrawItemTable[] = { * Draw "Get Item" Model * Calls the corresponding draw function for the given draw ID */ -void GetItem_Draw(PlayState* play, s16 drawId) { - sDrawItemTable[drawId].drawFunc(play, drawId); +void GetItem_Draw(PlayState* play, s16 giDrawId) { + sDrawItemTable[giDrawId].drawFunc(play, giDrawId); } // All remaining functions in this file are draw functions referenced in the table and called by the function above -void GetItem_DrawMaskOrBombchu(PlayState* play, s16 drawId) { +void GetItem_DrawMaskOrBombchu(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 556); Gfx_SetupDL_26Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 560); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 565); } -void GetItem_DrawSoldOut(PlayState* play, s16 drawId) { +void GetItem_DrawSoldOut(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 572); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 576); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 581); } -void GetItem_DrawBlueFire(PlayState* play, s16 drawId) { +void GetItem_DrawBlueFire(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 588); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 592); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, @@ -426,24 +426,24 @@ void GetItem_DrawBlueFire(PlayState* play, s16 drawId) { Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 615); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 621); } -void GetItem_DrawPoes(PlayState* play, s16 drawId) { +void GetItem_DrawPoes(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 628); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 632); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 641); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 16, 32, 1, 1 * (play->state.frames * 1), @@ -451,25 +451,25 @@ void GetItem_DrawPoes(PlayState* play, s16 drawId) { Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 656); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[3]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 663); } -void GetItem_DrawFairy(PlayState* play, s16 drawId) { +void GetItem_DrawFairy(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 670); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 674); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 683); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 32, 32, 1, 1 * (play->state.frames * 1), @@ -477,13 +477,13 @@ void GetItem_DrawFairy(PlayState* play, s16 drawId) { Matrix_Push(); Matrix_ReplaceRotation(&play->billboardMtxF); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 698); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 704); } -void GetItem_DrawMirrorShield(PlayState* play, s16 drawId) { +void GetItem_DrawMirrorShield(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 712); @@ -494,23 +494,23 @@ void GetItem_DrawMirrorShield(PlayState* play, s16 drawId) { 1 * (play->state.frames * 2) % 256, 64, 64, 1, 0 * (play->state.frames * 0) % 128, 1 * (play->state.frames * 1) % 128, 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 723); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 730); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 735); } -void GetItem_DrawSkullToken(PlayState* play, s16 drawId) { +void GetItem_DrawSkullToken(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 742); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 746); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, @@ -518,13 +518,13 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) { 1 * -(play->state.frames * 5), 32, 32, 1, 0 * (play->state.frames * 0), 0 * (play->state.frames * 0), 32, 64)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 760); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 765); } -void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId) { - DrawItemTableEntry* entry = &sDrawItemTable[drawId]; +void GetItem_DrawEggOrMedallion(PlayState* play, s16 giDrawId) { + DrawItemTableEntry* entry = &sDrawItemTable[giDrawId]; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772); @@ -536,23 +536,23 @@ void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId) { CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 783); } -void GetItem_DrawCompass(PlayState* play, s16 drawId) { +void GetItem_DrawCompass(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 811); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 815); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 822); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 827); } -void GetItem_DrawPotion(PlayState* play, s16 drawId) { +void GetItem_DrawPotion(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 834); @@ -563,20 +563,20 @@ void GetItem_DrawPotion(PlayState* play, s16 drawId) { 1 * (play->state.frames * 1), 32, 32, 1, -1 * (play->state.frames * 1), 1 * (play->state.frames * 1), 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 845); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[2]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[3]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 855); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[5]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[4]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[5]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 861); } -void GetItem_DrawGoronSword(PlayState* play, s16 drawId) { +void GetItem_DrawGoronSword(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 868); @@ -587,12 +587,12 @@ void GetItem_DrawGoronSword(PlayState* play, s16 drawId) { 0 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 1), 0 * (play->state.frames * 1), 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 878); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 883); } -void GetItem_DrawDekuNuts(PlayState* play, s16 drawId) { +void GetItem_DrawDekuNuts(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 890); @@ -603,12 +603,12 @@ void GetItem_DrawDekuNuts(PlayState* play, s16 drawId) { 1 * (play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 6), 1 * (play->state.frames * 6), 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 901); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 906); } -void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId) { +void GetItem_DrawRecoveryHeart(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 913); @@ -619,12 +619,12 @@ void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId) { 1 * -(play->state.frames * 3), 32, 32, 1, 0 * (play->state.frames * 1), 1 * -(play->state.frames * 2), 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 924); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 929); } -void GetItem_DrawFish(PlayState* play, s16 drawId) { +void GetItem_DrawFish(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 936); @@ -635,41 +635,41 @@ void GetItem_DrawFish(PlayState* play, s16 drawId) { 1 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 0), 1 * (play->state.frames * 1), 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 947); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 952); } -void GetItem_DrawOpa0(PlayState* play, s16 drawId) { +void GetItem_DrawOpa0(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 959); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 963); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 968); } -void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId) { +void GetItem_DrawOpa0Xlu1(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 975); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 979); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 986); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 991); } -void GetItem_DrawXlu01(PlayState* play, s16 drawId) { - DrawItemTableEntry* entry = &sDrawItemTable[drawId]; +void GetItem_DrawXlu01(PlayState* play, s16 giDrawId) { + DrawItemTableEntry* entry = &sDrawItemTable[giDrawId]; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998); @@ -681,41 +681,41 @@ void GetItem_DrawXlu01(PlayState* play, s16 drawId) { CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1008); } -void GetItem_DrawOpa10Xlu2(PlayState* play, s16 drawId) { +void GetItem_DrawOpa10Xlu2(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1015); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1019); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1027); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1032); } -void GetItem_DrawMagicArrow(PlayState* play, s16 drawId) { +void GetItem_DrawMagicArrow(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1039); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1043); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1050); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1056); } -void GetItem_DrawMagicSpell(PlayState* play, s16 drawId) { +void GetItem_DrawMagicSpell(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1063); @@ -726,47 +726,47 @@ void GetItem_DrawMagicSpell(PlayState* play, s16 drawId) { 1 * -(play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 1), -1 * (play->state.frames * 2), 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1074); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[0]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1081); } -void GetItem_DrawOpa1023(PlayState* play, s16 drawId) { +void GetItem_DrawOpa1023(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1088); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1092); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[2]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[3]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1100); } -void GetItem_DrawOpa10Xlu32(PlayState* play, s16 drawId) { +void GetItem_DrawOpa10Xlu32(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1108); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1112); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1120); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[3]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1126); } -void GetItem_DrawSmallRupee(PlayState* play, s16 drawId) { +void GetItem_DrawSmallRupee(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1133); @@ -775,18 +775,18 @@ void GetItem_DrawSmallRupee(PlayState* play, s16 drawId) { Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1140); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); Gfx_SetupDL_25Xlu(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1148); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[3]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1154); } -void GetItem_DrawScale(PlayState* play, s16 drawId) { +void GetItem_DrawScale(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1162); @@ -797,16 +797,16 @@ void GetItem_DrawScale(PlayState* play, s16 drawId) { -1 * (play->state.frames * 2), 64, 64, 1, 1 * (play->state.frames * 4), 1 * -(play->state.frames * 4), 32, 32)); MATRIX_FINALIZE_AND_LOAD(POLY_XLU_DISP++, play->state.gfxCtx, "../z_draw.c", 1173); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[2]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[3]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[giDrawId].dlists[0]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1181); } -void GetItem_DrawBulletBag(PlayState* play, s16 drawId) { - DrawItemTableEntry* entry = &sDrawItemTable[drawId]; +void GetItem_DrawBulletBag(PlayState* play, s16 giDrawId) { + DrawItemTableEntry* entry = &sDrawItemTable[giDrawId]; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188); @@ -824,21 +824,21 @@ void GetItem_DrawBulletBag(PlayState* play, s16 drawId) { CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1207); } -void GetItem_DrawWallet(PlayState* play, s16 drawId) { +void GetItem_DrawWallet(PlayState* play, s16 giDrawId) { s32 pad; OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1214); Gfx_SetupDL_25Opa(play->state.gfxCtx); MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_draw.c", 1218); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[4]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[5]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[6]); - gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[7]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[1]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[0]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[2]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[3]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[4]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[5]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[6]); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[giDrawId].dlists[7]); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1230); } diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index d44007bb76..a5df803229 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -1,14 +1,13 @@ #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 "macros.h" -#include "global.h" +#include "effect.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index e4e331964e..051731fd87 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -1,14 +1,14 @@ #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "terminal.h" -#include "z64effect.h" -#include "z64light.h" -#include "z64play.h" -#include "z64skin_matrix.h" - -#include "macros.h" -#include "global.h" +#include "translation.h" +#include "effect.h" +#include "light.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index f14c8160fe..ae6a84c47d 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -1,13 +1,13 @@ #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" - -#include "macros.h" -#include "global.h" +#include "translation.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c index c752738725..b29cb0a32f 100644 --- a/src/code/z_eff_ss_dead.c +++ b/src/code/z_eff_ss_dead.c @@ -1,6 +1,6 @@ #include "gfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.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 02ba00a8dd..a725cd3172 100644 --- a/src/code/z_effect.c +++ b/src/code/z_effect.c @@ -1,7 +1,9 @@ #include "gfx.h" -#include "z64effect.h" -#include "z64frame_advance.h" -#include "z64play.h" +#include "printf.h" +#include "translation.h" +#include "effect.h" +#include "frame_advance.h" +#include "play_state.h" EffectContext sEffectContext; diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 2acddc4bf0..363367a85c 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -1,10 +1,13 @@ #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" +#include "frame_advance.h" +#include "effect.h" +#include "play_state.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..7a5f7e4e49 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 "effect.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 c04e76128e..fea0102140 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -1,4 +1,5 @@ #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" @@ -6,10 +7,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "skin_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" @@ -70,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 bb93099363..9eef37ef6c 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -1,10 +1,10 @@ -#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" +#include "translation.h" +#include "play_state.h" +#include "player.h" +#include "quest_hint.h" +#include "quest_hint_commands.h" +#include "save.h" QuestHintCmd sChildSariaQuestHints[] = { QUEST_HINT_STRENGTH_UPG(SKIP, 0, false, 3), @@ -73,7 +73,7 @@ u32 QuestHint_CheckCondition(QuestHintCmd* hintCmd) { } } - LOG_STRING("企画外 条件", "../z_elf_message.c", 156); // "Unplanned conditions" + LOG_STRING_T("企画外 条件", "Unplanned conditions", "../z_elf_message.c", 156); ASSERT(0, "0", "../z_elf_message.c", 157); return false; @@ -170,7 +170,7 @@ u16 QuestHint_GetTextIdFromScript(QuestHintCmd* hintCmd) { return hintCmd->byte2 | 0x100; default: - LOG_STRING("企画外 条件", "../z_elf_message.c", 281); // "Unplanned conditions" + LOG_STRING_T("企画外 条件", "Unplanned conditions", "../z_elf_message.c", 281); ASSERT(0, "0", "../z_elf_message.c", 282); } diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 9b2bf7c0b7..12d31b4f0a 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -4,7 +4,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.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 aa757f8643..43668baebb 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -12,17 +12,17 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64draw.h" -#include "z64effect.h" -#include "z64item.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "draw.h" +#include "effect.h" +#include "item.h" +#include "play_state.h" +#include "player.h" +#include "save.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.0: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 9ad7e7a024..858061d4f5 100644 --- a/src/code/z_env_flags.c +++ b/src/code/z_env_flags.c @@ -1,6 +1,7 @@ +#include "array_count.h" #include "ultra64.h" -#include "z64cutscene_flags.h" -#include "z64play.h" +#include "cutscene_flags.h" +#include "play_state.h" void CutsceneFlags_UnsetAll(PlayState* play) { u8 i; diff --git a/src/code/z_face_reaction.c b/src/code/z_face_reaction.c index ea6313a762..470c454b7d 100644 --- a/src/code/z_face_reaction.c +++ b/src/code/z_face_reaction.c @@ -1,6 +1,6 @@ #include "ultra64.h" -#include "z64face_reaction.h" -#include "z64player.h" +#include "face_reaction.h" +#include "player.h" u16 sMaskReactionSetTextIds[MASK_REACTION_SET_MAX][PLAYER_MASK_MAX] = { // MASK_REACTION_SET_CARPENTER_BOSS diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index 246e27b1a3..b37c4aeb39 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -9,14 +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 "transition_tile.h" + #include "libc64/malloc.h" #include "libc64/sleep.h" #include "libu64/debug.h" #include "gfx.h" -#include "z64math.h" -#include "z64transition_instances.h" - -#include "macros.h" +#include "printf.h" +#include "z_math.h" +#include "transition_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 c25f174a75..0a7dabdd6b 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -1,6 +1,9 @@ -#include "gfx.h" +#include "transition_circle.h" -#include "global.h" +#include "color.h" +#include "gfx.h" +#include "sfx.h" +#include "transition.h" typedef enum TransitionCircleDirection { /* 0 */ TRANS_CIRCLE_DIR_IN, @@ -12,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 3375628cb0..4798a225a8 100644 --- a/src/code/z_fbdemo_fade.c +++ b/src/code/z_fbdemo_fade.c @@ -1,12 +1,13 @@ -#include "ultra64.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" - -#include "macros.h" +#include "save.h" +#include "transition_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..b1a5b2e679 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 "z_math.h" +#include "transition_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 a3418e91a3..6a5dd62e5c 100644 --- a/src/code/z_fbdemo_wipe1.c +++ b/src/code/z_fbdemo_wipe1.c @@ -1,41 +1,15 @@ +#include "transition_wipe.h" + #include "gfx.h" -#include "z64save.h" -#include "z64transition_instances.h" +#include "save.h" +#include "transition_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..774f4137f7 100644 --- a/src/code/z_fcurve_data.c +++ b/src/code/z_fcurve_data.c @@ -2,8 +2,7 @@ * File: z_fcurve_data.c * Description: Interpolation functions for use with Curve SkelAnime */ -#include "global.h" -#include "z64curve.h" +#include "curve.h" #define FCURVE_INTERP_CUBIC 0 // Interpolate using a Hermite cubic spline #define FCURVE_INTERP_NONE 1 // Return the value at the left endpoint instead of interpolating diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index 3797449312..da1325ee17 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -26,13 +26,15 @@ */ #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" +#include "actor.h" +#include "curve.h" +#include "play_state.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 5c8f685f22..05d839539a 100644 --- a/src/code/z_frame_advance.c +++ b/src/code/z_frame_advance.c @@ -1,10 +1,9 @@ -#include "z64frame_advance.h" +#include "frame_advance.h" #include "stdbool.h" #include "controller.h" #include "libu64/pad.h" -#include "macros.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 57efe90dfc..84fca6ba63 100644 --- a/src/code/z_game_dlftbls.c +++ b/src/code/z_game_dlftbls.c @@ -5,7 +5,7 @@ #include "setup_state.h" #include "title_setup_state.h" #include "z_game_dlftbls.h" -#include "z64play.h" +#include "play_state.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 20814a4c74..12d94eaa3a 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -1,14 +1,12 @@ +#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" - -#include "macros.h" -#include "global.h" +#include "game_over.h" +#include "play_state.h" +#include "save.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 800f72c738..ab556c3d13 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -1,10 +1,13 @@ +#include "array_count.h" #include "terminal.h" #include "z_lib.h" +#include "printf.h" #include "regs.h" -#include "z64horse.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "translation.h" +#include "horse.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" /** diff --git a/src/code/z_inventory.c b/src/code/z_inventory.c index bb4bb5f850..8ae2bcbf20 100644 --- a/src/code/z_inventory.c +++ b/src/code/z_inventory.c @@ -1,7 +1,9 @@ #include "ultra64.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "printf.h" +#include "translation.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/textures/icon_item_static/icon_item_static.h" #include "assets/textures/icon_item_24_static/icon_item_24_static.h" diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 81e2999462..4413e8ae69 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -1,11 +1,13 @@ -#include "global.h" -#include "ultra64.h" -#include "attributes.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 "macros.h" +#include "translation.h" +#include "ultra64.h" #define MARKER_ESCAPE 0x00 #define MARKER_SOI 0xD8 @@ -46,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 9fa8f5ebc3..63bc6e0fdc 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -1,11 +1,12 @@ #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 "z64play.h" - -#include "macros.h" +#include "translation.h" +#include "play_state.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 cacd46abe3..73d3b20dbf 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,14 +1,14 @@ -#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:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:144 pal-1.1:144" +#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:64" \ + "ntsc-1.0:96 ntsc-1.1:96 ntsc-1.2:96 pal-1.0:96 pal-1.1:96" #include "libu64/debug.h" #include "kaleido_manager.h" #include "letterbox.h" +#include "printf.h" #include "regs.h" #include "terminal.h" -#include "z64play.h" - -#include "global.h" +#include "translation.h" +#include "play_state.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 cc1621947d..b3ef531649 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -3,10 +3,11 @@ #if PLATFORM_N64 #include "n64dd.h" #endif +#include "printf.h" #include "regs.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64save.h" +#include "audio.h" +#include "play_state.h" +#include "save.h" /* * The following three arrays are effectively unused. @@ -78,7 +79,7 @@ void KaleidoSetup_Update(PlayState* play) { if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) { if (DEBUG_FEATURES && BREG(0)) { - pauseCtx->debugState = 3; + pauseCtx->debugState = PAUSE_DEBUG_STATE_FLAG_SET_OPEN; } } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { // The start button was pressed, pause @@ -133,7 +134,7 @@ void KaleidoSetup_Init(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; pauseCtx->state = PAUSE_STATE_OFF; - pauseCtx->debugState = 0; + pauseCtx->debugState = PAUSE_DEBUG_STATE_CLOSED; pauseCtx->eye.x = pauseCtx->eye.y = 0.0f; pauseCtx->eye.z = 64.0f; @@ -159,8 +160,8 @@ void KaleidoSetup_Init(PlayState* play) { pauseCtx->cursorY[PAUSE_MAP] = 0; pauseCtx->cursorX[PAUSE_QUEST] = 0; pauseCtx->cursorY[PAUSE_QUEST] = 0; - pauseCtx->cursorX[PAUSE_EQUIP] = 1; - pauseCtx->cursorY[PAUSE_EQUIP] = 0; + pauseCtx->cursorX[PAUSE_EQUIP] = EQUIP_VALUE_SWORD_KOKIRI; + pauseCtx->cursorY[PAUSE_EQUIP] = EQUIP_TYPE_SWORD; pauseCtx->cursorItem[PAUSE_ITEM] = PAUSE_ITEM_NONE; pauseCtx->cursorItem[PAUSE_MAP] = VREG(30) + 3; diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index 21ba416b35..280bfa3df8 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -1,12 +1,12 @@ #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" - -#include "macros.h" +#include "dma.h" +#include "font.h" +#include "message.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 ff23bbebc2..bdb35093b2 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -1,13 +1,15 @@ -#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:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64" +#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 "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" @@ -19,15 +21,16 @@ #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 "audio.h" +#include "cutscene.h" +#include "frame_advance.h" +#include "environment.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" @@ -235,8 +238,8 @@ s16 sLightningFlashAlpha; s16 sSunDepthTestX; s16 sSunDepthTestY; -#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \ - "ique-cn:160 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: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; @@ -903,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 cab9737ff7..8ebefa7e62 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -3,10 +3,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64lifemeter.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "lifemeter.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/textures/parameter_static/parameter_static.h" diff --git a/src/code/z_lights.c b/src/code/z_lights.c index e9f5338503..4059faacaa 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -1,9 +1,10 @@ +#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 "light.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 502eb43c3c..f2c204c07f 100644 --- a/src/code/z_map_data.c +++ b/src/code/z_map_data.c @@ -1,5 +1,5 @@ #include "map.h" -#include "z64save.h" +#include "save.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 78371084b5..ba6cb77f0a 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -5,15 +5,17 @@ #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 "z64play.h" -#include "z64player.h" -#include "z64save.h" - -#include "global.h" +#include "translation.h" +#include "map_mark.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/textures/parameter_static/parameter_static.h" diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 600aa2189c..5abc554de4 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -1,19 +1,20 @@ #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 "assets/textures/parameter_static/parameter_static.h" -#if PLATFORM_N64 -#include "n64dd.h" -#endif -#include "z64map_mark.h" -#include "z64play.h" -#include "z64save.h" +#include "translation.h" +#include "map_mark.h" +#include "play_state.h" +#include "save.h" -#include "global.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 88c219d37d..1fc06d7407 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -1,30 +1,33 @@ #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" #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" - -#include "global.h" +#include "audio.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/textures/parameter_static/parameter_static.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" +#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 33abd83f7f..e26ce68e7f 100644 --- a/src/code/z_moji.c +++ b/src/code/z_moji.c @@ -3,9 +3,7 @@ */ #include "gfx.h" - -#include "macros.h" -#include "global.h" +#include "printf.h" // how big to draw the characters on screen #define DISP_CHAR_WIDTH 8 diff --git a/src/code/z_olib.c b/src/code/z_olib.c index 66c767f68b..1ee420025b 100644 --- a/src/code/z_olib.c +++ b/src/code/z_olib.c @@ -1,6 +1,6 @@ -#include "z64math.h" +#include "z_math.h" #include "libc64/math64.h" -#include "z64olib.h" +#include "olib.h" #include "z_lib.h" /** diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index 6a4c896ac7..12dc2d2568 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -1,15 +1,18 @@ +#include "one_point_cutscene.h" + #include "libc64/math64.h" #include "libc64/qrand.h" -#include "one_point_cutscene.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 "olib.h" +#include "play_state.h" +#include "player.h" +#include "save.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 2c9b219501..7c97802888 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1,9 +1,13 @@ +#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" @@ -11,21 +15,22 @@ #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 "global.h" +#include "audio.h" +#include "lifemeter.h" +#include "horse.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.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" +#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" + typedef struct RestrictionFlags { /* 0x00 */ u8 sceneId; /* 0x01 */ u8 flags1; @@ -2160,7 +2165,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); } } @@ -3218,7 +3223,7 @@ void Interface_Draw(PlayState* play) { gSPSegment(OVERLAY_DISP++, 0x08, interfaceCtx->iconItemSegment); gSPSegment(OVERLAY_DISP++, 0x0B, interfaceCtx->mapSegment); - if (pauseCtx->debugState == 0) { + if (pauseCtx->debugState == PAUSE_DEBUG_STATE_CLOSED) { Interface_InitVertices(play); func_8008A994(interfaceCtx); Health_DrawMeter(play); @@ -3487,7 +3492,8 @@ void Interface_Draw(PlayState* play) { } gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[PAUSE_CURSOR_QUAD_4 * 4], 4, 0); - gDPLoadTextureBlock(OVERLAY_DISP++, gMagicArrowEquipEffectTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, + gDPLoadTextureBlock(OVERLAY_DISP++, gMagicArrowEquipEffectTex, G_IM_FMT_IA, G_IM_SIZ_8b, + gMagicArrowEquipEffectTex_WIDTH, gMagicArrowEquipEffectTex_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); } @@ -4022,7 +4028,7 @@ void Interface_Draw(PlayState* play) { } #if DEBUG_FEATURES - if (pauseCtx->debugState == 3) { + if (pauseCtx->debugState == PAUSE_DEBUG_STATE_FLAG_SET_OPEN) { FlagSet_Update(play); } #endif diff --git a/src/code/z_path.c b/src/code/z_path.c index 29b51a8f17..f025f04499 100644 --- a/src/code/z_path.c +++ b/src/code/z_path.c @@ -1,9 +1,9 @@ #include "ultra64.h" #include "libc64/math64.h" #include "segmented_address.h" -#include "z64actor.h" -#include "z64path.h" -#include "z64play.h" +#include "actor.h" +#include "path.h" +#include "play_state.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 13ce984512..590680da25 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,7 +1,9 @@ #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 "file_select_state.h" @@ -14,6 +16,7 @@ #include "n64dd.h" #endif #include "one_point_cutscene.h" +#include "printf.h" #include "quake.h" #include "regs.h" #include "rumble.h" @@ -24,23 +27,28 @@ #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 "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" +#include "audio.h" +#include "cutscene_flags.h" +#include "debug_display.h" +#include "effect.h" +#include "frame_advance.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "vis.h" -#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 ique-cn:0" \ - "ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:224 pal-1.1:224" +#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; @@ -576,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)) { @@ -887,8 +895,8 @@ void Play_Update(PlayState* this) { this->envCtx.sandstormState = SANDSTORM_DISSIPATE; this->envCtx.sandstormPrimA = 255; this->envCtx.sandstormEnvA = 255; - // "It's here!!!!!!!!!" - LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", 3471); + LOG_STRING_T("来た!!!!!!!!!!!!!!!!!!!!!", "It's here!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", + 3471); this->transitionMode = TRANS_MODE_SANDSTORM_END; } else { this->transitionMode = TRANS_MODE_SANDSTORM_INIT; @@ -1137,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); @@ -1598,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 eb52aff798..5838188ab6 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -1,8 +1,8 @@ #include "kaleido_manager.h" -#include "z64actor.h" -#include "z64actor_profile.h" -#include "z64play.h" -#include "z64player.h" +#include "actor.h" +#include "actor_profile.h" +#include "play_state.h" +#include "player.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index adefea26a7..7358db96d5 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -6,19 +6,19 @@ #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 "draw.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "skin_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" \ - "pal-1.0:0 pal-1.1:0" +#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 pal-1.0:0" \ + "pal-1.1:0" typedef struct BowSlingshotStringData { /* 0x00 */ Gfx* dList; @@ -970,7 +970,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) { return envHazard + 1; } -u8 sPlayerFaces[PLAYER_FACE_MAX][PLAYER_FACEPART_MAX] = { +PlayerFaceIndices sPlayerFaces[PLAYER_FACE_MAX] = { // The first 6 faces defined must be default blinking faces. See relevant code in `Player_UpdateCommon`. { PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_NEUTRAL { PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_NEUTRAL_BLINKING_HALF @@ -984,12 +984,12 @@ u8 sPlayerFaces[PLAYER_FACE_MAX][PLAYER_FACEPART_MAX] = { { PLAYER_EYES_CLOSED, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_NEUTRAL_BLINKING_CLOSED_2 // The rest of these faces go unused. Face data encoded within animations handles all other faces. - { PLAYER_EYES_RIGHT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_LOOK_RIGHT + { PLAYER_EYES_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_LOOK_LEFT { PLAYER_EYES_WIDE, PLAYER_MOUTH_HALF }, // PLAYER_FACE_SURPRISED { PLAYER_EYES_WINCING, PLAYER_MOUTH_OPEN }, // PLAYER_FACE_HURT { PLAYER_EYES_OPEN, PLAYER_MOUTH_OPEN }, // PLAYER_FACE_GASP - { PLAYER_EYES_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_LOOK_LEFT - { PLAYER_EYES_RIGHT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_LOOK_RIGHT_2 + { PLAYER_EYES_RIGHT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_LOOK_RIGHT + { PLAYER_EYES_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_LOOK_LEFT_2 { PLAYER_EYES_CLOSED, PLAYER_MOUTH_OPEN }, // PLAYER_FACE_EYES_CLOSED_MOUTH_OPEN { PLAYER_EYES_HALF, PLAYER_MOUTH_HALF }, // PLAYER_FACE_OPENING { PLAYER_EYES_OPEN, PLAYER_MOUTH_OPEN }, // PLAYER_FACE_EYES_AND_MOUTH_OPEN @@ -1007,8 +1007,8 @@ void* sEyeTextures[PLAYER_EYES_MAX] = { gLinkAdultEyesOpenTex, // PLAYER_EYES_OPEN gLinkAdultEyesHalfTex, // PLAYER_EYES_HALF gLinkAdultEyesClosedfTex, // PLAYER_EYES_CLOSED - gLinkAdultEyesLeftTex, // PLAYER_EYES_LEFT gLinkAdultEyesRightTex, // PLAYER_EYES_RIGHT + gLinkAdultEyesLeftTex, // PLAYER_EYES_LEFT gLinkAdultEyesWideTex, // PLAYER_EYES_WIDE gLinkAdultEyesDownTex, // PLAYER_EYES_DOWN gLinkAdultEyesWincingTex, // PLAYER_EYES_WINCING @@ -1027,8 +1027,8 @@ void* sEyeTextures[][PLAYER_EYES_MAX] = { gLinkAdultEyesOpenTex, // PLAYER_EYES_OPEN gLinkAdultEyesHalfTex, // PLAYER_EYES_HALF gLinkAdultEyesClosedfTex, // PLAYER_EYES_CLOSED - gLinkAdultEyesLeftTex, // PLAYER_EYES_LEFT gLinkAdultEyesRightTex, // PLAYER_EYES_RIGHT + gLinkAdultEyesLeftTex, // PLAYER_EYES_LEFT gLinkAdultEyesWideTex, // PLAYER_EYES_WIDE gLinkAdultEyesDownTex, // PLAYER_EYES_DOWN gLinkAdultEyesWincingTex, // PLAYER_EYES_WINCING @@ -1037,8 +1037,14 @@ void* sEyeTextures[][PLAYER_EYES_MAX] = { gLinkChildEyesOpenTex, // PLAYER_EYES_OPEN gLinkChildEyesHalfTex, // PLAYER_EYES_HALF gLinkChildEyesClosedfTex, // PLAYER_EYES_CLOSED - gLinkChildEyesLeftTex, // PLAYER_EYES_LEFT - gLinkChildEyesRightTex, // PLAYER_EYES_RIGHT + /* + Note `PLAYER_EYES_RIGHT` corresponds to the "left" eyes texture, and vice-versa with the "right" eyes textures. + This is because on the textures Link appears to look left/right as if facing outwards the screen, + but the image is mirrored by the child Link model's UVs, reversing the direction actually looked in, + which results in-game in the correct eyes direction. + */ + gLinkChildEyesLeftTex, // PLAYER_EYES_RIGHT + gLinkChildEyesRightTex, // PLAYER_EYES_LEFT gLinkChildEyesWideTex, // PLAYER_EYES_WIDE gLinkChildEyesDownTex, // PLAYER_EYES_DOWN gLinkChildEyesWincingTex, // PLAYER_EYES_WINCING @@ -1093,7 +1099,7 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL // If the eyes index provided by the animation is negative, use the value provided by the `face` argument instead if (eyesIndex < 0) { - eyesIndex = sPlayerFaces[face][PLAYER_FACEPART_EYES]; + eyesIndex = sPlayerFaces[face].eyeIndex; } #ifndef AVOID_UB @@ -1104,7 +1110,7 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL // If the mouth index provided by the animation is negative, use the value provided by the `face` argument instead if (mouthIndex < 0) { - mouthIndex = sPlayerFaces[face][PLAYER_FACEPART_MOUTH]; + mouthIndex = sPlayerFaces[face].mouthIndex; } #ifndef AVOID_UB @@ -1525,7 +1531,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); @@ -1879,9 +1885,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); @@ -2057,9 +2063,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 bda115d462..6bf73b0577 100644 --- a/src/code/z_prenmi.c +++ b/src/code/z_prenmi.c @@ -1,12 +1,11 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "prenmi_state.h" +#include "printf.h" #include "regs.h" #include "terminal.h" #include "versions.h" - -#include "macros.h" -#include "global.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 17ef0b78c9..3c45d7e540 100644 --- a/src/code/z_prenmi_buff.c +++ b/src/code/z_prenmi_buff.c @@ -1,5 +1,4 @@ #include "prenmi_buff.h" -#include "global.h" #define COLD_RESET 0 #define NMI 1 diff --git a/src/code/z_quake.c b/src/code/z_quake.c index 2e83a7c10e..18ebfbcc38 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -1,10 +1,11 @@ #include "libc64/qrand.h" -#include "macros.h" +#include "array_count.h" +#include "printf.h" #include "quake.h" #include "terminal.h" #include "z_lib.h" -#include "z64olib.h" -#include "z64play.h" +#include "olib.h" +#include "play_state.h" typedef struct QuakeRequest { /* 0x00 */ s16 index; diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 6228b51cf1..135ffa8876 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -5,7 +5,7 @@ #include "letterbox.h" #include "main.h" #include "regs.h" -#include "z64play.h" +#include "play_state.h" Gfx sSetupDL[SETUPDL_MAX][6] = { { diff --git a/src/code/z_room.c b/src/code/z_room.c index a9daab2047..5549922b6a 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -1,5 +1,6 @@ #include "libu64/debug.h" #include "ultra64/gs2dex.h" +#include "array_count.h" #include "buffers.h" #include "fault.h" #include "gfx.h" @@ -10,18 +11,20 @@ #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" +#include "audio.h" +#include "play_state.h" +#include "player.h" +#include "room.h" +#include "save.h" +#include "skin_matrix.h" Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f }; @@ -713,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)); @@ -728,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 52897d6294..fcc39adee8 100644 --- a/src/code/z_rumble.c +++ b/src/code/z_rumble.c @@ -13,8 +13,9 @@ */ #include "rumble.h" #include "padmgr.h" -#include "z64math.h" +#include "z_math.h" +static s32 sUnused[4]; RumbleMgr sRumbleMgr; /** diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 63e0836bbc..dc7c4836b0 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -4,8 +4,8 @@ #include "regs.h" #include "sample_state.h" #include "segment_symbols.h" -#include "z64dma.h" -#include "z64play.h" +#include "dma.h" +#include "play_state.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 77206ce6f8..65503d0ccb 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -1,16 +1,20 @@ +#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" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "scene.h" SceneCmdHandlerFunc sSceneCmdHandlers[SCENE_CMD_ID_MAX]; RomFile sNaviQuestHintFiles[]; @@ -106,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) { @@ -262,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 5e096a262e..97741c50b6 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -11,10 +11,10 @@ #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 "frame_advance.h" +#include "play_state.h" +#include "player.h" +#include "save.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..2aaadeb365 100644 --- a/src/code/z_sfx_source.c +++ b/src/code/z_sfx_source.c @@ -1,6 +1,9 @@ -#include "z64sfx_source.h" +#include "sfx_source.h" -#include "global.h" +#include "array_count.h" +#include "sfx.h" +#include "play_state.h" +#include "skin_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 be5f275647..10e0df1a44 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1,17 +1,18 @@ #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" - -#include "macros.h" +#include "animation.h" +#include "animation_legacy.h" +#include "play_state.h" #define ANIM_INTERP 1 diff --git a/src/code/z_skin.c b/src/code/z_skin.c index 508943cdd9..e5ddf71f46 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -1,18 +1,13 @@ #include "gfx.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64math.h" -#include "z64play.h" -#include "z64skin.h" -#include "z64skin_matrix.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 "z_math.h" +#include "play_state.h" +#include "skin.h" +#include "skin_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; diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c index 8a175ed15f..c6ddc1a793 100644 --- a/src/code/z_skin_awb.c +++ b/src/code/z_skin_awb.c @@ -1,10 +1,12 @@ -#include "overlays/actors/ovl_En_fHG/z_en_fhg.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 "actor.h" +#include "play_state.h" +#include "skin.h" +#include "skin_matrix.h" + +#include "overlays/actors/ovl_En_fHG/z_en_fhg.h" /** * Initialises the Vtx buffers used for limb at index `limbIndex` diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c index f83cb8295d..1dbb9a26b0 100644 --- a/src/code/z_skin_matrix.c +++ b/src/code/z_skin_matrix.c @@ -1,9 +1,10 @@ -#include "gfx.h" -#include "terminal.h" -#include "z_lib.h" -#include "z64skin_matrix.h" +#include "skin_matrix.h" -#include "macros.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 de2f1ce72e..17bfb5baa4 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -1,15 +1,21 @@ +#include "sram.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 "z64game.h" -#include "z64message.h" -#include "z64save.h" -#include "z64scene.h" -#include "z64sram.h" -#include "z64ss_sram.h" - -#include "global.h" +#include "audio.h" +#include "game.h" +#include "interface.h" +#include "message.h" +#include "ocarina.h" +#include "save.h" +#include "scene.h" +#include "ss_sram.h" #define SLOT_SIZE (sizeof(SaveContext) + 0x28) #define CHECKSUM_SIZE (sizeof(Save) / 2) @@ -1058,7 +1064,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting); PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting); PRINTF_RST(); - Audio_SetSoundMode(gSaveContext.soundSetting); + Audio_SetSoundOutputMode(gSaveContext.soundSetting); } void Sram_Alloc(GameState* gameState, SramContext* sramCtx) { diff --git a/src/code/z_ss_sram.c b/src/code/z_ss_sram.c index 330f5ca4ac..de13b321d2 100644 --- a/src/code/z_ss_sram.c +++ b/src/code/z_ss_sram.c @@ -1,8 +1,6 @@ #include "ultra64.h" -#include "z64ss_sram.h" - -#include "macros.h" -#include "global.h" +#include "printf.h" +#include "ss_sram.h" typedef struct SsSramContext { /* 0x00 */ OSPiHandle piHandle; diff --git a/src/code/z_view.c b/src/code/z_view.c index dd4608cde3..4c37194cfd 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -1,12 +1,16 @@ +#include "view.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 "z64view.h" +#include "translation.h" vu32 sLogOnNextViewInit = true; diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index d1f472057e..6eceeaa7e7 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -3,13 +3,12 @@ #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" -#include "global.h" -#include "macros.h" - void ViMode_LogPrint(OSViMode* osViMode) { LOG_ADDRESS("osvimodep", osViMode, "../z_vimode.c", 87); LOG_HEX32("osvimodep->comRegs.ctrl", osViMode->comRegs.ctrl, "../z_vimode.c", 88); diff --git a/src/code/z_viscvg.c b/src/code/z_viscvg.c index 5fff1a460f..1616b661c0 100644 --- a/src/code/z_viscvg.c +++ b/src/code/z_viscvg.c @@ -21,9 +21,7 @@ */ #include "gfx.h" -#include "z64vis.h" - -#include "macros.h" +#include "vis.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 e3cecda5c1..632d00a6e7 100644 --- a/src/code/z_vismono.c +++ b/src/code/z_vismono.c @@ -13,9 +13,7 @@ #include "attributes.h" #include "gfx.h" #include "gfxalloc.h" -#include "z64vis.h" - -#include "macros.h" +#include "vis.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 8f8265bfda..aa72289742 100644 --- a/src/code/z_viszbuf.c +++ b/src/code/z_viszbuf.c @@ -33,9 +33,7 @@ */ #include "gfx.h" -#include "z64vis.h" - -#include "macros.h" +#include "vis.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 cd8c1b2b8f..3387db500f 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -1,7 +1,14 @@ -#include "global.h" +#include "skybox.h" + +#include "array_count.h" +#include "printf.h" +#include "segment_symbols.h" #include "terminal.h" -#include "z64environment.h" -#include "z64save.h" +#include "ultra64.h" +#include "environment.h" +#include "game.h" +#include "play_state.h" +#include "save.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 aa7fa1dae0..46c38291f6 100644 --- a/src/code/z_vr_box_draw.c +++ b/src/code/z_vr_box_draw.c @@ -1,7 +1,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" -#include "z64skybox.h" +#include "skybox.h" Mtx* sSkyboxDrawMatrix; diff --git a/src/dmadata/dmadata.c b/src/dmadata/dmadata.c index 93ea2b4d33..eff05f171b 100644 --- a/src/dmadata/dmadata.c +++ b/src/dmadata/dmadata.c @@ -1,4 +1,4 @@ -#include "z64dma.h" +#include "dma.h" // Linker symbol declarations (used in the table below) #define DEFINE_DMA_ENTRY(name, _1) \ diff --git a/src/elf_message/elf_message_field.c b/src/elf_message/elf_message_field.c index 8c672ad50b..5488c7d3e5 100644 --- a/src/elf_message/elf_message_field.c +++ b/src/elf_message/elf_message_field.c @@ -1,5 +1,5 @@ -#include "z64quest_hint_commands.h" -#include "z64save.h" +#include "quest_hint_commands.h" +#include "save.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 cde6410b22..4ba3559021 100644 --- a/src/elf_message/elf_message_ydan.c +++ b/src/elf_message/elf_message_ydan.c @@ -1,4 +1,4 @@ -#include "z64quest_hint_commands.h" +#include "quest_hint_commands.h" QuestHintCmd gDungeonNaviQuestHints[] = { QUEST_HINT_END(0x5F), 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..6dc183dc14 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 @@ -39,7 +41,7 @@ void* SystemArena_Malloc(u32 size) { ptr = __osMalloc(&gSystemArena, size); RESTORE_INTERRUPTS(); - SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc", "確保"); // "Secure" + SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc", T("確保", "Secure")); return ptr; } @@ -52,7 +54,7 @@ void* SystemArena_MallocDebug(u32 size, const char* file, int line) { ptr = __osMallocDebug(&gSystemArena, size, file, line); RESTORE_INTERRUPTS(); - SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_DEBUG", "確保"); // "Secure" + SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_DEBUG", T("確保", "Secure")); return ptr; } #endif @@ -65,7 +67,7 @@ void* SystemArena_MallocR(u32 size) { ptr = __osMallocR(&gSystemArena, size); RESTORE_INTERRUPTS(); - SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r", "確保"); // "Secure" + SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r", T("確保", "Secure")); return ptr; } @@ -78,7 +80,7 @@ void* SystemArena_MallocRDebug(u32 size, const char* file, int line) { ptr = __osMallocRDebug(&gSystemArena, size, file, line); RESTORE_INTERRUPTS(); - SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r_DEBUG", "確保"); // "Secure" + SYSTEM_ARENA_CHECK_POINTER(ptr, size, "malloc_r_DEBUG", T("確保", "Secure")); return ptr; } #endif @@ -90,7 +92,7 @@ void* SystemArena_Realloc(void* ptr, u32 newSize) { ptr = __osRealloc(&gSystemArena, ptr, newSize); RESTORE_INTERRUPTS(); - SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc", "再確保"); // "Re-securing" + SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc", T("再確保", "Re-secure")); return ptr; } @@ -102,7 +104,7 @@ void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int lin ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line); RESTORE_INTERRUPTS(); - SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc_DEBUG", "再確保"); // "Re-securing" + SYSTEM_ARENA_CHECK_POINTER(ptr, newSize, "realloc_DEBUG", T("再確保", "Re-secure")); return ptr; } #endif @@ -138,7 +140,7 @@ void* SystemArena_Calloc(u32 num, u32 size) { bzero(ret, n); } - SYSTEM_ARENA_CHECK_POINTER(ret, n, "calloc", "確保"); + SYSTEM_ARENA_CHECK_POINTER(ret, n, "calloc", T("確保", "Secure")); return ret; } diff --git a/src/libc64/math64.c b/src/libc64/math64.c index f2a6edba9a..964dc3c8a4 100644 --- a/src/libc64/math64.c +++ b/src/libc64/math64.c @@ -1,6 +1,5 @@ #include "libc64/math64.h" -#include "z64math.h" -#include "macros.h" +#include "z_math.h" #if !PLATFORM_N64 s32 gUseAtanContFrac; diff --git a/src/libc64/qrand.c b/src/libc64/qrand.c index 69bfa11d72..dafddc864f 100644 --- a/src/libc64/qrand.c +++ b/src/libc64/qrand.c @@ -42,7 +42,7 @@ * @note Original name: qrand.c */ #include "libc64/qrand.h" -#include "z64math.h" +#include "z_math.h" #define RAND_MULTIPLIER 1664525 #define RAND_INCREMENT 1013904223 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 aa9c0feda7..4ae1c7bd9e 100644 --- a/src/libleo/api/cacreateleomanager.c +++ b/src/libleo/api/cacreateleomanager.c @@ -2,10 +2,10 @@ #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" -#include "libc/stdint.h" +#include "stdint.h" #include "attributes.h" -#include "global.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 4cd6ab0018..1daf54ca12 100644 --- a/src/libleo/api/cjcreateleomanager.c +++ b/src/libleo/api/cjcreateleomanager.c @@ -2,10 +2,10 @@ #include "ultra64/leo.h" #include "ultra64/leoappli.h" #include "ultra64/leodrive.h" -#include "libc/stdint.h" +#include "stdint.h" #include "attributes.h" -#include "global.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 7a678dc675..d7887d4944 100644 --- a/src/libleo/leo/leocmdex.c +++ b/src/libleo/leo/leocmdex.c @@ -3,7 +3,7 @@ #include "ultra64/leodrive.h" #include "attributes.h" -#include "global.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 98de987f71..d0804f033c 100644 --- a/src/libleo/leo/leomecha.c +++ b/src/libleo/leo/leomecha.c @@ -3,7 +3,7 @@ #include "ultra64/leodrive.h" #include "attributes.h" -#include "global.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 c2c5d98b54..f6c7fdfc05 100644 --- a/src/libleo/leo/leotimer.c +++ b/src/libleo/leo/leotimer.c @@ -3,7 +3,7 @@ #include "ultra64/leodrive.h" #include "attributes.h" -#include "global.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 7a1c37e08c..c47d52a3a5 100644 --- a/src/libu64/gfxprint.c +++ b/src/libu64/gfxprint.c @@ -1,8 +1,7 @@ #include "libc64/aprintf.h" #include "libu64/gfxprint.h" #include "attributes.h" - -#include "macros.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 6211d119b2..e99c83d1df 100644 --- a/src/libu64/load_gc.c +++ b/src/libu64/load_gc.c @@ -1,8 +1,8 @@ #include "libu64/overlay.h" #include "ultra64.h" -#include "z64dma.h" - -#include "macros.h" +#include "printf.h" +#include "translation.h" +#include "dma.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 191b2ee076..5ad556e506 100644 --- a/src/libu64/loadfragment2_gc.c +++ b/src/libu64/loadfragment2_gc.c @@ -1,7 +1,6 @@ #include "libc64/malloc.h" #include "libu64/overlay.h" - -#include "macros.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 015e1d1d6b..72ecabaf37 100644 --- a/src/libu64/loadfragment2_n64.c +++ b/src/libu64/loadfragment2_n64.c @@ -8,9 +8,8 @@ */ #include "libc64/malloc.h" #include "libu64/overlay.h" -#include "z64dma.h" - -#include "macros.h" +#include "translation.h" +#include "dma.h" s32 gOverlayLogSeverity = 2; 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 9307d67cc6..91d7eaf790 100644 --- a/src/libu64/relocation_gc.c +++ b/src/libu64/relocation_gc.c @@ -8,10 +8,9 @@ */ #include "libu64/overlay.h" #include "attributes.h" +#include "printf.h" #include "ultra64.h" -#include "macros.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 76% rename from src/libu64/system_heap.c rename to src/libu64/runtime.c index 3a98ef3cef..aa0c507b7d 100644 --- a/src/libu64/system_heap.c +++ b/src/libu64/runtime.c @@ -1,3 +1,5 @@ +#include "libu64/runtime.h" + #include "libc64/malloc.h" #include "libc64/os_malloc.h" @@ -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 f98e828eae..69fe224ee8 100644 --- a/src/libu64/stackcheck.c +++ b/src/libu64/stackcheck.c @@ -1,9 +1,9 @@ #include "libu64/debug.h" #include "attributes.h" +#include "printf.h" #include "stackcheck.h" #include "terminal.h" - -#include "macros.h" +#include "translation.h" StackEntry* sStackInfoListStart = NULL; StackEntry* sStackInfoListEnd = NULL; diff --git a/src/libultra/audio/drvrnew.c b/src/libultra/audio/drvrnew.c index 6b10e66b72..e549347e0f 100644 --- a/src/libultra/audio/drvrnew.c +++ b/src/libultra/audio/drvrnew.c @@ -1,5 +1,7 @@ #include "libaudio.h" #include "synthInternals.h" +#include "stdbool.h" +#include "stddef.h" // WARNING: THE FOLLOWING CONSTANT MUST BE KEPT IN SYNC WITH SCALING IN MICROCODE!!! #define SCALE 16384 diff --git a/src/libultra/audio/env.c b/src/libultra/audio/env.c index 2d0027ba7d..654c682ab3 100644 --- a/src/libultra/audio/env.c +++ b/src/libultra/audio/env.c @@ -1,6 +1,7 @@ #include "libaudio.h" #include "synthInternals.h" -#include "libc/math.h" +#include "stdbool.h" +#include "stddef.h" #include "ultra64/convert.h" #define EQPOWER_LENGTH 128 diff --git a/src/libultra/audio/filter.c b/src/libultra/audio/filter.c index 937ffd04c5..20e5d7e606 100644 --- a/src/libultra/audio/filter.c +++ b/src/libultra/audio/filter.c @@ -1,5 +1,6 @@ #include "libaudio.h" #include "synthInternals.h" +#include "stddef.h" void alFilterNew(ALFilter* f, ALCmdHandler h, ALSetParam s, s32 type) { f->source = NULL; diff --git a/src/libultra/audio/heapalloc.c b/src/libultra/audio/heapalloc.c index 52c3605c51..708134ec2b 100644 --- a/src/libultra/audio/heapalloc.c +++ b/src/libultra/audio/heapalloc.c @@ -1,5 +1,6 @@ #include "libaudio.h" #include "synthInternals.h" +#include "stddef.h" void* alHeapDBAlloc(u8* file, s32 line, ALHeap* hp, s32 num, s32 size) { s32 bytes; diff --git a/src/libultra/audio/libaudio.h b/src/libultra/audio/libaudio.h index 67f04567bf..4d30b0161e 100644 --- a/src/libultra/audio/libaudio.h +++ b/src/libultra/audio/libaudio.h @@ -1,9 +1,6 @@ #ifndef __LIB_AUDIO__ #define __LIB_AUDIO__ -#include "libc/stdbool.h" -#include "libc/stddef.h" -#include "libc/stdint.h" #include "ultra64/ultratypes.h" #include "libaudio_abi.h" diff --git a/src/libultra/audio/load.c b/src/libultra/audio/load.c index 86486ce3a7..02be1f47cd 100644 --- a/src/libultra/audio/load.c +++ b/src/libultra/audio/load.c @@ -1,5 +1,8 @@ #include "libaudio.h" #include "synthInternals.h" +#include "stdbool.h" +#include "stddef.h" +#include "stdint.h" #include "ultra64/R4300.h" #ifndef MIN diff --git a/src/libultra/audio/resample.c b/src/libultra/audio/resample.c index 8301d22a1a..8001eb151b 100644 --- a/src/libultra/audio/resample.c +++ b/src/libultra/audio/resample.c @@ -1,5 +1,7 @@ #include "libaudio.h" #include "synthInternals.h" +#include "stdbool.h" +#include "stddef.h" #include "ultra64/convert.h" Acmd* alResamplePull(void* filter, s16* outp, s32 outCnt, s32 sampleOffset, Acmd* p) { diff --git a/src/libultra/audio/reverb.c b/src/libultra/audio/reverb.c index 453147f125..9edf3ab9a6 100644 --- a/src/libultra/audio/reverb.c +++ b/src/libultra/audio/reverb.c @@ -1,5 +1,8 @@ #include "libaudio.h" #include "synthInternals.h" +#include "stdbool.h" +#include "stddef.h" +#include "stdint.h" #include "ultra64/convert.h" #define RANGE 2.0 diff --git a/src/libultra/audio/sl.c b/src/libultra/audio/sl.c index 7f2ebe28b8..ad9949d114 100644 --- a/src/libultra/audio/sl.c +++ b/src/libultra/audio/sl.c @@ -1,4 +1,5 @@ #include "libaudio.h" +#include "stddef.h" ALGlobals* alGlobals = NULL; diff --git a/src/libultra/audio/synallocfx.c b/src/libultra/audio/synallocfx.c index 8c530fc19d..55c8267e14 100644 --- a/src/libultra/audio/synallocfx.c +++ b/src/libultra/audio/synallocfx.c @@ -1,3 +1,4 @@ +#include "libaudio.h" #include "synthInternals.h" ALFxRef* alSynAllocFX(ALSynth* s, s16 bus, ALSynConfig* c, ALHeap* hp) { diff --git a/src/libultra/audio/syndelete.c b/src/libultra/audio/syndelete.c index 7af0d50090..96299af32f 100644 --- a/src/libultra/audio/syndelete.c +++ b/src/libultra/audio/syndelete.c @@ -1,4 +1,5 @@ -#include "synthInternals.h" +#include "libaudio.h" +#include "stddef.h" void alSynDelete(ALSynth* drvr) { drvr->head = NULL; diff --git a/src/libultra/audio/synthesizer.c b/src/libultra/audio/synthesizer.c index 62d5677ecd..62c07582ed 100644 --- a/src/libultra/audio/synthesizer.c +++ b/src/libultra/audio/synthesizer.c @@ -1,4 +1,6 @@ +#include "libaudio.h" #include "synthInternals.h" +#include "stddef.h" #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) diff --git a/src/libultra/bb/sa/common.c b/src/libultra/bb/sa/common.c index 667af02b7f..a18735f4a5 100644 --- a/src/libultra/bb/sa/common.c +++ b/src/libultra/bb/sa/common.c @@ -1,4 +1,4 @@ -#include "libc/stddef.h" +#include "stddef.h" int strcmp(const char* s, const char* t) { while (*s == *t) { diff --git a/src/libultra/gu/cosf.c b/src/libultra/gu/cosf.c index 639084093f..4d4f13fbe8 100644 --- a/src/libultra/gu/cosf.c +++ b/src/libultra/gu/cosf.c @@ -1,5 +1,5 @@ #include "ultra64.h" -#include "global.h" +#include "z_math.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..c30a259bf1 100644 --- a/src/libultra/gu/lookat.c +++ b/src/libultra/gu/lookat.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "ultra64.h" +#include "z_math.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..b954069f96 100644 --- a/src/libultra/gu/normalize.c +++ b/src/libultra/gu/normalize.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "ultra64.h" +#include "z_math.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..64f850efbd 100644 --- a/src/libultra/gu/sinf.c +++ b/src/libultra/gu/sinf.c @@ -1,5 +1,5 @@ -#include "global.h" #include "ultra64.h" +#include "z_math.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/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 3c4c644078..4ad8ccc820 100644 --- a/src/libultra/os/settimer.c +++ b/src/libultra/os/settimer.c @@ -1,7 +1,7 @@ #include "ultra64.h" #include "attributes.h" -#include "global.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 8c6c91a9ce..2212fe43fb 100644 --- a/src/n64dd/n64dd_801C8000.c +++ b/src/n64dd/n64dd_801C8000.c @@ -1,5 +1,8 @@ // Does some command processing + #include "n64dd.h" + +#include "array_count.h" #include "versions.h" #include "z_locale.h" diff --git a/src/n64dd/n64dd_801C8940.c b/src/n64dd/n64dd_801C8940.c index a0d1ff84b3..132222b689 100644 --- a/src/n64dd/n64dd_801C8940.c +++ b/src/n64dd/n64dd_801C8940.c @@ -1,10 +1,9 @@ // Lower-level command processing in a background thread #include "n64dd.h" + #include "libc64/sleep.h" #include "attributes.h" -#include "global.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_801CA0B0.c b/src/n64dd/n64dd_801CA0B0.c index d564d46caa..8252def9e5 100644 --- a/src/n64dd/n64dd_801CA0B0.c +++ b/src/n64dd/n64dd_801CA0B0.c @@ -1,8 +1,9 @@ #include "n64dd.h" + #include "libc64/aprintf.h" #include "attributes.h" - -#include "global.h" +#include "array_count.h" +#include "color.h" // Draws text to framebuffer typedef struct struct_801CA704 { 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 17aff6416c..ea1b73249e 100644 --- a/src/n64dd/z_n64dd.c +++ b/src/n64dd/z_n64dd.c @@ -1,18 +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 "n64dd.h" + #include "libc64/sleep.h" +#include "array_count.h" #include "fault.h" +#include "gfx.h" #include "irqmgr.h" #include "line_numbers.h" -#include "n64dd.h" #include "stack.h" #include "stackcheck.h" #include "sys_freeze.h" #include "versions.h" -#include "z64audio.h" -#include "z64thread.h" +#include "audio.h" +#include "thread.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" +#pragma increment_block_number "ntsc-1.0:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64" 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..62594850af 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -7,8 +7,8 @@ #include "sfx.h" #include "sys_math.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "z_lib.h" #include "assets/objects/object_link_boy/object_link_boy.h" @@ -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_Arms_Hook/z_arms_hook.h b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h index ad50194506..d06019f040 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h @@ -2,8 +2,8 @@ #define Z_ARMS_HOOK_H #include "ultra64.h" -#include "z64actor.h" -#include "z64player.h" +#include "actor.h" +#include "player.h" struct ArmsHook; 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 a92c226117..664e00223b 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -7,14 +7,15 @@ #include "z_arrow_fire.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" -#include "libu64/debug.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" #include "sys_matrix.h" +#include "tex_len.h" +#include "translation.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) @@ -27,7 +28,29 @@ void ArrowFire_Charge(ArrowFire* this, PlayState* play); void ArrowFire_Fly(ArrowFire* this, PlayState* play); void ArrowFire_Hit(ArrowFire* this, PlayState* play); -#include "assets/overlays/ovl_Arrow_Fire/ovl_Arrow_Fire.c" +#define s1Tex_WIDTH 32 +#define s1Tex_HEIGHT 64 +static u64 s1Tex[TEX_LEN(u64, s1Tex_WIDTH, s1Tex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Arrow_Fire/s1Tex.i8.inc.c" +}; + +#define s2Tex_WIDTH 32 +#define s2Tex_HEIGHT 64 +static u64 s2Tex[TEX_LEN(u64, s2Tex_WIDTH, s2Tex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Arrow_Fire/s2Tex.i8.inc.c" +}; + +static Vtx sVtx[] = { +#include "assets/overlays/ovl_Arrow_Fire/sVtx.inc.c" +}; + +static Gfx sMaterialDL[22] = { +#include "assets/overlays/ovl_Arrow_Fire/sMaterialDL.inc.c" +}; + +static Gfx sModelDL[24] = { +#include "assets/overlays/ovl_Arrow_Fire/sModelDL.inc.c" +}; ActorProfile Arrow_Fire_Profile = { /**/ ACTOR_ARROW_FIRE, @@ -64,7 +87,7 @@ void ArrowFire_Init(Actor* thisx, PlayState* play) { void ArrowFire_Destroy(Actor* thisx, PlayState* play) { Magic_Reset(play); - LOG_STRING("消滅", "../z_arrow_fire.c", 421); // "Disappearance" + LOG_STRING_T("消滅", "Disappearance", "../z_arrow_fire.c", 421); } void ArrowFire_Charge(ArrowFire* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h index a04b496a11..395946c6f6 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h @@ -2,7 +2,7 @@ #define Z_ARROW_FIRE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ArrowFire; 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 953e0a333c..b8a064f9b9 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -7,14 +7,15 @@ #include "z_arrow_ice.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" -#include "libu64/debug.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" #include "sys_matrix.h" +#include "tex_len.h" +#include "translation.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) @@ -27,7 +28,29 @@ void ArrowIce_Charge(ArrowIce* this, PlayState* play); void ArrowIce_Fly(ArrowIce* this, PlayState* play); void ArrowIce_Hit(ArrowIce* this, PlayState* play); -#include "assets/overlays/ovl_Arrow_Ice/ovl_Arrow_Ice.c" +#define s1Tex_WIDTH 32 +#define s1Tex_HEIGHT 64 +static u64 s1Tex[TEX_LEN(u64, s1Tex_WIDTH, s1Tex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Arrow_Ice/s1Tex.i8.inc.c" +}; + +#define s2Tex_WIDTH 32 +#define s2Tex_HEIGHT 64 +static u64 s2Tex[TEX_LEN(u64, s2Tex_WIDTH, s2Tex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Arrow_Ice/s2Tex.i8.inc.c" +}; + +static Vtx sVtx[] = { +#include "assets/overlays/ovl_Arrow_Ice/sVtx.inc.c" +}; + +static Gfx sMaterialDL[22] = { +#include "assets/overlays/ovl_Arrow_Ice/sMaterialDL.inc.c" +}; + +static Gfx sModelDL[24] = { +#include "assets/overlays/ovl_Arrow_Ice/sModelDL.inc.c" +}; ActorProfile Arrow_Ice_Profile = { /**/ ACTOR_ARROW_ICE, @@ -64,7 +87,7 @@ void ArrowIce_Init(Actor* thisx, PlayState* play) { void ArrowIce_Destroy(Actor* thisx, PlayState* play) { Magic_Reset(play); - LOG_STRING("消滅", "../z_arrow_ice.c", 415); // "Disappearance" + LOG_STRING_T("消滅", "Disappearance", "../z_arrow_ice.c", 415); } void ArrowIce_Charge(ArrowIce* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h index 7494aefa9d..f0094550c6 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h @@ -2,7 +2,7 @@ #define Z_ARROW_ICE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ArrowIce; 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 100b8c20c1..51e3fdb42b 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -7,14 +7,15 @@ #include "z_arrow_light.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" -#include "libu64/debug.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" #include "sfx.h" #include "sys_matrix.h" +#include "tex_len.h" +#include "translation.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) @@ -27,7 +28,29 @@ void ArrowLight_Charge(ArrowLight* this, PlayState* play); void ArrowLight_Fly(ArrowLight* this, PlayState* play); void ArrowLight_Hit(ArrowLight* this, PlayState* play); -#include "assets/overlays/ovl_Arrow_Light/ovl_Arrow_Light.c" +#define s1Tex_WIDTH 32 +#define s1Tex_HEIGHT 64 +static u64 s1Tex[TEX_LEN(u64, s1Tex_WIDTH, s1Tex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Arrow_Light/s1Tex.i8.inc.c" +}; + +#define s2Tex_WIDTH 32 +#define s2Tex_HEIGHT 64 +static u64 s2Tex[TEX_LEN(u64, s2Tex_WIDTH, s2Tex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Arrow_Light/s2Tex.i8.inc.c" +}; + +static Vtx sVtx[] = { +#include "assets/overlays/ovl_Arrow_Light/sVtx.inc.c" +}; + +static Gfx sMaterialDL[22] = { +#include "assets/overlays/ovl_Arrow_Light/sMaterialDL.inc.c" +}; + +static Gfx sModelDL[24] = { +#include "assets/overlays/ovl_Arrow_Light/sModelDL.inc.c" +}; ActorProfile Arrow_Light_Profile = { /**/ ACTOR_ARROW_LIGHT, @@ -64,7 +87,7 @@ void ArrowLight_Init(Actor* thisx, PlayState* play) { void ArrowLight_Destroy(Actor* thisx, PlayState* play) { Magic_Reset(play); - LOG_STRING("消滅", "../z_arrow_light.c", 403); // "Disappearance" + LOG_STRING_T("消滅", "Disappearance", "../z_arrow_light.c", 403); } void ArrowLight_Charge(ArrowLight* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h index ee4b678961..516469d5cb 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h @@ -2,7 +2,7 @@ #define Z_ARROW_LIGHT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ArrowLight; 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 c927465569..047ad13ba0 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,15 +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 "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_bdan_objects/object_bdan_objects.h" @@ -107,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; } } @@ -124,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_Objects/z_bg_bdan_objects.h b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h index e8729bb983..72f2b7103c 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h @@ -2,7 +2,7 @@ #define Z_BG_BDAN_OBJECTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgBdanObjects; 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 4fdf0d7dea..280730bcda 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,13 +7,15 @@ #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" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_bdan_objects/object_bdan_objects.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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -206,11 +209,14 @@ 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("不正な ARG_DATA(arg_data 0x%04x)(%s %d)\n", "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("(巨大魚ダンジョン 専用スイッチ)(arg_data 0x%04x)\n", + "(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 f86ef79e3e..8020a212b9 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 @@ -2,7 +2,7 @@ #define Z_BG_BDAN_SWITCH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" typedef enum BgBdanSwitchType { /* 0x00 */ BLUE, 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..e773a20c4c 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,9 +7,11 @@ #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 "z64play.h" +#include "translation.h" +#include "play_state.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(" ☆☆☆☆☆ 透明ガード出現 ☆☆☆☆☆ \n", " ☆☆☆☆☆ Transparent guard appears ☆☆☆☆☆ \n") VT_RST); thisx->scale.x = 1.0f; thisx->scale.y = 1.0f; diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h index 47e167de8a..707027f443 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h @@ -2,7 +2,7 @@ #define Z_BG_BOM_GUARD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgBomGuard; 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 b97d4c80bc..15a2ffb841 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -7,9 +7,11 @@ #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" +#include "play_state.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.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); } } @@ -155,8 +156,9 @@ 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(T("(field keep 汎用爆弾壁)(arg_data 0x%04x)(angY %d)\n", + "(field keep 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 8cd1bb879f..f2714e062a 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h @@ -2,7 +2,7 @@ #define Z_BG_BOMBWALL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgBombwall; 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..57a5b0b9e6 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,14 +10,16 @@ #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" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_bowl/object_bowl.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(" ☆☆☆☆☆ ボーリングおじゃま壁発生 ☆☆☆☆☆ %d\n", " ☆☆☆☆☆ Bowling obstacle wall spawns ☆☆☆☆☆ %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_Bowl_Wall/z_bg_bowl_wall.h b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h index ac743fe7f1..c108447575 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h @@ -2,7 +2,7 @@ #define Z_BG_BOWL_WALL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" struct BgBowlWall; 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 f36d251f45..c12522fe52 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -15,9 +15,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.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_Breakwall/z_bg_breakwall.h b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index 02ab43a5fc..eff2fbeec2 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -2,7 +2,7 @@ #define Z_BG_BREAKWALL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgBreakwall; diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c index fb910b56fd..71f37f61a5 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c @@ -11,7 +11,7 @@ #include "rand.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_ddan_objects/object_ddan_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h index 48e695b47d..a8073e1498 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h @@ -2,7 +2,7 @@ #define Z_BG_DDAN_JD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgDdanJd; 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..81012e657a 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,11 +9,12 @@ #include "libc64/qrand.h" #include "ichain.h" #include "one_point_cutscene.h" +#include "printf.h" #include "rand.h" #include "rumble.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_ddan_objects/object_ddan_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h index fca0119052..46b4105b81 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h @@ -2,7 +2,7 @@ #define Z_BG_DDAN_KD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgDdanKd; 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 15adb7bf94..f2e50dcb61 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -7,10 +7,10 @@ #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" @@ -18,9 +18,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_ddan_objects/object_ddan_objects.h" @@ -50,7 +50,7 @@ ActorProfile Bg_Dodoago_Profile = { /**/ BgDodoago_Draw, }; -static ColliderCylinderInit sColCylinderInitMain = { +static ColliderCylinderInit sMainColliderCylinderInit = { { COL_MATERIAL_NONE, AT_NONE, @@ -70,7 +70,7 @@ static ColliderCylinderInit sColCylinderInitMain = { { 80, 30, 80, { 0, 0, 0 } }, }; -static ColliderCylinderInit sColCylinderInitLeftRight = { +static ColliderCylinderInit sLeftRightColliderCylinderInit = { { COL_MATERIAL_NONE, AT_NONE, @@ -146,9 +146,9 @@ void BgDodoago_Init(Actor* thisx, PlayState* play) { 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); + Collider_SetCylinder(play, &this->mainCollider, &this->dyna.actor, &sMainColliderCylinderInit); + Collider_SetCylinder(play, &this->leftCollider, &this->dyna.actor, &sLeftRightColliderCylinderInit); + Collider_SetCylinder(play, &this->rightCollider, &this->dyna.actor, &sLeftRightColliderCylinderInit); BgDodoago_SetupAction(this, BgDodoago_WaitExplosives); sDisableBombCatcher = false; 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 9f361a3ccb..9c16d9eb1f 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h @@ -2,7 +2,7 @@ #define Z_BG_DODOAGO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" typedef enum BgDodoagoEye { /* 0 */ BGDODOAGO_EYE_LEFT, 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 eb35f52494..44dc02ca0d 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,18 +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 "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_dy_obj/object_dy_obj.h" #include "assets/scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.h" @@ -102,8 +104,8 @@ 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("☆☆☆☆☆ 大妖精の泉 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ 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 @@ -113,8 +115,8 @@ 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("☆☆☆☆☆ 石妖精の泉 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ 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 @@ -251,8 +253,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("☆☆☆☆☆ もうど ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Mode ☆☆☆☆☆ %d\n") VT_RST, play->msgCtx.ocarinaMode); givingReward = false; if (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) { @@ -277,24 +278,23 @@ 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 ☆☆☆☆☆ \n", " ☆☆☆☆☆ 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(" ☆☆☆☆☆ 魔法ゲージメーター倍増 ☆☆☆☆☆ \n", + " ☆☆☆☆☆ 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(" ☆☆☆☆☆ ダメージ半減 ☆☆☆☆☆ \n", " ☆☆☆☆☆ Damage halved ☆☆☆☆☆ \n") VT_RST); this->givingSpell = true; givingReward = true; } diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h index f799bf9278..0b07024b17 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h @@ -2,7 +2,7 @@ #define Z_BG_DY_YOSEIZO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" 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..b43241f1bd 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,17 +7,20 @@ #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" #include "terminal.h" +#include "tex_len.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -74,7 +77,75 @@ static Vec3f sSideCenters[] = { static f32 sSideAngles[] = { M_PI / 2, -M_PI / 2, 0.0f, M_PI }; -#include "assets/overlays/ovl_Bg_Ganon_Otyuka/ovl_Bg_Ganon_Otyuka.c" +#define sPlatformTex_WIDTH 32 +#define sPlatformTex_HEIGHT 32 +static u64 sPlatformTex[TEX_LEN(u64, sPlatformTex_WIDTH, sPlatformTex_HEIGHT, 16)] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformTex.rgba16.inc.c" +}; + +static u8 sZeros[8] = { 0 }; + +static Vtx sPlatformTopVtx[4] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformTopVtx.inc.c" +}; + +static Gfx sPlatformMaterialDL[17] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformMaterialDL.inc.c" +}; + +static Gfx sPlatformTopDL[3] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformTopDL.inc.c" +}; + +static Vtx sPlatformBottomVtx[4] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformBottomVtx.inc.c" +}; + +static Gfx sPlatformBottomDL[3] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformBottomDL.inc.c" +}; + +static Vtx sPlatformSideVtx[4] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformSideVtx.inc.c" +}; + +static Gfx sPlatformSideDL[3] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPlatformSideDL.inc.c" +}; + +#define sFlashTex_WIDTH 32 +#define sFlashTex_HEIGHT 64 +static u64 sFlashTex[TEX_LEN(u64, sFlashTex_WIDTH, sFlashTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sFlashTex.i8.inc.c" +}; + +static Vtx sFlashVtx[8] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sFlashVtx.inc.c" +}; + +static Gfx sFlashDL[22] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sFlashDL.inc.c" +}; + +static BgCamInfo sBgCamList[1] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sBgCamList.inc.c" +}; + +static SurfaceType sSurfaceTypes[2] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sSurfaceTypes.inc.c" +}; + +static CollisionPoly sPolyList[10] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sPolyList.inc.c" +}; + +static Vec3s sVtxList[8] = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sVtxList.inc.c" +}; + +static CollisionHeader sCol = { +#include "assets/overlays/ovl_Bg_Ganon_Otyuka/sCol.inc.c" +}; void BgGanonOtyuka_Init(Actor* thisx, PlayState* play2) { BgGanonOtyuka* this = (BgGanonOtyuka*)thisx; diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h index 9d0c4bcfaf..14744529e6 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h @@ -2,7 +2,7 @@ #define Z_BG_GANON_OTYUKA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #define OTYUKA_SIDE_EAST (1 << 0) #define OTYUKA_SIDE_WEST (1 << 1) 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 9385ed95bf..8e7ad4c3d6 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,12 +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 "play_state.h" +#include "save.h" #include "assets/objects/object_spot01_matoyab/object_spot01_matoyab.h" @@ -60,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(" ☆☆☆☆☆ 柵でたなぁ ☆☆☆☆☆ \n", " ☆☆☆☆☆ There's a fence ☆☆☆☆☆ \n") VT_RST); this->actionFunc = func_8087828C; } diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h index 6f9f53a546..1b89840088 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h @@ -2,7 +2,7 @@ #define Z_BG_GATE_SHUTTER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgGateShutter; 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 6c0f01b322..3cf1b45e31 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 @@ -11,9 +11,9 @@ #include "ichain.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.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_Gjyo_Bridge/z_bg_gjyo_bridge.h b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h index 312dcdee72..3cec2c7a6b 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h @@ -2,7 +2,7 @@ #define Z_BG_GJYO_BRIDGE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgGjyoBridge; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index b05734104c..d3f3ccae8b 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -9,7 +9,7 @@ #include "gfx.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_demo_kekkai/object_demo_kekkai.h" diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h index 3124be292e..9ff0f6294f 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h @@ -2,7 +2,7 @@ #define Z_BG_GND_DARKMEIRO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgGndDarkmeiro; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c index c49697f627..441870154f 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c @@ -11,8 +11,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_demo_kekkai/object_demo_kekkai.h" diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h index bebb77303f..a6092c9364 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h @@ -2,7 +2,7 @@ #define Z_BG_GND_FIREMEIRO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgGndFiremeiro; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c index 8b026839f7..2e587cde55 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c @@ -12,9 +12,9 @@ #include "rand.h" #include "sfx.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_demo_kekkai/object_demo_kekkai.h" diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h index 86e3aa4f62..23b4ff6af5 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h @@ -2,7 +2,7 @@ #define Z_BG_GND_ICEBLOCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgGndIceblock; 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..3a6aa26abb 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 @@ -6,7 +6,7 @@ #include "z_bg_gnd_nisekabe.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_demo_kekkai/object_demo_kekkai.h" @@ -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_Gnd_Nisekabe/z_bg_gnd_nisekabe.h b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h index 291a0e4ea1..5145c02b6b 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h @@ -2,7 +2,7 @@ #define Z_BG_GND_NISEKABE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgGndNisekabe; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index 889d4f9551..acb2bd4f80 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -14,8 +14,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_demo_kekkai/object_demo_kekkai.h" diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h index d2e039c8ad..110c53d9bf 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h @@ -2,7 +2,7 @@ #define Z_BG_GND_SOULMEIRO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgGndSoulmeiro; 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 f20af0b9f8..b487e1280d 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -12,9 +12,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_haka/object_haka.h" diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h index b95f5c0f8e..1bad32c14b 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHaka; 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..cdda12ba15 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 @@ -14,8 +14,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_haka_objects/object_haka_objects.h" @@ -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_Gate/z_bg_haka_gate.h b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h index 6c926d4354..cc718d095d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_GATE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaGate; diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 63ef8e5153..4e6d67df94 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -14,9 +14,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_hakach_objects/object_hakach_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h index e1ce3a0946..3d691f3fad 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_HUTA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaHuta; 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 3d67136b73..a0c3e37a58 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 @@ -7,7 +7,7 @@ #include "z_bg_haka_megane.h" #include "ichain.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hakach_objects/object_hakach_objects.h" #include "assets/objects/object_haka_objects/object_haka_objects.h" @@ -133,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_Megane/z_bg_haka_megane.h b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h index bb7711c7b5..a50a74a27f 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_MEGANE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaMegane; diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 7b06abe5ab..061cdaf5d5 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -10,7 +10,7 @@ #include "one_point_cutscene.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_haka_objects/object_haka_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h index 4a11b26b7d..47342beb78 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_MEGANEBG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaMeganeBG; 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 f11973a86f..cf90fc6a68 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 @@ -9,9 +9,9 @@ #include "ichain.h" #include "sfx.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_haka_objects/object_haka_objects.h" #include "assets/objects/object_ice_objects/object_ice_objects.h" @@ -142,7 +142,7 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) { BgHakaSgami* this = (BgHakaSgami*)thisx; EffectBlureInit1 blureInit; s32 i; - ColliderTris* colliderScythe = &this->colliderScythe; + ColliderTris* scytheCollider = &this->scytheCollider; Actor_ProcessInitChain(thisx, sInitChain); @@ -153,8 +153,8 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) { thisx->flags |= ACTOR_FLAG_REACT_TO_LENS; } - Collider_InitTris(play, colliderScythe); - Collider_SetTris(play, colliderScythe, thisx, &sTrisInit, this->colliderScytheItems); + Collider_InitTris(play, scytheCollider); + Collider_SetTris(play, scytheCollider, thisx, &sTrisInit, this->scytheColliderElements); Collider_InitCylinder(play, &this->scytheCenterCollider); Collider_SetCylinder(play, &this->scytheCenterCollider, thisx, &sCylinderInit); @@ -199,7 +199,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_DestroyTris(play, &this->scytheCollider); Collider_DestroyCylinder(play, &this->scytheCenterCollider); } @@ -256,14 +256,14 @@ void BgHakaSgami_Spin(BgHakaSgami* this, PlayState* play) { elementInit->dim.vtx[j].x * actorRotYSin; } - Collider_SetTrisVertices(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); + Collider_SetTrisVertices(&this->scytheCollider, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); for (j = 0; j < 3; j++) { scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x; scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z; } - Collider_SetTrisVertices(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], + Collider_SetTrisVertices(&this->scytheCollider, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); } @@ -288,7 +288,7 @@ void BgHakaSgami_Spin(BgHakaSgami* this, PlayState* play) { EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[1]), &scytheVertices[0], &scytheVertices[1]); } - CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderScythe.base); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->scytheCollider.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 53c0b63400..4d94f0ac1e 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 @@ -2,7 +2,7 @@ #define Z_BG_HAKA_SGAMI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaSgami; @@ -16,8 +16,8 @@ typedef struct BgHakaSgami { /* 0x0152 */ s16 timer; /* 0x0154 */ s32 blureEffectIndex[2]; /* 0x015C */ ColliderCylinder scytheCenterCollider; - /* 0x01A8 */ ColliderTris colliderScythe; - /* 0x01C8 */ ColliderTrisElement colliderScytheItems[4]; + /* 0x01A8 */ ColliderTris scytheCollider; + /* 0x01C8 */ ColliderTrisElement scytheColliderElements[4]; } BgHakaSgami; // size = 0x0338 #endif 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..667f1f309b 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,11 +10,13 @@ #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" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/object_haka_objects/object_haka_objects.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_Ship/z_bg_haka_ship.h b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h index e6ede3d2b3..28337fb437 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_SHIP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaShip; diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index cf34101f56..250f4ce32a 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -11,10 +11,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "skin_matrix.h" #include "assets/objects/object_haka_objects/object_haka_objects.h" @@ -171,8 +171,8 @@ void BgHakaTrap_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&object_haka_objects_Col_008D10, &colHeader); } - Collider_InitTris(play, &this->colliderSpikes); - Collider_SetTris(play, &this->colliderSpikes, thisx, &sTrisInit, this->colliderSpikesItem); + Collider_InitTris(play, &this->spikesCollider); + Collider_SetTris(play, &this->spikesCollider, thisx, &sTrisInit, this->spikesColliderElements); this->colliderCylinder.dim.radius = 18; this->colliderCylinder.dim.height = 115; @@ -202,7 +202,7 @@ void BgHakaTrap_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); if ((this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) || (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL_2)) { - Collider_DestroyTris(play, &this->colliderSpikes); + Collider_DestroyTris(play, &this->spikesCollider); } } @@ -253,7 +253,7 @@ void func_808801B8(BgHakaTrap* this, PlayState* play) { func_8087FFC0(this, play); - if (this->colliderSpikes.base.acFlags & AC_HIT) { + if (this->spikesCollider.base.acFlags & AC_HIT) { this->timer = 20; D_80880F30 = 1; this->actionFunc = func_808802D8; @@ -502,7 +502,7 @@ void BgHakaTrap_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base); } else { if (this->actionFunc == func_808801B8) { - CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSpikes.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->spikesCollider.base); } CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder.base); @@ -518,10 +518,10 @@ void func_80880D68(BgHakaTrap* this) { Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[0], &vec1); Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[1], &vec2); Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[2], &vec3); - Collider_SetTrisVertices(&this->colliderSpikes, 0, &vec1, &vec2, &vec3); + Collider_SetTrisVertices(&this->spikesCollider, 0, &vec1, &vec2, &vec3); Matrix_MultVec3f(&sTrisElementsInit[1].dim.vtx[2], &vec2); - Collider_SetTrisVertices(&this->colliderSpikes, 1, &vec1, &vec3, &vec2); + Collider_SetTrisVertices(&this->spikesCollider, 1, &vec1, &vec3, &vec2); } void BgHakaTrap_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h index 0ef71acec9..a75c877ed3 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_TRAP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" typedef enum HakaTrapType { /* 0x00 */ HAKA_TRAP_GUILLOTINE_SLOW, @@ -25,8 +25,8 @@ typedef struct BgHakaTrap { /* 0x016A */ s16 unk_16A; // used as boolean for HAKA_TRAP_GUILLOTINE_SLOW/FAST, s16 for HAKA_TRAP_SPIKED_BOX /* 0x016C */ Vec3f unk_16C; /* 0x0178 */ ColliderCylinder colliderCylinder; - /* 0x01C4 */ ColliderTris colliderSpikes; - /* 0x01E4 */ ColliderTrisElement colliderSpikesItem[2]; + /* 0x01C4 */ ColliderTris spikesCollider; + /* 0x01E4 */ ColliderTrisElement spikesColliderElements[2]; } BgHakaTrap; // size = 0x029C #endif 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 df7c95b0e9..d4b20752d5 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 @@ -14,8 +14,8 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.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_Haka_Tubo/z_bg_haka_tubo.h b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h index a0caba8c23..ad9fd87703 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_TUBO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaTubo; diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c index 581af06120..8143404e10 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c @@ -12,7 +12,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hakach_objects/object_hakach_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h index a34a043590..9cf3685710 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_WATER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaWater; diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 8064cae2d4..5be3889889 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -12,8 +12,8 @@ #include "rand.h" #include "sfx.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_hakach_objects/object_hakach_objects.h" #include "assets/objects/object_haka_objects/object_haka_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h index 2c8f9a4834..1d4c4798d6 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h @@ -2,7 +2,7 @@ #define Z_BG_HAKA_ZOU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHakaZou; 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..88b063ae2c 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,10 +20,11 @@ #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_heavy_object/object_heavy_object.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_Heavy_Block/z_bg_heavy_block.h b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h index a93f5cc3a0..765a05a968 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h @@ -2,7 +2,7 @@ #define Z_BG_HEAVY_BLOCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHeavyBlock; 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 a20a0a0421..7abcc1f912 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,11 +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 "play_state.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -85,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 のタイプが設定されていない(%s %d)(arg_data 0x%04x)\n", + "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; } @@ -98,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 のセーブビットが設定されていない(%s %d)(arg_data 0x%04x)\n", + "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_Curtain/z_bg_hidan_curtain.h b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h index 14502cba68..89f43762d3 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_CURTAIN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanCurtain; 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 885967c2bb..412b2a5426 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 @@ -11,9 +11,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" 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 83cabfaab4..50165babbe 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 @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_DALM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanDalm; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 9394d4017b..9ca446025c 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -12,8 +12,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index 35e643279e..a407018592 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_FIREWALL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanFirewall; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index 2616f14ace..b8d10809f8 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -9,7 +9,7 @@ #include "ichain.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h index e21de9fca2..1f810b1c04 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_FSLIFT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanFslift; 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 47849aa850..0a01e35dcd 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 @@ -15,9 +15,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.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_Fwbig/z_bg_hidan_fwbig.h b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h index ce1f016125..495c9abc3d 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_FWBIG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanFwbig; 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 92ba5dd5b0..3f2e87ed3f 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,18 +6,21 @@ #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" +#include "play_state.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" @@ -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 faf1db7577..2a643b568d 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 @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_HAMSTEP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanHamstep; 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 a4fd5fab33..64159da59a 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 @@ -10,7 +10,7 @@ #include "rumble.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" 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 955ddd5dfc..8f00335b03 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 @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_HROCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanHrock; 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..3559b572fb 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,10 +10,12 @@ #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 "play_state.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.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_Kousi/z_bg_hidan_kousi.h b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h index 112b8dc09a..cb051c3bd0 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_KOUSI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanKousi; 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 27312b4fae..4f1be80a62 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,11 +11,13 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" @@ -129,8 +131,8 @@ 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", + PRINTF(T("Error : 炎の神殿 壊れる壁 の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", + "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 +147,9 @@ 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 爆弾で壊れる 壁 床)(arg_data 0x%04x)\n", "(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 7257a210f1..3f1b848d7b 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 @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_KOWARERUKABE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanKowarerukabe; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index bf5bc52317..872ed0608c 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -14,9 +14,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64skin_matrix.h" +#include "play_state.h" +#include "player.h" +#include "skin_matrix.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h index aa8d6ca874..d2651e157f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_ROCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanRock; 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 715ecc5fba..df5936d41e 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" @@ -13,7 +14,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" @@ -159,7 +160,7 @@ void BgHidanRsekizou_Destroy(Actor* thisx, PlayState* play) { void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) { BgHidanRsekizou* this = (BgHidanRsekizou*)thisx; s32 i; - ColliderJntSphElement* sphere; + ColliderJntSphElement* element; s32 pad; f32 yawSine; f32 yawCosine; @@ -179,12 +180,14 @@ void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) { yawCosine = Math_CosS(this->dyna.actor.shape.rot.y); 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; - sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + sphere->dim.modelSphere.center.y; - sphere->dim.worldSphere.center.z = (this->dyna.actor.home.pos.z - yawSine * sphere->dim.modelSphere.center.x) + - yawCosine * sphere->dim.modelSphere.center.z; + element = &this->collider.elements[i]; + element->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + + (yawCosine * element->dim.modelSphere.center.x) + + (yawSine * element->dim.modelSphere.center.z); + element->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + element->dim.modelSphere.center.y; + element->dim.worldSphere.center.z = this->dyna.actor.home.pos.z - + (yawSine * element->dim.modelSphere.center.x) + + (yawCosine * element->dim.modelSphere.center.z); } CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); 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 82725e4fc1..7810d0f411 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 @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_RSEKIZOU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanRsekizou; 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 1c86d7d851..bb7cf7edf5 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" @@ -13,8 +14,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" 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 c898f9d934..ebf8d5738a 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 @@ -2,7 +2,7 @@ #define Z_BG_HIDAN_SEKIZOU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanSekizou; 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 20b3717087..a44cfa3491 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 @@ -6,6 +6,7 @@ #include "z_bg_hidan_sima.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -14,8 +15,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" 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 dd64b556b0..14d461898e 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,7 +2,7 @@ #define Z_BG_HIDAN_SIMA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanSima; 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 d21b1e8212..a540872b96 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 @@ -8,7 +8,7 @@ #include "ichain.h" #include "sfx.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" 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 2ce3fbfd4e..6b169810c8 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,7 +2,7 @@ #define Z_BG_HIDAN_SYOKU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgHidanSyoku; 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 6bfd39e4e5..7398d9e8e0 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 @@ -11,9 +11,9 @@ #include "rand.h" #include "sfx.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_ice_objects/object_ice_objects.h" 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 364b087852..95ff43009f 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,7 +2,7 @@ #define Z_BG_ICE_OBJECTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgIceObjects; 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 0b19f74e6a..0c6578ec26 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 @@ -10,11 +10,13 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_ice_objects/object_ice_objects.h" @@ -135,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 30286a64d1..401fb7096f 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,7 +2,7 @@ #define Z_BG_ICE_SHELTER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgIceShelter; 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 20176f2758..8933b3c7a1 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 @@ -10,7 +10,7 @@ #include "one_point_cutscene.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_ice_objects/object_ice_objects.h" 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 aad63d435b..5d246aab9e 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,7 +2,7 @@ #define Z_BG_ICE_SHUTTER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgIceShutter; 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 8fb200aca5..8f619e0ed2 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 @@ -11,8 +11,8 @@ #include "rand.h" #include "sfx.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_ice_objects/object_ice_objects.h" 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 46a78eb738..c8779247cb 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,7 +2,7 @@ #define Z_BG_ICE_TURARA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgIceTurara; 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 e46139117c..61ea3e0e4c 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_ingate/object_ingate.h" 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 c9f46446ab..32eedc24b6 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h @@ -2,7 +2,7 @@ #define Z_BG_INGATE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgInGate; 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 94fd0883d4..6ff102aa41 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 @@ -7,10 +7,12 @@ #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 "play_state.h" +#include "save.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -85,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -102,8 +104,8 @@ 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リフト)(flag %d)(room %d)\n", "(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 8d772757bf..b909470829 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,7 +2,7 @@ #define Z_BG_JYA_1FLIFT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJya1flift; 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 e97451e861..046da7d10f 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 @@ -7,9 +7,11 @@ #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 "play_state.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -60,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 1dad4c1543..439bc41ae1 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 "z64actor.h" +#include "actor.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 7a3606213a..feb7cba7b7 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 @@ -9,8 +9,10 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "sys_matrix.h" -#include "z64play.h" +#include "translation.h" +#include "play_state.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -83,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(T("Error : コブラ削除された (%s %d)\n", "Error : Cobra deleted (%s %d)\n"), + "../z_bg_jya_bigmirror.c", 203); } #endif } else { @@ -94,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(T("Error : コブラ発生失敗 (%s %d)\n", "Error : Cobra failed to spawn (%s %d)\n"), + "../z_bg_jya_bigmirror.c", 221); } } } @@ -162,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(T("Error : Mir Ray 発生失敗 (%s %d)\n", "Error : Mir Ray failed to spawn (%s %d)\n"), + "../z_bg_jya_bigmirror.c", 310); } #endif } @@ -194,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(T("(jya 大鏡)(arg_data 0x%04x)\n", "(jya 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 56b6d8db07..15bc7f83e4 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,7 +2,7 @@ #define Z_BG_JYA_BIGMIRROR_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #define BIGMIR_PUZZLE_COBRA1_SOLVED (1 << 0) #define BIGMIR_PUZZLE_COBRA2_SOLVED (1 << 1) 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 946db1b05c..261bb07fb5 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 @@ -11,9 +11,9 @@ #include "ichain.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" 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 641141945a..53c72f03fc 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 "z64actor.h" +#include "actor.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 5b1c869eac..e19f90863a 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 @@ -6,11 +6,13 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" #define FLAGS ACTOR_FLAG_ATTENTION_ENABLED @@ -193,9 +195,9 @@ 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 発生失敗(%s %d)(arg_data 0x%04x)\n", + "Error : Mir_Ray failed to spawn (%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 ad9b9c33db..04d81c1e7f 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,7 +2,7 @@ #define Z_BG_JYA_BOMBCHUIWA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaBombchuiwa; 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 ea2dd59eb2..87a1aa3a78 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 @@ -9,10 +9,12 @@ #include "libc64/qrand.h" #include "ichain.h" +#include "printf.h" #include "sfx.h" #include "terminal.h" -#include "z64effect.h" -#include "z64play.h" +#include "translation.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -81,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -100,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 が変更された(%s %d)(SW %d)\n", + "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); @@ -113,8 +114,8 @@ 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 爆弾で破壊岩)(arg_data 0x%04x)\n", "(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 9f06d9a1d6..8888d372d6 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,7 +2,7 @@ #define Z_BG_JYA_BOMBIWA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaBombiwa; 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 6380e0cf6a..81fe1e598f 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 @@ -5,12 +5,14 @@ #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 "play_state.h" +#include "player.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -26,7 +28,13 @@ void func_80896950(BgJyaCobra* this, PlayState* play); void func_808969F8(BgJyaCobra* this, PlayState* play); void func_80896ABC(BgJyaCobra* this, PlayState* play); -#include "assets/overlays/ovl_Bg_Jya_Cobra/ovl_Bg_Jya_Cobra.c" +static Vtx sShadowVtx[] = { +#include "assets/overlays/ovl_Bg_Jya_Cobra/sShadowVtx.inc.c" +}; + +static Gfx sShadowDL[7] = { +#include "assets/overlays/ovl_Bg_Jya_Cobra/sShadowDL.inc.c" +}; ActorProfile Bg_Jya_Cobra_Profile = { /**/ ACTOR_BG_JYA_COBRA, @@ -137,9 +145,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -151,8 +159,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 発生失敗 (%s %d)\n", "Error : Mir Ray failed to occur (%s %d)\n"), + "../z_bg_jya_cobra.c", 270); PRINTF_RST(); } #endif @@ -437,9 +445,9 @@ 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, - &this->shadowTextureBuffer, COBRA_SHADOW_TEX_PTR(this)); + PRINTF(T("(jya コブラ)(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n", + "(jya cobra)(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n"), + this->dyna.actor.params, this, &this->shadowTextureBuffer, COBRA_SHADOW_TEX_PTR(this)); } void BgJyaCobra_Destroy(Actor* thisx, PlayState* play) { 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 32266e2ac4..9f2a9d9f36 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,7 +2,7 @@ #define Z_BG_JYA_COBRA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaCobra; 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 6d6b13efb8..fb25354ccd 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 @@ -10,8 +10,8 @@ #include "ichain.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_goroiwa/object_goroiwa.h" 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 35f4c971c9..3b24569f51 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,7 +2,7 @@ #define Z_BG_JYA_GOROIWA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaGoroiwa; 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 f19f5f9baf..dd514e850b 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 @@ -8,11 +8,12 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_jya_iron/object_jya_iron.h" 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 2da7d3673f..ba4af700bf 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,7 +2,7 @@ #define Z_BG_JYA_HAHENIRON_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaHaheniron; 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 3ecb0cb2f8..cf13895832 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 @@ -9,11 +9,13 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_jya_iron/object_jya_iron.h" @@ -89,15 +91,15 @@ static InitChainEntry sInitChain[] = { static CollisionHeader* sCollisionHeaders[] = { &gPillarCol, &gThroneCol }; void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) { - ColliderCylinder* colCylinder = &this->colliderCylinder; + s32 pad; - Collider_InitCylinder(play, colCylinder); - Collider_SetCylinder(play, colCylinder, &this->dyna.actor, &sCylinderInit); + Collider_InitCylinder(play, &this->colliderCylinder); + Collider_SetCylinder(play, &this->colliderCylinder, &this->dyna.actor, &sCylinderInit); if (PARAMS_GET_U(this->dyna.actor.params, 0, 1) == 1) { this->colliderCylinder.dim.radius = 40; this->colliderCylinder.dim.height = 100; } - Collider_UpdateCylinder(&this->dyna.actor, colCylinder); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliderCylinder); } /* @@ -117,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 @@ -183,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 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 9768aec2a5..3857918e31 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,7 +2,7 @@ #define Z_BG_JYA_IRONOBJ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaIronobj; 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 7aead74061..652ec8e8e6 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 @@ -8,10 +8,12 @@ #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 "play_state.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -59,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -75,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(T("(jya 金網)(arg_data 0x%04x)\n", "(jya 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 a125e8ef53..892a7354d1 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,7 +2,7 @@ #define Z_BG_JYA_KANAAMI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaKanaami; 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 50571f8ac5..83e58b79b8 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 @@ -8,9 +8,11 @@ #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 "play_state.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -66,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))) { @@ -85,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 ea9abac2bf..85db1a0969 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,7 +2,7 @@ #define Z_BG_JYA_LIFT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaLift; typedef void (*BgJyaLiftActionFunc)(struct BgJyaLift*, struct PlayState*); 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 4e9d88d7ce..da22420786 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 @@ -8,6 +8,7 @@ #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" @@ -16,8 +17,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" 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 e297ebb63a..013fac982d 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,7 +2,7 @@ #define Z_BG_JYA_MEGAMI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaMegami; 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 4dea268824..148d6c0098 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 @@ -6,12 +6,15 @@ #include "z_bg_jya_zurerukabe.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 "play_state.h" +#include "player.h" #include "assets/objects/object_jya_obj/object_jya_obj.h" @@ -78,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -133,14 +137,15 @@ 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 が変更されたみたい(%s %d)(arg_data 0x%04x)\n", + "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(T("(jya ずれる壁)(arg_data 0x%04x)\n", "(jya 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 d9d920f57b..ebbcf35c7e 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,7 +2,7 @@ #define Z_BG_JYA_ZURERUKABE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgJyaZurerukabe; 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 79102a7c12..b130738664 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 @@ -12,7 +12,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_menkuri_objects/object_menkuri_objects.h" @@ -70,7 +70,7 @@ static InitChainEntry sInitChain[] = { void BgMenkuriEye_Init(Actor* thisx, PlayState* play) { BgMenkuriEye* this = (BgMenkuriEye*)thisx; - ColliderJntSphElement* colliderList; + s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(play, &this->collider); @@ -78,8 +78,7 @@ void BgMenkuriEye_Init(Actor* thisx, PlayState* play) { 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; - colliderList = this->collider.elements; - colliderList->dim.worldSphere.radius = colliderList->dim.modelSphere.radius; + this->collider.elements[0].dim.worldSphere.radius = this->collider.elements[0].dim.modelSphere.radius; if (!Flags_GetSwitch(play, this->actor.params)) { sNumEyesShot = 0; } 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 69f1e32eab..212623d2ac 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 "z64actor.h" +#include "actor.h" struct BgMenkuriEye; 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 ee3f35a1db..1b17110214 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 @@ -8,7 +8,7 @@ #include "ichain.h" #include "sfx.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_menkuri_objects/object_menkuri_objects.h" 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 5bcdbf8ec4..cd1f5a7457 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 "z64actor.h" +#include "actor.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 0bc0649065..43a922bd33 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 @@ -6,7 +6,7 @@ #include "z_bg_menkuri_nisekabe.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_menkuri_objects/object_menkuri_objects.h" @@ -54,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 54cce56eff..7f462a5e44 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 "z64actor.h" +#include "actor.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 787739822f..bb21a6cb6f 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 @@ -8,13 +8,16 @@ #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 "play_state.h" #include "assets/objects/object_mizu_objects/object_mizu_objects.h" @@ -41,7 +44,7 @@ ActorProfile Bg_Mizu_Bwall_Profile = { /**/ BgMizuBwall_Draw, }; -static ColliderTrisElementInit sTrisElementInitFloor[2] = { +static ColliderTrisElementInit sTrisElementsInitFloor[2] = { { { ELEM_MATERIAL_UNK0, @@ -76,10 +79,10 @@ static ColliderTrisInit sTrisInitFloor = { COLSHAPE_TRIS, }, 2, - sTrisElementInitFloor, + sTrisElementsInitFloor, }; -static ColliderTrisElementInit sTrisElementInitRutoWall[1] = { +static ColliderTrisElementInit sTrisElementsInitRutoWall[1] = { { { ELEM_MATERIAL_UNK0, @@ -103,10 +106,10 @@ static ColliderTrisInit sTrisInitRutoWall = { COLSHAPE_TRIS, }, 1, - sTrisElementInitRutoWall, + sTrisElementsInitRutoWall, }; -static ColliderTrisElementInit sTrisElementInitWall[2] = { +static ColliderTrisElementInit sTrisElementsInitWall[2] = { { { ELEM_MATERIAL_UNK0, @@ -141,7 +144,7 @@ static ColliderTrisInit sTrisInitUnusedWall = { COLSHAPE_TRIS, }, 2, - sTrisElementInitWall, + sTrisElementsInitWall, }; static ColliderTrisInit sTrisInitStingerWall = { @@ -154,7 +157,7 @@ static ColliderTrisInit sTrisInitStingerWall = { COLSHAPE_TRIS, }, 2, - sTrisElementInitWall, + sTrisElementsInitWall, }; static Gfx* sDLists[] = { @@ -208,14 +211,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitFloor, this->colliderElements)) { - PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 484, - this->dyna.actor.params); + PRINTF(T("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", + "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); cos = Math_CosS(this->dyna.actor.shape.rot.y); - for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { + for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) { for (j = 0; j < 3; j++) { offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; @@ -248,14 +252,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitRutoWall, this->colliderElements)) { - PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 558, - this->dyna.actor.params); + PRINTF(T("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", + "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); cos = Math_CosS(this->dyna.actor.shape.rot.y); - for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) { + for (i = 0; i < ARRAY_COUNT(sTrisElementsInitRutoWall); i++) { for (j = 0; j < 3; j++) { offset.x = sTrisInitRutoWall.elements[i].dim.vtx[j].x; offset.y = sTrisInitRutoWall.elements[i].dim.vtx[j].y; @@ -288,14 +293,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitUnusedWall, this->colliderElements)) { - PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 638, - this->dyna.actor.params); + PRINTF(T("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", + "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); cos = Math_CosS(this->dyna.actor.shape.rot.y); - for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { + for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitUnusedWall. @@ -330,14 +336,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitStingerWall, this->colliderElements)) { - PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 724, - this->dyna.actor.params); + PRINTF(T("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", + "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); cos = Math_CosS(this->dyna.actor.shape.rot.y); - for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { + for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitStingerWall. @@ -372,14 +379,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInitStingerWall, this->colliderElements)) { - PRINTF("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_mizu_bwall.c", 798, - this->dyna.actor.params); + PRINTF(T("Error : コリジョンデータセット失敗(%s %d)(arg_data 0x%04x)\n", + "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); cos = Math_CosS(this->dyna.actor.shape.rot.y); - for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { + for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitStingerWall. 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 aacbf321a5..f56773d9ae 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,7 +2,7 @@ #define Z_BG_MIZU_BWALL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMizuBwall; 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 ae1dd32bc6..98de021dab 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 @@ -14,7 +14,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_mizu_objects/object_mizu_objects.h" 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 75a50e864e..0b527e59c4 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 "z64actor.h" +#include "actor.h" typedef enum BgMizuMovebgType { /* 0 */ MIZUMOVEBG_TYPE_FLOATING_PLATFORM_OUTSIDE_CENTER_PILLAR, 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 ed8fae2784..c8c325298c 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 @@ -8,7 +8,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_mizu_objects/object_mizu_objects.h" 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 bcba73f531..a3f172393a 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 "z64actor.h" +#include "actor.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) 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 3072207ece..03d4ac5628 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 @@ -8,8 +8,8 @@ #include "ichain.h" #include "sfx.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_mizu_objects/object_mizu_objects.h" 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 f8fe16ccd7..f415d0d4d9 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,7 +2,7 @@ #define Z_BG_MIZU_UZU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMizuUzu; 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 5a59ddd683..4b08d9479f 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 @@ -10,12 +10,14 @@ #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 "play_state.h" #include "assets/objects/object_mizu_objects/object_mizu_objects.h" @@ -120,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", "%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 26eb33d0d8..6f0122ae69 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,7 +2,7 @@ #define Z_BG_MIZU_WATER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMizuWater; 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 6fa9814a1b..cd9fc555c7 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -11,7 +11,7 @@ #include "ichain.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_mjin/object_mjin.h" #include "assets/objects/object_mjin_wind/object_mjin_wind.h" @@ -117,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 1ed19aa2a4..63601a13ff 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h @@ -2,7 +2,7 @@ #define Z_BG_MJIN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMjin; 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 9bc16b1fe4..baf9156bb7 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 @@ -10,11 +10,13 @@ #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 "z64play.h" -#include "z64player.h" +#include "translation.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_mori_objects/object_mori_objects.h" @@ -72,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -83,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.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", + "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; @@ -150,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 spawn\n")); } Flags_SetClear(play, this->dyna.actor.room); } @@ -212,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 failed to spawn\n")); } stalfos2 = Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_EN_TEST, 170.0f, 827.0f, -3260.0f, 0, 0, 0, 5); @@ -221,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 failed to spawn\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 f37499b2f7..772ee02e31 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,7 +2,7 @@ #define Z_BG_MORI_BIGST_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriBigst; 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 53206ecf72..8532ce180b 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 @@ -4,11 +4,13 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "one_point_cutscene.h" +#include "printf.h" #include "sfx.h" #include "sys_matrix.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64player.h" +#include "translation.h" +#include "audio.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_mori_objects/object_mori_objects.h" @@ -103,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); @@ -131,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; } @@ -155,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); @@ -216,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 42e45d56fc..14932fe534 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,7 +2,7 @@ #define Z_BG_MORI_ELEVATOR_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriElevator; 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 b75117adca..ad41dfc212 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 @@ -6,12 +6,15 @@ #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 "play_state.h" #include "assets/objects/object_mori_objects/object_mori_objects.h" @@ -99,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -137,9 +140,9 @@ 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(T("Error : 梯子の発生失敗(%s %d)(arg_data 0x%04x)\n", + "Error : Ladder failed to spawn (%s %d)(arg_data 0x%04x)\n"), + "../z_bg_mori_hashigo.c", 220, this->dyna.actor.params); return false; } } @@ -179,14 +182,14 @@ 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(T("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", "Error : 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("(森の神殿 梯子とその留め金)(arg_data 0x%04x)\n", + "(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 e14aec45e1..99fd9f035e 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,7 +2,7 @@ #define Z_BG_MORI_HASHIGO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriHashigo; 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 9f3b50dadb..fa25e2df8d 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 @@ -10,10 +10,12 @@ #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 "play_state.h" #include "assets/objects/object_mori_objects/object_mori_objects.h" @@ -70,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -93,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(T("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", "Error : 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)) { @@ -104,8 +105,8 @@ 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本柱)(arg_data 0x%04x)\n", "(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 e4ab5a2d85..627126d379 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,7 +2,7 @@ #define Z_BG_MORI_HASHIRA4_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriHashira4; 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 92fc3c57a8..e06abd1114 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 @@ -14,9 +14,9 @@ #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" -#include "z64curve.h" -#include "z64play.h" -#include "z64player.h" +#include "curve.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_box/object_box.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 b9a29df504..2761ab4f6b 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,7 +2,7 @@ #define Z_BG_MORI_HINERI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriHineri; 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 051e7c6874..2cd35ab1ee 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 @@ -9,10 +9,12 @@ #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 "play_state.h" #include "assets/objects/object_mori_objects/object_mori_objects.h" @@ -78,16 +80,16 @@ 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(T("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", "Error : 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("(森の神殿 井戸水)(arg_data 0x%04x)\n", "(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 4348622425..3f8c327a59 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,7 +2,7 @@ #define Z_BG_MORI_IDOMIZU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriIdomizu; 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 8bf43c9a18..3f41bf1e79 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 @@ -9,11 +9,13 @@ #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 "play_state.h" +#include "player.h" #include "assets/objects/object_mori_objects/object_mori_objects.h" @@ -60,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); @@ -69,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 91c0d65a80..6e7272cee1 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,7 +2,7 @@ #define Z_BG_MORI_KAITENKABE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriKaitenkabe; 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 b331b15b27..8693802846 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 @@ -6,16 +6,19 @@ #include "z_bg_mori_rakkatenjo.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 "play_state.h" +#include "player.h" #include "assets/objects/object_mori_objects/object_mori_objects.h" @@ -65,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. 落下天井 (home posY %f)\n", "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 657baefc53..07feeefd74 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,7 +2,7 @@ #define Z_BG_MORI_RAKKATENJO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgMoriRakkatenjo; 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 eda5a530eb..30f2044980 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 @@ -15,10 +15,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_po_sisters/object_po_sisters.h" @@ -103,7 +103,7 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, PlayState* play) { static s16 paintingPosX[] = { -1302, -866, 1421, 985 }; static s16 paintingPosY[] = { 1107, 1091 }; static s16 paintingPosZ[] = { -3384, -3252 }; - ColliderTrisElementInit* item; + ColliderTrisElementInit* elementInit; Vec3f* vtxVec; s32 i1; s32 i2; @@ -124,10 +124,10 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, PlayState* play) { scaleY = 1.0f; } for (i1 = 0; i1 < sTrisInit.count; i1++) { - item = &sTrisInit.elements[i1]; + elementInit = &sTrisInit.elements[i1]; if (1) {} // This section looks like a macro of some sort. for (i2 = 0; i2 < 3; i2++) { - vtxVec = &item->dim.vtx[i2]; + vtxVec = &elementInit->dim.vtx[i2]; sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.home.pos.x + (sins * vtxVec->z)); sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.home.pos.y; sp9C[i2].z = this->dyna.actor.home.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins); 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 78fe7fc966..4f299fa3c8 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,7 +2,7 @@ #define Z_BG_PO_EVENT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgPoEvent; 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 e5b8edea9d..cf9c454583 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 @@ -12,8 +12,8 @@ #include "ichain.h" #include "sfx.h" #include "sys_matrix.h" -#include "z64light.h" -#include "z64play.h" +#include "light.h" +#include "play_state.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 a6186dcbe7..3c50d66794 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,8 +2,8 @@ #define Z_BG_PO_SYOKUDAI_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.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 3392a15f60..49f017a0f9 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -11,7 +11,7 @@ #include "ichain.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_pu_box/object_pu_box.h" 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 38cd6857d9..267e141a5c 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h @@ -2,7 +2,7 @@ #define Z_BG_PUSHBOX_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgPushbox; 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 37591ae020..52f858a343 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 @@ -10,11 +10,11 @@ #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 "audio.h" +#include "cutscene_flags.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_relay_objects/object_relay_objects.h" 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 25db5cc5f6..caa91b1567 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,7 +2,7 @@ #define Z_BG_RELAY_OBJECTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgRelayObjects; 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 4a3a760d92..248043de43 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 @@ -7,8 +7,8 @@ #include "z_bg_spot00_break.h" #include "ichain.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot00_break/object_spot00_break.h" 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 17e45aa918..0597a30085 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 "z64actor.h" +#include "actor.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 c305635b83..8b6ab5ac96 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 @@ -13,11 +13,11 @@ #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 "cutscene_flags.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_spot00_objects/object_spot00_objects.h" 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 7780bea692..93b43331fa 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,8 +2,8 @@ #define Z_BG_SPOT00_HANEBASI_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct BgSpot00Hanebasi; 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 33f96d5476..36a2c78c32 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 @@ -9,11 +9,12 @@ #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 "audio.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot01_objects/object_spot01_objects.h" @@ -74,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 e232c6a907..434f5f11ba 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,7 +2,7 @@ #define Z_BG_SPOT01_FUSYA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot01Fusya; 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 d5a21a8b6b..4f65271474 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 @@ -9,14 +9,16 @@ #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 "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot01_objects/object_spot01_objects.h" @@ -191,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; } @@ -266,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; @@ -296,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); @@ -347,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 8d177d3317..c6632d7f37 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,7 +2,7 @@ #define Z_BG_SPOT01_IDOHASHIRA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot01Idohashira; 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 5329d2e0f6..ebeffcc2fb 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 @@ -12,8 +12,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot01_objects/object_spot01_objects.h" 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 3d4ff68a6f..20b4a5ef73 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,7 +2,7 @@ #define Z_BG_SPOT01_IDOMIZU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot01Idomizu; 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 6dbdd910d5..b68a23208f 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot01_matoya/object_spot01_matoya.h" 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 44981abc07..6e187712ca 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,7 +2,7 @@ #define Z_BG_SPOT01_IDOSOKO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot01Idosoko; 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 4b7e9eed8a..3f50e2e866 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 @@ -7,9 +7,11 @@ #include "z_bg_spot01_objects2.h" #include "ichain.h" +#include "printf.h" #include "segmented_address.h" -#include "z64play.h" -#include "z64save.h" +#include "translation.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot01_matoya/object_spot01_matoya.h" #include "assets/objects/object_spot01_matoyab/object_spot01_matoyab.h" @@ -67,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; } @@ -98,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 7ffc3094fe..39fdf213a8 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,7 +2,7 @@ #define Z_BG_SPOT01_OBJECTS2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot01Objects2; 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 795df90151..ffe4ee021a 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 @@ -14,10 +14,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_spot02_objects/object_spot02_objects.h" 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 42d4e45b08..32ed8bca35 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,7 +2,7 @@ #define Z_BG_SPOT02_OBJECTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot02Objects; 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 501a677359..e77823866c 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 @@ -12,8 +12,8 @@ #include "one_point_cutscene.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64audio.h" -#include "z64play.h" +#include "audio.h" +#include "play_state.h" #include "assets/objects/object_spot03_object/object_spot03_object.h" 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 45ad4de4f2..3fd0960883 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 "z64actor.h" +#include "actor.h" typedef enum BgSpot03TakiState { WATERFALL_CLOSED, 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 edb253568d..1303fad735 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 @@ -10,8 +10,8 @@ #include "one_point_cutscene.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot05_objects/object_spot05_objects.h" 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 1aae818797..bc5602264d 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,7 +2,7 @@ #define Z_BG_SPOT05_SOKO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot05Soko; 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 45b2b1e9f2..c3c94063c5 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 @@ -10,13 +10,14 @@ #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 "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot06_objects/object_spot06_objects.h" 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 cbdc1054f8..c0c555f771 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,7 +2,7 @@ #define Z_BG_SPOT06_OBJECTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot06Objects; 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 afb9d02972..bc054e20b9 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 @@ -11,8 +11,8 @@ #include "ichain.h" #include "sys_matrix.h" #include "versions.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot07_object/object_spot07_object.h" 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 30872233ad..1e2a79737a 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,7 +2,7 @@ #define Z_BG_SPOT07_TAKI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot07Taki; 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 b54226cec8..ce59f55d04 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 @@ -8,11 +8,12 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" #include "assets/objects/object_spot08_obj/object_spot08_obj.h" 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 a0436ea9ea..2f423b5645 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,7 +2,7 @@ #define Z_BG_SPOT08_BAKUDANKABE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot08Bakudankabe; 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 4f0bb37567..ee7036a491 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,12 +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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_spot08_obj/object_spot08_obj.h" @@ -61,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -75,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 設定ミスです。(%s %d)(arg_data 0x%04x)\n", + "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: @@ -298,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(T("(spot08 流氷)(arg_data 0x%04x)\n", "(spot08 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_Spot08_Iceblock/z_bg_spot08_iceblock.h b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h index 1a3f920c3e..45c5976f37 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h @@ -2,7 +2,7 @@ #define Z_BG_SPOT08_ICEBLOCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot08Iceblock; 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 449091faa0..8fa33c1d22 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 @@ -6,12 +6,15 @@ #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 "z64play.h" -#include "z64save.h" +#include "translation.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot09_obj/object_spot09_obj.h" @@ -145,12 +148,14 @@ 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(T("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", + "Spot09 Object [arg_data : 0x%04x](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 が判別出来ない(%s %d)(arg_data 0x%04x)\n", + "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 491d7380c2..c0a60964f7 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 "z64actor.h" +#include "actor.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 1aafed8831..427d9d4a6c 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 @@ -8,10 +8,12 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_spot11_obj/object_spot11_obj.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" @@ -128,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(T("(spot11 爆弾壁)(arg_data 0x%04x)\n", "(spot11 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 5dedab77d5..a4a4910f33 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 "z64actor.h" +#include "actor.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 1af76df476..d4a2be3391 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 @@ -8,6 +8,7 @@ #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" @@ -16,10 +17,10 @@ #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 "cutscene_flags.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_spot11_obj/object_spot11_obj.h" 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 0f0ed97e6e..c869405f51 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,7 +2,7 @@ #define Z_BG_SPOT11_OASIS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot11Oasis; 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 9a36eb287d..f6eae41733 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 @@ -8,10 +8,12 @@ #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 "play_state.h" #include "assets/objects/object_spot12_obj/object_spot12_obj.h" @@ -62,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 bb9ef25cf5..5c8e101db3 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,7 +2,7 @@ #define Z_BG_SPOT12_GATE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot12Gate; 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 1edeb59461..71674bc12b 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 @@ -8,9 +8,11 @@ #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 "play_state.h" #include "assets/objects/object_spot12_obj/object_spot12_obj.h" @@ -59,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 7ed7751ede..6c37ec6d97 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,7 +2,7 @@ #define Z_BG_SPOT12_SAKU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot12Saku; 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 02dbe68e3a..650cc50723 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 @@ -6,13 +6,16 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_spot15_obj/object_spot15_obj.h" @@ -76,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -142,7 +146,8 @@ void BgSpot15Rrbox_Init(Actor* thisx, PlayState* play) { } else { func_808B4084(this, play); } - PRINTF("(spot15 ロンロン木箱)(arg_data 0x%04x)\n", this->dyna.actor.params); + PRINTF(T("(spot15 ロンロン木箱)(arg_data 0x%04x)\n", "(spot15 Lon Lon Wooden Box)(arg_data 0x%04x)\n"), + this->dyna.actor.params); } void BgSpot15Rrbox_Destroy(Actor* thisx, PlayState* play) { @@ -329,9 +334,9 @@ 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(T("Warning : ロンロン木箱落ちすぎた(%s %d)(arg_data 0x%04x)\n", + "Warning : 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 d0534e1e73..a55d5c82cc 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,7 +2,7 @@ #define Z_BG_SPOT15_RRBOX_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot15Rrbox; 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 c053a6c2d1..a95f92eba9 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "sfx.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot15_obj/object_spot15_obj.h" 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 35fcbee90e..6111804318 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,7 +2,7 @@ #define Z_BG_SPOT15_SAKU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot15Saku; 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 b014d7faff..d3b44d8aeb 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 @@ -3,19 +3,22 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_spot16_obj/object_spot16_obj.h" #include "assets/objects/object_bombiwa/object_bombiwa.h" @@ -187,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); @@ -237,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(T("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", "Error : Bank danger! (arg_data 0x%04x)(%s %d)\n"), + actor->params, "../z_bg_spot16_bombstone.c", 589); return false; } @@ -269,8 +273,9 @@ 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 おかしいな(%s %d)(arg_data 0x%04x)\n", + "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 @@ -280,7 +285,9 @@ 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( + T("Spot16 obj 爆弾石 (scaleX %f)(arg_data 0x%04x)\n", "Spot16 obj Bomb Stone (scaleX %f)(arg_data 0x%04x)\n"), + this->actor.scale.x, this->actor.params); } void BgSpot16Bombstone_Destroy(Actor* thisx, PlayState* play) { @@ -403,8 +410,9 @@ 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 補正出来ない(%s %d)(arg_data 0x%04x)(hosei_angY %x)\n", + "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 577bd3863b..74cf8db05f 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,7 +2,7 @@ #define Z_BG_SPOT16_BOMBSTONE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot16Bombstone; 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 c6cf246bca..dbeb445596 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 @@ -9,10 +9,12 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "sys_matrix.h" #include "terminal.h" -#include "z64play.h" -#include "z64save.h" +#include "translation.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_efc_doughnut/object_efc_doughnut.h" @@ -83,7 +85,8 @@ void BgSpot16Doughnut_Init(Actor* thisx, PlayState* play) { } else { this->fireFlag |= 1; } - PRINTF("(spot16 ドーナツ雲)(arg_data 0x%04x)\n", this->actor.params); + PRINTF(T("(spot16 ドーナツ雲)(arg_data 0x%04x)\n", "(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 3b7008ef2d..c453dd1cd0 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 "z64actor.h" +#include "actor.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 03f7b4514b..7c5546156c 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 @@ -14,8 +14,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.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 fd88416ddf..618682b608 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 "z64actor.h" +#include "actor.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 84973d0b11..7d580c9b46 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 @@ -9,8 +9,10 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "sys_matrix.h" -#include "z64play.h" +#include "translation.h" +#include "play_state.h" #include "assets/objects/object_spot17_obj/object_spot17_obj.h" @@ -42,7 +44,8 @@ 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(T("spot17 obj. 噴煙 (arg_data 0x%04x)\n", "spot17 obj. 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 737719ea28..086d55c449 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 "z64actor.h" +#include "actor.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 2f36cd5034..5e4c7896f7 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,16 +1,19 @@ #include "z_bg_spot18_basket.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 "audio.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_spot18_obj/object_spot18_obj.h" @@ -168,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 : 変化壷蓋発生失敗(%s %d)\n", "Error : Failed to spawn 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 460a56fb12..6b4c85bceb 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,7 +2,7 @@ #define Z_BG_SPOT18_BASKET_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot18Basket; 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 21bc50671c..9a30eb90df 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 @@ -8,7 +8,7 @@ #include "ichain.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_spot18_obj/object_spot18_obj.h" 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 ff0c2cf8ac..a24b60f093 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 "z64actor.h" +#include "actor.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 7012e9023c..e5ebde92cf 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 @@ -7,13 +7,16 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_spot18_obj/object_spot18_obj.h" @@ -105,8 +108,9 @@ 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 : リンク年齢不詳 (%s %d)(arg_data 0x%04x)\n", + "Error : Link age unknown (%s %d)(arg_data 0x%04x)\n"), + "../z_bg_spot18_obj.c", 182, this->dyna.actor.params); return 0; } @@ -114,16 +118,18 @@ 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出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", + "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出現判定失敗(%s %d)(arg_data 0x%04x)\n", + "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 bfa758afd7..c523ae383e 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,7 +2,7 @@ #define Z_BG_SPOT18_OBJ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot18Obj; 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 a92e53a4f2..b6eacf13f4 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 @@ -10,8 +10,8 @@ #include "one_point_cutscene.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_spot18_obj/object_spot18_obj.h" 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 737d30bdbb..d95dc8fbbc 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,7 +2,7 @@ #define Z_BG_SPOT18_SHUTTER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgSpot18Shutter; 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 1ddffb6c98..f2dfdc363f 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 @@ -13,8 +13,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_sst/object_sst.h" 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 eb4abfa662..7ef76380f5 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 "z64actor.h" +#include "actor.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 47550f22bd..f11e24ef52 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_toki_objects/object_toki_objects.h" 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 3c49b61cca..62f668f842 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,7 +2,7 @@ #define Z_BG_TOKI_HIKARI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgTokiHikari; 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 a3a3856969..144388d38e 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 @@ -13,10 +13,10 @@ #include "sequence.h" #include "sfx.h" #include "sys_matrix.h" -#include "z64cutscene_flags.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "cutscene_flags.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_toki_objects/object_toki_objects.h" 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 5fdb9e0692..6ecaa26884 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,7 +2,7 @@ #define Z_BG_TOKI_SWD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgTokiSwd; 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 123a797a73..efc039ced4 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 "z64cutscene_commands.h" -#include "z64player.h" +#include "cutscene_commands.h" +#include "player.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 3e27901701..4de0284695 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 "z64cutscene_commands.h" -#include "z64player.h" +#include "cutscene_commands.h" +#include "player.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 3e5ccb4ea6..9d40cf7b01 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 "z64cutscene_commands.h" -#include "z64player.h" +#include "cutscene_commands.h" +#include "player.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 5a544c3015..5ac35592bd 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -14,10 +14,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "versions.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_spot04_objects/object_spot04_objects.h" 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 7fea6f8e77..78f7d633c3 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h @@ -2,7 +2,7 @@ #define Z_BG_TREEMOUTH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgTreemouth; 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 c254318d42..fda53b3d9c 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,6 +1,6 @@ #include "sequence.h" -#include "z64cutscene_commands.h" -#include "z64player.h" +#include "cutscene_commands.h" +#include "player.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 63a73aaf4e..ce538ce9b4 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -8,8 +8,8 @@ #include "ichain.h" #include "regs.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_umajump/object_umajump.h" 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 067b5195c8..620350f4c4 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 "z64actor.h" +#include "actor.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 679519f1be..a3ef2197eb 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 @@ -15,8 +15,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_fd/object_fd.h" 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 1dcee1b596..9371f91521 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 "z64actor.h" +#include "actor.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 f759a98148..1d563eda76 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 @@ -13,7 +13,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_ydan_objects/object_ydan_objects.h" 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 a308c6ebc0..6f938f887b 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,7 +2,7 @@ #define Z_BG_YDAN_HASI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgYdanHasi; 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 becd2a11cc..8d683a9422 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 @@ -10,7 +10,7 @@ #include "one_point_cutscene.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_ydan_objects/object_ydan_objects.h" @@ -89,7 +89,7 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { f32 sinRotY; f32 cosRotY; CollisionHeader* colHeader = NULL; - ColliderTrisElementInit* triInit; + ColliderTrisElementInit* triElementInit; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Collider_InitTris(play, &this->collider); @@ -99,10 +99,10 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { thisx->params = PARAMS_GET_U(thisx->params, 8, 8); // thisx is required to match here if (this->dyna.actor.params == 0) { - triInit = &sTrisElementsInit[0]; + triElementInit = &sTrisElementsInit[0]; this->actionFunc = func_808BEFF4; } else { - triInit = &sTrisElementsInit[1]; + triElementInit = &sTrisElementsInit[1]; DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&gDTFallingLadderCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); @@ -119,16 +119,16 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { cosRotY = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < 3; i++) { - sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + this->dyna.actor.world.pos.x; - sp4C[i].y = triInit->dim.vtx[i].y + this->dyna.actor.world.pos.y; - sp4C[i].z = this->dyna.actor.world.pos.z - (triInit->dim.vtx[i].x * sinRotY); + sp4C[i].x = (triElementInit->dim.vtx[i].x * cosRotY) + this->dyna.actor.world.pos.x; + sp4C[i].y = triElementInit->dim.vtx[i].y + this->dyna.actor.world.pos.y; + sp4C[i].z = this->dyna.actor.world.pos.z - (triElementInit->dim.vtx[i].x * sinRotY); } Collider_SetTrisVertices(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]); - sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + this->dyna.actor.world.pos.x; - sp4C[1].y = triInit->dim.vtx[0].y + this->dyna.actor.world.pos.y; - sp4C[1].z = this->dyna.actor.world.pos.z - (triInit->dim.vtx[2].x * sinRotY); + sp4C[1].x = (triElementInit->dim.vtx[2].x * cosRotY) + this->dyna.actor.world.pos.x; + sp4C[1].y = triElementInit->dim.vtx[0].y + this->dyna.actor.world.pos.y; + sp4C[1].z = this->dyna.actor.world.pos.z - (triElementInit->dim.vtx[2].x * sinRotY); Collider_SetTrisVertices(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]); } 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 450c550b3a..6fb6724364 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,7 +2,7 @@ #define Z_BG_YDAN_MARUTA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgYdanMaruta; 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 0034cfb4ca..9e6fca4b52 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 @@ -16,9 +16,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_ydan_objects/object_ydan_objects.h" @@ -51,7 +51,7 @@ ActorProfile Bg_Ydan_Sp_Profile = { /**/ BgYdanSp_Draw, }; -static ColliderTrisElementInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { { ELEM_MATERIAL_UNK0, @@ -86,7 +86,7 @@ static ColliderTrisInit sTrisInit = { COLSHAPE_TRIS, }, 2, - sTrisItemsInit, + sTrisElementsInit, }; static InitChainEntry sInitChain[] = { @@ -95,11 +95,11 @@ static InitChainEntry sInitChain[] = { void BgYdanSp_Init(Actor* thisx, PlayState* play) { BgYdanSp* this = (BgYdanSp*)thisx; - ColliderTrisElementInit* ti0 = &sTrisItemsInit[0]; + ColliderTrisElementInit* triElementInit0 = &sTrisElementsInit[0]; Vec3f tri[3]; s32 i; CollisionHeader* colHeader = NULL; - ColliderTrisElementInit* ti1 = &sTrisItemsInit[1]; + ColliderTrisElementInit* triElementInit1 = &sTrisElementsInit[1]; f32 cossY; f32 sinsY; f32 cossX; @@ -110,22 +110,22 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) { this->burnSwitchFlag = PARAMS_GET_U(thisx->params, 6, 6); this->dyna.actor.params = PARAMS_GET_U(thisx->params, 12, 4); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - Collider_InitTris(play, &this->trisCollider); - Collider_SetTris(play, &this->trisCollider, &this->dyna.actor, &sTrisInit, this->trisColliderItems); + Collider_InitTris(play, &this->colliderTris); + Collider_SetTris(play, &this->colliderTris, &this->dyna.actor, &sTrisInit, this->colliderTrisElements); if (this->dyna.actor.params == WEB_FLOOR) { CollisionHeader_GetVirtual(&gDTWebFloorCol, &colHeader); this->actionFunc = BgYdanSp_FloorWebIdle; for (i = 0; i < 3; i++) { - tri[i].x = ti0->dim.vtx[i].x + this->dyna.actor.world.pos.x; - tri[i].y = ti0->dim.vtx[i].y + this->dyna.actor.world.pos.y; - tri[i].z = ti0->dim.vtx[i].z + this->dyna.actor.world.pos.z; + tri[i].x = triElementInit0->dim.vtx[i].x + this->dyna.actor.world.pos.x; + tri[i].y = triElementInit0->dim.vtx[i].y + this->dyna.actor.world.pos.y; + tri[i].z = triElementInit0->dim.vtx[i].z + this->dyna.actor.world.pos.z; } - Collider_SetTrisVertices(&this->trisCollider, 0, &tri[0], &tri[1], &tri[2]); + Collider_SetTrisVertices(&this->colliderTris, 0, &tri[0], &tri[1], &tri[2]); tri[1].x = tri[0].x; tri[1].z = tri[2].z; - Collider_SetTrisVertices(&this->trisCollider, 1, &tri[0], &tri[2], &tri[1]); + Collider_SetTrisVertices(&this->colliderTris, 1, &tri[0], &tri[2], &tri[1]); this->unk_16C = 0.0f; } else { CollisionHeader_GetVirtual(&gDTWebWallCol, &colHeader); @@ -137,19 +137,21 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) { cossX = Math_CosS(this->dyna.actor.shape.rot.x); for (i = 0; i < 3; i++) { - tri[i].x = - this->dyna.actor.world.pos.x + (cossY * ti1->dim.vtx[i].x) - (sinsY * ti1->dim.vtx[i].y * nSinsX); - tri[i].y = this->dyna.actor.world.pos.y + (ti1->dim.vtx[i].y * cossX); - tri[i].z = - this->dyna.actor.world.pos.z - (sinsY * ti1->dim.vtx[i].x) + (ti1->dim.vtx[i].y * cossY * nSinsX); + tri[i].x = this->dyna.actor.world.pos.x + (cossY * triElementInit1->dim.vtx[i].x) - + (sinsY * triElementInit1->dim.vtx[i].y * nSinsX); + tri[i].y = this->dyna.actor.world.pos.y + (triElementInit1->dim.vtx[i].y * cossX); + tri[i].z = this->dyna.actor.world.pos.z - (sinsY * triElementInit1->dim.vtx[i].x) + + (triElementInit1->dim.vtx[i].y * cossY * nSinsX); } - Collider_SetTrisVertices(&this->trisCollider, 0, &tri[0], &tri[1], &tri[2]); + Collider_SetTrisVertices(&this->colliderTris, 0, &tri[0], &tri[1], &tri[2]); - tri[1].x = this->dyna.actor.world.pos.x + (cossY * ti1->dim.vtx[0].x) - (ti1->dim.vtx[2].y * sinsY * nSinsX); - tri[1].y = this->dyna.actor.world.pos.y + (ti1->dim.vtx[2].y * cossX); - tri[1].z = this->dyna.actor.world.pos.z - (sinsY * ti1->dim.vtx[0].x) + (ti1->dim.vtx[2].y * cossY * nSinsX); - Collider_SetTrisVertices(&this->trisCollider, 1, &tri[0], &tri[2], &tri[1]); + tri[1].x = this->dyna.actor.world.pos.x + (cossY * triElementInit1->dim.vtx[0].x) - + (triElementInit1->dim.vtx[2].y * sinsY * nSinsX); + tri[1].y = this->dyna.actor.world.pos.y + (triElementInit1->dim.vtx[2].y * cossX); + tri[1].z = this->dyna.actor.world.pos.z - (sinsY * triElementInit1->dim.vtx[0].x) + + (triElementInit1->dim.vtx[2].y * cossY * nSinsX); + Collider_SetTrisVertices(&this->colliderTris, 1, &tri[0], &tri[2], &tri[1]); } this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->timer = 0; @@ -161,7 +163,7 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) { void BgYdanSp_Destroy(Actor* thisx, PlayState* play) { BgYdanSp* this = (BgYdanSp*)thisx; DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - Collider_DestroyTris(play, &this->trisCollider); + Collider_DestroyTris(play, &this->colliderTris); } void BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) { @@ -298,7 +300,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) { BgYdanSp_BurnWeb(this, play); return; } - if (this->trisCollider.base.acFlags & AC_HIT) { + if (this->colliderTris.base.acFlags & AC_HIT) { BgYdanSp_BurnWeb(this, play); return; } @@ -345,7 +347,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) { } } BgYdanSp_UpdateFloorWebCollision(this); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->trisCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderTris.base); } void BgYdanSp_BurnWallWeb(BgYdanSp* this, PlayState* play) { @@ -406,7 +408,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) { Vec3f sp30; player = GET_PLAYER(play); - if (Flags_GetSwitch(play, this->burnSwitchFlag) || (this->trisCollider.base.acFlags & AC_HIT)) { + if (Flags_GetSwitch(play, this->burnSwitchFlag) || (this->colliderTris.base.acFlags & AC_HIT)) { this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f; BgYdanSp_BurnWeb(this, play); } else if (player->heldItemAction == PLAYER_IA_DEKU_STICK && player->unk_860 != 0) { @@ -417,7 +419,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) { BgYdanSp_BurnWeb(this, play); } } - CollisionCheck_SetAC(play, &play->colChkCtx, &this->trisCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderTris.base); } void BgYdanSp_Update(Actor* thisx, PlayState* play) { 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 b2138e23a5..300fb42cfc 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,7 +2,7 @@ #define Z_BG_YDAN_SP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgYdanSp; @@ -15,8 +15,8 @@ typedef struct BgYdanSp { /* 0x0169 */ u8 burnSwitchFlag; /* 0x016A */ s16 timer; /* 0x016C */ f32 unk_16C; - /* 0x0170 */ ColliderTris trisCollider; - /* 0x0190 */ ColliderTrisElement trisColliderItems[2]; + /* 0x0170 */ ColliderTris colliderTris; + /* 0x0190 */ ColliderTrisElement colliderTrisElements[2]; } BgYdanSp; // size = 0x0248 #endif 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 68bacc26c8..f607fb4150 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -9,11 +9,13 @@ #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 "z64play.h" +#include "translation.h" +#include "play_state.h" #include "assets/objects/object_zg/object_zg.h" @@ -108,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); } @@ -155,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 c7f1add3a5..7791107db3 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h @@ -2,7 +2,7 @@ #define Z_BG_ZG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BgZg; 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 bfc700c6dc..56db81767b 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -15,11 +15,12 @@ #include "sequence.h" #include "sfx.h" #include "sys_matrix.h" +#include "tex_len.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_kingdodongo/object_kingdodongo.h" #include "assets/scenes/dungeons/ddan_boss/ddan_boss_room_1.h" @@ -69,7 +70,18 @@ ActorProfile Boss_Dodongo_Profile = { }; #include "z_boss_dodongo_data.inc.c" -#include "assets/overlays/ovl_Boss_Dodongo/ovl_Boss_Dodongo.c" + +#define sLavaFloorLavaTex_WIDTH 64 +#define sLavaFloorLavaTex_HEIGHT 64 +static u64 sLavaFloorLavaTex[TEX_LEN(u64, sLavaFloorLavaTex_WIDTH, sLavaFloorLavaTex_HEIGHT, 16)] = { +#include "assets/overlays/ovl_Boss_Dodongo/sLavaFloorLavaTex.rgba16.inc.c" +}; + +#define sLavaFloorRockTex_WIDTH 32 +#define sLavaFloorRockTex_HEIGHT 64 +static u64 sLavaFloorRockTex[TEX_LEN(u64, sLavaFloorRockTex_WIDTH, sLavaFloorRockTex_HEIGHT, 16)] = { +#include "assets/overlays/ovl_Boss_Dodongo/sLavaFloorRockTex.rgba16.inc.c" +}; static InitChainEntry sInitChain[] = { ICHAIN_U8(attentionRangeType, ATTENTION_RANGE_5, ICHAIN_CONTINUE), 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 191487f13f..3dbd41cd5e 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h @@ -2,7 +2,7 @@ #define Z_BOSS_DODONGO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossDodongo; 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 3d0061bb35..ce2d694b11 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 "z64collision_check.h" +#include "collision_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, 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 aad89ee93f..5643da5d98 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -12,10 +12,12 @@ #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" @@ -23,10 +25,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_fd/object_fd.h" @@ -1305,12 +1307,12 @@ void BossFd_Effects(BossFd* this, PlayState* play) { } void BossFd_CollisionCheck(BossFd* this, PlayState* play) { - ColliderJntSphElement* headCollider = &this->collider.elements[0]; + ColliderJntSphElement* headColliderElem = &this->collider.elements[0]; ColliderElement* acHitElem; - if (headCollider->base.acElemFlags & ACELEM_HIT) { - headCollider->base.acElemFlags &= ~ACELEM_HIT; - acHitElem = headCollider->base.acHitElem; + if (headColliderElem->base.acElemFlags & ACELEM_HIT) { + headColliderElem->base.acElemFlags &= ~ACELEM_HIT; + acHitElem = headColliderElem->base.acHitElem; this->actor.colChkInfo.health -= 2; if (acHitElem->atDmgInfo.dmgFlags & DMG_ARROW_ICE) { this->actor.colChkInfo.health -= 2; 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 1ec72040c9..99bd75c6d6 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h @@ -2,7 +2,7 @@ #define Z_BOSS_FD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossFd; 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 1012117e52..edd02bd7d9 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,4 +1,4 @@ -#include "z64collision_check.h" +#include "collision_check.h" static ColliderJntSphElementInit sJntSphElementsInit[19] = { { 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 27c5d82e96..efc154e97f 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -8,10 +8,12 @@ #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" @@ -21,8 +23,8 @@ #include "sys_matrix.h" #include "terminal.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_fd2/object_fd2.h" 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 d9fbde0ada..2c9fbf6b81 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h @@ -2,7 +2,7 @@ #define Z_BOSS_FD2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossFd2; 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 3a432692fe..2323528180 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 "z64collision_check.h" +#include "collision_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 97bf27b6f9..c9e41de7d7 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" @@ -20,10 +21,10 @@ #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.h" #include "assets/objects/object_ganon/object_ganon.h" @@ -124,15 +125,15 @@ 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" \ - "ique-cn:192 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: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; static s32 sSeed2; @@ -359,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[] = { @@ -522,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; @@ -570,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; @@ -1117,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), @@ -1207,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; @@ -1220,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; @@ -1255,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); @@ -2834,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_Ganon/z_boss_ganon.h b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h index eb7fc2e2bf..4864087bc6 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h @@ -2,7 +2,7 @@ #define Z_BOSS_GANON_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossGanon; 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 f0e1656fa0..efe3f9583f 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" @@ -17,10 +19,10 @@ #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ganon/object_ganon.h" #include "assets/objects/object_ganon2/object_ganon2.h" @@ -379,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); @@ -1342,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_Ganon2/z_boss_ganon2.h b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h index c72fbd1e25..0258746798 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h @@ -2,7 +2,7 @@ #define Z_BOSS_GANON2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossGanon2; 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 cc30350bc4..09f84081de 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -13,10 +13,12 @@ #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" @@ -24,10 +26,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64light.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "light.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_gnd/object_gnd.h" 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 1fed43e428..df76f54750 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h @@ -2,8 +2,8 @@ #define Z_BOSS_GANONDROF_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct BossGanondrof; 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 c1719b8e6d..0d83b2b4a3 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -11,10 +11,12 @@ #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" @@ -23,11 +25,11 @@ #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 "effect.h" +#include "environment.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_goma/object_goma.h" 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 4e4c8ea955..7d8a3c9387 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h @@ -2,7 +2,7 @@ #define Z_BOSS_GOMA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossGoma; 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 cbb82fd9a6..4a1b0acbba 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -9,12 +9,14 @@ #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" @@ -24,15 +26,14 @@ #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 "global.h" +#include "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_mo/object_mo.h" @@ -1785,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; @@ -1868,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 88867ceeda..54e95a74e7 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h @@ -2,7 +2,7 @@ #define Z_BOSS_MO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossMo; 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 1148cf1a99..8063245fa3 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,4 +1,4 @@ -#include "z64collision_check.h" +#include "collision_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 1425b63c8b..fd18b10ece 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -23,17 +23,17 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "skin_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:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn: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" \ + "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 | \ @@ -917,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 { @@ -2552,7 +2552,7 @@ void BossSst_HandCollisionCheck(BossSst* this, PlayState* play) { s32 bothHands = true; this->colliderJntSph.base.acFlags &= ~AC_HIT; - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); this->colliderJntSph.base.acFlags &= ~AC_ON; this->colliderJntSph.base.ocFlags1 &= ~OC1_NO_PUSH; @@ -2563,7 +2563,7 @@ void BossSst_HandCollisionCheck(BossSst* this, PlayState* play) { } this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; - if (this->actor.colChkInfo.damageEffect == 3) { + if (this->actor.colChkInfo.damageReaction == 3) { BossSst_HandSetupFrozen(this); } else { BossSst_HandSetupReel(this); @@ -2583,7 +2583,7 @@ void BossSst_HandCollisionCheck(BossSst* this, PlayState* play) { void BossSst_HeadCollisionCheck(BossSst* this, PlayState* play) { 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->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->actionFunc == BossSst_HeadVulnerable) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); @@ -2713,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))) { @@ -2818,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; @@ -2897,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) { @@ -2924,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 caf4891ccb..1cd1f7663b 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h @@ -2,7 +2,7 @@ #define Z_BOSS_SST_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossSst; 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 0016ff93d5..cb0e5012c1 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,4 +1,4 @@ -#include "z64collision_check.h" +#include "collision_check.h" static ColliderJntSphElementInit sJntSphElementsInitHand[11] = { { 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 50bb35218a..79eb682a76 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -3,11 +3,13 @@ #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" @@ -16,14 +18,17 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_tw/object_tw.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) 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 df62aeff37..17ce1ae4ca 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h @@ -2,7 +2,7 @@ #define Z_BOSS_TW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossTw; 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 d5454d30e8..7cbbff4c3e 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Boom/z_en_boom.h" #include "libc64/qrand.h" +#include "array_count.h" #include "attributes.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -20,16 +21,16 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "save.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: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" +#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 | \ @@ -1401,7 +1402,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { if (this->timer >= 0) { if (this->invincibilityTimer == 0) { this->invincibilityTimer = 8; - if (this->actor.colChkInfo.damageEffect != 1) { + if (this->actor.colChkInfo.damageReaction != 1) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_DAMAGE); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 12); 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 628831ad2f..60a35dd61c 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h @@ -2,7 +2,7 @@ #define Z_BOSS_VA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct BossVa; 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 d61720cdf6..076c395093 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -9,6 +9,7 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "rand.h" #include "segmented_address.h" #include "sequence.h" @@ -16,11 +17,11 @@ #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 "audio.h" +#include "effect.h" +#include "light.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_demo_6k/object_demo_6k.h" 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 5849ccc236..3e88fb50ed 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h @@ -2,8 +2,8 @@ #define Z_DEMO_6K_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct Demo6K; 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 9a1993da17..4bd2cf54e3 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -5,15 +5,17 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_du/object_du.h" @@ -920,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; @@ -977,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); @@ -1048,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 ede2756e05..fbd557a6f7 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 "z64actor.h" +#include "actor.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 ad83a24185..1f8e223ba1 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,6 +1,6 @@ #include "sequence.h" -#include "z64cutscene_commands.h" -#include "z64player.h" +#include "cutscene_commands.h" +#include "player.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 303c4f7240..817234eea7 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -6,13 +6,16 @@ #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 "play_state.h" +#include "save.h" #include "assets/objects/object_zo/object_zo.h" #include "assets/objects/object_ec/object_ec.h" @@ -166,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; @@ -328,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); @@ -337,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) { @@ -699,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; } } @@ -745,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; } } @@ -1256,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; } @@ -1281,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; } @@ -1334,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); @@ -1367,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 494338b27d..b850b071ac 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h @@ -2,7 +2,7 @@ #define Z_DEMO_EC_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoEc; 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 78517cad0f..b0594e2e53 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" @@ -12,15 +13,16 @@ #include "sys_math.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "versions.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64curve.h" -#include "z64draw.h" -#include "z64cutscene_flags.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64save.h" +#include "audio.h" +#include "curve.h" +#include "draw.h" +#include "cutscene_flags.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_efc_crystal_light/object_efc_crystal_light.h" @@ -546,7 +548,7 @@ void DemoEffect_WaitForObject(DemoEffect* this, PlayState* play) { this->actor.draw = this->initDrawFunc; this->updateFunc = this->initUpdateFunc; - PRINTF(VT_FGCOL(CYAN) " 転送終了 move_wait " VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" 転送終了 move_wait ", " Transfer completed move_wait ") VT_RST); } } @@ -704,12 +706,12 @@ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) { SkelCurve_SetAnim(&this->skelCurve, &gTimeWarpAnim, 1.0f, 59.0f, 59.0f, 0.0f); SkelCurve_Update(play, &this->skelCurve); this->updateFunc = DemoEffect_UpdateTimeWarpReturnFromChamberOfSages; - PRINTF(VT_FGCOL(CYAN) " 縮むバージョン \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" 縮むバージョン \n", " Shrinking version \n") VT_RST); } else { SkelCurve_SetAnim(&this->skelCurve, &gTimeWarpAnim, 1.0f, 59.0f, 1.0f, 1.0f); SkelCurve_Update(play, &this->skelCurve); this->updateFunc = DemoEffect_UpdateTimeWarpPullMasterSword; - PRINTF(VT_FGCOL(CYAN) " 通常 バージョン \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" 通常 バージョン \n", " Normal version \n") VT_RST); } } diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h index 12b22a1ad5..05747ff8dd 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h @@ -2,8 +2,8 @@ #define Z_DEMO_EFFECT_H #include "ultra64.h" -#include "z64actor.h" -#include "z64curve.h" +#include "actor.h" +#include "curve.h" struct DemoEffect; 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 55713d4134..e4a944a0a2 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -8,12 +8,14 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "regs.h" #include "sfx.h" #include "sys_matrix.h" #include "terminal.h" -#include "z64play.h" -#include "z64skin.h" +#include "translation.h" +#include "play_state.h" +#include "skin.h" #include "assets/objects/object_fhg/object_fhg.h" @@ -120,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; @@ -183,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); } @@ -237,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 2eadc4af69..e34a059d50 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h @@ -2,7 +2,7 @@ #define Z_DEMO_EXT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoExt; 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 b70210c38a..fe2fd1a13d 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -9,11 +9,13 @@ #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 "z64play.h" +#include "translation.h" +#include "play_state.h" #include "assets/objects/object_geff/object_geff.h" @@ -70,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; } @@ -101,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) {} @@ -188,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; } @@ -204,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; } @@ -218,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); @@ -232,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 03c6110fae..a70c72f593 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h @@ -2,7 +2,7 @@ #define Z_DEMO_GEFF_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoGeff; 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 1cfb0ef82b..03d2fdbf89 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -8,20 +8,23 @@ #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 "z64save.h" +#include "draw.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_gj/object_gj.h" @@ -113,14 +116,14 @@ s32 DemoGj_GetType(DemoGj* this) { return type; } -void DemoGj_InitCylinder(DemoGj* this, PlayState* play, ColliderCylinder* cylinder, - ColliderCylinderInitType1* cylinderInit) { - Collider_InitCylinder(play, cylinder); - Collider_SetCylinderType1(play, cylinder, &this->dyna.actor, cylinderInit); +void DemoGj_InitCylinder(DemoGj* this, PlayState* play, ColliderCylinder* collider, + ColliderCylinderInitType1* colliderInit) { + Collider_InitCylinder(play, collider); + Collider_SetCylinderType1(play, collider, &this->dyna.actor, colliderInit); } -s32 DemoGj_HitByExplosion(DemoGj* this, PlayState* play, ColliderCylinder* cylinder) { - if (Actor_GetCollidedExplosive(play, &cylinder->base) != NULL) { +s32 DemoGj_HitByExplosion(DemoGj* this, PlayState* play, ColliderCylinder* collider) { + if (Actor_GetCollidedExplosive(play, &collider->base) != NULL) { return true; } return false; @@ -236,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 @@ -401,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; } @@ -555,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; } @@ -1003,38 +1008,38 @@ void DemoGj_DoNothing1(DemoGj* this, PlayState* play) { * Used by DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_1 */ void func_8097AEE8(DemoGj* this, PlayState* play) { - ColliderCylinder* cylinder0 = &this->colliderCylinders[0]; - ColliderCylinder* cylinder1 = &this->colliderCylinders[1]; - ColliderCylinder* cylinder2 = &this->colliderCylinders[2]; + ColliderCylinder* collider0 = &this->colliderCylinders[0]; + ColliderCylinder* collider1 = &this->colliderCylinders[1]; + ColliderCylinder* collider2 = &this->colliderCylinders[2]; Vec3f* actorPos = &this->dyna.actor.world.pos; s32 pad; - s16 theta = this->dyna.actor.world.rot.y; - f32 cos_theta = Math_CosS(theta); - f32 sin_theta = Math_SinS(theta); + s16 yaw = this->dyna.actor.world.rot.y; + f32 cos = Math_CosS(yaw); + f32 sin = Math_SinS(yaw); - cylinder0->dim.pos.z = actorPos->z + (20.0f * cos_theta) - (-20.0f * sin_theta); - cylinder0->dim.pos.x = actorPos->x + (20.0f * sin_theta) + (-20.0f * cos_theta); - cylinder0->dim.pos.y = actorPos->y; + collider0->dim.pos.z = actorPos->z + (20.0f * cos) - (-20.0f * sin); + collider0->dim.pos.x = actorPos->x + (20.0f * sin) + (-20.0f * cos); + collider0->dim.pos.y = actorPos->y; - cylinder1->dim.pos.z = actorPos->z + (-20.0f * cos_theta) - (20.0f * sin_theta); - cylinder1->dim.pos.x = actorPos->x + (-20.0f * sin_theta) + (20.0f * cos_theta); - cylinder1->dim.pos.y = actorPos->y; + collider1->dim.pos.z = actorPos->z + (-20.0f * cos) - (20.0f * sin); + collider1->dim.pos.x = actorPos->x + (-20.0f * sin) + (20.0f * cos); + collider1->dim.pos.y = actorPos->y; - cylinder2->dim.pos.z = actorPos->z + (-60.0f * cos_theta) - (60.0f * sin_theta); - cylinder2->dim.pos.x = actorPos->x + (-60.0f * sin_theta) + (60.0f * cos_theta); - cylinder2->dim.pos.y = actorPos->y; + collider2->dim.pos.z = actorPos->z + (-60.0f * cos) - (60.0f * sin); + collider2->dim.pos.x = actorPos->x + (-60.0f * sin) + (60.0f * cos); + collider2->dim.pos.y = actorPos->y; } void DemoGj_SetCylindersAsAC(DemoGj* this, PlayState* play) { s32 pad[2]; - Collider* cylinder0 = &this->colliderCylinders[0].base; - Collider* cylinder1 = &this->colliderCylinders[1].base; - Collider* cylinder2 = &this->colliderCylinders[2].base; + Collider* collider0 = &this->colliderCylinders[0].base; + Collider* collider1 = &this->colliderCylinders[1].base; + Collider* collider2 = &this->colliderCylinders[2].base; s32 pad2[3]; - CollisionCheck_SetAC(play, &play->colChkCtx, cylinder0); - CollisionCheck_SetAC(play, &play->colChkCtx, cylinder1); - CollisionCheck_SetAC(play, &play->colChkCtx, cylinder2); + CollisionCheck_SetAC(play, &play->colChkCtx, collider0); + CollisionCheck_SetAC(play, &play->colChkCtx, collider1); + CollisionCheck_SetAC(play, &play->colChkCtx, collider2); } void DemoGj_DirectedExplosion(DemoGj* this, PlayState* play, Vec3f* direction) { @@ -1137,26 +1142,26 @@ 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->colliderCylinders[0]; - ColliderCylinder* cylinder1 = &this->colliderCylinders[1]; - ColliderCylinder* cylinder2 = &this->colliderCylinders[2]; + ColliderCylinder* collider0 = &this->colliderCylinders[0]; + ColliderCylinder* collider1 = &this->colliderCylinders[1]; + ColliderCylinder* collider2 = &this->colliderCylinders[2]; Vec3f* actorPos = &this->dyna.actor.world.pos; s32 pad; - s16 theta = this->dyna.actor.world.rot.y; - f32 cos_theta = Math_CosS(theta); - f32 sin_theta = Math_SinS(theta); + s16 yaw = this->dyna.actor.world.rot.y; + f32 cos = Math_CosS(yaw); + f32 sin = Math_SinS(yaw); - cylinder0->dim.pos.z = actorPos->z - (35.0f * sin_theta); - cylinder0->dim.pos.x = actorPos->x + (35.0f * cos_theta); - cylinder0->dim.pos.y = actorPos->y; + collider0->dim.pos.z = actorPos->z - (35.0f * sin); + collider0->dim.pos.x = actorPos->x + (35.0f * cos); + collider0->dim.pos.y = actorPos->y; - cylinder1->dim.pos.z = actorPos->z - (-10.0f * sin_theta); - cylinder1->dim.pos.x = actorPos->x + (-10.0f * cos_theta); - cylinder1->dim.pos.y = actorPos->y; + collider1->dim.pos.z = actorPos->z - (-10.0f * sin); + collider1->dim.pos.x = actorPos->x + (-10.0f * cos); + collider1->dim.pos.y = actorPos->y; - cylinder2->dim.pos.z = actorPos->z - (-55.0f * sin_theta); - cylinder2->dim.pos.x = actorPos->x + (-55.0f * cos_theta); - cylinder2->dim.pos.y = actorPos->y; + collider2->dim.pos.z = actorPos->z - (-55.0f * sin); + collider2->dim.pos.x = actorPos->x + (-55.0f * cos); + collider2->dim.pos.y = actorPos->y; } void DemoGj_SetCylindersAsAC2(DemoGj* this, PlayState* play) { @@ -1302,12 +1307,12 @@ void func_8097B9BC(DemoGj* this, PlayState* play) { */ void func_8097BA48(DemoGj* this, PlayState* play) { Actor* thisx = &this->dyna.actor; - ColliderCylinder* cylinder = &this->colliderCylinders[0]; + ColliderCylinder* collider = &this->colliderCylinders[0]; s32 pad[2]; if (func_809797E4(this, 4)) { Actor_Kill(thisx); - } else if (DemoGj_HitByExplosion(this, play, cylinder)) { + } else if (DemoGj_HitByExplosion(this, play, collider)) { Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; DemoGj_DropCollectible(this, play); @@ -1324,8 +1329,8 @@ void func_8097BA48(DemoGj* this, PlayState* play) { Actor_Kill(thisx); } - Collider_UpdateCylinder(thisx, cylinder); - CollisionCheck_SetAC(play, &play->colChkCtx, &cylinder->base); + Collider_UpdateCylinder(thisx, collider); + CollisionCheck_SetAC(play, &play->colChkCtx, &collider->base); } // func_8097BB78 @@ -1375,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; } @@ -1432,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); } } @@ -1467,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 313788893f..a26987eb34 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h @@ -2,7 +2,7 @@ #define Z_DEMO_GJ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h" 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 517b120553..2c687facc7 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -8,13 +8,15 @@ #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 "play_state.h" +#include "skin_matrix.h" #include "assets/objects/object_oF1d_map/object_oF1d_map.h" @@ -330,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); @@ -371,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 9abd5ed41c..9d68200c8d 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.h +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.h @@ -2,7 +2,7 @@ #define Z_DEMO_GO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoGo; 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 7b86c2bc25..444e683285 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -5,18 +5,20 @@ #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 "audio.h" +#include "effect.h" +#include "frame_advance.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_gt/object_gt.h" #include "assets/objects/object_geff/object_geff.h" @@ -1735,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; } @@ -1772,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); } } @@ -1791,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 910c265939..0826a7bd81 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h @@ -2,7 +2,7 @@ #define Z_DEMO_GT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoGt; 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 cab53df6ac..ef3da8a40d 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -1,12 +1,15 @@ #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 "z64effect.h" -#include "z64play.h" +#include "translation.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_ik/object_ik.h" @@ -241,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; } @@ -390,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; } @@ -478,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); @@ -499,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 b4f2ca74ea..4571fff288 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h @@ -2,7 +2,7 @@ #define Z_DEMO_IK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoIk; 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 95d68dd2b5..81667318e8 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -10,15 +10,17 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/scenes/indoors/nakaniwa/nakaniwa_scene.h" #include "assets/objects/object_im/object_im.h" @@ -645,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; } @@ -685,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; } @@ -813,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; } @@ -1083,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; } @@ -1122,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); @@ -1233,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 9477c21d8f..ac3e06250c 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h @@ -2,7 +2,7 @@ #define Z_DEMO_IM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoIm; 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 7a9a0dde84..210fcdc5b7 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,5 +1,5 @@ #include "sequence.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off static CutsceneData gShadowMedallionCs[] = { 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 e3ac3e78fe..60d023f6b8 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -4,25 +4,26 @@ #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 "cutscene_commands.h" +#include "cutscene_flags.h" +#include "cutscene_spline.h" +#include "olib.h" +#include "play_state.h" +#include "player.h" +#include "save.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: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: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.h b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h index 06501904ac..1899cc05ba 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h @@ -2,7 +2,7 @@ #define Z_DEMO_KANKYO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoKankyo; 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 4e17a4a53c..1a082a9cbc 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,4 @@ -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gAdultWarpInCS[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.c index 2a6e3f3e5d..439f78e05d 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.c @@ -1,5 +1,5 @@ #include "z_demo_kankyo.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gAdultWarpOutCS[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.c index e742384ec2..d7d091cc55 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.c @@ -1,5 +1,5 @@ #include "z_demo_kankyo.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gAdultWarpInToTCS[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.c index 53f2b5133a..731e9e286e 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.c @@ -1,5 +1,5 @@ #include "z_demo_kankyo.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gAdultWarpOutToTCS[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.c index e1092b34dd..d9b6df92cb 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.c @@ -1,5 +1,5 @@ #include "z_demo_kankyo.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gChildWarpInCS[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.c index 9e8a7c6bc6..69b239655c 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.c @@ -1,5 +1,5 @@ #include "z_demo_kankyo.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gChildWarpOutCS[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.c index 3a718366c3..f4c06dbbc0 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.c @@ -1,5 +1,5 @@ #include "z_demo_kankyo.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gChildWarpInToTCS[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.c index 84e12ec7a8..740639ab29 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.c @@ -1,5 +1,5 @@ #include "z_demo_kankyo.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off CutsceneData gChildWarpOutToTCS[] = { 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 2a79aef458..3ba0504137 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -6,7 +6,6 @@ #include "z_demo_kekkai.h" -#include "libu64/debug.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" @@ -14,11 +13,12 @@ #include "sequence.h" #include "sfx.h" #include "sys_matrix.h" +#include "translation.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64save.h" +#include "audio.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_demo_kekkai/object_demo_kekkai.h" #include "assets/scenes/dungeons/ganontika/ganontika_scene.h" @@ -267,8 +267,7 @@ void DemoKekkai_TrialBarrierIdle(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base); if (this->collider2.base.acFlags & AC_HIT) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); - // "I got it" - LOG_STRING("当ったよ", "../z_demo_kekkai.c", 572); + LOG_STRING_T("当ったよ", "I got it", "../z_demo_kekkai.c", 572); this->actor.update = DemoKekkai_TrialBarrierDispel; this->timer = 0; play->csCtx.script = SEGMENTED_TO_VIRTUAL(sSageCutscenes[this->actor.params]); 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 182b1d587c..f800075019 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h @@ -2,7 +2,7 @@ #define Z_DEMO_KEKKAI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoKekkai; 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 3b6ed448d8..fb44ec0376 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -10,15 +10,17 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_sa/object_sa.h" @@ -590,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; } @@ -739,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; } @@ -779,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); @@ -849,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 639d50a634..e9c0d5dc2e 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h @@ -2,7 +2,7 @@ #define Z_DEMO_SA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoSa; diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.inc.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.inc.c index 67edd6cb9f..5440aabf98 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.inc.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.inc.c @@ -1,5 +1,5 @@ #include "z_demo_sa.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off static CutsceneData gForestMedallionCs[] = { 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 549daf0db7..1c6ea8559b 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "sequence.h" #include "sys_matrix.h" -#include "z64audio.h" -#include "z64play.h" +#include "audio.h" +#include "play_state.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) 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 eb62a3983f..c8bdb04ded 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h @@ -2,7 +2,7 @@ #define Z_DEMO_SHD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DemoShd; 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 dcafdfed20..ece0958ad2 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 @@ -3,10 +3,12 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "sfx.h" -#include "z64curve.h" -#include "z64play.h" -#include "z64save.h" +#include "translation.h" +#include "curve.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_box/object_box.h" @@ -57,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 47f6c35642..5b4947575b 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,8 +2,8 @@ #define Z_DEMO_TRE_LGT_H #include "ultra64.h" -#include "z64actor.h" -#include "z64curve.h" +#include "actor.h" +#include "curve.h" struct DemoTreLgt; 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 4034dafc91..80c94c19b1 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -11,10 +11,10 @@ #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 "cutscene_flags.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" 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 0092bd8f1a..2a8fa0eb38 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h @@ -2,7 +2,7 @@ #define Z_DOOR_ANA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DoorAna; 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 2f9f4e1183..5483a07db7 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -12,9 +12,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_door_gerudo/object_door_gerudo.h" 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 efd2959767..5e9a5e5f35 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h @@ -2,7 +2,7 @@ #define Z_DOOR_GERUDO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct DoorGerudo; 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 7c00f0118c..dc016d34b6 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -8,13 +8,14 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_hidan_objects/object_hidan_objects.h" @@ -471,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 32eaaeb014..e431e5337b 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 "z64actor.h" +#include "actor.h" /* * Associated switch flag: (params >> 8) & 0x3F 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 1252d7db59..3d0b9603dd 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -7,10 +7,12 @@ #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" @@ -18,10 +20,10 @@ #include "quake.h" #include "versions.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_gnd/object_gnd.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 8ab1c8a4c7..ac2706acdf 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 "z64actor.h" +#include "actor.h" /** * Actor Parameters 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 ceef1f93f6..c4c9d2f25e 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -7,8 +7,8 @@ #include "z_door_toki.h" #include "ichain.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_toki_objects/object_toki_objects.h" 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 8e276c56bd..fd0d8105b1 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 "z64actor.h" +#include "actor.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 7c5709434f..dd99eb63c0 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -4,18 +4,23 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "one_point_cutscene.h" +#include "printf.h" #include "seqcmd.h" #include "sequence.h" #include "sfx.h" #include "sys_matrix.h" +#include "translation.h" #include "z_lib.h" -#include "z64light.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.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); @@ -505,7 +510,9 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { this->warpTimer++; if (sWarpTimerTarget < this->warpTimer && gSaveContext.nextCutsceneIndex == 0xFFEF) { - PRINTF("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", play->transitionTrigger, TRANS_TRIGGER_START); + PRINTF(T("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", + "\n\n\nThe time has come, so it's over. fade_direction=[%d]"), + play->transitionTrigger, TRANS_TRIGGER_START); if (play->sceneId == SCENE_DODONGOS_CAVERN_BOSS) { if (!Flags_GetEventChkInf(EVENTCHKINF_25)) { @@ -532,7 +539,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { play->nextEntranceIndex = ENTR_ZORAS_FOUNTAIN_0; gSaveContext.nextCutsceneIndex = 0; } - PRINTF("\n\n\nおわりおわり"); + PRINTF(T("\n\n\nおわりおわり", "\n\n\nThe end The end")); play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE_SLOW; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h index ff8a89d9b1..b7a07cf20c 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h @@ -2,8 +2,8 @@ #define Z_DOOR_WARP1_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct DoorWarp1; 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 677458f186..53790dd7f4 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -7,9 +7,9 @@ #include "sequence.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64save.h" +#include "audio.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_efc_erupc/object_efc_erupc.h" 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 888d9580ef..bf97f8e395 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h @@ -2,7 +2,7 @@ #define Z_EFC_ERUPC_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EfcErupc; 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 e8f9f26841..10875e547b 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -14,8 +14,8 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 153b6d4e2a..b107e82dd8 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h @@ -2,7 +2,7 @@ #define Z_EFF_DUST_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EffDust; 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 5165520c6d..fd54803e25 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -6,15 +6,16 @@ #include "z_elf_msg.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 "translation.h" +#include "play_state.h" +#include "player.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" @@ -62,14 +63,14 @@ void ElfMsg_SetupAction(ElfMsg* this, ElfMsgActionFunc actionFunc) { s32 ElfMsg_KillCheck(ElfMsg* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { - LOG_STRING("共倒れ", "../z_elf_msg.c", 161); // "Mutual destruction" + LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg.c", 161); if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { - LOG_STRING("共倒れ", "../z_elf_msg.c", 172); // "Mutual destruction" + LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg.c", 172); if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } @@ -87,12 +88,12 @@ s32 ElfMsg_KillCheck(ElfMsg* this, PlayState* play) { void ElfMsg_Init(Actor* thisx, PlayState* play) { ElfMsg* this = (ElfMsg*)thisx; - // "Conditions for Elf Tag disappearing" - PRINTF(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", PARAMS_GET_U(thisx->params, 8, 6)); + PRINTF(VT_FGCOL(CYAN) T("\nエルフ タグ 消える条件 %d", "\nConditions for Elf Tag disappearing %d") VT_RST "\n", + PARAMS_GET_U(thisx->params, 8, 6)); PRINTF(VT_FGCOL(CYAN) "\nthisx->shape.angle.sy = %d\n" VT_RST, thisx->shape.rot.y); if (thisx->shape.rot.y >= 0x41) { - // "Conditions for Elf Tag appearing" - PRINTF(VT_FGCOL(CYAN) "\nエルフ タグ 出現条件 %d" VT_RST "\n", thisx->shape.rot.y - 0x41); + PRINTF(VT_FGCOL(CYAN) T("\nエルフ タグ 出現条件 %d", "\nConditions for Elf Tag appearing %d") VT_RST "\n", + thisx->shape.rot.y - 0x41); } if (!ElfMsg_KillCheck(this, play)) { diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h index c95cbb527f..14412b5310 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h @@ -2,7 +2,7 @@ #define Z_ELF_MSG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ElfMsg; 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 562eef8a42..11a01bc4b8 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -6,14 +6,15 @@ #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" +#include "translation.h" +#include "play_state.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -60,14 +61,14 @@ void ElfMsg2_SetupAction(ElfMsg2* this, ElfMsg2ActionFunc actionFunc) { s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { - LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); // "Mutual destruction" + LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg2.c", 171); if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { - LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2" + LOG_STRING_T("共倒れ2", "Mutual destruction 2", "../z_elf_msg2.c", 182); if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } @@ -76,7 +77,7 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) { } else if (PARAMS_GET_U(this->actor.params, 8, 6) == 0x3F) { return 0; } else if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { - LOG_STRING("共倒れ", "../z_elf_msg2.c", 192); // "Mutual destruction" + LOG_STRING_T("共倒れ", "Mutual destruction", "../z_elf_msg2.c", 192); Actor_Kill(&this->actor); return 1; } 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 5a0a693415..70ae86801e 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h @@ -2,7 +2,7 @@ #define Z_ELF_MSG2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ElfMsg2; 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 3f7649ea7e..6b382ca364 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -16,9 +16,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_am/object_am.h" @@ -127,48 +127,48 @@ static ColliderQuadInit sQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum ArmosDamageEffect { - /* 0 */ AM_DMGEFF_NONE, // used by anything that can't kill the armos - /* 1 */ AM_DMGEFF_NUT, - /* 6 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts - /* 13 */ AM_DMGEFF_ICE = 13, - /* 14 */ AM_DMGEFF_MAGIC_FIRE_LIGHT, - /* 15 */ AM_DMGEFF_KILL // any damage source that can kill the armos (and isn't a special case) -} ArmosDamageEffect; +typedef enum ArmosDamageReaction { + /* 0 */ AM_DMG_REACT_NONE, // used by anything that can't kill the armos + /* 1 */ AM_DMG_REACT_NUT, + /* 6 */ AM_DMG_REACT_STUN = 6, // doesn't include deku nuts + /* 13 */ AM_DMG_REACT_ICE = 13, + /* 14 */ AM_DMG_REACT_MAGIC_FIRE_LIGHT, + /* 15 */ AM_DMG_REACT_KILL // any damage source that can kill the armos (and isn't a special case) +} ArmosDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, AM_DMGEFF_NUT), - /* Deku stick */ DMG_ENTRY(2, AM_DMGEFF_NONE), - /* Slingshot */ DMG_ENTRY(1, AM_DMGEFF_NONE), - /* Explosive */ DMG_ENTRY(2, AM_DMGEFF_KILL), - /* Boomerang */ DMG_ENTRY(0, AM_DMGEFF_STUN), - /* Normal arrow */ DMG_ENTRY(2, AM_DMGEFF_KILL), - /* Hammer swing */ DMG_ENTRY(2, AM_DMGEFF_KILL), - /* Hookshot */ DMG_ENTRY(0, AM_DMGEFF_STUN), - /* Kokiri sword */ DMG_ENTRY(1, AM_DMGEFF_NONE), - /* Master sword */ DMG_ENTRY(2, AM_DMGEFF_KILL), - /* Giant's Knife */ DMG_ENTRY(4, AM_DMGEFF_KILL), - /* Fire arrow */ DMG_ENTRY(2, AM_DMGEFF_KILL), - /* Ice arrow */ DMG_ENTRY(4, AM_DMGEFF_ICE), - /* Light arrow */ DMG_ENTRY(2, AM_DMGEFF_KILL), - /* Unk arrow 1 */ DMG_ENTRY(2, AM_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(2, AM_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(2, AM_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(0, AM_DMGEFF_MAGIC_FIRE_LIGHT), - /* Ice magic */ DMG_ENTRY(3, AM_DMGEFF_ICE), - /* Light magic */ DMG_ENTRY(0, AM_DMGEFF_MAGIC_FIRE_LIGHT), - /* Shield */ DMG_ENTRY(0, AM_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, AM_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, AM_DMGEFF_NONE), - /* Giant spin */ DMG_ENTRY(4, AM_DMGEFF_KILL), - /* Master spin */ DMG_ENTRY(2, AM_DMGEFF_KILL), - /* Kokiri jump */ DMG_ENTRY(2, AM_DMGEFF_NONE), - /* Giant jump */ DMG_ENTRY(8, AM_DMGEFF_KILL), - /* Master jump */ DMG_ENTRY(4, AM_DMGEFF_KILL), - /* Unknown 1 */ DMG_ENTRY(0, AM_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, AM_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, AM_DMGEFF_KILL), - /* Unknown 2 */ DMG_ENTRY(0, AM_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, AM_DMG_REACT_NUT), + /* Deku stick */ DMG_ENTRY(2, AM_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(1, AM_DMG_REACT_NONE), + /* Explosive */ DMG_ENTRY(2, AM_DMG_REACT_KILL), + /* Boomerang */ DMG_ENTRY(0, AM_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, AM_DMG_REACT_KILL), + /* Hammer swing */ DMG_ENTRY(2, AM_DMG_REACT_KILL), + /* Hookshot */ DMG_ENTRY(0, AM_DMG_REACT_STUN), + /* Kokiri sword */ DMG_ENTRY(1, AM_DMG_REACT_NONE), + /* Master sword */ DMG_ENTRY(2, AM_DMG_REACT_KILL), + /* Giant's Knife */ DMG_ENTRY(4, AM_DMG_REACT_KILL), + /* Fire arrow */ DMG_ENTRY(2, AM_DMG_REACT_KILL), + /* Ice arrow */ DMG_ENTRY(4, AM_DMG_REACT_ICE), + /* Light arrow */ DMG_ENTRY(2, AM_DMG_REACT_KILL), + /* Unk arrow 1 */ DMG_ENTRY(2, AM_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(2, AM_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(2, AM_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(0, AM_DMG_REACT_MAGIC_FIRE_LIGHT), + /* Ice magic */ DMG_ENTRY(3, AM_DMG_REACT_ICE), + /* Light magic */ DMG_ENTRY(0, AM_DMG_REACT_MAGIC_FIRE_LIGHT), + /* Shield */ DMG_ENTRY(0, AM_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, AM_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, AM_DMG_REACT_NONE), + /* Giant spin */ DMG_ENTRY(4, AM_DMG_REACT_KILL), + /* Master spin */ DMG_ENTRY(2, AM_DMG_REACT_KILL), + /* Kokiri jump */ DMG_ENTRY(2, AM_DMG_REACT_NONE), + /* Giant jump */ DMG_ENTRY(8, AM_DMG_REACT_KILL), + /* Master jump */ DMG_ENTRY(4, AM_DMG_REACT_KILL), + /* Unknown 1 */ DMG_ENTRY(0, AM_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, AM_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, AM_DMG_REACT_KILL), + /* Unknown 2 */ DMG_ENTRY(0, AM_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -735,7 +735,7 @@ void EnAm_SetupStunned(EnAm* this, PlayState* play) { Actor_SetColorFilter(&this->dyna.actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 100); - if (this->damageEffect == AM_DMGEFF_ICE) { + if (this->damageReaction == AM_DMG_REACT_ICE) { this->iceTimer = 48; } @@ -810,27 +810,27 @@ void EnAm_UpdateDamage(EnAm* this, PlayState* play) { } else if ((this->hurtCollider.base.acFlags & AC_HIT) && (this->behavior >= AM_BEHAVIOR_5)) { this->hurtCollider.base.acFlags &= ~AC_HIT; - if (this->dyna.actor.colChkInfo.damageEffect != AM_DMGEFF_MAGIC_FIRE_LIGHT) { + if (this->dyna.actor.colChkInfo.damageReaction != AM_DMG_REACT_MAGIC_FIRE_LIGHT) { this->unk_264 = 0; - this->damageEffect = this->dyna.actor.colChkInfo.damageEffect; + this->damageReaction = this->dyna.actor.colChkInfo.damageReaction; Actor_SetDropFlag(&this->dyna.actor, &this->hurtCollider.elem, false); - if ((this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_NUT) || - (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) || - (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_ICE)) { + if ((this->dyna.actor.colChkInfo.damageReaction == AM_DMG_REACT_NUT) || + (this->dyna.actor.colChkInfo.damageReaction == AM_DMG_REACT_STUN) || + (this->dyna.actor.colChkInfo.damageReaction == AM_DMG_REACT_ICE)) { if (this->behavior != AM_BEHAVIOR_STUNNED) { EnAm_SetupStunned(this, play); if (this->dyna.actor.colChkInfo.damage != 0) { this->dyna.actor.colChkInfo.health = 0; } - } else if (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) { + } else if (this->dyna.actor.colChkInfo.damageReaction == AM_DMG_REACT_STUN) { Vec3f sparkPos = this->dyna.actor.world.pos; sparkPos.y += 50.0f; CollisionCheck_SpawnShieldParticlesMetal(play, &sparkPos); } - } else if ((this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_KILL) || + } else if ((this->dyna.actor.colChkInfo.damageReaction == AM_DMG_REACT_KILL) || (this->behavior == AM_BEHAVIOR_STUNNED)) { this->dyna.actor.colChkInfo.health = 0; @@ -857,7 +857,7 @@ void EnAm_Update(Actor* thisx, PlayState* play) { EnAm_UpdateDamage(this, play); } - if (this->dyna.actor.colChkInfo.damageEffect != AM_DMGEFF_MAGIC_FIRE_LIGHT) { + if (this->dyna.actor.colChkInfo.damageReaction != AM_DMG_REACT_MAGIC_FIRE_LIGHT) { if (this->attackTimer != 0) { this->attackTimer--; } 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 2903a3b6ea..ce91429227 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.h +++ b/src/overlays/actors/ovl_En_Am/z_en_am.h @@ -2,7 +2,7 @@ #define Z_EN_AM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnAm; @@ -23,7 +23,7 @@ typedef struct EnAm { /* 0x0262 */ s16 panicSpinRot; // used when panicking before death /* 0x0264 */ s16 unk_264; /* 0x0266 */ u8 textureBlend; // 0 = statue textures; 255 = enemy textures - /* 0x0267 */ u8 damageEffect; + /* 0x0267 */ u8 damageReaction; /* 0x0267 */ Vec3f shakeOrigin; // center point to shake around when waking up /* 0x0274 */ ColliderCylinder hurtCollider; /* 0x02C0 */ ColliderCylinder blockCollider; 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 8bfcc38fac..17d4eb62f2 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -13,9 +13,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64face_reaction.h" -#include "z64play.h" -#include "z64save.h" +#include "face_reaction.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_ani/object_ani.h" 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 454a7bd8d2..024f4310d1 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -2,7 +2,7 @@ #define Z_EN_ANI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnAni; 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 d68f1c8502..dd527d95bd 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -9,17 +9,20 @@ #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 "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_anubice/object_anubice.h" @@ -70,45 +73,45 @@ static ColliderCylinderInit sCylinderInit = { { 29, 103, 0, { 0, 0, 0 } }, }; -typedef enum AnubiceDamageEffect { - /* 0x0 */ ANUBICE_DMGEFF_NONE, - /* 0x2 */ ANUBICE_DMGEFF_FIRE = 2, - /* 0xF */ ANUBICE_DMGEFF_0xF = 0xF // Treated the same as ANUBICE_DMGEFF_NONE in code -} AnubiceDamageEffect; +typedef enum AnubiceDamageReaction { + /* 0x0 */ ANUBICE_DMG_REACT_NONE, + /* 0x2 */ ANUBICE_DMG_REACT_FIRE = 2, + /* 0xF */ ANUBICE_DMG_REACT_0xF = 0xF // Treated the same as ANUBICE_DMG_REACT_NONE in code +} AnubiceDamageReaction; static DamageTable sDamageTable[] = { - /* Deku nut */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Deku stick */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Slingshot */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Explosive */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Boomerang */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Normal arrow */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Hammer swing */ DMG_ENTRY(1, ANUBICE_DMGEFF_0xF), - /* Hookshot */ DMG_ENTRY(2, ANUBICE_DMGEFF_0xF), - /* Kokiri sword */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Master sword */ DMG_ENTRY(2, ANUBICE_DMGEFF_0xF), - /* Giant's Knife */ DMG_ENTRY(6, ANUBICE_DMGEFF_0xF), - /* Fire arrow */ DMG_ENTRY(2, ANUBICE_DMGEFF_FIRE), - /* Ice arrow */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Light arrow */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Unk arrow 1 */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Unk arrow 2 */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Unk arrow 3 */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Fire magic */ DMG_ENTRY(3, ANUBICE_DMGEFF_FIRE), - /* Ice magic */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Light magic */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Shield */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Giant spin */ DMG_ENTRY(6, ANUBICE_DMGEFF_0xF), - /* Master spin */ DMG_ENTRY(2, ANUBICE_DMGEFF_0xF), - /* Kokiri jump */ DMG_ENTRY(0, ANUBICE_DMGEFF_0xF), - /* Giant jump */ DMG_ENTRY(12, ANUBICE_DMGEFF_0xF), - /* Master jump */ DMG_ENTRY(4, ANUBICE_DMGEFF_0xF), - /* Unknown 1 */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, ANUBICE_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Deku stick */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Slingshot */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Explosive */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Boomerang */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Normal arrow */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Hammer swing */ DMG_ENTRY(1, ANUBICE_DMG_REACT_0xF), + /* Hookshot */ DMG_ENTRY(2, ANUBICE_DMG_REACT_0xF), + /* Kokiri sword */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Master sword */ DMG_ENTRY(2, ANUBICE_DMG_REACT_0xF), + /* Giant's Knife */ DMG_ENTRY(6, ANUBICE_DMG_REACT_0xF), + /* Fire arrow */ DMG_ENTRY(2, ANUBICE_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Light arrow */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Unk arrow 1 */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Unk arrow 2 */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Unk arrow 3 */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Fire magic */ DMG_ENTRY(3, ANUBICE_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Light magic */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Shield */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Giant spin */ DMG_ENTRY(6, ANUBICE_DMG_REACT_0xF), + /* Master spin */ DMG_ENTRY(2, ANUBICE_DMG_REACT_0xF), + /* Kokiri jump */ DMG_ENTRY(0, ANUBICE_DMG_REACT_0xF), + /* Giant jump */ DMG_ENTRY(12, ANUBICE_DMG_REACT_0xF), + /* Master jump */ DMG_ENTRY(4, ANUBICE_DMG_REACT_0xF), + /* Unknown 1 */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, ANUBICE_DMG_REACT_NONE), }; void EnAnubice_Hover(EnAnubice* this, PlayState* play) { @@ -145,8 +148,7 @@ void EnAnubice_Init(Actor* thisx, PlayState* play) { ANUBICE_LIMB_MAX); PRINTF("\n\n"); - // "☆☆☆☆☆ Anubis occurence ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ アヌビス発生 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ アヌビス発生 ☆☆☆☆☆ \n", "☆☆☆☆☆ Anubis spawn ☆☆☆☆☆ \n") VT_RST); this->actor.naviEnemyId = NAVI_ENEMY_ANUBIS; @@ -194,9 +196,9 @@ void EnAnubice_FindFlameCircles(EnAnubice* this, PlayState* play) { currentProp = currentProp->next; } else { this->flameCircles[flameCirclesFound] = (BgHidanCurtain*)currentProp; - // "☆☆☆☆☆ How many fires? ☆☆☆☆☆" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 火は幾つ? ☆☆☆☆☆ %d\n" VT_RST, flameCirclesFound); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 火は幾つ? ☆☆☆☆☆ %x\n" VT_RST, + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 火は幾つ? ☆☆☆☆☆ %d\n", "☆☆☆☆☆ How many fires? ☆☆☆☆☆ %d\n") VT_RST, + flameCirclesFound); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 火は幾つ? ☆☆☆☆☆ %x\n", "☆☆☆☆☆ How many fires? ☆☆☆☆☆ %x\n") VT_RST, this->flameCircles[flameCirclesFound]); if (flameCirclesFound < ARRAY_COUNT(this->flameCircles) - 1) { flameCirclesFound++; @@ -397,7 +399,7 @@ void EnAnubice_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect == ANUBICE_DMGEFF_FIRE) { + if (this->actor.colChkInfo.damageReaction == ANUBICE_DMG_REACT_FIRE) { Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Enemy_StartFinishingBlow(play, &this->actor); 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 51cd02d1ef..51b143fa1e 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h @@ -2,7 +2,7 @@ #define Z_EN_ANUBICE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnAnubice; @@ -41,7 +41,7 @@ typedef struct EnAnubice { /* 0x025C */ s16 knockbackTimer; /* 0x025E */ s16 isMirroringPlayer; /* 0x0260 */ s16 isPlayerOutOfRange; - /* 0x0262 */ s16 isKnockedback; // Hit by an attack without ANUBICE_DMGEFF_FIRE + /* 0x0262 */ s16 isKnockedback; // Hit by an attack without ANUBICE_DMG_REACT_FIRE /* 0x0264 */ s16 hasSearchedForFlameCircles; /* 0x0268 */ f32 hoverVelocityTimer; /* 0x026C */ f32 animLastFrame; 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 480940dc44..39cc72c383 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 @@ -14,9 +14,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_anubice/object_anubice.h" 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 34072a43b5..9e916c090a 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,7 +2,7 @@ #define Z_EN_ANUBICE_FIRE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnAnubiceFire; 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 bdb3c312c0..9d49a27234 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 @@ -7,11 +7,13 @@ #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 "translation.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64play.h" +#include "debug_display.h" +#include "play_state.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -39,8 +41,9 @@ void EnAnubiceTag_Init(Actor* thisx, PlayState* play) { EnAnubiceTag* this = (EnAnubiceTag*)thisx; PRINTF("\n\n"); - // "Anubis control tag generated" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ アヌビス制御タグ発生 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ アヌビス制御タグ発生 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Anubis control tag spawn ☆☆☆☆☆ %d\n") + VT_RST, + this->actor.params); if (this->actor.params < -1) { this->actor.params = 0; 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 026d4d0199..afbc61970b 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,7 +2,7 @@ #define Z_EN_ANUBICE_TAG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnAnubiceTag; 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 d4de5191ef..56b949ce7e 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 @@ -7,7 +7,7 @@ #include "z_en_arow_trap.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED 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 ba91505088..48252407a7 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,7 +2,7 @@ #define Z_EN_AROW_TRAP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.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 9000417a23..c4a90bec05 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -17,8 +17,8 @@ #include "sys_math3d.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -46,7 +46,7 @@ ActorProfile En_Arrow_Profile = { /**/ EnArrow_Draw, }; -static ColliderQuadInit sColliderInit = { +static ColliderQuadInit sColliderQuadInit = { { COL_MATERIAL_NONE, AT_ON | AT_TYPE_PLAYER, @@ -133,7 +133,7 @@ void EnArrow_Init(Actor* thisx, PlayState* play) { } Collider_InitQuad(play, &this->collider); - Collider_SetQuad(play, &this->collider, &this->actor, &sColliderInit); + Collider_SetQuad(play, &this->collider, &this->actor, &sColliderQuadInit); if (this->actor.params <= ARROW_NORMAL) { this->collider.elem.atElemFlags &= ~ATELEM_SFX_MASK; diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h index ba974c2105..e5d80928cd 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h @@ -2,8 +2,8 @@ #define Z_EN_ARROW_H #include "ultra64.h" -#include "z64actor.h" -#include "z64player.h" +#include "actor.h" +#include "player.h" struct EnArrow; 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 4a3a32663a..a7fd550149 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 @@ -15,9 +15,9 @@ #include "sfx.h" #include "versions.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_niw/object_niw.h" 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 a4d361542d..d460a43d9f 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,7 +2,7 @@ #define Z_EN_ATTACK_NIW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnAttackNiw; 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 a149d3c63d..462e8a5f1d 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -15,9 +15,9 @@ #include "sys_math.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_bxa/object_bxa.h" 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 dc3b8cb3f6..3cb9b3582d 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.h +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.h @@ -2,7 +2,7 @@ #define Z_EN_BA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBa; 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 18dad81519..0c055c9be9 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -17,9 +17,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_Bb/object_Bb.h" @@ -1169,7 +1169,7 @@ void EnBb_CollisionCheck(EnBb* this, PlayState* play) { } if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - this->dmgEffect = this->actor.colChkInfo.damageEffect; + this->dmgEffect = this->actor.colChkInfo.damageReaction; Actor_SetDropFlag(&this->actor, &this->collider.elements[0].base, false); switch (this->dmgEffect) { case 7: @@ -1252,7 +1252,7 @@ void EnBb_Update(Actor* thisx, PlayState* play2) { if (this->actor.params <= ENBB_BLUE) { EnBb_CollisionCheck(this, play); } - if (this->actor.colChkInfo.damageEffect != 0xD) { + if (this->actor.colChkInfo.damageReaction != 0xD) { this->actionFunc(this, play); if ((this->actor.params <= ENBB_BLUE) && (this->actor.speed >= -6.0f) && !(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) { 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 0b7e85c461..8f5591dc78 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -2,7 +2,7 @@ #define Z_EN_BB_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBb; 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 d5c951d346..76462af1de 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -10,13 +10,14 @@ #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 "light.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_kingdodongo/object_kingdodongo.h" 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 876a790d71..9becdade1a 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h @@ -2,8 +2,8 @@ #define Z_EN_BDFIRE_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnBdfire; 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 a321a43a0e..1ab5979a3c 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,5 +1,6 @@ #include "z_en_bigokuta.h" +#include "array_count.h" #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -11,10 +12,10 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_bigokuta/object_bigokuta.h" @@ -766,12 +767,12 @@ void func_809BE798(EnBigokuta* this, PlayState* play) { void EnBigokuta_UpdateDamage(EnBigokuta* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { - if (this->actor.colChkInfo.damageEffect == 1) { + if (this->actor.colChkInfo.damageReaction != 0 || this->actor.colChkInfo.damage != 0) { + if (this->actor.colChkInfo.damageReaction == 1) { if (this->actionFunc != func_809BE058) { func_809BD524(this); } - } else if (this->actor.colChkInfo.damageEffect == 0xF) { + } else if (this->actor.colChkInfo.damageReaction == 0xF) { func_809BD47C(this); } else if (!Actor_IsFacingPlayer(&this->actor, 0x4000)) { if (Actor_ApplyDamage(&this->actor) == 0) { // Dead 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 c04da49c86..434cb521e7 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h @@ -2,7 +2,7 @@ #define Z_EN_BIGOKUTA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBigokuta; 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 82f7b62796..0e7c532efb 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -17,8 +17,8 @@ #include "versions.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_bl/object_bl.h" @@ -78,48 +78,48 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 9, 28, -20, 30 }; -typedef enum BiriDamageEffect { - /* 0x0 */ BIRI_DMGEFF_NONE, - /* 0x1 */ BIRI_DMGEFF_DEKUNUT, - /* 0x2 */ BIRI_DMGEFF_FIRE, - /* 0x3 */ BIRI_DMGEFF_ICE, - /* 0xE */ BIRI_DMGEFF_SLINGSHOT = 0xE, - /* 0xF */ BIRI_DMGEFF_SWORD -} BiriDamageEffect; +typedef enum BiriDamageReaction { + /* 0x0 */ BIRI_DMG_REACT_NONE, + /* 0x1 */ BIRI_DMG_REACT_DEKUNUT, + /* 0x2 */ BIRI_DMG_REACT_FIRE, + /* 0x3 */ BIRI_DMG_REACT_ICE, + /* 0xE */ BIRI_DMG_REACT_SLINGSHOT = 0xE, + /* 0xF */ BIRI_DMG_REACT_SWORD +} BiriDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, BIRI_DMGEFF_DEKUNUT), - /* Deku stick */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Slingshot */ DMG_ENTRY(0, BIRI_DMGEFF_SLINGSHOT), - /* Explosive */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(1, BIRI_DMGEFF_NONE), - /* Normal arrow */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Hookshot */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Kokiri sword */ DMG_ENTRY(1, BIRI_DMGEFF_SWORD), - /* Master sword */ DMG_ENTRY(2, BIRI_DMGEFF_SWORD), - /* Giant's Knife */ DMG_ENTRY(4, BIRI_DMGEFF_SWORD), - /* Fire arrow */ DMG_ENTRY(4, BIRI_DMGEFF_FIRE), - /* Ice arrow */ DMG_ENTRY(4, BIRI_DMGEFF_ICE), - /* Light arrow */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Unk arrow 1 */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(4, BIRI_DMGEFF_FIRE), - /* Ice magic */ DMG_ENTRY(4, BIRI_DMGEFF_ICE), - /* Light magic */ DMG_ENTRY(0, BIRI_DMGEFF_NONE), - /* Shield */ DMG_ENTRY(0, BIRI_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, BIRI_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, BIRI_DMGEFF_NONE), - /* Giant spin */ DMG_ENTRY(4, BIRI_DMGEFF_NONE), - /* Master spin */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Kokiri jump */ DMG_ENTRY(2, BIRI_DMGEFF_NONE), - /* Giant jump */ DMG_ENTRY(8, BIRI_DMGEFF_NONE), - /* Master jump */ DMG_ENTRY(4, BIRI_DMGEFF_NONE), - /* Unknown 1 */ DMG_ENTRY(0, BIRI_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, BIRI_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, BIRI_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, BIRI_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, BIRI_DMG_REACT_DEKUNUT), + /* Deku stick */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(0, BIRI_DMG_REACT_SLINGSHOT), + /* Explosive */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(1, BIRI_DMG_REACT_NONE), + /* Normal arrow */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Hookshot */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Kokiri sword */ DMG_ENTRY(1, BIRI_DMG_REACT_SWORD), + /* Master sword */ DMG_ENTRY(2, BIRI_DMG_REACT_SWORD), + /* Giant's Knife */ DMG_ENTRY(4, BIRI_DMG_REACT_SWORD), + /* Fire arrow */ DMG_ENTRY(4, BIRI_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(4, BIRI_DMG_REACT_ICE), + /* Light arrow */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Unk arrow 1 */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(4, BIRI_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(4, BIRI_DMG_REACT_ICE), + /* Light magic */ DMG_ENTRY(0, BIRI_DMG_REACT_NONE), + /* Shield */ DMG_ENTRY(0, BIRI_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, BIRI_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, BIRI_DMG_REACT_NONE), + /* Giant spin */ DMG_ENTRY(4, BIRI_DMG_REACT_NONE), + /* Master spin */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Kokiri jump */ DMG_ENTRY(2, BIRI_DMG_REACT_NONE), + /* Giant jump */ DMG_ENTRY(8, BIRI_DMG_REACT_NONE), + /* Master jump */ DMG_ENTRY(4, BIRI_DMG_REACT_NONE), + /* Unknown 1 */ DMG_ENTRY(0, BIRI_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, BIRI_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, BIRI_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, BIRI_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -566,26 +566,26 @@ void EnBili_Frozen(EnBili* this, PlayState* play) { } void EnBili_UpdateDamage(EnBili* this, PlayState* play) { - u8 damageEffect; + u8 damageReaction; if ((this->actor.colChkInfo.health != 0) && (this->collider.base.acFlags & AC_HIT)) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_BIRI_DEAD); Enemy_StartFinishingBlow(play, &this->actor); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } - damageEffect = this->actor.colChkInfo.damageEffect; + damageReaction = this->actor.colChkInfo.damageReaction; - if (damageEffect == BIRI_DMGEFF_DEKUNUT) { + if (damageReaction == BIRI_DMG_REACT_DEKUNUT) { if (this->actionFunc != EnBili_Stunned) { EnBili_SetupStunned(this); } - } else if (damageEffect == BIRI_DMGEFF_SWORD) { + } else if (damageReaction == BIRI_DMG_REACT_SWORD) { if (this->actionFunc != EnBili_Stunned) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 200, COLORFILTER_BUFFLAG_XLU, 10); @@ -596,12 +596,12 @@ void EnBili_UpdateDamage(EnBili* this, PlayState* play) { } else { EnBili_SetupBurnt(this); } - } else if (damageEffect == BIRI_DMGEFF_FIRE) { + } else if (damageReaction == BIRI_DMG_REACT_FIRE) { EnBili_SetupBurnt(this); this->timer = 2; - } else if (damageEffect == BIRI_DMGEFF_ICE) { + } else if (damageReaction == BIRI_DMG_REACT_ICE) { EnBili_SetupFrozen(this, play); - } else if (damageEffect == BIRI_DMGEFF_SLINGSHOT) { + } else if (damageReaction == BIRI_DMG_REACT_SLINGSHOT) { EnBili_SetupRecoil(this); } else { EnBili_SetupBurnt(this); 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 3199639c9d..b0e58c4679 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.h +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.h @@ -2,7 +2,7 @@ #define Z_EN_BILI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBili; 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 c93d682ee1..771ee7dd15 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c @@ -8,7 +8,7 @@ #include "ichain.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_bird/object_bird.h" 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 beaf60a3d4..8c9a2eb774 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.h +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.h @@ -2,7 +2,7 @@ #define Z_EN_BIRD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBird; 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 1d8d606cf3..813f16ce12 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_blkobj/object_blkobj.h" 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 babddb4e5d..d8be8fb21f 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h @@ -2,7 +2,7 @@ #define Z_EN_BLKOBJ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBlkobj; 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 31acad8cec..bf1c9ee479 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -14,9 +14,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 88c8feef5c..1dfee46406 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -2,7 +2,7 @@ #define Z_EN_BOM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBom; 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 8edeca7cf5..2fff5313e5 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,15 +4,17 @@ #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 "terminal.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "translation.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_bg/object_bg.h" @@ -72,10 +74,10 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gChuGirlSkel, &gChuGirlNoddingOffAnim, this->jointTable, this->morphTable, 11); - // "☆ Man, my shoulders hurt~ ☆" - PRINTF(VT_FGCOL(GREEN) "☆ もー 肩こっちゃうよねぇ〜 \t\t ☆ \n" VT_RST); - // "☆ Isn't there some sort of job that will pay better and be more relaxing? ☆ %d" - PRINTF(VT_FGCOL(GREEN) "☆ もっとラクしてもうかるバイトないかしら? ☆ %d\n" VT_RST, play->bombchuBowlingStatus); + PRINTF(VT_FGCOL(GREEN) T("☆ もー 肩こっちゃうよねぇ〜 \t\t ☆ \n", "☆ Man, my shoulders hurt~ \t\t ☆ \n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆ もっとラクしてもうかるバイトないかしら? ☆ %d\n", + "☆ Isn't there some sort of job that will pay better and be more relaxing? ☆ %d\n") VT_RST, + play->bombchuBowlingStatus); this->posCopy = this->actor.world.pos; this->actor.shape.yOffset = -60.0f; Actor_SetScale(&this->actor, 0.013f); @@ -232,12 +234,12 @@ void EnBomBowlMan_RunGame(EnBomBowlMan* this, PlayState* play) { if (BREG(3)) { PRINTF(VT_FGCOL(RED) "☆ game_play->bomchu_game_flag ☆ %d\n" VT_RST, play->bombchuBowlingStatus); - // "HOW'S THE FIRST WALL DOING?" - PRINTF(VT_FGCOL(RED) "☆ 壁1の状態どう? ☆ %d\n" VT_RST, this->wallStatus[0]); - // "HOW'S THE SECOND WALL DOING?" - PRINTF(VT_FGCOL(RED) "☆ 壁2の状態どう? ☆ %d\n" VT_RST, this->wallStatus[1]); - // "HOLE INFORMATION" - PRINTF(VT_FGCOL(RED) "☆ 穴情報\t ☆ %d\n" VT_RST, this->bowlPit->status); + PRINTF(VT_FGCOL(RED) T("☆ 壁1の状態どう? ☆ %d\n", "☆ What's the state of wall 1? ☆ %d\n") VT_RST, + this->wallStatus[0]); + PRINTF(VT_FGCOL(RED) T("☆ 壁2の状態どう? ☆ %d\n", "☆ What's the state of wall 2? ☆ %d\n") VT_RST, + this->wallStatus[1]); + PRINTF(VT_FGCOL(RED) T("☆ 穴情報\t ☆ %d\n", "☆ Hole Information\t ☆ %d\n") VT_RST, + this->bowlPit->status); PRINTF("\n\n"); } @@ -247,15 +249,13 @@ void EnBomBowlMan_RunGame(EnBomBowlMan* this, PlayState* play) { if ((this->wallStatus[0] != 1) && (this->wallStatus[1] != 1) && (this->bowlPit->status == 2)) { this->gameResult = 1; // Won this->bowlPit->status = 0; - // "Center HIT!" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 中央HIT!!!! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 中央HIT!!!! ☆☆☆☆☆ \n", "☆☆☆☆☆ Center HIT!!!! ☆☆☆☆☆ \n") VT_RST); } if ((play->bombchuBowlingStatus == -1) && (play->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length == 0) && (this->bowlPit->status == 0) && (this->wallStatus[0] != 1) && (this->wallStatus[1] != 1)) { this->gameResult = 2; // Lost - // "Bombchu lost" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ ボムチュウ消化 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ ボムチュウ消化 ☆☆☆☆☆ \n", "☆☆☆☆☆ Bombchu digestion ☆☆☆☆☆ \n") VT_RST); } } @@ -469,8 +469,7 @@ void EnBomBowlMan_BeginPlayGame(EnBomBowlMan* this, PlayState* play) { BREG(2) = 0; } - // "Wow" - PRINTF(VT_FGCOL(YELLOW) "☆ わー ☆ %d\n" VT_RST, play->bombchuBowlingStatus); + PRINTF(VT_FGCOL(YELLOW) T("☆ わー ☆ %d\n", "☆ Wow ☆ %d\n") VT_RST, play->bombchuBowlingStatus); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_7); this->actionFunc = EnBomBowlMan_SetupRunGame; } diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h index ffc4ae9efc..2b85ab84ac 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h @@ -2,7 +2,7 @@ #define Z_EN_BOM_BOWL_MAN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" #include "overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.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 20ea5fb0db..43207a9992 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,13 +1,15 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -207,12 +209,10 @@ void EnBomBowlPit_WaitTillPrizeGiven(EnBomBowlPit* this, PlayState* play) { void EnBomBowlPit_Reset(EnBomBowlPit* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - // "Normal termination"/"completion" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n", "☆☆☆☆☆ Normal termination ☆☆☆☆☆ \n") VT_RST); if (this->getItemId == GI_HEART_PIECE) { gSaveContext.healthAccumulator = 0x140; - // "Ah recovery!" (?) - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ あぁ回復! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ あぁ回復! ☆☆☆☆☆ \n", "☆☆☆☆☆ Ah recovery! ☆☆☆☆☆ \n") VT_RST); } this->exItemDone = 0; this->status = 2; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h index 711518848f..a75f4a9f72 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h @@ -2,7 +2,7 @@ #define Z_EN_BOM_BOWL_PIT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" struct EnBomBowlPit; 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 3af6e87eca..6e9dc91695 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" @@ -10,9 +11,9 @@ #include "sys_math3d.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h index 38ca8d20c6..dad96a02ea 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h @@ -2,7 +2,7 @@ #define Z_EN_BOM_CHU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBomChu; 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 ed1d7eed79..117343703e 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -15,9 +15,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_bombf/object_bombf.h" 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 840da79c19..e805ae0ac1 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 "z64actor.h" +#include "actor.h" struct EnBombf; 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 b9dcbacb76..d70422b1d0 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -12,8 +12,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.h b/src/overlays/actors/ovl_En_Boom/z_en_boom.h index 7a211880a4..f62edc7654 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.h +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.h @@ -2,8 +2,8 @@ #define Z_EN_BOOM_H #include "ultra64.h" -#include "z64actor.h" -#include "z64player.h" +#include "actor.h" +#include "player.h" struct EnBoom; 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 ac30a23d5f..23c9321356 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -6,18 +6,19 @@ #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 "audio.h" +#include "curve.h" +#include "effect.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_box/object_box.h" @@ -639,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_Box/z_en_box.h b/src/overlays/actors/ovl_En_Box/z_en_box.h index 1604b0d1bc..7bea0c4787 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -2,7 +2,7 @@ #define Z_EN_BOX_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #define ENBOX_TREASURE_FLAG_UNK_MIN 20 #define ENBOX_TREASURE_FLAG_UNK_MAX 32 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 436f4740c5..1dc0ea5e6e 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -11,8 +11,8 @@ #include "gfx_setupdl.h" #include "sfx.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_brob/object_brob.h" 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 02516f4e9b..1d3b785508 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.h +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.h @@ -2,7 +2,7 @@ #define Z_EN_BROB_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBrob; 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 79860d7f7f..30de9c5bbb 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -8,8 +8,8 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_bubble/object_bubble.h" 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 9b183ae2bc..e90efefb29 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h @@ -2,7 +2,7 @@ #define Z_EN_BUBBLE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBubble; 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 cd9776b988..58a5392306 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -11,13 +11,15 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" @@ -49,7 +51,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = { }, { 0, { { 0, 0, 0 }, 5 }, 100 } }, }; -static ColliderJntSphInit sColliderInit = { +static ColliderJntSphInit sColliderJntSphInit = { { COL_MATERIAL_NONE, AT_NONE, @@ -172,7 +174,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->colliderElements); + Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements); this->actor.colChkInfo.mass = 0; this->unk_25C = Rand_ZeroOne() * 0xFFFF; this->unk_25E = Rand_ZeroOne() * 0xFFFF; @@ -181,8 +183,8 @@ void EnButte_Init(Actor* thisx, PlayState* play) { EnButte_SetupFlyAround(this); this->actor.shape.rot.x -= 0x2320; this->drawSkelAnime = true; - // "field keep butterfly" - PRINTF("(field keep 蝶)(%x)(arg_data 0x%04x)\n", this, this->actor.params); + PRINTF(T("(field keep 蝶)(%x)(arg_data 0x%04x)\n", "(field keep butterfly)(%x)(arg_data 0x%04x)\n"), this, + this->actor.params); } void EnButte_Destroy(Actor* thisx, PlayState* play2) { 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 1a1764520c..1a18cb681b 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.h +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.h @@ -2,7 +2,7 @@ #define Z_EN_BUTTE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnButte; 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 0aad9cccae..7f6b4ae99e 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -19,9 +19,9 @@ #include "versions.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_bw/object_bw.h" @@ -617,7 +617,7 @@ void func_809D01CC(EnBw* this) { this->actor.speed = 0.0f; this->unk_25C = (Rand_ZeroOne() * 0.25f) + 1.0f; this->unk_260 = 0.0f; - if (this->damageEffect == 0xE) { + if (this->damageReaction == 0xE) { this->iceTimer = 0x50; } this->unk_222 = (this->actor.colorFilterParams & 0x4000) ? 25 : 80; @@ -658,7 +658,7 @@ void func_809D0268(EnBw* this, PlayState* play) { void func_809D03CC(EnBw* this) { this->actor.speed = 0.0f; - if (this->damageEffect == 0xE) { + if (this->damageReaction == 0xE) { this->iceTimer = 32; } this->unk_23C = this->actor.colorFilterTimer; @@ -706,12 +706,12 @@ void func_809D0584(EnBw* this, PlayState* play) { } else { if (this->collider2.base.acFlags & AC_HIT) { this->collider2.base.acFlags &= ~AC_HIT; - if ((this->actor.colChkInfo.damageEffect == 0) || (this->unk_220 == 6)) { + if ((this->actor.colChkInfo.damageReaction == 0) || (this->unk_220 == 6)) { return; } - this->damageEffect = this->actor.colChkInfo.damageEffect; + this->damageReaction = this->actor.colChkInfo.damageReaction; Actor_SetDropFlag(&this->actor, &this->collider2.elem, false); - if ((this->damageEffect == 1) || (this->damageEffect == 0xE)) { + if ((this->damageReaction == 1) || (this->damageReaction == 0xE)) { if (this->unk_23C == 0) { Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); @@ -771,7 +771,7 @@ void EnBw_Update(Actor* thisx, PlayState* play2) { Color_RGBA8 sp44 = { 0, 0, 0, 220 }; func_809D0584(this, play); - if (thisx->colChkInfo.damageEffect != 6) { + if (thisx->colChkInfo.damageReaction != 6) { this->actionFunc(this, play); if (this->unk_23C == 0) { this->unk_23A = (this->unk_23A + 4) & 0x7F; 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 7c0698d22c..fe9f8ef90a 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.h +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.h @@ -2,7 +2,7 @@ #define Z_EN_BW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnBw; typedef void (*EnBwActionFunc)(struct EnBw*, struct PlayState*); @@ -35,7 +35,7 @@ typedef struct EnBw { /* 0x0228 */ EnBwActionFunc actionFunc; /* 0x022C */ Color_RGBA8 color1; /* 0x0230 */ u8 unk_230; - /* 0x0231 */ u8 damageEffect; + /* 0x0231 */ u8 damageReaction; /* 0x0232 */ u8 unk_232; /* 0x0234 */ s16 unk_234; /* 0x0236 */ s16 unk_236; 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 51896cbb7d..942cfdd6fb 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -14,9 +14,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_bxa/object_bxa.h" 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 077def413d..be5872d959 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 "z64actor.h" +#include "actor.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 d6f0ab74e0..c400d0e08d 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -9,12 +9,14 @@ #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" +#include "translation.h" +#include "debug_display.h" +#include "play_state.h" +#include "save.h" #define FLAGS 0 @@ -91,14 +93,14 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { } PRINTF("\n\n"); - // "Treasure generation (which room is it?)" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 宝発生(部屋はどれ?) %d\n" VT_RST, play->roomCtx.curRoom.num); - // "How is the Bit?" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ビットは? \t %x\n" VT_RST, play->actorCtx.flags.chest); - // "How is the Save BIT?" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ セーブBITは? %x\n" VT_RST, sTreasureFlags[minigameRoomNum]); - // "Is it already a zombie?" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ もう、ゾンビ?\t %d\n" VT_RST, this->roomChestsOpened); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 宝発生(部屋はどれ?) %d\n", "☆☆☆☆☆ Treasure found (which room?) %d\n") VT_RST, + play->roomCtx.curRoom.num); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ビットは? \t %x\n", "☆☆☆☆☆ What about bits? \t %x\n") VT_RST, + play->actorCtx.flags.chest); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ セーブBITは? %x\n", "☆☆☆☆☆ What is the save BIT? %x\n") VT_RST, + sTreasureFlags[minigameRoomNum]); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ もう、ゾンビ?\t %d\n", "☆☆☆☆☆ Already a zombie?\t %d\n") VT_RST, + this->roomChestsOpened); PRINTF("\n\n"); minigameRoomNum *= 2; @@ -119,8 +121,9 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { 0xFF; Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_ETCETERA, 20.0f, 20.0f, -2500.0f, 0, 0, 0, ((sTreasureFlags[5] & 0x1F) << 8) + rewardParams); - // "Central treasure instance/occurrence (GREAT)" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 中央宝発生(GREAT) ☆☆☆☆☆ %x\n" VT_RST, rewardChestParams); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 中央宝発生(GREAT) ☆☆☆☆☆ %x\n", + "☆☆☆☆☆ Central treasure spawn (GREAT) ☆☆☆☆☆ %x\n") VT_RST, + rewardChestParams); this->actionFunc = EnChanger_SetHeartPieceFlag; return; } @@ -156,14 +159,15 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { leftChestParams); if (this->leftChest != NULL) { - // "Left treasure generation (what does it contain?)" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 左宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n" VT_RST, leftChestParams); - // "What is the room number?" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 部屋番号は? %x\n" VT_RST, play->roomCtx.curRoom.num); - // "What is the bit?" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ ビットはなぁに? %x\n" VT_RST, this->rightChestNum); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 左宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n", + "☆☆☆☆☆ Left treasure spawn (what does it contain?) ☆☆☆☆☆ %x\n") VT_RST, + leftChestParams); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 部屋番号は? %x\n", "☆☆☆☆☆ What is the room number? %x\n") VT_RST, + play->roomCtx.curRoom.num); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ ビットはなぁに? %x\n", "☆☆☆☆☆ What is the bit? %x\n") VT_RST, + this->rightChestNum); // "Sukesuke-kun" (something to do with being invisible) - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ すけすけ君? %x\n" VT_RST, rightChestItem); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ すけすけ君? %x\n", "☆☆☆☆☆ See-through guy? %x\n") VT_RST, rightChestItem); PRINTF("\n\n"); if (this->roomChestsOpened) { Flags_SetTreasure(play, this->leftChestNum & 0x1F); @@ -180,14 +184,15 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { rightChestParams); if (this->rightChest != NULL) { - // "Right treasure generation (what does it contain?)" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 右宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n" VT_RST, rightChestParams); - // "What is the room number?" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 部屋番号は? %d\n" VT_RST, play->roomCtx.curRoom.num); - // "What is the bit?" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ ビットはなぁに? %x\n" VT_RST, this->leftChestNum); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 右宝発生(ナニがはいってるの?) ☆☆☆☆☆ %x\n", + "☆☆☆☆☆ Right treasure spawn (what does it contain?) ☆☆☆☆☆ %x\n") VT_RST, + rightChestParams); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 部屋番号は? %d\n", "☆☆☆☆☆ What is the room number? %d\n") VT_RST, + play->roomCtx.curRoom.num); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ ビットはなぁに? %x\n", "☆☆☆☆☆ What is the bit? %x\n") VT_RST, + this->leftChestNum); // "Sukesuke-kun" (something to do with being invisible) - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ すけすけ君? %x\n" VT_RST, leftChestItem); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ すけすけ君? %x\n", "☆☆☆☆☆ See-through guy? %x\n") VT_RST, leftChestItem); PRINTF("\n\n"); if (this->roomChestsOpened) { @@ -248,8 +253,9 @@ void EnChanger_OpenChests(EnChanger* this, PlayState* play) { } else { unopenedChestItemType = (s16)(this->rightChestGetItemId - GI_RUPEE_GREEN_LOSE) + EXITEM_GREEN_RUPEE_CHEST; - // "Open right treasure (chest)" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 右宝開く ☆☆☆☆☆ %d\n" VT_RST, unopenedChestItemType); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 右宝開く ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Right treasure open ☆☆☆☆☆ %d\n") + VT_RST, + unopenedChestItemType); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, unopenedChestItemType); } @@ -266,8 +272,8 @@ void EnChanger_OpenChests(EnChanger* this, PlayState* play) { } else { unopenedChestItemType = (s16)(this->leftChestGetItemId - GI_RUPEE_GREEN_LOSE) + EXITEM_GREEN_RUPEE_CHEST; - // "Open left treasure (chest)" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 左宝開く ☆☆☆☆☆ %d\n" VT_RST, unopenedChestItemType); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 左宝開く ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Left treasure open ☆☆☆☆☆ %d\n") VT_RST, + unopenedChestItemType); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, unopenedChestItemType); } 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 6807287787..45f8799a5f 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.h +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.h @@ -2,7 +2,7 @@ #define Z_EN_CHANGER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnChanger; 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 619630cf7b..f3b7f3dc19 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 @@ -5,12 +5,13 @@ #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" +#include "play_state.h" +#include "player.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_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 6978941868..bd9b0c2a1a 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 "z64actor.h" +#include "actor.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 d459c93f6f..2c27b88f2c 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -13,10 +13,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64ocarina.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) 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 e5602967e1..0ffd8529dd 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 "z64actor.h" +#include "actor.h" #include "assets/objects/object_cow/object_cow.h" #define COW_FLAG_PLAYER_NEARBY (1 << 1) 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 3ce86ff9d3..0182ad038f 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -7,9 +7,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_crow/object_crow.h" @@ -169,7 +169,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { this->actor.lockOnArrowOffset = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); - if (this->actor.colChkInfo.damageEffect == 3) { // Ice arrows + if (this->actor.colChkInfo.damageReaction == 3) { // Ice arrows Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 40); for (i = 0; i < 8; i++) { iceParticlePos.x = ((i & 1 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.x; @@ -178,7 +178,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { EffectSsEnIce_SpawnFlyingVec3f(play, &this->actor, &iceParticlePos, 150, 150, 150, 250, 235, 245, 255, ((Rand_ZeroOne() * 0.15f) + 0.85f) * scale); } - } else if (this->actor.colChkInfo.damageEffect == 2) { // Fire arrows and Din's Fire + } else if (this->actor.colChkInfo.damageReaction == 2) { // Fire arrows and Din's Fire Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 40); for (i = 0; i < 4; i++) { @@ -426,8 +426,8 @@ void EnCrow_UpdateDamage(EnCrow* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elements[0].base, true); - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { - if (this->actor.colChkInfo.damageEffect == 1) { // Deku Nuts + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { + if (this->actor.colChkInfo.damageReaction == 1) { // Deku Nuts EnCrow_SetupTurnAway(this); } else { Actor_ApplyDamage(&this->actor); 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 fb13e7bca6..058bef6e90 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h @@ -2,7 +2,7 @@ #define Z_EN_CROW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnCrow; 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 8b74a6063e..ce9f69f5cd 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -8,10 +8,10 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.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 8e1d665f54..304a1e443f 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.h +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.h @@ -2,7 +2,7 @@ #define Z_EN_CS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnCs; 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 98a09bb25e..628e7de831 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -10,10 +10,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_daiku/object_daiku.h" 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 b191c1d79f..8b1e36786f 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h @@ -2,7 +2,7 @@ #define Z_EN_DAIKU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDaiku; 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 c5eb8ff56b..7401a84e38 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 @@ -10,14 +10,15 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_daiku/object_daiku.h" 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 1395b6e259..72ed1c7e3e 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,7 +2,7 @@ #define Z_EN_DAIKU_KAKARIKO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDaikuKakariko; 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 ab7b8e4285..d30784b4c1 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -1,6 +1,7 @@ #include "z_en_dekubaba.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" @@ -8,10 +9,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_dekubaba/object_dekubaba.h" @@ -149,84 +150,84 @@ static ColliderJntSphInit sJntSphInit = { static CollisionCheckInfoInit sColChkInfoInit = { 2, 25, 25, MASS_IMMOVABLE }; -typedef enum DekuBabaDamageEffect { - /* 0x0 */ DEKUBABA_DMGEFF_NONE, - /* 0x1 */ DEKUBABA_DMGEFF_DEKUNUT, - /* 0x2 */ DEKUBABA_DMGEFF_FIRE, - /* 0xE */ DEKUBABA_DMGEFF_BOOMERANG = 14, - /* 0xF */ DEKUBABA_DMGEFF_SWORD -} DekuBabaDamageEffect; +typedef enum DekuBabaDamageReaction { + /* 0x0 */ DEKUBABA_DMG_REACT_NONE, + /* 0x1 */ DEKUBABA_DMG_REACT_DEKUNUT, + /* 0x2 */ DEKUBABA_DMG_REACT_FIRE, + /* 0xE */ DEKUBABA_DMG_REACT_BOOMERANG = 14, + /* 0xF */ DEKUBABA_DMG_REACT_SWORD +} DekuBabaDamageReaction; static DamageTable sDekuBabaDamageTable = { - /* Deku nut */ DMG_ENTRY(0, DEKUBABA_DMGEFF_DEKUNUT), - /* Deku stick */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Slingshot */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), - /* Explosive */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(2, DEKUBABA_DMGEFF_BOOMERANG), - /* Normal arrow */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Hookshot */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Kokiri sword */ DMG_ENTRY(1, DEKUBABA_DMGEFF_SWORD), - /* Master sword */ DMG_ENTRY(2, DEKUBABA_DMGEFF_SWORD), - /* Giant's Knife */ DMG_ENTRY(4, DEKUBABA_DMGEFF_SWORD), - /* Fire arrow */ DMG_ENTRY(4, DEKUBABA_DMGEFF_FIRE), - /* Ice arrow */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Light arrow */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Unk arrow 1 */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(4, DEKUBABA_DMGEFF_FIRE), - /* Ice magic */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Light magic */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Shield */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, DEKUBABA_DMGEFF_SWORD), - /* Giant spin */ DMG_ENTRY(4, DEKUBABA_DMGEFF_SWORD), - /* Master spin */ DMG_ENTRY(2, DEKUBABA_DMGEFF_SWORD), - /* Kokiri jump */ DMG_ENTRY(2, DEKUBABA_DMGEFF_SWORD), - /* Giant jump */ DMG_ENTRY(8, DEKUBABA_DMGEFF_SWORD), - /* Master jump */ DMG_ENTRY(4, DEKUBABA_DMGEFF_SWORD), - /* Unknown 1 */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, DEKUBABA_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_DEKUNUT), + /* Deku stick */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(1, DEKUBABA_DMG_REACT_NONE), + /* Explosive */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_BOOMERANG), + /* Normal arrow */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Hookshot */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Kokiri sword */ DMG_ENTRY(1, DEKUBABA_DMG_REACT_SWORD), + /* Master sword */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_SWORD), + /* Giant's Knife */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_SWORD), + /* Fire arrow */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Light arrow */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Unk arrow 1 */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Light magic */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Shield */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, DEKUBABA_DMG_REACT_SWORD), + /* Giant spin */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_SWORD), + /* Master spin */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_SWORD), + /* Kokiri jump */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_SWORD), + /* Giant jump */ DMG_ENTRY(8, DEKUBABA_DMG_REACT_SWORD), + /* Master jump */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_SWORD), + /* Unknown 1 */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), }; // The only difference is that for Big Deku Babas, Hookshot will act the same as Deku Nuts: i.e. it will stun, but // cannot kill. static DamageTable sBigDekuBabaDamageTable = { - /* Deku nut */ DMG_ENTRY(0, DEKUBABA_DMGEFF_DEKUNUT), - /* Deku stick */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Slingshot */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), - /* Explosive */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(2, DEKUBABA_DMGEFF_BOOMERANG), - /* Normal arrow */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Hookshot */ DMG_ENTRY(0, DEKUBABA_DMGEFF_DEKUNUT), - /* Kokiri sword */ DMG_ENTRY(1, DEKUBABA_DMGEFF_SWORD), - /* Master sword */ DMG_ENTRY(2, DEKUBABA_DMGEFF_SWORD), - /* Giant's Knife */ DMG_ENTRY(4, DEKUBABA_DMGEFF_SWORD), - /* Fire arrow */ DMG_ENTRY(4, DEKUBABA_DMGEFF_FIRE), - /* Ice arrow */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Light arrow */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Unk arrow 1 */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(4, DEKUBABA_DMGEFF_FIRE), - /* Ice magic */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Light magic */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Shield */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, DEKUBABA_DMGEFF_SWORD), - /* Giant spin */ DMG_ENTRY(4, DEKUBABA_DMGEFF_SWORD), - /* Master spin */ DMG_ENTRY(2, DEKUBABA_DMGEFF_SWORD), - /* Kokiri jump */ DMG_ENTRY(2, DEKUBABA_DMGEFF_SWORD), - /* Giant jump */ DMG_ENTRY(8, DEKUBABA_DMGEFF_SWORD), - /* Master jump */ DMG_ENTRY(4, DEKUBABA_DMGEFF_SWORD), - /* Unknown 1 */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, DEKUBABA_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_DEKUNUT), + /* Deku stick */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(1, DEKUBABA_DMG_REACT_NONE), + /* Explosive */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_BOOMERANG), + /* Normal arrow */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Hookshot */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_DEKUNUT), + /* Kokiri sword */ DMG_ENTRY(1, DEKUBABA_DMG_REACT_SWORD), + /* Master sword */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_SWORD), + /* Giant's Knife */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_SWORD), + /* Fire arrow */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Light arrow */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Unk arrow 1 */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Light magic */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Shield */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, DEKUBABA_DMG_REACT_SWORD), + /* Giant spin */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_SWORD), + /* Master spin */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_SWORD), + /* Kokiri jump */ DMG_ENTRY(2, DEKUBABA_DMG_REACT_SWORD), + /* Giant jump */ DMG_ENTRY(8, DEKUBABA_DMG_REACT_SWORD), + /* Master jump */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_SWORD), + /* Unknown 1 */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, DEKUBABA_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, DEKUBABA_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -256,7 +257,7 @@ void EnDekubaba_Init(Actor* thisx, PlayState* play) { // (Of course they reckoned without each age being able to use the other's items, so Stick and Master Sword // jumpslash can give the Stick drop as adult, and neither will as child.) if (!LINK_IS_ADULT) { - sBigDekuBabaDamageTable.table[0x1B] = DMG_ENTRY(4, DEKUBABA_DMGEFF_NONE); // DMG_JUMP_MASTER + sBigDekuBabaDamageTable.table[0x1B] = DMG_ENTRY(4, DEKUBABA_DMG_REACT_NONE); // DMG_JUMP_MASTER } CollisionCheck_SetInfo(&this->actor.colChkInfo, &sBigDekuBabaDamageTable, &sColChkInfoInit); @@ -271,7 +272,7 @@ void EnDekubaba_Init(Actor* thisx, PlayState* play) { } if (!LINK_IS_ADULT) { - sDekuBabaDamageTable.table[0x1B] = DMG_ENTRY(4, DEKUBABA_DMGEFF_NONE); // DMG_JUMP_MASTER + sDekuBabaDamageTable.table[0x1B] = DMG_ENTRY(4, DEKUBABA_DMG_REACT_NONE); // DMG_JUMP_MASTER } CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDekuBabaDamageTable, &sColChkInfoInit); @@ -1048,14 +1049,15 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { Actor_SetDropFlagJntSph(&this->actor, &this->collider, true); if ((this->collider.base.colMaterial != COL_MATERIAL_HARD) && - ((this->actor.colChkInfo.damageEffect != DEKUBABA_DMGEFF_NONE) || (this->actor.colChkInfo.damage != 0))) { + ((this->actor.colChkInfo.damageReaction != DEKUBABA_DMG_REACT_NONE) || + (this->actor.colChkInfo.damage != 0))) { phi_s0 = this->actor.colChkInfo.health - this->actor.colChkInfo.damage; if (this->actionFunc != EnDekubaba_StunnedVertical) { - if ((this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_BOOMERANG) || - (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_DEKUNUT)) { - if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_BOOMERANG) { + if ((this->actor.colChkInfo.damageReaction == DEKUBABA_DMG_REACT_BOOMERANG) || + (this->actor.colChkInfo.damageReaction == DEKUBABA_DMG_REACT_DEKUNUT)) { + if (this->actor.colChkInfo.damageReaction == DEKUBABA_DMG_REACT_BOOMERANG) { phi_s0 = this->actor.colChkInfo.health; } @@ -1069,14 +1071,14 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { } else { EnDekubaba_SetupHit(this, 0); } - } else if ((this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_BOOMERANG) || - (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_SWORD)) { + } else if ((this->actor.colChkInfo.damageReaction == DEKUBABA_DMG_REACT_BOOMERANG) || + (this->actor.colChkInfo.damageReaction == DEKUBABA_DMG_REACT_SWORD)) { if (phi_s0 > 0) { EnDekubaba_SetupSway(this); } else { EnDekubaba_SetupPrunedSomersault(this); } - } else if (this->actor.colChkInfo.damageEffect != DEKUBABA_DMGEFF_DEKUNUT) { + } else if (this->actor.colChkInfo.damageReaction != DEKUBABA_DMG_REACT_DEKUNUT) { EnDekubaba_SetupHit(this, 0); } else { return; @@ -1084,7 +1086,7 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { this->actor.colChkInfo.health = CLAMP_MIN(phi_s0, 0); - if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_FIRE) { + if (this->actor.colChkInfo.damageReaction == DEKUBABA_DMG_REACT_FIRE) { firePos = &this->actor.world.pos; fireScale = (this->size * 70.0f); 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 46a8b8dbdf..f1cce28c07 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -2,7 +2,7 @@ #define Z_EN_DEKUBABA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDekubaba; 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 cf498eb726..dac88693bc 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -12,8 +12,8 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_dekunuts/object_dekunuts.h" @@ -456,9 +456,9 @@ void EnDekunuts_ColliderCheck(EnDekunuts* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); if (this->actor.colChkInfo.mass == 50) { - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { - if (this->actor.colChkInfo.damageEffect != 1) { - if (this->actor.colChkInfo.damageEffect == 2) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { + if (this->actor.colChkInfo.damageReaction != 1) { + if (this->actor.colChkInfo.damageReaction == 2) { EffectSsFCircle_Spawn(play, &this->actor, &this->actor.world.pos, 40, 50); } EnDekunuts_SetupBeDamaged(this); 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 76f23bdecf..a072dc2aa4 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h @@ -2,7 +2,7 @@ #define Z_EN_DEKUNUTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDekunuts; 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 34acb2d982..7870669259 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -18,11 +18,11 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_dh/object_dh.h" @@ -507,7 +507,7 @@ void EnDh_CollisionCheck(EnDh* this, PlayState* play) { 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)) { + if ((this->actor.colChkInfo.damageReaction != 0) && (this->actor.colChkInfo.damageReaction != 6)) { this->colliderJntSph.base.atFlags = this->colliderJntSph.elements[0].base.atElemFlags = AT_NONE; // also ATELEM_NONE this->colliderJntSph.elements[0].base.atDmgInfo.dmgFlags = 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 0feb3069b5..d923144a73 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.h +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.h @@ -2,7 +2,7 @@ #define Z_EN_DH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDh; 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 5754d8ae1e..559e4a7213 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -16,9 +16,9 @@ #include "versions.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_dh/object_dh.h" @@ -409,7 +409,7 @@ void EnDha_UpdateHealth(EnDha* this, PlayState* play) { if (!((this->unk_1C0 >= 8) || !(this->collider.base.acFlags & AC_HIT))) { this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect == 0 || this->actor.colChkInfo.damageEffect == 6) { + if (this->actor.colChkInfo.damageReaction == 0 || this->actor.colChkInfo.damageReaction == 6) { return; } else { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); 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 f7cbd78d7b..9c6f0f7d18 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.h +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.h @@ -2,7 +2,7 @@ #define Z_EN_DHA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDha; 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 6de6666028..bcb49b9250 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 @@ -10,19 +10,21 @@ #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 "translation.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 "audio.h" +#include "effect.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_zo/object_zo.h" @@ -99,13 +101,13 @@ void EnDivingGame_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, &gZoraIdleAnim, this->jointTable, this->morphTable, 20); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 素もぐりGO ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 素もぐりGO ☆☆☆☆☆ \n", "☆☆☆☆☆ Diving GO ☆☆☆☆☆ \n") VT_RST); this->actor.room = -1; this->actor.scale.x = 0.01f; this->actor.scale.y = 0.012999999f; this->actor.scale.z = 0.0139999995f; if (D_809EF0B0) { - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ もういてる原 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ もういてる原 ☆☆☆☆☆ \n", "☆☆☆☆☆ I'm already here -Hara ☆☆☆☆☆ \n") VT_RST); this->unk_31F = 1; Actor_Kill(&this->actor); } else { @@ -496,8 +498,7 @@ void func_809EEA90(EnDivingGame* this, PlayState* play) { void func_809EEAF8(EnDivingGame* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { - // "Successful completion" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n", "☆☆☆☆☆ Normal termination ☆☆☆☆☆ \n") VT_RST); this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0; SET_EVENTCHKINF(EVENTCHKINF_38); this->actionFunc = func_809EDCB0; 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 ccc211dc8b..f5e9c1cc77 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,7 +2,7 @@ #define Z_EN_DIVING_GAME_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDivingGame; 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 cc823ecdcb..8dd85d8c2e 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -9,14 +9,16 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "sfx.h" #include "terminal.h" +#include "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_shopnuts/object_shopnuts.h" @@ -92,17 +94,17 @@ static u16 sStartingTextIds[] = { #if DEBUG_FEATURES static char* sItemDebugTxt[] = { - "デクの実売り ", // "Deku Nuts" - "デクの棒売り ", // "Deku Sticks" - "ハートの欠片売り ", // "Piece of Heart" - "デクの種売り ", // "Deku Seeds" - "デクの盾売り ", // "Deku Shield" - "バクダン売り ", // "Bombs" - "矢売り ", // "Arrows" - "赤のくすり売り ", // "Red Potion" - "緑のくすり売り ", // "Green Potion" - "デクの棒持てる数を増やす", // "Deku Stick Upgrade" - "デクの実持てる数を増やす", // "Deku Nut Upgrade" + T("デクの実売り ", "Deku Nuts "), + T("デクの棒売り ", "Deku Sticks "), + T("ハートの欠片売り ", "Piece of Heart "), + T("デクの種売り ", "Deku Seeds "), + T("デクの盾売り ", "Deku Shield "), + T("バクダン売り ", "Bombs "), + T("矢売り ", "Arrows "), + T("赤のくすり売り ", "Red Potion "), + T("緑のくすり売り ", "Green Potion "), + T("デクの棒持てる数を増やす", "Deku Stick Upgrade "), + T("デクの実持てる数を増やす", "Deku Nut Upgrade "), }; #endif @@ -142,8 +144,9 @@ void EnDns_Init(Actor* thisx, PlayState* play) { EnDns* this = (EnDns*)thisx; if (DNS_GET_TYPE(&this->actor) < 0) { - // "Function Error (Deku Salesman)" - PRINTF(VT_FGCOL(RED) "引数エラー(売りナッツ)[ arg_data = %d ]" VT_RST "\n", this->actor.params); + PRINTF(VT_FGCOL(RED) T("引数エラー(売りナッツ)[ arg_data = %d ]", + "Argument error (selling nuts) [ arg_data = %d ]") VT_RST "\n", + this->actor.params); Actor_Kill(&this->actor); return; } @@ -153,8 +156,8 @@ void EnDns_Init(Actor* thisx, PlayState* play) { DNS_GET_TYPE(&this->actor) = DNS_TYPE_DEKU_SEEDS_30; } - // "Deku Salesman" - PRINTF(VT_FGCOL(GREEN) "◆◆◆ 売りナッツ『%s』 ◆◆◆" VT_RST "\n", sItemDebugTxt[DNS_GET_TYPE(&this->actor)]); + PRINTF(VT_FGCOL(GREEN) T("◆◆◆ 売りナッツ『%s』 ◆◆◆", "◆◆◆ Selling nuts『%s』 ◆◆◆") VT_RST "\n", + sItemDebugTxt[DNS_GET_TYPE(&this->actor)]); Actor_ProcessInitChain(&this->actor, sInitChain); 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 3a91a5362a..251cc4192b 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 "z64actor.h" +#include "actor.h" #include "assets/objects/object_shopnuts/object_shopnuts.h" #define DNS_GET_TYPE(thisx) ((thisx)->params) 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 e23c50b448..24e881840f 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 @@ -10,18 +10,20 @@ #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 "translation.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64debug_display.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "debug_display.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS 0 @@ -88,16 +90,17 @@ void EnDntDemo_Init(Actor* thisx, PlayState* play2) { s32 pad; PRINTF("\n\n"); - // "Deku Scrub mask show start" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ デグナッツお面品評会開始 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) + T("☆☆☆☆☆ デグナッツお面品評会開始 ☆☆☆☆☆ \n", "☆☆☆☆☆ Deku Scrub mask competition start ☆☆☆☆☆ \n") VT_RST); for (i = 0; i < 9; i++) { this->scrubPos[i] = sScrubPos[i]; this->scrubs[i] = (EnDntNomal*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_DNT_NOMAL, this->scrubPos[i].x, this->scrubPos[i].y, this->scrubPos[i].z, 0, 0, 0, i + ENDNTNOMAL_STAGE); if (this->scrubs[i] != NULL) { - // "zako zako" [small fries] - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ザコザコ ☆☆☆☆☆ %x\n" VT_RST, this->scrubs[i]); + // [small fry] + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ザコザコ ☆☆☆☆☆ %x\n", "☆☆☆☆☆ zako zako ☆☆☆☆☆ %x\n") VT_RST, + this->scrubs[i]); } } @@ -107,8 +110,10 @@ void EnDntDemo_Init(Actor* thisx, PlayState* play2) { this->leader = (EnDntJiji*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_DNT_JIJI, this->leaderPos.x, this->leaderPos.y, this->leaderPos.z, 0, 0, 0, 0); if (this->leader != NULL) { - // "jiji jiji jiji jiji jiji" [onomatopoeia for the scrub sound?] - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ じじじじじじじじじじい ☆☆☆☆☆ %x\n" VT_RST, this->leader); + // onomatopoeia for the scrub sound? + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ じじじじじじじじじじい ☆☆☆☆☆ %x\n", "☆☆☆☆☆ jiji jiji jiji jiji jiji ☆☆☆☆☆ %x\n") + VT_RST, + this->leader); } this->subCamId = SUB_CAM_ID_DONE; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; @@ -157,8 +162,8 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { } } if (this->judgeTimer > 40) { - // "gera gera" [onomatopoeia for loud giggling] - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ げらげら ☆☆☆☆☆ \n" VT_RST); + // [onomatopoeia for loud giggling] + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ げらげら ☆☆☆☆☆ \n", "☆☆☆☆☆ gera gera ☆☆☆☆☆ \n") VT_RST); func_800F436C(&this->actor.projectedPos, NA_SE_EV_CROWD - SFX_FLAG, 2.0f); } if (this->judgeTimer < 120) { @@ -205,15 +210,17 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { ignore = true; delay = 8; reaction = DNT_SIGNAL_HIDE; - // "Special!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 特別! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 特別! ☆☆☆☆☆ \n", "☆☆☆☆☆ Special! ☆☆☆☆☆ \n") VT_RST); } else { if (maskIdx >= PLAYER_MASK_MAX - 1) { - // "This is dangerous!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n", "☆☆☆☆☆ This is bad! ☆☆☆☆☆ \n") + VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n", "☆☆☆☆☆ This is bad! ☆☆☆☆☆ \n") + VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n", "☆☆☆☆☆ This is bad! ☆☆☆☆☆ \n") + VT_RST); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ ヤバいよこれ! ☆☆☆☆☆ \n", "☆☆☆☆☆ This is bad! ☆☆☆☆☆ \n") + VT_RST); maskIdx = Rand_ZeroFloat(7.99f); } @@ -236,17 +243,22 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { break; } PRINTF("\n\n"); - // "Each index 1" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 各インデックス1 ☆☆☆☆☆ %d\n" VT_RST, rand9); - // "Each index 2" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 各インデックス2 ☆☆☆☆☆ %d\n" VT_RST, maskIdx); - // "Each index 3" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 各インデックス3 ☆☆☆☆☆ %d\n" VT_RST, resultIdx); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 各インデックス1 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Each index 1 ☆☆☆☆☆ %d\n") + VT_RST, + rand9); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 各インデックス2 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Each index 2 ☆☆☆☆☆ %d\n") + VT_RST, + maskIdx); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 各インデックス3 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Each index 3 ☆☆☆☆☆ %d\n") + VT_RST, + resultIdx); PRINTF("\n"); - // "What kind of evaluation?" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ どういう評価? ☆☆☆☆☆☆ %d\n" VT_RST, reaction); - // "What kind of action?" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ どういうアクション? ☆☆☆ %d\n" VT_RST, this->action); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ どういう評価? ☆☆☆☆☆☆ %d\n", + "☆☆☆☆☆ What kind of evaluation? ☆☆☆☆☆☆ %d\n") VT_RST, + reaction); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ どういうアクション? ☆☆☆ %d\n", + "☆☆☆☆☆ What kind of action? ☆☆☆ %d\n") VT_RST, + this->action); PRINTF("\n\n"); break; } 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 29c302aed2..0fab1534e7 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,7 +2,7 @@ #define Z_EN_DNT_DEMO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDntDemo; 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 b0be17234b..dfaa49be28 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 @@ -12,6 +12,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" @@ -20,11 +21,12 @@ #include "sfx.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_dns/object_dns.h" @@ -98,8 +100,9 @@ void EnDntJiji_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->stage = (EnDntDemo*)this->actor.parent; PRINTF("\n\n"); - // "Deku Scrub mask show elder" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ デグナッツお面品評会長老 ☆☆☆☆☆ %x\n" VT_RST, this->stage); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ デグナッツお面品評会長老 ☆☆☆☆☆ %x\n", + "☆☆☆☆☆ Deku Scrub mask competition elder ☆☆☆☆☆ %x\n") VT_RST, + this->stage); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.attentionRangeType = ATTENTION_RANGE_6; @@ -291,24 +294,22 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { if ((this->getItemId == GI_DEKU_NUT_UPGRADE_30) || (this->getItemId == GI_DEKU_NUT_UPGRADE_40)) { - // "nut" - PRINTF("実 \n"); - PRINTF("実 \n"); - PRINTF("実 \n"); - PRINTF("実 \n"); - PRINTF("実 \n"); - PRINTF("実 \n"); - PRINTF("実 \n"); - PRINTF("実 \n"); + PRINTF(T("実 \n", "nut \n")); + PRINTF(T("実 \n", "nut \n")); + PRINTF(T("実 \n", "nut \n")); + PRINTF(T("実 \n", "nut \n")); + PRINTF(T("実 \n", "nut \n")); + PRINTF(T("実 \n", "nut \n")); + PRINTF(T("実 \n", "nut \n")); + PRINTF(T("実 \n", "nut \n")); SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE); } else { - // "stick" - PRINTF("棒 \n"); - PRINTF("棒 \n"); - PRINTF("棒 \n"); - PRINTF("棒 \n"); - PRINTF("棒 \n"); - PRINTF("棒 \n"); + PRINTF(T("棒 \n", "stick \n")); + PRINTF(T("棒 \n", "stick \n")); + PRINTF(T("棒 \n", "stick \n")); + PRINTF(T("棒 \n", "stick \n")); + PRINTF(T("棒 \n", "stick \n")); + PRINTF(T("棒 \n", "stick \n")); SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_STICK_UPGRADE); } this->actor.textId = 0; @@ -392,8 +393,7 @@ void EnDntJiji_Update(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.015f); this->unkTimer++; if (BREG(0)) { - // "time" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 時間 ☆☆☆☆☆ %d\n" VT_RST, this->timer); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 時間 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ time ☆☆☆☆☆ %d\n") VT_RST, this->timer); } if ((this->timer > 1) && (this->timer != 0)) { this->timer--; 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 540a8951a3..6272f8d916 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,7 +2,7 @@ #define Z_EN_DNT_JIJI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDntJiji; 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 bcf0978433..353f42e63c 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 @@ -14,18 +14,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 "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_dnk/object_dnk.h" #include "assets/objects/object_hintnuts/object_hintnuts.h" @@ -148,16 +150,15 @@ void EnDntNomal_Init(Actor* thisx, PlayState* play) { this->objectId = -1; if (this->type == ENDNTNOMAL_TARGET) { PRINTF("\n\n"); - // "Deku Scrub target" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ デグナッツ的当て ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ デグナッツ的当て ☆☆☆☆☆ \n", "☆☆☆☆☆ Deku Scrub target ☆☆☆☆☆ \n") VT_RST); 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); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ デグナッツお面品評会一般人 ☆☆☆☆☆ \n", + "☆☆☆☆☆ Deku Scrub mask competition audience ☆☆☆☆☆ \n") VT_RST); Collider_InitCylinder(play, &this->bodyColliderCylinder); Collider_SetCylinder(play, &this->bodyColliderCylinder, &this->actor, &sBodyCylinderInit); this->objectId = OBJECT_DNK; @@ -166,10 +167,9 @@ void EnDntNomal_Init(Actor* thisx, PlayState* play) { this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, this->objectId); if (this->requiredObjectSlot < 0) { Actor_Kill(&this->actor); - // "What?" - PRINTF(VT_FGCOL(MAGENTA) " なにみの? %d\n" VT_RST "\n", this->requiredObjectSlot); - // "Bank is funny" - PRINTF(VT_FGCOL(CYAN) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params); + PRINTF(VT_FGCOL(MAGENTA) T(" なにみの? %d\n", " What? %d\n") VT_RST "\n", this->requiredObjectSlot); + PRINTF(VT_FGCOL(CYAN) T(" バンクおかしいしぞ!%d\n", " The bank is weird! %d\n") VT_RST "\n", + this->actor.params); return; } } else { @@ -191,7 +191,7 @@ void EnDntNomal_Destroy(Actor* thisx, PlayState* play) { 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; @@ -278,8 +278,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { EffectSsExtra_Spawn(play, &scorePos, &scoreVel, &scoreAccel, 4, 2); Audio_StopSfxById(NA_SE_SY_TRE_BOX_APPEAR); Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); - // "Big hit" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 大当り ☆☆☆☆☆ %d\n" VT_RST, this->hitCounter); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 大当り ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Big hit ☆☆☆☆☆ %d\n") VT_RST, this->hitCounter); if (!LINK_IS_ADULT && !GET_ITEMGETINF(ITEMGETINF_1D)) { this->hitCounter++; if (this->hitCounter >= 3) { 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 21f77798a0..8f8626a28a 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,7 +2,7 @@ #define Z_EN_DNT_NOMAL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDntNomal; 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 1d967ed5fa..2f276b25f4 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -14,9 +14,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_dodojr/object_dodojr.h" @@ -360,14 +360,14 @@ s32 EnDodojr_CheckDamaged(EnDodojr* this, PlayState* play) { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } - if ((this->actor.colChkInfo.damageEffect == 0) && (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction == 0) && (this->actor.colChkInfo.damage != 0)) { Enemy_StartFinishingBlow(play, &this->actor); this->freezeFrameTimer = 2; this->actionFunc = EnDodojr_WaitFreezeFrames; return true; } - if ((this->actor.colChkInfo.damageEffect == 1) && (this->actionFunc != EnDodojr_Stunned) && + if ((this->actor.colChkInfo.damageReaction == 1) && (this->actionFunc != EnDodojr_Stunned) && (this->actionFunc != EnDodojr_StunnedBounce)) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->stunTimer = 120; 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 615304cb01..c90c5be548 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h @@ -2,7 +2,7 @@ #define Z_EN_DODOJR_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDodojr; 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 5d013911eb..c7446c4f19 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -12,9 +12,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_dodongo/object_dodongo.h" @@ -415,7 +415,7 @@ void EnDodongo_SetupStunned(EnDodongo* this) { Animation_Change(&this->skelAnime, &gDodongoBreatheFireAnim, 0.0f, 25.0f, 0.0f, ANIMMODE_ONCE, -4.0f); this->actionState = DODONGO_STUNNED; this->actor.speed = 0.0f; - if (this->damageEffect == 0xF) { + if (this->damageReaction == 0xF) { this->iceTimer = 36; } Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -733,9 +733,9 @@ void EnDodongo_CollisionCheck(EnDodongo* this, PlayState* play) { } 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)) { + if (this->actor.colChkInfo.damageReaction != 0xE) { + this->damageReaction = this->actor.colChkInfo.damageReaction; + if ((this->actor.colChkInfo.damageReaction == 1) || (this->actor.colChkInfo.damageReaction == 0xF)) { if (this->actionState != DODONGO_STUNNED) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(&this->actor); @@ -783,7 +783,7 @@ void EnDodongo_Update(Actor* thisx, PlayState* play) { EnDodongo* this = (EnDodongo*)thisx; EnDodongo_CollisionCheck(this, play); - if (this->actor.colChkInfo.damageEffect != 0xE) { + if (this->actor.colChkInfo.damageReaction != 0xE) { this->actionFunc(this, play); Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 60.0f, 70.0f, 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 7785030d49..4196409607 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -2,7 +2,7 @@ #define Z_EN_DODONGO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDodongo; @@ -30,7 +30,7 @@ typedef struct EnDodongo { /* 0x0358 */ Vec3f icePos[9]; /* 0x03C4 */ Color_RGBA8 bombSmokePrimColor; /* 0x03C8 */ Color_RGBA8 bombSmokeEnvColor; - /* 0x03CC */ u8 damageEffect; + /* 0x03CC */ u8 damageReaction; /* 0x03D0 */ s32 blureIdx; /* 0x03D4 */ ColliderQuad colliderAT; /* 0x0454 */ ColliderTris colliderHard; 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 0255b01626..4f25c38d08 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_dog/object_dog.h" 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 c3cdfd913b..7595d752ae 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.h +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.h @@ -2,7 +2,7 @@ #define Z_EN_DOG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDog; 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 b3f71481d9..b4bdd073f4 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -7,15 +7,16 @@ #include "z_en_door.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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index 4b4f95c466..60ed932eac 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -2,7 +2,7 @@ #define Z_EN_DOOR_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" /** * Actor Parameters 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 3c879ee1ac..1568736109 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -11,9 +11,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ds/object_ds.h" 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 9c7df969c6..40adaa8c47 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.h +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.h @@ -2,7 +2,7 @@ #define Z_EN_DS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDs; 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 1f716b977d..a89c572a83 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -7,12 +7,12 @@ #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 "audio.h" +#include "face_reaction.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.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 9e3ecb8805..e832b32071 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.h +++ b/src/overlays/actors/ovl_En_Du/z_en_du.h @@ -2,7 +2,7 @@ #define Z_EN_DU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDu; 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..a3ae11bf61 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,12 +8,14 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_dy_obj/object_dy_obj.h" @@ -46,8 +48,8 @@ void EnDyExtra_Init(Actor* thisx, PlayState* play) { EnDyExtra* this = (EnDyExtra*)thisx; PRINTF("\n\n"); - // "Big fairy effect" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 大妖精効果 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 大妖精効果 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Big fairy effect ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); this->type = this->actor.params; this->scale.x = 0.025f; this->scale.y = 0.039f; diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h index cf0fba2ea1..a093b62b31 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h @@ -2,7 +2,7 @@ #define Z_EN_DY_EXTRA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnDyExtra; 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 9023f99eac..87558e258d 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -6,14 +6,16 @@ #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" +#include "play_state.h" +#include "save.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -73,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 c42994f61c..4636ad9149 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.h +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.h @@ -2,7 +2,7 @@ #define Z_EN_EG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnEg; 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 d60d91c222..f0a5b4466e 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -7,9 +7,9 @@ #include "sfx.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_ei/object_ei.h" @@ -59,7 +59,7 @@ ActorProfile En_Eiyer_Profile = { /**/ EnEiyer_Draw, }; -static ColliderCylinderInit sColCylInit = { +static ColliderCylinderInit sColliderCylinderInit = { { COL_MATERIAL_HIT0, AT_ON | AT_TYPE_ENEMY, @@ -135,7 +135,7 @@ void EnEiyer_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 600.0f, ActorShadow_DrawCircle, 65.0f); SkelAnime_Init(play, &this->skelanime, &gStingerSkel, &gStingerIdleAnim, this->jointTable, this->morphTable, 19); Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit); + Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (this->actor.params < 3) { @@ -282,7 +282,7 @@ void EnEiyer_SetupLand(EnEiyer* this) { // Update BgCheck info, play sound, and spawn effect on the first frame of the land action this->timer = -1; this->actor.gravity = 0.0f; - this->collider.dim.height = sColCylInit.dim.height; + this->collider.dim.height = sColliderCylinderInit.dim.height; this->actionFunc = EnEiyer_Land; } @@ -328,7 +328,7 @@ void EnEiyer_SetupStunned(EnEiyer* this) { this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; - this->collider.dim.height = sColCylInit.dim.height + 8; + this->collider.dim.height = sColliderCylinderInit.dim.height + 8; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80); this->collider.base.atFlags &= ~AT_ON; Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -606,7 +606,7 @@ void EnEiyer_Stunned(EnEiyer* this, PlayState* play) { if (this->timer == 0) { this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - this->collider.dim.height = sColCylInit.dim.height; + this->collider.dim.height = sColliderCylinderInit.dim.height; EnEiyer_SetupGlide(this); } } @@ -616,7 +616,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); - if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { + if (this->actor.colChkInfo.damageReaction != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_EIER_DEAD); @@ -630,7 +630,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) { } else { EnEiyer_SetupDie(this); } - } else if (this->actor.colChkInfo.damageEffect == 1) { + } else if (this->actor.colChkInfo.damageReaction == 1) { if (this->actionFunc != EnEiyer_Stunned) { EnEiyer_SetupStunned(this); } @@ -638,7 +638,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_EIER_DAMAGE); EnEiyer_SetupHurt(this); } else { - this->collider.dim.height = sColCylInit.dim.height; + this->collider.dim.height = sColliderCylinderInit.dim.height; EnEiyer_SetupDie(this); } } 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 7626924496..b9e19f884f 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h @@ -2,7 +2,7 @@ #define Z_EN_EIYER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnEiyer; 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 58cd30f3ff..b40e670140 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -19,13 +19,13 @@ #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 "audio.h" +#include "effect.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "quest_hint.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 60e9940d75..2c796cfbbc 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.h +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.h @@ -2,8 +2,8 @@ #define Z_EN_ELF_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnElf; 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 b60eb08a6d..d43571b7d6 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -2,14 +2,16 @@ #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" +#include "debug_display.h" +#include "play_state.h" +#include "player.h" +#include "save.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 b9c8c1d882..73486e493b 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h @@ -2,7 +2,7 @@ #define Z_EN_ENCOUNT1_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #define SPAWNER_PARAMS(type, number, total) ((type << 0xB) | (number << 0x6) | total) 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 0fd64079e6..b1f714e5df 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -4,15 +4,17 @@ #include "libc64/qrand.h" #include "attributes.h" #include "gfx.h" +#include "printf.h" #include "quake.h" #include "rand.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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_efc_star_field/object_efc_star_field.h" @@ -56,16 +58,16 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) { if (!this->isNotDeathMountain) { PRINTF("\n\n"); - // "☆☆☆☆☆ Death Mountain Encount2 set ☆☆☆☆☆" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ デスマウンテンエンカウント2セットされました ☆☆☆☆☆ %d\n" VT_RST, + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ デスマウンテンエンカウント2セットされました ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ Death Mountain Encount2 set ☆☆☆☆☆ %d\n") VT_RST, this->actor.params); if (LINK_IS_ADULT && GET_EVENTCHKINF(EVENTCHKINF_49)) { // flag for having used fire temple blue warp Actor_Kill(thisx); } } else { PRINTF("\n\n"); - // "☆☆☆☆☆ Ganon Tower Escape Encount2 set ☆☆☆☆☆" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ガノンタワー脱出エンカウント2セットされました ☆☆☆☆☆ %d\n" VT_RST, + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ガノンタワー脱出エンカウント2セットされました ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ Ganon Tower Escape Encount2 set ☆☆☆☆☆ %d\n") VT_RST, this->actor.params); } @@ -247,12 +249,11 @@ void EnEncount2_SpawnRocks(EnEncount2* this, PlayState* play) { this->numSpawnedRocks++; return; } - // "☆☆☆☆☆ Can't occur! ☆☆☆☆☆" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n" VT_RST); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n\n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Can't spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Can't spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Can't spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n", "☆☆☆☆☆ Can't spawn! ☆☆☆☆☆\n") VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発生できません! ☆☆☆☆☆\n\n", "☆☆☆☆☆ Can't spawn! ☆☆☆☆☆\n\n") VT_RST); } } } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index c91c7a7512..20095e4cd3 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -2,7 +2,7 @@ #define Z_EN_ENCOUNT2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnEncount2; 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 b7232a5c45..6c232529e7 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,15 +10,17 @@ #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 "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64draw.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "draw.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -68,10 +70,10 @@ void EnExItem_Init(Actor* thisx, PlayState* play) { this->type = PARAMS_GET_U(this->actor.params, 0, 8); this->unusedParam = PARAMS_GET_U(this->actor.params, 8, 8); PRINTF("\n\n"); - // "What will come out?" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->type); - // "What will come out?" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->unusedParam); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n", "☆☆☆☆☆ What will you get? ☆☆☆☆☆ %d\n") VT_RST, + this->type); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n", "☆☆☆☆☆ What will you get? ☆☆☆☆☆ %d\n") VT_RST, + this->unusedParam); this->initPos = this->actor.world.pos; this->getItemObjectId = -1; switch (this->type) { @@ -120,10 +122,9 @@ void EnExItem_Init(Actor* thisx, PlayState* play) { this->actor.draw = NULL; if (this->requiredObjectSlot < 0) { Actor_Kill(&this->actor); - // "What?" - PRINTF("なにみの? %d\n", this->actor.params); - // "bank is funny" - PRINTF(VT_FGCOL(MAGENTA) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params); + PRINTF(T("なにみの? %d\n", "What? %d\n"), this->actor.params); + PRINTF(VT_FGCOL(MAGENTA) T(" バンクおかしいしぞ!%d\n", " The bank is weird!%d\n") VT_RST "\n", + this->actor.params); return; } this->actionFunc = EnExItem_WaitForObject; @@ -134,12 +135,16 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { s32 onCounter; if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { - // "End of transfer" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - PRINTF(VT_FGCOL(BLUE) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Transfer completed ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Transfer completed ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(BLUE) T("☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Transfer completed ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Transfer completed ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n\n", "☆☆☆☆☆ Transfer completed ☆☆☆☆☆ %d\n\n") VT_RST, + this->actor.params); this->actor.objectSlot = this->requiredObjectSlot; this->actor.draw = EnExItem_Draw; this->stopRotate = false; @@ -313,14 +318,13 @@ void EnExItem_BowlPrize(EnExItem* this, PlayState* play) { this->actor.world.pos.z += (tmpf3 / tmpf4) * 5.0f; } } else { - // "parent" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 母親ー? ☆☆☆☆☆ %x\n" VT_RST, this->actor.parent); - // "Can it move?" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 動いてねー? ☆☆☆☆☆ %x\n" VT_RST, this->actor.parent->update); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 母親ー? ☆☆☆☆☆ %x\n", " ☆☆☆☆☆ Mother? ☆☆☆☆☆ %x\n") VT_RST, + this->actor.parent); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 動いてねー? ☆☆☆☆☆ %x\n", " ☆☆☆☆☆ Is it moving? ☆☆☆☆☆ %x\n") VT_RST, + this->actor.parent->update); if ((this->actor.parent != NULL) && (this->actor.parent->update != NULL)) { ((EnBomBowlPit*)this->actor.parent)->exItemDone = 1; - // "It can't move!" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ さぁきえるぞ! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ さぁきえるぞ! ☆☆☆☆☆ \n", " ☆☆☆☆☆ Now it's gone! ☆☆☆☆☆ \n") VT_RST); } Actor_Kill(&this->actor); } @@ -425,8 +429,7 @@ void EnExItem_TargetPrizeGive(EnExItem* this, PlayState* play) { void EnExItem_TargetPrizeFinish(EnExItem* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - // "Successful completion" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n", "☆☆☆☆☆ Normal termination ☆☆☆☆☆ \n") VT_RST); SET_ITEMGETINF(ITEMGETINF_1D); Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h index eba20bc116..1783672579 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h @@ -2,7 +2,7 @@ #define Z_EN_EX_ITEM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnExItem; 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 88e2d884c2..c9dd249402 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 @@ -4,16 +4,18 @@ #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 "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -62,8 +64,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { s16 temp3; this->type = this->actor.params; - // "Index" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Index ☆☆☆☆☆ %x\n") VT_RST, this->type); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); switch (this->type) { @@ -133,8 +134,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { this->colorIdx = (s16)Rand_ZeroFloat(3.99f) + 1; } this->actor.gravity = -3.0f; - // "Wow Coin" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n", "☆☆☆☆☆ Wow Coin ☆☆☆☆☆ \n") VT_RST); this->actor.shape.shadowScale = 6.0f; this->actor.shape.yOffset = 700.0f; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; @@ -155,8 +155,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { break; } this->actor.gravity = -3.0f; - // "Normal rupee" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n", "☆☆☆☆☆ Normal rupee ☆☆☆☆☆ \n") VT_RST); this->actor.shape.shadowScale = 6.0f; this->actor.shape.yOffset = 700.0f; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; @@ -341,10 +340,10 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, PlayState* play) { parent->unk_226 = 1; } } else { - // "That idiot! error" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ そ、そんなばかな!エラー!!!!! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ そ、そんなばかな!エラー!!!!! ☆☆☆☆☆ \n", + "☆☆☆☆☆ That's stupid! Error!!!!! ☆☆☆☆☆ \n") VT_RST); } - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ バカめ! ☆☆☆☆☆ \n" VT_RST); // "Stupid!" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ バカめ! ☆☆☆☆☆ \n", "☆☆☆☆☆ Stupid! ☆☆☆☆☆ \n") VT_RST); explosionScale = 100; explosionScaleStep = 30; if (this->type == 2) { 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 7ba20450e8..1e3b6ece87 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,7 +2,7 @@ #define Z_EN_EX_RUPPY_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnExRuppy; 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 26848dd956..8050aef560 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -16,9 +16,9 @@ #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64player.h" +#include "audio.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_fw/object_fw.h" @@ -244,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); } @@ -684,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 3fc40a54cf..81774fac66 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.h +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.h @@ -2,7 +2,7 @@ #define Z_EN_FD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnFd; 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 815d8c654d..a26b54a64a 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,12 +1,13 @@ #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 "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 d027a07972..3100b31e72 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,7 +2,7 @@ #define Z_EN_FD_FIRE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnFdFire; 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 308c9f5137..793f6a5e82 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 @@ -14,15 +14,17 @@ #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 "translation.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_fhg/object_fhg.h" @@ -134,9 +136,9 @@ void EnFhgFire_Init(Actor* thisx, PlayState* play) { this->collider.dim.height = this->actor.world.rot.x * 0.13f; this->collider.dim.yShift = 0; } else if (this->actor.params == FHGFIRE_SPEAR_LIGHT) { - PRINTF("yari hikari ct 1\n"); // "light spear" + PRINTF(T("yari hikari ct 1\n", "spear light ct 1\n")); EnFhgFire_SetUpdate(this, EnFhgFire_SpearLight); - PRINTF("yari hikari ct 2\n"); + PRINTF(T("yari hikari ct 2\n", "spear light ct 2\n")); this->work[FHGFIRE_TIMER] = this->actor.world.rot.x; this->work[FHGFIRE_FIRE_MODE] = this->actor.world.rot.y; } else if ((this->actor.params == FHGFIRE_WARP_EMERGE) || (this->actor.params == FHGFIRE_WARP_RETREAT) || @@ -654,8 +656,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { this->actor.speed = 20.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_FIRE - SFX_FLAG); - // "Why ah ah ah ah" - PRINTF("なぜだああああああああ %d\n", this->work[FHGFIRE_VARIANCE_TIMER]); + PRINTF(T("なぜだああああああああ %d\n", "Whyyyyyyyy %d\n"), this->work[FHGFIRE_VARIANCE_TIMER]); } } 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 59136f7dfd..fbdb9d8c62 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,8 +2,8 @@ #define Z_EN_FHG_FIRE_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnFhgFire; 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 f9af6f916d..f07d0ac868 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,16 +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 "translation.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "debug_display.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_efc_star_field/object_efc_star_field.h" @@ -99,16 +101,14 @@ void EnFireRock_Init(Actor* thisx, PlayState* play) { switch (this->type) { case FIRE_ROCK_CEILING_SPOT_SPAWNER: this->actor.draw = NULL; - // "☆☆☆☆☆ ceiling waiting rock ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 天井待ち岩 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 天井待ち岩 ☆☆☆☆☆ \n", "☆☆☆☆☆ ceiling waiting rock ☆☆☆☆☆ \n") VT_RST); this->actionFunc = FireRock_WaitSpawnRocksFromCeiling; break; case FIRE_ROCK_ON_FLOOR: Actor_SetScale(&this->actor, 0.03f); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80A12CCC); - // "☆☆☆☆☆ floor rock ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 床岩 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 床岩 ☆☆☆☆☆ \n", "☆☆☆☆☆ floor rock ☆☆☆☆☆ \n") VT_RST); this->collider.dim.radius = 23; this->collider.dim.height = 37; this->collider.dim.yShift = -10; @@ -153,8 +153,8 @@ void EnFireRock_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnFireRock_Fall; break; default: - // "☆☆☆☆☆ No such rock! ERR !!!!!! ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ そんな岩はねぇ!ERR!!!!!! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ そんな岩はねぇ!ERR!!!!!! ☆☆☆☆☆ \n", "☆☆☆☆☆ No such rock! ERR!!!!!! ☆☆☆☆☆ \n") VT_RST); Actor_Kill(&this->actor); break; } @@ -168,8 +168,9 @@ void EnFireRock_Destroy(Actor* thisx, PlayState* play) { if ((spawner->actor.update != NULL) && (spawner->numSpawnedRocks > 0)) { spawner->numSpawnedRocks--; PRINTF("\n\n"); - // "☆☆☆☆☆ Number of spawned instances recovery ☆☆☆☆☆%d" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発生数回復 ☆☆☆☆☆%d\n" VT_RST, spawner->numSpawnedRocks); + PRINTF(VT_FGCOL(GREEN) + T("☆☆☆☆☆ 発生数回復 ☆☆☆☆☆%d\n", "☆☆☆☆☆ Number of spawned instances recovery ☆☆☆☆☆%d\n") VT_RST, + spawner->numSpawnedRocks); PRINTF("\n\n"); } } @@ -269,7 +270,7 @@ void EnFireRock_SpawnMoreBrokenPieces(EnFireRock* this, PlayState* play) { } spawnedFireRock->scale = this->scale - 0.01f; } else { - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ イッパイデッス ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ イッパイデッス ☆☆☆☆☆ \n", "☆☆☆☆☆ It's full ☆☆☆☆☆ \n") VT_RST); } } Actor_PlaySfx(&this->actor, NA_SE_EN_VALVAISA_ROCK); @@ -290,7 +291,7 @@ void FireRock_WaitSpawnRocksFromCeiling(EnFireRock* this, PlayState* play) { if (spawnedFireRock != NULL) { spawnedFireRock->timer = 10; } else { - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ イッパイデッス ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ イッパイデッス ☆☆☆☆☆ \n", "☆☆☆☆☆ It's full ☆☆☆☆☆ \n") VT_RST); } } this->playerNearby = 1; @@ -368,8 +369,8 @@ void EnFireRock_Update(Actor* thisx, PlayState* play) { thisx->velocity.y = 0.0f; thisx->speed = 0.0f; this->actionFunc = EnFireRock_SpawnMoreBrokenPieces; - // "☆☆☆☆☆ Shield Defense Lv1 ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ シールド防御 Lv1 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ シールド防御 Lv1 ☆☆☆☆☆ \n", "☆☆☆☆☆ Shield Defense Lv1 ☆☆☆☆☆ \n") + VT_RST); return; } setCollision = true; diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h index 9b88eaa2c0..0bd9ab2e65 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h @@ -2,7 +2,7 @@ #define Z_EN_FIRE_ROCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_Encount2/z_en_encount2.h" 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 e674ee9bf5..e3df3a19f1 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -17,9 +17,9 @@ #include "versions.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_firefly/object_firefly.h" @@ -637,21 +637,21 @@ void EnFirefly_Combust(EnFirefly* this, PlayState* play) { } void EnFirefly_UpdateDamage(EnFirefly* this, PlayState* play) { - u8 damageEffect; + u8 damageReaction; if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elements[0].base, true); - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } - damageEffect = this->actor.colChkInfo.damageEffect; + damageReaction = this->actor.colChkInfo.damageReaction; - if (damageEffect == 2) { // Din's Fire + if (damageReaction == 2) { // Din's Fire if (this->actor.params == KEESE_ICE_FLY) { this->actor.colChkInfo.health = 0; Enemy_StartFinishingBlow(play, &this->actor); @@ -663,18 +663,18 @@ void EnFirefly_UpdateDamage(EnFirefly* this, PlayState* play) { EnFirefly_SetupFlyIdle(this); } } - } else if (damageEffect == 3) { // Ice Arrows or Ice Magic + } else if (damageReaction == 3) { // Ice Arrows or Ice Magic if (this->actor.params == KEESE_ICE_FLY) { EnFirefly_SetupFall(this); } else { EnFirefly_SetupFrozenFall(this, play); } - } else if (damageEffect == 1) { // Deku Nuts + } else if (damageReaction == 1) { // Deku Nuts if (this->actionFunc != EnFirefly_Stunned) { EnFirefly_SetupStunned(this); } } else { // Fire Arrows - if ((damageEffect == 0xF) && (this->actor.params == KEESE_ICE_FLY)) { + if ((damageReaction == 0xF) && (this->actor.params == KEESE_ICE_FLY)) { EnFirefly_Combust(this, play); } EnFirefly_SetupFall(this); 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 7638036a82..d49e8b1943 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -2,7 +2,7 @@ #define Z_EN_FIREFLY_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnFirefly; 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 6634d2cf2c..ce2cb23937 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -10,12 +10,14 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "sfx.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64item.h" -#include "z64play.h" -#include "z64player.h" +#include "item.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -395,8 +397,8 @@ void EnFish_Dropped_Fall(EnFish* this, PlayState* play) { } else if ((this->timer <= 0) && (this->actor.params == FISH_DROPPED) && (this->actor.floorHeight < BGCHECK_Y_MIN + 10.0f)) { PRINTF_COLOR_WARNING(); - // "BG missing? Running Actor_delete" - PRINTF("BG 抜け? Actor_delete します(%s %d)\n", "../z_en_sakana.c", 822); + PRINTF(T("BG 抜け? Actor_delete します(%s %d)\n", "BG missing? Running Actor_delete (%s %d)\n"), + "../z_en_sakana.c", 822); PRINTF_RST(); Actor_Kill(&this->actor); } @@ -638,9 +640,9 @@ void EnFish_UpdateCutscene(EnFish* this, PlayState* play) { if (play) {} if (cue == NULL) { - // "Warning : DEMO ended without dousa (action) 3 termination being called" - PRINTF("Warning : dousa 3 消滅 が呼ばれずにデモが終了した(%s %d)(arg_data 0x%04x)\n", "../z_en_sakana.c", 1169, - this->actor.params); + PRINTF(T("Warning : dousa 3 消滅 が呼ばれずにデモが終了した(%s %d)(arg_data 0x%04x)\n", + "Warning : Demo ended without action 3 being called (%s %d)(arg_data 0x%04x)\n"), + "../z_en_sakana.c", 1169, this->actor.params); EnFish_ClearCutsceneData(this); Actor_Kill(&this->actor); return; @@ -657,14 +659,13 @@ void EnFish_UpdateCutscene(EnFish* this, PlayState* play) { EnFish_Cutscene_WiggleFlyingThroughAir(this, play); break; case 3: - // "DEMO fish termination" - PRINTF("デモ魚消滅\n"); + PRINTF(T("デモ魚消滅\n", "Demo fish disappearance\n")); EnFish_ClearCutsceneData(this); Actor_Kill(&this->actor); return; default: - // "Improper DEMO action" - PRINTF("不正なデモ動作(%s %d)(arg_data 0x%04x)\n", "../z_en_sakana.c", 1200, this->actor.params); + PRINTF(T("不正なデモ動作(%s %d)(arg_data 0x%04x)\n", "Incorrect demo behavior (%s %d)(arg_data 0x%04x)\n"), + "../z_en_sakana.c", 1200, this->actor.params); break; } 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 d75de5b0a5..8019ff06cb 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.h +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.h @@ -2,7 +2,7 @@ #define Z_EN_FISH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnFish; 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 d365822f59..2c102649c3 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -13,10 +13,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_wallmaster/object_wallmaster.h" @@ -189,8 +189,8 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { void EnFloormas_Destroy(Actor* thisx, PlayState* play) { EnFloormas* this = (EnFloormas*)thisx; - ColliderCylinder* col = &this->collider; - Collider_DestroyCylinder(play, col); + + Collider_DestroyCylinder(play, &this->collider); } void EnFloormas_MakeInvulnerable(EnFloormas* this) { @@ -293,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; @@ -423,7 +423,7 @@ void EnFloormas_SetupRecover(EnFloormas* this) { void EnFloormas_SetupFreeze(EnFloormas* this) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.5f, 0, 20.0f, ANIMMODE_ONCE, -3.0f); this->actor.speed = 0.0f; - if (this->actor.colChkInfo.damageEffect == 4) { + if (this->actor.colChkInfo.damageReaction == 4) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_OPA, 80); } else { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); @@ -992,7 +992,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->collider.base.colMaterial != COL_MATERIAL_HARD) { isSmall = false; if (this->actor.scale.x < 0.01f) { @@ -1000,7 +1000,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { } if (isSmall && this->collider.elem.acHitElem->atDmgInfo.dmgFlags & DMG_HOOKSHOT) { this->actor.colChkInfo.damage = 2; - this->actor.colChkInfo.damageEffect = 0; + this->actor.colChkInfo.damageReaction = 0; } if (Actor_ApplyDamage(&this->actor) == 0) { if (isSmall) { @@ -1014,12 +1014,12 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DAMAGE); } - if ((this->actor.colChkInfo.damageEffect == 4) || (this->actor.colChkInfo.damageEffect == 1)) { + if ((this->actor.colChkInfo.damageReaction == 4) || (this->actor.colChkInfo.damageReaction == 1)) { if (this->actionFunc != EnFloormas_Freeze) { EnFloormas_SetupFreeze(this); } } else { - if (this->actor.colChkInfo.damageEffect == 2) { + if (this->actor.colChkInfo.damageReaction == 2) { EffectSsFCircle_Spawn(play, &this->actor, &this->actor.world.pos, this->actor.scale.x * 4000.0f, this->actor.scale.x * 4000.0f); } 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 4aefd1ad97..7c96d195b6 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h @@ -2,7 +2,7 @@ #define Z_EN_FLOORMAS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" typedef struct EnFloormas EnFloormas; 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 9bfa0c0ff2..17889ad568 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -1,27 +1,28 @@ #include "z_en_fr.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 "translation.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 "global.h" +#include "audio.h" +#include "debug_display.h" +#include "effect.h" +#include "light.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" #include "assets/objects/object_fr/object_fr.h" @@ -269,8 +270,8 @@ void EnFr_Init(Actor* thisx, PlayState* play) { } else { if ((this->actor.params >= 6) || (this->actor.params < 0)) { PRINTF_COLOR_ERROR(); - // "The argument is wrong!!" - PRINTF("%s[%d] : 引数が間違っている!!(%d)\n", "../z_en_fr.c", 370, this->actor.params); + PRINTF(T("%s[%d] : 引数が間違っている!!(%d)\n", "%s[%d] : The argument is wrong!! (%d)\n"), + "../z_en_fr.c", 370, this->actor.params); PRINTF_RST(); ASSERT(0, "0", "../z_en_fr.c", 372); } @@ -279,8 +280,7 @@ void EnFr_Init(Actor* thisx, PlayState* play) { if (this->requiredObjectSlot < 0) { Actor_Kill(&this->actor); PRINTF_COLOR_ERROR(); - // "There is no bank!!" - PRINTF("%s[%d] : バンクが無いよ!!\n", "../z_en_fr.c", 380); + PRINTF(T("%s[%d] : バンクが無いよ!!\n", "%s[%d] : There is no bank!!\n"), "../z_en_fr.c", 380); PRINTF_RST(); ASSERT(0, "0", "../z_en_fr.c", 382); } @@ -1004,8 +1004,7 @@ void EnFr_Deactivate(EnFr* this, PlayState* play) { if (frog == NULL) { PRINTF_COLOR_ERROR(); - // "There are no frogs!?" - PRINTF("%s[%d]カエルがいない!?\n", "../z_en_fr.c", 1604); + PRINTF(T("%s[%d]カエルがいない!?\n", "%s[%d] There are no frogs!?\n"), "../z_en_fr.c", 1604); PRINTF_RST(); return; } else if (frog->isDeactivating != true) { @@ -1018,8 +1017,7 @@ void EnFr_Deactivate(EnFr* this, PlayState* play) { if (frog == NULL) { PRINTF_COLOR_ERROR(); - // "There are no frogs!?" - PRINTF("%s[%d]カエルがいない!?\n", "../z_en_fr.c", 1618); + PRINTF(T("%s[%d]カエルがいない!?\n", "%s[%d] There are no frogs!?\n"), "../z_en_fr.c", 1618); PRINTF_RST(); return; } 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 2bed02b4a0..541fa5ae12 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -2,8 +2,8 @@ #define Z_EN_FR_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnFr; 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 24818477d7..e8cfb6342f 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -12,11 +12,11 @@ #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 "face_reaction.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.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 af90b2cf05..d2138f7613 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -2,7 +2,7 @@ #define Z_EN_FU_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnFu; 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 b9a678d699..9d8b9e5aa3 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -16,8 +16,8 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_fw/object_fw.h" @@ -376,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 b19f967111..6bc847f3c1 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.h +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.h @@ -2,7 +2,7 @@ #define Z_EN_FW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnFw; 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 6ded127aef..fc0c1363bb 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -9,8 +9,8 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_fz/object_fz.h" @@ -356,7 +356,7 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) { this->collider1.base.acFlags &= ~AC_HIT; } else if (this->collider1.base.acFlags & AC_HIT) { this->collider1.base.acFlags &= ~AC_HIT; - switch (this->actor.colChkInfo.damageEffect) { + switch (this->actor.colChkInfo.damageReaction) { case 0xF: Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 8); 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 277e039e2d..891ae41d94 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.h +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.h @@ -2,7 +2,7 @@ #define Z_EN_FZ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnFz; 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 cbc6fff801..bc8c75c255 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 @@ -12,20 +12,22 @@ #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 "translation.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 "audio.h" +#include "debug_display.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_tsubo/object_tsubo.h" @@ -103,22 +105,21 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { this->type = PARAMS_GET_U(this->actor.params, 12, 4); this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); this->numEffects = EN_GSWITCH_EFFECT_COUNT; - // "index" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); - // "save" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ セーブ\t ☆☆☆☆☆ %x\n" VT_RST, this->switchFlag); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Index ☆☆☆☆☆ %x\n") VT_RST, this->type); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ セーブ\t ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Save\t ☆☆☆☆☆ %x\n") VT_RST, this->switchFlag); switch (this->type) { case ENGSWITCH_SILVER_TRACKER: PRINTF("\n\n"); - // "parent switch spawn" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Parent switch spawn ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); sCollectedCount = 0; // Ideally the following two lines would be // this->silverCount = PARAMS_GET_U(this->actor.params, 6, 6); this->silverCount = PARAMS_GET_NOMASK(this->actor.params, 6); this->silverCount &= 0x3F; - // "maximum number of checks" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 最大チェック数 ☆☆☆☆☆ %d\n" VT_RST, this->silverCount); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 最大チェック数 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Maximum number of checks ☆☆☆☆☆ %d\n") + VT_RST, + this->silverCount); PRINTF("\n\n"); if (Flags_GetSwitch(play, this->switchFlag)) { // This is a reference to Hokuto no Ken @@ -130,8 +131,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { break; case ENGSWITCH_SILVER_RUPEE: PRINTF("\n\n"); - // "child switch spawn" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 子スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 子スイッチ発生 ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Child switch spawn ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); this->colorIdx = 5; this->numEffects = 20; Collider_InitCylinder(play, &this->collider); @@ -148,8 +149,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { break; case ENGSWITCH_ARCHERY_POT: PRINTF("\n\n"); - // "Horseback archery destructible pot" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ やぶさめぶち抜き壷 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ やぶさめぶち抜き壷 ☆☆☆☆☆ \n", + "☆☆☆☆☆ Horseback archery destructible pot ☆☆☆☆☆ \n") VT_RST); this->actor.gravity = -3.0f; this->colorIdx = Rand_ZeroFloat(2.99f); Collider_InitCylinder(play, &this->collider); @@ -162,10 +163,9 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, this->objectId); if (this->requiredObjectSlot < 0) { Actor_Kill(&this->actor); - // "what?" - PRINTF(VT_FGCOL(MAGENTA) " なにみの? %d\n" VT_RST "\n", this->requiredObjectSlot); - // "bank is funny" - PRINTF(VT_FGCOL(CYAN) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params); + PRINTF(VT_FGCOL(MAGENTA) T(" なにみの? %d\n", " What? %d\n") VT_RST "\n", this->requiredObjectSlot); + PRINTF(VT_FGCOL(CYAN) T(" バンクおかしいしぞ!%d\n", " Bank is weird! %d\n") VT_RST "\n", + this->actor.params); } this->collider.dim.radius = 24; this->collider.dim.height = 74; @@ -220,7 +220,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; @@ -232,18 +232,18 @@ void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, PlayState* play) { if (this->noteIndex < sCollectedCount) { if (sCollectedCount < 5) { - // "sound?" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n" VT_RST, this->noteIndex); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n", "sound?") VT_RST, this->noteIndex); Audio_PlaySfxTransposed(&gSfxDefaultPos, NA_SE_EV_FIVE_COUNT_LUPY, majorScale[this->noteIndex]); this->noteIndex = sCollectedCount; } } if (sCollectedCount >= this->silverCount) { - // "It is now the end of the century." - // This another reference to Hokuto no Ken. - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 時はまさに世紀末〜 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); - // "Last!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ らすとぉ! ☆☆☆☆☆ \n" VT_RST); + // This is another reference to Hokuto no Ken. + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 時はまさに世紀末〜 ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ It is now the end of the century. ☆☆☆☆☆ %d\n") VT_RST, + this->switchFlag); + PRINTF(VT_FGCOL(GREEN) + T("☆☆☆☆☆ らすとぉ! ☆☆☆☆☆ \n", "☆☆☆☆☆ Last! ☆☆☆☆☆ \n") VT_RST); if ((play->sceneId == SCENE_GERUDO_TRAINING_GROUND) && (this->actor.room == 2)) { Flags_SetTempClear(play, this->actor.room); } else { @@ -366,8 +366,9 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, PlayState* play) { gallery->targetState[this->index] = ENSYATEKIHIT_HIT; Sfx_PlaySfxCentered(NA_SE_EV_HIT_SOUND); Sfx_PlaySfxCentered(NA_SE_SY_GET_RUPY); - // "Yeah !" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ いぇぇーす!HIT!! ☆☆☆☆☆ %d\n" VT_RST, gallery->hitCount); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ いぇぇーす!HIT!! ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Yeah! HIT!! ☆☆☆☆☆ %d\n") + VT_RST, + gallery->hitCount); EnGSwitch_Break(this, play); this->killTimer = 50; this->broken = true; 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 c680fb1440..85f77284d5 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,7 +2,7 @@ #define Z_EN_G_SWITCH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGSwitch; 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..c7f32b7bd7 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,13 +6,15 @@ #include "z_en_ganon_mant.h" +#include "array_count.h" #include "gfx.h" #include "rand.h" #include "segmented_address.h" #include "sys_math.h" #include "sys_matrix.h" +#include "tex_len.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" @@ -101,12 +103,39 @@ static u16 sVerticesMap[GANON_MANT_NUM_STRANDS * GANON_MANT_NUM_JOINTS] = { MAP_STRAND_TO_VTX(3), MAP_STRAND_TO_VTX(2), MAP_STRAND_TO_VTX(1), MAP_STRAND_TO_VTX(0), }; -#define MANT_TEX_WIDTH 32 -#define MANT_TEX_HEIGHT 64 - static u64 sForceAlignment = 0; -#include "assets/overlays/ovl_En_Ganon_Mant/ovl_En_Ganon_Mant.c" +#define gMantTex_WIDTH 32 +#define gMantTex_HEIGHT 64 +static u64 gMantTex[TEX_LEN(u64, gMantTex_WIDTH, gMantTex_HEIGHT, 16)] = { +#include "assets/overlays/ovl_En_Ganon_Mant/gMantTex.rgba16.inc.c" +}; + +#define gMantUnusedTex_WIDTH 32 +#define gMantUnusedTex_HEIGHT 32 +static u64 gMantUnusedTex[TEX_LEN(u64, gMantUnusedTex_WIDTH, gMantUnusedTex_HEIGHT, 16)] = { +#include "assets/overlays/ovl_En_Ganon_Mant/gMantUnusedTex.rgba16.inc.c" +}; + +static Vtx gMant1Vtx[] = { +#include "assets/overlays/ovl_En_Ganon_Mant/gMant1Vtx.inc.c" +}; + +static Gfx gMantMaterialDL[11] = { +#include "assets/overlays/ovl_En_Ganon_Mant/gMantMaterialDL.inc.c" +}; + +static Gfx gMantUnusedMaterialDL[11] = { +#include "assets/overlays/ovl_En_Ganon_Mant/gMantUnusedMaterialDL.inc.c" +}; + +static Gfx gMantDL[138] = { +#include "assets/overlays/ovl_En_Ganon_Mant/gMantDL.inc.c" +}; + +static Vtx gMant2Vtx[] = { +#include "assets/overlays/ovl_En_Ganon_Mant/gMant2Vtx.inc.c" +}; void EnGanonMant_Init(Actor* thisx, PlayState* play) { EnGanonMant* this = (EnGanonMant*)thisx; @@ -126,8 +155,8 @@ void EnGanonMant_Tear(EnGanonMant* this) { s16 areaX; s16 areaY; s16 texIdx; - f32 tx = Rand_ZeroFloat(MANT_TEX_WIDTH); - f32 ty = Rand_ZeroFloat(MANT_TEX_HEIGHT); + f32 tx = Rand_ZeroFloat(gMantTex_WIDTH); + f32 ty = Rand_ZeroFloat(gMantTex_HEIGHT); f32 tearAngle = Rand_ZeroFloat(2 * M_PI); f32 tearDirX = sinf(tearAngle); f32 tearDirY = cosf(tearAngle); @@ -136,11 +165,11 @@ void EnGanonMant_Tear(EnGanonMant* this) { s16* tearAreaSizes = shape->tearAreaSizes; for (i = 0; i < count; i++) { - if ((0 <= tx && tx < MANT_TEX_WIDTH) && (0 <= ty && ty < MANT_TEX_HEIGHT)) { + if ((0 <= tx && tx < gMantTex_WIDTH) && (0 <= ty && ty < gMantTex_HEIGHT)) { for (areaX = 0; areaX <= tearAreaSizes[i]; areaX++) { for (areaY = 0; areaY <= tearAreaSizes[i]; areaY++) { - texIdx = (s16)((s16)tx + ((s16)ty * MANT_TEX_WIDTH)) + ((s16)areaX + ((s16)areaY * MANT_TEX_WIDTH)); - if (texIdx >= MANT_TEX_WIDTH * MANT_TEX_HEIGHT) { + texIdx = (s16)((s16)tx + ((s16)ty * gMantTex_WIDTH)) + ((s16)areaX + ((s16)areaY * gMantTex_WIDTH)); + if (texIdx >= gMantTex_WIDTH * gMantTex_HEIGHT) { continue; } ((u16*)gMantTex)[texIdx] = 0; diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h index 61bf1826bc..84d6ecce90 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h @@ -2,7 +2,7 @@ #define Z_EN_GANON_MANT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGanonMant; 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 30f18393a0..6237f84e06 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 @@ -8,8 +8,9 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "sys_matrix.h" -#include "z64play.h" +#include "play_state.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" 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 8d20bee4d3..5e5f4a577c 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 "z64actor.h" +#include "actor.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 0bc9d51d95..ccf8740470 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -7,6 +7,7 @@ #include "z_en_gb.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -15,10 +16,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64light.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ps/object_ps.h" 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 24b7d30560..5f12f4b360 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.h +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.h @@ -2,8 +2,8 @@ #define Z_EN_GB_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnGb; 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 745fa4a493..6d08efd921 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -9,16 +9,18 @@ #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 "translation.h" #include "z_lib.h" -#include "z64face_reaction.h" -#include "z64horse.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "face_reaction.h" +#include "horse.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ge1/object_ge1.h" @@ -146,8 +148,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { case GE1_TYPE_VALLEY_FLOOR: if (LINK_IS_ADULT) { - // "Valley floor Gerudo withdrawal" - PRINTF(VT_FGCOL(CYAN) "谷底 ゲルド 撤退 \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T("谷底 ゲルド 撤退 \n", "Valley floor Gerudo withdrawal \n") VT_RST); Actor_Kill(&this->actor); return; } @@ -162,8 +163,9 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { } this->actor.attentionRangeType = ATTENTION_RANGE_3; this->hairstyle = GE1_HAIR_BOB; - // "Horseback archery Gerudo EVENT_INF(0) =" - PRINTF(VT_FGCOL(CYAN) "やぶさめ ゲルド EVENT_INF(0) = %x\n" VT_RST, gSaveContext.eventInf[0]); + PRINTF(VT_FGCOL(CYAN) + T("やぶさめ ゲルド EVENT_INF(0) = %x\n", "Horseback archery Gerudo EVENT_INF(0) = %x\n") VT_RST, + gSaveContext.eventInf[0]); if (GET_EVENTINF(EVENTINF_HORSES_08)) { this->actionFunc = EnGe1_TalkAfterGame_Archery; 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 6aaaf2ab37..077f0f9cc0 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -2,7 +2,7 @@ #define Z_EN_GE1_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGe1; 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 2ff3ec7b51..c40402d602 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -8,16 +8,18 @@ #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 "translation.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64horse.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "horse.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_gla/object_gla.h" @@ -584,14 +586,12 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (Ge2_DetectPlayerInUpdate(play, this, &this->actor.focus.pos, this->actor.shape.rot.y, this->yDetectRange)) { - // "Discovered!" - PRINTF(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("発見!!!!!!!!!!!!\n", "Discovered!!!!!!!!!!!!\n") VT_RST); EnGe2_SetupCapturePlayer(this, play); } if ((PARAMS_GET_S(this->actor.params, 0, 8) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { - // "Discovered!" - PRINTF(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("発見!!!!!!!!!!!!\n", "Discovered!!!!!!!!!!!!\n") VT_RST); EnGe2_SetupCapturePlayer(this, play); } } 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 b453531040..27094a5833 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h @@ -2,7 +2,7 @@ #define Z_EN_GE2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGe2; 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 5e0783bc30..ad77c01118 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -13,9 +13,9 @@ #include "sys_matrix.h" #include "versions.h" #include "z_lib.h" -#include "z64item.h" -#include "z64play.h" -#include "z64player.h" +#include "item.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_geldb/object_geldb.h" 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 d767ba6d9a..62b9882055 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h @@ -2,7 +2,7 @@ #define Z_EN_GE3_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_GeldB/z_en_geldb.h" struct EnGe3; 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 33b53f4dcd..11850ccdf5 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -17,11 +17,11 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_geldb/object_geldb.h" @@ -99,7 +99,7 @@ ActorProfile En_GeldB_Profile = { /**/ EnGeldB_Draw, }; -static ColliderCylinderInit sBodyCylInit = { +static ColliderCylinderInit sBodyCylinderInit = { { COL_MATERIAL_HIT5, AT_NONE, @@ -177,48 +177,48 @@ static ColliderQuadInit sSwordQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum EnGeldBDamageEffects { - /* 0x0 */ GELDB_DMG_NORMAL, - /* 0x1 */ GELDB_DMG_STUN, - /* 0x6 */ GELDB_DMG_UNK_6 = 0x6, - /* 0xD */ GELDB_DMG_UNK_D = 0xD, - /* 0xE */ GELDB_DMG_UNK_E, - /* 0xF */ GELDB_DMG_FREEZE -} EnGeldBDamageEffects; +typedef enum EnGeldBDamageReaction { + /* 0x0 */ GELDB_DMG_REACT_NORMAL, + /* 0x1 */ GELDB_DMG_REACT_STUN, + /* 0x6 */ GELDB_DMG_REACT_UNK_6 = 0x6, + /* 0xD */ GELDB_DMG_REACT_UNK_D = 0xD, + /* 0xE */ GELDB_DMG_REACT_UNK_E, + /* 0xF */ GELDB_DMG_REACT_FREEZE +} EnGeldBDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, GELDB_DMG_STUN), - /* Deku stick */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Slingshot */ DMG_ENTRY(1, GELDB_DMG_NORMAL), - /* Explosive */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Boomerang */ DMG_ENTRY(0, GELDB_DMG_STUN), - /* Normal arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Hammer swing */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Hookshot */ DMG_ENTRY(0, GELDB_DMG_STUN), - /* Kokiri sword */ DMG_ENTRY(1, GELDB_DMG_NORMAL), - /* Master sword */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Giant's Knife */ DMG_ENTRY(4, GELDB_DMG_NORMAL), - /* Fire arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Ice arrow */ DMG_ENTRY(2, GELDB_DMG_FREEZE), - /* Light arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Unk arrow 1 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Unk arrow 2 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Unk arrow 3 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Fire magic */ DMG_ENTRY(4, GELDB_DMG_UNK_E), - /* Ice magic */ DMG_ENTRY(0, GELDB_DMG_UNK_6), - /* Light magic */ DMG_ENTRY(3, GELDB_DMG_UNK_D), - /* Shield */ DMG_ENTRY(0, GELDB_DMG_NORMAL), - /* Mirror Ray */ DMG_ENTRY(0, GELDB_DMG_NORMAL), - /* Kokiri spin */ DMG_ENTRY(1, GELDB_DMG_NORMAL), - /* Giant spin */ DMG_ENTRY(4, GELDB_DMG_NORMAL), - /* Master spin */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Kokiri jump */ DMG_ENTRY(2, GELDB_DMG_NORMAL), - /* Giant jump */ DMG_ENTRY(8, GELDB_DMG_NORMAL), - /* Master jump */ DMG_ENTRY(4, GELDB_DMG_NORMAL), - /* Unknown 1 */ DMG_ENTRY(4, GELDB_DMG_NORMAL), - /* Unblockable */ DMG_ENTRY(0, GELDB_DMG_NORMAL), - /* Hammer jump */ DMG_ENTRY(4, GELDB_DMG_NORMAL), - /* Unknown 2 */ DMG_ENTRY(0, GELDB_DMG_NORMAL), + /* Deku nut */ DMG_ENTRY(0, GELDB_DMG_REACT_STUN), + /* Deku stick */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Slingshot */ DMG_ENTRY(1, GELDB_DMG_REACT_NORMAL), + /* Explosive */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Boomerang */ DMG_ENTRY(0, GELDB_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Hammer swing */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Hookshot */ DMG_ENTRY(0, GELDB_DMG_REACT_STUN), + /* Kokiri sword */ DMG_ENTRY(1, GELDB_DMG_REACT_NORMAL), + /* Master sword */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Giant's Knife */ DMG_ENTRY(4, GELDB_DMG_REACT_NORMAL), + /* Fire arrow */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Ice arrow */ DMG_ENTRY(2, GELDB_DMG_REACT_FREEZE), + /* Light arrow */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Unk arrow 1 */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Unk arrow 2 */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Unk arrow 3 */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Fire magic */ DMG_ENTRY(4, GELDB_DMG_REACT_UNK_E), + /* Ice magic */ DMG_ENTRY(0, GELDB_DMG_REACT_UNK_6), + /* Light magic */ DMG_ENTRY(3, GELDB_DMG_REACT_UNK_D), + /* Shield */ DMG_ENTRY(0, GELDB_DMG_REACT_NORMAL), + /* Mirror Ray */ DMG_ENTRY(0, GELDB_DMG_REACT_NORMAL), + /* Kokiri spin */ DMG_ENTRY(1, GELDB_DMG_REACT_NORMAL), + /* Giant spin */ DMG_ENTRY(4, GELDB_DMG_REACT_NORMAL), + /* Master spin */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Kokiri jump */ DMG_ENTRY(2, GELDB_DMG_REACT_NORMAL), + /* Giant jump */ DMG_ENTRY(8, GELDB_DMG_REACT_NORMAL), + /* Master jump */ DMG_ENTRY(4, GELDB_DMG_REACT_NORMAL), + /* Unknown 1 */ DMG_ENTRY(4, GELDB_DMG_REACT_NORMAL), + /* Unblockable */ DMG_ENTRY(0, GELDB_DMG_REACT_NORMAL), + /* Hammer jump */ DMG_ENTRY(4, GELDB_DMG_REACT_NORMAL), + /* Unknown 2 */ DMG_ENTRY(0, GELDB_DMG_REACT_NORMAL), }; static InitChainEntry sInitChain[] = { @@ -253,7 +253,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoRedSkel, &gGerudoRedNeutralAnim, this->jointTable, this->morphTable, GELDB_LIMB_MAX); Collider_InitCylinder(play, &this->bodyCollider); - Collider_SetCylinder(play, &this->bodyCollider, thisx, &sBodyCylInit); + Collider_SetCylinder(play, &this->bodyCollider, thisx, &sBodyCylinderInit); Collider_InitTris(play, &this->blockCollider); Collider_SetTris(play, &this->blockCollider, thisx, &sBlockTrisInit, this->blockElements); Collider_InitQuad(play, &this->swordCollider); @@ -1030,10 +1030,10 @@ void EnGeldB_SetupStunned(EnGeldB* this) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } - if ((this->damageEffect != GELDB_DMG_FREEZE) || (this->action == GELDB_SPIN_ATTACK)) { + if ((this->damageReaction != GELDB_DMG_REACT_FREEZE) || (this->action == GELDB_SPIN_ATTACK)) { Animation_PlayOnceSetSpeed(&this->skelAnime, &gGerudoRedDamageAnim, 0.0f); } - if (this->damageEffect == GELDB_DMG_FREEZE) { + if (this->damageReaction == GELDB_DMG_REACT_FREEZE) { this->iceTimer = 36; } Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -1390,12 +1390,12 @@ void EnGeldB_CollisionCheck(EnGeldB* this, PlayState* play) { } else if ((this->bodyCollider.base.acFlags & AC_HIT) && (this->action >= GELDB_READY) && (this->spinAttackState < 2)) { this->bodyCollider.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { - this->damageEffect = this->actor.colChkInfo.damageEffect; + if (this->actor.colChkInfo.damageReaction != GELDB_DMG_REACT_UNK_6) { + this->damageReaction = this->actor.colChkInfo.damageReaction; Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, true); Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH); - if ((this->actor.colChkInfo.damageEffect == GELDB_DMG_STUN) || - (this->actor.colChkInfo.damageEffect == GELDB_DMG_FREEZE)) { + if ((this->actor.colChkInfo.damageReaction == GELDB_DMG_REACT_STUN) || + (this->actor.colChkInfo.damageReaction == GELDB_DMG_REACT_FREEZE)) { if (this->action != GELDB_STUNNED) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(&this->actor); @@ -1429,7 +1429,7 @@ void EnGeldB_Update(Actor* thisx, PlayState* play) { EnGeldB* this = (EnGeldB*)thisx; EnGeldB_CollisionCheck(this, play); - if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { + if (this->actor.colChkInfo.damageReaction != GELDB_DMG_REACT_UNK_6) { Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 30.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | 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 e1a7ff3ea0..a5ce4286b5 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 "z64actor.h" +#include "actor.h" struct EnGeldB; @@ -48,7 +48,7 @@ typedef struct EnGeldB { /* 0x02F8 */ s16 unkTimer; /* 0x02FA */ s16 lookTimer; /* 0x02FC */ s16 iceTimer; - /* 0x02FE */ u8 damageEffect; + /* 0x02FE */ u8 damageReaction; /* 0x0300 */ s32 timer; /* 0x0304 */ f32 approachRate; /* 0x0308 */ char unk_308[4]; 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 08c47da269..4bfe862466 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -6,13 +6,15 @@ #include "z_en_girla.h" +#include "printf.h" #include "rand.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64draw.h" -#include "z64play.h" -#include "z64save.h" +#include "draw.h" +#include "play_state.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) @@ -88,56 +90,56 @@ ActorProfile En_GirlA_Profile = { #if DEBUG_FEATURES static char* sShopItemDescriptions[] = { - "デクの実×5 ", // "Deku nut x5" - "矢×30 ", // "Arrow x30" - "矢×50 ", // "Arrow x50" - "爆弾×5 ", // "bomb" - "デクの実×10 ", // "Deku nut x10" - "デクの棒 ", // "Deku stick" - "爆弾×10 ", // "Bomb x10" - "さかな ", // "Fish" - "赤クスリ ", // "Red medicine" - "緑クスリ ", // "Green medicine" - "青クスリ ", // "Blue medicine" - "巨人のナイフ ", // "Giant knife" - "ハイリアの盾 ", // "Hyria Shield" - "デクの盾 ", // "Deku Shield" - "ゴロンの服 ", // "Goron's clothes" - "ゾ─ラの服 ", // "Zora's clothes" - "回復のハート ", // "Heart of recovery" - "ロンロン牛乳 ", // "Ron Ron milk" - "鶏の卵 ", // "Chicken egg" - "インゴー牛乳 ", // "Ingo milk" - "インゴー卵 ", // "Ingo egg" - "もだえ石 ", // "Modae stone" - "大人の財布 ", // "Adult wallet" - "ハートの欠片 ", // "Heart fragment" - "ボムチュウ ", // "Bombchu" - "ボムチュウ ", // "Bombchu" - "ボムチュウ ", // "Bombchu" - "ボムチュウ ", // "Bombchu" - "ボムチュウ ", // "Bombchu" - "デクのタネ ", // "Deku seeds" - "キータンのお面", // "Ketan's mask" - "こわそなお面 ", // "Scary face" - "ドクロのお面 ", // "Skull mask" - "ウサギずきん ", // "Rabbit hood" - "まことの仮面 ", // "True mask" - "ゾーラのお面 ", // "Zora's mask" - "ゴロンのお面 ", // "Goron's mask" - "ゲルドのお面 ", // "Gerd's mask" + T("デクの実×5 ", "Deku nuts x5 "), + T("矢×30 ", "Arrows x30 "), + T("矢×50 ", "Arrows x50 "), + T("爆弾×5 ", "Bombs x5 "), + T("デクの実×10 ", "Deku nuts x10 "), + T("デクの棒 ", "Deku stick "), + T("爆弾×10 ", "Bombs x10 "), + T("さかな ", "Fish "), + T("赤クスリ ", "Red medicine "), + T("緑クスリ ", "Green medicine"), + T("青クスリ ", "Blue medicine "), + T("巨人のナイフ ", "Giant's knife "), + T("ハイリアの盾 ", "Hylian shield "), + T("デクの盾 ", "Deku shield "), + T("ゴロンの服 ", "Goron clothing"), + T("ゾ─ラの服 ", "Zora's clothes"), + T("回復のハート ", "Heart of recovery"), + T("ロンロン牛乳 ", "Lon Lon milk "), + T("鶏の卵 ", "Chicken egg "), + T("インゴー牛乳 ", "Ingo milk "), + T("インゴー卵 ", "Ingo egg "), + T("もだえ石 ", "Writhing stone"), + T("大人の財布 ", "Adult wallet "), + T("ハートの欠片 ", "Piece of heart"), + T("ボムチュウ ", "Bombchu "), + T("ボムチュウ ", "Bombchu "), + T("ボムチュウ ", "Bombchu "), + T("ボムチュウ ", "Bombchu "), + T("ボムチュウ ", "Bombchu "), + T("デクのタネ ", "Deku seeds "), + T("キータンのお面", "Keaton mask "), + T("こわそなお面 ", "Scary mask "), + T("ドクロのお面 ", "Skull mask "), + T("ウサギずきん ", "Rabbit hood "), + T("まことの仮面 ", "True mask "), + T("ゾーラのお面 ", "Zora's mask "), + T("ゴロンのお面 ", "Goron mask "), + T("ゲルドのお面 ", "Gerudo mask "), "SOLDOUT", - "炎 ", // "Flame" - "虫 ", // "Bugs" - "チョウチョ ", // "Butterfly" - "ポウ ", // "Poe" - "妖精の魂 ", // "Fairy soul" - "矢×10 ", // "Arrow" - "爆弾×20 ", // "Bomb x20" - "爆弾×30 ", // "Bomb x30" - "爆弾×5 ", // "Bomb x5" - "赤クスリ ", // "Red medicine" - "赤クスリ " // "Red medicine" + T("炎 ", "Flame "), + T("虫 ", "Insect "), + T("チョウチョ ", "Butterfly "), + T("ポウ ", "Poe "), + T("妖精の魂 ", "Fairy soul "), + T("矢×10 ", "Arrows x10 "), + T("爆弾×20 ", "Bombs x20 "), + T("爆弾×30 ", "Bombs x30 "), + T("爆弾×5 ", "Bombs x5 "), + T("赤クスリ ", "Red medicine "), + T("赤クスリ ", "Red medicine "), }; #endif @@ -385,12 +387,13 @@ s32 EnGirlA_TryChangeShopItem(EnGirlA* this) { void EnGirlA_InitItem(EnGirlA* this, PlayState* play) { s16 params = this->actor.params; - PRINTF("%s(%2d)初期設定\n", sShopItemDescriptions[params], params); + PRINTF(T("%s(%2d)初期設定\n", "%s(%2d) Initial setup\n"), sShopItemDescriptions[params], params); if ((params >= SI_MAX) && (params < 0)) { Actor_Kill(&this->actor); PRINTF_COLOR_ERROR(); - PRINTF("引数がおかしいよ(arg_data=%d)!!\n", this->actor.params); + PRINTF(T("引数がおかしいよ(arg_data=%d)!!\n", "The arguments are strange (arg_data=%d)!!\n"), + this->actor.params); PRINTF_RST(); ASSERT(0, "0", "../z_en_girlA.c", 1421); return; @@ -401,7 +404,7 @@ void EnGirlA_InitItem(EnGirlA* this, PlayState* play) { if (this->requiredObjectSlot < 0) { Actor_Kill(&this->actor); PRINTF_COLOR_ERROR(); - PRINTF("バンクが無いよ!!(%s)\n", sShopItemDescriptions[params]); + PRINTF(T("バンクが無いよ!!(%s)\n", "There is no bank!! (%s)\n"), sShopItemDescriptions[params]); PRINTF_RST(); ASSERT(0, "0", "../z_en_girlA.c", 1434); return; @@ -416,7 +419,8 @@ void EnGirlA_Init(Actor* thisx, PlayState* play) { EnGirlA_TryChangeShopItem(this); EnGirlA_InitItem(this, play); - PRINTF("%s(%2d)初期設定\n", sShopItemDescriptions[this->actor.params], this->actor.params); + PRINTF(T("%s(%2d)初期設定\n", "%s(%2d) Initial setup\n"), sShopItemDescriptions[this->actor.params], + this->actor.params); } void EnGirlA_Destroy(Actor* thisx, PlayState* play) { 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 504837044e..21439399b5 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -2,7 +2,7 @@ #define Z_EN_GIRLA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGirlA; 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 75bf9b4357..3c0b766413 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -10,13 +10,15 @@ #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 "translation.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_oF1d_map/object_oF1d_map.h" #include "assets/objects/object_gm/object_gm.h" @@ -79,15 +81,14 @@ void EnGm_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); - // "Medi Goron" - PRINTF(VT_FGCOL(GREEN) "%s[%d] : 中ゴロン[%d]" VT_RST "\n", "../z_en_gm.c", 133, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("%s[%d] : 中ゴロン[%d]", "%s[%d] : Medi Goron [%d]") VT_RST "\n", "../z_en_gm.c", 133, + this->actor.params); this->gmObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GM); if (this->gmObjectSlot < 0) { PRINTF_COLOR_ERROR(); - // "There is no model bank! !! (Medi Goron)" - PRINTF("モデル バンクが無いよ!!(中ゴロン)\n"); + PRINTF(T("モデル バンクが無いよ!!(中ゴロン)\n", "There is no model bank!! (Medi Goron)\n")); PRINTF_RST(); ASSERT(0, "0", "../z_en_gm.c", 145); } @@ -117,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; @@ -286,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 d5234bde14..653bd72a59 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -2,7 +2,7 @@ #define Z_EN_GM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGm; 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 ed97935cef..018fb95348 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -15,9 +15,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.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 2187dde960..a5e45755b5 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -2,7 +2,7 @@ #define Z_EN_GO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGo; 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 9c5718e0b3..974b78e103 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -2,6 +2,7 @@ #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" @@ -13,11 +14,11 @@ #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 "audio.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.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_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h index e2e4ea77bd..4897283db2 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -2,7 +2,7 @@ #define Z_EN_GO2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_Go/z_en_go.h" struct EnGo2; 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 82175795bd..d13c4a85f8 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -18,9 +18,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "assets/objects/object_gol/object_gol.h" 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 6b2f7cf309..04a14e9a7e 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 "z64actor.h" +#include "actor.h" typedef enum GomaType { /* 0 */ ENGOMA_NORMAL, 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 bf25b3bc5d..06e1dae817 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -9,6 +9,7 @@ #include "libc64/qrand.h" #include "ichain.h" +#include "printf.h" #include "quake.h" #include "regs.h" #include "segmented_address.h" @@ -16,10 +17,11 @@ #include "sys_math3d.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_goroiwa/object_goroiwa.h" @@ -267,8 +269,7 @@ s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { if (nextPointPos->x == currentPointPos->x && nextPointPos->z == currentPointPos->z) { #if DEBUG_FEATURES if (nextPointPos->y == currentPointPos->y) { - // "Error: Invalid path data (points overlap)" - PRINTF("Error : レールデータ不正(点が重なっている)"); + PRINTF(T("Error : レールデータ不正(点が重なっている)", "Error : Rail data is incorrect (dots overlap)")); PRINTF("(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 559, this->actor.params); } #endif @@ -563,14 +564,15 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_InitCollider(this, play); pathIdx = PARAMS_GET_U(this->actor.params, 0, 8); if (pathIdx == 0xFF) { - // "Error: Invalid arg_data" - PRINTF("Error : arg_data が不正(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 1033, this->actor.params); + PRINTF(T("Error : arg_data が不正(%s %d)(arg_data 0x%04x)\n", + "Error : Invalid arg_data (%s %d)(arg_data 0x%04x)\n"), + "../z_en_gr.c", 1033, this->actor.params); Actor_Kill(&this->actor); return; } if (play->pathList[pathIdx].count < 2) { - // "Error: Invalid Path Data" - PRINTF("Error : レールデータ が不正(%s %d)\n", "../z_en_gr.c", 1043); + PRINTF(T("Error : レールデータ が不正(%s %d)\n", "Error : Rail data is invalid (%s %d)\n"), "../z_en_gr.c", + 1043); Actor_Kill(&this->actor); return; } @@ -584,9 +586,9 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_InitRotation(this); EnGoroiwa_FaceNextWaypoint(this, play); EnGoroiwa_SetupRoll(this); - // "(Goroiwa)" - PRINTF("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, - PARAMS_GET_U(this->actor.params, 0, 8), PARAMS_GET_U(this->actor.params, 8, 2), + PRINTF(T("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", + "(Goroiwa)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n"), + this->actor.params, PARAMS_GET_U(this->actor.params, 0, 8), PARAMS_GET_U(this->actor.params, 8, 2), PARAMS_GET_U(this->actor.params, 10, 1), this->actor.home.rot.z & 1); } @@ -624,7 +626,7 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { } Actor_SetPlayerKnockbackLarge(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); PRINTF_COLOR_CYAN(); - PRINTF("Player ぶっ飛ばし\n"); // "Player knocked down" + PRINTF(T("Player ぶっ飛ばし\n", "Player knocked down\n")); PRINTF_RST(); onHitSetupFuncs[PARAMS_GET_U(this->actor.params, 10, 1)](this); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); 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 26a5810a2d..805e13ef00 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h @@ -2,7 +2,7 @@ #define Z_EN_GOROIWA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGoroiwa; 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 4e590217f0..77db13b027 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -15,10 +15,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64ocarina.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_gs/object_gs.h" @@ -544,7 +544,7 @@ void EnGs_Update(Actor* thisx, PlayState* play2) { this->unk_19F = 0; this->collider.base.acFlags &= ~AC_HIT; - switch (this->actor.colChkInfo.damageEffect) { + switch (this->actor.colChkInfo.damageReaction) { case 15: this->unk_19E |= 1; func_80A4F77C(this); 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 d7abdc676f..45503245f8 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -2,7 +2,7 @@ #define Z_EN_GS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGs; 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 117f891c10..9dd16fe237 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -9,14 +9,16 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_os_anime/object_os_anime.h" #include "assets/objects/object_boj/object_boj.h" @@ -70,8 +72,7 @@ void EnGuest_Init(Actor* thisx, PlayState* play) { this->osAnimeObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OS_ANIME); if (this->osAnimeObjectSlot < 0) { PRINTF_COLOR_ERROR(); - // "No such bank!!" - PRINTF("%s[%d] : バンクが無いよ!!\n", "../z_en_guest.c", 129); + PRINTF(T("%s[%d] : バンクが無いよ!!\n", "%s[%d] : There is no bank!!\n"), "../z_en_guest.c", 129); PRINTF_RST(); ASSERT(0, "0", "../z_en_guest.c", 132); } @@ -93,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); @@ -171,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 92dbc72d5c..e7e2395437 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.h +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.h @@ -2,7 +2,7 @@ #define Z_EN_GUEST_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnGuest; 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 27cd1341ce..2b4133c39f 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -12,7 +12,7 @@ #include "rand.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hata/object_hata.h" 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 82f6ba1a8b..53d31bab58 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 "z64actor.h" +#include "actor.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 7f5af16a74..e377c17ae5 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -7,20 +7,23 @@ #include "z_en_heishi1.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 "translation.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "debug_display.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_sd/object_sd.h" @@ -95,27 +98,33 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play2) { this->animParams[i] = sAnimParamsInit[this->type][i]; } - // "type" - PRINTF(VT_FGCOL(GREEN) " 種類☆☆☆☆☆☆☆☆☆☆☆☆☆ %d\n" VT_RST, this->type); - // "path data" - PRINTF(VT_FGCOL(YELLOW) " れえるでぇたぁ☆☆☆☆☆☆☆☆ %d\n" VT_RST, this->path); + PRINTF(VT_FGCOL(GREEN) T(" 種類☆☆☆☆☆☆☆☆☆☆☆☆☆ %d\n", " type ☆☆☆☆☆☆☆☆☆☆☆☆☆ %d\n") VT_RST, + this->type); + PRINTF(VT_FGCOL(YELLOW) T(" れえるでぇたぁ☆☆☆☆☆☆☆☆ %d\n", " rail data ☆☆☆☆☆☆☆☆ %d\n") VT_RST, + this->path); PRINTF(VT_FGCOL(MAGENTA) " anime_frame_speed ☆☆☆☆☆☆ %f\n" VT_RST, this->animSpeed); - // "interpolation frame" - PRINTF(VT_FGCOL(MAGENTA) " 補間フレーム☆☆☆☆☆☆☆☆☆ %f\n" VT_RST, this->animMorphFrames); - // "targeted movement speed value between points" - PRINTF(VT_FGCOL(MAGENTA) " point間の移動スピード目標値 ☆ %f\n" VT_RST, this->moveSpeedTarget); - // "maximum movement speed value between points" - PRINTF(VT_FGCOL(MAGENTA) " point間の移動スピード最大 ☆☆ %f\n" VT_RST, this->moveSpeedMax); - // "(body) targeted turning angle speed value" - PRINTF(VT_FGCOL(MAGENTA) " (体)反転アングルスピード目標値 %f\n" VT_RST, this->bodyTurnSpeedTarget); - // "(body) maximum turning angle speed" - PRINTF(VT_FGCOL(MAGENTA) " (体)反転アングルスピード最大☆ %f\n" VT_RST, this->bodyTurnSpeedMax); - // "(head) targeted turning angle speed value" - PRINTF(VT_FGCOL(MAGENTA) " (頭)反転アングルスピード加算値 %f\n" VT_RST, this->headTurnSpeedScale); - // "(head) maximum turning angle speed" - PRINTF(VT_FGCOL(MAGENTA) " (頭)反転アングルスピード最大☆ %f\n" VT_RST, this->headTurnSpeedMax); - PRINTF(VT_FGCOL(GREEN) " 今時間 %d\n" VT_RST, ((void)0, gSaveContext.save.dayTime)); // "current time" - PRINTF(VT_FGCOL(YELLOW) " チェック時間 %d\n" VT_RST, CLOCK_TIME(17, 30) - 1); // "check time" + PRINTF(VT_FGCOL(MAGENTA) T(" 補間フレーム☆☆☆☆☆☆☆☆☆ %f\n", " interpolation frame ☆☆☆☆☆☆☆☆☆ %f\n") VT_RST, + this->animMorphFrames); + PRINTF(VT_FGCOL(MAGENTA) + T(" point間の移動スピード目標値 ☆ %f\n", " target speed of movement between points ☆ %f\n") VT_RST, + this->moveSpeedTarget); + PRINTF(VT_FGCOL(MAGENTA) + T(" point間の移動スピード最大 ☆☆ %f\n", " maximum speed of movement between points ☆☆ %f\n") VT_RST, + this->moveSpeedMax); + PRINTF(VT_FGCOL(MAGENTA) + T(" (体)反転アングルスピード目標値 %f\n", " (body) reversing angle speed target value %f\n") VT_RST, + this->bodyTurnSpeedTarget); + PRINTF(VT_FGCOL(MAGENTA) + T(" (体)反転アングルスピード最大☆ %f\n", " (body) maximum turning angle speed ☆ %f\n") VT_RST, + this->bodyTurnSpeedMax); + PRINTF(VT_FGCOL(MAGENTA) + T(" (頭)反転アングルスピード加算値 %f\n", " (head) reverse angle speed additional value %f\n") VT_RST, + this->headTurnSpeedScale); + PRINTF(VT_FGCOL(MAGENTA) + T(" (頭)反転アングルスピード最大☆ %f\n", " (head) maximum turning angle speed ☆ %f\n") VT_RST, + this->headTurnSpeedMax); + PRINTF(VT_FGCOL(GREEN) T(" 今時間 %d\n", " Current time %d\n") VT_RST, ((void)0, gSaveContext.save.dayTime)); + PRINTF(VT_FGCOL(YELLOW) T(" チェック時間 %d\n", " Check time %d\n") VT_RST, CLOCK_TIME(17, 30) - 1); PRINTF("\n\n"); if (this->path == 3) { @@ -199,11 +208,11 @@ void EnHeishi1_Walk(EnHeishi1* this, PlayState* play) { Math_ApproachF(&this->headAngle, this->headAngleTarget, this->headTurnSpeedScale, this->headTurnSpeedMax); if (DEBUG_FEATURES && (this->path == BREG(1)) && (BREG(0) != 0)) { - PRINTF(VT_FGCOL(RED) " 種類 %d\n" VT_RST, this->path); - PRINTF(VT_FGCOL(RED) " ぱす %d\n" VT_RST, this->waypoint); - PRINTF(VT_FGCOL(RED) " 反転 %d\n" VT_RST, this->bodyTurnSpeed); - PRINTF(VT_FGCOL(RED) " 時間 %d\n" VT_RST, this->waypointTimer); - PRINTF(VT_FGCOL(RED) " 点座 %d\n" VT_RST, path->count); + PRINTF(VT_FGCOL(RED) T(" 種類 %d\n", " Type %d\n") VT_RST, this->path); + PRINTF(VT_FGCOL(RED) T(" ぱす %d\n", " Path %d\n") VT_RST, this->waypoint); + PRINTF(VT_FGCOL(RED) T(" 反転 %d\n", " Turning around %d\n") VT_RST, this->bodyTurnSpeed); + PRINTF(VT_FGCOL(RED) T(" 時間 %d\n", " Time %d\n") VT_RST, this->waypointTimer); + PRINTF(VT_FGCOL(RED) T(" 点座 %d\n", " Tenza %d\n") VT_RST, path->count); PRINTF("\n\n"); } @@ -317,10 +326,10 @@ void EnHeishi1_Wait(EnHeishi1* this, PlayState* play) { this->headTurnSpeedMax + this->headTurnSpeedMax); if (DEBUG_FEATURES && (this->path == BREG(1)) && (BREG(0) != 0)) { - PRINTF(VT_FGCOL(GREEN) " 種類 %d\n" VT_RST, this->path); - PRINTF(VT_FGCOL(GREEN) " ぱす %d\n" VT_RST, this->waypoint); - PRINTF(VT_FGCOL(GREEN) " 反転 %d\n" VT_RST, this->bodyTurnSpeed); - PRINTF(VT_FGCOL(GREEN) " 時間 %d\n" VT_RST, this->waypointTimer); + PRINTF(VT_FGCOL(GREEN) T(" 種類 %d\n", " Type %d\n") VT_RST, this->path); + PRINTF(VT_FGCOL(GREEN) T(" ぱす %d\n", " Path %d\n") VT_RST, this->waypoint); + PRINTF(VT_FGCOL(GREEN) T(" 反転 %d\n", " Turning around %d\n") VT_RST, this->bodyTurnSpeed); + PRINTF(VT_FGCOL(GREEN) T(" 時間 %d\n", " Time %d\n") VT_RST, this->waypointTimer); PRINTF("\n\n"); } } @@ -387,7 +396,7 @@ void EnHeishi1_WaitNight(EnHeishi1* this, PlayState* play) { if (this->actor.xzDistToPlayer < 100.0f) { Message_StartTextbox(play, 0x702D, &this->actor); Sfx_PlaySfxCentered(NA_SE_SY_FOUND); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); // "Discovered!" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発見! ☆☆☆☆☆ \n", "☆☆☆☆☆ Discovered! ☆☆☆☆☆ \n") VT_RST); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); this->actionFunc = EnHeishi1_SetupKick; } @@ -470,8 +479,8 @@ void EnHeishi1_Update(Actor* thisx, PlayState* play) { // this 60 unit height check is so the player doesn't get caught when on the upper path if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) { Sfx_PlaySfxCentered(NA_SE_SY_FOUND); - // "Discovered!" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発見! ☆☆☆☆☆ \n", "☆☆☆☆☆ Discovered! ☆☆☆☆☆ \n") + VT_RST); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); sPlayerIsCaught = true; this->actionFunc = EnHeishi1_SetupMoveToLink; 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 bc1837241e..739aeab546 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h @@ -2,7 +2,7 @@ #define Z_EN_HEISHI1_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHeishi1; 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 d9428562fe..3d6a7cb7dc 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -11,15 +11,17 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "rand.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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_sd/object_sd.h" #include "assets/objects/object_link_child/object_link_child.h" @@ -111,8 +113,8 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { } else { PRINTF("\n\n"); - // "No, I'm completely disappointed" (message for when shooting guard window in courtyard) - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ いやー ついうっかり ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) + T(" ☆☆☆☆☆ いやー ついうっかり ☆☆☆☆☆ \n", " ☆☆☆☆☆ Oh, no, I was just careless. ☆☆☆☆☆ \n") VT_RST); Actor_SetScale(&this->actor, 0.02f); @@ -152,8 +154,8 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { break; case 6: PRINTF("\n\n"); - // "Peep hole soldier!" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 覗き穴奥兵士ふぃ〜 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 覗き穴奥兵士ふぃ〜 ☆☆☆☆☆ \n", " ☆☆☆☆☆ Peep hole soldier ☆☆☆☆☆ \n") + VT_RST); Collider_DestroyCylinder(play, collider); this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); this->actionFunc = EnHeishi_DoNothing2; @@ -162,12 +164,14 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { this->unk_2F0 = PARAMS_GET_U(this->actor.params, 8, 8); PRINTF("\n\n"); - // "Soldier Set 2 Completed!" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - // "Identification Completed!" - PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type); - // "Message completed!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n", " ☆☆☆☆☆ Soldier Set 2 Completed! ☆☆☆☆☆ %d\n") + VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T(" ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n", " ☆☆☆☆☆ Identification Completed! ☆☆☆☆☆ %d\n") + VT_RST, + this->type); + PRINTF(VT_FGCOL(MAGENTA) + T(" ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n", " ☆☆☆☆☆ Message completed! ☆☆☆☆☆ %x\n\n") VT_RST, PARAMS_GET_U(this->actor.params, 8, 4)); } } @@ -202,41 +206,39 @@ void func_80A53278(EnHeishi2* this, PlayState* play) { this->unk_300 = TEXT_STATE_DONE; this->actionFunc = func_80A5475C; } else if (GET_EVENTCHKINF(EVENTCHKINF_09) && GET_EVENTCHKINF(EVENTCHKINF_25) && GET_EVENTCHKINF(EVENTCHKINF_37)) { - // "Get all spiritual stones!" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 全部の精霊石GET! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 全部の精霊石GET! ☆☆☆☆☆ \n", " ☆☆☆☆☆ All the spirit stones GET! ☆☆☆☆☆ \n") + VT_RST); this->unk_300 = TEXT_STATE_DONE; this->actor.textId = 0x7006; this->actionFunc = func_80A5475C; } else if (!IS_DAY) { - // "Sleep early for children!" - PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 子供ははやくネロ! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T(" ☆☆☆☆☆ 子供ははやくネロ! ☆☆☆☆☆ \n", " ☆☆☆☆☆ Sleep early for children! ☆☆☆☆☆ \n") + VT_RST); this->unk_300 = TEXT_STATE_DONE; this->actor.textId = 0x7002; this->actionFunc = func_80A5475C; } else if (this->unk_30C != 0) { - // "Anything passes" - PRINTF(VT_FGCOL(BLUE) " ☆☆☆☆☆ なんでも通るよ ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(BLUE) T(" ☆☆☆☆☆ なんでも通るよ ☆☆☆☆☆ \n", " ☆☆☆☆☆ Anything passes ☆☆☆☆☆ \n") VT_RST); this->unk_300 = TEXT_STATE_DONE; this->actor.textId = 0x7099; this->actionFunc = func_80A5475C; } else if (GET_EVENTCHKINF(EVENTCHKINF_RECEIVED_WEIRD_EGG)) { if (this->unk_30E == 0) { - // "Start under the first sleeve!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ 1回目袖の下開始! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) + T(" ☆☆☆☆☆ 1回目袖の下開始! ☆☆☆☆☆ \n", " ☆☆☆☆☆ Start under the first sleeve! ☆☆☆☆☆ \n") VT_RST); this->actor.textId = 0x7071; this->unk_30E = 1; } else { - // "Start under the second sleeve!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ 2回目袖の下開始! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆☆☆☆ 2回目袖の下開始! ☆☆☆☆☆ \n", + " ☆☆☆☆☆ Start under the second sleeve! ☆☆☆☆☆ \n") VT_RST); this->actor.textId = 0x7072; } this->unk_300 = TEXT_STATE_CHOICE; this->actionFunc = func_80A5475C; } else { - // "That's okay" - PRINTF(VT_FGCOL(CYAN) " ☆☆☆☆☆ それはとおらんよぉ ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" ☆☆☆☆☆ それはとおらんよぉ ☆☆☆☆☆ \n", " ☆☆☆☆☆ That won't work ☆☆☆☆☆ \n") VT_RST); this->unk_300 = TEXT_STATE_DONE; this->actor.textId = 0x7029; this->actionFunc = func_80A5475C; @@ -309,8 +311,9 @@ void func_80A53638(EnHeishi2* this, PlayState* play) { break; } } - // "I've come!" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆ きたきたきたぁ! ☆☆☆ %x\n" VT_RST, actor->dyna.actor.next); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆ きたきたきたぁ! ☆☆☆ %x\n", "☆☆☆ It's here, it's here, it's here! ☆☆☆ %x\n") + VT_RST, + actor->dyna.actor.next); this->actionFunc = func_80A5372C; } } @@ -394,8 +397,8 @@ void func_80A5399C(EnHeishi2* this, PlayState* play) { } this->actionFunc = func_80A5475C; } else { - // "I don't know" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ とおしゃしねぇちゅーの ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆☆☆☆ とおしゃしねぇちゅーの ☆☆☆☆☆ \n", " ☆☆☆☆☆ There is no way out ☆☆☆☆☆ \n") + VT_RST); this->actionFunc = func_80A53AD4; } } @@ -476,8 +479,9 @@ void func_80A53D0C(EnHeishi2* this, PlayState* play) { break; } } - // "I've come!" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆ きたきたきたぁ! ☆☆☆ %x\n" VT_RST, gate->dyna.actor.next); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆ きたきたきたぁ! ☆☆☆ %x\n", "☆☆☆ It's here, it's here, it's here! ☆☆☆ %x\n") + VT_RST, + gate->dyna.actor.next); this->actionFunc = func_80A53DF8; } } @@ -678,8 +682,7 @@ void func_80A5455C(EnHeishi2* this, PlayState* play) { bomb->actor.velocity.y = Rand_CenteredFloat(5.0f) + 10.0f; } - // "This is down!" - PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ これでダウンだ! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T(" ☆☆☆☆☆ これでダウンだ! ☆☆☆☆☆ \n", " ☆☆☆☆☆ This is down! ☆☆☆☆☆ \n") VT_RST); this->actionFunc = func_80A546DC; } } 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 3753012bee..30305aeb8b 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h @@ -2,7 +2,7 @@ #define Z_EN_HEISHI2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHeishi2; 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 91ccd4d516..075c5f8cb0 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -8,13 +8,15 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "sfx.h" #include "terminal.h" +#include "translation.h" #include "versions.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_sd/object_sd.h" @@ -86,8 +88,8 @@ void EnHeishi3_Init(Actor* thisx, PlayState* play) { this->actor.attentionRangeType = ATTENTION_RANGE_6; Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - // "Castle Gate Soldier - Power Up" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n", "☆☆☆☆☆ Castle gate soldier power-up ☆☆☆☆☆ \n") + VT_RST); this->actor.gravity = -3.0f; this->actor.focus.pos = this->actor.world.pos; @@ -142,7 +144,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, PlayState* play) { sPlayerCaught = 1; Message_StartTextbox(play, 0x702D, &this->actor); Sfx_PlaySfxCentered(NA_SE_SY_FOUND); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); // "Discovered!" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発見! ☆☆☆☆☆ \n", "☆☆☆☆☆ Discovered! ☆☆☆☆☆ \n") VT_RST); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); #if OOT_PAL_N64 this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED; @@ -173,7 +175,7 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, PlayState* play) { sPlayerCaught = 1; Message_StartTextbox(play, 0x702D, &this->actor); Sfx_PlaySfxCentered(NA_SE_SY_FOUND); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); // "Discovered!" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 発見! ☆☆☆☆☆ \n", "☆☆☆☆☆ Discovered! ☆☆☆☆☆ \n") VT_RST); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_1); #if OOT_PAL_N64 this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED; 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 57eb11c61c..4ed1e47f89 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h @@ -2,7 +2,7 @@ #define Z_EN_HEISHI3_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHeishi3; 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 b139288ba1..ced83c19c4 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -2,11 +2,13 @@ #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 "translation.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_sd/object_sd.h" @@ -103,9 +105,15 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { } this->unk_27C = PARAMS_GET_U(thisx->params, 8, 8); PRINTF("\n\n"); - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, thisx->params); - PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了!\t ☆☆☆☆☆ %d\n" VT_RST, this->type); - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET_U(thisx->params, 8, 4)); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n", " ☆☆☆☆☆ Soldier Set 2 Completed! ☆☆☆☆☆ %d\n") + VT_RST, + thisx->params); + PRINTF(VT_FGCOL(YELLOW) T(" ☆☆☆☆☆ 識別完了!\t ☆☆☆☆☆ %d\n", " ☆☆☆☆☆ Identification Completed!\t ☆☆☆☆☆ %d\n") + VT_RST, + this->type); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n", " ☆☆☆☆☆ Message completed! ☆☆☆☆☆ %x\n\n") + VT_RST, + PARAMS_GET_U(thisx->params, 8, 4)); PRINTF("\n\n"); } @@ -175,7 +183,7 @@ void func_80A56544(EnHeishi4* this, PlayState* play) { Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, -10.0f); if (LINK_AGE_IN_YEARS != YEARS_CHILD) { - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ ぎゃぁ!オトナだー ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ ぎゃぁ!オトナだー ☆☆☆☆☆ \n", " ☆☆☆☆☆ Oh, no! I'm an adult! ☆☆☆☆☆ \n") VT_RST); Actor_Kill(&this->actor); } else { this->actionFunc = func_80A56614; @@ -222,7 +230,8 @@ void func_80A5673C(EnHeishi4* this, PlayState* play) { f32 frames; if (GET_EVENTCHKINF(EVENTCHKINF_45)) { - PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ マスターソード祝入手! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T(" ☆☆☆☆☆ マスターソード祝入手! ☆☆☆☆☆ \n", + " ☆☆☆☆☆ Congratulations on obtaining the Master Sword! ☆☆☆☆☆ \n") VT_RST); Actor_Kill(&this->actor); return; } @@ -235,11 +244,11 @@ void func_80A5673C(EnHeishi4* this, PlayState* play) { this->actor.textId = 0x7007; this->unk_282 = TEXT_STATE_EVENT; this->unk_284 = 1; - PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ デモ開始! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T(" ☆☆☆☆☆ デモ開始! ☆☆☆☆☆ \n", " ☆☆☆☆☆ Demo begins! ☆☆☆☆☆ \n") VT_RST); } else { this->actor.textId = 0x7008; this->unk_282 = TEXT_STATE_DONE; - PRINTF(VT_FGCOL(BLUE) " ☆☆☆☆☆ 返事なし ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(BLUE) T(" ☆☆☆☆☆ 返事なし ☆☆☆☆☆ \n", " ☆☆☆☆☆ No reply ☆☆☆☆☆ \n") VT_RST); } this->actionFunc = func_80A56874; } else { 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 9ab928fe3e..57a2b436dc 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 "z64actor.h" +#include "actor.h" typedef enum Heishi4Type { /* 0x00 */ HEISHI4_AT_KAKARIKO_ENTRANCE, 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 454f83c2d0..72a6fb9d63 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -10,7 +10,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_hintnuts/object_hintnuts.h" 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 a24b387fe1..222c08bd29 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h @@ -2,7 +2,7 @@ #define Z_EN_HINTNUTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHintnuts; 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 c3f8fa40ad..6f9a589458 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -5,9 +5,9 @@ #include "ichain.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -415,7 +415,13 @@ void EnHoll_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); } -#include "assets/overlays/ovl_En_Holl/ovl_En_Holl.c" +static Vtx sPlaneVtx[] = { +#include "assets/overlays/ovl_En_Holl/sPlaneVtx.inc.c" +}; + +static Gfx sPlaneDL[5] = { +#include "assets/overlays/ovl_En_Holl/sPlaneDL.inc.c" +}; void EnHoll_Draw(Actor* thisx, PlayState* play) { EnHoll* this = (EnHoll*)thisx; 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 4a9409373a..f1c8f49ac7 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 "z64actor.h" +#include "actor.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) 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 bdee0a8ad0..2fa5d13382 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -10,15 +10,16 @@ #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 "effect.h" +#include "play_state.h" +#include "player.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 debd2bfb7c..1b78e692fb 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -2,7 +2,7 @@ #define Z_EN_HONOTRAP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHonotrap; 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 08f58dbce2..e3359b4181 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -9,6 +9,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -22,13 +23,13 @@ #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 "audio.h" +#include "effect.h" +#include "horse.h" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "skin_matrix.h" #include "assets/objects/object_horse/object_horse.h" #include "assets/objects/object_hni/object_hni.h" 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 0eed5c001c..db953948fe 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -2,8 +2,8 @@ #define Z_EN_HORSE_H #include "ultra64.h" -#include "z64actor.h" -#include "z64skin.h" +#include "actor.h" +#include "skin.h" typedef enum EnHorseAction { /* 0 */ ENHORSE_ACT_FROZEN, 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 ac1ae2f420..56f09ec2d8 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 @@ -9,15 +9,17 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -318,8 +320,7 @@ void EnHorseGameCheck_FinishMalonRace(EnHorseGameCheckMalonRace* this, PlayState play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST); play->transitionTrigger = TRANS_TRIGGER_START; } else { - // "not supported" - PRINTF("En_HGC_Spot20_Ta_end():対応せず\n"); + PRINTF(T("En_HGC_Spot20_Ta_end():対応せず\n", "En_HGC_Spot20_Ta_end(): not supported\n")); gSaveContext.save.cutsceneIndex = 0; play->nextEntranceIndex = ENTR_LON_LON_RANCH_0; play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST); 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 84ab117216..f3e8cd7d4a 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,7 +2,7 @@ #define Z_EN_HORSE_GAME_CHECK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHorseGameCheckBase; 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 e1991688a1..b5f402ba1d 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 @@ -13,9 +13,9 @@ #include "sfx.h" #include "sys_math3d.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64skin.h" +#include "play_state.h" +#include "player.h" +#include "skin.h" #include "assets/objects/object_horse_ganon/object_horse_ganon.h" 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 473f6cecb4..41a659079b 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,8 +2,8 @@ #define Z_EN_HORSE_GANON_H #include "ultra64.h" -#include "z64actor.h" -#include "z64skin.h" +#include "actor.h" +#include "skin.h" struct EnHorseGanon; 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 7a3307bc05..7e1282d880 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 @@ -6,6 +6,7 @@ #include "z_en_horse_link_child.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -15,12 +16,12 @@ #include "sfx.h" #include "sys_math3d.h" #include "z_lib.h" -#include "z64actor.h" -#include "z64horse.h" -#include "z64player.h" -#include "z64play.h" -#include "z64save.h" -#include "z64skin.h" +#include "actor.h" +#include "horse.h" +#include "player.h" +#include "play_state.h" +#include "save.h" +#include "skin.h" #include "assets/objects/object_horse_link_child/object_horse_link_child.h" 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 a4e9b512d7..54656fb547 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 @@ -2,8 +2,8 @@ #define Z_EN_HORSE_LINK_CHILD_H #include "ultra64.h" -#include "z64actor.h" -#include "z64skin.h" +#include "actor.h" +#include "skin.h" struct EnHorseLinkChild; 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 1ddc46944b..c3713febb6 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 @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -16,10 +17,10 @@ #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 "play_state.h" +#include "save.h" +#include "skin.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_horse_normal/object_horse_normal.h" 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 01ddd44608..06f7237322 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,8 +2,8 @@ #define Z_EN_HORSE_NORMAL_H #include "ultra64.h" -#include "z64actor.h" -#include "z64skin.h" +#include "actor.h" +#include "skin.h" struct EnHorseNormal; 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 059f88c3ae..2906e541cd 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 @@ -7,14 +7,15 @@ #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 "play_state.h" +#include "player.h" #include "assets/objects/object_horse_zelda/object_horse_zelda.h" 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 86b851c77b..353e09d6ec 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,8 +2,8 @@ #define Z_EN_HORSE_ZELDA_H #include "ultra64.h" -#include "z64actor.h" -#include "z64skin.h" +#include "actor.h" +#include "skin.h" struct EnHorseZelda; 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 88a548a41a..757eab0a77 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -8,13 +8,15 @@ #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 "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_hs/object_hs.h" @@ -84,17 +86,14 @@ void EnHs_Init(Actor* thisx, PlayState* play) { } if (this->actor.params == 1) { - // "chicken shop (adult era)" - PRINTF(VT_FGCOL(CYAN) " ヒヨコの店(大人の時) \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" ヒヨコの店(大人の時) \n", " chicken shop (adult era) \n") VT_RST); func_80A6E3A0(this, func_80A6E9AC); if (GET_ITEMGETINF(ITEMGETINF_30)) { - // "chicken shop closed" - PRINTF(VT_FGCOL(CYAN) " ヒヨコ屋閉店 \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" ヒヨコ屋閉店 \n", " chicken shop closed \n") VT_RST); Actor_Kill(&this->actor); } } else { - // "chicken shop (child era)" - PRINTF(VT_FGCOL(CYAN) " ヒヨコの店(子人の時) \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" ヒヨコの店(子人の時) \n", " chicken shop (child era) \n") VT_RST); func_80A6E3A0(this, func_80A6E9AC); } 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 f938b51518..cf2097c11a 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.h +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.h @@ -2,7 +2,7 @@ #define Z_EN_HS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHs; 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 4914be17ed..453ab7f659 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -8,11 +8,13 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64face_reaction.h" -#include "z64play.h" +#include "face_reaction.h" +#include "play_state.h" #include "assets/objects/object_hs/object_hs.h" @@ -68,7 +70,7 @@ void EnHs2_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); - PRINTF(VT_FGCOL(CYAN) " ヒヨコの店(子人の時) \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" ヒヨコの店(子人の時) \n", " Chick's Shop (Children's Time) \n") VT_RST); this->actionFunc = func_80A6F1A4; this->unk_2A8 = 0; this->actor.attentionRangeType = ATTENTION_RANGE_6; 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 dec1533f89..7732d7b7c2 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h @@ -2,7 +2,7 @@ #define Z_EN_HS2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnHs2; 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 3af23db48b..bcc58becb1 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -15,11 +15,11 @@ #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 "audio.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_aob/object_aob.h" #include "assets/objects/object_ahg/object_ahg.h" @@ -60,7 +60,7 @@ ActorProfile En_Hy_Profile = { /**/ EnHy_Draw, }; -static ColliderCylinderInit sColCylInit = { +static ColliderCylinderInit sColliderCylinderInit = { { COL_MATERIAL_NONE, AT_NONE, @@ -1162,14 +1162,14 @@ 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); + Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit); EnHy_InitCollider(this); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[ENHY_GET_TYPE(&this->actor)].animInfoIndex); @@ -1350,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); @@ -1377,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; @@ -1386,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) { @@ -1423,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 50bdc90933..7a49efb396 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 "z64actor.h" +#include "actor.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) 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 4c230f210b..86e86a8065 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 @@ -10,13 +10,15 @@ #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 "z64item.h" -#include "z64light.h" -#include "z64play.h" -#include "z64player.h" +#include "item.h" +#include "light.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -185,7 +187,7 @@ void EnIceHono_Init(Actor* thisx, PlayState* play) { this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); this->unk_154 = Rand_ZeroOne() * (0x1FFFF / 2.0f); this->unk_156 = Rand_ZeroOne() * (0x1FFFF / 2.0f); - PRINTF("(ice 炎)(arg_data 0x%04x)\n", this->actor.params); // "(ice flame)" + PRINTF(T("(ice 炎)(arg_data 0x%04x)\n", "(ice flame)(arg_data 0x%04x)\n"), this->actor.params); } } @@ -372,7 +374,7 @@ void EnIceHono_Update(Actor* thisx, PlayState* play) { #if DEBUG_FEATURES if ((intensity > 0.7f) || (intensity < 0.2f)) { - PRINTF("ありえない値(ratio = %f)\n", intensity); // "impossible value(ratio = %f)" + PRINTF(T("ありえない値(ratio = %f)\n", "Impossible value (ratio = %f)\n"), intensity); } #endif 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 ea975199aa..8cdef19fbd 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,8 +2,8 @@ #define Z_EN_ICE_HONO_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnIceHono; 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 61573e535f..2dfee076b2 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -7,23 +7,26 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "skin_matrix.h" #include "assets/scenes/dungeons/jyasinboss/jyasinboss_scene.h" #include "assets/objects/object_ik/object_ik.h" @@ -49,13 +52,13 @@ typedef enum EnIkCsDrawMode { /* 0x02 */ IK_CS_DRAW_DEFEAT } EnIkCsDrawMode; -typedef enum EnIkDamageEffect { - /* 0x0 */ EN_IK_DMGEFF_NONE, - /* 0x6 */ EN_IK_DMGEFF_ELEMENTAL_MAGIC = 0x6, - /* 0xD */ EN_IK_DMGEFF_SPARKS_NO_DMG = 0xD, - /* 0xE */ EN_IK_DMGEFF_PROJECTILE, - /* 0xF */ EN_IK_DMGEFF_DAMAGE -} EnIkDamageEffect; +typedef enum EnIkDamageReaction { + /* 0x0 */ EN_IK_DMG_REACT_NONE, + /* 0x6 */ EN_IK_DMG_REACT_ELEMENTAL_MAGIC = 0x6, + /* 0xD */ EN_IK_DMG_REACT_SPARKS_NO_DMG = 0xD, + /* 0xE */ EN_IK_DMG_REACT_PROJECTILE, + /* 0xF */ EN_IK_DMG_REACT_DAMAGE +} EnIkDamageReaction; void EnIk_UpdateEnemy(Actor* thisx, PlayState* play); void EnIk_DrawEnemy(Actor* thisx, PlayState* play); @@ -163,38 +166,38 @@ static ColliderQuadInit sQuadInit = { }; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, EN_IK_DMGEFF_SPARKS_NO_DMG), - /* Deku stick */ DMG_ENTRY(2, EN_IK_DMGEFF_DAMAGE), - /* Slingshot */ DMG_ENTRY(1, EN_IK_DMGEFF_PROJECTILE), - /* Explosive */ DMG_ENTRY(2, EN_IK_DMGEFF_DAMAGE), - /* Boomerang */ DMG_ENTRY(0, EN_IK_DMGEFF_SPARKS_NO_DMG), - /* Normal arrow */ DMG_ENTRY(2, EN_IK_DMGEFF_PROJECTILE), - /* Hammer swing */ DMG_ENTRY(2, EN_IK_DMGEFF_DAMAGE), - /* Hookshot */ DMG_ENTRY(0, EN_IK_DMGEFF_SPARKS_NO_DMG), - /* Kokiri sword */ DMG_ENTRY(1, EN_IK_DMGEFF_DAMAGE), - /* Master sword */ DMG_ENTRY(2, EN_IK_DMGEFF_DAMAGE), - /* Giant's Knife */ DMG_ENTRY(4, EN_IK_DMGEFF_DAMAGE), - /* Fire arrow */ DMG_ENTRY(2, EN_IK_DMGEFF_PROJECTILE), - /* Ice arrow */ DMG_ENTRY(2, EN_IK_DMGEFF_PROJECTILE), - /* Light arrow */ DMG_ENTRY(2, EN_IK_DMGEFF_PROJECTILE), - /* Unk arrow 1 */ DMG_ENTRY(2, EN_IK_DMGEFF_PROJECTILE), - /* Unk arrow 2 */ DMG_ENTRY(2, EN_IK_DMGEFF_PROJECTILE), - /* Unk arrow 3 */ DMG_ENTRY(15, EN_IK_DMGEFF_PROJECTILE), - /* Fire magic */ DMG_ENTRY(0, EN_IK_DMGEFF_ELEMENTAL_MAGIC), - /* Ice magic */ DMG_ENTRY(0, EN_IK_DMGEFF_ELEMENTAL_MAGIC), - /* Light magic */ DMG_ENTRY(0, EN_IK_DMGEFF_ELEMENTAL_MAGIC), - /* Shield */ DMG_ENTRY(0, EN_IK_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, EN_IK_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, EN_IK_DMGEFF_DAMAGE), - /* Giant spin */ DMG_ENTRY(4, EN_IK_DMGEFF_DAMAGE), - /* Master spin */ DMG_ENTRY(2, EN_IK_DMGEFF_DAMAGE), - /* Kokiri jump */ DMG_ENTRY(2, EN_IK_DMGEFF_DAMAGE), - /* Giant jump */ DMG_ENTRY(8, EN_IK_DMGEFF_DAMAGE), - /* Master jump */ DMG_ENTRY(4, EN_IK_DMGEFF_DAMAGE), - /* Unknown 1 */ DMG_ENTRY(10, EN_IK_DMGEFF_DAMAGE), - /* Unblockable */ DMG_ENTRY(0, EN_IK_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, EN_IK_DMGEFF_DAMAGE), - /* Unknown 2 */ DMG_ENTRY(0, EN_IK_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, EN_IK_DMG_REACT_SPARKS_NO_DMG), + /* Deku stick */ DMG_ENTRY(2, EN_IK_DMG_REACT_DAMAGE), + /* Slingshot */ DMG_ENTRY(1, EN_IK_DMG_REACT_PROJECTILE), + /* Explosive */ DMG_ENTRY(2, EN_IK_DMG_REACT_DAMAGE), + /* Boomerang */ DMG_ENTRY(0, EN_IK_DMG_REACT_SPARKS_NO_DMG), + /* Normal arrow */ DMG_ENTRY(2, EN_IK_DMG_REACT_PROJECTILE), + /* Hammer swing */ DMG_ENTRY(2, EN_IK_DMG_REACT_DAMAGE), + /* Hookshot */ DMG_ENTRY(0, EN_IK_DMG_REACT_SPARKS_NO_DMG), + /* Kokiri sword */ DMG_ENTRY(1, EN_IK_DMG_REACT_DAMAGE), + /* Master sword */ DMG_ENTRY(2, EN_IK_DMG_REACT_DAMAGE), + /* Giant's Knife */ DMG_ENTRY(4, EN_IK_DMG_REACT_DAMAGE), + /* Fire arrow */ DMG_ENTRY(2, EN_IK_DMG_REACT_PROJECTILE), + /* Ice arrow */ DMG_ENTRY(2, EN_IK_DMG_REACT_PROJECTILE), + /* Light arrow */ DMG_ENTRY(2, EN_IK_DMG_REACT_PROJECTILE), + /* Unk arrow 1 */ DMG_ENTRY(2, EN_IK_DMG_REACT_PROJECTILE), + /* Unk arrow 2 */ DMG_ENTRY(2, EN_IK_DMG_REACT_PROJECTILE), + /* Unk arrow 3 */ DMG_ENTRY(15, EN_IK_DMG_REACT_PROJECTILE), + /* Fire magic */ DMG_ENTRY(0, EN_IK_DMG_REACT_ELEMENTAL_MAGIC), + /* Ice magic */ DMG_ENTRY(0, EN_IK_DMG_REACT_ELEMENTAL_MAGIC), + /* Light magic */ DMG_ENTRY(0, EN_IK_DMG_REACT_ELEMENTAL_MAGIC), + /* Shield */ DMG_ENTRY(0, EN_IK_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, EN_IK_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, EN_IK_DMG_REACT_DAMAGE), + /* Giant spin */ DMG_ENTRY(4, EN_IK_DMG_REACT_DAMAGE), + /* Master spin */ DMG_ENTRY(2, EN_IK_DMG_REACT_DAMAGE), + /* Kokiri jump */ DMG_ENTRY(2, EN_IK_DMG_REACT_DAMAGE), + /* Giant jump */ DMG_ENTRY(8, EN_IK_DMG_REACT_DAMAGE), + /* Master jump */ DMG_ENTRY(4, EN_IK_DMG_REACT_DAMAGE), + /* Unknown 1 */ DMG_ENTRY(10, EN_IK_DMG_REACT_DAMAGE), + /* Unblockable */ DMG_ENTRY(0, EN_IK_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, EN_IK_DMG_REACT_DAMAGE), + /* Unknown 2 */ DMG_ENTRY(0, EN_IK_DMG_REACT_NONE), }; void EnIk_Destroy(Actor* thisx, PlayState* play) { @@ -225,7 +228,7 @@ void EnIk_InitImpl(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->bodyCollider); Collider_SetCylinder(play, &this->bodyCollider, thisx, &sCylinderInit); Collider_InitTris(play, &this->shieldCollider); - Collider_SetTris(play, &this->shieldCollider, thisx, &sTrisInit, this->shieldColliderItems); + Collider_SetTris(play, &this->shieldCollider, thisx, &sTrisInit, this->shieldColliderElements); Collider_InitQuad(play, &this->axeCollider); Collider_SetQuad(play, &this->axeCollider, thisx, &sQuadInit); @@ -744,19 +747,19 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { } else if (this->bodyCollider.base.acFlags & AC_HIT) { s16 pad; u8 prevHealth; - s32 damageEffect; + s32 damageReaction; Vec3f sparksPos = this->actor.world.pos; sparksPos.y += 50.0f; Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, true); - this->damageEffect = this->actor.colChkInfo.damageEffect; + this->damageReaction = this->actor.colChkInfo.damageReaction; this->bodyCollider.base.acFlags &= ~AC_HIT; - if ((this->damageEffect == EN_IK_DMGEFF_NONE) || (this->damageEffect == EN_IK_DMGEFF_SPARKS_NO_DMG) || - ((this->armorStatusFlag == 0) && (this->damageEffect == EN_IK_DMGEFF_PROJECTILE))) { - if (this->damageEffect != EN_IK_DMGEFF_NONE) { + if ((this->damageReaction == EN_IK_DMG_REACT_NONE) || (this->damageReaction == EN_IK_DMG_REACT_SPARKS_NO_DMG) || + ((this->armorStatusFlag == 0) && (this->damageReaction == EN_IK_DMG_REACT_PROJECTILE))) { + if (this->damageReaction != EN_IK_DMG_REACT_NONE) { // spawn sparks and don't damage CollisionCheck_SpawnShieldParticlesMetal(play, &sparksPos); } @@ -1377,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; @@ -1412,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; } @@ -1506,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 a0ecd34d0f..9ae2a9cee4 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -2,7 +2,7 @@ #define Z_EN_IK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnIk; @@ -99,7 +99,7 @@ typedef struct EnIk { /* 0x02FA */ u8 drawArmorFlag; /* 0x02FB */ u8 armorStatusFlag; /* 0x02FC */ u8 isBreakingProp; - /* 0x02FD */ u8 damageEffect; + /* 0x02FD */ u8 damageReaction; /* 0x02FE */ s8 unk_2FE; /* 0x02FF */ s8 unk_2FF; /* 0x0300 */ s16 unk_300; @@ -109,7 +109,7 @@ typedef struct EnIk { /* 0x0320 */ ColliderCylinder bodyCollider; /* 0x036C */ ColliderQuad axeCollider; /* 0x03EC */ ColliderTris shieldCollider; - /* 0x040C */ ColliderTrisElement shieldColliderItems[2]; + /* 0x040C */ ColliderTrisElement shieldColliderElements[2]; /* 0x04C4 */ s32 blureIdx; /* 0x04C8 */ s32 csAction; /* 0x04CC */ s32 csDrawMode; 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 fec8487235..3fb2a8f5e9 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -2,9 +2,11 @@ #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" @@ -12,11 +14,11 @@ #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 "audio.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_in/object_in.h" 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 00774d0ddb..78d8f89170 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -2,7 +2,7 @@ #define Z_EN_IN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnIn; 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 9135ccd110..dd215680c9 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -11,14 +11,16 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "sfx.h" #include "sys_math3d.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -82,7 +84,7 @@ static ColliderJntSphElementInit sColliderElementsInit[1] = { }, }; -static ColliderJntSphInit sColliderInit = { +static ColliderJntSphInit sColliderJntSphInit = { { COL_MATERIAL_NONE, AT_NONE, @@ -205,7 +207,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->colliderElements); + Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements); this->actor.colChkInfo.mass = 30; @@ -592,8 +594,8 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { } else { if (this->insectFlags & INSECT_FLAG_FOUND_SOIL) { PRINTF_COLOR_WARNING(); - // "warning: target Actor is NULL" - PRINTF("warning:目標 Actor が NULL (%s %d)\n", "../z_en_mushi.c", 1046); + PRINTF(T("warning:目標 Actor が NULL (%s %d)\n", "warning: target Actor is NULL (%s %d)\n"), + "../z_en_mushi.c", 1046); PRINTF_RST(); } distanceSq = 40.0f; @@ -720,8 +722,8 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { (this->insectFlags & INSECT_FLAG_0) && this->lifeTimer <= 0 && this->actionTimer <= 0 && this->actor.floorHeight < BGCHECK_Y_MIN + 10.0f) { PRINTF_COLOR_WARNING(); - // "BG missing? To do Actor_delete" - PRINTF("BG 抜け? Actor_delete します(%s %d)\n", "../z_en_mushi.c", 1197); + PRINTF(T("BG 抜け? Actor_delete します(%s %d)\n", "BG missing? To do Actor_delete (%s %d)\n"), + "../z_en_mushi.c", 1197); PRINTF_RST(); Actor_Kill(&this->actor); } 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 7bf443a2ea..e5e938176a 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -2,7 +2,7 @@ #define Z_EN_INSECT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnInsect; 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 41058b811a..aedb18900b 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -9,20 +9,23 @@ #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 "printf.h" #include "rand.h" #include "rumble.h" #include "sfx.h" #include "sys_matrix.h" #include "quake.h" #include "terminal.h" +#include "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64item.h" -#include "z64play.h" +#include "effect.h" +#include "item.h" +#include "play_state.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" @@ -141,8 +144,7 @@ s32 EnIshi_SnapToFloor(EnIshi* this, PlayState* play, f32 arg2) { return true; } else { PRINTF_COLOR_WARNING(); - // "Failure attaching to ground" - PRINTF("地面に付着失敗(%s %d)\n", "../z_en_ishi.c", 388); + PRINTF(T("地面に付着失敗(%s %d)\n", "Failed to attach to ground (%s %d)\n"), "../z_en_ishi.c", 388); PRINTF_RST(); return false; } 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 731929a384..5139e851b7 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 "z64actor.h" +#include "actor.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. 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 975fe8411f..2faea7fb6e 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -6,7 +6,7 @@ #include "z_en_it.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS 0 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 9f1f794e4f..6d1992ecd6 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 "z64actor.h" +#include "actor.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 3f6b3c587c..917c765c7e 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -14,9 +14,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_jj/object_jj.h" 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 9ac2df8bb4..7b37ee0058 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.h +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.h @@ -2,7 +2,7 @@ #define Z_EN_JJ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnJj; diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj_cutscene_data.inc.c b/src/overlays/actors/ovl_En_Jj/z_en_jj_cutscene_data.inc.c index 0cf56d63e6..35a67d6972 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj_cutscene_data.inc.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj_cutscene_data.inc.c @@ -1,5 +1,5 @@ #include "z_en_jj.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off static CutsceneData gJabuInhalingCs[] = { 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 f5aee34c6a..7e570bdd56 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -11,8 +11,8 @@ #include "regs.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_js/object_js.h" 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 e1e22f547d..8add36574b 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.h +++ b/src/overlays/actors/ovl_En_Js/z_en_js.h @@ -2,7 +2,7 @@ #define Z_EN_JS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnJs; 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 2d0ed48af9..fc3ff48de1 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -7,15 +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 "tex_len.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) @@ -37,13 +39,67 @@ 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]; static s32 sUnused[2] = { 0, 0 }; -#include "assets/overlays/ovl_En_Jsjutan/ovl_En_Jsjutan.c" +#define sCarpetTex_WIDTH 32 +#define sCarpetTex_HEIGHT 64 +static u64 sCarpetTex[TEX_LEN(u64, sCarpetTex_WIDTH, sCarpetTex_HEIGHT, 16)] = { +#include "assets/overlays/ovl_En_Jsjutan/sCarpetTex.rgba16.inc.c" +}; + +static Vtx gShadowOddVtx[] = { +#include "assets/overlays/ovl_En_Jsjutan/gShadowOddVtx.inc.c" +}; + +static Vtx sShadowEvenVtx[] = { +#include "assets/overlays/ovl_En_Jsjutan/sShadowEvenVtx.inc.c" +}; + +static Vtx sCarpetOddVtx[] = { +#include "assets/overlays/ovl_En_Jsjutan/sCarpetOddVtx.inc.c" +}; + +static Gfx sCarpetMaterialDL[16] = { +#include "assets/overlays/ovl_En_Jsjutan/sCarpetMaterialDL.inc.c" +}; + +static Gfx sShadowMaterialDL[14] = { +#include "assets/overlays/ovl_En_Jsjutan/sShadowMaterialDL.inc.c" +}; + +static Gfx sModelDL[134] = { +#include "assets/overlays/ovl_En_Jsjutan/sModelDL.inc.c" +}; + +static Vtx sCarpetEvenVtx[] = { +#include "assets/overlays/ovl_En_Jsjutan/sCarpetEvenVtx.inc.c" +}; + +static BgCamInfo sBgCamList[] = { +#include "assets/overlays/ovl_En_Jsjutan/sBgCamList.inc.c" +}; + +static SurfaceType sSurfaceTypes[] = { +#include "assets/overlays/ovl_En_Jsjutan/sSurfaceTypes.inc.c" +}; + +static CollisionPoly sPolyList[] = { +#include "assets/overlays/ovl_En_Jsjutan/sPolyList.inc.c" +}; + +static Vec3s sVtxList[] = { +#include "assets/overlays/ovl_En_Jsjutan/sVtxList.inc.c" +}; + +static CollisionHeader sCol = { +#include "assets/overlays/ovl_En_Jsjutan/sCol.inc.c" +}; void EnJsjutan_Init(Actor* thisx, PlayState* play) { EnJsjutan* this = (EnJsjutan*)thisx; 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 b6c4b07591..18c3afc26c 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 "z64actor.h" +#include "actor.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 7a38ebc937..71a3eae57f 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -6,18 +6,21 @@ #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 "translation.h" #include "z_lib.h" -#include "z64ocarina.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ka/object_ka.h" @@ -249,8 +252,7 @@ void func_80A8F8D0(EnKakasi* this, PlayState* play) { Player* player = GET_PLAYER(play); if (play->msgCtx.ocarinaMode == OCARINA_MODE_04 && play->msgCtx.msgMode == MSGMODE_NONE) { - // "end?" - PRINTF(VT_FGCOL(BLUE) "☆☆☆☆☆ 終り? ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(BLUE) T("☆☆☆☆☆ 終り? ☆☆☆☆☆ \n", "☆☆☆☆☆ end? ☆☆☆☆☆ \n") VT_RST); if (this->unk_19A != 0) { Message_CloseTextbox(play); @@ -353,8 +355,8 @@ void EnKakasi_Draw(Actor* thisx, PlayState* play) { if (BREG(3) != 0) { PRINTF("\n\n"); - // "flag!" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.save.info.scarecrowLongSongSet); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n", "☆☆☆☆☆ flag! ☆☆☆☆☆ %d\n") VT_RST, + gSaveContext.save.info.scarecrowLongSongSet); } Gfx_SetupDL_25Opa(play->state.gfxCtx); SkelAnime_DrawFlexOpa(play, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount, NULL, 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 c2eff368ca..4e7df38313 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -2,7 +2,7 @@ #define Z_EN_KAKASI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKakasi; 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 d2b70ada73..e4b3dbf9e6 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -8,15 +8,17 @@ #include "gfx_setupdl.h" #include "one_point_cutscene.h" +#include "printf.h" #include "regs.h" #include "sfx.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64ocarina.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "debug_display.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ka/object_ka.h" @@ -74,8 +76,7 @@ void EnKakasi2_Init(Actor* thisx, PlayState* play) { f32 spawnRangeXZ; PRINTF("\n\n"); - // "Visit Umeda" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 梅田参号見参! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 梅田参号見参! ☆☆☆☆☆ \n", "☆☆☆☆☆ Umeda Sangyo visit! ☆☆☆☆☆ \n") VT_RST); this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); spawnRangeY = PARAMS_GET_U(this->actor.params, 6, 8); @@ -87,16 +88,16 @@ void EnKakasi2_Init(Actor* thisx, PlayState* play) { this->maxSpawnDistance.x = (spawnRangeY * 40.0f) + 40.0f; this->maxSpawnDistance.y = (spawnRangeXZ * 40.0f) + 40.0f; - // "Former? (Argument 0)" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元?(引数0) ☆☆☆☆ %f\n" VT_RST, spawnRangeY); - // "Former? (Z angle)" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元?(Zアングル) ☆☆ %f\n" VT_RST, spawnRangeXZ); - // "Correction coordinates X" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 補正座標X ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.x); - // "Correction coordinates Y" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 補正座標Y ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.y); - // "Correction coordinates Z" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 補正座標Z ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.z); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 元?(引数0) ☆☆☆☆ %f\n", "☆☆☆☆☆ Former? (Argument 0) ☆☆☆☆ %f\n") VT_RST, + spawnRangeY); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 元?(Zアングル) ☆☆ %f\n", "☆☆☆☆☆ Former? (Z angle) ☆☆ %f\n") VT_RST, + spawnRangeXZ); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 補正座標X ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Correction coordinates X ☆☆☆☆☆ %f\n") VT_RST, + this->maxSpawnDistance.x); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 補正座標Y ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Correction coordinates Y ☆☆☆☆☆ %f\n") VT_RST, + this->maxSpawnDistance.y); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 補正座標Z ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Correction coordinates Z ☆☆☆☆☆ %f\n") VT_RST, + this->maxSpawnDistance.z); PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ SAVE ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); PRINTF("\n\n"); @@ -145,7 +146,8 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { Flags_SetSwitch(play, this->switchFlag); } - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ SAVE 終了 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ SAVE 終了 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ SAVE finished ☆☆☆☆☆ %d\n") VT_RST, + this->switchFlag); this->actionFunc = func_80A904D8; } else if ((this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y) && @@ -156,7 +158,8 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ SAVE 終了 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ SAVE 終了 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ SAVE finished ☆☆☆☆☆ %d\n") VT_RST, + this->switchFlag); play->msgCtx.ocarinaMode = OCARINA_MODE_04; this->actor.draw = func_80A90948; Collider_InitCylinder(play, &this->collider); 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 c3398d7e7f..ae93150f04 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h @@ -2,7 +2,7 @@ #define Z_EN_KAKASI2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKakasi2; 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 6ae299d966..6752e92d1c 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -6,18 +6,21 @@ #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 "translation.h" #include "z_lib.h" -#include "z64ocarina.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ka/object_ka.h" @@ -82,8 +85,7 @@ void EnKakasi3_Init(Actor* thisx, PlayState* play) { EnKakasi3* this = (EnKakasi3*)thisx; PRINTF("\n\n"); - // "Obonur" -- Related to the name of the scarecrow (Bonooru) - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ おーボヌール ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ おーボヌール ☆☆☆☆☆ \n", "☆☆☆☆☆ Bonooru ☆☆☆☆☆ \n") VT_RST); this->actor.attentionRangeType = ATTENTION_RANGE_6; Collider_InitCylinder(play, &this->collider); @@ -355,8 +357,8 @@ void func_80A918E4(EnKakasi3* this, PlayState* play) { Player* player = GET_PLAYER(play); if (BREG(3) != 0) { - // "No way!" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ まさか! ☆☆☆☆☆ %d\n" VT_RST, play->msgCtx.ocarinaMode); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ まさか! ☆☆☆☆☆ %d\n", "☆☆☆☆☆ No way! ☆☆☆☆☆ %d\n") VT_RST, + play->msgCtx.ocarinaMode); } if ((play->msgCtx.ocarinaMode == OCARINA_MODE_04 || (play->msgCtx.ocarinaMode >= OCARINA_MODE_05 && play->msgCtx.ocarinaMode < OCARINA_MODE_0B)) && @@ -375,8 +377,9 @@ void func_80A918E4(EnKakasi3* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; if (BREG(3) != 0) { PRINTF("\n\n"); - // "With this, other guys are OK! That's it!" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ これで、他の奴もOK!だ! ☆☆☆☆☆ %d\n" VT_RST, play->msgCtx.ocarinaMode); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ これで、他の奴もOK!だ! ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ With this, other guys are OK! That's it! ☆☆☆☆☆ %d\n") VT_RST, + play->msgCtx.ocarinaMode); } this->unk_195 = true; Message_StartTextbox(play, 0x40A7, NULL); @@ -423,8 +426,8 @@ void EnKakasi3_Update(Actor* thisx, PlayState* play) { if (BREG(2) != 0) { PRINTF("\n\n"); - // "flag!" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.save.info.scarecrowSpawnSongSet); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n", "☆☆☆☆☆ flag! ☆☆☆☆☆ %d\n") VT_RST, + gSaveContext.save.info.scarecrowSpawnSongSet); } this->unk_198++; 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 e09b98a9fb..d301d4c077 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h @@ -2,7 +2,7 @@ #define Z_EN_KAKASI3_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKakasi3; 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 5c2b652437..a7cc77a262 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -8,20 +8,22 @@ #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 "effect.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_kanban/object_kanban.h" @@ -822,7 +824,13 @@ static f32 sCutAngles[] = { static s32 sUnused[] = { 0, 0, 0 }; // Unused zero vector? -#include "assets/overlays/ovl_En_Kanban/ovl_En_Kanban.c" +static Vtx sShadowVtx[] = { +#include "assets/overlays/ovl_En_Kanban/sShadowVtx.inc.c" +}; + +static Gfx sShadowDL[16] = { +#include "assets/overlays/ovl_En_Kanban/sShadowDL.inc.c" +}; void EnKanban_Draw(Actor* thisx, PlayState* play) { EnKanban* this = (EnKanban*)thisx; diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h index 36efa211df..c8839c89bf 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h @@ -2,7 +2,7 @@ #define Z_EN_KANBAN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKanban; 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 be3b0eacb5..3a128a5b12 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -13,10 +13,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_dekubaba/object_dekubaba.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 97b04f1a7f..347cafa189 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h @@ -2,7 +2,7 @@ #define Z_EN_KAREBABA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKarebaba; 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 4426d8c4f7..1ad021f692 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -8,16 +8,18 @@ #include "attributes.h" #include "gfx.h" +#include "printf.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 "z64face_reaction.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_fa/object_fa.h" #include "assets/objects/object_os_anime/object_os_anime.h" @@ -1185,17 +1187,16 @@ 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); if (ENKO_TYPE == ENKO_TYPE_CHILD_7) { - // "Angle Z" - PRINTF(VT_BGCOL(BLUE) " アングルZ->(%d)\n" VT_RST, this->actor.shape.rot.z); + PRINTF(VT_BGCOL(BLUE) T(" アングルZ->(%d)\n", " Angle Z->(%d)\n") VT_RST, this->actor.shape.rot.z); if (LINK_IS_ADULT && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) { if (this->actor.shape.rot.z != 1) { Actor_Kill(&this->actor); @@ -1304,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); @@ -1337,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; @@ -1345,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; @@ -1373,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 d9531e57e6..1de4967f28 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.h +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.h @@ -2,7 +2,7 @@ #define Z_EN_KO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKo; 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 eb6b0f1c23..9a5a41119f 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -9,14 +9,17 @@ #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 "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" @@ -126,8 +129,7 @@ s32 EnKusa_SnapToFloor(EnKusa* this, PlayState* play, f32 yOffset) { return true; } else { PRINTF_COLOR_WARNING(); - // "Failure attaching to ground" - PRINTF("地面に付着失敗(%s %d)\n", "../z_en_kusa.c", 323); + PRINTF(T("地面に付着失敗(%s %d)\n", "Failed to attach to ground (%s %d)\n"), "../z_en_kusa.c", 323); PRINTF_RST(); return false; } @@ -266,8 +268,8 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET_U(thisx->params, 0, 2)]); if (this->requiredObjectSlot < 0) { - // "Bank danger!" - PRINTF("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", thisx->params, "../z_en_kusa.c", 561); + PRINTF(T("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", "Error : Bank danger! (arg_data 0x%04x)(%s %d)\n"), + thisx->params, "../z_en_kusa.c", 561); Actor_Kill(&this->actor); return; } 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 a375581cf9..85ed0d5407 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -2,7 +2,7 @@ #define Z_EN_KUSA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKusa; 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 7caa735739..81aacf1335 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -15,10 +15,10 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_kz/object_kz.h" 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 933fbe2617..f05b123712 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.h +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.h @@ -2,7 +2,7 @@ #define Z_EN_KZ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnKz; 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 f0cc5dddc6..8d9640a2ad 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -12,9 +12,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64light.h" -#include "z64play.h" -#include "z64save.h" +#include "light.h" +#include "play_state.h" +#include "save.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 035471f47d..94f7004036 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.h +++ b/src/overlays/actors/ovl_En_Light/z_en_light.h @@ -2,8 +2,8 @@ #define Z_EN_LIGHT_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.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 b4bd3af91b..097564b021 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -9,7 +9,7 @@ #include "regs.h" #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_lightbox/object_lightbox.h" 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 c09c77f850..232daedc8f 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 "z64actor.h" +#include "actor.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 2097bb9d26..eef5e1c0b9 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 @@ -7,7 +7,7 @@ #include "z_en_m_fire1.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS 0 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 59ebb44318..091c6e268a 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 "z64actor.h" +#include "actor.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 ba34f9adcc..1a64d485d3 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 @@ -6,11 +6,11 @@ #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 "audio.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 8c7cdd7a1f..7332cdcf21 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,8 +2,8 @@ #define Z_EN_M_THUNDER_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnMThunder; 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 9c1689a524..1709fb037c 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -12,12 +12,12 @@ #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 "audio.h" +#include "face_reaction.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ma1/object_ma1.h" 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 3664fc98a8..10cc508afd 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h @@ -2,7 +2,7 @@ #define Z_EN_MA1_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMa1; 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 aed88bb92c..88098c93bf 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -7,12 +7,12 @@ #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 "audio.h" +#include "face_reaction.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ma2/object_ma2.h" 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 81fddf7672..c312591b94 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h @@ -2,7 +2,7 @@ #define Z_EN_MA2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMa2; 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 cdac009221..a685945a2a 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -14,10 +14,10 @@ #include "sys_matrix.h" #include "z_lib.h" #include "versions.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ma2/object_ma2.h" 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 ecf637561e..a6bb2096f3 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h @@ -2,7 +2,7 @@ #define Z_EN_MA3_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMa3; 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 3431445989..849eee33d8 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -6,6 +6,8 @@ #include "z_en_mag.h" +#include "array_count.h" +#include "avoid_ub.h" #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" @@ -13,14 +15,16 @@ #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 "z64play.h" -#include "z64save.h" -#include "z64ss_sram.h" +#include "audio.h" +#include "cutscene_flags.h" +#include "play_state.h" +#include "save.h" +#include "ss_sram.h" #include "assets/objects/object_mag/object_mag.h" @@ -71,7 +75,7 @@ void EnMag_ResetSram(void) { SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8007800), buffer, 0x800, 1); gSaveContext.soundSetting = gSaveContext.zTargetSetting = 0; // SOUND_SETTING_STEREO/Z_TARGET_SETTING_SWITCH - Audio_SetSoundMode(gSaveContext.soundSetting); + 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 ace8427278..07733d40ce 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.h +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.h @@ -2,8 +2,8 @@ #define Z_EN_MAG_H #include "ultra64.h" -#include "z64actor.h" -#include "z64message.h" +#include "actor.h" +#include "message.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 485052002e..8c1413bc0f 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -18,9 +18,9 @@ #include "versions.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_mb/object_mb.h" @@ -126,7 +126,7 @@ static ColliderCylinderInit sBodyColliderInit = { { 20, 70, 0, { 0, 0, 0 } }, }; -static ColliderTrisElementInit sFrontShieldingTrisInit[2] = { +static ColliderTrisElementInit sFrontShieldingTrisElementsInit[2] = { { { ELEM_MATERIAL_UNK2, @@ -151,7 +151,7 @@ static ColliderTrisElementInit sFrontShieldingTrisInit[2] = { }, }; -static ColliderTrisInit sFrontShieldingInit = { +static ColliderTrisInit sFrontShieldingTrisInit = { { COL_MATERIAL_METAL, AT_NONE, @@ -161,10 +161,10 @@ static ColliderTrisInit sFrontShieldingInit = { COLSHAPE_TRIS, }, 2, - sFrontShieldingTrisInit, + sFrontShieldingTrisElementsInit, }; -static ColliderQuadInit sAttackColliderInit = { +static ColliderQuadInit sAttackColliderQuadInit = { { COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, @@ -184,82 +184,82 @@ static ColliderQuadInit sAttackColliderInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum EnMbDamageEffect { - /* 0x0 */ ENMB_DMGEFF_IGNORE, - /* 0x1 */ ENMB_DMGEFF_STUN, - /* 0x5 */ ENMB_DMGEFF_FREEZE = 0x5, - /* 0x6 */ ENMB_DMGEFF_STUN_ICE, - /* 0xF */ ENMB_DMGEFF_DEFAULT = 0xF -} EnMbDamageEffect; +typedef enum EnMbDamageReaction { + /* 0x0 */ ENMB_DMG_REACT_IGNORE, + /* 0x1 */ ENMB_DMG_REACT_STUN, + /* 0x5 */ ENMB_DMG_REACT_FREEZE = 0x5, + /* 0x6 */ ENMB_DMG_REACT_STUN_ICE, + /* 0xF */ ENMB_DMG_REACT_DEFAULT = 0xF +} EnMbDamageReaction; static DamageTable sSpearMoblinDamageTable = { - /* Deku nut */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Deku stick */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Slingshot */ DMG_ENTRY(1, ENMB_DMGEFF_DEFAULT), - /* Explosive */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Boomerang */ DMG_ENTRY(0, ENMB_DMGEFF_STUN), - /* Normal arrow */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Hammer swing */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Hookshot */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Kokiri sword */ DMG_ENTRY(1, ENMB_DMGEFF_DEFAULT), - /* Master sword */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Giant's Knife */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Fire arrow */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Ice arrow */ DMG_ENTRY(4, ENMB_DMGEFF_STUN_ICE), - /* Light arrow */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Unk arrow 1 */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Unk arrow 2 */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Unk arrow 3 */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Fire magic */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Ice magic */ DMG_ENTRY(3, ENMB_DMGEFF_STUN_ICE), - /* Light magic */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Shield */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Mirror Ray */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Kokiri spin */ DMG_ENTRY(1, ENMB_DMGEFF_DEFAULT), - /* Giant spin */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Master spin */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Kokiri jump */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Giant jump */ DMG_ENTRY(8, ENMB_DMGEFF_DEFAULT), - /* Master jump */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Unknown 1 */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Unblockable */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Hammer jump */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Unknown 2 */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), + /* Deku nut */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Deku stick */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Slingshot */ DMG_ENTRY(1, ENMB_DMG_REACT_DEFAULT), + /* Explosive */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Boomerang */ DMG_ENTRY(0, ENMB_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Hammer swing */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Hookshot */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Kokiri sword */ DMG_ENTRY(1, ENMB_DMG_REACT_DEFAULT), + /* Master sword */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Giant's Knife */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Fire arrow */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Ice arrow */ DMG_ENTRY(4, ENMB_DMG_REACT_STUN_ICE), + /* Light arrow */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Unk arrow 1 */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Unk arrow 2 */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Unk arrow 3 */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Fire magic */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Ice magic */ DMG_ENTRY(3, ENMB_DMG_REACT_STUN_ICE), + /* Light magic */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Shield */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Mirror Ray */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Kokiri spin */ DMG_ENTRY(1, ENMB_DMG_REACT_DEFAULT), + /* Giant spin */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Master spin */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Kokiri jump */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Giant jump */ DMG_ENTRY(8, ENMB_DMG_REACT_DEFAULT), + /* Master jump */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Unknown 1 */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Unblockable */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Hammer jump */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Unknown 2 */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), }; static DamageTable sClubMoblinDamageTable = { - /* Deku nut */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Deku stick */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Slingshot */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Explosive */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Boomerang */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Normal arrow */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Hammer swing */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Hookshot */ DMG_ENTRY(0, ENMB_DMGEFF_STUN), - /* Kokiri sword */ DMG_ENTRY(1, ENMB_DMGEFF_DEFAULT), - /* Master sword */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Giant's Knife */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Fire arrow */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Ice arrow */ DMG_ENTRY(4, ENMB_DMGEFF_STUN_ICE), - /* Light arrow */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Unk arrow 1 */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Unk arrow 2 */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Unk arrow 3 */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Fire magic */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Ice magic */ DMG_ENTRY(3, ENMB_DMGEFF_STUN_ICE), - /* Light magic */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Shield */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Mirror Ray */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Kokiri spin */ DMG_ENTRY(1, ENMB_DMGEFF_DEFAULT), - /* Giant spin */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Master spin */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Kokiri jump */ DMG_ENTRY(2, ENMB_DMGEFF_DEFAULT), - /* Giant jump */ DMG_ENTRY(8, ENMB_DMGEFF_DEFAULT), - /* Master jump */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Unknown 1 */ DMG_ENTRY(0, ENMB_DMGEFF_FREEZE), - /* Unblockable */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), - /* Hammer jump */ DMG_ENTRY(4, ENMB_DMGEFF_DEFAULT), - /* Unknown 2 */ DMG_ENTRY(0, ENMB_DMGEFF_IGNORE), + /* Deku nut */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Deku stick */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Slingshot */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Explosive */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Boomerang */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Normal arrow */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Hammer swing */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Hookshot */ DMG_ENTRY(0, ENMB_DMG_REACT_STUN), + /* Kokiri sword */ DMG_ENTRY(1, ENMB_DMG_REACT_DEFAULT), + /* Master sword */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Giant's Knife */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Fire arrow */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Ice arrow */ DMG_ENTRY(4, ENMB_DMG_REACT_STUN_ICE), + /* Light arrow */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Unk arrow 1 */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Unk arrow 2 */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Unk arrow 3 */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Fire magic */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Ice magic */ DMG_ENTRY(3, ENMB_DMG_REACT_STUN_ICE), + /* Light magic */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Shield */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Mirror Ray */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Kokiri spin */ DMG_ENTRY(1, ENMB_DMG_REACT_DEFAULT), + /* Giant spin */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Master spin */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Kokiri jump */ DMG_ENTRY(2, ENMB_DMG_REACT_DEFAULT), + /* Giant jump */ DMG_ENTRY(8, ENMB_DMG_REACT_DEFAULT), + /* Master jump */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Unknown 1 */ DMG_ENTRY(0, ENMB_DMG_REACT_FREEZE), + /* Unblockable */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), + /* Hammer jump */ DMG_ENTRY(4, ENMB_DMG_REACT_DEFAULT), + /* Unknown 2 */ DMG_ENTRY(0, ENMB_DMG_REACT_IGNORE), }; static InitChainEntry sInitChain[] = { @@ -284,10 +284,11 @@ void EnMb_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.damageTable = &sSpearMoblinDamageTable; Collider_InitCylinder(play, &this->bodyCollider); Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sBodyColliderInit); - Collider_InitTris(play, &this->frontShielding); - Collider_SetTris(play, &this->frontShielding, &this->actor, &sFrontShieldingInit, this->frontShieldingTris); + Collider_InitTris(play, &this->frontShieldingCollider); + Collider_SetTris(play, &this->frontShieldingCollider, &this->actor, &sFrontShieldingTrisInit, + this->frontShieldingColliderElements); Collider_InitQuad(play, &this->attackCollider); - Collider_SetQuad(play, &this->attackCollider, &this->actor, &sAttackColliderInit); + Collider_SetQuad(play, &this->attackCollider, &this->actor, &sAttackColliderQuadInit); switch (this->actor.params) { case ENMB_TYPE_SPEAR_GUARD: @@ -349,7 +350,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { void EnMb_Destroy(Actor* thisx, PlayState* play) { EnMb* this = (EnMb*)thisx; - Collider_DestroyTris(play, &this->frontShielding); + Collider_DestroyTris(play, &this->frontShieldingCollider); Collider_DestroyCylinder(play, &this->bodyCollider); Collider_DestroyQuad(play, &this->attackCollider); } @@ -604,7 +605,7 @@ void EnMb_SetupStunned(EnMb* this) { this->state = ENMB_STATE_STUNNED; this->actor.speed = 0.0f; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); - if (this->damageEffect == ENMB_DMGEFF_STUN_ICE) { + if (this->damageReaction == ENMB_DMG_REACT_STUN_ICE) { this->iceEffectTimer = 40; } else { if (this->actor.params != ENMB_TYPE_CLUB) { @@ -1434,13 +1435,13 @@ void EnMb_ClubUpdateAttackCollider(Actor* thisx, PlayState* play) { void EnMb_CheckColliding(EnMb* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->frontShielding.base.acFlags & AC_HIT) { - this->frontShielding.base.acFlags &= ~(AC_HIT | AC_BOUNCED); + if (this->frontShieldingCollider.base.acFlags & AC_HIT) { + this->frontShieldingCollider.base.acFlags &= ~(AC_HIT | AC_BOUNCED); this->bodyCollider.base.acFlags &= ~AC_HIT; } else if ((this->bodyCollider.base.acFlags & AC_HIT) && this->state >= ENMB_STATE_STUNNED) { this->bodyCollider.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect != ENMB_DMGEFF_IGNORE && - this->actor.colChkInfo.damageEffect != ENMB_DMGEFF_FREEZE) { + if (this->actor.colChkInfo.damageReaction != ENMB_DMG_REACT_IGNORE && + this->actor.colChkInfo.damageReaction != ENMB_DMG_REACT_FREEZE) { if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; @@ -1449,11 +1450,11 @@ void EnMb_CheckColliding(EnMb* this, PlayState* play) { #endif Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 6.0f, this->actor.world.rot.y, 6.0f); } - this->damageEffect = this->actor.colChkInfo.damageEffect; + this->damageReaction = this->actor.colChkInfo.damageReaction; this->attack = ENMB_ATTACK_NONE; Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, false); - if (this->actor.colChkInfo.damageEffect == ENMB_DMGEFF_STUN || - this->actor.colChkInfo.damageEffect == ENMB_DMGEFF_STUN_ICE) { + if (this->actor.colChkInfo.damageReaction == ENMB_DMG_REACT_STUN || + this->actor.colChkInfo.damageReaction == ENMB_DMG_REACT_STUN_ICE) { if (this->state != ENMB_STATE_STUNNED) { Actor_ApplyDamage(&this->actor); EnMb_SetupStunned(this); @@ -1484,7 +1485,7 @@ void EnMb_Update(Actor* thisx, PlayState* play) { s32 pad; EnMb_CheckColliding(this, play); - if (thisx->colChkInfo.damageEffect != ENMB_DMGEFF_FREEZE) { + if (thisx->colChkInfo.damageReaction != ENMB_DMG_REACT_FREEZE) { this->actionFunc(this, play); Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 40.0f, 40.0f, 70.0f, @@ -1502,7 +1503,7 @@ void EnMb_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base); } if (this->state >= ENMB_STATE_IDLE) { - CollisionCheck_SetAC(play, &play->colChkCtx, &this->frontShielding.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->frontShieldingCollider.base); } if (this->attack > ENMB_ATTACK_NONE) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->attackCollider.base); @@ -1601,9 +1602,9 @@ void EnMb_Draw(Actor* thisx, PlayState* play) { Matrix_MultVec3f(&frontShieldingTriModel0[i], &frontShieldingTri0[i]); Matrix_MultVec3f(&frontShieldingTriModel1[i], &frontShieldingTri1[i]); } - Collider_SetTrisVertices(&this->frontShielding, 0, &frontShieldingTri0[0], &frontShieldingTri0[1], + Collider_SetTrisVertices(&this->frontShieldingCollider, 0, &frontShieldingTri0[0], &frontShieldingTri0[1], &frontShieldingTri0[2]); - Collider_SetTrisVertices(&this->frontShielding, 1, &frontShieldingTri1[0], &frontShieldingTri1[1], + Collider_SetTrisVertices(&this->frontShieldingCollider, 1, &frontShieldingTri1[0], &frontShieldingTri1[1], &frontShieldingTri1[2]); } 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 8c3ddc6029..c8413b8173 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.h +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.h @@ -2,7 +2,7 @@ #define Z_EN_MB_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMb; @@ -23,7 +23,7 @@ typedef enum EnMbState { typedef struct EnMb { /* 0x0000 */ Actor actor; /* 0x014C */ Vec3s bodyPartsPos[10]; - /* 0x0188 */ u8 damageEffect; + /* 0x0188 */ u8 damageReaction; /* 0x018C */ SkelAnime skelAnime; /* 0x01D0 */ Vec3s jointTable[28]; /* 0x0278 */ Vec3s morphTable[28]; @@ -46,8 +46,8 @@ typedef struct EnMb { /* 0x0364 */ f32 playerDetectionRange; /* 0x0368 */ ColliderCylinder bodyCollider; /* 0x03B4 */ ColliderQuad attackCollider; // for attacking the player - /* 0x0434 */ ColliderTris frontShielding; // Moblins don't have shields, but this acts as one - /* 0x0454 */ ColliderTrisElement frontShieldingTris[2]; + /* 0x0434 */ ColliderTris frontShieldingCollider; // Moblins don't have shields, but this acts as one + /* 0x0454 */ ColliderTrisElement frontShieldingColliderElements[2]; } EnMb; // size = 0x050C #endif 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 296f4d42af..3059baa7bb 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -14,11 +14,11 @@ #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 "face_reaction.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_md/object_md.h" 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 bfd9b0450a..3b5cc079bb 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 "z64actor.h" +#include "actor.h" struct EnMd; 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 f035f2d331..59257e93d3 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -11,10 +11,10 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_mk/object_mk.h" 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 53df56b76a..d9c85a90d8 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.h +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.h @@ -2,7 +2,7 @@ #define Z_EN_MK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMk; 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 75969dd224..9881334a0a 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -14,10 +14,10 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.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 555073753f..b7def02740 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.h +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.h @@ -2,7 +2,7 @@ #define Z_EN_MM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMm; 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 3958fce494..187b576594 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -10,12 +10,14 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_mm/object_mm.h" @@ -161,7 +163,7 @@ void EnMm2_Init(Actor* thisx, PlayState* play2) { } if (this->actor.params == 1) { if (!GET_INFTABLE(INFTABLE_17F) || !GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) { - PRINTF(VT_FGCOL(CYAN) " マラソン 開始されていない \n" VT_RST "\n"); + PRINTF(VT_FGCOL(CYAN) T(" マラソン 開始されていない \n", " Marathon not started \n") VT_RST "\n"); Actor_Kill(&this->actor); } } 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 8e48261d7c..e855b99c88 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h @@ -2,7 +2,7 @@ #define Z_EN_MM2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMm2; 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 32ac753571..e9012fb1e4 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -9,9 +9,10 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" -#include "z64face_reaction.h" -#include "z64play.h" -#include "z64save.h" +#include "printf.h" +#include "face_reaction.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_ms/object_ms.h" 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 9ace7bc2d0..77a19a5004 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.h +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.h @@ -2,7 +2,7 @@ #define Z_EN_MS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnMs; 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 7360dd7f18..78229fc754 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -10,9 +10,9 @@ #include "gfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64face_reaction.h" -#include "z64play.h" -#include "z64save.h" +#include "face_reaction.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_mu/object_mu.h" 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 417ce242b1..0fce157890 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 "z64actor.h" +#include "actor.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 4b615342c0..c2120b1fc9 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -8,8 +8,10 @@ #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" @@ -17,11 +19,12 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_nb/object_nb.h" @@ -137,11 +140,12 @@ void EnNb_UpdatePath(EnNb* this, PlayState* play) { this->finalPos.z = pointPos[1].z; this->pathYaw = RAD_TO_BINANG(Math_FAtan2F(this->finalPos.x - this->initialPos.x, this->finalPos.z - this->initialPos.z)); - // "En_Nb_Get_path_info Rail Data Get! = %d!!!!!!!!!!!!!!" - PRINTF("En_Nb_Get_path_info レールデータをゲットだぜ = %d!!!!!!!!!!!!!!\n", path); + PRINTF(T("En_Nb_Get_path_info レールデータをゲットだぜ = %d!!!!!!!!!!!!!!\n", + "En_Nb_Get_path_info Got the rail data = %d!!!!!!!!!!!!!!\n"), + path); } else { - // "En_Nb_Get_path_info Rail Data Doesn't Exist!!!!!!!!!!!!!!!!!!!!" - PRINTF("En_Nb_Get_path_info レールデータが無い!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("En_Nb_Get_path_info レールデータが無い!!!!!!!!!!!!!!!!!!!!\n", + "En_Nb_Get_path_info No rail data!!!!!!!!!!!!!!!!!!!!\n")); } } @@ -692,8 +696,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; @@ -911,8 +915,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; @@ -1099,8 +1103,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; @@ -1458,8 +1462,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; } @@ -1566,8 +1570,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 3ed08cbf8e..397c6b63a2 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 "z64actor.h" +#include "actor.h" struct EnNb; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb_cutscene_data.inc.c b/src/overlays/actors/ovl_En_Nb/z_en_nb_cutscene_data.inc.c index 3c3a68311c..15d6ff298f 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb_cutscene_data.inc.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb_cutscene_data.inc.c @@ -1,5 +1,5 @@ #include "z_en_nb.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off static CutsceneData gSpiritMedallionCs[] = { 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 00fde6a469..5acaf3f9ed 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -9,22 +9,25 @@ #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 "translation.h" #include "versions.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_niw/object_niw.h" @@ -151,7 +154,8 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { if (this->actor.params == 0xB) { if (sLowerRiverSpawned) { Actor_Kill(&this->actor); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ もういてる原 Ver.1 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ もういてる原 Ver.1 ☆☆☆☆☆ \n", "☆☆☆☆☆ I'm already here -Hara Ver.1 ☆☆☆☆☆ \n") VT_RST); return; } sLowerRiverSpawned = true; @@ -162,7 +166,8 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { if (this->actor.params == 0xC) { if (sUpperRiverSpawned) { Actor_Kill(&this->actor); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ もういてる原 Ver.2 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ もういてる原 Ver.2 ☆☆☆☆☆ \n", "☆☆☆☆☆ I'm already here -Hara Ver.2 ☆☆☆☆☆ \n") VT_RST); return; } sUpperRiverSpawned = true; @@ -179,7 +184,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { if (fabsf(this->actor.world.pos.x - sKakarikoPosList[i].x) < 40.0f && fabsf(this->actor.world.pos.z - sKakarikoPosList[i].z) < 40.0f) { this->unk_2AA = i; - PRINTF(VT_FGCOL(YELLOW) " 通常鶏index %d\n" VT_RST, this->unk_2AA); + PRINTF(VT_FGCOL(YELLOW) T(" 通常鶏index %d\n", " Normal chicken index %d\n") VT_RST, this->unk_2AA); if (gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F] & sKakarikoFlagList[i]) { this->actor.world.pos.x = 300.0f; @@ -257,7 +262,8 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { break; } - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ どんな奴? ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ どんな奴? ☆☆☆☆☆ %d\n", "☆☆☆☆☆ What kind of guy? ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); PRINTF("\n\n"); this->actionFunc = EnNiw_ResetAction; } @@ -384,7 +390,7 @@ void EnNiw_SpawnAttackCucco(EnNiw* this, PlayState* play) { this->timer5 = 10; } else { PRINTF("\n\n"); - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 発生できず ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 発生できず ☆☆☆☆☆ \n", " ☆☆☆☆☆ Cannot spawn ☆☆☆☆☆ \n") VT_RST); } } } @@ -981,17 +987,21 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { f32 camResult; s32 pad3[10]; - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 上下? ☆☆☆☆☆ %f\n" VT_RST, thisx->floorHeight); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 上下? ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Up and down? ☆☆☆☆☆ %f\n") VT_RST, + thisx->floorHeight); cam.x = play->view.at.x - play->view.eye.x; cam.y = play->view.at.y - play->view.eye.y; cam.z = play->view.at.z - play->view.eye.z; camResult = cam.y / sqrtf(SQ(cam.x) + SQ(cam.y) + SQ(cam.z)); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外X! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.x); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.y); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.z); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ セットX! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.x); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ セットY! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.y); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ セットZ! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.z); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 範囲外X! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ X out of range! ☆☆☆☆☆ %f\n") VT_RST, + thisx->world.pos.x); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 範囲外Y! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Y out of range! ☆☆☆☆☆ %f\n") VT_RST, + thisx->world.pos.y); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 範囲外Z! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Z out of range! ☆☆☆☆☆ %f\n") VT_RST, + thisx->world.pos.z); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ セットX! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Set X! ☆☆☆☆☆ %f\n") VT_RST, thisx->home.pos.x); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ セットY! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Set Y! ☆☆☆☆☆ %f\n") VT_RST, thisx->home.pos.y); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ セットZ! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Set Z! ☆☆☆☆☆ %f\n") VT_RST, thisx->home.pos.z); thisx->world.pos.x = thisx->home.pos.x; thisx->world.pos.z = thisx->home.pos.z; thisx->world.pos.y = ((thisx->home.pos.y + play->view.eye.y) + (camResult * 160.0f)); @@ -1000,9 +1010,12 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { thisx->world.pos.y = thisx->home.pos.y + 300.0f; } - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後X! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.x); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.y); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.z); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 修整後X! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ X after correction! ☆☆☆☆☆ %f\n") VT_RST, + thisx->world.pos.x); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 修整後Y! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Y after correction! ☆☆☆☆☆ %f\n") VT_RST, + thisx->world.pos.y); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 修整後Z! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Z after correction! ☆☆☆☆☆ %f\n") VT_RST, + thisx->world.pos.z); PRINTF("\n\n"); thisx->speed = 0.0f; thisx->gravity = -2.0f; @@ -1043,7 +1056,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 400); this->timer5 = 0; PRINTF("\n\n"); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ ぶくぶく ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ ぶくぶく ☆☆☆☆☆ \n", "☆☆☆☆☆ Bubbling ☆☆☆☆☆ \n") VT_RST); PRINTF("\n\n"); this->actionFunc = func_80AB6F04; return; 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 a0f58d0a35..b64180af22 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.h +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.h @@ -2,7 +2,7 @@ #define Z_EN_NIW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnNiw; 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 2250042f84..8949be2892 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 @@ -10,14 +10,16 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_gr/object_gr.h" @@ -89,15 +91,21 @@ void EnNiwGirl_Init(Actor* thisx, PlayState* play) { &play->actorCtx, &this->actor, play, ACTOR_EN_NIW, this->actor.world.pos.x + vec2.x, this->actor.world.pos.y + vec2.y, this->actor.world.pos.z + vec2.z, 0, this->actor.world.rot.y, 0, 0xA); if (this->chasedEnNiw != NULL) { - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ シツレイしちゃうわね!プンプン ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ きゃははははは、まてー ☆☆☆☆☆ %d\n" VT_RST, this->path); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ シツレイしちゃうわね!プンプン ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ That's so mean! Punpun ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ きゃははははは、まてー ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Kyahahahaha, wait ☆☆☆☆☆ %d\n") + VT_RST, + this->path); PRINTF("\n\n"); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actionFunc = EnNiwGirl_Talk; } else { PRINTF("\n\n"); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ なぜか、セットできむぅあせん ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ んんがくく ☆☆☆☆☆ %d\n" VT_RST, this->path); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ なぜか、セットできむぅあせん ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ For some reason, I can't set it up ☆☆☆☆☆ %d\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ んんがくく ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Language ☆☆☆☆☆ %d\n") VT_RST, this->path); PRINTF("\n\n"); Actor_Kill(&this->actor); } 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 422cf33e48..2651d95d8f 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,7 +2,7 @@ #define Z_EN_NIW_GIRL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnNiwGirl; 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 33881ed73f..2ea1ace664 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 @@ -4,17 +4,19 @@ #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 "translation.h" #include "versions.h" #include "z_lib.h" -#include "z64face_reaction.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ane/object_ane.h" #include "assets/objects/object_os_anime/object_os_anime.h" @@ -99,7 +101,8 @@ void EnNiwLady_Init(Actor* thisx, PlayState* play) { Actor_Kill(thisx); return; } - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ねぇちゃんうっふん ☆☆☆☆☆ %d\n" VT_RST, this->unk_278); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ねぇちゃんうっふん ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Neechan ugh ☆☆☆☆☆ %d\n") VT_RST, + this->unk_278); PRINTF("\n\n"); this->actionFunc = func_80AB9F24; thisx->cullingVolumeDistance = 600.0f; @@ -170,9 +173,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); @@ -227,8 +230,9 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F] |= D_80ABB3B4[currentCucco->unk_2AA]; if (BREG(1) != 0) { - // "GET inside the chicken fence!" - PRINTF(VT_FGCOL(GREEN) "☆ 鶏柵内GET!☆ %x\n" VT_RST, D_80ABB3B4[currentCucco->unk_2AA]); + PRINTF(VT_FGCOL(GREEN) T("☆ 鶏柵内GET!☆ %x\n", "☆ GET inside the chicken fence! ☆ %x\n") + VT_RST, + D_80ABB3B4[currentCucco->unk_2AA]); } } this->cuccosInPen++; @@ -266,12 +270,21 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { } if (Actor_TalkOfferAccepted(&this->actor, play)) { PRINTF("\n\n"); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃん選択\t ☆☆☆☆ %d\n" VT_RST, phi_s1); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃんハート ☆☆☆☆ %d\n" VT_RST, this->unk_26C); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃん保存 ☆☆☆☆ %d\n" VT_RST, this->unk_26A); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ ねぇちゃん今\t ☆☆☆☆ %d\n" VT_RST, this->cuccosInPen); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ this->actor.talk_message ☆☆ %x\n" VT_RST, this->actor.textId); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ this->message_end_code ☆☆ %d\n" VT_RST, this->unk_262); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ ねぇちゃん選択\t ☆☆☆☆ %d\n", "☆☆☆☆☆ Select your sister\t ☆☆☆☆ %d\n") VT_RST, + phi_s1); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ ねぇちゃんハート ☆☆☆☆ %d\n", "☆☆☆☆☆ Neechan Heart ☆☆☆☆ %d\n") VT_RST, + this->unk_26C); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ ねぇちゃん保存 ☆☆☆☆ %d\n", "☆☆☆☆☆ Save my sister ☆☆☆☆ %d\n") + VT_RST, + this->unk_26A); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ ねぇちゃん今\t ☆☆☆☆ %d\n", "☆☆☆☆☆ Neechan now\t ☆☆☆☆ %d\n") VT_RST, + this->cuccosInPen); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ this->actor.talk_message ☆☆ %x\n", "☆☆☆☆☆ this->actor.talk_message ☆☆ %x\n") + VT_RST, + this->actor.textId); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ this->message_end_code ☆☆ %d\n", "☆☆☆☆☆ this->message_end_code ☆☆ %d\n") + VT_RST, + this->unk_262); PRINTF("\n\n"); if (MaskReaction_GetTextId(play, MASK_REACTION_SET_CUCCO_LADY) == 0) { #if OOT_VERSION >= NTSC_1_1 @@ -289,13 +302,15 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { this->unk_26C = 1; this->unk_262 = TEXT_STATE_EVENT; this->unk_26A = this->cuccosInPen; - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更前 ☆☆ %x\n" VT_RST, + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 柵内BIT変更前 ☆☆ %x\n", "☆☆☆☆☆ Before changing the fence BIT ☆☆ %x\n") + VT_RST, gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F]); gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F] &= (u16) ~(INFTABLE_MASK(INFTABLE_199) | INFTABLE_MASK(INFTABLE_19A) | INFTABLE_MASK(INFTABLE_19B) | INFTABLE_MASK(INFTABLE_19C) | INFTABLE_MASK(INFTABLE_19D) | INFTABLE_MASK(INFTABLE_19E) | INFTABLE_MASK(INFTABLE_19F)); - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更後 ☆☆ %x\n" VT_RST, + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 柵内BIT変更後 ☆☆ %x\n", + "☆☆☆☆☆ After changing the BIT inside the fence ☆☆ %x\n") VT_RST, gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F]); PRINTF("\n\n"); this->actionFunc = func_80ABA654; @@ -328,8 +343,8 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { void func_80ABA654(EnNiwLady* this, PlayState* play) { if (this->unk_262 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ハート ☆☆☆☆☆ %d\n" VT_RST, this->unk_26C); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 爆弾 ☆☆☆☆☆ %d\n" VT_RST, this->unk_272); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ハート ☆☆☆☆☆ %d\n", "☆☆☆☆☆ heart ☆☆☆☆☆ %d\n") VT_RST, this->unk_26C); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 爆弾 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ bomb ☆☆☆☆☆ %d\n") VT_RST, this->unk_272); PRINTF("\n\n"); this->unk_26E = 0xB; if (!GET_ITEMGETINF(ITEMGETINF_0C)) { @@ -352,8 +367,7 @@ static s16 sTradeItemTextIds[] = { 0x503E, 0x503F, 0x5047, 0x5040, 0x5042, 0x504 0x5044, 0x00CF, 0x5045, 0x5042, 0x5027 }; void func_80ABA778(EnNiwLady* this, PlayState* play) { - // "☆☆☆☆☆ Adult message check ☆☆☆☆☆" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ アダルトメッセージチェック ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ アダルトメッセージチェック ☆☆☆☆☆ \n", "☆☆☆☆☆ Adult message check ☆☆☆☆☆ \n") VT_RST); this->unk_262 = TEXT_STATE_DONE; this->unk_273 = 0; if (!GET_ITEMGETINF(ITEMGETINF_2C)) { @@ -479,7 +493,7 @@ void func_80ABAC84(EnNiwLady* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) != TEXT_STATE_DONE) || !Message_ShouldAdvance(play)) { return; } - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n", "☆☆☆☆☆ Normal termination ☆☆☆☆☆ \n") VT_RST); if (LINK_IS_ADULT) { if (!GET_ITEMGETINF(ITEMGETINF_2C)) { SET_ITEMGETINF(ITEMGETINF_2C); @@ -495,7 +509,7 @@ void func_80ABAC84(EnNiwLady* this, PlayState* play) { } void func_80ABAD38(EnNiwLady* this, PlayState* play) { - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 通常メッセージチェック ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 通常メッセージチェック ☆☆☆☆☆ \n", "☆☆☆☆☆ Normal message check ☆☆☆☆☆ \n") VT_RST); this->unk_262 = TEXT_STATE_DONE; this->actionFunc = func_80ABAD7C; } @@ -533,7 +547,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 a6167454da..124efa5947 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,7 +2,7 @@ #define Z_EN_NIW_LADY_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnNiwLady; 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 3511a3c45d..9417316e4c 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -11,10 +11,10 @@ #include "gfx_setupdl.h" #include "sfx.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_dekunuts/object_dekunuts.h" #include "assets/objects/object_hintnuts/object_hintnuts.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 bcd4e0a936..9af4b042d7 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 "z64actor.h" +#include "actor.h" #define NUTSBALL_GET_TYPE(thisx) ((thisx)->params) 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 a5f322def6..4d5ec7f3ca 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -11,7 +11,7 @@ #include "gfx_setupdl.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_nwc/object_nwc.h" 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 fbb64d1ca2..5e33e2fd36 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h @@ -2,7 +2,7 @@ #define Z_EN_NWC_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnNwc; struct EnNwcChick; 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 bf71620dc3..38167bef26 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -5,13 +5,15 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "rand.h" #include "sfx.h" #include "sys_matrix.h" +#include "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_ny/object_ny.h" @@ -63,7 +65,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { }, }; -static ColliderJntSphInit sColliderInit = { +static ColliderJntSphInit sColliderJntSphInit = { { COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, @@ -124,7 +126,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->colliderElements); + Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); this->unk_1CA = 0; this->unk_1D0 = 0; @@ -140,8 +142,7 @@ void EnNy_Init(Actor* thisx, PlayState* play) { this->unk_1E8 = 0.0f; this->unk_1E0 = 0.25f; if (this->actor.params == 0) { - // "New initials" - PRINTF("ニュウ イニシャル[ %d ] !!\n", this->actor.params); + PRINTF(T("ニュウ イニシャル[ %d ] !!\n", "New init [ %d ] !!\n"), this->actor.params); this->actor.colChkInfo.mass = 0; this->unk_1D4 = 0; this->unk_1D8 = 0xFF; @@ -149,8 +150,7 @@ void EnNy_Init(Actor* thisx, PlayState* play) { func_80ABCDBC(this); } else { // This mode is unused in the final game - // "Dummy new initials" - PRINTF("ダミーニュウ イニシャル[ %d ] !!\n", this->actor.params); + PRINTF(T("ダミーニュウ イニシャル[ %d ] !!\n", "Dummy new init [ %d ] !!\n"), this->actor.params); PRINTF("En_Ny_actor_move2[ %x ] !!\n", EnNy_UpdateUnused); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.update = EnNy_UpdateUnused; @@ -323,7 +323,7 @@ s32 EnNy_CollisionCheck(EnNy* this, PlayState* play) { effectPos.y = this->collider.elements[0].base.acDmgInfo.hitPos.y; effectPos.z = this->collider.elements[0].base.acDmgInfo.hitPos.z; if ((this->unk_1E0 == 0.25f) && (this->unk_1D4 == 0xFF)) { - switch (this->actor.colChkInfo.damageEffect) { + switch (this->actor.colChkInfo.damageReaction) { case 0xE: sp3F = 1; FALLTHROUGH; 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 03cace42fb..714858408f 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.h +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.h @@ -2,7 +2,7 @@ #define Z_EN_NY_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnNy; 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 f568d1812b..1d6b8dec43 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c @@ -6,7 +6,7 @@ #include "z_en_oe2.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) 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 062e103819..35cd7f65f8 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.h +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.h @@ -2,7 +2,7 @@ #define Z_EN_OE2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnOE2; 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 49c4756c29..d58918ea82 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 @@ -6,16 +6,18 @@ #include "z_en_okarina_effect.h" +#include "printf.h" #include "regs.h" #include "sequence.h" #include "terminal.h" +#include "translation.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" +#include "audio.h" +#include "cutscene_flags.h" +#include "debug_display.h" +#include "frame_advance.h" +#include "play_state.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) @@ -63,8 +65,8 @@ void EnOkarinaEffect_Init(Actor* thisx, PlayState* play) { EnOkarinaEffect* this = (EnOkarinaEffect*)thisx; PRINTF("\n\n"); - // "Ocarina Storm Effect" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ オカリナあらし効果ビカビカビカ〜 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ オカリナあらし効果ビカビカビカ〜 ☆☆☆☆☆ \n", + "☆☆☆☆☆ Ocarina storm effect sparkle sparkle sparkle ☆☆☆☆☆ \n") VT_RST); PRINTF("\n\n"); if (play->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) { Actor_Kill(&this->actor); @@ -96,7 +98,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, PlayState* play) { } PRINTF("\nthis->timer=[%d]", this->timer); if (this->timer == 308) { - PRINTF("\n\n\n豆よ のびろ 指定\n\n\n"); // "Let's grow some beans" + PRINTF(T("\n\n\n豆よ のびろ 指定\n\n\n", "\n\n\nBeans, grow!\n\n\n")); CutsceneFlags_Set(play, 5); } } 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 bca8c99234..2596766d3a 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,7 +2,7 @@ #define Z_EN_OKARINA_EFFECT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnOkarinaEffect; 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 c6ac85502c..13bba29d07 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 @@ -7,18 +7,20 @@ #include "z_en_okarina_tag.h" #include "attributes.h" +#include "printf.h" #include "regs.h" #include "segmented_address.h" #include "sfx.h" #include "terminal.h" +#include "translation.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 "audio.h" +#include "debug_display.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/scenes/misc/hakaana_ouke/hakaana_ouke_scene.h" #include "assets/scenes/overworld/spot02/spot02_scene.h" @@ -58,8 +60,8 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { EnOkarinaTag* this = (EnOkarinaTag*)thisx; PRINTF("\n\n"); - // "Ocarina tag outbreak" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ オカリナタグ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ オカリナタグ発生 ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Ocarina tag spawn ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->type = PARAMS_GET_U(this->actor.params, 10, 6); this->ocarinaSong = PARAMS_GET_U(this->actor.params, 6, 4); @@ -76,18 +78,17 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { this->interactRange = this->actor.world.rot.z * 40.0f; } - // "Save information" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ セーブ情報\t ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); - // "Type index" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 種類インデックス ☆☆☆☆☆ %d\n" VT_RST, this->type); - // "Correct answer information" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 正解情報\t ☆☆☆☆☆ %d\n" VT_RST, this->ocarinaSong); - // "Range information" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 範囲情報\t ☆☆☆☆☆ %d\n" VT_RST, this->actor.world.rot.z); - // "Processing range information" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 処理範囲情報\t ☆☆☆☆☆ %f\n" VT_RST, this->interactRange); - // "Hit?" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 当り?\t\t ☆☆☆☆☆ %d\n" VT_RST, this->unk_158); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ セーブ情報\t ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Save information\t ☆☆☆☆☆ %d\n") VT_RST, + this->switchFlag); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 種類インデックス ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Type index ☆☆☆☆☆ %d\n") VT_RST, this->type); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 正解情報\t ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Correct answer information\t ☆☆☆☆☆ %d\n") VT_RST, + this->ocarinaSong); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 範囲情報\t ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Range information\t ☆☆☆☆☆ %d\n") VT_RST, + this->actor.world.rot.z); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 処理範囲情報\t ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Processing range information\t ☆☆☆☆☆ %f\n") + VT_RST, + this->interactRange); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 当り?\t\t ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Hit?\t\t ☆☆☆☆☆ %d\n") VT_RST, this->unk_158); PRINTF("\n\n"); if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { @@ -130,8 +131,8 @@ void func_80ABEF2C(EnOkarinaTag* this, PlayState* play) { } else { if ((this->ocarinaSong != 6) || (gSaveContext.save.info.scarecrowSpawnSongSet)) { if (player->stateFlags2 & PLAYER_STATE2_24) { - // "North! ! ! ! !" - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToPlayer); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n", "☆☆☆☆☆ North!!!!! ☆☆☆☆☆ %f\n") VT_RST, + this->actor.xzDistToPlayer); } if ((this->actor.xzDistToPlayer < (90.0f + this->interactRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { @@ -227,8 +228,9 @@ void func_80ABF28C(EnOkarinaTag* this, PlayState* play) { Message_StartOcarina(play, OCARINA_ACTION_CHECK_LULLABY); break; default: - // "Ocarina Invisible-kun demo start check error source" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ オカリナ透明君デモ開始チェックエラー原 ☆☆☆☆☆ %d\n" VT_RST, + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ オカリナ透明君デモ開始チェックエラー原 ☆☆☆☆☆ %d\n", + "☆☆☆☆☆ Ocarina Invisible-kun demo start check error -Hara ☆☆☆☆☆ %d\n") + VT_RST, this->type); Actor_Kill(&this->actor); break; @@ -319,8 +321,8 @@ void func_80ABF708(EnOkarinaTag* this, PlayState* play) { } void func_80ABF7CC(EnOkarinaTag* this, PlayState* play) { - // "Open sesame sesame!" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 開けゴマゴマゴマ! ☆☆☆☆☆ %d\n" VT_RST, Message_GetState(&play->msgCtx)); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 開けゴマゴマゴマ! ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Open gomagomagoma! ☆☆☆☆☆ %d\n") VT_RST, + Message_GetState(&play->msgCtx)); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); 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 76ac1581a5..4e0fff553c 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,7 +2,7 @@ #define Z_EN_OKARINA_TAG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnOkarinaTag; 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 2ff69c780e..fde49023cd 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,6 +1,6 @@ #include "sequence.h" -#include "z64cutscene_commands.h" -#include "z64player.h" +#include "cutscene_commands.h" +#include "player.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 b7063e0f00..1503bb265c 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -8,10 +8,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_okuta/object_okuta.h" @@ -570,11 +570,11 @@ void EnOkuta_ColliderCheck(EnOkuta* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { Enemy_StartFinishingBlow(play, &this->actor); this->actor.colChkInfo.health = 0; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; - if (this->actor.colChkInfo.damageEffect == 3) { + if (this->actor.colChkInfo.damageReaction == 3) { EnOkuta_SetupFreeze(this); } else { EnOkuta_SetupWaitToDie(this); 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 5409481022..0e0a7a74eb 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h @@ -2,7 +2,7 @@ #define Z_EN_OKUTA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnOkuta; 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 620d70e215..ab3c142984 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -8,14 +8,16 @@ #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 "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_ossan/object_ossan.h" @@ -171,17 +173,10 @@ static s16 D_80AC8904[] = { 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x00 #if DEBUG_FEATURES static char* sShopkeeperPrintName[] = { - "コキリの店 ", // "Kokiri Shop" - "薬屋 ", // "Potion Shop" - "夜の店 ", // "Night Shop" - "路地裏の店 ", // "Back Alley Shop" - "盾の店 ", // "Shield Shop" - "大人の店 ", // "Adult Shop" - "タロンの店 ", // "Talon Shop" - "ゾーラの店 ", // "Zora Shop" - "ゴロン夜の店", // "Goron Night Shop" - "インゴーの店", // "Ingo Store" - "お面屋 ", // "Mask Shop" + T("コキリの店 ", "Kokiri Shop"), T("薬屋 ", "Potion Shop"), T("夜の店 ", "Night Shop"), + T("路地裏の店 ", "Back Alley Shop"), T("盾の店 ", "Shield Shop"), T("大人の店 ", "Adult Shop"), + T("タロンの店 ", "Talon Shop"), T("ゾーラの店 ", "Zora Shop"), T("ゴロン夜の店", "Goron Night Shop"), + T("インゴーの店", "Ingo Store"), T("お面屋 ", "Mask Shop"), }; #endif @@ -610,7 +605,8 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { if (this->actor.params > OSSAN_TYPE_MASK && this->actor.params < OSSAN_TYPE_KOKIRI) { Actor_Kill(&this->actor); PRINTF_COLOR_ERROR(); - PRINTF("引数がおかしいよ(arg_data=%d)!!\n", this->actor.params); + PRINTF(T("引数がおかしいよ(arg_data=%d)!!\n", "The arguments are strange (arg_data=%d)!!\n"), + this->actor.params); PRINTF_RST(); ASSERT(0, "0", "../z_en_oB1.c", 1246); return; @@ -639,7 +635,7 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { if (this->objectSlot1 < 0) { Actor_Kill(&this->actor); PRINTF_COLOR_ERROR(); - PRINTF("バンクが無いよ!!(%s)\n", sShopkeeperPrintName[this->actor.params]); + PRINTF(T("バンクが無いよ!!(%s)\n", "There is no bank!! (%s)\n"), sShopkeeperPrintName[this->actor.params]); PRINTF_RST(); ASSERT(0, "0", "../z_en_oB1.c", 1284); return; @@ -648,7 +644,8 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { if (EnOssan_TryGetObjBankIndices(this, play, objectIds) == 0) { Actor_Kill(&this->actor); PRINTF_COLOR_ERROR(); - PRINTF("予備バンクが無いよ!!(%s)\n", sShopkeeperPrintName[this->actor.params]); + PRINTF(T("予備バンクが無いよ!!(%s)\n", "There is no spare bank!! (%s)\n"), + sShopkeeperPrintName[this->actor.params]); PRINTF_RST(); ASSERT(0, "0", "../z_en_oB1.c", 1295); return; @@ -676,8 +673,8 @@ void EnOssan_UpdateCursorPos(PlayState* play, EnOssan* this) { void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { Player* player = GET_PLAYER(play); - // "End of conversation!" - PRINTF(VT_FGCOL(YELLOW) "%s[%d]:★★★ 会話終了!! ★★★" VT_RST "\n", "../z_en_oB1.c", 1337); + PRINTF(VT_FGCOL(YELLOW) T("%s[%d]:★★★ 会話終了!! ★★★", "%s[%d]:★★★ End of conversation!! ★★★") VT_RST "\n", + "../z_en_oB1.c", 1337); YREG(31) = 0; Actor_TalkOfferAccepted(&this->actor, play); play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; @@ -764,8 +761,7 @@ void EnOssan_State_Idle(EnOssan* this, PlayState* play, Player* player) { this->headTargetRot = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (Actor_TalkOfferAccepted(&this->actor, play)) { - // "Start conversation!!" - PRINTF(VT_FGCOL(YELLOW) "★★★ 会話開始!! ★★★" VT_RST "\n"); + PRINTF(VT_FGCOL(YELLOW) T("★★★ 会話開始!! ★★★", "★★★ Start conversation!! ★★★") VT_RST "\n"); player->stateFlags2 |= PLAYER_STATE2_29; Play_SetShopBrowsingViewpoint(play); EnOssan_SetStateStartShopping(play, this, false); @@ -954,8 +950,7 @@ void EnOssan_State_StartConversation(EnOssan* this, PlayState* play, Player* pla } if (!EnOssan_TestEndInteraction(this, play, &play->state.input[0])) { - // "Shop around by moving the stick left and right" - PRINTF("「スティック左右で品物みてくれ!」\n"); + PRINTF(T("「スティック左右で品物みてくれ!」\n", "「Shop around by moving the stick left and right!」\n")); EnOssan_StartShopping(play, this); } } @@ -1208,7 +1203,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, PlayState* play, Player* playe s32 d; if (!EnOssan_ReturnItemToShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2152); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2152); this->delayTimer = 3; return; } @@ -1267,7 +1262,7 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, PlayState* play, Player* play prevIndex = this->cursorIndex; if (!EnOssan_ReturnItemToShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2244); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2244); this->delayTimer = 3; return; } @@ -1332,7 +1327,7 @@ void EnOssan_State_LookFromShelfToShopkeeper(EnOssan* this, PlayState* play, Pla void EnOssan_State_DisplayOnlyBombDialog(EnOssan* this, PlayState* play, Player* player) { if (!EnOssan_ReturnItemToShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2355); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2355); return; } Math_ApproachF(&this->cameraFaceAngle, 0.0f, 0.5f, 10.0f); @@ -1349,7 +1344,7 @@ void EnOssan_State_DisplayOnlyBombDialog(EnOssan* this, PlayState* play, Player* void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) { Player* player = GET_PLAYER(play); - PRINTF("\n" VT_FGCOL(YELLOW) "初めて手にいれた!!" VT_RST "\n\n"); + PRINTF("\n" VT_FGCOL(YELLOW) T("初めて手にいれた!!", "I got it for the first time!!") VT_RST "\n\n"); Actor_OfferGetItem(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; play->msgCtx.stateTimer = 4; @@ -1359,7 +1354,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) { this->drawCursor = 0; EnOssan_UpdateCameraDirection(this, play, 0.0f); this->stateFlag = OSSAN_STATE_GIVE_ITEM_FANFARE; - PRINTF(VT_FGCOL(YELLOW) "持ち上げ開始!!" VT_RST "\n\n"); + PRINTF(VT_FGCOL(YELLOW) T("持ち上げ開始!!", "Start lifting!!") VT_RST "\n\n"); } void EnOssan_SetStateCantGetItem(PlayState* play, EnOssan* this, u16 textId) { @@ -1511,7 +1506,7 @@ void EnOssan_State_ItemSelected(EnOssan* this, PlayState* play2, Player* player) PlayState* play = play2; // Necessary for OKs if (!EnOssan_TakeItemOffShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2654); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2654); return; } if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && @@ -1532,7 +1527,7 @@ void EnOssan_State_SelectMilkBottle(EnOssan* this, PlayState* play2, Player* pla PlayState* play = play2; // Need for OK if (!EnOssan_TakeItemOffShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2693); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2693); return; } if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && @@ -1553,7 +1548,7 @@ void EnOssan_State_SelectWeirdEgg(EnOssan* this, PlayState* play2, Player* playe PlayState* play = play2; // Needed for OK if (!EnOssan_TakeItemOffShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2732); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2732); return; } if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && @@ -1572,7 +1567,7 @@ void EnOssan_State_SelectWeirdEgg(EnOssan* this, PlayState* play2, Player* playe void EnOssan_State_SelectUnimplementedItem(EnOssan* this, PlayState* play, Player* player) { if (!EnOssan_TakeItemOffShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2771); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2771); return; } if (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT && Message_ShouldAdvance(play)) { @@ -1583,10 +1578,10 @@ void EnOssan_State_SelectUnimplementedItem(EnOssan* this, PlayState* play, Playe void EnOssan_State_SelectBombs(EnOssan* this, PlayState* play, Player* player) { if (!EnOssan_TakeItemOffShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2798); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2798); return; } - PRINTF("店主の依頼 ( %d )\n", GET_INFTABLE(INFTABLE_FC)); + PRINTF(T("店主の依頼 ( %d )\n", "Shopkeeper's request ( %d )\n"), GET_INFTABLE(INFTABLE_FC)); if (this->actor.params != OSSAN_TYPE_GORON) { EnOssan_State_ItemSelected(this, play, player); return; @@ -1610,7 +1605,7 @@ void EnOssan_State_SelectMaskItem(EnOssan* this, PlayState* play, Player* player EnGirlA* item = this->shelfSlots[this->cursorIndex]; if (!EnOssan_TakeItemOffShelf(this)) { - PRINTF("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", "../z_en_oB1.c", 2845); + PRINTF("%s[%d]:" VT_FGCOL(GREEN) T("ズーム中!!", "Zooming!!") VT_RST "\n", "../z_en_oB1.c", 2845); return; } if (talkState == TEXT_STATE_EVENT) { @@ -1727,7 +1722,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player switch (play->msgCtx.choiceIndex) { case 0: - PRINTF(VT_FGCOL(YELLOW) "★★★ 続けるよ!! ★★★" VT_RST "\n"); + PRINTF(VT_FGCOL(YELLOW) T("★★★ 続けるよ!! ★★★", "★★★ I will continue!! ★★★") VT_RST "\n"); player->actor.shape.rot.y += 0x8000; player->stateFlags2 |= PLAYER_STATE2_29; Play_SetViewpoint(play, VIEWPOINT_PIVOT); @@ -1737,7 +1732,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player break; case 1: default: - PRINTF(VT_FGCOL(YELLOW) "★★★ やめるよ!! ★★★" VT_RST "\n"); + PRINTF(VT_FGCOL(YELLOW) T("★★★ やめるよ!! ★★★", "★★★ I'm quitting!! ★★★") VT_RST "\n"); EnOssan_EndInteraction(play, this); break; } @@ -2024,7 +2019,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; @@ -2035,7 +2030,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; @@ -2044,7 +2039,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; @@ -2144,14 +2139,14 @@ void EnOssan_InitActionFunc(EnOssan* this, PlayState* play) { if (this->shelves == NULL) { PRINTF_COLOR_ERROR(); - // "Warning!! There are no shelves!!" - PRINTF("★★★ 警告!! 棚がないよ!! ★★★\n"); + PRINTF(T("★★★ 警告!! 棚がないよ!! ★★★\n", "★★★ Warning!! There are no shelves!! ★★★\n")); PRINTF_RST(); return; } - // "Shopkeeper (params) init" - PRINTF(VT_FGCOL(YELLOW) "◇◇◇ 店のおやじ( %d ) 初期設定 ◇◇◇" VT_RST "\n", this->actor.params); + PRINTF(VT_FGCOL(YELLOW) T("◇◇◇ 店のおやじ( %d ) 初期設定 ◇◇◇", "◇◇◇ Shopkeeper ( %d ) initial setting ◇◇◇") + VT_RST "\n", + this->actor.params); this->actor.world.pos.x += sShopkeeperPositionOffsets[this->actor.params].x; this->actor.world.pos.y += sShopkeeperPositionOffsets[this->actor.params].y; @@ -2227,7 +2222,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) { @@ -2397,7 +2392,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 7df4be57b8..e1b9e4691d 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -2,7 +2,7 @@ #define Z_EN_OSSAN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnOssan; 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 827bf75c03..cd5da7dd2f 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -11,6 +11,7 @@ #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" @@ -19,11 +20,12 @@ #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 "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_owl/object_owl.h" #include "assets/scenes/overworld/spot06/spot06_scene.h" 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 2f9e0939f8..5ba352a4c4 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.h +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.h @@ -2,7 +2,7 @@ #define Z_EN_OWL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" 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 c10a8edcb4..27956fd3d4 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -15,9 +15,9 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.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 405e795e75..e6b618fcb9 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.h +++ b/src/overlays/actors/ovl_En_Part/z_en_part.h @@ -2,7 +2,7 @@ #define Z_EN_PART_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnPart; 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 2246b3df16..a4225d0ff4 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -12,10 +12,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_peehat/object_peehat.h" @@ -137,48 +137,48 @@ static ColliderQuadInit sQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum DamageEffect { - /* 00 */ PEAHAT_DMG_EFF_ATTACK = 0, - /* 06 */ PEAHAT_DMG_EFF_LIGHT_ICE_ARROW = 6, - /* 12 */ PEAHAT_DMG_EFF_FIRE = 12, - /* 13 */ PEAHAT_DMG_EFF_HOOKSHOT = 13, - /* 14 */ PEAHAT_DMG_EFF_BOOMERANG = 14, - /* 15 */ PEAHAT_DMG_EFF_NUT = 15 -} DamageEffect; +typedef enum EnPeehatDamageReaction { + /* 00 */ PEAHAT_DMG_REACT_ATTACK = 0, + /* 06 */ PEAHAT_DMG_REACT_LIGHT_ICE_ARROW = 6, + /* 12 */ PEAHAT_DMG_REACT_FIRE = 12, + /* 13 */ PEAHAT_DMG_REACT_HOOKSHOT = 13, + /* 14 */ PEAHAT_DMG_REACT_BOOMERANG = 14, + /* 15 */ PEAHAT_DMG_REACT_NUT = 15 +} EnPeehatDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, PEAHAT_DMG_EFF_NUT), - /* Deku stick */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Slingshot */ DMG_ENTRY(1, PEAHAT_DMG_EFF_ATTACK), - /* Explosive */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Boomerang */ DMG_ENTRY(0, PEAHAT_DMG_EFF_BOOMERANG), - /* Normal arrow */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Hammer swing */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Hookshot */ DMG_ENTRY(2, PEAHAT_DMG_EFF_HOOKSHOT), - /* Kokiri sword */ DMG_ENTRY(1, PEAHAT_DMG_EFF_ATTACK), - /* Master sword */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Giant's Knife */ DMG_ENTRY(4, PEAHAT_DMG_EFF_ATTACK), - /* Fire arrow */ DMG_ENTRY(4, PEAHAT_DMG_EFF_FIRE), - /* Ice arrow */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Light arrow */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Unk arrow 1 */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Unk arrow 2 */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Unk arrow 3 */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Fire magic */ DMG_ENTRY(3, PEAHAT_DMG_EFF_FIRE), - /* Ice magic */ DMG_ENTRY(0, PEAHAT_DMG_EFF_LIGHT_ICE_ARROW), - /* Light magic */ DMG_ENTRY(0, PEAHAT_DMG_EFF_LIGHT_ICE_ARROW), - /* Shield */ DMG_ENTRY(0, PEAHAT_DMG_EFF_ATTACK), - /* Mirror Ray */ DMG_ENTRY(0, PEAHAT_DMG_EFF_ATTACK), - /* Kokiri spin */ DMG_ENTRY(1, PEAHAT_DMG_EFF_ATTACK), - /* Giant spin */ DMG_ENTRY(4, PEAHAT_DMG_EFF_ATTACK), - /* Master spin */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Kokiri jump */ DMG_ENTRY(2, PEAHAT_DMG_EFF_ATTACK), - /* Giant jump */ DMG_ENTRY(8, PEAHAT_DMG_EFF_ATTACK), - /* Master jump */ DMG_ENTRY(4, PEAHAT_DMG_EFF_ATTACK), - /* Unknown 1 */ DMG_ENTRY(0, PEAHAT_DMG_EFF_ATTACK), - /* Unblockable */ DMG_ENTRY(0, PEAHAT_DMG_EFF_ATTACK), - /* Hammer jump */ DMG_ENTRY(4, PEAHAT_DMG_EFF_ATTACK), - /* Unknown 2 */ DMG_ENTRY(0, PEAHAT_DMG_EFF_ATTACK), + /* Deku nut */ DMG_ENTRY(0, PEAHAT_DMG_REACT_NUT), + /* Deku stick */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Slingshot */ DMG_ENTRY(1, PEAHAT_DMG_REACT_ATTACK), + /* Explosive */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Boomerang */ DMG_ENTRY(0, PEAHAT_DMG_REACT_BOOMERANG), + /* Normal arrow */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Hammer swing */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Hookshot */ DMG_ENTRY(2, PEAHAT_DMG_REACT_HOOKSHOT), + /* Kokiri sword */ DMG_ENTRY(1, PEAHAT_DMG_REACT_ATTACK), + /* Master sword */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Giant's Knife */ DMG_ENTRY(4, PEAHAT_DMG_REACT_ATTACK), + /* Fire arrow */ DMG_ENTRY(4, PEAHAT_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Light arrow */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Unk arrow 1 */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Unk arrow 2 */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Unk arrow 3 */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Fire magic */ DMG_ENTRY(3, PEAHAT_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(0, PEAHAT_DMG_REACT_LIGHT_ICE_ARROW), + /* Light magic */ DMG_ENTRY(0, PEAHAT_DMG_REACT_LIGHT_ICE_ARROW), + /* Shield */ DMG_ENTRY(0, PEAHAT_DMG_REACT_ATTACK), + /* Mirror Ray */ DMG_ENTRY(0, PEAHAT_DMG_REACT_ATTACK), + /* Kokiri spin */ DMG_ENTRY(1, PEAHAT_DMG_REACT_ATTACK), + /* Giant spin */ DMG_ENTRY(4, PEAHAT_DMG_REACT_ATTACK), + /* Master spin */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Kokiri jump */ DMG_ENTRY(2, PEAHAT_DMG_REACT_ATTACK), + /* Giant jump */ DMG_ENTRY(8, PEAHAT_DMG_REACT_ATTACK), + /* Master jump */ DMG_ENTRY(4, PEAHAT_DMG_REACT_ATTACK), + /* Unknown 1 */ DMG_ENTRY(0, PEAHAT_DMG_REACT_ATTACK), + /* Unblockable */ DMG_ENTRY(0, PEAHAT_DMG_REACT_ATTACK), + /* Hammer jump */ DMG_ENTRY(4, PEAHAT_DMG_REACT_ATTACK), + /* Unknown 2 */ DMG_ENTRY(0, PEAHAT_DMG_REACT_ATTACK), }; typedef enum PeahatState { @@ -902,13 +902,13 @@ void EnPeehat_Adult_CollisionCheck(EnPeehat* this, PlayState* play) { } 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) { + if (this->actor.colChkInfo.damageReaction == PEAHAT_DMG_REACT_NUT || + this->actor.colChkInfo.damageReaction == PEAHAT_DMG_REACT_LIGHT_ICE_ARROW) { return; } - if (this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_HOOKSHOT) { + if (this->actor.colChkInfo.damageReaction == PEAHAT_DMG_REACT_HOOKSHOT) { this->actor.colChkInfo.health = 0; - } else if (this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_BOOMERANG) { + } else if (this->actor.colChkInfo.damageReaction == PEAHAT_DMG_REACT_BOOMERANG) { if (this->state != PEAHAT_STATE_STUNNED) { EnPeehat_SetStateBoomerangStunned(this); } @@ -919,7 +919,7 @@ void EnPeehat_Adult_CollisionCheck(EnPeehat* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_DAMAGE); } - if (this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_FIRE) { + if (this->actor.colChkInfo.damageReaction == PEAHAT_DMG_REACT_FIRE) { Vec3f pos; s32 i; for (i = 4; i >= 0; i--) { @@ -949,7 +949,7 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) { if (thisx->params <= 0) { EnPeehat_Adult_CollisionCheck(this, play); } - if (thisx->colChkInfo.damageEffect != PEAHAT_DMG_EFF_LIGHT_ICE_ARROW) { + if (thisx->colChkInfo.damageReaction != PEAHAT_DMG_REACT_LIGHT_ICE_ARROW) { if (thisx->speed != 0.0f || thisx->velocity.y != 0.0f) { Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 25.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); 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 deb24089f6..2f554ef29e 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 "z64actor.h" +#include "actor.h" typedef enum PeahatType { /* -1 */ PEAHAT_TYPE_GROUNDED = -1, 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 57ef9a85b6..caf492b8be 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 @@ -14,8 +14,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64light.h" -#include "z64play.h" +#include "light.h" +#include "play_state.h" #include "assets/objects/object_po_field/object_po_field.h" @@ -43,7 +43,7 @@ ActorProfile En_Po_Desert_Profile = { /**/ EnPoDesert_Draw, }; -static ColliderCylinderInit sColliderInit = { +static ColliderCylinderInit sColliderCylinderInit = { { COL_MATERIAL_HIT3, AT_NONE, @@ -76,7 +76,7 @@ void EnPoDesert_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_Init(play, &this->skelAnime, &gPoeFieldSkel, &gPoeFieldFloatAnim, this->jointTable, this->morphTable, 10); Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderInit); + Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit); this->lightColor.r = 255; this->lightColor.g = 255; this->lightColor.b = 210; @@ -226,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; @@ -246,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 3f93eeb01d..729388ca19 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,8 +2,8 @@ #define Z_EN_PO_DESERT_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnPoDesert; 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 30218e20e5..2989292f7f 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 @@ -14,11 +14,11 @@ #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 "effect.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_po_field/object_po_field.h" @@ -744,7 +744,7 @@ void EnPoField_SoulInteract(EnPoField* this, PlayState* play) { void EnPoField_TestForDamage(EnPoField* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { + if (this->actor.colChkInfo.damageReaction != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DEAD); 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 17e08ee999..06f36af808 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,8 +2,8 @@ #define Z_EN_PO_FIELD_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnPoField; 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 983dbf0d71..b2effdffed 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 @@ -17,11 +17,11 @@ #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 "effect.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_tk/object_tk.h" 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 e4a440d940..483208f9f0 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,8 +2,8 @@ #define Z_EN_PO_RELAY_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnPoRelay; 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 0f24ad4d0d..fcd5a3ce27 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 @@ -6,6 +6,7 @@ #include "z_en_po_sisters.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "one_point_cutscene.h" @@ -16,11 +17,11 @@ #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 "audio.h" +#include "effect.h" +#include "light.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_po_sisters/object_po_sisters.h" @@ -1165,15 +1166,15 @@ void func_80ADC10C(EnPoSisters* this, PlayState* play) { Item_DropCollectible(play, &sp24, ITEM00_ARROWS_SMALL); } } else if (this->collider.base.colMaterial == COL_MATERIAL_METAL || - (this->actor.colChkInfo.damageEffect == 0 && this->actor.colChkInfo.damage == 0)) { + (this->actor.colChkInfo.damageReaction == 0 && this->actor.colChkInfo.damage == 0)) { if (this->unk_194 == 0) { this->actor.freezeTimer = 0; } - } else if (this->actor.colChkInfo.damageEffect == 0xF) { + } else if (this->actor.colChkInfo.damageReaction == 0xF) { this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 |= 2; func_80AD98F4(this, play); - } else if (this->unk_194 == 0 && this->actor.colChkInfo.damageEffect == 0xE && + } else if (this->unk_194 == 0 && this->actor.colChkInfo.damageReaction == 0xE && this->actionFunc == func_80ADB770) { if (this->unk_19C == 0) { this->unk_19C = -45; 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 bc25e9d035..fdfd734360 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,8 +2,8 @@ #define Z_EN_PO_SISTERS_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnPoSisters; 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 fceb18ef7c..b6e7232852 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -14,11 +14,11 @@ #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 "effect.h" +#include "light.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_poh/object_poh.h" #include "assets/objects/object_po_composer/object_po_composer.h" @@ -880,7 +880,7 @@ void EnPoh_TalkComposer(EnPoh* this, PlayState* play) { void func_80AE032C(EnPoh* this, PlayState* play) { 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->actor.colChkInfo.damageReaction != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DEAD); 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 7e7db7d997..6973719638 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -2,8 +2,8 @@ #define Z_EN_POH_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct EnPoh; 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 e984f316f7..5f72ceeb4d 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 @@ -8,7 +8,7 @@ #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_pu_box/object_pu_box.h" 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 cd15c66c18..c128c86dfb 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 "z64actor.h" +#include "actor.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 af9ed8f112..3091697443 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -16,10 +16,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_rd/object_rd.h" @@ -108,48 +108,48 @@ static ColliderCylinderInit sCylinderInit = { { 20, 70, 0, { 0, 0, 0 } }, }; -typedef enum EnRdDamageEffect { - /* 0x0 */ REDEAD_DMGEFF_NONE, // Does not interact with the Gibdo/Redead at all - /* 0x1 */ REDEAD_DMGEFF_HOOKSHOT, // Stuns the Gibdo/Redead - /* 0x6 */ REDEAD_DMGEFF_ICE_MAGIC = 0x6, // Does not interact with the Gibdo/Redead at all - /* 0xD */ REDEAD_DMGEFF_LIGHT_MAGIC = 0xD, // Stuns the Gibdo/Redead - /* 0xE */ REDEAD_DMGEFF_FIRE_MAGIC, // Applies a fire effect - /* 0xF */ REDEAD_DMGEFF_DAMAGE // Deals damage without stunning or applying an effect -} EnRdDamageEffect; +typedef enum EnRdDamageReaction { + /* 0x0 */ REDEAD_DMG_REACT_NONE, // Does not interact with the Gibdo/Redead at all + /* 0x1 */ REDEAD_DMG_REACT_HOOKSHOT, // Stuns the Gibdo/Redead + /* 0x6 */ REDEAD_DMG_REACT_ICE_MAGIC = 0x6, // Does not interact with the Gibdo/Redead at all + /* 0xD */ REDEAD_DMG_REACT_LIGHT_MAGIC = 0xD, // Stuns the Gibdo/Redead + /* 0xE */ REDEAD_DMG_REACT_FIRE_MAGIC, // Applies a fire effect + /* 0xF */ REDEAD_DMG_REACT_DAMAGE // Deals damage without stunning or applying an effect +} EnRdDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Deku stick */ DMG_ENTRY(2, REDEAD_DMGEFF_DAMAGE), - /* Slingshot */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Explosive */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Normal arrow */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, REDEAD_DMGEFF_DAMAGE), - /* Hookshot */ DMG_ENTRY(0, REDEAD_DMGEFF_HOOKSHOT), - /* Kokiri sword */ DMG_ENTRY(1, REDEAD_DMGEFF_DAMAGE), - /* Master sword */ DMG_ENTRY(2, REDEAD_DMGEFF_DAMAGE), - /* Giant's Knife */ DMG_ENTRY(4, REDEAD_DMGEFF_DAMAGE), - /* Fire arrow */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Ice arrow */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Light arrow */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Unk arrow 1 */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(4, REDEAD_DMGEFF_FIRE_MAGIC), - /* Ice magic */ DMG_ENTRY(0, REDEAD_DMGEFF_ICE_MAGIC), - /* Light magic */ DMG_ENTRY(3, REDEAD_DMGEFF_LIGHT_MAGIC), - /* Shield */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, REDEAD_DMGEFF_DAMAGE), - /* Giant spin */ DMG_ENTRY(4, REDEAD_DMGEFF_DAMAGE), - /* Master spin */ DMG_ENTRY(2, REDEAD_DMGEFF_DAMAGE), - /* Kokiri jump */ DMG_ENTRY(2, REDEAD_DMGEFF_DAMAGE), - /* Giant jump */ DMG_ENTRY(8, REDEAD_DMGEFF_DAMAGE), - /* Master jump */ DMG_ENTRY(4, REDEAD_DMGEFF_DAMAGE), - /* Unknown 1 */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, REDEAD_DMGEFF_DAMAGE), - /* Unknown 2 */ DMG_ENTRY(0, REDEAD_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Deku stick */ DMG_ENTRY(2, REDEAD_DMG_REACT_DAMAGE), + /* Slingshot */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Explosive */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Normal arrow */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, REDEAD_DMG_REACT_DAMAGE), + /* Hookshot */ DMG_ENTRY(0, REDEAD_DMG_REACT_HOOKSHOT), + /* Kokiri sword */ DMG_ENTRY(1, REDEAD_DMG_REACT_DAMAGE), + /* Master sword */ DMG_ENTRY(2, REDEAD_DMG_REACT_DAMAGE), + /* Giant's Knife */ DMG_ENTRY(4, REDEAD_DMG_REACT_DAMAGE), + /* Fire arrow */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Ice arrow */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Light arrow */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Unk arrow 1 */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(4, REDEAD_DMG_REACT_FIRE_MAGIC), + /* Ice magic */ DMG_ENTRY(0, REDEAD_DMG_REACT_ICE_MAGIC), + /* Light magic */ DMG_ENTRY(3, REDEAD_DMG_REACT_LIGHT_MAGIC), + /* Shield */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, REDEAD_DMG_REACT_DAMAGE), + /* Giant spin */ DMG_ENTRY(4, REDEAD_DMG_REACT_DAMAGE), + /* Master spin */ DMG_ENTRY(2, REDEAD_DMG_REACT_DAMAGE), + /* Kokiri jump */ DMG_ENTRY(2, REDEAD_DMG_REACT_DAMAGE), + /* Giant jump */ DMG_ENTRY(8, REDEAD_DMG_REACT_DAMAGE), + /* Master jump */ DMG_ENTRY(4, REDEAD_DMG_REACT_DAMAGE), + /* Unknown 1 */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, REDEAD_DMG_REACT_DAMAGE), + /* Unknown 2 */ DMG_ENTRY(0, REDEAD_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -768,7 +768,7 @@ void EnRd_SetupStunned(EnRd* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, COLORFILTER_INTENSITY_FLAG | 200, COLORFILTER_BUFFLAG_OPA, 255); - } else if (this->damageEffect == REDEAD_DMGEFF_HOOKSHOT) { + } else if (this->damageReaction == REDEAD_DMG_REACT_HOOKSHOT) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80); } else { Actor_PlaySfx(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); @@ -835,7 +835,7 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - this->damageEffect = this->actor.colChkInfo.damageEffect; + this->damageReaction = this->actor.colChkInfo.damageReaction; if (this->action != REDEAD_ACTION_RISE_FROM_COFFIN) { Actor_SetDropFlag(&this->actor, &this->collider.elem, true); @@ -843,9 +843,10 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) { this->unk_31D = player->unk_845; } - if ((this->damageEffect != REDEAD_DMGEFF_NONE) && (this->damageEffect != REDEAD_DMGEFF_ICE_MAGIC)) { - if (((this->damageEffect == REDEAD_DMGEFF_HOOKSHOT) || - (this->damageEffect == REDEAD_DMGEFF_LIGHT_MAGIC)) && + if ((this->damageReaction != REDEAD_DMG_REACT_NONE) && + (this->damageReaction != REDEAD_DMG_REACT_ICE_MAGIC)) { + if (((this->damageReaction == REDEAD_DMG_REACT_HOOKSHOT) || + (this->damageReaction == REDEAD_DMG_REACT_LIGHT_MAGIC)) && (this->action != REDEAD_ACTION_STUNNED)) { Actor_ApplyDamage(&this->actor); EnRd_SetupStunned(this); @@ -855,7 +856,7 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) { this->stunnedBySunsSong = false; this->sunsSongStunTimer = 0; - if (this->damageEffect == REDEAD_DMGEFF_FIRE_MAGIC) { + if (this->damageReaction == REDEAD_DMG_REACT_FIRE_MAGIC) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 80); this->fireTimer = 40; } else { @@ -887,8 +888,8 @@ void EnRd_Update(Actor* thisx, PlayState* play) { gSaveContext.sunsSongState = SUNSSONG_INACTIVE; } - if (this->damageEffect != REDEAD_DMGEFF_ICE_MAGIC && - ((this->action != REDEAD_ACTION_RISE_FROM_COFFIN) || (this->damageEffect != REDEAD_DMGEFF_FIRE_MAGIC))) { + if (this->damageReaction != REDEAD_DMG_REACT_ICE_MAGIC && + ((this->action != REDEAD_ACTION_RISE_FROM_COFFIN) || (this->damageReaction != REDEAD_DMG_REACT_FIRE_MAGIC))) { if (this->playerStunWaitTimer != 0) { this->playerStunWaitTimer--; } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 5e9f328dee..1e85e119f8 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -2,7 +2,7 @@ #define Z_EN_RD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnRd; @@ -71,7 +71,7 @@ typedef struct EnRd { /* 0x0319 */ u8 grabDamageTimer; /* 0x031A */ u8 fireTimer; /* 0x031B */ u8 action; - /* 0x031C */ u8 damageEffect; + /* 0x031C */ u8 damageReaction; /* 0x031D */ u8 unk_31D; // related to player->unk_845 /* 0x0320 */ ColliderCylinder collider; } EnRd; // size = 0x036C 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 fb3f20bc6c..1cb43e2481 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -12,16 +12,18 @@ #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 "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "debug_display.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_reeba/object_reeba.h" @@ -47,49 +49,49 @@ void EnReeba_Die(EnReeba* this, PlayState* play); void EnReeba_Stunned(EnReeba* this, PlayState* play); void EnReeba_StunDie(EnReeba* this, PlayState* play); -typedef enum LeeverDamageEffect { - /* 0x00 */ LEEVER_DMGEFF_NONE, // used by anything that cant kill the Leever - /* 0x01 */ LEEVER_DMGEFF_UNK, // used by "unknown 1" attack - /* 0x03 */ LEEVER_DMGEFF_ICE = 3, - /* 0x0B */ LEEVER_DMGEFF_UNUSED = 11, // not used in the damage table, but still checked for. - /* 0x0C */ LEEVER_DMGEFF_BOOMERANG, - /* 0x0D */ LEEVER_DMGEFF_HOOKSHOT, - /* 0x0E */ LEEVER_DMGEFF_OTHER -} LeeverDamageEffect; +typedef enum LeeverDamageReaction { + /* 0x00 */ LEEVER_DMG_REACT_NONE, // used by anything that cant kill the Leever + /* 0x01 */ LEEVER_DMG_REACT_UNK, // used by "unknown 1" attack + /* 0x03 */ LEEVER_DMG_REACT_ICE = 3, + /* 0x0B */ LEEVER_DMG_REACT_UNUSED = 11, // not used in the damage table, but still checked for. + /* 0x0C */ LEEVER_DMG_REACT_BOOMERANG, + /* 0x0D */ LEEVER_DMG_REACT_HOOKSHOT, + /* 0x0E */ LEEVER_DMG_REACT_OTHER +} LeeverDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), - /* Deku stick */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Slingshot */ DMG_ENTRY(1, LEEVER_DMGEFF_OTHER), - /* Explosive */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Boomerang */ DMG_ENTRY(1, LEEVER_DMGEFF_BOOMERANG), - /* Normal arrow */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Hammer swing */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Hookshot */ DMG_ENTRY(2, LEEVER_DMGEFF_HOOKSHOT), - /* Kokiri sword */ DMG_ENTRY(1, LEEVER_DMGEFF_OTHER), - /* Master sword */ DMG_ENTRY(4, LEEVER_DMGEFF_OTHER), - /* Giant's Knife */ DMG_ENTRY(6, LEEVER_DMGEFF_OTHER), - /* Fire arrow */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Ice arrow */ DMG_ENTRY(4, LEEVER_DMGEFF_ICE), - /* Light arrow */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Unk arrow 1 */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Unk arrow 2 */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Unk arrow 3 */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Fire magic */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), - /* Ice magic */ DMG_ENTRY(4, LEEVER_DMGEFF_ICE), - /* Light magic */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), - /* Shield */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Giant spin */ DMG_ENTRY(8, LEEVER_DMGEFF_OTHER), - /* Master spin */ DMG_ENTRY(4, LEEVER_DMGEFF_OTHER), - /* Kokiri jump */ DMG_ENTRY(2, LEEVER_DMGEFF_OTHER), - /* Giant jump */ DMG_ENTRY(8, LEEVER_DMGEFF_OTHER), - /* Master jump */ DMG_ENTRY(4, LEEVER_DMGEFF_OTHER), - /* Unknown 1 */ DMG_ENTRY(0, LEEVER_DMGEFF_UNK), - /* Unblockable */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, LEEVER_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), + /* Deku stick */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Slingshot */ DMG_ENTRY(1, LEEVER_DMG_REACT_OTHER), + /* Explosive */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Boomerang */ DMG_ENTRY(1, LEEVER_DMG_REACT_BOOMERANG), + /* Normal arrow */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Hammer swing */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Hookshot */ DMG_ENTRY(2, LEEVER_DMG_REACT_HOOKSHOT), + /* Kokiri sword */ DMG_ENTRY(1, LEEVER_DMG_REACT_OTHER), + /* Master sword */ DMG_ENTRY(4, LEEVER_DMG_REACT_OTHER), + /* Giant's Knife */ DMG_ENTRY(6, LEEVER_DMG_REACT_OTHER), + /* Fire arrow */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Ice arrow */ DMG_ENTRY(4, LEEVER_DMG_REACT_ICE), + /* Light arrow */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Unk arrow 1 */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Unk arrow 2 */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Unk arrow 3 */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Fire magic */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), + /* Ice magic */ DMG_ENTRY(4, LEEVER_DMG_REACT_ICE), + /* Light magic */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), + /* Shield */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Giant spin */ DMG_ENTRY(8, LEEVER_DMG_REACT_OTHER), + /* Master spin */ DMG_ENTRY(4, LEEVER_DMG_REACT_OTHER), + /* Kokiri jump */ DMG_ENTRY(2, LEEVER_DMG_REACT_OTHER), + /* Giant jump */ DMG_ENTRY(8, LEEVER_DMG_REACT_OTHER), + /* Master jump */ DMG_ENTRY(4, LEEVER_DMG_REACT_OTHER), + /* Unknown 1 */ DMG_ENTRY(0, LEEVER_DMG_REACT_UNK), + /* Unblockable */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, LEEVER_DMG_REACT_NONE), }; ActorProfile En_Reeba_Profile = { @@ -146,8 +148,8 @@ void EnReeba_Init(Actor* thisx, PlayState* play) { this->scale *= 1.5f; this->collider.dim.radius = 35; this->collider.dim.height = 45; - // "Reeba Boss Appears %f" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ リーバぼす登場 ☆☆☆☆☆ %f\n" VT_RST, this->scale); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ リーバぼす登場 ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Reeba boss appears ☆☆☆☆☆ %f\n") VT_RST, + this->scale); this->actor.colChkInfo.health = 20; this->collider.elem.atDmgInfo.effect = 4; this->collider.elem.atDmgInfo.damage = 16; @@ -519,9 +521,10 @@ void EnReeba_Die(EnReeba* this, PlayState* play) { if (spawner->killCount < 10) { spawner->killCount++; } - // "How many are dead?" PRINTF("\n\n"); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 何匹DEAD? ☆☆☆☆☆%d\n" VT_RST, spawner->killCount); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 何匹DEAD? ☆☆☆☆☆%d\n", "☆☆☆☆☆ How many are DEAD? ☆☆☆☆☆%d\n") + VT_RST, + spawner->killCount); PRINTF("\n\n"); } @@ -554,9 +557,9 @@ void EnReeba_CheckDamage(EnReeba* this, PlayState* play) { this->actor.shape.rot.x = this->actor.shape.rot.z = 0; this->stunType = LEEVER_STUN_NONE; - switch (this->actor.colChkInfo.damageEffect) { - case LEEVER_DMGEFF_UNUSED: - case LEEVER_DMGEFF_BOOMERANG: + switch (this->actor.colChkInfo.damageReaction) { + case LEEVER_DMG_REACT_UNUSED: + case LEEVER_DMG_REACT_BOOMERANG: if ((this->actor.colChkInfo.health > 1) && (this->stunType != LEEVER_STUN_OTHER)) { this->stunType = LEEVER_STUN_OTHER; Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -566,7 +569,7 @@ void EnReeba_CheckDamage(EnReeba* this, PlayState* play) { break; } FALLTHROUGH; - case LEEVER_DMGEFF_HOOKSHOT: + case LEEVER_DMG_REACT_HOOKSHOT: if ((this->actor.colChkInfo.health > 2) && (this->stunType != LEEVER_STUN_OTHER)) { this->stunType = LEEVER_STUN_OTHER; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, @@ -576,7 +579,7 @@ void EnReeba_CheckDamage(EnReeba* this, PlayState* play) { break; } FALLTHROUGH; - case LEEVER_DMGEFF_OTHER: + case LEEVER_DMG_REACT_OTHER: this->unkDamageField = 6; Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { @@ -592,7 +595,7 @@ void EnReeba_CheckDamage(EnReeba* this, PlayState* play) { } break; - case LEEVER_DMGEFF_ICE: + case LEEVER_DMG_REACT_ICE: Actor_ApplyDamage(&this->actor); this->unkDamageField = 2; this->stunType = LEEVER_STUN_ICE; @@ -600,7 +603,7 @@ void EnReeba_CheckDamage(EnReeba* this, PlayState* play) { this->actionfunc = EnReeba_SetupStunned; break; - case LEEVER_DMGEFF_UNK: + case LEEVER_DMG_REACT_UNK: if (this->stunType != LEEVER_STUN_OTHER) { this->stunType = LEEVER_STUN_OTHER; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 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 a357af86ef..9f4ba8c07d 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h @@ -2,7 +2,7 @@ #define Z_EN_REEBA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnReeba; 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 871cf6668f..1b1d066b00 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 @@ -10,10 +10,10 @@ #include "sequence.h" #include "sfx.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) 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 4332af6021..1b9622ae53 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 "z64actor.h" +#include "actor.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 56e27591fc..83b51453e5 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -8,13 +8,15 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_rl/object_rl.h" @@ -349,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); @@ -398,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 9ce9949aa6..b06f3fff09 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.h +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.h @@ -2,7 +2,7 @@ #define Z_EN_RL_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnRl; 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 07bb916640..5ed4a1ea37 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -10,18 +10,20 @@ #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 "translation.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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_rr/object_rr.h" @@ -43,18 +45,18 @@ typedef enum EnRrReachState { /* 5 */ REACH_CLOSE } EnRrReachState; -typedef enum EnRrDamageEffect { - /* 0x0 */ RR_DMG_NONE, - /* 0x1 */ RR_DMG_STUN, - /* 0x2 */ RR_DMG_FIRE, - /* 0x3 */ RR_DMG_ICE, - /* 0x4 */ RR_DMG_LIGHT_MAGIC, - /* 0xB */ RR_DMG_LIGHT_ARROW = 11, - /* 0xC */ RR_DMG_SHDW_ARROW, - /* 0xD */ RR_DMG_WIND_ARROW, - /* 0xE */ RR_DMG_SPRT_ARROW, - /* 0xF */ RR_DMG_NORMAL -} EnRrDamageEffect; +typedef enum EnRrDamageReaction { + /* 0x0 */ RR_DMG_REACT_NONE, + /* 0x1 */ RR_DMG_REACT_STUN, + /* 0x2 */ RR_DMG_REACT_FIRE, + /* 0x3 */ RR_DMG_REACT_ICE, + /* 0x4 */ RR_DMG_REACT_LIGHT_MAGIC, + /* 0xB */ RR_DMG_REACT_LIGHT_ARROW = 11, + /* 0xC */ RR_DMG_REACT_SHDW_ARROW, + /* 0xD */ RR_DMG_REACT_WIND_ARROW, + /* 0xE */ RR_DMG_REACT_SPRT_ARROW, + /* 0xF */ RR_DMG_REACT_NORMAL +} EnRrDamageReaction; typedef enum EnRrDropType { /* 0 */ RR_DROP_RANDOM_RUPEE, @@ -97,8 +99,8 @@ ActorProfile En_Rr_Profile = { #if DEBUG_FEATURES static char* sDropNames[] = { - // "type 7", "small magic jar", "arrow", "fairy", "20 rupees", "50 rupees" - "タイプ7 ", "魔法の壷小", "矢 ", "妖精 ", "20ルピー ", "50ルピー ", + T("タイプ7 ", "Type 7 "), T("魔法の壷小", "Small magic jar"), T("矢 ", "Arrow "), + T("妖精 ", "Fairy "), T("20ルピー ", "20 rupees "), T("50ルピー ", "50 rupees "), }; #endif @@ -141,38 +143,38 @@ static ColliderCylinderInitType1 sCylinderInit2 = { }; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, RR_DMG_NONE), - /* Deku stick */ DMG_ENTRY(2, RR_DMG_NORMAL), - /* Slingshot */ DMG_ENTRY(1, RR_DMG_NORMAL), - /* Explosive */ DMG_ENTRY(2, RR_DMG_NORMAL), - /* Boomerang */ DMG_ENTRY(0, RR_DMG_STUN), - /* Normal arrow */ DMG_ENTRY(2, RR_DMG_NORMAL), - /* Hammer swing */ DMG_ENTRY(2, RR_DMG_NORMAL), - /* Hookshot */ DMG_ENTRY(0, RR_DMG_STUN), - /* Kokiri sword */ DMG_ENTRY(1, RR_DMG_NORMAL), - /* Master sword */ DMG_ENTRY(2, RR_DMG_NORMAL), - /* Giant's Knife */ DMG_ENTRY(4, RR_DMG_NORMAL), - /* Fire arrow */ DMG_ENTRY(4, RR_DMG_FIRE), - /* Ice arrow */ DMG_ENTRY(4, RR_DMG_ICE), - /* Light arrow */ DMG_ENTRY(15, RR_DMG_LIGHT_ARROW), - /* Unk arrow 1 */ DMG_ENTRY(4, RR_DMG_WIND_ARROW), - /* Unk arrow 2 */ DMG_ENTRY(15, RR_DMG_SHDW_ARROW), - /* Unk arrow 3 */ DMG_ENTRY(15, RR_DMG_SPRT_ARROW), - /* Fire magic */ DMG_ENTRY(4, RR_DMG_FIRE), - /* Ice magic */ DMG_ENTRY(3, RR_DMG_ICE), - /* Light magic */ DMG_ENTRY(10, RR_DMG_LIGHT_MAGIC), - /* Shield */ DMG_ENTRY(0, RR_DMG_NONE), - /* Mirror Ray */ DMG_ENTRY(0, RR_DMG_NONE), - /* Kokiri spin */ DMG_ENTRY(1, RR_DMG_NORMAL), - /* Giant spin */ DMG_ENTRY(4, RR_DMG_NORMAL), - /* Master spin */ DMG_ENTRY(2, RR_DMG_NORMAL), - /* Kokiri jump */ DMG_ENTRY(2, RR_DMG_NORMAL), - /* Giant jump */ DMG_ENTRY(8, RR_DMG_NORMAL), - /* Master jump */ DMG_ENTRY(4, RR_DMG_NORMAL), - /* Unknown 1 */ DMG_ENTRY(10, RR_DMG_SPRT_ARROW), - /* Unblockable */ DMG_ENTRY(0, RR_DMG_NONE), - /* Hammer jump */ DMG_ENTRY(0, RR_DMG_NONE), - /* Unknown 2 */ DMG_ENTRY(0, RR_DMG_NONE), + /* Deku nut */ DMG_ENTRY(0, RR_DMG_REACT_NONE), + /* Deku stick */ DMG_ENTRY(2, RR_DMG_REACT_NORMAL), + /* Slingshot */ DMG_ENTRY(1, RR_DMG_REACT_NORMAL), + /* Explosive */ DMG_ENTRY(2, RR_DMG_REACT_NORMAL), + /* Boomerang */ DMG_ENTRY(0, RR_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, RR_DMG_REACT_NORMAL), + /* Hammer swing */ DMG_ENTRY(2, RR_DMG_REACT_NORMAL), + /* Hookshot */ DMG_ENTRY(0, RR_DMG_REACT_STUN), + /* Kokiri sword */ DMG_ENTRY(1, RR_DMG_REACT_NORMAL), + /* Master sword */ DMG_ENTRY(2, RR_DMG_REACT_NORMAL), + /* Giant's Knife */ DMG_ENTRY(4, RR_DMG_REACT_NORMAL), + /* Fire arrow */ DMG_ENTRY(4, RR_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(4, RR_DMG_REACT_ICE), + /* Light arrow */ DMG_ENTRY(15, RR_DMG_REACT_LIGHT_ARROW), + /* Unk arrow 1 */ DMG_ENTRY(4, RR_DMG_REACT_WIND_ARROW), + /* Unk arrow 2 */ DMG_ENTRY(15, RR_DMG_REACT_SHDW_ARROW), + /* Unk arrow 3 */ DMG_ENTRY(15, RR_DMG_REACT_SPRT_ARROW), + /* Fire magic */ DMG_ENTRY(4, RR_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(3, RR_DMG_REACT_ICE), + /* Light magic */ DMG_ENTRY(10, RR_DMG_REACT_LIGHT_MAGIC), + /* Shield */ DMG_ENTRY(0, RR_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, RR_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, RR_DMG_REACT_NORMAL), + /* Giant spin */ DMG_ENTRY(4, RR_DMG_REACT_NORMAL), + /* Master spin */ DMG_ENTRY(2, RR_DMG_REACT_NORMAL), + /* Kokiri jump */ DMG_ENTRY(2, RR_DMG_REACT_NORMAL), + /* Giant jump */ DMG_ENTRY(8, RR_DMG_REACT_NORMAL), + /* Master jump */ DMG_ENTRY(4, RR_DMG_REACT_NORMAL), + /* Unknown 1 */ DMG_ENTRY(10, RR_DMG_REACT_SPRT_ARROW), + /* Unblockable */ DMG_ENTRY(0, RR_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(0, RR_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, RR_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -436,8 +438,7 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { if (this->collider2.base.acFlags & AC_HIT) { this->collider2.base.acFlags &= ~AC_HIT; - // "Kakin" (not sure what this means) - PRINTF(VT_FGCOL(GREEN) "カキン(%d)!!" VT_RST "\n", this->frameCount); + PRINTF(VT_FGCOL(GREEN) T("カキン(%d)!!", "Kakin (%d)!!") VT_RST "\n", this->frameCount); hitPos.x = this->collider2.elem.acDmgInfo.hitPos.x; hitPos.y = this->collider2.elem.acDmgInfo.hitPos.y; hitPos.z = this->collider2.elem.acDmgInfo.hitPos.z; @@ -447,30 +448,30 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { u8 dropType = RR_DROP_RANDOM_RUPEE; this->collider1.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect != 0) { + if (this->actor.colChkInfo.damageReaction != 0) { hitPos.x = this->collider1.elem.acDmgInfo.hitPos.x; hitPos.y = this->collider1.elem.acDmgInfo.hitPos.y; hitPos.z = this->collider1.elem.acDmgInfo.hitPos.z; CollisionCheck_BlueBlood(play, NULL, &hitPos); } - switch (this->actor.colChkInfo.damageEffect) { - case RR_DMG_LIGHT_ARROW: + switch (this->actor.colChkInfo.damageReaction) { + case RR_DMG_REACT_LIGHT_ARROW: dropType++; // purple rupee FALLTHROUGH; - case RR_DMG_SHDW_ARROW: + case RR_DMG_REACT_SHDW_ARROW: dropType++; // flexible FALLTHROUGH; - case RR_DMG_WIND_ARROW: + case RR_DMG_REACT_WIND_ARROW: dropType++; // arrow FALLTHROUGH; - case RR_DMG_SPRT_ARROW: + case RR_DMG_REACT_SPRT_ARROW: dropType++; // magic jar FALLTHROUGH; - case RR_DMG_NORMAL: - // "ouch" - PRINTF(VT_FGCOL(RED) "いてっ( %d : LIFE %d : DAMAGE %d : %x )!!" VT_RST "\n", this->frameCount, - this->actor.colChkInfo.health, this->actor.colChkInfo.damage, - this->actor.colChkInfo.damageEffect); + case RR_DMG_REACT_NORMAL: + PRINTF(VT_FGCOL(RED) T("いてっ( %d : LIFE %d : DAMAGE %d : %x )!!", + "ouch ( %d : LIFE %d : DAMAGE %d : %x )!!") VT_RST "\n", + this->frameCount, this->actor.colChkInfo.health, this->actor.colChkInfo.damage, + this->actor.colChkInfo.damageReaction); this->stopScroll = false; Actor_ApplyDamage(&this->actor); this->invincibilityTimer = 40; @@ -485,7 +486,7 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { EnRr_SetupDeath(this); } return; - case RR_DMG_FIRE: // Fire Arrow and Din's Fire + case RR_DMG_REACT_FIRE: // Fire Arrow and Din's Fire Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; @@ -494,7 +495,7 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { this->effectTimer = 20; EnRr_SetupStunned(this); return; - case RR_DMG_ICE: // Ice Arrow and unused ice magic + case RR_DMG_REACT_ICE: // Ice Arrow and unused ice magic Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; @@ -511,7 +512,7 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { #endif EnRr_SetupStunned(this); return; - case RR_DMG_LIGHT_MAGIC: // Unused light magic + case RR_DMG_REACT_LIGHT_MAGIC: // Unused light magic Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RUPEE_RED; @@ -519,7 +520,7 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_XLU, 80); EnRr_SetupStunned(this); return; - case RR_DMG_STUN: // Boomerang and Hookshot + case RR_DMG_REACT_STUN: // Boomerang and Hookshot Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_XLU, 80); EnRr_SetupStunned(this); @@ -531,8 +532,7 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { ((this->collider1.base.ocFlags1 & OC1_HIT) || (this->collider2.base.ocFlags1 & OC1_HIT))) { this->collider1.base.ocFlags1 &= ~OC1_HIT; this->collider2.base.ocFlags1 &= ~OC1_HIT; - // "catch" - PRINTF(VT_FGCOL(GREEN) "キャッチ(%d)!!" VT_RST "\n", this->frameCount); + PRINTF(VT_FGCOL(GREEN) T("キャッチ(%d)!!", "catch (%d)!!") VT_RST "\n", this->frameCount); if (play->grabPlayer(play, player)) { player->actor.parent = &this->actor; this->stopScroll = false; @@ -713,8 +713,7 @@ void EnRr_Death(EnRr* this, PlayState* play) { Item_DropCollectible(play, &dropPos, ITEM00_TUNIC_ZORA); break; } - // "dropped" - PRINTF(VT_FGCOL(GREEN) "「%s」が出た!!" VT_RST "\n", sDropNames[this->dropType]); + PRINTF(VT_FGCOL(GREEN) T("「%s」が出た!!", "「%s」dropped!!") VT_RST "\n", sDropNames[this->dropType]); switch (this->dropType) { case RR_DROP_MAGIC: Item_DropCollectible(play, &dropPos, ITEM00_MAGIC_SMALL); 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 f0ed5b5c30..e39d79d160 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.h +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.h @@ -2,7 +2,7 @@ #define Z_EN_RR_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnRr; 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 16bc86f02a..575755d445 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -8,8 +8,10 @@ #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" @@ -17,13 +19,14 @@ #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 "effect.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ru1/object_ru1.h" @@ -81,13 +84,35 @@ void func_80AEFC24(EnRu1* this, PlayState* play); void func_80AEFECC(EnRu1* this, PlayState* play); void func_80AEFF40(EnRu1* this, PlayState* play); -void func_80AF0278(EnRu1* this, PlayState* play, s32 limbIndex, Vec3s* rot); +void EnRu1_PreLimbDraw(EnRu1* this, PlayState* play, s32 limbIndex, Vec3s* rot); void EnRu1_DrawNothing(EnRu1* this, PlayState* play); void EnRu1_DrawOpa(EnRu1* this, PlayState* play); void EnRu1_DrawXlu(EnRu1* this, PlayState* play); -static ColliderCylinderInitType1 sCylinderInit1 = { +typedef enum EnRu1Eyes { + /* 0 */ ENRU1_EYES_OPEN, + /* 1 */ ENRU1_EYES_HALF_BLINK, + /* 2 */ ENRU1_EYES_CLOSED, + /* 3 */ ENRU1_EYES_UP, + /* 4 */ ENRU1_EYES_GAZING, + /* 5 */ ENRU1_EYES_BLUSH, +} EnRu1Eyes; + +typedef enum EnRu1Mouth { + /* 0 */ ENRU1_MOUTH_SMILING, + /* 1 */ ENRU1_MOUTH_FROWNING, + /* 2 */ ENRU1_MOUTH_OPEN, +} EnRu1Mouth; + +typedef enum EnRu1WaterState { + /* 0 */ ENRU1_WATER_OUTSIDE, + /* 1 */ ENRU1_WATER_IMMERSED, + /* 2 */ ENRU1_WATER_BOBBING, + /* 3 */ ENRU1_WATER_SINKING, +} EnRu1WaterState; + +static ColliderCylinderInitType1 sStandingCylinderInit = { { COL_MATERIAL_HIT0, AT_NONE, @@ -99,7 +124,7 @@ static ColliderCylinderInitType1 sCylinderInit1 = { { 25, 80, 0, { 0 } }, }; -static ColliderCylinderInitType1 sCylinderInit2 = { +static ColliderCylinderInitType1 sSittingCylinderInit = { { COL_MATERIAL_HIT0, AT_ON | AT_TYPE_PLAYER, @@ -139,7 +164,7 @@ static EnRu1ActionFunc sActionFuncs[] = { }; static EnRu1PreLimbDrawFunc sPreLimbDrawFuncs[] = { - func_80AF0278, + EnRu1_PreLimbDraw, }; static Vec3f sMultVec = { 0.0f, 10.0f, 0.0f }; @@ -162,60 +187,60 @@ ActorProfile En_Ru1_Profile = { /**/ EnRu1_Draw, }; -void func_80AEAC10(EnRu1* this, PlayState* play) { +void EnRu1_UpdateStandingOC(EnRu1* this, PlayState* play) { s32 pad[5]; - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + Collider_UpdateCylinder(&this->actor, &this->standingCollider); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->standingCollider.base); } -void func_80AEAC54(EnRu1* this, PlayState* play) { +void EnRu1_UpdateSittingOC(EnRu1* this, PlayState* play) { s32 pad[5]; - Collider_UpdateCylinder(&this->actor, &this->collider2); - if (this->unk_34C != 0) { - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider2.base); + Collider_UpdateCylinder(&this->actor, &this->sittingCollider); + if (this->isSittingOCActive) { + CollisionCheck_SetOC(play, &play->colChkCtx, &this->sittingCollider.base); } else if (this->actor.xzDistToPlayer > 32.0f) { - this->unk_34C = 1; + this->isSittingOCActive = true; } } -void func_80AEACDC(EnRu1* this, PlayState* play) { +void EnRu1_UpdateSittingAT(EnRu1* this, PlayState* play) { s32 pad[5]; - Collider_UpdateCylinder(&this->actor, &this->collider2); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider2.base); + Collider_UpdateCylinder(&this->actor, &this->sittingCollider); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->sittingCollider.base); } -void func_80AEAD20(Actor* thisx, PlayState* play) { +void EnRu1_InitColliders(Actor* thisx, PlayState* play) { EnRu1* this = (EnRu1*)thisx; - Collider_InitCylinder(play, &this->collider); - Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit1); + Collider_InitCylinder(play, &this->standingCollider); + Collider_SetCylinderType1(play, &this->standingCollider, &this->actor, &sStandingCylinderInit); - Collider_InitCylinder(play, &this->collider2); - Collider_SetCylinderType1(play, &this->collider2, &this->actor, &sCylinderInit2); + Collider_InitCylinder(play, &this->sittingCollider); + Collider_SetCylinderType1(play, &this->sittingCollider, &this->actor, &sSittingCylinderInit); } void EnRu1_DestroyColliders(EnRu1* this, PlayState* play) { - Collider_DestroyCylinder(play, &this->collider); - Collider_DestroyCylinder(play, &this->collider2); + Collider_DestroyCylinder(play, &this->standingCollider); + Collider_DestroyCylinder(play, &this->sittingCollider); } -void func_80AEADD8(EnRu1* this) { - this->unk_34C = 0; +void EnRu1_DisableSittingOC(EnRu1* this) { + this->isSittingOCActive = false; } -u8 func_80AEADE0(EnRu1* this) { - u8 params = PARAMS_GET_U(this->actor.params, 8, 8); +u8 EnRu1_GetSwitchFlag(EnRu1* this) { + u8 switchFlag = ENRU1_SWITCH_FLAG(&this->actor); - return params; + return switchFlag; } -u8 func_80AEADF0(EnRu1* this) { - u8 params = PARAMS_GET_U(this->actor.params, 0, 8); +u8 EnRu1_GetType(EnRu1* this) { + u8 type = ENRU1_TYPE(&this->actor); - return params; + return type; } void EnRu1_Destroy(Actor* thisx, PlayState* play) { @@ -227,24 +252,24 @@ void EnRu1_Destroy(Actor* thisx, PlayState* play) { void EnRu1_UpdateEyes(EnRu1* this) { s32 pad[3]; s16* blinkTimer = &this->blinkTimer; - s16* eyeIndex = &this->eyeIndex; + s16* eyes = &this->eyes; if (DECR(*blinkTimer) == 0) { *blinkTimer = Rand_S16Offset(60, 60); } - *eyeIndex = *blinkTimer; - if (*eyeIndex >= 3) { - *eyeIndex = 0; + *eyes = *blinkTimer; + if (*eyes >= ENRU1_EYES_UP) { + *eyes = ENRU1_EYES_OPEN; } } -void EnRu1_SetEyeIndex(EnRu1* this, s16 eyeIndex) { - this->eyeIndex = eyeIndex; +void EnRu1_SetEyes(EnRu1* this, s16 eyes) { + this->eyes = eyes; } -void EnRu1_SetMouthIndex(EnRu1* this, s16 mouthIndex) { - this->mouthIndex = mouthIndex; +void EnRu1_SetMouth(EnRu1* this, s16 mouth) { + this->mouth = mouth; } void func_80AEAECC(EnRu1* this, PlayState* play) { @@ -310,7 +335,7 @@ s32 func_80AEB020(EnRu1* this, PlayState* play) { return false; } -BgBdanObjects* EnRu1_FindSwitch(PlayState* play) { +BgBdanObjects* EnRu1_FindBigOctoPlatform(PlayState* play) { Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_BG].head; while (actorIt != NULL) { @@ -319,20 +344,20 @@ BgBdanObjects* EnRu1_FindSwitch(PlayState* play) { } actorIt = actorIt->next; } - // "There is no stand" - PRINTF(VT_FGCOL(RED) "お立ち台が無い!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T("お立ち台が無い!!!!!!!!!!!!!!!!!!!!!!!!!\n", "There is no stand!!!!!!!!!!!!!!!!!!!!!!!!!\n") + VT_RST); return NULL; } -void func_80AEB0EC(EnRu1* this, s32 cameraSetting) { - if (this->unk_28C != NULL) { - this->unk_28C->cameraSetting = cameraSetting; +void EnRu1_SetPlatformCamSetting(EnRu1* this, s32 cameraSetting) { + if (this->bigOctoPlatform != NULL) { + this->bigOctoPlatform->cameraSetting = cameraSetting; } } -s32 func_80AEB104(EnRu1* this) { - if (this->unk_28C != NULL) { - return this->unk_28C->cameraSetting; +s32 EnRu1_GetPlatformCamSetting(EnRu1* this) { + if (this->bigOctoPlatform != NULL) { + return this->bigOctoPlatform->cameraSetting; } else { return 0; } @@ -368,7 +393,7 @@ void func_80AEB1D8(EnRu1* this) { this->actor.speed = 0.0f; this->actor.gravity = 0.0f; this->actor.minVelocityY = 0.0f; - func_80AEB0EC(this, 0); + EnRu1_SetPlatformCamSetting(this, 0); } void func_80AEB220(EnRu1* this, PlayState* play) { @@ -378,25 +403,25 @@ void func_80AEB220(EnRu1* this, PlayState* play) { } #endif -void func_80AEB264(EnRu1* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) { +void EnRu1_AnimationChange(EnRu1* this, AnimationHeader* animation, u8 mode, f32 morphFrames, s32 playReversed) { s32 pad[2]; AnimationHeader* animHeader = SEGMENTED_TO_VIRTUAL(animation); f32 frameCount = Animation_GetLastFrame(animHeader); f32 playbackSpeed; - f32 unk0; - f32 fc; + f32 startFrame; + f32 endFrame; - if (arg4 == 0) { - unk0 = 0.0f; - fc = frameCount; + if (!playReversed) { + startFrame = 0.0f; + endFrame = frameCount; playbackSpeed = 1.0f; } else { - unk0 = frameCount; - fc = 0.0f; + startFrame = frameCount; + endFrame = 0.0f; playbackSpeed = -1.0f; } - Animation_Change(&this->skelAnime, animHeader, playbackSpeed, unk0, fc, arg2, morphFrames); + Animation_Change(&this->skelAnime, animHeader, playbackSpeed, startFrame, endFrame, mode, morphFrames); } s32 EnRu1_UpdateSkelAnime(EnRu1* this) { @@ -422,12 +447,12 @@ void func_80AEB3CC(EnRu1* this) { this->skelAnime.movementFlags &= ~ANIM_FLAG_UPDATE_XZ; } -void func_80AEB3DC(EnRu1* this, PlayState* play) { - func_80AEB264(this, &gRutoChildWaitHandsBehindBackAnim, 0, 0, 0); +void EnRu1_InitOutsideJabuJabu(EnRu1* this, PlayState* play) { + EnRu1_AnimationChange(this, &gRutoChildWaitHandsBehindBackAnim, ANIMMODE_LOOP, 0, false); this->action = 0; this->drawConfig = 1; - EnRu1_SetEyeIndex(this, 4); - EnRu1_SetMouthIndex(this, 0); + EnRu1_SetEyes(this, ENRU1_EYES_GAZING); + EnRu1_SetMouth(this, ENRU1_MOUTH_SMILING); } CsCmdActorCue* EnRu1_GetCueChannel3(PlayState* play) { @@ -642,10 +667,10 @@ void func_80AEBD94(EnRu1* this, PlayState* play) { f32 frameCount; if (func_80AEB480(play, 3)) { - frameCount = Animation_GetLastFrame(&gRutoChildAnim_009060); + frameCount = Animation_GetLastFrame(&gRutoChildResurfaceAnim); func_80AEB934(this, play); func_80AEB738(this, play); - Animation_Change(&this->skelAnime, &gRutoChildAnim_009060, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); + Animation_Change(&this->skelAnime, &gRutoChildResurfaceAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); this->action = 2; this->drawConfig = 1; } @@ -779,16 +804,16 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) { func_80AEC070(this, play, something); } -void func_80AEC320(EnRu1* this, PlayState* play) { +void EnRu1_InitInJabuJabuHolesRoom(EnRu1* this, PlayState* play) { if (!GET_INFTABLE(INFTABLE_141)) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); this->action = 7; - EnRu1_SetMouthIndex(this, 1); + EnRu1_SetMouth(this, ENRU1_MOUTH_FROWNING); } else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145)) { if (!func_80AEB020(this, play)) { s8 actorRoom; - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); actorRoom = this->actor.room; this->action = 22; this->actor.room = -1; @@ -1024,12 +1049,12 @@ void func_80AECCB0(EnRu1* this, PlayState* play) { spawnY, spawnZ, 0, yawTowardsPlayer, 0, WARP_BLUE_RUTO); } -void func_80AECDA0(EnRu1* this, PlayState* play) { - func_80AEB264(this, &gRutoChildWaitHandsOnHipsAnim, 0, 0, 0); +void EnRu1_InitInBossRoom(EnRu1* this, PlayState* play) { + EnRu1_AnimationChange(this, &gRutoChildWaitHandsOnHipsAnim, ANIMMODE_LOOP, 0, false); this->action = 15; this->actor.shape.yOffset = -10000.0f; - EnRu1_SetEyeIndex(this, 5); - EnRu1_SetMouthIndex(this, 2); + EnRu1_SetEyes(this, ENRU1_EYES_BLUSH); + EnRu1_SetMouth(this, ENRU1_MOUTH_OPEN); } void func_80AECE04(EnRu1* this, PlayState* play) { @@ -1190,13 +1215,13 @@ void func_80AED414(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); } -void func_80AED44C(EnRu1* this, PlayState* play) { +void EnRu1_InitInJabuJabuBasement(EnRu1* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_141) && !GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_147)) { if (!func_80AEB020(this, play)) { s8 actorRoom; - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); actorRoom = this->actor.room; this->action = 22; this->actor.room = -1; @@ -1304,35 +1329,35 @@ void func_80AED83C(EnRu1* this) { Math_SmoothStepToS(&torsoRot->y, 0, 0x14, 0x1838, 0x64); } -void func_80AED8DC(EnRu1* this) { - s32 temp_hi; - s16* unk_2AC = &this->unk_2AC; +void EnRu1_UpdateHeadRotation(EnRu1* this) { + s32 headRotOffset; + s16* headRotTimer = &this->headRotTimer; s16* headRotY = &this->interactInfo.headRot.y; - s16* unk_29E = &this->unk_29E; + s16* headTurnSpeed = &this->headTurnSpeed; s32 pad[2]; - if (DECR(*unk_2AC) == 0) { - *unk_2AC = Rand_S16Offset(0xA, 0x19); - temp_hi = *unk_2AC % 5; - if (temp_hi == 0) { - this->unk_2B0 = 1; - } else if (temp_hi == 1) { - this->unk_2B0 = 2; + if (DECR(*headRotTimer) == 0) { + *headRotTimer = Rand_S16Offset(0xA, 0x19); + headRotOffset = *headRotTimer % 5; + if (headRotOffset == 0) { + this->headRotDirection = 1; + } else if (headRotOffset == 1) { + this->headRotDirection = 2; } else { - this->unk_2B0 = 0; + this->headRotDirection = 0; } - *unk_29E = 0; + *headTurnSpeed = 0; } - if (this->unk_2B0 == 0) { - Math_SmoothStepToS(unk_29E, 0 - *headRotY, 1, 0x190, 0x190); - Math_SmoothStepToS(headRotY, 0, 3, ABS(*unk_29E), 0x64); - } else if (this->unk_2B0 == 1) { - Math_SmoothStepToS(unk_29E, -0x2AAA - *headRotY, 1, 0x190, 0x190); - Math_SmoothStepToS(headRotY, -0x2AAA, 3, ABS(*unk_29E), 0x64); + if (this->headRotDirection == 0) { + Math_SmoothStepToS(headTurnSpeed, 0 - *headRotY, 1, 0x190, 0x190); + Math_SmoothStepToS(headRotY, 0, 3, ABS(*headTurnSpeed), 0x64); + } else if (this->headRotDirection == 1) { + Math_SmoothStepToS(headTurnSpeed, -0x2AAA - *headRotY, 1, 0x190, 0x190); + Math_SmoothStepToS(headRotY, -0x2AAA, 3, ABS(*headTurnSpeed), 0x64); } else { - Math_SmoothStepToS(unk_29E, 0x2AAA - *headRotY, 1, 0x190, 0x190); - Math_SmoothStepToS(headRotY, 0x2AAA, 3, ABS(*unk_29E), 0x64); + Math_SmoothStepToS(headTurnSpeed, 0x2AAA - *headRotY, 1, 0x190, 0x190); + Math_SmoothStepToS(headRotY, 0x2AAA, 3, ABS(*headTurnSpeed), 0x64); } } @@ -1467,20 +1492,22 @@ void func_80AEE02C(EnRu1* this) { this->actor.minVelocityY = 0.0f; } -void func_80AEE050(EnRu1* this) { +void EnRu1_UpdateWaterState(EnRu1* this) { s32 pad; - f32 sp28; - f32 sp24; + f32 bobMagnitude; + f32 startY; EnRu1* thisx = this; // necessary to match - if (this->unk_350 == 0) { + if (this->waterState == ENRU1_WATER_OUTSIDE) { if ((this->actor.minVelocityY == 0.0f) && (this->actor.speed == 0.0f)) { - this->unk_350 = 1; + // When Ruto's velocity has been slowed enough by the water, stop her motion + this->waterState = ENRU1_WATER_IMMERSED; func_80AEE02C(this); - this->unk_35C = 0; - this->unk_358 = (this->actor.depthInWater - 10.0f) * 0.5f; - this->unk_354 = this->actor.world.pos.y + thisx->unk_358; // thisx only used here + this->bobPhase = 0; + this->bobDepth = (this->actor.depthInWater - 10.0f) * 0.5f; + this->sinkingStartPosY = this->actor.world.pos.y + thisx->bobDepth; } else { + // Ruto is touching the water but still in motion, e.g. from being thrown this->actor.gravity = 0.0f; this->actor.minVelocityY *= 0.2f; this->actor.velocity.y *= 0.2f; @@ -1497,25 +1524,25 @@ void func_80AEE050(EnRu1* this) { Actor_UpdatePos(&this->actor); } } else { - if (this->unk_350 == 1) { - if (this->unk_358 <= 1.0f) { + if (this->waterState == ENRU1_WATER_IMMERSED) { + if (this->bobDepth <= 1.0f) { func_80AEE02C(this); - this->unk_350 = 2; - this->unk_360 = 0.0f; + this->waterState = ENRU1_WATER_BOBBING; + this->isSinking = 0.0f; } else { - f32 temp_f10; + f32 deltaY; - sp28 = this->unk_358; - sp24 = this->unk_354; - temp_f10 = Math_CosS(this->unk_35C) * -sp28; - this->actor.world.pos.y = temp_f10 + sp24; - this->unk_35C += 0x3E8; - this->unk_358 *= 0.95f; + bobMagnitude = this->bobDepth; + startY = this->sinkingStartPosY; + deltaY = Math_CosS(this->bobPhase) * -bobMagnitude; + this->actor.world.pos.y = deltaY + startY; + this->bobPhase += 0x3E8; + this->bobDepth *= 0.95f; } } else { - this->unk_360 += 1.0f; - if (this->unk_360 > 0.0f) { - this->unk_350 = 3; + this->isSinking += 1.0f; + if (this->isSinking > 0.0f) { + this->waterState = ENRU1_WATER_SINKING; } } } @@ -1573,7 +1600,7 @@ s32 func_80AEE394(EnRu1* this, PlayState* play) { gSaveContext.cutsceneTrigger = 1; this->action = 36; this->drawConfig = 0; - this->unk_28C = (BgBdanObjects*)dynaPolyActor; + this->bigOctoPlatform = (BgBdanObjects*)dynaPolyActor; this->actor.shape.shadowAlpha = 0; return true; } @@ -1607,13 +1634,13 @@ void func_80AEE568(EnRu1* this, PlayState* play) { func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); this->action = 27; - func_80AEADD8(this); + EnRu1_DisableSittingOC(this); return; } if (this->actor.depthInWater > 0.0f) { this->action = 29; - this->unk_350 = 0; + this->waterState = ENRU1_WATER_OUTSIDE; } } } @@ -1652,10 +1679,10 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) { return false; } -void func_80AEE7C4(EnRu1* this, PlayState* play) { +void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { s32 pad[9]; Player* player; - f32* unk_370 = &this->unk_370; + f32* carryIdleTimer = &this->carryIdleTimer; if (Actor_HasNoParent(&this->actor, play)) { f32 frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); @@ -1668,17 +1695,17 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) { this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); func_80AED57C(this); this->action = 28; - *unk_370 = 0.0f; + *carryIdleTimer = 0.0f; } else if (func_80AEE6D0(this, play)) { s32 pad; - *unk_370 = 0.0f; + *carryIdleTimer = 0.0f; } else { player = GET_PLAYER(play); if (player->stateFlags2 & PLAYER_STATE2_IDLE_FIDGET) { - this->unk_370 += 1.0f; + this->carryIdleTimer += 1.0f; if (this->action != 32) { - if (*unk_370 > 30.0f) { + if (*carryIdleTimer > 30.0f) { if (Rand_S16Offset(0, 3) == 0) { f32 frameCount = Animation_GetLastFrame(&gRutoChildSquirmAnim); @@ -1687,42 +1714,42 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) { func_80AED5DC(this); this->action = 32; } - *unk_370 = 0.0f; + *carryIdleTimer = 0.0f; } } else { - if (*unk_370 > 50.0f) { + if (*carryIdleTimer > 50.0f) { f32 frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); this->action = 31; - *unk_370 = 0.0f; + *carryIdleTimer = 0.0f; } } } else { f32 frameCount = Animation_GetLastFrame(&gRutoChildSittingAnim); Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); - *unk_370 = 0.0f; + *carryIdleTimer = 0.0f; } } } -s32 func_80AEEAC8(EnRu1* this, PlayState* play) { +s32 EnRu1_CheckHitBottomUnderwater(EnRu1* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { s32 pad; func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); this->action = 27; - func_80AEADD8(this); + EnRu1_DisableSittingOC(this); return true; } return false; } -void func_80AEEB24(EnRu1* this, PlayState* play) { - if ((func_80AEEAC8(this, play) == 0) && (this->unk_350 == 3)) { +void EnRu1_CheckSinkingState(EnRu1* this, PlayState* play) { + if ((EnRu1_CheckHitBottomUnderwater(this, play) == 0) && (this->waterState == ENRU1_WATER_SINKING)) { this->action = 30; func_80AEE02C(this); this->actor.gravity = -0.1f; @@ -1736,7 +1763,7 @@ void func_80AEEBB4(EnRu1* this, PlayState* play) { void func_80AEEBD4(EnRu1* this, PlayState* play) { func_80AED83C(this); - func_80AEAC54(this, play); + EnRu1_UpdateSittingOC(this, play); func_80AEAECC(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); @@ -1748,7 +1775,7 @@ void func_80AEEBD4(EnRu1* this, PlayState* play) { void func_80AEEC5C(EnRu1* this, PlayState* play) { func_80AED83C(this); - func_80AEACDC(this, play); + EnRu1_UpdateSittingAT(this, play); func_80AEAECC(this, play); func_80AEE2F8(this, play); func_80AEDFF4(this, play); @@ -1762,10 +1789,10 @@ void func_80AEEC5C(EnRu1* this, PlayState* play) { void func_80AEECF0(EnRu1* this, PlayState* play) { func_80AED83C(this); func_80AEAECC(this, play); - func_80AEE050(this); + EnRu1_UpdateWaterState(this); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEEB24(this, play); + EnRu1_CheckSinkingState(this, play); func_80AED624(this, play); } @@ -1775,19 +1802,19 @@ void func_80AEED58(EnRu1* this, PlayState* play) { Actor_MoveXZGravity(&this->actor); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEEAC8(this, play); + EnRu1_CheckHitBottomUnderwater(this, play); func_80AED624(this, play); func_80AEDAE0(this, play); } void func_80AEEDCC(EnRu1* this, PlayState* play) { - func_80AED8DC(this); + EnRu1_UpdateHeadRotation(this); EnRu1_UpdateSkelAnime(this); func_80AEAECC(this, play); func_80AEE2F8(this, play); EnRu1_UpdateEyes(this); func_80AED6F8(play); - func_80AEE7C4(this, play); + EnRu1_UpdateCarriedBehavior(this, play); } void func_80AEEE34(EnRu1* this, PlayState* play) { @@ -1797,7 +1824,7 @@ void func_80AEEE34(EnRu1* this, PlayState* play) { func_80AEE2F8(this, play); EnRu1_UpdateEyes(this); func_80AED6F8(play); - func_80AEE7C4(this, play); + EnRu1_UpdateCarriedBehavior(this, play); } void func_80AEEE9C(EnRu1* this, PlayState* play) { @@ -1884,7 +1911,7 @@ void func_80AEF1F0(EnRu1* this, PlayState* play, UNK_TYPE arg2) { func_80AED6DC(this, play); Actor_OfferCarry(&this->actor, play); this->action = 27; - func_80AEADD8(this); + EnRu1_DisableSittingOC(this); } } @@ -1904,7 +1931,7 @@ void func_80AEF2D0(EnRu1* this, PlayState* play) { func_80AEEF68(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAC10(this, play); + EnRu1_UpdateStandingOC(this, play); func_80AEAECC(this, play); cond = func_80AEE264(this, play); func_80AED624(this, play); @@ -1955,11 +1982,11 @@ void func_80AEF51C(EnRu1* this) { } void func_80AEF540(EnRu1* this) { - if (func_80AEB104(this) == 2) { - EnRu1_SetEyeIndex(this, 3); - EnRu1_SetMouthIndex(this, 2); + if (EnRu1_GetPlatformCamSetting(this) == 2) { + EnRu1_SetEyes(this, ENRU1_EYES_UP); + EnRu1_SetMouth(this, ENRU1_MOUTH_OPEN); if (this->skelAnime.mode != 2) { - func_80AEB264(this, &gRutoChildShutterAnim, 2, -8.0f, 0); + EnRu1_AnimationChange(this, &gRutoChildShutterAnim, ANIMMODE_ONCE, -8.0f, false); func_80AEF51C(this); } } @@ -1971,8 +1998,8 @@ void func_80AEF5B8(EnRu1* this) { if (D_80AF1938 == 0) { curFrame = this->skelAnime.curFrame; if (curFrame >= 60.0f) { - EnRu1_SetEyeIndex(this, 3); - EnRu1_SetMouthIndex(this, 0); + EnRu1_SetEyes(this, ENRU1_EYES_UP); + EnRu1_SetMouth(this, ENRU1_MOUTH_SMILING); func_80AED57C(this); D_80AF1938 = 1; } @@ -2043,15 +2070,15 @@ void func_80AEF890(EnRu1* this, PlayState* play) { if (!(DEBUG_FEATURES && IS_CUTSCENE_LAYER) && EnRu1_IsCsStateIdle(play)) { curRoomNum = play->roomCtx.curRoom.num; SET_INFTABLE(INFTABLE_145); - Flags_SetSwitch(play, func_80AEADE0(this)); - func_80AEB0EC(this, 1); + Flags_SetSwitch(play, EnRu1_GetSwitchFlag(this)); + EnRu1_SetPlatformCamSetting(this, 1); this->action = 42; this->actor.room = curRoomNum; } } void func_80AEF930(EnRu1* this, PlayState* play) { - if (func_80AEB104(this) == 3) { + if (EnRu1_GetPlatformCamSetting(this) == 3) { this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; this->actor.textId = 0x4048; #if !OOT_PAL_N64 @@ -2067,7 +2094,7 @@ void func_80AEF930(EnRu1* this, PlayState* play) { void func_80AEF99C(EnRu1* this, PlayState* play) { if (func_80AEB1B4(play) != 0) { - func_80AEB0EC(this, 4); + EnRu1_SetPlatformCamSetting(this, 4); Actor_Kill(&this->actor); } } @@ -2146,14 +2173,14 @@ void func_80AEFC24(EnRu1* this, PlayState* play) { func_80AEF99C(this, play); } -void func_80AEFC54(EnRu1* this, PlayState* play) { +void EnRu1_InitInSapphireRoom(EnRu1* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_145) && !GET_INFTABLE(INFTABLE_146)) { s32 pad; - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); this->action = 41; - this->unk_28C = EnRu1_FindSwitch(play); - func_80AEB0EC(this, 1); + this->bigOctoPlatform = EnRu1_FindBigOctoPlatform(play); + EnRu1_SetPlatformCamSetting(this, 1); this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); } else { Actor_Kill(&this->actor); @@ -2161,17 +2188,17 @@ void func_80AEFC54(EnRu1* this, PlayState* play) { } void func_80AEFCE8(EnRu1* this, PlayState* play) { - this->unk_28C = EnRu1_FindSwitch(play); - if (this->unk_28C != NULL) { + this->bigOctoPlatform = EnRu1_FindBigOctoPlatform(play); + if (this->bigOctoPlatform != NULL) { this->action = 42; this->drawConfig = 1; - func_80AEB0EC(this, 1); + EnRu1_SetPlatformCamSetting(this, 1); } } -void func_80AEFD38(EnRu1* this, PlayState* play) { +void EnRu1_InitBesideKingZora(EnRu1* this, PlayState* play) { if (GET_EVENTCHKINF(EVENTCHKINF_37) && LINK_IS_CHILD) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; this->action = 44; this->drawConfig = 1; @@ -2217,7 +2244,7 @@ void func_80AEFECC(EnRu1* this, PlayState* play) { func_80AEEF68(this, play); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); - func_80AEAC10(this, play); + EnRu1_UpdateStandingOC(this, play); func_80AEAECC(this, play); func_80AEFE84(this, play, func_80AEFDC0(this, play)); } @@ -2230,12 +2257,15 @@ void func_80AEFF40(EnRu1* this, PlayState* play) { func_80AEFE9C(this, play); } -void func_80AEFF94(EnRu1* this, PlayState* play) { +/** + * Places Ruto beside the door switch outside the room with the map. + */ +void EnRu1_InitBesideDoorSwitch(EnRu1* this, PlayState* play) { s8 actorRoom; if (GET_INFTABLE(INFTABLE_141) && GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145) && (!(func_80AEB020(this, play)))) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); actorRoom = this->actor.room; this->action = 22; this->actor.room = -1; @@ -2243,21 +2273,19 @@ void func_80AEFF94(EnRu1* this, PlayState* play) { this->roomNum1 = actorRoom; this->roomNum3 = actorRoom; this->roomNum2 = actorRoom; - // "Ruto switch set" - PRINTF("スイッチルトセット!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("スイッチルトセット!!!!!!!!!!!!!!!!!!!!!!\n", "Ruto switch set!!!!!!!!!!!!!!!!!!!!!!\n")); } else { - // "Ruto switch not set" - PRINTF("スイッチルトセットしない!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("スイッチルトセットしない!!!!!!!!!!!!!!!!!!!!!!\n", "Ruto switch not set!!!!!!!!!!!!!!!!!!!!!!\n")); Actor_Kill(&this->actor); } } #if DEBUG_FEATURES void func_80AF0050(EnRu1* this, PlayState* play) { - func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); + EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); this->action = 36; this->roomNum1 = this->actor.room; - this->unk_28C = EnRu1_FindSwitch(play); + this->bigOctoPlatform = EnRu1_FindBigOctoPlatform(play); this->actor.room = -1; } #endif @@ -2266,8 +2294,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; } @@ -2280,43 +2308,42 @@ void EnRu1_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gRutoChildSkel, NULL, this->jointTable, this->morphTable, 17); - func_80AEAD20(&this->actor, play); - switch (func_80AEADF0(this)) { - case 0: - func_80AECDA0(this, play); + EnRu1_InitColliders(&this->actor, play); + switch (EnRu1_GetType(this)) { + case ENRU1_TYPE_BOSS_ROOM: + EnRu1_InitInBossRoom(this, play); break; - case 1: - func_80AEB3DC(this, play); + case ENRU1_TYPE_FOUNTAIN: + EnRu1_InitOutsideJabuJabu(this, play); break; - case 2: - func_80AEC320(this, play); + case ENRU1_TYPE_HOLES_ROOM: + EnRu1_InitInJabuJabuHolesRoom(this, play); break; - case 3: - func_80AED44C(this, play); + case ENRU1_TYPE_BASEMENT: + EnRu1_InitInJabuJabuBasement(this, play); break; - case 4: - func_80AEFC54(this, play); + case ENRU1_TYPE_SAPPHIRE_ROOM: + EnRu1_InitInSapphireRoom(this, play); break; - case 5: - func_80AEFD38(this, play); + case ENRU1_TYPE_BESIDE_KZ: + EnRu1_InitBesideKingZora(this, play); break; - case 6: - func_80AEFF94(this, play); + case ENRU1_TYPE_BESIDE_DOOR_SWITCH: + EnRu1_InitBesideDoorSwitch(this, play); break; #if DEBUG_FEATURES - case 10: + case ENRU1_TYPE_DEBUG: func_80AF0050(this, play); break; #endif default: Actor_Kill(&this->actor); - // "Relevant arge_data = %d unacceptable" - PRINTF("該当 arge_data = %d 無し\n", func_80AEADF0(this)); + PRINTF(T("該当 arge_data = %d 無し\n", "Relevant arge_data = %d unacceptable\n"), EnRu1_GetType(this)); break; } } -void func_80AF0278(EnRu1* this, PlayState* play, s32 limbIndex, Vec3s* rot) { +void EnRu1_PreLimbDraw(EnRu1* this, PlayState* play, s32 limbIndex, Vec3s* rot) { Vec3s* torsoRot = &this->interactInfo.torsoRot; Vec3s* headRot = &this->interactInfo.headRot; @@ -2336,11 +2363,12 @@ s32 EnRu1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p Gfx** gfx) { EnRu1* this = (EnRu1*)thisx; - if ((this->unk_290 < 0) || (this->unk_290 > 0) || (*sPreLimbDrawFuncs[this->unk_290] == NULL)) { - // "Neck rotation mode is improper!" - PRINTF(VT_FGCOL(RED) "首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + if ((this->preLimbDrawIndex < 0) || (this->preLimbDrawIndex > 0) || + (*sPreLimbDrawFuncs[this->preLimbDrawIndex] == NULL)) { + PRINTF(VT_FGCOL(RED) T("首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "Neck rotation mode is improper!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST); } else { - sPreLimbDrawFuncs[this->unk_290](this, play, limbIndex, rot); + sPreLimbDrawFuncs[this->preLimbDrawIndex](this, play, limbIndex, rot); } return false; } @@ -2349,14 +2377,14 @@ void EnRu1_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, EnRu1* this = (EnRu1*)thisx; if (limbIndex == RUTO_CHILD_HEAD) { - Vec3f vec1; - Vec3f vec2; + Vec3f multVec; + Vec3f focusPos; - vec1 = sMultVec; - Matrix_MultVec3f(&vec1, &vec2); - this->actor.focus.pos.x = vec2.x; - this->actor.focus.pos.y = vec2.y; - this->actor.focus.pos.z = vec2.z; + multVec = sMultVec; + Matrix_MultVec3f(&multVec, &focusPos); + this->actor.focus.pos.x = focusPos.x; + this->actor.focus.pos.y = focusPos.y; + this->actor.focus.pos.z = focusPos.z; this->actor.focus.rot.x = this->actor.world.rot.x; this->actor.focus.rot.y = this->actor.world.rot.y; this->actor.focus.rot.z = this->actor.world.rot.z; @@ -2368,11 +2396,11 @@ void EnRu1_DrawNothing(EnRu1* this, PlayState* play) { void EnRu1_DrawOpa(EnRu1* this, PlayState* play) { s32 pad[2]; - s16 eyeIndex = this->eyeIndex; - void* eyeTex = sEyeTextures[eyeIndex]; - s16 mouthIndex = this->mouthIndex; + s16 eyes = this->eyes; + void* eyeTex = sEyeTextures[eyes]; + s16 mouth = this->mouth; SkelAnime* skelAnime = &this->skelAnime; - void* mouthTex = sMouthTextures[mouthIndex]; + void* mouthTex = sMouthTextures[mouth]; s32 pad1; OPEN_DISPS(play->state.gfxCtx, "../z_en_ru1.c", 1282); @@ -2393,11 +2421,11 @@ void EnRu1_DrawOpa(EnRu1* this, PlayState* play) { void EnRu1_DrawXlu(EnRu1* this, PlayState* play) { s32 pad[2]; - s16 eyeIndex = this->eyeIndex; - void* eyeTex = sEyeTextures[eyeIndex]; - s16 mouthIndex = this->mouthIndex; + s16 eyes = this->eyes; + void* eyeTex = sEyeTextures[eyes]; + s16 mouth = this->mouth; SkelAnime* skelAnime = &this->skelAnime; - void* mouthTex = sMouthTextures[mouthIndex]; + void* mouthTex = sMouthTextures[mouth]; s32 pad1; OPEN_DISPS(play->state.gfxCtx, "../z_en_ru1.c", 1324); @@ -2420,8 +2448,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 8778174ef5..6968b6fb0d 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -2,11 +2,14 @@ #define Z_EN_RU1_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#define ENRU1_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 8, 8) +#define ENRU1_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 8) + struct EnRu1; typedef void (*EnRu1ActionFunc)(struct EnRu1*, struct PlayState*); @@ -18,9 +21,9 @@ typedef struct EnRu1 { /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ Vec3s jointTable[17]; /* 0x01F6 */ Vec3s morphTable[17]; - /* 0x025C */ s16 eyeIndex; + /* 0x025C */ s16 eyes; /* 0x025E */ s16 blinkTimer; - /* 0x0260 */ s16 mouthIndex; + /* 0x0260 */ s16 mouth; /* 0x0264 */ s32 action; /* 0x0268 */ s32 drawConfig; /* 0x026C */ f32 unk_26C; @@ -33,41 +36,54 @@ typedef struct EnRu1 { /* 0x0285 */ s8 roomNum2; /* 0x0286 */ s8 roomNum3; /* 0x0288 */ f32 unk_288; - /* 0x028C */ BgBdanObjects* unk_28C; - /* 0x0290 */ s32 unk_290; + /* 0x028C */ BgBdanObjects* bigOctoPlatform; + /* 0x0290 */ s32 preLimbDrawIndex; /* 0x0294 */ char unk_294[0x4]; /* 0x0298 */ s32 unk_298; /* 0x029C */ char unk_29C[0x2]; - /* 0x029E */ s16 unk_29E; + /* 0x029E */ s16 headTurnSpeed; /* 0x02A0 */ char unk_2A0[0x4]; /* 0x02A4 */ f32 unk_2A4; /* 0x02A8 */ s32 alpha; - /* 0x02AC */ s16 unk_2AC; - /* 0x02B0 */ s32 unk_2B0; - /* 0x02B4 */ ColliderCylinder collider; - /* 0x0300 */ ColliderCylinder collider2; - /* 0x034C */ s32 unk_34C; - /* 0x0350 */ s32 unk_350; - /* 0x0354 */ f32 unk_354; - /* 0x0358 */ f32 unk_358; - /* 0x035C */ s16 unk_35C; - /* 0x0360 */ f32 unk_360; + /* 0x02AC */ s16 headRotTimer; + /* 0x02B0 */ s32 headRotDirection; + /* 0x02B4 */ ColliderCylinder standingCollider; + /* 0x0300 */ ColliderCylinder sittingCollider; + /* 0x034C */ s32 isSittingOCActive; + /* 0x0350 */ s32 waterState; + /* 0x0354 */ f32 sinkingStartPosY; + /* 0x0358 */ f32 bobDepth; + /* 0x035C */ s16 bobPhase; + /* 0x0360 */ f32 isSinking; /* 0x0364 */ Vec3f unk_364; - /* 0x0370 */ f32 unk_370; + /* 0x0370 */ f32 carryIdleTimer; /* 0x0374 */ NpcInteractInfo interactInfo; } EnRu1; // size = 0x039C +typedef enum EnRu1Type { + /* 0 */ ENRU1_TYPE_BOSS_ROOM, + /* 1 */ ENRU1_TYPE_FOUNTAIN, + /* 2 */ ENRU1_TYPE_HOLES_ROOM, + /* 3 */ ENRU1_TYPE_BASEMENT, + /* 4 */ ENRU1_TYPE_SAPPHIRE_ROOM, + /* 5 */ ENRU1_TYPE_BESIDE_KZ, + /* 6 */ ENRU1_TYPE_BESIDE_DOOR_SWITCH, +#if DEBUG_FEATURES + /* 10 */ ENRU1_TYPE_DEBUG = 10, +#endif +} EnRu1Type; + typedef enum RutoLimb { - /* 0 */ RUTO_CHILD_NONE, - /* 1 */ RUTO_CHILD_ROOT, - /* 2 */ RUTO_CHILD_LEFT_THIGH, - /* 3 */ RUTO_CHILD_LEFT_SHIN, - /* 4 */ RUTO_CHILD_LEFT_FOOT, - /* 5 */ RUTO_CHILD_RIGHT_THIGH, - /* 6 */ RUTO_CHILD_RIGHT_SHIN, - /* 7 */ RUTO_CHILD_RIGHT_FOOT, - /* 8 */ RUTO_CHILD_CHEST, - /* 9 */ RUTO_CHILD_LEFT_UPPER_ARM, + /* 0 */ RUTO_CHILD_NONE, + /* 1 */ RUTO_CHILD_ROOT, + /* 2 */ RUTO_CHILD_LEFT_THIGH, + /* 3 */ RUTO_CHILD_LEFT_SHIN, + /* 4 */ RUTO_CHILD_LEFT_FOOT, + /* 5 */ RUTO_CHILD_RIGHT_THIGH, + /* 6 */ RUTO_CHILD_RIGHT_SHIN, + /* 7 */ RUTO_CHILD_RIGHT_FOOT, + /* 8 */ RUTO_CHILD_CHEST, + /* 9 */ RUTO_CHILD_LEFT_UPPER_ARM, /* 10 */ RUTO_CHILD_LEFT_FIN, /* 11 */ RUTO_CHILD_LEFT_HAND, /* 12 */ RUTO_CHILD_RIGHT_UPPER_ARM, diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c index bce6bf6cac..32717457ef 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.inc.c @@ -1,5 +1,5 @@ #include "z_en_ru1.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off static CutsceneData gRutoFirstMeetingCs[] = { 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 402bb2329a..6e35bd842f 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -7,19 +7,22 @@ #include "z_en_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 "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ru2/object_ru2.h" @@ -700,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; @@ -832,13 +835,11 @@ void EnRu2_DialogCameraHandler(EnRu2* this, PlayState* play) { if (dialogState == TEXT_STATE_DONE_FADING) { if (this->lastDialogState != TEXT_STATE_DONE_FADING) { - // "I'm Komatsu!" (cinema scene dev) - PRINTF("おれが小松だ! \n"); + PRINTF(T("おれが小松だ! \n", "I'm Komatsu! \n")); // (cinema scene dev) this->textboxCount++; if (this->textboxCount % 6 == 3) { player = GET_PLAYER(play); - // "uorya-!" (screeming sound) - PRINTF("うおりゃー! \n"); + PRINTF(T("うおりゃー! \n", "uorya-! \n")); // (screaming sound) Camera_SetFinishedFlag(GET_ACTIVE_CAM(play)); player->actor.world.pos.x = 820.0f; player->actor.world.pos.y = 0.0f; @@ -921,8 +922,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); @@ -982,8 +983,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 ca051d1800..7b2b0ff2b1 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h @@ -2,7 +2,7 @@ #define Z_EN_RU2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.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) diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c index 4efe6fb390..92b2634543 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.inc.c @@ -1,5 +1,5 @@ #include "z_en_ru2.h" -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" // clang-format off static CutsceneData gWaterMedallionCs[] = { 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 fb834576fb..2f39fefa34 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -7,10 +7,10 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_sa/object_sa.h" #include "assets/scenes/overworld/spot04/spot04_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 0132877731..1161b67ca4 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.h +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.h @@ -2,7 +2,7 @@ #define Z_EN_SA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSa; 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 d1a2d3715f..6ece8b50b5 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -8,13 +8,15 @@ #include "attributes.h" #include "ichain.h" +#include "printf.h" #include "rand.h" #include "sfx.h" #include "terminal.h" +#include "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_sb/object_sb.h" @@ -276,8 +278,7 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) { EnSb_SpawnBubbles(play, this); this->bouncesLeft = 3; EnSb_SetupLunge(this); - // "Attack!!" - PRINTF("アタァ〜ック!!\n"); + PRINTF(T("アタァ〜ック!!\n", "Attack!!\n")); } } @@ -321,7 +322,7 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { this->actor.speed = 0.0f; this->timer = 1; EnSb_SetupWaitClosed(this); - PRINTF(VT_FGCOL(RED) "攻撃終了!!" VT_RST "\n"); // "Attack Complete!" + PRINTF(VT_FGCOL(RED) T("攻撃終了!!", "Attack complete!!") VT_RST "\n"); } } } @@ -392,7 +393,7 @@ s32 EnSb_UpdateDamage(EnSb* this, PlayState* play) { tookDamage = false; this->collider.base.acFlags &= ~AC_HIT; - switch (this->actor.colChkInfo.damageEffect) { + switch (this->actor.colChkInfo.damageReaction) { case 14: // wind arrow hitByWindArrow = true; FALLTHROUGH; 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 f2f0e42adb..e57381420d 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.h +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.h @@ -2,7 +2,7 @@ #define Z_EN_SB_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSb; 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 425b30b8f4..3ba16d656c 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 @@ -8,7 +8,7 @@ #include "gfx.h" #include "gfx_setupdl.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS 0 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 d1fcb16d90..b1925c1e80 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,7 +2,7 @@ #define Z_ITEM_SCENE_CHANGE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSceneChange; 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 95a1f773e6..1276b7f5ee 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -8,10 +8,11 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "regs.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) 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 27cba99665..bd9f623f7c 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 "z64actor.h" +#include "actor.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 4e082fcd47..03ef38b658 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -13,8 +13,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_shopnuts/object_shopnuts.h" 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 8bea3a0a68..32657cce02 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h @@ -2,7 +2,7 @@ #define Z_EN_SHOPNUTS_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "assets/objects/object_shopnuts/object_shopnuts.h" struct EnShopnuts; 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 d1597d0827..f3894ac83b 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -8,11 +8,11 @@ #include "sequence.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64draw.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "draw.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOOKSHOT_PULLS_ACTOR) @@ -88,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); @@ -121,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 a4ec863028..6aa91c0f30 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.h +++ b/src/overlays/actors/ovl_En_Si/z_en_si.h @@ -2,7 +2,7 @@ #define Z_EN_SI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSi; 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 ecdab8d5b2..b56bca6f67 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -14,10 +14,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_siofuki/object_siofuki.h" 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 56a08bff6f..4804f961aa 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 "z64actor.h" +#include "actor.h" typedef enum EnSiofukiType { /* 0x00 */ EN_SIOFUKI_RAISING, 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 52e521df9c..5d21c25fb4 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -16,10 +16,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_skb/object_skb.h" @@ -472,11 +472,11 @@ void EnSkb_CheckDamage(EnSkb* this, PlayState* play) { } else if (this->actionState >= SKB_BEHAVIOR_ATTACKING) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect != 6) { - this->lastDamageEffect = this->actor.colChkInfo.damageEffect; + if (this->actor.colChkInfo.damageReaction != 6) { + this->lastDamageReaction = this->actor.colChkInfo.damageReaction; Actor_SetDropFlag(&this->actor, &this->collider.elements[1].base, true); this->setColliderAT = false; - if (this->actor.colChkInfo.damageEffect == 1) { + if (this->actor.colChkInfo.damageReaction == 1) { if (this->actionState != SKB_BEHAVIOR_STUNNED) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); @@ -485,7 +485,7 @@ void EnSkb_CheckDamage(EnSkb* this, PlayState* play) { } } else { colorFilterDuration = 8; - if (this->actor.colChkInfo.damageEffect == 7) { + if (this->actor.colChkInfo.damageReaction == 7) { scale = this->actor.scale.y * 7500.0f; for (i = 4; i >= 0; i--) { flamePos = this->actor.world.pos; @@ -504,8 +504,8 @@ void EnSkb_CheckDamage(EnSkb* this, PlayState* play) { } player = GET_PLAYER(play); if (this->breakFlags == 0) { - if ((this->actor.colChkInfo.damageEffect == 0xD) || - ((this->actor.colChkInfo.damageEffect == 0xE) && + if ((this->actor.colChkInfo.damageReaction == 0xD) || + ((this->actor.colChkInfo.damageReaction == 0xE) && ((player->meleeWeaponAnimation >= PLAYER_MWA_RIGHT_SLASH_1H && player->meleeWeaponAnimation <= PLAYER_MWA_LEFT_COMBO_2H) || (player->meleeWeaponAnimation == PLAYER_MWA_BACKSLASH_RIGHT || 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 dd96d9e16e..e40c049cfa 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.h +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.h @@ -2,7 +2,7 @@ #define Z_EN_SKB_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSkb; @@ -15,7 +15,7 @@ typedef struct EnSkb { /* 0x0208 */ Vec3s morphTable[20]; /* 0x0280 */ u8 actionState; /* 0x0281 */ u8 setColliderAT; - /* 0x0282 */ u8 lastDamageEffect; + /* 0x0282 */ u8 lastDamageReaction; /* 0x0283 */ u8 breakFlags; /* 0x0284 */ EnSkbActionFunc actionFunc; /* 0x0288 */ s16 headlessYawOffset; 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 c5024ec78f..492b973735 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -4,6 +4,7 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "rand.h" #include "regs.h" #include "sequence.h" @@ -11,14 +12,14 @@ #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 "audio.h" +#include "debug_display.h" +#include "face_reaction.h" +#include "ocarina.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_skj/object_skj.h" @@ -605,7 +606,7 @@ s32 EnSkj_CollisionCheck(EnSkj* this, PlayState* play) { if (!((this->unk_2D3 == 0) || (D_80B01EA0 != 0) || !(this->collider.base.acFlags & AC_HIT))) { this->collider.base.acFlags &= ~AC_HIT; - switch (this->actor.colChkInfo.damageEffect) { + switch (this->actor.colChkInfo.damageReaction) { case 0xF: effectPos.x = this->collider.elem.acDmgInfo.hitPos.x; effectPos.y = this->collider.elem.acDmgInfo.hitPos.y; 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 1d49c81c42..1a9ccda020 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.h +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.h @@ -2,7 +2,7 @@ #define Z_EN_SKJ_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSkj; 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 91e9273054..11c33d8469 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -10,7 +10,7 @@ #include "gfx_setupdl.h" #include "ichain.h" #include "sys_matrix.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_skj/object_skj.h" 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 08ec8f4639..a58a37b933 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 "z64actor.h" +#include "actor.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 46c4d7559a..f3649fa697 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -1,15 +1,16 @@ #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 "effect.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ssh/object_ssh.h" @@ -509,16 +510,16 @@ s32 EnSsh_CheckHitFront(EnSsh* this) { } s32 EnSsh_CheckHitBack(EnSsh* this, PlayState* play) { - ColliderCylinder* cyl = &this->colliderCylinders[0]; + ColliderCylinder* collider = &this->colliderCylinders[0]; s32 hit = false; - if (cyl->base.acFlags & AC_HIT) { - cyl->base.acFlags &= ~AC_HIT; + if (collider->base.acFlags & AC_HIT) { + collider->base.acFlags &= ~AC_HIT; hit = true; } - cyl = &this->colliderCylinders[1]; - if (cyl->base.acFlags & AC_HIT) { - cyl->base.acFlags &= ~AC_HIT; + collider = &this->colliderCylinders[1]; + if (collider->base.acFlags & AC_HIT) { + collider->base.acFlags &= ~AC_HIT; hit = true; } if (!hit) { 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 741770cec5..fd056a0cc4 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -2,7 +2,7 @@ #define Z_EN_SSH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSsh; 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 3b36545dba..f32ce0ba67 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -7,15 +7,16 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_st/object_st.h" @@ -35,7 +36,13 @@ void EnSt_Die(EnSt* this, PlayState* play); void EnSt_BounceAround(EnSt* this, PlayState* play); void EnSt_FinishBouncing(EnSt* this, PlayState* play); -#include "assets/overlays/ovl_En_St/ovl_En_St.c" +static Vtx sSkulltulaUnusedVtx[] = { +#include "assets/overlays/ovl_En_St/sSkulltulaUnusedVtx.inc.c" +}; + +static Gfx sSkulltulaUnusedDL[10] = { +#include "assets/overlays/ovl_En_St/sSkulltulaUnusedDL.inc.c" +}; ActorProfile En_St_Profile = { /**/ ACTOR_EN_ST, @@ -438,21 +445,21 @@ s32 EnSt_CheckHitFrontside(EnSt* this) { } s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) { - ColliderCylinder* cyl = &this->colliderCylinders[0]; + ColliderCylinder* collider = &this->colliderCylinders[0]; s32 flags = 0; // damage flags from colliders 0 and 1 s32 hit = false; - if (cyl->base.acFlags & AC_HIT) { - cyl->base.acFlags &= ~AC_HIT; + if (collider->base.acFlags & AC_HIT) { + collider->base.acFlags &= ~AC_HIT; hit = true; - flags |= cyl->elem.acHitElem->atDmgInfo.dmgFlags; + flags |= collider->elem.acHitElem->atDmgInfo.dmgFlags; } - cyl = &this->colliderCylinders[1]; - if (cyl->base.acFlags & AC_HIT) { - cyl->base.acFlags &= ~AC_HIT; + collider = &this->colliderCylinders[1]; + if (collider->base.acFlags & AC_HIT) { + collider->base.acFlags &= ~AC_HIT; hit = true; - flags |= cyl->elem.acHitElem->atDmgInfo.dmgFlags; + flags |= collider->elem.acHitElem->atDmgInfo.dmgFlags; } if (!hit) { @@ -460,7 +467,7 @@ s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) { } this->invulnerableTimer = 8; - if (this->actor.colChkInfo.damageEffect == 1) { + if (this->actor.colChkInfo.damageReaction == 1) { if (this->stunTimer == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); this->stunTimer = 120; 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 08e9e8bd8d..36ecd714d2 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -2,7 +2,7 @@ #define Z_EN_ST_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSt; 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 2535b03254..5cd96b9c63 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -8,12 +8,14 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "segmented_address.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_ahg/object_ahg.h" #include "assets/objects/object_boj/object_boj.h" @@ -106,18 +108,17 @@ void EnSth_Init(Actor* thisx, PlayState* play) { s32 params = this->actor.params; s32 objectSlot; - PRINTF(VT_FGCOL(BLUE) "金スタル屋 no = %d\n" VT_RST, params); // "Gold Skulltula Shop" + PRINTF(VT_FGCOL(BLUE) T("金スタル屋 no = %d\n", "Gold Skulltula Shop no = %d\n") VT_RST, params); if (this->actor.params == 0) { if (gSaveContext.save.info.inventory.gsTokens < 100) { Actor_Kill(&this->actor); - // "Gold Skulltula Shop I still can't be a human" - PRINTF("金スタル屋 まだ 人間に戻れない \n"); + PRINTF(T("金スタル屋 まだ 人間に戻れない \n", "Gold Skulltula Shop I still can't be a human \n")); return; } } else if (gSaveContext.save.info.inventory.gsTokens < (this->actor.params * 10)) { Actor_Kill(&this->actor); - // "Gold Skulltula Shop I still can't be a human" - PRINTF(VT_FGCOL(BLUE) "金スタル屋 まだ 人間に戻れない \n" VT_RST); + PRINTF(VT_FGCOL(BLUE) T("金スタル屋 まだ 人間に戻れない \n", "Gold Skulltula Shop I still can't be a human \n") + VT_RST); return; } @@ -157,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]); @@ -400,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 a135fea2aa..d63682a474 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h @@ -2,7 +2,7 @@ #define Z_EN_STH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSth; 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 118328e793..c8c301cb2d 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -13,8 +13,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_stream/object_stream.h" 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 0a21d54d84..e188cb1dca 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.h +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.h @@ -2,7 +2,7 @@ #define Z_EN_STREAM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnStream; 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 8e10154c10..44a589c993 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -10,10 +10,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_st/object_st.h" 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 fe68092667..6a22eb7ba1 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.h +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.h @@ -2,7 +2,7 @@ #define Z_EN_SW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSw; 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 993e6bdbf0..045c8afbc0 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 @@ -3,15 +3,17 @@ #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 "translation.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "debug_display.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -84,8 +86,7 @@ void EnSyatekiItm_Init(Actor* thisx, PlayState* play2) { this->man = (EnSyatekiMan*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_SYATEKI_MAN, 140.0f, 0.0f, 255.0f, 0, -0x4000, 0, 0); if (this->man == NULL) { - // "Spawn error" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ エラー原 ☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ エラー原 ☆☆☆☆ \n", "☆☆☆☆☆ Error -Hara ☆☆☆☆ \n") VT_RST); Actor_Kill(&this->actor); return; } @@ -93,8 +94,7 @@ void EnSyatekiItm_Init(Actor* thisx, PlayState* play2) { this->markers[i] = (EnExRuppy*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_EX_RUPPY, sRupeePos[i].x, sRupeePos[i].y, sRupeePos[i].z, 0, 0, 0, 4); if (this->markers[i] == NULL) { - // "Second spawn error" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ エラー原セカンド ☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ エラー原セカンド ☆☆☆☆ \n", "☆☆☆☆☆ Second error -Hara ☆☆☆☆ \n") VT_RST); Actor_Kill(&this->actor); return; } @@ -245,8 +245,7 @@ void EnSyatekiItm_SpawnTargets(EnSyatekiItm* this, PlayState* play) { &play->actorCtx, &this->actor, play, ACTOR_EN_G_SWITCH, this->targetHome[i].x, this->targetHome[i].y, this->targetHome[i].z, 0, 0, 0, (ENGSWITCH_TARGET_RUPEE << 0xC) | 0x3F); if (this->targets[i] == NULL) { - // "Rupee spawn error" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ルピーでエラー原 ☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ルピーでエラー原 ☆☆☆☆ \n", "☆☆☆☆☆ Rupee error -Hara ☆☆☆☆ \n") VT_RST); Actor_Kill(&this->actor); return; } @@ -323,17 +322,16 @@ void EnSyatekiItm_EndGame(EnSyatekiItm* this, PlayState* play) { this->actionFunc = EnSyatekiItm_Idle; } if (this->signal == ENSYATEKI_START) { - // "1 frame attack and defense!" - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(RED) "☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(RED) T("☆☆☆☆☆ 1フレームの攻防! ☆☆☆☆ \n", "☆☆☆☆☆ 1 frame attack and defense! ☆☆☆☆ \n") VT_RST); this->signal = ENSYATEKI_NONE; this->actionFunc = EnSyatekiItm_Idle; } 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 46f54b7c79..fba3f9fac6 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,7 +2,7 @@ #define Z_EN_SYATEKI_ITM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSyatekiItm; 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 3ddfb5d78f..3c983d700f 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 @@ -5,13 +5,15 @@ #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 "translation.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ossan/object_ossan.h" @@ -172,8 +174,8 @@ void EnSyatekiMan_Init(Actor* thisx, PlayState* play) { EnSyatekiMan* this = (EnSyatekiMan*)thisx; PRINTF("\n\n"); - // "Old man appeared!! Muhohohohohohohon" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 親父登場!!むほほほほほほほーん ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 親父登場!!むほほほほほほほーん ☆☆☆☆☆ \n", + "☆☆☆☆☆ Old man appears!! Muhohohohohohoon ☆☆☆☆☆ \n") VT_RST); this->actor.attentionRangeType = ATTENTION_RANGE_1; Actor_SetScale(&this->actor, 0.01f); SkelAnime_InitFlex(play, &this->skelAnime, &gObjectOssanSkel, &gObjectOssanAnim_000338, this->jointTable, @@ -420,8 +422,7 @@ void EnSyatekiMan_GivePrize(EnSyatekiMan* this, PlayState* play) { void EnSyatekiMan_FinishPrize(EnSyatekiMan* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - // "Successful completion" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n", "☆☆☆☆☆ Normal termination ☆☆☆☆☆ \n") VT_RST); if (!LINK_IS_ADULT) { SET_ITEMGETINF(ITEMGETINF_0D); } else if ((this->getItemId == GI_QUIVER_40) || (this->getItemId == GI_QUIVER_50)) { @@ -443,8 +444,7 @@ void EnSyatekiMan_RestartGame(EnSyatekiMan* this, PlayState* play) { gallery->signal = ENSYATEKI_START; this->gameResult = SYATEKI_RESULT_NONE; this->actionFunc = EnSyatekiMan_WaitForGame; - // "Let's try again! Baby!" - PRINTF(VT_FGCOL(BLUE) "再挑戦だぜ!ベイビー!" VT_RST "\n"); + PRINTF(VT_FGCOL(BLUE) T("再挑戦だぜ!ベイビー!", "Let's try again! Baby!") VT_RST "\n"); } } } 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 306c33104f..b17187573c 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,7 +2,7 @@ #define Z_EN_SYATEKI_MAN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" 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 01b9c77979..c01b1a22d2 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,15 +10,17 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "rand.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 "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_niw/object_niw.h" @@ -95,13 +97,11 @@ void EnSyatekiNiw_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); if (this->minigameType == SYATEKI_MINIGAME_ARCHERY) { PRINTF("\n\n"); - // "Archery range chicken" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 射的場鶏 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 射的場鶏 ☆☆☆☆☆ \n", "☆☆☆☆☆ Archery range chicken ☆☆☆☆☆ \n") VT_RST); Actor_SetScale(&this->actor, 0.01f); } else { PRINTF("\n\n"); - // "Bomb chicken" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ ボムにわ! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ ボムにわ! ☆☆☆☆☆ \n", "☆☆☆☆☆ Bomb chicken! ☆☆☆☆☆ \n") VT_RST); this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); } diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h index 37db3e65fd..97ea786921 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h @@ -2,7 +2,7 @@ #define Z_EN_SYATEKI_NIW_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnSyatekiNiw; 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 7e13bf3679..353cb507b4 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -8,9 +8,11 @@ #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" @@ -18,12 +20,13 @@ #include "sfx.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64face_reaction.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_ta/object_ta.h" @@ -174,8 +177,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { switch (this->actor.params) { case ENTA_IN_KAKARIKO: - // "Exile Talon" - PRINTF(VT_FGCOL(CYAN) " 追放タロン \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" 追放タロン \n", " Exile Talon \n") VT_RST); if (GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO)) { Actor_Kill(&this->actor); } else if (!LINK_IS_ADULT) { @@ -195,15 +197,14 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { break; case ENTA_RETURNED_FROM_KAKARIKO: - // "Return Talon" - PRINTF(VT_FGCOL(CYAN) " 出戻りタロン \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" 出戻りタロン \n", " Return Talon \n") VT_RST); if (!GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO)) { Actor_Kill(&this->actor); } else if (!LINK_IS_ADULT) { Actor_Kill(&this->actor); } else if (play->sceneId == SCENE_STABLE && !IS_DAY) { Actor_Kill(&this->actor); - PRINTF(VT_FGCOL(CYAN) " 夜はいない \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" 夜はいない \n", " He's not here at night \n") VT_RST); } else { EnTa_SetupAction(this, EnTa_IdleAtRanch, EnTa_AnimRepeatCurrent); this->eyeIndex = TALON_EYE_INDEX_OPEN; @@ -213,8 +214,7 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { break; default: // Child era Talon - // "Other Talon" - PRINTF(VT_FGCOL(CYAN) " その他のタロン \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" その他のタロン \n", " Other Talon \n") VT_RST); if (play->sceneId == SCENE_HYRULE_CASTLE) { if (GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { Actor_Kill(&this->actor); @@ -231,7 +231,8 @@ void EnTa_Init(Actor* thisx, PlayState* play2) { this->actor.shape.shadowScale = 54.0f; } } else if (play->sceneId == SCENE_LON_LON_BUILDINGS) { - PRINTF(VT_FGCOL(CYAN) " ロンロン牧場の倉庫 の タロン\n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" ロンロン牧場の倉庫 の タロン\n", " Talon in the warehouse at Lon Lon Ranch\n") + VT_RST); if (!GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { Actor_Kill(&this->actor); } else if (LINK_IS_ADULT) { 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 d230c2b757..d8888d79b3 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.h +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.h @@ -2,7 +2,7 @@ #define Z_EN_TA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTa; 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 6370bef893..f087395369 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 @@ -8,12 +8,14 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "rand.h" #include "segmented_address.h" #include "terminal.h" +#include "translation.h" #include "versions.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_ts/object_ts.h" @@ -55,14 +57,14 @@ void EnTakaraMan_Init(Actor* thisx, PlayState* play) { if (sTakaraIsInitialized) { Actor_Kill(&this->actor); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ もういてる原 ☆☆☆☆☆ \n" VT_RST); // "Already initialized" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ もういてる原 ☆☆☆☆☆ \n", "☆☆☆☆☆ I'm already here -Hara ☆☆☆☆☆ \n") VT_RST); return; } sTakaraIsInitialized = true; PRINTF("\n\n"); - // "Bun! %x" (needs a better translation) - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ ばぅん! ☆☆☆☆☆ %x\n" VT_RST, play->actorCtx.flags.chest); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ ばぅん! ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Bang! ☆☆☆☆☆ %x\n") VT_RST, + play->actorCtx.flags.chest); play->actorCtx.flags.chest = 0; gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] = -1; SkelAnime_InitFlex(play, &this->skelAnime, &object_ts_Skel_004FE0, &object_ts_Anim_000498, this->jointTable, 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 e7d51c4b07..dbc0f80f45 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,7 +2,7 @@ #define Z_EN_TAKARA_MAN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTakaraMan; 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 28397c9c53..31df49fbc1 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -8,9 +8,11 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64play.h" +#include "translation.h" +#include "play_state.h" #include "assets/objects/object_shop_dungen/object_shop_dungen.h" @@ -39,8 +41,8 @@ ActorProfile En_Tana_Profile = { //! next data entry will be dereferenced and print garbage, stopping any future printing. //! In a non-matching context, this can cause a crash if the next item isn't a valid pointer. static const char* sShelfTypes[] = { - "木の棚", // "Wooden Shelves" - "石の棚", // "Stone Shelves" + T("木の棚", "Wooden shelf"), + T("石の棚", "Stone shelf"), #ifdef AVOID_UB "", #endif 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 1804bcd798..28f9c50f7c 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 "z64actor.h" +#include "actor.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 0f9a9aa228..f81eba1e5d 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -15,10 +15,10 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_sk2/object_sk2.h" @@ -192,7 +192,7 @@ static ColliderCylinderInit sShieldColliderInit = { { 20, 70, -50, { 0, 0, 0 } }, }; -static ColliderQuadInit sSwordColliderInit = { +static ColliderQuadInit sSwordColliderQuadInit = { { COL_MATERIAL_NONE, AT_ON | AT_TYPE_ENEMY, @@ -212,48 +212,48 @@ static ColliderQuadInit sSwordColliderInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum StalfosDamageEffect { - /* 0x0 */ STALFOS_DMGEFF_NORMAL, - /* 0x1 */ STALFOS_DMGEFF_STUN, - /* 0x6 */ STALFOS_DMGEFF_FIREMAGIC = 6, - /* 0xD */ STALFOS_DMGEFF_SLING = 0xD, - /* 0xE */ STALFOS_DMGEFF_LIGHT, - /* 0xF */ STALFOS_DMGEFF_FREEZE -} StalfosDamageEffect; +typedef enum StalfosDamageReaction { + /* 0x0 */ STALFOS_DMG_REACT_NORMAL, + /* 0x1 */ STALFOS_DMG_REACT_STUN, + /* 0x6 */ STALFOS_DMG_REACT_FIREMAGIC = 6, + /* 0xD */ STALFOS_DMG_REACT_SLING = 0xD, + /* 0xE */ STALFOS_DMG_REACT_LIGHT, + /* 0xF */ STALFOS_DMG_REACT_FREEZE +} StalfosDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, STALFOS_DMGEFF_STUN), - /* Deku stick */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Slingshot */ DMG_ENTRY(1, STALFOS_DMGEFF_SLING), - /* Explosive */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Boomerang */ DMG_ENTRY(0, STALFOS_DMGEFF_STUN), - /* Normal arrow */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Hammer swing */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Hookshot */ DMG_ENTRY(0, STALFOS_DMGEFF_STUN), - /* Kokiri sword */ DMG_ENTRY(1, STALFOS_DMGEFF_NORMAL), - /* Master sword */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Giant's Knife */ DMG_ENTRY(4, STALFOS_DMGEFF_NORMAL), - /* Fire arrow */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Ice arrow */ DMG_ENTRY(4, STALFOS_DMGEFF_FREEZE), - /* Light arrow */ DMG_ENTRY(2, STALFOS_DMGEFF_LIGHT), - /* Unk arrow 1 */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Unk arrow 2 */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Unk arrow 3 */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Fire magic */ DMG_ENTRY(0, STALFOS_DMGEFF_FIREMAGIC), - /* Ice magic */ DMG_ENTRY(3, STALFOS_DMGEFF_FREEZE), - /* Light magic */ DMG_ENTRY(0, STALFOS_DMGEFF_LIGHT), - /* Shield */ DMG_ENTRY(0, STALFOS_DMGEFF_NORMAL), - /* Mirror Ray */ DMG_ENTRY(0, STALFOS_DMGEFF_NORMAL), - /* Kokiri spin */ DMG_ENTRY(1, STALFOS_DMGEFF_NORMAL), - /* Giant spin */ DMG_ENTRY(4, STALFOS_DMGEFF_NORMAL), - /* Master spin */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Kokiri jump */ DMG_ENTRY(2, STALFOS_DMGEFF_NORMAL), - /* Giant jump */ DMG_ENTRY(8, STALFOS_DMGEFF_NORMAL), - /* Master jump */ DMG_ENTRY(4, STALFOS_DMGEFF_NORMAL), - /* Unknown 1 */ DMG_ENTRY(0, STALFOS_DMGEFF_NORMAL), - /* Unblockable */ DMG_ENTRY(0, STALFOS_DMGEFF_NORMAL), - /* Hammer jump */ DMG_ENTRY(4, STALFOS_DMGEFF_NORMAL), - /* Unknown 2 */ DMG_ENTRY(0, STALFOS_DMGEFF_NORMAL), + /* Deku nut */ DMG_ENTRY(0, STALFOS_DMG_REACT_STUN), + /* Deku stick */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Slingshot */ DMG_ENTRY(1, STALFOS_DMG_REACT_SLING), + /* Explosive */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Boomerang */ DMG_ENTRY(0, STALFOS_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Hammer swing */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Hookshot */ DMG_ENTRY(0, STALFOS_DMG_REACT_STUN), + /* Kokiri sword */ DMG_ENTRY(1, STALFOS_DMG_REACT_NORMAL), + /* Master sword */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Giant's Knife */ DMG_ENTRY(4, STALFOS_DMG_REACT_NORMAL), + /* Fire arrow */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Ice arrow */ DMG_ENTRY(4, STALFOS_DMG_REACT_FREEZE), + /* Light arrow */ DMG_ENTRY(2, STALFOS_DMG_REACT_LIGHT), + /* Unk arrow 1 */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Unk arrow 2 */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Unk arrow 3 */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Fire magic */ DMG_ENTRY(0, STALFOS_DMG_REACT_FIREMAGIC), + /* Ice magic */ DMG_ENTRY(3, STALFOS_DMG_REACT_FREEZE), + /* Light magic */ DMG_ENTRY(0, STALFOS_DMG_REACT_LIGHT), + /* Shield */ DMG_ENTRY(0, STALFOS_DMG_REACT_NORMAL), + /* Mirror Ray */ DMG_ENTRY(0, STALFOS_DMG_REACT_NORMAL), + /* Kokiri spin */ DMG_ENTRY(1, STALFOS_DMG_REACT_NORMAL), + /* Giant spin */ DMG_ENTRY(4, STALFOS_DMG_REACT_NORMAL), + /* Master spin */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Kokiri jump */ DMG_ENTRY(2, STALFOS_DMG_REACT_NORMAL), + /* Giant jump */ DMG_ENTRY(8, STALFOS_DMG_REACT_NORMAL), + /* Master jump */ DMG_ENTRY(4, STALFOS_DMG_REACT_NORMAL), + /* Unknown 1 */ DMG_ENTRY(0, STALFOS_DMG_REACT_NORMAL), + /* Unblockable */ DMG_ENTRY(0, STALFOS_DMG_REACT_NORMAL), + /* Hammer jump */ DMG_ENTRY(4, STALFOS_DMG_REACT_NORMAL), + /* Unknown 2 */ DMG_ENTRY(0, STALFOS_DMG_REACT_NORMAL), }; static InitChainEntry sInitChain[] = { @@ -294,7 +294,7 @@ void EnTest_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->shieldCollider, &this->actor, &sShieldColliderInit); Collider_InitQuad(play, &this->swordCollider); - Collider_SetQuad(play, &this->swordCollider, &this->actor, &sSwordColliderInit); + Collider_SetQuad(play, &this->swordCollider, &this->actor, &sSwordColliderQuadInit); this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 10; @@ -1313,12 +1313,12 @@ void EnTest_SetupStunned(EnTest* this) { this->skelAnime.playSpeed = 0.0f; this->actor.speed = -4.0f; - if (this->lastDamageEffect == STALFOS_DMGEFF_LIGHT) { + if (this->lastDamageReaction == STALFOS_DMG_REACT_LIGHT) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 120, COLORFILTER_BUFFLAG_OPA, 80); } else { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); - if (this->lastDamageEffect == STALFOS_DMGEFF_FREEZE) { + if (this->lastDamageReaction == STALFOS_DMG_REACT_FREEZE) { this->iceTimer = 36; } else { Animation_PlayOnceSetSpeed(&this->skelAnime, &gStalfosFlinchFromHitFrontAnim, 0.0f); @@ -1678,9 +1678,9 @@ void EnTest_UpdateDamage(EnTest* this, PlayState* play) { } else if (this->bodyCollider.base.acFlags & AC_HIT) { this->bodyCollider.base.acFlags &= ~AC_HIT; - if ((this->actor.colChkInfo.damageEffect != STALFOS_DMGEFF_SLING) && - (this->actor.colChkInfo.damageEffect != STALFOS_DMGEFF_FIREMAGIC)) { - this->lastDamageEffect = this->actor.colChkInfo.damageEffect; + if ((this->actor.colChkInfo.damageReaction != STALFOS_DMG_REACT_SLING) && + (this->actor.colChkInfo.damageReaction != STALFOS_DMG_REACT_FIREMAGIC)) { + this->lastDamageReaction = this->actor.colChkInfo.damageReaction; if (this->swordState >= 1) { this->swordState = 0; } @@ -1689,9 +1689,9 @@ void EnTest_UpdateDamage(EnTest* this, PlayState* play) { Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, false); Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU); - if ((this->actor.colChkInfo.damageEffect == STALFOS_DMGEFF_STUN) || - (this->actor.colChkInfo.damageEffect == STALFOS_DMGEFF_FREEZE) || - (this->actor.colChkInfo.damageEffect == STALFOS_DMGEFF_LIGHT)) { + if ((this->actor.colChkInfo.damageReaction == STALFOS_DMG_REACT_STUN) || + (this->actor.colChkInfo.damageReaction == STALFOS_DMG_REACT_FREEZE) || + (this->actor.colChkInfo.damageReaction == STALFOS_DMG_REACT_LIGHT)) { if (this->unk_7C8 != 0xB) { Actor_ApplyDamage(&this->actor); EnTest_SetupStunned(this); @@ -1723,7 +1723,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { EnTest_UpdateDamage(this, play); - if (this->actor.colChkInfo.damageEffect != STALFOS_DMGEFF_FIREMAGIC) { + if (this->actor.colChkInfo.damageReaction != STALFOS_DMG_REACT_FIREMAGIC) { Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | @@ -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_Test/z_en_test.h b/src/overlays/actors/ovl_En_Test/z_en_test.h index 030fcf740f..8a0e41abf6 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.h +++ b/src/overlays/actors/ovl_En_Test/z_en_test.h @@ -2,7 +2,7 @@ #define Z_EN_TEST_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTest; @@ -90,7 +90,7 @@ typedef struct EnTest { /* 0x7DD */ char unk_7DD[0x1]; /* 0x7DE */ u8 unk_7DE; /* 0x7E0 */ s16 iceTimer; - /* 0x7E2 */ u8 lastDamageEffect; + /* 0x7E2 */ u8 lastDamageReaction; /* 0x7E4 */ s32 unk_7E4; /* 0x7E8 */ s32 timer; /* 0x7EC */ f32 unk_7EC; 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 1fc830181b..e0e7ef04b2 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -8,8 +8,8 @@ #include "gfx.h" #include "sys_matrix.h" -#include "z64face_reaction.h" -#include "z64play.h" +#include "face_reaction.h" +#include "play_state.h" #include "assets/objects/object_mu/object_mu.h" 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 b4d9bfe063..f32b2b698f 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.h +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.h @@ -2,7 +2,7 @@ #define Z_EN_TG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTg; 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 e2f39597b5..1f45f2541b 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -12,15 +12,17 @@ #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 "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_tite/object_tite.h" @@ -225,8 +227,8 @@ void EnTite_Destroy(Actor* thisx, PlayState* play) { spawner->curNumSpawn--; } PRINTF("\n\n"); - // "Number of simultaneous occurrences" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 同時発生数 ☆☆☆☆☆%d\n" VT_RST, spawner->curNumSpawn); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 同時発生数 ☆☆☆☆☆%d\n", "☆☆☆☆☆ Number of simultaneous spawns ☆☆☆☆☆%d\n") VT_RST, + spawner->curNumSpawn); PRINTF("\n\n"); } Collider_DestroyJntSph(play, &this->collider); @@ -693,7 +695,7 @@ void EnTite_SetupStunned(EnTite* this) { this->action = TEKTITE_STUNNED; this->actor.speed = -6.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (this->damageEffect == 0xF) { + if (this->damageReaction == 0xF) { this->spawnIceTimer = 48; } Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -864,11 +866,11 @@ void EnTite_CheckDamage(Actor* thisx, PlayState* play) { if ((this->collider.base.acFlags & AC_HIT) && (this->action >= TEKTITE_IDLE)) { this->collider.base.acFlags &= ~AC_HIT; - if (thisx->colChkInfo.damageEffect != 0xE) { // Immune to fire magic - this->damageEffect = thisx->colChkInfo.damageEffect; + if (thisx->colChkInfo.damageReaction != 0xE) { // Immune to fire magic + this->damageReaction = thisx->colChkInfo.damageReaction; Actor_SetDropFlag(thisx, &this->collider.elements[0].base, false); // Stun if Tektite hit by nut, boomerang, hookshot, ice arrow or ice magic - if ((thisx->colChkInfo.damageEffect == 1) || (thisx->colChkInfo.damageEffect == 0xF)) { + if ((thisx->colChkInfo.damageReaction == 1) || (thisx->colChkInfo.damageReaction == 0xF)) { if (this->action != TEKTITE_STUNNED) { Actor_SetColorFilter(thisx, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(thisx); @@ -914,7 +916,7 @@ void EnTite_Update(Actor* thisx, PlayState* play) { EnTite_CheckDamage(thisx, play); // Stay still if hit by immunity damage type this frame - if (thisx->colChkInfo.damageEffect != 0xE) { + if (thisx->colChkInfo.damageReaction != 0xE) { this->actionFunc(this, play); Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 25.0f, 40.0f, 20.0f, this->unk_2DC); 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 d4ec9ab8dd..4fedb782d1 100755 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -2,7 +2,7 @@ #define Z_EN_TITE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTite; @@ -26,7 +26,7 @@ typedef struct EnTite { /* 0x02E0 */ s16 actionVar1; // Usage depends on current action function /* 0x02E2 */ u8 actionVar2; // Usage depends on current action function /* 0x02E3 */ u8 spawnIceTimer; - /* 0x02E4 */ u8 damageEffect; + /* 0x02E4 */ u8 damageReaction; /* 0x02E8 */ ColliderJntSph collider; /* 0x0308 */ ColliderJntSphElement colliderElements[1]; /* 0x0348 */ Vec3f frontLeftFootPos; 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 c6b1b0906e..a802541986 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -8,6 +8,7 @@ #include "libc64/math64.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "rand.h" @@ -16,9 +17,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64face_reaction.h" -#include "z64play.h" -#include "z64save.h" +#include "face_reaction.h" +#include "play_state.h" +#include "save.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 2ce0b9ef87..26f9774d41 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -2,7 +2,7 @@ #define Z_EN_TK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" /* Dirt particle effect */ struct EnTkEff; 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 6e406c6bab..1219bab670 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -7,8 +7,8 @@ #include "z_en_torch.h" #include "overlays/actors/ovl_En_Box/z_en_box.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.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 fc3e2dabac..88b339c7ef 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 "z64actor.h" +#include "actor.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 a02e9bc3bb..3f10462ead 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -17,11 +17,11 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_torch2/object_torch2.h" @@ -612,7 +612,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->stateFlags3 &= ~PLAYER_STATE3_2; } else { func_800F5ACC(NA_BGM_MINI_BOSS); - if (this->actor.colChkInfo.damageEffect == 1) { + if (this->actor.colChkInfo.damageReaction == 1) { if (sAlpha == 255) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); } else { 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 bb132bc91e..a45afbba4a 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h @@ -2,8 +2,8 @@ #define Z_EN_TORCH2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" -// Uses the Player struct (from z64player.h) +// Uses the Player struct (from player.h) #endif 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 2ac84162c6..361ef77182 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -11,10 +11,10 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_toryo/object_toryo.h" 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 f8d04e74ac..479b97e8bb 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h @@ -2,7 +2,7 @@ #define Z_EN_TORYO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnToryo; 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 a1ce22995c..f197510c55 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -18,9 +18,9 @@ #include "versions.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_tp/object_tp.h" @@ -95,46 +95,46 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -typedef enum TailpasaranDamageEffect { - /* 00 */ TAILPASARAN_DMGEFF_NONE, - /* 01 */ TAILPASARAN_DMGEFF_DEKUNUT, - /* 14 */ TAILPASARAN_DMGEFF_SHOCKING = 14, // Kills the Tailpasaran but shocks Player - /* 15 */ TAILPASARAN_DMGEFF_INSULATING // Kills the Tailpasaran and does not shock Player -} TailpasaranDamageEffect; +typedef enum TailpasaranDamageReaction { + /* 00 */ TAILPASARAN_DMG_REACT_NONE, + /* 01 */ TAILPASARAN_DMG_REACT_DEKUNUT, + /* 14 */ TAILPASARAN_DMG_REACT_SHOCKING = 14, // Kills the Tailpasaran but shocks Player + /* 15 */ TAILPASARAN_DMG_REACT_INSULATING // Kills the Tailpasaran and does not shock Player +} TailpasaranDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_DEKUNUT), - /* Deku stick */ DMG_ENTRY(2, TAILPASARAN_DMGEFF_INSULATING), - /* Slingshot */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Explosive */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(1, TAILPASARAN_DMGEFF_INSULATING), - /* Normal arrow */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, TAILPASARAN_DMGEFF_SHOCKING), - /* Hookshot */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Kokiri sword */ DMG_ENTRY(1, TAILPASARAN_DMGEFF_SHOCKING), - /* Master sword */ DMG_ENTRY(2, TAILPASARAN_DMGEFF_SHOCKING), - /* Giant's Knife */ DMG_ENTRY(4, TAILPASARAN_DMGEFF_SHOCKING), - /* Fire arrow */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Ice arrow */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Light arrow */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Unk arrow 1 */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Ice magic */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Light magic */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Shield */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, TAILPASARAN_DMGEFF_SHOCKING), - /* Giant spin */ DMG_ENTRY(4, TAILPASARAN_DMGEFF_SHOCKING), - /* Master spin */ DMG_ENTRY(2, TAILPASARAN_DMGEFF_SHOCKING), - /* Kokiri jump */ DMG_ENTRY(2, TAILPASARAN_DMGEFF_SHOCKING), - /* Giant jump */ DMG_ENTRY(8, TAILPASARAN_DMGEFF_SHOCKING), - /* Master jump */ DMG_ENTRY(4, TAILPASARAN_DMGEFF_SHOCKING), - /* Unknown 1 */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, TAILPASARAN_DMGEFF_SHOCKING), - /* Unknown 2 */ DMG_ENTRY(0, TAILPASARAN_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_DEKUNUT), + /* Deku stick */ DMG_ENTRY(2, TAILPASARAN_DMG_REACT_INSULATING), + /* Slingshot */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Explosive */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(1, TAILPASARAN_DMG_REACT_INSULATING), + /* Normal arrow */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, TAILPASARAN_DMG_REACT_SHOCKING), + /* Hookshot */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Kokiri sword */ DMG_ENTRY(1, TAILPASARAN_DMG_REACT_SHOCKING), + /* Master sword */ DMG_ENTRY(2, TAILPASARAN_DMG_REACT_SHOCKING), + /* Giant's Knife */ DMG_ENTRY(4, TAILPASARAN_DMG_REACT_SHOCKING), + /* Fire arrow */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Ice arrow */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Light arrow */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Unk arrow 1 */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Ice magic */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Light magic */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Shield */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, TAILPASARAN_DMG_REACT_SHOCKING), + /* Giant spin */ DMG_ENTRY(4, TAILPASARAN_DMG_REACT_SHOCKING), + /* Master spin */ DMG_ENTRY(2, TAILPASARAN_DMG_REACT_SHOCKING), + /* Kokiri jump */ DMG_ENTRY(2, TAILPASARAN_DMG_REACT_SHOCKING), + /* Giant jump */ DMG_ENTRY(8, TAILPASARAN_DMG_REACT_SHOCKING), + /* Master jump */ DMG_ENTRY(4, TAILPASARAN_DMG_REACT_SHOCKING), + /* Unknown 1 */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, TAILPASARAN_DMG_REACT_SHOCKING), + /* Unknown 2 */ DMG_ENTRY(0, TAILPASARAN_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -604,10 +604,10 @@ void EnTp_UpdateDamage(EnTp* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlagJntSph(&this->actor, &this->collider, true); - this->damageEffect = this->actor.colChkInfo.damageEffect; + this->damageReaction = this->actor.colChkInfo.damageReaction; - if (this->actor.colChkInfo.damageEffect != TAILPASARAN_DMGEFF_NONE) { - if (this->actor.colChkInfo.damageEffect == TAILPASARAN_DMGEFF_DEKUNUT) { + if (this->actor.colChkInfo.damageReaction != TAILPASARAN_DMG_REACT_NONE) { + if (this->actor.colChkInfo.damageReaction == TAILPASARAN_DMG_REACT_DEKUNUT) { phi_s4 = 1; } @@ -622,7 +622,7 @@ void EnTp_UpdateDamage(EnTp* this, PlayState* play) { if (head->actor.params <= TAILPASARAN_HEAD) { EnTp_SetupDie(head); - head->damageEffect = this->actor.colChkInfo.damageEffect; + head->damageReaction = this->actor.colChkInfo.damageReaction; head->actor.params = TAILPASARAN_HEAD_DYING; } } else { @@ -686,7 +686,7 @@ void EnTp_Update(Actor* thisx, PlayState* play) { s16 yawToWall; if (player->stateFlags1 & PLAYER_STATE1_26) { // Shielding - this->damageEffect = TAILPASARAN_DMGEFF_NONE; + this->damageReaction = TAILPASARAN_DMG_REACT_NONE; } if (this->actor.colChkInfo.health != 0) { @@ -737,7 +737,7 @@ void EnTp_Update(Actor* thisx, PlayState* play) { this->actor.focus.pos = this->actor.world.pos; - if (this->damageEffect == TAILPASARAN_DMGEFF_SHOCKING) { + if (this->damageReaction == TAILPASARAN_DMG_REACT_SHOCKING) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); } 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 71fdca8188..7e596aadbd 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.h +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.h @@ -2,7 +2,7 @@ #define Z_EN_TP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTp; @@ -13,7 +13,7 @@ typedef struct EnTp { /* 0x014C */ s32 actionIndex; /* 0x0150 */ s32 unk_150; // Some kind of state indicator /* 0x0154 */ EnTpActionFunc actionFunc; - /* 0x0158 */ u8 damageEffect; // Used to propagate the effect to the other segments' actors + /* 0x0158 */ u8 damageReaction; // Used to propagate the reaction to the other segments' actors /* 0x015A */ s16 timer; /* 0x015C */ s16 unk_15C; // Multipurpose, used to change the horizontal position of tail segments /* 0x015E */ s16 alpha; // The dying types fade away 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 3f2672cde4..84b2dd4cf6 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -13,9 +13,9 @@ #include "sys_math.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_tr/object_tr.h" 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 091aa5c52f..d649090229 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.h +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.h @@ -2,7 +2,7 @@ #define Z_EN_TR_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTr; 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 848e6701b0..22b44abdfc 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -8,8 +8,8 @@ #include "sfx.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_trap/object_trap.h" 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 fcd62dd170..86b0c1d043 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 "z64actor.h" +#include "actor.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 d9965bfe1f..b7afe53f41 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 @@ -8,15 +8,17 @@ #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 "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" @@ -68,7 +70,7 @@ void EnTuboTrap_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 2.0f); PRINTF("\n\n"); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Urn Trap ☆☆☆☆☆ %x\n") VT_RST, this->actor.params); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Actor_SetScale(&this->actor, 0.1f); @@ -233,8 +235,9 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, PlayState* play) { f32 targetHeight; if (BREG(2) != 0) { - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ わて ☆☆☆☆☆ %f\n" VT_RST, this->actor.world.pos.y); // "You" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ おいどん ☆☆☆☆☆ %f\n" VT_RST, player->actor.world.pos.y); // "Me" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ わて ☆☆☆☆☆ %f\n", "☆☆☆☆☆ You ☆☆☆☆☆ %f\n") VT_RST, this->actor.world.pos.y); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ おいどん ☆☆☆☆☆ %f\n", "☆☆☆☆☆ Me ☆☆☆☆☆ %f\n") VT_RST, + player->actor.world.pos.y); PRINTF("\n\n"); } 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 3abe8b625a..04d54d3847 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,7 +2,7 @@ #define Z_EN_TUBO_TRAP_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnTuboTrap; 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 011b004b68..643cae1b35 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -15,8 +15,8 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_vali/object_vali.h" @@ -97,48 +97,48 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 2, 18, 32, MASS_HEAVY }; -typedef enum BariDamageEffect { - /* 0x0 */ BARI_DMGEFF_NONE, - /* 0x1 */ BARI_DMGEFF_STUN, - /* 0x2 */ BARI_DMGEFF_FIRE, - /* 0x3 */ BARI_DMGEFF_ICE, - /* 0xE */ BARI_DMGEFF_SLINGSHOT = 0xE, - /* 0xF */ BARI_DMGEFF_SWORD -} BariDamageEffect; +typedef enum BariDamageReaction { + /* 0x0 */ BARI_DMG_REACT_NONE, + /* 0x1 */ BARI_DMG_REACT_STUN, + /* 0x2 */ BARI_DMG_REACT_FIRE, + /* 0x3 */ BARI_DMG_REACT_ICE, + /* 0xE */ BARI_DMG_REACT_SLINGSHOT = 0xE, + /* 0xF */ BARI_DMG_REACT_SWORD +} BariDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, BARI_DMGEFF_STUN), - /* Deku stick */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Slingshot */ DMG_ENTRY(0, BARI_DMGEFF_SLINGSHOT), - /* Explosive */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(0, BARI_DMGEFF_STUN), - /* Normal arrow */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Hookshot */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Kokiri sword */ DMG_ENTRY(1, BARI_DMGEFF_SWORD), - /* Master sword */ DMG_ENTRY(2, BARI_DMGEFF_SWORD), - /* Giant's Knife */ DMG_ENTRY(4, BARI_DMGEFF_SWORD), - /* Fire arrow */ DMG_ENTRY(4, BARI_DMGEFF_FIRE), - /* Ice arrow */ DMG_ENTRY(4, BARI_DMGEFF_ICE), - /* Light arrow */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Unk arrow 1 */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(4, BARI_DMGEFF_FIRE), - /* Ice magic */ DMG_ENTRY(4, BARI_DMGEFF_ICE), - /* Light magic */ DMG_ENTRY(0, BARI_DMGEFF_NONE), - /* Shield */ DMG_ENTRY(0, BARI_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, BARI_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, BARI_DMGEFF_NONE), - /* Giant spin */ DMG_ENTRY(4, BARI_DMGEFF_NONE), - /* Master spin */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Kokiri jump */ DMG_ENTRY(2, BARI_DMGEFF_NONE), - /* Giant jump */ DMG_ENTRY(8, BARI_DMGEFF_NONE), - /* Master jump */ DMG_ENTRY(4, BARI_DMGEFF_NONE), - /* Unknown 1 */ DMG_ENTRY(0, BARI_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, BARI_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, BARI_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, BARI_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, BARI_DMG_REACT_STUN), + /* Deku stick */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(0, BARI_DMG_REACT_SLINGSHOT), + /* Explosive */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(0, BARI_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Hookshot */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Kokiri sword */ DMG_ENTRY(1, BARI_DMG_REACT_SWORD), + /* Master sword */ DMG_ENTRY(2, BARI_DMG_REACT_SWORD), + /* Giant's Knife */ DMG_ENTRY(4, BARI_DMG_REACT_SWORD), + /* Fire arrow */ DMG_ENTRY(4, BARI_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(4, BARI_DMG_REACT_ICE), + /* Light arrow */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Unk arrow 1 */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(4, BARI_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(4, BARI_DMG_REACT_ICE), + /* Light magic */ DMG_ENTRY(0, BARI_DMG_REACT_NONE), + /* Shield */ DMG_ENTRY(0, BARI_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, BARI_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, BARI_DMG_REACT_NONE), + /* Giant spin */ DMG_ENTRY(4, BARI_DMG_REACT_NONE), + /* Master spin */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Kokiri jump */ DMG_ENTRY(2, BARI_DMG_REACT_NONE), + /* Giant jump */ DMG_ENTRY(8, BARI_DMG_REACT_NONE), + /* Master jump */ DMG_ENTRY(4, BARI_DMG_REACT_NONE), + /* Unknown 1 */ DMG_ENTRY(0, BARI_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, BARI_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, BARI_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, BARI_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -512,21 +512,21 @@ void EnVali_UpdateDamage(EnVali* this, PlayState* play) { this->bodyCollider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, true); - if ((this->actor.colChkInfo.damageEffect != BARI_DMGEFF_NONE) || (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction != BARI_DMG_REACT_NONE) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_BARI_DEAD); Enemy_StartFinishingBlow(play, &this->actor); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; - } else if ((this->actor.colChkInfo.damageEffect != BARI_DMGEFF_STUN) && - (this->actor.colChkInfo.damageEffect != BARI_DMGEFF_SLINGSHOT)) { + } else if ((this->actor.colChkInfo.damageReaction != BARI_DMG_REACT_STUN) && + (this->actor.colChkInfo.damageReaction != BARI_DMG_REACT_SLINGSHOT)) { Actor_PlaySfx(&this->actor, NA_SE_EN_BARI_DAMAGE); } - if (this->actor.colChkInfo.damageEffect == BARI_DMGEFF_STUN) { + if (this->actor.colChkInfo.damageReaction == BARI_DMG_REACT_STUN) { if (this->actionFunc != EnVali_Stunned) { EnVali_SetupStunned(this); } - } else if (this->actor.colChkInfo.damageEffect == BARI_DMGEFF_SWORD) { + } else if (this->actor.colChkInfo.damageReaction == BARI_DMG_REACT_SWORD) { if (this->actionFunc != EnVali_Stunned) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 150, COLORFILTER_BUFFLAG_XLU, 30); this->actor.params = BARI_TYPE_SWORD_DAMAGE; @@ -534,11 +534,11 @@ void EnVali_UpdateDamage(EnVali* this, PlayState* play) { } else { EnVali_SetupRetaliate(this); } - } else if (this->actor.colChkInfo.damageEffect == BARI_DMGEFF_FIRE) { + } else if (this->actor.colChkInfo.damageReaction == BARI_DMG_REACT_FIRE) { EnVali_SetupBurnt(this); - } else if (this->actor.colChkInfo.damageEffect == BARI_DMGEFF_ICE) { + } else if (this->actor.colChkInfo.damageReaction == BARI_DMG_REACT_ICE) { EnVali_SetupFrozen(this); - } else if (this->actor.colChkInfo.damageEffect == BARI_DMGEFF_SLINGSHOT) { + } else if (this->actor.colChkInfo.damageReaction == BARI_DMG_REACT_SLINGSHOT) { if (this->slingshotReactionTimer == 0) { this->slingshotReactionTimer = 20; } 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 1a031d964b..66ac96d3d1 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.h +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.h @@ -2,7 +2,7 @@ #define Z_EN_VALI_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnVali; 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 30f8b32b18..4e8cec5ff4 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -6,7 +6,7 @@ #include "z_en_vase.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/object_vase/object_vase.h" 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 04a8381e29..50cc1d08e3 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 "z64actor.h" +#include "actor.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 8791409d01..826d7f0ebe 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 @@ -15,8 +15,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_fd/object_fd.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 e81bc1ac25..e7954751de 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 "z64actor.h" +#include "actor.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 5db75cbfe2..ce7ea7e2c9 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -9,6 +9,7 @@ #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" @@ -19,10 +20,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64save.h" -#include "z64skin.h" +#include "audio.h" +#include "play_state.h" +#include "save.h" +#include "skin.h" #include "assets/objects/object_zl4/object_zl4.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -33,6 +34,8 @@ #include "assets/objects/object_ganon/object_ganon.h" #include "assets/objects/object_opening_demo1/object_opening_demo1.h" +#pragma increment_block_number "ntsc-1.0:128" + #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED void EnViewer_Init(Actor* thisx, PlayState* play); @@ -140,7 +143,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); @@ -151,7 +154,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); } @@ -504,7 +507,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 a06435d553..1bb5780203 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -2,8 +2,8 @@ #define Z_EN_VIEWER_H #include "ultra64.h" -#include "z64actor.h" -#include "z64skin.h" +#include "actor.h" +#include "skin.h" struct EnViewer; 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 d5d2ec1b06..128a0af5f4 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -10,15 +10,16 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_vm/object_vm.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 7705d87032..33d52e2fb8 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.h +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.h @@ -2,7 +2,7 @@ #define Z_EN_VM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnVm; 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 28411c959f..cda2c07dc0 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,12 +12,14 @@ #include "rand.h" #include "regs.h" #include "sfx.h" +#include "printf.h" #include "quake.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64effect.h" -#include "z64play.h" +#include "debug_display.h" +#include "effect.h" +#include "play_state.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -45,8 +47,7 @@ void EnWallTubo_Init(Actor* thisx, PlayState* play) { EnWallTubo* this = (EnWallTubo*)thisx; PRINTF("\n\n"); - // "Wall Target" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 壁のツボ ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 壁のツボ ☆☆☆☆☆ \n", "☆☆☆☆☆ Points on the wall ☆☆☆☆☆ \n") VT_RST); this->unk_164 = this->actor.world.pos; this->actionFunc = EnWallTubo_FindGirl; } @@ -134,12 +135,12 @@ void EnWallTubo_SetWallFall(EnWallTubo* this, PlayState* play) { if ((wall != NULL) && (wall->dyna.actor.update != NULL)) { wall->isHit = true; - // "You did it field!" (repeated 5 times) - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆ やった原! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆ やった原! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(BLUE) "☆☆☆☆ やった原! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆ やった原! ☆☆☆☆☆ \n" VT_RST); - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆ やった原! ☆☆☆☆☆ \n" VT_RST); + // "Hara" may stand for the developer name Kuzuhara + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆ やった原! ☆☆☆☆☆ \n", "☆☆☆☆ I did it! -Hara ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆ やった原! ☆☆☆☆☆ \n", "☆☆☆☆ I did it! -Hara ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(BLUE) T("☆☆☆☆ やった原! ☆☆☆☆☆ \n", "☆☆☆☆ I did it! -Hara ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆ やった原! ☆☆☆☆☆ \n", "☆☆☆☆ I did it! -Hara ☆☆☆☆☆ \n") VT_RST); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆ やった原! ☆☆☆☆☆ \n", "☆☆☆☆ I did it! -Hara ☆☆☆☆☆ \n") VT_RST); } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h index b2e9005372..5cbbb878e7 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h @@ -2,7 +2,7 @@ #define Z_EN_WALL_TUBO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" #include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" struct EnWallTubo; 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 abb91c80b9..7373f441a6 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -14,10 +14,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_wallmaster/object_wallmaster.h" @@ -26,10 +26,6 @@ #define TIMER_SCALE ((f32)OS_CLOCK_RATE / 10000000000) -#define DAMAGE_EFFECT_BURN 2 -#define DAMAGE_EFFECT_STUN_WHITE 4 -#define DAMAGE_EFFECT_STUN_BLUE 1 - void EnWallmas_Init(Actor* thisx, PlayState* play); void EnWallmas_Destroy(Actor* thisx, PlayState* play); void EnWallmas_Update(Actor* thisx, PlayState* play); @@ -86,39 +82,46 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 4, 30, 40, 150 }; +typedef enum EnWallmasDamageReaction { + /* 0 */ WALLMAS_DMG_REACT_NONE, + /* 1 */ WALLMAS_DMG_REACT_STUN_BLUE, + /* 2 */ WALLMAS_DMG_REACT_BURN, + /* 4 */ WALLMAS_DMG_REACT_STUN_WHITE = 4 +} EnWallmasDamageReaction; + static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, 0x1), - /* Deku stick */ DMG_ENTRY(2, 0x0), - /* Slingshot */ DMG_ENTRY(1, 0x0), - /* Explosive */ DMG_ENTRY(2, 0x0), - /* Boomerang */ DMG_ENTRY(0, 0x1), - /* Normal arrow */ DMG_ENTRY(2, 0x0), - /* Hammer swing */ DMG_ENTRY(2, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0x1), - /* Kokiri sword */ DMG_ENTRY(1, 0x0), - /* Master sword */ DMG_ENTRY(2, 0x0), - /* Giant's Knife */ DMG_ENTRY(4, 0x0), - /* Fire arrow */ DMG_ENTRY(4, 0x2), - /* Ice arrow */ DMG_ENTRY(2, 0x0), - /* Light arrow */ DMG_ENTRY(4, 0x4), - /* Unk arrow 1 */ DMG_ENTRY(4, 0x0), - /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), - /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), - /* Fire magic */ DMG_ENTRY(4, 0x2), - /* Ice magic */ DMG_ENTRY(0, 0x0), - /* Light magic */ DMG_ENTRY(4, 0x4), - /* Shield */ DMG_ENTRY(0, 0x0), - /* Mirror Ray */ DMG_ENTRY(0, 0x0), - /* Kokiri spin */ DMG_ENTRY(1, 0x0), - /* Giant spin */ DMG_ENTRY(4, 0x0), - /* Master spin */ DMG_ENTRY(2, 0x0), - /* Kokiri jump */ DMG_ENTRY(2, 0x0), - /* Giant jump */ DMG_ENTRY(8, 0x0), - /* Master jump */ DMG_ENTRY(4, 0x0), - /* Unknown 1 */ DMG_ENTRY(0, 0x0), - /* Unblockable */ DMG_ENTRY(0, 0x0), - /* Hammer jump */ DMG_ENTRY(4, 0x0), - /* Unknown 2 */ DMG_ENTRY(0, 0x0), + /* Deku nut */ DMG_ENTRY(0, WALLMAS_DMG_REACT_STUN_BLUE), + /* Deku stick */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(1, WALLMAS_DMG_REACT_NONE), + /* Explosive */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(0, WALLMAS_DMG_REACT_STUN_BLUE), + /* Normal arrow */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Hookshot */ DMG_ENTRY(0, WALLMAS_DMG_REACT_STUN_BLUE), + /* Kokiri sword */ DMG_ENTRY(1, WALLMAS_DMG_REACT_NONE), + /* Master sword */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Giant's Knife */ DMG_ENTRY(4, WALLMAS_DMG_REACT_NONE), + /* Fire arrow */ DMG_ENTRY(4, WALLMAS_DMG_REACT_BURN), + /* Ice arrow */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Light arrow */ DMG_ENTRY(4, WALLMAS_DMG_REACT_STUN_WHITE), + /* Unk arrow 1 */ DMG_ENTRY(4, WALLMAS_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(4, WALLMAS_DMG_REACT_BURN), + /* Ice magic */ DMG_ENTRY(0, WALLMAS_DMG_REACT_NONE), + /* Light magic */ DMG_ENTRY(4, WALLMAS_DMG_REACT_STUN_WHITE), + /* Shield */ DMG_ENTRY(0, WALLMAS_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, WALLMAS_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, WALLMAS_DMG_REACT_NONE), + /* Giant spin */ DMG_ENTRY(4, WALLMAS_DMG_REACT_NONE), + /* Master spin */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Kokiri jump */ DMG_ENTRY(2, WALLMAS_DMG_REACT_NONE), + /* Giant jump */ DMG_ENTRY(8, WALLMAS_DMG_REACT_NONE), + /* Master jump */ DMG_ENTRY(4, WALLMAS_DMG_REACT_NONE), + /* Unknown 1 */ DMG_ENTRY(0, WALLMAS_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, WALLMAS_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, WALLMAS_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, WALLMAS_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -292,7 +295,7 @@ void EnWallmas_SetupStun(EnWallmas* this) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.5f, 0, 20.0f, ANIMMODE_ONCE, -3.0f); this->actor.speed = 0.0f; - if (this->actor.colChkInfo.damageEffect == 4) { + if (this->actor.colChkInfo.damageReaction == 4) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_OPA, 80); } else { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 255, COLORFILTER_BUFFLAG_OPA, 80); @@ -522,7 +525,7 @@ void EnWallmas_ColUpdate(EnWallmas* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DEAD); @@ -533,13 +536,13 @@ void EnWallmas_ColUpdate(EnWallmas* this, PlayState* play) { } } - if ((this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_WHITE) || - (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_STUN_BLUE)) { + if ((this->actor.colChkInfo.damageReaction == WALLMAS_DMG_REACT_STUN_WHITE) || + (this->actor.colChkInfo.damageReaction == WALLMAS_DMG_REACT_STUN_BLUE)) { if (this->actionFunc != EnWallmas_Stun) { EnWallmas_SetupStun(this); } } else { - if (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_BURN) { + if (this->actor.colChkInfo.damageReaction == WALLMAS_DMG_REACT_BURN) { EffectSsFCircle_Spawn(play, &this->actor, &this->actor.world.pos, 40, 40); } 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 76ee52d9e0..664bc80778 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 "z64actor.h" +#include "actor.h" typedef enum WallmasType { /* 0x00 */ WMT_TIMER, 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 85de2cd564..3fe70749c9 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 @@ -6,14 +6,16 @@ #include "z_en_weather_tag.h" +#include "printf.h" #include "regs.h" #include "terminal.h" +#include "translation.h" #include "versions.h" #include "z_lib.h" -#include "z64debug_display.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "debug_display.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -66,14 +68,14 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { switch (PARAMS_GET_U(this->actor.params, 0, 4)) { case EN_WEATHER_TAG_TYPE_CLOUDY_MARKET: PRINTF("\n\n"); - // "☆☆☆☆☆ (;o;) About ☆☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ (;o;) くらいよー ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ (;o;) くらいよー ☆☆☆☆☆ \n", "☆☆☆☆☆ (;o;) About that much ☆☆☆☆☆ \n") + VT_RST); EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudyHyruleMarket); break; case EN_WEATHER_TAG_TYPE_CLOUDY_LON_LON_RANCH: PRINTF("\n\n"); - // "☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n", + "☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆ \n") VT_RST); if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED)) { Actor_Kill(&this->actor); } @@ -81,8 +83,8 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case EN_WEATHER_TAG_TYPE_SNOW_ZORAS_DOMAIN: PRINTF("\n\n"); - // "☆☆☆☆☆ Yukigafuru You won't come (._.) ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ ゆきがふるー あなたはこないー (._.) ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ ゆきがふるー あなたはこないー (._.) ☆☆☆☆☆ \n", + "☆☆☆☆☆ The snow is falling... You're not coming... (._.) ☆☆☆☆☆ \n") VT_RST); if (GET_EVENTCHKINF(EVENTCHKINF_4A)) { Actor_Kill(&this->actor); @@ -91,8 +93,8 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case EN_WEATHER_TAG_TYPE_RAIN_LAKE_HYLIA: PRINTF("\n\n"); - // "☆☆☆☆☆ Wow wa wa na wa saa ki ha (^o^) ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ わわわわー なーがーさーきーはー (^o^) ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ わわわわー なーがーさーきーはー (^o^) ☆☆☆☆☆ \n", + "☆☆☆☆☆ Waaaa- Na-ga-sa-ki wa- (^o^) ☆☆☆☆☆ \n") VT_RST); if (GET_EVENTCHKINF(EVENTCHKINF_4A)) { Actor_Kill(&this->actor); @@ -101,8 +103,8 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case EN_WEATHER_TAG_TYPE_CLOUDY_DEATH_MOUNTAIN: PRINTF("\n\n"); - // "☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ くもり (._.) あーあ 憂鬱 ☆☆☆☆☆ \n", "☆☆☆☆☆ Cloudy (._.) Ah Melancholy ☆☆☆☆☆") VT_RST); if (GET_EVENTCHKINF(EVENTCHKINF_49)) { Actor_Kill(&this->actor); } @@ -110,8 +112,8 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case EN_WEATHER_TAG_TYPE_THUNDERSTORM_KAKARIKO: PRINTF("\n\n"); - // "☆☆☆☆☆ Cloudy Rain Thunder (;O;) Uo Melancholy ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ くもり雨雷 (;O;) うおお 憂鬱 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ くもり雨雷 (;O;) うおお 憂鬱 ☆☆☆☆☆ \n", + "☆☆☆☆☆ Cloudy with rain and thunder (;O;) Wow, I'm depressed ☆☆☆☆☆ \n") VT_RST); if (!GET_EVENTCHKINF(EVENTCHKINF_48) || !GET_EVENTCHKINF(EVENTCHKINF_49) || !GET_EVENTCHKINF(EVENTCHKINF_4A) || CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) { @@ -121,14 +123,14 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case EN_WEATHER_TAG_TYPE_SANDSTORM_INTENSITY: PRINTF("\n\n"); - // "☆☆☆☆☆ The desert becomes thicker ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 砂漠が濃くなります ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 砂漠が濃くなります ☆☆☆☆☆ \n", "☆☆☆☆☆ The desert becomes thicker ☆☆☆☆☆ \n") + VT_RST); EnWeatherTag_SetupAction(this, EnWeatherTag_SetSandstormIntensity); break; case EN_WEATHER_TAG_TYPE_THUNDERSTORM_GRAVEYARD: PRINTF("\n\n"); - // "☆☆☆☆☆ Wow wa wa na wa saa ki ha (^o^) ☆☆☆☆☆" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ わわわわー なーがーさーきーはー (^o^) ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ わわわわー なーがーさーきーはー (^o^) ☆☆☆☆☆ \n", + "☆☆☆☆☆ Waaaa- Na-ga-sa-ki wa- (^o^) ☆☆☆☆☆ \n") VT_RST); EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledRainThunder); break; 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 52b617a0e7..e3db54c571 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,7 +2,7 @@ #define Z_EN_WEATHER_TAG_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnWeatherTag; 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 2e19328961..35e232c69b 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -13,9 +13,9 @@ #include "sfx.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_ei/object_ei.h" @@ -575,8 +575,8 @@ void func_80B3368C(EnWeiyer* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.elem, true); - if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { - if (this->actor.colChkInfo.damageEffect == 1) { + if ((this->actor.colChkInfo.damageReaction != 0) || (this->actor.colChkInfo.damage != 0)) { + if (this->actor.colChkInfo.damageReaction == 1) { if (this->actionFunc != func_80B333B8) { func_80B32660(this); } 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 ab1b81c34f..d35e43544f 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h @@ -2,7 +2,7 @@ #define Z_EN_WEIYER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnWeiyer; 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 95f1061d62..c651e4ff4a 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -8,21 +8,24 @@ #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 "translation.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_wf/object_wf.h" @@ -160,48 +163,48 @@ static ColliderCylinderInit sTailCylinderInit = { { 15, 20, -15, { 0, 0, 0 } }, }; -typedef enum EnWfDamageEffect { - /* 0 */ ENWF_DMGEFF_NONE, - /* 1 */ ENWF_DMGEFF_STUN, - /* 6 */ ENWF_DMGEFF_ICE_MAGIC = 6, - /* 13 */ ENWF_DMGEFF_LIGHT_MAGIC = 13, - /* 14 */ ENWF_DMGEFF_FIRE, - /* 15 */ ENWF_DMGEFF_UNDEF // used like STUN in the code, but not in the table -} EnWfDamageEffect; +typedef enum EnWfDamageReaction { + /* 0 */ ENWF_DMG_REACT_NONE, + /* 1 */ ENWF_DMG_REACT_STUN, + /* 6 */ ENWF_DMG_REACT_ICE_MAGIC = 6, + /* 13 */ ENWF_DMG_REACT_LIGHT_MAGIC = 13, + /* 14 */ ENWF_DMG_REACT_FIRE, + /* 15 */ ENWF_DMG_REACT_UNDEF // used like STUN in the code, but not in the table +} EnWfDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, ENWF_DMGEFF_STUN), - /* Deku stick */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Slingshot */ DMG_ENTRY(1, ENWF_DMGEFF_NONE), - /* Explosive */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(0, ENWF_DMGEFF_STUN), - /* Normal arrow */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Hookshot */ DMG_ENTRY(0, ENWF_DMGEFF_STUN), - /* Kokiri sword */ DMG_ENTRY(1, ENWF_DMGEFF_NONE), - /* Master sword */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Giant's Knife */ DMG_ENTRY(4, ENWF_DMGEFF_NONE), - /* Fire arrow */ DMG_ENTRY(4, ENWF_DMGEFF_FIRE), - /* Ice arrow */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Light arrow */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Unk arrow 1 */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Unk arrow 2 */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Unk arrow 3 */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Fire magic */ DMG_ENTRY(4, ENWF_DMGEFF_FIRE), - /* Ice magic */ DMG_ENTRY(0, ENWF_DMGEFF_ICE_MAGIC), - /* Light magic */ DMG_ENTRY(3, ENWF_DMGEFF_LIGHT_MAGIC), - /* Shield */ DMG_ENTRY(0, ENWF_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, ENWF_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, ENWF_DMGEFF_NONE), - /* Giant spin */ DMG_ENTRY(4, ENWF_DMGEFF_NONE), - /* Master spin */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Kokiri jump */ DMG_ENTRY(2, ENWF_DMGEFF_NONE), - /* Giant jump */ DMG_ENTRY(8, ENWF_DMGEFF_NONE), - /* Master jump */ DMG_ENTRY(4, ENWF_DMGEFF_NONE), - /* Unknown 1 */ DMG_ENTRY(0, ENWF_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, ENWF_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, ENWF_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, ENWF_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, ENWF_DMG_REACT_STUN), + /* Deku stick */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(1, ENWF_DMG_REACT_NONE), + /* Explosive */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(0, ENWF_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Hookshot */ DMG_ENTRY(0, ENWF_DMG_REACT_STUN), + /* Kokiri sword */ DMG_ENTRY(1, ENWF_DMG_REACT_NONE), + /* Master sword */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Giant's Knife */ DMG_ENTRY(4, ENWF_DMG_REACT_NONE), + /* Fire arrow */ DMG_ENTRY(4, ENWF_DMG_REACT_FIRE), + /* Ice arrow */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Light arrow */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Unk arrow 1 */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Unk arrow 2 */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Unk arrow 3 */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Fire magic */ DMG_ENTRY(4, ENWF_DMG_REACT_FIRE), + /* Ice magic */ DMG_ENTRY(0, ENWF_DMG_REACT_ICE_MAGIC), + /* Light magic */ DMG_ENTRY(3, ENWF_DMG_REACT_LIGHT_MAGIC), + /* Shield */ DMG_ENTRY(0, ENWF_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, ENWF_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, ENWF_DMG_REACT_NONE), + /* Giant spin */ DMG_ENTRY(4, ENWF_DMG_REACT_NONE), + /* Master spin */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Kokiri jump */ DMG_ENTRY(2, ENWF_DMG_REACT_NONE), + /* Giant jump */ DMG_ENTRY(8, ENWF_DMG_REACT_NONE), + /* Master jump */ DMG_ENTRY(4, ENWF_DMG_REACT_NONE), + /* Unknown 1 */ DMG_ENTRY(0, ENWF_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, ENWF_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, ENWF_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, ENWF_DMG_REACT_NONE), }; ActorProfile En_Wf_Profile = { @@ -290,8 +293,9 @@ void EnWf_Destroy(Actor* thisx, PlayState* play) { } PRINTF("\n\n"); - // "☆☆☆☆☆ Number of concurrent events ☆☆☆☆☆" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 同時発生数 ☆☆☆☆☆%d\n" VT_RST, parent->curNumSpawn); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 同時発生数 ☆☆☆☆☆%d\n", "☆☆☆☆☆ Number of simultaneous spawns ☆☆☆☆☆%d\n") + VT_RST, + parent->curNumSpawn); PRINTF("\n\n"); } } @@ -1281,15 +1285,15 @@ void EnWf_UpdateDamage(EnWf* this, PlayState* play) { 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; + if (this->actor.colChkInfo.damageReaction != ENWF_DMG_REACT_ICE_MAGIC) { + this->damageReaction = this->actor.colChkInfo.damageReaction; Actor_SetDropFlag(&this->actor, &this->bodyColliderCylinder.elem, true); #if OOT_VERSION >= PAL_1_0 this->slashStatus = 0; #endif - if ((this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_STUN) || - (this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_UNDEF)) { + if ((this->actor.colChkInfo.damageReaction == ENWF_DMG_REACT_STUN) || + (this->actor.colChkInfo.damageReaction == ENWF_DMG_REACT_UNDEF)) { if (this->action != WOLFOS_ACTION_STUNNED) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); @@ -1299,7 +1303,7 @@ void EnWf_UpdateDamage(EnWf* this, PlayState* play) { } else { // LIGHT_MAGIC, FIRE, NONE Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); - if (this->damageEffect == ENWF_DMGEFF_FIRE) { + if (this->damageReaction == ENWF_DMG_REACT_FIRE) { this->fireTimer = 40; } @@ -1321,7 +1325,7 @@ void EnWf_Update(Actor* thisx, PlayState* play) { EnWf_UpdateDamage(this, play); - if (this->actor.colChkInfo.damageEffect != ENWF_DMGEFF_ICE_MAGIC) { + if (this->actor.colChkInfo.damageReaction != ENWF_DMG_REACT_ICE_MAGIC) { Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | 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 afc18f7d01..cc69df8ad4 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.h +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.h @@ -2,7 +2,7 @@ #define Z_EN_WF_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnWf; @@ -63,7 +63,7 @@ typedef struct EnWf { /* 0x02E0 */ s16 unk_2E0; // Used, but has no effect /* 0x02E2 */ s16 unk_2E2; /* 0x02E4 */ s16 fireTimer; - /* 0x02E6 */ u8 damageEffect; + /* 0x02E6 */ u8 damageReaction; /* 0x02E8 */ s32 actionTimer; // Used to make an action last for a certain amount of time /* 0x02EC */ f32 runSpeed; /* 0x02F0 */ char unk_2F0[4]; 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 94dca26a3b..7cfe974b8a 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 @@ -6,14 +6,16 @@ #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" +#include "debug_display.h" +#include "play_state.h" +#include "player.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 5b99e235c3..2910fcae17 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,7 +2,7 @@ #define Z_EN_WONDER_ITEM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnWonderItem; 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 71a1e5d8fd..7313c8100d 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 @@ -6,11 +6,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" +#include "translation.h" +#include "debug_display.h" +#include "play_state.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED) @@ -41,8 +43,8 @@ void EnWonderTalk_Init(Actor* thisx, PlayState* play) { EnWonderTalk* this = (EnWonderTalk*)thisx; PRINTF("\n\n"); - // "Special conversation" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 特殊会話くん ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 特殊会話くん ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Special conversation ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); this->unk_150 = PARAMS_GET_U(this->actor.params, 11, 5); this->unk_152 = PARAMS_GET_U(this->actor.params, 6, 5); @@ -66,19 +68,17 @@ void func_80B391CC(EnWonderTalk* this, PlayState* play) { if (this->switchFlag < 0 || !Flags_GetSwitch(play, this->switchFlag)) { switch (this->unk_150) { case 1: - // "Slate GO!" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 石板GO! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 石板GO! ☆☆☆☆☆ \n", " ☆☆☆☆☆ Slate GO! ☆☆☆☆☆ \n") VT_RST); this->height = 0.0f; this->unk_15C = 80.0f; - // "Attention coordinates" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 0.0f); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n", + "☆☆☆☆☆ Attention coordinates\t \t☆☆☆☆☆ %f\n") VT_RST, + 0.0f); if (!LINK_IS_ADULT) { this->actor.textId = 0x7040; - // "Children" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ こども ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ こども ☆☆☆☆☆ \n", " ☆☆☆☆☆ Child ☆☆☆☆☆ \n") VT_RST); } else { - // "Adult" - PRINTF(VT_FGCOL(CYAN) " ☆☆☆☆☆ おとな ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(CYAN) T(" ☆☆☆☆☆ おとな ☆☆☆☆☆ \n", " ☆☆☆☆☆ Adult ☆☆☆☆☆ \n") VT_RST); this->actor.textId = 0x7088; } @@ -86,29 +86,31 @@ void func_80B391CC(EnWonderTalk* this, PlayState* play) { PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ this->actor.talk_message ☆☆☆☆☆ %x\n" VT_RST, this->actor.textId); break; case 2: - // "Diary start!" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 日記帳スタート! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ 日記帳スタート! ☆☆☆☆☆ \n", " ☆☆☆☆☆ Diary start! ☆☆☆☆☆ \n") VT_RST); this->actor.textId = 0x5002; this->unk_156 = TEXT_STATE_CHOICE; this->unk_15C = 40.0f; this->height = 30.0f; - // "Attention coordinates" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 30.0f); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n", + "☆☆☆☆☆ Attention coordinates\t \t☆☆☆☆☆ %f\n") VT_RST, + 30.0f); break; case 3: this->actor.textId = 0x501E; this->unk_156 = TEXT_STATE_EVENT; this->height = 0.0f; this->unk_15C = 110.0f; - // "Attention coordinates" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 0.0f); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n", + "☆☆☆☆☆ Attention coordinates\t \t☆☆☆☆☆ %f\n") VT_RST, + 0.0f); break; case 4: this->actor.textId = 0x5020; this->unk_156 = TEXT_STATE_DONE; this->height = 0.0f; - // "Attention coordinates" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 0.0f); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n", + "☆☆☆☆☆ Attention coordinates\t \t☆☆☆☆☆ %f\n") VT_RST, + 0.0f); this->unk_15C = 120.0f; if (GET_EVENTCHKINF(EVENTCHKINF_1D)) { Actor_Kill(&this->actor); @@ -119,8 +121,9 @@ void func_80B391CC(EnWonderTalk* this, PlayState* play) { this->unk_156 = TEXT_STATE_EVENT; this->height = 0.0f; this->unk_15C = 110.0f; - // "Attention coordinates" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 0.0f); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n", + "☆☆☆☆☆ Attention coordinates\t \t☆☆☆☆☆ %f\n") VT_RST, + 0.0f); break; default: this->actor.textId = 0x7072; @@ -160,14 +163,18 @@ void func_80B3943C(EnWonderTalk* this, PlayState* play) { if (yawDiff < 0x4000) { if (this->unk_15A >= 2) { PRINTF("\n\n"); - // "Save information" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ セーブ情報\t\t☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); - // "Type index" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 種類インデックス\t☆☆☆☆☆ %d\n" VT_RST, this->unk_150); - // "Actual message type" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); - // "Specified range" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ セーブ情報\t\t☆☆☆☆☆ %d\n", "☆☆☆☆☆ Save information\t\t☆☆☆☆☆ %d\n") + VT_RST, + this->switchFlag); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 種類インデックス\t☆☆☆☆☆ %d\n", "☆☆☆☆☆ Type index\t☆☆☆☆☆ %d\n") + VT_RST, + this->unk_150); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 実質メッセージ種類 %x\n", "☆☆☆☆☆ Actual message type %x\n") + VT_RST, + this->actor.textId); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 指定範囲 %d\n", + "☆☆☆☆☆ Specified range %d\n") VT_RST, + this->actor.world.rot.z); PRINTF("\n\n"); } this->unk_15A = 0; @@ -192,18 +199,17 @@ void func_80B395F0(EnWonderTalk* this, PlayState* play) { switch (play->msgCtx.choiceIndex) { case 0: if (!LINK_IS_ADULT) { - // "I'm still a child!" - PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ まだコドモなの! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(GREEN) T(" ☆☆☆☆☆ まだコドモなの! ☆☆☆☆☆ \n", + " ☆☆☆☆☆ I'm still a child! ☆☆☆☆☆ \n") VT_RST); this->actor.textId = 0x5001; } else { - // "I'm an adult. .. .." - PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ アダルトなの。。。 ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(YELLOW) T(" ☆☆☆☆☆ アダルトなの。。。 ☆☆☆☆☆ \n", + " ☆☆☆☆☆ I'm an adult... ☆☆☆☆☆ \n") VT_RST); this->actor.textId = 0x5003; } break; case 1: - // "Out!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ はずれ! ☆☆☆☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆☆☆☆ はずれ! ☆☆☆☆☆ \n", " ☆☆☆☆☆ No luck! ☆☆☆☆☆ \n") VT_RST); this->actor.textId = 0x5004; break; } 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 a42c3febfc..7850cf6fff 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,7 +2,7 @@ #define Z_EN_WONDER_TALK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnWonderTalk; 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 b843b64a8b..137cbf619e 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 @@ -6,12 +6,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" +#include "translation.h" +#include "debug_display.h" +#include "item.h" +#include "play_state.h" +#include "player.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED) @@ -47,8 +49,8 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { EnWonderTalk2* this = (EnWonderTalk2*)thisx; PRINTF("\n\n"); - // "Transparent message" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Transparent message ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); this->baseMsgId = PARAMS_GET_U(this->actor.params, 6, 8); if (this->actor.world.rot.z > 0) { s32 rangeIndex = 0; @@ -67,12 +69,12 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { this->actor.attentionRangeType = D_80B3A8E0[rangeIndex]; PRINTF("\n\n"); - // "originally?" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元は? ☆☆☆☆☆ %d\n" VT_RST, this->actor.world.rot.z); - // "The range is?" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n" VT_RST, this->actor.attentionRangeType); - // "Is the range?" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ は、範囲わ? ☆☆☆☆☆ %f\n" VT_RST, this->triggerRange); + PRINTF(VT_FGCOL(YELLOW) T("☆☆☆☆☆ 元は? ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Originally? ☆☆☆☆☆ %d\n") VT_RST, + this->actor.world.rot.z); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n", "☆☆☆☆☆ The range is? ☆☆☆☆☆ %d\n") VT_RST, + this->actor.attentionRangeType); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ は、範囲わ? ☆☆☆☆☆ %f\n", "☆☆☆☆☆ The range is? ☆☆☆☆☆ %f\n") VT_RST, + this->triggerRange); PRINTF("\n\n"); PRINTF("\n\n"); PRINTF("\n\n"); @@ -126,8 +128,9 @@ void func_80B3A15C(EnWonderTalk2* this, PlayState* play) { } else if (Actor_TalkOfferAccepted(&this->actor, play)) { if ((this->switchFlag >= 0) && (this->talkMode != 2)) { Flags_SetSwitch(play, this->switchFlag); - // "I saved it! All of it!" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ セーブしたよ!おもいっきり! %x\n" VT_RST, this->switchFlag); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ セーブしたよ!おもいっきり! %x\n", "☆☆☆☆☆ I saved it! All of it! %x\n") + VT_RST, + this->switchFlag); } this->actionFunc = func_80B3A10C; @@ -139,30 +142,33 @@ void func_80B3A15C(EnWonderTalk2* this, PlayState* play) { if (DEBUG_FEATURES && this->unk_158 >= 2) { PRINTF("\n\n"); - // "Transparent Message Kimi Set" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君せっと %x\n" VT_RST, this->actor.params); - // "Save Information" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ セーブ情報 \t %x\n" VT_RST, this->switchFlag); - // "Specified message type" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 指定メッセージ種類 %x\n" VT_RST, this->baseMsgId); - // "Actual message type" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); - // "Specified range" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); - // "Processing range" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 処理範囲 %f\n" VT_RST, this->triggerRange); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 透明メッセージ君せっと %x\n", "☆☆☆☆☆ Transparent Message Kimi Set %x\n") + VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ セーブ情報 \t %x\n", "☆☆☆☆☆ Save Information \t %x\n") VT_RST, + this->switchFlag); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 指定メッセージ種類 %x\n", "☆☆☆☆☆ Specified message type %x\n") + VT_RST, + this->baseMsgId); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 実質メッセージ種類 %x\n", "☆☆☆☆☆ Actual message type %x\n") + VT_RST, + this->actor.textId); + PRINTF(VT_FGCOL(GREEN) + T("☆☆☆☆☆ 指定範囲 %d\n", "☆☆☆☆☆ Specified range %d\n") VT_RST, + this->actor.world.rot.z); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ 処理範囲 %f\n", "☆☆☆☆☆ Processing range %f\n") VT_RST, + this->triggerRange); switch (this->talkMode) { case 0: - // "Normal" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆ 通常 ☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆ 通常 ☆☆ \n", " ☆☆ Normal ☆☆ \n") VT_RST); break; case 2: - // "Check only" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆ チェックのみ ☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆ チェックのみ ☆☆ \n", " ☆☆ Check only ☆☆ \n") VT_RST); break; case 3: - // "Lock only" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆ ロックのみ ☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆ ロックのみ ☆☆ \n", " ☆☆ Lock only ☆☆ \n") VT_RST); break; } } @@ -175,8 +181,7 @@ void func_80B3A15C(EnWonderTalk2* this, PlayState* play) { void func_80B3A3D4(EnWonderTalk2* this, PlayState* play) { if (BREG(2) != 0) { - // "Oh" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ わー %d\n" VT_RST, Message_GetState(&play->msgCtx)); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ わー %d\n", "☆☆☆☆☆ Oh %d\n") VT_RST, Message_GetState(&play->msgCtx)); } switch (Message_GetState(&play->msgCtx)) { @@ -192,8 +197,9 @@ void func_80B3A3D4(EnWonderTalk2* this, PlayState* play) { case TEXT_STATE_NONE: if ((this->switchFlag >= 0) && (this->talkMode != 4)) { Flags_SetSwitch(play, this->switchFlag); - // "(Forced) I saved it! All of it!" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ (強制)セーブしたよ!おもいっきり! %x\n" VT_RST, this->switchFlag); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ (強制)セーブしたよ!おもいっきり! %x\n", + "☆☆☆☆☆ (Forced) I saved it! All of it! %x\n") VT_RST, + this->switchFlag); } if (this->talkMode == 4) { @@ -219,8 +225,7 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { } } else if ((this->talkMode != 4) || !this->unk_15A) { if (BREG(2) != 0) { - // "distance" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ きょり %f\n" VT_RST, this->actor.xzDistToPlayer); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ きょり %f\n", "☆☆☆☆☆ distance %f\n") VT_RST, this->actor.xzDistToPlayer); } if (((this->actor.xzDistToPlayer < (40.0f + this->triggerRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f)) && @@ -228,30 +233,34 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { if (DEBUG_FEATURES && this->unk_158 >= 2) { PRINTF("\n\n"); - // "Transparent Message Kimi Seto" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君せっと %x\n" VT_RST, this->actor.params); - // "Save Information" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ セーブ情報 \t %x\n" VT_RST, this->switchFlag); - // "Specified message type" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 指定メッセージ種類 %x\n" VT_RST, this->baseMsgId); - // "Real message type" - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); - // "Specified range" - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); - // "Processing range" - PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ 処理範囲 %f\n" VT_RST, this->triggerRange); - // "What is your range?" - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ レンジは? \t\t %d\n" VT_RST, this->actor.attentionRangeType); + PRINTF(VT_FGCOL(GREEN) + T("☆☆☆☆☆ 透明メッセージ君せっと %x\n", "☆☆☆☆☆ Transparent Message Kimi Seto %x\n") VT_RST, + this->actor.params); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ セーブ情報 \t %x\n", "☆☆☆☆☆ Save Information \t %x\n") VT_RST, + this->switchFlag); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 指定メッセージ種類 %x\n", "☆☆☆☆☆ Specified message type %x\n") + VT_RST, + this->baseMsgId); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ 実質メッセージ種類 %x\n", "☆☆☆☆☆ Real message type %x\n") VT_RST, + this->actor.textId); + PRINTF(VT_FGCOL(GREEN) + T("☆☆☆☆☆ 指定範囲 %d\n", "☆☆☆☆☆ Specified range %d\n") VT_RST, + this->actor.world.rot.z); + PRINTF(VT_FGCOL(YELLOW) + T("☆☆☆☆☆ 処理範囲 %f\n", "☆☆☆☆☆ Processing range %f\n") VT_RST, + this->triggerRange); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ レンジは? \t\t %d\n", "☆☆☆☆☆ The range is? \t\t %d\n") VT_RST, + this->actor.attentionRangeType); PRINTF("\n\n"); PRINTF("\n\n"); switch (this->talkMode) { case 1: - // "Compulsion" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆ 強制 ☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(MAGENTA) T(" ☆☆ 強制 ☆☆ \n", " ☆☆ Compulsion ☆☆ \n") VT_RST); break; case 4: - // "Gerudo Training Grounds Forced Check Only" - PRINTF(VT_FGCOL(RED) " ☆☆ ゲルドの修練場強制チェックのみ ☆☆ \n" VT_RST); + PRINTF(VT_FGCOL(RED) T(" ☆☆ ゲルドの修練場強制チェックのみ ☆☆ \n", + " ☆☆ Gerudo Training Grounds Forced Check Only ☆☆ \n") VT_RST); break; } 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 0dad49d375..d48ad99777 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,7 +2,7 @@ #define Z_EN_WONDER_TALK2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnWonderTalk2; 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 bf32807226..2d351c9184 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -16,9 +16,9 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" -#include "z64skin_matrix.h" +#include "play_state.h" +#include "player.h" +#include "skin_matrix.h" #include "assets/objects/object_wood02/object_wood02.h" 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 89242188ae..d9ebab697a 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 "z64actor.h" +#include "actor.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 833973d4e4..2820225931 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -8,8 +8,10 @@ #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" @@ -17,12 +19,13 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" +#include "skin_matrix.h" #include "assets/objects/object_xc/object_xc.h" #include "assets/scenes/overworld/spot05/spot05_scene.h" @@ -30,8 +33,8 @@ #include "assets/scenes/indoors/tokinoma/tokinoma_scene.h" #include "assets/scenes/dungeons/ice_doukutu/ice_doukutu_scene.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: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" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -373,10 +376,10 @@ void EnXc_SetupSerenadeAction(EnXc* this, PlayState* play) { s32 pad; this->action = SHEIK_ACTION_SERENADE; - PRINTF("水のセレナーデ シーク誕生!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("水のセレナーデ シーク誕生!!!!!!!!!!!!!!!!!!\n", "Water serenade Sheik's birth!!!!!!!!!!!!!!!!!!\n")); } else { Actor_Kill(&this->actor); - PRINTF("水のセレナーデ シーク消滅!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("水のセレナーデ シーク消滅!!!!!!!!!!!!!!!!!!\n", "Water serenade Sheik vanishes!!!!!!!!!!!!!!!!!!\n")); } } @@ -393,10 +396,10 @@ s32 EnXc_SerenadeCS(EnXc* this, PlayState* play) { gSaveContext.cutsceneTrigger = 1; SET_EVENTCHKINF(EVENTCHKINF_52); // Learned Serenade of Water Flag Item_Give(play, ITEM_SONG_SERENADE); - PRINTF("ブーツを取った!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("ブーツを取った!!!!!!!!!!!!!!!!!!\n", "I took the boots!!!!!!!!!!!!!!!!!!\n")); return true; } else { - PRINTF("はやくブーツを取るべし!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("はやくブーツを取るべし!!!!!!!!!!!!!!!!!!\n", "Quickly get your boots!!!!!!!!!!!!!!!!!!\n")); return false; } } @@ -1413,7 +1416,7 @@ void func_80B3F3D8(void) { } #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:64 ntsc-1.1:64 ntsc-1.2:64 pal-1.0:64 pal-1.1:64" + "ntsc-1.0:64 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; @@ -2040,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; } @@ -2349,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); } @@ -2397,7 +2402,8 @@ void EnXc_Init(Actor* thisx, PlayState* play) { break; #endif default: - PRINTF(VT_FGCOL(RED) " En_Oa2 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T(" En_Oa2 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n", + " En_Oa2 arg_data is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST); EnXc_DoNothing(this, play); } } @@ -2466,8 +2472,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 1cc56f68e6..419f67d55d 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.h +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.h @@ -2,7 +2,7 @@ #define Z_EN_XC_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnXc; 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 4be5360be4..ee1d8b8161 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 @@ -6,16 +6,18 @@ #include "z_en_yabusame_mark.h" +#include "printf.h" #include "regs.h" #include "sequence.h" #include "sfx.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64debug_display.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64save.h" +#include "audio.h" +#include "debug_display.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #define FLAGS 0 @@ -89,11 +91,14 @@ void EnYabusameMark_Init(Actor* thisx, PlayState* play) { EnYabusameMark* this = (EnYabusameMark*)thisx; PRINTF("\n\n"); - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ やぶさめまと ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); + // "まと" could be a typo for "まこ", in which case this could be "Yabusame mark" + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ やぶさめまと ☆☆☆☆☆ %x\n", "☆☆☆☆☆ Yabusame mato ☆☆☆☆☆ %x\n") VT_RST, + this->actor.params); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->typeIndex = this->actor.params; this->actor.attentionRangeType = ATTENTION_RANGE_5; - PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 種類インデックス \t ☆☆☆☆☆ %d\n" VT_RST, this->typeIndex); + PRINTF(VT_FGCOL(GREEN) T("☆☆☆☆☆ 種類インデックス \t ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Type index \t ☆☆☆☆☆ %d\n") VT_RST, + this->typeIndex); switch (this->typeIndex) { case 0: this->subTypeIndex = 0; @@ -119,8 +124,9 @@ void EnYabusameMark_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 種類 ☆☆☆☆☆ %d\n" VT_RST, this->typeIndex); - PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ さらに分類 ☆☆☆☆☆ %d\n" VT_RST, this->subTypeIndex); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 種類 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Type ☆☆☆☆☆ %d\n") VT_RST, this->typeIndex); + PRINTF(VT_FGCOL(CYAN) T("☆☆☆☆☆ さらに分類 ☆☆☆☆☆ %d\n", "☆☆☆☆☆ Further classification ☆☆☆☆☆ %d\n") VT_RST, + this->subTypeIndex); this->actionFunc = func_80B42F74; } @@ -176,8 +182,8 @@ void func_80B42F74(EnYabusameMark* this, PlayState* play) { PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ hitX ☆☆☆☆☆ %f\n" VT_RST, sTargetPos[this->subTypeIndex].x); PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ hitY ☆☆☆☆☆ %f\n" VT_RST, sTargetPos[this->subTypeIndex].y); PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ hitZ ☆☆☆☆☆ %f\n" VT_RST, sTargetPos[this->subTypeIndex].z); - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 小 ☆☆☆☆☆ %f\n" VT_RST, scoreDistance100); - PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 大 ☆☆☆☆☆ %f\n" VT_RST, scoreDistance60); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 小 ☆☆☆☆☆ %f\n", "☆☆☆☆☆ small ☆☆☆☆☆ %f\n") VT_RST, scoreDistance100); + PRINTF(VT_FGCOL(MAGENTA) T("☆☆☆☆☆ 大 ☆☆☆☆☆ %f\n", "☆☆☆☆☆ large ☆☆☆☆☆ %f\n") VT_RST, scoreDistance60); PRINTF(VT_FGCOL(MAGENTA) "☆☆☆☆☆ point ☆☆☆☆☆ %d\n" VT_RST, scoreIndex); PRINTF("\n\n"); 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 12cfb46cbb..f7587d8152 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,7 +2,7 @@ #define Z_EN_YABUSAME_MARK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnYabusameMark; 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 22d454fb61..772eceb114 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -13,8 +13,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_yukabyun/object_yukabyun.h" 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 a695fb4c1f..36e7b13512 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h @@ -2,7 +2,7 @@ #define Z_EN_YUKABYUN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnYukabyun; 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 843669b4ec..7fa645e64a 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -7,6 +7,7 @@ #include "z_en_zf.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -17,10 +18,10 @@ #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 "audio.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_zf/object_zf.h" @@ -168,47 +169,47 @@ static ColliderQuadInit sSwordQuadInit = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -typedef enum EnZfDamageEffect { - /* 0x0 */ ENZF_DMGEFF_NONE, - /* 0x1 */ ENZF_DMGEFF_STUN, - /* 0x6 */ ENZF_DMGEFF_IMMUNE = 6, // Skips damage code, but also skips the top half of Update - /* 0xD */ ENZF_DMGEFF_PROJECTILE = 0xD, // Projectiles that don't have another damageeffect - /* 0xF */ ENZF_DMGEFF_ICE = 0xF -} EnZfDamageEffect; +typedef enum EnZfDamageReaction { + /* 0x0 */ ENZF_DMG_REACT_NONE, + /* 0x1 */ ENZF_DMG_REACT_STUN, + /* 0x6 */ ENZF_DMG_REACT_IMMUNE = 6, // Skips damage code, but also skips the top half of Update + /* 0xD */ ENZF_DMG_REACT_PROJECTILE = 0xD, // Projectiles that don't have another damageeffect + /* 0xF */ ENZF_DMG_REACT_ICE = 0xF +} EnZfDamageReaction; static DamageTable sDamageTable = { - /* Deku nut */ DMG_ENTRY(0, ENZF_DMGEFF_STUN), - /* Deku stick */ DMG_ENTRY(2, ENZF_DMGEFF_NONE), - /* Slingshot */ DMG_ENTRY(1, ENZF_DMGEFF_PROJECTILE), - /* Explosive */ DMG_ENTRY(2, ENZF_DMGEFF_NONE), - /* Boomerang */ DMG_ENTRY(0, ENZF_DMGEFF_STUN), - /* Normal arrow */ DMG_ENTRY(2, ENZF_DMGEFF_NONE), - /* Hammer swing */ DMG_ENTRY(2, ENZF_DMGEFF_NONE), - /* Hookshot */ DMG_ENTRY(0, ENZF_DMGEFF_STUN), - /* Kokiri sword */ DMG_ENTRY(1, ENZF_DMGEFF_NONE), - /* Master sword */ DMG_ENTRY(2, ENZF_DMGEFF_NONE), - /* Giant's Knife */ DMG_ENTRY(4, ENZF_DMGEFF_NONE), - /* Fire arrow */ DMG_ENTRY(2, ENZF_DMGEFF_PROJECTILE), - /* Ice arrow */ DMG_ENTRY(4, ENZF_DMGEFF_ICE), - /* Light arrow */ DMG_ENTRY(2, ENZF_DMGEFF_PROJECTILE), - /* Unk arrow 1 */ DMG_ENTRY(2, ENZF_DMGEFF_PROJECTILE), - /* Unk arrow 2 */ DMG_ENTRY(2, ENZF_DMGEFF_PROJECTILE), - /* Unk arrow 3 */ DMG_ENTRY(2, ENZF_DMGEFF_PROJECTILE), - /* Fire magic */ DMG_ENTRY(0, ENZF_DMGEFF_IMMUNE), - /* Ice magic */ DMG_ENTRY(3, ENZF_DMGEFF_ICE), - /* Light magic */ DMG_ENTRY(0, ENZF_DMGEFF_IMMUNE), - /* Shield */ DMG_ENTRY(0, ENZF_DMGEFF_NONE), - /* Mirror Ray */ DMG_ENTRY(0, ENZF_DMGEFF_NONE), - /* Kokiri spin */ DMG_ENTRY(1, ENZF_DMGEFF_NONE), - /* Giant spin */ DMG_ENTRY(4, ENZF_DMGEFF_NONE), - /* Master spin */ DMG_ENTRY(2, ENZF_DMGEFF_NONE), - /* Kokiri jump */ DMG_ENTRY(2, ENZF_DMGEFF_NONE), - /* Giant jump */ DMG_ENTRY(8, ENZF_DMGEFF_NONE), - /* Master jump */ DMG_ENTRY(4, ENZF_DMGEFF_NONE), - /* Unknown 1 */ DMG_ENTRY(0, ENZF_DMGEFF_NONE), - /* Unblockable */ DMG_ENTRY(0, ENZF_DMGEFF_NONE), - /* Hammer jump */ DMG_ENTRY(4, ENZF_DMGEFF_NONE), - /* Unknown 2 */ DMG_ENTRY(0, ENZF_DMGEFF_NONE), + /* Deku nut */ DMG_ENTRY(0, ENZF_DMG_REACT_STUN), + /* Deku stick */ DMG_ENTRY(2, ENZF_DMG_REACT_NONE), + /* Slingshot */ DMG_ENTRY(1, ENZF_DMG_REACT_PROJECTILE), + /* Explosive */ DMG_ENTRY(2, ENZF_DMG_REACT_NONE), + /* Boomerang */ DMG_ENTRY(0, ENZF_DMG_REACT_STUN), + /* Normal arrow */ DMG_ENTRY(2, ENZF_DMG_REACT_NONE), + /* Hammer swing */ DMG_ENTRY(2, ENZF_DMG_REACT_NONE), + /* Hookshot */ DMG_ENTRY(0, ENZF_DMG_REACT_STUN), + /* Kokiri sword */ DMG_ENTRY(1, ENZF_DMG_REACT_NONE), + /* Master sword */ DMG_ENTRY(2, ENZF_DMG_REACT_NONE), + /* Giant's Knife */ DMG_ENTRY(4, ENZF_DMG_REACT_NONE), + /* Fire arrow */ DMG_ENTRY(2, ENZF_DMG_REACT_PROJECTILE), + /* Ice arrow */ DMG_ENTRY(4, ENZF_DMG_REACT_ICE), + /* Light arrow */ DMG_ENTRY(2, ENZF_DMG_REACT_PROJECTILE), + /* Unk arrow 1 */ DMG_ENTRY(2, ENZF_DMG_REACT_PROJECTILE), + /* Unk arrow 2 */ DMG_ENTRY(2, ENZF_DMG_REACT_PROJECTILE), + /* Unk arrow 3 */ DMG_ENTRY(2, ENZF_DMG_REACT_PROJECTILE), + /* Fire magic */ DMG_ENTRY(0, ENZF_DMG_REACT_IMMUNE), + /* Ice magic */ DMG_ENTRY(3, ENZF_DMG_REACT_ICE), + /* Light magic */ DMG_ENTRY(0, ENZF_DMG_REACT_IMMUNE), + /* Shield */ DMG_ENTRY(0, ENZF_DMG_REACT_NONE), + /* Mirror Ray */ DMG_ENTRY(0, ENZF_DMG_REACT_NONE), + /* Kokiri spin */ DMG_ENTRY(1, ENZF_DMG_REACT_NONE), + /* Giant spin */ DMG_ENTRY(4, ENZF_DMG_REACT_NONE), + /* Master spin */ DMG_ENTRY(2, ENZF_DMG_REACT_NONE), + /* Kokiri jump */ DMG_ENTRY(2, ENZF_DMG_REACT_NONE), + /* Giant jump */ DMG_ENTRY(8, ENZF_DMG_REACT_NONE), + /* Master jump */ DMG_ENTRY(4, ENZF_DMG_REACT_NONE), + /* Unknown 1 */ DMG_ENTRY(0, ENZF_DMG_REACT_NONE), + /* Unblockable */ DMG_ENTRY(0, ENZF_DMG_REACT_NONE), + /* Hammer jump */ DMG_ENTRY(4, ENZF_DMG_REACT_NONE), + /* Unknown 2 */ DMG_ENTRY(0, ENZF_DMG_REACT_NONE), }; static InitChainEntry sInitChain[] = { @@ -1323,7 +1324,7 @@ void EnZf_SetupStunned(EnZf* this) { this->hopAnimIndex = 1; } - if (this->damageEffect == ENZF_DMGEFF_ICE) { + if (this->damageReaction == ENZF_DMG_REACT_ICE) { this->iceTimer = 36; } else { Animation_PlayOnceSetSpeed(&this->skelAnime, &gZfKnockedBackAnim, 0.0f); @@ -1684,7 +1685,7 @@ void EnZf_Damaged(EnZf* this, PlayState* play) { SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (D_80B4A1B4 != -1) { - if (this->damageEffect == ENZF_DMGEFF_PROJECTILE) { + if (this->damageReaction == ENZF_DMG_REACT_PROJECTILE) { D_80B4A1B0++; } else { this->actor.world.rot.y = this->actor.shape.rot.y; @@ -2027,12 +2028,12 @@ void EnZf_UpdateDamage(EnZf* this, PlayState* play) { if (((this->actor.params < ENZF_TYPE_LIZALFOS_MINIBOSS_A) /* not miniboss */ || (D_80B4A1B4 != this->actor.params)) && - (this->actor.colChkInfo.damageEffect != ENZF_DMGEFF_IMMUNE)) { - this->damageEffect = this->actor.colChkInfo.damageEffect; + (this->actor.colChkInfo.damageReaction != ENZF_DMG_REACT_IMMUNE)) { + this->damageReaction = this->actor.colChkInfo.damageReaction; Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, false); - if ((this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_STUN) || - (this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_ICE)) { + if ((this->actor.colChkInfo.damageReaction == ENZF_DMG_REACT_STUN) || + (this->actor.colChkInfo.damageReaction == ENZF_DMG_REACT_ICE)) { if (this->action != ENZF_ACTION_STUNNED) { Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 120, COLORFILTER_BUFFLAG_OPA, 80); Actor_ApplyDamage(&this->actor); @@ -2055,7 +2056,7 @@ void EnZf_UpdateDamage(EnZf* this, PlayState* play) { } else { if ((D_80B4A1B4 != -1) && ((this->actor.colChkInfo.health + this->actor.colChkInfo.damage) >= 4) && (this->actor.colChkInfo.health < 4)) { - this->damageEffect = ENZF_DMGEFF_PROJECTILE; + this->damageReaction = ENZF_DMG_REACT_PROJECTILE; } EnZf_SetupDamaged(this); @@ -2071,7 +2072,7 @@ void EnZf_Update(Actor* thisx, PlayState* play) { s32 pad2; EnZf_UpdateDamage(this, play); - if (this->actor.colChkInfo.damageEffect != ENZF_DMGEFF_IMMUNE) { + if (this->actor.colChkInfo.damageReaction != ENZF_DMG_REACT_IMMUNE) { this->unk_3F8 = false; if ((this->hopAnimIndex != 1) && (this->action != ENZF_ACTION_HOP_AWAY)) { if (this->actor.speed != 0.0f) { 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 9dfb3119b9..1ecd0b646b 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.h +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.h @@ -2,7 +2,7 @@ #define Z_EN_ZF_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnZf; @@ -112,7 +112,7 @@ typedef struct EnZf { /* 0x0404 */ u8 alpha; /* 0x0408 */ f32 unk_408; // related to XZ speeds /* 0x040C */ f32 unk_40C; // related to y velocity - /* 0x0410 */ u8 damageEffect; + /* 0x0410 */ u8 damageReaction; /* 0x0414 */ s32 blureIndex; /* 0x0418 */ ColliderCylinder bodyCollider; /* 0x0464 */ ColliderQuad swordCollider; 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 5c60653b4e..8de9163341 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -14,10 +14,10 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64audio.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_zl1/object_zl1.h" 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 ada1335819..f1a07e1930 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h @@ -2,7 +2,7 @@ #define Z_EN_ZL1_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnZl1; 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 f6fac8940a..4c763e5583 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,4 @@ -#include "z64cutscene_commands.h" +#include "cutscene_commands.h" static CutsceneCameraDirection D_80B4D5C0[] = { { { -440.0f, 117.0f, 0.0f }, { -490.0f, 120.0f, 0.0f }, 0, 45 }, 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 4a8622cbba..77709ec0fb 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,6 +1,6 @@ #include "sequence.h" -#include "z64cutscene_commands.h" -#include "z64player.h" +#include "cutscene_commands.h" +#include "player.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 3665e8c6e5..817ac9c3dd 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -10,20 +10,18 @@ #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" - -#if PLATFORM_N64 -#include "global.h" -#endif +#include "frame_advance.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_zl2/object_zl2.h" #include "assets/objects/object_zl2_anime1/object_zl2_anime1.h" @@ -594,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) { @@ -1007,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; } @@ -1398,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; } @@ -1562,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; @@ -1602,7 +1603,8 @@ void func_80B52114(EnZl2* this, PlayState* play) { break; #endif default: - PRINTF(VT_FGCOL(RED) " En_Oa2 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T(" En_Oa2 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n", + " En_Oa2 arg_data is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST); func_80B4FD90(this, play); } } @@ -1615,7 +1617,8 @@ void func_80B521A0(EnZl2* this, PlayState* play) { #if DEBUG_FEATURES if (objectSlot < 0) { - PRINTF(VT_FGCOL(RED) "En_Zl2_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T("En_Zl2_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n", + "En_Zl2_main_bank Can't read animation bank!!!!!!!!!!!!\n") VT_RST); return; } #endif @@ -1632,7 +1635,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); @@ -1663,7 +1667,8 @@ s32 EnZl2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p if (this->overrideLimbDrawConfig < 0 || this->overrideLimbDrawConfig > 0 || sOverrideLimbDrawFuncs[this->overrideLimbDrawConfig] == NULL) { - PRINTF(VT_FGCOL(RED) "描画前処理モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T("描画前処理モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "The pre-drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST); return 0; } return sOverrideLimbDrawFuncs[this->overrideLimbDrawConfig](play, limbIndex, dList, pos, rot, thisx, gfx); @@ -1728,7 +1733,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 4bd0730de7..42ea682f68 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h @@ -2,7 +2,7 @@ #define Z_EN_ZL2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnZl2; 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 a07a2576d1..b9c396dfcc 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 "z64save.h" +#include "audio.h" +#include "frame_advance.h" +#include "play_state.h" +#include "player.h" +#include "save.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) { @@ -810,7 +813,8 @@ void func_80B54F18(EnZl3* this, PlayState* play) { } void func_80B54FB4(EnZl3* this, PlayState* play) { - PRINTF("ゼルダ姫のEn_Zl3_Actor_inFinal_Init通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("ゼルダ姫のEn_Zl3_Actor_inFinal_Init通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "I'm going through Princess Zelda's En_Zl3_Actor_inFinal_Init!!!!!!!!!!!!!!!!!!!!!!!!!\n")); func_80B54E14(this, &gZelda2Anime2Anim_008AD0, 0, 0.0f, 0); EnZl3_setEyeIndex(this, 4); EnZl3_setMouthIndex(this, 2); @@ -820,7 +824,8 @@ void func_80B54FB4(EnZl3* this, PlayState* play) { this->actor.shape.rot.z = 0; this->unk_3C4 = this->actor.world.rot.z; this->actor.world.rot.z = this->actor.shape.rot.z; - PRINTF("ゼルダ姫のEn_Zl3_Actor_inFinal_Initは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("ゼルダ姫のEn_Zl3_Actor_inFinal_Initは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "Princess Zelda's En_Zl3_Actor_inFinal_Init passed!!!!!!!!!!!!!!!!!!!!!!!!!\n")); } void func_80B55054(EnZl3* this) { @@ -965,7 +970,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; @@ -1024,11 +1030,13 @@ void func_80B5572C(EnZl3* this, PlayState* play) { } void func_80B55780(EnZl3* this, PlayState* play) { - PRINTF("ゼルダ姫のEn_Zl3_Actor_inFinal2_Init通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("ゼルダ姫のEn_Zl3_Actor_inFinal2_Init通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "I'm going through Princess Zelda's En_Zl3_Actor_inFinal2_Init!!!!!!!!!!!!!!!!!!!!!!!!!\n")); func_80B54E14(this, &gZelda2Anime2Anim_005A0C, 0, 0.0f, 0); this->action = 7; this->drawConfig = 1; - PRINTF("ゼルダ姫のEn_Zl3_Actor_inFinal2_Initは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("ゼルダ姫のEn_Zl3_Actor_inFinal2_Initは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "Princess Zelda's En_Zl3_Actor_inFinal2_Init passed!!!!!!!!!!!!!!!!!!!!!!!!!\n")); EnZl3_setMouthIndex(this, 1); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; } @@ -1381,7 +1389,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; } @@ -1601,9 +1610,12 @@ void func_80B56F10(EnZl3* this, PlayState* play) { pathHead += waypoint; this->unk_30C = pathHead; this->unk_310 = pathHead->count; - PRINTF("En_Zl3_Get_path_info レールデータをゲットだぜ = %d!!!!!!!!!!!!!!\n", waypoint); + PRINTF(T("En_Zl3_Get_path_info レールデータをゲットだぜ = %d!!!!!!!!!!!!!!\n", + "En_Zl3_Get_path_info Got the rail data = %d!!!!!!!!!!!!!!\n"), + waypoint); } else { - PRINTF("En_Zl3_Get_path_info レールデータが無い!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("En_Zl3_Get_path_info レールデータが無い!!!!!!!!!!!!!!!!!!!!\n", + "En_Zl3_Get_path_info No rail data!!!!!!!!!!!!!!!!!!!!\n")); } } @@ -2652,7 +2664,8 @@ void func_80B59B6C(EnZl3* this, PlayState* play) { func_80B59828(this, play); break; default: - PRINTF(VT_FGCOL(RED) " En_Oa3 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T(" En_Oa3 の arg_data がおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n", + " En_Oa3 arg_data is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST); Actor_Kill(&this->actor); } } @@ -2665,7 +2678,8 @@ void func_80B59DB8(EnZl3* this, PlayState* play) { #if DEBUG_FEATURES if (objectSlot < 0) { - PRINTF(VT_FGCOL(RED) "En_Zl3_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T("En_Zl3_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n", + "En_Zl3_main_bank Can't read animation bank!!!!!!!!!!!!\n") VT_RST); return; } #endif @@ -2690,7 +2704,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); @@ -2701,7 +2716,8 @@ void EnZl3_Init(Actor* thisx, PlayState* play) { ActorShape* shape = &this->actor.shape; s32 pad; - PRINTF("ゼルダ姫のEn_Zl3_Actor_ct通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("ゼルダ姫のEn_Zl3_Actor_ct通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "I'm going through Princess Zelda's En_Zl3_Actor_ct!!!!!!!!!!!!!!!!!!!!!!!!!\n")); ActorShape_Init(shape, 0.0f, ActorShadow_DrawCircle, 30.0f); shape->shadowAlpha = 0; func_80B533B0(thisx, play); @@ -2716,7 +2732,8 @@ void EnZl3_Init(Actor* thisx, PlayState* play) { break; } - PRINTF("ゼルダ姫のEn_Zl3_Actor_ctは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("ゼルダ姫のEn_Zl3_Actor_ctは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "Princess Zelda's En_Zl3_Actor_ct passed!!!!!!!!!!!!!!!!!!!!!!!!!\n")); } static OverrideLimbDraw sOverrideLimbDrawFuncs[] = { @@ -2730,7 +2747,8 @@ s32 EnZl3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p if (this->unk_308 < 0 || this->unk_308 >= ARRAY_COUNT(sOverrideLimbDrawFuncs) || sOverrideLimbDrawFuncs[this->unk_308] == NULL) { - PRINTF(VT_FGCOL(RED) "描画前処理モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); + PRINTF(VT_FGCOL(RED) T("描画前処理モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "The pre-drawing mode is wrong!!!!!!!!!!!!!!!!!!!!!!!!!\n") VT_RST); return 0; } return sOverrideLimbDrawFuncs[this->unk_308](play, limbIndex, dList, pos, rot, thisx, gfx); @@ -2799,7 +2817,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_Zl3/z_en_zl3.h b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h index 695588fd52..ab656ead8c 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h @@ -2,8 +2,8 @@ #define Z_EN_ZL3_H #include "ultra64.h" -#include "z64actor.h" -#include "z64scene.h" +#include "actor.h" +#include "scene.h" #include "overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h" 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 a18efd4ba9..be729698f4 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -16,11 +16,11 @@ #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 "audio.h" +#include "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.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 b371092e08..c7020df315 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h @@ -2,7 +2,7 @@ #define Z_EN_ZL4_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct EnZl4; 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 933f7e0aaa..3819247d5c 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 "z64cutscene_commands.h" +#include "cutscene_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 5332ab6788..85f0f300e9 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -7,16 +7,17 @@ #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 "face_reaction.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_zo/object_zo.h" 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 5f26a20230..a0ada224a1 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 "z64actor.h" +#include "actor.h" struct EnZo; 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 1818bea858..5b37333bc9 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -14,15 +14,16 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" +#include "skin.h" #include "assets/objects/object_fhg/object_fhg.h" 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 dca6eeb82a..f8f514dfdb 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h @@ -2,8 +2,8 @@ #define Z_EN_FHG_H #include "ultra64.h" -#include "z64actor.h" -#include "z64skin.h" +#include "actor.h" +#include "skin.h" struct EnfHG; 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 3e2d26e509..20c26abb89 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -9,9 +9,10 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" +#include "tex_len.h" #include "versions.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -33,7 +34,125 @@ ActorProfile End_Title_Profile = { /**/ EndTitle_DrawFull, }; -#include "assets/overlays/ovl_End_Title/ovl_End_Title.c" +#if OOT_VERSION != IQUE_CN + +#define sTheLegendOfZeldaTex_WIDTH 120 +#define sTheLegendOfZeldaTex_HEIGHT 24 +static u64 sTheLegendOfZeldaTex[TEX_LEN(u64, sTheLegendOfZeldaTex_WIDTH, sTheLegendOfZeldaTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sTheLegendOfZeldaTex.ia8.inc.c" +}; + +#define sOcarinaOfTimeTex_WIDTH 112 +#define sOcarinaOfTimeTex_HEIGHT 16 +static u64 sOcarinaOfTimeTex[TEX_LEN(u64, sOcarinaOfTimeTex_WIDTH, sOcarinaOfTimeTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sOcarinaOfTimeTex.ia8.inc.c" +}; + +#define sTheEndTex_WIDTH 80 +#define sTheEndTex_HEIGHT 24 +static u64 sTheEndTex[TEX_LEN(u64, sTheEndTex_WIDTH, sTheEndTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sTheEndTex.ia8.inc.c" +}; + +#else + +static Gfx sEmptyDL1[1] = { +#include "assets/overlays/ovl_End_Title/sEmptyDL1.inc.c" +}; + +#define sIQueTop_WIDTH 128 +#define sIQueTop_HEIGHT 24 +static u64 sIQueTop[TEX_LEN(u64, sIQueTop_WIDTH, sIQueTop_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sIQueTop.ia8.inc.c" +}; + +#define sIQueBottom_WIDTH 128 +#define sIQueBottom_HEIGHT 24 +static u64 sIQueBottom[TEX_LEN(u64, sIQueBottom_WIDTH, sIQueBottom_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sIQueBottom.ia8.inc.c" +}; + +static Gfx sEmptyDL2[1] = { +#include "assets/overlays/ovl_End_Title/sEmptyDL2.inc.c" +}; + +#endif + +#define sNintendoLeftTex_WIDTH 64 +#define sNintendoLeftTex_HEIGHT 48 +static u64 sNintendoLeftTex[TEX_LEN(u64, sNintendoLeftTex_WIDTH, sNintendoLeftTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sNintendoLeftTex.ia8.inc.c" +}; + +#if OOT_VERSION == IQUE_CN +static Gfx sEmptyDL3[1] = { +#include "assets/overlays/ovl_End_Title/sEmptyDL3.inc.c" +}; +#endif + +#define sNintendoRightTex_WIDTH 64 +#define sNintendoRightTex_HEIGHT 48 +static u64 sNintendoRightTex[TEX_LEN(u64, sNintendoRightTex_WIDTH, sNintendoRightTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sNintendoRightTex.ia8.inc.c" +}; + +#if OOT_VERSION == IQUE_CN +static Gfx sEmptyDL4[1] = { +#include "assets/overlays/ovl_End_Title/sEmptyDL4.inc.c" +}; +#endif + +#define sPresentedByTex_WIDTH 96 +#define sPresentedByTex_HEIGHT 16 +static u64 sPresentedByTex[TEX_LEN(u64, sPresentedByTex_WIDTH, sPresentedByTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sPresentedByTex.ia8.inc.c" +}; + +#if OOT_VERSION == IQUE_CN + +static Gfx sEmptyDL5[1] = { +#include "assets/overlays/ovl_End_Title/sEmptyDL5.inc.c" +}; + +#define sTheEndTex_WIDTH 80 +#define sTheEndTex_HEIGHT 24 +static u64 sTheEndTex[TEX_LEN(u64, sTheEndTex_WIDTH, sTheEndTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sTheEndTex.ia8.inc.c" +}; + +static Gfx sEmptyDL6[1] = { +#include "assets/overlays/ovl_End_Title/sEmptyDL6.inc.c" +}; + +#define sTheLegendOfZeldaTex_WIDTH 120 +#define sTheLegendOfZeldaTex_HEIGHT 24 +static u64 sTheLegendOfZeldaTex[TEX_LEN(u64, sTheLegendOfZeldaTex_WIDTH, sTheLegendOfZeldaTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sTheLegendOfZeldaTex.ia8.inc.c" +}; + +static Gfx sEmptyDL7[1] = { +#include "assets/overlays/ovl_End_Title/sEmptyDL7.inc.c" +}; + +#define sOcarinaOfTimeTex_WIDTH 112 +#define sOcarinaOfTimeTex_HEIGHT 16 +static u64 sOcarinaOfTimeTex[TEX_LEN(u64, sOcarinaOfTimeTex_WIDTH, sOcarinaOfTimeTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_End_Title/sOcarinaOfTimeTex.ia8.inc.c" +}; + +#endif + +static Vtx sTriforceVtx[] = { +#include "assets/overlays/ovl_End_Title/sTriforceVtx.inc.c" +}; + +static Gfx sTriforceDL[12] = { +#include "assets/overlays/ovl_End_Title/sTriforceDL.inc.c" +}; + +static Gfx sPresentedByNintendoDL[] = { +#include "assets/overlays/ovl_End_Title/sPresentedByNintendoDL.inc.c" +}; void EndTitle_Init(Actor* thisx, PlayState* play) { EndTitle* this = (EndTitle*)thisx; @@ -94,19 +213,21 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED); gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->endAlpha); - gDPLoadTextureTile(OVERLAY_DISP++, sTheEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 80, 24, 0, 0, 80, 24, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); + gDPLoadTextureTile(OVERLAY_DISP++, sTheEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, sTheEndTex_WIDTH, sTheEndTex_HEIGHT, 0, 0, + 80, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); gSPTextureRectangle(OVERLAY_DISP++, 120 << 2, 90 << 2, 200 << 2, 113 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->tlozAlpha); - gDPLoadTextureTile(OVERLAY_DISP++, sTheLegendOfZeldaTex, G_IM_FMT_IA, G_IM_SIZ_8b, 120, 24, 0, 0, 120, 24, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); + gDPLoadTextureTile(OVERLAY_DISP++, sTheLegendOfZeldaTex, G_IM_FMT_IA, G_IM_SIZ_8b, sTheLegendOfZeldaTex_WIDTH, + sTheLegendOfZeldaTex_HEIGHT, 0, 0, 120, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); gSPTextureRectangle(OVERLAY_DISP++, 100 << 2, 160 << 2, 220 << 2, 183 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->ootAlpha); - gDPLoadTextureTile(OVERLAY_DISP++, sOcarinaOfTimeTex, G_IM_FMT_IA, G_IM_SIZ_8b, 112, 16, 0, 0, 112, 16, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); + gDPLoadTextureTile(OVERLAY_DISP++, sOcarinaOfTimeTex, G_IM_FMT_IA, G_IM_SIZ_8b, sOcarinaOfTimeTex_WIDTH, + sOcarinaOfTimeTex_HEIGHT, 0, 0, 112, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + 0, 0, 0, 0); gSPTextureRectangle(OVERLAY_DISP++, 104 << 2, 177 << 2, 216 << 2, 192 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); 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 cd29ff507c..41cbb8664b 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 "z64actor.h" +#include "actor.h" struct EndTitle; diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 1ec716f8cf..9f94310a35 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" @@ -27,17 +28,17 @@ #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 "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" +#include "skin_matrix.h" #if PLATFORM_N64 #include "cic6105.h" #endif -#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: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:128" \ + "ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.h b/src/overlays/actors/ovl_Fishing/z_fishing.h index 6836ce79f8..7cb72e88dd 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.h +++ b/src/overlays/actors/ovl_Fishing/z_fishing.h @@ -2,8 +2,8 @@ #define Z_FISHING_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct Fishing; 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 a690bfa73f..3c636bc128 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 @@ -11,8 +11,8 @@ #include "ichain.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64item.h" -#include "z64play.h" +#include "item.h" +#include "play_state.h" #include "assets/objects/object_gi_hearts/object_gi_hearts.h" 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 ef92f86b86..d8bc6bfe72 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 "z64actor.h" +#include "actor.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 e0e0e88d83..99db32656c 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -8,11 +8,12 @@ #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" +#include "draw.h" +#include "effect.h" +#include "play_state.h" +#include "save.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 e938c81267..dcae852df4 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -2,7 +2,7 @@ #define Z_ITEM_ETC_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ItemEtcetera; 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 40594c86f6..4459188135 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -5,8 +5,8 @@ */ #include "z_item_inbox.h" -#include "z64draw.h" -#include "z64play.h" +#include "draw.h" +#include "play_state.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 d13bad0053..c22eda0a95 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h @@ -2,7 +2,7 @@ #define Z_ITEM_INBOX_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ItemInbox; 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 fa4f500c87..7e6630f4f8 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -9,10 +9,10 @@ #include "libu64/debug.h" #include "segmented_address.h" #include "sfx.h" -#include "z64draw.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64save.h" +#include "draw.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/scenes/overworld/spot00/spot00_scene.h" 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 3ae598e7d1..5dd7dd74de 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h @@ -2,7 +2,7 @@ #define Z_ITEM_OCARINA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ItemOcarina; 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 357e1e8f71..9dda7af3f0 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -8,16 +8,17 @@ #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 "effect.h" +#include "item.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_link_child/object_link_child.h" 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 564170e465..6fcfcbd209 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.h +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.h @@ -2,7 +2,7 @@ #define Z_ITEM_SHIELD_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ItemShield; 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 0dfabfee4c..21827f32c0 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -6,14 +6,15 @@ #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 "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 59344baff1..d475bab70f 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 "z64actor.h" +#include "actor.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 f93ded2f02..103a7ee1b8 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -12,8 +12,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" -#include "z64player.h" +#include "play_state.h" +#include "player.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) @@ -241,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 ae953c0d3c..d561d291e6 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 "z64actor.h" +#include "actor.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 2872bdc70c..aff6fcd55a 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -6,13 +6,15 @@ #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" +#include "translation.h" +#include "curve.h" +#include "play_state.h" +#include "player.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) @@ -54,8 +56,7 @@ void MagicWind_Init(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); if (!SkelCurve_Init(play, &this->skelCurve, &sSkel, &sAnim)) { - // "Magic_Wind_Actor_ct (): Construct failed" - PRINTF("Magic_Wind_Actor_ct():コンストラクト失敗\n"); + PRINTF(T("Magic_Wind_Actor_ct():コンストラクト失敗\n", "Magic_Wind_Actor_ct(): Construct failed\n")); } this->actor.room = -1; switch (this->actor.params) { @@ -67,8 +68,7 @@ void MagicWind_Init(Actor* thisx, PlayState* play) { case 1: SkelCurve_SetAnim(&this->skelCurve, &sAnim, 60.0f, 0.0f, 60.0f, -1.0f); MagicWind_SetupAction(this, MagicWind_Shrink); - // "Means start" - LOG_STRING("表示開始", "../z_magic_wind.c", 486); + LOG_STRING_T("表示開始", "Start displaying", "../z_magic_wind.c", 486); Player_PlaySfx(player, NA_SE_PL_MAGIC_WIND_WARP); break; } @@ -78,8 +78,7 @@ void MagicWind_Destroy(Actor* thisx, PlayState* play) { MagicWind* this = (MagicWind*)thisx; SkelCurve_Destroy(play, &this->skelCurve); Magic_Reset(play); - // "wipe out" - LOG_STRING("消滅", "../z_magic_wind.c", 505); + LOG_STRING_T("消滅", "Disappearance", "../z_magic_wind.c", 505); } void MagicWind_UpdateAlpha(f32 alpha) { @@ -98,8 +97,7 @@ void MagicWind_WaitForTimer(MagicWind* this, PlayState* play) { return; } - // "Means start" - LOG_STRING("表示開始", "../z_magic_wind.c", 539); + LOG_STRING_T("表示開始", "Start displaying", "../z_magic_wind.c", 539); Player_PlaySfx(player, NA_SE_PL_MAGIC_WIND_NORMAL); MagicWind_UpdateAlpha(1.0f); MagicWind_SetupAction(this, MagicWind_Grow); 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 b7ba93c264..6a186dcb56 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h @@ -2,8 +2,8 @@ #define Z_MAGIC_WIND_H #include "ultra64.h" -#include "z64actor.h" -#include "z64curve.h" +#include "actor.h" +#include "curve.h" struct MagicWind; 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 1dc67c448f..06254d6ca6 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -10,13 +10,15 @@ #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 "translation.h" #include "z_lib.h" -#include "z64light.h" -#include "z64play.h" -#include "z64player.h" +#include "light.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_mir_ray/object_mir_ray.h" @@ -179,13 +181,12 @@ void MirRay_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - // "Generation of reflectable light!" - PRINTF("反射用 光の発生!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + PRINTF(T("反射用 光の発生!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", + "Spawn of reflectable light!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")); LOG_NUM("this->actor.arg_data", this->actor.params, "../z_mir_ray.c", 518); if (this->actor.params >= 0xA) { - // "Reflected light generation failure" - LOG_STRING("反射光 発生失敗", "../z_mir_ray.c", 521); + LOG_STRING_T("反射光 発生失敗", "Reflected light failed to spawn", "../z_mir_ray.c", 521); Actor_Kill(&this->actor); } 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 245cf1007b..ddc4a4708d 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -2,8 +2,8 @@ #define Z_MIR_RAY_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct MirRay; 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 f2837d8481..7ccb70299d 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -9,18 +9,20 @@ #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 "cutscene_flags.h" +#include "effect.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_mamenoki/object_mamenoki.h" @@ -161,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -489,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; @@ -527,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) { @@ -905,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 42ba39261c..172fa66101 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h @@ -2,7 +2,7 @@ #define Z_OBJ_BEAN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" 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 8f24b7e647..5f76c6e02a 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -9,7 +9,7 @@ #include "sfx.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS 0 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 e0159e0f97..a8e75a42cd 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 "z64actor.h" +#include "actor.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 9563d5d2b4..1ebc95cff8 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -8,12 +8,13 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_bombiwa/object_bombiwa.h" 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 9c5c38d127..f12a0d246e 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 "z64actor.h" +#include "actor.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 d3affc90a9..9430414f3e 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -14,8 +14,8 @@ #include "sys_matrix.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" 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 acda97f16d..5395353efb 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -2,7 +2,7 @@ #define Z_OBJ_COMB_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjComb; 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 2c77570a41..3484ffcefa 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "sfx.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/object_dekujr/object_dekujr.h" 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 68b483f8dc..4c7b50b9f9 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 "z64actor.h" +#include "actor.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 fd9d335b65..ad572f17be 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -7,9 +7,11 @@ #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 "play_state.h" #include "assets/objects/object_d_elevator/object_d_elevator.h" @@ -61,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 e6b8d4b6d8..a6d665d55a 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h @@ -2,7 +2,7 @@ #define Z_OBJ_ELEVATOR_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjElevator; 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 f7ec91ca08..97c898f466 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -7,6 +7,7 @@ #include "z_obj_hamishi.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" @@ -14,8 +15,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" 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 8a2256bf04..457a413f85 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 "z64actor.h" +#include "actor.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 f1f8000063..8cfaa9599e 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -7,8 +7,8 @@ #include "z_obj_hana.h" #include "ichain.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" 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 69c08b4cb6..1296e275c7 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 "z64actor.h" +#include "actor.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 e76c104657..3d8af090e5 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -9,10 +9,12 @@ #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 "play_state.h" #include "assets/objects/object_d_hsblock/object_d_hsblock.h" @@ -73,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 299ba7d3d6..4f4696eb6c 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h @@ -2,7 +2,7 @@ #define Z_OBJ_HSBLOCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjHsblock; 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 71ff43d277..3dac2d7fe4 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 @@ -13,8 +13,8 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 c6a56d16f1..bb2c860a7d 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,7 +2,7 @@ #define Z_OBJ_ICE_POLY_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjIcePoly; 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 cb90bd2ce1..b4dd823735 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -9,12 +9,14 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" @@ -107,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 7538b53705..8a299bfe07 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h @@ -2,7 +2,7 @@ #define Z_OBJ_KIBAKO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjKibako; 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 591909a579..c8c0a1211f 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -9,11 +9,13 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_kibako2/object_kibako2.h" @@ -139,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 177ef0b04c..201e5cde88 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h @@ -2,7 +2,7 @@ #define Z_OBJ_KIBAKO2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjKibako2; 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 1545430f1a..a6c35ed922 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -8,12 +8,15 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_d_lift/object_d_lift.h" @@ -81,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 e3f217b930..58bebccf1e 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h @@ -2,7 +2,7 @@ #define Z_OBJ_LIFT_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjLift; 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 a433834d66..3a99282723 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -12,13 +12,15 @@ #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 "effect.h" +#include "play_state.h" #include "assets/objects/object_lightswitch/object_lightswitch.h" @@ -202,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 failed to spawn (%s %d)(arg_data 0x%04x)\n"), + "../z_obj_lightswitch.c", 452, this->actor.params); PRINTF_RST(); removeSelf = true; } @@ -213,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 7f0834a240..0b11c6ae72 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -2,7 +2,7 @@ #define Z_OBJ_LIGHTSWITCH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjLightswitch; 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 93c4b9cdf3..ca902bce1b 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -6,9 +6,11 @@ #include "z_obj_makekinsuta.h" +#include "printf.h" #include "terminal.h" -#include "z64play.h" -#include "z64player.h" +#include "translation.h" +#include "play_state.h" +#include "player.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -35,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_Makekinsuta/z_obj_makekinsuta.h b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h index 0ac9b7ab84..c6134808c5 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h @@ -2,7 +2,7 @@ #define Z_OBJ_MAKEKINSUTA_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjMakekinsuta; 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 5004472a56..ad06491a54 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -7,12 +7,14 @@ #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" +#include "play_state.h" #define FLAGS ACTOR_FLAG_DRAW_CULLING_DISABLED @@ -77,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 failed to spawn (%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 84938f578a..8ff31186c5 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 "z64actor.h" +#include "actor.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 5d1f63d6b6..238bf69cf6 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -9,7 +9,9 @@ #include "libc64/qrand.h" #include "ichain.h" -#include "z64play.h" +#include "printf.h" +#include "translation.h" +#include "play_state.h" #define FLAGS 0 @@ -75,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; @@ -99,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)) { @@ -111,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 } @@ -134,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 @@ -151,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 @@ -168,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 spawn (%s %d)\n"), "../z_obj_mure.c", + 359); } break; default: @@ -179,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 spawn (%s %d)\n"), "../z_obj_mure.c", + 382); } break; } @@ -196,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 @@ -209,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 spawn (%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 20cf667daa..bc6fc66e9a 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h @@ -2,7 +2,7 @@ #define Z_OBJ_MURE_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjMure; 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 ecffdfbe7c..e2e50736e0 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -7,9 +7,11 @@ #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" +#include "play_state.h" #define FLAGS 0 @@ -116,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 8643d477e1..b15386e945 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h @@ -2,7 +2,7 @@ #define Z_OBJ_MURE2_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjMure2; 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 51035c0678..ff37f4b8e1 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -10,7 +10,7 @@ #include "sys_math3d.h" #include "z_en_item00.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #define FLAGS 0 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 fc9a3e83aa..e9b237361b 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h @@ -2,7 +2,7 @@ #define Z_OBJ_MURE3_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjMure3; 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 2817c14f2a..b328e2b6c1 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -7,16 +7,19 @@ #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 "play_state.h" +#include "player.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" @@ -108,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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -227,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; } } @@ -271,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]; @@ -317,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) { @@ -384,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 265ba4691c..45e72bec96 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 "z64actor.h" +#include "actor.h" struct ObjOshihiki; 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 6eca379686..0ff67cc85c 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -8,8 +8,8 @@ #include "sfx.h" #include "z_lib.h" -#include "z64play.h" -#include "z64save.h" +#include "play_state.h" +#include "save.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED 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 ee8e74eaa2..c23785a32a 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h @@ -2,7 +2,7 @@ #define Z_OBJ_ROOMTIMER_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjRoomtimer; 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 45c8594c6e..f8cc6397f8 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -6,18 +6,21 @@ #include "z_obj_switch.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 "play_state.h" +#include "player.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" @@ -215,9 +218,9 @@ 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 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", + "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 } @@ -336,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 failed to spawn (%s %d)\n"), "../z_obj_switch.c", 732); PRINTF_RST(); this->dyna.actor.params &= ~OBJSWITCH_FROZEN_FLAG; } 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 b4d3ae8b20..328f6389c0 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -2,7 +2,7 @@ #define Z_OBJ_SWITCH_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" 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 a189fe4345..9409ee0a52 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -15,7 +15,7 @@ #include "sfx.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64play.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_syokudai/object_syokudai.h" 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 4dee2ba671..e651bc29de 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h @@ -2,8 +2,8 @@ #define Z_OBJ_SYOKUDAI_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct ObjSyokudai; 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 fdd18ef60a..2e3f6e0186 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -10,13 +10,15 @@ #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 "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_timeblock/object_timeblock.h" @@ -148,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) { @@ -232,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; @@ -290,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 966f474496..1cd2a07644 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h @@ -2,7 +2,7 @@ #define Z_OBJ_TIMEBLOCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjTimeblock; 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 2f4cc15c76..4a2ba2d3d9 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -9,13 +9,15 @@ #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 "effect.h" +#include "item.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "assets/objects/object_tsubo/object_tsubo.h" @@ -123,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; } } @@ -148,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 8e27cc8310..b42de51f48 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h @@ -2,7 +2,7 @@ #define Z_OBJ_TSUBO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjTsubo; 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 aed6b65e70..0d5e46873a 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -10,14 +10,16 @@ #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 "ocarina.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/object_timeblock/object_timeblock.h" @@ -233,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)); } @@ -278,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 8f22398db7..199dca053a 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h @@ -2,7 +2,7 @@ #define Z_OBJ_WARP2BLOCK_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjWarp2block; 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 bdf1ff693c..5f8f580e4e 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -7,6 +7,7 @@ #include "z_object_kankyo.h" #include "libc64/qrand.h" +#include "array_count.h" #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" @@ -15,10 +16,10 @@ #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 "audio.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/objects/object_demo_kekkai/object_demo_kekkai.h" #include "assets/objects/gameplay_keep/gameplay_keep.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 40307f5e91..a225f53bc9 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h @@ -2,7 +2,7 @@ #define Z_OBJECT_KANKYO_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ObjectKankyo; 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 c9d6470d63..61772fa0c1 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -9,15 +9,17 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "ichain.h" +#include "printf.h" #include "regs.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.h" #include "z_lib.h" -#include "z64light.h" -#include "z64ocarina.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "light.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) @@ -98,15 +100,13 @@ void OceffSpot_End(OceffSpot* this, PlayState* play) { play->msgCtx.ocarinaMode != OCARINA_MODE_08) { gSaveContext.sunsSongState = SUNSSONG_START; PRINTF_COLOR_YELLOW(); - // "Sun's Song Flag" - PRINTF("z_oceff_spot 太陽の歌フラグ\n"); + PRINTF(T("z_oceff_spot 太陽の歌フラグ\n", "z_oceff_spot Sun's Song Flag\n")); PRINTF_RST(); } } else { play->msgCtx.ocarinaMode = OCARINA_MODE_04; PRINTF_COLOR_YELLOW(); - // "Ocarina End" - PRINTF("z_oceff_spot オカリナ終了\n"); + PRINTF(T("z_oceff_spot オカリナ終了\n", "z_oceff_spot Ocarina finished\n")); PRINTF_RST(); } } 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 222c977fc2..be5389c74c 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h @@ -2,8 +2,8 @@ #define Z_OCEFF_SPOT_H #include "ultra64.h" -#include "z64actor.h" -#include "z64light.h" +#include "actor.h" +#include "light.h" struct OceffSpot; 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 5e236c86f4..036349d0e9 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -9,9 +9,9 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" +#include "play_state.h" +#include "player.h" +#include "save.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_Oceff_Storm/z_oceff_storm.h b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h index aebc002780..269d57d8b5 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h @@ -2,7 +2,7 @@ #define Z_OCEFF_STORM_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct OceffStorm; 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 011b112061..8346407c9a 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -8,12 +8,13 @@ #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" +#include "play_state.h" +#include "player.h" +#include "save.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 65a18468a3..5e6e4add96 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 "z64actor.h" +#include "actor.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 5885dd0ac9..71498caa13 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -8,12 +8,13 @@ #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" +#include "play_state.h" +#include "player.h" +#include "save.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 6276bb33c4..c83616da8c 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 "z64actor.h" +#include "actor.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 580d2cfece..6ec42324a2 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -8,12 +8,13 @@ #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" +#include "play_state.h" +#include "player.h" +#include "save.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 5e6abb0456..b7fddd9f60 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 "z64actor.h" +#include "actor.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 7263cd16f4..8b860cc0c1 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -8,10 +8,11 @@ #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 "play_state.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 bd82ddc7c4..f7eac4cf04 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 "z64actor.h" +#include "actor.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 de537e434b..1ba86361ed 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -9,17 +9,19 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "one_point_cutscene.h" +#include "printf.h" #include "segmented_address.h" #include "sfx.h" #include "sys_math3d.h" #include "terminal.h" +#include "translation.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 "environment.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/scenes/overworld/spot06/spot06_scene.h" @@ -76,8 +78,8 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { ShotSun* this = (ShotSun*)thisx; s32 params; - // "Ocarina secret occurrence" - PRINTF("%d ---- オカリナの秘密発生!!!!!!!!!!!!!\n", this->actor.params); + PRINTF(T("%d ---- オカリナの秘密発生!!!!!!!!!!!!!\n", "%d ---- Ocarina secret spawn!!!!!!!!!!!!!\n"), + this->actor.params); params = PARAMS_GET_U(this->actor.params, 0, 8); if (params == 0x40 || params == 0x41) { this->fairySpawnerState = SPAWNER_OUT_OF_RANGE; 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 4415e6e98f..3404d52013 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h @@ -2,7 +2,7 @@ #define Z_SHOT_SUN_H #include "ultra64.h" -#include "z64actor.h" +#include "actor.h" struct ShotSun; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 4d5a5f075f..e6e017490a 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -18,6 +18,8 @@ #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" @@ -25,6 +27,7 @@ #include "letterbox.h" #include "map.h" #include "one_point_cutscene.h" +#include "printf.h" #include "quake.h" #include "rand.h" #include "regs.h" @@ -39,14 +42,14 @@ #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 "audio.h" +#include "debug.h" +#include "effect.h" +#include "lifemeter.h" +#include "ocarina.h" +#include "play_state.h" +#include "save.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_link_child/object_link_child.h" @@ -1736,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) { @@ -2555,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; @@ -4000,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 { @@ -6174,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)) { @@ -6289,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) && @@ -10773,7 +10776,8 @@ void Player_Init(Actor* thisx, PlayState* play2) { ((play->sceneId != SCENE_BOMBCHU_SHOP) || GET_EVENTCHKINF(EVENTCHKINF_25)) #endif ) { - TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, this->giObjectSegment, 160, 120, 144, 24, 20); + TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, this->giObjectSegment, 160, 120, + PLACE_NAME_TEX_WIDTH, PLACE_NAME_TEX_HEIGHT, 20); } } @@ -11375,7 +11379,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) { @@ -11997,7 +12001,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; @@ -12561,7 +12565,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; } @@ -16152,7 +16156,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 9ff1bd5a96..aa9ae498eb 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 @@ -11,8 +11,8 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 bfceec5856..22be855946 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 a6f909b56a..f78c1e2f56 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 @@ -7,14 +7,15 @@ #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 "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 923739819b..6939246900 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 "z64math.h" +#include "z_math.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 4ec61bc8ea..176f68acc1 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 @@ -11,9 +11,9 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 8aea4d3cc5..91dbf726f3 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 "z64math.h" +#include "z_math.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 f23d0a9aab..49f3ace0c1 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 @@ -12,8 +12,8 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 7701365bdc..52d7c40e26 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 "z64math.h" +#include "z_math.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 b66766dd19..f89b0840b8 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 @@ -9,9 +9,9 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "segmented_address.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/object_dodongo/object_dodongo.h" @@ -87,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); @@ -103,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 fbaa8aa28c..686d02b183 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 "z64math.h" +#include "z_math.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 e8b904a4b6..b75a7077c8 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 @@ -10,9 +10,9 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sfx.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 fb7fc84af1..f4297d8fe4 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 0b3ef078e9..7bc0936907 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 @@ -9,9 +9,11 @@ #include "libc64/qrand.h" #include "gfx.h" #include "gfx_setupdl.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "printf.h" +#include "translation.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -91,7 +93,7 @@ u32 EffectSsDeadDd_Init(PlayState* play, u32 index, EffectSs* this, void* initPa this->accel.z = this->velocity.z = (Rand_ZeroOne() - 0.5f) * 2.0f; } } else { - PRINTF("Effect_SS_Dd_disp_mode():mode_swが変です。\n"); + PRINTF(T("Effect_SS_Dd_disp_mode():mode_swが変です。\n", "Effect_SS_Dd_disp_mode():mode_sw is strange.\n")); return 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 c9c91ec609..0adb102caa 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 4d649d4be4..5f6da1295f 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 @@ -9,8 +9,8 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 7a7d57363a..a248e76229 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 "z64math.h" +#include "z_math.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..4a577652b9 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,9 +5,11 @@ */ #include "z_eff_ss_dead_sound.h" +#include "printf.h" #include "sfx.h" -#include "z64effect.h" -#include "z64play.h" +#include "translation.h" +#include "effect.h" +#include "play_state.h" #define rSfxId regs[10] #define rRepeatMode regs[11] // sound is replayed every update. unused in the original game @@ -32,7 +34,7 @@ u32 EffectSsDeadSound_Init(PlayState* play, u32 index, EffectSs* this, void* ini this->update = EffectSsDeadSound_Update; this->rRepeatMode = initParams->repeatMode; this->rSfxId = initParams->sfxId; - PRINTF("コンストラクター3\n"); // "constructor 3" + PRINTF(T("コンストラクター3\n", "Constructor 3\n")); return 1; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h index 1f8ca9304c..7c9a67b3d2 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h @@ -2,7 +2,7 @@ #define Z_EFF_SS_DEAD_SOUND_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsDeadSoundInitParams { /* 0x00 */ Vec3f pos; 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 2f5901ca2e..1e7e3ca2ed 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 @@ -12,8 +12,8 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 6138c86046..2d51f1ed11 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 899e9f2a2d..f06b5f3031 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 @@ -12,9 +12,9 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 958bde91f8..4a4d9ec4bd 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 56dc375337..d632dfaa52 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 @@ -11,8 +11,8 @@ #include "gfx_setupdl.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 14acb95e40..e4ec69ea9a 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,7 +2,7 @@ #define Z_EFF_SS_EN_FIRE_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsEnFireInitParams { /* 0x00 */ struct Actor* actor; 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 f4f8e01d1c..d4b07ef730 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 @@ -8,13 +8,15 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "rand.h" #include "sys_math.h" #include "sys_matrix.h" +#include "translation.h" #include "versions.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -89,7 +91,8 @@ u32 EffectSsEnIce_Init(PlayState* play, u32 index, EffectSs* this, void* initPar this->rEnvColorB = initParams->envColor.b; this->rAlphaMode = 0; } else { - PRINTF("Effect_Ss_En_Ice_ct():pid->mode_swがエラーです。\n"); + PRINTF(T("Effect_Ss_En_Ice_ct():pid->mode_swがエラーです。\n", + "Effect_Ss_En_Ice_ct():pid->mode_sw is an error.\n")); return 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 238b005bcc..a9b60960d0 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsEnIceInitParams { /* 0x00 */ struct Actor* actor; 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 3af854c502..f2eaceaee8 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_yabusame_point/object_yabusame_point.h" @@ -39,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; @@ -71,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 1bf5a5d30c..b4d77a21c1 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 "z64math.h" +#include "z_math.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 9f00f52e30..c9bfbe981a 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 fc2a4ec2de..0a16be9333 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,7 +2,7 @@ #define Z_EFF_SS_FCIRCLE_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsFcircleInitParams { /* 0x00 */ struct Actor* actor; 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 3bdadb99f7..b44cc99533 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 @@ -10,13 +10,15 @@ #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 "translation.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" +#include "skin.h" #include "assets/objects/object_fhg/object_fhg.h" @@ -37,8 +39,6 @@ EffectSsProfile Effect_Ss_Fhg_Flash_Profile = { EffectSsFhgFlash_Init, }; -// Should eventually come from assets/overlays/ovl_Effect_Ss_Fhg_Flash/ovl_Effect_Ss_Fhg_Flash.h -//! TODO: investigate having ZAPD forward declare static variables static Gfx sShockDL[15]; u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { @@ -54,7 +54,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; @@ -68,7 +68,7 @@ u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* init this->gfx = SEGMENTED_TO_VIRTUAL(gPhantomEnergyBallDL); gSegments[6] = prevSeg6; } else { - PRINTF("Effect_Ss_Fhg_Flash_ct():pffd->modeエラー\n"); + PRINTF(T("Effect_Ss_Fhg_Flash_ct():pffd->modeエラー\n", "Effect_Ss_Fhg_Flash_ct():pffd->mode error\n")); return 0; } } else { @@ -110,7 +110,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); @@ -214,4 +214,18 @@ void EffectSsFhgFlash_UpdateShock(PlayState* play, u32 index, EffectSs* this) { } } -#include "assets/overlays/ovl_Effect_Ss_Fhg_Flash/ovl_Effect_Ss_Fhg_Flash.c" +static Vtx sShockVtx[] = { +#include "assets/overlays/ovl_Effect_Ss_Fhg_Flash/sShockVtx.inc.c" +}; + +#define sShockTex_WIDTH 32 +#define sShockTex_HEIGHT 32 +static u64 sShockTex[TEX_LEN(u64, sShockTex_WIDTH, sShockTex_HEIGHT, 8)]; + +static Gfx sShockDL[15] = { +#include "assets/overlays/ovl_Effect_Ss_Fhg_Flash/sShockDL.inc.c" +}; + +static u64 sShockTex[TEX_LEN(u64, sShockTex_WIDTH, sShockTex_HEIGHT, 8)] = { +#include "assets/overlays/ovl_Effect_Ss_Fhg_Flash/sShockTex.i8.inc.c" +}; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h index f3c1ea6168..8c57bad37d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h @@ -2,7 +2,7 @@ #define Z_EFF_SS_FHGFLASH_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" struct Actor; 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 de4ae887bb..8a5e416a6a 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 @@ -10,9 +10,9 @@ #include "gfx_setupdl.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 ebe8a7203d..01e80d30d0 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsFireTailInitParams { /* 0x00 */ struct Actor* actor; 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 05e4a3d8bf..9fc9d920dd 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 @@ -7,8 +7,8 @@ #include "z_eff_ss_g_fire.h" #include "segmented_address.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 52312527d9..d1673ab4f7 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 "z64math.h" +#include "z_math.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 9610917043..b37136a18c 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 @@ -8,8 +8,8 @@ #include "libc64/qrand.h" #include "segmented_address.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 55215239d2..e2361a3ed2 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 "z64math.h" +#include "z_math.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 9ee5cbe831..19f535ef71 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_kingdodongo/object_kingdodongo.h" @@ -53,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; @@ -92,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 2ddc9f4ce7..9ab63141a0 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 2c83108d35..ef0565c8f8 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 @@ -10,9 +10,9 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 86a7d8378e..196e688c88 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 "z64math.h" +#include "z_math.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 a5472c29fa..783224c9e0 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 @@ -11,9 +11,9 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 0d94bd7e0a..d88cdfcf86 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsGSpkInitParams { /* 0x00 */ struct Actor* actor; 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 3baab32db9..5995c1b563 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 @@ -7,8 +7,8 @@ #include "z_eff_ss_g_splash.h" #include "segmented_address.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 fa1907f667..507117656e 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsGSplashInitParams { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c index e084b5f1f6..550c4a08d3 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c @@ -11,9 +11,9 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h index d598cebf5d..a6a5d7acf3 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h @@ -2,7 +2,7 @@ #define Z_EFF_SS_HAHEN_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsHahenInitParams { /* 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 9be42db8d9..e1fa2a982e 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 @@ -10,9 +10,9 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h index 591ba5a7d0..cbe297176d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h @@ -2,7 +2,7 @@ #define Z_EFF_SS_HITMARK_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsHitMarkInitParams { /* 0x00 */ s32 type; 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 9ce9885de3..4bad83b5f0 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 @@ -11,8 +11,8 @@ #include "rand.h" #include "sys_math.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 afb96c213c..6ed2557174 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 "z64math.h" +#include "z_math.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 5c1b5fc164..bfa4d40db8 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 @@ -8,11 +8,13 @@ #include "gfx.h" #include "gfx_setupdl.h" +#include "printf.h" #include "segmented_address.h" #include "sys_matrix.h" +#include "translation.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/object_fz/object_fz.h" @@ -39,7 +41,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); @@ -54,7 +56,8 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init return 1; } - PRINTF("Effect_SS_Ice_Smoke_ct():バンク Object_Bank_Fzが有りません。\n"); + PRINTF(T("Effect_SS_Ice_Smoke_ct():バンク Object_Bank_Fzが有りません。\n", + "Effect_SS_Ice_Smoke_ct(): Bank Object_Bank_Fz does not exist.\n")); return 0; } @@ -75,7 +78,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 24c27f1cf6..649aff9adb 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 "z64math.h" +#include "z_math.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 12d9c5a5eb..ce06859168 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "rand.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 eb8e8764d7..2afeb50935 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 "z64math.h" +#include "z_math.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..cf5f3a2b88 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,11 +11,13 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "line_numbers.h" +#include "printf.h" #include "sys_matrix.h" +#include "translation.h" #include "versions.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #define rReg0 regs[0] #define rGravity regs[1] @@ -64,7 +66,7 @@ u32 EffectSsKakera_Init(PlayState* play, u32 index, EffectSs* this, void* initPa } } else { - PRINTF("shape_modelがNULL\n"); + PRINTF(T("shape_modelがNULL\n", "shape_model is NULL\n")); LogUtils_HungupThread("../z_eff_kakera.c", LN1(175, 178)); } @@ -91,7 +93,8 @@ f32 func_809A9818(f32 arg0, f32 arg1) { #if DEBUG_FEATURES if (arg1 < 0.0f) { - PRINTF("範囲がマイナス!!(randomD_sectionUniformity)\n"); + PRINTF(T("範囲がマイナス!!(randomD_sectionUniformity)\n", + "The range is negative!! (randomD_sectionUniformity)\n")); } #endif diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h index 90f3a8cdab..09d38ed7e9 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h @@ -2,7 +2,7 @@ #define Z_EFF_SS_KAKERA_H #include "ultra64.h" -#include "z64math.h" +#include "z_math.h" typedef struct EffectSsKakeraInitParams { /* 0x00 */ Vec3f pos; 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 f7c22aaa19..a4093ead1b 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 @@ -13,9 +13,9 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 0c128ff7ab..64612fcbb4 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 f44ac38496..5e2ff3aaf0 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 @@ -12,9 +12,9 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 39f5d51841..75af1b7e0c 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 @@ -3,7 +3,7 @@ #include "ultra64.h" #include "color.h" -#include "z64math.h" +#include "z_math.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 1dadd7f069..aecdd6c936 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 @@ -13,9 +13,9 @@ #include "segmented_address.h" #include "sys_matrix.h" #include "z_lib.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 e45c2c6f2a..11eb6c9e8b 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 "z64math.h" +#include "z_math.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 8566be1623..24e484c1ee 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 @@ -10,8 +10,8 @@ #include "gfx_setupdl.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" +#include "effect.h" +#include "play_state.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 37a9425dc7..a01146d3e0 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 "z64math.h" +#include "z_math.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 2277a71d85..beac5fd414 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,10 +6,10 @@ #include "z_eff_ss_solder_srch_ball.h" -#include "z64bgcheck.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64player.h" +#include "bgcheck.h" +#include "effect.h" +#include "play_state.h" +#include "player.h" #define rUnused regs[1] 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 b105f063d5..c68ae12bfa 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 "z64math.h" +#include "z_math.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 520f8af02a..d7758d3b97 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 @@ -10,10 +10,10 @@ #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 "effect.h" +#include "play_state.h" +#include "player.h" +#include "save.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 4b5ccda965..1748ca5249 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 "z64math.h" +#include "z_math.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 5ecd83add1..bdd99e1e31 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 @@ -12,9 +12,9 @@ #include "regs.h" #include "segmented_address.h" #include "sys_matrix.h" -#include "z64effect.h" -#include "z64play.h" -#include "z64skin_matrix.h" +#include "effect.h" +#include "play_state.h" +#include "skin_matrix.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" 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 efb8df225d..c84ab06f9c 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 "z64math.h" +#include "z_math.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 ae41c4dced..016c04dce5 100644 --- a/src/overlays/gamestates/ovl_file_choose/file_select.h +++ b/src/overlays/gamestates/ovl_file_choose/file_select.h @@ -1,11 +1,11 @@ #ifndef FILE_SELECT_H #define FILE_SELECT_H -#include "libc/stddef.h" +#include "stddef.h" #include "ultra64.h" #include "gfx.h" #include "versions.h" -#include "z64game.h" +#include "game.h" #define GET_NEWF(sramCtx, slotNum, index) (sramCtx->readBuff[gSramSlotOffsets[slotNum] + offsetof(SaveContext, save.info.playerData.newf[index])]) @@ -225,4 +225,26 @@ void FileSelect_DrawCharacter(GraphicsContext* gfxCtx, void* texture, s16 vtx); extern s16 D_808124C0[]; #endif +extern Vtx gNameEntryVtx[]; +extern Vtx gOptionsMenuHeadersVtx[]; +extern Vtx gOptionsMenuSettingsVtx[]; +extern Vtx gOptionsDividerSoundVtx[]; +extern Vtx gOptionsDividerZTargetVtx[]; +extern Vtx gOptionsDividerBrightnessVtx[]; +extern s16 gCharPageEng[]; +#if OOT_NTSC +extern s16 gCharPageHira[]; +extern s16 gCharPageKata[]; +extern s16 gNextCharPage[]; +#endif +#if OOT_PAL && PLATFORM_N64 +extern Vtx gOptionsMenuBrightnessVtx[]; +extern Vtx gOptionsMenuLanguageVtx[]; +extern Vtx gOptionsDividerLanguageVtx[]; +#endif +#if OOT_PAL && PLATFORM_GC +extern Vtx gOptionsMenuHeadersGERVtx[]; +extern Vtx gOptionsMenuSettingsGERVtx[]; +#endif + #endif 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 4517fc7e72..fdb36d94bd 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -5,13 +5,15 @@ #include "controller.h" #include "gfx.h" #include "gfx_setupdl.h" +#include "language_array.h" #include "letterbox.h" -#include "macros.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" @@ -20,18 +22,17 @@ #include "sfx.h" #include "sys_matrix.h" #include "terminal.h" +#include "translation.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" - -#include "global.h" +#include "audio.h" +#include "environment.h" +#include "play_state.h" +#include "save.h" +#include "skybox.h" +#include "sram.h" +#include "ss_sram.h" +#include "view.h" #if OOT_PAL_N64 #include "assets/objects/object_mag/object_mag.h" @@ -365,7 +366,7 @@ void FileSelect_InitModeUpdate(GameState* thisx) { this->nextTitleLabel = FS_TITLE_OPEN_FILE; PRINTF("Sram Start─Load 》》》》》 "); Sram_VerifyAndLoadAllSaves(this, sramCtx); - PRINTF("終了!!!\n"); + PRINTF(T("終了!!!\n", "End!!!\n")); } #else if (this->configMode == CM_FADE_IN_START) { @@ -1955,7 +1956,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 4cb4fa5c85..fb14504bd7 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 @@ -2,13 +2,12 @@ #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" - -#include "macros.h" +#include "save.h" +#include "sram.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 2c1e49fb59..faf219fd93 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset.c @@ -1,23 +1,23 @@ #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 "translation.h" #include "versions.h" -#include "z64audio.h" -#include "z64save.h" - -#include "macros.h" -#include "global.h" +#include "audio.h" +#include "save.h" #include "assets/textures/title_static/title_static.h" -#include "assets/overlays/ovl_file_choose/ovl_file_choose.h" void FileSelect_DrawCharacter(GraphicsContext* gfxCtx, void* texture, s16 vtx) { OPEN_DISPS(gfxCtx, "../z_file_nameset_PAL.c", 110); @@ -1369,8 +1369,8 @@ void FileSelect_UpdateOptionsMenu(GameState* thisx) { PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting); PRINTF("Na_SetSoundOutputMode = %d\n", gSaveContext.soundSetting); PRINTF_RST(); - Audio_SetSoundMode(gSaveContext.soundSetting); - PRINTF("終了\n"); + Audio_SetSoundOutputMode(gSaveContext.soundSetting); + PRINTF(T("終了\n", "end\n")); return; } diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c index 2fc9670b89..b51fd2eceb 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c @@ -1 +1,83 @@ -#include "assets/overlays/ovl_file_choose/ovl_file_choose.c" +#include "file_select.h" + +#include "ultra64.h" +#include "gfx.h" +#include "versions.h" + +Vtx gNameEntryVtx[] = { +#include "assets/overlays/ovl_file_choose/gNameEntryVtx.inc.c" +}; + +#if OOT_NTSC +s16 gCharPageHira[] = { +#include "assets/overlays/ovl_file_choose/gCharPageHira.inc.c" +}; + +s16 gCharPageKata[] = { +#include "assets/overlays/ovl_file_choose/gCharPageKata.inc.c" +}; + +s16 gCharPageEng[] = { +#include "assets/overlays/ovl_file_choose/gCharPageEng.inc.c" +}; + +s16 gNextCharPage[] = { +#include "assets/overlays/ovl_file_choose/gNextCharPage.inc.c" +}; +#endif + +Vtx gOptionsMenuHeadersVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsMenuHeadersVtx.inc.c" +}; + +#if OOT_PAL && PLATFORM_GC +Vtx gOptionsMenuHeadersGERVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsMenuHeadersGERVtx.inc.c" +}; +#endif + +Vtx gOptionsMenuSettingsVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsMenuSettingsVtx.inc.c" +}; + +#if OOT_PAL && PLATFORM_GC +Vtx gOptionsMenuSettingsGERVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsMenuSettingsGERVtx.inc.c" +}; +#endif + +#if OOT_PAL && PLATFORM_N64 +Vtx gOptionsMenuBrightnessVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsMenuBrightnessVtx.inc.c" +}; + +Vtx gOptionsMenuLanguageVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsMenuLanguageVtx.inc.c" +}; + +u8 ovl_file_choose_zeros_000640[320] = { 0 }; +#endif + +Vtx gOptionsDividerSoundVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsDividerSoundVtx.inc.c" +}; + +Vtx gOptionsDividerZTargetVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsDividerZTargetVtx.inc.c" +}; + +Vtx gOptionsDividerBrightnessVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsDividerBrightnessVtx.inc.c" +}; + +#if OOT_PAL && PLATFORM_N64 +Vtx gOptionsDividerLanguageVtx[] = { +#include "assets/overlays/ovl_file_choose/gOptionsDividerLanguageVtx.inc.c" +}; +#endif + +#if OOT_PAL +s16 gCharPageEng[] = { +#include "assets/overlays/ovl_file_choose/gCharPageEng.inc.c" +}; +#endif diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index ad36b6e205..f300c1ea7b 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -8,11 +8,11 @@ #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" +#include "game.h" +#include "play_state.h" +#include "save.h" +#include "sram.h" +#include "view.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 633986cd66..329af45f22 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -6,8 +6,8 @@ #include "libc64/qrand.h" #include "libu64/gfxprint.h" -#include "ultra64.h" #include "alloca.h" +#include "array_count.h" #include "console_logo_state.h" #include "controller.h" #include "gfx.h" @@ -16,17 +16,18 @@ #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 "z64play.h" -#include "z64save.h" -#include "z64sram.h" - -#include "macros.h" +#include "translation.h" +#include "ultra64.h" +#include "play_state.h" +#include "save.h" +#include "sram.h" void MapSelect_LoadTitle(MapSelectState* this) { this->state.running = false; diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index 175c43f9ea..907fdb886c 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -11,10 +11,12 @@ #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" @@ -23,11 +25,9 @@ #include "sys_freeze.h" #include "title_setup_state.h" #include "versions.h" -#include "z64actor.h" -#include "z64environment.h" -#include "z64save.h" - -#include "global.h" +#include "actor.h" +#include "environment.h" +#include "save.h" #include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h" 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 4690ccade8..87a30a53b5 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -1,14 +1,14 @@ #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 "global.h" +#include "ocarina.h" +#include "play_state.h" +#include "save.h" #include "assets/textures/parameter_static/parameter_static.h" #include "assets/textures/icon_item_static/icon_item_static.h" @@ -500,8 +500,9 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); - gDPLoadTextureBlock(POLY_OPA_DISP++, gSongNoteTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(POLY_OPA_DISP++, gSongNoteTex, G_IM_FMT_IA, G_IM_SIZ_8b, gSongNoteTex_WIDTH, + gSongNoteTex_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); for (j = 0; j < QUEST_KOKIRI_EMERALD - QUEST_SONG_MINUET; j++, bufI += 4) { if (CHECK_QUEST_ITEM(QUEST_SONG_MINUET + j)) { 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 3339bc3250..2ba3fd1139 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c @@ -5,35 +5,166 @@ #include "gfx.h" #include "gfx_setupdl.h" #include "gfxalloc.h" -#include "z64play.h" -#include "z64save.h" +#include "printf.h" +#include "translation.h" +#include "play_state.h" +#include "save.h" #include "assets/textures/parameter_static/parameter_static.h" +typedef enum DebugSection { + /* 0x00 */ SECTION_RUPEES, + /* 0x01 */ SECTION_HEALTH_CAPACITY, + /* 0x02 */ SECTION_CURRENT_HEALTH, + /* 0x03 */ SECTION_FIRST_INVENTORY_SLOT, + /* 0x1A */ SECTION_LAST_INVENTORY_SLOT = 0x1A, + /* 0x1B */ SECTION_FIRST_KEY_COUNT, + /* 0x2B */ SECTION_LAST_KEY_COUNT = 0x2B, + /* 0x2C */ SECTION_FIRST_UPGRADE, + /* 0x33 */ SECTION_LAST_UPGRADE = 0x33, + /* 0x34 */ SECTION_FIRST_EQUIPMENT, + /* 0x37 */ SECTION_LAST_EQUIPMENT = 0x37, + /* 0x38 */ SECTION_FIRST_DUNGEON_ITEMS, + /* 0x43 */ SECTION_LAST_DUNGEON_ITEMS = 0x43, + /* 0x44 */ SECTION_FIRST_MEDALLION, + /* 0x49 */ SECTION_LAST_MEDALLION = 0x49, + /* 0x4A */ SECTION_FIRST_SONG, + /* 0x55 */ SECTION_LAST_SONG = 0x55, + /* 0x56 */ SECTION_FIRST_SPIRITUAL_STONE, + /* 0x58 */ SECTION_LAST_SPIRITUAL_STONE = 0x58, + /* 0x59 */ SECTION_STONE_OF_AGONY, + /* 0x5A */ SECTION_GERUDO_CARD, + /* 0x5B */ SECTION_SKULL_TOKENS, + /* 0x5C */ SECTION_HEART_PIECES, + /* 0x5D */ SECTION_MAX +} DebugSection; + // Positions of each input section in the editor -static u16 sSectionPositions[][2] = { - { 64, 15 }, { 144, 15 }, { 170, 15 }, { 78, 35 }, { 104, 35 }, { 130, 35 }, { 156, 35 }, { 182, 35 }, - { 208, 35 }, { 78, 50 }, { 104, 50 }, { 130, 50 }, { 156, 50 }, { 182, 50 }, { 208, 50 }, { 78, 65 }, - { 104, 65 }, { 130, 65 }, { 156, 65 }, { 182, 65 }, { 208, 65 }, { 78, 80 }, { 104, 80 }, { 130, 80 }, - { 156, 80 }, { 182, 80 }, { 208, 80 }, { 78, 98 }, { 88, 98 }, { 98, 98 }, { 108, 98 }, { 118, 98 }, - { 128, 98 }, { 138, 98 }, { 148, 98 }, { 158, 98 }, { 168, 98 }, { 178, 98 }, { 188, 98 }, { 198, 98 }, - { 208, 98 }, { 218, 98 }, { 228, 98 }, { 238, 98 }, { 78, 115 }, { 90, 115 }, { 102, 115 }, { 114, 115 }, - { 126, 115 }, { 138, 115 }, { 150, 115 }, { 162, 115 }, { 202, 115 }, { 214, 115 }, { 226, 115 }, { 238, 115 }, - { 78, 132 }, { 90, 132 }, { 102, 132 }, { 114, 132 }, { 126, 132 }, { 138, 132 }, { 150, 132 }, { 162, 132 }, - { 174, 132 }, { 186, 132 }, { 198, 132 }, { 210, 132 }, { 78, 149 }, { 90, 149 }, { 102, 149 }, { 114, 149 }, - { 126, 149 }, { 138, 149 }, { 78, 166 }, { 90, 166 }, { 102, 166 }, { 114, 166 }, { 126, 166 }, { 138, 166 }, - { 150, 166 }, { 162, 166 }, { 174, 166 }, { 186, 166 }, { 198, 166 }, { 210, 166 }, { 210, 149 }, { 222, 149 }, - { 234, 149 }, { 78, 185 }, { 90, 185 }, { 145, 185 }, { 210, 185 }, +static u16 sSectionPositions[SECTION_MAX][2] = { + { 64, 15 }, // SECTION_RUPEES + { 144, 15 }, // SECTION_HEALTH_CAPACITY + { 170, 15 }, // SECTION_CURRENT_HEALTH + + { 78, 35 }, // SECTION_FIRST_INVENTORY_SLOT + { 104, 35 }, + { 130, 35 }, + { 156, 35 }, + { 182, 35 }, + { 208, 35 }, + // + { 78, 50 }, + { 104, 50 }, + { 130, 50 }, + { 156, 50 }, + { 182, 50 }, + { 208, 50 }, + // + { 78, 65 }, + { 104, 65 }, + { 130, 65 }, + { 156, 65 }, + { 182, 65 }, + { 208, 65 }, + // + { 78, 80 }, + { 104, 80 }, + { 130, 80 }, + { 156, 80 }, + { 182, 80 }, + { 208, 80 }, // SECTION_LAST_INVENTORY_SLOT + + { 78, 98 }, // SECTION_FIRST_KEY_COUNT + { 88, 98 }, + { 98, 98 }, + { 108, 98 }, + { 118, 98 }, + { 128, 98 }, + { 138, 98 }, + { 148, 98 }, + { 158, 98 }, + { 168, 98 }, + { 178, 98 }, + { 188, 98 }, + { 198, 98 }, + { 208, 98 }, + { 218, 98 }, + { 228, 98 }, + { 238, 98 }, // SECTION_LAST_KEY_COUNT + + { 78, 115 }, // SECTION_FIRST_UPGRADE + { 90, 115 }, + { 102, 115 }, + { 114, 115 }, + { 126, 115 }, + { 138, 115 }, + { 150, 115 }, + { 162, 115 }, // SECTION_LAST_UPGRADE + + { 202, 115 }, // SECTION_FIRST_EQUIPMENT + { 214, 115 }, + { 226, 115 }, + { 238, 115 }, // SECTION_LAST_EQUIPMENT + + { 78, 132 }, // SECTION_FIRST_DUNGEON_ITEMS + { 90, 132 }, + { 102, 132 }, + { 114, 132 }, + { 126, 132 }, + { 138, 132 }, + { 150, 132 }, + { 162, 132 }, + { 174, 132 }, + { 186, 132 }, + { 198, 132 }, + { 210, 132 }, // SECTION_LAST_DUNGEON_ITEMS + + { 78, 149 }, // SECTION_FIRST_MEDALLION + { 90, 149 }, + { 102, 149 }, + { 114, 149 }, + { 126, 149 }, + { 138, 149 }, // SECTION_LAST_MEDALLION + + { 78, 166 }, // SECTION_FIRST_SONG + { 90, 166 }, + { 102, 166 }, + { 114, 166 }, + { 126, 166 }, + { 138, 166 }, + { 150, 166 }, + { 162, 166 }, + { 174, 166 }, + { 186, 166 }, + { 198, 166 }, + { 210, 166 }, // SECTION_LAST_SONG + + { 210, 149 }, // SECTION_FIRST_SPIRITUAL_STONE + { 222, 149 }, + { 234, 149 }, // SECTION_LAST_SPIRITUAL_STONE + + { 78, 185 }, // SECTION_STONE_OF_AGONY + { 90, 185 }, // SECTION_GERUDO_CARD + { 145, 185 }, // SECTION_SKULL_TOKENS + { 210, 185 }, // SECTION_HEART_PIECES }; // First section of each row in the editor (starting from the top) static u16 sRowFirstSections[] = { - 0x00, 0x03, 0x1B, 0x2C, 0x34, 0x38, 0x44, 0x4A, 0x56, 0x59, 0x5C, + SECTION_RUPEES, SECTION_FIRST_INVENTORY_SLOT, SECTION_FIRST_KEY_COUNT, + SECTION_FIRST_UPGRADE, SECTION_FIRST_EQUIPMENT, SECTION_FIRST_DUNGEON_ITEMS, + SECTION_FIRST_MEDALLION, SECTION_FIRST_SONG, SECTION_FIRST_SPIRITUAL_STONE, + SECTION_STONE_OF_AGONY, SECTION_HEART_PIECES, }; -// Maximum value of each upgrade type static u8 sMaxUpgradeValues[] = { - 3, 3, 3, 2, 2, 3, 3, 3, + /* UPG_QUIVER */ 3, + /* UPG_BOMB_BAG */ 3, + /* UPG_STRENGTH */ 3, + /* UPG_SCALE */ 2, + /* UPG_WALLET */ 2, + /* UPG_BULLET_BAG */ 3, + /* UPG_DEKU_STICKS */ 3, + /* UPG_DEKU_NUTS */ 3, }; // Item ID corresponding to each slot, aside from bottles and trade items @@ -43,7 +174,7 @@ static s16 sSlotItems[] = { ITEM_BOOMERANG, ITEM_LENS_OF_TRUTH, ITEM_MAGIC_BEAN, ITEM_HAMMER, ITEM_ARROW_LIGHT, ITEM_NAYRUS_LOVE, }; -void KaleidoScope_DrawDebugEditorText(Gfx** gfxP) { +void KaleidoScope_DrawInventoryEditorText(Gfx** gfxP) { GfxPrint printer; s32 pad[2]; @@ -52,35 +183,35 @@ void KaleidoScope_DrawDebugEditorText(Gfx** gfxP) { GfxPrint_SetPos(&printer, 4, 2); GfxPrint_SetColor(&printer, 255, 60, 0, 255); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ルピー"); // "Rupee" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "ルピー", "Rupee")); GfxPrint_SetPos(&printer, 15, 2); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ハート"); // "Heart" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "ハート", "Heart")); GfxPrint_SetPos(&printer, 26, 3); GfxPrint_Printf(&printer, "%s", "/4"); GfxPrint_SetPos(&printer, 4, 5); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "アイテム"); // "Item" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "アイテム", "Item")); GfxPrint_SetPos(&printer, 4, 13); GfxPrint_Printf(&printer, "%s", "KEY"); GfxPrint_SetPos(&printer, 4, 15); - GfxPrint_Printf(&printer, "%s", GFXP_HIRAGANA "ソウビ"); // "Equipment" + GfxPrint_Printf(&printer, "%s", T(GFXP_HIRAGANA "ソウビ", "Equipment")); GfxPrint_SetPos(&printer, 23, 14); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "ケン"); // "Sword" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "ケン", "Sword")); GfxPrint_SetPos(&printer, 23, 15); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "タテ"); // "Shield" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "タテ", "Shield")); GfxPrint_SetPos(&printer, 4, 17); GfxPrint_Printf(&printer, "%s", "MAP"); GfxPrint_SetPos(&printer, 4, 19); - GfxPrint_Printf(&printer, "%s", GFXP_HIRAGANA "フウイン"); // "Seal" + GfxPrint_Printf(&printer, "%s", T(GFXP_HIRAGANA "フウイン", "Seal")); GfxPrint_SetPos(&printer, 20, 19); - GfxPrint_Printf(&printer, "%s", GFXP_HIRAGANA "セイレイセキ"); // "Spiritual Stone" + GfxPrint_Printf(&printer, "%s", T(GFXP_HIRAGANA "セイレイセキ", "Spiritual Stone")); GfxPrint_SetPos(&printer, 4, 21); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "オカリナ"); // "Ocarina" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "オカリナ", "Ocarina")); GfxPrint_SetPos(&printer, 4, 24); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "コレクト"); // "Collect" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "コレクト", "Collect")); GfxPrint_SetPos(&printer, 14, 24); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "キンスタ"); // "Skulltula" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "キンスタ", "Skulltula")); GfxPrint_SetPos(&printer, 23, 24); - GfxPrint_Printf(&printer, "%s", GFXP_KATAKANA "カケラ"); // "Gold Token" + GfxPrint_Printf(&printer, "%s", T(GFXP_KATAKANA "カケラ", "Gold Token")); GfxPrint_SetPos(&printer, 28, 24); GfxPrint_Printf(&printer, "%s", "/4"); @@ -100,8 +231,8 @@ void KaleidoScope_DrawDigit(PlayState* play, s32 digit, s32 rectLeft, s32 rectTo CLOSE_DISPS(play->state.gfxCtx, "../z_kaleido_debug.c", 220); } -void KaleidoScope_DrawDebugEditor(PlayState* play) { - static s16 curSection = 0; +void KaleidoScope_DrawInventoryEditor(PlayState* play) { + static s16 curSection = SECTION_RUPEES; static s16 curRow = 0; static s32 prevDBtnInput = 0; static s32 heldDBtnTimer = 0; @@ -109,7 +240,8 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { Input* input = &play->state.input[0]; Gfx* gfx; Gfx* gfxRef; - s16 spD8[4]; + // Used for both storing the digits of the drawn numbers and digit positions + s16 digitBuf[4]; s16 slot; s16 i; s16 j; @@ -136,7 +268,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { gfx = Gfx_Open(gfxRef); gSPDisplayList(OVERLAY_DISP++, gfx); - KaleidoScope_DrawDebugEditorText(&gfx); + KaleidoScope_DrawInventoryEditorText(&gfx); gSPEndDisplayList(gfx++); Gfx_Close(gfxRef, gfx); @@ -153,162 +285,162 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); // Rupees - spD8[0] = spD8[1] = spD8[2] = 0; - spD8[3] = gSaveContext.save.info.playerData.rupees; - while (spD8[3] >= 1000) { - spD8[0]++; - spD8[3] -= 1000; + digitBuf[0] = digitBuf[1] = digitBuf[2] = 0; + digitBuf[3] = gSaveContext.save.info.playerData.rupees; + while (digitBuf[3] >= 1000) { + digitBuf[0]++; + digitBuf[3] -= 1000; } - while (spD8[3] >= 100) { - spD8[1]++; - spD8[3] -= 100; + while (digitBuf[3] >= 100) { + digitBuf[1]++; + digitBuf[3] -= 100; } - while (spD8[3] >= 10) { - spD8[2]++; - spD8[3] -= 10; + while (digitBuf[3] >= 10) { + digitBuf[2]++; + digitBuf[3] -= 10; } for (i = 0, x = 68; i < 4; i++, x += 10) { - KaleidoScope_DrawDigit(play, spD8[i], x, 15); + KaleidoScope_DrawDigit(play, digitBuf[i], x, 15); } // Health capacity - spD8[2] = 0; - spD8[3] = gSaveContext.save.info.playerData.healthCapacity / 0x10; - while (spD8[3] >= 10) { - spD8[2]++; - spD8[3] -= 10; + digitBuf[2] = 0; + digitBuf[3] = gSaveContext.save.info.playerData.healthCapacity / 0x10; + while (digitBuf[3] >= 10) { + digitBuf[2]++; + digitBuf[3] -= 10; } - KaleidoScope_DrawDigit(play, spD8[2], 146, 15); - KaleidoScope_DrawDigit(play, spD8[3], 156, 15); + KaleidoScope_DrawDigit(play, digitBuf[2], 146, 15); + KaleidoScope_DrawDigit(play, digitBuf[3], 156, 15); // Health - spD8[2] = 0; - spD8[3] = gSaveContext.save.info.playerData.health / 0x10; - while (spD8[3] >= 10) { - spD8[2]++; - spD8[3] -= 10; + digitBuf[2] = 0; + digitBuf[3] = gSaveContext.save.info.playerData.health / 0x10; + while (digitBuf[3] >= 10) { + digitBuf[2]++; + digitBuf[3] -= 10; } - KaleidoScope_DrawDigit(play, spD8[2], 172, 15); - KaleidoScope_DrawDigit(play, spD8[3], 182, 15); + KaleidoScope_DrawDigit(play, digitBuf[2], 172, 15); + KaleidoScope_DrawDigit(play, digitBuf[3], 182, 15); // Inventory for (slot = 0, i = 0, y = 35; i < 4; i++, y += 15) { for (j = 0, x = 78; j < 6; j++, slot++, x += 26) { - spD8[2] = 0; + digitBuf[2] = 0; if ((slot <= SLOT_BOW) || (slot == SLOT_SLINGSHOT) || (slot == SLOT_BOMBCHU) || (slot == SLOT_MAGIC_BEAN)) { - spD8[3] = AMMO(gAmmoItems[slot]); + digitBuf[3] = AMMO(gAmmoItems[slot]); } else if (slot == SLOT_OCARINA) { - spD8[3] = gSaveContext.save.info.inventory.items[slot]; + digitBuf[3] = gSaveContext.save.info.inventory.items[slot]; } else { - spD8[3] = gSaveContext.save.info.inventory.items[slot]; + digitBuf[3] = gSaveContext.save.info.inventory.items[slot]; } - if (spD8[3] != ITEM_NONE) { - while (spD8[3] >= 10) { - spD8[2]++; - spD8[3] -= 10; + if (digitBuf[3] != ITEM_NONE) { + while (digitBuf[3] >= 10) { + digitBuf[2]++; + digitBuf[3] -= 10; } } else { - spD8[2] = spD8[3] = 0; + digitBuf[2] = digitBuf[3] = 0; } - KaleidoScope_DrawDigit(play, spD8[2], x, y); - KaleidoScope_DrawDigit(play, spD8[3], x + 10, y); + KaleidoScope_DrawDigit(play, digitBuf[2], x, y); + KaleidoScope_DrawDigit(play, digitBuf[3], x + 10, y); } } // Keys - for (spD8[1] = 78, i = 0; i < 17; i++) { - spD8[2] = 0; + for (digitBuf[1] = 78, i = 0; i < 17; i++) { + digitBuf[2] = 0; - if ((spD8[3] = gSaveContext.save.info.inventory.dungeonKeys[i]) >= 0) { - while (spD8[3] >= 10) { - spD8[2]++; - spD8[3] -= 10; + if ((digitBuf[3] = gSaveContext.save.info.inventory.dungeonKeys[i]) >= 0) { + while (digitBuf[3] >= 10) { + digitBuf[2]++; + digitBuf[3] -= 10; } } else { - spD8[2] = spD8[3] = 0; + digitBuf[2] = digitBuf[3] = 0; } - KaleidoScope_DrawDigit(play, spD8[3], spD8[1], 98); - spD8[1] += 10; + KaleidoScope_DrawDigit(play, digitBuf[3], digitBuf[1], 98); + digitBuf[1] += 10; } // Upgrades - for (spD8[1] = 78, i = 0; i < 8; i++, spD8[1] += 12) { - KaleidoScope_DrawDigit(play, CUR_UPG_VALUE(i), spD8[1], 115); + for (digitBuf[1] = 78, i = 0; i < 8; i++, digitBuf[1] += 12) { + KaleidoScope_DrawDigit(play, CUR_UPG_VALUE(i), digitBuf[1], 115); } // Equipment - for (spD8[1] = 202, i = 0; i < 4; i++, spD8[1] += 12) { - KaleidoScope_DrawDigit(play, ALL_EQUIP_VALUE(i), spD8[1], 115); + for (digitBuf[1] = 202, i = 0; i < 4; i++, digitBuf[1] += 12) { + KaleidoScope_DrawDigit(play, ALL_EQUIP_VALUE(i), digitBuf[1], 115); } // Dungeon Items - for (spD8[1] = 78, i = 0; i < 12; i++, spD8[1] += 12) { - spD8[2] = gSaveContext.save.info.inventory.dungeonItems[i] & gEquipMasks[0]; - KaleidoScope_DrawDigit(play, spD8[2], spD8[1], 132); + for (digitBuf[1] = 78, i = 0; i < 12; i++, digitBuf[1] += 12) { + digitBuf[2] = gSaveContext.save.info.inventory.dungeonItems[i] & gEquipMasks[0]; + KaleidoScope_DrawDigit(play, digitBuf[2], digitBuf[1], 132); } // Medallions - for (spD8[1] = 78, i = 0; i < 6; i++, spD8[1] += 12) { - spD8[2] = 0; + for (digitBuf[1] = 78, i = 0; i < 6; i++, digitBuf[1] += 12) { + digitBuf[2] = 0; if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST + i)) { - spD8[2] = 1; + digitBuf[2] = 1; } - KaleidoScope_DrawDigit(play, spD8[2], spD8[1], 149); + KaleidoScope_DrawDigit(play, digitBuf[2], digitBuf[1], 149); } // Spiritual Stones - for (spD8[1] = 210, i = 0; i < 3; i++, spD8[1] += 12) { - spD8[2] = 0; + for (digitBuf[1] = 210, i = 0; i < 3; i++, digitBuf[1] += 12) { + digitBuf[2] = 0; if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD + i)) { - spD8[2] = 1; + digitBuf[2] = 1; } - KaleidoScope_DrawDigit(play, spD8[2], spD8[1], 149); + KaleidoScope_DrawDigit(play, digitBuf[2], digitBuf[1], 149); } // Songs - for (spD8[1] = 78, i = 0; i < 12; i++, spD8[1] += 12) { - spD8[2] = 0; + for (digitBuf[1] = 78, i = 0; i < 12; i++, digitBuf[1] += 12) { + digitBuf[2] = 0; if (CHECK_QUEST_ITEM(QUEST_SONG_MINUET + i)) { - spD8[2] = 1; + digitBuf[2] = 1; } - KaleidoScope_DrawDigit(play, spD8[2], spD8[1], 166); + KaleidoScope_DrawDigit(play, digitBuf[2], digitBuf[1], 166); } // Other Quest Items - for (spD8[1] = 78, i = 0; i < 2; i++, spD8[1] += 12) { - spD8[2] = 0; + for (digitBuf[1] = 78, i = 0; i < 2; i++, digitBuf[1] += 12) { + digitBuf[2] = 0; if (CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY + i)) { - spD8[2] = 1; + digitBuf[2] = 1; } - KaleidoScope_DrawDigit(play, spD8[2], spD8[1], 185); + KaleidoScope_DrawDigit(play, digitBuf[2], digitBuf[1], 185); } // GS Tokens - spD8[3] = gSaveContext.save.info.inventory.gsTokens; - spD8[1] = 0; - spD8[2] = 0; - while (spD8[3] >= 100) { - spD8[1]++; - spD8[3] -= 100; + digitBuf[3] = gSaveContext.save.info.inventory.gsTokens; + digitBuf[1] = 0; + digitBuf[2] = 0; + while (digitBuf[3] >= 100) { + digitBuf[1]++; + digitBuf[3] -= 100; } - while (spD8[3] >= 10) { - spD8[2]++; - spD8[3] -= 10; + while (digitBuf[3] >= 10) { + digitBuf[2]++; + digitBuf[3] -= 10; } - KaleidoScope_DrawDigit(play, spD8[1], 145, 185); - KaleidoScope_DrawDigit(play, spD8[2], 155, 185); - KaleidoScope_DrawDigit(play, spD8[3], 165, 185); + KaleidoScope_DrawDigit(play, digitBuf[1], 145, 185); + KaleidoScope_DrawDigit(play, digitBuf[2], 155, 185); + KaleidoScope_DrawDigit(play, digitBuf[3], 165, 185); // Heart Pieces (X / 4) KaleidoScope_DrawDigit( @@ -340,18 +472,18 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } curSection = sRowFirstSections[curRow]; } else if (CHECK_BTN_ANY(dBtnInput, BTN_DLEFT)) { - if (--curSection < 0) { - curSection = 0x5C; + if (--curSection < SECTION_RUPEES) { + curSection = SECTION_HEART_PIECES; } } else if (CHECK_BTN_ANY(dBtnInput, BTN_DRIGHT)) { - if (++curSection > 0x5C) { - curSection = 0; + if (++curSection > SECTION_HEART_PIECES) { + curSection = SECTION_RUPEES; } } // Handles the logic to change values based on the selected section switch (curSection) { - case 0: + case SECTION_RUPEES: if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) { gSaveContext.save.info.playerData.rupees -= 100; if (gSaveContext.save.info.playerData.rupees < 0) { @@ -375,7 +507,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } break; - case 1: + case SECTION_HEALTH_CAPACITY: if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { gSaveContext.save.info.playerData.healthCapacity -= 0x10; if (gSaveContext.save.info.playerData.healthCapacity < 0x30) { @@ -390,7 +522,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } break; - case 2: + case SECTION_CURRENT_HEALTH: if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { Health_ChangeBy(play, -4); } else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { @@ -402,7 +534,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } break; - case 0x5C: + case SECTION_HEART_PIECES: if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { if ((((gSaveContext.save.info.inventory.questItems & 0xF0000000) & 0xF0000000) >> QUEST_HEART_PIECE_COUNT) != 0) { @@ -417,8 +549,8 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { break; default: - if (curSection < 0x1B) { - i = curSection - 3; + if (curSection <= SECTION_LAST_INVENTORY_SLOT) { + i = curSection - SECTION_FIRST_INVENTORY_SLOT; if ((i <= SLOT_BOW) || (i == SLOT_SLINGSHOT) || (i == SLOT_BOMBCHU) || (i == SLOT_MAGIC_BEAN)) { if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) { Inventory_DeleteItem(gAmmoItems[i], SLOT(gAmmoItems[i])); @@ -551,16 +683,16 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } } } - } else if (curSection < 0x2C) { + } else if (curSection <= SECTION_LAST_KEY_COUNT) { if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { - i = curSection - 0x1B; + i = curSection - SECTION_FIRST_KEY_COUNT; gSaveContext.save.info.inventory.dungeonKeys[i]--; if (gSaveContext.save.info.inventory.dungeonKeys[i] < 0) { gSaveContext.save.info.inventory.dungeonKeys[i] = -1; } } else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) || CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { - i = curSection - 0x1B; + i = curSection - SECTION_FIRST_KEY_COUNT; if (gSaveContext.save.info.inventory.dungeonKeys[i] < 0) { gSaveContext.save.info.inventory.dungeonKeys[i] = 1; } else { @@ -571,9 +703,9 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } } } else { - if (curSection < 0x38) { - i = curSection - 0x2C; - if ((curSection >= 0x2C) && (curSection < 0x34)) { + if (curSection <= SECTION_LAST_EQUIPMENT) { + i = curSection - SECTION_FIRST_UPGRADE; + if ((curSection >= SECTION_FIRST_UPGRADE) && (curSection <= SECTION_LAST_UPGRADE)) { if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { if (CUR_UPG_VALUE(i) != 0) { @@ -586,7 +718,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { } } } else { - i = curSection - 0x34; // 0 <= i < 4 + i = curSection - SECTION_FIRST_EQUIPMENT; // 0 <= i < 4 if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 0); } @@ -600,8 +732,8 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(i, 3); } } - } else if (curSection < 0x44) { - i = curSection - 0x38; + } else if (curSection <= SECTION_LAST_DUNGEON_ITEMS) { + i = curSection - SECTION_FIRST_DUNGEON_ITEMS; if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { gSaveContext.save.info.inventory.dungeonItems[i] ^= 4; } @@ -611,7 +743,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { gSaveContext.save.info.inventory.dungeonItems[i] ^= 1; } - } else if (curSection == 0x5B) { + } else if (curSection == SECTION_SKULL_TOKENS) { if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { gSaveContext.save.info.inventory.gsTokens++; #if PLATFORM_N64 @@ -626,8 +758,8 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { gSaveContext.save.info.inventory.gsTokens = 0; } } - } else if (curSection < 0x5C) { - i = curSection - 0x44; + } else if (curSection < SECTION_HEART_PIECES) { + i = curSection - SECTION_FIRST_MEDALLION; if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { gSaveContext.save.info.inventory.questItems ^= gBitFlags[i]; } @@ -642,23 +774,28 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { gDPSetCombineMode(POLY_OPA_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 200, 120); - if (curSection == 0) { + if (curSection == SECTION_RUPEES) { + // 4 digit long box gDPFillRectangle(POLY_OPA_DISP++, sSectionPositions[curSection][0], sSectionPositions[curSection][1], sSectionPositions[curSection][0] + 45, sSectionPositions[curSection][1] + 16); - } else if ((curSection >= 0x1B) || (curSection == 0x5B)) { + } else if ((curSection >= SECTION_FIRST_KEY_COUNT) || (curSection == SECTION_SKULL_TOKENS)) { + // 1 digit long box gDPFillRectangle(POLY_OPA_DISP++, sSectionPositions[curSection][0] - 2, sSectionPositions[curSection][1], sSectionPositions[curSection][0] + 14, sSectionPositions[curSection][1] + 16); } else { + // 2 digit long box gDPFillRectangle(POLY_OPA_DISP++, sSectionPositions[curSection][0] - 4, sSectionPositions[curSection][1], sSectionPositions[curSection][0] + 24, sSectionPositions[curSection][1] + 16); } // Handles exiting the inventory editor with the L button - // The editor is opened with `debugState` set to 1, and becomes closable after a frame once `debugState` is set to 2 - if (pauseCtx->debugState == 1) { - pauseCtx->debugState = 2; - } else if ((pauseCtx->debugState == 2) && CHECK_BTN_ALL(input->press.button, BTN_L)) { - pauseCtx->debugState = 0; + // The editor is opened with `debugState` set to PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPENING, + // and becomes closable after a frame once `debugState` is set to PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPEN + if (pauseCtx->debugState == PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPENING) { + pauseCtx->debugState = PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPEN; + } else if ((pauseCtx->debugState == PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPEN) && + CHECK_BTN_ALL(input->press.button, BTN_L)) { + pauseCtx->debugState = PAUSE_DEBUG_STATE_CLOSED; } CLOSE_DISPS(play->state.gfxCtx, "../z_kaleido_debug.c", 861); 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 8a8b627995..1f573ca3e3 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -3,27 +3,71 @@ #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 "translation.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/textures/icon_item_static/icon_item_static.h" #include "assets/textures/parameter_static/parameter_static.h" -static u8 sChildUpgrades[] = { UPG_BULLET_BAG, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE }; -static u8 sAdultUpgrades[] = { UPG_QUIVER, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE }; +static u8 sChildUpgrades[] = { + UPG_BULLET_BAG, // EQUIP_QUAD_UPG_BULLETBAG_QUIVER + UPG_BOMB_BAG, // EQUIP_QUAD_UPG_BOMB_BAG + UPG_STRENGTH, // EQUIP_QUAD_UPG_STRENGTH + UPG_SCALE, // EQUIP_QUAD_UPG_SCALE +}; +static u8 sAdultUpgrades[] = { + UPG_QUIVER, // EQUIP_QUAD_UPG_BULLETBAG_QUIVER + UPG_BOMB_BAG, // EQUIP_QUAD_UPG_BOMB_BAG + UPG_STRENGTH, // EQUIP_QUAD_UPG_STRENGTH + UPG_SCALE, // EQUIP_QUAD_UPG_SCALE +}; -static u8 sChildUpgradeItemBases[] = { ITEM_BULLET_BAG_30, ITEM_BOMB_BAG_20, ITEM_STRENGTH_GORONS_BRACELET, - ITEM_SCALE_SILVER }; -static u8 sAdultUpgradeItemBases[] = { ITEM_QUIVER_30, ITEM_BOMB_BAG_20, ITEM_STRENGTH_GORONS_BRACELET, - ITEM_SCALE_SILVER }; +static u8 sChildUpgradeItemBases[] = { + ITEM_BULLET_BAG_30, // EQUIP_QUAD_UPG_BULLETBAG_QUIVER + ITEM_BOMB_BAG_20, // EQUIP_QUAD_UPG_BOMB_BAG + ITEM_STRENGTH_GORONS_BRACELET, // EQUIP_QUAD_UPG_STRENGTH + ITEM_SCALE_SILVER, // EQUIP_QUAD_UPG_SCALE +}; +static u8 sAdultUpgradeItemBases[] = { + ITEM_QUIVER_30, // EQUIP_QUAD_UPG_BULLETBAG_QUIVER + ITEM_BOMB_BAG_20, // EQUIP_QUAD_UPG_BOMB_BAG + ITEM_STRENGTH_GORONS_BRACELET, // EQUIP_QUAD_UPG_STRENGTH + ITEM_SCALE_SILVER, // EQUIP_QUAD_UPG_SCALE +}; -static u8 sUpgradeItemOffsets[] = { 0x00, 0x03, 0x06, 0x09 }; +static u8 sUpgradeItemOffsets[] = { + 0, // unused + ITEM_BOMB_BAG_20 - ITEM_QUIVER_30, // UPG_BOMB_BAG + ITEM_STRENGTH_GORONS_BRACELET - ITEM_QUIVER_30, // UPG_STRENGTH + ITEM_SCALE_SILVER - ITEM_QUIVER_30, // UPG_SCALE +}; static u8 sEquipmentItemOffsets[] = { - 0x00, 0x00, 0x01, 0x02, 0x00, 0x03, 0x04, 0x05, 0x00, 0x06, 0x07, 0x08, 0x00, 0x09, 0x0A, 0x0B, + // EQUIP_TYPE_SWORD + 0, // unused + ITEM_SWORD_KOKIRI - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SWORD_KOKIRI + ITEM_SWORD_MASTER - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SWORD_MASTER + ITEM_SWORD_BIGGORON - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SWORD_BIGGORON + // EQUIP_TYPE_SHIELD + 0, // unused + ITEM_SHIELD_DEKU - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SHIELD_DEKU + ITEM_SHIELD_HYLIAN - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SHIELD_HYLIAN + ITEM_SHIELD_MIRROR - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SHIELD_MIRROR + // EQUIP_TYPE_TUNIC + 0, // unused + ITEM_TUNIC_KOKIRI - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_TUNIC_KOKIRI + ITEM_TUNIC_GORON - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_TUNIC_GORON + ITEM_TUNIC_ZORA - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_TUNIC_ZORA + // EQUIP_TYPE_BOOTS + 0, // unused + ITEM_BOOTS_KOKIRI - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_BOOTS_KOKIRI + ITEM_BOOTS_IRON - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_BOOTS_IRON + ITEM_BOOTS_HOVER - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_BOOTS_HOVER }; void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u32 height) { @@ -45,15 +89,15 @@ void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); curTexture = source; - remainingSize = width * height * 2; - textureHeight = 4096 / (width * 2); - textureSize = width * textureHeight * 2; + remainingSize = width * height * G_IM_SIZ_16b_BYTES; + textureHeight = TMEM_SIZE / (width * G_IM_SIZ_16b_BYTES); + textureSize = width * textureHeight * G_IM_SIZ_16b_BYTES; textureCount = remainingSize / textureSize; if ((remainingSize % textureSize) != 0) { textureCount += 1; } - vtxIndex = 80; + vtxIndex = EQUIP_QUAD_PLAYER_FIRST * 4; gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, width - 1, textureHeight - 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -75,7 +119,7 @@ void KaleidoScope_DrawEquipmentImage(PlayState* play, void* source, u32 width, u if ((remainingSize - textureSize) < 0) { if (remainingSize > 0) { - textureHeight = remainingSize / (s32)(width * 2); + textureHeight = remainingSize / (s32)(width * G_IM_SIZ_16b_BYTES); remainingSize -= textureSize; gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, width - 1, textureHeight - 1, 0, @@ -124,8 +168,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; @@ -153,7 +199,9 @@ void KaleidoScope_DrawEquipment(PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, ZREG(39), ZREG(40), ZREG(41), pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, ZREG(43), ZREG(44), ZREG(45), 0); - for (i = 0, j = 64; i < 4; i++, j += 4) { + // Draw EQUIP_QUAD_SELECTED_SWORD, EQUIP_QUAD_SELECTED_SHIELD, EQUIP_QUAD_SELECTED_TUNIC, EQUIP_QUAD_SELECTED_BOOTS + + for (i = 0, j = EQUIP_QUAD_SELECTED_SWORD * 4; i < EQUIP_TYPE_MAX; i++, j += 4) { if (CUR_EQUIP_VALUE(i) != 0) { gDPPipeSync(POLY_OPA_DISP++); gSPVertex(POLY_OPA_DISP++, &pauseCtx->equipVtx[j], 4, 0); @@ -167,6 +215,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { oldCursorPoint = pauseCtx->cursorPoint[PAUSE_EQUIP]; pauseCtx->cursorColorSet = 0; + // Handle moving the cursor with stick input + if (pauseCtx->cursorSpecialPos == 0) { pauseCtx->nameColorSet = 0; @@ -182,12 +232,13 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorMoveResult = 0; do { if (pauseCtx->stickAdjX < -30) { - if (pauseCtx->cursorX[PAUSE_EQUIP] != 0) { + if (pauseCtx->cursorX[PAUSE_EQUIP] != EQUIP_CURSOR_X_UPG) { pauseCtx->cursorX[PAUSE_EQUIP]--; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 1; - if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { - if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { + if (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_CURSOR_X_UPG) { + if (pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_CURSOR_Y_BULLETBAG_QUIVER) { + //! @bug Assumes adult always has bullet bag (as adult this should rely on `UPG_QUIVER`) if (CUR_UPG_VALUE(UPG_BULLET_BAG) != 0) { cursorMoveResult = 1; } @@ -229,7 +280,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { pauseCtx->cursorX[PAUSE_EQUIP]++; pauseCtx->cursorPoint[PAUSE_EQUIP] += 1; - if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { + if (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_CURSOR_X_UPG) { if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { cursorMoveResult = 1; } @@ -276,17 +327,21 @@ void KaleidoScope_DrawEquipment(PlayState* play) { pauseCtx->cursorY[PAUSE_EQUIP]--; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 4; - if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { - if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { + if (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_CURSOR_X_UPG) { + if (pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_CURSOR_Y_BULLETBAG_QUIVER) { if (CUR_UPG_VALUE(UPG_BULLET_BAG) != 0) { cursorMoveResult = 1; } - } else if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { - cursorMoveResult = 1; + } else { + if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { + cursorMoveResult = 1; + } + } + } else { + if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & + gSaveContext.save.info.inventory.equipment) { + cursorMoveResult = 2; } - } else if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & - gSaveContext.save.info.inventory.equipment) { - cursorMoveResult = 2; } } else { pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; @@ -298,13 +353,15 @@ void KaleidoScope_DrawEquipment(PlayState* play) { pauseCtx->cursorY[PAUSE_EQUIP]++; pauseCtx->cursorPoint[PAUSE_EQUIP] += 4; - if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { + if (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_CURSOR_X_UPG) { if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { cursorMoveResult = 1; } - } else if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & - gSaveContext.save.info.inventory.equipment) { - cursorMoveResult = 2; + } else { + if (gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & + gSaveContext.save.info.inventory.equipment) { + cursorMoveResult = 2; + } } } else { pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; @@ -325,25 +382,29 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorPoint = cursorX = cursorY = 0; while (true) { - if (cursorX == 0) { - if (cursorY == 0) { + if (cursorX == EQUIP_CURSOR_X_UPG) { + if (cursorY == EQUIP_CURSOR_Y_BULLETBAG_QUIVER) { if (CUR_UPG_VALUE(UPG_BULLET_BAG) != 0) { pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; break; } - } else if (CUR_UPG_VALUE(cursorY) != 0) { + } else { + if (CUR_UPG_VALUE(cursorY) != 0) { + pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; + pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; + pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; + break; + } + } + } else { + if (gBitFlags[cursorPoint - 1] & gSaveContext.save.info.inventory.equipment) { pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; break; } - } else if (gBitFlags[cursorPoint - 1] & gSaveContext.save.info.inventory.equipment) { - pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; - pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; - pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; - break; } cursorY = cursorY + 1; @@ -359,7 +420,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } } - } else { + } else { // cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT if (pauseCtx->stickAdjX < -30) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -369,18 +430,20 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorPoint = cursorX = 3; cursorY = 0; while (true) { - if (cursorX == 0) { + if (cursorX == EQUIP_CURSOR_X_UPG) { if (CUR_UPG_VALUE(cursorY) != 0) { pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; break; } - } else if (gBitFlags[cursorPoint - 1] & gSaveContext.save.info.inventory.equipment) { - pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; - pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; - pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; - break; + } else { + if (gBitFlags[cursorPoint - 1] & gSaveContext.save.info.inventory.equipment) { + pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; + pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; + pauseCtx->cursorY[PAUSE_EQUIP] = cursorY; + break; + } } cursorY = cursorY + 1; @@ -398,11 +461,14 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } - if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { + // set cursorItem + + if (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_CURSOR_X_UPG) { pauseCtx->cursorColorSet = 0; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - if ((pauseCtx->cursorY[PAUSE_EQUIP] == 0) && (CUR_UPG_VALUE(UPG_BULLET_BAG) != 0)) { + if ((pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_CURSOR_Y_BULLETBAG_QUIVER) && + (CUR_UPG_VALUE(UPG_BULLET_BAG) != 0)) { cursorItem = ITEM_BULLET_BAG_30 + CUR_UPG_VALUE(UPG_BULLET_BAG) - 1; } else { cursorItem = ITEM_QUIVER_30 + sUpgradeItemOffsets[pauseCtx->cursorY[PAUSE_EQUIP]] + @@ -410,12 +476,15 @@ void KaleidoScope_DrawEquipment(PlayState* play) { PRINTF("H_arrowcase_1 + non_equip_item_table = %d\n", cursorItem); } } else { - if ((pauseCtx->cursorY[PAUSE_EQUIP] == 0) && (CUR_UPG_VALUE(UPG_QUIVER) == 0)) { + if ((pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_CURSOR_Y_BULLETBAG_QUIVER) && + (CUR_UPG_VALUE(UPG_QUIVER) == 0)) { cursorItem = ITEM_BULLET_BAG_30 + CUR_UPG_VALUE(UPG_BULLET_BAG) - 1; } else { cursorItem = ITEM_QUIVER_30 + sUpgradeItemOffsets[pauseCtx->cursorY[PAUSE_EQUIP]] + CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) - 1; - PRINTF("大人 H_arrowcase_1 + non_equip_item_table = %d\n", cursorItem); + PRINTF(T("大人 H_arrowcase_1 + non_equip_item_table = %d\n", + "Adult H_arrowcase_1 + non_equip_item_table = %d\n"), + cursorItem); } } } else { @@ -427,8 +496,9 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } - if ((pauseCtx->cursorY[PAUSE_EQUIP] == 0) && (pauseCtx->cursorX[PAUSE_EQUIP] == 3)) { - if (gSaveContext.save.info.playerData.bgsFlag != 0) { + if ((pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_TYPE_SWORD) && + (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_VALUE_SWORD_BIGGORON)) { + if (gSaveContext.save.info.playerData.bgsFlag) { cursorItem = ITEM_HEART_PIECE_2; } else if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { cursorItem = ITEM_GIANTS_KNIFE; @@ -442,6 +512,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { PRINTF("kscope->select_name[Display_Equipment] = %d\n", pauseCtx->cursorItem[PAUSE_EQUIP]); + // Handle age particularities + if (!CHECK_AGE_REQ_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP])) { pauseCtx->nameColorSet = 1; } @@ -454,7 +526,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } - if ((pauseCtx->cursorX[PAUSE_EQUIP] == 0) && (pauseCtx->cursorY[PAUSE_EQUIP] == 0)) { + if ((pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_CURSOR_X_UPG) && + (pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_CURSOR_Y_BULLETBAG_QUIVER)) { if (LINK_AGE_IN_YEARS != YEARS_CHILD) { if ((cursorItem >= ITEM_BULLET_BAG_30) && (cursorItem <= ITEM_BULLET_BAG_50)) { pauseCtx->nameColorSet = 1; @@ -466,20 +539,25 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + // Set cursor position + KaleidoScope_SetCursorPos(pauseCtx, cursorSlot * 4, pauseCtx->equipVtx); + // Handle input for changing equipment + if ((pauseCtx->cursorSpecialPos == 0) && (cursorItem != PAUSE_ITEM_NONE) && (pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && - CHECK_BTN_ALL(input->press.button, BTN_A) && (pauseCtx->cursorX[PAUSE_EQUIP] != 0)) { + CHECK_BTN_ALL(input->press.button, BTN_A) && (pauseCtx->cursorX[PAUSE_EQUIP] != EQUIP_CURSOR_X_UPG)) { if (CHECK_AGE_REQ_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP])) { Inventory_ChangeEquipment(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP]); - if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { + if (pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_TYPE_SWORD) { gSaveContext.save.info.infTable[INFTABLE_INDEX_1DX] = 0; gSaveContext.save.info.equips.buttonItems[0] = cursorItem; - if ((pauseCtx->cursorX[PAUSE_EQUIP] == 3) && (gSaveContext.save.info.playerData.bgsFlag != 0)) { + if ((pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_VALUE_SWORD_BIGGORON) && + gSaveContext.save.info.playerData.bgsFlag) { gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON; gSaveContext.save.info.playerData.swordHealth = 8; } else { @@ -487,8 +565,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON; } if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_SWORD_BIGGORON) && - - (gSaveContext.save.info.playerData.bgsFlag == 0) && + !gSaveContext.save.info.playerData.bgsFlag && CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { gSaveContext.save.info.equips.buttonItems[0] = ITEM_GIANTS_KNIFE; } @@ -499,7 +576,9 @@ void KaleidoScope_DrawEquipment(PlayState* play) { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - pauseCtx->mainState = PAUSE_MAIN_STATE_7; + + // Wait 10 frames before accepting input again + pauseCtx->mainState = PAUSE_MAIN_STATE_EQUIP_CHANGED; sEquipTimer = 10; } else { Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -511,7 +590,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_7) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { + } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_CHANGED) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { KaleidoScope_SetCursorPos(pauseCtx, pauseCtx->cursorSlot[PAUSE_EQUIP] * 4, pauseCtx->equipVtx); pauseCtx->cursorColorSet = 8; @@ -521,13 +600,19 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } - for (rowStart = 0, i = 0, point = 4; i < 4; i++, rowStart += 4, point += 16) { + // Enlarge the equip item at the current cursor position, if it can be equipped + // for each row (one row per equip type) + for (rowStart = 0, i = 0, point = EQUIP_QUAD_SWORD_KOKIRI * 4; i < EQUIP_TYPE_MAX; + i++, rowStart += 4, point += 4 * 4) { + + // for each equip column for (k = 0, temp = rowStart + 1, bit = rowStart, j = point; k < 3; k++, bit++, j += 4, temp++) { if ((gBitFlags[bit] & gSaveContext.save.info.inventory.equipment) && (pauseCtx->cursorSpecialPos == 0)) { if (CHECK_AGE_REQ_EQUIP(i, k + 1)) { if (temp == cursorSlot) { + pauseCtx->equipVtx[j].v.ob[0] = pauseCtx->equipVtx[j + 2].v.ob[0] = pauseCtx->equipVtx[j].v.ob[0] - 2; pauseCtx->equipVtx[j + 1].v.ob[0] = pauseCtx->equipVtx[j + 3].v.ob[0] = @@ -542,13 +627,19 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + // Draw upgrades and equips + Gfx_SetupDL_42Opa(play->state.gfxCtx); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - for (rowStart = 0, j = 0, temp = 0, i = 0; i < 4; i++, rowStart += 4, j += 16) { - gSPVertex(POLY_OPA_DISP++, &pauseCtx->equipVtx[j], 16, 0); + // for each row + for (rowStart = 0, j = 0, temp = 0, i = 0; i < 4; i++, rowStart += 4, j += 4 * 4) { + gSPVertex(POLY_OPA_DISP++, &pauseCtx->equipVtx[j], 4 * 4, 0); + + // Draw upgrade `i` + // EQUIP_QUAD_UPG_BULLETBAG_QUIVER, EQUIP_QUAD_UPG_BOMB_BAG, EQUIP_QUAD_UPG_STRENGTH, EQUIP_QUAD_UPG_SCALE if (LINK_AGE_IN_YEARS == YEARS_CHILD) { point = CUR_UPG_VALUE(sChildUpgrades[i]); @@ -559,6 +650,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } else { if ((i == 0) && (CUR_UPG_VALUE(sAdultUpgrades[i]) == 0)) { + // Show bullet bag instead of quiver if player has no quiver + //! @bug This assumes adult always has bullet bag KaleidoScope_DrawQuadTextureRGBA32( play->state.gfxCtx, gItemIcons[sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1], ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, 0); @@ -569,12 +662,20 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + // Draw owned equips of type `i` + // EQUIP_QUAD_SWORD_KOKIRI, EQUIP_QUAD_SWORD_MASTER, EQUIP_QUAD_SWORD_BIGGORON + // EQUIP_QUAD_SHIELD_DEKU, EQUIP_QUAD_SHIELD_HYLIAN, EQUIP_QUAD_SHIELD_MIRROR + // EQUIP_QUAD_TUNIC_KOKIRI, EQUIP_QUAD_TUNIC_GORON, EQUIP_QUAD_TUNIC_ZORA + // EQUIP_QUAD_BOOTS_KOKIRI, EQUIP_QUAD_BOOTS_IRON, EQUIP_QUAD_BOOTS_HOVER + for (k = 0, bit = rowStart, point = 4; k < 3; k++, point += 4, temp++, bit++) { - if (((u32)i == 0) && (k == 2) && (gSaveContext.save.info.playerData.bgsFlag != 0)) { + if (((u32)i == EQUIP_TYPE_SWORD) && (k == EQUIP_INV_SWORD_BIGGORON) && + gSaveContext.save.info.playerData.bgsFlag) { KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconSwordBiggoronTex, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, point); - } else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.save.info.inventory.equipment)) { + } else if ((i == EQUIP_TYPE_SWORD) && (k == EQUIP_INV_SWORD_BIGGORON) && + (gBitFlags[bit + 1] & gSaveContext.save.info.inventory.equipment)) { KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconBrokenGiantsKnifeTex, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, point); } else if (gBitFlags[bit] & gSaveContext.save.info.inventory.equipment) { @@ -584,15 +685,21 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } + // Draw player to the player prerender buffer + KaleidoScope_DrawPlayerWork(play); - if ((pauseCtx->mainState == PAUSE_MAIN_STATE_7) && (sEquipTimer == 10)) { + if ((pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_CHANGED) && (sEquipTimer == 10)) { KaleidoScope_SetupPlayerPreRender(play); } - if ((pauseCtx->mainState == PAUSE_MAIN_STATE_7) && (sEquipTimer == 9)) { + 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); @@ -602,6 +709,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x0B, interfaceCtx->mapSegment); gSPSegment(POLY_OPA_DISP++, 0x0C, pauseCtx->iconItemAltSegment); + // Draw player prerender onto the equip page + Gfx_SetupDL_42Opa(play->state.gfxCtx); KaleidoScope_DrawEquipmentImage(play, pauseCtx->playerSegment, PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT); 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 e76c6a7cea..eb4d7e3c7a 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -4,10 +4,12 @@ #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 "translation.h" +#include "play_state.h" +#include "save.h" #include "assets/textures/parameter_static/parameter_static.h" @@ -383,7 +385,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { index = cursorSlot * 4; // required to match? KaleidoScope_SetCursorPos(pauseCtx, index, pauseCtx->itemVtx); - if ((pauseCtx->debugState == 0) && (pauseCtx->state == PAUSE_STATE_MAIN) && + if ((pauseCtx->debugState == PAUSE_DEBUG_STATE_CLOSED) && (pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE)) { if (CHECK_BTN_ANY(input->press.button, BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { if (CHECK_AGE_REQ_SLOT(cursorSlot) && (cursorItem != ITEM_SOLD_OUT)) { @@ -696,19 +698,19 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.cButtonSlots[0] = pauseCtx->equipTargetSlot; Interface_LoadItemIcon1(play, 1); - PRINTF("C左sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); - PRINTF("C左sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + PRINTF(T("C左sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", "C left sl_item_no=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetItem, gSaveContext.save.info.equips.buttonItems[1], + gSaveContext.save.info.equips.buttonItems[2], gSaveContext.save.info.equips.buttonItems[3]); + PRINTF(T("C左sl_number=%d (1)=%d (2)=%d (3)=%d\n", "C left sl_number=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[0], + gSaveContext.save.info.equips.cButtonSlots[1], gSaveContext.save.info.equips.cButtonSlots[2]); } else if (pauseCtx->equipTargetCBtn == 1) { - PRINTF("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); - PRINTF("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + PRINTF(T("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", "C down sl_item_no=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetItem, gSaveContext.save.info.equips.buttonItems[1], + gSaveContext.save.info.equips.buttonItems[2], gSaveContext.save.info.equips.buttonItems[3]); + PRINTF(T("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", "C down sl_number=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[0], + gSaveContext.save.info.equips.cButtonSlots[1], gSaveContext.save.info.equips.cButtonSlots[2]); if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[0]) { if (gSaveContext.save.info.equips.buttonItems[2] != ITEM_NONE) { @@ -771,19 +773,19 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.cButtonSlots[1] = pauseCtx->equipTargetSlot; Interface_LoadItemIcon1(play, 2); - PRINTF("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); - PRINTF("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + PRINTF(T("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", "C down sl_item_no=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetItem, gSaveContext.save.info.equips.buttonItems[1], + gSaveContext.save.info.equips.buttonItems[2], gSaveContext.save.info.equips.buttonItems[3]); + PRINTF(T("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", "C down sl_number=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[0], + gSaveContext.save.info.equips.cButtonSlots[1], gSaveContext.save.info.equips.cButtonSlots[2]); } else { - PRINTF("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); - PRINTF("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + PRINTF(T("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", "C right sl_item_no=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetItem, gSaveContext.save.info.equips.buttonItems[1], + gSaveContext.save.info.equips.buttonItems[2], gSaveContext.save.info.equips.buttonItems[3]); + PRINTF(T("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", "C right sl_number=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[0], + gSaveContext.save.info.equips.cButtonSlots[1], gSaveContext.save.info.equips.cButtonSlots[2]); if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[0]) { if (gSaveContext.save.info.equips.buttonItems[3] != ITEM_NONE) { @@ -846,12 +848,12 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.cButtonSlots[2] = pauseCtx->equipTargetSlot; Interface_LoadItemIcon1(play, 3); - PRINTF("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); - PRINTF("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + PRINTF(T("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", "C right sl_item_no=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetItem, gSaveContext.save.info.equips.buttonItems[1], + gSaveContext.save.info.equips.buttonItems[2], gSaveContext.save.info.equips.buttonItems[3]); + PRINTF(T("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", "C right sl_number=%d (1)=%d (2)=%d (3)=%d\n"), + pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[0], + gSaveContext.save.info.equips.cButtonSlots[1], gSaveContext.save.info.equips.cButtonSlots[2]); } pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; 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 09a85cb039..00c57579b0 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -2,15 +2,15 @@ #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 "global.h" +#include "play_state.h" +#include "save.h" #include "assets/textures/icon_item_24_static/icon_item_24_static.h" #if OOT_NTSC 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 6264c4147c..265a122116 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c @@ -3,7 +3,7 @@ #include "libu64/pad.h" #include "regs.h" #include "sfx.h" -#include "z64play.h" +#include "play_state.h" static s16 sKaleidoPromptCursorAlphaVals[] = { 100, 255 }; 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 5c0bfab0d3..2a76a40fa2 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1,13 +1,17 @@ #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 "printf.h" #include "regs.h" #include "segment_symbols.h" #include "segmented_address.h" @@ -16,14 +20,13 @@ #include "sys_matrix.h" #include "terminal.h" #include "title_setup_state.h" +#include "translation.h" #include "versions.h" -#include "z64audio.h" -#include "z64ocarina.h" -#include "z64play.h" -#include "z64player.h" -#include "z64save.h" - -#include "global.h" +#include "audio.h" +#include "ocarina.h" +#include "play_state.h" +#include "player.h" +#include "save.h" #include "assets/textures/icon_item_static/icon_item_static.h" #include "assets/textures/icon_item_24_static/icon_item_24_static.h" @@ -37,7 +40,8 @@ #endif #include "assets/textures/icon_item_gameover_static/icon_item_gameover_static.h" -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 ntsc-1.0:0 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:0 pal-1.1:0" +#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 @@ -1099,9 +1103,9 @@ void KaleidoScope_SetupPageSwitch(PauseContext* pauseCtx, u8 pt) { } void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { - if ((pauseCtx->debugState == 0) && CHECK_BTN_ALL(input->press.button, BTN_L)) { + if ((pauseCtx->debugState == PAUSE_DEBUG_STATE_CLOSED) && CHECK_BTN_ALL(input->press.button, BTN_L)) { #if DEBUG_FEATURES - pauseCtx->debugState = 1; + pauseCtx->debugState = PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPENING; #endif return; } @@ -1166,9 +1170,9 @@ void KaleidoScope_DrawCursor(PlayState* play, u16 pageIndex) { gSPVertex(POLY_OPA_DISP++, pauseCtx->cursorVtx, 16, 0); for (i = j = 0; i < 4; i++, j += 4) { - gDPLoadTextureBlock_4b(POLY_OPA_DISP++, sCursorTexs[i], G_IM_FMT_IA, 16, 16, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(POLY_OPA_DISP++, sCursorTexs[i], G_IM_FMT_IA, PAUSE_MENU_CURSOR_CORNER_TEX_WIDTH, + PAUSE_MENU_CURSOR_CORNER_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0); } } @@ -1873,13 +1877,14 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { (pauseCtx->nameDisplayTimer < WREG(89)) && (((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK) || - ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && (pauseCtx->mainState <= PAUSE_MAIN_STATE_7)) || + ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && + (pauseCtx->mainState <= PAUSE_MAIN_STATE_EQUIP_CHANGED)) || (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) && (pauseCtx->cursorSpecialPos == 0)) { if (((u32)pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK) || ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && - (pauseCtx->mainState <= PAUSE_MAIN_STATE_7)) || + (pauseCtx->mainState <= PAUSE_MAIN_STATE_EQUIP_CHANGED)) || (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = -63; @@ -1906,8 +1911,9 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { if (pauseCtx->pageIndex == PAUSE_MAP) { if (YREG(7) != 0) { PRINTF_COLOR_YELLOW(); - PRINTF("キンスタ数(%d) Get_KIN_STA=%x (%x) (%x)\n", YREG(6), GET_GS_FLAGS(YREG(6)), - gAreaGsFlags[YREG(6)], gSaveContext.save.info.gsFlags[YREG(6) >> 2]); + PRINTF(T("キンスタ数(%d) Get_KIN_STA=%x (%x) (%x)\n", "Kinsta Count(%d) Get_KIN_STA=%x (%x) (%x)\n"), + YREG(6), GET_GS_FLAGS(YREG(6)), gAreaGsFlags[YREG(6)], + gSaveContext.save.info.gsFlags[YREG(6) >> 2]); PRINTF_RST(); YREG(7) = 0; @@ -1946,7 +1952,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { QUEST_ICON_HEIGHT, 0); } } - } else if ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_7) || + } else if ((pauseCtx->mainState < PAUSE_MAIN_STATE_3) || (pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_CHANGED) || (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) { pauseCtx->infoPanelVtx[20].v.ob[1] = pauseCtx->infoPanelVtx[21].v.ob[1] = temp; @@ -2153,7 +2159,7 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) { ((pauseCtx->cursorSlot[PAUSE_QUEST] >= 6) && (pauseCtx->cursorSlot[PAUSE_QUEST] <= 0x11)) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) || (pauseCtx->pageIndex == PAUSE_ITEM) || - ((pauseCtx->pageIndex == PAUSE_EQUIP) && (pauseCtx->cursorX[PAUSE_EQUIP] != 0))) { + ((pauseCtx->pageIndex == PAUSE_EQUIP) && (pauseCtx->cursorX[PAUSE_EQUIP] != EQUIP_CURSOR_X_UPG))) { if (pauseCtx->namedItem != ITEM_SOLD_OUT) { pauseCtx->nameDisplayTimer++; if (pauseCtx->nameDisplayTimer > WREG(88)) { @@ -2688,9 +2694,14 @@ static s16 sItemVtxQuadsWithAmmo[] = { SLOT_MAGIC_BEAN * 4, // ITEM_QUAD_AMMO_BEAN_ }; -static s16 D_8082B12C[] = { -114, 12, 44, 76 }; +static s16 sEquipColumnsX[] = { -114, 12, 44, 76 }; -static u8 D_8082B134[] = { 1, 5, 9, 13 }; +static u8 sEquipQuadsFirstByEquipType[EQUIP_TYPE_MAX] = { + EQUIP_QUAD_SWORD_KOKIRI, // EQUIP_TYPE_SWORD + EQUIP_QUAD_SHIELD_DEKU, // EQUIP_TYPE_SHIELD + EQUIP_QUAD_TUNIC_KOKIRI, // EQUIP_TYPE_TUNIC + EQUIP_QUAD_BOOTS_KOKIRI, // EQUIP_TYPE_BOOTS +}; static s16 sQuestQuadsX[] = { 74, // QUEST_MEDALLION_FOREST @@ -2947,10 +2958,10 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->cursorVtx[11].v.tc[1] // PAUSE_CURSOR_QUAD_BR = pauseCtx->cursorVtx[13].v.tc[0] = pauseCtx->cursorVtx[14].v.tc[1] = pauseCtx->cursorVtx[15].v.tc[0] = - pauseCtx->cursorVtx[15].v.tc[1] = 16 * (1 << 5); + pauseCtx->cursorVtx[15].v.tc[1] = PAUSE_MENU_CURSOR_CORNER_TEX_SIZE * (1 << 5); // PAUSE_CURSOR_QUAD_4 pauseCtx->cursorVtx[17].v.tc[0] = pauseCtx->cursorVtx[18].v.tc[1] = pauseCtx->cursorVtx[19].v.tc[0] = - pauseCtx->cursorVtx[19].v.tc[1] = 32 * (1 << 5); + pauseCtx->cursorVtx[19].v.tc[1] = gMagicArrowEquipEffectTex_SIZE * (1 << 5); pauseCtx->itemVtx = GRAPH_ALLOC(gfxCtx, (ITEM_QUAD_MAX * 4) * sizeof(Vtx)); @@ -3106,19 +3117,29 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { } } - pauseCtx->equipVtx = GRAPH_ALLOC(gfxCtx, 112 * sizeof(Vtx)); + pauseCtx->equipVtx = GRAPH_ALLOC(gfxCtx, (EQUIP_QUAD_MAX * 4) * sizeof(Vtx)); - for (k = 0, i = 0, y = 58; i < 4; i++, y -= 32) { + // EQUIP_QUAD_UPG_BULLETBAG_QUIVER, EQUIP_QUAD_SWORD_KOKIRI, EQUIP_QUAD_SWORD_MASTER, EQUIP_QUAD_SWORD_BIGGORON, + // EQUIP_QUAD_UPG_BOMB_BAG, EQUIP_QUAD_SHIELD_DEKU, EQUIP_QUAD_SHIELD_HYLIAN, EQUIP_QUAD_SHIELD_MIRROR, + // EQUIP_QUAD_UPG_STRENGTH, EQUIP_QUAD_TUNIC_KOKIRI, EQUIP_QUAD_TUNIC_GORON, EQUIP_QUAD_TUNIC_ZORA, + // EQUIP_QUAD_UPG_SCALE, EQUIP_QUAD_BOOTS_KOKIRI, EQUIP_QUAD_BOOTS_IRON, EQUIP_QUAD_BOOTS_HOVER + + // for each row + for (k = 0, i = 0, y = (EQUIP_TYPE_MAX * EQUIP_GRID_CELL_HEIGHT) / 2 - 6; i < EQUIP_TYPE_MAX; + i++, y -= EQUIP_GRID_CELL_HEIGHT) { + // for each column for (j = 0; j < 4; j++, k += 4) { - pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = D_8082B12C[j] + 2; + pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = + sEquipColumnsX[j] + EQUIP_GRID_QUAD_MARGIN; pauseCtx->equipVtx[k + 1].v.ob[0] = pauseCtx->equipVtx[k + 3].v.ob[0] = - pauseCtx->equipVtx[k + 0].v.ob[0] + 28; + pauseCtx->equipVtx[k + 0].v.ob[0] + EQUIP_GRID_QUAD_WIDTH; - pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = y + pauseCtx->pagesYOrigin1 - 2; + pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = + y + pauseCtx->pagesYOrigin1 - EQUIP_GRID_QUAD_MARGIN; pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = - pauseCtx->equipVtx[k + 0].v.ob[1] - 28; + pauseCtx->equipVtx[k + 0].v.ob[1] - EQUIP_GRID_QUAD_HEIGHT; pauseCtx->equipVtx[k + 0].v.ob[2] = pauseCtx->equipVtx[k + 1].v.ob[2] = pauseCtx->equipVtx[k + 2].v.ob[2] = pauseCtx->equipVtx[k + 3].v.ob[2] = 0; @@ -3130,7 +3151,7 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->equipVtx[k + 2].v.tc[0] = 0; pauseCtx->equipVtx[k + 1].v.tc[0] = pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[0] = - pauseCtx->equipVtx[k + 3].v.tc[1] = 0x400; + pauseCtx->equipVtx[k + 3].v.tc[1] = EQUIP_GRID_QUAD_TEX_SIZE * (1 << 5); pauseCtx->equipVtx[k + 0].v.cn[0] = pauseCtx->equipVtx[k + 1].v.cn[0] = pauseCtx->equipVtx[k + 2].v.cn[0] = pauseCtx->equipVtx[k + 3].v.cn[0] = pauseCtx->equipVtx[k + 0].v.cn[1] = @@ -3144,19 +3165,23 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { } } - for (j = 0; j < 4; k += 4, j++) { + // EQUIP_QUAD_SELECTED_SWORD, EQUIP_QUAD_SELECTED_SHIELD, EQUIP_QUAD_SELECTED_TUNIC, EQUIP_QUAD_SELECTED_BOOTS + + for (j = 0; j < EQUIP_TYPE_MAX; k += 4, j++) { if (CUR_EQUIP_VALUE(j) != 0) { - i = (CUR_EQUIP_VALUE(j) + D_8082B134[j] - 1) * 4; + i = (CUR_EQUIP_VALUE(j) + sEquipQuadsFirstByEquipType[j] - 1) * 4; - pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = pauseCtx->equipVtx[i].v.ob[0] - 2; + pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = + pauseCtx->equipVtx[i].v.ob[0] + EQUIP_GRID_SELECTED_QUAD_MARGIN; pauseCtx->equipVtx[k + 1].v.ob[0] = pauseCtx->equipVtx[k + 3].v.ob[0] = - pauseCtx->equipVtx[k + 0].v.ob[0] + 32; + pauseCtx->equipVtx[k + 0].v.ob[0] + EQUIP_GRID_SELECTED_QUAD_WIDTH; - pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = pauseCtx->equipVtx[i].v.ob[1] + 2; + pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = + pauseCtx->equipVtx[i].v.ob[1] - EQUIP_GRID_SELECTED_QUAD_MARGIN; pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = - pauseCtx->equipVtx[k + 0].v.ob[1] - 32; + pauseCtx->equipVtx[k + 0].v.ob[1] - EQUIP_GRID_SELECTED_QUAD_HEIGHT; pauseCtx->equipVtx[k + 0].v.ob[2] = pauseCtx->equipVtx[k + 1].v.ob[2] = pauseCtx->equipVtx[k + 2].v.ob[2] = pauseCtx->equipVtx[k + 3].v.ob[2] = 0; @@ -3168,7 +3193,7 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->equipVtx[k + 2].v.tc[0] = 0; pauseCtx->equipVtx[k + 1].v.tc[0] = pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[0] = - pauseCtx->equipVtx[k + 3].v.tc[1] = 0x400; + pauseCtx->equipVtx[k + 3].v.tc[1] = EQUIP_GRID_SELECTED_QUAD_TEX_SIZE * (1 << 5); pauseCtx->equipVtx[k + 0].v.cn[0] = pauseCtx->equipVtx[k + 1].v.cn[0] = pauseCtx->equipVtx[k + 2].v.cn[0] = pauseCtx->equipVtx[k + 3].v.cn[0] = pauseCtx->equipVtx[k + 0].v.cn[1] = @@ -3182,16 +3207,20 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { } } - x = 112; + // EQUIP_QUAD_PLAYER_FIRST..EQUIP_QUAD_PLAYER_LAST + + x = PAUSE_EQUIP_PLAYER_HEIGHT; y = 50; for (;;) { pauseCtx->equipVtx[k + 0].v.ob[0] = pauseCtx->equipVtx[k + 2].v.ob[0] = -64; - pauseCtx->equipVtx[k + 1].v.ob[0] = pauseCtx->equipVtx[k + 3].v.ob[0] = pauseCtx->equipVtx[k + 0].v.ob[0] + 64; + pauseCtx->equipVtx[k + 1].v.ob[0] = pauseCtx->equipVtx[k + 3].v.ob[0] = + pauseCtx->equipVtx[k + 0].v.ob[0] + PAUSE_EQUIP_PLAYER_WIDTH; pauseCtx->equipVtx[k + 0].v.ob[1] = pauseCtx->equipVtx[k + 1].v.ob[1] = y + pauseCtx->pagesYOrigin1; - pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = pauseCtx->equipVtx[k + 0].v.ob[1] - 32; + pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = + pauseCtx->equipVtx[k + 0].v.ob[1] - PAUSE_EQUIP_PLAYER_FRAG_HEIGHT; pauseCtx->equipVtx[k + 0].v.ob[2] = pauseCtx->equipVtx[k + 1].v.ob[2] = pauseCtx->equipVtx[k + 2].v.ob[2] = pauseCtx->equipVtx[k + 3].v.ob[2] = 0; @@ -3202,9 +3231,10 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->equipVtx[k + 0].v.tc[0] = pauseCtx->equipVtx[k + 0].v.tc[1] = pauseCtx->equipVtx[k + 1].v.tc[1] = pauseCtx->equipVtx[k + 2].v.tc[0] = 0; - pauseCtx->equipVtx[k + 1].v.tc[0] = pauseCtx->equipVtx[k + 3].v.tc[0] = 0x800; + pauseCtx->equipVtx[k + 1].v.tc[0] = pauseCtx->equipVtx[k + 3].v.tc[0] = PAUSE_EQUIP_PLAYER_WIDTH * (1 << 5); - pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[1] = 0x400; + pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[1] = + PAUSE_EQUIP_PLAYER_FRAG_HEIGHT * (1 << 5); pauseCtx->equipVtx[k + 0].v.cn[0] = pauseCtx->equipVtx[k + 1].v.cn[0] = pauseCtx->equipVtx[k + 2].v.cn[0] = pauseCtx->equipVtx[k + 3].v.cn[0] = pauseCtx->equipVtx[k + 0].v.cn[1] = pauseCtx->equipVtx[k + 1].v.cn[1] = @@ -3215,16 +3245,18 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { pauseCtx->equipVtx[k + 0].v.cn[3] = pauseCtx->equipVtx[k + 1].v.cn[3] = pauseCtx->equipVtx[k + 2].v.cn[3] = pauseCtx->equipVtx[k + 3].v.cn[3] = pauseCtx->alpha; - x -= 32; + x -= PAUSE_EQUIP_PLAYER_FRAG_HEIGHT; if (x < 0) { pauseCtx->equipVtx[k + 2].v.ob[1] = pauseCtx->equipVtx[k + 3].v.ob[1] = - pauseCtx->equipVtx[k + 0].v.ob[1] - 0x10; + pauseCtx->equipVtx[k + 0].v.ob[1] - (PAUSE_EQUIP_PLAYER_HEIGHT % PAUSE_EQUIP_PLAYER_FRAG_HEIGHT); + + pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[1] = + (PAUSE_EQUIP_PLAYER_HEIGHT % PAUSE_EQUIP_PLAYER_FRAG_HEIGHT) * (1 << 5); - pauseCtx->equipVtx[k + 2].v.tc[1] = pauseCtx->equipVtx[k + 3].v.tc[1] = 0x200; break; } - y -= 32; + y -= PAUSE_EQUIP_PLAYER_FRAG_HEIGHT; k += 4; } @@ -3365,7 +3397,7 @@ void KaleidoScope_Draw(PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x0C, pauseCtx->iconItemAltSegment); gSPSegment(POLY_OPA_DISP++, 0x0D, pauseCtx->iconItemLangSegment); - if (pauseCtx->debugState == 0) { + if (pauseCtx->debugState == PAUSE_DEBUG_STATE_CLOSED) { KaleidoScope_SetView(pauseCtx, pauseCtx->eye.x, pauseCtx->eye.y, pauseCtx->eye.z); Gfx_SetupDL_42Opa(play->state.gfxCtx); @@ -3387,8 +3419,9 @@ void KaleidoScope_Draw(PlayState* play) { KaleidoScope_DrawGameOver(play); } - if ((pauseCtx->debugState == 1) || (pauseCtx->debugState == 2)) { - KaleidoScope_DrawDebugEditor(play); + if ((pauseCtx->debugState == PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPENING) || + (pauseCtx->debugState == PAUSE_DEBUG_STATE_INVENTORY_EDITOR_OPEN)) { + KaleidoScope_DrawInventoryEditor(play); } CLOSE_DISPS(play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 3254); @@ -3651,7 +3684,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->playerSegment = (void*)(((uintptr_t)play->objectCtx.spaceStart + 0x30) & ~0x3F); size1 = Player_InitPauseDrawData(play, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime); - PRINTF("プレイヤー size1=%x\n", size1); + PRINTF(T("プレイヤー size1=%x\n", "Player size1=%x\n"), size1); size0 = (uintptr_t)_icon_item_staticSegmentRomEnd - (uintptr_t)_icon_item_staticSegmentRomStart; pauseCtx->iconItemSegment = (void*)ALIGN16((uintptr_t)pauseCtx->playerSegment + size1); @@ -3660,7 +3693,7 @@ void KaleidoScope_Update(PlayState* play) { DMA_REQUEST_SYNC(pauseCtx->iconItemSegment, (uintptr_t)_icon_item_staticSegmentRomStart, size0, "../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)) { @@ -3754,10 +3787,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size); - PRINTF("サイズ=%x\n", size2 + size1 + size0 + size); + PRINTF(T("サイズ=%x\n", "size=%x\n"), size2 + size1 + size0 + size); PRINTF("item_name I_N_PT=%x\n", 0x800); Interface_SetDoAction(play, DO_ACTION_DECIDE); - PRINTF("サイズ=%x\n", size2 + size1 + size0 + size + 0x800); + PRINTF(T("サイズ=%x\n", "size=%x\n"), size2 + size1 + size0 + size + 0x800); if (((void)0, gSaveContext.worldMapArea) < WORLD_MAP_AREA_MAX) { #if OOT_NTSC @@ -4141,7 +4174,7 @@ void KaleidoScope_Update(PlayState* play) { } break; - case PAUSE_MAIN_STATE_7: + case PAUSE_MAIN_STATE_EQUIP_CHANGED: break; case PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG: @@ -4280,7 +4313,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->alpha = 0; } } else { - pauseCtx->debugState = 0; + pauseCtx->debugState = PAUSE_DEBUG_STATE_CLOSED; pauseCtx->state = PAUSE_STATE_RESUME_GAMEPLAY; pauseCtx->itemPagePitch = pauseCtx->equipPagePitch = pauseCtx->mapPagePitch = pauseCtx->questPagePitch = 160.0f; @@ -4623,7 +4656,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->alpha = 0; } } else { - pauseCtx->debugState = 0; + pauseCtx->debugState = PAUSE_DEBUG_STATE_CLOSED; pauseCtx->state = PAUSE_STATE_RESUME_GAMEPLAY; pauseCtx->questPagePitch = 160.0f; pauseCtx->mapPagePitch = 160.0f; 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 5a99234432..8f42eb244d 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h @@ -3,8 +3,8 @@ #include "ultra64.h" #include "gfx.h" -#include "z64inventory.h" -#include "z64pause.h" +#include "inventory.h" +#include "pause.h" struct PlayState; @@ -69,6 +69,55 @@ typedef enum QuestQuad { /* 47 */ QUEST_QUAD_MAX } QuestQuad; +#define EQUIP_CURSOR_X_UPG 0 +#define EQUIP_CURSOR_Y_BULLETBAG_QUIVER 0 + +#define EQUIP_GRID_CELL_WIDTH 32 +#define EQUIP_GRID_CELL_HEIGHT 32 +#define EQUIP_GRID_QUAD_MARGIN 2 +#define EQUIP_GRID_QUAD_WIDTH (EQUIP_GRID_CELL_WIDTH - (2 * EQUIP_GRID_QUAD_MARGIN)) +#define EQUIP_GRID_QUAD_HEIGHT (EQUIP_GRID_CELL_HEIGHT - (2 * EQUIP_GRID_QUAD_MARGIN)) +#define EQUIP_GRID_QUAD_TEX_SIZE 32 // both width and height + +#define EQUIP_GRID_SELECTED_QUAD_MARGIN (-2) +#define EQUIP_GRID_SELECTED_QUAD_WIDTH (EQUIP_GRID_QUAD_WIDTH - (2 * EQUIP_GRID_SELECTED_QUAD_MARGIN)) +#define EQUIP_GRID_SELECTED_QUAD_HEIGHT (EQUIP_GRID_QUAD_HEIGHT - (2 * EQUIP_GRID_SELECTED_QUAD_MARGIN)) +#define EQUIP_GRID_SELECTED_QUAD_TEX_SIZE 32 // both width and height + +typedef enum EquipQuad { + // Grid of upgrades and equips, left column is upgrades, others are equips, with one row per equip type + // Row 0 + /* 0 */ EQUIP_QUAD_UPG_BULLETBAG_QUIVER, + /* 1 */ EQUIP_QUAD_SWORD_KOKIRI, + /* 2 */ EQUIP_QUAD_SWORD_MASTER, + /* 3 */ EQUIP_QUAD_SWORD_BIGGORON, + // Row 1 + /* 4 */ EQUIP_QUAD_UPG_BOMB_BAG, + /* 5 */ EQUIP_QUAD_SHIELD_DEKU, + /* 6 */ EQUIP_QUAD_SHIELD_HYLIAN, + /* 7 */ EQUIP_QUAD_SHIELD_MIRROR, + // Row 2 + /* 8 */ EQUIP_QUAD_UPG_STRENGTH, + /* 9 */ EQUIP_QUAD_TUNIC_KOKIRI, + /* 10 */ EQUIP_QUAD_TUNIC_GORON, + /* 11 */ EQUIP_QUAD_TUNIC_ZORA, + // Row 3 + /* 12 */ EQUIP_QUAD_UPG_SCALE, + /* 13 */ EQUIP_QUAD_BOOTS_KOKIRI, + /* 14 */ EQUIP_QUAD_BOOTS_IRON, + /* 15 */ EQUIP_QUAD_BOOTS_HOVER, + // Markers indicating the currently selected equip + /* 16 */ EQUIP_QUAD_SELECTED_SWORD, + /* 17 */ EQUIP_QUAD_SELECTED_SHIELD, + /* 18 */ EQUIP_QUAD_SELECTED_TUNIC, + /* 19 */ EQUIP_QUAD_SELECTED_BOOTS, + // Player prerender + /* 20 */ EQUIP_QUAD_PLAYER_FIRST, + /* 23 */ EQUIP_QUAD_PLAYER_LAST = EQUIP_QUAD_PLAYER_FIRST + PAUSE_EQUIP_PLAYER_FRAG_NUM - 1, + // 24..27 are unused, probably meant for player prerender + /* 28 */ EQUIP_QUAD_MAX = EQUIP_QUAD_PLAYER_LAST + 4 + 1 +} EquipQuad; + // The world map image is split into a number of quad fragments for drawing #define WORLD_MAP_IMAGE_WIDTH 216 #define WORLD_MAP_IMAGE_HEIGHT 128 @@ -171,7 +220,7 @@ typedef enum ItemQuad { void KaleidoScope_DrawQuestStatus(struct PlayState* play, GraphicsContext* gfxCtx); s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s32 point); -void KaleidoScope_DrawDebugEditor(struct PlayState* play); +void KaleidoScope_DrawInventoryEditor(struct PlayState* play); void KaleidoScope_DrawPlayerWork(struct PlayState* play); void KaleidoScope_DrawEquipment(struct PlayState* play); void KaleidoScope_SetCursorPos(PauseContext* pauseCtx, u16 index, Vtx* vtx); @@ -184,7 +233,9 @@ Gfx* KaleidoScope_QuadTextureIA4(Gfx* gfx, void* texture, s16 width, s16 height, Gfx* KaleidoScope_QuadTextureIA8(Gfx* gfx, void* texture, s16 width, s16 height, u16 point); void KaleidoScope_MoveCursorToSpecialPos(struct PlayState* play, u16 specialPos); void KaleidoScope_DrawQuadTextureRGBA32(GraphicsContext* gfxCtx, void* texture, u16 width, u16 height, u16 point); -void KaleidoScope_ProcessPlayerPreRender(); +#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); 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 126ceca4f1..05371b7149 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c @@ -5,9 +5,7 @@ #include "sys_matrix.h" #include "z_kaleido_scope.h" #include "z_lib.h" -#include "z64play.h" - -#include "global.h" +#include "play_state.h" #include "assets/textures/parameter_static/parameter_static.h" diff --git a/src/overlays/misc/ovl_map_mark_data/z_map_mark_data.c b/src/overlays/misc/ovl_map_mark_data/z_map_mark_data.c index 48a18fff9d..bb78417dde 100644 --- a/src/overlays/misc/ovl_map_mark_data/z_map_mark_data.c +++ b/src/overlays/misc/ovl_map_mark_data/z_map_mark_data.c @@ -1,4 +1,4 @@ -#include "z64map_mark.h" +#include "map_mark.h" static MapMarkData sMapMarkDekuTree[] = { // Deku Tree minimap 0 diff --git a/src/overlays/misc/ovl_map_mark_data/z_map_mark_data_mq.c b/src/overlays/misc/ovl_map_mark_data/z_map_mark_data_mq.c index ba7517034c..1587228a44 100644 --- a/src/overlays/misc/ovl_map_mark_data/z_map_mark_data_mq.c +++ b/src/overlays/misc/ovl_map_mark_data/z_map_mark_data_mq.c @@ -1,4 +1,4 @@ -#include "z64map_mark.h" +#include "map_mark.h" static MapMarkData sMapMarkDekuTree[] = { // Deku Tree minimap 0 diff --git a/sym_info.py b/sym_info.py index 301e80110f..afee014518 100755 --- a/sym_info.py +++ b/sym_info.py @@ -6,11 +6,13 @@ 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 @@ -228,9 +230,13 @@ def find_symbols_by_name( return infos -def print_map_file(map_file: mapfile_parser.mapfile.MapFile): +def print_map_file(map_file: mapfile_parser.mapfile.MapFile, *, colors: bool): for segment in map_file: - print(f"{segment.name}") + 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 ( @@ -239,7 +245,11 @@ def print_map_file(map_file: mapfile_parser.mapfile.MapFile): or file.sectionType.startswith(".mdebug") ): continue - print(f" {file.asStr()}") + 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: @@ -265,6 +275,12 @@ def sym_info_main(): 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", @@ -272,17 +288,65 @@ def sym_info_main(): help="which version should be processed (default: gc-eu-mq-dbg)", default="gc-eu-mq-dbg", ) + parser.add_argument( + "--build-dir", + dest="build_dir", + help="the build folder in which to read the map and elf (default: `build/VERSION/`)", + type=Path, + default=None, + ) args = parser.parse_args() - BUILTMAP = Path("build") / args.oot_version / f"oot-{args.oot_version}.map" - BUILTELF = Path("build") / args.oot_version / f"oot-{args.oot_version}.elf" + 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() + + build_dir: Path = args.build_dir + if build_dir is None: + build_dir = Path("build") / args.oot_version + map_path = build_dir / f"oot-{args.oot_version}.map" + elf_path = build_dir / f"oot-{args.oot_version}.elf" + else: + map_paths = list(build_dir.glob("*.map")) + elf_paths = list(build_dir.glob("*.elf")) + + if len(map_paths) > 1: + print(f"Found several .map files instead of just one:") + print("\n".join(map(str, map_paths))) + sys.exit(1) + if not map_paths: + print("Could not find map file") + sys.exit(1) + + if len(elf_paths) > 1: + print(f"Found several .elf files instead of just one:") + print("\n".join(map(str, elf_paths))) + sys.exit(1) + + map_path = map_paths[0] + elf_path = elf_paths[0] if elf_paths else None - map_path = BUILTMAP - elf_path = BUILTELF if args.use_expected: - map_path = "expected" / BUILTMAP - elf_path = "expected" / BUILTELF + map_path = ( + Path("expected") + / "build" + / args.oot_version + / f"oot-{args.oot_version}.map" + ) + elf_path = ( + Path("expected") + / "build" + / args.oot_version + / f"oot-{args.oot_version}.elf" + ) if not map_path.exists(): print(f"Could not find map_file at '{map_path}'") @@ -291,39 +355,44 @@ def sym_info_main(): map_file = mapfile_parser.mapfile.MapFile() map_file.readMapFile(map_path) - if elf_path.exists(): + if elf_path and 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" + "Could not find ELF file" + + (f" at '{elf_path}'" if elf_path else "") + + ", local symbols will not be available" ) sym_name = args.symname if sym_name is None: - print_map_file(map_file) + print_map_file(map_file, colors=colors) sys.exit(0) infos: list[mapfile_parser.mapfile.FoundSymbolInfo] = [] - possible_files: list[mapfile_parser.mapfile.File] = [] + all_possible_files: list[mapfile_parser.mapfile.File] = [] try: address = int(sym_name, 0) - if address >= 0x01000000: + + if address >= 0x0100_0000: 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] + infos += [info] + all_possible_files += possible_files + + info, possible_files = map_file.findSymbolByVrom(address) + if info is not None: + infos += [info] + all_possible_files += possible_files 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: + if all_possible_files: print("But it may be a local symbol of either of the following files:") - for f in possible_files: + for f in all_possible_files: print(f" {f.asStr()})") sys.exit(1) diff --git a/tools/Makefile b/tools/Makefile index 6e311ab398..7f6eef55a1 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -35,7 +35,6 @@ 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 @@ -44,7 +43,6 @@ all: $(PROGRAMS) $(IDO_RECOMP_5_3_DIR) $(IDO_RECOMP_7_1_DIR) $(EGCS_DIR) 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 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: - -![ZAPD warnings example](docs/zapd_warning_example.png?raw=true) 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 -#include -#include - -#include "Utils/Directory.h" -#include "tinyxml2.h" - -struct TexturePoolEntry -{ - fs::path path = ""; // Path to Shared Texture -}; - -class ExternalFile -{ -public: - fs::path xmlPath, outPath; - - ExternalFile(fs::path nXmlPath, fs::path nOutPath); -}; - -// Stores data from the XML file, the integer is the index (via ATOI) and the string is the value -class EnumData -{ -public: - // Common - std::map cutsceneCmd; - std::map miscType; - std::map fadeOutSeqPlayer; - std::map transitionType; - std::map naviQuestHintType; - std::map ocarinaSongActionId; - std::map seqId; - - // OoT - std::map textType; - std::map destination; - std::map playerCueId; - - // MM - std::map modifySeqType; - std::map chooseCreditsSceneType; - std::map destinationType; - std::map motionBlurType; - std::map transitionGeneralType; - std::map rumbleType; - std::map spawnFlag; - std::map endSfx; - std::map interpType; - std::map relTo; -}; - -class ZFile; - -class GameConfig -{ -public: - std::string configFilePath; - std::map> segmentRefFiles; - std::map symbolMap; - std::vector actorList; - std::vector objectList; - std::vector entranceList; - std::vector specialEntranceList; - std::map texturePool; // Key = CRC - EnumData enumData; - - // ZBackground - uint32_t bgScreenWidth = 320, bgScreenHeight = 240; - bool useScreenWidthHeightConstants = true; // If true, ZBackground's will be declared with - // SCREEN_WIDTH * SCREEN_HEIGHT in the C file - - // ExternalFile - fs::path externalXmlFolder; - std::vector externalFiles; - - GameConfig() = default; - ~GameConfig(); - - void ReadTexturePool(const fs::path& texturePoolXmlPath); - void GenSymbolMap(const fs::path& symbolMapPath); - - void ConfigFunc_SymbolMap(const tinyxml2::XMLElement& element); - void ConfigFunc_ActorList(const tinyxml2::XMLElement& element); - void ConfigFunc_ObjectList(const tinyxml2::XMLElement& element); - void ConfigFunc_EntranceList(const tinyxml2::XMLElement& element); - void ConfigFunc_specialEntranceList(const tinyxml2::XMLElement& element); - void ConfigFunc_TexturePool(const tinyxml2::XMLElement& element); - void ConfigFunc_BGConfig(const tinyxml2::XMLElement& element); - void ConfigFunc_ExternalXMLFolder(const tinyxml2::XMLElement& element); - void ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element); - void ConfigFunc_EnumData(const tinyxml2::XMLElement& element); - - void ReadConfigFile(const fs::path& configFilePath); -}; diff --git a/tools/ZAPD/ZAPD/Globals.cpp b/tools/ZAPD/ZAPD/Globals.cpp deleted file mode 100644 index 02380f6902..0000000000 --- a/tools/ZAPD/ZAPD/Globals.cpp +++ /dev/null @@ -1,246 +0,0 @@ -#include "Globals.h" - -#include -#include - -#include "Utils/File.h" -#include "Utils/Path.h" -#include "WarningHandler.h" -#include "tinyxml2.h" - -Globals* Globals::Instance; - -Globals::Globals() -{ - Instance = this; - - game = ZGame::OOT_RETAIL; - genSourceFile = true; - testMode = false; - profile = false; - useLegacyZDList = false; - useExternalResources = true; - verbosity = VerbosityLevel::VERBOSITY_SILENT; - outputPath = Directory::GetCurrentDirectory(); -} - -Globals::~Globals() -{ - auto& exporters = GetExporterMap(); - - for (auto& it : exporters) - { - delete it.second; - } -} - -void Globals::AddSegment(int32_t segment, ZFile* file) -{ - if (std::find(segments.begin(), segments.end(), segment) == segments.end()) - segments.push_back(segment); - if (cfg.segmentRefFiles.find(segment) == cfg.segmentRefFiles.end()) - cfg.segmentRefFiles[segment] = std::vector(); - - cfg.segmentRefFiles[segment].push_back(file); -} - -bool Globals::HasSegment(int32_t segment) -{ - return std::find(segments.begin(), segments.end(), segment) != segments.end(); -} - -std::map& Globals::GetExporterMap() -{ - static std::map exporters; - return exporters; -} - -void Globals::AddExporter(std::string exporterName, ExporterSet* exporterSet) -{ - auto& exporters = GetExporterMap(); - exporters[exporterName] = exporterSet; -} - -ZResourceExporter* Globals::GetExporter(ZResourceType resType) -{ - auto& exporters = GetExporterMap(); - - if (currentExporter != "" && exporters[currentExporter]->exporters.find(resType) != - exporters[currentExporter]->exporters.end()) - return exporters[currentExporter]->exporters[resType]; - else - return nullptr; -} - -ExporterSet* Globals::GetExporterSet() -{ - auto& exporters = GetExporterMap(); - - if (currentExporter != "") - return exporters[currentExporter]; - else - return nullptr; -} - -bool Globals::GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile, - const std::string& expectedType, std::string& declName, - bool warnIfNotFound) -{ - if (segAddress == SEGMENTED_NULL) - { - declName = "NULL"; - return true; - } - - uint8_t segment = GETSEGNUM(segAddress); - uint32_t offset = Seg2Filespace(segAddress, currentFile->baseAddress); - ZSymbol* sym; - - sym = currentFile->GetSymbolResource(offset); - if (sym != nullptr) - { - if (expectedType == "" || expectedType == sym->GetSourceTypeName()) - { - declName = sym->GetName(); - return true; - } - } - sym = currentFile->GetSymbolResource(segAddress); - if (sym != nullptr) - { - if (expectedType == "" || expectedType == sym->GetSourceTypeName()) - { - declName = sym->GetName(); - return true; - } - } - - if (currentFile->IsSegmentedInFilespaceRange(segAddress)) - { - if (currentFile->GetDeclarationPtrName(segAddress, expectedType, declName)) - return true; - } - else if (HasSegment(segment)) - { - for (auto file : cfg.segmentRefFiles[segment]) - { - offset = Seg2Filespace(segAddress, file->baseAddress); - - sym = file->GetSymbolResource(offset); - if (sym != nullptr) - { - if (expectedType == "" || expectedType == sym->GetSourceTypeName()) - { - declName = sym->GetName(); - return true; - } - } - sym = file->GetSymbolResource(segAddress); - if (sym != nullptr) - { - if (expectedType == "" || expectedType == sym->GetSourceTypeName()) - { - declName = sym->GetName(); - return true; - } - } - - if (file->IsSegmentedInFilespaceRange(segAddress)) - { - if (file->GetDeclarationPtrName(segAddress, expectedType, declName)) - return true; - } - } - } - - const auto& symbolFromMap = Globals::Instance->cfg.symbolMap.find(segAddress); - if (symbolFromMap != Globals::Instance->cfg.symbolMap.end()) - { - declName = "&" + symbolFromMap->second; - return true; - } - - declName = StringHelper::Sprintf("0x%08X", segAddress); - if (warnIfNotFound) - { - WarnHardcodedPointer(segAddress, currentFile, nullptr, -1); - } - return false; -} - -bool Globals::GetSegmentedArrayIndexedName(segptr_t segAddress, size_t elementSize, - ZFile* currentFile, const std::string& expectedType, - std::string& declName, bool warnIfNotFound) -{ - if (segAddress == SEGMENTED_NULL) - { - declName = "NULL"; - return true; - } - - uint8_t segment = GETSEGNUM(segAddress); - - if (currentFile->IsSegmentedInFilespaceRange(segAddress)) - { - bool addressFound = currentFile->GetDeclarationArrayIndexedName(segAddress, elementSize, - expectedType, declName); - if (addressFound) - return true; - } - else if (HasSegment(segment)) - { - for (auto file : cfg.segmentRefFiles[segment]) - { - if (file->IsSegmentedInFilespaceRange(segAddress)) - { - bool addressFound = file->GetDeclarationArrayIndexedName(segAddress, elementSize, - expectedType, declName); - if (addressFound) - return true; - } - } - } - - declName = StringHelper::Sprintf("0x%08X", segAddress); - if (warnIfNotFound) - { - WarnHardcodedPointer(segAddress, currentFile, nullptr, -1); - } - return false; -} - -void Globals::WarnHardcodedPointer(segptr_t segAddress, ZFile* currentFile, ZResource* res, - offset_t currentOffset) -{ - uint8_t segment = GETSEGNUM(segAddress); - - if ((segment >= 2 && segment <= 6) || segment == 0x80) - { - std::string errorHeader = "A hardcoded pointer was found"; - std::string errorBody = StringHelper::Sprintf("Pointer: 0x%08X", segAddress); - - HANDLE_WARNING_RESOURCE(WarningType::HardcodedPointer, currentFile, res, currentOffset, - errorHeader, errorBody); - } - else - { - std::string errorHeader = "A general purpose hardcoded pointer was found"; - std::string errorBody = StringHelper::Sprintf("Pointer: 0x%08X", segAddress); - - HANDLE_WARNING_RESOURCE(WarningType::HardcodedGenericPointer, currentFile, res, - currentOffset, errorHeader, errorBody); - } -} - -ExternalFile::ExternalFile(fs::path nXmlPath, fs::path nOutPath) - : xmlPath{nXmlPath}, outPath{nOutPath} -{ -} - -ExporterSet::~ExporterSet() -{ - for (auto& it : exporters) - { - delete it.second; - } -} diff --git a/tools/ZAPD/ZAPD/Globals.h b/tools/ZAPD/ZAPD/Globals.h deleted file mode 100644 index 2cc9c2d4db..0000000000 --- a/tools/ZAPD/ZAPD/Globals.h +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once - -#include -#include -#include -#include "GameConfig.h" -#include "ZFile.h" -#include "ExporterSet.h" - -class ZRoom; - -enum class VerbosityLevel -{ - VERBOSITY_SILENT, - VERBOSITY_INFO, - VERBOSITY_DEBUG -}; - -enum class CsFloatType -{ - HexOnly, - FloatOnly, - HexAndFloat, - HexAndCommentedFloatLeft, - HexAndCommentedFloatRight, -}; - -class Globals -{ -public: - static Globals* Instance; - - bool genSourceFile; // Used for extraction - bool useExternalResources; - bool testMode; // Enables certain experimental features - bool outputCrc = false; - bool profile; // Measure performance of certain operations - bool useLegacyZDList; - VerbosityLevel verbosity; // ZAPD outputs additional information - ZFileMode fileMode; - fs::path baseRomPath, inputPath, outputPath, sourceOutputPath, cfgPath; - TextureType texType; - CsFloatType floatType = CsFloatType::FloatOnly; - int64_t baseAddress = -1; - int64_t startOffset = -1; - int64_t endOffset = -1; - ZGame game; - GameConfig cfg; - bool verboseUnaccounted = false; - bool gccCompat = false; - bool forceStatic = false; - bool forceUnaccountedStatic = false; - - std::vector files; - std::vector externalFiles; - std::vector segments; - - std::string currentExporter; - static std::map& GetExporterMap(); - static void AddExporter(std::string exporterName, ExporterSet* exporterSet); - - Globals(); - ~Globals(); - - void AddSegment(int32_t segment, ZFile* file); - bool HasSegment(int32_t segment); - - ZResourceExporter* GetExporter(ZResourceType resType); - ExporterSet* GetExporterSet(); - - /** - * Search in every file (and the symbol map) for the `segAddress` passed as parameter. - * If the segment of `currentFile` is the same segment of `segAddress`, then that file will be - * used only, otherwise, the search will be performed in every other file. - * The name of that variable will be stored in the `declName` parameter. - * Returns `true` if the address is found. `false` otherwise, - * in which case `declName` will be set to the address formatted as a pointer. - */ - bool GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile, - const std::string& expectedType, std::string& declName, - bool warnIfNotFound = true); - - bool GetSegmentedArrayIndexedName(segptr_t segAddress, size_t elementSize, ZFile* currentFile, - const std::string& expectedType, std::string& declName, - bool warnIfNotFound = true); - - // TODO: consider moving to another place - void WarnHardcodedPointer(segptr_t segAddress, ZFile* currentFile, ZResource* res, - offset_t currentOffset); -}; diff --git a/tools/ZAPD/ZAPD/ImageBackend.cpp b/tools/ZAPD/ZAPD/ImageBackend.cpp deleted file mode 100644 index 307945b40e..0000000000 --- a/tools/ZAPD/ZAPD/ImageBackend.cpp +++ /dev/null @@ -1,506 +0,0 @@ -#include "ImageBackend.h" - -#include -#include -#include -#include - -#include "Utils/StringHelper.h" -#include "WarningHandler.h" - -/* ImageBackend */ - -ImageBackend::~ImageBackend() -{ - FreeImageData(); -} - -void ImageBackend::ReadPng(const char* filename) -{ - FreeImageData(); - - FILE* fp = fopen(filename, "rb"); - if (fp == nullptr) - { - std::string errorHeader = StringHelper::Sprintf("could not open file '%s'", filename); - HANDLE_ERROR(WarningType::InvalidPNG, errorHeader, ""); - } - - png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); - if (png == nullptr) - { - HANDLE_ERROR(WarningType::InvalidPNG, "could not create png struct", ""); - } - - png_infop info = png_create_info_struct(png); - if (info == nullptr) - { - HANDLE_ERROR(WarningType::InvalidPNG, "could not create png info", ""); - } - - if (setjmp(png_jmpbuf(png))) - { - // TODO: better warning explanation - HANDLE_ERROR(WarningType::InvalidPNG, "setjmp(png_jmpbuf(png))", ""); - } - - png_init_io(png, fp); - - png_read_info(png, info); - - width = png_get_image_width(png, info); - height = png_get_image_height(png, info); - colorType = png_get_color_type(png, info); - bitDepth = png_get_bit_depth(png, info); - -#ifdef TEXTURE_DEBUG - printf("Width: %u\n", width); - printf("Height: %u\n", height); - printf("ColorType: "); - switch (colorType) - { - case PNG_COLOR_TYPE_RGBA: - printf("PNG_COLOR_TYPE_RGBA\n"); - break; - - case PNG_COLOR_TYPE_RGB: - printf("PNG_COLOR_TYPE_RGB\n"); - break; - - case PNG_COLOR_TYPE_PALETTE: - printf("PNG_COLOR_TYPE_PALETTE\n"); - break; - - default: - printf("%u\n", colorType); - break; - } - printf("BitDepth: %u\n", bitDepth); - printf("\n"); -#endif - - // Read any color_type into 8bit depth, RGBA format. - // See http://www.libpng.org/pub/png/libpng-manual.txt - - if (bitDepth == 16) - png_set_strip_16(png); - - if (colorType == PNG_COLOR_TYPE_PALETTE) - { - // png_set_palette_to_rgb(png); - isColorIndexed = true; - } - - // PNG_COLOR_TYPE_GRAY_ALPHA is always 8 or 16bit depth. - if (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8) - png_set_expand_gray_1_2_4_to_8(png); - - /*if (png_get_valid(png, info, PNG_INFO_tRNS)) - png_set_tRNS_to_alpha(png);*/ - - // These color_type don't have an alpha channel then fill it with 0xff. - /*if(*color_type == PNG_COLOR_TYPE_RGB || - *color_type == PNG_COLOR_TYPE_GRAY || - *color_type == PNG_COLOR_TYPE_PALETTE) - png_set_filler(png, 0xFF, PNG_FILLER_AFTER);*/ - - if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb(png); - - png_read_update_info(png, info); - - size_t rowBytes = png_get_rowbytes(png, info); - pixelMatrix = (uint8_t**)malloc(sizeof(uint8_t*) * height); - for (size_t y = 0; y < height; y++) - { - pixelMatrix[y] = (uint8_t*)malloc(rowBytes); - } - - png_read_image(png, pixelMatrix); - -#ifdef TEXTURE_DEBUG - printf("rowBytes: %zu\n", rowBytes); - - size_t bytePerPixel = GetBytesPerPixel(); - printf("imgData\n"); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x++) - { - for (size_t z = 0; z < bytePerPixel; z++) - { - printf("%02X ", pixelMatrix[y][x * bytePerPixel + z]); - } - printf(" "); - } - printf("\n"); - } - printf("\n"); -#endif - - fclose(fp); - - png_destroy_read_struct(&png, &info, nullptr); - - hasImageData = true; -} - -void ImageBackend::ReadPng(const fs::path& filename) -{ - ReadPng(filename.c_str()); -} - -void ImageBackend::WritePng(const char* filename) -{ - assert(hasImageData); - - FILE* fp = fopen(filename, "wb"); - if (fp == nullptr) - { - std::string errorHeader = - StringHelper::Sprintf("could not open file '%s' in write mode", filename); - HANDLE_ERROR(WarningType::InvalidPNG, errorHeader, ""); - } - - png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); - if (png == nullptr) - { - HANDLE_ERROR(WarningType::InvalidPNG, "could not create png struct", ""); - } - - png_infop info = png_create_info_struct(png); - if (info == nullptr) - { - HANDLE_ERROR(WarningType::InvalidPNG, "could not create png info", ""); - } - - if (setjmp(png_jmpbuf(png))) - { - // TODO: better warning description - HANDLE_ERROR(WarningType::InvalidPNG, "setjmp(png_jmpbuf(png))", ""); - } - - png_init_io(png, fp); - - png_set_IHDR(png, info, width, height, - bitDepth, // 8, - colorType, // PNG_COLOR_TYPE_RGBA, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - - if (isColorIndexed) - { - png_set_PLTE(png, info, static_cast(colorPalette), paletteSize); - -#ifdef TEXTURE_DEBUG - printf("palette\n"); - png_color* aux = (png_color*)colorPalette; - for (size_t y = 0; y < paletteSize; y++) - { - printf("#%02X%02X%02X ", aux[y].red, aux[y].green, aux[y].blue); - if ((y + 1) % 8 == 0) - printf("\n"); - } - printf("\n"); -#endif - - png_set_tRNS(png, info, alphaPalette, paletteSize, nullptr); - } - - png_write_info(png, info); - - // To remove the alpha channel for PNG_COLOR_TYPE_RGB format, - // Use png_set_filler(). - // png_set_filler(png, 0, PNG_FILLER_AFTER); - -#ifdef TEXTURE_DEBUG - size_t bytePerPixel = GetBytesPerPixel(); - printf("imgData\n"); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width * bytePerPixel; x++) - { - printf("%02X ", pixelMatrix[y][x]); - } - printf("\n"); - } - printf("\n"); -#endif - - png_write_image(png, pixelMatrix); - png_write_end(png, nullptr); - - fclose(fp); - - png_destroy_write_struct(&png, &info); -} - -void ImageBackend::WritePng(const fs::path& filename) -{ - // Note: The .string() is necessary for MSVC, due to the implementation of std::filesystem - // differing from GCC. Do not remove! - WritePng(filename.string().c_str()); -} - -void ImageBackend::SetTextureData(const std::vector>& texData, - uint32_t nWidth, uint32_t nHeight, uint8_t nColorType, - uint8_t nBitDepth) -{ - FreeImageData(); - - width = nWidth; - height = nHeight; - colorType = nColorType; - bitDepth = nBitDepth; - - size_t bytePerPixel = GetBytesPerPixel(); - - pixelMatrix = static_cast(malloc(sizeof(uint8_t*) * height)); - for (size_t y = 0; y < height; y++) - { - pixelMatrix[y] = static_cast(malloc(sizeof(uint8_t*) * width * bytePerPixel)); - for (size_t x = 0; x < width; x++) - { - pixelMatrix[y][x * bytePerPixel + 0] = texData.at(y).at(x).r; - pixelMatrix[y][x * bytePerPixel + 1] = texData.at(y).at(x).g; - pixelMatrix[y][x * bytePerPixel + 2] = texData.at(y).at(x).b; - - if (colorType == PNG_COLOR_TYPE_RGBA) - pixelMatrix[y][x * bytePerPixel + 3] = texData.at(y).at(x).a; - } - } - hasImageData = true; -} - -void ImageBackend::InitEmptyRGBImage(uint32_t nWidth, uint32_t nHeight, bool alpha) -{ - FreeImageData(); - - width = nWidth; - height = nHeight; - colorType = PNG_COLOR_TYPE_RGB; - if (alpha) - colorType = PNG_COLOR_TYPE_RGBA; - bitDepth = 8; // nBitDepth; - - size_t bytePerPixel = GetBytesPerPixel(); - - pixelMatrix = static_cast(malloc(sizeof(uint8_t*) * height)); - for (size_t y = 0; y < height; y++) - { - pixelMatrix[y] = static_cast(calloc(width * bytePerPixel, sizeof(uint8_t*))); - } - - hasImageData = true; -} - -void ImageBackend::InitEmptyPaletteImage(uint32_t nWidth, uint32_t nHeight) -{ - FreeImageData(); - - width = nWidth; - height = nHeight; - colorType = PNG_COLOR_TYPE_PALETTE; - bitDepth = 8; - - size_t bytePerPixel = GetBytesPerPixel(); - - pixelMatrix = (uint8_t**)malloc(sizeof(uint8_t*) * height); - for (size_t y = 0; y < height; y++) - { - pixelMatrix[y] = static_cast(calloc(width * bytePerPixel, sizeof(uint8_t*))); - } - colorPalette = calloc(paletteSize, sizeof(png_color)); - alphaPalette = static_cast(calloc(paletteSize, sizeof(uint8_t))); - - hasImageData = true; - isColorIndexed = true; -} - -RGBAPixel ImageBackend::GetPixel(size_t y, size_t x) const -{ - assert(y < height); - assert(x < width); - assert(!isColorIndexed); - - RGBAPixel pixel; - size_t bytePerPixel = GetBytesPerPixel(); - pixel.r = pixelMatrix[y][x * bytePerPixel + 0]; - pixel.g = pixelMatrix[y][x * bytePerPixel + 1]; - pixel.b = pixelMatrix[y][x * bytePerPixel + 2]; - if (colorType == PNG_COLOR_TYPE_RGBA) - pixel.a = pixelMatrix[y][x * bytePerPixel + 3]; - return pixel; -} - -uint8_t ImageBackend::GetIndexedPixel(size_t y, size_t x) const -{ - assert(y < height); - assert(x < width); - assert(isColorIndexed); - - return pixelMatrix[y][x]; -} - -void ImageBackend::SetRGBPixel(size_t y, size_t x, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA) -{ - assert(hasImageData); - assert(y < height); - assert(x < width); - - size_t bytePerPixel = GetBytesPerPixel(); - pixelMatrix[y][x * bytePerPixel + 0] = nR; - pixelMatrix[y][x * bytePerPixel + 1] = nG; - pixelMatrix[y][x * bytePerPixel + 2] = nB; - if (colorType == PNG_COLOR_TYPE_RGBA) - pixelMatrix[y][x * bytePerPixel + 3] = nA; -} - -void ImageBackend::SetGrayscalePixel(size_t y, size_t x, uint8_t grayscale, uint8_t alpha) -{ - assert(hasImageData); - assert(y < height); - assert(x < width); - - size_t bytePerPixel = GetBytesPerPixel(); - pixelMatrix[y][x * bytePerPixel + 0] = grayscale; - pixelMatrix[y][x * bytePerPixel + 1] = grayscale; - pixelMatrix[y][x * bytePerPixel + 2] = grayscale; - if (colorType == PNG_COLOR_TYPE_RGBA) - pixelMatrix[y][x * bytePerPixel + 3] = alpha; -} - -void ImageBackend::SetIndexedPixel(size_t y, size_t x, uint8_t index, uint8_t grayscale) -{ - assert(hasImageData); - assert(y < height); - assert(x < width); - - size_t bytePerPixel = GetBytesPerPixel(); - pixelMatrix[y][x * bytePerPixel + 0] = index; - - assert(index < paletteSize); - png_color* pal = static_cast(colorPalette); - pal[index].red = grayscale; - pal[index].green = grayscale; - pal[index].blue = grayscale; - alphaPalette[index] = 255; -} - -void ImageBackend::SetPaletteIndex(size_t index, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA) -{ - assert(isColorIndexed); - assert(index < paletteSize); - - png_color* pal = static_cast(colorPalette); - pal[index].red = nR; - pal[index].green = nG; - pal[index].blue = nB; - alphaPalette[index] = nA; -} - -void ImageBackend::SetPalette(const ImageBackend& pal, uint32_t offset) -{ - assert(isColorIndexed); - size_t bytePerPixel = pal.GetBytesPerPixel(); - - for (size_t y = 0; y < pal.height; y++) - { - for (size_t x = 0; x < pal.width; x++) - { - size_t index = y * pal.width + x; - if (index >= paletteSize) - { - /* - * Some TLUTs are bigger than 256 colors. - * For those cases, we will only take the first 256 - * to colorize this CI texture. - */ - return; - } - - uint8_t r = pal.pixelMatrix[y][x * bytePerPixel + 0]; - uint8_t g = pal.pixelMatrix[y][x * bytePerPixel + 1]; - uint8_t b = pal.pixelMatrix[y][x * bytePerPixel + 2]; - uint8_t a = pal.pixelMatrix[y][x * bytePerPixel + 3]; - SetPaletteIndex(index + offset, r, g, b, a); - } - } -} - -uint32_t ImageBackend::GetWidth() const -{ - return width; -} - -uint32_t ImageBackend::GetHeight() const -{ - return height; -} - -uint8_t ImageBackend::GetColorType() const -{ - return colorType; -} - -uint8_t ImageBackend::GetBitDepth() const -{ - return bitDepth; -} - -double ImageBackend::GetBytesPerPixel() const -{ - switch (colorType) - { - case PNG_COLOR_TYPE_RGBA: - return 4 * bitDepth / 8; - - case PNG_COLOR_TYPE_RGB: - return 3 * bitDepth / 8; - - case PNG_COLOR_TYPE_PALETTE: - return 1 * bitDepth / 8; - - default: - HANDLE_ERROR(WarningType::InvalidPNG, "invalid color type", ""); - } -} - -void ImageBackend::FreeImageData() -{ - if (hasImageData) - { - for (size_t y = 0; y < height; y++) - free(pixelMatrix[y]); - free(pixelMatrix); - pixelMatrix = nullptr; - } - - if (isColorIndexed) - { - free(colorPalette); - free(alphaPalette); - colorPalette = nullptr; - alphaPalette = nullptr; - isColorIndexed = false; - } - - hasImageData = false; -} - -/* RGBAPixel */ - -void RGBAPixel::SetRGBA(uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA) -{ - r = nR; - g = nG; - b = nB; - a = nA; -} - -void RGBAPixel::SetGrayscale(uint8_t grayscale, uint8_t alpha) -{ - r = grayscale; - g = grayscale; - b = grayscale; - a = alpha; -} diff --git a/tools/ZAPD/ZAPD/ImageBackend.h b/tools/ZAPD/ZAPD/ImageBackend.h deleted file mode 100644 index 0b1f4806c0..0000000000 --- a/tools/ZAPD/ZAPD/ImageBackend.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include -#include - -#include "Utils/Directory.h" - -class RGBAPixel -{ -public: - RGBAPixel() = default; - - void SetRGBA(uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA); - void SetGrayscale(uint8_t grayscale, uint8_t alpha = 0); - - uint8_t r = 0; - uint8_t g = 0; - uint8_t b = 0; - uint8_t a = 0; -}; - -class ImageBackend -{ -public: - ImageBackend() = default; - ~ImageBackend(); - - void ReadPng(const char* filename); - void ReadPng(const fs::path& filename); - void WritePng(const char* filename); - void WritePng(const fs::path& filename); - - void SetTextureData(const std::vector>& texData, uint32_t nWidth, - uint32_t nHeight, uint8_t nColorType, uint8_t nBitDepth); - void InitEmptyRGBImage(uint32_t nWidth, uint32_t nHeight, bool alpha); - void InitEmptyPaletteImage(uint32_t nWidth, uint32_t nHeight); - - RGBAPixel GetPixel(size_t y, size_t x) const; - uint8_t GetIndexedPixel(size_t y, size_t x) const; - - void SetRGBPixel(size_t y, size_t x, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA = 0); - void SetGrayscalePixel(size_t y, size_t x, uint8_t grayscale, uint8_t alpha = 0); - - void SetIndexedPixel(size_t y, size_t x, uint8_t index, uint8_t grayscale); - void SetIndexedPixel(size_t y, size_t x, uint8_t index, RGBAPixel pixel); - void SetPaletteIndex(size_t index, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA); - void SetPalette(const ImageBackend& pal, uint32_t offset = 0); - - uint32_t GetWidth() const; - uint32_t GetHeight() const; - uint8_t GetColorType() const; - uint8_t GetBitDepth() const; - -protected: - uint8_t** pixelMatrix = nullptr; // height * [width * bytePerPixel] - - void* colorPalette = nullptr; - uint8_t* alphaPalette = nullptr; - size_t paletteSize = 16 * 16; - - uint32_t width = 0; - uint32_t height = 0; - uint8_t colorType = 0; - uint8_t bitDepth = 0; - - bool hasImageData = false; - bool isColorIndexed = false; - - double GetBytesPerPixel() const; - - void FreeImageData(); -}; diff --git a/tools/ZAPD/ZAPD/Main.cpp b/tools/ZAPD/ZAPD/Main.cpp deleted file mode 100644 index 19d10d7d96..0000000000 --- a/tools/ZAPD/ZAPD/Main.cpp +++ /dev/null @@ -1,532 +0,0 @@ -#include "Globals.h" -#include "Utils/Directory.h" -#include "Utils/File.h" -#include "Utils/Path.h" -#include "WarningHandler.h" -#include "ZAnimation.h" -#include "ZBackground.h" -#include "ZBlob.h" -#include "ZFile.h" -#include "ZTexture.h" - -#include -#include "CrashHandler.h" - -#include -#include -#include "tinyxml2.h" - -using ArgFunc = void (*)(int&, char**); - -void Arg_SetOutputPath(int& i, char* argv[]); -void Arg_SetInputPath(int& i, char* argv[]); -void Arg_SetBaseromPath(int& i, char* argv[]); -void Arg_SetSourceOutputPath(int& i, char* argv[]); -void Arg_GenerateSourceFile(int& i, char* argv[]); -void Arg_TestMode(int& i, char* argv[]); -void Arg_LegacyDList(int& i, char* argv[]); -void Arg_EnableProfiling(int& i, char* argv[]); -void Arg_UseExternalResources(int& i, char* argv[]); -void Arg_SetTextureType(int& i, char* argv[]); -void Arg_ReadConfigFile(int& i, char* argv[]); -void Arg_EnableErrorHandler(int& i, char* argv[]); -void Arg_SetVerbosity(int& i, char* argv[]); -void Arg_VerboseUnaccounted(int& i, char* argv[]); -void Arg_SetExporter(int& i, char* argv[]); -void Arg_EnableGCCCompat(int& i, char* argv[]); -void Arg_ForceStatic(int& i, char* argv[]); -void Arg_ForceUnaccountedStatic(int& i, char* argv[]); -void Arg_CsFloatMode(int& i, char* argv[]); -void Arg_BaseAddress(int& i, char* argv[]); -void Arg_StartOffset(int& i, char* argv[]); -void Arg_EndOffset(int& i, char* argv[]); - -int main(int argc, char* argv[]); - -bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath, - ZFileMode fileMode); - -void ParseArgs(int& argc, char* argv[]); - -void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath); -void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath); -void BuildAssetBlob(const fs::path& blobFilePath, const fs::path& outPath); -ZFileMode ParseFileMode(const std::string& buildMode, ExporterSet* exporterSet); -int HandleExtract(ZFileMode fileMode, ExporterSet* exporterSet); - -extern const char gBuildHash[]; - -int main(int argc, char* argv[]) -{ - int returnCode = 0; - - if (argc < 2) - { - printf("ZAPD.out (%s) [mode (btex/bovl/bsf/bblb/bmdlintr/bamnintr/e)] ...\n", gBuildHash); - return 1; - } - - Globals* g = new Globals(); - WarningHandler::Init(argc, argv); - - for (int i = 1; i < argc; i++) - { - if (!strcmp(argv[i], "--version")) - { - printf("ZAPD.out %s\n", gBuildHash); - return 0; - } - else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) - { - printf("Congratulations!\n"); - printf("You just found the (unimplemented and undocumented) ZAPD's help message.\n"); - printf("Feel free to implement it if you want :D\n"); - - WarningHandler::PrintHelp(); - return 0; - } - } - - ParseArgs(argc, argv); - - // Parse File Mode - ExporterSet* exporterSet = Globals::Instance->GetExporterSet(); - std::string buildMode = argv[1]; - ZFileMode fileMode = ParseFileMode(buildMode, exporterSet); - - if (fileMode == ZFileMode::Invalid) - { - printf("Error: Invalid file mode '%s'\n", buildMode.c_str()); - return 1; - } - - // We've parsed through our commands once. If an exporter exists, it's been set by now. - // Now we'll parse through them again but pass them on to our exporter if one is available. - if (exporterSet != nullptr && exporterSet->parseArgsFunc != nullptr) - { - for (int32_t i = 2; i < argc; i++) - exporterSet->parseArgsFunc(argc, argv, i); - } - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - printf("ZAPD: Zelda Asset Processor For Decomp: %s\n", gBuildHash); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - WarningHandler::PrintWarningsDebugInfo(); - - if (fileMode == ZFileMode::Extract || fileMode == ZFileMode::BuildSourceFile) - returnCode = HandleExtract(fileMode, exporterSet); - else if (fileMode == ZFileMode::BuildTexture) - BuildAssetTexture(Globals::Instance->inputPath, Globals::Instance->texType, - Globals::Instance->outputPath); - else if (fileMode == ZFileMode::BuildBackground) - BuildAssetBackground(Globals::Instance->inputPath, Globals::Instance->outputPath); - else if (fileMode == ZFileMode::BuildBlob) - BuildAssetBlob(Globals::Instance->inputPath, Globals::Instance->outputPath); - - delete g; - return returnCode; -} - -bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath, - ZFileMode fileMode) -{ - tinyxml2::XMLDocument doc; - tinyxml2::XMLError eResult = doc.LoadFile(xmlFilePath.string().c_str()); - - if (eResult != tinyxml2::XML_SUCCESS) - { - // TODO: use XMLDocument::ErrorIDToName to get more specific error messages here - HANDLE_ERROR(WarningType::InvalidXML, - StringHelper::Sprintf("invalid XML file: '%s'", xmlFilePath.c_str()), ""); - return false; - } - - tinyxml2::XMLNode* root = doc.FirstChild(); - - if (root == nullptr) - { - HANDLE_WARNING( - WarningType::InvalidXML, - StringHelper::Sprintf("missing Root tag in xml file: '%s'", xmlFilePath.c_str()), ""); - return false; - } - - for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != NULL; - child = child->NextSiblingElement()) - { - if (std::string_view(child->Name()) == "File") - { - ZFile* file = new ZFile(fileMode, child, basePath, outPath, "", xmlFilePath); - Globals::Instance->files.push_back(file); - if (fileMode == ZFileMode::ExternalFile) - { - Globals::Instance->externalFiles.push_back(file); - file->isExternalFile = true; - } - } - else if (std::string(child->Name()) == "ExternalFile") - { - const char* xmlPathValue = child->Attribute("XmlPath"); - if (xmlPathValue == nullptr) - { - throw std::runtime_error(StringHelper::Sprintf( - "Parse: Fatal error in '%s'.\n" - "\t Missing 'XmlPath' attribute in `ExternalFile` element.\n", - xmlFilePath.c_str())); - } - const char* outPathValue = child->Attribute("OutPath"); - if (outPathValue == nullptr) - { - throw std::runtime_error(StringHelper::Sprintf( - "Parse: Fatal error in '%s'.\n" - "\t Missing 'OutPath' attribute in `ExternalFile` element.\n", - xmlFilePath.c_str())); - } - - fs::path externalXmlFilePath = - Globals::Instance->cfg.externalXmlFolder / fs::path(xmlPathValue); - fs::path externalOutFilePath = fs::path(outPathValue); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - { - printf("Parsing external file: '%s'\n", externalXmlFilePath.c_str()); - } - - // Recursion. What can go wrong? - Parse(externalXmlFilePath, basePath, externalOutFilePath, ZFileMode::ExternalFile); - } - else - { - std::string errorHeader = - StringHelper::Sprintf("when parsing file '%s'", xmlFilePath.c_str()); - std::string errorBody = StringHelper::Sprintf( - "Found a resource outside a File element: '%s'", child->Name()); - HANDLE_ERROR(WarningType::InvalidXML, errorHeader, errorBody); - } - } - - if (fileMode != ZFileMode::ExternalFile) - { - ExporterSet* exporterSet = Globals::Instance->GetExporterSet(); - - if (exporterSet != nullptr && exporterSet->beginXMLFunc != nullptr) - exporterSet->beginXMLFunc(); - - for (ZFile* file : Globals::Instance->files) - { - if (fileMode == ZFileMode::BuildSourceFile) - file->BuildSourceFile(); - else - file->ExtractResources(); - } - - if (exporterSet != nullptr && exporterSet->endXMLFunc != nullptr) - exporterSet->endXMLFunc(); - } - - return true; -} - -void ParseArgs(int& argc, char* argv[]) -{ - static const std::unordered_map ArgFuncDictionary = { - {"-o", &Arg_SetOutputPath}, - {"--outputpath", &Arg_SetOutputPath}, - {"-i", &Arg_SetInputPath}, - {"--inputpath", &Arg_SetInputPath}, - {"-b", &Arg_SetBaseromPath}, - {"--baserompath", &Arg_SetBaseromPath}, - {"-osf", &Arg_SetSourceOutputPath}, - {"-gsf", &Arg_GenerateSourceFile}, - {"-tm", &Arg_TestMode}, - {"-ulzdl", &Arg_LegacyDList}, - {"-profile", &Arg_EnableProfiling}, - {"-uer", &Arg_UseExternalResources}, - {"-tt", &Arg_SetTextureType}, - {"-rconf", &Arg_ReadConfigFile}, - {"-eh", &Arg_EnableErrorHandler}, - {"-v", &Arg_SetVerbosity}, - {"-vu", &Arg_VerboseUnaccounted}, - {"--verbose-unaccounted", &Arg_VerboseUnaccounted}, - {"-se", &Arg_SetExporter}, - {"--set-exporter", &Arg_SetExporter}, - {"--gcc-compat", &Arg_EnableGCCCompat}, - {"-s", &Arg_ForceStatic}, - {"--static", &Arg_ForceStatic}, - {"-us", &Arg_ForceUnaccountedStatic}, - {"--unaccounted-static", &Arg_ForceUnaccountedStatic}, - {"--cs-float", &Arg_CsFloatMode}, - {"--base-address", &Arg_BaseAddress}, - {"--start-offset", &Arg_StartOffset}, - {"--end-offset", &Arg_EndOffset}, - }; - - for (int32_t i = 2; i < argc; i++) - { - std::string arg = argv[i]; - - // Ignore warning args as they have already been parsed - if (arg.length() > 2 && arg[0] == '-' && arg[1] == 'W' && arg[2] != '\0') - { - continue; - } - - auto it = ArgFuncDictionary.find(arg); - if (it == ArgFuncDictionary.end()) - { - fprintf(stderr, "Unsupported argument: %s\n", arg.c_str()); - continue; - } - - std::invoke(it->second, i, argv); - } -} - -ZFileMode ParseFileMode(const std::string& buildMode, ExporterSet* exporterSet) -{ - ZFileMode fileMode = ZFileMode::Invalid; - - if (buildMode == "btex") - fileMode = ZFileMode::BuildTexture; - else if (buildMode == "bren") - fileMode = ZFileMode::BuildBackground; - else if (buildMode == "bsf") - fileMode = ZFileMode::BuildSourceFile; - else if (buildMode == "bblb") - fileMode = ZFileMode::BuildBlob; - else if (buildMode == "e") - fileMode = ZFileMode::Extract; - else if (exporterSet != nullptr && exporterSet->parseFileModeFunc != nullptr) - exporterSet->parseFileModeFunc(buildMode, fileMode); - - return fileMode; -} - -void Arg_SetOutputPath(int& i, [[maybe_unused]] char* argv[]) -{ - Globals::Instance->outputPath = argv[++i]; - - if (Globals::Instance->sourceOutputPath == "") - Globals::Instance->sourceOutputPath = Globals::Instance->outputPath; -} - -void Arg_SetInputPath(int& i, char* argv[]) -{ - Globals::Instance->inputPath = argv[++i]; -} - -void Arg_SetBaseromPath(int& i, char* argv[]) -{ - Globals::Instance->baseRomPath = argv[++i]; -} - -void Arg_SetSourceOutputPath(int& i, char* argv[]) -{ - Globals::Instance->sourceOutputPath = argv[++i]; -} - -void Arg_GenerateSourceFile(int& i, char* argv[]) -{ - // Generate source file during extraction - Globals::Instance->genSourceFile = std::string_view(argv[++i]) == "1"; -} - -void Arg_TestMode(int& i, char* argv[]) -{ - // Test Mode (enables certain experimental features) - Globals::Instance->testMode = std::string_view(argv[++i]) == "1"; -} - -void Arg_LegacyDList(int& i, char* argv[]) -{ - Globals::Instance->useLegacyZDList = std::string_view(argv[++i]) == "1"; -} - -void Arg_EnableProfiling(int& i, char* argv[]) -{ - Globals::Instance->profile = std::string_view(argv[++i]) == "1"; -} - -void Arg_UseExternalResources(int& i, char* argv[]) -{ - // Split resources into their individual components(enabled by default) - // TODO: We may wish to make this a part of the config file... - Globals::Instance->useExternalResources = std::string_view(argv[++i]) == "1"; -} - -void Arg_SetTextureType(int& i, char* argv[]) -{ - Globals::Instance->texType = ZTexture::GetTextureTypeFromString(argv[++i]); -} - -void Arg_ReadConfigFile(int& i, char* argv[]) -{ - Globals::Instance->cfg.ReadConfigFile(argv[++i]); -} - -void Arg_EnableErrorHandler([[maybe_unused]] int& i, [[maybe_unused]] char* argv[]) -{ - CrashHandler_Init(); -} - -void Arg_SetVerbosity(int& i, char* argv[]) -{ - Globals::Instance->verbosity = static_cast(strtol(argv[++i], NULL, 16)); -} - -void Arg_VerboseUnaccounted([[maybe_unused]] int& i, [[maybe_unused]] char* argv[]) -{ - Globals::Instance->verboseUnaccounted = true; -} - -void Arg_SetExporter(int& i, char* argv[]) -{ - Globals::Instance->currentExporter = argv[++i]; -} - -void Arg_EnableGCCCompat([[maybe_unused]] int& i, [[maybe_unused]] char* argv[]) -{ - Globals::Instance->gccCompat = true; -} - -void Arg_ForceStatic([[maybe_unused]] int& i, [[maybe_unused]] char* argv[]) -{ - Globals::Instance->forceStatic = true; -} - -void Arg_ForceUnaccountedStatic([[maybe_unused]] int& i, [[maybe_unused]] char* argv[]) -{ - Globals::Instance->forceUnaccountedStatic = true; -} - -void Arg_CsFloatMode([[maybe_unused]] int& i, [[maybe_unused]] char* argv[]) -{ - i++; - if (std::strcmp(argv[i], "hex") == 0) - { - Globals::Instance->floatType = CsFloatType::HexOnly; - } - else if (std::strcmp(argv[i], "float") == 0) - { - Globals::Instance->floatType = CsFloatType::FloatOnly; - } - else if (std::strcmp(argv[i], "both") == 0) - { - Globals::Instance->floatType = CsFloatType::HexAndFloat; - } - else if (std::strcmp(argv[i], "hex-commented-left") == 0) - { - Globals::Instance->floatType = CsFloatType::HexAndCommentedFloatLeft; - } - else if (std::strcmp(argv[i], "hex-commented-right") == 0) - { - Globals::Instance->floatType = CsFloatType::HexAndCommentedFloatRight; - } - else - { - Globals::Instance->floatType = CsFloatType::FloatOnly; - HANDLE_WARNING( - WarningType::Always, "Invalid CS Float Type", - StringHelper::Sprintf("Invalid CS float type entered. Expected \"hex\", \"float\", " - "\"both\", \"hex-commented-left\" or \"hex-commented-right\". " - "Got %s.\n Defaulting to \"float\".", - argv[i])); - } -} - -uint32_t ParseU32Hex(char* str) -{ - static_assert(sizeof(uint32_t) <= sizeof(unsigned long)); - return (uint32_t)std::stoul(str, nullptr, 16); -} - -void Arg_BaseAddress(int& i, char* argv[]) -{ - Globals::Instance->baseAddress = ParseU32Hex(argv[++i]); -} - -void Arg_StartOffset(int& i, char* argv[]) -{ - Globals::Instance->startOffset = ParseU32Hex(argv[++i]); -} - -void Arg_EndOffset(int& i, char* argv[]) -{ - Globals::Instance->endOffset = ParseU32Hex(argv[++i]); -} - -int HandleExtract(ZFileMode fileMode, ExporterSet* exporterSet) -{ - bool procFileModeSuccess = false; - - if (exporterSet != nullptr && exporterSet->processFileModeFunc != nullptr) - procFileModeSuccess = exporterSet->processFileModeFunc(fileMode); - - if (!procFileModeSuccess) - { - bool parseSuccessful; - - for (auto& extFile : Globals::Instance->cfg.externalFiles) - { - fs::path externalXmlFilePath = - Globals::Instance->cfg.externalXmlFolder / extFile.xmlPath; - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - printf("Parsing external file from config: '%s'\n", externalXmlFilePath.c_str()); - - parseSuccessful = Parse(externalXmlFilePath, Globals::Instance->baseRomPath, - extFile.outPath, ZFileMode::ExternalFile); - - if (!parseSuccessful) - return 1; - } - - parseSuccessful = Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath, - Globals::Instance->outputPath, fileMode); - if (!parseSuccessful) - return 1; - } - - return 0; -} - -void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath) -{ - std::string name = outPath.stem().string(); - - ZTexture tex(nullptr); - - if (name.find("u32") != std::string::npos) - tex.dWordAligned = false; - - tex.FromPNG(pngFilePath.string(), texType); - std::string cfgPath = StringHelper::Split(pngFilePath.string(), ".")[0] + ".cfg"; - - if (File::Exists(cfgPath)) - name = File::ReadAllText(cfgPath); - - std::string src = tex.GetBodySourceCode(); - - File::WriteAllText(outPath.string(), src); -} - -void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath) -{ - ZBackground background(nullptr); - background.ParseBinaryFile(imageFilePath.string(), false); - - File::WriteAllText(outPath.string(), background.GetBodySourceCode()); -} - -void BuildAssetBlob(const fs::path& blobFilePath, const fs::path& outPath) -{ - ZBlob* blob = ZBlob::FromFile(blobFilePath.string()); - std::string name = outPath.stem().string(); // filename without extension - - std::string src = blob->GetBodySourceCode(); - - File::WriteAllText(outPath.string(), src); - - delete blob; -} diff --git a/tools/ZAPD/ZAPD/NuGet/libpng.static.txt b/tools/ZAPD/ZAPD/NuGet/libpng.static.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tools/ZAPD/ZAPD/OtherStructs/CutsceneMM_Commands.cpp b/tools/ZAPD/ZAPD/OtherStructs/CutsceneMM_Commands.cpp deleted file mode 100644 index 960404e598..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/CutsceneMM_Commands.cpp +++ /dev/null @@ -1,622 +0,0 @@ -#include "CutsceneMM_Commands.h" - -#include -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" - -#include "ZCutscene.h" - -/**** GENERIC ****/ - -// Specific for command lists where each entry has size 8 bytes -const std::unordered_map csCommandsDescMM = { - {CutsceneMM_CommandType::CS_CMD_MISC, {"CS_MISC", "(%s, %i, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_LIGHT_SETTING, {"CS_LIGHT_SETTING", "(0x%02X, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_TRANSITION, {"CS_TRANSITION", "(%s, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_MOTION_BLUR, {"CS_MOTION_BLUR", "(%s, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_GIVE_TATL, {"CS_GIVE_TATL", "(%s, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_START_SEQ, {"CS_START_SEQ", "(%s, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_2, - {"CS_SFX_REVERB_INDEX_2", "(0x%04X, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_1, - {"CS_SFX_REVERB_INDEX_1", "(0x%04X, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_MODIFY_SEQ, {"CS_MODIFY_SEQ", "(%s, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_STOP_SEQ, {"CS_STOP_SEQ", "(%s, %i, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_START_AMBIENCE, {"CS_START_AMBIENCE", "(0x%04X, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_FADE_OUT_AMBIENCE, - {"CS_FADE_OUT_AMBIENCE", "(0x%04X, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_DESTINATION, {"CS_DESTINATION", "(%s, %i, %i)"}}, - {CutsceneMM_CommandType::CS_CMD_CHOOSE_CREDITS_SCENES, - {"CS_CHOOSE_CREDITS_SCENES", "(%s, %i, %i)"}}, -}; - -CutsceneMMSubCommandEntry_GenericCmd::CutsceneMMSubCommandEntry_GenericCmd( - const std::vector& rawData, offset_t rawDataIndex, CutsceneMM_CommandType cmdId) - : CutsceneSubCommandEntry(rawData, rawDataIndex), commandId(cmdId) -{ -} - -std::string CutsceneMMSubCommandEntry_GenericCmd::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - const auto& element = csCommandsDescMM.find(commandId); - std::string entryFmt = "CS_UNK_DATA(0x%02X, %i, %i, %i)"; - std::string type = ""; - bool isIndexInSeqId = enumData->seqId.find(base - 1) != enumData->seqId.end(); - - if (element != csCommandsDescMM.end()) - { - entryFmt = element->second.cmdMacro; - entryFmt += element->second.args; - } - - if (commandId == CutsceneMM_CommandType::CS_CMD_MISC && - enumData->miscType.find(base) != enumData->miscType.end()) - type = enumData->miscType[base]; - - else if (commandId == CutsceneMM_CommandType::CS_CMD_TRANSITION && - enumData->transitionType.find(base) != enumData->transitionType.end()) - type = enumData->transitionType[base]; - - else if (commandId == CutsceneMM_CommandType::CS_CMD_MOTION_BLUR && - enumData->motionBlurType.find(base) != enumData->motionBlurType.end()) - type = enumData->motionBlurType[base]; - - else if (commandId == CutsceneMM_CommandType::CS_CMD_MODIFY_SEQ && - enumData->modifySeqType.find(base) != enumData->modifySeqType.end()) - type = enumData->modifySeqType[base]; - - else if (commandId == CutsceneMM_CommandType::CS_CMD_DESTINATION && - enumData->destinationType.find(base) != enumData->destinationType.end()) - type = enumData->destinationType[base]; - - else if (commandId == CutsceneMM_CommandType::CS_CMD_CHOOSE_CREDITS_SCENES && - enumData->chooseCreditsSceneType.find(base) != enumData->chooseCreditsSceneType.end()) - type = enumData->chooseCreditsSceneType[base]; - - else if ((commandId == CutsceneMM_CommandType::CS_CMD_START_SEQ || - commandId == CutsceneMM_CommandType::CS_CMD_STOP_SEQ) && - isIndexInSeqId) - type = enumData->seqId[base - 1]; - - else if (commandId == CutsceneMM_CommandType::CS_CMD_GIVE_TATL) - type = base ? "true" : "false"; - - if (type != "") - return StringHelper::Sprintf(entryFmt.c_str(), type.c_str(), startFrame, endFrame, pad); - - if (commandId == CutsceneMM_CommandType::CS_CMD_LIGHT_SETTING || - commandId == CutsceneMM_CommandType::CS_CMD_START_SEQ || - commandId == CutsceneMM_CommandType::CS_CMD_STOP_SEQ) - { - return StringHelper::Sprintf(entryFmt.c_str(), base - 1, startFrame, endFrame, pad); - } - - return StringHelper::Sprintf(entryFmt.c_str(), base, startFrame, endFrame, pad); -} - -CutsceneMMCommand_GenericCmd::CutsceneMMCommand_GenericCmd(const std::vector& rawData, - offset_t rawDataIndex, - CutsceneMM_CommandType cmdId) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - commandID = static_cast(cmdId); - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneMMSubCommandEntry_GenericCmd(rawData, rawDataIndex, cmdId); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneMMCommand_GenericCmd::GetCommandMacro() const -{ - const auto& element = csCommandsDescMM.find(static_cast(commandID)); - - if (element != csCommandsDescMM.end()) - { - return StringHelper::Sprintf("%s_LIST(%i)", element->second.cmdMacro, numEntries); - } - - return StringHelper::Sprintf("CS_UNK_DATA_LIST(0x%X, %i)", commandID, numEntries); -} - -/**** CAMERA ****/ - -CutsceneSubCommandEntry_SplineCamPoint::CutsceneSubCommandEntry_SplineCamPoint( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - interpType = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0); - weight = BitConverter::ToUInt8BE(rawData, rawDataIndex + 1); - duration = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - posX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); - posY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); - posZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8); - relTo = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10); -} - -std::string CutsceneSubCommandEntry_SplineCamPoint::GetBodySourceCode() const -{ - const auto interpTypeMap = &Globals::Instance->cfg.enumData.interpType; - const auto relToMap = &Globals::Instance->cfg.enumData.relTo; - - return StringHelper::Sprintf("CS_CAM_POINT(%s, 0x%02X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, %s)", - interpTypeMap->at(interpType).c_str(), weight, duration, posX, - posY, posZ, relToMap->at(relTo).c_str()); -} - -size_t CutsceneSubCommandEntry_SplineCamPoint::GetRawSize() const -{ - return 0x0C; -} - -CutsceneSubCommandEntry_SplineMiscPoint::CutsceneSubCommandEntry_SplineMiscPoint( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); - roll = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - fov = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); - unused1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); -} - -std::string CutsceneSubCommandEntry_SplineMiscPoint::GetBodySourceCode() const -{ - return StringHelper::Sprintf("CS_CAM_MISC(0x%04X, 0x%04X, 0x%04X, 0x%04X)", unused0, roll, fov, - unused1); -} - -size_t CutsceneSubCommandEntry_SplineMiscPoint::GetRawSize() const -{ - return 0x08; -} - -CutsceneSubCommandEntry_SplineHeader::CutsceneSubCommandEntry_SplineHeader( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - numEntries = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); - unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - unused1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); - duration = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); -} - -std::string CutsceneSubCommandEntry_SplineHeader::GetBodySourceCode() const -{ - return StringHelper::Sprintf("CS_CAM_SPLINE(0x%04X, 0x%04X, 0x%04X, 0x%04X)", numEntries, - unused0, unused1, duration); -} - -size_t CutsceneSubCommandEntry_SplineHeader::GetRawSize() const -{ - return 0x08; -} - -CutsceneSubCommandEntry_SplineFooter::CutsceneSubCommandEntry_SplineFooter( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - uint16_t firstHalfWord = BitConverter::ToUInt16BE(rawData, rawDataIndex); - uint16_t secondHalfWord = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - - if (firstHalfWord != 0xFFFF || secondHalfWord != 4) - { - HANDLE_ERROR(WarningType::InvalidExtractedData, "Invalid Spline Footer", - StringHelper::Sprintf( - "Invalid Spline footer. Was expecting 0xFFFF, 0x0004. Got 0x%04X, 0x%04X", - firstHalfWord, secondHalfWord)); - } -} - -std::string CutsceneSubCommandEntry_SplineFooter::GetBodySourceCode() const -{ - return "CS_CAM_END()"; -} - -size_t CutsceneSubCommandEntry_SplineFooter::GetRawSize() const -{ - return 0x04; -} - -CutsceneMMCommand_Spline::CutsceneMMCommand_Spline(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - numHeaders = 0; - totalCommands = 0; - rawDataIndex += 4; - - while (1) - { - if (BitConverter::ToUInt16BE(rawData, rawDataIndex) == 0xFFFF) - { - break; - } - numHeaders++; - - auto* header = new CutsceneSubCommandEntry_SplineHeader(rawData, rawDataIndex); - rawDataIndex += header->GetRawSize(); - entries.push_back(header); - - totalCommands += header->numEntries; - - for (uint32_t i = 0; i < header->numEntries; i++) - { - auto* entry = new CutsceneSubCommandEntry_SplineCamPoint(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } - - for (uint32_t i = 0; i < header->numEntries; i++) - { - auto* entry = new CutsceneSubCommandEntry_SplineCamPoint(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } - - for (uint32_t i = 0; i < header->numEntries; i++) - { - auto* entry = new CutsceneSubCommandEntry_SplineMiscPoint(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } - } - - auto* footer = new CutsceneSubCommandEntry_SplineFooter(rawData, rawDataIndex); - entries.push_back(footer); - rawDataIndex += footer->GetRawSize(); -} - -std::string CutsceneMMCommand_Spline::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_CAM_SPLINE_LIST(%i)", numEntries); -} - -size_t CutsceneMMCommand_Spline::GetCommandSize() const -{ - // 8 Bytes once for the spline command, 8 Bytes per spline the header, two groups of size 12, 1 - // group of size 8, 4 bytes for the footer. - return 8 + (8 * numHeaders) + ((totalCommands * 2) * 0xC) + (totalCommands * 8) + 4; -} - -/**** TRANSITION GENERAL ****/ - -CutsceneSubCommandEntry_TransitionGeneral::CutsceneSubCommandEntry_TransitionGeneral( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - unk_06 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x06); - unk_07 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x07); - unk_08 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08); - unk_09 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x09); - unk_0A = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x0A); - unk_0B = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x0B); -} - -std::string CutsceneSubCommandEntry_TransitionGeneral::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (enumData->transitionGeneralType.find(base) != enumData->transitionGeneralType.end()) - return StringHelper::Sprintf("CS_TRANSITION_GENERAL(%s, %i, %i, %i, %i, %i)", - enumData->transitionGeneralType[base].c_str(), startFrame, - endFrame, unk_06, unk_07, unk_08); - - return StringHelper::Sprintf("CS_TRANSITION_GENERAL(0x%02X, %i, %i, %i, %i, %i)", base, - startFrame, endFrame, unk_06, unk_07, unk_08); -} - -size_t CutsceneSubCommandEntry_TransitionGeneral::GetRawSize() const -{ - return 0x0C; -} - -CutsceneMMCommand_TransitionGeneral::CutsceneMMCommand_TransitionGeneral( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneSubCommandEntry_TransitionGeneral(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneMMCommand_TransitionGeneral::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_TRANSITION_GENERAL_LIST(%i)", numEntries); -} - -CutsceneSubCommandEntry_FadeOutSeq::CutsceneSubCommandEntry_FadeOutSeq( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - unk_08 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); -} - -/**** FADE OUT SEQUENCE ****/ - -std::string CutsceneSubCommandEntry_FadeOutSeq::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (enumData->fadeOutSeqPlayer.find(base) != enumData->fadeOutSeqPlayer.end()) - return StringHelper::Sprintf("CS_FADE_OUT_SEQ(%s, %i, %i)", - enumData->fadeOutSeqPlayer[base].c_str(), startFrame, - endFrame); - - return StringHelper::Sprintf("CS_FADE_OUT_SEQ(%i, %i, %i)", base, startFrame, endFrame); -} - -size_t CutsceneSubCommandEntry_FadeOutSeq::GetRawSize() const -{ - return 0x0C; -} - -CutsceneMMCommand_FadeOutSeq::CutsceneMMCommand_FadeOutSeq(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneSubCommandEntry_FadeOutSeq(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneMMCommand_FadeOutSeq::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_FADE_OUT_SEQ_LIST(%i)", numEntries); -} - -/**** NON IMPLEMENTED ****/ - -CutsceneSubCommandEntry_NonImplemented::CutsceneSubCommandEntry_NonImplemented( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ -} - -CutsceneMMCommand_NonImplemented::CutsceneMMCommand_NonImplemented( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneSubCommandEntry_NonImplemented(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -/**** RUMBLE ****/ - -CutsceneMMSubCommandEntry_Rumble::CutsceneMMSubCommandEntry_Rumble( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - intensity = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x06); - decayTimer = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x07); - decayStep = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08); -} - -std::string CutsceneMMSubCommandEntry_Rumble::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (enumData->rumbleType.find(base) != enumData->rumbleType.end()) - return StringHelper::Sprintf("CS_RUMBLE(%s, %i, %i, 0x%02X, 0x%02X, 0x%02X)", - enumData->rumbleType[base].c_str(), startFrame, endFrame, - intensity, decayTimer, decayStep); - - return StringHelper::Sprintf("CS_RUMBLE(0x%04X, %i, %i, 0x%02X, 0x%02X, 0x%02X)", base, - startFrame, endFrame, intensity, decayTimer, decayStep); -} - -size_t CutsceneMMSubCommandEntry_Rumble::GetRawSize() const -{ - return 0x0C; -} - -CutsceneMMCommand_Rumble::CutsceneMMCommand_Rumble(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneMMSubCommandEntry_Rumble(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneMMCommand_Rumble::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_RUMBLE_LIST(%i)", numEntries); -} - -/**** TEXT ****/ - -CutsceneMMSubCommandEntry_Text::CutsceneMMSubCommandEntry_Text(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6); - textId1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8); - textId2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA); -} - -std::string CutsceneMMSubCommandEntry_Text::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (type == 0xFFFF) - { - return StringHelper::Sprintf("CS_TEXT_NONE(%i, %i)", startFrame, endFrame); - } - - if (type == 2 && - enumData->ocarinaSongActionId.find(base) != enumData->ocarinaSongActionId.end()) - { - return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%s, %i, %i, 0x%X)", - enumData->ocarinaSongActionId[base].c_str(), startFrame, - endFrame, textId1); - } - - switch (type) - { - case 0: - return StringHelper::Sprintf("CS_TEXT_DEFAULT(0x%X, %i, %i, 0x%X, 0x%X)", base, startFrame, - endFrame, textId1, textId2); - - case 1: - return StringHelper::Sprintf("CS_TEXT_TYPE_1(0x%X, %i, %i, 0x%X, 0x%X)", base, startFrame, - endFrame, textId1, textId2); - - case 3: - return StringHelper::Sprintf("CS_TEXT_TYPE_3(0x%X, %i, %i, 0x%X, 0x%X)", base, startFrame, - endFrame, textId1, textId2); - - case 4: - return StringHelper::Sprintf("CS_TEXT_BOSSES_REMAINS(0x%X, %i, %i, 0x%X)", base, startFrame, - endFrame, textId1); - - case 5: - return StringHelper::Sprintf("CS_TEXT_ALL_NORMAL_MASKS(0x%X, %i, %i, 0x%X)", base, - startFrame, endFrame, textId1); - } - - return nullptr; -} - -size_t CutsceneMMSubCommandEntry_Text::GetRawSize() const -{ - return 0x0C; -} - -CutsceneMMCommand_Text::CutsceneMMCommand_Text(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneMMSubCommandEntry_Text(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneMMCommand_Text::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_TEXT_LIST(%i)", numEntries); -} - -/**** ACTOR CUE ****/ - -CutsceneMMSubCommandEntry_ActorCue::CutsceneMMSubCommandEntry_ActorCue( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6); - rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8); - rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA); - startPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0xC); - startPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x10); - startPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x14); - endPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x18); - endPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x1C); - endPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x20); - normalX = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x24); - normalY = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x28); - normalZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x2C); -} - -std::string CutsceneMMSubCommandEntry_ActorCue::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - std::string normalXStr = - ZCutscene::GetCsEncodedFloat(normalX, Globals::Instance->floatType, true); - std::string normalYStr = - ZCutscene::GetCsEncodedFloat(normalY, Globals::Instance->floatType, true); - std::string normalZStr = - ZCutscene::GetCsEncodedFloat(normalZ, Globals::Instance->floatType, true); - - if (static_cast(commandID) == CutsceneMM_CommandType::CS_CMD_PLAYER_CUE) - { - return StringHelper::Sprintf("CS_PLAYER_CUE(%s, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, " - "%i, %i, %i, %i, %s, %s, %s)", - enumData->playerCueId[base].c_str(), startFrame, endFrame, - rotX, rotY, rotZ, startPosX, startPosY, startPosZ, endPosX, - endPosY, endPosZ, normalXStr.c_str(), normalYStr.c_str(), - normalZStr.c_str()); - } - else - { - return StringHelper::Sprintf("CS_ACTOR_CUE(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, " - "%i, %i, %i, %i, %s, %s, %s)", - base, startFrame, endFrame, rotX, rotY, rotZ, startPosX, - startPosY, startPosZ, endPosX, endPosY, endPosZ, - normalXStr.c_str(), normalYStr.c_str(), normalZStr.c_str()); - } -} - -size_t CutsceneMMSubCommandEntry_ActorCue::GetRawSize() const -{ - return 0x30; -} - -CutsceneMMCommand_ActorCue::CutsceneMMCommand_ActorCue(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneMMSubCommandEntry_ActorCue(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneMMCommand_ActorCue::GetCommandMacro() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (static_cast(commandID) == CutsceneMM_CommandType::CS_CMD_PLAYER_CUE) - { - return StringHelper::Sprintf("CS_PLAYER_CUE_LIST(%i)", numEntries); - } - - if (enumData->cutsceneCmd.find(commandID) != enumData->cutsceneCmd.end()) - { - return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(%s, %i)", - enumData->cutsceneCmd[commandID].c_str(), numEntries); - } - return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(0x%03X, %i)", commandID, numEntries); -} diff --git a/tools/ZAPD/ZAPD/OtherStructs/CutsceneMM_Commands.h b/tools/ZAPD/ZAPD/OtherStructs/CutsceneMM_Commands.h deleted file mode 100644 index 597f6788bc..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/CutsceneMM_Commands.h +++ /dev/null @@ -1,481 +0,0 @@ -#pragma once - -#include "Cutscene_Common.h" - -// https://github.com/zeldaret/mm/blob/0c7b90cf97f26483c8b6a98ae099a295f61e72ab/include/z64cutscene.h#L294-530 -enum class CutsceneMM_CommandType -{ - /* -2 */ CS_CMD_ACTOR_CUE_POST_PROCESS = -2, - /* -1 */ CS_CAM_STOP, - /* 0x00A */ CS_CMD_TEXT = 10, - /* 0x05A */ CS_CMD_CAMERA_SPLINE = 90, - /* 0x064 */ CS_CMD_ACTOR_CUE_100 = 100, - /* 0x065 */ CS_CMD_ACTOR_CUE_101, - /* 0x066 */ CS_CMD_ACTOR_CUE_102, - /* 0x067 */ CS_CMD_ACTOR_CUE_103, - /* 0x068 */ CS_CMD_ACTOR_CUE_104, - /* 0x069 */ CS_CMD_ACTOR_CUE_105, - /* 0x06A */ CS_CMD_ACTOR_CUE_106, - /* 0x06B */ CS_CMD_ACTOR_CUE_107, - /* 0x06C */ CS_CMD_ACTOR_CUE_108, - /* 0x06D */ CS_CMD_ACTOR_CUE_109, - /* 0x06E */ CS_CMD_ACTOR_CUE_110, - /* 0x06F */ CS_CMD_ACTOR_CUE_111, - /* 0x070 */ CS_CMD_ACTOR_CUE_112, - /* 0x071 */ CS_CMD_ACTOR_CUE_113, - /* 0x072 */ CS_CMD_ACTOR_CUE_114, - /* 0x073 */ CS_CMD_ACTOR_CUE_115, - /* 0x074 */ CS_CMD_ACTOR_CUE_116, - /* 0x075 */ CS_CMD_ACTOR_CUE_117, - /* 0x076 */ CS_CMD_ACTOR_CUE_118, - /* 0x077 */ CS_CMD_ACTOR_CUE_119, - /* 0x078 */ CS_CMD_ACTOR_CUE_120, - /* 0x079 */ CS_CMD_ACTOR_CUE_121, - /* 0x07A */ CS_CMD_ACTOR_CUE_122, - /* 0x07B */ CS_CMD_ACTOR_CUE_123, - /* 0x07C */ CS_CMD_ACTOR_CUE_124, - /* 0x07D */ CS_CMD_ACTOR_CUE_125, - /* 0x07E */ CS_CMD_ACTOR_CUE_126, - /* 0x07F */ CS_CMD_ACTOR_CUE_127, - /* 0x080 */ CS_CMD_ACTOR_CUE_128, - /* 0x081 */ CS_CMD_ACTOR_CUE_129, - /* 0x082 */ CS_CMD_ACTOR_CUE_130, - /* 0x083 */ CS_CMD_ACTOR_CUE_131, - /* 0x084 */ CS_CMD_ACTOR_CUE_132, - /* 0x085 */ CS_CMD_ACTOR_CUE_133, - /* 0x086 */ CS_CMD_ACTOR_CUE_134, - /* 0x087 */ CS_CMD_ACTOR_CUE_135, - /* 0x088 */ CS_CMD_ACTOR_CUE_136, - /* 0x089 */ CS_CMD_ACTOR_CUE_137, - /* 0x08A */ CS_CMD_ACTOR_CUE_138, - /* 0x08B */ CS_CMD_ACTOR_CUE_139, - /* 0x08C */ CS_CMD_ACTOR_CUE_140, - /* 0x08D */ CS_CMD_ACTOR_CUE_141, - /* 0x08E */ CS_CMD_ACTOR_CUE_142, - /* 0x08F */ CS_CMD_ACTOR_CUE_143, - /* 0x090 */ CS_CMD_ACTOR_CUE_144, - /* 0x091 */ CS_CMD_ACTOR_CUE_145, - /* 0x092 */ CS_CMD_ACTOR_CUE_146, - /* 0x093 */ CS_CMD_ACTOR_CUE_147, - /* 0x094 */ CS_CMD_ACTOR_CUE_148, - /* 0x095 */ CS_CMD_ACTOR_CUE_149, - /* 0x096 */ CS_CMD_MISC, - /* 0x097 */ CS_CMD_LIGHT_SETTING, - /* 0x098 */ CS_CMD_TRANSITION, - /* 0x099 */ CS_CMD_MOTION_BLUR, - /* 0x09A */ CS_CMD_GIVE_TATL, - /* 0x09B */ CS_CMD_TRANSITION_GENERAL, - /* 0x09C */ CS_CMD_FADE_OUT_SEQ, - /* 0x09D */ CS_CMD_TIME, - /* 0x0C8 */ CS_CMD_PLAYER_CUE = 200, - /* 0x0C9 */ CS_CMD_ACTOR_CUE_201, - /* 0x0FA */ CS_CMD_UNK_DATA_FA = 0xFA, - /* 0x0FE */ CS_CMD_UNK_DATA_FE = 0xFE, - /* 0x0FF */ CS_CMD_UNK_DATA_FF, - /* 0x100 */ CS_CMD_UNK_DATA_100, - /* 0x101 */ CS_CMD_UNK_DATA_101, - /* 0x102 */ CS_CMD_UNK_DATA_102, - /* 0x103 */ CS_CMD_UNK_DATA_103, - /* 0x104 */ CS_CMD_UNK_DATA_104, - /* 0x105 */ CS_CMD_UNK_DATA_105, - /* 0x108 */ CS_CMD_UNK_DATA_108 = 0x108, - /* 0x109 */ CS_CMD_UNK_DATA_109, - /* 0x12C */ CS_CMD_START_SEQ = 300, - /* 0x12D */ CS_CMD_STOP_SEQ, - /* 0x12E */ CS_CMD_START_AMBIENCE, - /* 0x12F */ CS_CMD_FADE_OUT_AMBIENCE, - /* 0x130 */ CS_CMD_SFX_REVERB_INDEX_2, - /* 0x131 */ CS_CMD_SFX_REVERB_INDEX_1, - /* 0x132 */ CS_CMD_MODIFY_SEQ, - /* 0x15E */ CS_CMD_DESTINATION = 350, - /* 0x15F */ CS_CMD_CHOOSE_CREDITS_SCENES, - /* 0x190 */ CS_CMD_RUMBLE = 400, - /* 0x1C2 */ CS_CMD_ACTOR_CUE_450 = 450, - /* 0x1C3 */ CS_CMD_ACTOR_CUE_451, - /* 0x1C4 */ CS_CMD_ACTOR_CUE_452, - /* 0x1C5 */ CS_CMD_ACTOR_CUE_453, - /* 0x1C6 */ CS_CMD_ACTOR_CUE_454, - /* 0x1C7 */ CS_CMD_ACTOR_CUE_455, - /* 0x1C8 */ CS_CMD_ACTOR_CUE_456, - /* 0x1C9 */ CS_CMD_ACTOR_CUE_457, - /* 0x1CA */ CS_CMD_ACTOR_CUE_458, - /* 0x1CB */ CS_CMD_ACTOR_CUE_459, - /* 0x1CC */ CS_CMD_ACTOR_CUE_460, - /* 0x1CD */ CS_CMD_ACTOR_CUE_461, - /* 0x1CE */ CS_CMD_ACTOR_CUE_462, - /* 0x1CF */ CS_CMD_ACTOR_CUE_463, - /* 0x1D0 */ CS_CMD_ACTOR_CUE_464, - /* 0x1D1 */ CS_CMD_ACTOR_CUE_465, - /* 0x1D2 */ CS_CMD_ACTOR_CUE_466, - /* 0x1D3 */ CS_CMD_ACTOR_CUE_467, - /* 0x1D4 */ CS_CMD_ACTOR_CUE_468, - /* 0x1D5 */ CS_CMD_ACTOR_CUE_469, - /* 0x1D6 */ CS_CMD_ACTOR_CUE_470, - /* 0x1D7 */ CS_CMD_ACTOR_CUE_471, - /* 0x1D8 */ CS_CMD_ACTOR_CUE_472, - /* 0x1D9 */ CS_CMD_ACTOR_CUE_473, - /* 0x1DA */ CS_CMD_ACTOR_CUE_474, - /* 0x1DB */ CS_CMD_ACTOR_CUE_475, - /* 0x1DC */ CS_CMD_ACTOR_CUE_476, - /* 0x1DD */ CS_CMD_ACTOR_CUE_477, - /* 0x1DE */ CS_CMD_ACTOR_CUE_478, - /* 0x1DF */ CS_CMD_ACTOR_CUE_479, - /* 0x1E0 */ CS_CMD_ACTOR_CUE_480, - /* 0x1E1 */ CS_CMD_ACTOR_CUE_481, - /* 0x1E2 */ CS_CMD_ACTOR_CUE_482, - /* 0x1E3 */ CS_CMD_ACTOR_CUE_483, - /* 0x1E4 */ CS_CMD_ACTOR_CUE_484, - /* 0x1E5 */ CS_CMD_ACTOR_CUE_485, - /* 0x1E6 */ CS_CMD_ACTOR_CUE_486, - /* 0x1E7 */ CS_CMD_ACTOR_CUE_487, - /* 0x1E8 */ CS_CMD_ACTOR_CUE_488, - /* 0x1E9 */ CS_CMD_ACTOR_CUE_489, - /* 0x1EA */ CS_CMD_ACTOR_CUE_490, - /* 0x1EB */ CS_CMD_ACTOR_CUE_491, - /* 0x1EC */ CS_CMD_ACTOR_CUE_492, - /* 0x1ED */ CS_CMD_ACTOR_CUE_493, - /* 0x1EE */ CS_CMD_ACTOR_CUE_494, - /* 0x1EF */ CS_CMD_ACTOR_CUE_495, - /* 0x1F0 */ CS_CMD_ACTOR_CUE_496, - /* 0x1F1 */ CS_CMD_ACTOR_CUE_497, - /* 0x1F2 */ CS_CMD_ACTOR_CUE_498, - /* 0x1F3 */ CS_CMD_ACTOR_CUE_499, - /* 0x1F4 */ CS_CMD_ACTOR_CUE_500, - /* 0x1F5 */ CS_CMD_ACTOR_CUE_501, - /* 0x1F6 */ CS_CMD_ACTOR_CUE_502, - /* 0x1F7 */ CS_CMD_ACTOR_CUE_503, - /* 0x1F8 */ CS_CMD_ACTOR_CUE_504, - /* 0x1F9 */ CS_CMD_ACTOR_CUE_SOTCS, - /* 0x1FA */ CS_CMD_ACTOR_CUE_506, - /* 0x1FB */ CS_CMD_ACTOR_CUE_507, - /* 0x1FC */ CS_CMD_ACTOR_CUE_508, - /* 0x1FD */ CS_CMD_ACTOR_CUE_509, - /* 0x1FE */ CS_CMD_ACTOR_CUE_510, - /* 0x1FF */ CS_CMD_ACTOR_CUE_511, - /* 0x200 */ CS_CMD_ACTOR_CUE_512, - /* 0x201 */ CS_CMD_ACTOR_CUE_513, - /* 0x202 */ CS_CMD_ACTOR_CUE_514, - /* 0x203 */ CS_CMD_ACTOR_CUE_515, - /* 0x204 */ CS_CMD_ACTOR_CUE_516, - /* 0x205 */ CS_CMD_ACTOR_CUE_517, - /* 0x206 */ CS_CMD_ACTOR_CUE_518, - /* 0x207 */ CS_CMD_ACTOR_CUE_519, - /* 0x208 */ CS_CMD_ACTOR_CUE_520, - /* 0x209 */ CS_CMD_ACTOR_CUE_521, - /* 0x20A */ CS_CMD_ACTOR_CUE_522, - /* 0x20B */ CS_CMD_ACTOR_CUE_523, - /* 0x20C */ CS_CMD_ACTOR_CUE_524, - /* 0x20D */ CS_CMD_ACTOR_CUE_525, - /* 0x20E */ CS_CMD_ACTOR_CUE_526, - /* 0x20F */ CS_CMD_ACTOR_CUE_527, - /* 0x210 */ CS_CMD_ACTOR_CUE_528, - /* 0x211 */ CS_CMD_ACTOR_CUE_529, - /* 0x212 */ CS_CMD_ACTOR_CUE_530, - /* 0x213 */ CS_CMD_ACTOR_CUE_531, - /* 0x214 */ CS_CMD_ACTOR_CUE_532, - /* 0x215 */ CS_CMD_ACTOR_CUE_533, - /* 0x216 */ CS_CMD_ACTOR_CUE_534, - /* 0x217 */ CS_CMD_ACTOR_CUE_535, - /* 0x218 */ CS_CMD_ACTOR_CUE_536, - /* 0x219 */ CS_CMD_ACTOR_CUE_537, - /* 0x21A */ CS_CMD_ACTOR_CUE_538, - /* 0x21B */ CS_CMD_ACTOR_CUE_539, - /* 0x21C */ CS_CMD_ACTOR_CUE_540, - /* 0x21D */ CS_CMD_ACTOR_CUE_541, - /* 0x21E */ CS_CMD_ACTOR_CUE_542, - /* 0x21F */ CS_CMD_ACTOR_CUE_543, - /* 0x220 */ CS_CMD_ACTOR_CUE_544, - /* 0x221 */ CS_CMD_ACTOR_CUE_545, - /* 0x222 */ CS_CMD_ACTOR_CUE_546, - /* 0x223 */ CS_CMD_ACTOR_CUE_547, - /* 0x224 */ CS_CMD_ACTOR_CUE_548, - /* 0x225 */ CS_CMD_ACTOR_CUE_549, - /* 0x226 */ CS_CMD_ACTOR_CUE_550, - /* 0x227 */ CS_CMD_ACTOR_CUE_551, - /* 0x228 */ CS_CMD_ACTOR_CUE_552, - /* 0x229 */ CS_CMD_ACTOR_CUE_553, - /* 0x22A */ CS_CMD_ACTOR_CUE_554, - /* 0x22B */ CS_CMD_ACTOR_CUE_555, - /* 0x22C */ CS_CMD_ACTOR_CUE_556, - /* 0x22D */ CS_CMD_ACTOR_CUE_557, - /* 0x22E */ CS_CMD_ACTOR_CUE_558, - /* 0x22F */ CS_CMD_ACTOR_CUE_559, - /* 0x230 */ CS_CMD_ACTOR_CUE_560, - /* 0x231 */ CS_CMD_ACTOR_CUE_561, - /* 0x232 */ CS_CMD_ACTOR_CUE_562, - /* 0x233 */ CS_CMD_ACTOR_CUE_563, - /* 0x234 */ CS_CMD_ACTOR_CUE_564, - /* 0x235 */ CS_CMD_ACTOR_CUE_565, - /* 0x236 */ CS_CMD_ACTOR_CUE_566, - /* 0x237 */ CS_CMD_ACTOR_CUE_567, - /* 0x238 */ CS_CMD_ACTOR_CUE_568, - /* 0x239 */ CS_CMD_ACTOR_CUE_569, - /* 0x23A */ CS_CMD_ACTOR_CUE_570, - /* 0x23B */ CS_CMD_ACTOR_CUE_571, - /* 0x23C */ CS_CMD_ACTOR_CUE_572, - /* 0x23D */ CS_CMD_ACTOR_CUE_573, - /* 0x23E */ CS_CMD_ACTOR_CUE_574, - /* 0x23F */ CS_CMD_ACTOR_CUE_575, - /* 0x240 */ CS_CMD_ACTOR_CUE_576, - /* 0x241 */ CS_CMD_ACTOR_CUE_577, - /* 0x242 */ CS_CMD_ACTOR_CUE_578, - /* 0x243 */ CS_CMD_ACTOR_CUE_579, - /* 0x244 */ CS_CMD_ACTOR_CUE_580, - /* 0x245 */ CS_CMD_ACTOR_CUE_581, - /* 0x246 */ CS_CMD_ACTOR_CUE_582, - /* 0x247 */ CS_CMD_ACTOR_CUE_583, - /* 0x248 */ CS_CMD_ACTOR_CUE_584, - /* 0x249 */ CS_CMD_ACTOR_CUE_585, - /* 0x24A */ CS_CMD_ACTOR_CUE_586, - /* 0x24B */ CS_CMD_ACTOR_CUE_587, - /* 0x24C */ CS_CMD_ACTOR_CUE_588, - /* 0x24D */ CS_CMD_ACTOR_CUE_589, - /* 0x24E */ CS_CMD_ACTOR_CUE_590, - /* 0x24F */ CS_CMD_ACTOR_CUE_591, - /* 0x250 */ CS_CMD_ACTOR_CUE_592, - /* 0x251 */ CS_CMD_ACTOR_CUE_593, - /* 0x252 */ CS_CMD_ACTOR_CUE_594, - /* 0x253 */ CS_CMD_ACTOR_CUE_595, - /* 0x254 */ CS_CMD_ACTOR_CUE_596, - /* 0x255 */ CS_CMD_ACTOR_CUE_597, - /* 0x256 */ CS_CMD_ACTOR_CUE_598, - /* 0x257 */ CS_CMD_ACTOR_CUE_599 -}; - -/**** GENERIC ****/ - -class CutsceneMMSubCommandEntry_GenericCmd : public CutsceneSubCommandEntry -{ -public: - CutsceneMM_CommandType commandId; - - CutsceneMMSubCommandEntry_GenericCmd(const std::vector& rawData, offset_t rawDataIndex, - CutsceneMM_CommandType cmdId); - - std::string GetBodySourceCode() const override; -}; - -class CutsceneMMCommand_GenericCmd : public CutsceneCommand -{ -public: - CutsceneMMCommand_GenericCmd(const std::vector& rawData, offset_t rawDataIndex, - CutsceneMM_CommandType cmdId); - - std::string GetCommandMacro() const override; -}; - -/**** CAMERA ****/ - -// TODO: MM cutscene camera command is implemented as a placeholder until we better understand how -// it works - -class CutsceneSubCommandEntry_SplineCamPoint : public CutsceneSubCommandEntry -{ -public: - uint8_t interpType; - uint8_t weight; - uint16_t duration; - - uint16_t posX; - uint16_t posY; - - uint16_t posZ; - uint16_t relTo; - - CutsceneSubCommandEntry_SplineCamPoint(const std::vector& rawData, - offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneSubCommandEntry_SplineMiscPoint : public CutsceneSubCommandEntry -{ -public: - uint16_t unused0; - uint16_t roll; - uint16_t fov; - uint16_t unused1; - - CutsceneSubCommandEntry_SplineMiscPoint(const std::vector& rawData, - offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneSubCommandEntry_SplineFooter : public CutsceneSubCommandEntry -{ -public: - CutsceneSubCommandEntry_SplineFooter(const std::vector& rawData, - offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneSubCommandEntry_SplineHeader : public CutsceneSubCommandEntry -{ -public: - uint16_t numEntries; - uint16_t unused0; - uint16_t unused1; - uint16_t duration; - CutsceneSubCommandEntry_SplineHeader(const std::vector& rawData, - offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneMMCommand_Spline : public CutsceneCommand -{ -public: - uint32_t numHeaders; - uint32_t totalCommands; - CutsceneMMCommand_Spline(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; - size_t GetCommandSize() const override; -}; - -/**** TRANSITION GENERAL ****/ - -class CutsceneSubCommandEntry_TransitionGeneral : public CutsceneSubCommandEntry -{ -public: - uint8_t unk_06; - uint8_t unk_07; - uint8_t unk_08; - uint8_t unk_09; - uint8_t unk_0A; - uint8_t unk_0B; - - CutsceneSubCommandEntry_TransitionGeneral(const std::vector& rawData, - offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneMMCommand_TransitionGeneral : public CutsceneCommand -{ -public: - CutsceneMMCommand_TransitionGeneral(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; - -/**** FADE OUT SEQUENCE ****/ - -class CutsceneSubCommandEntry_FadeOutSeq : public CutsceneSubCommandEntry -{ -public: - uint32_t unk_08; - - CutsceneSubCommandEntry_FadeOutSeq(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneMMCommand_FadeOutSeq : public CutsceneCommand -{ -public: - CutsceneMMCommand_FadeOutSeq(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; - -/**** NON IMPLEMENTED ****/ - -class CutsceneSubCommandEntry_NonImplemented : public CutsceneSubCommandEntry -{ -public: - CutsceneSubCommandEntry_NonImplemented(const std::vector& rawData, - offset_t rawDataIndex); -}; - -class CutsceneMMCommand_NonImplemented : public CutsceneCommand -{ -public: - CutsceneMMCommand_NonImplemented(const std::vector& rawData, offset_t rawDataIndex); -}; - -/**** RUMBLE ****/ - -class CutsceneMMSubCommandEntry_Rumble : public CutsceneSubCommandEntry -{ -public: - uint8_t intensity; - uint8_t decayTimer; - uint8_t decayStep; - - CutsceneMMSubCommandEntry_Rumble(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneMMCommand_Rumble : public CutsceneCommand -{ -public: - CutsceneMMCommand_Rumble(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; - -/**** TEXT ****/ - -class CutsceneMMSubCommandEntry_Text : public CutsceneSubCommandEntry -{ -public: - uint16_t type; - uint16_t textId1; - uint16_t textId2; - - CutsceneMMSubCommandEntry_Text(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneMMCommand_Text : public CutsceneCommand -{ -public: - CutsceneMMCommand_Text(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; - -/**** ACTOR CUE ****/ - -class CutsceneMMSubCommandEntry_ActorCue : public CutsceneSubCommandEntry -{ -public: - uint16_t rotX, rotY, rotZ; - int32_t startPosX, startPosY, startPosZ; - int32_t endPosX, endPosY, endPosZ; - float normalX, normalY, normalZ; - - CutsceneMMSubCommandEntry_ActorCue(const std::vector& rawData, offset_t rawDataIndex); - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneMMCommand_ActorCue : public CutsceneCommand -{ -public: - CutsceneMMCommand_ActorCue(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; diff --git a/tools/ZAPD/ZAPD/OtherStructs/CutsceneOoT_Commands.cpp b/tools/ZAPD/ZAPD/OtherStructs/CutsceneOoT_Commands.cpp deleted file mode 100644 index 668657e7aa..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/CutsceneOoT_Commands.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "CutsceneOoT_Commands.h" - -#include -#include -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -#include "ZCutscene.h" - -/**** GENERIC ****/ - -// Specific for command lists where each entry has size 0x30 bytes -const std::unordered_map csCommandsDesc = { - {CutsceneOoT_CommandType::CS_CMD_MISC, - {"CS_MISC", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}}, - {CutsceneOoT_CommandType::CS_CMD_LIGHT_SETTING, - {"CS_LIGHT_SETTING", "(0x%02X, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}}, - {CutsceneOoT_CommandType::CS_CMD_START_SEQ, - {"CS_START_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}}, - {CutsceneOoT_CommandType::CS_CMD_STOP_SEQ, - {"CS_STOP_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}}, - {CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ, - {"CS_FADE_OUT_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}}, -}; - -CutsceneOoTSubCommandEntry_GenericCmd::CutsceneOoTSubCommandEntry_GenericCmd( - const std::vector& rawData, offset_t rawDataIndex, CutsceneOoT_CommandType cmdId) - : CutsceneSubCommandEntry(rawData, rawDataIndex), commandId(cmdId) -{ - word0 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0); - word1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x4); - - unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x8); - unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0xC); - unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x10); - unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x14); - unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x18); - unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x1C); - unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x20); - unused8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x24); - unused9 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x28); - unused10 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x2C); -} - -std::string CutsceneOoTSubCommandEntry_GenericCmd::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - const auto& element = csCommandsDesc.find(commandId); - - if (element != csCommandsDesc.end()) - { - bool isIndexInMisc = enumData->miscType.find(base) != enumData->miscType.end(); - bool isIndexInFade = - enumData->fadeOutSeqPlayer.find(base) != enumData->fadeOutSeqPlayer.end(); - bool isIndexInSeqId = enumData->seqId.find(base - 1) != enumData->seqId.end(); - std::string entryFmt = element->second.cmdMacro; - std::string firstArg; - entryFmt += element->second.args; - - if (commandId == CutsceneOoT_CommandType::CS_CMD_MISC && isIndexInMisc) - firstArg = enumData->miscType[base]; - else if (commandId == CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ && isIndexInFade) - firstArg = enumData->fadeOutSeqPlayer[base]; - else if (commandId == CutsceneOoT_CommandType::CS_CMD_START_SEQ && isIndexInSeqId) - firstArg = enumData->seqId[base - 1]; - else if (commandId == CutsceneOoT_CommandType::CS_CMD_STOP_SEQ && isIndexInSeqId) - firstArg = enumData->seqId[base - 1]; - else - { - return StringHelper::Sprintf(entryFmt.c_str(), base - 1, startFrame, endFrame, pad, - unused1, unused2, unused3, unused4, unused5, unused6, - unused7, unused8, unused9, unused10); - } - return StringHelper::Sprintf(entryFmt.c_str(), firstArg.c_str(), startFrame, endFrame, pad, - unused1, unused2, unused3, unused4, unused5, unused6, unused7, - unused8, unused9, unused10); - } - return StringHelper::Sprintf("CS_UNK_DATA(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, " - "0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)", - word0, word1, unused1, unused2, unused3, unused4, unused5, unused6, - unused7, unused8, unused9, unused10); -} - -size_t CutsceneOoTSubCommandEntry_GenericCmd::GetRawSize() const -{ - return 0x30; -} - -CutsceneOoTCommand_GenericCmd::CutsceneOoTCommand_GenericCmd(const std::vector& rawData, - offset_t rawDataIndex, - CutsceneOoT_CommandType cmdId) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - commandID = static_cast(cmdId); - entries.reserve(numEntries); - - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneOoTSubCommandEntry_GenericCmd(rawData, rawDataIndex, cmdId); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneOoTCommand_GenericCmd::GetCommandMacro() const -{ - const auto& element = csCommandsDesc.find(static_cast(commandID)); - - if (element != csCommandsDesc.end()) - { - return StringHelper::Sprintf("%s_LIST(%i)", element->second.cmdMacro, numEntries); - } - - return StringHelper::Sprintf("CS_UNK_DATA_LIST(0x%X, %i)", commandID, numEntries); -} - -/**** CAMERA ****/ - -CutsceneOoTCommand_CameraPoint::CutsceneOoTCommand_CameraPoint(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - continueFlag = BitConverter::ToInt8BE(rawData, rawDataIndex + 0); - cameraRoll = BitConverter::ToInt8BE(rawData, rawDataIndex + 1); - nextPointFrame = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - viewAngle = BitConverter::ToFloatBE(rawData, rawDataIndex + 4); - - posX = BitConverter::ToInt16BE(rawData, rawDataIndex + 8); - posY = BitConverter::ToInt16BE(rawData, rawDataIndex + 10); - posZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 12); - - unused = BitConverter::ToInt16BE(rawData, rawDataIndex + 14); -} - -std::string CutsceneOoTCommand_CameraPoint::GetBodySourceCode() const -{ - std::string continueMacro = "CS_CAM_CONTINUE"; - if (continueFlag != 0) - continueMacro = "CS_CAM_STOP"; - - return StringHelper::Sprintf( - "CS_CAM_POINT(%s, 0x%02X, %i, %s, %i, %i, %i, 0x%04X)", continueMacro.c_str(), cameraRoll, - nextPointFrame, - ZCutscene::GetCsEncodedFloat(viewAngle, Globals::Instance->floatType, false).c_str(), posX, - posY, posZ, unused); -} - -size_t CutsceneOoTCommand_CameraPoint::GetRawSize() const -{ - return 0x10; -} - -CutsceneOoTCommand_GenericCameraCmd::CutsceneOoTCommand_GenericCameraCmd( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); - startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); - unused = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); - - bool shouldContinue = true; - - uint32_t currentPtr = rawDataIndex + 8; - - while (shouldContinue) - { - CutsceneOoTCommand_CameraPoint* camPoint = - new CutsceneOoTCommand_CameraPoint(rawData, currentPtr); - entries.push_back(camPoint); - - if (camPoint->continueFlag == -1) - shouldContinue = false; - - currentPtr += camPoint->GetRawSize(); - } -} - -std::string CutsceneOoTCommand_GenericCameraCmd::GetCommandMacro() const -{ - std::string result; - const char* listStr; - - if (commandID == (uint32_t)CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE) - { - listStr = "CS_CAM_AT_SPLINE"; - } - else if (commandID == (uint32_t)CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER) - { - listStr = "CS_CAM_AT_SPLINE_REL_TO_PLAYER"; - } - else if (commandID == (uint32_t)CutsceneOoT_CommandType::CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER) - { - listStr = "CS_CAM_EYE_SPLINE_REL_TO_PLAYER"; - } - else - { - listStr = "CS_CAM_EYE_SPLINE"; - } - - result += StringHelper::Sprintf("%s(%i, %i)", listStr, startFrame, endFrame); - - return result; -} - -size_t CutsceneOoTCommand_GenericCameraCmd::GetCommandSize() const -{ - return 0x0C + entries.at(0)->GetRawSize() * entries.size(); -} - -/**** RUMBLE ****/ - -CutsceneOoTSubCommandEntry_Rumble::CutsceneOoTSubCommandEntry_Rumble( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - sourceStrength = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x06); - duration = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x07); - decreaseRate = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08); - unk_09 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x09); - unk_0A = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x0A); -} - -std::string CutsceneOoTSubCommandEntry_Rumble::GetBodySourceCode() const -{ - // Note: the first argument is unused - return StringHelper::Sprintf("CS_RUMBLE_CONTROLLER(%i, %i, %i, %i, %i, %i, 0x%02X, 0x%02X)", - base, startFrame, endFrame, sourceStrength, duration, decreaseRate, - unk_09, unk_0A); -} - -size_t CutsceneOoTSubCommandEntry_Rumble::GetRawSize() const -{ - return 0x0C; -} - -CutsceneOoTCommand_Rumble::CutsceneOoTCommand_Rumble(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneOoTSubCommandEntry_Rumble(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneOoTCommand_Rumble::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_RUMBLE_CONTROLLER_LIST(%i)", numEntries); -} - -/**** TEXT ****/ - -CutsceneOoTSubCommandEntry_Text::CutsceneOoTSubCommandEntry_Text( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6); - textId1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8); - textId2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA); -} - -std::string CutsceneOoTSubCommandEntry_Text::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (type == 0xFFFF) - { - return StringHelper::Sprintf("CS_TEXT_NONE(%i, %i)", startFrame, endFrame); - } - if (type == 2 && - enumData->ocarinaSongActionId.find(base) != enumData->ocarinaSongActionId.end()) - { - return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%s, %i, %i, 0x%X)", - enumData->ocarinaSongActionId[base].c_str(), startFrame, - endFrame, textId1); - } - - if (enumData->textType.find(type) != enumData->textType.end()) - { - return StringHelper::Sprintf("CS_TEXT(0x%X, %i, %i, %s, 0x%X, 0x%X)", base, startFrame, - endFrame, enumData->textType[type].c_str(), textId1, textId2); - } - - return StringHelper::Sprintf("CS_TEXT(0x%X, %i, %i, %i, 0x%X, 0x%X)", base, startFrame, - endFrame, type, textId1, textId2); -} - -size_t CutsceneOoTSubCommandEntry_Text::GetRawSize() const -{ - return 0x0C; -} - -CutsceneOoTCommand_Text::CutsceneOoTCommand_Text(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneOoTSubCommandEntry_Text(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneOoTCommand_Text::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_TEXT_LIST(%i)", numEntries); -} - -/**** ACTOR CUE ****/ - -CutsceneOoTSubCommandEntry_ActorCue::CutsceneOoTSubCommandEntry_ActorCue( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6); - rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8); - rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA); - startPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0xC); - startPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x10); - startPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x14); - endPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x18); - endPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x1C); - endPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x20); - normalX = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x24); - normalY = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x28); - normalZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x2C); -} -std::string CutsceneOoTSubCommandEntry_ActorCue::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - std::string normalXStr = - ZCutscene::GetCsEncodedFloat(normalX, Globals::Instance->floatType, true); - std::string normalYStr = - ZCutscene::GetCsEncodedFloat(normalY, Globals::Instance->floatType, true); - std::string normalZStr = - ZCutscene::GetCsEncodedFloat(normalZ, Globals::Instance->floatType, true); - - if (static_cast(commandID) == - CutsceneOoT_CommandType::CS_CMD_PLAYER_CUE) - { - return StringHelper::Sprintf("CS_PLAYER_CUE(%s, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, " - "%i, %i, %i, %i, %s, %s, %s)", - enumData->playerCueId[base].c_str(), startFrame, endFrame, - rotX, rotY, rotZ, startPosX, startPosY, startPosZ, endPosX, - endPosY, endPosZ, normalXStr.c_str(), normalYStr.c_str(), - normalZStr.c_str()); - } - else - { - return StringHelper::Sprintf("CS_ACTOR_CUE(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, " - "%i, %i, %i, %i, %s, %s, %s)", - base, startFrame, endFrame, rotX, rotY, rotZ, startPosX, - startPosY, startPosZ, endPosX, endPosY, endPosZ, - normalXStr.c_str(), normalYStr.c_str(), normalZStr.c_str()); - } -} - -size_t CutsceneOoTSubCommandEntry_ActorCue::GetRawSize() const -{ - return 0x30; -} - -CutsceneOoTCommand_ActorCue::CutsceneOoTCommand_ActorCue(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneOoTSubCommandEntry_ActorCue(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneOoTCommand_ActorCue::GetCommandMacro() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (static_cast(commandID) == - CutsceneOoT_CommandType::CS_CMD_PLAYER_CUE) - { - return StringHelper::Sprintf("CS_PLAYER_CUE_LIST(%i)", entries.size()); - } - - if (enumData->cutsceneCmd.find(commandID) != enumData->cutsceneCmd.end()) - { - return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(%s, %i)", - enumData->cutsceneCmd[commandID].c_str(), entries.size()); - } - - return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(0x%04X, %i)", commandID, entries.size()); -} - -/**** DESTINATION ****/ - -CutsceneOoTCommand_Destination::CutsceneOoTCommand_Destination(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); - startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); - unknown = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); // endFrame duplicate -} - -std::string CutsceneOoTCommand_Destination::GenerateSourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (enumData->destination.find(base) != enumData->destination.end()) - { - return StringHelper::Sprintf("CS_DESTINATION(%s, %i, %i),\n", - enumData->destination[base].c_str(), startFrame, endFrame); - } - - return StringHelper::Sprintf("CS_DESTINATION(%i, %i, %i),\n", base, startFrame, endFrame); -} - -size_t CutsceneOoTCommand_Destination::GetCommandSize() const -{ - return 0x10; -} - -/**** TRANSITION ****/ - -CutsceneOoTCommand_Transition::CutsceneOoTCommand_Transition(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); - startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); -} - -std::string CutsceneOoTCommand_Transition::GenerateSourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (enumData->transitionType.find(base) != enumData->transitionType.end()) - { - return StringHelper::Sprintf("CS_TRANSITION(%s, %i, %i),\n", - enumData->transitionType[base].c_str(), startFrame, endFrame); - } - - return StringHelper::Sprintf("CS_TRANSITION(%i, %i, %i),\n", base, startFrame, endFrame); -} - -size_t CutsceneOoTCommand_Transition::GetCommandSize() const -{ - return 0x10; -} diff --git a/tools/ZAPD/ZAPD/OtherStructs/CutsceneOoT_Commands.h b/tools/ZAPD/ZAPD/OtherStructs/CutsceneOoT_Commands.h deleted file mode 100644 index ff9b6797c3..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/CutsceneOoT_Commands.h +++ /dev/null @@ -1,314 +0,0 @@ -#pragma once - -#include "Cutscene_Common.h" - -// https://github.com/zeldaret/oot/blob/7235af2249843fb68740111b70089bad827a4730/include/z64cutscene.h#L35-L165 -enum class CutsceneOoT_CommandType -{ - CS_CMD_CAM_EYE_SPLINE = 0x01, - CS_CMD_CAM_AT_SPLINE, - CS_CMD_MISC, - CS_CMD_LIGHT_SETTING, - CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER, - CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER, - CS_CMD_CAM_EYE, - CS_CMD_CAM_AT, - CS_CMD_RUMBLE_CONTROLLER, - CS_CMD_PLAYER_CUE, - CS_CMD_UNIMPLEMENTED_B, - CS_CMD_UNIMPLEMENTED_D = 0x0D, - CS_CMD_ACTOR_CUE_1_0, - CS_CMD_ACTOR_CUE_0_0, - CS_CMD_ACTOR_CUE_1_1, - CS_CMD_ACTOR_CUE_0_1, - CS_CMD_ACTOR_CUE_0_2, - CS_CMD_TEXT, - CS_CMD_UNIMPLEMENTED_15 = 0x15, - CS_CMD_UNIMPLEMENTED_16, - CS_CMD_ACTOR_CUE_0_3, - CS_CMD_ACTOR_CUE_1_2, - CS_CMD_ACTOR_CUE_2_0, - CS_CMD_UNIMPLEMENTED_1B = 0x1B, - CS_CMD_UNIMPLEMENTED_1C, - CS_CMD_ACTOR_CUE_3_0, - CS_CMD_ACTOR_CUE_4_0, - CS_CMD_ACTOR_CUE_6_0, - CS_CMD_UNIMPLEMENTED_20, - CS_CMD_UNIMPLEMENTED_21, - CS_CMD_ACTOR_CUE_0_4, - CS_CMD_ACTOR_CUE_1_3, - CS_CMD_ACTOR_CUE_2_1, - CS_CMD_ACTOR_CUE_3_1, - CS_CMD_ACTOR_CUE_4_1, - CS_CMD_ACTOR_CUE_0_5, - CS_CMD_ACTOR_CUE_1_4, - CS_CMD_ACTOR_CUE_2_2, - CS_CMD_ACTOR_CUE_3_2, - CS_CMD_ACTOR_CUE_4_2, - CS_CMD_ACTOR_CUE_5_0, - CS_CMD_TRANSITION, - CS_CMD_ACTOR_CUE_0_6, - CS_CMD_ACTOR_CUE_4_3, - CS_CMD_ACTOR_CUE_1_5, - CS_CMD_ACTOR_CUE_7_0, - CS_CMD_ACTOR_CUE_2_3, - CS_CMD_ACTOR_CUE_3_3, - CS_CMD_ACTOR_CUE_6_1, - CS_CMD_ACTOR_CUE_3_4, - CS_CMD_ACTOR_CUE_4_4, - CS_CMD_ACTOR_CUE_5_1, - CS_CMD_ACTOR_CUE_6_2 = 0x39, - CS_CMD_ACTOR_CUE_6_3, - CS_CMD_UNIMPLEMENTED_3B, - CS_CMD_ACTOR_CUE_7_1, - CS_CMD_UNIMPLEMENTED_3D, - CS_CMD_ACTOR_CUE_8_0, - CS_CMD_ACTOR_CUE_3_5, - CS_CMD_ACTOR_CUE_1_6, - CS_CMD_ACTOR_CUE_3_6, - CS_CMD_ACTOR_CUE_3_7, - CS_CMD_ACTOR_CUE_2_4, - CS_CMD_ACTOR_CUE_1_7, - CS_CMD_ACTOR_CUE_2_5, - CS_CMD_ACTOR_CUE_1_8, - CS_CMD_UNIMPLEMENTED_47, - CS_CMD_ACTOR_CUE_2_6, - CS_CMD_UNIMPLEMENTED_49, - CS_CMD_ACTOR_CUE_2_7, - CS_CMD_ACTOR_CUE_3_8, - CS_CMD_ACTOR_CUE_0_7, - CS_CMD_ACTOR_CUE_5_2, - CS_CMD_ACTOR_CUE_1_9, - CS_CMD_ACTOR_CUE_4_5, - CS_CMD_ACTOR_CUE_1_10, - CS_CMD_ACTOR_CUE_2_8, - CS_CMD_ACTOR_CUE_3_9, - CS_CMD_ACTOR_CUE_4_6, - CS_CMD_ACTOR_CUE_5_3, - CS_CMD_ACTOR_CUE_0_8, - CS_CMD_START_SEQ, - CS_CMD_STOP_SEQ, - CS_CMD_ACTOR_CUE_6_4, - CS_CMD_ACTOR_CUE_7_2, - CS_CMD_ACTOR_CUE_5_4, - CS_CMD_ACTOR_CUE_0_9 = 0x5D, - CS_CMD_ACTOR_CUE_1_11, - CS_CMD_ACTOR_CUE_0_10 = 0x69, - CS_CMD_ACTOR_CUE_2_9, - CS_CMD_ACTOR_CUE_0_11, - CS_CMD_ACTOR_CUE_3_10, - CS_CMD_UNIMPLEMENTED_6D, - CS_CMD_ACTOR_CUE_0_12, - CS_CMD_ACTOR_CUE_7_3, - CS_CMD_UNIMPLEMENTED_70, - CS_CMD_UNIMPLEMENTED_71, - CS_CMD_ACTOR_CUE_7_4, - CS_CMD_ACTOR_CUE_6_5, - CS_CMD_ACTOR_CUE_1_12, - CS_CMD_ACTOR_CUE_2_10, - CS_CMD_ACTOR_CUE_1_13, - CS_CMD_ACTOR_CUE_0_13, - CS_CMD_ACTOR_CUE_1_14, - CS_CMD_ACTOR_CUE_2_11, - CS_CMD_ACTOR_CUE_0_14 = 0x7B, - CS_CMD_FADE_OUT_SEQ, - CS_CMD_ACTOR_CUE_1_15, - CS_CMD_ACTOR_CUE_2_12, - CS_CMD_ACTOR_CUE_3_11, - CS_CMD_ACTOR_CUE_4_7, - CS_CMD_ACTOR_CUE_5_5, - CS_CMD_ACTOR_CUE_6_6, - CS_CMD_ACTOR_CUE_1_16, - CS_CMD_ACTOR_CUE_2_13, - CS_CMD_ACTOR_CUE_3_12, - CS_CMD_ACTOR_CUE_7_5, - CS_CMD_ACTOR_CUE_4_8, - CS_CMD_ACTOR_CUE_5_6, - CS_CMD_ACTOR_CUE_6_7, - CS_CMD_ACTOR_CUE_0_15, - CS_CMD_ACTOR_CUE_0_16, - CS_CMD_TIME, - CS_CMD_ACTOR_CUE_1_17, - CS_CMD_ACTOR_CUE_7_6, - CS_CMD_ACTOR_CUE_9_0, - CS_CMD_ACTOR_CUE_0_17, - CS_CMD_DESTINATION = 0x03E8, - CS_CMD_END = 0xFFFF -}; - -/**** GENERIC ****/ - -class CutsceneOoTSubCommandEntry_GenericCmd : public CutsceneSubCommandEntry -{ -public: - CutsceneOoT_CommandType commandId; - - uint32_t word0 = 0; - uint32_t word1 = 0; - - uint32_t unused1 = 0; - uint32_t unused2 = 0; - uint32_t unused3 = 0; - uint32_t unused4 = 0; - uint32_t unused5 = 0; - uint32_t unused6 = 0; - uint32_t unused7 = 0; - uint32_t unused8 = 0; - uint32_t unused9 = 0; - uint32_t unused10 = 0; - - CutsceneOoTSubCommandEntry_GenericCmd(const std::vector& rawData, - offset_t rawDataIndex, CutsceneOoT_CommandType cmdId); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneOoTCommand_GenericCmd : public CutsceneCommand -{ -public: - CutsceneOoTCommand_GenericCmd(const std::vector& rawData, offset_t rawDataIndex, - CutsceneOoT_CommandType cmdId); - - std::string GetCommandMacro() const override; -}; - -/**** CAMERA ****/ - -class CutsceneOoTCommand_CameraPoint : public CutsceneSubCommandEntry -{ -public: - int8_t continueFlag; - int8_t cameraRoll; - int16_t nextPointFrame; - float viewAngle; - int16_t posX, posY, posZ; - int16_t unused; - - CutsceneOoTCommand_CameraPoint(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneOoTCommand_GenericCameraCmd : public CutsceneCommand -{ -public: - uint16_t base; - uint16_t startFrame; - uint16_t endFrame; - uint16_t unused; - - CutsceneOoTCommand_GenericCameraCmd(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; - - size_t GetCommandSize() const override; -}; - -/**** TRANSITION ****/ - -class CutsceneOoTCommand_Transition : public CutsceneCommand -{ -public: - uint16_t base; - uint16_t startFrame; - uint16_t endFrame; - - CutsceneOoTCommand_Transition(const std::vector& rawData, offset_t rawDataIndex); - - std::string GenerateSourceCode() const override; - size_t GetCommandSize() const override; -}; - -/**** RUMBLE ****/ - -class CutsceneOoTSubCommandEntry_Rumble : public CutsceneSubCommandEntry -{ -public: - uint8_t sourceStrength; - uint8_t duration; - uint8_t decreaseRate; - uint8_t unk_09; - uint8_t unk_0A; - - CutsceneOoTSubCommandEntry_Rumble(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneOoTCommand_Rumble : public CutsceneCommand -{ -public: - CutsceneOoTCommand_Rumble(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; - -/**** TEXT ****/ - -class CutsceneOoTSubCommandEntry_Text : public CutsceneSubCommandEntry -{ -public: - uint16_t type; - uint16_t textId1; - uint16_t textId2; - - CutsceneOoTSubCommandEntry_Text(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneOoTCommand_Text : public CutsceneCommand -{ -public: - CutsceneOoTCommand_Text(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; - -/**** ACTOR CUE ****/ - -class CutsceneOoTSubCommandEntry_ActorCue : public CutsceneSubCommandEntry -{ -public: - uint16_t rotX, rotY, rotZ; - int32_t startPosX, startPosY, startPosZ; - int32_t endPosX, endPosY, endPosZ; - float normalX, normalY, normalZ; - - CutsceneOoTSubCommandEntry_ActorCue(const std::vector& rawData, offset_t rawDataIndex); - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneOoTCommand_ActorCue : public CutsceneCommand -{ -public: - CutsceneOoTCommand_ActorCue(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; - -/**** DESTINATION ****/ - -class CutsceneOoTCommand_Destination : public CutsceneCommand -{ -public: - uint16_t base; - uint16_t startFrame; - uint16_t endFrame; - uint16_t unknown; - - CutsceneOoTCommand_Destination(const std::vector& rawData, offset_t rawDataIndex); - - std::string GenerateSourceCode() const override; - size_t GetCommandSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/OtherStructs/Cutscene_Common.cpp b/tools/ZAPD/ZAPD/OtherStructs/Cutscene_Common.cpp deleted file mode 100644 index a5ea609af8..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/Cutscene_Common.cpp +++ /dev/null @@ -1,128 +0,0 @@ -#include "Cutscene_Common.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -/* CutsceneSubCommandEntry */ - -CutsceneSubCommandEntry::CutsceneSubCommandEntry(const std::vector& rawData, - offset_t rawDataIndex) -{ - base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); - startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); - pad = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); -} - -std::string CutsceneSubCommandEntry::GetBodySourceCode() const -{ - return StringHelper::Sprintf("CMD_HH(0x%04X, 0x%04X), CMD_HH(0x%04X, 0x%04X)", base, startFrame, - endFrame, pad); -} - -size_t CutsceneSubCommandEntry::GetRawSize() const -{ - return 0x08; -} - -/* CutsceneCommand */ - -CutsceneCommand::CutsceneCommand(const std::vector& rawData, offset_t rawDataIndex) -{ - numEntries = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0); -} - -CutsceneCommand::~CutsceneCommand() -{ - for (auto entry : entries) - { - delete entry; - } -} - -std::string CutsceneCommand::GetCommandMacro() const -{ - return StringHelper::Sprintf("CMD_W(0x%08X), CMD_W(0x%08X)", commandID, numEntries); -} - -std::string CutsceneCommand::GenerateSourceCode() const -{ - std::string result; - - result += GetCommandMacro(); - result += ",\n"; - - for (auto& entry : entries) - { - result += " "; - result += entry->GetBodySourceCode(); - result += ",\n"; - } - - return result; -} - -size_t CutsceneCommand::GetCommandSize() const -{ - size_t size = 0; - if (entries.size() > 0) - { - size = entries.at(0)->GetRawSize() * entries.size(); - } - else - { - size = 0x08 * numEntries; - } - return 0x08 + size; -} - -void CutsceneCommand::SetCommandID(uint32_t nCommandID) -{ - commandID = nCommandID; - - for (auto& entry : entries) - { - entry->commandID = commandID; - } -} - -/*** TIME ****/ - -CutsceneSubCommandEntry_SetTime::CutsceneSubCommandEntry_SetTime( - const std::vector& rawData, offset_t rawDataIndex) - : CutsceneSubCommandEntry(rawData, rawDataIndex) -{ - hour = BitConverter::ToUInt8BE(rawData, rawDataIndex + 6); - minute = BitConverter::ToUInt8BE(rawData, rawDataIndex + 7); -} - -std::string CutsceneSubCommandEntry_SetTime::GetBodySourceCode() const -{ - // Note: Both OoT and MM have the first argument unused - return StringHelper::Sprintf("CS_TIME(%i, %i, %i, %i, %i)", base, startFrame, endFrame, hour, - minute); -} - -size_t CutsceneSubCommandEntry_SetTime::GetRawSize() const -{ - return 0x0C; -} - -CutsceneCommand_Time::CutsceneCommand_Time(const std::vector& rawData, - offset_t rawDataIndex) - : CutsceneCommand(rawData, rawDataIndex) -{ - rawDataIndex += 4; - - entries.reserve(numEntries); - for (size_t i = 0; i < numEntries; i++) - { - auto* entry = new CutsceneSubCommandEntry_SetTime(rawData, rawDataIndex); - entries.push_back(entry); - rawDataIndex += entry->GetRawSize(); - } -} - -std::string CutsceneCommand_Time::GetCommandMacro() const -{ - return StringHelper::Sprintf("CS_TIME_LIST(%i)", numEntries); -} diff --git a/tools/ZAPD/ZAPD/OtherStructs/Cutscene_Common.h b/tools/ZAPD/ZAPD/OtherStructs/Cutscene_Common.h deleted file mode 100644 index 9d8dcf63de..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/Cutscene_Common.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include -#include -#include -#include "Declaration.h" - -typedef struct CsCommandListDescriptor -{ - const char* cmdMacro; - const char* args; -} CsCommandListDescriptor; - -class CutsceneSubCommandEntry -{ -public: - uint16_t base; - uint16_t startFrame; - uint16_t endFrame; - uint16_t pad; - - uint32_t commandID; - - CutsceneSubCommandEntry(const std::vector& rawData, offset_t rawDataIndex); - virtual ~CutsceneSubCommandEntry() = default; - - virtual std::string GetBodySourceCode() const; - - virtual size_t GetRawSize() const; -}; - -class CutsceneCommand -{ -public: - uint32_t commandID; - uint32_t commandIndex; - - uint32_t numEntries; - std::vector entries; - - CutsceneCommand(const std::vector& rawData, offset_t rawDataIndex); - virtual ~CutsceneCommand(); - - virtual std::string GetCommandMacro() const; - virtual std::string GenerateSourceCode() const; - virtual size_t GetCommandSize() const; - - virtual void SetCommandID(uint32_t nCommandID); -}; - -/**** TIME ****/ - -class CutsceneSubCommandEntry_SetTime : public CutsceneSubCommandEntry -{ -public: - uint8_t hour; - uint8_t minute; - - CutsceneSubCommandEntry_SetTime(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetBodySourceCode() const override; - - size_t GetRawSize() const override; -}; - -class CutsceneCommand_Time : public CutsceneCommand -{ -public: - CutsceneCommand_Time(const std::vector& rawData, offset_t rawDataIndex); - - std::string GetCommandMacro() const override; -}; diff --git a/tools/ZAPD/ZAPD/OtherStructs/SkinLimbStructs.cpp b/tools/ZAPD/ZAPD/OtherStructs/SkinLimbStructs.cpp deleted file mode 100644 index e85bdefe76..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/SkinLimbStructs.cpp +++ /dev/null @@ -1,354 +0,0 @@ -#include "SkinLimbStructs.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZDisplayList.h" -#include "ZFile.h" - -/* SkinVertex */ - -SkinVertex::SkinVertex(ZFile* nParent) : ZResource(nParent) -{ -} - -void SkinVertex::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - index = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00); - s = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x02); - t = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x04); - normX = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x06); - normY = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x07); - normZ = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x08); - alpha = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x09); -} - -std::string SkinVertex::GetBodySourceCode() const -{ - return StringHelper::Sprintf("0x%02X, %i, %i, %i, %i, %i, 0x%02X", index, s, t, normX, normY, - normZ, alpha); -} - -std::string SkinVertex::GetSourceTypeName() const -{ - return "SkinVertex"; -} - -ZResourceType SkinVertex::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -size_t SkinVertex::GetRawDataSize() const -{ - return 0x0A; -} - -/* SkinTransformation */ - -SkinTransformation::SkinTransformation(ZFile* nParent) : ZResource(nParent) -{ -} - -void SkinTransformation::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - limbIndex = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x00); - x = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x02); - y = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x04); - z = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x06); - scale = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08); -} - -std::string SkinTransformation::GetBodySourceCode() const -{ - return StringHelper::Sprintf("0x%02X, %i, %i, %i, 0x%02X", limbIndex, x, y, z, scale); -} - -std::string SkinTransformation::GetSourceTypeName() const -{ - return "SkinTransformation"; -} - -ZResourceType SkinTransformation::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -size_t SkinTransformation::GetRawDataSize() const -{ - return 0x0A; -} - -/* SkinLimbModif */ - -SkinLimbModif::SkinLimbModif(ZFile* nParent) : ZResource(nParent) -{ -} - -void SkinLimbModif::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - vtxCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00); - transformCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x02); - unk_4 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x04); - skinVertices = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08); - limbTransformations = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0C); - - if (skinVertices != 0 && GETSEGNUM(skinVertices) == parent->segment) - { - uint32_t unk_8_Offset = Seg2Filespace(skinVertices, parent->baseAddress); - - skinVertices_arr.reserve(vtxCount); - for (size_t i = 0; i < vtxCount; i++) - { - SkinVertex skinVertices_data(parent); - skinVertices_data.ExtractFromFile(unk_8_Offset); - skinVertices_arr.push_back(skinVertices_data); - - unk_8_Offset += skinVertices_data.GetRawDataSize(); - } - } - - if (limbTransformations != 0 && GETSEGNUM(skinVertices) == parent->segment) - { - uint32_t unk_C_Offset = Seg2Filespace(limbTransformations, parent->baseAddress); - - limbTransformations_arr.reserve(transformCount); - for (size_t i = 0; i < transformCount; i++) - { - SkinTransformation limbTransformations_data(parent); - limbTransformations_data.ExtractFromFile(unk_C_Offset); - limbTransformations_arr.push_back(limbTransformations_data); - - unk_C_Offset += limbTransformations_data.GetRawDataSize(); - } - } -} - -void SkinLimbModif::DeclareReferences(const std::string& prefix) -{ - std::string varPrefix = prefix; - if (name != "") - varPrefix = name; - - if (skinVertices != 0 && GETSEGNUM(skinVertices) == parent->segment) - { - const auto& res = skinVertices_arr.at(0); - std::string unk_8_Str = res.GetDefaultName(varPrefix); - - size_t arrayItemCnt = skinVertices_arr.size(); - std::string entryStr = ""; - - for (size_t i = 0; i < arrayItemCnt; i++) - { - auto& child = skinVertices_arr[i]; - child.DeclareReferences(varPrefix); - entryStr += StringHelper::Sprintf("\t{ %s },", child.GetBodySourceCode().c_str()); - - if (i < arrayItemCnt - 1) - entryStr += "\n"; - } - - uint32_t skinVertices_Offset = Seg2Filespace(skinVertices, parent->baseAddress); - Declaration* decl = parent->GetDeclaration(skinVertices_Offset); - if (decl == nullptr) - { - parent->AddDeclarationArray(skinVertices_Offset, res.GetDeclarationAlignment(), - arrayItemCnt * res.GetRawDataSize(), - res.GetSourceTypeName(), unk_8_Str, arrayItemCnt, entryStr); - } - else - decl->declBody = entryStr; - } - - if (limbTransformations != 0 && GETSEGNUM(limbTransformations) == parent->segment) - { - const auto& res = limbTransformations_arr.at(0); - std::string unk_C_Str = res.GetDefaultName(varPrefix); - - size_t arrayItemCnt = limbTransformations_arr.size(); - std::string entryStr = ""; - - for (size_t i = 0; i < arrayItemCnt; i++) - { - auto& child = limbTransformations_arr[i]; - child.DeclareReferences(varPrefix); - entryStr += StringHelper::Sprintf("\t{ %s },", child.GetBodySourceCode().c_str()); - - if (i < arrayItemCnt - 1) - entryStr += "\n"; - } - - uint32_t unk_C_Offset = Seg2Filespace(limbTransformations, parent->baseAddress); - Declaration* decl = parent->GetDeclaration(unk_C_Offset); - if (decl == nullptr) - { - parent->AddDeclarationArray(unk_C_Offset, res.GetDeclarationAlignment(), - arrayItemCnt * res.GetRawDataSize(), - res.GetSourceTypeName(), unk_C_Str, arrayItemCnt, entryStr); - } - else - decl->declBody = entryStr; - } -} - -std::string SkinLimbModif::GetBodySourceCode() const -{ - std::string skinVertices_Str; - std::string unk_C_Str; - Globals::Instance->GetSegmentedPtrName(skinVertices, parent, "SkinVertex", skinVertices_Str); - Globals::Instance->GetSegmentedPtrName(limbTransformations, parent, "SkinTransformation", - unk_C_Str); - - std::string entryStr = StringHelper::Sprintf("\n\t\tARRAY_COUNTU(%s), ARRAY_COUNTU(%s),\n", - skinVertices_Str.c_str(), unk_C_Str.c_str()); - entryStr += StringHelper::Sprintf("\t\t%i, %s, %s\n\t", unk_4, skinVertices_Str.c_str(), - unk_C_Str.c_str()); - - return entryStr; -} - -std::string SkinLimbModif::GetSourceTypeName() const -{ - return "SkinLimbModif"; -} - -ZResourceType SkinLimbModif::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -size_t SkinLimbModif::GetRawDataSize() const -{ - return 0x10; -} - -/* SkinAnimatedLimbData */ - -SkinAnimatedLimbData::SkinAnimatedLimbData(ZFile* nParent) : ZResource(nParent) -{ -} - -void SkinAnimatedLimbData::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - totalVtxCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00); - limbModifCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x02); - limbModifications = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x04); - dlist = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08); - - if (limbModifications != 0 && GETSEGNUM(limbModifications) == parent->segment) - { - uint32_t limbModifications_Offset = Seg2Filespace(limbModifications, parent->baseAddress); - - limbModifications_arr.reserve(limbModifCount); - for (size_t i = 0; i < limbModifCount; i++) - { - SkinLimbModif limbModifications_data(parent); - limbModifications_data.ExtractFromFile(limbModifications_Offset); - limbModifications_arr.push_back(limbModifications_data); - - limbModifications_Offset += limbModifications_data.GetRawDataSize(); - } - } -} - -void SkinAnimatedLimbData::DeclareReferences(const std::string& prefix) -{ - std::string varPrefix = prefix; - if (name != "") - varPrefix = name; - - ZResource::DeclareReferences(varPrefix); - - if (limbModifications != SEGMENTED_NULL && GETSEGNUM(limbModifications) == parent->segment) - { - const auto& res = limbModifications_arr.at(0); - std::string limbModifications_Str = res.GetDefaultName(varPrefix); - - size_t arrayItemCnt = limbModifications_arr.size(); - std::string entryStr = ""; - - for (size_t i = 0; i < arrayItemCnt; i++) - { - auto& child = limbModifications_arr[i]; - child.DeclareReferences(varPrefix); - entryStr += StringHelper::Sprintf("\t{ %s },", child.GetBodySourceCode().c_str()); - - if (i < arrayItemCnt - 1) - entryStr += "\n"; - } - - uint32_t limbModifications_Offset = Seg2Filespace(limbModifications, parent->baseAddress); - Declaration* decl = parent->GetDeclaration(limbModifications_Offset); - if (decl == nullptr) - { - parent->AddDeclarationArray(limbModifications_Offset, res.GetDeclarationAlignment(), - arrayItemCnt * res.GetRawDataSize(), - res.GetSourceTypeName(), limbModifications_Str, - arrayItemCnt, entryStr); - } - else - decl->declBody = entryStr; - } - - if (dlist != SEGMENTED_NULL && GETSEGNUM(dlist) == parent->segment) - { - uint32_t dlist_Offset = Seg2Filespace(dlist, parent->baseAddress); - - int32_t dlistLength = ZDisplayList::GetDListLength( - parent->GetRawData(), dlist_Offset, - Globals::Instance->game == ZGame::OOT_SW97 ? DListType::F3DEX : DListType::F3DZEX); - ZDisplayList* dlist_data = new ZDisplayList(parent); - dlist_data->ExtractFromBinary(dlist_Offset, dlistLength); - - std::string dListStr = - StringHelper::Sprintf("%sSkinLimbDL_%06X", varPrefix.c_str(), dlist_Offset); - dlist_data->SetName(dListStr); - dlist_data->DeclareVar(varPrefix, ""); - dlist_data->DeclareReferences(varPrefix); - parent->AddResource(dlist_data); - } -} - -std::string SkinAnimatedLimbData::GetBodySourceCode() const -{ - std::string limbModifications_Str; - std::string dlist_Str; - Globals::Instance->GetSegmentedPtrName(limbModifications, parent, "SkinLimbModif", - limbModifications_Str); - Globals::Instance->GetSegmentedPtrName(dlist, parent, "Gfx", dlist_Str); - - std::string entryStr = "\n"; - entryStr += StringHelper::Sprintf("\t%i, ARRAY_COUNTU(%s),\n", totalVtxCount, - limbModifications_Str.c_str()); - entryStr += - StringHelper::Sprintf("\t%s, %s\n", limbModifications_Str.c_str(), dlist_Str.c_str()); - - return entryStr; -} - -std::string SkinAnimatedLimbData::GetSourceTypeName() const -{ - return "SkinAnimatedLimbData"; -} - -ZResourceType SkinAnimatedLimbData::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -size_t SkinAnimatedLimbData::GetRawDataSize() const -{ - return 0x0C; -} diff --git a/tools/ZAPD/ZAPD/OtherStructs/SkinLimbStructs.h b/tools/ZAPD/ZAPD/OtherStructs/SkinLimbStructs.h deleted file mode 100644 index f338ebeddc..0000000000 --- a/tools/ZAPD/ZAPD/OtherStructs/SkinLimbStructs.h +++ /dev/null @@ -1,111 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "ZResource.h" - -enum class ZLimbSkinType -{ - SkinType_Null, // SkinLimb segment = NULL - SkinType_Animated = 4, // SkinLimb segment = SkinAnimatedLimbData* - SkinType_Normal = 11, // SkinLimb segment = Gfx* -}; - -class SkinVertex : public ZResource -{ -public: - SkinVertex(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - uint16_t index; - int16_t s; - int16_t t; - int8_t normX; - int8_t normY; - int8_t normZ; - uint8_t alpha; -}; - -class SkinTransformation : public ZResource -{ -public: - SkinTransformation(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - uint8_t limbIndex; - int16_t x; - int16_t y; - int16_t z; - uint8_t scale; -}; - -class SkinLimbModif : public ZResource -{ -public: - SkinLimbModif(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - uint16_t vtxCount; // Number of vertices in this modif entry - uint16_t transformCount; // Length of limbTransformations - uint16_t unk_4; // 0 or 1, used as an index for limbTransformations - segptr_t skinVertices; // SkinVertex* - segptr_t limbTransformations; // SkinTransformation* - - std::vector skinVertices_arr; - std::vector limbTransformations_arr; -}; - -class SkinAnimatedLimbData : public ZResource -{ -public: - SkinAnimatedLimbData(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - uint16_t totalVtxCount; - uint16_t limbModifCount; // Length of limbModifications - segptr_t limbModifications; // SkinLimbModif* - segptr_t dlist; // Gfx* - - std::vector limbModifications_arr; - // ZDisplayList* unk_8_dlist = nullptr; -}; diff --git a/tools/ZAPD/ZAPD/OutputFormatter.cpp b/tools/ZAPD/ZAPD/OutputFormatter.cpp deleted file mode 100644 index 393ec1936a..0000000000 --- a/tools/ZAPD/ZAPD/OutputFormatter.cpp +++ /dev/null @@ -1,115 +0,0 @@ -#include "OutputFormatter.h" - -void OutputFormatter::Flush() -{ - if (col > lineLimit) - { - str.append(1, '\n'); - str.append(currentIndent, ' '); - - uint32_t newCol = currentIndent + (wordP - word); - - for (uint32_t i = 0; i < wordNests; i++) - nestIndent[nest - i] -= col - newCol; - - col = newCol; - } - else - { - str.append(space, spaceP - space); - } - spaceP = space; - - str.append(word, wordP - word); - wordP = word; - wordNests = 0; -} - -int OutputFormatter::Write(const char* buf, int count) -{ - for (int i = 0; i < count; i++) - { - char c = buf[i]; - - if (c == ' ' || c == '\t' || c == '\n') - { - if (wordP - word != 0) - { - Flush(); - } - - if (c == '\n') - { - col = 0; - *spaceP++ = c; - } - else if (c == '\t') - { - int n = tabSize - (col % tabSize); - col += n; - for (int j = 0; j < n; j++) - *spaceP++ = ' '; - } - else - { - col++; - *spaceP++ = c; - } - - currentIndent = nestIndent[nest]; - } - else - { - col++; - - if (c == '(') - { - nest++; - nestIndent[nest] = col; - wordNests++; - } - else if (c == ')') - { - if (nest > 0) - nest--; - if (wordNests > 0) - wordNests--; - } - - *wordP++ = c; - } - } - - return count; -} - -int OutputFormatter::Write(const std::string& buf) -{ - return Write(buf.data(), buf.size()); -} - -OutputFormatter* OutputFormatter::Instance; - -int OutputFormatter::WriteStatic(const char* buf, int count) -{ - return Instance->Write(buf, count); -} - -int (*OutputFormatter::StaticWriter())(const char* buf, int count) -{ - Instance = this; - return &WriteStatic; -} - -OutputFormatter::OutputFormatter(uint32_t tabSize, uint32_t indentation, uint32_t lineLimit) - : tabSize{tabSize}, lineLimit{lineLimit}, col{0}, nest{0}, nestIndent{indentation}, - currentIndent{indentation}, wordNests(0), wordP{word}, spaceP{space} -{ -} - -std::string OutputFormatter::GetOutput() -{ - Flush(); - - return std::move(str); -} diff --git a/tools/ZAPD/ZAPD/OutputFormatter.h b/tools/ZAPD/ZAPD/OutputFormatter.h deleted file mode 100644 index ec56b654da..0000000000 --- a/tools/ZAPD/ZAPD/OutputFormatter.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class OutputFormatter -{ -private: - const uint32_t tabSize; - const uint32_t lineLimit; - - uint32_t col; - uint32_t nest; - uint32_t nestIndent[8]; - uint32_t currentIndent; - uint32_t wordNests; - - char word[128]; - char space[128]; - char* wordP; - char* spaceP; - - std::string str; - - void Flush(); - - static OutputFormatter* Instance; - static int WriteStatic(const char* buf, int count); - -public: - OutputFormatter(uint32_t tabSize = 4, uint32_t indentation = 4, uint32_t lineLimit = 120); - - int (*StaticWriter())(const char* buf, int count); // Must be `int` due to libgfxd - - int Write(const char* buf, int count); - int Write(const std::string& buf); - - std::string GetOutput(); -}; diff --git a/tools/ZAPD/ZAPD/WarningHandler.cpp b/tools/ZAPD/ZAPD/WarningHandler.cpp deleted file mode 100644 index f416a5b80c..0000000000 --- a/tools/ZAPD/ZAPD/WarningHandler.cpp +++ /dev/null @@ -1,455 +0,0 @@ -/** - * ZAPD Warning- and Error-handling system - * ======================================= - * - * This provides a common standard way to write ZAPD warnings/errors, which should be used for all - * such. It will pretty-print them in a uniform way, with styles defined in the header. - * - * Warnings/errors should be constructed using the macros given in the header; there are now plenty - * of examples in the codebase of how to do this. Their purposes are noted above each category in - * the header. Each warning has a type, one of the ones in warningStringToInitMap, or - * WarningType::Always, which is used for warnings that cannot be disabled and do not display a - * type. - * - * Currently there are three levels of alert a warning can have: - * - 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) - * - * Flag use: - * - -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 - * - -Werror escalates all enabled warnings to errors - * - * Errors do not have types, and will always throw an exception; they cannot be disabled. - * - * Format - * === - * Each printed warning/error contains the same three sections: - * - Preamble: automatically generated; the content varies depending on category. It will print the - * file and function that the warning is from, and information about the files being processed - * or extracted. - * - Header: begins with 'warning: ' or 'error:', should contain essential information about the - * warning/error, ends with the warning type if applicable. Printed with emphasis to make it - * stand out. Does not start with a capital letter or end with a '.' - * - Body (optional): indented, should contain further diagnostic information useful for identifying - * and fixing the warning/error. Can be a sentence with captialisation and '.' on the end. - * - * Please think of what the end user will find most useful when writing the header and body, and try - * to keep it brief without sacrificing important information! Also remember that if the user is - * only looking at stderr, they will normally have no other context. - * - * Warning vs error - * === - * The principle that we have operated on so far is - * - issue a warning if ZAPD will still be able to produce a valid, compilable C file that will - * match - * - if this cannot happen, use an error. - * but at the end of the day, it is up to the programmer's discretion what it should be possible to - * disable. - * - * Documentation - * === - * Remember that all warnings also need to be documented in the README.md. The help is generated - * automatically. - */ -#include "WarningHandler.h" - -#include -#include "Globals.h" -#include "Utils/StringHelper.h" - -typedef struct -{ - WarningType type; - WarningLevel defaultLevel; - std::string description; -} WarningInfoInit; - -typedef struct -{ - WarningLevel level; - std::string name; - std::string description; -} WarningInfo; - -/** - * Master list of all default warning types and features - * - * To add a warning type, fill in a new row of this map. Think carefully about what its default - * level should be, and try and make the description both brief and informative: it is used in the - * help message, so again, think about what the end user needs to know. - */ -// clang-format off -static const std::unordered_map warningStringToInitMap = { - {"deprecated", {WarningType::Deprecated, -#ifdef DEPRECATION_ON - WarningLevel::Warn, -#else - WarningLevel::Off, -#endif - "Deprecated features"}}, - {"unaccounted", {WarningType::Unaccounted, WarningLevel::Off, "Large blocks of unaccounted"}}, - {"missing-offsets", {WarningType::MissingOffsets, WarningLevel::Warn, "Offset attribute missing in XML tag"}}, - {"intersection", {WarningType::Intersection, WarningLevel::Warn, "Two assets intersect"}}, - {"missing-attribute", {WarningType::MissingAttribute, WarningLevel::Warn, "Required attribute missing in XML tag"}}, - {"invalid-attribute-value", {WarningType::InvalidAttributeValue, WarningLevel::Err, "Attribute declared in XML is wrong"}}, - {"unknown-attribute", {WarningType::UnknownAttribute, WarningLevel::Warn, "Unknown attribute in XML entry tag"}}, - {"invalid-xml", {WarningType::InvalidXML, WarningLevel::Err, "XML has syntax errors"}}, - {"invalid-jpeg", {WarningType::InvalidJPEG, WarningLevel::Err, "JPEG file does not conform to the game's format requirements"}}, - {"invalid-png", {WarningType::InvalidPNG, WarningLevel::Err, "Issues arising when processing PNG data"}}, - {"invalid-extracted-data", {WarningType::InvalidExtractedData, WarningLevel::Err, "Extracted data does not have correct form"}}, - {"missing-segment", {WarningType::MissingSegment, WarningLevel::Warn, "Segment not given in File tag in XML"}}, - {"hardcoded-generic-pointer", {WarningType::HardcodedGenericPointer, WarningLevel::Off, "A generic segmented pointer must be produced"}}, - {"hardcoded-pointer", {WarningType::HardcodedPointer, WarningLevel::Warn, "ZAPD lacks the info to make a symbol, so must output a hardcoded pointer"}}, - {"not-implemented", {WarningType::NotImplemented, WarningLevel::Warn, "ZAPD does not currently support this feature"}}, -}; - -/** - * Map constructed at runtime to contain the warning features as set by the user using -W flags. - */ -static std::unordered_map warningTypeToInfoMap; - -void WarningHandler::ConstructTypeToInfoMap() { - for (auto& entry : warningStringToInitMap) { - warningTypeToInfoMap[entry.second.type] = {entry.second.defaultLevel, entry.first, entry.second.description}; - } - warningTypeToInfoMap[WarningType::Always] = {WarningLevel::Warn, "always", "you shouldn't be reading this"}; - assert(warningTypeToInfoMap.size() == static_cast(WarningType::Max)); -} - -/** - * Initialises the main warning type map and reads flags passed to set each warning type's level. - */ -void WarningHandler::Init(int argc, char* argv[]) { - ConstructTypeToInfoMap(); - - bool werror = false; - for (int i = 1; i < argc; i++) { - // If it doesn't start with "-W" skip it. - if (argv[i][0] != '-' || argv[i][1] != 'W' || argv[i][2] == '\0') { - continue; - } - - WarningLevel warningTypeOn = WarningLevel::Warn; - size_t startingIndex = 2; - - // "-Wno-" - if (argv[i][2] == 'n' && argv[i][3] == 'o' && argv[i][4] == '-' && argv[i][5] != '\0') { - warningTypeOn = WarningLevel::Off; - startingIndex = 5; - } - - // Read starting after the "-W" or "-Wno-" - std::string_view currentArgv = &argv[i][startingIndex]; - - if (currentArgv == "error") { - werror = warningTypeOn != WarningLevel::Off; - } else if (currentArgv == "everything") { - for (auto& it: warningTypeToInfoMap) { - if (it.second.level <= WarningLevel::Warn) { - it.second.level = warningTypeOn; - } - } - } else { - // "-Werror=" / "-Wno-error=" parser - if (currentArgv.rfind("error=", 0) == 0) { - // Read starting after the "error=" part - currentArgv = &argv[i][startingIndex + 6]; - warningTypeOn = warningTypeOn != WarningLevel::Off ? WarningLevel::Err : WarningLevel::Warn; - } - - auto it = warningStringToInitMap.find(std::string(currentArgv)); - if (it != warningStringToInitMap.end()) { - warningTypeToInfoMap[it->second.type].level = warningTypeOn; - } - else { - HANDLE_WARNING(WarningType::Always, StringHelper::Sprintf("unknown warning flag '%s'", argv[i]), ""); - } - } - } - - if (werror) { - for (auto& it: warningTypeToInfoMap) { - if (it.second.level >= WarningLevel::Warn) { - it.second.level = WarningLevel::Err; - } - } - } -} - -bool WarningHandler::IsWarningEnabled(WarningType warnType) { - assert(static_cast(warnType) >= 0 && warnType < WarningType::Max); - - return warningTypeToInfoMap.at(warnType).level != WarningLevel::Off; -} - -bool WarningHandler::WasElevatedToError(WarningType warnType) { - assert(static_cast(warnType) >= 0 && warnType < WarningType::Max); - - if (!IsWarningEnabled(warnType)) { - return false; - } - - return warningTypeToInfoMap.at(warnType).level >= WarningLevel::Err; -} - -/** - * Print file/line/function info for debugging - */ -void WarningHandler::FunctionPreamble(const char* filename, int32_t line, const char* function) { - bool forcePrint = false; - -#ifdef DEVELOPMENT - forcePrint = true; -#endif - - fprintf(stderr, "\n"); - - if (forcePrint || Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) { - fprintf(stderr, "%s:%i: in function <%s>:\n", filename, line, function); - } -} - -/** - * Print the information about the file(s) being processed (XML for extraction, png etc. for building) - */ -void WarningHandler::ProcessedFilePreamble() { - if (Globals::Instance->inputPath != "") { - fprintf(stderr, "When processing file %s: ", Globals::Instance->inputPath.c_str()); - } -} - -/** - * Print information about the binary file being extracted - */ -void WarningHandler::ExtractedFilePreamble(const ZFile *parent, const ZResource* res, const uint32_t offset) { - fprintf(stderr, "in input binary file %s, ", parent->GetName().c_str()); - if (res != nullptr) { - fprintf(stderr, "resource '%s' at ", res->GetName().c_str()); - } - if (offset != static_cast(-1)) { - fprintf(stderr, "offset 0x%06X:", offset); - } - fprintf(stderr, "\n\t"); -} - -/** - * Construct the rest of the message, after warning:/error. The message is filled in one character at a time, with indents added after newlines - */ -std::string WarningHandler::ConstructMessage(std::string message, const std::string& header, const std::string& body) { - message.reserve(message.size() + header.size() + body.size() + 10 * (sizeof(HANG_INDT) - 1)); - message += StringHelper::Sprintf(HILITE("%s"), header.c_str()); - message += "\n"; - - if (body == "") { - return message; - } - - message += HANG_INDT; - for (const char* ptr = body.c_str(); *ptr != '\0'; ptr++) { - message += *ptr; - if (*ptr == '\n') { - message += HANG_INDT; - } - } - message += "\n"; - - return message; -} - -/* Error module functions */ - -void WarningHandler::PrintErrorAndThrow(const std::string& header, const std::string& body) { - std::string errorMsg = ERR_FMT("error: "); - throw std::runtime_error(ConstructMessage(errorMsg, header, body)); -} - -/* Error types, to be used via the macros */ - -void WarningHandler::ErrorType(WarningType warnType, const std::string& header, const std::string& body) { - std::string headerMsg = header; - - for (const auto& iter: warningStringToInitMap) { - if (iter.second.type == warnType) { - headerMsg += StringHelper::Sprintf(" [%s]", iter.first.c_str()); - } - } - - PrintErrorAndThrow(headerMsg, body); -} - -void WarningHandler::Error_Plain(const char* filename, int32_t line, const char* function, WarningType warnType, const std::string& header, const std::string& body) { - FunctionPreamble(filename, line, function); - - ErrorType(warnType, header, body); -} - -void WarningHandler::Error_Process(const char* filename, int32_t line, const char* function, WarningType warnType, const std::string& header, const std::string& body) { - FunctionPreamble(filename, line, function); - ProcessedFilePreamble(); - - ErrorType(warnType, header, body); -} - -void WarningHandler::Error_Resource(const char* filename, int32_t line, const char* function, WarningType warnType, const ZFile *parent, const ZResource* res, const uint32_t offset, const std::string& header, const std::string& body) { - assert(parent != nullptr); - - FunctionPreamble(filename, line, function); - ProcessedFilePreamble(); - ExtractedFilePreamble(parent, res, offset); - - ErrorType(warnType, header, body); -} - -/* Warning module functions */ - -void WarningHandler::PrintWarningBody(const std::string& header, const std::string& body) { - std::string errorMsg = WARN_FMT("warning: "); - fprintf(stderr, "%s", ConstructMessage(errorMsg, header, body).c_str()); -} - -void WarningHandler::WarningTypeAndChooseEscalate(WarningType warnType, const std::string& header, const std::string& body) { - std::string headerMsg = header; - - for (const auto& iter: warningStringToInitMap) { - if (iter.second.type == warnType) { - headerMsg += StringHelper::Sprintf(" [-W%s]", iter.first.c_str()); - } - } - - if (WasElevatedToError(warnType)) { - PrintErrorAndThrow(headerMsg, body); - } else { - PrintWarningBody(headerMsg, body); - } -} - - -/* Warning types, to be used via the macros */ - -void WarningHandler::Warning_Plain(const char* filename, int32_t line, const char* function, WarningType warnType, const std::string& header, const std::string& body) { - if (!IsWarningEnabled(warnType)) { - return; - } - - FunctionPreamble(filename, line, function); - - WarningTypeAndChooseEscalate(warnType, header, body); -} - -void WarningHandler::Warning_Process(const char* filename, int32_t line, const char* function, WarningType warnType, const std::string& header, const std::string& body) { - if (!IsWarningEnabled(warnType)) { - return; - } - - FunctionPreamble(filename, line, function); - ProcessedFilePreamble(); - - WarningTypeAndChooseEscalate(warnType, header, body); -} - -void WarningHandler::Warning_Resource(const char* filename, int32_t line, const char* function, WarningType warnType, const ZFile *parent, const ZResource* res, const uint32_t offset, const std::string& header, const std::string& body) { - assert(parent != nullptr); - - if (!IsWarningEnabled(warnType)) { - return; - } - - FunctionPreamble(filename, line, function); - ProcessedFilePreamble(); - ExtractedFilePreamble(parent, res, offset); - - WarningTypeAndChooseEscalate(warnType, header, body); -} - - -/* Help-related functions */ - -#include - -/** - * Print each warning name, default status, and description using the init map - */ -void WarningHandler::PrintHelp() { - std::set sortedKeys; - WarningInfoInit warningInfo; - uint32_t columnWidth = 25; - std::string dt; - - // Sort keys through the magic of `set`, to print in alphabetical order - for (auto& it : warningStringToInitMap) { - sortedKeys.insert(it.first); - } - - printf("\nWarning types ( * means enabled by default)\n"); - for (auto& key : sortedKeys) { - warningInfo = warningStringToInitMap.at(key); - if (warningInfo.defaultLevel <= WarningLevel::Warn) { - dt = "-W"; - dt += key; - if (warningInfo.defaultLevel == WarningLevel::Warn) { - dt += " *"; - } - printf(HELP_DT_INDT "%-*s", columnWidth, dt.c_str()); - - if (dt.length() + 2 > columnWidth) { - printf("\n" HELP_DT_INDT "%-*s", columnWidth, ""); - } - printf("%s\n", warningInfo.description.c_str()); - } - } - - printf("\nDefault errors\n"); - for (auto& key : sortedKeys) { - if (warningInfo.defaultLevel > WarningLevel::Warn) { - dt = "-W"; - dt += key; - printf(HELP_DT_INDT "%-*s", columnWidth, dt.c_str()); - - if (dt.length() + 2 > columnWidth) { - printf("\n" HELP_DT_INDT "%*s", columnWidth, ""); - } - printf("%s\n", warningInfo.description.c_str()); - } - } - - printf("\n"); - printf("Other\n" HELP_DT_INDT "-Weverything will enable all existing warnings.\n" HELP_DT_INDT "-Werror will promote all warnings to errors.\n"); - - printf("\n"); - printf("Warnings can be disabled using -Wno-... instead of -W...; -Weverything will override any -Wno-... flags passed before it.\n"); -} - -/** - * Print which warnings are currently enabled - */ -void WarningHandler::PrintWarningsDebugInfo() -{ - std::string dt; - - printf("Warnings status:\n"); - for (auto& it: warningTypeToInfoMap) { - dt = it.second.name; - dt += ": "; - - printf(HELP_DT_INDT "%-25s", dt.c_str()); - switch (it.second.level) - { - case WarningLevel::Off: - printf(VT_FGCOL(LIGHTGRAY) "Off" VT_RST); - break; - case WarningLevel::Warn: - printf(VT_FGCOL(YELLOW) "Warn" VT_RST); - break; - case WarningLevel::Err: - printf(VT_FGCOL(RED) "Err" VT_RST); - break; - - } - printf("\n"); - } - printf("\n"); -} diff --git a/tools/ZAPD/ZAPD/WarningHandler.h b/tools/ZAPD/ZAPD/WarningHandler.h deleted file mode 100644 index f99330042b..0000000000 --- a/tools/ZAPD/ZAPD/WarningHandler.h +++ /dev/null @@ -1,146 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "Utils/vt.h" -#include "ZFile.h" - -#ifdef _MSC_VER -#define __PRETTY_FUNCTION__ __FUNCSIG__ -#elif not defined(__GNUC__) -#define __PRETTY_FUNCTION__ __func__ -#endif - -// ======================================= -/* Formatting macros */ - -// TODO: move this somewhere else so it can be used by other help -#define HELP_DT_INDT " " - -/* Macros for formatting warnings/errors */ -#define VT_HILITE VT_BOLD_FGCOL(WHITE) -#define VT_WARN VT_BOLD_FGCOL(PURPLE) -#define VT_ERR VT_BOLD_FGCOL(RED) - -#define HILITE(string) (VT_HILITE string VT_RST) -#define WARN_FMT(string) (VT_WARN string VT_RST) -#define ERR_FMT(string) (VT_ERR string VT_RST) - -// Maybe make WARN_LF instead -// Currently 8 spaces -#define WARN_INDT " " -// Currently 16 spaces -#define HANG_INDT " " - -// ======================================= -/* Warning and error macros */ -// TODO: better names - -// General-purpose, plain style (only prints function,file,line in the preamble) -#define HANDLE_ERROR(warningType, header, body) \ - WarningHandler::Error_Plain(__FILE__, __LINE__, __PRETTY_FUNCTION__, warningType, header, body) -#define HANDLE_WARNING(warningType, header, body) \ - WarningHandler::Warning_Plain(__FILE__, __LINE__, __PRETTY_FUNCTION__, warningType, header, \ - body) - -// For processing XMLs or textures/blobs (preamble contains function,file,line; processed file) -#define HANDLE_ERROR_PROCESS(warningType, header, body) \ - WarningHandler::Error_Process(__FILE__, __LINE__, __PRETTY_FUNCTION__, warningType, header, \ - body) -#define HANDLE_WARNING_PROCESS(warningType, header, body) \ - WarningHandler::Warning_Process(__FILE__, __LINE__, __PRETTY_FUNCTION__, warningType, header, \ - body) - -// For ZResource-related stuff (preamble contains function,file,line; processed file; extracted file -// and offset) -#define HANDLE_ERROR_RESOURCE(warningType, parent, resource, offset, header, body) \ - WarningHandler::Error_Resource(__FILE__, __LINE__, __PRETTY_FUNCTION__, warningType, parent, \ - resource, offset, header, body) -#define HANDLE_WARNING_RESOURCE(warningType, parent, resource, offset, header, body) \ - WarningHandler::Warning_Resource(__FILE__, __LINE__, __PRETTY_FUNCTION__, warningType, parent, \ - resource, offset, header, body) - -// ======================================= - -enum class WarningType -{ - Always, // Warnings of this type are always printed, cannot be disabled. - Deprecated, - Unaccounted, - MissingOffsets, - Intersection, - MissingAttribute, - InvalidAttributeValue, - UnknownAttribute, - InvalidXML, - InvalidJPEG, - InvalidPNG, - InvalidExtractedData, - MissingSegment, - HardcodedPointer, - HardcodedGenericPointer, - NotImplemented, - Max, -}; - -enum class WarningLevel -{ - Off, - Warn, - Err, -}; - -class WarningHandler -{ -public: - static void ConstructTypeToInfoMap(); - - static void Init(int argc, char* argv[]); - - static bool IsWarningEnabled(WarningType warnType); - static bool WasElevatedToError(WarningType warnType); - - static void FunctionPreamble(const char* filename, int32_t line, const char* function); - static void ProcessedFilePreamble(); - static void ExtractedFilePreamble(const ZFile* parent, const ZResource* res, - const uint32_t offset); - static std::string ConstructMessage(std::string message, const std::string& header, - const std::string& body); - - [[noreturn]] static void PrintErrorAndThrow(const std::string& header, const std::string& body); - static void PrintWarningBody(const std::string& header, const std::string& body); - - [[noreturn]] static void ErrorType(WarningType warnType, const std::string& header, - const std::string& body); - [[noreturn]] static void Error_Plain(const char* filename, int32_t line, const char* function, - WarningType warnType, const std::string& header, - const std::string& body); - [[noreturn]] static void Error_Process(const char* filename, int32_t line, const char* function, - WarningType warnType, const std::string& header, - const std::string& body); - [[noreturn]] static void Error_Resource(const char* filename, int32_t line, - const char* function, WarningType warnType, - const ZFile* parent, const ZResource* res, - const uint32_t offset, const std::string& header, - const std::string& body); - - static void WarningTypeAndChooseEscalate(WarningType warnType, const std::string& header, - const std::string& body); - - static void Warning_Plain(const char* filename, int32_t line, const char* function, - WarningType warnType, const std::string& header, - const std::string& body); - static void Warning_Process(const char* filename, int32_t line, const char* function, - WarningType warnType, const std::string& header, - const std::string& body); - static void Warning_Resource(const char* filename, int32_t line, const char* function, - WarningType warnType, const ZFile* parent, const ZResource* res, - const uint32_t offset, const std::string& header, - const std::string& body); - - static void PrintHelp(); - static void PrintWarningsDebugInfo(); -}; diff --git a/tools/ZAPD/ZAPD/ZAPD.vcxproj b/tools/ZAPD/ZAPD/ZAPD.vcxproj deleted file mode 100644 index 26a0b70363..0000000000 --- a/tools/ZAPD/ZAPD/ZAPD.vcxproj +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36} - ZAPD - 10.0 - ZAPD - - - - Application - true - v142 - MultiByte - - - Application - false - v142 - true - MultiByte - - - Application - true - v142 - MultiByte - false - - - Application - false - v142 - true - MultiByte - false - - - - - - - - - - - - - - - - - - - - - $(OutDir);$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\packages\libpng-v142.1.6.37.2\build\native\lib\x64\v142\Debug\;$(LibraryPath) - $(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath) - - - $(IncludePath) - - - $(SolutionDir)ZAPD\lib\tinyxml2;$(SolutionDir)ZAPD\lib\libgfxd;$(SolutionDir)ZAPD\lib\elfio;$(SolutionDir)ZAPD\lib\stb;$(ProjectDir);$(IncludePath) - $(SolutionDir)ZAPD\lib\libgfxd;$(SolutionDir)x64\Debug;$(SolutionDir)packages\libpng.1.6.28.1\build\native\lib\x64\v140\dynamic\Debug;$(LibraryPath) - - - - Level3 - Disabled - true - true - stdcpp17 - stdc11 - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - true - Console - - - cd .. -mkdir build\ZAPD - python ZAPD/genbuildinfo.py - - - - - Level3 - Disabled - true - true - stdcpp17 - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - EnableFastChecks - stdc11 - MultiThreadedDebug - true - - - true - ZAPDUtils.lib;/WHOLEARCHIVE:ExporterExample.lib;%(AdditionalDependencies) - false - Console - - - cd .. -mkdir build\ZAPD - python ZAPD/genbuildinfo.py - - - - - Level3 - MaxSpeed - true - true - true - true - true - - - true - true - - - cd .. -mkdir build\ZAPD - python ZAPD/genbuildinfo.py - - - - - Level3 - MaxSpeed - true - true - true - true - stdcpplatest - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - true - true - - - cd .. -mkdir build\ZAPD - python ZAPD/genbuildinfo.py - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZAPD.vcxproj.filters b/tools/ZAPD/ZAPD/ZAPD.vcxproj.filters deleted file mode 100644 index 51723306b4..0000000000 --- a/tools/ZAPD/ZAPD/ZAPD.vcxproj.filters +++ /dev/null @@ -1,605 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;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 - - - {02148456-5068-4613-8478-f10addc58e70} - - - {bcab3136-95ba-4839-833c-43d78ad6e335} - - - {dc06ed84-f6fe-4277-80f3-d62bd5cdbb98} - - - {6049c045-bc38-4221-b29e-ca6d4d8af4aa} - - - {490e3a08-047b-48d3-ab53-3a860a3b92aa} - - - {26c06845-8e8e-4b79-ad18-07c4f9c0f801} - - - {d45c420d-2378-47ac-92c5-80db9475c195} - - - {03cc56a2-e0e8-4167-80a0-98fb900a959a} - - - {73db0879-6df8-4f6a-8cc2-a1f836e9e796} - - - {be9a5be0-ec6a-4200-8e39-bb58c7da7aa8} - - - {7ee79d97-c6a8-4e82-93ef-37981f4d7838} - - - {85600275-99fe-491d-8189-bcc3dc1a8903} - - - {ba9990b0-1082-48bb-874c-6108534b5455} - - - {ce9d91b0-ba20-4296-bc2d-8630965bb392} - - - {730beb67-6d59-4849-9d9b-702c4a565fc0} - - - - - Source Files - - - Source Files\Z64\ZRoom - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files - - - Source Files\Z64 - - - Source Files\Libraries\libgfxd - - - Source Files\Libraries\libgfxd - - - Source Files\Libraries\libgfxd - - - Source Files\Libraries\libgfxd - - - Source Files\Libraries\libgfxd - - - Source Files\Libraries\libgfxd - - - Source Files\Libraries\libgfxd - - - Source Files\Z64 - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64 - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64 - - - Source Files - - - Source Files - - - Source Files\Z64 - - - Source Files - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files - - - Source Files\Z64 - - - Source Files - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64 - - - Source Files\Z64\ZRoom\Commands - - - Source Files\Z64 - - - Source Files\Z64 - - - - - Header Files\Z64\ZRoom - - - Header Files\Z64\ZRoom - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files\Libraries\elfio - - - Header Files - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Libraries - - - Header Files\Libraries - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files - - - Header Files\Z64 - - - Header Files - - - Header Files\Z64 - - - Header Files\Libraries\libgfxd - - - Header Files\Libraries\libgfxd - - - Header Files\Libraries\libgfxd - - - Header Files\Z64 - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64 - - - Header Files\Z64\ZRoom\Commands - - - Header Files - - - Header Files\Z64 - - - Header Files - - - Header Files\Z64 - - - Header Files - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files - - - Header Files\Z64 - - - Header Files - - - Header Files - - - Header Files - - - Header Files\Z64 - - - Header Files\Z64 - - - Header Files\Z64\ZRoom\Commands - - - Header Files\Z64 - - - Header Files\Z64 - - - - - Resource Files - - - any\any - - - NuGet - - - - - - \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZActorList.cpp b/tools/ZAPD/ZAPD/ZActorList.cpp deleted file mode 100644 index ee5cb4d445..0000000000 --- a/tools/ZAPD/ZAPD/ZActorList.cpp +++ /dev/null @@ -1,194 +0,0 @@ -#include "ZActorList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "WarningHandler.h" -#include "ZFile.h" -#include "ZRoom/ZNames.h" - -REGISTER_ZFILENODE(ActorList, ZActorList); - -ZActorList::ZActorList(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("Count"); -} - -void ZActorList::ExtractFromBinary(uint32_t nRawDataIndex, uint8_t nNumActors) -{ - rawDataIndex = nRawDataIndex; - numActors = nNumActors; - - // Don't parse raw data of external files - if (parent->GetMode() == ZFileMode::ExternalFile) - return; - - ParseRawData(); -} - -void ZActorList::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - numActors = StringHelper::StrToL(registeredAttributes.at("Count").value); - - if (numActors < 1) - { - HANDLE_ERROR_RESOURCE( - WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - StringHelper::Sprintf("invalid value '%d' found for 'NumPaths' attribute", numActors), - "Should be at least '1'"); - } -} - -void ZActorList::ParseRawData() -{ - ZResource::ParseRawData(); - - offset_t currentPtr = rawDataIndex; - size_t largestlength = 0; - - for (size_t i = 0; i < numActors; i++) - { - ActorSpawnEntry entry(parent->GetRawData(), currentPtr); - - currentPtr += entry.GetRawDataSize(); - actors.push_back(entry); - - size_t actorNameLength = ZNames::GetActorName(entry.GetActorId()).size(); - if (actorNameLength > largestlength) - largestlength = actorNameLength; - } - - for (auto& entry : actors) - { - entry.SetLargestActorName(largestlength); - } -} - -Declaration* ZActorList::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), name, GetActorListArraySize(), bodyStr); - decl->staticConf = staticConf; - - return decl; -} - -std::string ZActorList::GetBodySourceCode() const -{ - std::string declaration; - - size_t index = 0; - for (auto& entry : actors) - { - declaration += StringHelper::Sprintf("\t{ %s },", entry.GetBodySourceCode().c_str()); - - if (index < actors.size() - 1) - declaration += "\n"; - - index++; - } - - return declaration; -} - -std::string ZActorList::GetSourceTypeName() const -{ - return actors.front().GetSourceTypeName(); -} - -ZResourceType ZActorList::GetResourceType() const -{ - return ZResourceType::ActorList; -} - -size_t ZActorList::GetRawDataSize() const -{ - return actors.size() * actors.front().GetRawDataSize(); -} - -size_t ZActorList::GetActorListArraySize() const -{ - size_t actorCount = 0; - - // Doing an else-if here so we only do the loop when the game is SW97. - // Actor 0x22 is removed from SW97, so we need to ensure that we don't increment the actor count - // for it. - if (Globals::Instance->game == ZGame::OOT_SW97) - { - actorCount = 0; - - for (const auto& entry : actors) - if (entry.GetActorId() != 0x22) - actorCount++; - } - else - { - actorCount = actors.size(); - } - - return actorCount; -} - -/* ActorSpawnEntry */ - -ActorSpawnEntry::ActorSpawnEntry(const std::vector& rawData, uint32_t rawDataIndex) -{ - actorNum = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - posX = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - posY = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - posZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8); - rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10); - rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 12); - params = BitConverter::ToInt16BE(rawData, rawDataIndex + 14); -} - -std::string ActorSpawnEntry::GetBodySourceCode() const -{ - std::string body; - - std::string actorNameFmt = StringHelper::Sprintf("%%-%zus ", largestActorName + 1); - body = - StringHelper::Sprintf(actorNameFmt.c_str(), (ZNames::GetActorName(actorNum) + ",").c_str()); - - body += StringHelper::Sprintf("{ %6i, %6i, %6i }, ", posX, posY, posZ); - if (Globals::Instance->game == ZGame::MM_RETAIL) - body += StringHelper::Sprintf("{ SPAWN_ROT_FLAGS(%#5hX, 0x%04X)" - ", SPAWN_ROT_FLAGS(%#5hX, 0x%04X)" - ", SPAWN_ROT_FLAGS(%#5hX, 0x%04X) }, ", - (rotX >> 7) & 0b111111111, rotX & 0b1111111, - (rotY >> 7) & 0b111111111, rotY & 0b1111111, - (rotZ >> 7) & 0b111111111, rotZ & 0b1111111); - else - body += StringHelper::Sprintf("{ %#6hX, %#6hX, %#6hX }, ", rotX, rotY, rotZ); - body += StringHelper::Sprintf("0x%04X", params); - - return body; -} - -std::string ActorSpawnEntry::GetSourceTypeName() const -{ - return "ActorEntry"; -} - -size_t ActorSpawnEntry::GetRawDataSize() const -{ - return 16; -} - -uint16_t ActorSpawnEntry::GetActorId() const -{ - return actorNum; -} - -void ActorSpawnEntry::SetLargestActorName(size_t nameSize) -{ - largestActorName = nameSize; -} diff --git a/tools/ZAPD/ZAPD/ZActorList.h b/tools/ZAPD/ZAPD/ZActorList.h deleted file mode 100644 index 7cc63da2fe..0000000000 --- a/tools/ZAPD/ZAPD/ZActorList.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include "ZResource.h" - -class ActorSpawnEntry -{ -public: - uint16_t actorNum; - int16_t posX; - int16_t posY; - int16_t posZ; - uint16_t rotX; - uint16_t rotY; - uint16_t rotZ; - uint16_t params; - size_t largestActorName = 16; - - ActorSpawnEntry(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetBodySourceCode() const; - - std::string GetSourceTypeName() const; - size_t GetRawDataSize() const; - - uint16_t GetActorId() const; - void SetLargestActorName(size_t nameSize); -}; - -class ZActorList : public ZResource -{ -public: - std::vector actors; - uint32_t numActors = 0; - - ZActorList(ZFile* nParent); - - void ExtractFromBinary(offset_t nRawDataIndex, uint8_t nNumActors); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - size_t GetActorListArraySize() const; -}; diff --git a/tools/ZAPD/ZAPD/ZAnimation.cpp b/tools/ZAPD/ZAPD/ZAnimation.cpp deleted file mode 100644 index 959fff8291..0000000000 --- a/tools/ZAPD/ZAPD/ZAnimation.cpp +++ /dev/null @@ -1,556 +0,0 @@ -#include "ZAnimation.h" - -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/File.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Animation, ZNormalAnimation); -REGISTER_ZFILENODE(PlayerAnimation, ZLinkAnimation); -REGISTER_ZFILENODE(CurveAnimation, ZCurveAnimation); -REGISTER_ZFILENODE(LegacyAnimation, ZLegacyAnimation); - -ZAnimation::ZAnimation(ZFile* nParent) : ZResource(nParent) -{ - frameCount = 0; -} - -void ZAnimation::ParseRawData() -{ - ZResource::ParseRawData(); - - frameCount = BitConverter::ToInt16BE(parent->GetRawData(), rawDataIndex + 0); -} - -ZResourceType ZAnimation::GetResourceType() const -{ - return ZResourceType::Animation; -} - -/* ZNormalAnimation */ - -ZNormalAnimation::ZNormalAnimation(ZFile* nParent) : ZAnimation(nParent) -{ -} - -size_t ZNormalAnimation::GetRawDataSize() const -{ - return 16; -} - -std::string ZNormalAnimation::GetSourceTypeName() const -{ - return "AnimationHeader"; -} - -void ZNormalAnimation::ParseRawData() -{ - ZAnimation::ParseRawData(); - - auto& data = parent->GetRawData(); - - rotationValuesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 4); - rotationIndicesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 8); - limit = BitConverter::ToInt16BE(data, rawDataIndex + 12); - - rotationValuesOffset = Seg2Filespace(rotationValuesSeg, parent->baseAddress); - rotationIndicesOffset = Seg2Filespace(rotationIndicesSeg, parent->baseAddress); - - uint32_t currentPtr = rotationValuesOffset; - - // Read the Rotation Values - for (uint32_t i = 0; i < ((rotationIndicesOffset - rotationValuesOffset) / 2); i++) - { - rotationValues.push_back(BitConverter::ToInt16BE(data, currentPtr)); - currentPtr += 2; - } - - currentPtr = rotationIndicesOffset; - - // Read the Rotation Indices - for (uint32_t i = 0; i < ((rawDataIndex - rotationIndicesOffset) / 6); i++) - { - rotationIndices.push_back(RotationIndex(BitConverter::ToInt16BE(data, currentPtr), - BitConverter::ToInt16BE(data, currentPtr + 2), - BitConverter::ToInt16BE(data, currentPtr + 4))); - currentPtr += 6; - } -} - -void ZNormalAnimation::DeclareReferences(const std::string& prefix) -{ - std::string defaultPrefix = prefix.c_str(); - if (name != "") - defaultPrefix = name; - - // replace g prefix with s for local variables - if (defaultPrefix.at(0) == 'g') - defaultPrefix.replace(0, 1, "s"); - - std::string indicesStr = ""; - std::string valuesStr = " "; - const uint8_t lineLength = 14; - const uint8_t offset = 0; - - for (size_t i = 0; i < rotationValues.size(); i++) - { - valuesStr += StringHelper::Sprintf("0x%04X, ", rotationValues[i]); - - if ((i - offset + 1) % lineLength == 0) - valuesStr += "\n "; - } - - parent->AddDeclarationArray(rotationValuesOffset, DeclarationAlignment::Align4, - rotationValues.size() * 2, "s16", - StringHelper::Sprintf("%sFrameData", defaultPrefix.c_str()), - rotationValues.size(), valuesStr); - - for (size_t i = 0; i < rotationIndices.size(); i++) - { - indicesStr += StringHelper::Sprintf(" { 0x%04X, 0x%04X, 0x%04X },", rotationIndices[i].x, - rotationIndices[i].y, rotationIndices[i].z); - - if (i != (rotationIndices.size() - 1)) - indicesStr += "\n"; - } - - parent->AddDeclarationArray(rotationIndicesOffset, DeclarationAlignment::Align4, - rotationIndices.size() * 6, "JointIndex", - StringHelper::Sprintf("%sJointIndices", defaultPrefix.c_str()), - rotationIndices.size(), indicesStr); -} - -std::string ZNormalAnimation::GetBodySourceCode() const -{ - std::string frameDataName; - Globals::Instance->GetSegmentedPtrName(rotationValuesSeg, parent, "s16", frameDataName); - std::string jointIndicesName; - Globals::Instance->GetSegmentedPtrName(rotationIndicesSeg, parent, "JointIndex", - jointIndicesName); - - std::string headerStr = - StringHelper::Sprintf("\n\t{ %i }, %s,\n", frameCount, frameDataName.c_str()); - headerStr += StringHelper::Sprintf("\t%s, %i\n", jointIndicesName.c_str(), limit); - - return headerStr; -} - -/* ZLinkAnimation */ - -ZLinkAnimation::ZLinkAnimation(ZFile* nParent) : ZAnimation(nParent) -{ - segmentAddress = 0; -} - -size_t ZLinkAnimation::GetRawDataSize() const -{ - return 8; -} - -std::string ZLinkAnimation::GetSourceTypeName() const -{ - if (Globals::Instance->game == ZGame::MM_RETAIL) - return "PlayerAnimationHeader"; - else - return "LinkAnimationHeader"; -} - -void ZLinkAnimation::ParseRawData() -{ - ZAnimation::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - segmentAddress = BitConverter::ToInt32BE(rawData, rawDataIndex + 4); -} - -std::string ZLinkAnimation::GetBodySourceCode() const -{ - std::string segSymbol; - Globals::Instance->GetSegmentedPtrName(segmentAddress, parent, "", segSymbol); - - return StringHelper::Sprintf("\n\t{ %i }, %s\n", frameCount, segSymbol.c_str()); -} - -/* ZCurveAnimation */ - -CurveInterpKnot::CurveInterpKnot(ZFile* parent, const std::vector& rawData, - uint32_t fileOffset) - : parent(parent) -{ - unk_00 = BitConverter::ToUInt16BE(rawData, fileOffset + 0); - unk_02 = BitConverter::ToUInt16BE(rawData, fileOffset + 2); - unk_04 = BitConverter::ToInt16BE(rawData, fileOffset + 4); - unk_06 = BitConverter::ToInt16BE(rawData, fileOffset + 6); - unk_08 = BitConverter::ToFloatBE(rawData, fileOffset + 8); -} - -CurveInterpKnot::CurveInterpKnot(ZFile* parent, const std::vector& rawData, - uint32_t fileOffset, size_t index) - : CurveInterpKnot(parent, rawData, fileOffset + index * GetRawDataSize()) -{ -} - -std::string CurveInterpKnot::GetBody([[maybe_unused]] const std::string& prefix) const -{ - return StringHelper::Sprintf("0x%04X, 0x%04X, %i, %i, %ff", unk_00, unk_02, unk_04, unk_06, - unk_08); -} - -size_t CurveInterpKnot::GetRawDataSize() const -{ - return 0x0C; -} - -std::string CurveInterpKnot::GetSourceTypeName() -{ - return "CurveInterpKnot"; -} - -ZCurveAnimation::ZCurveAnimation(ZFile* nParent) : ZAnimation(nParent) -{ - RegisterOptionalAttribute("SkelOffset"); -} - -void ZCurveAnimation::ParseXML(tinyxml2::XMLElement* reader) -{ - ZAnimation::ParseXML(reader); - - std::string skelOffsetXml = registeredAttributes.at("SkelOffset").value; - if (skelOffsetXml == "") - { - HANDLE_ERROR_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex, - "missing 'SkelOffset' attribute in ", - "You need to provide the offset of the curve skeleton."); - } - skelOffset = StringHelper::StrToL(skelOffsetXml, 0); -} - -void ZCurveAnimation::ParseRawData() -{ - ZAnimation::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - refIndex = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0); - transformData = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); - copyValues = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); - unk_0C = BitConverter::ToInt16BE(rawData, rawDataIndex + 12); - unk_10 = BitConverter::ToInt16BE(rawData, rawDataIndex + 14); - - uint32_t limbCountAddress = Seg2Filespace(skelOffset, parent->baseAddress) + 4; - limbCount = BitConverter::ToUInt8BE(rawData, limbCountAddress); - - size_t transformDataSize = 0; - size_t copyValuesSize = 0; - if (refIndex != 0) - { - uint32_t refIndexOffset = Seg2Filespace(refIndex, parent->baseAddress); - for (size_t i = 0; i < 3 * 3 * limbCount; i++) - { - uint8_t ref = BitConverter::ToUInt8BE(rawData, refIndexOffset + i); - if (ref == 0) - copyValuesSize++; - else - transformDataSize += ref; - - refIndexArr.emplace_back(ref); - } - } - - if (transformData != 0) - { - uint32_t transformDataOffset = Seg2Filespace(transformData, parent->baseAddress); - - for (size_t i = 0; i < transformDataSize; i++) - transformDataArr.emplace_back(parent, rawData, transformDataOffset, i); - } - - if (copyValues != 0) - { - uint32_t copyValuesOffset = Seg2Filespace(copyValues, parent->baseAddress); - - for (size_t i = 0; i < copyValuesSize; i++) - copyValuesArr.emplace_back(BitConverter::ToInt16BE(rawData, copyValuesOffset + i * 2)); - } -} - -void ZCurveAnimation::DeclareReferences(const std::string& prefix) -{ - if (refIndex != 0) - { - uint32_t refIndexOffset = Seg2Filespace(refIndex, parent->baseAddress); - std::string refIndexStr = - StringHelper::Sprintf("%sCurveAnime_%s_%06X", prefix.c_str(), "Ref", refIndexOffset); - - std::string entryStr = " "; - uint16_t arrayItemCnt = refIndexArr.size(); - - size_t i = 0; - for (auto& child : refIndexArr) - { - entryStr += StringHelper::Sprintf("0x%02X, %s", child, (i++ % 8 == 7) ? "\n " : ""); - } - - Declaration* decl = parent->GetDeclaration(refIndexOffset); - if (decl == nullptr) - { - parent->AddDeclarationArray(refIndexOffset, DeclarationAlignment::Align4, - arrayItemCnt * 1, "u8", refIndexStr, arrayItemCnt, - entryStr); - } - else - { - decl->declBody = entryStr; - } - } - - if (transformData != 0) - { - uint32_t transformDataOffset = Seg2Filespace(transformData, parent->baseAddress); - std::string transformDataStr = StringHelper::Sprintf( - "%sCurveAnime_%s_%06X", prefix.c_str(), - transformDataArr.at(0).GetSourceTypeName().c_str(), transformDataOffset); - - std::string entryStr; - uint16_t arrayItemCnt = transformDataArr.size(); - - size_t i = 0; - for (auto& child : transformDataArr) - { - entryStr += StringHelper::Sprintf(" { %s },%s", child.GetBody(prefix).c_str(), - (++i < arrayItemCnt) ? "\n" : ""); - } - - Declaration* decl = parent->GetDeclaration(transformDataOffset); - if (decl == nullptr) - { - parent->AddDeclarationArray(transformDataOffset, DeclarationAlignment::Align4, - arrayItemCnt * transformDataArr.at(0).GetRawDataSize(), - transformDataArr.at(0).GetSourceTypeName(), - transformDataStr, arrayItemCnt, entryStr); - } - else - { - decl->declBody = entryStr; - } - } - - if (copyValues != 0) - { - uint32_t copyValuesOffset = Seg2Filespace(copyValues, parent->baseAddress); - std::string copyValuesStr = - StringHelper::Sprintf("%sCurveAnime_%s_%06X", prefix.c_str(), "Copy", copyValuesOffset); - - std::string entryStr = " "; - uint16_t arrayItemCnt = copyValuesArr.size(); - - size_t i = 0; - for (auto& child : copyValuesArr) - { - entryStr += StringHelper::Sprintf("% 6i, %s", child, (i++ % 8 == 7) ? "\n " : ""); - } - - Declaration* decl = parent->GetDeclaration(copyValuesOffset); - if (decl == nullptr) - { - parent->AddDeclarationArray(copyValuesOffset, DeclarationAlignment::Align4, - arrayItemCnt * 2, "s16", copyValuesStr, arrayItemCnt, - entryStr); - } - else - { - decl->declBody = entryStr; - } - } -} - -std::string ZCurveAnimation::GetBodySourceCode() const -{ - std::string refIndexStr; - Globals::Instance->GetSegmentedPtrName(refIndex, parent, "u8", refIndexStr); - std::string transformDataStr; - Globals::Instance->GetSegmentedPtrName(transformData, parent, "CurveInterpKnot", - transformDataStr); - std::string copyValuesStr; - Globals::Instance->GetSegmentedPtrName(copyValues, parent, "s16", copyValuesStr); - - return StringHelper::Sprintf("\n\t%s,\n\t%s,\n\t%s,\n\t%i, %i\n", refIndexStr.c_str(), - transformDataStr.c_str(), copyValuesStr.c_str(), unk_0C, unk_10); -} - -size_t ZCurveAnimation::GetRawDataSize() const -{ - return 0x10; -} - -DeclarationAlignment ZCurveAnimation::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align4; -} - -std::string ZCurveAnimation::GetSourceTypeName() const -{ - return "CurveAnimationHeader"; -} - -/* ZLegacyAnimation */ - -ZLegacyAnimation::ZLegacyAnimation(ZFile* nParent) : ZAnimation(nParent) -{ -} - -void ZLegacyAnimation::ParseRawData() -{ - ZAnimation::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - limbCount = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x02); - frameData = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x04); - jointKey = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08); - - if (GETSEGNUM(frameData) == parent->segment && GETSEGNUM(jointKey) == parent->segment) - { - uint32_t frameDataOffset = Seg2Filespace(frameData, parent->baseAddress); - uint32_t jointKeyOffset = Seg2Filespace(jointKey, parent->baseAddress); - - uint32_t ptr = frameDataOffset; - for (size_t i = 0; i < (jointKeyOffset - frameDataOffset) / 2; i++) - { - frameDataArray.push_back(BitConverter::ToUInt16BE(rawData, ptr)); - ptr += 2; - } - - ptr = jointKeyOffset; - for (int32_t i = 0; i < limbCount + 1; i++) - { - LegacyJointKey key(parent); - key.ExtractFromFile(ptr); - - jointKeyArray.push_back(key); - ptr += key.GetRawDataSize(); - } - } -} - -void ZLegacyAnimation::DeclareReferences(const std::string& prefix) -{ - std::string varPrefix = prefix; - if (name != "") - varPrefix = name; - - ZAnimation::DeclareReferences(varPrefix); - - if (!frameDataArray.empty()) - { - uint32_t frameDataOffset = Seg2Filespace(frameData, parent->baseAddress); - if (GETSEGNUM(frameData) == parent->segment && !parent->HasDeclaration(frameDataOffset)) - { - std::string frameDataBody = "\t"; - - for (size_t i = 0; i < frameDataArray.size(); i++) - { - frameDataBody += StringHelper::Sprintf("0x%04X, ", frameDataArray[i]); - - if (i % 8 == 7 && i + 1 < frameDataArray.size()) - frameDataBody += "\n\t"; - } - - std::string frameDataName = StringHelper::Sprintf("%sFrameData", varPrefix.c_str()); - parent->AddDeclarationArray(frameDataOffset, DeclarationAlignment::Align4, - frameDataArray.size() * 2, "s16", frameDataName, - frameDataArray.size(), frameDataBody); - } - } - - if (!jointKeyArray.empty()) - { - uint32_t jointKeyOffset = Seg2Filespace(jointKey, parent->baseAddress); - if (GETSEGNUM(jointKey) == parent->segment && !parent->HasDeclaration(jointKeyOffset)) - { - const auto res = jointKeyArray.at(0); - std::string jointKeyBody; - - for (size_t i = 0; i < jointKeyArray.size(); i++) - { - jointKeyBody += StringHelper::Sprintf("\t{ %s },", - jointKeyArray[i].GetBodySourceCode().c_str()); - - if (i + 1 < jointKeyArray.size()) - jointKeyBody += "\n"; - } - - std::string jointKeyName = StringHelper::Sprintf("%sJointKey", varPrefix.c_str()); - parent->AddDeclarationArray(jointKeyOffset, DeclarationAlignment::Align4, - jointKeyArray.size() * res.GetRawDataSize(), - res.GetSourceTypeName(), jointKeyName, jointKeyArray.size(), - jointKeyBody); - } - } -} - -std::string ZLegacyAnimation::GetBodySourceCode() const -{ - std::string body = "\n"; - - std::string frameDataName; - std::string jointKeyName; - Globals::Instance->GetSegmentedPtrName(frameData, parent, "s16", frameDataName); - Globals::Instance->GetSegmentedPtrName(jointKey, parent, "LegacyJointKey", jointKeyName); - - body += StringHelper::Sprintf("\t%i, %i,\n", frameCount, limbCount); - body += StringHelper::Sprintf("\t%s,\n", frameDataName.c_str()); - body += StringHelper::Sprintf("\t%s\n", jointKeyName.c_str()); - - return body; -} - -std::string ZLegacyAnimation::GetSourceTypeName() const -{ - return "LegacyAnimationHeader"; -} - -size_t ZLegacyAnimation::GetRawDataSize() const -{ - return 0x0C; -} - -LegacyJointKey::LegacyJointKey(ZFile* nParent) : ZResource(nParent) -{ -} - -void LegacyJointKey::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - xMax = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x00); - x = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x02); - yMax = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x04); - y = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x06); - zMax = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x08); - z = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x0A); -} - -std::string LegacyJointKey::GetBodySourceCode() const -{ - return StringHelper::Sprintf("%6i, %6i, %6i, %6i, %6i, %6i", xMax, x, yMax, y, zMax, z); -} - -std::string LegacyJointKey::GetSourceTypeName() const -{ - return "LegacyJointKey"; -} - -ZResourceType LegacyJointKey::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -size_t LegacyJointKey::GetRawDataSize() const -{ - return 0x0C; -} diff --git a/tools/ZAPD/ZAPD/ZAnimation.h b/tools/ZAPD/ZAPD/ZAnimation.h deleted file mode 100644 index 643842b891..0000000000 --- a/tools/ZAPD/ZAPD/ZAnimation.h +++ /dev/null @@ -1,179 +0,0 @@ -#pragma once - -#include -#include -#include -#include "Vec3s.h" -#include "ZResource.h" -#include "ZSkeleton.h" -#include "tinyxml2.h" - -struct RotationIndex -{ - // uint16_t transX, transY, transZ; - uint16_t x, y, z; - - RotationIndex(uint16_t nX, uint16_t nY, uint16_t nZ) : x(nX), y(nY), z(nZ) {} -}; - -class ZAnimation : public ZResource -{ -public: - int16_t frameCount; - - ZAnimation(ZFile* nParent); - - ZResourceType GetResourceType() const override; - -protected: - void ParseRawData() override; -}; - -class ZNormalAnimation : public ZAnimation -{ -public: - std::vector rotationValues; - std::vector rotationIndices; - segptr_t rotationValuesSeg = 0; - segptr_t rotationIndicesSeg = 0; - offset_t rotationValuesOffset = 0; - offset_t rotationIndicesOffset = 0; - int16_t limit = 0; - - ZNormalAnimation(ZFile* nParent); - - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - size_t GetRawDataSize() const override; - std::string GetSourceTypeName() const override; - - void ParseRawData() override; -}; - -class ZLinkAnimation : public ZAnimation -{ -public: - segptr_t segmentAddress; - - ZLinkAnimation(ZFile* nParent); - - std::string GetBodySourceCode() const override; - - size_t GetRawDataSize() const override; - std::string GetSourceTypeName() const override; - - void ParseRawData() override; -}; - -class CurveInterpKnot -{ -protected: - ZFile* parent; - - ///* 0x0000 */ u16 unk_00; // appears to be flags - uint16_t unk_00; - ///* 0x0002 */ s16 unk_02; - int16_t unk_02; - ///* 0x0004 */ s16 unk_04; - int16_t unk_04; - ///* 0x0006 */ s16 unk_06; - int16_t unk_06; - ///* 0x0008 */ f32 unk_08; - float unk_08; - -public: - CurveInterpKnot() = default; - CurveInterpKnot(ZFile* parent, const std::vector& rawData, uint32_t fileOffset); - CurveInterpKnot(ZFile* parent, const std::vector& rawData, uint32_t fileOffset, - size_t index); - - [[nodiscard]] std::string GetBody(const std::string& prefix) const; - - size_t GetRawDataSize() const; - std::string GetSourceTypeName(); -}; - -class ZCurveAnimation : public ZAnimation -{ -protected: - segptr_t skelOffset = 0; - - ///* 0x0000 */ u8* refIndex; - segptr_t refIndex = 0; - ///* 0x0004 */ CurveInterpKnot* transformData; - segptr_t transformData = 0; - ///* 0x0008 */ s16* copyValues; - segptr_t copyValues = 0; - ///* 0x000C */ s16 unk_0C; - int16_t unk_0C; - ///* 0x000E */ s16 unk_10; - int16_t unk_10; - - uint8_t limbCount = 0; - - std::vector refIndexArr; - std::vector transformDataArr; - std::vector copyValuesArr; - -public: - ZCurveAnimation(ZFile* nParent); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; - - std::string GetSourceTypeName() const override; -}; -// CurveAnimationHeader - -/* ZLegacyAnimation */ - -class LegacyJointKey : public ZResource -{ -public: - LegacyJointKey(ZFile* nParent); - - void ParseRawData() override; - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - int16_t xMax, x; - int16_t yMax, y; - int16_t zMax, z; -}; - -class ZLegacyAnimation : public ZAnimation -{ -public: - ZLegacyAnimation(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - - size_t GetRawDataSize() const override; - -protected: - int16_t limbCount; - segptr_t frameData; // s16* - segptr_t jointKey; // LegacyJointKey* - - std::vector frameDataArray; - std::vector jointKeyArray; -}; diff --git a/tools/ZAPD/ZAPD/ZArray.cpp b/tools/ZAPD/ZAPD/ZArray.cpp deleted file mode 100644 index 62720bc610..0000000000 --- a/tools/ZAPD/ZAPD/ZArray.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include "ZArray.h" - -#include - -#include "Globals.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Array, ZArray); - -ZArray::ZArray(ZFile* nParent) : ZResource(nParent) -{ - canHaveInner = true; - RegisterRequiredAttribute("Count"); -} - -ZArray::~ZArray() -{ - for (auto res : resList) - delete res; -} - -void ZArray::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - arrayCnt = reader->IntAttribute("Count", 0); - if (arrayCnt <= 0) - { - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - "invalid value found for 'Count' attribute", ""); - } - - tinyxml2::XMLElement* child = reader->FirstChildElement(); - if (child == nullptr) - { - HANDLE_ERROR_RESOURCE(WarningType::InvalidXML, parent, this, rawDataIndex, - " needs one sub-element", ""); - } - - childName = child->Name(); - - auto nodeMap = ZFile::GetNodeMap(); - size_t childIndex = rawDataIndex; - resList.reserve(arrayCnt); - for (size_t i = 0; i < arrayCnt; i++) - { - ZResource* res = nodeMap->at(childName)(parent); - if (!res->DoesSupportArray()) - { - std::string errorHeader = StringHelper::Sprintf( - "resource <%s> does not support being wrapped in an ", childName.c_str()); - HANDLE_ERROR_RESOURCE(WarningType::InvalidXML, parent, this, rawDataIndex, errorHeader, - ""); - } - res->parent = parent; - res->SetInnerNode(true); - res->ExtractWithXML(child, childIndex); - - childIndex += res->GetRawDataSize(); - resList.push_back(res); - } -} - -Declaration* ZArray::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - ZResource* res = resList.at(0); - Declaration* decl; - if (res->IsExternalResource()) - { - auto filepath = Globals::Instance->outputPath / name; - std::string includePath = StringHelper::Sprintf("%s.%s.inc", filepath.string().c_str(), - res->GetExternalExtension().c_str()); - decl = parent->AddDeclarationIncludeArray(rawDataIndex, includePath, GetRawDataSize(), - GetSourceTypeName(), name, arrayCnt); - decl->declBody = bodyStr; - decl->isExternal = true; - } - else - { - decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), name, arrayCnt, bodyStr); - } - - decl->staticConf = staticConf; - return decl; -} - -std::string ZArray::GetBodySourceCode() const -{ - std::string output; - - for (size_t i = 0; i < arrayCnt; i++) - { - const auto& res = resList[i]; - output += "\t"; - - switch (res->GetResourceType()) - { - case ZResourceType::Pointer: - case ZResourceType::Scalar: - case ZResourceType::Vertex: - case ZResourceType::CollisionPoly: - case ZResourceType::SurfaceType: - case ZResourceType::Waterbox: - output += resList.at(i)->GetBodySourceCode(); - break; - - default: - output += StringHelper::Sprintf("{ %s }", resList.at(i)->GetBodySourceCode().c_str()); - break; - } - - if (i < arrayCnt - 1 || res->IsExternalResource()) - output += ",\n"; - } - - return output; -} - -size_t ZArray::GetRawDataSize() const -{ - size_t size = 0; - for (const auto res : resList) - size += res->GetRawDataSize(); - return size; -} - -std::string ZArray::GetSourceTypeName() const -{ - return resList.at(0)->GetSourceTypeName(); -} - -ZResourceType ZArray::GetResourceType() const -{ - return ZResourceType::Array; -} - -DeclarationAlignment ZArray::GetDeclarationAlignment() const -{ - if (resList.size() == 0) - { - return DeclarationAlignment::Align4; - } - return resList.at(0)->GetDeclarationAlignment(); -} diff --git a/tools/ZAPD/ZAPD/ZArray.h b/tools/ZAPD/ZAPD/ZArray.h deleted file mode 100644 index b78a8edfd8..0000000000 --- a/tools/ZAPD/ZAPD/ZArray.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include -#include -#include -#include "ZResource.h" -#include "tinyxml2.h" - -class ZArray : public ZResource -{ -public: - ZArray(ZFile* nParent); - ~ZArray(); - - void ParseXML(tinyxml2::XMLElement* reader) override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - size_t GetRawDataSize() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - DeclarationAlignment GetDeclarationAlignment() const override; - -protected: - size_t arrayCnt; - std::string childName; - std::vector resList; -}; diff --git a/tools/ZAPD/ZAPD/ZBackground.cpp b/tools/ZAPD/ZAPD/ZBackground.cpp deleted file mode 100644 index fc725637e7..0000000000 --- a/tools/ZAPD/ZAPD/ZBackground.cpp +++ /dev/null @@ -1,197 +0,0 @@ -#include "ZBackground.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/File.h" -#include "Utils/Path.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Background, ZBackground); - -#define JPEG_MARKER 0xFFD8FFE0 -#define MARKER_DQT 0xFFDB -#define MARKER_EOI 0xFFD9 - -ZBackground::ZBackground(ZFile* nParent) : ZResource(nParent) -{ -} - -void ZBackground::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - size_t i = 0; - while (true) - { - uint8_t val = rawData.at(rawDataIndex + i); - data.push_back(val); - - if (BitConverter::ToUInt16BE(rawData, rawDataIndex + i) == MARKER_EOI) - { - data.push_back(rawData.at(rawDataIndex + i + 1)); - break; - } - - i++; - } -} - -void ZBackground::ParseBinaryFile(const std::string& inFolder, bool appendOutName) -{ - fs::path filepath(inFolder); - - if (appendOutName) - filepath = filepath / (outName + "." + GetExternalExtension()); - - data = File::ReadAllBytes(filepath.string()); - - // Add padding. - data.insert(data.end(), GetRawDataSize() - data.size(), 0x00); - CheckValidJpeg(filepath.generic_string()); -} - -void ZBackground::CheckValidJpeg(const std::string& filepath) -{ - std::string filename = outName; - if (filepath != "") - { - filename = filepath; - } - - uint32_t jpegMarker = BitConverter::ToUInt32BE(data, 0); - if (jpegMarker != JPEG_MARKER) - { - HANDLE_WARNING_PROCESS( - WarningType::InvalidJPEG, - StringHelper::Sprintf("missing jpeg marker at beginning of file: '%s'", - filename.c_str()), - "The game will skip this jpeg."); - } - if (data.at(6) != 'J' || data.at(7) != 'F' || data.at(8) != 'I' || data.at(9) != 'F' || - data.at(10) != '\0') - { - std::string jfifIdentifier(data.begin() + 6, data.begin() + 6 + 5); - HANDLE_WARNING_PROCESS( - WarningType::InvalidJPEG, "missing 'JFIF' identifier", - StringHelper::Sprintf( - "This image may be corrupted, or not a jpeg. The identifier found was: '%s'", - jfifIdentifier.c_str())); - } - uint8_t majorVersion = data.at(11); - uint8_t minorVersion = data.at(12); - if (majorVersion != 0x01 || minorVersion != 0x01) - { - HANDLE_WARNING_PROCESS( - WarningType::InvalidJPEG, - StringHelper::Sprintf("wrong JFIF version '%i.%02i'", majorVersion, minorVersion), - "The expected version is '1.01'. The game may be unable to decode this image " - "correctly."); - } - if (BitConverter::ToUInt16BE(data, 20) != MARKER_DQT) - { - // This may happen when creating a custom image with Exif, XMP, thumbnail, progressive, etc. - // enabled. - HANDLE_WARNING_PROCESS(WarningType::InvalidJPEG, - "there seems to be extra data before the image data in this file", - "The game may not be able to decode this image correctly."); - } - if (data.size() > GetRawDataSize()) - { - HANDLE_WARNING_PROCESS( - WarningType::InvalidJPEG, "the image is bigger than the screen buffer", - StringHelper::Sprintf("Image size: %zu bytes\nScreen buffer size: %zu bytes", - data.size(), GetRawDataSize())); - } -} - -size_t ZBackground::GetRawDataSize() const -{ - // Jpgs use the whole sceen buffer, which is a u16 matrix. - return Globals::Instance->cfg.bgScreenHeight * Globals::Instance->cfg.bgScreenWidth * 2; -} - -Declaration* ZBackground::DeclareVar(const std::string& prefix, - [[maybe_unused]] const std::string& bodyStr) -{ - std::string auxName = name; - std::string auxOutName = outName; - - if (auxName == "") - auxName = GetDefaultName(prefix); - - if (auxOutName == "") - auxOutName = GetDefaultName(prefix); - - auto filepath = Globals::Instance->outputPath / fs::path(auxOutName).stem(); - - std::string incStr = - StringHelper::Sprintf("%s.%s.inc.c", filepath.c_str(), GetExternalExtension().c_str()); - - Declaration* decl = parent->AddDeclarationIncludeArray(rawDataIndex, incStr, GetRawDataSize(), - GetSourceTypeName(), auxName, 0); - - if (Globals::Instance->cfg.useScreenWidthHeightConstants) - { - decl->arrayItemCntStr = "SCREEN_WIDTH * SCREEN_HEIGHT / 4"; - decl->forceArrayCnt = true; - } - - decl->staticConf = staticConf; - return decl; -} - -bool ZBackground::IsExternalResource() const -{ - return true; -} - -std::string ZBackground::GetExternalExtension() const -{ - return "jpg"; -} - -void ZBackground::Save(const fs::path& outFolder) -{ - fs::path filepath = outFolder / (outName + "." + GetExternalExtension()); - File::WriteAllBytes(filepath.string(), data); -} - -std::string ZBackground::GetBodySourceCode() const -{ - std::string bodyStr = " "; - - for (size_t i = 0; i < data.size() / 8; ++i) - { - bodyStr += StringHelper::Sprintf("0x%016llX, ", BitConverter::ToUInt64BE(data, i * 8)); - - if (i % 8 == 7) - bodyStr += "\n "; - } - - bodyStr += "\n"; - - return bodyStr; -} - -std::string ZBackground::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sBackground_%06X", prefix.c_str(), rawDataIndex); -} - -std::string ZBackground::GetSourceTypeName() const -{ - return "u64"; -} - -ZResourceType ZBackground::GetResourceType() const -{ - return ZResourceType::Background; -} - -DeclarationAlignment ZBackground::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align8; -} diff --git a/tools/ZAPD/ZAPD/ZBackground.h b/tools/ZAPD/ZAPD/ZBackground.h deleted file mode 100644 index e3728bd984..0000000000 --- a/tools/ZAPD/ZAPD/ZBackground.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include -#include -#include "ZResource.h" - -class ZBackground : public ZResource -{ -protected: - std::vector data; - -public: - ZBackground(ZFile* nParent); - - void ParseBinaryFile(const std::string& inFolder, bool appendOutName); - - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - void Save(const fs::path& outFolder) override; - - bool IsExternalResource() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - std::string GetExternalExtension() const override; - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; - - void CheckValidJpeg(const std::string& filepath); -}; diff --git a/tools/ZAPD/ZAPD/ZBlob.cpp b/tools/ZAPD/ZAPD/ZBlob.cpp deleted file mode 100644 index 6812bfaee9..0000000000 --- a/tools/ZAPD/ZAPD/ZBlob.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "ZBlob.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/File.h" -#include "Utils/Path.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Blob, ZBlob); - -ZBlob::ZBlob(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("Size"); -} - -ZBlob* ZBlob::FromFile(const std::string& filePath) -{ - ZBlob* blob = new ZBlob(nullptr); - blob->name = StringHelper::Split(Path::GetFileNameWithoutExtension(filePath), ".")[0]; - blob->blobData = File::ReadAllBytes(filePath); - - return blob; -} - -void ZBlob::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - blobSize = StringHelper::StrToL(registeredAttributes.at("Size").value, 16); -} - -void ZBlob::ParseRawData() -{ - blobData.assign(parent->GetRawData().begin() + rawDataIndex, - parent->GetRawData().begin() + rawDataIndex + blobSize); -} - -Declaration* ZBlob::DeclareVar(const std::string& prefix, - [[maybe_unused]] const std::string& bodyStr) -{ - std::string auxName = name; - std::string auxOutName = outName; - - if (auxName == "") - auxName = GetDefaultName(prefix); - - if (auxOutName == "") - auxOutName = GetDefaultName(prefix); - - std::string path = Path::GetFileNameWithoutExtension(auxOutName); - - std::string assetOutDir = - (Globals::Instance->outputPath / Path::GetFileNameWithoutExtension(GetOutName())).string(); - - std::string incStr = - StringHelper::Sprintf("%s.%s.inc.c", assetOutDir.c_str(), GetExternalExtension().c_str()); - - return parent->AddDeclarationIncludeArray(rawDataIndex, incStr, GetRawDataSize(), - GetSourceTypeName(), auxName, blobData.size()); -} - -std::string ZBlob::GetBodySourceCode() const -{ - std::string sourceOutput; - - for (size_t i = 0; i < blobData.size(); i += 1) - { - if (i % 16 == 0) - sourceOutput += "\t"; - - sourceOutput += StringHelper::Sprintf("0x%02X, ", blobData[i]); - - if (i % 16 == 15) - sourceOutput += "\n"; - } - - // Ensure there's always a trailing line feed to prevent dumb warnings. - // Please don't remove this line, unless you somehow made a way to prevent - // that warning when building the OoT repo. - sourceOutput += "\n"; - - return sourceOutput; -} - -void ZBlob::Save(const fs::path& outFolder) -{ - File::WriteAllBytes((outFolder / (name + ".bin")).string(), blobData); -} - -bool ZBlob::IsExternalResource() const -{ - return true; -} - -std::string ZBlob::GetExternalExtension() const -{ - return "bin"; -} - -std::string ZBlob::GetSourceTypeName() const -{ - return "u8"; -} - -ZResourceType ZBlob::GetResourceType() const -{ - return ZResourceType::Blob; -} - -size_t ZBlob::GetRawDataSize() const -{ - return blobSize; -} diff --git a/tools/ZAPD/ZAPD/ZBlob.h b/tools/ZAPD/ZAPD/ZBlob.h deleted file mode 100644 index d7a7feff12..0000000000 --- a/tools/ZAPD/ZAPD/ZBlob.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "ZResource.h" -#include "tinyxml2.h" - -class ZBlob : public ZResource -{ -public: - ZBlob(ZFile* nParent); - - static ZBlob* FromFile(const std::string& filePath); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - void Save(const fs::path& outFolder) override; - - bool IsExternalResource() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - std::string GetExternalExtension() const override; - - size_t GetRawDataSize() const override; - -protected: - std::vector blobData; - size_t blobSize = 0; -}; diff --git a/tools/ZAPD/ZAPD/ZCKeyFrame.cpp b/tools/ZAPD/ZAPD/ZCKeyFrame.cpp deleted file mode 100644 index 3893394f5c..0000000000 --- a/tools/ZAPD/ZAPD/ZCKeyFrame.cpp +++ /dev/null @@ -1,312 +0,0 @@ -#include "ZCKeyFrame.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" - -REGISTER_ZFILENODE(KeyFrameSkel, ZKeyFrameSkel); -REGISTER_ZFILENODE(KeyFrameLimbList, ZKeyFrameLimbList); - -ZKeyFrameSkel::ZKeyFrameSkel(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("LimbType"); -} - -ZKeyFrameSkel::~ZKeyFrameSkel() -{ -} - -ZKeyFrameLimb::ZKeyFrameLimb(ZFile* nParent) : ZResource(nParent) -{ -} - -ZKeyFrameStandardLimb::ZKeyFrameStandardLimb(ZFile* nParent) : ZKeyFrameLimb(nParent) -{ -} - -ZKeyFrameFlexLimb::ZKeyFrameFlexLimb(ZFile* nParent) : ZKeyFrameLimb(nParent) -{ -} - -ZKeyFrameLimbList::ZKeyFrameLimbList(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("LimbType"); - RegisterRequiredAttribute("LimbCount"); -} - -ZKeyFrameLimbList::ZKeyFrameLimbList(ZFile* nParent, uint32_t limbCount, ZKeyframeSkelType type) - : ZResource(nParent) -{ - numLimbs = limbCount; - limbType = type; -} - -ZKeyFrameLimbList::~ZKeyFrameLimbList() -{ - for (const auto l : limbs) - delete l; -} - -void ZKeyFrameSkel::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string limbTypeStr = registeredAttributes.at("LimbType").value; - - limbType = ZKeyFrameLimbList::ParseLimbTypeStr(limbTypeStr); - if (limbType == ZKeyframeSkelType::Error) - HANDLE_ERROR_RESOURCE( - WarningType::InvalidXML, parent, this, rawDataIndex, "Invalid limb type", - StringHelper::Sprintf("Invalid limb type. Was expecting 'Flex' or 'Normal'. Got %s.", - limbTypeStr.c_str())); -} -void ZKeyFrameLimbList::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string limbTypeStr = registeredAttributes.at("LimbType").value; - std::string numLimbStr = registeredAttributes.at("LimbCount").value; - - limbType = ParseLimbTypeStr(limbTypeStr); - - if (limbType == ZKeyframeSkelType::Error) - HANDLE_ERROR_RESOURCE( - WarningType::InvalidXML, parent, this, rawDataIndex, "Invalid limb type", - StringHelper::Sprintf("Invalid limb type. Was expecting 'Flex' or 'Normal'. Got %s.", - limbTypeStr.c_str())); - - numLimbs = (uint8_t)StringHelper::StrToL(numLimbStr); -} - -void ZKeyFrameSkel::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - limbCount = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0); - dListCount = BitConverter::ToUInt8BE(rawData, rawDataIndex + 1); - limbsPtr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); - - limbList = std::make_unique(parent, limbCount, limbType); - limbList->SetRawDataIndex(GETSEGOFFSET(limbsPtr)); - limbList->ParseRawData(); -} - -void ZKeyFrameSkel::DeclareReferences(const std::string& prefix) -{ - std::string defaultPrefix = name; - std::string declaration; - - if (defaultPrefix == "") - defaultPrefix = prefix; - - ZResource::DeclareReferences(defaultPrefix); - declaration += limbList->GetBodySourceCode(); - parent->AddDeclarationArray( - GETSEGOFFSET(limbsPtr), DeclarationAlignment::Align4, limbList->GetRawDataSize(), - limbList->GetSourceTypeName(), - StringHelper::Sprintf("%s_KeyFrameLimbs_%06X", prefix.c_str(), rawDataIndex), - limbList->limbs.size(), declaration); -} - -std::string ZKeyFrameSkel::GetBodySourceCode() const -{ - std::string limbStr; - - if (limbType == ZKeyframeSkelType::Normal) - Globals::Instance->GetSegmentedPtrName(limbsPtr, parent, "KeyFrameStandardLimb", limbStr); - else - Globals::Instance->GetSegmentedPtrName(limbsPtr, parent, "KeyFrameFlexLimb", limbStr); - - return StringHelper::Sprintf("\n\t0x%02X, 0x%02X, %s\n", limbCount, dListCount, - limbStr.c_str()); -} - -size_t ZKeyFrameSkel::GetRawDataSize() const -{ - return 0x8; -} - -std::string ZKeyFrameSkel::GetSourceTypeName() const -{ - switch (limbType) - { - case ZKeyframeSkelType::Normal: - return "KeyFrameSkeleton"; - - case ZKeyframeSkelType::Flex: - return "KeyFrameFlexSkeleton"; - - default: - return "KeyFrameSkeleton"; - } -} - -ZResourceType ZKeyFrameSkel::GetResourceType() const -{ - return ZResourceType::KeyFrameSkel; -} - -size_t ZKeyFrameStandardLimb::GetRawDataSize() const -{ - return 0xC; -} - -size_t ZKeyFrameFlexLimb::GetRawDataSize() const -{ - return 0x8; -} - -size_t ZKeyFrameLimbList::GetRawDataSize() const -{ - size_t limbSize; - if (limbType == ZKeyframeSkelType::Flex) - limbSize = 0x8; - else - limbSize = 0xC; - - return limbSize * numLimbs; -} - -ZKeyframeSkelType ZKeyFrameLimbList::ParseLimbTypeStr(const std::string& typeStr) -{ - if (typeStr == "Flex") - return ZKeyframeSkelType::Flex; - else if (typeStr == "Normal") - return ZKeyframeSkelType::Normal; - else - return ZKeyframeSkelType::Error; -} - -void ZKeyFrameLimb::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - dlist = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0); - numChildren = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x4); - flags = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x5); -} - -void ZKeyFrameStandardLimb::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - ZKeyFrameLimb::ParseRawData(); - translation.x = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6); - translation.y = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8); - translation.z = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA); -} - -void ZKeyFrameFlexLimb::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - ZKeyFrameLimb::ParseRawData(); - callbackIndex = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x6); -} - -void ZKeyFrameLimbList::ParseRawData() -{ - limbs.reserve(numLimbs); - rawDataIndex = GetRawDataIndex(); - - for (uint32_t i = 0; i < numLimbs; i++) - { - ZKeyFrameLimb* limb; - if (limbType == ZKeyframeSkelType::Flex) - limb = new ZKeyFrameFlexLimb(parent); - else - limb = new ZKeyFrameStandardLimb(parent); - - limb->SetRawDataIndex(rawDataIndex + (offset_t)(i * limb->GetRawDataSize())); - limb->ParseRawData(); - limbs.push_back(limb); - } -} - -std::string ZKeyFrameLimbList::GetBodySourceCode() const -{ - std::string declaration; - - for (const auto l : limbs) - declaration += StringHelper::Sprintf("\t{ %s },\n", l->GetBodySourceCode().c_str()); - // Remove last newline - return declaration.substr(0, declaration.length() - 1); -} - -std::string ZKeyFrameStandardLimb::GetBodySourceCode() const -{ - std::string declaration; - std::string dlString; - - Globals::Instance->GetSegmentedArrayIndexedName(dlist, 8, parent, "Gfx", dlString); - - declaration += - StringHelper::Sprintf("%s, 0x%02X, 0x%02X, { 0x%04X, 0x%04X, 0x%04X},", dlString.c_str(), - numChildren, flags, translation.x, translation.y, translation.z); - return declaration; -} - -std::string ZKeyFrameFlexLimb::GetBodySourceCode() const -{ - std::string declaration; - - std::string dlString; - - Globals::Instance->GetSegmentedArrayIndexedName(dlist, 8, parent, "Gfx", dlString); - - declaration += StringHelper::Sprintf("%s, 0x%02X, 0x%02X, 0x%02X", dlString.c_str(), - numChildren, flags, callbackIndex); - return declaration; -} - -std::string ZKeyFrameStandardLimb::GetSourceTypeName() const -{ - return "KeyFrameStandardLimb"; -} - -std::string ZKeyFrameFlexLimb::GetSourceTypeName() const -{ - return "KeyFrameFlexLimb"; -} - -std::string ZKeyFrameLimbList::GetSourceTypeName() const -{ - switch (limbType) - { - case ZKeyframeSkelType::Flex: - return "KeyFrameFlexLimb"; - case ZKeyframeSkelType::Normal: - return "KeyFrameStandardLimb"; - default: - HANDLE_ERROR_RESOURCE(WarningType::InvalidXML, parent, this, rawDataIndex, - "Invalid limb type", ""); - break; - } -} - -ZResourceType ZKeyFrameStandardLimb::GetResourceType() const -{ - return ZResourceType::KeyFrameStandardLimb; -} - -ZResourceType ZKeyFrameFlexLimb::GetResourceType() const -{ - return ZResourceType::KeyFrameFlexLimb; -} - -ZResourceType ZKeyFrameLimbList::GetResourceType() const -{ - switch (limbType) - { - case ZKeyframeSkelType::Flex: - return ZResourceType::KeyFrameFlexLimb; - case ZKeyframeSkelType::Normal: - return ZResourceType::KeyFrameStandardLimb; - default: - HANDLE_ERROR_RESOURCE(WarningType::InvalidXML, parent, this, rawDataIndex, - "Invalid limb type", ""); - break; - } -} diff --git a/tools/ZAPD/ZAPD/ZCKeyFrame.h b/tools/ZAPD/ZAPD/ZCKeyFrame.h deleted file mode 100644 index 417d7cc686..0000000000 --- a/tools/ZAPD/ZAPD/ZCKeyFrame.h +++ /dev/null @@ -1,121 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "ZFile.h" - -class ZKeyFrameLimb; - -struct Vec3s -{ - int16_t x; - int16_t y; - int16_t z; -}; - -enum class ZKeyframeSkelType -{ - Normal, - Flex, - Error, -}; - -class ZKeyFrameLimbList : public ZResource -{ -public: - ZKeyFrameLimbList(); - ZKeyFrameLimbList(ZFile* nParent); - ZKeyFrameLimbList(ZFile* nParent, uint32_t limbCount, ZKeyframeSkelType type); - - ~ZKeyFrameLimbList(); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - void ParseXML(tinyxml2::XMLElement* reader) override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - - static ZKeyframeSkelType ParseLimbTypeStr(const std::string& typeStr); - - std::vector limbs; - ZKeyframeSkelType limbType; - uint8_t numLimbs; -}; - -class ZKeyFrameLimb : public ZResource -{ -public: - segptr_t dlist; - uint8_t numChildren; - uint8_t flags; - - ZKeyFrameLimb(ZFile* nParent); - void ParseRawData() override; -}; - -class ZKeyFrameStandardLimb : public ZKeyFrameLimb -{ -public: - Vec3s translation; - - ZKeyFrameStandardLimb(ZFile* nParent); - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; -}; - -class ZKeyFrameFlexLimb : public ZKeyFrameLimb -{ -public: - uint8_t callbackIndex; - - ZKeyFrameFlexLimb(ZFile* nParent); - // void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - // std::string GetSourceOutputHeader(const std::string& prefix) override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; -}; - -class ZKeyFrameSkel : public ZResource -{ -public: - std::unique_ptr limbList; - segptr_t limbsPtr; - ZKeyframeSkelType limbType; - uint8_t limbCount; - uint8_t dListCount; - - ZKeyFrameSkel(ZFile* nParent); - ~ZKeyFrameSkel(); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZCKeyFrameAnim.cpp b/tools/ZAPD/ZAPD/ZCKeyFrameAnim.cpp deleted file mode 100644 index 0b07471333..0000000000 --- a/tools/ZAPD/ZAPD/ZCKeyFrameAnim.cpp +++ /dev/null @@ -1,219 +0,0 @@ -#include "ZCkeyFrameAnim.h" -#include "ZCKeyFrame.h" -#include "Globals.h" - -#include "Utils/BitConverter.h" - -REGISTER_ZFILENODE(KeyFrameAnimation, ZKeyFrameAnim); - -ZKeyFrameAnim::ZKeyFrameAnim(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("Skel"); -} - -ZKeyFrameAnim::~ZKeyFrameAnim() -{ -} - -void ZKeyFrameAnim::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string skelAddrStr = registeredAttributes.at("Skel").value; - skelOffset = (offset_t)StringHelper::StrToL(skelAddrStr, 16); -} - -void ZKeyFrameAnim::DeclareReferencesLate(const std::string& prefix) -{ - std::string defaultPrefix = name; - std::string declaration; - - if (defaultPrefix == "") - defaultPrefix = prefix; - - ZResource::DeclareReferences(defaultPrefix); - - declaration += "\t"; - - if (skel->limbType == ZKeyframeSkelType::Normal) - { - for (const auto b : bitFlags) - { - declaration += StringHelper::Sprintf("0x%02X, ", b); - parent->AddDeclarationArray( - GETSEGOFFSET(bitFlagsAddr), DeclarationAlignment::Align4, bitFlags.size(), "u8", - StringHelper::Sprintf("%s_bitFlags_%06X", prefix.c_str(), rawDataIndex), - bitFlags.size(), declaration); - } - } - else - { - for (const auto b : bitFlagsFlex) - { - declaration += StringHelper::Sprintf("0x%04X, ", b); - parent->AddDeclarationArray( - GETSEGOFFSET(bitFlagsAddr), DeclarationAlignment::Align4, bitFlagsFlex.size() * 2, - "u16", StringHelper::Sprintf("%s_flexBitFlags_%06X", prefix.c_str(), rawDataIndex), - bitFlagsFlex.size(), declaration); - } - } - declaration.clear(); - - for (const auto kf : keyFrames) - { - declaration += - StringHelper::Sprintf(" \t { %i, %i, %i, },\n", kf.frame, kf.value, kf.velocity); - } - // Remove last new line to prevent an extra line after the last element - declaration = declaration.substr(0, declaration.length() - 1); - parent->AddDeclarationArray( - GETSEGOFFSET(keyFramesAddr), DeclarationAlignment::Align4, keyFrames.size() * 6, "KeyFrame", - StringHelper::Sprintf("%s_KeyFrame_%06X", prefix.c_str(), rawDataIndex), keyFrames.size(), - declaration); - - declaration.clear(); - - declaration += "\t"; - - for (const auto kfNum : kfNums) - { - declaration += StringHelper::Sprintf("0x%04X, ", kfNum); - } - - parent->AddDeclarationArray( - GETSEGOFFSET(kfNumsAddr), DeclarationAlignment::Align4, kfNums.size() * 2, "s16", - StringHelper::Sprintf("%s_kfNums_%06X", prefix.c_str(), rawDataIndex), kfNums.size(), - declaration); - declaration += "\n"; - - declaration.clear(); - - declaration += "\t"; - - for (const auto pv : presetValues) - { - declaration += StringHelper::Sprintf("0x%04X, ", pv); - } - declaration += "\n"; - parent->AddDeclarationArray( - GETSEGOFFSET(presentValuesAddr), DeclarationAlignment::Align4, presetValues.size() * 2, - "s16", StringHelper::Sprintf("%s_presetValues_%06X", prefix.c_str(), rawDataIndex), - presetValues.size(), declaration); - -} - -// ParseRawDataLate is used because we need to make sure the flex skel has been processed first. -void ZKeyFrameAnim::ParseRawDataLate() -{ - const auto& rawData = parent->GetRawData(); - - skel = static_cast(parent->FindResource(skelOffset)); - size_t numLimbs = skel->limbCount; - - bitFlagsAddr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0); - keyFramesAddr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x4); - kfNumsAddr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x8); - presentValuesAddr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0xC); - - uint32_t kfNumsSize = 0; - uint32_t presetValuesSize = 0; - uint32_t keyFramesCount = 0; - if (skel->limbType == ZKeyframeSkelType::Normal) - { - bitFlags.reserve(numLimbs); - for (size_t i = 0; i < numLimbs; i++) - { - uint8_t e = BitConverter::ToUInt8BE(rawData, GETSEGOFFSET(bitFlagsAddr) + i); - bitFlags.push_back(e); - kfNumsSize += GetSetBits((uint8_t)(e & 0b111111)); - presetValuesSize += GetSetBits((uint8_t)((e ^ 0xFF) & 0b111111)); - } - } - else - { - bitFlagsFlex.reserve(numLimbs); - for (size_t i = 0; i < numLimbs; i++) - { - uint16_t e = BitConverter::ToUInt16BE(rawData, GETSEGOFFSET(bitFlagsAddr) + (i * 2)); - bitFlagsFlex.push_back(e); - kfNumsSize += GetSetBits((uint16_t)(e & 0b111111111)); - presetValuesSize += GetSetBits((uint16_t)((e ^ 0xFFFF) & 0b111111111)); - } - } - - kfNums.reserve(kfNumsSize); - for (uint32_t i = 0; i < kfNumsSize; i++) - { - int16_t kfNum = BitConverter::ToUInt16BE(rawData, GETSEGOFFSET(kfNumsAddr) + (i * 2)); - keyFramesCount += kfNum; - kfNums.push_back(kfNum); - } - - keyFrames.reserve(keyFramesCount); - for (uint32_t i = 0; i < keyFramesCount; i++) - { - KeyFrame kf; - kf.frame = BitConverter::ToInt16BE(rawData, (GETSEGOFFSET(keyFramesAddr) + 0) + (i * 6)); - kf.value = BitConverter::ToInt16BE(rawData, (GETSEGOFFSET(keyFramesAddr) + 2) + (i * 6)); - kf.velocity = BitConverter::ToInt16BE(rawData, (GETSEGOFFSET(keyFramesAddr) + 4) + (i * 6)); - keyFrames.push_back(kf); - } - - presetValues.reserve(presetValuesSize); - for (uint32_t i = 0; i < presetValuesSize; i++) - { - presetValues.push_back( - BitConverter::ToInt16BE(rawData, GETSEGOFFSET(presentValuesAddr) + (i * 2))); - } - - unk_10 = BitConverter::ToInt16BE(rawData, GETSEGOFFSET(rawDataIndex) + 0x10); - duration = BitConverter::ToInt16BE(rawData, GETSEGOFFSET(rawDataIndex) + 0x12); -} - -std::string ZKeyFrameAnim::GetBodySourceCode() const -{ - std::string declaration; - - std::string bitFlagsStr; - std::string keyFrameStr; - std::string kfNumsStr; - std::string presetValuesStr; - - Globals::Instance->GetSegmentedPtrName(bitFlagsAddr, parent, "", bitFlagsStr); - Globals::Instance->GetSegmentedPtrName(keyFramesAddr, parent, "", keyFrameStr); - Globals::Instance->GetSegmentedPtrName(kfNumsAddr, parent, "", kfNumsStr); - Globals::Instance->GetSegmentedPtrName(presentValuesAddr, parent, "", presetValuesStr); - - return StringHelper::Sprintf("\n\t%s, %s, %s, %s, 0x%04X, 0x%04X\n", bitFlagsStr.c_str(), - keyFrameStr.c_str(), kfNumsStr.c_str(), presetValuesStr.c_str(), - unk_10, duration); -} - -std::string ZKeyFrameAnim::GetSourceTypeName() const -{ - return "KeyFrameAnimation"; -} - -ZResourceType ZKeyFrameAnim::GetResourceType() const -{ - return ZResourceType::KeyFrameAnimation; -} - -size_t ZKeyFrameAnim::GetRawDataSize() const -{ - return 0x14; -} - -template -uint32_t ZKeyFrameAnim::GetSetBits(T data) const -{ - uint32_t num = 0; - - for (size_t i = 0; i < sizeof(T) * 8; i++) - { - if ((data >> i) & 1) - num++; - } - - return num; -} \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZCkeyFrameAnim.h b/tools/ZAPD/ZAPD/ZCkeyFrameAnim.h deleted file mode 100644 index 64f95b13ae..0000000000 --- a/tools/ZAPD/ZAPD/ZCkeyFrameAnim.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once -#include -#include -#include -#include - -#include "ZFile.h" - -class ZKeyFrameSkel; - -typedef struct -{ - int16_t frame; - int16_t value; - int16_t velocity; -} KeyFrame; - -class ZKeyFrameAnim : public ZResource -{ -public: - ZKeyFrameSkel* skel; - std::vector bitFlags; // Standard only - std::vector bitFlagsFlex; // Flex only - - std::vector keyFrames; - std::vector kfNums; - std::vector presetValues; - - uint16_t unk_10; - int16_t duration; - - ZKeyFrameAnim(ZFile* nParent); - ~ZKeyFrameAnim(); - void ParseXML(tinyxml2::XMLElement* reader) override; - void DeclareReferencesLate(const std::string& prefix) override; - void ParseRawDataLate() override; - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -private: - offset_t skelOffset; - segptr_t bitFlagsAddr; - segptr_t keyFramesAddr; - segptr_t kfNumsAddr; - segptr_t presentValuesAddr; - template - uint32_t GetSetBits(T data) const; -}; diff --git a/tools/ZAPD/ZAPD/ZCollision.cpp b/tools/ZAPD/ZAPD/ZCollision.cpp deleted file mode 100644 index d177e036cb..0000000000 --- a/tools/ZAPD/ZAPD/ZCollision.cpp +++ /dev/null @@ -1,413 +0,0 @@ -#include "ZCollision.h" -#include "ZWaterbox.h" - -#include -#include -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -REGISTER_ZFILENODE(Collision, ZCollisionHeader); - -ZCollisionHeader::ZCollisionHeader(ZFile* nParent) : ZResource(nParent) -{ -} - -ZCollisionHeader::~ZCollisionHeader() -{ - delete camData; -} - -void ZCollisionHeader::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - absMinX = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - absMinY = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - absMinZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - - absMaxX = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - absMaxY = BitConverter::ToInt16BE(rawData, rawDataIndex + 8); - absMaxZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 10); - - numVerts = BitConverter::ToUInt16BE(rawData, rawDataIndex + 12); - vtxAddress = BitConverter::ToInt32BE(rawData, rawDataIndex + 16); - - numPolygons = BitConverter::ToUInt16BE(rawData, rawDataIndex + 20); - polyAddress = BitConverter::ToInt32BE(rawData, rawDataIndex + 24); - polyTypeDefAddress = BitConverter::ToInt32BE(rawData, rawDataIndex + 28); - camDataAddress = BitConverter::ToInt32BE(rawData, rawDataIndex + 32); - - numWaterBoxes = BitConverter::ToUInt16BE(rawData, rawDataIndex + 36); - waterBoxAddress = BitConverter::ToInt32BE(rawData, rawDataIndex + 40); - - vtxSegmentOffset = Seg2Filespace(vtxAddress, parent->baseAddress); - polySegmentOffset = Seg2Filespace(polyAddress, parent->baseAddress); - polyTypeDefSegmentOffset = Seg2Filespace(polyTypeDefAddress, parent->baseAddress); - camDataSegmentOffset = Seg2Filespace(camDataAddress, parent->baseAddress); - waterBoxSegmentOffset = Seg2Filespace(waterBoxAddress, parent->baseAddress); - - vertices.reserve(numVerts); - polygons.reserve(numPolygons); - waterBoxes.reserve(numWaterBoxes); - - offset_t currentPtr = vtxSegmentOffset; - - for (uint16_t i = 0; i < numVerts; i++) - { - ZVector vec(parent); - vec.ExtractFromBinary(currentPtr, ZScalarType::ZSCALAR_S16, 3); - - currentPtr += vec.GetRawDataSize(); - vertices.push_back(vec); - } - - for (uint16_t i = 0; i < numPolygons; i++) - { - ZCollisionPoly poly(parent); - poly.SetRawDataIndex(polySegmentOffset + (i * 16)); - poly.ParseRawData(); - polygons.push_back(poly); - } - - uint16_t highestPolyType = 0; - - for (const ZCollisionPoly& poly : polygons) - { - if (poly.type > highestPolyType) - highestPolyType = poly.type; - } - - for (uint16_t i = 0; i < highestPolyType + 1; i++) - { - ZSurfaceType surfaceType(parent); - surfaceType.SetRawDataIndex(polyTypeDefSegmentOffset + (i * 8)); - surfaceType.ParseRawData(); - polygonTypes.push_back(surfaceType); - } - // polygonTypes.push_back( - // BitConverter::ToUInt64BE(rawData, polyTypeDefSegmentOffset + (i * 8))); - - if (camDataAddress != SEGMENTED_NULL) - { - // Try to guess how many elements the CamDataList array has. - // The "guessing algorithm" is basically a "best effort" one and it - // is error-prone. - // This is based mostly on observation of how CollisionHeader data is - // usually ordered. If for some reason the data was in some other funny - // order, this would probably break. - // The most common ordering is: - // - *BgCamInfo* - // - SurfaceType - // - CollisionPoly - // - Vertices - // - WaterBoxes - // - CollisionHeader - offset_t upperCameraBoundary = polyTypeDefSegmentOffset; - if (upperCameraBoundary == SEGMENTED_NULL) - { - upperCameraBoundary = polySegmentOffset; - } - if (upperCameraBoundary == SEGMENTED_NULL) - { - upperCameraBoundary = vtxSegmentOffset; - } - if (upperCameraBoundary == SEGMENTED_NULL) - { - upperCameraBoundary = waterBoxSegmentOffset; - } - if (upperCameraBoundary == SEGMENTED_NULL) - { - upperCameraBoundary = rawDataIndex; - } - - // Sharp Ocarina places the CamDataEntries above the list so we need to calculate the number - // of cameras differently. - if (upperCameraBoundary < camDataSegmentOffset) - { - offset_t offset = camDataSegmentOffset; - while (rawData[offset] == 0x00 && rawData[offset + 0x4] == 0x02) - { - offset += 0x08; - } - upperCameraBoundary = offset; - } - - camData = - new CameraDataList(parent, name, rawData, camDataSegmentOffset, upperCameraBoundary); - } - - for (int32_t i = 0; i < numWaterBoxes; i++) - { - ZWaterbox waterbox(parent); - - waterbox.SetRawDataIndex(waterBoxSegmentOffset + - (i * (Globals::Instance->game == ZGame::OOT_SW97 ? 12 : 16))); - waterbox.ParseRawData(); - waterBoxes.emplace_back(waterbox); - } -} - -void ZCollisionHeader::DeclareReferences(const std::string& prefix) -{ - std::string declaration = ""; - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - if (waterBoxes.size() > 0) - { - for (size_t i = 0; i < waterBoxes.size(); i++) - { - declaration += - StringHelper::Sprintf("\t{ %s },", waterBoxes[i].GetBodySourceCode().c_str()); - if (i + 1 < waterBoxes.size()) - declaration += "\n"; - } - - parent->AddDeclarationArray(waterBoxSegmentOffset, DeclarationAlignment::Align4, - waterBoxes[0].GetRawDataSize() * waterBoxes.size(), - waterBoxes[0].GetSourceTypeName().c_str(), - StringHelper::Sprintf("%sWaterBoxes", auxName.c_str()), - waterBoxes.size(), declaration); - } - - if (polygons.size() > 0) - { - declaration.clear(); - - for (size_t i = 0; i < polygons.size(); i++) - { - declaration += StringHelper::Sprintf("\t%s,", polygons[i].GetBodySourceCode().c_str()); - if (i + 1 < polygons.size()) - declaration += "\n"; - } - - parent->AddDeclarationArray(polySegmentOffset, DeclarationAlignment::Align4, - polygons.size() * 16, polygons[0].GetSourceTypeName().c_str(), - StringHelper::Sprintf("%sPolygons", auxName.c_str()), - polygons.size(), declaration); - } - - declaration.clear(); - for (const auto& polyType : polygonTypes) - { - declaration += StringHelper::Sprintf("\t%s,", polyType.GetBodySourceCode().c_str()); - } - - if (polyTypeDefAddress != SEGMENTED_NULL) - parent->AddDeclarationArray(polyTypeDefSegmentOffset, DeclarationAlignment::Align4, - polygonTypes.size() * 8, - polygonTypes[0].GetSourceTypeName().c_str(), - StringHelper::Sprintf("%sSurfaceType", auxName.c_str()), - polygonTypes.size(), declaration); - - declaration.clear(); - - if (vertices.size() > 0) - { - declaration.clear(); - - for (size_t i = 0; i < vertices.size(); i++) - { - declaration += - StringHelper::Sprintf("\t{ %s },", vertices[i].GetBodySourceCode().c_str()); - - if (i < vertices.size() - 1) - declaration += "\n"; - } - - const auto& first = vertices.front(); - if (vtxAddress != 0) - parent->AddDeclarationArray( - vtxSegmentOffset, first.GetDeclarationAlignment(), - vertices.size() * first.GetRawDataSize(), first.GetSourceTypeName(), - StringHelper::Sprintf("%sVertices", auxName.c_str()), vertices.size(), declaration); - } -} - -std::string ZCollisionHeader::GetBodySourceCode() const -{ - std::string declaration = ""; - - declaration += "\n"; - - declaration += StringHelper::Sprintf("\t{ %i, %i, %i },\n", absMinX, absMinY, absMinZ); - declaration += StringHelper::Sprintf("\t{ %i, %i, %i },\n", absMaxX, absMaxY, absMaxZ); - - std::string vtxName; - Globals::Instance->GetSegmentedPtrName(vtxAddress, parent, "Vec3s", vtxName); - - if (numVerts > 0) - declaration += - StringHelper::Sprintf("\tARRAY_COUNT(%s), %s,\n", vtxName.c_str(), vtxName.c_str()); - else - declaration += StringHelper::Sprintf("\t%i, %s,\n", numVerts, vtxName.c_str()); - - std::string polyName; - Globals::Instance->GetSegmentedPtrName(polyAddress, parent, "CollisionPoly", polyName); - - if (numPolygons > 0) - declaration += - StringHelper::Sprintf("\tARRAY_COUNT(%s), %s,\n", polyName.c_str(), polyName.c_str()); - else - declaration += StringHelper::Sprintf("\t%i, %s,\n", numPolygons, polyName.c_str()); - - std::string surfaceName; - Globals::Instance->GetSegmentedPtrName(polyTypeDefAddress, parent, "SurfaceType", surfaceName); - declaration += StringHelper::Sprintf("\t%s,\n", surfaceName.c_str()); - - std::string camName; - Globals::Instance->GetSegmentedPtrName(camDataAddress, parent, "BgCamInfo", camName); - declaration += StringHelper::Sprintf("\t%s,\n", camName.c_str()); - - std::string waterBoxName; - Globals::Instance->GetSegmentedPtrName(waterBoxAddress, parent, "WaterBox", waterBoxName); - - if (numWaterBoxes > 0) - declaration += StringHelper::Sprintf("\tARRAY_COUNT(%s), %s\n", waterBoxName.c_str(), - waterBoxName.c_str()); - else - declaration += StringHelper::Sprintf("\t%i, %s\n", numWaterBoxes, waterBoxName.c_str()); - - return declaration; -} - -std::string ZCollisionHeader::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sCol_%06X", prefix.c_str(), rawDataIndex); -} - -std::string ZCollisionHeader::GetSourceTypeName() const -{ - return "CollisionHeader"; -} - -ZResourceType ZCollisionHeader::GetResourceType() const -{ - return ZResourceType::CollisionHeader; -} - -size_t ZCollisionHeader::GetRawDataSize() const -{ - return 44; -} - -CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix, - const std::vector& rawData, offset_t rawDataIndex, - offset_t upperCameraBoundary) -{ - std::string declaration; - - // Parse CameraDataEntries - size_t numElements = (upperCameraBoundary - rawDataIndex) / 8; - assert(numElements < 10000); - - offset_t cameraPosDataSeg = rawDataIndex; - uint32_t numDataTotal; - uint32_t cameraPosDataSegEnd = rawDataIndex; - bool isSharpOcarina = false; - - for (size_t i = 0; i < numElements; i++) - { - CameraDataEntry entry; - - entry.cameraSType = - BitConverter::ToInt16BE(rawData, rawDataIndex + (entries.size() * 8) + 0); - entry.numData = BitConverter::ToInt16BE(rawData, rawDataIndex + (entries.size() * 8) + 2); - entry.cameraPosDataSeg = - BitConverter::ToInt32BE(rawData, rawDataIndex + (entries.size() * 8) + 4); - - if (entry.cameraPosDataSeg != 0 && GETSEGNUM(entry.cameraPosDataSeg) != SEGMENT_SCENE) - { - cameraPosDataSeg = rawDataIndex + (entries.size() * 8); - break; - } - - if (rawDataIndex > GETSEGOFFSET(entry.cameraPosDataSeg)) - { - if (entry.cameraPosDataSeg != 0 && - cameraPosDataSeg > GETSEGOFFSET(entry.cameraPosDataSeg)) - cameraPosDataSeg = GETSEGOFFSET(entry.cameraPosDataSeg); - } - else - { - // Sharp Ocarina will place the cam data after the list as opposed to the original maps - // which have it before. - isSharpOcarina = true; - cameraPosDataSeg = rawDataIndex + (numElements * 0x8); - if (cameraPosDataSegEnd < GETSEGOFFSET(entry.cameraPosDataSeg)) - cameraPosDataSegEnd = GETSEGOFFSET(entry.cameraPosDataSeg); - } - - entries.emplace_back(entry); - } - - // Setting cameraPosDataAddr to rawDataIndex give a pos list length of 0 - uint32_t cameraPosDataOffset = GETSEGOFFSET(cameraPosDataSeg); - for (size_t i = 0; i < entries.size(); i++) - { - char camSegLine[2048]; - - if (entries[i].cameraPosDataSeg != 0) - { - uint32_t index = - (GETSEGOFFSET(entries[i].cameraPosDataSeg) - cameraPosDataOffset) / 0x6; - snprintf(camSegLine, 2048, "&%sCamPosData[%i]", prefix.c_str(), index); - } - else - snprintf(camSegLine, 2048, "NULL"); - - declaration += - StringHelper::Sprintf(" { 0x%04X, %i, %s },", entries[i].cameraSType, - entries[i].numData, camSegLine, rawDataIndex + (i * 8)); - - if (i < entries.size() - 1) - declaration += "\n"; - } - - parent->AddDeclarationArray( - rawDataIndex, DeclarationAlignment::Align4, entries.size() * 8, "BgCamInfo", - StringHelper::Sprintf("%sCamDataList", prefix.c_str(), rawDataIndex), entries.size(), - declaration); - - if (!isSharpOcarina) - numDataTotal = (rawDataIndex - cameraPosDataOffset) / 0x6; - else - numDataTotal = ((cameraPosDataSegEnd - cameraPosDataSeg) + 18) / 0x6; - - if (numDataTotal > 0) - { - declaration.clear(); - cameraPositionData.reserve(numDataTotal); - for (uint32_t i = 0; i < numDataTotal; i++) - { - CameraPositionData data = CameraPositionData(rawData, cameraPosDataOffset + (i * 6)); - - declaration += StringHelper::Sprintf("\t{ %6i, %6i, %6i },", data.x, data.y, data.z); - cameraPositionData.emplace_back(data); - if (i + 1 < numDataTotal) - declaration += "\n"; - } - - uint32_t cameraPosDataIndex = GETSEGOFFSET(cameraPosDataSeg); - uint32_t entrySize = numDataTotal * 0x6; - parent->AddDeclarationArray(cameraPosDataIndex, DeclarationAlignment::Align4, entrySize, - "Vec3s", StringHelper::Sprintf("%sCamPosData", prefix.c_str()), - numDataTotal, declaration); - } -} - -CameraDataList::~CameraDataList() -{ -} - -CameraPositionData::CameraPositionData(const std::vector& rawData, uint32_t rawDataIndex) -{ - x = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - y = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - z = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); -} diff --git a/tools/ZAPD/ZAPD/ZCollision.h b/tools/ZAPD/ZAPD/ZCollision.h deleted file mode 100644 index 8c73d2eaa1..0000000000 --- a/tools/ZAPD/ZAPD/ZCollision.h +++ /dev/null @@ -1,75 +0,0 @@ -#pragma once - -#include "ZCollisionPoly.h" -#include "ZFile.h" -#include "ZResource.h" -#include "ZRoom/ZRoom.h" -#include "ZSurfaceType.h" -#include "ZVector.h" -#include "ZWaterbox.h" - -class CameraPositionData -{ -public: - int16_t x, y, z; - - CameraPositionData(const std::vector& rawData, uint32_t rawDataIndex); -}; - -class CameraDataEntry -{ -public: - int16_t cameraSType; - int16_t numData; - offset_t cameraPosDataSeg; -}; - -class CameraDataList -{ -public: - std::vector entries; - std::vector cameraPositionData; - - CameraDataList(ZFile* parent, const std::string& prefix, const std::vector& rawData, - offset_t rawDataIndex, offset_t upperCameraBoundary); - ~CameraDataList(); -}; - -class ZCollisionHeader : public ZResource -{ -public: - int16_t absMinX, absMinY, absMinZ; - int16_t absMaxX, absMaxY, absMaxZ; - uint16_t numVerts; - segptr_t vtxAddress; - uint16_t numPolygons; - segptr_t polyAddress; - segptr_t polyTypeDefAddress; - segptr_t camDataAddress; - - int32_t numWaterBoxes; - segptr_t waterBoxAddress; - - uint32_t vtxSegmentOffset, polySegmentOffset, polyTypeDefSegmentOffset, camDataSegmentOffset, - waterBoxSegmentOffset; - - std::vector vertices; - std::vector polygons; - std::vector polygonTypes; - std::vector waterBoxes; - CameraDataList* camData = nullptr; - - ZCollisionHeader(ZFile* nParent); - ~ZCollisionHeader(); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZCollisionPoly.cpp b/tools/ZAPD/ZAPD/ZCollisionPoly.cpp deleted file mode 100644 index c4eb2d461d..0000000000 --- a/tools/ZAPD/ZAPD/ZCollisionPoly.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "ZCollisionPoly.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -REGISTER_ZFILENODE(CollisionPoly, ZCollisionPoly); - -ZCollisionPoly::ZCollisionPoly(ZFile* nParent) : ZResource(nParent) -{ -} - -ZCollisionPoly::~ZCollisionPoly() -{ -} - -void ZCollisionPoly::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); - - vtxA = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - vtxB = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); - vtxC = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); - - normX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8); - normY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10); - normZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 12); - - dist = BitConverter::ToUInt16BE(rawData, rawDataIndex + 14); -} - -void ZCollisionPoly::DeclareReferences(const std::string& prefix) -{ - std::string declaration; - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(), - GetSourceTypeName(), name.c_str(), GetBodySourceCode()); -} - -std::string ZCollisionPoly::GetBodySourceCode() const -{ - std::string declaration; - - declaration += - StringHelper::Sprintf("{0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X}", - type, vtxA, vtxB, vtxC, normX, normY, normZ, dist); - return declaration; -} - -std::string ZCollisionPoly::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sCollisionPoly_%06X", prefix.c_str(), rawDataIndex); -} - -ZResourceType ZCollisionPoly::GetResourceType() const -{ - return ZResourceType::CollisionPoly; -} - -size_t ZCollisionPoly::GetRawDataSize() const -{ - return 16; -} - -std::string ZCollisionPoly::GetSourceTypeName() const -{ - return "CollisionPoly"; -} - -bool ZCollisionPoly::DoesSupportArray() const -{ - return true; -} \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZCollisionPoly.h b/tools/ZAPD/ZAPD/ZCollisionPoly.h deleted file mode 100644 index 64b98ba1d9..0000000000 --- a/tools/ZAPD/ZAPD/ZCollisionPoly.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "ZFile.h" -#include "ZResource.h" - -class ZCollisionPoly : public ZResource -{ -public: - uint16_t type; - uint16_t vtxA, vtxB, vtxC; - uint16_t normX, normY, normZ; - uint16_t dist; - - ZCollisionPoly(ZFile* nParent); - ~ZCollisionPoly(); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - bool DoesSupportArray() const override; - - size_t GetRawDataSize() const override; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZCutscene.cpp b/tools/ZAPD/ZAPD/ZCutscene.cpp deleted file mode 100644 index 636a7d4c73..0000000000 --- a/tools/ZAPD/ZAPD/ZCutscene.cpp +++ /dev/null @@ -1,396 +0,0 @@ -#include "ZCutscene.h" - -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZResource.h" - -REGISTER_ZFILENODE(Cutscene, ZCutscene); - -ZCutscene::ZCutscene(ZFile* nParent) : ZResource(nParent) -{ -} - -ZCutscene::~ZCutscene() -{ - for (CutsceneCommand* cmd : commands) - delete cmd; -} - -std::string ZCutscene::GetBodySourceCode() const -{ - std::string output = ""; - - output += StringHelper::Sprintf(" CS_HEADER(%i, %i),\n", numCommands, endFrame); - - for (size_t i = 0; i < commands.size(); i++) - { - CutsceneCommand* cmd = commands[i]; - output += " " + cmd->GenerateSourceCode(); - } - - output += StringHelper::Sprintf(" CS_END_OF_SCRIPT(),"); - - return output; -} - -size_t ZCutscene::GetRawDataSize() const -{ - size_t size = 0; - - // Beginning - size += 8; - - for (size_t i = 0; i < commands.size(); i++) - { - CutsceneCommand* cmd = commands[i]; - - size += cmd->GetCommandSize(); - } - - // End - if (Globals::Instance->game == ZGame::MM_RETAIL) - { - size += 4; - } - else - { - size += 8; - } - - return size; -} - -void ZCutscene::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - - numCommands = BitConverter::ToInt32BE(rawData, rawDataIndex + 0); - commands = std::vector(); - - endFrame = BitConverter::ToInt32BE(rawData, rawDataIndex + 4); - offset_t currentPtr = rawDataIndex + 8; - commands.reserve(numCommands); - for (int32_t i = 0; i < numCommands; i++) - { - uint32_t id = BitConverter::ToUInt32BE(rawData, currentPtr); - - if (id == 0xFFFFFFFF) - break; - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - { - printf("Cutscene Command: 0x%X (%i)\n", id, id); - } - - currentPtr += 4; - - CutsceneCommand* cmd = nullptr; - - if (Globals::Instance->game == ZGame::MM_RETAIL) - { - cmd = GetCommandMM(id, currentPtr); - } - else - { - cmd = GetCommandOoT(id, currentPtr); - } - - if (cmd == nullptr) - { - HANDLE_WARNING_RESOURCE( - WarningType::NotImplemented, parent, this, rawDataIndex, - StringHelper::Sprintf("Cutscene command not implemented"), - StringHelper::Sprintf("Command ID: 0x%X\nIndex: %d\ncurrentPtr-rawDataIndex: 0x%X", - id, i, currentPtr - rawDataIndex)); - cmd = new CutsceneMMCommand_NonImplemented(rawData, currentPtr); - } - - assert(cmd != nullptr); - - cmd->commandIndex = i; - cmd->SetCommandID(id); - size_t commmandSize = cmd->GetCommandSize(); - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - { - printf("\t Command size: 0x%zX (%zu)\n", commmandSize, commmandSize); - } - currentPtr += commmandSize - 4; - - commands.push_back(cmd); - } -} - -CutsceneCommand* ZCutscene::GetCommandOoT(uint32_t id, offset_t currentPtr) const -{ - CutsceneOoT_CommandType cmdID = static_cast(id); - - const auto& rawData = parent->GetRawData(); - - switch (cmdID) - { - case CutsceneOoT_CommandType::CS_CMD_PLAYER_CUE: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_1: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_8_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_7: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_7: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_8: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_7: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_8: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_7: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_9: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_10: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_8: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_9: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_8: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_2: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_9: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_11: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_10: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_9: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_11: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_10: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_12: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_3: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_4: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_12: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_10: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_13: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_13: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_14: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_11: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_14: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_15: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_12: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_11: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_7: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_16: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_13: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_12: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_5: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_8: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_7: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_15: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_16: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_17: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_6: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_9_0: - case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_17: - return new CutsceneOoTCommand_ActorCue(rawData, currentPtr); - - case CutsceneOoT_CommandType::CS_CMD_MISC: - case CutsceneOoT_CommandType::CS_CMD_LIGHT_SETTING: - case CutsceneOoT_CommandType::CS_CMD_START_SEQ: - case CutsceneOoT_CommandType::CS_CMD_STOP_SEQ: - case CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ: - return new CutsceneOoTCommand_GenericCmd(rawData, currentPtr, cmdID); - - case CutsceneOoT_CommandType::CS_CMD_CAM_EYE_SPLINE: - case CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE: - case CutsceneOoT_CommandType::CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER: - case CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER: - return new CutsceneOoTCommand_GenericCameraCmd(rawData, currentPtr); - - case CutsceneOoT_CommandType::CS_CMD_RUMBLE_CONTROLLER: - return new CutsceneOoTCommand_Rumble(rawData, currentPtr); - - case CutsceneOoT_CommandType::CS_CMD_TEXT: - return new CutsceneOoTCommand_Text(rawData, currentPtr); - - case CutsceneOoT_CommandType::CS_CMD_TRANSITION: - return new CutsceneOoTCommand_Transition(rawData, currentPtr); - - case CutsceneOoT_CommandType::CS_CMD_TIME: - return new CutsceneCommand_Time(rawData, currentPtr); - - case CutsceneOoT_CommandType::CS_CMD_DESTINATION: - return new CutsceneOoTCommand_Destination(rawData, currentPtr); - - case CutsceneOoT_CommandType::CS_CMD_CAM_EYE: - case CutsceneOoT_CommandType::CS_CMD_CAM_AT: - break; - - default: - std::string errorHeader = - StringHelper::Sprintf("Warning: Invalid cutscene command ID: '0x%04X'", cmdID); - return new CutsceneOoTCommand_GenericCmd(rawData, currentPtr, cmdID); - } - - return nullptr; -} - -CutsceneCommand* ZCutscene::GetCommandMM(uint32_t id, offset_t currentPtr) const -{ - CutsceneMM_CommandType cmdID = static_cast(id); - - const auto& rawData = parent->GetRawData(); - - if (((id >= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_100) && - (id <= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_149)) || - (id == (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_201) || - ((id >= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_450) && - (id <= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_599))) - { - return new CutsceneMMCommand_ActorCue(rawData, currentPtr); - } - - switch (cmdID) - { - case CutsceneMM_CommandType::CS_CMD_MISC: - case CutsceneMM_CommandType::CS_CMD_LIGHT_SETTING: - case CutsceneMM_CommandType::CS_CMD_TRANSITION: - case CutsceneMM_CommandType::CS_CMD_MOTION_BLUR: - case CutsceneMM_CommandType::CS_CMD_GIVE_TATL: - case CutsceneMM_CommandType::CS_CMD_START_SEQ: - case CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_2: - case CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_1: - case CutsceneMM_CommandType::CS_CMD_MODIFY_SEQ: - case CutsceneMM_CommandType::CS_CMD_STOP_SEQ: - case CutsceneMM_CommandType::CS_CMD_START_AMBIENCE: - case CutsceneMM_CommandType::CS_CMD_FADE_OUT_AMBIENCE: - case CutsceneMM_CommandType::CS_CMD_DESTINATION: - case CutsceneMM_CommandType::CS_CMD_CHOOSE_CREDITS_SCENES: - - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_FA: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_FE: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_FF: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_100: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_101: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_102: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_103: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_104: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_105: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_108: - case CutsceneMM_CommandType::CS_CMD_UNK_DATA_109: - return new CutsceneMMCommand_GenericCmd(rawData, currentPtr, cmdID); - - case CutsceneMM_CommandType::CS_CMD_TEXT: - return new CutsceneMMCommand_Text(rawData, currentPtr); - - case CutsceneMM_CommandType::CS_CMD_CAMERA_SPLINE: - return new CutsceneMMCommand_Spline(rawData, currentPtr); - - case CutsceneMM_CommandType::CS_CMD_TRANSITION_GENERAL: - return new CutsceneMMCommand_TransitionGeneral(rawData, currentPtr); - - case CutsceneMM_CommandType::CS_CMD_FADE_OUT_SEQ: - return new CutsceneMMCommand_FadeOutSeq(rawData, currentPtr); - - case CutsceneMM_CommandType::CS_CMD_TIME: - return new CutsceneCommand_Time(rawData, currentPtr); - - case CutsceneMM_CommandType::CS_CMD_PLAYER_CUE: - return new CutsceneMMCommand_ActorCue(rawData, currentPtr); - - case CutsceneMM_CommandType::CS_CMD_RUMBLE: - return new CutsceneMMCommand_Rumble(rawData, currentPtr); - - default: - std::string errorHeader = - StringHelper::Sprintf("Warning: Invalid cutscene command ID: '0x%04X'", cmdID); - return new CutsceneMMCommand_GenericCmd(rawData, currentPtr, cmdID); - } - - return nullptr; -} - -Declaration* ZCutscene::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (auxName == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), auxName, 0, bodyStr); - decl->staticConf = staticConf; - return decl; -} - -std::string ZCutscene::GetSourceTypeName() const -{ - return "CutsceneData"; -} - -ZResourceType ZCutscene::GetResourceType() const -{ - return ZResourceType::Cutscene; -} - -std::string ZCutscene::GetCsEncodedFloat(float f, CsFloatType type, bool useSciNotation) -{ - uint32_t i; - std::memcpy(&i, &f, sizeof(i)); - - switch (type) - { - default: - // This default case will NEVER be reached, but GCC still gives a warning. - case CsFloatType::HexOnly: - return StringHelper::Sprintf("0x%08X", i); - case CsFloatType::FloatOnly: - return StringHelper::Sprintf(useSciNotation ? "%.8ef" : "%ff", f); - case CsFloatType::HexAndFloat: - return StringHelper::Sprintf(useSciNotation ? "CS_FLOAT(0x%08X, %.8ef)" : "CS_FLOAT(0x%08X, %ff)", i, f); - case CsFloatType::HexAndCommentedFloatLeft: - return StringHelper::Sprintf(useSciNotation ? "/* %.8ef */ 0x%08X" : "/* %ff */ 0x%08X", f, i); - case CsFloatType::HexAndCommentedFloatRight: - return StringHelper::Sprintf(useSciNotation ? "0x%08X /* %.8ef */" : "0x%08X /* %ff */", i, f); - } -} diff --git a/tools/ZAPD/ZAPD/ZCutscene.h b/tools/ZAPD/ZAPD/ZCutscene.h deleted file mode 100644 index 5dbf475c33..0000000000 --- a/tools/ZAPD/ZAPD/ZCutscene.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include -#include -#include -#include "tinyxml2.h" - -#include "OtherStructs/CutsceneOoT_Commands.h" -#include "OtherStructs/CutsceneMM_Commands.h" -#include "ZFile.h" -#include "ZResource.h" - -enum class CsFloatType; - -class ZCutscene : public ZResource -{ -public: - ZCutscene(ZFile* nParent); - ~ZCutscene(); - - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - - std::string GetBodySourceCode() const override; - - size_t GetRawDataSize() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - static std::string GetCsEncodedFloat(float f, CsFloatType type, bool useSciNotation); - - int32_t numCommands; - int32_t endFrame; - std::vector commands; - -protected: - CutsceneCommand* GetCommandOoT(uint32_t id, offset_t currentPtr) const; - CutsceneCommand* GetCommandMM(uint32_t id, offset_t currentPtr) const; -}; diff --git a/tools/ZAPD/ZAPD/ZDisplayList.cpp b/tools/ZAPD/ZAPD/ZDisplayList.cpp deleted file mode 100644 index 98c4d0e4a4..0000000000 --- a/tools/ZAPD/ZAPD/ZDisplayList.cpp +++ /dev/null @@ -1,2178 +0,0 @@ -#include "ZDisplayList.h" - -#include -#include -#include -#include -#include - -#include "Globals.h" -#include "OutputFormatter.h" -#include "Utils/BitConverter.h" -#include "Utils/File.h" -#include "Utils/Path.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "gfxd.h" - -REGISTER_ZFILENODE(DList, ZDisplayList); - -ZDisplayList::ZDisplayList(ZFile* nParent) : ZResource(nParent) -{ - lastTexWidth = 0; - lastTexHeight = 0; - lastTexAddr = 0; - lastTexFmt = F3DZEXTexFormats::G_IM_FMT_RGBA; - lastTexSiz = F3DZEXTexSizes::G_IM_SIZ_16b; - lastTexSizTest = F3DZEXTexSizes::G_IM_SIZ_16b; - lastTexLoaded = false; - lastTexIsPalette = false; - dListType = Globals::Instance->game == ZGame::OOT_SW97 ? DListType::F3DEX : DListType::F3DZEX; - RegisterOptionalAttribute("Ucode"); -} - -ZDisplayList::~ZDisplayList() -{ - for (auto o : otherDLists) - { - delete o; - } -} - -// EXTRACT MODE -void ZDisplayList::ExtractWithXML(tinyxml2::XMLElement* reader, uint32_t nRawDataIndex) -{ - rawDataIndex = nRawDataIndex; - ParseXML(reader); - // TODO add error handling here - bool ucodeSet = registeredAttributes.at("Ucode").wasSet; - std::string ucodeValue = registeredAttributes.at("Ucode").value; - if ((Globals::Instance->game == ZGame::OOT_SW97) || (ucodeValue == "f3dex")) - { - dListType = DListType::F3DEX; - } - else if (!ucodeSet || ucodeValue == "f3dex2") - { - dListType = DListType::F3DZEX; - } - else - { - HANDLE_ERROR_RESOURCE( - WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - StringHelper::Sprintf("Invalid ucode type in node: %s\n", reader->Name()), ""); - } - - // Don't parse raw data of external files - if (parent->GetMode() != ZFileMode::ExternalFile) - { - int32_t rawDataSize = - ZDisplayList::GetDListLength(parent->GetRawData(), rawDataIndex, dListType); - numInstructions = rawDataSize / 8; - ParseRawData(); - } - - Declaration* decl = DeclareVar("", ""); - decl->declaredInXml = true; -} - -void ZDisplayList::ExtractFromBinary(uint32_t nRawDataIndex, int32_t rawDataSize) -{ - rawDataIndex = nRawDataIndex; - name = GetDefaultName(parent->GetName()); - numInstructions = rawDataSize / 8; - - // Don't parse raw data of external files - if (parent->GetMode() == ZFileMode::ExternalFile) - return; - - ParseRawData(); -} - -void ZDisplayList::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - instructions.reserve(numInstructions); - uint32_t ptr = rawDataIndex; - - instructions.reserve(numInstructions); - for (size_t i = 0; i < numInstructions; i++) - { - instructions.push_back(BitConverter::ToUInt64BE(rawData, ptr)); - ptr += 8; - } -} - -Declaration* ZDisplayList::DeclareVar([[maybe_unused]] const std::string& prefix, - const std::string& bodyStr) -{ - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), name, numInstructions, bodyStr); - decl->isExternal = true; - decl->staticConf = staticConf; - return decl; -} - -std::string ZDisplayList::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sDL_%06X", prefix.c_str(), rawDataIndex); -} - -void ZDisplayList::ParseF3DZEX(F3DZEXOpcode opcode, uint64_t data, int32_t i, - const std::string& prefix, char* line) -{ - switch (opcode) - { - case F3DZEXOpcode::G_NOOP: - sprintf(line, "gsDPNoOpTag(0x%08" PRIX64 "),", data & 0xFFFFFFFF); - break; - case F3DZEXOpcode::G_DL: - Opcode_G_DL(data, prefix, line); - break; - case F3DZEXOpcode::G_MODIFYVTX: - Opcode_G_MODIFYVTX(data, line); - break; - case F3DZEXOpcode::G_CULLDL: - Opcode_G_CULLDL(data, line); - break; - case F3DZEXOpcode::G_TRI1: - Opcode_G_TRI1(data, line); - break; - case F3DZEXOpcode::G_TRI2: - Opcode_G_TRI2(data, line); - break; - case F3DZEXOpcode::G_QUAD: - { - int32_t aa = ((data & 0x00FF000000000000ULL) >> 48) / 2; - int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2; - int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2; - int32_t dd = ((data & 0x000000000000FFULL)) / 2; - sprintf(line, "gsSP1Quadrangle(%i, %i, %i, %i, 0),", aa, bb, cc, dd); - } - break; - case F3DZEXOpcode::G_VTX: - Opcode_G_VTX(data, line); - break; - case F3DZEXOpcode::G_SETTIMG: // HOTSPOT - Opcode_G_SETTIMG(data, prefix, line); - break; - case F3DZEXOpcode::G_GEOMETRYMODE: - { - int32_t cccccc = (data & 0x00FFFFFF00000000) >> 32; - int32_t ssssssss = (data & 0xFFFFFFFF); - std::string geoModeStr = "G_TEXTURE_ENABLE"; - - int32_t geoModeParam = ~cccccc; - - if (ssssssss != 0) - geoModeParam = ssssssss; - - if (geoModeParam & 0x00000001) - geoModeStr += " | G_ZBUFFER"; - - if (geoModeParam & 0x00000004) - geoModeStr += " | G_SHADE"; - - if (geoModeParam & 0x00000200) - geoModeStr += " | G_CULL_FRONT"; - - if (geoModeParam & 0x00000400) - geoModeStr += " | G_CULL_BACK"; - - if (geoModeParam & 0x00010000) - geoModeStr += " | G_FOG"; - - if (geoModeParam & 0x00020000) - geoModeStr += " | G_LIGHTING"; - - if (geoModeParam & 0x00040000) - geoModeStr += " | G_TEXTURE_GEN"; - - if (geoModeParam & 0x00080000) - geoModeStr += " | G_TEXTURE_GEN_LINEAR"; - - if (geoModeParam & 0x00200000) - geoModeStr += " | G_SHADING_SMOOTH"; - - if (geoModeParam & 0x00800000) - geoModeStr += " | G_CLIPPING"; - - if (ssssssss != 0) - { - if ((~cccccc & 0xFF000000) != 0) - sprintf(line, "gsSPSetGeometryMode(%s),", geoModeStr.c_str()); - else - sprintf(line, "gsSPLoadGeometryMode(%s),", geoModeStr.c_str()); - } - else - sprintf(line, "gsSPClearGeometryMode(%s),", geoModeStr.c_str()); - } - break; - case F3DZEXOpcode::G_SETPRIMCOLOR: - Opcode_G_SETPRIMCOLOR(data, line); - break; - case F3DZEXOpcode::G_SETOTHERMODE_L: - Opcode_G_SETOTHERMODE_L(data, line); - break; - case F3DZEXOpcode::G_SETOTHERMODE_H: - Opcode_G_SETOTHERMODE_H(data, line); - break; - case F3DZEXOpcode::G_SETTILE: - Opcode_G_SETTILE(data, line); - break; - case F3DZEXOpcode::G_SETTILESIZE: - Opcode_G_SETTILESIZE(data, prefix, line); - break; - case F3DZEXOpcode::G_LOADBLOCK: - Opcode_G_LOADBLOCK(data, line); - break; - case F3DZEXOpcode::G_TEXTURE: - Opcode_G_TEXTURE(data, line); - break; - case F3DZEXOpcode::G_RDPSETOTHERMODE: - { - int32_t hhhhhh = (data & 0x00FFFFFF00000000) >> 32; - int32_t llllllll = (data & 0x00000000FFFFFFFF); - - sprintf(line, "gsDPSetOtherMode(%i, %i),", hhhhhh, llllllll); - } - break; - case F3DZEXOpcode::G_POPMTX: - { - sprintf(line, "gsSPPopMatrix(%" PRIi64 "),", data); - } - break; - case F3DZEXOpcode::G_LOADTLUT: - Opcode_G_LOADTLUT(data, prefix, line); - break; - case F3DZEXOpcode::G_SETENVCOLOR: - { - uint8_t r = (uint8_t)((data & 0xFF000000) >> 24); - uint8_t g = (uint8_t)((data & 0x00FF0000) >> 16); - uint8_t b = (uint8_t)((data & 0xFF00FF00) >> 8); - uint8_t a = (uint8_t)((data & 0x000000FF) >> 0); - - sprintf(line, "gsDPSetEnvColor(%i, %i, %i, %i),", r, g, b, a); - } - break; - case F3DZEXOpcode::G_SETCOMBINE: - { - Opcode_G_SETCOMBINE(data, line); - } - break; - case F3DZEXOpcode::G_RDPLOADSYNC: - sprintf(line, "gsDPLoadSync(),"); - break; - case F3DZEXOpcode::G_RDPPIPESYNC: - sprintf(line, "gsDPPipeSync(),"); - break; - case F3DZEXOpcode::G_RDPTILESYNC: - sprintf(line, "gsDPTileSync(),"); - break; - case F3DZEXOpcode::G_RDPFULLSYNC: - sprintf(line, "gsDPFullSync(),"); - break; - case F3DZEXOpcode::G_ENDDL: - Opcode_G_ENDDL(prefix, line); - break; - case F3DZEXOpcode::G_RDPHALF_1: - { - uint64_t data2 = instructions[i + 1]; - uint32_t h = (data & 0xFFFFFFFF); - F3DZEXOpcode opcode2 = (F3DZEXOpcode)(instructions[i + 1] >> 56); - - if (opcode2 == F3DZEXOpcode::G_BRANCH_Z) - { - uint32_t a = (data2 & 0x00FFF00000000000) >> 44; - uint32_t b = (data2 & 0x00000FFF00000000) >> 32; - uint32_t z = (data2 & 0x00000000FFFFFFFF) >> 0; - - // sprintf(line, "gsDPWord(%i, 0),", h); - sprintf(line, "gsSPBranchLessZraw(%sDlist0x%06X, 0x%02X, 0x%02X),", prefix.c_str(), - h & 0x00FFFFFF, (a / 5) | (b / 2), z); - - ZDisplayList* nList = new ZDisplayList(parent); - nList->ExtractFromBinary( - h & 0x00FFFFFF, GetDListLength(parent->GetRawData(), h & 0x00FFFFFF, dListType)); - nList->SetName(nList->GetDefaultName(prefix)); - otherDLists.push_back(nList); - - i++; - } - } - break; - case F3DZEXOpcode::G_MTX: - Opcode_G_MTX(data, line); - break; - default: - sprintf(line, "// Opcode 0x%02X unimplemented!", (uint32_t)opcode); - break; - } -} - -void ZDisplayList::ParseF3DEX(F3DEXOpcode opcode, uint64_t data, const std::string& prefix, - char* line) -{ - switch (opcode) - { - case F3DEXOpcode::G_NOOP: - sprintf(line, "gsDPNoOpTag(0x%08" PRIX64 "),", data & 0xFFFFFFFF); - break; - case F3DEXOpcode::G_VTX: - Opcode_G_VTX(data, line); - break; - case F3DEXOpcode::G_DL: - Opcode_G_DL(data, prefix, line); - break; - case F3DEXOpcode::G_CULLDL: - Opcode_G_CULLDL(data, line); - break; - case F3DEXOpcode::G_MODIFYVTX: - Opcode_G_MODIFYVTX(data, line); - break; - case F3DEXOpcode::G_MTX: - Opcode_G_MTX(data, line); - break; - case F3DEXOpcode::G_TRI1: - Opcode_G_TRI1(data, line); - break; - case F3DEXOpcode::G_TRI2: - Opcode_G_TRI2(data, line); - break; - case F3DEXOpcode::G_ENDDL: - Opcode_G_ENDDL(prefix, line); - break; - case F3DEXOpcode::G_RDPLOADSYNC: - sprintf(line, "gsDPLoadSync(),"); - break; - case F3DEXOpcode::G_RDPPIPESYNC: - sprintf(line, "gsDPPipeSync(),"); - break; - case F3DEXOpcode::G_RDPTILESYNC: - sprintf(line, "gsDPTileSync(),"); - break; - case F3DEXOpcode::G_RDPFULLSYNC: - sprintf(line, "gsDPFullSync(),"); - break; - case F3DEXOpcode::G_TEXTURE: - Opcode_G_TEXTURE(data, line); - break; - case F3DEXOpcode::G_SETTIMG: - Opcode_G_SETTIMG(data, prefix, line); - break; - case F3DEXOpcode::G_SETTILE: - Opcode_G_SETTILE(data, line); - break; - case F3DEXOpcode::G_SETTILESIZE: - Opcode_G_SETTILESIZE(data, prefix, line); - break; - case F3DEXOpcode::G_LOADBLOCK: - Opcode_G_LOADBLOCK(data, line); - break; - case F3DEXOpcode::G_SETCOMBINE: - Opcode_G_SETCOMBINE(data, line); - break; - case F3DEXOpcode::G_SETPRIMCOLOR: - Opcode_G_SETPRIMCOLOR(data, line); - break; - case F3DEXOpcode::G_SETOTHERMODE_L: - Opcode_G_SETOTHERMODE_L(data, line); - break; - case F3DEXOpcode::G_SETOTHERMODE_H: - Opcode_G_SETOTHERMODE_H(data, line); - break; - case F3DEXOpcode::G_LOADTLUT: - Opcode_G_LOADTLUT(data, prefix, line); - break; - case F3DEXOpcode::G_CLEARGEOMETRYMODE: - case F3DEXOpcode::G_SETGEOMETRYMODE: - { - int32_t cccccc = (data & 0x00FFFFFF00000000) >> 32; - int32_t ssssssss = (data & 0xFFFFFFFF); - std::string geoModeStr = "G_TEXTURE_ENABLE"; - - int32_t geoModeParam = ~cccccc; - - if (ssssssss != 0) - geoModeParam = ssssssss; - - if (geoModeParam & 0x00000002) - geoModeStr += " | G_TEXTURE_ENABLE"; - - if (geoModeParam & 0x00000200) - geoModeStr += " | G_SHADING_SMOOTH"; - - if (geoModeParam & 0x00001000) - geoModeStr += " | G_CULL_FRONT"; - - if (geoModeParam & 0x00002000) - geoModeStr += " | G_CULL_BACK"; - - if (geoModeParam & 0x00000001) - geoModeStr += " | G_ZBUFFER"; - - if (geoModeParam & 0x00000004) - geoModeStr += " | G_SHADE"; - - if (geoModeParam & 0x00010000) - geoModeStr += " | G_FOG"; - - if (geoModeParam & 0x00020000) - geoModeStr += " | G_LIGHTING"; - - if (geoModeParam & 0x00040000) - geoModeStr += " | G_TEXTURE_GEN"; - - if (geoModeParam & 0x00080000) - geoModeStr += " | G_TEXTURE_GEN_LINEAR"; - - if (geoModeParam & 0x00800000) - geoModeStr += " | G_CLIPPING"; - - if (opcode == F3DEXOpcode::G_SETGEOMETRYMODE) - sprintf(line, "gsSPSetGeometryMode(%s),", geoModeStr.c_str()); - else - sprintf(line, "gsSPClearGeometryMode(%s),", geoModeStr.c_str()); - } - break; - default: - sprintf(line, "// Opcode 0x%02X unimplemented!", (uint32_t)opcode); - break; - } -} - -int32_t ZDisplayList::GetDListLength(const std::vector& rawData, uint32_t rawDataIndex, - DListType dListType) -{ - uint8_t endDLOpcode; - uint8_t branchListOpcode; - - if (dListType == DListType::F3DZEX) - { - endDLOpcode = static_cast(F3DZEXOpcode::G_ENDDL); - branchListOpcode = static_cast(F3DZEXOpcode::G_DL); - } - else - { - endDLOpcode = static_cast(F3DEXOpcode::G_ENDDL); - branchListOpcode = static_cast(F3DEXOpcode::G_DL); - } - - uint32_t ptr = rawDataIndex; - size_t rawDataSize = rawData.size(); - while (true) - { - if (ptr >= rawDataSize) - { - std::string errorHeader = - StringHelper::Sprintf("reached end of file when trying to find the end of the " - "DisplayList starting at offset 0x%X", - rawDataIndex); - std::string errorBody = StringHelper::Sprintf("Raw data size: 0x%zX.", rawDataSize); - HANDLE_ERROR_PROCESS(WarningType::Always, errorHeader, errorBody); - } - - uint8_t opcode = rawData.at(ptr); - bool dlNoPush = rawData.at(ptr + 1) == 1; - ptr += 8; - - if (opcode == endDLOpcode || (opcode == branchListOpcode && dlNoPush)) - { - return ptr - rawDataIndex; - } - } -} - -bool ZDisplayList::SequenceCheck(std::vector sequence, int32_t startIndex) -{ - bool success = true; - - for (size_t j = 0; j < sequence.size(); j++) - { - F3DZEXOpcode opcode = (F3DZEXOpcode)(instructions[startIndex + j] >> 56); - - if (sequence[j] != opcode) - { - success = false; - break; - } - } - - if (success) - return true; - - return false; -} - -int32_t ZDisplayList::OptimizationChecks(int32_t startIndex, std::string& output, - const std::string& prefix) -{ - int32_t result = -1; - - result = OptimizationCheck_LoadTextureBlock(startIndex, output, prefix); - - if (result != -1) - return result; - - return -1; -} - -int32_t ZDisplayList::OptimizationCheck_LoadTextureBlock(int32_t startIndex, std::string& output, - [[maybe_unused]] const std::string& prefix) -{ - std::vector sequence = {F3DZEXOpcode::G_SETTIMG, F3DZEXOpcode::G_SETTILE, - F3DZEXOpcode::G_RDPLOADSYNC, F3DZEXOpcode::G_LOADBLOCK, - F3DZEXOpcode::G_RDPPIPESYNC, F3DZEXOpcode::G_SETTILE, - F3DZEXOpcode::G_SETTILESIZE}; - - bool seqRes = SequenceCheck(sequence, startIndex); - - if (seqRes) - { - // gsDPLoadTextureBlock(texAddr, fmt, siz, width, height, pal, cms, cmt, masks, maskt, - // shifts, shiftt) gsDPLoadMultiBlock(texAddr, tmem, rtile, fmt, siz, width, height, pal, - // cms, cmt, masks, maskt, shifts, shiftt) gsDPLoadTextureBlock_4b(texAddr, fmt, width, - // height, pal, cms, cmt, masks, maskt, shifts, shiftt) gsDPLoadMultiBlock_4b(texAddr, tmem, - // rtile, fmt, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) - - uint32_t texAddr, tmem, rtile, fmt, siz, sizB, width, height, width2, height2, pal, cms, - cmt, masks, maskt, shifts, shiftt; - std::string texStr; - - // gsDPSetTextureImage - { - uint64_t data = instructions[startIndex + 0]; - - int32_t __ = (data & 0x00FF000000000000) >> 48; - // int32_t www = (data & 0x00000FFF00000000) >> 32; - - fmt = (__ & 0xE0) >> 5; - siz = (__ & 0x18) >> 3; - texAddr = Seg2Filespace(data, parent->baseAddress); - uint32_t segmentNumber = GETSEGNUM(data); - - lastTexSeg = segmentNumber; - - Globals::Instance->GetSegmentedPtrName(data & 0xFFFFFFFF, parent, "", texStr); - } - - // gsDPSetTile - { - uint64_t data = instructions[startIndex + 1]; - - tmem = - (data & 0b0000000000000000111111111111111100000000000000000000000000000000) >> 32; - - cmt = (data & 0b0000000000000000000000000000000000000000000011000000000000000000) >> 18; - maskt = - (data & 0b0000000000000000000000000000000000000000000000111100000000000000) >> 14; - shiftt = - (data & 0b0000000000000000000000000000000000000000000000000011110000000000) >> 10; - cms = (data & 0b0000000000000000000000000000000000000000000000000000001100000000) >> 8; - masks = - (data & 0b0000000000000000000000000000000000000000000000000000000011110000) >> 4; - shifts = (data & 0b0000000000000000000000000000000000000000000000000000000000001111); - - // sprintf(line, "gsDPSetTile(%s, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i),", - // fmtTbl[fff].c_str(), sizTbl[ii].c_str(), nnnnnnnnn, mmmmmmmmm, ttt, pppp, cc, aaaa, - // ssss, dd, bbbb, uuuu); - } - - // gsDPLoadSync - - // gsDPLoadBlock - - // gsDPPipeSync - - // gsDPSetTile - { - uint64_t data = instructions[startIndex + 5]; - int32_t __ = (data & 0x00FF000000000000) >> 48; - pal = (data & 0b0000000000000000000000000000000000000000111100000000000000000000) >> 20; - // siz = (__ & 0x18) >> 3; - rtile = - (data & 0b0000000000000000000000000000000011111111000000000000000000000000) >> 24; - sizB = (__ & 0x18) >> 3; - } - - // gsDPSetTileSize - { - uint64_t data = instructions[startIndex + 6]; - int32_t uuu = (data & 0x0000000000FFF000) >> 12; - int32_t vvv = (data & 0x0000000000000FFF); - - int32_t shiftAmtW = 2; - int32_t shiftAmtH = 2; - - if (sizB == (int32_t)F3DZEXTexSizes::G_IM_SIZ_8b && - fmt == (int32_t)F3DZEXTexFormats::G_IM_FMT_IA) - shiftAmtW = 3; - - if (sizB == (int32_t)F3DZEXTexSizes::G_IM_SIZ_4b) - shiftAmtW = 3; - - if (sizB == (int32_t)F3DZEXTexSizes::G_IM_SIZ_4b && - fmt == (int32_t)F3DZEXTexFormats::G_IM_FMT_IA) - shiftAmtH = 3; - - width = (uuu >> shiftAmtW) + 1; - height = (vvv >> shiftAmtH) + 1; - - width2 = (uuu >> 2) + 1; - height2 = (vvv >> 2) + 1; - } - - const char* fmtTbl[] = {"G_IM_FMT_RGBA", "G_IM_FMT_YUV", "G_IM_FMT_CI", "G_IM_FMT_IA", - "G_IM_FMT_I"}; - const char* sizTbl[] = {"G_IM_SIZ_4b", "G_IM_SIZ_8b", "G_IM_SIZ_16b", "G_IM_SIZ_32b"}; - - // output += StringHelper::Sprintf("gsDPLoadTextureBlock(%s, %s, %s, %i, %i, %i, %i, %i, %i, - // %i, %i, %i),", texStr.c_str(), fmtTbl[fmt], sizTbl[siz].c_str(), width, height, - // pal, cms, cmt, masks, maskt, shifts, shiftt); - - if (siz == 2 && sizB == 0) - { - if (tmem != 0) - output += StringHelper::Sprintf( - "gsDPLoadMultiBlock_4b(%s, %i, %i, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i),", - texStr.c_str(), tmem, rtile, fmtTbl[fmt], width2, height2, pal, cms, cmt, masks, - maskt, shifts, shiftt); - else - output += StringHelper::Sprintf( - "gsDPLoadTextureBlock_4b(%s, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i),", - texStr.c_str(), fmtTbl[fmt], width2, height2, pal, cms, cmt, masks, maskt, - shifts, shiftt); - } - else if (siz == 2 && sizB != 0) - { - if (tmem != 0) - output += StringHelper::Sprintf( - "gsDPLoadMultiBlock(%s, %i, %i, %s, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i),", - texStr.c_str(), tmem, rtile, fmtTbl[fmt], sizTbl[sizB], width2, height2, pal, - cms, cmt, masks, maskt, shifts, shiftt); - else - output += StringHelper::Sprintf( - "gsDPLoadTextureBlock(%s, %s, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i),", - texStr.c_str(), fmtTbl[fmt], sizTbl[sizB], width2, height2, pal, cms, cmt, - masks, maskt, shifts, shiftt); - } - else - { - if (siz != sizB) - { - lastTexAddr = texAddr; - lastTexFmt = (F3DZEXTexFormats)fmt; - lastTexWidth = width; - lastTexHeight = height; - lastTexSiz = (F3DZEXTexSizes)siz; - lastTexLoaded = true; - - TextureGenCheck(); - - return -1; - } - - output += StringHelper::Sprintf( - "gsDPLoadMultiBlock(%s, %i, %i, %s, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i),", - texStr.c_str(), tmem, rtile, fmtTbl[fmt], sizTbl[siz], width, height, pal, cms, cmt, - masks, maskt, shifts, shiftt); - } - - lastTexAddr = texAddr; - lastTexFmt = (F3DZEXTexFormats)fmt; - lastTexWidth = width; - lastTexHeight = height; - lastTexSiz = (F3DZEXTexSizes)siz; - lastTexLoaded = true; - - TextureGenCheck(); - - return (int32_t)sequence.size(); - } - - return -1; -} - -void ZDisplayList::Opcode_G_DL(uint64_t data, const std::string& prefix, char* line) -{ - int32_t pp = (data & 0x00FF000000000000) >> 56; - int32_t segNum = GETSEGNUM(data); - - Declaration* dListDecl = nullptr; - - if (parent != nullptr) - dListDecl = parent->GetDeclaration(GETSEGOFFSET(data)); - - if (pp != 0) - { - if (!Globals::Instance->HasSegment(segNum)) - sprintf(line, "gsSPBranchList(0x%08" PRIX64 "),", data & 0xFFFFFFFF); - else if (dListDecl != nullptr) - sprintf(line, "gsSPBranchList(%s),", dListDecl->declName.c_str()); - else - sprintf(line, "gsSPBranchList(%sDlist0x%06" PRIX64 "),", prefix.c_str(), - GETSEGOFFSET(data)); - } - else - { - if (!Globals::Instance->HasSegment(segNum)) - sprintf(line, "gsSPDisplayList(0x%08" PRIX64 "),", data & 0xFFFFFFFF); - else if (dListDecl != nullptr) - sprintf(line, "gsSPDisplayList(%s),", dListDecl->declName.c_str()); - else - sprintf(line, "gsSPDisplayList(%sDlist0x%06" PRIX64 "),", prefix.c_str(), - GETSEGOFFSET(data)); - } - - // if (segNum == 8 || segNum == 9 || segNum == 10 || segNum == 11 || segNum == 12 || segNum == - // 13) // Used for runtime-generated display lists - if (!Globals::Instance->HasSegment(segNum)) - { - if (pp != 0) - sprintf(line, "gsSPBranchList(0x%08" PRIX64 "),", data & 0xFFFFFFFF); - else - sprintf(line, "gsSPDisplayList(0x%08" PRIX64 "),", data & 0xFFFFFFFF); - } - else - { - ZDisplayList* nList = new ZDisplayList(parent); - nList->ExtractFromBinary(GETSEGOFFSET(data), GetDListLength(parent->GetRawData(), - GETSEGOFFSET(data), dListType)); - nList->SetName(nList->GetDefaultName(prefix)); - - otherDLists.push_back(nList); - } -} - -void ZDisplayList::Opcode_G_MODIFYVTX(uint64_t data, char* line) -{ - int32_t ww = (data & 0x00FF000000000000ULL) >> 48; - int32_t nnnn = (data & 0x0000FFFF00000000ULL) >> 32; - int32_t vvvvvvvv = (data & 0x00000000FFFFFFFFULL); - - sprintf(line, "gsSPModifyVertex(%i, %i, %i),", nnnn / 2, ww, vvvvvvvv); -} - -void ZDisplayList::Opcode_G_CULLDL(uint64_t data, char* line) -{ - int32_t vvvv = (data & 0xFFFF00000000) >> 32; - int32_t wwww = (data & 0x0000FFFF); - - sprintf(line, "gsSPCullDisplayList(%i, %i),", vvvv / 2, wwww / 2); -} - -void ZDisplayList::Opcode_G_TRI1(uint64_t data, char* line) -{ - if (dListType == DListType::F3DZEX) - { - int32_t aa = ((data & 0x00FF000000000000ULL) >> 48) / 2; - int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2; - int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2; - sprintf(line, "gsSP1Triangle(%i, %i, %i, 0),", aa, bb, cc); - } - else - { - int32_t aa = ((data & 0x0000000000FF0000ULL) >> 16) / 2; - int32_t bb = ((data & 0x000000000000FF00ULL) >> 8) / 2; - int32_t cc = ((data & 0x00000000000000FFULL) >> 0) / 2; - sprintf(line, "gsSP1Triangle(%i, %i, %i, 0),", aa, bb, cc); - } -} - -void ZDisplayList::Opcode_G_TRI2(uint64_t data, char* line) -{ - int32_t aa = ((data & 0x00FF000000000000ULL) >> 48) / 2; - int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2; - int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2; - int32_t dd = ((data & 0x00000000FF0000ULL) >> 16) / 2; - int32_t ee = ((data & 0x0000000000FF00ULL) >> 8) / 2; - int32_t ff = ((data & 0x000000000000FFULL) >> 0) / 2; - sprintf(line, "gsSP2Triangles(%i, %i, %i, 0, %i, %i, %i, 0),", aa, bb, cc, dd, ee, ff); -} - -void ZDisplayList::Opcode_G_MTX(uint64_t data, char* line) -{ - uint32_t pp = 0; - uint32_t mm = (data & 0x00000000FFFFFFFF); - bool push = false; - bool load = false; - bool projection = false; - - if (dListType == DListType::F3DEX) - pp = (data & 0x00FF000000000000) >> 48; - else - pp = (data & 0x000000FF00000000) >> 32; - - std::string matrixRef; - - if (Globals::Instance->cfg.symbolMap.find(mm) != Globals::Instance->cfg.symbolMap.end()) - matrixRef = StringHelper::Sprintf("&%s", Globals::Instance->cfg.symbolMap[mm].c_str()); - else - matrixRef = StringHelper::Sprintf("0x%08X", mm); - - pp ^= 0x01; - - if (pp & 0x01) - push = true; - - if (pp & 0x02) - load = true; - - if (pp & 0x04) - projection = true; - - sprintf(line, "gsSPMatrix(%s, %s | %s | %s),", matrixRef.c_str(), - projection ? "G_MTX_PROJECTION" : "G_MTX_MODELVIEW", - push ? "G_MTX_PUSH" : "G_MTX_NOPUSH", load ? "G_MTX_LOAD" : "G_MTX_MUL"); -} - -void ZDisplayList::Opcode_G_VTX(uint64_t data, char* line) -{ - int32_t nn = (data & 0x000FF00000000000ULL) >> 44; - int32_t aa = (data & 0x000000FF00000000ULL) >> 32; - - uint32_t vtxAddr = Seg2Filespace(data, parent->baseAddress); - - if (dListType == DListType::F3DZEX) - sprintf(line, "gsSPVertex(@r, %i, %i),", nn, ((aa >> 1) - nn)); - else - { - uint32_t hi = data >> 32; - -#define _SHIFTR(v, s, w) (((uint32_t)v >> s) & ((0x01 << w) - 1)) - - nn = _SHIFTR(hi, 10, 6); - - sprintf(line, "gsSPVertex(@r, %i, %i),", nn, _SHIFTR(hi, 17, 7)); - } - - // Hack: Don't extract vertices from a unknown segment. - if (!Globals::Instance->HasSegment(GETSEGNUM(data))) - { - segptr_t segmented = data & 0xFFFFFFFF; - references.push_back(segmented); - parent->AddDeclaration(segmented, DeclarationAlignment::Align8, 16, "Vtx", - StringHelper::Sprintf("0x%08X", segmented), ""); - return; - } - references.push_back(data); - - { - uint32_t currentPtr = Seg2Filespace(data, parent->baseAddress); - Declaration* decl; - - // Check for vertex intersections from other display lists - // TODO: These two could probably be condenced to one... - decl = parent->GetDeclarationRanged(vtxAddr + (nn * 16)); - if (decl != nullptr) - { - int32_t diff = decl->address - vtxAddr; - if (diff > 0) - nn = diff / 16; - else - nn = 0; - } - - decl = parent->GetDeclarationRanged(vtxAddr); - if (decl != nullptr) - { - int32_t diff = decl->address - vtxAddr; - if (diff > 0) - nn = diff / 16; - else - nn = 0; - } - - if (nn > 0) - { - std::vector vtxList; - vtxList.reserve(nn); - - for (int32_t i = 0; i < nn; i++) - { - ZVtx vtx(parent); - vtx.ExtractFromFile(currentPtr); - vtxList.push_back(vtx); - - currentPtr += 16; - } - - vertices[vtxAddr] = vtxList; - } - } -} - -void ZDisplayList::Opcode_G_TEXTURE(uint64_t data, char* line) -{ - int32_t ____ = (data & 0x0000FFFF00000000) >> 32; - int32_t ssss = (data & 0x00000000FFFF0000) >> 16; - int32_t tttt = (data & 0x000000000000FFFF); - int32_t lll = (____ & 0x3800) >> 11; - int32_t ddd = (____ & 0x700) >> 8; - int32_t nnnnnnn = 0; - - if (dListType == DListType::F3DEX) - nnnnnnn = (____ & 0xFF); - else - nnnnnnn = (____ & 0xFE) >> 1; - - sprintf(line, "gsSPTexture(%i, %i, %i, %i, %s),", ssss, tttt, lll, ddd, - nnnnnnn == 1 ? "G_ON" : "G_OFF"); -} - -void ZDisplayList::Opcode_G_SETTIMG(uint64_t data, const std::string& prefix, char* line) -{ - int32_t __ = (data & 0x00FF000000000000) >> 48; - int32_t www = (data & 0x00000FFF00000000) >> 32; - const char* fmtTbl[] = {"G_IM_FMT_RGBA", "G_IM_FMT_YUV", "G_IM_FMT_CI", "G_IM_FMT_IA", - "G_IM_FMT_I"}; - const char* sizTbl[] = {"G_IM_SIZ_4b", "G_IM_SIZ_8b", "G_IM_SIZ_16b", "G_IM_SIZ_32b"}; - - uint32_t fmt = (__ & 0xE0) >> 5; - uint32_t siz = (__ & 0x18) >> 3; - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - printf("TextureGenCheck G_SETTIMG\n"); - - TextureGenCheck(); // HOTSPOT - - lastTexFmt = (F3DZEXTexFormats)fmt; - lastTexSiz = (F3DZEXTexSizes)siz; - lastTexSeg = data; - lastTexAddr = Seg2Filespace(data, parent->baseAddress); - - int32_t segmentNumber = GETSEGNUM(data); - - if (segmentNumber != 2) - { - char texStr[2048]; - int32_t texAddress = Seg2Filespace(data, parent->baseAddress); - Declaration* texDecl = nullptr; - - if (parent != nullptr) - { - if (Globals::Instance->HasSegment(segmentNumber)) - texDecl = parent->GetDeclaration(texAddress); - else - texDecl = parent->GetDeclaration(data); - } - - if (texDecl != nullptr) - sprintf(texStr, "%s", texDecl->declName.c_str()); - else if (data != 0 && Globals::Instance->HasSegment(segmentNumber)) - sprintf(texStr, "%sTex_%06X", prefix.c_str(), texAddress); - else - { - sprintf(texStr, "0x%08" PRIX64, data & 0xFFFFFFFF); - } - - sprintf(line, "gsDPSetTextureImage(%s, %s, %i, %s),", fmtTbl[fmt], sizTbl[siz], www + 1, - texStr); - } - else - { - std::string texName; - Globals::Instance->GetSegmentedPtrName(data, parent, "", texName); - sprintf(line, "gsDPSetTextureImage(%s, %s, %i, %s),", fmtTbl[fmt], sizTbl[siz], www + 1, - texName.c_str()); - } -} - -void ZDisplayList::Opcode_G_SETTILE(uint64_t data, char* line) -{ - int32_t fff = (data & 0b0000000011100000000000000000000000000000000000000000000000000000) >> 53; - int32_t ii = (data & 0b0000000000011000000000000000000000000000000000000000000000000000) >> 51; - int32_t nnnnnnnnn = - (data & 0b0000000000000011111111100000000000000000000000000000000000000000) >> 41; - int32_t mmmmmmmmm = - (data & 0b0000000000000000000000011111111100000000000000000000000000000000) >> 32; - int32_t ttt = (data & 0b0000000000000000000000000000000000000111000000000000000000000000) >> 24; - int32_t pppp = - (data & 0b0000000000000000000000000000000000000000111100000000000000000000) >> 20; - int32_t cc = (data & 0b0000000000000000000000000000000000000000000011000000000000000000) >> 18; - int32_t aaaa = - (data & 0b0000000000000000000000000000000000000000000000111100000000000000) >> 14; - int32_t ssss = - (data & 0b0000000000000000000000000000000000000000000000000011110000000000) >> 10; - int32_t dd = (data & 0b0000000000000000000000000000000000000000000000000000001100000000) >> 8; - int32_t bbbb = (data & 0b0000000000000000000000000000000000000000000000000000000011110000) >> 4; - int32_t uuuu = (data & 0b0000000000000000000000000000000000000000000000000000000000001111); - - const char* fmtTbl[] = {"G_IM_FMT_RGBA", "G_IM_FMT_YUV", "G_IM_FMT_CI", "G_IM_FMT_IA", - "G_IM_FMT_I"}; - const char* sizTbl[] = {"G_IM_SIZ_4b", "G_IM_SIZ_8b", "G_IM_SIZ_16b", "G_IM_SIZ_32b"}; - - if (fff == (int32_t)F3DZEXTexFormats::G_IM_FMT_CI) - lastCISiz = (F3DZEXTexSizes)ii; - - lastTexSizTest = (F3DZEXTexSizes)ii; - - sprintf(line, "gsDPSetTile(%s, %s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i),", fmtTbl[fff], - sizTbl[ii], nnnnnnnnn, mmmmmmmmm, ttt, pppp, cc, aaaa, ssss, dd, bbbb, uuuu); -} - -void ZDisplayList::Opcode_G_SETTILESIZE(uint64_t data, [[maybe_unused]] const std::string& prefix, - char* line) -{ - int32_t sss = (data & 0x00FFF00000000000) >> 44; - int32_t ttt = (data & 0x00000FFF00000000) >> 32; - int32_t uuu = (data & 0x0000000000FFF000) >> 12; - int32_t vvv = (data & 0x0000000000000FFF); - int32_t i = (data & 0x000000000F000000) >> 24; - - int32_t shiftAmtW = 2; - int32_t shiftAmtH = 2; - - if (lastTexSizTest == F3DZEXTexSizes::G_IM_SIZ_8b && - lastTexFmt == F3DZEXTexFormats::G_IM_FMT_IA) - shiftAmtW = 3; - - // if (lastTexFmt == F3DZEXTexFormats::G_IM_FMT_I || lastTexFmt == - // F3DZEXTexFormats::G_IM_FMT_CI) - if (lastTexSizTest == F3DZEXTexSizes::G_IM_SIZ_4b) - shiftAmtW = 3; - - if (lastTexSizTest == F3DZEXTexSizes::G_IM_SIZ_4b && - lastTexFmt == F3DZEXTexFormats::G_IM_FMT_IA) - shiftAmtH = 3; - - lastTexWidth = (uuu >> shiftAmtW) + 1; - lastTexHeight = (vvv >> shiftAmtH) + 1; - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - printf("lastTexWidth: %i lastTexHeight: %i, lastTexSizTest: 0x%x, lastTexFmt: 0x%x\n", - lastTexWidth, lastTexHeight, (uint32_t)lastTexSizTest, (uint32_t)lastTexFmt); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - printf("TextureGenCheck G_SETTILESIZE\n"); - - TextureGenCheck(); - - sprintf(line, "gsDPSetTileSize(%i, %i, %i, %i, %i),", i, sss, ttt, uuu, vvv); -} - -void ZDisplayList::Opcode_G_LOADBLOCK(uint64_t data, char* line) -{ - int32_t sss = (data & 0x00FFF00000000000) >> 48; - int32_t ttt = (data & 0x00000FFF00000000) >> 36; - int32_t i = (data & 0x000000000F000000) >> 24; - int32_t xxx = (data & 0x0000000000FFF000) >> 12; - int32_t ddd = (data & 0x0000000000000FFF); - - lastTexLoaded = true; - - sprintf(line, "gsDPLoadBlock(%i, %i, %i, %i, %i),", i, sss, ttt, xxx, ddd); -} - -void ZDisplayList::Opcode_G_SETCOMBINE(uint64_t data, char* line) -{ - int32_t a0 = (data & 0b000000011110000000000000000000000000000000000000000000000000000) >> 52; - int32_t c0 = (data & 0b000000000001111100000000000000000000000000000000000000000000000) >> 47; - int32_t aa0 = (data & 0b00000000000000011100000000000000000000000000000000000000000000) >> 44; - int32_t ac0 = (data & 0b00000000000000000011100000000000000000000000000000000000000000) >> 41; - int32_t a1 = (data & 0b000000000000000000000011110000000000000000000000000000000000000) >> 37; - int32_t c1 = (data & 0b000000000000000000000000001111100000000000000000000000000000000) >> 32; - int32_t b0 = (data & 0b000000000000000000000000000000011110000000000000000000000000000) >> 28; - int32_t b1 = (data & 0b000000000000000000000000000000000001111000000000000000000000000) >> 24; - int32_t aa1 = (data & 0b00000000000000000000000000000000000000111000000000000000000000) >> 21; - int32_t ac1 = (data & 0b00000000000000000000000000000000000000000111000000000000000000) >> 18; - int32_t d0 = (data & 0b000000000000000000000000000000000000000000000111000000000000000) >> 15; - int32_t ab0 = (data & 0b00000000000000000000000000000000000000000000000111000000000000) >> 12; - int32_t ad0 = (data & 0b00000000000000000000000000000000000000000000000000111000000000) >> 9; - int32_t d1 = (data & 0b000000000000000000000000000000000000000000000000000000111000000) >> 6; - int32_t ab1 = (data & 0b00000000000000000000000000000000000000000000000000000000111000) >> 3; - int32_t ad1 = (data & 0b00000000000000000000000000000000000000000000000000000000000111) >> 0; - - const char* modesA[] = {"COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE", "SHADE", "ENVIRONMENT", - "1", "NOISE", "0", "9", "10", "11", - "12", "13", "14", "0"}; - const char* modesB[] = {"COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE", "SHADE", "ENVIRONMENT", - "CENTER", "K4", "8", "9", "10", "11", - "12", "13", "14", "0"}; - const char* modesC[] = {"COMBINED", - "TEXEL0", - "TEXEL1", - "PRIMITIVE", - "SHADE", - "ENVIRONMENT", - "1", - "COMBINED_ALPHA", - "TEXEL0_ALPHA", - "TEXEL1_ALPHA", - "PRIMITIVE_ALPHA", - "SHADE_ALPHA", - "ENV_ALPHA", - "LOD_FRACTION", - "PRIM_LOD_FRAC", - "K5", - "16", - "17", - "18", - "19", - "20", - "21", - "22", - "23", - "24", - "25", - "26", - "27", - "28", - "29", - "30", - "0"}; - const char* modesD[] = {"COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE", - "SHADE", "ENVIRONMENT", "1", "0"}; - - const char* modes2[] = {"COMBINED", "TEXEL0", "TEXEL1", "PRIMITIVE", - "SHADE", "ENVIRONMENT", "1", "0"}; - const char* modes2C[] = {"LOD_FRACTION", "TEXEL0", "TEXEL1", "PRIMITIVE", - "SHADE", "ENVIRONMENT", "PRIM_LOD_FRAC", "0"}; - - sprintf(line, - "gsDPSetCombineLERP(%s, %s, %s, %s, %s, %s, %s, %s,\n %s, %s, " - "%s, %s, %s, %s, %s, %s),", - modesA[a0], modesB[b0], modesC[c0], modesD[d0], modes2[aa0], modes2[ab0], modes2C[ac0], - modes2[ad0], modesA[a1], modesB[b1], modesC[c1], modesD[d1], modes2[aa1], modes2[ab1], - modes2C[ac1], modes2[ad1]); -} - -void ZDisplayList::Opcode_G_SETPRIMCOLOR(uint64_t data, char* line) -{ - int32_t mm = (data & 0x0000FF0000000000) >> 40; - int32_t ff = (data & 0x000000FF00000000) >> 32; - int32_t rr = (data & 0x00000000FF000000) >> 24; - int32_t gg = (data & 0x0000000000FF0000) >> 16; - int32_t bb = (data & 0x000000000000FF00) >> 8; - int32_t aa = (data & 0x00000000000000FF) >> 0; - sprintf(line, "gsDPSetPrimColor(%i, %i, %i, %i, %i, %i),", mm, ff, rr, gg, bb, aa); -} - -void ZDisplayList::Opcode_F3DEX_G_SETOTHERMODE_L(uint64_t data, char* line) -{ - int32_t sft = (data & 0x0000FF0000000000) >> 40; - int32_t len = (data & 0x000000FF00000000) >> 32; - int32_t dat = (data & 0xFFFFFFFF); - - // TODO: Output the correct render modes in data - - sprintf(line, "gsSPSetOtherMode(0xE2, %i, %i, 0x%08X),", sft, len, dat); -} - -void ZDisplayList::Opcode_G_SETOTHERMODE_L(uint64_t data, char* line) -{ - int32_t dd = (data & 0xFFFFFFFF); - int32_t sft = 0; - int32_t len = 0; - - if (dListType == DListType::F3DEX) - { - sft = (data & 0x0000FF0000000000) >> 40; - len = (data & 0x000000FF00000000) >> 32; - } - else - { - int32_t ss = (data & 0x0000FF0000000000) >> 40; - len = ((data & 0x000000FF00000000) >> 32) + 1; - sft = 32 - (len)-ss; - } - - if (sft == G_MDSFT_RENDERMODE) - { - uint32_t mode1 = (dd & 0xCCCC0000) >> 0; - uint32_t mode2 = (dd & 0x3333FFFF); - - // TODO: Jesus Christ This is Messy - - uint32_t tblA[] = {G_RM_FOG_SHADE_A, - G_RM_FOG_PRIM_A, - G_RM_PASS, - G_RM_AA_ZB_OPA_SURF, - G_RM_AA_ZB_XLU_SURF, - G_RM_AA_ZB_OPA_DECAL, - G_RM_AA_ZB_XLU_DECAL, - G_RM_AA_ZB_OPA_INTER, - G_RM_AA_ZB_XLU_INTER, - G_RM_AA_ZB_XLU_LINE, - G_RM_AA_ZB_DEC_LINE, - G_RM_AA_ZB_TEX_EDGE, - G_RM_AA_ZB_TEX_INTER, - G_RM_AA_ZB_SUB_SURF, - G_RM_AA_ZB_PCL_SURF, - G_RM_AA_ZB_OPA_TERR, - G_RM_AA_ZB_TEX_TERR, - G_RM_AA_ZB_SUB_TERR, - G_RM_RA_ZB_OPA_SURF, - G_RM_RA_ZB_OPA_DECAL, - G_RM_RA_ZB_OPA_INTER, - G_RM_AA_OPA_SURF, - G_RM_AA_XLU_SURF, - G_RM_AA_XLU_LINE, - G_RM_AA_DEC_LINE, - G_RM_AA_TEX_EDGE, - G_RM_AA_SUB_SURF, - G_RM_AA_PCL_SURF, - G_RM_AA_OPA_TERR, - G_RM_AA_TEX_TERR, - G_RM_AA_SUB_TERR, - G_RM_RA_OPA_SURF, - G_RM_ZB_OPA_SURF, - G_RM_ZB_XLU_SURF, - G_RM_ZB_OPA_DECAL, - G_RM_ZB_XLU_DECAL, - G_RM_ZB_CLD_SURF, - G_RM_ZB_OVL_SURF, - G_RM_ZB_PCL_SURF, - G_RM_OPA_SURF, - G_RM_XLU_SURF, - G_RM_CLD_SURF, - G_RM_TEX_EDGE, - G_RM_PCL_SURF, - G_RM_ADD, - G_RM_NOOP, - G_RM_VISCVG, - G_RM_OPA_CI}; - - uint32_t tblB[] = {G_RM_AA_ZB_OPA_SURF2, - G_RM_AA_ZB_XLU_SURF2, - G_RM_AA_ZB_OPA_DECAL2, - G_RM_AA_ZB_XLU_DECAL2, - G_RM_AA_ZB_OPA_INTER2, - G_RM_AA_ZB_XLU_INTER2, - G_RM_AA_ZB_XLU_LINE2, - G_RM_AA_ZB_DEC_LINE2, - G_RM_AA_ZB_TEX_EDGE2, - G_RM_AA_ZB_TEX_INTER2, - G_RM_AA_ZB_SUB_SURF2, - G_RM_AA_ZB_PCL_SURF2, - G_RM_AA_ZB_OPA_TERR2, - G_RM_AA_ZB_TEX_TERR2, - G_RM_AA_ZB_SUB_TERR2, - G_RM_RA_ZB_OPA_SURF2, - G_RM_RA_ZB_OPA_DECAL2, - G_RM_RA_ZB_OPA_INTER2, - G_RM_AA_OPA_SURF2, - G_RM_AA_XLU_SURF2, - G_RM_AA_XLU_LINE2, - G_RM_AA_DEC_LINE2, - G_RM_AA_TEX_EDGE2, - G_RM_AA_SUB_SURF2, - G_RM_AA_PCL_SURF2, - G_RM_AA_OPA_TERR2, - G_RM_AA_TEX_TERR2, - G_RM_AA_SUB_TERR2, - G_RM_RA_OPA_SURF2, - G_RM_ZB_OPA_SURF2, - G_RM_ZB_XLU_SURF2, - G_RM_ZB_OPA_DECAL2, - G_RM_ZB_XLU_DECAL2, - G_RM_ZB_CLD_SURF2, - G_RM_ZB_OVL_SURF2, - G_RM_ZB_PCL_SURF2, - G_RM_OPA_SURF2, - G_RM_XLU_SURF2, - G_RM_CLD_SURF2, - G_RM_TEX_EDGE2, - G_RM_PCL_SURF2, - G_RM_ADD2, - G_RM_NOOP2, - G_RM_VISCVG2, - G_RM_OPA_CI2}; - - std::map str = { - {G_RM_FOG_SHADE_A, "G_RM_FOG_SHADE_A"}, - {G_RM_FOG_PRIM_A, "G_RM_FOG_PRIM_A"}, - {G_RM_PASS, "G_RM_PASS"}, - {G_RM_AA_ZB_OPA_SURF, "G_RM_AA_ZB_OPA_SURF"}, - {G_RM_AA_ZB_OPA_SURF2, "G_RM_AA_ZB_OPA_SURF2"}, - {G_RM_AA_ZB_XLU_SURF, "G_RM_AA_ZB_XLU_SURF"}, - {G_RM_AA_ZB_XLU_SURF2, "G_RM_AA_ZB_XLU_SURF2"}, - {G_RM_AA_ZB_OPA_DECAL, "G_RM_AA_ZB_OPA_DECAL"}, - {G_RM_AA_ZB_OPA_DECAL2, "G_RM_AA_ZB_OPA_DECAL2"}, - {G_RM_AA_ZB_XLU_DECAL, "G_RM_AA_ZB_XLU_DECAL"}, - {G_RM_AA_ZB_XLU_DECAL2, "G_RM_AA_ZB_XLU_DECAL2"}, - {G_RM_AA_ZB_OPA_INTER, "G_RM_AA_ZB_OPA_INTER"}, - {G_RM_AA_ZB_OPA_INTER2, "G_RM_AA_ZB_OPA_INTER2"}, - {G_RM_AA_ZB_XLU_INTER, "G_RM_AA_ZB_XLU_INTER"}, - {G_RM_AA_ZB_XLU_INTER2, "G_RM_AA_ZB_XLU_INTER2"}, - {G_RM_AA_ZB_XLU_LINE, "G_RM_AA_ZB_XLU_LINE"}, - {G_RM_AA_ZB_XLU_LINE2, "G_RM_AA_ZB_XLU_LINE2"}, - {G_RM_AA_ZB_DEC_LINE, "G_RM_AA_ZB_DEC_LINE"}, - {G_RM_AA_ZB_DEC_LINE2, "G_RM_AA_ZB_DEC_LINE2"}, - {G_RM_AA_ZB_TEX_EDGE, "G_RM_AA_ZB_TEX_EDGE"}, - {G_RM_AA_ZB_TEX_EDGE2, "G_RM_AA_ZB_TEX_EDGE2"}, - {G_RM_AA_ZB_TEX_INTER, "G_RM_AA_ZB_TEX_INTER"}, - {G_RM_AA_ZB_TEX_INTER2, "G_RM_AA_ZB_TEX_INTER2"}, - {G_RM_AA_ZB_SUB_SURF, "G_RM_AA_ZB_SUB_SURF"}, - {G_RM_AA_ZB_SUB_SURF2, "G_RM_AA_ZB_SUB_SURF2"}, - {G_RM_AA_ZB_PCL_SURF, "G_RM_AA_ZB_PCL_SURF"}, - {G_RM_AA_ZB_PCL_SURF2, "G_RM_AA_ZB_PCL_SURF2"}, - {G_RM_AA_ZB_OPA_TERR, "G_RM_AA_ZB_OPA_TERR"}, - {G_RM_AA_ZB_OPA_TERR2, "G_RM_AA_ZB_OPA_TERR2"}, - {G_RM_AA_ZB_TEX_TERR, "G_RM_AA_ZB_TEX_TERR"}, - {G_RM_AA_ZB_TEX_TERR2, "G_RM_AA_ZB_TEX_TERR2"}, - {G_RM_AA_ZB_SUB_TERR, "G_RM_AA_ZB_SUB_TERR"}, - {G_RM_AA_ZB_SUB_TERR2, "G_RM_AA_ZB_SUB_TERR2"}, - {G_RM_RA_ZB_OPA_SURF, "G_RM_RA_ZB_OPA_SURF"}, - {G_RM_RA_ZB_OPA_SURF2, "G_RM_RA_ZB_OPA_SURF2"}, - {G_RM_RA_ZB_OPA_DECAL, "G_RM_RA_ZB_OPA_DECAL"}, - {G_RM_RA_ZB_OPA_DECAL2, "G_RM_RA_ZB_OPA_DECAL2"}, - {G_RM_RA_ZB_OPA_INTER, "G_RM_RA_ZB_OPA_INTER"}, - {G_RM_RA_ZB_OPA_INTER2, "G_RM_RA_ZB_OPA_INTER2"}, - {G_RM_AA_OPA_SURF, "G_RM_AA_OPA_SURF"}, - {G_RM_AA_OPA_SURF2, "G_RM_AA_OPA_SURF2"}, - {G_RM_AA_XLU_SURF, "G_RM_AA_XLU_SURF"}, - {G_RM_AA_XLU_SURF2, "G_RM_AA_XLU_SURF2"}, - {G_RM_AA_XLU_LINE, "G_RM_AA_XLU_LINE"}, - {G_RM_AA_XLU_LINE2, "G_RM_AA_XLU_LINE2"}, - {G_RM_AA_DEC_LINE, "G_RM_AA_DEC_LINE"}, - {G_RM_AA_DEC_LINE2, "G_RM_AA_DEC_LINE2"}, - {G_RM_AA_TEX_EDGE, "G_RM_AA_TEX_EDGE"}, - {G_RM_AA_TEX_EDGE2, "G_RM_AA_TEX_EDGE2"}, - {G_RM_AA_SUB_SURF, "G_RM_AA_SUB_SURF"}, - {G_RM_AA_SUB_SURF2, "G_RM_AA_SUB_SURF2"}, - {G_RM_AA_PCL_SURF, "G_RM_AA_PCL_SURF"}, - {G_RM_AA_PCL_SURF2, "G_RM_AA_PCL_SURF2"}, - {G_RM_AA_OPA_TERR, "G_RM_AA_OPA_TERR"}, - {G_RM_AA_OPA_TERR2, "G_RM_AA_OPA_TERR2"}, - {G_RM_AA_TEX_TERR, "G_RM_AA_TEX_TERR"}, - {G_RM_AA_TEX_TERR2, "G_RM_AA_TEX_TERR2"}, - {G_RM_AA_TEX_TERR, "G_RM_AA_TEX_TERR"}, - {G_RM_AA_TEX_TERR2, "G_RM_AA_TEX_TERR2"}, - {G_RM_AA_SUB_TERR, "G_RM_AA_SUB_TERR"}, - {G_RM_AA_SUB_TERR2, "G_RM_AA_SUB_TERR2"}, - {G_RM_RA_OPA_SURF, "G_RM_RA_OPA_SURF"}, - {G_RM_RA_OPA_SURF2, "G_RM_RA_OPA_SURF2"}, - {G_RM_ZB_OPA_SURF, "G_RM_ZB_OPA_SURF"}, - {G_RM_ZB_OPA_SURF2, "G_RM_ZB_OPA_SURF2"}, - {G_RM_ZB_XLU_SURF, "G_RM_ZB_XLU_SURF"}, - {G_RM_ZB_XLU_SURF2, "G_RM_ZB_XLU_SURF2"}, - {G_RM_ZB_OPA_DECAL, "G_RM_ZB_OPA_DECAL"}, - {G_RM_ZB_OPA_DECAL2, "G_RM_ZB_OPA_DECAL2"}, - {G_RM_ZB_XLU_DECAL, "G_RM_ZB_XLU_DECAL"}, - {G_RM_ZB_XLU_DECAL2, "G_RM_ZB_XLU_DECAL2"}, - {G_RM_ZB_CLD_SURF, "G_RM_ZB_CLD_SURF"}, - {G_RM_ZB_CLD_SURF2, "G_RM_ZB_CLD_SURF2"}, - {G_RM_ZB_OVL_SURF, "G_RM_ZB_OVL_SURF"}, - {G_RM_ZB_OVL_SURF2, "G_RM_ZB_OVL_SURF2"}, - {G_RM_ZB_PCL_SURF, "G_RM_ZB_PCL_SURF"}, - {G_RM_ZB_PCL_SURF2, "G_RM_ZB_PCL_SURF2"}, - {G_RM_OPA_SURF, "G_RM_OPA_SURF"}, - {G_RM_OPA_SURF2, "G_RM_OPA_SURF2"}, - {G_RM_XLU_SURF, "G_RM_XLU_SURF"}, - {G_RM_XLU_SURF2, "G_RM_XLU_SURF2"}, - {G_RM_CLD_SURF, "G_RM_CLD_SURF"}, - {G_RM_CLD_SURF2, "G_RM_CLD_SURF2"}, - {G_RM_TEX_EDGE, "G_RM_TEX_EDGE"}, - {G_RM_TEX_EDGE2, "G_RM_TEX_EDGE2"}, - {G_RM_PCL_SURF, "G_RM_PCL_SURF"}, - {G_RM_PCL_SURF2, "G_RM_PCL_SURF2"}, - {G_RM_ADD, "G_RM_ADD"}, - {G_RM_ADD2, "G_RM_ADD2"}, - {G_RM_NOOP, "G_RM_NOOP"}, - {G_RM_NOOP2, "G_RM_NOOP2"}, - {G_RM_VISCVG, "G_RM_VISCVG"}, - {G_RM_VISCVG2, "G_RM_VISCVG2"}, - {G_RM_OPA_CI, "G_RM_OPA_CI"}, - {G_RM_OPA_CI2, "G_RM_OPA_CI2"}, - }; - - for (uint32_t k = 0; k < sizeof(tblA) / 4; k++) - { - if ((dd & tblA[k]) == tblA[k]) - { - if (tblA[k] > mode1) - mode1 = tblA[k]; - } - } - - for (uint32_t k = 0; k < sizeof(tblB) / 4; k++) - { - if ((dd & tblB[k]) == tblB[k]) - { - if (tblB[k] > mode2) - mode2 = tblB[k]; - } - } - - std::string mode1Str = str[mode1]; - std::string mode2Str = str[mode2]; - - if (mode1Str == "") - { - mode1Str = StringHelper::Sprintf("0x%08X", mode1); - } - - if (mode2Str == "") - { - if (mode2 & AA_EN) - { - mode2Str += "AA_EN | "; - } - - if (mode2 & Z_CMP) - { - mode2Str += "Z_CMP | "; - } - - if (mode2 & Z_UPD) - { - mode2Str += "Z_UPD | "; - } - - if (mode2 & IM_RD) - { - mode2Str += "IM_RD | "; - } - - if (mode2 & CLR_ON_CVG) - { - mode2Str += "CLR_ON_CVG | "; - } - - if (mode2 & CVG_DST_CLAMP) - { - mode2Str += "CVG_DST_CLAMP | "; - } - - if (mode2 & CVG_DST_WRAP) - { - mode2Str += "CVG_DST_WRAP | "; - } - - if (mode2 & CVG_DST_FULL) - { - mode2Str += "CVG_DST_FULL | "; - } - - if (mode2 & CVG_DST_SAVE) - { - mode2Str += "CVG_DST_SAVE | "; - } - - int32_t zMode = mode2 & 0xC00; - - if (zMode == ZMODE_INTER) - { - mode2Str += "ZMODE_INTER | "; - } - else if (zMode == ZMODE_XLU) - { - mode2Str += "ZMODE_XLU | "; - } - else if (zMode == ZMODE_DEC) - { - mode2Str += "ZMODE_DEC | "; - } - - if (mode2 & CVG_X_ALPHA) - { - mode2Str += "CVG_X_ALPHA | "; - } - - if (mode2 & ALPHA_CVG_SEL) - { - mode2Str += "ALPHA_CVG_SEL | "; - } - - if (mode2 & FORCE_BL) - { - mode2Str += "FORCE_BL | "; - } - - int32_t bp = (mode2 >> 28) & 0b11; - int32_t ba = (mode2 >> 24) & 0b11; - int32_t bm = (mode2 >> 20) & 0b11; - int32_t bb = (mode2 >> 16) & 0b11; - - mode2Str += StringHelper::Sprintf("GBL_c2(%i, %i, %i, %i)", bp, ba, bm, bb); - // mode2Str = StringHelper::Sprintf("0x%08X", mode2); - } - - sprintf(line, "gsDPSetRenderMode(%s, %s),", mode1Str.c_str(), mode2Str.c_str()); - } - else - { - sprintf(line, "gsSPSetOtherMode(0xE2, %i, %i, 0x%08X),", sft, len, dd); - } -} - -void ZDisplayList::Opcode_G_SETOTHERMODE_H(uint64_t data, char* line) -{ - int32_t ss = (data & 0x0000FF0000000000) >> 40; - int32_t nn = (data & 0x000000FF00000000) >> 32; - int32_t dd = (data & 0xFFFFFFFF); - - int32_t sft = 32 - (nn + 1) - ss; - - if (sft == 14) // G_MDSFT_TEXTLUT - { - const char* types[] = {"G_TT_NONE", "G_TT_NONE", "G_TT_RGBA16", "G_TT_IA16"}; - sprintf(line, "gsDPSetTextureLUT(%s),", types[dd >> 14]); - } - else - sprintf(line, "gsSPSetOtherMode(0xE3, %i, %i, 0x%08X),", sft, nn + 1, dd); -} - -void ZDisplayList::Opcode_G_LOADTLUT(uint64_t data, [[maybe_unused]] const std::string& prefix, - char* line) -{ - int32_t t = (data & 0x0000000007000000) >> 24; - int32_t ccc = (data & 0x00000000003FF000) >> 14; - - lastTexWidth = sqrt(ccc + 1); - lastTexHeight = sqrt(ccc + 1); - - lastTexLoaded = true; - lastTexIsPalette = true; - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - printf("TextureGenCheck G_LOADTLUT (lastCISiz: %i)\n", (uint32_t)lastCISiz); - - TextureGenCheck(); - - sprintf(line, "gsDPLoadTLUTCmd(%i, %i),", t, ccc); -} - -void ZDisplayList::Opcode_G_ENDDL([[maybe_unused]] const std::string& prefix, char* line) -{ - sprintf(line, "gsSPEndDisplayList(),"); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - printf("TextureGenCheck G_ENDDL\n"); - - TextureGenCheck(); -} - -static int32_t GfxdCallback_FormatSingleEntry() -{ - ZDisplayList* self = static_cast(gfxd_udata_get()); - gfxd_puts("\t"); - gfxd_macro_dflt(); - gfxd_puts(","); - - auto macroId = gfxd_macro_id(); - - switch (macroId) - { - case gfxd_SP1Triangle: - case gfxd_SP2Triangles: - if (self->lastTexture != nullptr && self->lastTexture->IsColorIndexed() && - !self->lastTexture->HasTlut()) - { - auto tex = self->lastTexture; - auto tlut = self->lastTlut; - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - { - if (tlut != nullptr) - printf("CI texture '%s' (0x%X), TLUT: '%s' (0x%X)\n", tex->GetName().c_str(), - tex->GetRawDataIndex(), tlut->GetName().c_str(), - tlut->GetRawDataIndex()); - else - printf("CI texture '%s' (0x%X), TLUT: null\n", tex->GetName().c_str(), - tex->GetRawDataIndex()); - } - - if (tlut != nullptr && !tex->HasTlut()) - tex->SetTlut(tlut); - } - break; - } - - // dont print a new line after the last command - switch (macroId) - { - case gfxd_SPEndDisplayList: - case gfxd_SPBranchList: - break; - - default: - gfxd_puts("\n"); - break; - } - - return 0; -} - -static int32_t GfxdCallback_Vtx(uint32_t seg, int32_t count) -{ - ZDisplayList* self = static_cast(gfxd_udata_get()); - uint32_t vtxOffset = Seg2Filespace(seg, self->parent->baseAddress); - - if (GETSEGNUM(seg) == self->parent->segment) - { - Declaration* decl; - - // Check for vertex intersections from other display lists - // TODO: These two could probably be condenced to one... - decl = self->parent->GetDeclarationRanged(vtxOffset + (count * 16)); - if (decl != nullptr) - { - int32_t diff = decl->address - vtxOffset; - - if (diff > 0) - count = diff / 16; - else - count = 0; - } - - decl = self->parent->GetDeclarationRanged(vtxOffset); - if (decl != nullptr) - { - int32_t diff = decl->address - vtxOffset; - - if (diff > 0) - count = diff / 16; - else - count = 0; - } - - if (count > 0) - { - std::vector vtxList; - vtxList.reserve(count); - - uint32_t currentPtr = vtxOffset; - for (int32_t i = 0; i < count; i++) - { - ZVtx vtx(self->parent); - vtx.ExtractFromFile(currentPtr); - - vtxList.push_back(vtx); - currentPtr += 16; - } - - bool keyAlreadyOccupied = self->vertices.find(vtxOffset) != self->vertices.end(); - - // In some cases a vtxList already exists at vtxOffset. Only override the existing list - // if the new one is bigger. - if (!keyAlreadyOccupied || - (keyAlreadyOccupied && vtxList.size() > self->vertices[vtxOffset].size())) - self->vertices[vtxOffset] = vtxList; - } - } - - self->references.push_back(seg); - gfxd_puts("@r"); - - return 1; -} - -static int32_t GfxdCallback_Texture(segptr_t seg, int32_t fmt, int32_t siz, int32_t width, - int32_t height, [[maybe_unused]] int32_t pal) -{ - ZDisplayList* self = static_cast(gfxd_udata_get()); - uint32_t texOffset = Seg2Filespace(seg, self->parent->baseAddress); - - self->lastTexWidth = width; - self->lastTexHeight = height; - self->lastTexAddr = texOffset; - self->lastTexSeg = seg; - self->lastTexFmt = static_cast(fmt); - self->lastTexSiz = static_cast(siz); - self->lastTexLoaded = true; - self->lastTexIsPalette = false; - - self->TextureGenCheck(); - - std::string texName; - Globals::Instance->GetSegmentedPtrName(seg, self->parent, "", texName); - - gfxd_puts(texName.c_str()); - - return 1; -} - -static int32_t GfxdCallback_Palette(uint32_t seg, [[maybe_unused]] int32_t idx, int32_t count) -{ - ZDisplayList* self = static_cast(gfxd_udata_get()); - uint32_t palOffset = Seg2Filespace(seg, self->parent->baseAddress); - - self->lastTexWidth = sqrt(count); - self->lastTexHeight = sqrt(count); - self->lastTexAddr = palOffset; - self->lastTexSeg = seg; - self->lastTexSiz = F3DZEXTexSizes::G_IM_SIZ_16b; - self->lastTexFmt = F3DZEXTexFormats::G_IM_FMT_RGBA; - self->lastTexLoaded = true; - self->lastTexIsPalette = true; - - self->TextureGenCheck(); - - std::string palName; - Globals::Instance->GetSegmentedPtrName(seg, self->parent, "", palName); - - gfxd_puts(palName.c_str()); - - return 1; -} - -static int32_t GfxdCallback_DisplayList(uint32_t seg) -{ - ZDisplayList* self = static_cast(gfxd_udata_get()); - uint32_t dListOffset = GETSEGOFFSET(seg); - uint32_t dListSegNum = GETSEGNUM(seg); - - std::string dListName = ""; - bool addressFound = - Globals::Instance->GetSegmentedPtrName(seg, self->parent, "Gfx", dListName, false); - - if (!addressFound) - { - if (self->parent->segment == dListSegNum) - { - ZDisplayList* newDList = new ZDisplayList(self->parent); - newDList->ExtractFromBinary( - dListOffset, - self->GetDListLength(self->parent->GetRawData(), dListOffset, self->dListType)); - newDList->SetName(newDList->GetDefaultName(self->parent->GetName())); - self->otherDLists.push_back(newDList); - dListName = newDList->GetName(); - } - else - { - Globals::Instance->WarnHardcodedPointer(seg, self->parent, self, - self->GetRawDataIndex()); - } - } - - gfxd_puts(dListName.c_str()); - - return 1; -} - -static int32_t GfxdCallback_Matrix(uint32_t seg) -{ - std::string mtxName; - ZDisplayList* self = static_cast(gfxd_udata_get()); - - bool addressFound = - Globals::Instance->GetSegmentedPtrName(seg, self->parent, "Mtx", mtxName, false); - - if (!addressFound) - { - if (GETSEGNUM(seg) == self->parent->segment) - { - Declaration* decl = - self->parent->GetDeclaration(Seg2Filespace(seg, self->parent->baseAddress)); - if (decl == nullptr) - { - ZMtx mtx(self->parent); - mtx.SetName(mtx.GetDefaultName(self->GetName())); - mtx.ExtractFromFile(Seg2Filespace(seg, self->parent->baseAddress)); - mtx.DeclareVar(self->GetName(), ""); - - mtx.GetSourceOutputCode(self->GetName()); - self->mtxList.push_back(mtx); - mtxName = "&" + mtx.GetName(); - } - } - else - { - Globals::Instance->WarnHardcodedPointer(seg, self->parent, self, - self->GetRawDataIndex()); - } - } - - gfxd_puts(mtxName.c_str()); - - return 1; -} - -void ZDisplayList::DeclareReferences(const std::string& prefix) -{ - std::string sourceOutput; - - if (Globals::Instance->useLegacyZDList) - sourceOutput += ProcessLegacy(prefix); - else - sourceOutput += ProcessGfxDis(prefix); - - // Iterate through our vertex lists, connect intersecting lists. - if (vertices.size() > 0) - { - std::vector>> verticesSorted(vertices.begin(), - vertices.end()); - - for (size_t i = 0; i < verticesSorted.size() - 1; i++) - { - size_t vtxSize = vertices[verticesSorted[i].first].size() * 16; - - if ((verticesSorted[i].first + vtxSize) > verticesSorted[i + 1].first) - { - int32_t intersectAmt = - (verticesSorted[i].first + vtxSize) - verticesSorted[i + 1].first; - int32_t intersectIndex = intersectAmt / 16; - - for (size_t j = intersectIndex; j < verticesSorted[i + 1].second.size(); j++) - vertices[verticesSorted[i].first].push_back(verticesSorted[i + 1].second[j]); - - vertices.erase(verticesSorted[i + 1].first); - verticesSorted.erase(verticesSorted.begin() + i + 1); - - i--; - } - } - - // Generate Vertex Declarations - for (auto& item : vertices) - { - std::string declaration = ""; - - offset_t curAddr = item.first; - auto& firstVtx = item.second.at(0); - - for (auto vtx : item.second) - declaration += StringHelper::Sprintf("\t%s,\n", vtx.GetBodySourceCode().c_str()); - - Declaration* decl = parent->AddDeclarationArray( - curAddr, firstVtx.GetDeclarationAlignment(), - item.second.size() * firstVtx.GetRawDataSize(), firstVtx.GetSourceTypeName(), - firstVtx.GetDefaultName(name), item.second.size(), declaration); - decl->isExternal = true; - } - } - - Declaration* decl = DeclareVar("", sourceOutput); - decl->references = references; - - // Iterate through our vertex lists, connect intersecting lists. - if (vertices.size() > 0) - { - std::vector>> verticesSorted(vertices.begin(), - vertices.end()); - - for (size_t i = 0; i < verticesSorted.size() - 1; i++) - { - // int32_t vtxSize = verticesSorted[i].second.size() * 16; - size_t vtxSize = vertices[verticesSorted[i].first].size() * 16; - - if ((verticesSorted[i].first + vtxSize) > verticesSorted[i + 1].first) - { - int32_t intersectAmt = - (verticesSorted[i].first + vtxSize) - verticesSorted[i + 1].first; - int32_t intersectIndex = intersectAmt / 16; - - for (size_t j = intersectIndex; j < verticesSorted[i + 1].second.size(); j++) - vertices[verticesSorted[i].first].push_back(verticesSorted[i + 1].second[j]); - - vertices.erase(verticesSorted[i + 1].first); - verticesSorted.erase(verticesSorted.begin() + i + 1); - - i--; - } - } - - // Generate Vertex Declarations - std::vector vtxKeys; - vtxKeys.reserve(vertices.size()); - for (auto& item : vertices) - vtxKeys.push_back(item.first); - - // for (pair> item : vertices) - for (size_t i = 0; i < vtxKeys.size(); i++) - { - auto& item = vertices[vtxKeys[i]]; - - std::string declaration; - - for (auto& vtx : item) - declaration += StringHelper::Sprintf("\t%s,\n", vtx.GetBodySourceCode().c_str()); - - // Ensure there's always a trailing line feed to prevent dumb warnings. - // Please don't remove this line, unless you somehow made a way to prevent - // that warning when building the OoT repo. - declaration += "\n"; - - if (parent != nullptr) - { - std::string vtxName; - ZResource* vtxRes = parent->FindResource(vtxKeys[i]); - - if (vtxRes != nullptr) - vtxName = vtxRes->GetName(); - else - vtxName = StringHelper::Sprintf("%sVtx_%06X", prefix.c_str(), vtxKeys[i]); - - auto filepath = Globals::Instance->outputPath / vtxName; - std::string incStr = - StringHelper::Sprintf("%s.%s.inc", filepath.string().c_str(), "vtx"); - - Declaration* vtxDecl = parent->AddDeclarationIncludeArray( - vtxKeys[i], incStr, item.size() * 16, "Vtx", vtxName, item.size()); - vtxDecl->isExternal = true; - } - } - } -} - -std::string ZDisplayList::ProcessLegacy(const std::string& prefix) -{ - char line[4096]; - std::string sourceOutput; - - for (size_t i = 0; i < instructions.size(); i++) - { - uint8_t opcode = (uint8_t)(instructions[i] >> 56); - uint64_t data = instructions[i]; - sourceOutput += " "; - - auto start = std::chrono::steady_clock::now(); - - int32_t optimizationResult = OptimizationChecks(i, sourceOutput, prefix); - - if (optimizationResult != -1) - { - i += optimizationResult - 1; - line[0] = '\0'; - } - else - { - if (dListType == DListType::F3DZEX) - ParseF3DZEX((F3DZEXOpcode)opcode, data, i, prefix, line); - else - ParseF3DEX((F3DEXOpcode)opcode, data, prefix, line); - } - - auto end = std::chrono::steady_clock::now(); - int64_t diff = std::chrono::duration_cast(end - start).count(); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG && diff > 5) - printf("F3DOP: 0x%02X, TIME: %" PRIi64 "ms\n", opcode, diff); - - sourceOutput += line; - - if (i < instructions.size() - 1) - sourceOutput += "\n"; - } - - return sourceOutput; -} - -std::string ZDisplayList::ProcessGfxDis([[maybe_unused]] const std::string& prefix) -{ - std::string sourceOutput; - - OutputFormatter outputformatter; - int32_t dListSize = instructions.size() * sizeof(instructions[0]); - - gfxd_input_buffer(instructions.data(), dListSize); - gfxd_endian(gfxd_endian_little, sizeof(uint64_t)); // tell gfxdis what format the data is - - gfxd_macro_fn(GfxdCallback_FormatSingleEntry); // format for each command entry - gfxd_vtx_callback(GfxdCallback_Vtx); // handle vertices - gfxd_timg_callback(GfxdCallback_Texture); // handle textures - gfxd_tlut_callback(GfxdCallback_Palette); // handle palettes - gfxd_dl_callback(GfxdCallback_DisplayList); // handle child display lists - gfxd_mtx_callback(GfxdCallback_Matrix); // handle matrices - gfxd_output_callback( - outputformatter.StaticWriter()); // convert tabs to 4 spaces and enforce 120 line limit - - gfxd_enable(gfxd_emit_dec_color); // use decimal for colors - - // set microcode. see gfxd.h for more options. - if (dListType == DListType::F3DZEX) - gfxd_target(gfxd_f3dex2); - else - gfxd_target(gfxd_f3dex); - - gfxd_udata_set(this); - gfxd_execute(); // generate display list - sourceOutput += outputformatter.GetOutput(); // write formatted display list - - MergeConnectingVertexLists(); - - return sourceOutput; -} - -void ZDisplayList::MergeConnectingVertexLists() -{ - if (vertices.size() > 0) - { - std::vector>> vertexKeys(vertices.begin(), - vertices.end()); - std::pair> lastItem = vertexKeys.at(0); - - for (size_t i = 1; i < vertexKeys.size(); i++) - { - std::pair> curItem = vertexKeys[i]; - - size_t lastItemEnd = lastItem.first + (lastItem.second.size() * 16); - bool lastItemIntersects = lastItemEnd >= curItem.first; - - if (lastItemIntersects) - { - int intersectedVtxStart = (lastItemEnd - curItem.first) / 16; - - for (size_t j = intersectedVtxStart; j < curItem.second.size(); j++) - vertices[lastItem.first].push_back(curItem.second[j]); - - vertices.erase(curItem.first); - vertexKeys.erase(vertexKeys.begin() + i); - - lastItem.second = vertices[lastItem.first]; - - i--; - } - else - lastItem = curItem; - } - } -} - -void ZDisplayList::TextureGenCheck() -{ - if (TextureGenCheck(lastTexWidth, lastTexHeight, lastTexAddr, lastTexSeg, lastTexFmt, - lastTexSiz, lastTexLoaded, lastTexIsPalette, this)) - { - lastTexAddr = 0; - lastTexLoaded = false; - lastTexIsPalette = false; - } -} - -bool ZDisplayList::TextureGenCheck(int32_t texWidth, int32_t texHeight, uint32_t texAddr, - uint32_t texSeg, F3DZEXTexFormats texFmt, F3DZEXTexSizes texSiz, - bool texLoaded, bool texIsPalette, ZDisplayList* self) -{ - uint32_t segmentNumber = GETSEGNUM(texSeg); - - if (!texIsPalette) - self->lastTexture = nullptr; - else - self->lastTlut = nullptr; - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) - printf("TextureGenCheck seg=%i width=%i height=%i ispal=%i addr=0x%06X\n", segmentNumber, - texWidth, texHeight, texIsPalette, texAddr); - - if ((texSeg != 0 || texAddr != 0) && texWidth > 0 && texHeight > 0 && texLoaded && - Globals::Instance->HasSegment(segmentNumber)) - { - ZFile* auxParent = nullptr; - if (segmentNumber == self->parent->segment) - { - auxParent = self->parent; - } - else - { - // Try to find a non-external file (i.e., one we are actually extracting) - // which has the same segment number we are looking for. - for (auto& otherFile : Globals::Instance->cfg.segmentRefFiles[segmentNumber]) - { - if (!otherFile->isExternalFile) - { - auxParent = otherFile; - } - } - } - - if (auxParent == nullptr) - { - // We can't declare the texture in any of the files we are extracting. - return false; - } - - if (auxParent->IsOffsetInFileRange(texAddr)) - { - ZTexture* tex = auxParent->GetTextureResource(texAddr); - if (tex != nullptr) - tex->isPalette = texIsPalette; - else - { - tex = new ZTexture(auxParent); - tex->ExtractFromBinary(texAddr, texWidth, texHeight, - TexFormatToTexType(texFmt, texSiz), texIsPalette); - auxParent->AddTextureResource(texAddr, tex); - } - - if (!texIsPalette) - self->lastTexture = tex; - else - self->lastTlut = tex; - - if (auxParent->GetDeclaration(texAddr) == nullptr) - { - tex->DeclareVar(self->GetName(), ""); - } - - return true; - } - } - - return false; -} - -TextureType ZDisplayList::TexFormatToTexType(F3DZEXTexFormats fmt, F3DZEXTexSizes siz) -{ - if (fmt == F3DZEXTexFormats::G_IM_FMT_RGBA) - { - if (siz == F3DZEXTexSizes::G_IM_SIZ_16b) - return TextureType::RGBA16bpp; - else if (siz == F3DZEXTexSizes::G_IM_SIZ_32b) - return TextureType::RGBA32bpp; - } - else if (fmt == F3DZEXTexFormats::G_IM_FMT_CI) - { - if (Globals::Instance->useLegacyZDList) - return TextureType::Palette8bpp; - else - { - if (siz == F3DZEXTexSizes::G_IM_SIZ_4b) - return TextureType::Palette4bpp; - else if (siz == F3DZEXTexSizes::G_IM_SIZ_8b) - return TextureType::Palette8bpp; - } - } - else if (fmt == F3DZEXTexFormats::G_IM_FMT_IA) - { - if (siz == F3DZEXTexSizes::G_IM_SIZ_4b) - return TextureType::GrayscaleAlpha4bpp; - else if (siz == F3DZEXTexSizes::G_IM_SIZ_8b) - return TextureType::GrayscaleAlpha8bpp; - else if (siz == F3DZEXTexSizes::G_IM_SIZ_16b) - return TextureType::GrayscaleAlpha16bpp; - } - else if (fmt == F3DZEXTexFormats::G_IM_FMT_I) - { - if (siz == F3DZEXTexSizes::G_IM_SIZ_4b) - return TextureType::Grayscale4bpp; - else if (siz == F3DZEXTexSizes::G_IM_SIZ_8b) - return TextureType::Grayscale8bpp; - else if (siz == F3DZEXTexSizes::G_IM_SIZ_16b) - return TextureType::Grayscale8bpp; - } - - return TextureType::RGBA16bpp; -} - -bool ZDisplayList::IsExternalResource() const -{ - return false; -} - -std::string ZDisplayList::GetExternalExtension() const -{ - return "dlist"; -} - -std::string ZDisplayList::GetSourceTypeName() const -{ - return "Gfx"; -} - -ZResourceType ZDisplayList::GetResourceType() const -{ - return ZResourceType::DisplayList; -} - -size_t ZDisplayList::GetRawDataSize() const -{ - return instructions.size() * 8; -} - -DeclarationAlignment ZDisplayList::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align8; -} diff --git a/tools/ZAPD/ZAPD/ZDisplayList.h b/tools/ZAPD/ZAPD/ZDisplayList.h deleted file mode 100644 index 356e89a2be..0000000000 --- a/tools/ZAPD/ZAPD/ZDisplayList.h +++ /dev/null @@ -1,381 +0,0 @@ -#pragma once - -#include "ZMtx.h" -#include "ZResource.h" -#include "ZRoom/ZRoom.h" -#include "ZTexture.h" -#include "ZVtx.h" -#include "tinyxml2.h" - -#include -#include -#include - -enum class F3DEXOpcode -{ - G_SPNOOP = 0x00, - G_MTX = 0x01, - G_MOVEMEM = 0x03, - G_VTX = 0x04, - G_DL = 0x06, - G_LOAD_UCODE = 0xAF, - G_BRANCH_Z = 0xB0, - G_TRI2 = 0xB1, - G_MODIFYVTX = 0xB2, - G_RDPHALF_2 = 0xB3, - G_RDPHALF_1 = 0xB4, - G_QUAD = 0xB5, - G_CLEARGEOMETRYMODE = 0xB6, - G_SETGEOMETRYMODE = 0xB7, - G_ENDDL = 0xB8, - G_SETOTHERMODE_L = 0xB9, - G_SETOTHERMODE_H = 0xBA, - G_TEXTURE = 0xBB, - G_MOVEWORD = 0xBC, - G_POPMTX = 0xBD, - G_CULLDL = 0xBE, - G_TRI1 = 0xBF, - G_NOOP = 0xC0, - G_TEXRECT = 0xE4, - G_TEXRECTFLIP = 0xE5, - G_RDPLOADSYNC = 0xE6, - G_RDPPIPESYNC = 0xE7, - G_RDPTILESYNC = 0xE8, - G_RDPFULLSYNC = 0xE9, - G_SETKEYGB = 0xEA, - G_SETKEYR = 0xEB, - G_SETCONVERT = 0xEC, - G_SETSCISSOR = 0xED, - G_SETPRIMDEPTH = 0xEE, - G_RDPSETOTHERMODE = 0xEF, - G_LOADTLUT = 0xF0, - G_SETTILESIZE = 0xF2, - G_LOADBLOCK = 0xF3, - G_LOADTILE = 0xF4, - G_SETTILE = 0xF5, - G_FILLRECT = 0xF6, - G_SETFILLCOLOR = 0xF7, - G_SETFOGCOLOR = 0xF8, - G_SETBLENDCOLOR = 0xF9, - G_SETPRIMCOLOR = 0xFA, - G_SETENVCOLOR = 0xFB, - G_SETCOMBINE = 0xFC, - G_SETTIMG = 0xFD, - G_SETZIMG = 0xFE, - G_SETCIMG = 0xFF -}; - -enum class F3DZEXOpcode -{ - G_NOOP = 0x00, - G_VTX = 0x01, - G_MODIFYVTX = 0x02, - G_CULLDL = 0x03, - G_BRANCH_Z = 0x04, - G_TRI1 = 0x05, - G_TRI2 = 0x06, - G_QUAD = 0x07, - G_SPECIAL_3 = 0xD3, - G_SPECIAL_2 = 0xD4, - G_SPECIAL_1 = 0xD5, - G_DMA_IO = 0xD6, - G_TEXTURE = 0xD7, - G_POPMTX = 0xD8, - G_GEOMETRYMODE = 0xD9, - G_MTX = 0xDA, - G_MOVEWORD = 0xDB, - G_MOVEMEM = 0xDC, - G_LOAD_UCODE = 0xDD, - G_DL = 0xDE, - G_ENDDL = 0xDF, - G_SPNOOP = 0xE0, - G_RDPHALF_1 = 0xE1, - G_SETOTHERMODE_L = 0xE2, - G_SETOTHERMODE_H = 0xE3, - G_TEXRECT = 0xE4, - G_TEXRECTFLIP = 0xE5, - G_RDPLOADSYNC = 0xE6, - G_RDPPIPESYNC = 0xE7, - G_RDPTILESYNC = 0xE8, - G_RDPFULLSYNC = 0xE9, - G_SETKEYGB = 0xEA, - G_SETKEYR = 0xEB, - G_SETCONVERT = 0xEC, - G_SETSCISSOR = 0xED, - G_SETPRIMDEPTH = 0xEE, - G_RDPSETOTHERMODE = 0xEF, - G_LOADTLUT = 0xF0, - G_RDPHALF_2 = 0xF1, - G_SETTILESIZE = 0xF2, - G_LOADBLOCK = 0xF3, - G_LOADTILE = 0xF4, - G_SETTILE = 0xF5, - G_FILLRECT = 0xF6, - G_SETFILLCOLOR = 0xF7, - G_SETFOGCOLOR = 0xF8, - G_SETBLENDCOLOR = 0xF9, - G_SETPRIMCOLOR = 0xFA, - G_SETENVCOLOR = 0xFB, - G_SETCOMBINE = 0xFC, - G_SETTIMG = 0xFD, - G_SETZIMG = 0xFE, - G_SETCIMG = 0xFF, -}; - -enum class F3DZEXTexFormats -{ - G_IM_FMT_RGBA, - G_IM_FMT_YUV, - G_IM_FMT_CI, - G_IM_FMT_IA, - G_IM_FMT_I -}; - -enum class F3DZEXTexSizes -{ - G_IM_SIZ_4b, - G_IM_SIZ_8b, - G_IM_SIZ_16b, - G_IM_SIZ_32b -}; - -enum class DListType -{ - F3DZEX, - F3DEX, -}; - -enum class OoTSegments -{ - DirectReference = 0, - TitleStatic = 1, - Scene = 2, - Room = 3, - GameplayKeep = 4, - FieldDungeonKeep = 5, - Object = 6, - LinkAnimation = 7, - IconItemStatic = 8, - IconItem24Static = 9, - Unknown10 = 10, - Unknown11 = 11, - Unknown12 = 12, - IconFieldDungeonStatic = 13, - IconItemLanguageStatic = 14, - ZBuffer = 15, - FrameBuffer = 16, -}; - -#define G_MDSFT_ALPHACOMPARE 0 -#define G_MDSFT_ZSRCSEL 2 -#define G_MDSFT_RENDERMODE 3 -#define G_MDSFT_BLENDER 16 - -#define G_RM_FOG_SHADE_A 0xC8000000 -#define G_RM_FOG_PRIM_A 0xC4000000 -#define G_RM_PASS 0x0C080000 -#define G_RM_AA_ZB_OPA_SURF 0x442078 -#define G_RM_AA_ZB_OPA_SURF2 0x112078 -#define G_RM_AA_ZB_XLU_SURF 0x4049D8 -#define G_RM_AA_ZB_XLU_SURF2 0x1049D8 -#define G_RM_AA_ZB_OPA_DECAL 0x442D58 -#define G_RM_AA_ZB_OPA_DECAL2 0x112D58 -#define G_RM_AA_ZB_XLU_DECAL 0x404DD8 -#define G_RM_AA_ZB_XLU_DECAL2 0x104DD8 -#define G_RM_AA_ZB_OPA_INTER 0x442478 -#define G_RM_AA_ZB_OPA_INTER2 0x112478 -#define G_RM_AA_ZB_XLU_INTER 0x4045D8 -#define G_RM_AA_ZB_XLU_INTER2 0x1045D8 -#define G_RM_AA_ZB_XLU_LINE 0x407858 -#define G_RM_AA_ZB_XLU_LINE2 0x107858 -#define G_RM_AA_ZB_DEC_LINE 0x407F58 -#define G_RM_AA_ZB_DEC_LINE2 0x107F58 -#define G_RM_AA_ZB_TEX_EDGE 0x443078 -#define G_RM_AA_ZB_TEX_EDGE2 0x113078 -#define G_RM_AA_ZB_TEX_INTER 0x443478 -#define G_RM_AA_ZB_TEX_INTER2 0x113478 -#define G_RM_AA_ZB_SUB_SURF 0x442878 -#define G_RM_AA_ZB_SUB_SURF2 0x112278 -#define G_RM_AA_ZB_PCL_SURF 0x40007B -#define G_RM_AA_ZB_PCL_SURF2 0x10007B -#define G_RM_AA_ZB_OPA_TERR 0x402078 -#define G_RM_AA_ZB_OPA_TERR2 0x102078 -#define G_RM_AA_ZB_TEX_TERR 0x403078 -#define G_RM_AA_ZB_TEX_TERR2 0x103078 -#define G_RM_AA_ZB_SUB_TERR 0x402278 -#define G_RM_AA_ZB_SUB_TERR2 0x102278 -#define G_RM_RA_ZB_OPA_SURF 0x442038 -#define G_RM_RA_ZB_OPA_SURF2 0x112038 -#define G_RM_RA_ZB_OPA_DECAL 0x442D18 -#define G_RM_RA_ZB_OPA_DECAL2 0x112D18 -#define G_RM_RA_ZB_OPA_INTER 0x442438 -#define G_RM_RA_ZB_OPA_INTER2 0x112438 -#define G_RM_AA_OPA_SURF 0x442048 -#define G_RM_AA_OPA_SURF2 0x112048 -#define G_RM_AA_XLU_SURF 0x4041C8 -#define G_RM_AA_XLU_SURF2 0x1041C8 -#define G_RM_AA_XLU_LINE 0x407048 -#define G_RM_AA_XLU_LINE2 0x107048 -#define G_RM_AA_DEC_LINE 0x407248 -#define G_RM_AA_DEC_LINE2 0x107248 -#define G_RM_AA_TEX_EDGE 0x443048 -#define G_RM_AA_TEX_EDGE2 0x113048 -#define G_RM_AA_SUB_SURF 0x442248 -#define G_RM_AA_SUB_SURF2 0x112248 -#define G_RM_AA_PCL_SURF 0x40004B -#define G_RM_AA_PCL_SURF2 0x10004B -#define G_RM_AA_OPA_TERR 0x402048 -#define G_RM_AA_OPA_TERR2 0x102048 -#define G_RM_AA_TEX_TERR 0x403048 -#define G_RM_AA_TEX_TERR2 0x103048 -#define G_RM_AA_SUB_TERR 0x402248 -#define G_RM_AA_SUB_TERR2 0x102248 -#define G_RM_RA_OPA_SURF 0x442008 -#define G_RM_RA_OPA_SURF2 0x112008 -#define G_RM_ZB_OPA_SURF 0x442230 -#define G_RM_ZB_OPA_SURF2 0x112230 -#define G_RM_ZB_XLU_SURF 0x404A50 -#define G_RM_ZB_XLU_SURF2 0x104A50 -#define G_RM_ZB_OPA_DECAL 0x442E10 -#define G_RM_ZB_OPA_DECAL2 0x112E10 -#define G_RM_ZB_XLU_DECAL 0x404E50 -#define G_RM_ZB_XLU_DECAL2 0x104E50 -#define G_RM_ZB_CLD_SURF 0x404B50 -#define G_RM_ZB_CLD_SURF2 0x104B50 -#define G_RM_ZB_OVL_SURF 0x404F50 -#define G_RM_ZB_OVL_SURF2 0x104F50 -#define G_RM_ZB_PCL_SURF 0x0C080233 -#define G_RM_ZB_PCL_SURF2 0x03020233 -#define G_RM_OPA_SURF 0x0C084000 -#define G_RM_OPA_SURF2 0x03024000 -#define G_RM_XLU_SURF 0x00404200 -#define G_RM_XLU_SURF2 0x00104240 -#define G_RM_CLD_SURF 0x00404340 -#define G_RM_CLD_SURF2 0x00104340 -#define G_RM_TEX_EDGE 0x0C087008 -#define G_RM_TEX_EDGE2 0x03027008 -#define G_RM_PCL_SURF 0x0C084203 -#define G_RM_PCL_SURF2 0x03024203 -#define G_RM_ADD 0x04484340 -#define G_RM_ADD2 0x01124340 -#define G_RM_NOOP 0x00000000 -#define G_RM_NOOP2 0x00000000 -#define G_RM_VISCVG 0x0C844040 -#define G_RM_VISCVG2 0x03214040 -#define G_RM_OPA_CI 0x0C080000 -#define G_RM_OPA_CI2 0x03020000 - -#define AA_EN 0x8 -#define Z_CMP 0x10 -#define Z_UPD 0x20 -#define IM_RD 0x40 -#define CLR_ON_CVG 0x80 -#define CVG_DST_CLAMP 0 -#define CVG_DST_WRAP 0x100 -#define CVG_DST_FULL 0x200 -#define CVG_DST_SAVE 0x300 -#define ZMODE_OPA 0 -#define ZMODE_INTER 0x400 -#define ZMODE_XLU 0x800 -#define ZMODE_DEC 0xc00 -#define CVG_X_ALPHA 0x1000 -#define ALPHA_CVG_SEL 0x2000 -#define FORCE_BL 0x4000 -#define TEX_EDGE 0x0000 - -class ZDisplayList : public ZResource -{ -protected: - static TextureType TexFormatToTexType(F3DZEXTexFormats fmt, F3DZEXTexSizes siz); - - void ParseF3DZEX(F3DZEXOpcode opcode, uint64_t data, int32_t i, const std::string& prefix, - char* line); - void ParseF3DEX(F3DEXOpcode opcode, uint64_t data, const std::string& prefix, char* line); - - // Various Instruction Optimizations - bool SequenceCheck(std::vector sequence, int32_t startIndex); - int32_t OptimizationChecks(int32_t startIndex, std::string& output, const std::string& prefix); - int32_t OptimizationCheck_LoadTextureBlock(int32_t startIndex, std::string& output, - const std::string& prefix); - // int32_t OptimizationCheck_LoadMultiBlock(int32_t startIndex, std::string& output, std::string - // prefix); - - // F3DEX Specific Opcode Values - void Opcode_F3DEX_G_SETOTHERMODE_L(uint64_t data, char* line); - - // Shared Opcodes between F3DZEX and F3DEX - void Opcode_G_DL(uint64_t data, const std::string& prefix, char* line); - void Opcode_G_MODIFYVTX(uint64_t data, char* line); - void Opcode_G_CULLDL(uint64_t data, char* line); - void Opcode_G_TRI1(uint64_t data, char* line); - void Opcode_G_TRI2(uint64_t data, char* line); - void Opcode_G_MTX(uint64_t data, char* line); - void Opcode_G_VTX(uint64_t data, char* line); - void Opcode_G_TEXTURE(uint64_t data, char* line); - void Opcode_G_SETTIMG(uint64_t data, const std::string& prefix, char* line); - void Opcode_G_SETTILE(uint64_t data, char* line); - void Opcode_G_SETTILESIZE(uint64_t data, const std::string& prefix, char* line); - void Opcode_G_LOADBLOCK(uint64_t data, char* line); - void Opcode_G_SETCOMBINE(uint64_t data, char* line); - void Opcode_G_SETPRIMCOLOR(uint64_t data, char* line); - void Opcode_G_SETOTHERMODE_L(uint64_t data, char* line); - void Opcode_G_SETOTHERMODE_H(uint64_t data, char* line); - void Opcode_G_LOADTLUT(uint64_t data, const std::string& prefix, char* line); - void Opcode_G_ENDDL(const std::string& prefix, char* line); - -public: - std::vector instructions; - - int32_t lastTexWidth, lastTexHeight, lastTexAddr, lastTexSeg; - F3DZEXTexFormats lastTexFmt; - F3DZEXTexSizes lastTexSiz, lastTexSizTest, lastCISiz; - bool lastTexLoaded; - bool lastTexIsPalette; - - DListType dListType; - - std::map> vertices; - std::vector otherDLists; - - ZTexture* lastTexture = nullptr; - ZTexture* lastTlut = nullptr; - - std::vector references; - std::vector mtxList; - - ZDisplayList(ZFile* nParent); - ~ZDisplayList(); - - void ExtractWithXML(tinyxml2::XMLElement* reader, uint32_t nRawDataIndex) override; - void ExtractFromBinary(uint32_t nRawDataIndex, int32_t rawDataSize); - - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetDefaultName(const std::string& prefix) const override; - - void TextureGenCheck(); - static bool TextureGenCheck(int32_t texWidth, int32_t texHeight, uint32_t texAddr, - uint32_t texSeg, F3DZEXTexFormats texFmt, F3DZEXTexSizes texSiz, - bool texLoaded, bool texIsPalette, ZDisplayList* self); - static int32_t GetDListLength(const std::vector& rawData, uint32_t rawDataIndex, - DListType dListType); - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; - void DeclareReferences(const std::string& prefix) override; - std::string ProcessLegacy(const std::string& prefix); - std::string ProcessGfxDis(const std::string& prefix); - - // Combines vertex lists from the vertices map which touch or intersect - void MergeConnectingVertexLists(); - - bool IsExternalResource() const override; - std::string GetExternalExtension() const override; - std::string GetSourceTypeName() const override; - - ZResourceType GetResourceType() const override; - -protected: - size_t numInstructions; -}; diff --git a/tools/ZAPD/ZAPD/ZFile.cpp b/tools/ZAPD/ZAPD/ZFile.cpp deleted file mode 100644 index db2d251a5c..0000000000 --- a/tools/ZAPD/ZAPD/ZFile.cpp +++ /dev/null @@ -1,1434 +0,0 @@ -#include "ZFile.h" - -#include -#include -#include -#include - -#include "Globals.h" -#include "OutputFormatter.h" -#include "Utils/BinaryWriter.h" -#include "Utils/BitConverter.h" -#include "Utils/Directory.h" -#include "Utils/File.h" -#include "Utils/MemoryStream.h" -#include "Utils/Path.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZAnimation.h" -#include "ZArray.h" -#include "ZBackground.h" -#include "ZBlob.h" -#include "ZCollision.h" -#include "ZCutscene.h" -#include "ZDisplayList.h" -#include "ZLimb.h" -#include "ZMtx.h" -#include "ZRoom/ZRoom.h" -#include "ZScalar.h" -#include "ZSkeleton.h" -#include "ZSymbol.h" -#include "ZTexture.h" -#include "ZVector.h" -#include "ZVtx.h" - -ZFile::ZFile() -{ - resources = std::vector(); - basePath = ""; - declarations = std::map(); - defines = ""; - baseAddress = 0; - rangeStart = 0x000000000; - rangeEnd = 0xFFFFFFFF; -} - -ZFile::ZFile(const fs::path& nOutPath, const std::string& nName) : ZFile() -{ - name = nName; - outName = nName; - outputPath = nOutPath; -} - -ZFile::ZFile(ZFileMode nMode, tinyxml2::XMLElement* reader, const fs::path& nBasePath, - const fs::path& nOutPath, const std::string& filename, const fs::path& nXmlFilePath) - : ZFile() -{ - xmlFilePath = nXmlFilePath; - if (nBasePath == "") - basePath = Directory::GetCurrentDirectory(); - else - basePath = nBasePath; - - if (nOutPath == "") - outputPath = Directory::GetCurrentDirectory(); - else - outputPath = nOutPath; - - mode = nMode; - - ParseXML(reader, filename); - if (mode != ZFileMode::ExternalFile) - DeclareResourceSubReferences(); -} - -ZFile::~ZFile() -{ - for (ZResource* res : resources) - delete res; - - for (auto d : declarations) - delete d.second; - - for (auto sym : symbolResources) - delete sym.second; -} - -void ZFile::ParseXML(tinyxml2::XMLElement* reader, const std::string& filename) -{ - assert(mode != ZFileMode::Invalid); - - if (filename == "") - name = reader->Attribute("Name"); - else - name = filename; - - outName = name; - const char* outNameXml = reader->Attribute("OutName"); - if (outNameXml != nullptr) - outName = outNameXml; - - // TODO: This should be a variable on the ZFile, but it is a large change in order to force all - // ZResource types to have a parent ZFile. - const char* gameStr = reader->Attribute("Game"); - if (reader->Attribute("Game") != nullptr) - { - if (std::string_view(gameStr) == "MM") - Globals::Instance->game = ZGame::MM_RETAIL; - else if (std::string_view(gameStr) == "SW97" || std::string_view(gameStr) == "OOTSW97") - Globals::Instance->game = ZGame::OOT_SW97; - else if (std::string_view(gameStr) == "OOT") - Globals::Instance->game = ZGame::OOT_RETAIL; - else - { - std::string errorHeader = - StringHelper::Sprintf("'Game' type '%s' is not supported.", gameStr); - HANDLE_ERROR_PROCESS(WarningType::InvalidAttributeValue, errorHeader, ""); - } - } - - if (reader->Attribute("BaseAddress") != nullptr) - baseAddress = StringHelper::StrToL(reader->Attribute("BaseAddress"), 16); - - if (mode == ZFileMode::Extract && Globals::Instance->baseAddress != -1) - baseAddress = Globals::Instance->baseAddress; - - if (reader->Attribute("RangeStart") != nullptr) - rangeStart = StringHelper::StrToL(reader->Attribute("RangeStart"), 16); - - if (reader->Attribute("RangeEnd") != nullptr) - rangeEnd = StringHelper::StrToL(reader->Attribute("RangeEnd"), 16); - - if (rangeStart > rangeEnd) - HANDLE_ERROR_PROCESS( - WarningType::Always, - StringHelper::Sprintf("'RangeStart' 0x%06X must be before 'RangeEnd' 0x%06X", - rangeStart, rangeEnd), - ""); - - const char* segmentXml = reader->Attribute("Segment"); - if (segmentXml != nullptr) - { - if (!StringHelper::HasOnlyDigits(segmentXml)) - { - HANDLE_ERROR_PROCESS(WarningType::Always, - StringHelper::Sprintf("error: Invalid segment value '%s': must be " - "a decimal between 0 and 15 inclusive", - segmentXml), - ""); - } - - segment = StringHelper::StrToL(segmentXml, 10); - if (segment > 15) - { - if (segment == 128) - { -#ifdef DEPRECATION_ON - HANDLE_WARNING_PROCESS( - WarningType::Always, "warning: segment 128 is deprecated.", - "Remove 'Segment=\"128\"' from the xml to use virtual addresses\n"); -#endif - } - else - { - HANDLE_ERROR_PROCESS( - WarningType::Always, - StringHelper::Sprintf("error: invalid segment value '%s': must be a decimal " - "number between 0 and 15 inclusive", - segmentXml), - ""); - } - } - } - Globals::Instance->AddSegment(segment, this); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - { - if (segment == 0x80) - { - printf("File '%s' using virtual addresses.\n", GetName().c_str()); - } - else - { - printf("File '%s' using segment %X.\n", GetName().c_str(), segment); - } - } - - const char* segmentDefines = reader->Attribute("Defines"); - if (segmentDefines != NULL) - { - makeDefines = true; - } - - if (mode == ZFileMode::Extract || mode == ZFileMode::ExternalFile) - { - if (!File::Exists((basePath / name).string())) - { - std::string errorHeader = StringHelper::Sprintf("binary file '%s' does not exist.", - (basePath / name).c_str()); - HANDLE_ERROR_PROCESS(WarningType::Always, errorHeader, ""); - } - - rawData = File::ReadAllBytes((basePath / name).string()); - if (mode == ZFileMode::Extract && Globals::Instance->startOffset != -1 && Globals::Instance->endOffset != -1) - rawData = std::vector(rawData.begin() + Globals::Instance->startOffset, - rawData.begin() + Globals::Instance->endOffset); - - if (reader->Attribute("RangeEnd") == nullptr) - rangeEnd = rawData.size(); - } - - std::unordered_set nameSet; - std::unordered_set outNameSet; - std::unordered_set offsetSet; - - auto nodeMap = *GetNodeMap(); - uint32_t rawDataIndex = 0; - - for (tinyxml2::XMLElement* child = reader->FirstChildElement(); child != nullptr; - child = child->NextSiblingElement()) - { - const char* nameXml = child->Attribute("Name"); - const char* outNameXml = child->Attribute("OutName"); - const char* offsetXml = child->Attribute("Offset"); - - // Check for repeated attributes. - if (offsetXml != nullptr) - { - if (!StringHelper::IsValidOffset(std::string_view(offsetXml))) - { - HANDLE_ERROR(WarningType::InvalidXML, - StringHelper::Sprintf("Invalid offset %s entered", offsetXml), ""); - } - rawDataIndex = strtol(offsetXml, NULL, 16); - - if (offsetSet.find(offsetXml) != offsetSet.end()) - { - std::string errorHeader = - StringHelper::Sprintf("repeated 'Offset' attribute: %s", offsetXml); - HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, ""); - } - offsetSet.insert(offsetXml); - } - else - { - HANDLE_WARNING_RESOURCE(WarningType::MissingOffsets, this, nullptr, rawDataIndex, - StringHelper::Sprintf("no offset specified for %s.", nameXml), - ""); - } - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - printf("%s: 0x%06X\n", nameXml, rawDataIndex); - - if (outNameXml != nullptr) - { - if (outNameSet.find(outNameXml) != outNameSet.end()) - { - std::string errorHeader = - StringHelper::Sprintf("repeated 'OutName' attribute: %s", outNameXml); - HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, ""); - } - outNameSet.insert(outNameXml); - } - if (nameXml != nullptr) - { - if (nameSet.find(nameXml) != nameSet.end()) - { - std::string errorHeader = - StringHelper::Sprintf("repeated 'Name' attribute: %s", nameXml); - HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, ""); - } - nameSet.insert(nameXml); - } - - std::string nodeName = std::string(child->Name()); - - if (nodeMap.find(nodeName) != nodeMap.end()) - { - ZResource* nRes = nodeMap[nodeName](this); - - if (mode == ZFileMode::Extract || mode == ZFileMode::ExternalFile) - nRes->ExtractWithXML(child, rawDataIndex); - - switch (nRes->GetResourceType()) - { - case ZResourceType::Texture: - AddTextureResource(rawDataIndex, static_cast(nRes)); - break; - - case ZResourceType::Symbol: - AddSymbolResource(rawDataIndex, static_cast(nRes)); - break; - - default: - AddResource(nRes); - break; - } - - rawDataIndex += nRes->GetRawDataSize(); - } - else if (std::string_view(child->Name()) == "File") - { - std::string errorHeader = "Can't declare a inside a "; - HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, ""); - } - else - { - std::string errorHeader = StringHelper::Sprintf( - "Unknown element found inside a element: %s", nodeName.c_str()); - HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, ""); - } - } -} - -void ZFile::DeclareResourceSubReferences() -{ - for (size_t i = 0; i < resources.size(); i++) - { - resources.at(i)->DeclareReferences(name); - } -} - -void ZFile::BuildSourceFile() -{ - if (mode == ZFileMode::ExternalFile) - return; - - if (!Directory::Exists(outputPath)) - Directory::CreateDirectory(outputPath.string()); - - GenerateSourceFiles(); -} - -std::string ZFile::GetName() const -{ - return name; -} - -std::string ZFile::GetOutName() const -{ - return outName.string(); -} - -ZFileMode ZFile::GetMode() const -{ - return mode; -} - -const fs::path& ZFile::GetXmlFilePath() const -{ - return xmlFilePath; -} - -const std::vector& ZFile::GetRawData() const -{ - return rawData; -} - -void ZFile::ExtractResources() -{ - if (mode == ZFileMode::ExternalFile) - return; - - if (!Directory::Exists(outputPath)) - Directory::CreateDirectory(outputPath.string()); - - if (!Directory::Exists(GetSourceOutputFolderPath())) - Directory::CreateDirectory(GetSourceOutputFolderPath().string()); - - for (size_t i = 0; i < resources.size(); i++) - resources[i]->ParseRawDataLate(); - for (size_t i = 0; i < resources.size(); i++) - resources[i]->DeclareReferencesLate(name); - - if (Globals::Instance->genSourceFile) - GenerateSourceFiles(); - - auto memStreamFile = std::shared_ptr(new MemoryStream()); - BinaryWriter writerFile = BinaryWriter(memStreamFile); - - ExporterSet* exporterSet = Globals::Instance->GetExporterSet(); - - if (exporterSet != nullptr && exporterSet->beginFileFunc != nullptr) - exporterSet->beginFileFunc(this); - - for (ZResource* res : resources) - { - auto memStreamRes = std::shared_ptr(new MemoryStream()); - BinaryWriter writerRes = BinaryWriter(memStreamRes); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - printf("Saving resource %s\n", res->GetName().c_str()); - - res->Save(outputPath); - - // Check if we have an exporter "registered" for this resource type - ZResourceExporter* exporter = Globals::Instance->GetExporter(res->GetResourceType()); - if (exporter != nullptr) - { - // exporter->Save(res, Globals::Instance->outputPath.string(), &writerFile); - exporter->Save(res, Globals::Instance->outputPath.string(), &writerRes); - } - - if (exporterSet != nullptr && exporterSet->resSaveFunc != nullptr) - exporterSet->resSaveFunc(res, writerRes); - } - - if (memStreamFile->GetLength() > 0) - { - File::WriteAllBytes(StringHelper::Sprintf("%s%s.bin", - Globals::Instance->outputPath.string().c_str(), - GetName().c_str()), - memStreamFile->ToVector()); - } - - writerFile.Close(); - - if (exporterSet != nullptr && exporterSet->endFileFunc != nullptr) - exporterSet->endFileFunc(this); -} - -void ZFile::AddResource(ZResource* res) -{ - resources.push_back(res); -} - -ZResource* ZFile::FindResource(offset_t rawDataIndex) -{ - for (ZResource* res : resources) - { - if (res->GetRawDataIndex() == rawDataIndex) - return res; - } - - return nullptr; -} - -std::vector ZFile::GetResourcesOfType(ZResourceType resType) -{ - std::vector resList; - resList.reserve(resources.size()); - - for (ZResource* res : resources) - { - if (res->GetResourceType() == resType) - resList.push_back(res); - } - - return resList; -} - -Declaration* ZFile::AddDeclaration(offset_t address, DeclarationAlignment alignment, size_t size, - const std::string& varType, const std::string& varName, - const std::string& body) -{ - bool validOffset = DeclarationSanityChecks(address, varName); - if (!validOffset) - return nullptr; - - Declaration* decl = GetDeclaration(address); - if (decl == nullptr) - { - decl = Declaration::Create(address, alignment, size, varType, varName, body); - declarations[address] = decl; - } - else - { - decl->alignment = alignment; - decl->size = size; - decl->declType = varType; - decl->declName = varName; - decl->declBody = body; - } - - return decl; -} - -Declaration* ZFile::AddDeclarationArray(offset_t address, DeclarationAlignment alignment, - size_t size, const std::string& varType, - const std::string& varName, size_t arrayItemCnt, - const std::string& body) -{ - bool validOffset = DeclarationSanityChecks(address, varName); - if (!validOffset) - return nullptr; - - Declaration* decl = GetDeclaration(address); - if (decl == nullptr) - { - decl = Declaration::CreateArray(address, alignment, size, varType, varName, body, - arrayItemCnt); - - declarations[address] = decl; - } - else - { - if (decl->isPlaceholder) - decl->declName = varName; - - decl->alignment = alignment; - decl->size = size; - decl->declType = varType; - decl->isArray = true; - decl->arrayItemCnt = arrayItemCnt; - decl->declBody = body; - } - - return decl; -} - -Declaration* ZFile::AddDeclarationArray(offset_t address, DeclarationAlignment alignment, - size_t size, const std::string& varType, - const std::string& varName, - const std::string& arrayItemCntStr, const std::string& body) -{ - bool validOffset = DeclarationSanityChecks(address, varName); - if (!validOffset) - return nullptr; - - Declaration* decl = GetDeclaration(address); - if (decl == nullptr) - { - decl = Declaration::CreateArray(address, alignment, size, varType, varName, body, - arrayItemCntStr); - - declarations[address] = decl; - } - else - { - decl->alignment = alignment; - decl->size = size; - decl->declType = varType; - decl->declName = varName; - decl->isArray = true; - decl->arrayItemCntStr = arrayItemCntStr; - decl->declBody = body; - } - return decl; -} - -Declaration* ZFile::AddDeclarationPlaceholder(offset_t address, const std::string& varName) -{ - bool validOffset = DeclarationSanityChecks(address, varName); - if (!validOffset) - return nullptr; - - Declaration* decl; - if (declarations.find(address) == declarations.end()) - { - decl = Declaration::CreatePlaceholder(address, varName); - declarations[address] = decl; - } - else - decl = declarations[address]; - - return decl; -} - -Declaration* ZFile::AddDeclarationInclude(offset_t address, const std::string& includePath, - size_t size, const std::string& varType, - const std::string& varName) -{ - bool validOffset = DeclarationSanityChecks(address, varName); - if (!validOffset) - return nullptr; - - Declaration* decl = GetDeclaration(address); - if (decl == nullptr) - { - decl = Declaration::CreateInclude(address, includePath, size, varType, varName); - declarations[address] = decl; - } - else - { - decl->includePath = includePath; - decl->size = size; - decl->declType = varType; - decl->declName = varName; - } - return decl; -} - -Declaration* ZFile::AddDeclarationIncludeArray(offset_t address, std::string& includePath, - size_t size, const std::string& varType, - const std::string& varName, size_t arrayItemCnt) -{ - bool validOffset = DeclarationSanityChecks(address, varName); - if (!validOffset) - return nullptr; - - if (StringHelper::StartsWith(includePath, "assets/extracted/")) - includePath = "assets/" + StringHelper::Split(includePath, "assets/extracted/")[1]; - if (StringHelper::StartsWith(includePath, "assets/custom/")) - includePath = "assets/" + StringHelper::Split(includePath, "assets/custom/")[1]; - // Hack for OOT: don't prefix include paths with extracted/VERSION/ - if (StringHelper::StartsWith(includePath, "extracted/")) { - std::vector parts = StringHelper::Split(includePath, "/"); - parts.erase(parts.begin(), parts.begin() + 2); - includePath = StringHelper::Join(parts, "/"); - } - - Declaration* decl = GetDeclaration(address); - if (decl == nullptr) - { - decl = Declaration::CreateInclude(address, includePath, size, varType, varName); - - decl->isArray = true; - decl->arrayItemCnt = arrayItemCnt; - - declarations[address] = decl; - } - else - { - decl->includePath = includePath; - decl->declType = varType; - decl->declName = varName; - decl->size = size; - decl->isArray = true; - decl->arrayItemCnt = arrayItemCnt; - } - return decl; -} - -Declaration* ZFile::AddDeclarationIncludeArray(offset_t address, std::string& includePath, - size_t size, const std::string& varType, - const std::string& varName, - const std::string& defines, size_t arrayItemCnt) -{ - bool validOffset = DeclarationSanityChecks(address, varName); - if (!validOffset) - return nullptr; - - if (StringHelper::StartsWith(includePath, "assets/extracted/")) - includePath = "assets/" + StringHelper::Split(includePath, "assets/extracted/")[1]; - if (StringHelper::StartsWith(includePath, "assets/custom/")) - includePath = "assets/" + StringHelper::Split(includePath, "assets/custom/")[1]; - // Hack for OOT: don't prefix include paths with extracted/VERSION/ - if (StringHelper::StartsWith(includePath, "extracted/")) { - std::vector parts = StringHelper::Split(includePath, "/"); - parts.erase(parts.begin(), parts.begin() + 2); - includePath = StringHelper::Join(parts, "/"); - } - - Declaration* decl = GetDeclaration(address); - if (decl == nullptr) - { - decl = Declaration::CreateInclude(address, includePath, size, varType, varName, defines); - - decl->isArray = true; - decl->arrayItemCnt = arrayItemCnt; - - declarations[address] = decl; - } - else - { - decl->includePath = includePath; - decl->declType = varType; - decl->declName = varName; - decl->defines = defines; - decl->size = size; - decl->isArray = true; - decl->arrayItemCnt = arrayItemCnt; - } - return decl; -} - -bool ZFile::DeclarationSanityChecks(uint32_t address, const std::string& varName) -{ - assert(GETSEGNUM(address) == 0); - assert(varName != ""); -#ifdef DEVELOPMENT - if (address == 0x0000) - { - [[maybe_unused]] int32_t bp = 0; - } -#endif - - if (!IsOffsetInFileRange(address)) - { - fprintf(stderr, - "%s: Warning in %s\n" - "\t Tried to declare a variable outside of this file's range. Ignoring...\n" - "\t\t Variable's name: %s\n" - "\t\t Variable's offset: 0x%06X\n", - __PRETTY_FUNCTION__, name.c_str(), varName.c_str(), address); - return false; - } - - return true; -} - -bool ZFile::GetDeclarationPtrName(segptr_t segAddress, const std::string& expectedType, - std::string& declName) const -{ - if (segAddress == 0) - { - declName = "NULL"; - return true; - } - - uint32_t offset = Seg2Filespace(segAddress, baseAddress); - Declaration* decl = GetDeclaration(offset); - if (GETSEGNUM(segAddress) != segment || decl == nullptr) - { - declName = StringHelper::Sprintf("0x%08X", segAddress); - return false; - } - - if (expectedType != "" && expectedType != "void*") - { - if (expectedType != decl->declType && "static " + expectedType != decl->declType) - { - declName = StringHelper::Sprintf("0x%08X", segAddress); - return false; - } - } - - if (!decl->isArray) - declName = "&" + decl->declName; - else - declName = decl->declName; - return true; -} - -bool ZFile::GetDeclarationArrayIndexedName(segptr_t segAddress, size_t elementSize, - const std::string& expectedType, - std::string& declName) const -{ - if (segAddress == 0) - { - declName = "NULL"; - return true; - } - - uint32_t address = Seg2Filespace(segAddress, baseAddress); - Declaration* decl = GetDeclarationRanged(address); - if (GETSEGNUM(segAddress) != segment || decl == nullptr || !decl->isArray) - { - declName = StringHelper::Sprintf("0x%08X", segAddress); - return false; - } - - if (expectedType != "" && expectedType != "void*") - { - if (expectedType != decl->declType && "static " + expectedType != decl->declType) - { - declName = StringHelper::Sprintf("0x%08X", segAddress); - return false; - } - } - - if (decl->address == address) - { - declName = decl->declName; - return true; - } - - if ((address - decl->address) % elementSize != 0 || !(address < decl->address + decl->size)) - { - declName = StringHelper::Sprintf("0x%08X", segAddress); - return false; - } - - uint32_t index = (address - decl->address) / elementSize; - declName = StringHelper::Sprintf("&%s[%u]", decl->declName.c_str(), index); - return true; -} - -Declaration* ZFile::GetDeclaration(offset_t address) const -{ - if (declarations.find(address) != declarations.end()) - return declarations.at(address); - - return nullptr; -} - -Declaration* ZFile::GetDeclarationRanged(offset_t address) const -{ - for (const auto decl : declarations) - { - if (address >= decl.first && address < decl.first + decl.second->size) - return decl.second; - } - - return nullptr; -} - -bool ZFile::HasDeclaration(offset_t address) -{ - assert(GETSEGNUM(address) == 0); - return declarations.find(address) != declarations.end(); -} - -size_t ZFile::GetDeclarationSizeFromNeighbor(uint32_t declarationAddress) -{ - auto currentDecl = declarations.find(declarationAddress); - if (currentDecl == declarations.end()) - return 0; - - auto nextDecl = currentDecl; - std::advance(nextDecl, 1); - if (nextDecl == declarations.end()) - return GetRawData().size() - currentDecl->first; - - return nextDecl->first - currentDecl->first; -} - -void ZFile::GenerateSourceFiles() -{ - std::string sourceOutput; - - sourceOutput += "#include \"ultra64.h\"\n"; - sourceOutput += "#include \"z64.h\"\n"; - sourceOutput += "#include \"macros.h\"\n"; - sourceOutput += GetHeaderInclude(); - - bool hasZRoom = false; - for (const auto& res : resources) - { - ZResourceType resType = res->GetResourceType(); - if (resType == ZResourceType::Room || resType == ZResourceType::Scene || - resType == ZResourceType::AltHeader) - { - hasZRoom = true; - break; - } - } - - if (hasZRoom) - { - sourceOutput += GetZRoomHeaderInclude(); - } - - sourceOutput += GetExternalFileHeaderInclude(); - - GeneratePlaceholderDeclarations(); - - // Generate Code - for (size_t i = 0; i < resources.size(); i++) - { - ZResource* res = resources.at(i); - res->GetSourceOutputCode(name); - } - - sourceOutput += ProcessDeclarations(); - - fs::path outPath = GetSourceOutputFolderPath() / outName.stem().concat(".c"); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - printf("Writing C file: %s\n", outPath.c_str()); - - OutputFormatter formatter; - formatter.Write(sourceOutput); - - File::WriteAllText(outPath, formatter.GetOutput()); - - GenerateSourceHeaderFiles(); -} - -void ZFile::GenerateSourceHeaderFiles() -{ - OutputFormatter formatter; - - std::string guard = StringHelper::ToUpper(outName.stem().string()); - - formatter.Write( - StringHelper::Sprintf("#ifndef %s_H\n#define %s_H 1\n\n", guard.c_str(), guard.c_str())); - - for (ZResource* res : resources) - { - std::string resSrc = res->GetSourceOutputHeader(""); - formatter.Write(resSrc); - - if (resSrc != "") - formatter.Write("\n"); - } - - for (auto& sym : symbolResources) - { - formatter.Write(sym.second->GetSourceOutputHeader("")); - } - - formatter.Write(ProcessExterns()); - - formatter.Write("#endif\n"); - - fs::path headerFilename = GetSourceOutputFolderPath() / outName.stem().concat(".h"); - - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) - printf("Writing H file: %s\n", headerFilename.c_str()); - - File::WriteAllText(headerFilename, formatter.GetOutput()); -} - -std::string ZFile::GetHeaderInclude() const -{ - std::string headers = StringHelper::Sprintf( - "#include \"%s.h\"\n", (outName.parent_path() / outName.stem()).string().c_str()); - - return headers; -} - -std::string ZFile::GetZRoomHeaderInclude() const -{ - std::string headers; - headers += "#include \"segment_symbols.h\"\n"; - headers += "#include \"command_macros_base.h\"\n"; - headers += "#include \"z64cutscene_commands.h\"\n"; - headers += "#include \"variables.h\"\n"; - return headers; -} - -std::string ZFile::GetExternalFileHeaderInclude() const -{ - std::string externalFilesIncludes = ""; - - for (ZFile* externalFile : Globals::Instance->files) - { - if (externalFile != this) - { - fs::path outputFolderPath = externalFile->GetSourceOutputFolderPath(); - if (outputFolderPath == this->GetSourceOutputFolderPath()) - outputFolderPath = externalFile->outName.stem(); - else - outputFolderPath /= externalFile->outName.stem(); - - externalFilesIncludes += - StringHelper::Sprintf("#include \"%s.h\"\n", outputFolderPath.string().c_str()); - } - } - - return externalFilesIncludes; -} - -void ZFile::GeneratePlaceholderDeclarations() -{ - // Generate placeholder declarations - for (ZResource* res : resources) - { - if (GetDeclaration(res->GetRawDataIndex()) != nullptr) - { - continue; - } - - Declaration* decl = res->DeclareVar(GetName(), ""); - decl->staticConf = res->GetStaticConf(); - if (res->GetResourceType() == ZResourceType::Symbol) - { - decl->staticConf = StaticConfig::Off; - } - } -} - -void ZFile::AddTextureResource(uint32_t offset, ZTexture* tex) -{ - for (auto res : resources) - assert(res->GetRawDataIndex() != offset); - - resources.push_back(tex); - texturesResources[offset] = tex; -} - -ZTexture* ZFile::GetTextureResource(uint32_t offset) const -{ - auto tex = texturesResources.find(offset); - if (tex != texturesResources.end()) - return tex->second; - - return nullptr; -} - -void ZFile::AddSymbolResource(uint32_t offset, ZSymbol* sym) -{ - symbolResources[offset] = sym; -} - -ZSymbol* ZFile::GetSymbolResource(uint32_t offset) const -{ - auto sym = symbolResources.find(offset); - if (sym != symbolResources.end()) - return sym->second; - - return nullptr; -} - -ZSymbol* ZFile::GetSymbolResourceRanged(uint32_t offset) const -{ - for (const auto decl : symbolResources) - { - if (offset >= decl.first && offset < decl.first + decl.second->GetRawDataSize()) - return decl.second; - } - - return nullptr; -} - -fs::path ZFile::GetSourceOutputFolderPath() const -{ - return outputPath / outName.parent_path(); -} - -bool ZFile::IsOffsetInFileRange(uint32_t offset) const -{ - if (!(offset < rawData.size())) - return false; - - return rangeStart <= offset && offset < rangeEnd; -} -bool ZFile::IsSegmentedInFilespaceRange(segptr_t segAddress) const -{ - uint8_t segnum = GETSEGNUM(segAddress); - uint32_t offset = Seg2Filespace(segAddress, baseAddress); - - if (segment != segnum) - return false; - - return IsOffsetInFileRange(offset); -} - -std::map* ZFile::GetNodeMap() -{ - static std::map nodeMap; - return &nodeMap; -} - -void ZFile::RegisterNode(std::string nodeName, ZResourceFactoryFunc* nodeFunc) -{ - std::map* nodeMap = GetNodeMap(); - (*nodeMap)[nodeName] = nodeFunc; -} - -std::string ZFile::ProcessDeclarations() -{ - std::string output; - - if (declarations.size() == 0) - return output; - - defines += ProcessTextureIntersections(name); - - // printf("RANGE START: 0x%06X - RANGE END: 0x%06X\n", rangeStart, rangeEnd); - - MergeNeighboringDeclarations(); - - for (std::pair item : declarations) - ProcessDeclarationText(item.second); - - for (std::pair item : declarations) - { - while (item.second->size % 4 != 0) - item.second->size++; - } - - HandleUnaccountedData(); - - // Go through include declarations - // First, handle the prototypes (static only for now) - for (std::pair item : declarations) - { - output += item.second->GetStaticForwardDeclarationStr(); - } - - output += "\n"; - - // Next, output the actual declarations - for (const auto& item : declarations) - { - if (!IsOffsetInFileRange(item.first)) - continue; - - if (item.second->includePath != "") - { - if (item.second->isExternal) - { - // HACK - std::string extType; - - if (item.second->declType == "Gfx") - extType = "dlist"; - else if (item.second->declType == "Vtx") - extType = "vtx"; - - auto filepath = outputPath / item.second->declName; - File::WriteAllText( - StringHelper::Sprintf("%s.%s.inc", filepath.string().c_str(), extType.c_str()), - item.second->declBody); - } - - output += item.second->GetExternalDeclarationStr(); - } - else if (item.second->declType != "") - { - output += item.second->GetNormalDeclarationStr(); - } - } - - return output; -} - -void ZFile::MergeNeighboringDeclarations() -{ - // Optimization: See if there are any arrays side by side that can be merged... - std::vector> declarationKeys(declarations.begin(), - declarations.end()); - - std::pair lastItem = declarationKeys.at(0); - - for (size_t i = 1; i < declarationKeys.size(); i++) - { - std::pair curItem = declarationKeys[i]; - - if (curItem.second->isArray && lastItem.second->isArray) - { - if (curItem.second->declType == lastItem.second->declType) - { - if (!curItem.second->declaredInXml && !lastItem.second->declaredInXml) - { - // TEST: For now just do Vtx declarations... - if (lastItem.second->declType == "Vtx") - { - int32_t sizeDiff = curItem.first - (lastItem.first + lastItem.second->size); - - // Make sure there isn't an unaccounted inbetween these two - if (sizeDiff == 0) - { - lastItem.second->size += curItem.second->size; - lastItem.second->arrayItemCnt += curItem.second->arrayItemCnt; - lastItem.second->declBody += "\n" + curItem.second->declBody; - declarations.erase(curItem.first); - declarationKeys.erase(declarationKeys.begin() + i); - delete curItem.second; - i--; - continue; - } - } - } - } - } - - lastItem = curItem; - } -} - -void ZFile::ProcessDeclarationText(Declaration* decl) -{ - size_t refIndex = 0; - - if (!(decl->references.size() > 0)) - return; - - for (size_t i = 0; i < decl->declBody.size() - 1; i++) - { - char c = decl->declBody[i]; - char c2 = decl->declBody[i + 1]; - - if (c == '@' && c2 == 'r') - { - std::string vtxName; - Globals::Instance->GetSegmentedArrayIndexedName(decl->references[refIndex], 0x10, this, - "Vtx", vtxName); - decl->declBody.replace(i, 2, vtxName); - - refIndex++; - - if (refIndex >= decl->references.size()) - break; - } - } -} - -std::string ZFile::ProcessExterns() -{ - std::string output = ""; - bool hadDefines = true; // Previous declaration included defines. - - for (const auto& item : declarations) - { - if (!IsOffsetInFileRange(item.first)) - { - continue; - } - - std::string itemDefines = item.second->GetDefinesStr(); - // Add a newline above if previous has no defines and this one does. - if (!hadDefines && (itemDefines.length() > 0)) - { - output.push_back('\n'); - } - output += item.second->GetExternStr(); - output += itemDefines; - - // Newline below if this one has defines. - if ((hadDefines = (itemDefines.length() > 0))) - { - output.push_back('\n'); - } - } - - output += defines; - - return output; -} - -std::string ZFile::ProcessTextureIntersections([[maybe_unused]] const std::string& prefix) -{ - if (texturesResources.empty()) - return ""; - - std::string defines; - std::vector> texturesSorted(texturesResources.begin(), - texturesResources.end()); - - for (size_t i = 0; i < texturesSorted.size() - 1; i++) - { - uint32_t currentOffset = texturesSorted[i].first; - uint32_t nextOffset = texturesSorted[i + 1].first; - auto& currentTex = texturesResources.at(currentOffset); - int texSize = currentTex->GetRawDataSize(); - - if (currentTex->WasDeclaredInXml()) - { - // We believe the user is right. - continue; - } - - if ((currentOffset + texSize) > nextOffset) - { - uint32_t offsetDiff = nextOffset - currentOffset; - if (currentTex->isPalette) - { - // Shrink palette so it doesn't overlap - currentTex->SetDimensions(offsetDiff / currentTex->GetPixelMultiplyer(), 1); - declarations.at(currentOffset)->size = currentTex->GetRawDataSize(); - currentTex->DeclareVar(GetName(), ""); - } - else - { - std::string texName; - std::string texNextName; - GetDeclarationPtrName(currentOffset, "", texName); - - Declaration* nextDecl = GetDeclaration(nextOffset); - if (nextDecl == nullptr) - texNextName = texturesResources.at(nextOffset)->GetName(); - else - texNextName = nextDecl->declName; - - defines += StringHelper::Sprintf("#define %s ((u32)%s + 0x%06X)\n", - texNextName.c_str(), texName.c_str(), offsetDiff); - - delete declarations[nextOffset]; - declarations.erase(nextOffset); - texturesResources.erase(nextOffset); - texturesSorted.erase(texturesSorted.begin() + i + 1); - - i--; - } - } - } - - return defines; -} - -void ZFile::HandleUnaccountedData() -{ - uint32_t lastAddr = 0; - uint32_t lastSize = 0; - std::vector declsAddresses; - - declsAddresses.reserve(declarations.size()); - for (const auto& item : declarations) - { - declsAddresses.push_back(item.first); - } - - bool breakLoop = false; - for (offset_t currentAddress : declsAddresses) - { - if (currentAddress >= rangeEnd) - { - breakLoop = true; - break; - } - - if (currentAddress < rangeStart) - { - lastAddr = currentAddress; - continue; - } - - breakLoop = HandleUnaccountedAddress(currentAddress, lastAddr, lastSize); - if (breakLoop) - break; - - lastAddr = currentAddress; - } - - if (!breakLoop) - { - // TODO: change rawData.size() to rangeEnd - // HandleUnaccountedAddress(rangeEnd, lastAddr, lastSize); - HandleUnaccountedAddress(rawData.size(), lastAddr, lastSize); - } -} - -bool ZFile::HandleUnaccountedAddress(offset_t currentAddress, offset_t lastAddr, uint32_t& lastSize) -{ - if (currentAddress != lastAddr && declarations.find(lastAddr) != declarations.end()) - { - Declaration* lastDecl = declarations.at(lastAddr); - lastSize = lastDecl->size; - - if (lastAddr + lastSize > currentAddress) - { - Declaration* currentDecl = declarations.at(currentAddress); - - std::string intersectionInfo = StringHelper::Sprintf( - "Resource from 0x%06X:0x%06X (%s) conflicts with 0x%06X (%s).", lastAddr, - lastAddr + lastSize, lastDecl->declName.c_str(), currentAddress, - currentDecl->declName.c_str()); - HANDLE_WARNING_RESOURCE(WarningType::Intersection, this, nullptr, currentAddress, - "intersection detected", intersectionInfo); - } - } - - uint32_t unaccountedAddress = lastAddr + lastSize; - - if (unaccountedAddress != currentAddress && lastAddr >= rangeStart && - unaccountedAddress < rangeEnd) - { - int diff = currentAddress - unaccountedAddress; - bool nonZeroUnaccounted = false; - - std::string src = " "; - - if (currentAddress > rawData.size()) - { - throw std::runtime_error(StringHelper::Sprintf( - "ZFile::ProcessDeclarations(): Fatal error while processing XML '%s'.\n" - "\t Offset '0x%X' is outside of the limits of file '%s', which has a size of " - "'0x%X'.\n" - "\t Aborting...", - xmlFilePath.c_str(), currentAddress, name.c_str(), rawData.size())); - } - - // Handle Align8 - if (currentAddress % 8 == 0 && diff % 8 != 0) - { - Declaration* currentDecl = GetDeclaration(currentAddress); - - if (currentDecl != nullptr) - { - if (currentDecl->alignment == DeclarationAlignment::Align8) - { - // Check removed bytes are zeroes - if (BitConverter::ToUInt32BE(rawData, unaccountedAddress + diff - 4) == 0) - { - diff -= 4; - } - } - - if (diff == 0) - { - return false; - } - } - } - - for (int i = 0; i < diff; i++) - { - uint8_t val = rawData.at(unaccountedAddress + i); - src += StringHelper::Sprintf("0x%02X, ", val); - if (val != 0x00) - { - nonZeroUnaccounted = true; - } - - if (Globals::Instance->verboseUnaccounted) - { - if ((i % 4 == 3)) - { - src += StringHelper::Sprintf(" // 0x%06X", unaccountedAddress + i - 3); - if (i != (diff - 1)) - { - src += "\n\t"; - } - } - } - else - { - if ((i % 16 == 15) && (i != (diff - 1))) - src += "\n "; - } - } - - if (declarations.find(unaccountedAddress) == declarations.end() && diff > 0) - { - std::string unaccountedPrefix = "unaccounted"; - - if (diff < 16 && !nonZeroUnaccounted) - { - unaccountedPrefix = "possiblePadding"; - - // Strip unnecessary padding at the end of the file. - if (unaccountedAddress + diff >= rawData.size()) - return true; - } - - Declaration* decl = AddDeclarationArray( - unaccountedAddress, DeclarationAlignment::Align4, diff, "u8", - StringHelper::Sprintf("%s_%s_%06X", name.c_str(), unaccountedPrefix.c_str(), - unaccountedAddress), - diff, src); - - decl->isUnaccounted = true; - if (Globals::Instance->forceUnaccountedStatic) - decl->staticConf = StaticConfig::On; - - if (nonZeroUnaccounted) - { - HANDLE_WARNING_RESOURCE(WarningType::Unaccounted, this, nullptr, unaccountedAddress, - "a non-zero unaccounted block was found", - StringHelper::Sprintf("Block size: '0x%X'", diff)); - } - else if (diff >= 16) - { - HANDLE_WARNING_RESOURCE(WarningType::Unaccounted, this, nullptr, unaccountedAddress, - "a big (size>=0x10) zero-only unaccounted block was found", - StringHelper::Sprintf("Block size: '0x%X'", diff)); - } - } - } - - return false; -} diff --git a/tools/ZAPD/ZAPD/ZFile.h b/tools/ZAPD/ZAPD/ZFile.h deleted file mode 100644 index 65b1cc4aa3..0000000000 --- a/tools/ZAPD/ZAPD/ZFile.h +++ /dev/null @@ -1,144 +0,0 @@ -#pragma once - -#include -#include - -#include "ZSymbol.h" -#include "ZTexture.h" -#include "tinyxml2.h" - -enum class ZFileMode -{ - BuildTexture, - BuildOverlay, - BuildBlob, - BuildSourceFile, - BuildBackground, - Extract, - ExternalFile, - Invalid, - Custom = 1000, // Used for exporter file modes -}; - -enum class ZGame -{ - OOT_RETAIL, - OOT_SW97, - MM_RETAIL -}; - -class ZFile -{ -public: - std::map declarations; - std::vector resources; - std::string defines; - - // Default to using virtual addresses - uint32_t segment = 0x80; - uint32_t baseAddress, rangeStart, rangeEnd; - bool isExternalFile = false; - // Whether to make defines for texture dimensions, and possibly more in future - bool makeDefines = false; - - ZFile(const fs::path& nOutPath, const std::string& nName); - ZFile(ZFileMode nMode, tinyxml2::XMLElement* reader, const fs::path& nBasePath, - const fs::path& nOutPath, const std::string& filename, const fs::path& nXmlFilePath); - ~ZFile(); - - std::string GetName() const; - std::string GetOutName() const; - ZFileMode GetMode() const; - const fs::path& GetXmlFilePath() const; - const std::vector& GetRawData() const; - void ExtractResources(); - void BuildSourceFile(); - void AddResource(ZResource* res); - ZResource* FindResource(offset_t rawDataIndex); - std::vector GetResourcesOfType(ZResourceType resType); - - Declaration* AddDeclaration(offset_t address, DeclarationAlignment alignment, size_t size, - const std::string& varType, const std::string& varName, - const std::string& body); - - Declaration* AddDeclarationArray(offset_t address, DeclarationAlignment alignment, size_t size, - const std::string& varType, const std::string& varName, - size_t arrayItemCnt, const std::string& body); - Declaration* AddDeclarationArray(offset_t address, DeclarationAlignment alignment, size_t size, - const std::string& varType, const std::string& varName, - const std::string& arrayItemCntStr, const std::string& body); - - Declaration* AddDeclarationPlaceholder(offset_t address, const std::string& varName); - - Declaration* AddDeclarationInclude(offset_t address, const std::string& includePath, - size_t size, const std::string& varType, - const std::string& varName); - Declaration* AddDeclarationIncludeArray(offset_t address, std::string& includePath, size_t size, - const std::string& varType, const std::string& varName, - size_t arrayItemCnt); - Declaration* AddDeclarationIncludeArray(offset_t address, std::string& includePath, size_t size, - const std::string& varType, const std::string& varName, - const std::string& defines, size_t arrayItemCnt); - - bool GetDeclarationPtrName(segptr_t segAddress, const std::string& expectedType, - std::string& declName) const; - bool GetDeclarationArrayIndexedName(segptr_t segAddress, size_t elementSize, - const std::string& expectedType, - std::string& declName) const; - - Declaration* GetDeclaration(offset_t address) const; - Declaration* GetDeclarationRanged(offset_t address) const; - bool HasDeclaration(offset_t address); - size_t GetDeclarationSizeFromNeighbor(uint32_t declarationAddress); - - std::string GetHeaderInclude() const; - std::string GetZRoomHeaderInclude() const; - std::string GetExternalFileHeaderInclude() const; - - void GeneratePlaceholderDeclarations(); - - void AddTextureResource(uint32_t offset, ZTexture* tex); - ZTexture* GetTextureResource(uint32_t offset) const; - - void AddSymbolResource(uint32_t offset, ZSymbol* sym); - ZSymbol* GetSymbolResource(uint32_t offset) const; - ZSymbol* GetSymbolResourceRanged(uint32_t offset) const; - - fs::path GetSourceOutputFolderPath() const; - - bool IsOffsetInFileRange(uint32_t offset) const; - bool IsSegmentedInFilespaceRange(segptr_t segAddress) const; - - static std::map* GetNodeMap(); - static void RegisterNode(std::string nodeName, ZResourceFactoryFunc* nodeFunc); - -protected: - std::vector rawData; - std::string name; - fs::path outName = ""; - fs::path basePath; - fs::path outputPath; - fs::path xmlFilePath; - - // Keep track of every texture of this ZFile. - // The pointers declared here are "borrowed" (somebody else is the owner), - // so ZFile shouldn't delete/free those textures. - std::map texturesResources; - std::map symbolResources; - ZFileMode mode = ZFileMode::Invalid; - - ZFile(); - void ParseXML(tinyxml2::XMLElement* reader, const std::string& filename); - void DeclareResourceSubReferences(); - void GenerateSourceFiles(); - void GenerateSourceHeaderFiles(); - bool DeclarationSanityChecks(uint32_t address, const std::string& varName); - std::string ProcessDeclarations(); - void MergeNeighboringDeclarations(); - void ProcessDeclarationText(Declaration* decl); - std::string ProcessExterns(); - - std::string ProcessTextureIntersections(const std::string& prefix); - void HandleUnaccountedData(); - bool HandleUnaccountedAddress(offset_t currentAddress, offset_t lastAddr, uint32_t& lastSize); -}; diff --git a/tools/ZAPD/ZAPD/ZLimb.cpp b/tools/ZAPD/ZAPD/ZLimb.cpp deleted file mode 100644 index b3acb940c1..0000000000 --- a/tools/ZAPD/ZAPD/ZLimb.cpp +++ /dev/null @@ -1,412 +0,0 @@ -#include "ZLimb.h" - -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZSkeleton.h" - -REGISTER_ZFILENODE(Limb, ZLimb); - -ZLimb::ZLimb(ZFile* nParent) : ZResource(nParent), segmentStruct(nParent) -{ - RegisterOptionalAttribute("EnumName"); - RegisterOptionalAttribute("LimbType"); - RegisterOptionalAttribute("Type"); -} - -void ZLimb::ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nType) -{ - rawDataIndex = nRawDataIndex; - type = nType; - - // Don't parse raw data of external files - if (parent->GetMode() == ZFileMode::ExternalFile) - return; - - ParseRawData(); -} - -void ZLimb::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - auto& enumNameXml = registeredAttributes.at("EnumName").value; - if (enumNameXml != "") - { - enumName = enumNameXml; - } - - // Reading from a - std::string limbType = registeredAttributes.at("LimbType").value; - if (limbType == "") // Reading from a - limbType = registeredAttributes.at("Type").value; - - if (limbType == "") - { - HANDLE_ERROR_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex, - "missing 'LimbType' attribute in ", ""); - } - - type = GetTypeByAttributeName(limbType); - if (type == ZLimbType::Invalid) - { - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - "invalid value found for 'LimbType' attribute", ""); - } -} - -void ZLimb::ParseRawData() -{ - ZResource::ParseRawData(); - const auto& rawData = parent->GetRawData(); - - if (type == ZLimbType::Curve) - { - childIndex = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0); - siblingIndex = BitConverter::ToUInt8BE(rawData, rawDataIndex + 1); - - dListPtr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); - dList2Ptr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); - return; - } - if (type == ZLimbType::Legacy) - { - dListPtr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x00); - legTransX = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x04); - legTransY = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x08); - legTransZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x0C); - rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x10); - rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x12); - rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x14); - childPtr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x18); - siblingPtr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x1C); - return; - } - - transX = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - transY = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - transZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - - childIndex = rawData.at(rawDataIndex + 6); - siblingIndex = rawData.at(rawDataIndex + 7); - - switch (type) - { - case ZLimbType::LOD: - dList2Ptr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12); - [[fallthrough]]; - case ZLimbType::Standard: - dListPtr = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); - break; - - case ZLimbType::Skin: - skinSegmentType = - static_cast(BitConverter::ToInt32BE(rawData, rawDataIndex + 8)); - skinSegment = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12); - if (skinSegmentType == ZLimbSkinType::SkinType_Animated) - { - if (skinSegment != 0 && GETSEGNUM(skinSegment) == parent->segment) - { - uint32_t skinSegmentOffset = Seg2Filespace(skinSegment, parent->baseAddress); - segmentStruct.ExtractFromFile(skinSegmentOffset); - } - } - break; - - case ZLimbType::Curve: - case ZLimbType::Legacy: - break; - - case ZLimbType::Invalid: - assert(!"whoops"); - break; - } -} - -void ZLimb::DeclareReferences(const std::string& prefix) -{ - std::string varPrefix = name; - if (varPrefix == "") - varPrefix = prefix; - - ZResource::DeclareReferences(varPrefix); - - std::string suffix; - switch (type) - { - case ZLimbType::Legacy: - if (childPtr != 0 && GETSEGNUM(childPtr) == parent->segment) - { - uint32_t childOffset = Seg2Filespace(childPtr, parent->baseAddress); - if (!parent->HasDeclaration(childOffset)) - { - ZLimb* child = new ZLimb(parent); - child->ExtractFromBinary(childOffset, ZLimbType::Legacy); - child->DeclareVar(varPrefix, ""); - child->DeclareReferences(varPrefix); - parent->AddResource(child); - } - } - if (siblingPtr != 0 && GETSEGNUM(siblingPtr) == parent->segment) - { - uint32_t siblingdOffset = Seg2Filespace(siblingPtr, parent->baseAddress); - if (!parent->HasDeclaration(siblingdOffset)) - { - ZLimb* sibling = new ZLimb(parent); - sibling->ExtractFromBinary(siblingdOffset, ZLimbType::Legacy); - sibling->DeclareVar(varPrefix, ""); - sibling->DeclareReferences(varPrefix); - parent->AddResource(sibling); - } - } - break; - - case ZLimbType::Curve: - case ZLimbType::LOD: - suffix = "Far"; - if (type == ZLimbType::Curve) - suffix = "Curve2"; - DeclareDList(dList2Ptr, varPrefix, suffix); - [[fallthrough]]; - case ZLimbType::Standard: - suffix = ""; - if (type == ZLimbType::Curve) - suffix = "Curve"; - DeclareDList(dListPtr, varPrefix, suffix); - break; - - case ZLimbType::Skin: - switch (skinSegmentType) - { - case ZLimbSkinType::SkinType_Animated: - if (skinSegment != 0 && GETSEGNUM(skinSegment) == parent->segment) - { - segmentStruct.DeclareReferences(varPrefix); - segmentStruct.GetSourceOutputCode(varPrefix); - } - break; - - case ZLimbSkinType::SkinType_Normal: - DeclareDList(skinSegment, varPrefix, ""); - break; - - default: - break; - } - break; - - case ZLimbType::Invalid: - break; - } -} - -size_t ZLimb::GetRawDataSize() const -{ - switch (type) - { - case ZLimbType::Standard: - case ZLimbType::Curve: - return 0x0C; - - case ZLimbType::LOD: - case ZLimbType::Skin: - return 0x10; - - case ZLimbType::Legacy: - return 0x20; - - case ZLimbType::Invalid: - break; - } - - return 0x0C; -} - -std::string ZLimb::GetBodySourceCode() const -{ - std::string dListStr; - std::string dListStr2; - Globals::Instance->GetSegmentedArrayIndexedName(dListPtr, 8, parent, "Gfx", dListStr); - Globals::Instance->GetSegmentedArrayIndexedName(dList2Ptr, 8, parent, "Gfx", dListStr2); - - std::string entryStr = "\n\t"; - if (type == ZLimbType::Legacy) - { - std::string childName; - std::string siblingName; - Globals::Instance->GetSegmentedPtrName(childPtr, parent, "LegacyLimb", childName); - Globals::Instance->GetSegmentedPtrName(siblingPtr, parent, "LegacyLimb", siblingName); - - entryStr += StringHelper::Sprintf("%s,\n", dListStr.c_str()); - entryStr += - StringHelper::Sprintf("\t{ %ff, %ff, %ff },\n", legTransX, legTransY, legTransZ); - entryStr += StringHelper::Sprintf("\t{ 0x%04X, 0x%04X, 0x%04X },\n", rotX, rotY, rotZ); - entryStr += StringHelper::Sprintf("\t%s,\n", childName.c_str()); - entryStr += StringHelper::Sprintf("\t%s\n", siblingName.c_str()); - } - else - { - std::string childStr; - std::string siblingStr; - if (limbsTable != nullptr) - { - childStr = limbsTable->GetLimbEnumName(childIndex); - siblingStr = limbsTable->GetLimbEnumName(siblingIndex); - } - else - { - childStr = StringHelper::Sprintf("0x%02X", childIndex); - siblingStr = StringHelper::Sprintf("0x%02X", siblingIndex); - } - - if (type != ZLimbType::Curve) - { - entryStr += StringHelper::Sprintf("{ %i, %i, %i }, ", transX, transY, transZ); - } - entryStr += StringHelper::Sprintf("%s, %s,\n", childStr.c_str(), siblingStr.c_str()); - - switch (type) - { - case ZLimbType::Standard: - entryStr += StringHelper::Sprintf("\t%s\n", dListStr.c_str()); - break; - - case ZLimbType::LOD: - case ZLimbType::Curve: - entryStr += - StringHelper::Sprintf("\t{ %s, %s }\n", dListStr.c_str(), dListStr2.c_str()); - break; - - case ZLimbType::Skin: - { - std::string skinSegmentStr; - Globals::Instance->GetSegmentedPtrName(skinSegment, parent, "", skinSegmentStr); - entryStr += - StringHelper::Sprintf("\t0x%02X, %s\n", skinSegmentType, skinSegmentStr.c_str()); - } - break; - - case ZLimbType::Legacy: - break; - - case ZLimbType::Invalid: - break; - } - } - - return entryStr; -} - -std::string ZLimb::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sLimb_%06X", prefix.c_str(), rawDataIndex); -} - -std::string ZLimb::GetSourceTypeName() const -{ - return GetSourceTypeName(type); -} - -ZResourceType ZLimb::GetResourceType() const -{ - return ZResourceType::Limb; -} - -ZLimbType ZLimb::GetLimbType() -{ - return type; -} - -void ZLimb::SetLimbType(ZLimbType value) -{ - type = value; -} - -const char* ZLimb::GetSourceTypeName(ZLimbType limbType) -{ - switch (limbType) - { - case ZLimbType::Standard: - return "StandardLimb"; - - case ZLimbType::LOD: - return "LodLimb"; - - case ZLimbType::Skin: - return "SkinLimb"; - - case ZLimbType::Curve: - return "SkelCurveLimb"; - - case ZLimbType::Legacy: - return "LegacyLimb"; - - default: - return "StandardLimb"; - } -} - -ZLimbType ZLimb::GetTypeByAttributeName(const std::string& attrName) -{ - if (attrName == "Standard") - { - return ZLimbType::Standard; - } - if (attrName == "LOD") - { - return ZLimbType::LOD; - } - if (attrName == "Skin") - { - return ZLimbType::Skin; - } - if (attrName == "Curve") - { - return ZLimbType::Curve; - } - if (attrName == "Legacy") - { - return ZLimbType::Legacy; - } - return ZLimbType::Invalid; -} - -void ZLimb::SetLimbIndex(uint8_t nLimbIndex) -{ - limbIndex = nLimbIndex; -} - -void ZLimb::DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix, - const std::string& limbSuffix) -{ - if (dListSegmentedPtr == 0 || GETSEGNUM(dListSegmentedPtr) != parent->segment) - return; - - uint32_t dlistOffset = Seg2Filespace(dListSegmentedPtr, parent->baseAddress); - if (parent->HasDeclaration(dlistOffset)) - return; - - if (!parent->IsOffsetInFileRange(dlistOffset) || dlistOffset >= parent->GetRawData().size()) - return; - - std::string dlistName; - bool declFound = Globals::Instance->GetSegmentedArrayIndexedName(dListSegmentedPtr, 8, parent, - "Gfx", dlistName, false); - if (declFound) - return; - - int32_t dlistLength = ZDisplayList::GetDListLength( - parent->GetRawData(), dlistOffset, - Globals::Instance->game == ZGame::OOT_SW97 ? DListType::F3DEX : DListType::F3DZEX); - ZDisplayList* dlist = new ZDisplayList(parent); - dlist->ExtractFromBinary(dlistOffset, dlistLength); - - std::string dListStr = - StringHelper::Sprintf("%s%sDL_%06X", prefix.c_str(), limbSuffix.c_str(), dlistOffset); - dlist->SetName(dListStr); - dlist->DeclareVar(prefix, ""); - parent->AddResource(dlist); -} diff --git a/tools/ZAPD/ZAPD/ZLimb.h b/tools/ZAPD/ZAPD/ZLimb.h deleted file mode 100644 index 52919bed92..0000000000 --- a/tools/ZAPD/ZAPD/ZLimb.h +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "OtherStructs/SkinLimbStructs.h" -#include "ZDisplayList.h" -#include "ZFile.h" - -enum class ZLimbType -{ - Invalid, - Standard, - LOD, - Skin, - Curve, - Legacy, -}; - -class ZLimbTable; - -class ZLimb : public ZResource -{ -public: - std::string enumName; - ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete! - - ZLimbType type = ZLimbType::Standard; - - ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_Null; // Skin only - segptr_t skinSegment = 0; // Skin only - SkinAnimatedLimbData segmentStruct; // Skin only - - // Legacy only - float legTransX, legTransY, legTransZ; // Vec3f - uint16_t rotX, rotY, rotZ; // Vec3s - segptr_t childPtr; // LegacyLimb* - segptr_t siblingPtr; // LegacyLimb* - - segptr_t dListPtr = 0; - segptr_t dList2Ptr = 0; // LOD and Curve Only - - int16_t transX, transY, transZ; - uint8_t childIndex, siblingIndex; - - uint8_t limbIndex = 0; - - ZLimb(ZFile* nParent); - - void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nType); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - size_t GetRawDataSize() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - ZLimbType GetLimbType(); - void SetLimbType(ZLimbType value); - static const char* GetSourceTypeName(ZLimbType limbType); - static ZLimbType GetTypeByAttributeName(const std::string& attrName); - - void SetLimbIndex(uint8_t nLimbIndex); - -protected: - void DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix, - const std::string& limbSuffix); -}; diff --git a/tools/ZAPD/ZAPD/ZMtx.cpp b/tools/ZAPD/ZAPD/ZMtx.cpp deleted file mode 100644 index b9ca3f22d2..0000000000 --- a/tools/ZAPD/ZAPD/ZMtx.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "ZMtx.h" - -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Mtx, ZMtx); - -ZMtx::ZMtx(ZFile* nParent) : ZResource(nParent) -{ -} - -void ZMtx::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - for (size_t i = 0; i < 4; ++i) - for (size_t j = 0; j < 4; ++j) - mtx[i][j] = BitConverter::ToInt32BE(rawData, rawDataIndex + (i * 4 + j) * 4); -} - -size_t ZMtx::GetRawDataSize() const -{ - return 64; -} - -std::string ZMtx::GetBodySourceCode() const -{ - std::string bodyStr = "\n"; - - for (const auto& row : mtx) - { - bodyStr += " "; - - for (int32_t val : row) - bodyStr += StringHelper::Sprintf("%-11i, ", val); - - bodyStr += "\n"; - } - - return bodyStr; -} - -std::string ZMtx::GetSourceTypeName() const -{ - return "Mtx"; -} - -ZResourceType ZMtx::GetResourceType() const -{ - return ZResourceType::Mtx; -} - -DeclarationAlignment ZMtx::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align8; -} diff --git a/tools/ZAPD/ZAPD/ZMtx.h b/tools/ZAPD/ZAPD/ZMtx.h deleted file mode 100644 index eed502374b..0000000000 --- a/tools/ZAPD/ZAPD/ZMtx.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include -#include -#include "ZResource.h" - -class ZMtx : public ZResource -{ -public: - ZMtx(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; - -protected: - std::array, 4> mtx; -}; diff --git a/tools/ZAPD/ZAPD/ZPath.cpp b/tools/ZAPD/ZAPD/ZPath.cpp deleted file mode 100644 index cb8295679f..0000000000 --- a/tools/ZAPD/ZAPD/ZPath.cpp +++ /dev/null @@ -1,218 +0,0 @@ -#include "ZPath.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Path, ZPath); // Old name that is being kept for backwards compatability -REGISTER_ZFILENODE(PathList, ZPath); // New name that may be used in future XMLs - -ZPath::ZPath(ZFile* nParent) : ZResource(nParent) -{ - numPaths = 1; - RegisterOptionalAttribute("NumPaths", "1"); -} - -void ZPath::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - numPaths = StringHelper::StrToL(registeredAttributes.at("NumPaths").value); - - if (numPaths < 1) - { - HANDLE_ERROR_RESOURCE( - WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - StringHelper::Sprintf("invalid value '%d' found for 'NumPaths' attribute", numPaths), - "Should be at least '1'"); - } -} - -void ZPath::ParseRawData() -{ - ZResource::ParseRawData(); - - uint32_t currentPtr = rawDataIndex; - - pathways.reserve(numPaths); - for (size_t pathIndex = 0; pathIndex < numPaths; pathIndex++) - { - PathwayEntry path(parent); - path.ExtractFromFile(currentPtr); - - if (path.GetListAddress() == 0) - break; - - currentPtr += path.GetRawDataSize(); - pathways.push_back(path); - } -} - -void ZPath::DeclareReferences(const std::string& prefix) -{ - ZResource::DeclareReferences(prefix); - - for (auto& entry : pathways) - entry.DeclareReferences(prefix); -} - -Declaration* ZPath::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), name, pathways.size(), bodyStr); - decl->staticConf = staticConf; - return decl; -} - -std::string ZPath::GetBodySourceCode() const -{ - std::string declaration; - - size_t index = 0; - for (const auto& entry : pathways) - { - declaration += StringHelper::Sprintf("\t{ %s },", entry.GetBodySourceCode().c_str()); - - if (index < pathways.size() - 1) - declaration += "\n"; - - index++; - } - - return declaration; -} - -std::string ZPath::GetSourceTypeName() const -{ - return "Path"; -} - -ZResourceType ZPath::GetResourceType() const -{ - return ZResourceType::Path; -} - -size_t ZPath::GetRawDataSize() const -{ - return pathways.size() * pathways.at(0).GetRawDataSize(); -} - -void ZPath::SetNumPaths(uint32_t nNumPaths) -{ - numPaths = nNumPaths; -} - -/* PathwayEntry */ - -PathwayEntry::PathwayEntry(ZFile* nParent) : ZResource(nParent) -{ -} - -void PathwayEntry::ParseRawData() -{ - ZResource::ParseRawData(); - auto parentRawData = parent->GetRawData(); - numPoints = parentRawData.at(rawDataIndex + 0); - unk1 = parentRawData.at(rawDataIndex + 1); - unk2 = BitConverter::ToInt16BE(parentRawData, rawDataIndex + 2); - listSegmentAddress = BitConverter::ToInt32BE(parentRawData, rawDataIndex + 4); - - uint32_t currentPtr = GETSEGOFFSET(listSegmentAddress); - - points.reserve(numPoints); - for (int32_t i = 0; i < numPoints; i++) - { - ZVector vec(parent); - vec.ExtractFromBinary(currentPtr, ZScalarType::ZSCALAR_S16, 3); - - currentPtr += vec.GetRawDataSize(); - points.push_back(vec); - } -} - -void PathwayEntry::DeclareReferences(const std::string& prefix) -{ - ZResource::DeclareReferences(prefix); - if (points.empty()) - return; - - std::string pointsName; - bool addressFound = Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", - pointsName, false); - if (addressFound) - return; - - std::string declaration = ""; - - size_t index = 0; - for (const auto& point : points) - { - declaration += StringHelper::Sprintf("\t{ %s },", point.GetBodySourceCode().c_str()); - - if (index < points.size() - 1) - declaration += "\n"; - - index++; - } - - uint32_t pointsOffset = Seg2Filespace(listSegmentAddress, parent->baseAddress); - Declaration* decl = parent->GetDeclaration(pointsOffset); - if (decl == nullptr) - { - pointsName = StringHelper::Sprintf("%sPathwayList_%06X", prefix.c_str(), pointsOffset); - parent->AddDeclarationArray(pointsOffset, points.at(0).GetDeclarationAlignment(), - points.size() * 6, points.at(0).GetSourceTypeName(), pointsName, - points.size(), declaration); - } - else - decl->declBody = declaration; -} - -std::string PathwayEntry::GetBodySourceCode() const -{ - std::string declaration; - std::string listName; - Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", listName); - - if (Globals::Instance->game == ZGame::MM_RETAIL) - declaration += - StringHelper::Sprintf("%i, %i, %i, %s", numPoints, unk1, unk2, listName.c_str()); - else - { - if (numPoints > 0) - declaration += - StringHelper::Sprintf("ARRAY_COUNT(%s), %s", listName.c_str(), listName.c_str()); - else - declaration += StringHelper::Sprintf("%i, %s", numPoints, listName.c_str()); - } - - return declaration; -} - -std::string PathwayEntry::GetSourceTypeName() const -{ - return "Path"; -} - -ZResourceType PathwayEntry::GetResourceType() const -{ - return ZResourceType::Path; -} - -size_t PathwayEntry::GetRawDataSize() const -{ - return 0x08; -} - -segptr_t PathwayEntry::GetListAddress() const -{ - return listSegmentAddress; -} diff --git a/tools/ZAPD/ZAPD/ZPath.h b/tools/ZAPD/ZAPD/ZPath.h deleted file mode 100644 index e519decff4..0000000000 --- a/tools/ZAPD/ZAPD/ZPath.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "ZResource.h" -#include "ZVector.h" - -class PathwayEntry : public ZResource -{ -public: - PathwayEntry(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - segptr_t GetListAddress() const; - -protected: - int32_t numPoints; - int8_t unk1; // (MM Only) - int16_t unk2; // (MM Only) - segptr_t listSegmentAddress; - std::vector points; -}; - -class ZPath : public ZResource -{ -public: - ZPath(ZFile* nParent); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - void SetNumPaths(uint32_t nNumPaths); - -protected: - uint32_t numPaths; - std::vector pathways; -}; diff --git a/tools/ZAPD/ZAPD/ZPlayerAnimationData.cpp b/tools/ZAPD/ZAPD/ZPlayerAnimationData.cpp deleted file mode 100644 index ce5425d7e1..0000000000 --- a/tools/ZAPD/ZAPD/ZPlayerAnimationData.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include "ZPlayerAnimationData.h" - -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(PlayerAnimationData, ZPlayerAnimationData); - -ZPlayerAnimationData::ZPlayerAnimationData(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("FrameCount"); -} - -void ZPlayerAnimationData::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string& frameCountXml = registeredAttributes.at("FrameCount").value; - - frameCount = StringHelper::StrToL(frameCountXml); -} - -void ZPlayerAnimationData::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - - size_t totalSize = GetRawDataSize(); - // Divided by 2 because each value is an s16 - limbRotData.reserve(totalSize * frameCount / 2); - - for (size_t i = 0; i < totalSize; i += 2) - { - limbRotData.push_back(BitConverter::ToInt16BE(rawData, rawDataIndex + i)); - } -} - -Declaration* ZPlayerAnimationData::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (auxName == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), name, limbRotData.size(), bodyStr); - decl->staticConf = staticConf; - return decl; -} - -std::string ZPlayerAnimationData::GetBodySourceCode() const -{ - std::string declaration = ""; - - size_t index = 0; - for (const auto entry : limbRotData) - { - if (index % 8 == 0) - { - declaration += "\t"; - } - - if (entry < 0) - { - declaration += StringHelper::Sprintf("-0x%04X, ", -entry); - } - else - { - declaration += StringHelper::Sprintf("0x%04X, ", entry); - } - - if ((index + 1) % 8 == 0) - { - declaration += "\n"; - } - - index++; - } - - return declaration; -} - -std::string ZPlayerAnimationData::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sPlayerAnimationData_%06X", prefix.c_str(), rawDataIndex); -} - -std::string ZPlayerAnimationData::GetSourceTypeName() const -{ - return "s16"; -} - -ZResourceType ZPlayerAnimationData::GetResourceType() const -{ - return ZResourceType::PlayerAnimationData; -} - -size_t ZPlayerAnimationData::GetRawDataSize() const -{ - // (sizeof(Vec3s) * limbCount + 2) * frameCount - return (6 * 22 + 2) * frameCount; -} diff --git a/tools/ZAPD/ZAPD/ZPlayerAnimationData.h b/tools/ZAPD/ZAPD/ZPlayerAnimationData.h deleted file mode 100644 index 2923117efc..0000000000 --- a/tools/ZAPD/ZAPD/ZPlayerAnimationData.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include -#include - -#include "ZResource.h" - -class ZPlayerAnimationData : public ZResource -{ -public: - int16_t frameCount = 0; - std::vector limbRotData; - - ZPlayerAnimationData(ZFile* nParent); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - - std::string GetBodySourceCode() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZPointer.cpp b/tools/ZAPD/ZAPD/ZPointer.cpp deleted file mode 100644 index 6e6945cada..0000000000 --- a/tools/ZAPD/ZAPD/ZPointer.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "ZPointer.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Pointer, ZPointer); - -ZPointer::ZPointer(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("Type"); -} - -void ZPointer::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - type = registeredAttributes.at("Type").value; -} - -void ZPointer::ParseRawData() -{ - auto& rawData = parent->GetRawData(); - - ptr = BitConverter::ToUInt32BE(rawData, rawDataIndex); -} - -std::string ZPointer::GetBodySourceCode() const -{ - std::string ptrName; - - Globals::Instance->GetSegmentedPtrName(ptr, parent, "", ptrName); - - return ptrName; -} - -bool ZPointer::DoesSupportArray() const -{ - return true; -} - -std::string ZPointer::GetSourceTypeName() const -{ - return type + "*"; -} - -ZResourceType ZPointer::GetResourceType() const -{ - return ZResourceType::Pointer; -} - -size_t ZPointer::GetRawDataSize() const -{ - return 0x04; -} diff --git a/tools/ZAPD/ZAPD/ZPointer.h b/tools/ZAPD/ZAPD/ZPointer.h deleted file mode 100644 index 8fb5889339..0000000000 --- a/tools/ZAPD/ZAPD/ZPointer.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "ZResource.h" - -class ZPointer : public ZResource -{ -public: - segptr_t ptr = SEGMENTED_NULL; - std::string type; - - ZPointer(ZFile* nParent); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - std::string GetBodySourceCode() const override; - - bool DoesSupportArray() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZResource.cpp b/tools/ZAPD/ZAPD/ZResource.cpp deleted file mode 100644 index d991c46539..0000000000 --- a/tools/ZAPD/ZAPD/ZResource.cpp +++ /dev/null @@ -1,339 +0,0 @@ -#include "ZResource.h" - -#include -#include - -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -ZResource::ZResource(ZFile* nParent) -{ - // assert(nParent != nullptr); - parent = nParent; - name = ""; - outName = ""; - sourceOutput = ""; - rawDataIndex = 0; - outputDeclaration = true; - - RegisterRequiredAttribute("Name"); - RegisterOptionalAttribute("OutName"); - RegisterOptionalAttribute("Offset"); - RegisterOptionalAttribute("Custom"); - RegisterOptionalAttribute("Static", "Global"); -} - -void ZResource::ExtractWithXML(tinyxml2::XMLElement* reader, offset_t nRawDataIndex) -{ - rawDataIndex = nRawDataIndex; - declaredInXml = true; - - if (reader != nullptr) - ParseXML(reader); - - // Don't parse raw data of external files - if (parent->GetMode() != ZFileMode::ExternalFile) - { - ParseRawData(); - CalcHash(); - } - - if (!isInner) - { - Declaration* decl = DeclareVar(parent->GetName(), ""); - if (decl != nullptr) - { - decl->declaredInXml = true; - decl->staticConf = staticConf; - } - } -} - -void ZResource::ExtractFromFile(offset_t nRawDataIndex) -{ - rawDataIndex = nRawDataIndex; - - // Don't parse raw data of external files - if (parent->GetMode() == ZFileMode::ExternalFile) - return; - - ParseRawData(); - CalcHash(); -} - -void ZResource::ParseXML(tinyxml2::XMLElement* reader) -{ - if (reader != nullptr) - { - // If it is an inner node, then 'Name' isn't required - if (isInner) - { - registeredAttributes.at("Name").isRequired = false; - } - - auto attrs = reader->FirstAttribute(); - while (attrs != nullptr) - { - std::string attrName = attrs->Name(); - bool attrDeclared = false; - - if (registeredAttributes.find(attrName) != registeredAttributes.end()) - { - registeredAttributes[attrName].value = attrs->Value(); - registeredAttributes[attrName].wasSet = true; - attrDeclared = true; - } - - if (!attrDeclared) - { - HANDLE_WARNING_RESOURCE( - WarningType::UnknownAttribute, parent, this, rawDataIndex, - StringHelper::Sprintf("unexpected '%s' attribute in resource <%s>", - attrName.c_str(), reader->Name()), - ""); - } - attrs = attrs->Next(); - } - - if (!canHaveInner && !reader->NoChildren()) - { - std::string errorHeader = StringHelper::Sprintf( - "resource '%s' with inner element/child detected", reader->Name()); - HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, ""); - } - - for (const auto& attr : registeredAttributes) - { - if (attr.second.isRequired && attr.second.value == "") - { - std::string headerMsg = - StringHelper::Sprintf("missing required attribute '%s' in resource <%s>", - attr.first.c_str(), reader->Name()); - HANDLE_ERROR_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex, - headerMsg, ""); - } - } - - name = registeredAttributes.at("Name").value; - - static std::regex r("[a-zA-Z_]+[a-zA-Z0-9_]*", std::regex::icase | std::regex::optimize); - - if (!isInner || (isInner && name != "")) - { - if (!std::regex_match(name, r)) - { - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, - rawDataIndex, "invalid value found for 'Name' attribute", ""); - } - } - - outName = registeredAttributes.at("OutName").value; - if (outName == "") - outName = name; - - isCustomAsset = registeredAttributes["Custom"].wasSet; - - std::string& staticXml = registeredAttributes["Static"].value; - if (staticXml == "Global") - { - staticConf = StaticConfig::Global; - } - else if (staticXml == "On") - { - staticConf = StaticConfig::On; - } - else if (staticXml == "Off") - { - staticConf = StaticConfig::Off; - } - else - { - HANDLE_ERROR_RESOURCE( - WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - StringHelper::Sprintf("invalid value '%s' for 'Static' attribute", staticConf), ""); - } - - declaredInXml = true; - } -} - -void ZResource::ParseRawData() -{ -} - -void ZResource::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ -} - -void ZResource::ParseRawDataLate() -{ -} - -void ZResource::DeclareReferencesLate([[maybe_unused]] const std::string& prefix) -{ -} - -Declaration* ZResource::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclaration(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), auxName, bodyStr); - decl->staticConf = staticConf; - return decl; -} - -void ZResource::Save([[maybe_unused]] const fs::path& outFolder) -{ -} - -const std::string& ZResource::GetName() const -{ - return name; -} - -const std::string& ZResource::GetOutName() const -{ - return outName; -} - -void ZResource::SetOutName(const std::string& nName) -{ - outName = nName; -} - -void ZResource::SetName(const std::string& nName) -{ - name = nName; -} - -bool ZResource::IsExternalResource() const -{ - return false; -} - -bool ZResource::DoesSupportArray() const -{ - return false; -} - -std::string ZResource::GetExternalExtension() const -{ - return ""; -} - -DeclarationAlignment ZResource::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align4; -} - -bool ZResource::WasDeclaredInXml() const -{ - return declaredInXml; -} - -StaticConfig ZResource::GetStaticConf() const -{ - return staticConf; -} - -offset_t ZResource::GetRawDataIndex() const -{ - return rawDataIndex; -} - -void ZResource::SetRawDataIndex(offset_t nRawDataIndex) -{ - rawDataIndex = nRawDataIndex; -} - -std::string ZResource::GetBodySourceCode() const -{ - return "ERROR"; -} - -std::string ZResource::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%s%s_%06X", prefix.c_str(), GetSourceTypeName().c_str(), - rawDataIndex); -} - -void ZResource::GetSourceOutputCode([[maybe_unused]] const std::string& prefix) -{ - std::string bodyStr = GetBodySourceCode(); - - if (bodyStr != "ERROR") - { - Declaration* decl = parent->GetDeclaration(rawDataIndex); - - if (decl == nullptr || decl->isPlaceholder) - decl = DeclareVar(prefix, bodyStr); - else - decl->declBody = bodyStr; - - decl->staticConf = staticConf; - } -} - -std::string ZResource::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix) -{ - return ""; -} - -ZResourceType ZResource::GetResourceType() const -{ - return ZResourceType::Error; -} - -void ZResource::CalcHash() -{ - hash = 0; -} - -void ZResource::SetInnerNode(bool inner) -{ - isInner = inner; -} - -void ZResource::RegisterRequiredAttribute(const std::string& attr) -{ - ResourceAttribute resAtrr; - resAtrr.key = attr; - resAtrr.isRequired = true; - registeredAttributes[attr] = resAtrr; -} - -void ZResource::RegisterOptionalAttribute(const std::string& attr, const std::string& defaultValue) -{ - ResourceAttribute resAtrr; - resAtrr.key = attr; - resAtrr.value = defaultValue; - registeredAttributes[attr] = resAtrr; -} - -offset_t Seg2Filespace(segptr_t segmentedAddress, uint32_t parentBaseAddress) -{ - offset_t currentPtr = GETSEGOFFSET(segmentedAddress); - - if (GETSEGNUM(segmentedAddress) == 0x80) // Is defined in code? - { - uint32_t parentBaseOffset = GETSEGOFFSET(parentBaseAddress); - if (parentBaseOffset > currentPtr) - { - HANDLE_ERROR(WarningType::Always, - StringHelper::Sprintf( - "resource address 0x%08X is smaller than 'BaseAddress' 0x%08X", - segmentedAddress, parentBaseAddress), - "Maybe your 'BaseAddress' is wrong?"); - } - - currentPtr -= parentBaseOffset; - } - - return currentPtr; -} diff --git a/tools/ZAPD/ZAPD/ZResource.h b/tools/ZAPD/ZAPD/ZResource.h deleted file mode 100644 index 768b785441..0000000000 --- a/tools/ZAPD/ZAPD/ZResource.h +++ /dev/null @@ -1,263 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include "Declaration.h" -#include "Utils/BinaryWriter.h" -#include "Utils/Directory.h" -#include "tinyxml2.h" - -#define SEGMENT_SCENE 2 -#define SEGMENT_ROOM 3 -#define SEGMENT_KEEP 4 -#define SEGMENT_FIELDDANGEON_KEEP 5 -#define SEGMENT_OBJECT 6 -#define SEGMENT_LINKANIMETION 7 - -#define GETSEGOFFSET(x) (x & 0x00FFFFFF) -#define GETSEGNUM(x) ((x >> 24) & 0xFF) - -class ZFile; - -enum class ZResourceType -{ - Error, - ActorList, - Animation, - Array, - AltHeader, - Background, - Blob, - CollisionHeader, - CollisionPoly, - Cutscene, - DisplayList, - Limb, - LimbTable, - Mtx, - Path, - PlayerAnimationData, - Pointer, - Room, - RoomCommand, - Scalar, - Scene, - Skeleton, - String, - SurfaceType, - Symbol, - Texture, - TextureAnimation, - TextureAnimationParams, - Vector, - Vertex, - Waterbox, - KeyFrameFlexLimb, - KeyFrameStandardLimb, - KeyFrameSkel, - KeyFrameAnimation, -}; - -class ResourceAttribute -{ -public: - std::string key; - std::string value; - bool isRequired = false; - bool wasSet = false; -}; - -class ZResource -{ -public: - ZFile* parent; - bool outputDeclaration = true; - uint32_t hash = 0; - - /** - * Constructor. - * Child classes should not declare any other constructor besides this one - */ - ZResource(ZFile* nParent); - virtual ~ZResource() = default; - - /// - /// Extracts/Parsees data from binary file using an XML to provide the needed metadata. - /// - /// XML Node we wish to parse from. - /// The offset within the binary file we are going to parse from as - /// indicated by the "Offset" parameter in the XML. - virtual void ExtractWithXML(tinyxml2::XMLElement* reader, offset_t nRawDataIndex); - - /// - /// Extracts/Parses the needed data straight from a binary without the use of an XML. - /// - /// The offset within the binary file we wish to parse from. - virtual void ExtractFromFile(offset_t nRawDataIndex); - - // Misc - /** - * Parses additional attributes of the XML node. - * Extra attritbutes have to be registered using `RegisterRequiredAttribute` or - * `RegisterOptionalAttribute` in the constructor of the ZResource - */ - virtual void ParseXML(tinyxml2::XMLElement* reader); - /** - * Extracts data from the binary file - */ - virtual void ParseRawData(); - /** - * Declares any data pointed by this resource that has not been declared already. - * For example, a Vtx referenced by a Dlist should be declared here if it wasn't - * declared previously by something else - */ - virtual void DeclareReferences(const std::string& prefix); - virtual void ParseRawDataLate(); - virtual void DeclareReferencesLate(const std::string& prefix); - - /** - * Adds this resource as a Declaration of its parent ZFile - */ - virtual Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr); - /** - * Returns the body of the variable of the extracted resource, without any side-effect - */ - [[nodiscard]] virtual std::string GetBodySourceCode() const; - /** - * Creates an automatically generated variable name for the current resource - */ - [[nodiscard]] virtual std::string GetDefaultName(const std::string& prefix) const; - - virtual void GetSourceOutputCode(const std::string& prefix); - virtual std::string GetSourceOutputHeader(const std::string& prefix); - virtual void CalcHash(); - /** - * Exports the resource to binary format - */ - virtual void Save(const fs::path& outFolder); - - // Properties - /** - * Returns true if the resource will be externalized, and included back to the C file using - * `#include`s - */ - virtual bool IsExternalResource() const; - /** - * Can this type be wrapped in an node? - */ - virtual bool DoesSupportArray() const; - /** - * The type of the resource as a C struct - */ - [[nodiscard]] virtual std::string GetSourceTypeName() const = 0; - /** - * The type in the ZResource enum - */ - [[nodiscard]] virtual ZResourceType GetResourceType() const = 0; - /** - * The filename extension for assets extracted as standalone files - */ - [[nodiscard]] virtual std::string GetExternalExtension() const; - - // Getters/Setters - [[nodiscard]] const std::string& GetName() const; - void SetName(const std::string& nName); - [[nodiscard]] const std::string& GetOutName() const; - void SetOutName(const std::string& nName); - [[nodiscard]] offset_t GetRawDataIndex() const; - void SetRawDataIndex(offset_t nRawDataIndex); - - /** - * The size of the current struct being extracted, not counting data referenced by it - */ - [[nodiscard]] virtual size_t GetRawDataSize() const = 0; - /** - * The alignment of the extracted struct - */ - [[nodiscard]] virtual DeclarationAlignment GetDeclarationAlignment() const; - void SetInnerNode(bool inner); - /** - * Returns `true` if this ZResource was declared using an XML node, - * `false` otherwise (for example, a Vtx extracted indirectly by a DList) - */ - [[nodiscard]] bool WasDeclaredInXml() const; - [[nodiscard]] StaticConfig GetStaticConf() const; - -protected: - std::string name; - std::string outName; - offset_t rawDataIndex; - std::string sourceOutput; - - // Inner is used mostly for nodes - /** - * Is this resource an inner node of another resource? - * (namely inside an ) - */ - bool isInner = false; - /** - * Can this type have an inner node? - */ - bool canHaveInner = false; - - /** - * If set to true, create a reference for the asset in the file, but don't - * actually try to extract it from the file - */ - bool isCustomAsset; - bool declaredInXml = false; - StaticConfig staticConf = StaticConfig::Global; - - // Reading from this XMLs attributes should be performed in the overrided `ParseXML` method. - std::map registeredAttributes; - - // XML attributes registers. - // Registering XML attributes should be done in constructors. - - // The resource needs this attribute. If it is not provided, then the program will throw an - // exception. - void RegisterRequiredAttribute(const std::string& attr); - // Optional attribute. The resource has to do manual checks and manual warnings. It may or may - // not have a value. - void RegisterOptionalAttribute(const std::string& attr, const std::string& defaultValue = ""); -}; - -class ZResourceExporter -{ -public: - ZResourceExporter() = default; - virtual ~ZResourceExporter() = default; - - virtual void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) = 0; -}; - -offset_t Seg2Filespace(segptr_t segmentedAddress, uint32_t parentBaseAddress); - -typedef ZResource*(ZResourceFactoryFunc)(ZFile* nParent); - -#define REGISTER_ZFILENODE(nodeName, zResClass) \ - static ZResource* ZResourceFactory_##zResClass_##nodeName(ZFile* nParent) \ - { \ - return static_cast(new zResClass(nParent)); \ - } \ - \ - class ZRes_##nodeName \ - { \ - public: \ - ZRes_##nodeName() \ - { \ - ZFile::RegisterNode(#nodeName, &ZResourceFactory_##zResClass_##nodeName); \ - } \ - }; \ - static ZRes_##nodeName inst_ZRes_##nodeName - -#define REGISTER_EXPORTER(expFunc) \ - class ZResExp_##expFunc \ - { \ - public: \ - ZResExp_##expFunc() { expFunc(); } \ - }; \ - static ZResExp_##expFunc inst_ZResExp_##expFunc diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/EndMarker.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/EndMarker.cpp deleted file mode 100644 index 3f64af168f..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/EndMarker.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "EndMarker.h" - -EndMarker::EndMarker(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -std::string EndMarker::GetBodySourceCode() const -{ - return "SCENE_CMD_END()"; -} - -std::string EndMarker::GetCommandCName() const -{ - return "SCmdEndMarker"; -} - -RoomCommand EndMarker::GetRoomCommand() const -{ - return RoomCommand::EndMarker; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/EndMarker.h b/tools/ZAPD/ZAPD/ZRoom/Commands/EndMarker.h deleted file mode 100644 index daa477c945..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/EndMarker.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class EndMarker : public ZRoomCommand -{ -public: - EndMarker(ZFile* nParent); - - std::string GetBodySourceCode() const override; - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetActorList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetActorList.cpp deleted file mode 100644 index 4d16f9377e..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetActorList.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "SetActorList.h" - -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZRoom/ZRoom.h" - -SetActorList::SetActorList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetActorList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - numActors = cmdArg1; - - actorList = new ZActorList(parent); - actorList->ExtractFromBinary(segmentOffset, numActors); -} - -void SetActorList::DeclareReferences(const std::string& prefix) -{ - if (parent->HasDeclaration(segmentOffset)) - { - delete actorList; - actorList = static_cast(parent->FindResource(segmentOffset)); - assert(actorList != nullptr); - assert(actorList->GetResourceType() == ZResourceType::ActorList); - return; - } - - if (actorList->GetName() == "") - { - actorList->SetName(actorList->GetDefaultName(prefix)); - } - actorList->DeclareVar(prefix, ""); - parent->AddResource(actorList); -} - -std::string SetActorList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorEntry", listName); - - return StringHelper::Sprintf("SCENE_CMD_ACTOR_LIST(%i, %s)", numActors, listName.c_str()); -} - -std::string SetActorList::GetCommandCName() const -{ - return "SCmdActorList"; -} - -RoomCommand SetActorList::GetRoomCommand() const -{ - return RoomCommand::SetActorList; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetActorList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetActorList.h deleted file mode 100644 index 9122c15bb0..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetActorList.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "ZActorList.h" -#include "ZRoom/ZRoomCommand.h" - -class SetActorList : public ZRoomCommand -{ -public: - uint32_t numActors; - ZActorList* actorList = nullptr; - - SetActorList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; - -protected: - size_t GetActorListArraySize() const; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp deleted file mode 100644 index e64b855374..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "SetAlternateHeaders.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" - -SetAlternateHeaders::SetAlternateHeaders(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetAlternateHeaders::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ - if (cmdArg2 != 0) - { - std::string varName = - StringHelper::Sprintf("%sAlternateHeaders0x%06X", prefix.c_str(), segmentOffset); - parent->AddDeclarationPlaceholder(segmentOffset, varName); - } -} - -void SetAlternateHeaders::ParseRawDataLate() -{ - size_t numHeaders = zRoom->parent->GetDeclarationSizeFromNeighbor(segmentOffset) / 4; - - headers.reserve(numHeaders); - for (uint32_t i = 0; i < numHeaders; i++) - { - int32_t address = BitConverter::ToInt32BE(parent->GetRawData(), segmentOffset + (i * 4)); - headers.push_back(address); - - if (address != 0 && parent->GetDeclaration(GETSEGOFFSET(address)) == nullptr) - { - ZRoom* altheader = new ZRoom(parent); - altheader->ExtractFromBinary(GETSEGOFFSET(address), zRoom->GetResourceType()); - altheader->DeclareReferences(parent->GetName()); - - parent->resources.push_back(altheader); - } - } -} - -void SetAlternateHeaders::DeclareReferencesLate(const std::string& prefix) -{ - if (!headers.empty()) - { - std::string declaration; - - for (size_t i = 0; i < headers.size(); i++) - { - std::string altHeaderName; - Globals::Instance->GetSegmentedPtrName(headers.at(i), parent, "", altHeaderName); - - declaration += StringHelper::Sprintf("\t%s,", altHeaderName.c_str()); - - if (i + 1 < headers.size()) - declaration += "\n"; - } - - std::string varName = - StringHelper::Sprintf("%sAlternateHeaders0x%06X", prefix.c_str(), segmentOffset); - parent->AddDeclarationArray(segmentOffset, GetDeclarationAlignment(), headers.size() * 4, - "SceneCmd*", varName, headers.size(), declaration); - } -} - -std::string SetAlternateHeaders::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "SceneCmd*", listName); - return StringHelper::Sprintf("SCENE_CMD_ALTERNATE_HEADER_LIST(%s)", listName.c_str()); -} - -std::string SetAlternateHeaders::GetCommandCName() const -{ - return "SCmdAltHeaders"; -} - -RoomCommand SetAlternateHeaders::GetRoomCommand() const -{ - return RoomCommand::SetAlternateHeaders; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAlternateHeaders.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetAlternateHeaders.h deleted file mode 100644 index e66df936d5..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAlternateHeaders.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoom.h" -#include "ZRoom/ZRoomCommand.h" - -class SetAlternateHeaders : public ZRoomCommand -{ -public: - std::vector headers; - - SetAlternateHeaders(ZFile* nParent); - - void DeclareReferences(const std::string& prefix) override; - void ParseRawDataLate() override; - void DeclareReferencesLate(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; - -private: -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp deleted file mode 100644 index 0b9a67e0ec..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** - * File: SetAnimatedMaterialList.cpp - * Description: Defines a class SetAnimatedMaterialList to enable ZRoom to declare - * ZTextureAnimations, using that ZResource to do the work. - */ -#include "SetAnimatedMaterialList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" -#include "ZTextureAnimation.h" - -SetAnimatedMaterialList::SetAnimatedMaterialList(ZFile* nParent) - : ZRoomCommand(nParent), textureAnimation(nParent) -{ -} - -void SetAnimatedMaterialList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - textureAnimation.ExtractFromFile(segmentOffset); -} - -void SetAnimatedMaterialList::DeclareReferences(const std::string& prefix) -{ - textureAnimation.SetName(textureAnimation.GetDefaultName(prefix.c_str())); - textureAnimation.DeclareReferences(prefix); - textureAnimation.GetSourceOutputCode(prefix); -} - -std::string SetAnimatedMaterialList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "AnimatedMaterial", listName); - return StringHelper::Sprintf("SCENE_CMD_ANIMATED_MATERIAL_LIST(%s)", listName.c_str()); -} - -std::string SetAnimatedMaterialList::GetCommandCName() const -{ - return "SCmdTextureAnimations"; -} - -RoomCommand SetAnimatedMaterialList::GetRoomCommand() const -{ - return RoomCommand::SetAnimatedMaterialList; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h deleted file mode 100644 index 3dbbf9684a..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" -#include "ZTextureAnimation.h" - -class SetAnimatedMaterialList : public ZRoomCommand -{ -public: - SetAnimatedMaterialList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; - -private: - ZTextureAnimation textureAnimation; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCameraSettings.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCameraSettings.cpp deleted file mode 100644 index e30e1b682d..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCameraSettings.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "SetCameraSettings.h" - -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "Globals.h" - -SetCameraSettings::SetCameraSettings(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetCameraSettings::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - cameraMovement = cmdArg1; - mapHighlight = BitConverter::ToUInt32BE(parent->GetRawData(), rawDataIndex + 4); -} - -std::string SetCameraSettings::GetBodySourceCode() const -{ - if (Globals::Instance->game == ZGame::MM_RETAIL) - return StringHelper::Sprintf("SCENE_CMD_SET_REGION_VISITED(0x%02X, 0x%08X)", cameraMovement, - mapHighlight); - else - return StringHelper::Sprintf("SCENE_CMD_MISC_SETTINGS(0x%02X, 0x%08X)", cameraMovement, - mapHighlight); -} - -std::string SetCameraSettings::GetCommandCName() const -{ - return "SCmdMiscSettings"; -} - -RoomCommand SetCameraSettings::GetRoomCommand() const -{ - return RoomCommand::SetCameraSettings; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCameraSettings.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCameraSettings.h deleted file mode 100644 index a8fed44ec2..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCameraSettings.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetCameraSettings : public ZRoomCommand -{ -public: - uint8_t cameraMovement; - uint32_t mapHighlight; - - SetCameraSettings(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; - -private: -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCollisionHeader.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCollisionHeader.cpp deleted file mode 100644 index 03aaa4bbbc..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCollisionHeader.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "SetCollisionHeader.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetCollisionHeader::SetCollisionHeader(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetCollisionHeader::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - - collisionHeader = new ZCollisionHeader(parent); - collisionHeader->SetName( - StringHelper::Sprintf("%sCollisionHeader_%06X", parent->GetName().c_str(), segmentOffset)); - collisionHeader->ExtractFromFile(segmentOffset); - parent->AddResource(collisionHeader); -} - -void SetCollisionHeader::DeclareReferences(const std::string& prefix) -{ - collisionHeader->DeclareVar(prefix, ""); -} - -std::string SetCollisionHeader::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CollisionHeader", listName); - return StringHelper::Sprintf("SCENE_CMD_COL_HEADER(%s)", listName.c_str()); -} - -std::string SetCollisionHeader::GetCommandCName() const -{ - return "SCmdColHeader"; -} - -RoomCommand SetCollisionHeader::GetRoomCommand() const -{ - return RoomCommand::SetCollisionHeader; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCollisionHeader.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCollisionHeader.h deleted file mode 100644 index f7d5ecf358..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCollisionHeader.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "ZCollision.h" -#include "ZRoom/ZRoomCommand.h" - -class SetCollisionHeader : public ZRoomCommand -{ -public: - ZCollisionHeader* collisionHeader; - - SetCollisionHeader(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCsCamera.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCsCamera.cpp deleted file mode 100644 index 302d638d4c..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCsCamera.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include "SetCsCamera.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetCsCamera::SetCsCamera(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetCsCamera::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - int numCameras = cmdArg1; - - uint32_t currentPtr = segmentOffset; - int32_t numPoints = 0; - - cameras.reserve(numCameras); - for (int32_t i = 0; i < numCameras; i++) - { - ActorCsCamInfo entry(parent->GetRawData(), currentPtr); - numPoints += entry.GetNumPoints(); - - currentPtr += entry.GetRawDataSize(); - cameras.push_back(entry); - } - - if (numPoints > 0) - { - uint32_t currentPtr = cameras.at(0).GetSegmentOffset(); - - points.reserve(numPoints); - for (int32_t i = 0; i < numPoints; i++) - { - ZVector vec(parent); - vec.ExtractFromBinary(currentPtr, ZScalarType::ZSCALAR_S16, 3); - - currentPtr += vec.GetRawDataSize(); - points.push_back(vec); - } - } -} - -void SetCsCamera::DeclareReferences(const std::string& prefix) -{ - if (points.size() > 0) - { - std::string declaration; - size_t index = 0; - for (auto& point : points) - { - declaration += StringHelper::Sprintf("\t{ %s },", point.GetBodySourceCode().c_str()); - - if (index < points.size() - 1) - declaration += "\n"; - - index++; - } - - uint32_t segOffset = cameras.at(0).GetSegmentOffset(); - - parent->AddDeclarationArray( - segOffset, DeclarationAlignment::Align4, points.size() * points.at(0).GetRawDataSize(), - points.at(0).GetSourceTypeName().c_str(), - StringHelper::Sprintf("%sCsCameraPoints_%06X", prefix.c_str(), segOffset), - points.size(), declaration); - } - - if (!cameras.empty()) - { - std::string camPointsName; - Globals::Instance->GetSegmentedPtrName(cameras.at(0).GetCamAddress(), parent, "Vec3s", - camPointsName); - std::string declaration; - - size_t index = 0; - size_t pointsIndex = 0; - for (const auto& entry : cameras) - { - declaration += - StringHelper::Sprintf("\t{ %i, %i, &%s[%i] },", entry.type, entry.numPoints, - camPointsName.c_str(), pointsIndex); - - if (index < cameras.size() - 1) - declaration += "\n"; - - index++; - pointsIndex += entry.GetNumPoints(); - } - - const auto& entry = cameras.front(); - std::string camTypename = entry.GetSourceTypeName(); - - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, cameras.size() * entry.GetRawDataSize(), - camTypename, - StringHelper::Sprintf("%s%s_%06X", prefix.c_str(), camTypename.c_str(), segmentOffset), - cameras.size(), declaration); - } -} - -std::string SetCsCamera::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorCsCamInfo", listName); - return StringHelper::Sprintf("SCENE_CMD_ACTOR_CUTSCENE_CAM_LIST(%i, %s)", cameras.size(), - listName.c_str()); -} - -std::string SetCsCamera::GetCommandCName() const -{ - return "SCmdCsCameraList"; -} - -RoomCommand SetCsCamera::GetRoomCommand() const -{ - return RoomCommand::SetCsCamera; -} - -ActorCsCamInfo::ActorCsCamInfo(const std::vector& rawData, uint32_t rawDataIndex) - : baseOffset(rawDataIndex), type(BitConverter::ToInt16BE(rawData, rawDataIndex + 0)), - numPoints(BitConverter::ToInt16BE(rawData, rawDataIndex + 2)) -{ - camAddress = BitConverter::ToInt32BE(rawData, rawDataIndex + 4); - segmentOffset = GETSEGOFFSET(camAddress); -} - -std::string ActorCsCamInfo::GetSourceTypeName() const -{ - return "ActorCsCamInfo"; -} - -int32_t ActorCsCamInfo::GetRawDataSize() const -{ - return 8; -} - -int16_t ActorCsCamInfo::GetNumPoints() const -{ - return numPoints; -} - -segptr_t ActorCsCamInfo::GetCamAddress() const -{ - return camAddress; -} - -uint32_t ActorCsCamInfo::GetSegmentOffset() const -{ - return segmentOffset; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCsCamera.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCsCamera.h deleted file mode 100644 index 2ce64e4e05..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCsCamera.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" -#include "ZVector.h" - -class ActorCsCamInfo -{ -public: - ActorCsCamInfo(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetSourceTypeName() const; - int32_t GetRawDataSize() const; - - int16_t GetNumPoints() const; - segptr_t GetCamAddress() const; - uint32_t GetSegmentOffset() const; - - int baseOffset; - int16_t type; - int16_t numPoints; - segptr_t camAddress; - uint32_t segmentOffset; -}; - -class SetCsCamera : public ZRoomCommand -{ -public: - std::vector cameras; - std::vector points; - - SetCsCamera(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutsceneEntryList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutsceneEntryList.cpp deleted file mode 100644 index 96c50c3be2..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutsceneEntryList.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "SetCutsceneEntryList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetActorCutsceneList::SetActorCutsceneList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetActorCutsceneList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - int numCutscenes = cmdArg1; - offset_t currentPtr = segmentOffset; - - cutscenes.reserve(numCutscenes); - for (int32_t i = 0; i < numCutscenes; i++) - { - CutsceneEntry entry(parent->GetRawData(), currentPtr); - cutscenes.push_back(entry); - - currentPtr += 16; - } -} - -void SetActorCutsceneList::DeclareReferences(const std::string& prefix) -{ - if (cutscenes.size() > 0) - { - std::string declaration; - - for (size_t i = 0; i < cutscenes.size(); i++) - { - const auto& entry = cutscenes.at(i); - declaration += StringHelper::Sprintf(" { %s },", entry.GetBodySourceCode().c_str()); - - if (i + 1 < cutscenes.size()) - { - declaration += "\n"; - } - } - - std::string typeName = cutscenes.at(0).GetSourceTypeName(); - - parent->AddDeclarationArray( - segmentOffset, GetDeclarationAlignment(), cutscenes.size() * 16, typeName, - StringHelper::Sprintf("%s%sList_%06X", prefix.c_str(), typeName.c_str(), segmentOffset), - cutscenes.size(), declaration); - } -} - -std::string SetActorCutsceneList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneEntry", listName); - return StringHelper::Sprintf("SCENE_CMD_ACTOR_CUTSCENE_LIST(%i, %s)", cutscenes.size(), - listName.c_str()); -} - -std::string SetActorCutsceneList::GetCommandCName() const -{ - return "SCmdCutsceneActorList"; -} - -RoomCommand SetActorCutsceneList::GetRoomCommand() const -{ - return RoomCommand::SetActorCutsceneList; -} - -CutsceneEntry::CutsceneEntry(const std::vector& rawData, uint32_t rawDataIndex) - : priority(BitConverter::ToInt16BE(rawData, rawDataIndex + 0)), - length(BitConverter::ToInt16BE(rawData, rawDataIndex + 2)), - csCamId(BitConverter::ToInt16BE(rawData, rawDataIndex + 4)), - scriptIndex(BitConverter::ToInt16BE(rawData, rawDataIndex + 6)), - additionalCsId(BitConverter::ToInt16BE(rawData, rawDataIndex + 8)), - endSfx(rawData[rawDataIndex + 0xA]), customValue(rawData[rawDataIndex + 0xB]), - hudVisibility(BitConverter::ToInt16BE(rawData, rawDataIndex + 0xC)), - endCam(rawData[rawDataIndex + 0xE]), letterboxSize(rawData[rawDataIndex + 0xF]) -{ -} - -std::string CutsceneEntry::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - - if (enumData->endSfx.find(endSfx) != enumData->endSfx.end()) - return StringHelper::Sprintf("%i, %i, %i, %i, %i, %s, %i, %i, %i, %i", priority, length, - csCamId, scriptIndex, additionalCsId, - enumData->endSfx[endSfx].c_str(), customValue, hudVisibility, - endCam, letterboxSize); - else - return StringHelper::Sprintf("%i, %i, %i, %i, %i, %i, %i, %i, %i, %i", priority, length, - csCamId, scriptIndex, additionalCsId, endSfx, customValue, - hudVisibility, endCam, letterboxSize); -} - -std::string CutsceneEntry::GetSourceTypeName() const -{ - return "CutsceneEntry"; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutsceneEntryList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutsceneEntryList.h deleted file mode 100644 index 6ba6c23abc..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutsceneEntryList.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class CutsceneEntry -{ -protected: - int16_t priority; - int16_t length; - int16_t csCamId; - int16_t scriptIndex; - int16_t additionalCsId; - uint8_t endSfx; - uint8_t customValue; - int16_t hudVisibility; - uint8_t endCam; - uint8_t letterboxSize; - -public: - CutsceneEntry(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetBodySourceCode() const; - std::string GetSourceTypeName() const; -}; - -class SetActorCutsceneList : public ZRoomCommand -{ -public: - std::vector cutscenes; - - SetActorCutsceneList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; - -private: -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutscenes.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutscenes.cpp deleted file mode 100644 index d2a1c19561..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutscenes.cpp +++ /dev/null @@ -1,134 +0,0 @@ -#include "SetCutscenes.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetCutscenes::SetCutscenes(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetCutscenes::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - - numCutscenes = cmdArg1; - - if (Globals::Instance->game == ZGame::MM_RETAIL) - { - int32_t currentPtr = segmentOffset; - - cutsceneEntries.reserve(numCutscenes); - for (uint8_t i = 0; i < numCutscenes; i++) - { - CutsceneScriptEntry entry(parent->GetRawData(), currentPtr); - cutsceneEntries.push_back(entry); - currentPtr += 8; - } - } -} - -void SetCutscenes::DeclareReferences(const std::string& prefix) -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - std::string varPrefix = name; - if (varPrefix == "") - varPrefix = prefix; - - if (Globals::Instance->game == ZGame::MM_RETAIL) - { - std::string declaration; - size_t i = 0; - - for (const auto& entry : cutsceneEntries) - { - if (entry.segmentPtr != SEGMENTED_NULL && - GETSEGNUM(entry.segmentPtr) == parent->segment) - { - offset_t csOffset = Seg2Filespace(entry.segmentPtr, parent->baseAddress); - if (!parent->HasDeclaration(csOffset)) - { - auto* cutscene = new ZCutscene(parent); - cutscene->ExtractFromFile(csOffset); - cutscene->SetName(cutscene->GetDefaultName(varPrefix)); - cutscene->DeclareVar(varPrefix, ""); - cutscene->DeclareReferences(varPrefix); - parent->AddResource(cutscene); - } - } - - std::string csName; - Globals::Instance->GetSegmentedPtrName(entry.segmentPtr, parent, "CutsceneData", - csName); - - if (enumData->spawnFlag.find(entry.flag) != enumData->spawnFlag.end()) - declaration += StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, %s },", - csName.c_str(), entry.exit, entry.entrance, - enumData->spawnFlag[entry.flag].c_str()); - else - declaration += - StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, 0x%02X },", csName.c_str(), - entry.exit, entry.entrance, entry.flag); - if (i + 1 < numCutscenes) - declaration += "\n"; - - i++; - } - - parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4, - cutsceneEntries.size() * 8, "CutsceneScriptEntry", - StringHelper::Sprintf("%sCutsceneScriptEntryList_%06X", - zRoom->GetName().c_str(), segmentOffset), - cutsceneEntries.size(), declaration); - } - else - { - if (cmdArg2 != SEGMENTED_NULL && GETSEGNUM(cmdArg2) == parent->segment) - { - offset_t csOffset = Seg2Filespace(cmdArg2, parent->baseAddress); - if (!parent->HasDeclaration(csOffset)) - { - auto* cutscene = new ZCutscene(parent); - cutscene->ExtractFromFile(csOffset); - cutscene->SetName(cutscene->GetDefaultName(varPrefix)); - cutscene->DeclareVar(varPrefix, ""); - cutscene->DeclareReferences(varPrefix); - parent->AddResource(cutscene); - } - } - } -} - -std::string SetCutscenes::GetBodySourceCode() const -{ - std::string listName; - - if (Globals::Instance->game == ZGame::MM_RETAIL) - { - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneScriptEntry", listName); - return StringHelper::Sprintf("SCENE_CMD_CUTSCENE_SCRIPT_LIST(%i, %s)", numCutscenes, - listName.c_str()); - } - - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneData", listName); - return StringHelper::Sprintf("SCENE_CMD_CUTSCENE_DATA(%s)", listName.c_str()); -} - -std::string SetCutscenes::GetCommandCName() const -{ - return "SCmdCutsceneData"; -} - -RoomCommand SetCutscenes::GetRoomCommand() const -{ - return RoomCommand::SetCutscenes; -} - -CutsceneScriptEntry::CutsceneScriptEntry(const std::vector& rawData, uint32_t rawDataIndex) - : segmentPtr(BitConverter::ToInt32BE(rawData, rawDataIndex + 0)), - exit(BitConverter::ToInt16BE(rawData, rawDataIndex + 4)), entrance(rawData[rawDataIndex + 6]), - flag(rawData[rawDataIndex + 7]) -{ -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutscenes.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutscenes.h deleted file mode 100644 index e6d979d0f6..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetCutscenes.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "ZCutscene.h" -#include "ZRoom/ZRoomCommand.h" - -class CutsceneScriptEntry -{ -public: - CutsceneScriptEntry(const std::vector& rawData, uint32_t rawDataIndex); - - segptr_t segmentPtr; - uint16_t exit; - uint8_t entrance; - uint8_t flag; -}; - -class SetCutscenes : public ZRoomCommand -{ -public: - std::vector cutsceneEntries; // (MM Only) - uint8_t numCutscenes; // (MM Only) - - SetCutscenes(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEchoSettings.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetEchoSettings.cpp deleted file mode 100644 index 79a278bc69..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEchoSettings.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "SetEchoSettings.h" -#include "Utils/StringHelper.h" - -SetEchoSettings::SetEchoSettings(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetEchoSettings::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - echo = parent->GetRawData().at(rawDataIndex + 0x07); -} - -std::string SetEchoSettings::GetBodySourceCode() const -{ - return StringHelper::Sprintf("SCENE_CMD_ECHO_SETTINGS(%i)", echo); -} - -std::string SetEchoSettings::GetCommandCName() const -{ - return "SCmdEchoSettings"; -} - -RoomCommand SetEchoSettings::GetRoomCommand() const -{ - return RoomCommand::SetEchoSettings; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEchoSettings.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetEchoSettings.h deleted file mode 100644 index 82b8c27dbc..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEchoSettings.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetEchoSettings : public ZRoomCommand -{ -public: - uint8_t echo; - - SetEchoSettings(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEntranceList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetEntranceList.cpp deleted file mode 100644 index 3ffba0ff12..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEntranceList.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "SetEntranceList.h" - -#include "Globals.h" -#include "SetStartPositionList.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetEntranceList::SetEntranceList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetEntranceList::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ - if (segmentOffset != 0) - { - std::string varName = - StringHelper::Sprintf("%sEntranceList0x%06X", prefix.c_str(), segmentOffset); - parent->AddDeclarationPlaceholder(segmentOffset, varName); - } -} - -void SetEntranceList::ParseRawDataLate() -{ - // Parse Entrances and Generate Declaration - uint32_t numEntrances = zRoom->parent->GetDeclarationSizeFromNeighbor(segmentOffset) / 2; - uint32_t currentPtr = segmentOffset; - - entrances.reserve(numEntrances); - for (uint32_t i = 0; i < numEntrances; i++) - { - Spawn entry(parent->GetRawData(), currentPtr); - entrances.push_back(entry); - - currentPtr += 2; - } -} - -void SetEntranceList::DeclareReferencesLate([[maybe_unused]] const std::string& prefix) -{ - if (!entrances.empty()) - { - std::string declaration; - - size_t index = 0; - for (const auto& entry : entrances) - { - declaration += StringHelper::Sprintf(" { %s },", entry.GetBodySourceCode().c_str()); - if (index + 1 < entrances.size()) - declaration += "\n"; - - index++; - } - - std::string varName = - StringHelper::Sprintf("%sEntranceList0x%06X", prefix.c_str(), segmentOffset); - - if (Globals::Instance->game != ZGame::MM_RETAIL) - parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4, - entrances.size() * 2, "Spawn", varName, entrances.size(), - declaration); - else - parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4, - entrances.size() * 2, "EntranceEntry", varName, - entrances.size(), declaration); - } -} - -std::string SetEntranceList::GetBodySourceCode() const -{ - std::string listName; - if (Globals::Instance->game != ZGame::MM_RETAIL) - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "Spawn", listName); - else - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "EntranceEntry", listName); - return StringHelper::Sprintf("SCENE_CMD_ENTRANCE_LIST(%s)", listName.c_str()); -} - -std::string SetEntranceList::GetCommandCName() const -{ - return "SCmdEntranceList"; -} - -RoomCommand SetEntranceList::GetRoomCommand() const -{ - return RoomCommand::SetEntranceList; -} - -Spawn::Spawn(const std::vector& rawData, uint32_t rawDataIndex) -{ - startPositionIndex = rawData.at(rawDataIndex + 0); - roomToLoad = rawData.at(rawDataIndex + 1); -} - -std::string Spawn::GetBodySourceCode() const -{ - return StringHelper::Sprintf("0x%02X, 0x%02X", startPositionIndex, roomToLoad); -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEntranceList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetEntranceList.h deleted file mode 100644 index 832232e06b..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetEntranceList.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class Spawn -{ -public: - uint8_t startPositionIndex; - uint8_t roomToLoad; - - Spawn(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetBodySourceCode() const; -}; - -class SetEntranceList : public ZRoomCommand -{ -public: - std::vector entrances; - - SetEntranceList(ZFile* nParent); - - void DeclareReferences(const std::string& prefix) override; - void ParseRawDataLate() override; - void DeclareReferencesLate(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetExitList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetExitList.cpp deleted file mode 100644 index 78bbaa87ed..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetExitList.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "SetExitList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZNames.h" -#include "ZRoom/ZRoom.h" - -SetExitList::SetExitList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetExitList::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ - if (segmentOffset != 0) - { - std::string varName = - StringHelper::Sprintf("%sExitList_%06X", prefix.c_str(), segmentOffset); - parent->AddDeclarationPlaceholder(segmentOffset, varName); - } -} - -void SetExitList::ParseRawDataLate() -{ - // Parse Entrances and Generate Declaration - uint32_t numEntrances = zRoom->parent->GetDeclarationSizeFromNeighbor(segmentOffset) / 2; - uint32_t currentPtr = segmentOffset; - - exits.reserve(numEntrances); - for (uint32_t i = 0; i < numEntrances; i++) - { - uint16_t exit = BitConverter::ToUInt16BE(parent->GetRawData(), currentPtr); - exits.push_back(exit); - - currentPtr += 2; - } -} - -void SetExitList::DeclareReferencesLate([[maybe_unused]] const std::string& prefix) -{ - if (!exits.empty()) - { - std::string declaration; - - for (size_t i = 0; i < exits.size(); i++) - { - declaration += - StringHelper::Sprintf(" %s,", ZNames::GetEntranceName(exits[i]).c_str()); - if (i + 1 < exits.size()) - declaration += "\n"; - } - - std::string varName = - StringHelper::Sprintf("%sExitList_%06X", prefix.c_str(), segmentOffset); - parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4, exits.size() * 2, - "u16", varName, exits.size(), declaration); - } -} - -std::string SetExitList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "u16", listName); - return StringHelper::Sprintf("SCENE_CMD_EXIT_LIST(%s)", listName.c_str()); -} - -std::string SetExitList::GetCommandCName() const -{ - return "SCmdExitList"; -} - -RoomCommand SetExitList::GetRoomCommand() const -{ - return RoomCommand::SetExitList; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetExitList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetExitList.h deleted file mode 100644 index 9d2791a83d..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetExitList.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetExitList : public ZRoomCommand -{ -public: - std::vector exits; - - SetExitList(ZFile* nParent); - - void DeclareReferences(const std::string& prefix) override; - void ParseRawDataLate() override; - void DeclareReferencesLate(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightList.cpp deleted file mode 100644 index 0d0f0ff79a..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightList.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "SetLightList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -SetLightList::SetLightList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetLightList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - std::string declarations; - - numLights = cmdArg1; - int32_t currentPtr = segmentOffset; - - lights.reserve(this->numLights); - for (int i = 0; i < this->numLights; i++) - { - LightInfo light(parent->GetRawData(), currentPtr); - - currentPtr += light.GetRawDataSize(); - lights.push_back(light); - } -} - -void SetLightList::DeclareReferences(const std::string& prefix) -{ - if (!lights.empty()) - { - std::string declarations; - - for (size_t i = 0; i < lights.size(); i++) - { - declarations += - StringHelper::Sprintf("\t{ %s },", lights.at(i).GetBodySourceCode().c_str()); - - if (i < lights.size() - 1) - declarations += "\n"; - } - - const auto& light = lights.front(); - - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, lights.size() * light.GetRawDataSize(), - light.GetSourceTypeName(), - StringHelper::Sprintf("%sLightInfo0x%06X", prefix.c_str(), segmentOffset), - lights.size(), declarations); - } -} - -std::string SetLightList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightInfo", listName); - return StringHelper::Sprintf("SCENE_CMD_LIGHT_LIST(%i, %s)", numLights, listName.c_str()); -} - -std::string SetLightList::GetCommandCName() const -{ - return "SCmdLightList"; -} - -RoomCommand SetLightList::GetRoomCommand() const -{ - return RoomCommand::SetLightList; -} - -LightInfo::LightInfo(const std::vector& rawData, uint32_t rawDataIndex) -{ - type = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0); - x = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - y = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - z = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - r = BitConverter::ToUInt8BE(rawData, rawDataIndex + 8); - g = BitConverter::ToUInt8BE(rawData, rawDataIndex + 9); - b = BitConverter::ToUInt8BE(rawData, rawDataIndex + 10); - drawGlow = BitConverter::ToUInt8BE(rawData, rawDataIndex + 11); - radius = BitConverter::ToInt16BE(rawData, rawDataIndex + 12); -} - -std::string LightInfo::GetBodySourceCode() const -{ - return StringHelper::Sprintf( - "0x%02X, { %i, %i, %i, { 0x%02X, 0x%02X, 0x%02X }, 0x%02X, 0x%04X }", type, x, y, z, r, g, - b, drawGlow, radius); -} - -std::string LightInfo::GetSourceTypeName() const -{ - return "LightInfo"; -} - -size_t LightInfo::GetRawDataSize() const -{ - return 0x0E; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightList.h deleted file mode 100644 index c089d82a54..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightList.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include - -#include "ZFile.h" -#include "ZRoom/ZRoom.h" -#include "ZRoom/ZRoomCommand.h" - -class LightInfo -{ -public: - LightInfo(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetBodySourceCode() const; - - std::string GetSourceTypeName() const; - size_t GetRawDataSize() const; - -protected: - uint8_t type; - int16_t x, y, z; - uint8_t r, g, b; - uint8_t drawGlow; - int16_t radius; -}; - -class SetLightList : public ZRoomCommand -{ -public: - uint8_t numLights; - std::vector lights; - - SetLightList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightingSettings.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightingSettings.cpp deleted file mode 100644 index eaf01cd4c4..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightingSettings.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "SetLightingSettings.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetLightingSettings::SetLightingSettings(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetLightingSettings::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - uint8_t numLights = cmdArg1; - - settings.reserve(numLights); - for (int i = 0; i < numLights; i++) - settings.push_back(LightingSettings(parent->GetRawData(), segmentOffset + (i * 22))); -} - -void SetLightingSettings::DeclareReferences(const std::string& prefix) -{ - if (settings.size() > 0) - { - std::string declaration; - - for (size_t i = 0; i < settings.size(); i++) - { - declaration += - StringHelper::Sprintf("\t{ %s },", settings.at(i).GetBodySourceCode().c_str()); - if (i + 1 < settings.size()) - declaration += "\n"; - } - - if (Globals::Instance->game != ZGame::MM_RETAIL) - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, - settings.size() * settings.front().GetRawDataSize(), "EnvLightSettings", - StringHelper::Sprintf("%sLightSettings0x%06X", prefix.c_str(), segmentOffset), - settings.size(), declaration); - else - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, - settings.size() * settings.front().GetRawDataSize(), "LightSettings", - StringHelper::Sprintf("%sLightSettings0x%06X", prefix.c_str(), segmentOffset), - settings.size(), declaration); - } -} - -std::string SetLightingSettings::GetBodySourceCode() const -{ - std::string listName; - if (Globals::Instance->game != ZGame::MM_RETAIL) - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "EnvLightSettings", listName); - else - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightSettings", listName); - return StringHelper::Sprintf("SCENE_CMD_ENV_LIGHT_SETTINGS(%i, %s)", settings.size(), - listName.c_str()); -} - -std::string SetLightingSettings::GetCommandCName() const -{ - return "SCmdLightSettingList"; -} - -RoomCommand SetLightingSettings::GetRoomCommand() const -{ - return RoomCommand::SetLightingSettings; -} - -LightingSettings::LightingSettings(const std::vector& rawData, uint32_t rawDataIndex) -{ - ambientClrR = rawData.at(rawDataIndex + 0); - ambientClrG = rawData.at(rawDataIndex + 1); - ambientClrB = rawData.at(rawDataIndex + 2); - - diffuseClrA_R = rawData.at(rawDataIndex + 3); - diffuseClrA_G = rawData.at(rawDataIndex + 4); - diffuseClrA_B = rawData.at(rawDataIndex + 5); - - diffuseDirA_X = rawData.at(rawDataIndex + 6); - diffuseDirA_Y = rawData.at(rawDataIndex + 7); - diffuseDirA_Z = rawData.at(rawDataIndex + 8); - - diffuseClrB_R = rawData.at(rawDataIndex + 9); - diffuseClrB_G = rawData.at(rawDataIndex + 10); - diffuseClrB_B = rawData.at(rawDataIndex + 11); - - diffuseDirB_X = rawData.at(rawDataIndex + 12); - diffuseDirB_Y = rawData.at(rawDataIndex + 13); - diffuseDirB_Z = rawData.at(rawDataIndex + 14); - - fogClrR = rawData.at(rawDataIndex + 15); - fogClrG = rawData.at(rawDataIndex + 16); - fogClrB = rawData.at(rawDataIndex + 17); - - unk = BitConverter::ToInt16BE(rawData, rawDataIndex + 18); - drawDistance = BitConverter::ToInt16BE(rawData, rawDataIndex + 20); -} - -std::string LightingSettings::GetBodySourceCode() const -{ - return StringHelper::Sprintf( - "0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, " - "0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%04X, 0x%04X", - ambientClrR, ambientClrG, ambientClrB, diffuseClrA_R, diffuseClrA_G, diffuseClrA_B, - diffuseDirA_X, diffuseDirA_Y, diffuseDirA_Z, diffuseClrB_R, diffuseClrB_G, diffuseClrB_B, - diffuseDirB_X, diffuseDirB_Y, diffuseDirB_Z, fogClrR, fogClrG, fogClrB, unk, drawDistance); -} - -size_t LightingSettings::GetRawDataSize() const -{ - return 0x16; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightingSettings.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightingSettings.h deleted file mode 100644 index 29caf4aa6a..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetLightingSettings.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class LightingSettings -{ -public: - uint8_t ambientClrR, ambientClrG, ambientClrB; - uint8_t diffuseClrA_R, diffuseClrA_G, diffuseClrA_B; - uint8_t diffuseDirA_X, diffuseDirA_Y, diffuseDirA_Z; - uint8_t diffuseClrB_R, diffuseClrB_G, diffuseClrB_B; - uint8_t diffuseDirB_X, diffuseDirB_Y, diffuseDirB_Z; - uint8_t fogClrR, fogClrG, fogClrB; - uint16_t unk; - uint16_t drawDistance; - - LightingSettings(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetBodySourceCode() const; - - size_t GetRawDataSize() const; -}; - -class SetLightingSettings : public ZRoomCommand -{ -public: - std::vector settings; - - SetLightingSettings(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp deleted file mode 100644 index 9a4d30d516..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp +++ /dev/null @@ -1,617 +0,0 @@ -#include "SetMesh.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/Path.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZBackground.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -void GenDListDeclarations(ZRoom* zRoom, ZFile* parent, ZDisplayList* dList); - -SetMesh::SetMesh(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetMesh::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - auto& parentRawData = parent->GetRawData(); - meshHeaderType = parentRawData.at(segmentOffset); - - switch (meshHeaderType) - { - case 0: - polyType = std::make_shared(parent, segmentOffset, zRoom); - break; - - case 1: - polyType = std::make_shared(parent, segmentOffset, zRoom); - break; - - case 2: - polyType = std::make_shared(parent, segmentOffset, zRoom); - break; - - default: - HANDLE_ERROR(WarningType::InvalidExtractedData, - StringHelper::Sprintf("unknown meshHeaderType: %i", meshHeaderType), ""); - } - - polyType->ParseRawData(); -} - -void SetMesh::DeclareReferences(const std::string& prefix) -{ - polyType->SetName(polyType->GetDefaultName(prefix)); - polyType->DeclareReferences(prefix); - polyType->DeclareAndGenerateOutputCode(prefix); -} - -// TODO: is this really needed? -void GenDListDeclarations(ZRoom* zRoom, ZFile* parent, ZDisplayList* dList) -{ - if (dList == nullptr) - return; - - dList->DeclareReferences(zRoom->GetName()); - - for (ZDisplayList* otherDList : dList->otherDLists) - GenDListDeclarations(zRoom, parent, otherDList); -} - -std::string SetMesh::GenDListExterns(ZDisplayList* dList) -{ - std::string sourceOutput; - - sourceOutput += StringHelper::Sprintf("extern Gfx %sDL_%06X[];\n", zRoom->GetName().c_str(), - dList->GetRawDataIndex()); - - for (ZDisplayList* otherDList : dList->otherDLists) - sourceOutput += GenDListExterns(otherDList); - - return sourceOutput; -} - -std::string SetMesh::GetBodySourceCode() const -{ - std::string list; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "", list); - return StringHelper::Sprintf("SCENE_CMD_ROOM_SHAPE(%s)", list.c_str()); -} - -std::string SetMesh::GetCommandCName() const -{ - return "SCmdMesh"; -} - -RoomCommand SetMesh::GetRoomCommand() const -{ - return RoomCommand::SetMesh; -} - -RoomShapeDListsEntry::RoomShapeDListsEntry(ZFile* nParent) : ZResource(nParent) -{ -} - -void RoomShapeDListsEntry::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - switch (polyType) - { - case 2: - x = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - y = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - z = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - unk_06 = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - - opa = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); - xlu = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12); - break; - - default: - opa = BitConverter::ToUInt32BE(rawData, rawDataIndex); - xlu = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); - break; - } -} - -void RoomShapeDListsEntry::DeclareReferences(const std::string& prefix) -{ - opaDList = MakeDlist(opa, prefix); - xluDList = MakeDlist(xlu, prefix); -} - -std::string RoomShapeDListsEntry::GetBodySourceCode() const -{ - std::string bodyStr; - std::string opaStr; - std::string xluStr; - Globals::Instance->GetSegmentedPtrName(opa, parent, "Gfx", opaStr); - Globals::Instance->GetSegmentedPtrName(xlu, parent, "Gfx", xluStr); - - if (polyType == 2) - { - bodyStr += StringHelper::Sprintf("{ %6i, %6i, %6i }, %6i, ", x, y, z, unk_06); - } - - bodyStr += StringHelper::Sprintf("%s, %s", opaStr.c_str(), xluStr.c_str()); - - return bodyStr; -} - -void RoomShapeDListsEntry::GetSourceOutputCode(const std::string& prefix) -{ - std::string bodyStr = StringHelper::Sprintf("\n\t%s\n", GetBodySourceCode().c_str()); - - Declaration* decl = parent->GetDeclaration(rawDataIndex); - - if (decl == nullptr) - DeclareVar(prefix, bodyStr); - else - decl->declBody = bodyStr; -} - -std::string RoomShapeDListsEntry::GetSourceTypeName() const -{ - switch (polyType) - { - case 2: - return "RoomShapeCullableEntry"; - - default: - return "RoomShapeDListsEntry"; - } -} - -ZResourceType RoomShapeDListsEntry::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -size_t RoomShapeDListsEntry::GetRawDataSize() const -{ - switch (polyType) - { - case 2: - return 0x10; - - default: - return 0x08; - } -} - -void RoomShapeDListsEntry::SetPolyType(uint8_t nPolyType) -{ - polyType = nPolyType; -} - -ZDisplayList* RoomShapeDListsEntry::MakeDlist(segptr_t ptr, - [[maybe_unused]] const std::string& prefix) -{ - if (ptr == 0) - { - return nullptr; - } - - uint32_t dlistAddress = Seg2Filespace(ptr, parent->baseAddress); - - int32_t dlistLength = ZDisplayList::GetDListLength( - parent->GetRawData(), dlistAddress, - Globals::Instance->game == ZGame::OOT_SW97 ? DListType::F3DEX : DListType::F3DZEX); - ZDisplayList* dlist = new ZDisplayList(parent); - parent->AddResource(dlist); - dlist->ExtractFromBinary(dlistAddress, dlistLength); - dlist->SetName(dlist->GetDefaultName(prefix)); - GenDListDeclarations(zRoom, parent, dlist); - - return dlist; -} - -/* RoomShapeImageMultiBgEntry */ - -RoomShapeImageMultiBgEntry::RoomShapeImageMultiBgEntry(ZFile* nParent) : ZResource(nParent) -{ -} - -RoomShapeImageMultiBgEntry::RoomShapeImageMultiBgEntry(bool nIsSubStruct, const std::string& prefix, - uint32_t nRawDataIndex, ZFile* nParent) - : RoomShapeImageMultiBgEntry(nParent) -{ - rawDataIndex = nRawDataIndex; - parent = nParent; - isSubStruct = nIsSubStruct; - - name = GetDefaultName(prefix); - - ParseRawData(); - sourceBackground = MakeBackground(source, prefix); -} - -void RoomShapeImageMultiBgEntry::ParseRawData() -{ - size_t pad = 0x00; - const auto& rawData = parent->GetRawData(); - if (!isSubStruct) - { - pad = 0x04; - - unk_00 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00); - id = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x02); - } - source = BitConverter::ToUInt32BE(rawData, rawDataIndex + pad + 0x00); - unk_0C = BitConverter::ToUInt32BE(rawData, rawDataIndex + pad + 0x04); - tlut = BitConverter::ToUInt32BE(rawData, rawDataIndex + pad + 0x08); - width = BitConverter::ToUInt16BE(rawData, rawDataIndex + pad + 0x0C); - height = BitConverter::ToUInt16BE(rawData, rawDataIndex + pad + 0x0E); - fmt = BitConverter::ToUInt8BE(rawData, rawDataIndex + pad + 0x10); - siz = BitConverter::ToUInt8BE(rawData, rawDataIndex + pad + 0x11); - mode0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + pad + 0x12); - tlutCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + pad + 0x14); -} - -ZBackground* RoomShapeImageMultiBgEntry::MakeBackground(segptr_t ptr, const std::string& prefix) -{ - if (ptr == 0) - return nullptr; - - uint32_t backAddress = Seg2Filespace(ptr, parent->baseAddress); - - ZBackground* background = new ZBackground(parent); - background->ExtractFromFile(backAddress); - - std::string defaultName = background->GetDefaultName(prefix); - background->SetName(defaultName); - background->SetOutName(defaultName); - - background->DeclareVar(prefix, ""); - parent->resources.push_back(background); - - return background; -} - -size_t RoomShapeImageMultiBgEntry::GetRawDataSize() const -{ - return 0x1C; -} - -std::string RoomShapeImageMultiBgEntry::GetBodySourceCode() const -{ - std::string bodyStr = " "; - if (!isSubStruct) - { - bodyStr += "{ \n "; - } - - if (!isSubStruct) - { - bodyStr += StringHelper::Sprintf("0x%04X, ", unk_00); - bodyStr += StringHelper::Sprintf("%i, ", id); - bodyStr += "\n "; - bodyStr += " "; - } - - std::string backgroundName; - Globals::Instance->GetSegmentedPtrName(source, parent, "", backgroundName); - bodyStr += StringHelper::Sprintf("%s, ", backgroundName.c_str()); - bodyStr += "\n "; - if (!isSubStruct) - { - bodyStr += " "; - } - - bodyStr += StringHelper::Sprintf("0x%08X, ", unk_0C); - bodyStr += StringHelper::Sprintf("0x%08X, ", tlut); - bodyStr += "\n "; - if (!isSubStruct) - { - bodyStr += " "; - } - - bodyStr += StringHelper::Sprintf("%i, ", width); - bodyStr += StringHelper::Sprintf("%i, ", height); - bodyStr += "\n "; - if (!isSubStruct) - { - bodyStr += " "; - } - - bodyStr += StringHelper::Sprintf("%i, ", fmt); - bodyStr += StringHelper::Sprintf("%i, ", siz); - bodyStr += "\n "; - if (!isSubStruct) - { - bodyStr += " "; - } - - bodyStr += StringHelper::Sprintf("0x%04X, ", mode0); - bodyStr += StringHelper::Sprintf("0x%04X, ", tlutCount); - if (!isSubStruct) - { - bodyStr += " \n }, "; - } - else - { - bodyStr += "\n"; - } - - return bodyStr; -} - -std::string RoomShapeImageMultiBgEntry::GetSourceTypeName() const -{ - return "RoomShapeImageMultiBgEntry"; -} - -ZResourceType RoomShapeImageMultiBgEntry::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -/* PolygonType section */ - -PolygonTypeBase::PolygonTypeBase(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom) - : ZResource(nParent), zRoom{nRoom} -{ - rawDataIndex = nRawDataIndex; - type = BitConverter::ToUInt8BE(parent->GetRawData(), rawDataIndex); -} - -void PolygonTypeBase::DeclareAndGenerateOutputCode(const std::string& prefix) -{ - std::string bodyStr = GetBodySourceCode(); - - Declaration* decl = parent->GetDeclaration(rawDataIndex); - if (decl == nullptr) - { - DeclareVar(prefix, bodyStr); - } - else - { - decl->declBody = bodyStr; - } -} - -std::string PolygonTypeBase::GetSourceTypeName() const -{ - switch (type) - { - case 2: - return "RoomShapeCullable"; - - case 1: - return "PolygonType1"; - - default: - return "RoomShapeNormal"; - } -} - -ZResourceType PolygonTypeBase::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -PolygonType1::PolygonType1(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom) - : PolygonTypeBase(nParent, nRawDataIndex, nRoom), single(nParent) -{ -} - -void PolygonType1::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - format = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x01); - dlist = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x04); - - if (format == 2) - { - count = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08); - list = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0C); - } - - if (dlist != 0) - { - RoomShapeDListsEntry polyGfxList(parent); - polyGfxList.zRoom = zRoom; - polyGfxList.SetPolyType(type); - polyGfxList.ExtractFromFile(Seg2Filespace(dlist, parent->baseAddress)); - polyGfxList.DeclareReferences(zRoom->GetName()); - polyDLists.push_back(polyGfxList); - } -} - -void PolygonType1::DeclareReferences(const std::string& prefix) -{ - polyDLists.at(0).GetSourceOutputCode(prefix); - - uint32_t listAddress; - std::string bgImageArrayBody; - switch (format) - { - case 1: - single = RoomShapeImageMultiBgEntry(true, prefix, rawDataIndex + 0x08, parent); - break; - - case 2: - if (list != 0) - { - listAddress = Seg2Filespace(list, parent->baseAddress); - uint32_t auxPtr = listAddress; - - multiList.reserve(count); - for (size_t i = 0; i < count; ++i) - { - RoomShapeImageMultiBgEntry bg(false, prefix, auxPtr, parent); - multiList.push_back(bg); - auxPtr += bg.GetRawDataSize(); - bgImageArrayBody += bg.GetBodySourceCode(); - if (i + 1 < count) - { - bgImageArrayBody += "\n"; - } - } - - Declaration* decl = parent->GetDeclaration(listAddress); - if (decl == nullptr) - { - parent->AddDeclarationArray( - listAddress, DeclarationAlignment::Align4, - count * multiList.at(0).GetRawDataSize(), multiList.at(0).GetSourceTypeName(), - multiList.at(0).GetName().c_str(), count, bgImageArrayBody); - } - } - break; - - default: - HANDLE_ERROR(WarningType::InvalidExtractedData, - StringHelper::Sprintf("unknown format: %i", format), ""); - break; - } -} - -size_t PolygonType1::GetRawDataSize() const -{ - switch (format) - { - case 1: - return 0x20; - - case 2: - return 0x10; - } - return 0x20; -} - -std::string PolygonType1::GetBodySourceCode() const -{ - std::string bodyStr = "\n "; - - bodyStr += "{ "; - bodyStr += StringHelper::Sprintf("%i, %i, ", type, format); - - std::string dlistStr; - Globals::Instance->GetSegmentedPtrName(dlist, parent, "", dlistStr); - - bodyStr += StringHelper::Sprintf("%s, ", dlistStr.c_str()); - bodyStr += "}, \n"; - - std::string listStr = "NULL"; - switch (format) - { - case 1: - bodyStr += single.GetBodySourceCode(); - break; - case 2: - Globals::Instance->GetSegmentedPtrName(list, parent, "RoomShapeImageMultiBgEntry", listStr); - bodyStr += StringHelper::Sprintf(" %i, %s, \n", count, listStr.c_str()); - break; - - default: - break; - } - - return bodyStr; -} - -std::string PolygonType1::GetSourceTypeName() const -{ - switch (format) - { - case 1: - return "RoomShapeImageSingle"; - - case 2: - return "RoomShapeImageMulti"; - } - return "ERROR"; - // return "PolygonType1"; -} - -RoomShapeCullable::RoomShapeCullable(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom) - : PolygonTypeBase(nParent, nRawDataIndex, nRoom) -{ -} - -void RoomShapeCullable::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - num = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x01); - - start = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x04); - end = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08); - - uint32_t currentPtr = GETSEGOFFSET(start); - - polyDLists.reserve(num); - for (size_t i = 0; i < num; i++) - { - RoomShapeDListsEntry entry(parent); - entry.zRoom = zRoom; - entry.SetPolyType(type); - entry.ExtractFromFile(currentPtr); - entry.DeclareReferences(zRoom->GetName()); - polyDLists.push_back(entry); - currentPtr += entry.GetRawDataSize(); - } -} - -void RoomShapeCullable::DeclareReferences(const std::string& prefix) -{ - if (num > 0) - { - std::string declaration; - - for (size_t i = 0; i < polyDLists.size(); i++) - { - declaration += - StringHelper::Sprintf("\t{ %s },", polyDLists.at(i).GetBodySourceCode().c_str()); - if (i + 1 < polyDLists.size()) - declaration += "\n"; - } - - std::string polyDlistType = polyDLists.at(0).GetSourceTypeName(); - std::string polyDListName; - polyDListName = StringHelper::Sprintf("%s%s_%06X", prefix.c_str(), polyDlistType.c_str(), - GETSEGOFFSET(start)); - - Declaration* decl = parent->AddDeclarationArray( - GETSEGOFFSET(start), DeclarationAlignment::Align4, - polyDLists.size() * polyDLists.at(0).GetRawDataSize(), polyDlistType, polyDListName, - polyDLists.size(), declaration); - decl->forceArrayCnt = true; - } - - parent->AddDeclaration(GETSEGOFFSET(end), DeclarationAlignment::Align4, 4, "s32", - StringHelper::Sprintf("%s_terminatorMaybe_%06X", - parent->GetName().c_str(), GETSEGOFFSET(end)), - "0x01000000"); -} - -std::string RoomShapeCullable::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(start, parent, "", listName); - - std::string body = StringHelper::Sprintf("\n %i, %i,\n", type, polyDLists.size()); - body += StringHelper::Sprintf(" %s,\n", listName.c_str()); - body += - StringHelper::Sprintf(" %s + ARRAY_COUNTU(%s)\n", listName.c_str(), listName.c_str()); - return body; -} - -size_t RoomShapeCullable::GetRawDataSize() const -{ - return 0x0C; -} - -DeclarationAlignment RoomShapeCullable::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align4; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.h deleted file mode 100644 index c0f15da9d3..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.h +++ /dev/null @@ -1,160 +0,0 @@ -#pragma once - -#include -#include "ZBackground.h" -#include "ZDisplayList.h" -#include "ZRoom/ZRoomCommand.h" - -class RoomShapeDListsEntry : public ZResource -{ -public: - ZRoom* zRoom; - - uint8_t polyType; - - int16_t x, y, z; // polyType == 2 - int16_t unk_06; // polyType == 2 - - segptr_t opa = 0; // Gfx* - segptr_t xlu = 0; // Gfx* - - ZDisplayList* opaDList = nullptr; // Gfx* - ZDisplayList* xluDList = nullptr; // Gfx* - - RoomShapeDListsEntry(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - void GetSourceOutputCode(const std::string& prefix) override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - - void SetPolyType(uint8_t nPolyType); - -protected: - ZDisplayList* MakeDlist(segptr_t ptr, const std::string& prefix); -}; - -class RoomShapeImageMultiBgEntry : public ZResource -{ -public: - uint16_t unk_00; - uint8_t id; - segptr_t source; - uint32_t unk_0C; - uint32_t tlut; - uint16_t width; - uint16_t height; - uint8_t fmt; - uint8_t siz; - uint16_t mode0; - uint16_t tlutCount; - - ZBackground* sourceBackground; - - bool isSubStruct; - - RoomShapeImageMultiBgEntry(ZFile* nParent); - RoomShapeImageMultiBgEntry(bool nIsSubStruct, const std::string& prefix, uint32_t nRawDataIndex, - ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - ZBackground* MakeBackground(segptr_t ptr, const std::string& prefix); -}; - -class PolygonTypeBase : public ZResource -{ -public: - uint8_t type; - std::vector polyDLists; - - PolygonTypeBase(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom); - - void DeclareAndGenerateOutputCode(const std::string& prefix); - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - -protected: - ZRoom* zRoom; -}; - -class PolygonType1 : public PolygonTypeBase -{ -public: - uint8_t format; - segptr_t dlist; - - // single - RoomShapeImageMultiBgEntry single; - - // multi - uint8_t count; - segptr_t list; // RoomShapeImageMultiBgEntry* - std::vector multiList; - - PolygonType1(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - - size_t GetRawDataSize() const override; -}; - -class RoomShapeCullable : public PolygonTypeBase -{ -public: - uint8_t num; - segptr_t start; - segptr_t end; - - RoomShapeCullable(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; -}; - -class SetMesh : public ZRoomCommand -{ -public: - uint8_t data; - uint8_t meshHeaderType; - std::shared_ptr polyType; - - SetMesh(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; - -private: - std::string GenDListExterns(ZDisplayList* dList); -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapChests.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapChests.cpp deleted file mode 100644 index b1985f8904..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapChests.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "SetMinimapChests.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetMinimapChests::SetMinimapChests(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetMinimapChests::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - int numChests = cmdArg1; - - offset_t currentPtr = segmentOffset; - - chests.reserve(numChests); - for (int32_t i = 0; i < numChests; i++) - { - MinimapChest chest(parent->GetRawData(), currentPtr); - chests.push_back(chest); - - currentPtr += 10; - } -} - -void SetMinimapChests::DeclareReferences(const std::string& prefix) -{ - std::string declaration; - - size_t index = 0; - for (const auto& chest : chests) - { - declaration += StringHelper::Sprintf(" { %s },", chest.GetBodySourceCode().c_str()); - - if (index < chests.size() - 1) - declaration += "\n"; - - index++; - } - - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, chests.size() * 10, "MinimapChest", - StringHelper::Sprintf("%sMinimapChests0x%06X", prefix.c_str(), segmentOffset), - chests.size(), declaration); -} - -std::string SetMinimapChests::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "MinimapChest", listName); - return StringHelper::Sprintf("SCENE_CMD_MINIMAP_COMPASS_ICON_INFO(0x%02X, %s)", chests.size(), - listName.c_str()); -} - -std::string SetMinimapChests::GetCommandCName() const -{ - return "SCmdMinimapChests"; -} - -RoomCommand SetMinimapChests::GetRoomCommand() const -{ - return RoomCommand::SetMinimapChests; -} - -MinimapChest::MinimapChest(const std::vector& rawData, uint32_t rawDataIndex) - : unk0(BitConverter::ToUInt16BE(rawData, rawDataIndex + 0)), - unk2(BitConverter::ToUInt16BE(rawData, rawDataIndex + 2)), - unk4(BitConverter::ToUInt16BE(rawData, rawDataIndex + 4)), - unk6(BitConverter::ToUInt16BE(rawData, rawDataIndex + 6)), - unk8(BitConverter::ToUInt16BE(rawData, rawDataIndex + 8)) -{ -} - -std::string MinimapChest::GetBodySourceCode() const -{ - return StringHelper::Sprintf("0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X", unk0, unk2, unk4, unk6, - unk8); -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapChests.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapChests.h deleted file mode 100644 index 0db09a8a25..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapChests.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class MinimapChest -{ -public: - MinimapChest(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetBodySourceCode() const; - -protected: - uint16_t unk0; - uint16_t unk2; - uint16_t unk4; - uint16_t unk6; - uint16_t unk8; -}; - -class SetMinimapChests : public ZRoomCommand -{ -public: - std::vector chests; - - SetMinimapChests(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapList.cpp deleted file mode 100644 index a5aac2a543..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapList.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "SetMinimapList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetMinimapList::SetMinimapList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetMinimapList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - listSegmentAddr = BitConverter::ToInt32BE(parent->GetRawData(), segmentOffset); - listSegmentOffset = GETSEGOFFSET(listSegmentAddr); - scale = BitConverter::ToInt16BE(parent->GetRawData(), segmentOffset + 4); - - uint32_t currentPtr = listSegmentOffset; - - minimaps.reserve(zRoom->roomCount); - for (int32_t i = 0; i < zRoom->roomCount; i++) - { - MinimapEntry entry(parent->GetRawData(), currentPtr); - minimaps.push_back(entry); - - currentPtr += 10; - } -} - -void SetMinimapList::DeclareReferences(const std::string& prefix) -{ - { - std::string declaration; - - size_t index = 0; - for (const auto& entry : minimaps) - { - declaration += StringHelper::Sprintf(" { %s },", entry.GetBodySourceCode().c_str()); - - if (index < minimaps.size() - 1) - declaration += "\n"; - - index++; - } - - parent->AddDeclarationArray( - listSegmentOffset, DeclarationAlignment::Align4, minimaps.size() * 10, "MinimapEntry", - StringHelper::Sprintf("%sMinimapEntryList0x%06X", prefix.c_str(), listSegmentOffset), - minimaps.size(), declaration); - } - - { - std::string listName; - Globals::Instance->GetSegmentedPtrName(listSegmentAddr, parent, "MinimapEntry", listName); - std::string declaration = StringHelper::Sprintf("\n\t%s, %d\n", listName.c_str(), scale); - - parent->AddDeclaration( - segmentOffset, DeclarationAlignment::Align4, 8, "MinimapList", - StringHelper::Sprintf("%sMinimapList0x%06X", prefix.c_str(), segmentOffset), - declaration); - } -} - -std::string SetMinimapList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "MinimapList", listName); - return StringHelper::Sprintf("SCENE_CMD_MINIMAP_INFO(%s)", listName.c_str()); -} - -std::string SetMinimapList::GetCommandCName() const -{ - return "SCmdMinimapSettings"; -} - -RoomCommand SetMinimapList::GetRoomCommand() const -{ - return RoomCommand::SetMinimapList; -} - -MinimapEntry::MinimapEntry(const std::vector& rawData, uint32_t rawDataIndex) - : unk0(BitConverter::ToUInt16BE(rawData, rawDataIndex + 0)), - unk2(BitConverter::ToUInt16BE(rawData, rawDataIndex + 2)), - unk4(BitConverter::ToUInt16BE(rawData, rawDataIndex + 4)), - unk6(BitConverter::ToUInt16BE(rawData, rawDataIndex + 6)), - unk8(BitConverter::ToUInt16BE(rawData, rawDataIndex + 8)) -{ -} - -std::string MinimapEntry::GetBodySourceCode() const -{ - return StringHelper::Sprintf("0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X", unk0, unk2, unk4, unk6, - unk8); -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapList.h deleted file mode 100644 index fcf7ad7a6f..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMinimapList.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class MinimapEntry -{ -public: - MinimapEntry(const std::vector& rawData, uint32_t rawDataIndex); - - std::string GetBodySourceCode() const; - -protected: - uint16_t unk0; - uint16_t unk2; - uint16_t unk4; - uint16_t unk6; - uint16_t unk8; -}; - -class SetMinimapList : public ZRoomCommand -{ -public: - std::vector minimaps; - - SetMinimapList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; - -private: - segptr_t listSegmentAddr; - uint32_t listSegmentOffset; - int16_t scale; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetObjectList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetObjectList.cpp deleted file mode 100644 index 3048aa2d49..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetObjectList.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "SetObjectList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZNames.h" -#include "ZRoom/ZRoom.h" - -SetObjectList::SetObjectList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetObjectList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - uint8_t objectCnt = parent->GetRawData().at(rawDataIndex + 1); - uint32_t currentPtr = segmentOffset; - - objects.reserve(objectCnt); - for (uint8_t i = 0; i < objectCnt; i++) - { - uint16_t objectIndex = BitConverter::ToInt16BE(parent->GetRawData(), currentPtr); - objects.push_back(objectIndex); - currentPtr += 2; - } -} - -void SetObjectList::DeclareReferences(const std::string& prefix) -{ - if (!objects.empty()) - { - std::string declaration; - - for (size_t i = 0; i < objects.size(); i++) - { - uint16_t objectIndex = objects[i]; - declaration += - StringHelper::Sprintf(" %s,", ZNames::GetObjectName(objectIndex).c_str()); - - if (i < objects.size() - 1) - declaration += "\n"; - } - - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, objects.size() * 2, "s16", - StringHelper::Sprintf("%sObjectList_%06X", prefix.c_str(), segmentOffset), - objects.size(), declaration); - } -} - -std::string SetObjectList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "s16", listName); - return StringHelper::Sprintf("SCENE_CMD_OBJECT_LIST(%i, %s)", objects.size(), listName.c_str()); -} - -std::string SetObjectList::GetCommandCName() const -{ - return "SCmdObjectList"; -} - -RoomCommand SetObjectList::GetRoomCommand() const -{ - return RoomCommand::SetObjectList; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetObjectList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetObjectList.h deleted file mode 100644 index 03c159483c..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetObjectList.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetObjectList : public ZRoomCommand -{ -public: - std::vector objects; - - SetObjectList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetPathways.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetPathways.cpp deleted file mode 100644 index 967d10b8d5..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetPathways.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "SetPathways.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetPathways::SetPathways(ZFile* nParent) : ZRoomCommand(nParent), pathwayList(nParent) -{ -} - -void SetPathways::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ - if (segmentOffset != 0) - { - std::string varName = - StringHelper::Sprintf("%sPathway_%06X", prefix.c_str(), segmentOffset); - parent->AddDeclarationPlaceholder(segmentOffset, varName); - } -} - -void SetPathways::ParseRawDataLate() -{ - if (Globals::Instance->game == ZGame::MM_RETAIL) - { - auto numPaths = zRoom->parent->GetDeclarationSizeFromNeighbor(segmentOffset) / 8; - pathwayList.SetNumPaths(numPaths); - } - - pathwayList.ExtractFromFile(segmentOffset); -} - -void SetPathways::DeclareReferencesLate(const std::string& prefix) -{ - std::string varName = StringHelper::Sprintf("%sPathway_%06X", prefix.c_str(), segmentOffset); - pathwayList.SetName(varName); - pathwayList.DeclareReferences(prefix); - pathwayList.GetSourceOutputCode(prefix); -} - -std::string SetPathways::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "Path", listName); - return StringHelper::Sprintf("SCENE_CMD_PATH_LIST(%s)", listName.c_str()); -} - -std::string SetPathways::GetCommandCName() const -{ - return "SCmdPathList"; -} - -RoomCommand SetPathways::GetRoomCommand() const -{ - return RoomCommand::SetPathways; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetPathways.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetPathways.h deleted file mode 100644 index 9abc93d32e..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetPathways.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "Vec3s.h" -#include "ZPath.h" -#include "ZResource.h" -#include "ZRoom/ZRoomCommand.h" - -class SetPathways : public ZRoomCommand -{ -public: - ZPath pathwayList; - - SetPathways(ZFile* nParent); - - void DeclareReferences(const std::string& prefix) override; - - void ParseRawDataLate() override; - void DeclareReferencesLate(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomBehavior.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomBehavior.cpp deleted file mode 100644 index 8c6f4bf514..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomBehavior.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "SetRoomBehavior.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -SetRoomBehavior::SetRoomBehavior(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetRoomBehavior::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - gameplayFlags = cmdArg1; - gameplayFlags2 = BitConverter::ToInt32BE(parent->GetRawData(), rawDataIndex + 0x04); - - currRoomUnk2 = gameplayFlags2 & 0xFF; - - currRoomUnk5 = showInvisActors = (gameplayFlags2 >> 8) & 1; - - msgCtxUnk = (gameplayFlags2 >> 10) & 1; - - enablePosLights = (gameplayFlags2 >> 11) & 1; - kankyoContextUnkE2 = (gameplayFlags2 >> 12) & 1; -} - -std::string SetRoomBehavior::GetBodySourceCode() const -{ - if (Globals::Instance->game == ZGame::MM_RETAIL) - { - std::string enableLights = StringHelper::BoolStr(enablePosLights); - return StringHelper::Sprintf("SCENE_CMD_ROOM_BEHAVIOR(0x%02X, 0x%02X, %i, %i, %s, %i)", - gameplayFlags, currRoomUnk2, currRoomUnk5, msgCtxUnk, - enableLights.c_str(), kankyoContextUnkE2); - } - std::string showInvisible = StringHelper::BoolStr(showInvisActors); - std::string disableWarps = StringHelper::BoolStr(msgCtxUnk); - return StringHelper::Sprintf("SCENE_CMD_ROOM_BEHAVIOR(0x%02X, 0x%02X, %s, %s)", gameplayFlags, - currRoomUnk2, showInvisible.c_str(), disableWarps.c_str()); -} - -std::string SetRoomBehavior::GetCommandCName() const -{ - return "SCmdRoomBehavior"; -} - -RoomCommand SetRoomBehavior::GetRoomCommand() const -{ - return RoomCommand::SetRoomBehavior; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomBehavior.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomBehavior.h deleted file mode 100644 index 47b772d77f..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomBehavior.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetRoomBehavior : public ZRoomCommand -{ -public: - uint8_t gameplayFlags; - uint32_t gameplayFlags2; - - uint8_t currRoomUnk2; - - uint8_t showInvisActors; - uint8_t currRoomUnk5; - - uint8_t msgCtxUnk; - - uint8_t enablePosLights; - uint8_t kankyoContextUnkE2; - - SetRoomBehavior(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomList.cpp deleted file mode 100644 index 24969a14d8..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomList.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include "SetRoomList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZRoom.h" - -SetRoomList::SetRoomList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetRoomList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - int numRooms = cmdArg1; - - romfile = new RomFile(parent); - romfile->numRooms = numRooms; - romfile->ExtractFromFile(segmentOffset); - - parent->resources.push_back(romfile); - - zRoom->roomCount = numRooms; -} - -void SetRoomList::DeclareReferences(const std::string& prefix) -{ - ZRoomCommand::DeclareReferences(prefix); - - romfile->DeclareVar(prefix, ""); -} - -std::string SetRoomList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "RomFile", listName); - return StringHelper::Sprintf("SCENE_CMD_ROOM_LIST(%i, %s)", romfile->rooms.size(), - listName.c_str()); -} - -std::string SetRoomList::GetCommandCName() const -{ - return "SCmdRoomList"; -} - -RoomCommand SetRoomList::GetRoomCommand() const -{ - return RoomCommand::SetRoomList; -} - -RomFile::RomFile(ZFile* nParent) : ZResource(nParent) -{ -} - -void RomFile::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - if (reader->Attribute("NumRooms") != nullptr) - { - numRooms = StringHelper::StrToL(std::string(reader->Attribute("NumRooms"))); - } -} - -void RomFile::ParseRawData() -{ - ZResource::ParseRawData(); - - uint32_t currentPtr = rawDataIndex; - - rooms.reserve(numRooms); - for (int32_t i = 0; i < numRooms; i++) - { - RoomEntry entry(parent->GetRawData(), currentPtr); - rooms.push_back(entry); - - currentPtr += 8; - } -} - -Declaration* RomFile::DeclareVar(const std::string& prefix, const std::string& body) -{ - std::string auxName = name; - if (name == "") - auxName = StringHelper::Sprintf("%sRoomList0x%06X", prefix.c_str(), rawDataIndex); - - return parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::Align4, - rooms.size() * rooms.at(0).GetRawDataSize(), - GetSourceTypeName(), auxName, rooms.size(), body); -} - -std::string RomFile::GetBodySourceCode() const -{ - std::string declaration; - bool isFirst = true; - - for (ZFile* file : Globals::Instance->files) - { - for (ZResource* res : file->resources) - { - if (res->GetResourceType() == ZResourceType::Room) - { - std::string roomName = res->GetName(); - if (!isFirst) - declaration += "\n"; - - declaration += StringHelper::Sprintf( - "\t{ (uintptr_t)_%sSegmentRomStart, (uintptr_t)_%sSegmentRomEnd },", - roomName.c_str(), roomName.c_str()); - isFirst = false; - } - } - } - - return declaration; -} - -void RomFile::GetSourceOutputCode(const std::string& prefix) -{ - DeclareVar(prefix, GetBodySourceCode()); -} - -std::string RomFile::GetSourceTypeName() const -{ - return "RomFile"; -} - -ZResourceType RomFile::GetResourceType() const -{ - // TODO - return ZResourceType::Error; -} - -size_t RomFile::GetRawDataSize() const -{ - return 8 * rooms.size(); -} - -RoomEntry::RoomEntry(uint32_t nVAS, uint32_t nVAE) -{ - virtualAddressStart = nVAS; - virtualAddressEnd = nVAE; -} - -RoomEntry::RoomEntry(const std::vector& rawData, uint32_t rawDataIndex) - : RoomEntry(BitConverter::ToInt32BE(rawData, rawDataIndex + 0), - BitConverter::ToInt32BE(rawData, rawDataIndex + 4)) -{ -} - -size_t RoomEntry::GetRawDataSize() const -{ - return 0x08; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomList.h deleted file mode 100644 index 2ae48b68df..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetRoomList.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class RoomEntry -{ -public: - int32_t virtualAddressStart; - int32_t virtualAddressEnd; - - RoomEntry(uint32_t nVAS, uint32_t nVAE); - RoomEntry(const std::vector& rawData, uint32_t rawDataIndex); - - size_t GetRawDataSize() const; -}; - -class RomFile : public ZResource -{ -public: - RomFile(ZFile* nParent); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& body) override; - std::string GetBodySourceCode() const override; - void GetSourceOutputCode(const std::string& prefix) override; - - std::string GetSourceTypeName() const override; - virtual ZResourceType GetResourceType() const override; - - virtual size_t GetRawDataSize() const override; - - uint8_t numRooms = 0; - std::vector rooms; -}; - -class SetRoomList : public ZRoomCommand -{ -public: - // Borrowed reference. Don't delete. - RomFile* romfile = nullptr; - - SetRoomList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxModifier.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxModifier.cpp deleted file mode 100644 index b16f1355b2..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxModifier.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "SetSkyboxModifier.h" - -#include "Utils/StringHelper.h" - -SetSkyboxModifier::SetSkyboxModifier(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetSkyboxModifier::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - disableSky = parent->GetRawData().at(rawDataIndex + 0x04); - disableSunMoon = parent->GetRawData().at(rawDataIndex + 0x05); -} - -std::string SetSkyboxModifier::GetBodySourceCode() const -{ - std::string sky = StringHelper::BoolStr(disableSky); - std::string soonMoon = StringHelper::BoolStr(disableSunMoon); - return StringHelper::Sprintf("SCENE_CMD_SKYBOX_DISABLES(%s, %s)", sky.c_str(), - soonMoon.c_str()); -} - -std::string SetSkyboxModifier::GetCommandCName() const -{ - return "SCmdSkyboxDisables"; -} - -RoomCommand SetSkyboxModifier::GetRoomCommand() const -{ - return RoomCommand::SetSkyboxModifier; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxModifier.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxModifier.h deleted file mode 100644 index 65935bf928..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxModifier.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetSkyboxModifier : public ZRoomCommand -{ -public: - uint8_t disableSky; - uint8_t disableSunMoon; - - SetSkyboxModifier(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxSettings.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxSettings.cpp deleted file mode 100644 index d5ae7ef761..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxSettings.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "SetSkyboxSettings.h" -#include "Globals.h" -#include "Utils/StringHelper.h" - -SetSkyboxSettings::SetSkyboxSettings(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetSkyboxSettings::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - unk1 = cmdArg1; - skyboxNumber = parent->GetRawData().at(rawDataIndex + 0x04); - cloudsType = parent->GetRawData().at(rawDataIndex + 0x05); - isIndoors = parent->GetRawData().at(rawDataIndex + 0x06); -} - -std::string SetSkyboxSettings::GetBodySourceCode() const -{ - std::string indoors = StringHelper::BoolStr(isIndoors); - if (Globals::Instance->game == ZGame::MM_RETAIL) - return StringHelper::Sprintf("SCENE_CMD_SKYBOX_SETTINGS(0x%02X, %i, %i, %s)", unk1, - skyboxNumber, cloudsType, indoors.c_str()); - return StringHelper::Sprintf("SCENE_CMD_SKYBOX_SETTINGS(%i, %i, %s)", skyboxNumber, cloudsType, - indoors.c_str()); -} - -std::string SetSkyboxSettings::GetCommandCName() const -{ - return "SCmdSkyboxSettings"; -} - -RoomCommand SetSkyboxSettings::GetRoomCommand() const -{ - return RoomCommand::SetSkyboxSettings; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxSettings.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxSettings.h deleted file mode 100644 index 1c7e01ad40..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSkyboxSettings.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetSkyboxSettings : public ZRoomCommand -{ -public: - uint8_t unk1; // (MM Only) - uint8_t skyboxNumber; - uint8_t cloudsType; - uint8_t isIndoors; - - SetSkyboxSettings(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSoundSettings.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSoundSettings.cpp deleted file mode 100644 index 54b91328fb..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSoundSettings.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "SetSoundSettings.h" -#include "Utils/StringHelper.h" - -SetSoundSettings::SetSoundSettings(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetSoundSettings::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - reverb = cmdArg1; - nightTimeSFX = parent->GetRawData().at(rawDataIndex + 0x06); - musicSequence = parent->GetRawData().at(rawDataIndex + 0x07); -} - -std::string SetSoundSettings::GetBodySourceCode() const -{ - return StringHelper::Sprintf("SCENE_CMD_SOUND_SETTINGS(%i, %i, %i)", reverb, nightTimeSFX, - musicSequence); -} - -std::string SetSoundSettings::GetCommandCName() const -{ - return "SCmdSoundSettings"; -} - -RoomCommand SetSoundSettings::GetRoomCommand() const -{ - return RoomCommand::SetSoundSettings; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSoundSettings.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSoundSettings.h deleted file mode 100644 index f378e5e4ed..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSoundSettings.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetSoundSettings : public ZRoomCommand -{ -public: - uint8_t reverb; - uint8_t nightTimeSFX; - uint8_t musicSequence; - - SetSoundSettings(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSpecialObjects.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSpecialObjects.cpp deleted file mode 100644 index 34edf5ae63..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSpecialObjects.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "SetSpecialObjects.h" - -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZRoom/ZNames.h" - -SetSpecialObjects::SetSpecialObjects(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetSpecialObjects::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - elfMessage = cmdArg1; - globalObject = BitConverter::ToUInt16BE(parent->GetRawData(), rawDataIndex + 0x06); -} - -std::string SetSpecialObjects::GetBodySourceCode() const -{ - EnumData* enumData = &Globals::Instance->cfg.enumData; - std::string objectName = ZNames::GetObjectName(globalObject); - - if (enumData->naviQuestHintType.find(elfMessage) != enumData->naviQuestHintType.end()) - return StringHelper::Sprintf("SCENE_CMD_SPECIAL_FILES(%s, %s)", - enumData->naviQuestHintType[elfMessage].c_str(), - objectName.c_str()); - - return StringHelper::Sprintf("SCENE_CMD_SPECIAL_FILES(0x%02X, %s)", elfMessage, - objectName.c_str()); -} - -std::string SetSpecialObjects::GetCommandCName() const -{ - return "SCmdSpecialFiles"; -} - -RoomCommand SetSpecialObjects::GetRoomCommand() const -{ - return RoomCommand::SetSpecialObjects; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSpecialObjects.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetSpecialObjects.h deleted file mode 100644 index 3327d44c38..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetSpecialObjects.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetSpecialObjects : public ZRoomCommand -{ -public: - uint8_t elfMessage; - uint16_t globalObject; - - SetSpecialObjects(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetStartPositionList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetStartPositionList.cpp deleted file mode 100644 index 14ca16a962..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetStartPositionList.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "SetStartPositionList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZNames.h" -#include "ZRoom/ZRoom.h" - -SetStartPositionList::SetStartPositionList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetStartPositionList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - uint8_t numActors = cmdArg1; - - offset_t currentPtr = segmentOffset; - - actors.reserve(numActors); - for (uint32_t i = 0; i < numActors; i++) - { - actors.push_back(ActorSpawnEntry(parent->GetRawData(), currentPtr)); - currentPtr += 16; - } -} - -void SetStartPositionList::DeclareReferences(const std::string& prefix) -{ - if (!actors.empty()) - { - std::string declaration; - - size_t index = 0; - for (const auto& entry : actors) - { - declaration += StringHelper::Sprintf(" { %s },", entry.GetBodySourceCode().c_str()); - if (index + 1 < actors.size()) - declaration += "\n"; - - index++; - } - - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, actors.size() * 16, "ActorEntry", - StringHelper::Sprintf("%sStartPositionList0x%06X", prefix.c_str(), segmentOffset), - actors.size(), declaration); - } -} - -std::string SetStartPositionList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorEntry", listName); - return StringHelper::Sprintf("SCENE_CMD_SPAWN_LIST(%i, %s)", actors.size(), listName.c_str()); -} - -std::string SetStartPositionList::GetCommandCName() const -{ - return "SCmdSpawnList"; -} - -RoomCommand SetStartPositionList::GetRoomCommand() const -{ - return RoomCommand::SetStartPositionList; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetStartPositionList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetStartPositionList.h deleted file mode 100644 index 10075adf3c..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetStartPositionList.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "SetActorList.h" -#include "ZRoom/ZRoomCommand.h" - -class SetStartPositionList : public ZRoomCommand -{ -public: - std::vector actors; - - SetStartPositionList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTimeSettings.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetTimeSettings.cpp deleted file mode 100644 index 9d4d356df7..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTimeSettings.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "SetTimeSettings.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -SetTimeSettings::SetTimeSettings(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetTimeSettings::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - hour = parent->GetRawData().at(rawDataIndex + 4); - min = parent->GetRawData().at(rawDataIndex + 5); - unk = parent->GetRawData().at(rawDataIndex + 6); -} - -std::string SetTimeSettings::GetBodySourceCode() const -{ - return StringHelper::Sprintf("SCENE_CMD_TIME_SETTINGS(%i, %i, %i)", hour, min, unk); -} - -std::string SetTimeSettings::GetCommandCName() const -{ - return "SCmdTimeSettings"; -} - -RoomCommand SetTimeSettings::GetRoomCommand() const -{ - return RoomCommand::SetTimeSettings; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTimeSettings.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetTimeSettings.h deleted file mode 100644 index 7ff2711d4e..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTimeSettings.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetTimeSettings : public ZRoomCommand -{ -public: - uint8_t hour; - uint8_t min; - uint8_t unk; - - SetTimeSettings(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTransitionActorList.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetTransitionActorList.cpp deleted file mode 100644 index 67e3e4e184..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTransitionActorList.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include "SetTransitionActorList.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" -#include "ZRoom/ZNames.h" -#include "ZRoom/ZRoom.h" - -SetTransitionActorList::SetTransitionActorList(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetTransitionActorList::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - int numActors = cmdArg1; - uint32_t currentPtr = segmentOffset; - - transitionActors.reserve(numActors); - for (int32_t i = 0; i < numActors; i++) - { - TransitionActorEntry entry(parent->GetRawData(), currentPtr); - transitionActors.push_back(entry); - - currentPtr += 16; - } -} - -void SetTransitionActorList::DeclareReferences(const std::string& prefix) -{ - std::string declaration; - - size_t index = 0; - for (const auto& entry : transitionActors) - { - declaration += StringHelper::Sprintf(" { %s },", entry.GetBodySourceCode().c_str()); - if (index + 1 < transitionActors.size()) - { - declaration += "\n"; - } - - index++; - } - - parent->AddDeclarationArray( - segmentOffset, DeclarationAlignment::Align4, transitionActors.size() * 16, - "TransitionActorEntry", - StringHelper::Sprintf("%sTransitionActorList_%06X", prefix.c_str(), segmentOffset), - transitionActors.size(), declaration); -} - -std::string SetTransitionActorList::GetBodySourceCode() const -{ - std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "TransitionActorEntry", listName); - return StringHelper::Sprintf("SCENE_CMD_TRANSITION_ACTOR_LIST(%i, %s)", transitionActors.size(), - listName.c_str()); -} - -std::string SetTransitionActorList::GetCommandCName() const -{ - return "SCmdTransiActorList"; -} - -RoomCommand SetTransitionActorList::GetRoomCommand() const -{ - return RoomCommand::SetTransitionActorList; -} - -TransitionActorEntry::TransitionActorEntry(const std::vector& rawData, int rawDataIndex) -{ - frontObjectRoom = rawData[rawDataIndex + 0]; - frontTransitionReaction = rawData[rawDataIndex + 1]; - backObjectRoom = rawData[rawDataIndex + 2]; - backTransitionReaction = rawData[rawDataIndex + 3]; - actorNum = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - posX = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - posY = BitConverter::ToInt16BE(rawData, rawDataIndex + 8); - posZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 10); - rotY = BitConverter::ToInt16BE(rawData, rawDataIndex + 12); - initVar = BitConverter::ToInt16BE(rawData, rawDataIndex + 14); -} - -std::string TransitionActorEntry::GetBodySourceCode() const -{ - std::string actorStr = ZNames::GetActorName(actorNum); - - return StringHelper::Sprintf("%i, %i, %i, %i, %s, %i, %i, %i, %i, 0x%04X", frontObjectRoom, - frontTransitionReaction, backObjectRoom, backTransitionReaction, - actorStr.c_str(), posX, posY, posZ, rotY, initVar); -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTransitionActorList.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetTransitionActorList.h deleted file mode 100644 index a5ce2e66fd..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetTransitionActorList.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class TransitionActorEntry -{ -public: - uint8_t frontObjectRoom; - uint8_t frontTransitionReaction; - uint8_t backObjectRoom; - uint8_t backTransitionReaction; - uint16_t actorNum; - int16_t posX, posY, posZ; - int16_t rotY; - uint16_t initVar; - - TransitionActorEntry(const std::vector& rawData, int rawDataIndex); - - std::string GetBodySourceCode() const; -}; - -class SetTransitionActorList : public ZRoomCommand -{ -public: - std::vector transitionActors; - - SetTransitionActorList(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWind.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetWind.cpp deleted file mode 100644 index 1893b56018..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWind.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "SetWind.h" -#include "Utils/StringHelper.h" - -SetWind::SetWind(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -void SetWind::ParseRawData() -{ - ZRoomCommand::ParseRawData(); - auto& parentRawData = parent->GetRawData(); - windWest = parentRawData.at(rawDataIndex + 0x04); - windVertical = parentRawData.at(rawDataIndex + 0x05); - windSouth = parentRawData.at(rawDataIndex + 0x06); - clothFlappingStrength = parentRawData.at(rawDataIndex + 0x07); -} - -std::string SetWind::GetBodySourceCode() const -{ - return StringHelper::Sprintf("SCENE_CMD_WIND_SETTINGS(%i, %i, %i, %i)", windWest, windVertical, - windSouth, clothFlappingStrength); -} - -std::string SetWind::GetCommandCName() const -{ - return "SCmdWindSettings"; -} - -RoomCommand SetWind::GetRoomCommand() const -{ - return RoomCommand::SetWind; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWind.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetWind.h deleted file mode 100644 index 05eaafeda8..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWind.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetWind : public ZRoomCommand -{ -public: - uint8_t windWest; - uint8_t windVertical; - uint8_t windSouth; - uint8_t clothFlappingStrength; - - SetWind(ZFile* nParent); - - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - std::string GetCommandCName() const override; - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWorldMapVisited.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetWorldMapVisited.cpp deleted file mode 100644 index fa28547e62..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWorldMapVisited.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "SetWorldMapVisited.h" - -#include "Utils/StringHelper.h" -#include "Globals.h" - -SetWorldMapVisited::SetWorldMapVisited(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -std::string SetWorldMapVisited::GetBodySourceCode() const -{ - if (Globals::Instance->game == ZGame::MM_RETAIL) - return "SCENE_CMD_SET_REGION_VISITED()"; - else - return "SCENE_CMD_MISC_SETTINGS()"; -} - -std::string SetWorldMapVisited::GetCommandCName() const -{ - return "SCmdWorldMapVisited"; -} - -RoomCommand SetWorldMapVisited::GetRoomCommand() const -{ - return RoomCommand::SetWorldMapVisited; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWorldMapVisited.h b/tools/ZAPD/ZAPD/ZRoom/Commands/SetWorldMapVisited.h deleted file mode 100644 index a7ad93154d..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetWorldMapVisited.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class SetWorldMapVisited : public ZRoomCommand -{ -public: - SetWorldMapVisited(ZFile* nParent); - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused09.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/Unused09.cpp deleted file mode 100644 index 9dfcaa5c23..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused09.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "Unused09.h" -#include "Utils/StringHelper.h" - -Unused09::Unused09(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -std::string Unused09::GetBodySourceCode() const -{ - return "SCENE_CMD_UNK_09()"; -} - -std::string Unused09::GetCommandCName() const -{ - return "SceneCmd"; -} - -RoomCommand Unused09::GetRoomCommand() const -{ - return RoomCommand::Unused09; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused09.h b/tools/ZAPD/ZAPD/ZRoom/Commands/Unused09.h deleted file mode 100644 index a38985eeaa..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused09.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class Unused09 : public ZRoomCommand -{ -public: - Unused09(ZFile* nParent); - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused1D.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/Unused1D.cpp deleted file mode 100644 index b8ea13652f..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused1D.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "Unused1D.h" -#include "Utils/StringHelper.h" - -Unused1D::Unused1D(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -std::string Unused1D::GetBodySourceCode() const -{ - return StringHelper::Sprintf("{ %s, 0x00, 0x00 }", GetCommandHex().c_str()); -} - -std::string Unused1D::GetCommandCName() const -{ - return "SceneCmd"; -} - -RoomCommand Unused1D::GetRoomCommand() const -{ - return RoomCommand::Unused1D; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused1D.h b/tools/ZAPD/ZAPD/ZRoom/Commands/Unused1D.h deleted file mode 100644 index dea0f98ee5..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/Unused1D.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "ZRoom/ZRoomCommand.h" - -class Unused1D : public ZRoomCommand -{ -public: - Unused1D(ZFile* nParent); - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; - std::string GetCommandCName() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/ZRoomCommandUnk.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/ZRoomCommandUnk.cpp deleted file mode 100644 index a892086c2a..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/ZRoomCommandUnk.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "ZRoomCommandUnk.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZRoom/ZRoom.h" - -ZRoomCommandUnk::ZRoomCommandUnk(ZFile* nParent) : ZRoomCommand(nParent) -{ -} - -std::string ZRoomCommandUnk::GetBodySourceCode() const -{ - return StringHelper::Sprintf("{ %s, 0x%02X, 0x%06X } /* WARNING: " - "UNIMPLEMENTED ROOM COMMAND */", - GetCommandHex().c_str(), cmdArg1, cmdArg2); -} - -RoomCommand ZRoomCommandUnk::GetRoomCommand() const -{ - return RoomCommand::Error; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/ZRoomCommandUnk.h b/tools/ZAPD/ZAPD/ZRoom/Commands/ZRoomCommandUnk.h deleted file mode 100644 index e381fe5a52..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/ZRoomCommandUnk.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once -#include "ZRoom/ZRoomCommand.h" - -class ZRoomCommandUnk : public ZRoomCommand -{ -public: - ZRoomCommandUnk(ZFile* nParent); - - std::string GetBodySourceCode() const override; - - RoomCommand GetRoomCommand() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/ZNames.h b/tools/ZAPD/ZAPD/ZRoom/ZNames.h deleted file mode 100644 index 83c217e999..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/ZNames.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once - -#include - -#include "Globals.h" -#include "Utils/StringHelper.h" - -class ZNames -{ -public: - static std::string GetObjectName(size_t id) - { - if (id >= Globals::Instance->cfg.objectList.size()) - return StringHelper::Sprintf("0x%04X", id); - return Globals::Instance->cfg.objectList[id]; - } - - static std::string GetActorName(uint16_t id) - { - switch (Globals::Instance->game) - { - case ZGame::OOT_RETAIL: - case ZGame::OOT_SW97: - if (id < ZNames::GetNumActors()) - return Globals::Instance->cfg.actorList[id]; - else - return StringHelper::Sprintf("0x%04X", id); - case ZGame::MM_RETAIL: - { - int32_t flags = id & 0xF000; - id &= 0xFFF; - std::string name; - if (id < ZNames::GetNumActors()) - name = Globals::Instance->cfg.actorList[id]; - else - name = StringHelper::Sprintf("0x%04X", id); - - if (flags == 0) - return name; - else - return StringHelper::Sprintf("%s | 0x%04X", name.c_str(), flags); - } - } - - return ""; - } - - static std::string GetEntranceName(uint16_t id) - { - if (ZNames::GetNumEntrances() == 0 || ZNames::GetNumSpecialEntrances() == 0) - return StringHelper::Sprintf("0x%04X", id); - - if (id < ZNames::GetNumEntrances()) - return Globals::Instance->cfg.entranceList[id]; - else if ((id >= 0x7FF9 && id <= 0x7FFF) && - !((id - 0x7FF9U) > GetNumSpecialEntrances())) // Special entrances - return Globals::Instance->cfg.specialEntranceList[id - 0x7FF9]; - else - return StringHelper::Sprintf("0x%04X", id); - } - - static size_t GetNumActors() { return Globals::Instance->cfg.actorList.size(); } - static size_t GetNumEntrances() { return Globals::Instance->cfg.entranceList.size(); } - static size_t GetNumSpecialEntrances() - { - return Globals::Instance->cfg.specialEntranceList.size(); - } -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp b/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp deleted file mode 100644 index a291c36feb..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp +++ /dev/null @@ -1,409 +0,0 @@ -#include "ZRoom.h" -#include -#include -#include -#include -#include - -#include "Commands/EndMarker.h" -#include "Commands/SetCutsceneEntryList.h" -#include "Commands/SetActorList.h" -#include "Commands/SetAlternateHeaders.h" -#include "Commands/SetAnimatedMaterialList.h" -#include "Commands/SetCameraSettings.h" -#include "Commands/SetCollisionHeader.h" -#include "Commands/SetCsCamera.h" -#include "Commands/SetCutscenes.h" -#include "Commands/SetEchoSettings.h" -#include "Commands/SetEntranceList.h" -#include "Commands/SetExitList.h" -#include "Commands/SetLightList.h" -#include "Commands/SetLightingSettings.h" -#include "Commands/SetMesh.h" -#include "Commands/SetMinimapChests.h" -#include "Commands/SetMinimapList.h" -#include "Commands/SetObjectList.h" -#include "Commands/SetPathways.h" -#include "Commands/SetRoomBehavior.h" -#include "Commands/SetRoomList.h" -#include "Commands/SetSkyboxModifier.h" -#include "Commands/SetSkyboxSettings.h" -#include "Commands/SetSoundSettings.h" -#include "Commands/SetSpecialObjects.h" -#include "Commands/SetStartPositionList.h" -#include "Commands/SetTimeSettings.h" -#include "Commands/SetTransitionActorList.h" -#include "Commands/SetWind.h" -#include "Commands/SetWorldMapVisited.h" -#include "Commands/Unused09.h" -#include "Commands/Unused1D.h" -#include "Commands/ZRoomCommandUnk.h" -#include "Globals.h" -#include "Utils/File.h" -#include "Utils/Path.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZBlob.h" -#include "ZCutscene.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Room, ZRoom); -REGISTER_ZFILENODE(Scene, ZRoom); -REGISTER_ZFILENODE(AltHeader, ZRoom); - -ZRoom::ZRoom(ZFile* nParent) : ZResource(nParent) -{ - roomCount = -1; - canHaveInner = true; - RegisterOptionalAttribute("HackMode"); -} - -ZRoom::~ZRoom() -{ - for (ZRoomCommand* cmd : commands) - delete cmd; -} - -void ZRoom::ExtractWithXML(tinyxml2::XMLElement* reader, uint32_t nRawDataIndex) -{ - ZResource::ExtractWithXML(reader, nRawDataIndex); - - if (hackMode == "syotes_room") - SyotesRoomFix(); - else - DeclareVar(name, ""); -} - -void ZRoom::ExtractFromBinary(uint32_t nRawDataIndex, ZResourceType parentType) -{ - rawDataIndex = nRawDataIndex; - name = GetDefaultName(parent->GetName()); - - zroomType = ZResourceType::AltHeader; - switch (parentType) - { - case ZResourceType::Scene: - case ZResourceType::Room: - case ZResourceType::AltHeader: - parentZroomType = parentType; - break; - - default: - // TODO: error message or something - assert(false); - break; - } - - ParseRawData(); - DeclareVar(name, ""); -} - -void ZRoom::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - // TODO: HACK: remove this specific check when the repo uses the correct HackMode="syotes_room" - if (name == "syotes_room_0") - { - hackMode = "syotes_room"; - } - - std::string nodeName = std::string(reader->Name()); - if (nodeName == "Scene") - { - zroomType = ZResourceType::Scene; - } - else if (nodeName == "Room") - zroomType = ZResourceType::Room; - else if (nodeName == "AltHeader") - zroomType = ZResourceType::AltHeader; - - if (reader->Attribute("HackMode") != nullptr) - { - hackMode = std::string(reader->Attribute("HackMode")); - if (hackMode != "syotes_room") - { - std::string headerError = StringHelper::Sprintf( - "invalid value found for 'HackMode' attribute: '%s'", hackMode.c_str()); - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - headerError, ""); - } - } -} - -void ZRoom::ParseRawData() -{ - if (hackMode == "syotes_room") - return; - - bool shouldContinue = true; - uint32_t currentIndex = 0; - uint32_t currentPtr = rawDataIndex; - - const auto& rawData = parent->GetRawData(); - while (shouldContinue) - { - RoomCommand opcode = static_cast(rawData.at(currentPtr)); - - ZRoomCommand* cmd = nullptr; - - auto start = std::chrono::steady_clock::now(); - - switch (opcode) - { - case RoomCommand::SetStartPositionList: - cmd = new SetStartPositionList(parent); - break; // 0x00 - case RoomCommand::SetActorList: - cmd = new SetActorList(parent); - break; // 0x01 - case RoomCommand::SetCsCamera: - cmd = new SetCsCamera(parent); - break; // 0x02 (MM-ONLY) - case RoomCommand::SetCollisionHeader: - cmd = new SetCollisionHeader(parent); - break; // 0x03 - case RoomCommand::SetRoomList: - cmd = new SetRoomList(parent); - break; // 0x04 - case RoomCommand::SetWind: - cmd = new SetWind(parent); - break; // 0x05 - case RoomCommand::SetEntranceList: - cmd = new SetEntranceList(parent); - break; // 0x06 - case RoomCommand::SetSpecialObjects: - cmd = new SetSpecialObjects(parent); - break; // 0x07 - case RoomCommand::SetRoomBehavior: - cmd = new SetRoomBehavior(parent); - break; // 0x08 - case RoomCommand::Unused09: - cmd = new Unused09(parent); - break; // 0x09 - case RoomCommand::SetMesh: - cmd = new SetMesh(parent); - break; // 0x0A - case RoomCommand::SetObjectList: - cmd = new SetObjectList(parent); - break; // 0x0B - case RoomCommand::SetLightList: - cmd = new SetLightList(parent); - break; // 0x0C (MM-ONLY) - case RoomCommand::SetPathways: - cmd = new SetPathways(parent); - break; // 0x0D - case RoomCommand::SetTransitionActorList: - cmd = new SetTransitionActorList(parent); - break; // 0x0E - case RoomCommand::SetLightingSettings: - cmd = new SetLightingSettings(parent); - break; // 0x0F - case RoomCommand::SetTimeSettings: - cmd = new SetTimeSettings(parent); - break; // 0x10 - case RoomCommand::SetSkyboxSettings: - cmd = new SetSkyboxSettings(parent); - break; // 0x11 - case RoomCommand::SetSkyboxModifier: - cmd = new SetSkyboxModifier(parent); - break; // 0x12 - case RoomCommand::SetExitList: - cmd = new SetExitList(parent); - break; // 0x13 - case RoomCommand::EndMarker: - cmd = new EndMarker(parent); - break; // 0x14 - case RoomCommand::SetSoundSettings: - cmd = new SetSoundSettings(parent); - break; // 0x15 - case RoomCommand::SetEchoSettings: - cmd = new SetEchoSettings(parent); - break; // 0x16 - case RoomCommand::SetCutscenes: - cmd = new SetCutscenes(parent); - break; // 0x17 - case RoomCommand::SetAlternateHeaders: - cmd = new SetAlternateHeaders(parent); - break; // 0x18 - case RoomCommand::SetCameraSettings: - if (Globals::Instance->game == ZGame::MM_RETAIL) - cmd = new SetWorldMapVisited(parent); - else - cmd = new SetCameraSettings(parent); - break; // 0x19 - case RoomCommand::SetAnimatedMaterialList: - cmd = new SetAnimatedMaterialList(parent); - break; // 0x1A (MM-ONLY) - case RoomCommand::SetActorCutsceneList: - cmd = new SetActorCutsceneList(parent); - break; // 0x1B (MM-ONLY) - case RoomCommand::SetMinimapList: - cmd = new SetMinimapList(parent); - break; // 0x1C (MM-ONLY) - case RoomCommand::Unused1D: - cmd = new Unused1D(parent); - break; // 0x1D - case RoomCommand::SetMinimapChests: - cmd = new SetMinimapChests(parent); - break; // 0x1E (MM-ONLY) - default: - cmd = new ZRoomCommandUnk(parent); - } - - cmd->commandSet = rawDataIndex; - cmd->ExtractCommandFromRoom(this, currentPtr); - - if (Globals::Instance->profile) - { - auto end = std::chrono::steady_clock::now(); - int64_t diff = - std::chrono::duration_cast(end - start).count(); - if (diff > 50) - printf("OP: %s, TIME: %" PRIi64 "ms\n", cmd->GetCommandCName().c_str(), diff); - } - - cmd->cmdIndex = currentIndex; - - commands.push_back(cmd); - - if (opcode == RoomCommand::EndMarker) - shouldContinue = false; - - currentPtr += 8; - currentIndex++; - } -} - -void ZRoom::DeclareReferences(const std::string& prefix) -{ - for (auto& cmd : commands) - cmd->DeclareReferences(prefix); -} - -void ZRoom::ParseRawDataLate() -{ - for (auto& cmd : commands) - cmd->ParseRawDataLate(); -} - -void ZRoom::DeclareReferencesLate(const std::string& prefix) -{ - for (auto& cmd : commands) - cmd->DeclareReferencesLate(prefix); -} - -Declaration* ZRoom::DeclareVar(const std::string& prefix, const std::string& body) -{ - std::string auxName = name; - if (auxName == "") - auxName = GetDefaultName(prefix); - if (zroomType == ZResourceType::Scene || zroomType == ZResourceType::Room) - auxName = StringHelper::Sprintf("%sCommands", name.c_str()); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), auxName, commands.size(), body); - decl->staticConf = staticConf; - return decl; -} - -std::string ZRoom::GetBodySourceCode() const -{ - std::string declaration; - - for (size_t i = 0; i < commands.size(); i++) - { - ZRoomCommand* cmd = commands[i]; - declaration += StringHelper::Sprintf("\t%s,", cmd->GetBodySourceCode().c_str()); - - if (i + 1 < commands.size()) - declaration += "\n"; - } - - return declaration; -} - -std::string ZRoom::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sSet_%06X", prefix.c_str(), rawDataIndex); -} - -/* - * There is one room in Ocarina of Time that lacks a header. Room 120, "Syotes", dates - * back to very early in the game's development. Since this room is a special case, - * declare automatically the data its contains whitout the need of a header. - */ -void ZRoom::SyotesRoomFix() -{ - RoomShapeCullable poly(parent, 0, this); - - poly.ParseRawData(); - poly.DeclareReferences(GetName()); - parent->AddDeclaration(0, poly.GetDeclarationAlignment(), poly.GetRawDataSize(), - poly.GetSourceTypeName(), poly.GetDefaultName(GetName()), - poly.GetBodySourceCode()); -} - -ZRoomCommand* ZRoom::FindCommandOfType(RoomCommand cmdType) -{ - for (size_t i = 0; i < commands.size(); i++) - { - if (commands[i]->GetRoomCommand() == cmdType) - return commands[i]; - } - - return nullptr; -} - -size_t ZRoom::GetCommandSizeFromNeighbor(ZRoomCommand* cmd) -{ - int32_t cmdIndex = -1; - - for (size_t i = 0; i < commands.size(); i++) - { - if (commands[i] == cmd) - { - cmdIndex = i; - break; - } - } - - if (cmdIndex != -1) - { - if (cmdIndex + 1 < (int32_t)commands.size()) - return commands[cmdIndex + 1]->cmdAddress - commands[cmdIndex]->cmdAddress; - else - return parent->GetRawData().size() - commands[cmdIndex]->cmdAddress; - } - - return 0; -} - -void ZRoom::GetSourceOutputCode([[maybe_unused]] const std::string& prefix) -{ - if (hackMode != "syotes_room") - DeclareVar(prefix, GetBodySourceCode()); -} - -size_t ZRoom::GetRawDataSize() const -{ - size_t size = 0; - - for (ZRoomCommand* cmd : commands) - size += cmd->GetRawDataSize(); - - return size; -} - -std::string ZRoom::GetSourceTypeName() const -{ - return "SceneCmd"; -} - -ZResourceType ZRoom::GetResourceType() const -{ - assert(zroomType == ZResourceType::Scene || zroomType == ZResourceType::Room || - zroomType == ZResourceType::AltHeader); - return zroomType; -} diff --git a/tools/ZAPD/ZAPD/ZRoom/ZRoom.h b/tools/ZAPD/ZAPD/ZRoom/ZRoom.h deleted file mode 100644 index 950dbbb182..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/ZRoom.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "ZResource.h" -#include "ZRoomCommand.h" -#include "tinyxml2.h" - -class ZRoom : public ZResource -{ -public: - std::vector commands; - int32_t roomCount; // Only valid for scenes - - std::string hackMode; - - ZResourceType zroomType = ZResourceType::Error; - ZResourceType parentZroomType = ZResourceType::Error; - - ZRoom(ZFile* nParent); - virtual ~ZRoom(); - - void ExtractWithXML(tinyxml2::XMLElement* reader, uint32_t nRawDataIndex) override; - void ExtractFromBinary(uint32_t nRawDataIndex, ZResourceType parentType); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - void ParseRawDataLate() override; - void DeclareReferencesLate(const std::string& prefix) override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& body) override; - std::string GetBodySourceCode() const override; - - void GetSourceOutputCode(const std::string& prefix) override; - - std::string GetDefaultName(const std::string& prefix) const override; - size_t GetCommandSizeFromNeighbor(ZRoomCommand* cmd); - ZRoomCommand* FindCommandOfType(RoomCommand cmdType); - - size_t GetRawDataSize() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - -protected: - void SyotesRoomFix(); -}; diff --git a/tools/ZAPD/ZAPD/ZRoom/ZRoomCommand.cpp b/tools/ZAPD/ZAPD/ZRoom/ZRoomCommand.cpp deleted file mode 100644 index 711c86a409..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/ZRoomCommand.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "ZRoomCommand.h" - -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZRoom.h" - -ZRoomCommand::ZRoomCommand(ZFile* nParent) : ZResource(nParent) -{ -} - -void ZRoomCommand::ExtractCommandFromRoom(ZRoom* nZRoom, uint32_t nRawDataIndex) -{ - zRoom = nZRoom; - rawDataIndex = nRawDataIndex; - - ParseRawData(); -} - -void ZRoomCommand::ParseRawData() -{ - auto& parentRawData = parent->GetRawData(); - cmdID = static_cast(parentRawData.at(rawDataIndex)); - cmdAddress = rawDataIndex; - - cmdArg1 = parentRawData.at(rawDataIndex + 1); - cmdArg2 = BitConverter::ToUInt32BE(parentRawData, rawDataIndex + 4); - segmentOffset = Seg2Filespace(cmdArg2, parent->baseAddress); -} - -RoomCommand ZRoomCommand::GetRoomCommand() const -{ - return RoomCommand::Error; -} - -size_t ZRoomCommand::GetRawDataSize() const -{ - return 0x08; -} - -std::string ZRoomCommand::GetSourceTypeName() const -{ - return GetCommandCName(); -} - -ZResourceType ZRoomCommand::GetResourceType() const -{ - return ZResourceType::RoomCommand; -} - -std::string ZRoomCommand::GetCommandCName() const -{ - return "SceneCmd"; -} - -std::string ZRoomCommand::GetCommandHex() const -{ - return StringHelper::Sprintf("0x%02X", static_cast(cmdID)); -} diff --git a/tools/ZAPD/ZAPD/ZRoom/ZRoomCommand.h b/tools/ZAPD/ZAPD/ZRoom/ZRoomCommand.h deleted file mode 100644 index e4029984c9..0000000000 --- a/tools/ZAPD/ZAPD/ZRoom/ZRoomCommand.h +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once - -#include "tinyxml2.h" - -#include -#include - -#include "ZFile.h" -#include "ZResource.h" - -class ZRoom; - -enum class RoomCommand : uint8_t -{ - SetStartPositionList = 0x00, - SetActorList = 0x01, - SetCsCamera = 0x02, - SetCollisionHeader = 0x03, - SetRoomList = 0x04, - SetWind = 0x05, - SetEntranceList = 0x06, - SetSpecialObjects = 0x07, - SetRoomBehavior = 0x08, - Unused09 = 0x09, - SetMesh = 0x0A, - SetObjectList = 0x0B, - SetLightList = 0x0C, - SetPathways = 0x0D, - SetTransitionActorList = 0x0E, - SetLightingSettings = 0x0F, - SetTimeSettings = 0x10, - SetSkyboxSettings = 0x11, - SetSkyboxModifier = 0x12, - SetExitList = 0x13, - EndMarker = 0x14, - SetSoundSettings = 0x15, - SetEchoSettings = 0x16, - SetCutscenes = 0x17, - SetAlternateHeaders = 0x18, - SetCameraSettings = 0x19, - - // MM Commands - SetWorldMapVisited = 0x19, - SetAnimatedMaterialList = 0x1A, - SetActorCutsceneList = 0x1B, - SetMinimapList = 0x1C, - Unused1D = 0x1D, - SetMinimapChests = 0x1E, - - Error = 0xFF -}; - -class ZRoomCommand : public ZResource -{ -public: - int32_t cmdAddress; - uint32_t cmdIndex; - uint32_t commandSet; - RoomCommand cmdID; - offset_t segmentOffset; - - ZRoomCommand(ZFile* nParent); - virtual ~ZRoomCommand() = default; - - virtual void ExtractCommandFromRoom(ZRoom* nZRoom, uint32_t nRawDataIndex); - - void ParseRawData() override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - // Getters/Setters - virtual RoomCommand GetRoomCommand() const = 0; - size_t GetRawDataSize() const final override; - virtual std::string GetCommandCName() const; - - virtual std::string GetCommandHex() const; - -protected: - ZRoom* zRoom; - - uint8_t cmdArg1; - segptr_t cmdArg2; -}; diff --git a/tools/ZAPD/ZAPD/ZScalar.cpp b/tools/ZAPD/ZAPD/ZScalar.cpp deleted file mode 100644 index 7e4be4d57f..0000000000 --- a/tools/ZAPD/ZAPD/ZScalar.cpp +++ /dev/null @@ -1,280 +0,0 @@ -#include "ZScalar.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/File.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Scalar, ZScalar); - -ZScalar::ZScalar(ZFile* nParent) : ZResource(nParent) -{ - memset(&scalarData, 0, sizeof(ZScalarData)); - scalarType = ZScalarType::ZSCALAR_NONE; - RegisterRequiredAttribute("Type"); -} - -void ZScalar::ExtractFromBinary(uint32_t nRawDataIndex, ZScalarType nScalarType) -{ - rawDataIndex = nRawDataIndex; - scalarType = nScalarType; - - // Don't parse raw data of external files - if (parent->GetMode() == ZFileMode::ExternalFile) - return; - - ParseRawData(); -} - -void ZScalar::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - scalarType = ZScalar::MapOutputTypeToScalarType(registeredAttributes.at("Type").value); -} - -ZScalarType ZScalar::MapOutputTypeToScalarType(const std::string& type) -{ - if (type == "s8") - { - return ZScalarType::ZSCALAR_S8; - } - else if (type == "u8") - { - return ZScalarType::ZSCALAR_U8; - } - else if (type == "x8") - { - return ZScalarType::ZSCALAR_X8; - } - else if (type == "s16") - { - return ZScalarType::ZSCALAR_S16; - } - else if (type == "u16") - { - return ZScalarType::ZSCALAR_U16; - } - else if (type == "x16") - { - return ZScalarType::ZSCALAR_X16; - } - else if (type == "s32") - { - return ZScalarType::ZSCALAR_S32; - } - else if (type == "u32") - { - return ZScalarType::ZSCALAR_U32; - } - else if (type == "x32") - { - return ZScalarType::ZSCALAR_X32; - } - else if (type == "s64") - { - return ZScalarType::ZSCALAR_S64; - } - else if (type == "u64") - { - return ZScalarType::ZSCALAR_U64; - } - else if (type == "x64") - { - return ZScalarType::ZSCALAR_X64; - } - else if (type == "f32") - { - return ZScalarType::ZSCALAR_F32; - } - else if (type == "f64") - { - return ZScalarType::ZSCALAR_F64; - } - - return ZScalarType::ZSCALAR_NONE; -} - -std::string ZScalar::MapScalarTypeToOutputType(const ZScalarType scalarType) -{ - switch (scalarType) - { - case ZScalarType::ZSCALAR_S8: - return "s8"; - case ZScalarType::ZSCALAR_U8: - case ZScalarType::ZSCALAR_X8: - return "u8"; - case ZScalarType::ZSCALAR_S16: - return "s16"; - case ZScalarType::ZSCALAR_U16: - case ZScalarType::ZSCALAR_X16: - return "u16"; - case ZScalarType::ZSCALAR_S32: - return "s32"; - case ZScalarType::ZSCALAR_U32: - case ZScalarType::ZSCALAR_X32: - return "u32"; - case ZScalarType::ZSCALAR_S64: - return "s64"; - case ZScalarType::ZSCALAR_U64: - case ZScalarType::ZSCALAR_X64: - return "u64"; - case ZScalarType::ZSCALAR_F32: - return "f32"; - case ZScalarType::ZSCALAR_F64: - return "f64"; - default: - return ""; - } -} - -size_t ZScalar::MapTypeToSize(const ZScalarType scalarType) -{ - switch (scalarType) - { - case ZScalarType::ZSCALAR_S8: - return sizeof(scalarData.s8); - case ZScalarType::ZSCALAR_U8: - case ZScalarType::ZSCALAR_X8: - return sizeof(scalarData.u8); - case ZScalarType::ZSCALAR_S16: - return sizeof(scalarData.s16); - case ZScalarType::ZSCALAR_U16: - case ZScalarType::ZSCALAR_X16: - return sizeof(scalarData.u16); - case ZScalarType::ZSCALAR_S32: - return sizeof(scalarData.s32); - case ZScalarType::ZSCALAR_U32: - case ZScalarType::ZSCALAR_X32: - return sizeof(scalarData.u32); - case ZScalarType::ZSCALAR_S64: - return sizeof(scalarData.s64); - case ZScalarType::ZSCALAR_U64: - case ZScalarType::ZSCALAR_X64: - return sizeof(scalarData.u64); - case ZScalarType::ZSCALAR_F32: - return sizeof(scalarData.f32); - case ZScalarType::ZSCALAR_F64: - return sizeof(scalarData.f64); - default: - return 0; - } -} - -size_t ZScalar::GetRawDataSize() const -{ - return ZScalar::MapTypeToSize(scalarType); -} - -void ZScalar::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - switch (scalarType) - { - case ZScalarType::ZSCALAR_S8: - scalarData.s8 = BitConverter::ToInt8BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_U8: - case ZScalarType::ZSCALAR_X8: - scalarData.u8 = BitConverter::ToUInt8BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_S16: - scalarData.s16 = BitConverter::ToInt16BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_U16: - case ZScalarType::ZSCALAR_X16: - scalarData.u16 = BitConverter::ToUInt16BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_S32: - scalarData.s32 = BitConverter::ToInt32BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_U32: - case ZScalarType::ZSCALAR_X32: - scalarData.u32 = BitConverter::ToUInt32BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_S64: - scalarData.s64 = BitConverter::ToInt64BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_U64: - case ZScalarType::ZSCALAR_X64: - scalarData.u64 = BitConverter::ToUInt64BE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_F32: - scalarData.f32 = BitConverter::ToFloatBE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_F64: - scalarData.f64 = BitConverter::ToDoubleBE(rawData, rawDataIndex); - break; - case ZScalarType::ZSCALAR_NONE: - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - "invalid value found for 'Type' attribute", "Defaulting to ''"); - break; - } -} - -std::string ZScalar::GetSourceTypeName() const -{ - return ZScalar::MapScalarTypeToOutputType(scalarType); -} - -std::string ZScalar::GetBodySourceCode() const -{ - switch (scalarType) - { - case ZScalarType::ZSCALAR_S8: - return StringHelper::Sprintf("%hhd", scalarData.s8); - case ZScalarType::ZSCALAR_U8: - return StringHelper::Sprintf("%hhu", scalarData.u8); - case ZScalarType::ZSCALAR_X8: - return StringHelper::Sprintf("0x%02X", scalarData.u8); - case ZScalarType::ZSCALAR_S16: - return StringHelper::Sprintf("%hd", scalarData.s16); - case ZScalarType::ZSCALAR_U16: - return StringHelper::Sprintf("%hu", scalarData.u16); - case ZScalarType::ZSCALAR_X16: - return StringHelper::Sprintf("0x%04X", scalarData.u16); - case ZScalarType::ZSCALAR_S32: - return StringHelper::Sprintf("%d", scalarData.s32); - case ZScalarType::ZSCALAR_U32: - return StringHelper::Sprintf("%u", scalarData.u32); - case ZScalarType::ZSCALAR_X32: - return StringHelper::Sprintf("0x%08X", scalarData.u32); - case ZScalarType::ZSCALAR_S64: - return StringHelper::Sprintf("%lld", scalarData.s64); - case ZScalarType::ZSCALAR_U64: - return StringHelper::Sprintf("%llu", scalarData.u64); - case ZScalarType::ZSCALAR_X64: - return StringHelper::Sprintf("0x%016X", scalarData.u64); - case ZScalarType::ZSCALAR_F32: - return StringHelper::Sprintf("%f", scalarData.f32); - case ZScalarType::ZSCALAR_F64: - return StringHelper::Sprintf("%lf", scalarData.f64); - default: - return "SCALAR_ERROR"; - } -} - -ZResourceType ZScalar::GetResourceType() const -{ - return ZResourceType::Scalar; -} - -bool ZScalar::DoesSupportArray() const -{ - return true; -} - -DeclarationAlignment ZScalar::GetDeclarationAlignment() const -{ - switch (scalarType) - { - case ZScalarType::ZSCALAR_S64: - case ZScalarType::ZSCALAR_U64: - case ZScalarType::ZSCALAR_F64: - return DeclarationAlignment::Align8; - default: - return DeclarationAlignment::Align4; - } -} diff --git a/tools/ZAPD/ZAPD/ZScalar.h b/tools/ZAPD/ZAPD/ZScalar.h deleted file mode 100644 index 8f98f261d7..0000000000 --- a/tools/ZAPD/ZAPD/ZScalar.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once - -#include -#include -#include -#include "ZResource.h" -#include "tinyxml2.h" - -enum class ZScalarType -{ - ZSCALAR_NONE, - ZSCALAR_S8, - ZSCALAR_U8, - ZSCALAR_X8, - ZSCALAR_S16, - ZSCALAR_U16, - ZSCALAR_X16, - ZSCALAR_S32, - ZSCALAR_U32, - ZSCALAR_X32, - ZSCALAR_S64, - ZSCALAR_U64, - ZSCALAR_X64, - ZSCALAR_F32, - ZSCALAR_F64 -}; - -typedef union ZScalarData -{ - uint8_t u8; - int8_t s8; - uint16_t u16; - int16_t s16; - uint32_t u32; - int32_t s32; - uint64_t u64; - int64_t s64; - float f32; - double f64; -} ZScalarData; - -class ZScalar : public ZResource -{ - friend class ZVector; - -public: - ZScalarData scalarData; - ZScalarType scalarType; - - ZScalar(ZFile* nParent); - - void ExtractFromBinary(uint32_t nRawDataIndex, ZScalarType nScalarType); - - void ParseRawData() override; - void ParseXML(tinyxml2::XMLElement* reader) override; - std::string GetBodySourceCode() const override; - - bool DoesSupportArray() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; - - static size_t MapTypeToSize(const ZScalarType scalarType); - static ZScalarType MapOutputTypeToScalarType(const std::string& type); - static std::string MapScalarTypeToOutputType(const ZScalarType scalarType); -}; diff --git a/tools/ZAPD/ZAPD/ZSkeleton.cpp b/tools/ZAPD/ZAPD/ZSkeleton.cpp deleted file mode 100644 index 86b578639f..0000000000 --- a/tools/ZAPD/ZAPD/ZSkeleton.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "ZSkeleton.h" - -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" - -REGISTER_ZFILENODE(Skeleton, ZSkeleton); -REGISTER_ZFILENODE(LimbTable, ZLimbTable); - -ZSkeleton::ZSkeleton(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("Type"); - RegisterRequiredAttribute("LimbType"); - RegisterOptionalAttribute("EnumName"); - RegisterOptionalAttribute("LimbNone"); - RegisterOptionalAttribute("LimbMax"); -} - -void ZSkeleton::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string skelTypeXml = registeredAttributes.at("Type").value; - - if (skelTypeXml == "Flex") - type = ZSkeletonType::Flex; - else if (skelTypeXml == "Curve") - type = ZSkeletonType::Curve; - else if (skelTypeXml != "Normal") - { - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - "invalid value found for 'Type' attribute", ""); - } - - std::string limbTypeXml = registeredAttributes.at("LimbType").value; - limbType = ZLimb::GetTypeByAttributeName(limbTypeXml); - if (limbType == ZLimbType::Invalid) - { - HANDLE_ERROR_RESOURCE( - WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - StringHelper::Sprintf("invalid value '%s' found for 'LimbType' attribute", - limbTypeXml.c_str()), - "Defaulting to 'Standard'."); - } - - enumName = registeredAttributes.at("EnumName").value; - limbNoneName = registeredAttributes.at("LimbNone").value; - limbMaxName = registeredAttributes.at("LimbMax").value; - - if (enumName != "") - { - if (limbNoneName == "" || limbMaxName == "") - { - HANDLE_ERROR_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex, - "'EnumName' attribute was used but either 'LimbNone' or " - "'LimbMax' attribute is missing", - ""); - } - } - - if (limbNoneName != "") - { - if (limbMaxName == "") - { - HANDLE_ERROR_RESOURCE( - WarningType::MissingAttribute, parent, this, rawDataIndex, - "'LimbNone' attribute was used but 'LimbMax' attribute is missing", ""); - } - } - - if (limbMaxName != "") - { - if (limbNoneName == "") - { - HANDLE_ERROR_RESOURCE( - WarningType::MissingAttribute, parent, this, rawDataIndex, - "'LimbMax' attribute was used but 'LimbNone' attribute is missing", ""); - } - } -} - -void ZSkeleton::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - limbsArrayAddress = BitConverter::ToUInt32BE(rawData, rawDataIndex); - limbCount = BitConverter::ToUInt8BE(rawData, rawDataIndex + 4); - - if (type == ZSkeletonType::Flex) - { - dListCount = BitConverter::ToUInt8BE(rawData, rawDataIndex + 8); - } -} - -void ZSkeleton::DeclareReferences(const std::string& prefix) -{ - std::string defaultPrefix = name; - if (defaultPrefix == "") - defaultPrefix = prefix; - - ZResource::DeclareReferences(defaultPrefix); - - if (limbsArrayAddress != SEGMENTED_NULL && GETSEGNUM(limbsArrayAddress) == parent->segment) - { - offset_t ptr = Seg2Filespace(limbsArrayAddress, parent->baseAddress); - - if (!parent->HasDeclaration(ptr)) - { - limbsTable = new ZLimbTable(parent); - limbsTable->ExtractFromBinary(ptr, limbType, limbCount); - limbsTable->SetName(StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str())); - parent->AddResource(limbsTable); - } - else - { - limbsTable = static_cast(parent->FindResource(ptr)); - } - - if (limbsTable->enumName == "") - { - limbsTable->enumName = enumName; - } - if (limbsTable->limbNoneName == "") - { - limbsTable->limbNoneName = limbNoneName; - } - if (limbsTable->limbMaxName == "") - { - limbsTable->limbMaxName = limbMaxName; - } - } -} - -std::string ZSkeleton::GetBodySourceCode() const -{ - std::string limbArrayName; - Globals::Instance->GetSegmentedPtrName(limbsArrayAddress, parent, "", limbArrayName); - - std::string countStr; - assert(limbsTable != nullptr); - // There are some Skeletons with the wrong limb count on them, so this check is necessary. - if (limbsTable->count == limbCount) - { - countStr = StringHelper::Sprintf("ARRAY_COUNT(%s)", limbArrayName.c_str()); - } - else - { - countStr = StringHelper::Sprintf("%i", limbCount); - } - - switch (type) - { - case ZSkeletonType::Normal: - case ZSkeletonType::Curve: - return StringHelper::Sprintf("\n\t%s, %s\n", limbArrayName.c_str(), countStr.c_str()); - - case ZSkeletonType::Flex: - return StringHelper::Sprintf("\n\t{ %s, %s }, %i\n", limbArrayName.c_str(), - countStr.c_str(), dListCount); - } - - // TODO: Throw exception? - return "ERROR"; -} - -size_t ZSkeleton::GetRawDataSize() const -{ - switch (type) - { - case ZSkeletonType::Flex: - return 0xC; - case ZSkeletonType::Normal: - case ZSkeletonType::Curve: - default: - return 0x8; - } -} - -std::string ZSkeleton::GetSourceTypeName() const -{ - switch (type) - { - case ZSkeletonType::Normal: - return "SkeletonHeader"; - case ZSkeletonType::Flex: - return "FlexSkeletonHeader"; - case ZSkeletonType::Curve: - return "CurveSkeletonHeader"; - } - - return "SkeletonHeader"; -} - -ZResourceType ZSkeleton::GetResourceType() const -{ - return ZResourceType::Skeleton; -} - -DeclarationAlignment ZSkeleton::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align4; -} - -uint8_t ZSkeleton::GetLimbCount() -{ - return limbCount; -} - -/* ZLimbTable */ - -ZLimbTable::ZLimbTable(ZFile* nParent) : ZResource(nParent) -{ - RegisterRequiredAttribute("LimbType"); - RegisterRequiredAttribute("Count"); - RegisterOptionalAttribute("EnumName"); - RegisterOptionalAttribute("LimbNone"); - RegisterOptionalAttribute("LimbMax"); -} - -void ZLimbTable::ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nLimbType, size_t nCount) -{ - rawDataIndex = nRawDataIndex; - limbType = nLimbType; - count = nCount; - - ParseRawData(); -} - -void ZLimbTable::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string limbTypeXml = registeredAttributes.at("LimbType").value; - limbType = ZLimb::GetTypeByAttributeName(limbTypeXml); - if (limbType == ZLimbType::Invalid) - { - HANDLE_WARNING_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - "invalid value found for 'LimbType' attribute.", - "Defaulting to 'Standard'."); - limbType = ZLimbType::Standard; - } - - count = StringHelper::StrToL(registeredAttributes.at("Count").value); - - enumName = registeredAttributes.at("EnumName").value; - limbNoneName = registeredAttributes.at("LimbNone").value; - limbMaxName = registeredAttributes.at("LimbMax").value; - - if (enumName != "") - { - if (limbNoneName == "" || limbMaxName == "") - { - HANDLE_ERROR_RESOURCE( - WarningType::MissingAttribute, parent, this, rawDataIndex, - "'EnumName' attribute was used but 'LimbNone'/'LimbMax' attributes is missing", ""); - } - } - - if (limbNoneName != "") - { - if (limbMaxName == "") - { - HANDLE_ERROR_RESOURCE( - WarningType::MissingAttribute, parent, this, rawDataIndex, - "'LimbNone' attribute was used but 'LimbMax' attribute is missing", ""); - } - } - - if (limbMaxName != "") - { - if (limbNoneName == "") - { - HANDLE_ERROR_RESOURCE( - WarningType::MissingAttribute, parent, this, rawDataIndex, - "'LimbMax' attribute was used but 'LimbNone' attribute is missing", ""); - } - } -} - -void ZLimbTable::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - uint32_t ptr = rawDataIndex; - - limbsAddresses.reserve(count); - for (size_t i = 0; i < count; i++) - { - limbsAddresses.push_back(BitConverter::ToUInt32BE(rawData, ptr)); - ptr += 4; - } -} - -void ZLimbTable::DeclareReferences(const std::string& prefix) -{ - std::string varPrefix = name; - if (varPrefix == "") - varPrefix = prefix; - - ZResource::DeclareReferences(varPrefix); - limbsReferences.reserve(count); - for (size_t i = 0; i < count; i++) - { - segptr_t limbAddress = limbsAddresses[i]; - - if (limbAddress != 0 && GETSEGNUM(limbAddress) == parent->segment) - { - uint32_t limbOffset = Seg2Filespace(limbAddress, parent->baseAddress); - ZLimb* limb; - - if (!parent->HasDeclaration(limbOffset)) - { - limb = new ZLimb(parent); - limb->ExtractFromBinary(limbOffset, limbType); - limb->SetName(limb->GetDefaultName(varPrefix)); - limb->DeclareVar(varPrefix, ""); - limb->DeclareReferences(varPrefix); - parent->AddResource(limb); - } - else - { - limb = static_cast(parent->FindResource(limbOffset)); - assert(limb != nullptr); - assert(limb->GetResourceType() == ZResourceType::Limb); - } - - limb->limbsTable = this; - limb->SetLimbIndex(i + 1); - - limbsReferences.push_back(limb); - } - } -} - -Declaration* ZLimbTable::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), auxName, limbsAddresses.size(), bodyStr); - decl->staticConf = staticConf; - return decl; -} - -std::string ZLimbTable::GetBodySourceCode() const -{ - std::string body; - - for (size_t i = 0; i < count; i++) - { - std::string limbName; - Globals::Instance->GetSegmentedPtrName(limbsAddresses[i], parent, "", limbName); - body += StringHelper::Sprintf("\t%s,", limbName.c_str()); - - auto& limb = limbsReferences.at(i); - std::string limbEnumName = limb->enumName; - if (limbEnumName != "") - { - body += StringHelper::Sprintf(" /* %s */", limbEnumName.c_str()); - } - - if (i + 1 < count) - body += "\n"; - } - - return body; -} - -std::string ZLimbTable::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix) -{ - if (limbNoneName == "" || limbMaxName == "" || enumName == "") - { - // Don't produce a enum of any of those attributes is missing - return ""; - } - - std::string limbEnum = StringHelper::Sprintf("typedef enum %s {\n", enumName.c_str()); - - // This assumes there isn't any skeleton with more than 0x100 limbs - - limbEnum += StringHelper::Sprintf(" /* 0x00 */ %s,\n", limbNoneName.c_str()); - - size_t i = 0; - for (; i < count; i++) - { - auto& limb = limbsReferences.at(i); - std::string limbEnumName = limb->enumName; - - if (limbEnumName == "") - { - HANDLE_ERROR_RESOURCE( - WarningType::MissingAttribute, parent, this, rawDataIndex, - "Skeleton's enum attributes were used but at least one limb is missing its " - "'LimbName' attribute", - StringHelper::Sprintf("When processing limb %02i, named '%s' at offset '0x%X'", - i + 1, limb->GetName().c_str(), limb->GetRawDataIndex())); - } - - limbEnum += StringHelper::Sprintf(" /* 0x%02X */ %s,\n", i + 1, limbEnumName.c_str()); - } - - limbEnum += StringHelper::Sprintf(" /* 0x%02X */ %s\n", i + 1, limbMaxName.c_str()); - - limbEnum += StringHelper::Sprintf("} %s;\n", enumName.c_str()); - - return limbEnum; -} - -std::string ZLimbTable::GetSourceTypeName() const -{ - switch (limbType) - { - case ZLimbType::Standard: - case ZLimbType::LOD: - case ZLimbType::Skin: - return "void*"; - - case ZLimbType::Curve: - case ZLimbType::Legacy: - return StringHelper::Sprintf("%s*", ZLimb::GetSourceTypeName(limbType)); - - case ZLimbType::Invalid: - // TODO: Proper error message or something. - assert("Invalid limb type.\n"); - } - - return "ERROR"; -} - -ZResourceType ZLimbTable::GetResourceType() const -{ - return ZResourceType::LimbTable; -} - -size_t ZLimbTable::GetRawDataSize() const -{ - return 4 * limbsAddresses.size(); -} - -std::string ZLimbTable::GetLimbEnumName(uint8_t limbIndex) const -{ - if (limbIndex == 0xFF) - { - return "LIMB_DONE"; - } - - if (limbIndex < count) - { - std::string limbEnumName = limbsReferences.at(limbIndex)->enumName; - if (limbEnumName != "") - { - return StringHelper::Sprintf("%s - 1", limbEnumName.c_str()); - } - } - else - { - HANDLE_WARNING_RESOURCE(WarningType::InvalidExtractedData, parent, this, rawDataIndex, - StringHelper::Sprintf("Limb index '%02i' out of range", limbIndex), - ""); - } - - return StringHelper::Sprintf("0x%02X", limbIndex); -} diff --git a/tools/ZAPD/ZAPD/ZSkeleton.h b/tools/ZAPD/ZAPD/ZSkeleton.h deleted file mode 100644 index c437a8484c..0000000000 --- a/tools/ZAPD/ZAPD/ZSkeleton.h +++ /dev/null @@ -1,85 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "ZDisplayList.h" -#include "ZFile.h" -#include "ZLimb.h" - -enum class ZSkeletonType -{ - Normal, - Flex, - Curve, -}; - -class ZLimbTable : public ZResource -{ -public: - ZLimbType limbType = ZLimbType::Standard; - size_t count = 0; - - std::vector limbsAddresses; - std::vector limbsReferences; // borrowed pointers, do not delete! - - // XML attributes - std::string enumName; - std::string limbNoneName; - std::string limbMaxName; - - ZLimbTable(ZFile* nParent); - - void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nLimbType, size_t nCount); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceOutputHeader(const std::string& prefix) override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - - std::string GetLimbEnumName(uint8_t limbIndex) const; -}; - -class ZSkeleton : public ZResource -{ -public: - ZSkeletonType type = ZSkeletonType::Normal; - ZLimbType limbType = ZLimbType::Standard; - std::string enumName; - std::string limbNoneName; - std::string limbMaxName; - - segptr_t limbsArrayAddress; - uint8_t limbCount = 0; - uint8_t dListCount = 0; // FLEX SKELETON ONLY - - ZSkeleton(ZFile* nParent); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; - - uint8_t GetLimbCount(); - -protected: - ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete! -}; diff --git a/tools/ZAPD/ZAPD/ZString.cpp b/tools/ZAPD/ZAPD/ZString.cpp deleted file mode 100644 index 965d4d6360..0000000000 --- a/tools/ZAPD/ZAPD/ZString.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "ZString.h" - -#include "Utils/File.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(String, ZString); - -ZString::ZString(ZFile* nParent) : ZResource(nParent) -{ -} - -void ZString::ParseRawData() -{ - size_t size = 0; - const auto& rawData = parent->GetRawData(); - const auto& rawDataArr = rawData.data(); - size_t rawDataSize = rawData.size(); - for (size_t i = rawDataIndex; i < rawDataSize; ++i) - { - ++size; - if (rawDataArr[i] == '\0') - { - break; - } - } - - auto dataStart = rawData.begin() + rawDataIndex; - strData.assign(dataStart, dataStart + size); -} - -Declaration* ZString::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), auxName, 0, bodyStr); - decl->staticConf = staticConf; - return decl; -} - -std::string ZString::GetBodySourceCode() const -{ - return StringHelper::Sprintf("\t\"%s\"", strData.data()); -} - -std::string ZString::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix) -{ - return StringHelper::Sprintf("#define %s_macro \"%s\"", name.c_str(), strData.data()); -} - -std::string ZString::GetSourceTypeName() const -{ - return "char"; -} - -ZResourceType ZString::GetResourceType() const -{ - return ZResourceType::String; -} - -size_t ZString::GetRawDataSize() const -{ - return strData.size(); -} diff --git a/tools/ZAPD/ZAPD/ZString.h b/tools/ZAPD/ZAPD/ZString.h deleted file mode 100644 index 6c58ebdcb5..0000000000 --- a/tools/ZAPD/ZAPD/ZString.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "ZResource.h" -#include "tinyxml2.h" - -class ZString : public ZResource -{ -public: - ZString(ZFile* nParent); - - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - std::string GetSourceOutputHeader(const std::string& prefix) override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; - -protected: - std::vector strData; -}; diff --git a/tools/ZAPD/ZAPD/ZSurfaceType.cpp b/tools/ZAPD/ZAPD/ZSurfaceType.cpp deleted file mode 100644 index 27e73accc2..0000000000 --- a/tools/ZAPD/ZAPD/ZSurfaceType.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "ZSurfaceType.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -REGISTER_ZFILENODE(SurfaceType, ZSurfaceType); - -ZSurfaceType::ZSurfaceType(ZFile* nParent) : ZResource(nParent) -{ -} - -ZSurfaceType::~ZSurfaceType() -{ -} - -void ZSurfaceType::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - data[0] = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0); - data[1] = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); -} - -void ZSurfaceType::DeclareReferences(const std::string& prefix) -{ - std::string declaration; - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(), - GetSourceTypeName(), name.c_str(), GetBodySourceCode()); -} - -std::string ZSurfaceType::GetBodySourceCode() const -{ - return StringHelper::Sprintf("{0x%08X, 0x%08X}", data[0], data[1]); -} - -std::string ZSurfaceType::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sSurfaceType_%06X", prefix.c_str(), rawDataIndex); -} - -ZResourceType ZSurfaceType::GetResourceType() const -{ - return ZResourceType::SurfaceType; -} - -size_t ZSurfaceType::GetRawDataSize() const -{ - return 8; -} - -std::string ZSurfaceType::GetSourceTypeName() const -{ - return "SurfaceType"; -} - -bool ZSurfaceType::DoesSupportArray() const -{ - return true; -} diff --git a/tools/ZAPD/ZAPD/ZSurfaceType.h b/tools/ZAPD/ZAPD/ZSurfaceType.h deleted file mode 100644 index 3bbddee8ce..0000000000 --- a/tools/ZAPD/ZAPD/ZSurfaceType.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include -#include "ZFile.h" -#include "ZResource.h" - -class ZSurfaceType : public ZResource -{ -public: - std::array data; - - ZSurfaceType(ZFile* nParent); - ~ZSurfaceType(); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - bool DoesSupportArray() const override; - - size_t GetRawDataSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZSymbol.cpp b/tools/ZAPD/ZAPD/ZSymbol.cpp deleted file mode 100644 index eabfc2faae..0000000000 --- a/tools/ZAPD/ZAPD/ZSymbol.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "ZSymbol.h" - -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Symbol, ZSymbol); - -ZSymbol::ZSymbol(ZFile* nParent) : ZResource(nParent) -{ - RegisterOptionalAttribute("Type"); - RegisterOptionalAttribute("TypeSize"); - RegisterOptionalAttribute("Count"); -} - -void ZSymbol::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string typeXml = registeredAttributes.at("Type").value; - - if (typeXml == "") - { - HANDLE_WARNING_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex, - "missing 'Type' attribute in ", "Defaulting to 'void*'."); - type = "void*"; - } - else - { - type = typeXml; - } - - std::string typeSizeXml = registeredAttributes.at("TypeSize").value; - if (typeSizeXml == "") - { - HANDLE_WARNING_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex, - "missing 'TypeSize' attribute in ", "Defaulting to '4'."); - typeSize = 4; // Size of a word. - } - else - { - typeSize = StringHelper::StrToL(typeSizeXml, 0); - } - - if (registeredAttributes.at("Count").wasSet) - { - isArray = true; - - std::string countXml = registeredAttributes.at("Count").value; - if (countXml != "") - count = StringHelper::StrToL(countXml, 0); - } - - if (registeredAttributes.at("Static").value == "On") - { - HANDLE_WARNING_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - "a cannot be marked as static", - "Disabling static for this resource."); - } - staticConf = StaticConfig::Off; -} - -Declaration* ZSymbol::DeclareVar([[maybe_unused]] const std::string& prefix, - [[maybe_unused]] const std::string& bodyStr) -{ - return nullptr; -} - -size_t ZSymbol::GetRawDataSize() const -{ - if (isArray) - return count * typeSize; - - return typeSize; -} - -std::string ZSymbol::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix) -{ - if (isArray) - { - if (count == 0) - return StringHelper::Sprintf("extern %s %s[];\n", type.c_str(), name.c_str()); - else - return StringHelper::Sprintf("extern %s %s[%i];\n", type.c_str(), name.c_str(), count); - } - - return StringHelper::Sprintf("extern %s %s;\n", type.c_str(), name.c_str()); -} - -std::string ZSymbol::GetSourceTypeName() const -{ - return type; -} - -ZResourceType ZSymbol::GetResourceType() const -{ - return ZResourceType::Symbol; -} diff --git a/tools/ZAPD/ZAPD/ZSymbol.h b/tools/ZAPD/ZAPD/ZSymbol.h deleted file mode 100644 index 7cb14aa9b4..0000000000 --- a/tools/ZAPD/ZAPD/ZSymbol.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "ZResource.h" -#include "tinyxml2.h" - -class ZSymbol : public ZResource -{ -protected: - std::string type; - size_t typeSize; - bool isArray = false; - uint32_t count = 0; - -public: - ZSymbol(ZFile* nParent); - - void ParseXML(tinyxml2::XMLElement* reader) override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - - std::string GetSourceOutputHeader(const std::string& prefix) override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - size_t GetRawDataSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZTexture.cpp b/tools/ZAPD/ZAPD/ZTexture.cpp deleted file mode 100644 index 0d66ba7da3..0000000000 --- a/tools/ZAPD/ZAPD/ZTexture.cpp +++ /dev/null @@ -1,978 +0,0 @@ -#include "ZTexture.h" - -#include - -#include "CRC32.h" -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/Directory.h" -#include "Utils/File.h" -#include "Utils/Path.h" -#include "WarningHandler.h" - -REGISTER_ZFILENODE(Texture, ZTexture); - -ZTexture::ZTexture(ZFile* nParent) : ZResource(nParent) -{ - width = 0; - height = 0; - dWordAligned = true; - splitTlut = false; - - RegisterRequiredAttribute("Width"); - RegisterRequiredAttribute("Height"); - RegisterRequiredAttribute("Format"); - RegisterOptionalAttribute("TlutOffset"); - RegisterOptionalAttribute("ExternalTlut"); - RegisterOptionalAttribute("ExternalTlutOffset"); - RegisterOptionalAttribute("SplitTlut"); -} - -void ZTexture::ExtractFromBinary(uint32_t nRawDataIndex, int32_t nWidth, int32_t nHeight, - TextureType nType, bool nIsPalette) -{ - width = nWidth; - height = nHeight; - format = nType; - rawDataIndex = nRawDataIndex; - isPalette = nIsPalette; - name = GetDefaultName(parent->GetName()); - outName = name; - - // Don't parse raw data of external files - if (parent->GetMode() == ZFileMode::ExternalFile) - return; - - ParseRawData(); - CalcHash(); -} - -void ZTexture::FromPNG(const fs::path& pngFilePath, TextureType texType) -{ - format = texType; - name = StringHelper::Split(Path::GetFileNameWithoutExtension(pngFilePath.string()), ".")[0]; - PrepareRawDataFromFile(pngFilePath); -} - -void ZTexture::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - std::string widthXml = registeredAttributes.at("Width").value; - std::string heightXml = registeredAttributes.at("Height").value; - std::string SplitTlutXml = registeredAttributes.at("SplitTlut").value; - - if (!StringHelper::HasOnlyDigits(widthXml)) - { - std::string errorHeader = StringHelper::Sprintf( - "value of 'Width' attribute has non-decimal digits: '%s'", widthXml.c_str()); - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - errorHeader, ""); - } - if (!StringHelper::HasOnlyDigits(heightXml)) - { - std::string errorHeader = StringHelper::Sprintf( - "value of 'Height' attribute has non-decimal digits: '%s'", heightXml.c_str()); - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - errorHeader, ""); - } - - if (!registeredAttributes.at("ExternalTlut").wasSet && - registeredAttributes.at("SplitTlut").wasSet) - { - std::string errorHeader = - StringHelper::Sprintf("SplitTlut set without using an external tlut"); - HANDLE_WARNING_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - errorHeader, ""); - } - - if (!SplitTlutXml.empty()) - { - if (!tinyxml2::XMLUtil::ToBool(SplitTlutXml.c_str(), &splitTlut)) - { - std::string errorHeader = StringHelper::Sprintf( - "Invalid value passed to SplitTlut: '%s'. Valid values are true, false, 1, 0", - SplitTlutXml.c_str()); - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - errorHeader, ""); - } - } - - width = StringHelper::StrToL(widthXml); - height = StringHelper::StrToL(heightXml); - - std::string formatStr = registeredAttributes.at("Format").value; - format = GetTextureTypeFromString(formatStr); - - if (format == TextureType::Error) - { - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - "invalid value found for 'Format' attribute", ""); - } - - const auto& tlutOffsetAttr = registeredAttributes.at("TlutOffset"); - if (tlutOffsetAttr.wasSet) - { - switch (format) - { - case TextureType::Palette4bpp: - case TextureType::Palette8bpp: - tlutOffset = StringHelper::StrToL(tlutOffsetAttr.value, 16); - break; - - default: - HANDLE_ERROR_RESOURCE(WarningType::InvalidXML, parent, this, rawDataIndex, - "'TlutOffset' declared in non color-indexed (ci4 or ci8) texture", - ""); - break; - } - } -} - -void ZTexture::ParseRawData() -{ - if ((parent->baseAddress + rawDataIndex) % 8 != 0) - dWordAligned = false; - - switch (format) - { - case TextureType::RGBA16bpp: - ConvertN64ToBitmap_RGBA16(); - break; - case TextureType::RGBA32bpp: - ConvertN64ToBitmap_RGBA32(); - break; - case TextureType::Grayscale4bpp: - ConvertN64ToBitmap_Grayscale4(); - break; - case TextureType::Grayscale8bpp: - ConvertN64ToBitmap_Grayscale8(); - break; - case TextureType::GrayscaleAlpha4bpp: - ConvertN64ToBitmap_GrayscaleAlpha4(); - break; - case TextureType::GrayscaleAlpha8bpp: - ConvertN64ToBitmap_GrayscaleAlpha8(); - break; - case TextureType::GrayscaleAlpha16bpp: - ConvertN64ToBitmap_GrayscaleAlpha16(); - break; - case TextureType::Palette4bpp: - ConvertN64ToBitmap_Palette4(); - break; - case TextureType::Palette8bpp: - ConvertN64ToBitmap_Palette8(); - break; - case TextureType::Error: - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, rawDataIndex, - StringHelper::Sprintf("Invalid texture format", format), ""); - assert(!"TODO"); - break; - } -} - -void ZTexture::ParseRawDataLate() -{ - if (registeredAttributes["ExternalTlut"].wasSet) - { - const std::string externPalette = registeredAttributes["ExternalTlut"].value; - for (const auto& file : Globals::Instance->files) - { - if (file->GetName() == externPalette) - { - offset_t palOffset = 0; - if (registeredAttributes["ExternalTlutOffset"].wasSet) - { - palOffset = - StringHelper::StrToL(registeredAttributes["ExternalTlutOffset"].value, 16); - } - else - { - HANDLE_WARNING_RESOURCE( - WarningType::MissingOffsets, parent, this, rawDataIndex, - StringHelper::Sprintf( - "No ExternalTlutOffset Given. Assuming offset of 0x0"), - ""); - } - for (const auto& res : file->resources) - { - if (res->GetRawDataIndex() == palOffset) - { - ZTexture* palette = (ZTexture*)res; - ZTexture tlutTemp(file); - - tlut = &tlutTemp; - tlut->ExtractFromBinary(palOffset, palette->width, palette->height, - TextureType::RGBA16bpp, true); - SetTlut(tlut); - } - } - } - } - } -} - -void ZTexture::ConvertN64ToBitmap_RGBA16() -{ - textureData.InitEmptyRGBImage(width, height, true); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x++) - { - int32_t pos = rawDataIndex + ((y * width) + x) * 2; - uint16_t data = parentRawData.at(pos + 1) | (parentRawData.at(pos) << 8); - uint8_t r = (data & 0xF800) >> 11; - uint8_t g = (data & 0x07C0) >> 6; - uint8_t b = (data & 0x003E) >> 1; - uint8_t alpha = data & 0x01; - - textureData.SetRGBPixel(y, x, (r << 3) | (r >> 2), (g << 3) | (g >> 2), - (b << 3) | (b >> 2), alpha * 255); - } - } -} - -void ZTexture::ConvertN64ToBitmap_RGBA32() -{ - textureData.InitEmptyRGBImage(width, height, true); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x++) - { - size_t pos = rawDataIndex + ((y * width) + x) * 4; - uint8_t r = parentRawData.at(pos + 0); - uint8_t g = parentRawData.at(pos + 1); - uint8_t b = parentRawData.at(pos + 2); - uint8_t alpha = parentRawData.at(pos + 3); - - textureData.SetRGBPixel(y, x, r, g, b, alpha); - } - } -} - -void ZTexture::ConvertN64ToBitmap_Grayscale4() -{ - textureData.InitEmptyRGBImage(width, height, false); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x += 2) - { - for (uint8_t i = 0; i < 2; i++) - { - size_t pos = rawDataIndex + ((y * width) + x) / 2; - uint8_t grayscale = 0; - - if (i == 0) - grayscale = parentRawData.at(pos) & 0xF0; - else - grayscale = (parentRawData.at(pos) & 0x0F) << 4; - - textureData.SetGrayscalePixel(y, x + i, (grayscale << 4) | grayscale); - } - } - } -} - -void ZTexture::ConvertN64ToBitmap_Grayscale8() -{ - textureData.InitEmptyRGBImage(width, height, false); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x++) - { - size_t pos = rawDataIndex + ((y * width) + x) * 1; - - textureData.SetGrayscalePixel(y, x, parentRawData.at(pos)); - } - } -} - -void ZTexture::ConvertN64ToBitmap_GrayscaleAlpha4() -{ - textureData.InitEmptyRGBImage(width, height, true); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x += 2) - { - for (uint16_t i = 0; i < 2; i++) - { - size_t pos = rawDataIndex + ((y * width) + x) / 2; - uint8_t data = 0; - - if (i == 0) - data = (parentRawData.at(pos) & 0xF0) >> 4; - else - data = parentRawData.at(pos) & 0x0F; - - uint8_t grayscale = data & 0b1110; - grayscale = (grayscale << 4) | (grayscale << 1) | (grayscale >> 2); - uint8_t alpha = (data & 0x01) ? 255 : 0; - - textureData.SetGrayscalePixel(y, x + i, grayscale, alpha); - } - } - } -} - -void ZTexture::ConvertN64ToBitmap_GrayscaleAlpha8() -{ - textureData.InitEmptyRGBImage(width, height, true); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x++) - { - size_t pos = rawDataIndex + ((y * width) + x) * 1; - uint8_t pixel = parentRawData.at(pos); - uint8_t data = (pixel >> 4) & 0xF; - - data = (data << 4) | data; - uint8_t grayscale = data; - uint8_t alpha = (pixel & 0xF); - alpha = (alpha << 4) | alpha; - - textureData.SetGrayscalePixel(y, x, grayscale, alpha); - } - } -} - -void ZTexture::ConvertN64ToBitmap_GrayscaleAlpha16() -{ - textureData.InitEmptyRGBImage(width, height, true); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x++) - { - size_t pos = rawDataIndex + ((y * width) + x) * 2; - uint8_t grayscale = parentRawData.at(pos + 0); - uint8_t alpha = parentRawData.at(pos + 1); - - textureData.SetGrayscalePixel(y, x, grayscale, alpha); - } - } -} - -void ZTexture::ConvertN64ToBitmap_Palette4() -{ - textureData.InitEmptyPaletteImage(width, height); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x += 2) - { - for (uint16_t i = 0; i < 2; i++) - { - size_t pos = rawDataIndex + ((y * width) + x) / 2; - uint8_t paletteIndex = 0; - - if (i == 0) - paletteIndex = (parentRawData.at(pos) & 0xF0) >> 4; - else - paletteIndex = (parentRawData.at(pos) & 0x0F); - - textureData.SetIndexedPixel(y, x + i, paletteIndex, paletteIndex * 16); - } - } - } -} - -void ZTexture::ConvertN64ToBitmap_Palette8() -{ - textureData.InitEmptyPaletteImage(width, height); - const auto& parentRawData = parent->GetRawData(); - for (size_t y = 0; y < height; y++) - { - for (size_t x = 0; x < width; x++) - { - size_t pos = rawDataIndex + ((y * width) + x) * 1; - uint8_t grayscale = parentRawData.at(pos); - - textureData.SetIndexedPixel(y, x, grayscale, grayscale); - } - } -} - -void ZTexture::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ - if (tlutOffset != static_cast(-1)) - { - tlut = parent->GetTextureResource(tlutOffset); - if (tlut == nullptr) - { - int32_t tlutDim = 16; - if (format == TextureType::Palette4bpp) - tlutDim = 4; - - tlut = new ZTexture(parent); - tlut->ExtractFromBinary(tlutOffset, tlutDim, tlutDim, TextureType::RGBA16bpp, true); - parent->AddTextureResource(tlutOffset, tlut); - tlut->DeclareVar(prefix, ""); - } - else - { - tlut->isPalette = true; - } - SetTlut(tlut); - } -} - -void ZTexture::PrepareRawDataFromFile(const fs::path& pngFilePath) -{ - textureData.ReadPng(pngFilePath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(ALIGN8(GetRawDataSize())); - - switch (format) - { - case TextureType::RGBA16bpp: - ConvertBitmapToN64_RGBA16(); - break; - case TextureType::RGBA32bpp: - ConvertBitmapToN64_RGBA32(); - break; - case TextureType::Grayscale4bpp: - ConvertBitmapToN64_Grayscale4(); - break; - case TextureType::Grayscale8bpp: - ConvertBitmapToN64_Grayscale8(); - break; - case TextureType::GrayscaleAlpha4bpp: - ConvertBitmapToN64_GrayscaleAlpha4(); - break; - case TextureType::GrayscaleAlpha8bpp: - ConvertBitmapToN64_GrayscaleAlpha8(); - break; - case TextureType::GrayscaleAlpha16bpp: - ConvertBitmapToN64_GrayscaleAlpha16(); - break; - case TextureType::Palette4bpp: - ConvertBitmapToN64_Palette4(); - break; - case TextureType::Palette8bpp: - ConvertBitmapToN64_Palette8(); - break; - case TextureType::Error: - HANDLE_ERROR_PROCESS(WarningType::InvalidPNG, "Input PNG file has invalid format type", ""); - break; - } -} - -void ZTexture::ConvertBitmapToN64_RGBA16() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x++) - { - size_t pos = ((y * width) + x) * 2; - RGBAPixel pixel = textureData.GetPixel(y, x); - - uint8_t r = pixel.r >> 3; - uint8_t g = pixel.g >> 3; - uint8_t b = pixel.b >> 3; - - uint8_t alphaBit = pixel.a != 0; - - uint16_t data = (r << 11) | (g << 6) | (b << 1) | alphaBit; - - textureDataRaw[pos + 0] = (data & 0xFF00) >> 8; - textureDataRaw[pos + 1] = (data & 0x00FF); - } - } -} - -void ZTexture::ConvertBitmapToN64_RGBA32() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x++) - { - size_t pos = ((y * width) + x) * 4; - RGBAPixel pixel = textureData.GetPixel(y, x); - - textureDataRaw[pos + 0] = pixel.r; - textureDataRaw[pos + 1] = pixel.g; - textureDataRaw[pos + 2] = pixel.b; - textureDataRaw[pos + 3] = pixel.a; - } - } -} - -void ZTexture::ConvertBitmapToN64_Grayscale4() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x += 2) - { - size_t pos = ((y * width) + x) / 2; - uint8_t r1 = textureData.GetPixel(y, x).r; - uint8_t r2 = textureData.GetPixel(y, x + 1).r; - - textureDataRaw[pos] = (uint8_t)(((r1 / 16) << 4) + (r2 / 16)); - } - } -} - -void ZTexture::ConvertBitmapToN64_Grayscale8() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x++) - { - size_t pos = (y * width) + x; - RGBAPixel pixel = textureData.GetPixel(y, x); - textureDataRaw[pos] = pixel.r; - } - } -} - -void ZTexture::ConvertBitmapToN64_GrayscaleAlpha4() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x += 2) - { - size_t pos = ((y * width) + x) / 2; - uint8_t data = 0; - - for (uint16_t i = 0; i < 2; i++) - { - RGBAPixel pixel = textureData.GetPixel(y, x + i); - uint8_t cR = pixel.r; - uint8_t alphaBit = pixel.a != 0; - - if (i == 0) - data = (((cR >> 5) << 1) | alphaBit) << 4; - else - data |= ((cR >> 5) << 1) | alphaBit; - } - - textureDataRaw[pos] = data; - } - } -} - -void ZTexture::ConvertBitmapToN64_GrayscaleAlpha8() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x++) - { - size_t pos = ((y * width) + x) * 1; - RGBAPixel pixel = textureData.GetPixel(y, x); - - uint8_t r = (pixel.r >> 4) & 0xF; - uint8_t a = (pixel.a >> 4) & 0xF; - - textureDataRaw[pos] = (r << 4) | a; - } - } -} - -void ZTexture::ConvertBitmapToN64_GrayscaleAlpha16() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x++) - { - size_t pos = ((y * width) + x) * 2; - RGBAPixel pixel = textureData.GetPixel(y, x); - - uint8_t cR = pixel.r; - uint8_t aR = pixel.a; - - textureDataRaw[pos + 0] = cR; - textureDataRaw[pos + 1] = aR; - } - } -} - -void ZTexture::ConvertBitmapToN64_Palette4() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x += 2) - { - size_t pos = ((y * width) + x) / 2; - - uint8_t cR1 = textureData.GetIndexedPixel(y, x); - uint8_t cR2 = textureData.GetIndexedPixel(y, x + 1); - - textureDataRaw[pos] = (cR1 << 4) | (cR2); - } - } -} - -void ZTexture::ConvertBitmapToN64_Palette8() -{ - for (uint16_t y = 0; y < height; y++) - { - for (uint16_t x = 0; x < width; x++) - { - size_t pos = ((y * width) + x); - uint8_t cR = textureData.GetIndexedPixel(y, x); - - textureDataRaw[pos] = cR; - } - } -} - -float ZTexture::GetPixelMultiplyer() const -{ - switch (format) - { - case TextureType::Grayscale4bpp: - case TextureType::GrayscaleAlpha4bpp: - case TextureType::Palette4bpp: - return 0.5f; - case TextureType::Grayscale8bpp: - case TextureType::GrayscaleAlpha8bpp: - case TextureType::Palette8bpp: - return 1; - case TextureType::GrayscaleAlpha16bpp: - case TextureType::RGBA16bpp: - return 2; - case TextureType::RGBA32bpp: - return 4; - default: - return -1; - } -} - -size_t ZTexture::GetRawDataSize() const -{ - return (width * height * GetPixelMultiplyer()); -} - -std::string ZTexture::GetIMFmtFromType() -{ - switch (format) - { - case TextureType::RGBA32bpp: - case TextureType::RGBA16bpp: - return "G_IM_FMT_RGBA"; - case TextureType::Grayscale4bpp: - case TextureType::Grayscale8bpp: - return "G_IM_FMT_I"; - case TextureType::Palette4bpp: - case TextureType::Palette8bpp: - return "G_IM_FMT_CI"; - case TextureType::GrayscaleAlpha4bpp: - case TextureType::GrayscaleAlpha8bpp: - case TextureType::GrayscaleAlpha16bpp: - return "G_IM_FMT_IA"; - default: - return "ERROR"; - } -} - -std::string ZTexture::GetIMSizFromType() -{ - switch (format) - { - case TextureType::Grayscale4bpp: - case TextureType::Palette4bpp: - case TextureType::GrayscaleAlpha4bpp: - return "G_IM_SIZ_4b"; - case TextureType::Palette8bpp: - case TextureType::Grayscale8bpp: - return "G_IM_SIZ_8b"; - case TextureType::GrayscaleAlpha16bpp: - case TextureType::RGBA16bpp: - return "G_IM_SIZ_16b"; - case TextureType::RGBA32bpp: - return "G_IM_SIZ_32b"; - default: - return "ERROR"; - } -} - -std::string ZTexture::GetDefaultName(const std::string& prefix) const -{ - const char* suffix = "Tex"; - if (isPalette) - suffix = "TLUT"; - return StringHelper::Sprintf("%s%s_%06X", prefix.c_str(), suffix, rawDataIndex); -} - -uint32_t ZTexture::GetWidth() const -{ - return width; -} - -uint32_t ZTexture::GetHeight() const -{ - return height; -} - -void ZTexture::SetDimensions(uint32_t nWidth, uint32_t nHeight) -{ - width = nWidth; - height = nHeight; - ParseRawData(); -} - -TextureType ZTexture::GetTextureType() const -{ - return format; -} - -void ZTexture::Save(const fs::path& outFolder) -{ - // Optionally generate text file containing CRC information. This is going to be a one time - // process for generating the Texture Pool XML. - if (Globals::Instance->outputCrc) - { - File::WriteAllText((Globals::Instance->outputPath / (outName + ".txt")).string(), - StringHelper::Sprintf("%08lX", hash)); - } - - auto outPath = GetPoolOutPath(outFolder); - - if (!Directory::Exists(outPath.string())) - Directory::CreateDirectory(outPath.string()); - - fs::path outFileName; - - if (!dWordAligned) - outFileName = outPath / (outName + ".u32" + "." + GetExternalExtension() + ".png"); - else - outFileName = outPath / (outName + +"." + GetExternalExtension() + ".png"); - -#ifdef TEXTURE_DEBUG - printf("Saving PNG: %s\n", outFileName.c_str()); - printf("\t Var name: %s\n", name.c_str()); - if (tlut != nullptr) - printf("\t TLUT name: %s\n", tlut->name.c_str()); -#endif - - textureData.WritePng(outFileName); - -#ifdef TEXTURE_DEBUG - printf("\n"); -#endif -} - -Declaration* ZTexture::DeclareVar(const std::string& prefix, - [[maybe_unused]] const std::string& bodyStr) -{ - std::string auxName = name; - std::string auxOutName = outName; - std::string incStr; - if (auxName == "") - auxName = GetDefaultName(prefix); - - if (auxOutName == "") - auxOutName = GetDefaultName(prefix); - - auto filepath = Globals::Instance->outputPath / fs::path(auxOutName).stem(); - - if (dWordAligned) - incStr = StringHelper::Sprintf("%s.%s.inc.c", filepath.string().c_str(), - GetExternalExtension().c_str()); - else - incStr = StringHelper::Sprintf("%s.u32.%s.inc.c", filepath.string().c_str(), - GetExternalExtension().c_str()); - - if (!Globals::Instance->cfg.texturePool.empty()) - { - CalcHash(); - - // TEXTURE POOL CHECK - const auto& poolEntry = Globals::Instance->cfg.texturePool.find(hash); - if (poolEntry != Globals::Instance->cfg.texturePool.end()) - { - if (dWordAligned) - incStr = - StringHelper::Sprintf("%s.%s.inc.c", poolEntry->second.path.string().c_str(), - GetExternalExtension().c_str()); - else - incStr = StringHelper::Sprintf("%s.u32.%s.inc.c", - poolEntry->second.path.string().c_str(), - GetExternalExtension().c_str()); - } - } - size_t texSizeDivisor = (dWordAligned) ? 8 : 4; - - Declaration* decl; - - if (parent->makeDefines) - { - decl = parent->AddDeclarationIncludeArray(rawDataIndex, incStr, GetRawDataSize(), - GetSourceTypeName(), auxName, GetHeaderDefines(), - GetRawDataSize() / texSizeDivisor); - } - else - { - decl = parent->AddDeclarationIncludeArray(rawDataIndex, incStr, GetRawDataSize(), - GetSourceTypeName(), auxName, - GetRawDataSize() / texSizeDivisor); - } - decl->staticConf = staticConf; - return decl; -} - -std::string ZTexture::GetBodySourceCode() const -{ - std::string sourceOutput; - size_t texSizeInc = (dWordAligned) ? 8 : 4; - for (size_t i = 0; i < textureDataRaw.size(); i += texSizeInc) - { - if (i % 32 == 0) - sourceOutput += " "; - if (dWordAligned) - sourceOutput += - StringHelper::Sprintf("0x%016llX, ", BitConverter::ToUInt64BE(textureDataRaw, i)); - else - sourceOutput += - StringHelper::Sprintf("0x%08llX, ", BitConverter::ToUInt32BE(textureDataRaw, i)); - if (i % 32 == 24) - sourceOutput += StringHelper::Sprintf(" // 0x%06X \n", rawDataIndex + ((i / 32) * 32)); - } - - // Ensure there's always a trailing line feed to prevent dumb warnings. - // Please don't remove this line, unless you somehow made a way to prevent - // that warning when building the OoT repo. - sourceOutput += "\n"; - - return sourceOutput; -} - -std::string ZTexture::GetHeaderDefines() const -{ - std::string definePrefix = StringHelper::camelCaseTo_SCREAMING_SNAKE_CASE(name.c_str(), true); - std::string ret = StringHelper::Sprintf("#define %s_WIDTH %d\n", definePrefix.c_str(), width); - - ret += StringHelper::Sprintf("#define %s_HEIGHT %d\n", definePrefix.c_str(), height); - ret += StringHelper::Sprintf("#define %s_SIZE 0x%zX\n", definePrefix.c_str(), GetRawDataSize()); - - return ret; -} - -bool ZTexture::IsExternalResource() const -{ - return true; -} - -ZResourceType ZTexture::GetResourceType() const -{ - return ZResourceType::Texture; -} - -std::string ZTexture::GetSourceTypeName() const -{ - return dWordAligned ? "u64" : "u32"; -} - -void ZTexture::CalcHash() -{ - const auto& parentRawData = parent->GetRawData(); - hash = CRC32B(parentRawData.data() + rawDataIndex, GetRawDataSize()); -} - -std::string ZTexture::GetExternalExtension() const -{ - switch (format) - { - case TextureType::RGBA32bpp: - return "rgba32"; - case TextureType::RGBA16bpp: - return "rgba16"; - case TextureType::Grayscale4bpp: - return "i4"; - case TextureType::Grayscale8bpp: - return "i8"; - case TextureType::GrayscaleAlpha4bpp: - return "ia4"; - case TextureType::GrayscaleAlpha8bpp: - return "ia8"; - case TextureType::GrayscaleAlpha16bpp: - return "ia16"; - case TextureType::Palette4bpp: - return "ci4"; - case TextureType::Palette8bpp: - return "ci8"; - default: - return "ERROR"; - } -} - -fs::path ZTexture::GetPoolOutPath(const fs::path& defaultValue) -{ - if (Globals::Instance->cfg.texturePool.find(hash) != Globals::Instance->cfg.texturePool.end()) - return Path::GetDirectoryName(Globals::Instance->cfg.texturePool[hash].path.string()); - - return defaultValue; -} - -TextureType ZTexture::GetTextureTypeFromString(const std::string& str) -{ - TextureType texType = TextureType::Error; - - if (str == "rgba32") - texType = TextureType::RGBA32bpp; - else if (str == "rgba16") - texType = TextureType::RGBA16bpp; - else if (str == "rgb5a1") - { - texType = TextureType::RGBA16bpp; - HANDLE_WARNING(WarningType::Deprecated, - "the texture format 'rgb5a1' is currently deprecated", - "It will be removed in a future version. Use the format 'rgba16' instead."); - } - else if (str == "i4") - texType = TextureType::Grayscale4bpp; - else if (str == "i8") - texType = TextureType::Grayscale8bpp; - else if (str == "ia4") - texType = TextureType::GrayscaleAlpha4bpp; - else if (str == "ia8") - texType = TextureType::GrayscaleAlpha8bpp; - else if (str == "ia16") - texType = TextureType::GrayscaleAlpha16bpp; - else if (str == "ci4") - texType = TextureType::Palette4bpp; - else if (str == "ci8") - texType = TextureType::Palette8bpp; - else - // TODO: handle this case in a more coherent way - HANDLE_WARNING(WarningType::InvalidAttributeValue, - "invalid value found for 'Type' attribute", "Defaulting to ''."); - return texType; -} - -bool ZTexture::IsColorIndexed() const -{ - switch (format) - { - case TextureType::Palette4bpp: - case TextureType::Palette8bpp: - return true; - - default: - return false; - } -} - -void ZTexture::SetTlut(ZTexture* nTlut) -{ - assert(IsColorIndexed()); - assert(nTlut->isPalette); - tlut = nTlut; - - textureData.SetPalette(tlut->textureData, splitTlut ? 128 : 0); -} - -bool ZTexture::HasTlut() const -{ - return tlut != nullptr; -} diff --git a/tools/ZAPD/ZAPD/ZTexture.h b/tools/ZAPD/ZAPD/ZTexture.h deleted file mode 100644 index 1461ff95a6..0000000000 --- a/tools/ZAPD/ZAPD/ZTexture.h +++ /dev/null @@ -1,119 +0,0 @@ -#pragma once - -#include "ImageBackend.h" -#include "ZResource.h" -#include "tinyxml2.h" - -enum class TextureType -{ - Error, - RGBA32bpp, - RGBA16bpp, - Palette4bpp, - Palette8bpp, - Grayscale4bpp, - Grayscale8bpp, - GrayscaleAlpha4bpp, - GrayscaleAlpha8bpp, - GrayscaleAlpha16bpp, -}; - -class ZTexture : public ZResource -{ -protected: - TextureType format = TextureType::Error; - uint32_t width, height; - - ImageBackend textureData; - std::vector textureDataRaw; // When reading from a PNG file. - uint32_t tlutOffset = static_cast(-1); - ZTexture* tlut = nullptr; - bool splitTlut; - - // The following functions convert from N64 binary data to a bitmap to be saved to a PNG. - void ConvertN64ToBitmap_RGBA16(); - void ConvertN64ToBitmap_RGBA32(); - void ConvertN64ToBitmap_Grayscale8(); - void ConvertN64ToBitmap_GrayscaleAlpha8(); - void ConvertN64ToBitmap_Grayscale4(); - void ConvertN64ToBitmap_GrayscaleAlpha4(); - void ConvertN64ToBitmap_GrayscaleAlpha16(); - void ConvertN64ToBitmap_Palette4(); - void ConvertN64ToBitmap_Palette8(); - - // The following functions convert from a bitmap to N64 binary data. - void PrepareRawDataFromFile(const fs::path& inFolder); - void ConvertBitmapToN64_RGBA16(); - void ConvertBitmapToN64_RGBA32(); - void ConvertBitmapToN64_Grayscale4(); - void ConvertBitmapToN64_Grayscale8(); - void ConvertBitmapToN64_GrayscaleAlpha4(); - void ConvertBitmapToN64_GrayscaleAlpha8(); - void ConvertBitmapToN64_GrayscaleAlpha16(); - void ConvertBitmapToN64_Palette4(); - void ConvertBitmapToN64_Palette8(); - -public: - ZTexture(ZFile* nParent); - - bool isPalette = false; - bool dWordAligned = true; - - void ExtractFromBinary(uint32_t nRawDataIndex, int32_t nWidth, int32_t nHeight, - TextureType nType, bool nIsPalette); - void FromPNG(const fs::path& pngFilePath, TextureType texType); - static TextureType GetTextureTypeFromString(const std::string& str); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - /// - /// Calculates the hash of this texture, for use with the texture pool. - /// - void CalcHash() override; - - void Save(const fs::path& outFolder) override; - - std::string GetHeaderDefines() const; - bool IsExternalResource() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - std::string GetExternalExtension() const override; - - size_t GetRawDataSize() const override; - std::string GetIMFmtFromType(); - std::string GetIMSizFromType(); - std::string GetDefaultName(const std::string& prefix) const override; - uint32_t GetWidth() const; - uint32_t GetHeight() const; - void SetDimensions(uint32_t nWidth, uint32_t nHeight); - - /// - /// Returns how many bytes each pixel takes up. - /// - /// - float GetPixelMultiplyer() const; - - TextureType GetTextureType() const; - - /// - /// Returns the path to the texture pool, taken from the config file. - /// - /// - /// - fs::path GetPoolOutPath(const fs::path& defaultValue); - - /// - /// Returns if this texture uses a palette. - /// - /// - bool IsColorIndexed() const; - - void SetTlut(ZTexture* nTlut); - bool HasTlut() const; - void ParseRawDataLate() override; -}; diff --git a/tools/ZAPD/ZAPD/ZTextureAnimation.cpp b/tools/ZAPD/ZAPD/ZTextureAnimation.cpp deleted file mode 100644 index 0c55b26097..0000000000 --- a/tools/ZAPD/ZAPD/ZTextureAnimation.cpp +++ /dev/null @@ -1,666 +0,0 @@ -/** - * File: ZTextureAnimation.cpp - * ZResources defined: ZTextureAnimation, ZTextureAnimationParams (XML declaration not supported for - * the latter) - * Purpose: extracting texture animating structures from asset files - * Note: data type is exclusive to Majora's Mask - * - * Structure of data: - * A texture animation consists of a main array of data of the form - * `SS 00 00 0T PPPPPPPP`, - * where `S` is the segment that the functionality is sent to (and read by DLists), `T` is the - * "type" (see below), and `P` is a pointer to the type's subsidiary information, which is - * invariably just above this main array. Details of this subsidiary data are given below. - * - * Segment - * === - * The segment starts at 1 and is incremented in each entry; the final one is negated, which is used - * as the indication to stop reading. The actual segment the game will use to draw is S + 7. - * - * Types - * === - * There are 7 values that `T` can take: - * `0`: A single texture scroll (Implemented by Gfx_TexScroll): subsidiary params are given as - * an array with one entry, a struct `XX YY WW HH` containing xStep, yStep, width, height - * (all u8). - * - * `1`: A dual texture scroll (Implementated by Gfx_TwoTexScroll): same as type `0`, but with - * two entries in the params array. - * - * `2`: Color changing: Changes the primColor (with a LOD factor) and envColor - * `KKKK LLLL PPPPPPPP QQQQQQQQ RRRRRRRR` - * - `K` (u16) is the total length of the animation (and in this case, the total number of - * colors) - * - `L` (u16) is seemingly always 0 for this type, and not used in the code - * - `P` segmented pointer to array of augmented primColors - * - `Q` segmented pointer to array of envColors, and can be NULL - * - `R` segmented pointer to array of frameData (u8), which is also seemingly always NULL - * for this type. - * - * envColors take the form `RR GG BB AA` as usual, while primColors have an extra LODFrac - * element: RR GG BB AA LL - * - * `3`: Color changing (LERP): similar to type `2`, but uses linear interpolation. The structure - * is similar to `2`, but - * - `K` is now just the animation length, while - * - `L` is the total number of colors, and - * - the frameData is used to determine which colors to interpolate. - * - * `4`: Color changing (Lagrange interpolation): For extraction purposes identical to type 3. - * Uses a nonlinear interpolation formula to change the colours more smoothly. - * - * `5`: Texture cycle: functions like a gif. Subsidiary params: - * `FFFF 0000 PPPPPPPP QQQQQQQQ` - * where - * - `F` (u16) time between changes in frames - * - `P` pointer to array of segmented pointers to textures to cycle through - * - `Q` array of indices, indicating which texture to use next when a change frame is - * reached. The maximum indicates the number of textures in the texture array. - * - * `6`: This is used to indicate an empty/unimplemented params set. It is ignored by the game's - * function provided that the segment is 0. A generic empty one takes the form - * `00 00 00 06 00000000`, - * and has no extra data. - * - * Implementation - * === - * - ZTextureAnimation requires a declaration in the XML to extract anything. It handles the main - * array. It uses a POD struct for each entry, and declares references to the params structs. - * - * - ZTextureAnimationParams is not (currently) declarable in an XML. It is a parent class for the - * three classes that handle the various cases: - * - TextureScrollingParams for types `0` and `1` - * - TextureColorChangingParams for types `2`,`3`,`4` - * - TextureCyclingParams for type `5` - * Each of these will declare all its subsidiary arrays, using POD structs. - */ -#include "ZTextureAnimation.h" - -#include -#include -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "WarningHandler.h" -#include "ZFile.h" -#include "ZResource.h" -#include "tinyxml2.h" - -REGISTER_ZFILENODE(TextureAnimation, ZTextureAnimation); - -/* Constructors */ -ZTextureAnimationParams::ZTextureAnimationParams(ZFile* parent) : ZResource::ZResource(parent) -{ -} -TextureScrollingParams::TextureScrollingParams(ZFile* parent) - : ZTextureAnimationParams::ZTextureAnimationParams(parent) -{ -} -TextureColorChangingParams::TextureColorChangingParams(ZFile* parent) - : ZTextureAnimationParams::ZTextureAnimationParams(parent) -{ -} -TextureCyclingParams::TextureCyclingParams(ZFile* parent) - : ZTextureAnimationParams::ZTextureAnimationParams(parent) -{ -} - -/* TextureAnimationParams */ -/* This class only implements the functions common to all or most its inheritors */ - -void ZTextureAnimationParams::ExtractFromBinary(uint32_t nRawDataIndex) -{ - rawDataIndex = nRawDataIndex; - - ParseRawData(); -} - -// Implemented by TextureScrollingParams only -void ZTextureAnimationParams::ExtractFromBinary([[maybe_unused]] uint32_t nRawDataIndex, - [[maybe_unused]] int count) -{ -} - -std::string -ZTextureAnimationParams::GetDefaultName([[maybe_unused]] const std::string& prefix) const -{ - return "ShouldNotBeVIsible"; -} - -ZResourceType ZTextureAnimationParams::GetResourceType() const -{ - return ZResourceType::TextureAnimationParams; -} - -/* TextureScrollingParams */ - -void TextureScrollingParams::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - for (int i = 0; i < count; i++) - { - rows[i].xStep = BitConverter::ToUInt8BE(rawData, rawDataIndex + 4 * i); - rows[i].yStep = BitConverter::ToUInt8BE(rawData, rawDataIndex + 4 * i + 1); - rows[i].width = BitConverter::ToUInt8BE(rawData, rawDataIndex + 4 * i + 2); - rows[i].height = BitConverter::ToUInt8BE(rawData, rawDataIndex + 4 * i + 3); - } -} - -void TextureScrollingParams::ExtractFromBinary(uint32_t nRawDataIndex, int nCount) -{ - rawDataIndex = nRawDataIndex; - count = nCount; - - ParseRawData(); -} - -std::string TextureScrollingParams::GetSourceTypeName() const -{ - return "AnimatedMatTexScrollParams"; // TODO: Better name -} - -std::string TextureScrollingParams::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sTexScrollParams_%06X", prefix.c_str(), rawDataIndex); -} - -size_t TextureScrollingParams::GetRawDataSize() const -{ - return 4 * count; -} - -/** - * Overrides the parent version to declare an array of the params rather than just one entry. - */ -Declaration* TextureScrollingParams::DeclareVar(const std::string& prefix, - const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - return parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), auxName, count, bodyStr); -} - -std::string TextureScrollingParams::GetBodySourceCode() const -{ - std::string bodyStr; - - for (int i = 0; i < count; i++) - { - bodyStr += StringHelper::Sprintf("\t{ %d, %d, 0x%02X, 0x%02X },\n", rows[i].xStep, - rows[i].yStep, rows[i].width, rows[i].height); - } - - bodyStr.pop_back(); - - return bodyStr; -} - -/* TextureColorChangingParams */ - -/** - * Also parses the color and frameData arrays - */ -void TextureColorChangingParams::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - animLength = BitConverter::ToUInt16BE(rawData, rawDataIndex); - colorListCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); - - // Handle type 2 separately - uint16_t listLength = - ((type == TextureAnimationParamsType::ColorChange) ? animLength : colorListCount); - - if (listLength == 0) - HANDLE_ERROR_RESOURCE(WarningType::Always, parent, this, rawDataIndex, - "color list length cannot be 0", ""); - - primColorListAddress = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); - envColorListAddress = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); - frameDataListAddress = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0xC); - - uint32_t primColorListOffset = Seg2Filespace(primColorListAddress, parent->baseAddress); - uint32_t envColorListOffset = Seg2Filespace(envColorListAddress, parent->baseAddress); - uint32_t frameDataListOffset = Seg2Filespace(frameDataListAddress, parent->baseAddress); - - uint32_t currentPtr; - - F3DPrimColor currentPrimColor; - - for (currentPtr = primColorListOffset; currentPtr < primColorListOffset + 5 * listLength; - currentPtr += 5) - { - currentPrimColor = {BitConverter::ToUInt8BE(rawData, currentPtr), - BitConverter::ToUInt8BE(rawData, currentPtr + 1), - BitConverter::ToUInt8BE(rawData, currentPtr + 2), - BitConverter::ToUInt8BE(rawData, currentPtr + 3), - BitConverter::ToUInt8BE(rawData, currentPtr + 4)}; - primColorList.push_back(currentPrimColor); - } - - F3DEnvColor currentEnvColor; - - for (currentPtr = envColorListOffset; currentPtr < envColorListOffset + 4 * listLength; - currentPtr += 4) - { - currentEnvColor = {BitConverter::ToUInt8BE(rawData, currentPtr), - BitConverter::ToUInt8BE(rawData, currentPtr + 1), - BitConverter::ToUInt8BE(rawData, currentPtr + 2), - BitConverter::ToUInt8BE(rawData, currentPtr + 3)}; - envColorList.push_back(currentEnvColor); - } - - uint16_t currentFrameData; - - for (currentPtr = frameDataListOffset; currentPtr < frameDataListOffset + 2 * listLength; - currentPtr += 2) - { - currentFrameData = BitConverter::ToUInt16BE(rawData, currentPtr); - frameDataList.push_back(currentFrameData); - } -} - -std::string TextureColorChangingParams::GetSourceTypeName() const -{ - return "AnimatedMatColorParams"; // TODO: Better name -} - -std::string TextureColorChangingParams::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sColorParams_%06X", prefix.c_str(), rawDataIndex); -} - -size_t TextureColorChangingParams::GetRawDataSize() const -{ - return 0x10; -} - -void TextureColorChangingParams::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ - if (primColorListAddress != 0) // NULL - { - std::string primColorBodyStr; - - for (const auto& color : primColorList) - { - primColorBodyStr += StringHelper::Sprintf("\t{ %d, %d, %d, %d, %d },\n", color.r, - color.g, color.b, color.a, color.lodFrac); - } - - primColorBodyStr.pop_back(); - - parent->AddDeclarationArray( - Seg2Filespace(primColorListAddress, parent->baseAddress), DeclarationAlignment::Align4, - primColorList.size() * 5, "F3DPrimColor", - StringHelper::Sprintf("%sTexColorChangingPrimColors_%06X", parent->GetName().c_str(), - Seg2Filespace(primColorListAddress, parent->baseAddress)), - primColorList.size(), primColorBodyStr); - } - - if (envColorListAddress != 0) // NULL - { - std::string envColorBodyStr; - - for (const auto& color : envColorList) - { - envColorBodyStr += StringHelper::Sprintf("\t{ %d, %d, %d, %d },\n", color.r, color.g, - color.b, color.a); - } - - envColorBodyStr.pop_back(); - - parent->AddDeclarationArray( - Seg2Filespace(envColorListAddress, parent->baseAddress), DeclarationAlignment::Align4, - envColorList.size() * 4, "F3DEnvColor", - StringHelper::Sprintf("%sTexColorChangingEnvColors_%06X", parent->GetName().c_str(), - Seg2Filespace(envColorListAddress, parent->baseAddress)), - envColorList.size(), envColorBodyStr); - } - - if (frameDataListAddress != 0) // NULL - { - std::string frameDataBodyStr = "\t"; - - for (const auto& frame : frameDataList) - { - frameDataBodyStr += StringHelper::Sprintf("%d, ", frame); - } - - frameDataBodyStr.pop_back(); - - parent->AddDeclarationArray( - Seg2Filespace(frameDataListAddress, parent->baseAddress), DeclarationAlignment::Align4, - frameDataList.size() * 2, "u16", - StringHelper::Sprintf("%sTexColorChangingFrameData_%06X", parent->GetName().c_str(), - Seg2Filespace(frameDataListAddress, parent->baseAddress)), - frameDataList.size(), frameDataBodyStr); - } -} - -std::string TextureColorChangingParams::GetBodySourceCode() const -{ - std::string primColorListName; - std::string envColorListName; - std::string frameDataListName; - - Globals::Instance->GetSegmentedPtrName(primColorListAddress, parent, "", primColorListName); - Globals::Instance->GetSegmentedPtrName(envColorListAddress, parent, "", envColorListName); - Globals::Instance->GetSegmentedPtrName(frameDataListAddress, parent, "", frameDataListName); - - std::string bodyStr = StringHelper::Sprintf( - "\n %d, %d, %s, %s, %s,\n", animLength, colorListCount, primColorListName.c_str(), - envColorListName.c_str(), frameDataListName.c_str()); - - return bodyStr; -} - -/* TextureCyclingParams */ - -void TextureCyclingParams::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - cycleLength = BitConverter::ToUInt16BE(rawData, rawDataIndex); - if (cycleLength == 0) - HANDLE_ERROR_RESOURCE(WarningType::Always, parent, this, rawDataIndex, - "cycle length cannot be 0", ""); - - textureListAddress = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); - textureIndexListAddress = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); - - uint32_t textureListOffset = Seg2Filespace(textureListAddress, parent->baseAddress); - uint32_t textureIndexListOffset = Seg2Filespace(textureIndexListAddress, parent->baseAddress); - - uint32_t currentPtr; - - uint8_t currentIndex; - uint8_t maxIndex = 0; // To find the length of the texture list - - for (currentPtr = textureIndexListOffset; currentPtr < textureIndexListOffset + cycleLength; - currentPtr++) - { - currentIndex = BitConverter::ToUInt8BE(rawData, currentPtr); - textureIndexList.push_back(currentIndex); - if (currentIndex > maxIndex) - maxIndex = currentIndex; - } - - for (currentPtr = textureListOffset; currentPtr <= textureListOffset + 4 * maxIndex; - currentPtr += 4) - { - textureList.push_back(BitConverter::ToUInt32BE(rawData, currentPtr)); - } -} - -std::string TextureCyclingParams::GetSourceTypeName() const -{ - return "AnimatedMatTexCycleParams"; // TODO: Better name -} - -std::string TextureCyclingParams::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sTexCycleParams_%06X", prefix.c_str(), rawDataIndex); -} - -size_t TextureCyclingParams::GetRawDataSize() const -{ - return 0xC; -} - -void TextureCyclingParams::DeclareReferences([[maybe_unused]] const std::string& prefix) -{ - if (textureListAddress != 0) // NULL - { - std::string texturesBodyStr; - std::string texName; - std::string comment; - - for (const auto& tex : textureList) - { - bool texFound = Globals::Instance->GetSegmentedPtrName(tex, parent, "", texName); - - // texName is a raw segmented pointer. This occurs if the texture is not declared - // separately since we cannot read the format. In theory we could scan DLists for the - // format on the appropriate segments. - if (!texFound) - { - comment = " // Raw pointer, declare texture in XML to use proper symbol"; - - auto msgHeader = StringHelper::Sprintf( - "TexCycle texture array declared here points to unknown texture at address %s", - texName.c_str()); - HANDLE_WARNING_RESOURCE( - WarningType::HardcodedPointer, parent, this, rawDataIndex, msgHeader, - "Please declare the texture in the XML to use the proper symbol."); - } - texturesBodyStr += StringHelper::Sprintf("\t%s,%s\n", texName.c_str(), comment.c_str()); - } - - texturesBodyStr.pop_back(); - - parent->AddDeclarationArray( - Seg2Filespace(textureListAddress, parent->baseAddress), DeclarationAlignment::Align4, - textureList.size() * 4, "TexturePtr", - StringHelper::Sprintf("%sTexCycleTexPtrs_%06X", parent->GetName().c_str(), - Seg2Filespace(textureListAddress, parent->baseAddress)), - textureList.size(), texturesBodyStr); - } - - if (textureIndexListAddress != 0) // NULL - { - std::string indicesBodyStr = "\t"; - - for (uint8_t index : textureIndexList) - { - indicesBodyStr += StringHelper::Sprintf("%d, ", index); - } - - indicesBodyStr.pop_back(); - - parent->AddDeclarationArray( - Seg2Filespace(textureIndexListAddress, parent->baseAddress), - DeclarationAlignment::Align4, textureIndexList.size(), "u8", - StringHelper::Sprintf("%sTexCycleTexIndices_%06X", parent->GetName().c_str(), - Seg2Filespace(textureIndexListAddress, parent->baseAddress)), - textureIndexList.size(), indicesBodyStr); - } -} - -std::string TextureCyclingParams::GetBodySourceCode() const -{ - std::string textureListName; - std::string textureIndexListName; - - Globals::Instance->GetSegmentedPtrName(textureListAddress, parent, "", textureListName); - Globals::Instance->GetSegmentedPtrName(textureIndexListAddress, parent, "", - textureIndexListName); - - std::string bodyStr = StringHelper::Sprintf( - "\n %d, %s, %s,\n", cycleLength, textureListName.c_str(), textureIndexListName.c_str()); - - return bodyStr; -} - -/* ZTextureAnimation */ - -ZTextureAnimation::ZTextureAnimation(ZFile* nParent) : ZResource(nParent) -{ -} - -/** - * Builds the array of params - */ -void ZTextureAnimation::ParseRawData() -{ - ZResource::ParseRawData(); - - TextureAnimationEntry currentEntry; - auto rawData = parent->GetRawData(); - int16_t type; - - for (uint32_t currentPtr = rawDataIndex;; currentPtr += 8) - { - type = BitConverter::ToInt16BE(rawData, currentPtr + 2); - - currentEntry.segment = BitConverter::ToInt8BE(rawData, currentPtr); - currentEntry.type = (TextureAnimationParamsType)type; - currentEntry.paramsPtr = BitConverter::ToUInt32BE(rawData, currentPtr + 4); - entries.push_back(currentEntry); - - if ((type < 0) || (type > 6)) - { - HANDLE_ERROR_RESOURCE( - WarningType::Always, parent, this, rawDataIndex, - StringHelper::Sprintf( - "unknown TextureAnimationParams type 0x%02X in TextureAnimation", type), - StringHelper::Sprintf( - "Entry reads { 0x%02X, 0x%02X, 0x%08X } , but type should be " - "between 0x00 and 0x06 inclusive.", - currentEntry.segment, type, currentEntry.paramsPtr)); - } - - if (currentEntry.segment <= 0) - break; - } -} - -#include -/** - * For each params entry, - */ -void ZTextureAnimation::DeclareReferences(const std::string& prefix) -{ - std::string varPrefix = name; - if (varPrefix == "") - varPrefix = prefix; - - ZResource::DeclareReferences(varPrefix); - - for (const auto& entry : entries) - { - if (entry.paramsPtr != 0 && GETSEGNUM(entry.paramsPtr) == parent->segment) - { - uint32_t paramsOffset = Seg2Filespace(entry.paramsPtr, parent->baseAddress); - if (!parent->HasDeclaration(paramsOffset)) - { - ZTextureAnimationParams* params; - int count; - switch (entry.type) - { - case TextureAnimationParamsType::SingleScroll: - if (true) - { - count = 1; - // The else now allows SingleScroll to fall through to params = ... without - // touching the code in the else block - } - else - { - // The contents of this block can only be run by jumping into it with the - // case label - [[fallthrough]]; - case TextureAnimationParamsType::DualScroll: - count = 2; - } - params = new TextureScrollingParams(parent); - params->type = entry.type; - params->ExtractFromBinary(paramsOffset, count); - break; - - case TextureAnimationParamsType::ColorChange: - case TextureAnimationParamsType::ColorChangeLERP: - case TextureAnimationParamsType::ColorChangeLagrange: - params = new TextureColorChangingParams(parent); - params->type = entry.type; - params->ExtractFromBinary(paramsOffset); - break; - - case TextureAnimationParamsType::TextureCycle: - params = new TextureCyclingParams(parent); - params->type = entry.type; - params->ExtractFromBinary(paramsOffset); - break; - - case TextureAnimationParamsType::Empty: - HANDLE_WARNING_RESOURCE( - WarningType::InvalidExtractedData, parent, this, rawDataIndex, - "TextureAnimationParams entry has empty type (6), but params pointer is " - "not NULL", - StringHelper::Sprintf("Params read { 0x%02X, 0x%02X, 0x%08X } .", - entry.segment, (int)entry.type, entry.paramsPtr)); - return; - default: - // Because GCC is worried this could happen - assert(entry.type < TextureAnimationParamsType::SingleScroll || - entry.type > TextureAnimationParamsType::Empty); - return; - } - - params->SetName(params->GetDefaultName(varPrefix)); - params->DeclareVar(varPrefix, ""); - parent->AddResource(params); - } - } - } -} - -std::string ZTextureAnimation::GetSourceTypeName() const -{ - return "AnimatedMaterial"; // TODO: Better name -} - -ZResourceType ZTextureAnimation::GetResourceType() const -{ - return ZResourceType::TextureAnimation; -} - -/** - * The size of the main array - */ -size_t ZTextureAnimation::GetRawDataSize() const -{ - return entries.size() * 8; -} - -std::string ZTextureAnimation::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sTexAnim_%06X", prefix.c_str(), rawDataIndex); -} - -Declaration* ZTextureAnimation::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - Declaration* decl = - parent->AddDeclarationArray(rawDataIndex, GetDeclarationAlignment(), GetRawDataSize(), - GetSourceTypeName(), auxName, entries.size(), bodyStr); - decl->staticConf = staticConf; - return decl; -} - -std::string ZTextureAnimation::GetBodySourceCode() const -{ - std::string bodyStr; - - for (const auto& entry : entries) - { - std::string paramName; - Globals::Instance->GetSegmentedPtrName(entry.paramsPtr, parent, "", paramName); - - bodyStr += StringHelper::Sprintf("\t{ %d, %d, %s },\n", entry.segment, entry.type, - paramName.c_str()); - } - - bodyStr.pop_back(); - - return bodyStr; -} diff --git a/tools/ZAPD/ZAPD/ZTextureAnimation.h b/tools/ZAPD/ZAPD/ZTextureAnimation.h deleted file mode 100644 index 6b03eb7cf4..0000000000 --- a/tools/ZAPD/ZAPD/ZTextureAnimation.h +++ /dev/null @@ -1,151 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "ZResource.h" - -enum class TextureAnimationParamsType -{ - /* 0 */ SingleScroll, - /* 1 */ DualScroll, - /* 2 */ ColorChange, - /* 3 */ ColorChangeLERP, - /* 4 */ ColorChangeLagrange, - /* 5 */ TextureCycle, - /* 6 */ Empty // An empty TextureAnimation has the form 00 00 00 06 00000000 -}; - -class ZTextureAnimationParams : public ZResource -{ -public: - ZTextureAnimationParams(ZFile* parent); - - void ExtractFromBinary(uint32_t nRawDataIndex); - virtual void ExtractFromBinary(uint32_t nRawDataIndex, int count); - - virtual std::string GetDefaultName(const std::string& prefix) const; - ZResourceType GetResourceType() const; - - TextureAnimationParamsType type; -}; - -struct TextureScrollingParamsEntry -{ - int8_t xStep; - int8_t yStep; - uint8_t width; - uint8_t height; -}; - -class TextureScrollingParams : public ZTextureAnimationParams -{ -public: - TextureScrollingParams(ZFile* parent); - - void ParseRawData() override; - void ExtractFromBinary(uint32_t nRawDataIndex, int count) override; - - std::string GetSourceTypeName() const override; - std::string GetDefaultName(const std::string& prefix) const override; - size_t GetRawDataSize() const override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - int count; // 1 for Single, 2 for Dual - TextureScrollingParamsEntry rows[2]; // Too small to make a vector worth it -}; - -struct F3DPrimColor -{ - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; - uint8_t lodFrac; -}; - -struct F3DEnvColor -{ - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; -}; - -class TextureColorChangingParams : public ZTextureAnimationParams -{ -public: - TextureColorChangingParams(ZFile* parent); - - void ParseRawData() override; - - std::string GetSourceTypeName() const override; - std::string GetDefaultName(const std::string& prefix) const override; - size_t GetRawDataSize() const override; - - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - uint16_t animLength; // size of list for type 2 - uint16_t colorListCount; - segptr_t primColorListAddress; - segptr_t envColorListAddress; - segptr_t frameDataListAddress; - std::vector primColorList; - std::vector envColorList; - std::vector frameDataList; -}; - -class TextureCyclingParams : public ZTextureAnimationParams -{ -public: - TextureCyclingParams(ZFile* parent); - - void ParseRawData() override; - - std::string GetSourceTypeName() const override; - std::string GetDefaultName(const std::string& prefix) const override; - size_t GetRawDataSize() const override; - - void DeclareReferences(const std::string& prefix) override; - - std::string GetBodySourceCode() const override; - - uint16_t cycleLength; - segptr_t textureListAddress; - segptr_t textureIndexListAddress; - std::vector textureList; - std::vector textureIndexList; -}; - -struct TextureAnimationEntry -{ - int8_t segment; - TextureAnimationParamsType type; - segptr_t paramsPtr; -}; - -class ZTextureAnimation : public ZResource -{ -public: - ZTextureAnimation(ZFile* nParent); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - size_t GetRawDataSize() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - -private: - std::vector entries; -}; diff --git a/tools/ZAPD/ZAPD/ZVector.cpp b/tools/ZAPD/ZAPD/ZVector.cpp deleted file mode 100644 index 607aac86d3..0000000000 --- a/tools/ZAPD/ZAPD/ZVector.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "ZVector.h" - -#include - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/File.h" -#include "Utils/StringHelper.h" -#include "WarningHandler.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Vector, ZVector); - -ZVector::ZVector(ZFile* nParent) : ZResource(nParent) -{ - scalarType = ZScalarType::ZSCALAR_NONE; - dimensions = 0; - - RegisterRequiredAttribute("Type"); - RegisterRequiredAttribute("Dimensions"); -} - -void ZVector::ExtractFromBinary(uint32_t nRawDataIndex, ZScalarType nScalarType, - uint32_t nDimensions) -{ - rawDataIndex = nRawDataIndex; - scalarType = nScalarType; - dimensions = nDimensions; - - // Don't parse raw data of external files - if (parent->GetMode() == ZFileMode::ExternalFile) - return; - - ParseRawData(); -} - -void ZVector::ParseXML(tinyxml2::XMLElement* reader) -{ - ZResource::ParseXML(reader); - - this->scalarType = ZScalar::MapOutputTypeToScalarType(registeredAttributes.at("Type").value); - - this->dimensions = StringHelper::StrToL(registeredAttributes.at("Dimensions").value, 16); -} - -void ZVector::ParseRawData() -{ - int32_t currentRawDataIndex = rawDataIndex; - // TODO: this shouldn't be necessary. - scalars.clear(); - scalars.reserve(dimensions); - for (uint32_t i = 0; i < dimensions; i++) - { - ZScalar scalar(parent); - scalar.ExtractFromBinary(currentRawDataIndex, scalarType); - currentRawDataIndex += scalar.GetRawDataSize(); - - scalars.push_back(scalar); - } - - // Ensure the scalars vector has the same number of elements as the vector dimension. - assert(scalars.size() == dimensions); -} - -size_t ZVector::GetRawDataSize() const -{ - size_t size = 0; - - for (size_t i = 0; i < this->scalars.size(); i++) - size += this->scalars[i].GetRawDataSize(); - - return size; -} - -bool ZVector::DoesSupportArray() const -{ - return true; -} - -std::string ZVector::GetSourceTypeName() const -{ - if (dimensions == 3 && scalarType == ZScalarType::ZSCALAR_F32) - return "Vec3f"; - else if (dimensions == 3 && scalarType == ZScalarType::ZSCALAR_S16) - return "Vec3s"; - else if (dimensions == 3 && scalarType == ZScalarType::ZSCALAR_S32) - return "Vec3i"; - else - { - std::string msgHeader = StringHelper::Sprintf( - "encountered unsupported vector type: %d dimensions, %s type", dimensions, - ZScalar::MapScalarTypeToOutputType(scalarType).c_str()); - - HANDLE_ERROR_RESOURCE(WarningType::NotImplemented, parent, this, rawDataIndex, msgHeader, - ""); - } -} - -std::string ZVector::GetBodySourceCode() const -{ - std::string body = ""; - - for (size_t i = 0; i < scalars.size(); i++) - { - body += StringHelper::Sprintf("%6s", scalars[i].GetBodySourceCode().c_str()); - - if (i + 1 < scalars.size()) - body += ", "; - } - - return body; -} - -ZResourceType ZVector::GetResourceType() const -{ - return ZResourceType::Vector; -} - -DeclarationAlignment ZVector::GetDeclarationAlignment() const -{ - if (scalars.size() == 0) - { - return DeclarationAlignment::Align4; - } - return scalars.at(0).GetDeclarationAlignment(); -} diff --git a/tools/ZAPD/ZAPD/ZVector.h b/tools/ZAPD/ZAPD/ZVector.h deleted file mode 100644 index a50d3e8083..0000000000 --- a/tools/ZAPD/ZAPD/ZVector.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include -#include -#include -#include "ZResource.h" -#include "ZScalar.h" -#include "tinyxml2.h" - -class ZVector : public ZResource -{ -public: - std::vector scalars; - ZScalarType scalarType; - uint32_t dimensions; - - ZVector(ZFile* nParent); - - void ExtractFromBinary(uint32_t nRawDataIndex, ZScalarType nScalarType, uint32_t nDimensions); - - void ParseXML(tinyxml2::XMLElement* reader) override; - void ParseRawData() override; - - std::string GetBodySourceCode() const override; - - bool DoesSupportArray() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZVtx.cpp b/tools/ZAPD/ZAPD/ZVtx.cpp deleted file mode 100644 index e4b3d97968..0000000000 --- a/tools/ZAPD/ZAPD/ZVtx.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "ZVtx.h" - -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" -#include "ZFile.h" - -REGISTER_ZFILENODE(Vtx, ZVtx); - -ZVtx::ZVtx(ZFile* nParent) : ZResource(nParent) -{ - x = 0; - y = 0; - z = 0; - flag = 0; - s = 0; - t = 0; - r = 0; - g = 0; - b = 0; - a = 0; -} - -void ZVtx::ParseRawData() -{ - ZResource::ParseRawData(); - - const auto& rawData = parent->GetRawData(); - x = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - y = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - z = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - flag = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - s = BitConverter::ToInt16BE(rawData, rawDataIndex + 8); - t = BitConverter::ToInt16BE(rawData, rawDataIndex + 10); - r = rawData[rawDataIndex + 12]; - g = rawData[rawDataIndex + 13]; - b = rawData[rawDataIndex + 14]; - a = rawData[rawDataIndex + 15]; -} - -Declaration* ZVtx::DeclareVar(const std::string& prefix, const std::string& bodyStr) -{ - Declaration* decl = ZResource::DeclareVar(prefix, bodyStr); - decl->isExternal = true; - return decl; -} - -std::string ZVtx::GetBodySourceCode() const -{ - return StringHelper::Sprintf("VTX(%i, %i, %i, %i, %i, %i, %i, %i, %i)", x, y, z, s, t, r, g, b, - a); -} - -size_t ZVtx::GetRawDataSize() const -{ - return 16; -} - -bool ZVtx::DoesSupportArray() const -{ - return true; -} - -ZResourceType ZVtx::GetResourceType() const -{ - return ZResourceType::Vertex; -} - -bool ZVtx::IsExternalResource() const -{ - return true; -} - -std::string ZVtx::GetSourceTypeName() const -{ - return "Vtx"; -} - -std::string ZVtx::GetExternalExtension() const -{ - return "vtx"; -} - -DeclarationAlignment ZVtx::GetDeclarationAlignment() const -{ - return DeclarationAlignment::Align8; -} diff --git a/tools/ZAPD/ZAPD/ZVtx.h b/tools/ZAPD/ZAPD/ZVtx.h deleted file mode 100644 index 511048791d..0000000000 --- a/tools/ZAPD/ZAPD/ZVtx.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include -#include -#include "ZResource.h" -#include "ZScalar.h" -#include "tinyxml2.h" - -class ZVtx : public ZResource -{ -public: - int16_t x, y, z; - uint16_t flag; - int16_t s, t; - uint8_t r, g, b, a; - - ZVtx(ZFile* nParent); - - void ParseRawData() override; - - Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override; - std::string GetBodySourceCode() const override; - - bool IsExternalResource() const override; - bool DoesSupportArray() const override; - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - std::string GetExternalExtension() const override; - - size_t GetRawDataSize() const override; - DeclarationAlignment GetDeclarationAlignment() const override; -}; diff --git a/tools/ZAPD/ZAPD/ZWaterbox.cpp b/tools/ZAPD/ZAPD/ZWaterbox.cpp deleted file mode 100644 index 9a289db523..0000000000 --- a/tools/ZAPD/ZAPD/ZWaterbox.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "ZWaterbox.h" - -#include "Globals.h" -#include "Utils/BitConverter.h" -#include "Utils/StringHelper.h" - -REGISTER_ZFILENODE(Waterbox, ZWaterbox); - -ZWaterbox::ZWaterbox(ZFile* nParent) : ZResource(nParent) -{ -} - -ZWaterbox::~ZWaterbox() -{ -} - -void ZWaterbox::ParseRawData() -{ - const auto& rawData = parent->GetRawData(); - - xMin = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - ySurface = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - zMin = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - xLength = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - zLength = BitConverter::ToInt16BE(rawData, rawDataIndex + 8); - - if (Globals::Instance->game == ZGame::OOT_SW97) - properties = BitConverter::ToInt16BE(rawData, rawDataIndex + 10); - else - properties = BitConverter::ToInt32BE(rawData, rawDataIndex + 12); -} - -void ZWaterbox::DeclareReferences(const std::string& prefix) -{ - std::string declaration; - std::string auxName = name; - - if (name == "") - auxName = GetDefaultName(prefix); - - parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align4, GetRawDataSize(), - GetSourceTypeName(), name.c_str(), GetBodySourceCode()); -} - -std::string ZWaterbox::GetBodySourceCode() const -{ - return StringHelper::Sprintf("%i, %i, %i, %i, %i, 0x%08X", xMin, ySurface, zMin, xLength, - zLength, properties); -} - -std::string ZWaterbox::GetDefaultName(const std::string& prefix) const -{ - return StringHelper::Sprintf("%sWaterBoxes_%06X", prefix.c_str(), rawDataIndex); -} - -ZResourceType ZWaterbox::GetResourceType() const -{ - return ZResourceType::Waterbox; -} - -size_t ZWaterbox::GetRawDataSize() const -{ - return 16; -} - -std::string ZWaterbox::GetSourceTypeName() const -{ - return "WaterBox"; -} - -bool ZWaterbox::DoesSupportArray() const -{ - return true; -} diff --git a/tools/ZAPD/ZAPD/ZWaterbox.h b/tools/ZAPD/ZAPD/ZWaterbox.h deleted file mode 100644 index e190b26a08..0000000000 --- a/tools/ZAPD/ZAPD/ZWaterbox.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include "ZFile.h" -#include "ZResource.h" - -class ZWaterbox : public ZResource -{ -public: - int16_t xMin; - int16_t ySurface; - int16_t zMin; - int16_t xLength; - int16_t zLength; - int32_t properties; - - ZWaterbox(ZFile* nParent); - ~ZWaterbox(); - - void ParseRawData() override; - void DeclareReferences(const std::string& prefix) override; - std::string GetBodySourceCode() const override; - std::string GetDefaultName(const std::string& prefix) const override; - - std::string GetSourceTypeName() const override; - ZResourceType GetResourceType() const override; - - bool DoesSupportArray() const override; - - size_t GetRawDataSize() const override; -}; diff --git a/tools/ZAPD/ZAPD/any/any/zlib.static.txt b/tools/ZAPD/ZAPD/any/any/zlib.static.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tools/ZAPD/ZAPD/genbuildinfo.py b/tools/ZAPD/ZAPD/genbuildinfo.py deleted file mode 100644 index 3317c42762..0000000000 --- a/tools/ZAPD/ZAPD/genbuildinfo.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python3 - -import argparse -from datetime import datetime -import getpass -import subprocess - -parser = argparse.ArgumentParser() -parser.add_argument("--devel", action="store_true") -args = parser.parse_args() - -with open("build/ZAPD/BuildInfo.cpp", "w+") as buildFile: - # Get commit hash from git - # If git fails due to a missing .git directory, a default label will be used instead. - try: - label = subprocess.check_output(["git", "describe", "--always"]).strip().decode("utf-8") - except: - label = "GIT_NOT_FOUND" - - now = datetime.now() - if args.devel: - label += " ~ Development version" - buildFile.write("extern const char gBuildHash[] = \"" + label + "\";\n") - #buildFile.write("extern const char gBuildDate[] = \"" + now.strftime("%Y-%m-%d %H:%M:%S") + "\";\n") diff --git a/tools/ZAPD/ZAPD/packages.config b/tools/ZAPD/ZAPD/packages.config deleted file mode 100644 index c387aaed70..0000000000 --- a/tools/ZAPD/ZAPD/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Color3b.h b/tools/ZAPD/ZAPDUtils/Color3b.h deleted file mode 100644 index 507c099f52..0000000000 --- a/tools/ZAPD/ZAPDUtils/Color3b.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include - -struct Color3b -{ - uint8_t r, g, b; - - Color3b() - { - r = 0; - g = 0; - b = 0; - }; - Color3b(uint8_t nR, uint8_t nG, uint8_t nB) - { - r = nR; - g = nG; - b = nB; - }; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Makefile b/tools/ZAPD/ZAPDUtils/Makefile deleted file mode 100644 index c0f818bdff..0000000000 --- a/tools/ZAPD/ZAPDUtils/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 := ZAPDUtils.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) -c $(OUTPUT_OPTION) $< - -$(LIB): $(O_FILES) - $(AR) rcs $@ $^ diff --git a/tools/ZAPD/ZAPDUtils/StrHash.h b/tools/ZAPD/ZAPDUtils/StrHash.h deleted file mode 100644 index c611bdddad..0000000000 --- a/tools/ZAPD/ZAPDUtils/StrHash.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include -#include -#include - -typedef uint32_t strhash; - -[[maybe_unused]] static strhash CRC32B(unsigned char* message, int32_t size) -{ - int32_t byte = 0, crc = 0; - int32_t mask = 0; - - 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); -} - -[[maybe_unused]] constexpr static strhash CRC32BCT(const char* message, int32_t size) -{ - int32_t byte = 0, crc = 0; - int32_t mask = 0; - - 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/ZAPDUtils/Utils/BinaryReader.cpp b/tools/ZAPD/ZAPDUtils/Utils/BinaryReader.cpp deleted file mode 100644 index 35412781cc..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/BinaryReader.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "BinaryReader.h" -#include -#include -#include "Stream.h" - -BinaryReader::BinaryReader(Stream* nStream) -{ - stream.reset(nStream); -} - -void BinaryReader::Close() -{ - stream->Close(); -} - -void BinaryReader::Seek(uint32_t offset, SeekOffsetType seekType) -{ - stream->Seek(offset, seekType); -} - -uint32_t BinaryReader::GetBaseAddress() -{ - return stream->GetBaseAddress(); -} - -void BinaryReader::Read([[maybe_unused]] char* buffer, int32_t length) -{ - stream->Read(length); -} - -char BinaryReader::ReadChar() -{ - return (char)stream->ReadByte(); -} - -int8_t BinaryReader::ReadByte() -{ - return stream->ReadByte(); -} - -uint8_t BinaryReader::ReadUByte() -{ - return (uint8_t)stream->ReadByte(); -} - -int16_t BinaryReader::ReadInt16() -{ - int16_t result = 0; - - stream->Read((char*)&result, sizeof(int16_t)); - return result; -} - -int32_t BinaryReader::ReadInt32() -{ - int32_t result = 0; - - stream->Read((char*)&result, sizeof(int32_t)); - return result; -} - -uint16_t BinaryReader::ReadUInt16() -{ - uint16_t result = 0; - - stream->Read((char*)&result, sizeof(uint16_t)); - return result; -} - -uint32_t BinaryReader::ReadUInt32() -{ - uint32_t result = 0; - - stream->Read((char*)&result, sizeof(uint32_t)); - return result; -} - -uint64_t BinaryReader::ReadUInt64() -{ - uint64_t result = 0; - - stream->Read((char*)&result, sizeof(uint64_t)); - return result; -} - -float BinaryReader::ReadSingle() -{ - float result = NAN; - - stream->Read((char*)&result, sizeof(float)); - - if (std::isnan(result)) - throw std::runtime_error("BinaryReader::ReadSingle(): Error reading stream"); - - return result; -} - -double BinaryReader::ReadDouble() -{ - double result = NAN; - - stream->Read((char*)&result, sizeof(double)); - if (std::isnan(result)) - throw std::runtime_error("BinaryReader::ReadDouble(): Error reading stream"); - - return result; -} - -Vec3f BinaryReader::ReadVec3f() -{ - return Vec3f(); -} - -Vec3s BinaryReader::ReadVec3s() -{ - return Vec3s(0, 0, 0); -} - -Vec3s BinaryReader::ReadVec3b() -{ - return Vec3s(0, 0, 0); -} - -Vec2f BinaryReader::ReadVec2f() -{ - return Vec2f(); -} - -Color3b BinaryReader::ReadColor3b() -{ - return Color3b(); -} - -std::string BinaryReader::ReadString() -{ - std::string res; - char c; - - do - { - c = ReadChar(); - - if (c != 0) - res += c; - } while (c != 0); - - return res; -} \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Utils/BinaryReader.h b/tools/ZAPD/ZAPDUtils/Utils/BinaryReader.h deleted file mode 100644 index cf0eeb42c9..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/BinaryReader.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include "../Color3b.h" -#include "../Vec2f.h" -#include "../Vec3f.h" -#include "../Vec3s.h" -#include "Stream.h" - -class BinaryReader -{ -public: - BinaryReader(Stream* nStream); - - void Close(); - - void Seek(uint32_t offset, SeekOffsetType seekType); - uint32_t GetBaseAddress(); - - void Read(char* buffer, int32_t length); - char ReadChar(); - int8_t ReadByte(); - int16_t ReadInt16(); - int32_t ReadInt32(); - uint8_t ReadUByte(); - uint16_t ReadUInt16(); - uint32_t ReadUInt32(); - uint64_t ReadUInt64(); - float ReadSingle(); - double ReadDouble(); - Vec3f ReadVec3f(); - Vec3s ReadVec3s(); - Vec3s ReadVec3b(); - Vec2f ReadVec2f(); - Color3b ReadColor3b(); - std::string ReadString(); - -protected: - std::shared_ptr stream; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Utils/BinaryWriter.cpp b/tools/ZAPD/ZAPDUtils/Utils/BinaryWriter.cpp deleted file mode 100644 index 87bc0ac684..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/BinaryWriter.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "BinaryWriter.h" - -BinaryWriter::BinaryWriter(Stream* nStream) -{ - stream.reset(nStream); -} - -BinaryWriter::BinaryWriter(std::shared_ptr nStream) -{ - stream = nStream; -} - -void BinaryWriter::Close() -{ - stream->Close(); -} - -std::shared_ptr BinaryWriter::GetStream() -{ - return stream; -} - -uint64_t BinaryWriter::GetBaseAddress() -{ - return stream->GetBaseAddress(); -} - -uint64_t BinaryWriter::GetLength() -{ - return stream->GetLength(); -} - -void BinaryWriter::Seek(int32_t offset, SeekOffsetType seekType) -{ - stream->Seek(offset, seekType); -} - -void BinaryWriter::Write(int8_t value) -{ - stream->Write((char*)&value, sizeof(int8_t)); -} - -void BinaryWriter::Write(uint8_t value) -{ - stream->Write((char*)&value, sizeof(uint8_t)); -} - -void BinaryWriter::Write(int16_t value) -{ - stream->Write((char*)&value, sizeof(int16_t)); -} - -void BinaryWriter::Write(uint16_t value) -{ - stream->Write((char*)&value, sizeof(uint16_t)); -} - -void BinaryWriter::Write(int32_t value) -{ - stream->Write((char*)&value, sizeof(int32_t)); -} - -void BinaryWriter::Write(uint32_t value) -{ - stream->Write((char*)&value, sizeof(uint32_t)); -} - -void BinaryWriter::Write(int64_t value) -{ - stream->Write((char*)&value, sizeof(int64_t)); -} - -void BinaryWriter::Write(uint64_t value) -{ - stream->Write((char*)&value, sizeof(uint64_t)); -} - -void BinaryWriter::Write(float value) -{ - stream->Write((char*)&value, sizeof(float)); -} - -void BinaryWriter::Write(double value) -{ - stream->Write((char*)&value, sizeof(double)); -} - -void BinaryWriter::Write(const std::string& str) -{ - int strLen = str.size(); - stream->Write((char*)&strLen, sizeof(int)); - - for (char c : str) - stream->WriteByte(c); -} diff --git a/tools/ZAPD/ZAPDUtils/Utils/BinaryWriter.h b/tools/ZAPD/ZAPDUtils/Utils/BinaryWriter.h deleted file mode 100644 index e224d182e3..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/BinaryWriter.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include "Stream.h" - -class BinaryWriter -{ -public: - BinaryWriter(Stream* nStream); - BinaryWriter(std::shared_ptr nStream); - - std::shared_ptr GetStream(); - uint64_t GetBaseAddress(); - uint64_t GetLength(); - void Seek(int32_t offset, SeekOffsetType seekType); - void Close(); - - void Write(int8_t value); - void Write(uint8_t value); - void Write(int16_t value); - void Write(uint16_t value); - void Write(int32_t value); - void Write(uint32_t value); - void Write(int64_t value); - void Write(uint64_t value); - void Write(float value); - void Write(double value); - void Write(const std::string& str); - -protected: - std::shared_ptr stream; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h b/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h deleted file mode 100644 index aa41b5b217..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h +++ /dev/null @@ -1,166 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -#define ALIGN8(val) (((val) + 7) & ~7) -#define ALIGN16(val) (((val) + 0xF) & ~0xF) -#define ALIGN64(val) (((val) + 0x3F) & ~0x3F) - -#ifdef _MSC_VER -#define __PRETTY_FUNCTION__ __FUNCSIG__ -#endif - -class BitConverter -{ -public: - static inline int8_t ToInt8BE(const std::vector& data, size_t offset) - { - if (offset + 0 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return (int8_t)data.at(offset + 0); - } - - static inline uint8_t ToUInt8BE(const std::vector& data, size_t offset) - { - if (offset + 0 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying an out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return (uint8_t)data.at(offset + 0); - } - - static inline int16_t ToInt16BE(const std::vector& data, size_t offset) - { - if (offset + 1 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return ((uint16_t)data.at(offset + 0) << 8) + (uint16_t)data.at(offset + 1); - } - - static inline uint16_t ToUInt16BE(const std::vector& data, size_t offset) - { - if (offset + 1 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return ((uint16_t)data.at(offset + 0) << 8) + (uint16_t)data.at(offset + 1); - } - - static inline int32_t ToInt32BE(const std::vector& data, size_t offset) - { - if (offset + 3 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return ((uint32_t)data.at(offset + 0) << 24) + ((uint32_t)data.at(offset + 1) << 16) + - ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3); - } - - static inline uint32_t ToUInt32BE(const std::vector& data, size_t offset) - { - if (offset + 3 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return ((uint32_t)data.at(offset + 0) << 24) + ((uint32_t)data.at(offset + 1) << 16) + - ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3); - } - - static inline int64_t ToInt64BE(const std::vector& data, size_t offset) - { - if (offset + 7 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) + - ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) + - ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) + - ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7)); - } - - static inline uint64_t ToUInt64BE(const std::vector& data, size_t offset) - { - if (offset + 7 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - return ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) + - ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) + - ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) + - ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7)); - } - - static inline float ToFloatBE(const std::vector& data, size_t offset) - { - if (offset + 3 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - float value; - uint32_t floatData = ((uint32_t)data.at(offset + 0) << 24) + - ((uint32_t)data.at(offset + 1) << 16) + - ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3); - static_assert(sizeof(uint32_t) == sizeof(float), "expected 32-bit float"); - std::memcpy(&value, &floatData, sizeof(value)); - return value; - } - - static inline double ToDoubleBE(const std::vector& data, size_t offset) - { - if (offset + 7 > data.size()) - { - fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); - fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); - fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); - fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); - } - double value; - uint64_t floatData = - ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) + - ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) + - ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) + - ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7)); - static_assert(sizeof(uint64_t) == sizeof(double), "expected 64-bit double"); - // Checks if the float format on the platform the ZAPD binary is running on supports the - // same float format as the object file. - static_assert(std::numeric_limits::is_iec559, - "expected IEC559 doubles on host machine"); - std::memcpy(&value, &floatData, sizeof(value)); - return value; - } -}; diff --git a/tools/ZAPD/ZAPDUtils/Utils/Directory.h b/tools/ZAPD/ZAPDUtils/Utils/Directory.h deleted file mode 100644 index d150f17727..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/Directory.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include -#include -#include - -#ifdef USE_BOOST_FS -#include -namespace fs = boost::filesystem; -#elif __has_include() -#include -namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif - -#include "StringHelper.h" - -class Directory -{ -public: -#ifdef USE_BOOST_FS - static std::string GetCurrentDirectory() - { - return fs::current_path().string(); - } -#else - static std::string GetCurrentDirectory() - { - return fs::current_path().u8string(); - } -#endif - - static bool Exists(const fs::path& path) - { - return fs::exists(path); - } - - static void CreateDirectory(const std::string& path) - { - std::string curPath; - std::vector split = StringHelper::Split(path, "/"); - - for (std::string s : split) - { - curPath += s + "/"; - - if (!Exists(curPath)) - fs::create_directory(curPath); - } - - // fs::create_directory(path); - } -}; diff --git a/tools/ZAPD/ZAPDUtils/Utils/File.h b/tools/ZAPD/ZAPDUtils/Utils/File.h deleted file mode 100644 index 707b1600fc..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/File.h +++ /dev/null @@ -1,97 +0,0 @@ -#pragma once - -#ifdef USE_BOOST_FS -#include -#else -#include -#endif - -#include -#include -#include "Directory.h" -#include "Utils/StringHelper.h" - -class File -{ -#ifdef USE_BOOST_FS - typedef fs::ifstream ifstream; - typedef fs::ofstream ofstream; -#else - typedef std::ifstream ifstream; - typedef std::ofstream ofstream; -#endif - -public: - static bool Exists(const fs::path& filePath) - { - ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate); - return file.good(); - } - - static std::vector ReadAllBytes(const fs::path& filePath) - { - ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate); - int32_t fileSize = (int32_t)file.tellg(); - file.seekg(0); - char* data = new char[fileSize]; - file.read(data, fileSize); - std::vector result = std::vector(data, data + fileSize); - delete[] data; - file.close(); - - return result; - }; - - static std::string ReadAllText(const fs::path& filePath) - { - ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate); - if (!file.is_open()) - return ""; - int32_t fileSize = (int32_t)file.tellg(); - file.seekg(0); - char* data = new char[fileSize + 1]; - memset(data, 0, fileSize + 1); - file.read(data, fileSize); - std::string str = std::string((const char*)data); - delete[] data; - file.close(); - - return str; - }; - - static std::vector ReadAllLines(const fs::path& filePath) - { - std::string text = ReadAllText(filePath); - std::vector lines = StringHelper::Split(text, "\n"); - - return lines; - }; - - static void WriteAllBytes(const fs::path& filePath, const std::vector& data) - { - ofstream file(filePath, std::ios::binary); - file.write((char*)data.data(), data.size()); - file.close(); - }; - - static void WriteAllBytes(const std::string& filePath, const std::vector& data) - { - ofstream file(filePath, std::ios::binary); - file.write((char*)data.data(), data.size()); - file.close(); - }; - - static void WriteAllBytes(const std::string& filePath, const char* data, int dataSize) - { - ofstream file(filePath, std::ios::binary); - file.write((char*)data, dataSize); - file.close(); - }; - - static void WriteAllText(const fs::path& filePath, const std::string& text) - { - ofstream file(filePath, std::ios::out); - file.write(text.c_str(), text.size()); - file.close(); - } -}; diff --git a/tools/ZAPD/ZAPDUtils/Utils/MemoryStream.cpp b/tools/ZAPD/ZAPDUtils/Utils/MemoryStream.cpp deleted file mode 100644 index 6e85c59a04..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/MemoryStream.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "MemoryStream.h" -#include - -#ifndef _MSC_VER -#define memcpy_s(dest, destSize, source, sourceSize) memcpy(dest, source, destSize) -#endif - -MemoryStream::MemoryStream() -{ - buffer = std::vector(); - bufferSize = 0; - baseAddress = 0; -} - -MemoryStream::MemoryStream(char* nBuffer, size_t nBufferSize) : MemoryStream() -{ - buffer = std::vector(nBuffer, nBuffer + nBufferSize); - bufferSize = nBufferSize; - baseAddress = 0; -} - -MemoryStream::~MemoryStream() -{ -} - -uint64_t MemoryStream::GetLength() -{ - return buffer.size(); -} - -void MemoryStream::Seek(int32_t offset, SeekOffsetType seekType) -{ - if (seekType == SeekOffsetType::Start) - baseAddress = offset; - else if (seekType == SeekOffsetType::Current) - baseAddress += offset; - else if (seekType == SeekOffsetType::End) - baseAddress = bufferSize - 1 - offset; -} - -std::unique_ptr MemoryStream::Read(size_t length) -{ - std::unique_ptr result = std::make_unique(length); - - memcpy_s(result.get(), length, &buffer[baseAddress], length); - baseAddress += length; - - return result; -} - -void MemoryStream::Read(const char* dest, size_t length) -{ - memcpy_s((void*)dest, length, &buffer[baseAddress], length); - baseAddress += length; -} - -int8_t MemoryStream::ReadByte() -{ - return buffer[baseAddress++]; -} - -void MemoryStream::Write(char* srcBuffer, size_t length) -{ - if (baseAddress + length >= buffer.size()) - { - buffer.resize(baseAddress + length); - bufferSize += length; - } - - memcpy_s(&buffer[baseAddress], length, srcBuffer, length); - baseAddress += length; -} - -void MemoryStream::WriteByte(int8_t value) -{ - if (baseAddress >= buffer.size()) - { - buffer.resize(baseAddress + 1); - bufferSize = baseAddress; - } - - buffer[baseAddress++] = value; -} - -std::vector MemoryStream::ToVector() -{ - return buffer; -} - -void MemoryStream::Flush() -{ -} - -void MemoryStream::Close() -{ -} \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Utils/MemoryStream.h b/tools/ZAPD/ZAPDUtils/Utils/MemoryStream.h deleted file mode 100644 index 5a17bb0c36..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/MemoryStream.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include -#include "Stream.h" - -class MemoryStream : public Stream -{ -public: - MemoryStream(); - MemoryStream(char* nBuffer, size_t nBufferSize); - ~MemoryStream(); - - uint64_t GetLength() override; - - void Seek(int32_t offset, SeekOffsetType seekType) override; - - std::unique_ptr Read(size_t length) override; - void Read(const char* dest, size_t length) override; - int8_t ReadByte() override; - - void Write(char* srcBuffer, size_t length) override; - void WriteByte(int8_t value) override; - - std::vector ToVector(); - - void Flush() override; - void Close() override; - -protected: - std::vector buffer; - std::size_t bufferSize; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Utils/Path.h b/tools/ZAPD/ZAPDUtils/Utils/Path.h deleted file mode 100644 index 90f55380b4..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/Path.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -#include -#include "Utils/StringHelper.h" - -#ifdef USE_BOOST_FS -#include -namespace fs = boost::filesystem; -#elif __has_include() -#include -namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif - -class Path -{ -public: - static std::string GetFileName(const fs::path& input) - { - // https://en.cppreference.com/w/cpp/filesystem/path/filename - return input.filename().string(); - }; - - static std::string GetFileNameWithoutExtension(const fs::path& input) - { - // https://en.cppreference.com/w/cpp/filesystem/path/stem - return input.stem().string(); - }; - - static std::string GetFileNameExtension(const std::string& input) - { - return input.substr(input.find_last_of("."), input.length()); - }; - - static fs::path GetPath(const std::string& input) - { - std::vector split = StringHelper::Split(input, "/"); - fs::path output; - - for (std::string str : split) - { - if (str.find_last_of(".") == std::string::npos) - output /= str; - } - - return output; - }; - - static fs::path GetDirectoryName(const fs::path& path) { return path.parent_path(); }; -}; diff --git a/tools/ZAPD/ZAPDUtils/Utils/Stream.h b/tools/ZAPD/ZAPDUtils/Utils/Stream.h deleted file mode 100644 index e73a9a70d0..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/Stream.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include -#include - -enum class SeekOffsetType -{ - Start, - Current, - End -}; - -// TODO: Eventually account for endianess in binaryreader and binarywriter -enum class Endianess -{ - Little = 0, - Big = 1, -}; - -class Stream -{ -public: - virtual ~Stream() = default; - virtual uint64_t GetLength() = 0; - uint64_t GetBaseAddress() { return baseAddress; } - - virtual void Seek(int32_t offset, SeekOffsetType seekType) = 0; - - virtual std::unique_ptr Read(size_t length) = 0; - virtual void Read(const char* dest, size_t length) = 0; - virtual int8_t ReadByte() = 0; - - virtual void Write(char* destBuffer, size_t length) = 0; - virtual void WriteByte(int8_t value) = 0; - - virtual void Flush() = 0; - virtual void Close() = 0; - -protected: - uint64_t baseAddress; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h b/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h deleted file mode 100644 index 942d0bcc9e..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h +++ /dev/null @@ -1,229 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -class StringHelper -{ -public: - static std::vector Split(std::string s, const std::string& delimiter) - { - std::vector result; - - size_t pos = 0; - std::string token; - - while ((pos = s.find(delimiter)) != std::string::npos) - { - token = s.substr(0, pos); - result.push_back(token); - s.erase(0, pos + delimiter.length()); - } - - if (s.length() != 0) - result.push_back(s); - - return result; - } - - static std::string Join(const std::vector parts, const std::string& delimiter) - { - std::string result; - - for (size_t i = 0; i < parts.size(); i++) - { - result += parts[i]; - - if (i != parts.size() - 1) - result += delimiter; - } - - return result; - } - - static std::string Strip(std::string s, const std::string& delimiter) - { - size_t pos = 0; - std::string token; - - while ((pos = s.find(delimiter)) != std::string::npos) - { - token = s.substr(0, pos); - s.erase(pos, pos + delimiter.length()); - } - - return s; - } - - static std::string Replace(std::string str, const std::string& from, const std::string& to) - { - size_t start_pos = str.find(from); - - if (start_pos == std::string::npos) - return str; - - str.replace(start_pos, from.length(), to); - return str; - } - - static bool StartsWith(const std::string& s, const std::string& input) - { - return s.rfind(input, 0) == 0; - } - - static bool Contains(const std::string& s, const std::string& input) - { - return s.find(input) != std::string::npos; - } - - static bool EndsWith(const std::string& s, const std::string& input) - { - size_t inputLen = strlen(input.c_str()); - return s.rfind(input) == (s.size() - inputLen); - } - - static std::string Sprintf(const char* format, ...) - { - char buffer[32768]; - // char buffer[2048]; - std::string output; - va_list va; - - va_start(va, format); - vsprintf(buffer, format, va); - va_end(va); - - output = buffer; - return output; - } - - static std::string Implode(std::vector& elements, const char* const separator) - { - return std::accumulate(std::begin(elements), std::end(elements), std::string(), - [separator](std::string& ss, std::string& s) { - return ss.empty() ? s : ss + separator + s; - }); - } - - static int64_t StrToL(const std::string& str, int32_t base = 10) - { - return std::strtoull(str.c_str(), nullptr, base); - } - - static std::string BoolStr(bool b) { return b ? "true" : "false"; } - - static bool HasOnlyDigits(const std::string& str) - { - return std::all_of(str.begin(), str.end(), ::isdigit); - } - - static bool IsValidHex(std::string_view str) - { - if (str.length() < 3) - { - return false; - } - - if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) - { - return std::all_of(str.begin() + 2, str.end(), ::isxdigit); - } - - return false; - } - - static bool IsValidOffset(std::string_view str) - { - if (str.length() == 1) - { - // 0 is a valid offset - return isdigit(str[0]); - } - - return IsValidHex(str); - } - - static bool IsValidHex(const std::string& str) - { - return IsValidHex(std::string_view(str.c_str())); - } - - static std::string ToUpper(const std::string& str) - { - std::string buff = str; - std::transform(buff.begin(), buff.end(), buff.begin(), ::toupper); - return buff; - } - - static bool IEquals(const std::string& a, const std::string& b) - { - return std::equal(a.begin(), a.end(), b.begin(), b.end(), - [](char a, char b) { return tolower(a) == tolower(b); }); - } - - /** - * Converts a std::string formatted in camelCase into one in SCREAMING_SNAKE_CASE. Since this - * will mostly be used on symbols that start with either 'g' or 's', an option is included to - * skip these. - */ - static std::string camelCaseTo_SCREAMING_SNAKE_CASE(const std::string& in, bool skipSP) - { - std::string out = ""; - const char* ptr = in.c_str(); - char ch = *ptr; - - // Switch checks for 'g'/'s'/'\0', looks at next character if skipSP enabled and string is - // nonempty. - switch (ch) - { - case 'g': - case 's': - if (skipSP) - { - // Print it anyway if the next character is lowercase, e.g. "gameplay_keep_...". - if (!isupper(ptr[1])) - { - out.push_back(toupper(ch)); - } - if ((ch = *++ptr) == '\0') - { - case '\0': - // This is reached either by the if or the case label, avoiding duplication. - return out; - } - } - [[fallthrough]]; - default: - if (islower(ch)) - { - out.push_back(toupper(ch)); - } - else - { - out.push_back(ch); - } - break; - } - - while ((ch = *++ptr) != '\0') - { - if (islower(ch)) - { - out.push_back(toupper(ch)); - } - else - { - if (isupper(ch) && !(isupper(ptr[1]) && isupper(ptr[-1]))) - { - out.push_back('_'); - } - out.push_back(ch); - } - } - return out; - } -}; diff --git a/tools/ZAPD/ZAPDUtils/Utils/vt.h b/tools/ZAPD/ZAPDUtils/Utils/vt.h deleted file mode 100644 index 23f424442b..0000000000 --- a/tools/ZAPD/ZAPDUtils/Utils/vt.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef VT_H -#define VT_H - -// clang-format off -#define VT_COLOR_BLACK 0 -#define VT_COLOR_RED 1 -#define VT_COLOR_GREEN 2 -#define VT_COLOR_YELLOW 3 -#define VT_COLOR_BLUE 4 -#define VT_COLOR_PURPLE 5 -#define VT_COLOR_CYAN 6 -#define VT_COLOR_WHITE 7 -#define VT_COLOR_LIGHTGRAY 8 -#define VT_COLOR_DARKGRAY 9 - -#define VT_COLOR_FOREGROUND 3 -#define VT_COLOR_BACKGROUND 4 -// clang-format on - -#define VT_COLOR_EXPAND0(type, color) #type #color -#define VT_COLOR_EXPAND1(type, color) VT_COLOR_EXPAND0(type, color) -#define VT_COLOR(type, color) VT_COLOR_EXPAND1(VT_COLOR_##type, VT_COLOR_##color) - -#define VT_ESC "\x1b" -#define VT_CSI "[" -#define VT_CUP(x, y) VT_ESC VT_CSI y ";" x "H" -#define VT_ED(n) VT_ESC VT_CSI #n "J" -#define VT_SGR(n) VT_ESC VT_CSI n "m" - -// Add more macros if necessary -#define VT_COL(back, fore) VT_SGR(VT_COLOR(BACKGROUND, back) ";" VT_COLOR(FOREGROUND, fore)) -#define VT_FGCOL(color) VT_SGR(VT_COLOR(FOREGROUND, color)) -#define VT_BGCOL(color) VT_SGR(VT_COLOR(BACKGROUND, color)) - -// Bold -#define VT_BOLD "1" - -// Bold color support -#define VT_BOLD_FGCOL(color) VT_SGR(VT_BOLD ";" VT_COLOR(FOREGROUND, color)) -#define VT_BOLD_BGCOL(color) VT_SGR(VT_BOLD ";" VT_COLOR(BACKGROUND, color)) - -#define VT_RST VT_SGR("") -#define VT_CLS VT_ED(2) - -#endif diff --git a/tools/ZAPD/ZAPDUtils/Vec2f.h b/tools/ZAPD/ZAPDUtils/Vec2f.h deleted file mode 100644 index 73e9259a89..0000000000 --- a/tools/ZAPD/ZAPDUtils/Vec2f.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include - -struct Vec2f -{ - float x, y; - - Vec2f() - { - x = 0; - y = 0; - }; - Vec2f(float nX, float nY) - { - x = nX; - y = nY; - }; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Vec3f.h b/tools/ZAPD/ZAPDUtils/Vec3f.h deleted file mode 100644 index d6e9c5568f..0000000000 --- a/tools/ZAPD/ZAPDUtils/Vec3f.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include - -struct Vec3f -{ - float x, y, z; - - Vec3f() - { - x = 0; - y = 0; - z = 0; - }; - Vec3f(float nX, float nY, float nZ) - { - x = nX; - y = nY; - z = nZ; - }; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/Vec3s.h b/tools/ZAPD/ZAPDUtils/Vec3s.h deleted file mode 100644 index 05816eddb5..0000000000 --- a/tools/ZAPD/ZAPDUtils/Vec3s.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include - -struct Vec3s -{ - int16_t x, y, z; - - Vec3s() - { - x = 0; - y = 0; - z = 0; - }; - Vec3s(int16_t nX, int16_t nY, int16_t nZ) - { - x = nX; - y = nY; - z = nZ; - }; -}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPDUtils/ZAPDUtils.vcxproj b/tools/ZAPD/ZAPDUtils/ZAPDUtils.vcxproj deleted file mode 100644 index 2abbdc9664..0000000000 --- a/tools/ZAPD/ZAPDUtils/ZAPDUtils.vcxproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {a2e01c3e-d647-45d1-9788-043debc1a908} - ZAPDUtils - 10.0 - - - - Application - true - v142 - Unicode - - - Application - false - v143 - true - Unicode - - - StaticLibrary - true - v142 - MultiByte - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - 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;%(PreprocessorDefinitions) - true - MultiThreadedDebug - Default - stdcpp17 - - - 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/ZAPDUtils/ZAPDUtils.vcxproj.filters b/tools/ZAPD/ZAPDUtils/ZAPDUtils.vcxproj.filters deleted file mode 100644 index 4765ad5d45..0000000000 --- a/tools/ZAPD/ZAPDUtils/ZAPDUtils.vcxproj.filters +++ /dev/null @@ -1,84 +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 - - - {d8c2c1e7-b065-4b0f-86a2-46ab46eedc0b} - - - {e047919d-7186-49ca-b115-e48fbb5c8743} - - - {3de9dd46-0dfd-4d48-9f20-9f24e5b80fe0} - - - - - Header Files\Utils - - - Header Files\Utils - - - Header Files\Utils - - - Header Files\Utils - - - Header Files\Utils - - - Header Files\Utils - - - Header Files\Utils - - - Header Files\Utils - - - Header Files - - - Header Files\Utils - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files\Utils - - - Source Files\Utils - - - Source Files\Utils - - - Source Files\Libraries - - - \ No newline at end of file diff --git a/tools/ZAPD/copycheck.py b/tools/ZAPD/copycheck.py deleted file mode 100755 index 36288f6853..0000000000 --- a/tools/ZAPD/copycheck.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import os -from shutil import copyfile - -if (os.environ.get('ZAPD_COPYDIR') != None): - print("Copying ZAPD.out to repo...") - #print(os.environ.get('ZAPD_COPYDIR')) - copyfile("ZAPD.out", os.environ.get('ZAPD_COPYDIR') + "/ZAPD.out") diff --git a/tools/ZAPD/docs/zapd_extraction_xml_reference.md b/tools/ZAPD/docs/zapd_extraction_xml_reference.md deleted file mode 100644 index edbdf857f1..0000000000 --- a/tools/ZAPD/docs/zapd_extraction_xml_reference.md +++ /dev/null @@ -1,680 +0,0 @@ -# ZAPD extraction XML reference - -This document aims to be a small reference of how to create a compatible xml file for ZAPD. - -## Table of contents - -- [ZAPD extraction XML reference](#zapd-extraction-xml-reference) - - [Table of contents](#table-of-contents) - - [Basic XML](#basic-xml) - - [Resources types](#resources-types) - - [File](#file) - - [ExternalFile](#externalfile) - - [Texture](#texture) - - [Background](#background) - - [Blob](#blob) - - [DList](#dlist) - - [TextureAnimation](#textureanimation) - - [Scene and Room](#scene-and-room) - - [AltHeader](#altheader) - - [Animation](#animation) - - [PlayerAnimation](#playeranimation) - - [CurveAnimation](#curveanimation) - - [LegacyAnimation](#legacyanimation) - - [Skeleton](#skeleton) - - [LimbTable](#limbtable) - - [Limb](#limb) - - [Symbol](#symbol) - - [Collision](#collision) - - [Scalar](#scalar) - - [Vector](#vector) - - [Vtx](#vtx) - - [Mtx](#mtx) - - [Cutscene](#cutscene) - - [Array](#array) - - [Path](#path) - - [PlayerAnimationData](#playeranimationdata) - - [Pointer](#pointer) - -## Basic XML - -An example of an object xml: - -```xml - - - - - - - - - - - - - - - - - - - -``` - -Every xml must have a `` tag. It must have at least one `` child. - -## Resources types - -The following is a list of the resources/tags supported by ZAPD, and the attributes needed by each one. - -For most resources inside a `` tag **you should also set an `Offset` attribute**. This is the offset (within the file) of the resource you are exporting. The `Offset` attribute is expected to be in hexadecimal, for example `Offset="0x41F0"`. - -It's worth noting that every tag expects a `Name="gNameOfTheAsset"`. This is will be the name of the extracted variable in the output C code. Every asset must be prefixed with `g` and the suffix should represent the type of the variable. - -Every tag can accept a `Static` attribute to specify if the asset should be marked as `static` or not. -There are 3 valid values (defaults to `Global`): - -- `Global`: Mark static if the flag `--static` was used. -- `On`: Override the global config and **always mark** as `static`. -- `Off`: Override the global config and **don't mark** as `static`. - -This table summarizes if the asset will be marked `static` (✅) or not (❌) -| `Static=""` attribute in XML | Without `--static` flag | With `--static` flag | -| ---------------------------- | ----------------------- | -------------------- | -| `On` | ✅ | ✅ | -| `Global` (default) | ❌ | ✅ | -| `Off` | ❌ | ❌ | - -------------------------- - -### File - -- Example of this tag: - -```xml - -``` - -- Attributes: - - - `Name`: Required. The name of the file in `baserom/` which will be extracted. - - `OutName`: Optional. The output name of the generated C source file. Defaults to the value passed to `Name`. - - `Segment`: Optional. This is the segment number of the current file. Expects a decimal number between 0 and 15 inclusive, usually 6 if it is an object. If not specified, the file will use VRAM instead of segmented addresses. - - `BaseAddress`: Optional. RAM address of the file. Expects a hex number (with `0x` prefix). Default value: `0`. - - `RangeStart`: Optional. File offset where the extraction will begin. Hex. Default value: `0x000000000`. - - `RangeEnd`: Optional. File offset where the extraction will end. Hex. Default value: `0xFFFFFFFF`. - - `Game`: Optional. Valid values: `OOT`, `MM`, `SW97` and `OOTSW97`. Default value: `OOT`. - -------------------------- - -### ExternalFile - -Allows ZAPD to map segmented addresses to variables declared in other files by using its XML. - -It is useful for objects that use variables from `gameplay_keep`, `gameplay_dangeon_keep`, `gameplay_field_keep`, etc. - -This tag can be used in the global `config.xml` file. - -- Example of this tag: - -```xml - -``` - -- Attributes: - - - `XmlPath`: Required. The path of the XML, relative to the value set by `ExternalXMLFolder` in the configuration file. - - `OutPath`: Required. The path were the header for the corresponding external file is. It is used to `#include` it in the generated `.c` file. - -------------------------- - -### Texture - -Textures are extracted as `.png` files. - -- Example: - -```xml - -``` - -Will be defined as: - -```c -u64 gCraterSmokeConeTex[] = { -#include "assets/objects/object_spot17_obj/crater_smoke_cone.ia8.inc.c" -}; -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Tex`, unless it is a palette, in that case it is suffixed by `TLUT`. - - `OutName`: Required. The filename of the extracted `.png` file. - - `Format`: Required. The format of the image. Valid values: `rgba32`, `rgba16`, `i4`, `i8`, `ia4`, `ia8`, `ia16`, `ci4` and `ci8`. - - `Width`: Required. Width in pixels of the image. - - `Height`: Required. Height in pixels of the image. - - `TlutOffset`: Optional. Specifies the tlut's offset used by this texture. This attribute is only valid if `Format` is either `ci4` or `ci8`, otherwise an exception would be thrown. - - `ExternalTlut`: Optional. Specifies that the texture's tlut is in a different file. Takes the filename of the file that contains the tlut. - - `ExternalTlutOffset`: Optional. Specifies the offset in the `ExternalTlut` of the tlut for the given texture. - - `SplitTlut`: Optional. Specifies that the given texture should take from the upper half of the tlut. Takes a bool, i.e. one of `true`, `false`, `1`, `0`. - -The following is a list of the texture formats the Nintendo 64 supports, with their gfxdis names and ZAPD format names. - -| Format name | Typing in `gsDPLoadTextureBlock` | "Format" in xml | -| ----------------------------------------------- | -------------------------------- | --------------- | -| 4-bit intensity (I) | `G_IM_FMT_I, G_IM_SIZ_4b` | `i4` | -| 4-bit intensity with alpha (I/A) (3/1) | `G_IM_FMT_IA, G_IM_SIZ_4b` | `ia4` | -| 4-bit color index (CI) | `G_IM_FMT_CI, G_IM_SIZ_4b` | `ci4` | -| 8-bit I | `G_IM_FMT_I, G_IM_SIZ_8b` | `i8` | -| 8-bit IA (4/4) | `G_IM_FMT_IA, G_IM_SIZ_8b` | `ia8` | -| 8-bit CI | `G_IM_FMT_CI, G_IM_SIZ_8b` | `ci8` | -| 16-bit red, green, blue, alpha (RGBA) (5/5/5/1) | `G_IM_FMT_RGBA, G_IM_SIZ_16b` | `rgba16` | -| 16-bit IA (8/8) | `G_IM_FMT_IA, G_IM_SIZ_16b` | `ia16` | -| 16-bit YUV (Luminance, Blue-Y, Red-Y) | `G_IM_FMT_YUV, G_IM_SIZ_16b` | (not used) | -| 32-bit RGBA (8/8/8/8) | `G_IM_FMT_RGBA, G_IM_SIZ_32b` | `rgba32` | - -If you want to know more about this formats, you can check [`gsDPLoadTextureBlock`](http://n64devkit.square7.ch/n64man/gdp/gDPLoadTextureBlock.htm) for most formats, or [`gDPLoadTextureBlock_4b`](http://n64devkit.square7.ch/n64man/gdp/gDPLoadTextureBlock_4b.htm) for the 4-bit formats. - -------------------------- - -### Background - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Background`. - - `OutName`: Required. The filename of the extracted `.jpg` file. - -※ Explicit use of this tag isn't often necesary because it would probably be extracted automatically by another extracted element. You can use this to name them if you don't like the autogenerated name. - -------------------------- - -### Blob - -Blob are binary data that will be extracted as `.bin` files. - -- Example: - -```xml - -``` - -Will be defined as: - -```c - -u8 gFireTempleBlob_00CCC0[] = { -#include "assets/objects/object_hidan_objects/gFireTempleBlob_00CCC0.bin.inc.c" -}; -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Blob`. - - `Size`: Required. Amount of bytes to extract. Hex. - -※ We usually use blobs when we can't figure out the content's type of chunk of data. - -------------------------- - -### DList - -A.k.a. Display list, or Gfx. - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `DL`. - -------------------------- - -### TextureAnimation - -A data type exclusive to Majora's Mask, that has scrolling, color changing, and texture changing capabilities. Declaring the main array will generate everything else; textures for the TextureCycle type must be declared manually in the XML to use symbols. (If it does reference any undeclared textures, ZAPD will warn and give the their offsets.) - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `TexAnim`. - -------------------------- - -### Scene and Room - -`Scene`s and `Room`s are a bit special, because `Room`s usually needs assets declared in their respective `Scene` (which is in a different file), so they need to be extracted together. - -To accomplish this, the scene and each of their rooms must be declared in the same XML. - -- Example: - -```xml - - - - - - - - - - - - - - -``` - -- Attributes: - - - `HackMode`: Optional. This is a simple non-hardcoded way to handle some edge cases. Valid values: `syotes_room`. - -------------------------- - -### AltHeader - -Like `Scene`s and `Room`s, `AltHeader`s is special too. It should always be declared in the same `File` as a `Scene` or a `Room`. - -- Example: - -```xml - - - - - - - - - - - - - - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `AltHeader`. - -------------------------- - -### Animation - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Anim`. - -------------------------- - -### PlayerAnimation - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Anim`. - -------------------------- - -### CurveAnimation - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Anim`. - - `SkelOffset`: Required. Offset of the `CurveSkeleton` (I.e. a [`Skeleton`](#skeleton) resource with `Type="Curve"`) related to this animation. - -------------------------- - -### LegacyAnimation - -Useful only for the unused `object_human`'s animation data. - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Anim`. - -------------------------- - -### Skeleton - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Skel`. - - `Type`: Required. Valid values: `Normal`, `Flex` and `Curve`. - - `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`. - - `EnumName`: Optional. The name of `typedef`'d limb enum. - - `LimbNone`: Optional. The name of the limb with index zero in the limb enum. - - `LimbMax`: Optional. The name of the max limb index in the limb enum. - -ZAPD is able to generate a limb enum by itself only if all the required data is provided. Providing some but not all the required data would trigger an error and the execution will halt. - -The required data is providing the `EnumName`, `LimbNone` and `LimbMax` attributes in the `Skeleton` or `LimbTable` node and the `EnumName` attribute in every `Limb` of this skeleton. - -※ There are no restrictions in the `Type` and `LimbType` attributes besides the valid values, so any skeleton type can be combined with any limb type. - -------------------------- - -### LimbTable - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Skel`. - - `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`. - - `Count`: Required. Amount of limbs. Integer. - - `EnumName`: Optional. The name of `typedef`'d limb enum. - - `LimbNone`: Optional. The name of the limb with index zero in the limb enum. - - `LimbMax`: Optional. The name of the max limb index in the limb enum. - -See [Skeleton](#skeleton) for info on the limb enum generation. - -------------------------- - -### Limb - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Limb`. - - `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`. - - `EnumName`: Optional. The name used for this limb in the limbs enum. It must be either present in every limb or in none. - -See [Skeleton](#skeleton) for info on the limb enum generation. - -------------------------- - -### Symbol - -A special element that allows declaring a variable without actually extracting it from the current file. Useful when a resource references an element from another file. The symbol will be declared as `extern`. - -- Example: - -```xml - -``` - -Will be declared as: - -```c -extern u8 gJsjutanShadowTex[2048]; -``` - -- Attributes: - - - `Type`: The type of the declared variable. If missing, it will default to `void*`. - - `TypeSize`: The size in bytes of the type. If missing, it will default to `4` (the size of a word and a pointer). Integer or hex value. - - `Count`: Optional. If it is present, the variable will be declared as an array instead of a plain variable. The value of this attribute specifies the length of the array. If `Count` is present but it has no value (`Count=""`), then the length of the array will not be specified either in the declared variable. Integer or hex value. - - `Static`: This attribute can't be enabled on a Symbol node. A warning will be showed in this case. - -------------------------- - -### Collision - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Col`. - -------------------------- - -### Scalar - -Allows the extraction of a single number. - -- Example: - -```xml - -``` - -Will be extracted as: - -```c -u64 pad34F8 = { 0 }; -``` - -- Attributes: - - - `Name`: Required. Suffixed by ~~`TBD`~~. - - `Type`: Required. Valid values: `s8`, `u8`, `x8`, `s16`, `u16`, `x16`, `s32`, `u32`, `x32`, `s64`, `u64`, `x64`, `f32` and `f64`. - -※ Can be wrapped in an [`Array`](#array) tag. - -------------------------- - -### Vector - -Extracts a vector. - -Current supported types are `Vec3s`, `Vec3i` or `Vec3f`. - -- Example: - -```xml - - - -``` - -Will be extracted as: - -```c -Vec3s D_04002040[24] = { - { -37, 2346, 93 }, - { 0, 11995, 0 }, - { -16385, -305, -16333 }, - { 0, 51, 12 }, - { 3761, 2263, -384 }, - { 0, 0, 3786 }, - { 1594, 1384, -18344 }, - { -2288, -2428, -1562 }, - { 0, 0, 3219 }, - { -2148, -5, -16840 }, - { 15365, -1708, 15611 }, - { 1761, 8365, 17711 }, - { 0, 0, 18859 }, - { 0, 0, 0 }, - { -9392, -9579, 28686 }, - { 0, 0, -7093 }, - { -2748, 685, -14092 }, - { 213, 6553, -32212 }, - { 0, 0, -1877 }, - { 3267, 3309, -16090 }, - { -18101, 25946, -2670 }, - { -104, 0, 0 }, - { 0, 0, 0 }, - { 0, 0, 0 } -}; -``` - -- Attributes: - - - `Name`: Required. Suffixed by ~~`TBD`~~. - - `Type`: Required. Specifies the vector's type (`Vec3s`, `Vec3i` and `Vec3f`). Valid values: `s16`, `s32` and `f32`. - - `Dimensions`: Required. The amount of dimensions of the vector. Valid values: `3`. - -※ Can be wrapped in an [`Array`](#array) tag. - -------------------------- - -### Vtx - -- Example: - -```xml - - - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Vtx`. - -※ Can be wrapped in an [`Array`](#array) tag. - -------------------------- - -### Mtx - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Mtx`. - -※ Explicit use of this tag isn't often necesary because it would probably be extracted automatically by another extracted element. - -------------------------- - -### Cutscene - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Cs`. - -※ Explicit use of this tag isn't often necesary because it would probably be extracted automatically by another extracted element. - -------------------------- - -### Array - -The `Array` element is special, because it needs an inner element to work. It will declare an array of its inner element. - -Currently, only [`Pointer`](#pointer), [`Scalar`](#scalar), [`Vector`](#vector) and [`Vtx`](#vtx) support being wrapped in an array. - -- Example: - -```xml - - - -``` - -- Attributes: - - - `Name`: Required. How the variable will be named. By our convention it should be prefixed by `g`. The sufix is mandated by the element contained. - - `Count`: Required. Amount of elements. Integer. - -------------------------- - -### Path - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `Path`. - - `NumPaths`: Optional. The amount of paths contained in the array. It must be a positive integer. - -------------------------- - -### PlayerAnimationData - -Allows the extraction of the specific data of the player animations which are found in the `link_animetion` file. - -- Example: - -```xml - -``` - -- Attributes: - - - `Name`: Required. Suffixed by `AnimData`. - - `FrameCount`: Required. The length of the animation in frames. It must be a positive integer. - -------------------------- - -### Pointer - -Allows the extraction of a variable that contains a pointer - -- Example: - -```xml - - - -``` - -- Attributes: - - - `Name`: Required. - - `Type`: Required. The type of the extracted pointer. - -※ Can be wrapped in an [`Array`](#array) tag. - -------------------------- diff --git a/tools/ZAPD/docs/zapd_warning_example.png b/tools/ZAPD/docs/zapd_warning_example.png deleted file mode 100644 index a001c64d6a..0000000000 Binary files a/tools/ZAPD/docs/zapd_warning_example.png and /dev/null differ diff --git a/tools/ZAPD/docs/zapd_xml_spec.md b/tools/ZAPD/docs/zapd_xml_spec.md deleted file mode 100644 index 9fcc0d4aab..0000000000 --- a/tools/ZAPD/docs/zapd_xml_spec.md +++ /dev/null @@ -1,55 +0,0 @@ -# ZAPD XML specification - -ZAPD XMLs use a restrictive subset of the XML standard: any ZAPD XML must be a valid XML (All elements starting with `` ending appropriately with ``, single "empty-element" tags with `/` at the end, etc.). - -Reminder that in - -```xml - - - - - - - - - -``` - -``, ``, `` are *children* of ``, but `` is not. `` is a *descendent* of `` and a child of ``. - -- Every XML's outermost element start/end tag is a single ``. -- The children of a `` must be ``s. -- A `` has *resources* as children. A resource is almost always single empty-element tag, and has one of the types - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - - `` - -- A `` cannot descend from a ``. -- All resources must be children of a ``. -- `` is the only paired resource tag enclosing an element; the element must be a single resource tag, one of - - `` - - `` - - `` diff --git a/tools/ZAPD/lib/libgfxd/.gitrepo b/tools/ZAPD/lib/libgfxd/.gitrepo deleted file mode 100644 index 4c8b7fe768..0000000000 --- a/tools/ZAPD/lib/libgfxd/.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 = git@github.com:glankk/libgfxd.git - branch = master - commit = 008f73dca8ebc9151b205959b17773a19c5bd0da - parent = c92cfda733aa740a53129a21f69c8abb08a465c7 - method = merge - cmdver = 0.4.3 diff --git a/tools/ZAPD/lib/libgfxd/LICENSE b/tools/ZAPD/lib/libgfxd/LICENSE deleted file mode 100644 index a7655f829d..0000000000 --- a/tools/ZAPD/lib/libgfxd/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016-2021 glank (glankk@github.com) - -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/lib/libgfxd/Makefile b/tools/ZAPD/lib/libgfxd/Makefile deleted file mode 100644 index b340ff5c0a..0000000000 --- a/tools/ZAPD/lib/libgfxd/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -CFLAGS = -Wall -O2 -g -UC_OBJ = uc_f3d.o uc_f3db.o uc_f3dex.o uc_f3dexb.o uc_f3dex2.o -OBJ = gfxd.o $(UC_OBJ) -LIB = libgfxd.a - -CPPFLAGS-$(MT) += -DCONFIG_MT -CPPFLAGS += $(CPPFLAGS-y) - -.PHONY: all -all: $(LIB) - -.PHONY: clean -clean: - rm -f $(OBJ) $(LIB) - -.INTERMEDIATE: $(OBJ) - -$(OBJ): gbi.h gfxd.h priv.h -$(UC_OBJ): uc.c uc_argfn.c uc_argtbl.c uc_macrofn.c uc_macrotbl.c - -$(LIB): $(OBJ) - $(AR) rcs $@ $^ - -%.o: %.c - $(COMPILE.c) $(OUTPUT_OPTION) $< diff --git a/tools/ZAPD/lib/libgfxd/README.md b/tools/ZAPD/lib/libgfxd/README.md deleted file mode 100644 index 2e82589439..0000000000 --- a/tools/ZAPD/lib/libgfxd/README.md +++ /dev/null @@ -1,478 +0,0 @@ -## Installing -Run `make` for a single-threaded build, or `make MT=y` for a multi-threaded -build. Copy `libgfxd.a` to your lib directory, and `gfxd.h` to your include -directory. - -## Example usage -Example source code: -``` -#include -#include - -static int macro_fn(void) -{ - /* Print a tab before each macro, and a comma and newline after each - macro */ - gfxd_puts("\t"); - gfxd_macro_dflt(); /* Execute the default macro handler */ - gfxd_puts(",\n"); - - return 0; -} - -int main() -{ - /* Read from stdin and write to stdout */ - gfxd_input_fd(fileno(stdin)); - gfxd_output_fd(fileno(stdout)); - - /* Override the default macro handler to make the output prettier */ - gfxd_macro_fn(macro_fn); - - /* Select F3DEX as the target microcode */ - gfxd_target(gfxd_f3dex); - - /* Set the input endianness to big endian, and the word size to 4 */ - gfxd_endian(gfxd_endian_big, 4); - - /* Print an opening brace */ - gfxd_puts("{\n"); - - /* Execute until the end of input, or until encountering an invalid - command */ - gfxd_execute(); - - /* Print a closing brace */ - gfxd_puts("}\n"); -} -``` - -Example input (binary): -``` -0xe7000000, 0x00000000, -0xfc127e03, 0xfffffdf8, -0xb900031d, 0xc8112078, -0xb6000000, 0x000e0000, -0xb7000000, 0x00012000, -0xfa000000, 0xffffffff, -0x040030bf, 0x000002e0, -0xb1000204, 0x00020604, -0xb1080a0c, 0x000a0e0c, -0xb10a1012, 0x000a120e, -0xb1140200, 0x00140016, -0xb8000000, 0x00000000, -``` - -Example output: -``` -{ - gsDPPipeSync(), - gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, 1, COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED), - gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2), - gsSPClearGeometryMode(G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR), - gsSPSetGeometryMode(G_CULL_BACK | G_FOG), - gsDPSetPrimColor(0, 0, 0xFF, 0xFF, 0xFF, 0xFF), - gsSPVertex(0x000002E0, 12, 0), - gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), - gsSP2Triangles(4, 5, 6, 0, 5, 7, 6, 0), - gsSP1Quadrangle(5, 8, 9, 7, 0), - gsSP1Quadrangle(10, 1, 0, 11, 0), - gsSPEndDisplayList(), -} -``` - -## Input/output methods -The input consists of any number of `Gfx` packets, and the output is the -decompiled macros in plain-text. The endianness and microcode type of the input -can be set using `gfxd_endian` and `gfxd_target`. - -Several methods of doing I/O are available. No method is selected by default, -meaning there will be no input, and any output will be discarded. - ---- - -##### `void gfxd_input_buffer(const void *buf, int size)` -##### `void gfxd_output_buffer(char *buf, int size)` -Use the buffer pointed to by `buf`, of `size` bytes. - ---- - -##### `void gfxd_input_fd(int fd)` -##### `void gfxd_output_fd(int fd)` -Use `read()` / `write()` with the provided file descriptor, `fd`. - ---- - -##### `typedef int gfxd_input_fn_t(void *buf, int count)` -##### `typedef int gfxd_output_fn_t(const char *buf, int count)` -##### `void gfxd_input_callback(gfxd_input_fn_t *fn)` -##### `void gfxd_output_callback(gfxd_output_fn_t *fn)` -Use the provided callback function, `fn`. `fn` should copy at most `count` -bytes to/from `buf`, and return the number of bytes actually copied. The input -callback should return 0 to signal end of input. - -## Handlers -The macro handler function is responsible for writing the output of each -decompiled macro. The default macro handler is `gfxd_macro_dflt`, but this can -be changed with `gfxd_macro_fn`. The new handler can extend the default -function by calling `gfxd_macro_dflt` within it, or it can override it -completely. - ---- - -##### `int gfxd_macro_dflt()` -The default macro handler. Outputs the macro name, dynamic display list pointer -if one has been specified, and then each argument in order using the function -registered using `gfxd_arg_fn` (`gfxd_arg_dflt` by default), and returns zero. -Because it is designed to be extended, it only outputs the macro text, without -any whitespace or punctuation before or after. When this function is used as -the sole macro handler, it will output the entire display list on one line -without any separation between macros, which is probably not what you want. - ---- - -##### `void gfxd_macro_fn(gfxd_macro_fn_t *fn)` -Set `fn` to be the macro handler function. `fn` can be null, in which case the -handler is reset to the default. - ---- - -##### `void gfxd_arg_dflt(int arg_num)` -The default argument handler for `gfxd_macro_dflt`. For the argument with index -`arg_num`, calls `gfxd_arg_callbacks`, and prints the argument value if the -callback returns zero, or if there is no callback for the given argument. - ---- - -##### `void gfxd_arg_fn(gfxd_arg_fn_t *fn)` -Set `fn` to be the argument handler function, called by `gfxd_macro_dflt`, -for each argument in the current macro, not counting the dynamic display list -pointer if one has been specified. `fn` can be null, in which case the handler -is reset to the default. This only affects the output of `gfxd_macro_dflt`, and -has no observable effect if `gfxd_macro_dflt` is overridden (not extended). - -## Argument callbacks -Callbacks can be registered that will be executed when an argument of a certain -type is encountered. The default argument handler `gfxd_arg_dflt` will execute -callbacks as needed using `gfxd_arg_callbacks`. If a callback returns non-zero, -`gfxd_arg_dflt` will not output anything. This is to allow callbacks to -override the default argument output. Otherwise, `gfxd_arg_dflt` will output -the argument value after the callback function's output. - ---- - -##### `int gfxd_arg_callbacks(int arg_num)` -Examines the argument with index `arg_num` and executes the callback function -for that argument type, if such a callback is supported and has been -registered. This function returns the value that was returned by the callback -function. If no callback function has been registered for the argument type, -zero is returned. - -Most argument callbacks have some extra parameters containing information that -might be relevant to the argument that triggered the callback. The extra -information is extracted only from the current macro, as gfxd does not retain -any context information from previous or subsequent macros. If any of the extra -parameter values is not available in the current macro, the value for that -parameter is substituted with `-1` for signed parameters, and zero for unsigned -parameters. - ---- - -##### `typedef int gfxd_tlut_fn_t(uint32_t tlut, int32_t idx, int32_t count)` -##### `void gfxd_tlut_callback(gfxd_tlut_fn_t *fn)` -Set the callback function for palette arguments. The argument type is -`gfxd_Tlut`. The palette index is in `idx` and the number of colors in `count`. - ---- - -##### `typedef int gfxd_timg_fn_t(uint32_t timg, int32_t fmt, int32_t siz, int32_t width, int32_t height, int32_t pal)` -##### `void gfxd_timg_callback(gfxd_timg_fn_t *fn)` -Set the callback function for texture arguments. The argument type is -`gfxd_Timg`. The image format is in `fmt` and `siz`, the dimensions in `width` -and `height`, and the palette index in `pal`. - ---- - -##### `typedef int gfxd_cimg_fn_t(uint32_t cimg, int32_t fmt, int32_t siz, int32_t width)` -##### `void gfxd_cimg_callback(gfxd_cimg_fn_t *fn)` -Set the callback function for frame buffer arguments. The argument type is -`gfxd_Cimg`. The image format is in `fmt` and `siz`, and the horizontal -resolution in `width`. - ---- - -##### `typedef int gfxd_zimg_fn_t(uint32_t zimg)` -##### `void gfxd_zimg_callback(gfxd_zimg_fn_t *fn)` -Set the callback function for depth buffer arguments. The argument type is -`gfxd_Zimg`. - ---- - -##### `typedef int gfxd_dl_fn_t(uint32_t dl)` -##### `void gfxd_dl_callback(gfxd_dl_fn_t *fn)` -Set the callback function for display list arguments. The argument type is -`gfxd_Dl`. - ---- - -##### `typedef int gfxd_mtx_fn_t(uint32_t mtx)` -##### `void gfxd_mtx_callback(gfxd_mtx_fn_t *fn)` -Set the callback function for matrix arguments. The argument type is -`gfxd_Mtxptr`. - ---- - -##### `typedef int gfxd_lookat_fn_t(uint32_t lookat, int32_t count)` -##### `void gfxd_lookat_callback(gfxd_lookat_fn_t *fn)` -Set the callback function for lookat array arguments. The argument type is -`gfxd_Lookatptr`. The number of lookat structures (1 or 2) is in `count`. - ---- - -##### `typedef int gfxd_light_fn_t(uint32_t light, int32_t count)` -##### `void gfxd_light_callback(gfxd_light_fn_t *fn)` -Set the callback function for light array arguments. The argument type is -`gfxd_Lightptr`. The number of light structures is in `count`. - ---- - -##### `typedef int gfxd_seg_fn_t(uint32_t seg, int32_t num)` -##### `void gfxd_seg_callback(gfxd_seg_fn_t *fn)` -Set the callback function for segment base arguments. The argument type is -`gfxd_Segptr`. The segment number is in `num`. - ---- - -##### `typedef int gfxd_vtx_fn_t(uint32_t vtx, int32_t num)` -##### `void gfxd_vtx_callback(gfxd_vtx_fn_t *fn)` -Set the callback function for vertex array arguments. The argument type is -`gfxd_Vtxptr`. The number of vertex structures is in `num`. - ---- - -##### `typedef int gfxd_vp_fn_t(uint32_t vp)` -##### `void gfxd_vp_callback(gfxd_vp_fn_t *fn)` -Set the callback function for viewport arguments. The argument type is -`gfxd_Vp`. - ---- - -##### `typedef int gfxd_uctext_fn_t(uint32_t text, uint32_t size)` -##### `void gfxd_uctext_callback(gfxd_uctext_fn_t *fn)` -Set the callback function for microcode text arguments. The argument type is -`gfxd_Uctext`. The size of the text segment is in `size`. - ---- - -##### `typedef int gfxd_ucdata_fn_t(uint32_t data, uint32_t size)` -##### `void gfxd_ucdata_callback(gfxd_ucdata_fn_t *fn)` -Set the callback function for microcode data arguments. The argument type is -`gfxd_Ucdata`. The size of the data segment is in `size`. - ---- - -##### `typedef int gfxd_dram_fn_t(uint32_t dram, uint32_t size)` -##### `void gfxd_dram_callback(gfxd_dram_fn_t *fn)` -Set the callback function for generic pointer arguments. The argument type is -`gfxd_Dram`. The size of the data is in `size`. - -## General settings -These functions control general input and output settings. - ---- - -##### `void gfxd_target(gfxd_ucode_t ucode)` -Select `ucode` as the target microcode. `ucode` can be `gfxd_f3d`, `gfxd_f3db`, -`gfxd_f3dex`, `gfxd_f3dexb`, or `gfxd_f3dex2`. The microcode must be selected -before `gfxd_execute`, as no microcode is selected by default. - ---- - -##### `void gfxd_endian(int endian, int wordsize)` -Select `endian` as the endianness of the input, and `wordsize` as the size of -each word in number of bytes. `endian` can be `gfxd_endian_big`, -`gfxd_endian_little`, or `gfxd_endian_host` (the endianness of the host -machine). `wordsize` can be 1, 2, 4, or 8. Big endian is selected by default, -with a word size of 4. - ---- - -##### `void gfxd_dynamic(const char *arg)` -Enable or disable the use of dynamic `g` macros instead of static `gs` macros, -and select the dynamic display list pointer argument to be used. `arg` will be -used by `gfxd_macro_dflt` as the first argument to dynamic macros. If `arg` is -null, dynamic macros are disabled, and `gs` macros are used. Also affects the -result of `gfxd_macro_name`, as it will return either the dynamic or static -version of the macro name as selected by this setting. - ---- - -##### `void gfxd_enable(int cap)` -##### `void gfxd_disable(int cap)` -Enable or disable the feature specified by `cap`. Can be one of the following; -- `gfxd_stop_on_invalid`: Stop execution when encountering an invalid macro. -Enabled by default. -- `gfxd_stop_on_end`: Stop execution when encountering a `SPBranchList` or -`SPEndDisplayList`. Enabled by default. -- `gfxd_emit_dec_color`: Print color components as decimal instead of -hexadecimal. Disabled by default. -- `gfxd_emit_q_macro`: Print fixed-point conversion `q` macros for fixed-point -values. Disabled by default. -- `gfxd_emit_ext_macro`: Emit non-standard macros. Some commands are valid -(though possibly meaningless), but have no macros associated with them, such as -a standalone `G_RDPHALF_1`. When this feature is enabled, such a command will -produce a non-standard `gsDPHalf1` macro instead of a raw hexadecimal command. -Also enables some non-standard multi-packet texture loading macros. Disabled by -default. - ---- - -##### `void gfxd_udata_set(void *ptr)` -##### `void *gfxd_udata_get(void)` -Set or get a generic pointer that can be used to pass user-defined data in and -out of callback functions. - -## Execution -Decompilation is started using the `gfxd_execute` function. When gfxd is -executing (i.e. after `gfxd_execute` has been entered, and before it returns), -the general settings and the I/O settings should not be changed. - ---- - -##### `int gfxd_execute()` -Start executing gfxd with the current settings. For each macro, the macro -handler registered with `gfxd_macro_fn` is called. Execution ends when the -input ends, the macro handler returns non-zero, when an invalid macro is -encountered and `gfxd_stop_on_invalid` is enabled, or when `SPBranchList` or -`SPEndDisplayList` is encountered and `gfxd_stop_on_end` is enabled. If -execution ends due to an invalid macro, `-1` is returned. If execution ends -because the macro handler returns non-zero, the return value from the macro -handler is returned. Otherwise zero is returned. - -## Macro information -The following functions can be used to obtain information about the current -macro and its arguments. They should only be used in custom handlers and -callbacks from within `gfxd_execute`. If used elsewhere, their behavior is -undefined. - ---- - -##### `int gfxd_macro_offset()` -Returns the offset in the input data of the current macro. The offset starts -at zero when `gfxd_execute` is called. - ---- - -##### `int gfxd_macro_packets()` -Returns the number of `Gfx` packets within the current macro. - ---- - -##### `const void *gfxd_macro_data()` -Returns a pointer to the input data for the current macro. The data is not -byte-swapped. The data has a length of `sizeof(Gfx) * gfxd_macro_packets()`. - ---- - -##### `int gfxd_macro_id()` -Returns a number that uniquely identifies the current macro. The number will -be one of the constants in `gfxd.h`. - ---- - -##### `const char *gfxd_macro_name()` -Returns the name of the current macro. If the macro does not have a name (i.e. -it's invalid), null is returned. If a dynamic display list pointer has been -specified, the dynamic `g` version is returned. Otherwise the static `gs` -version is returned. The returned pointer is invalidated by a subsequent call -to `gfxd_macro_name`. - ---- - -##### `int gfxd_arg_count()` -Returns the number of arguments to the current macro, not including a dynamic -display list pointer if one has been specified. - ---- - -##### `int gfxd_arg_type(int arg_num)` -Returns a number that identifies the type of the argument with index `arg_num`. -The number will be one of the constants in `gfxd.h`. - ---- - -##### `const char *gfxd_arg_name(int arg_num)` -Returns the name of the argument with index `arg_num`. Argument names are not -canonical, nor are they needed for macro disassembly, but they can be useful -for informational and diagnostic purposes. - ---- - -##### `int gfxd_arg_fmt(int arg_num)` -Returns the data format of the argument with index `arg_num`. The return value -will be `gfxd_argfmt_i` for `int32_t`, `gfxd_argfmt_u` for `uint32_t`, or -`gfxd_argfmt_f` for `float`. When accessing the value of the argument with -`gfxd_arg_value`, the member with the corresponding type should be used. - ---- - -##### `const gfxd_value_t *gfxd_arg_value(int arg_num)` -Returns a pointer to the value of the argument with index `arg_num`. The value -is a union of type `gfxd_value_t` with the following layout; -``` -typedef union -{ - int32_t i; - uint32_t u; - float f; -} gfxd_value_t -``` - ---- - -##### `const gfxd_value_t *gfxd_value_by_type(int type, int idx)` -Returns a pointer to the value of the argument that is of `type`, and has order -`idx` in all arguments of that type. An `idx` of zero returns the first -argument that has the specified type. If there is no argument with the given -type and order, null is returned. - ---- - -##### `int gfxd_arg_valid(int arg_num)` -Returns non-zero if the argument with index `arg_num` is "valid", for some -definition of valid. An invalid argument generally means that the disassembler -found inconsistencies in the input data, or that the data can not be reproduced -by the current macro type. The argument still has a value that can be printed, -though the value is not guaranteed to make any sense. - -## Custom output -When the default handlers are overridden or extended, the custom handler -functions will want to do some output of their own. The following methods are -available for inserting custom text into the gfxd output. - ---- - -##### `int gfxd_write(const void *buf, int count)` -Insert `count` bytes from the buffer at `buf` into the output. The number of -characters written is returned. - ---- - -##### `int gfxd_puts(const char *str)` -Insert the null-terminated string at `str` into the output. The number of -characters written is returned. - ---- - -##### `int gfxd_printf(const char *fmt, ...)` -Insert the printf-formatted string described by `fmt` and additional arguments -into the output. Limited to 255 characters. The number of characters written is -returned. - ---- - -##### `int gfxd_print_value(int type, const gfxd_value_t *value)` -Insert the type-formatted value into the output. The type should be one of the -constants in `gfxd.h`. The number of characters written is returned. The -macro argument with index `n` can be printed with -`gfxd_print_value(gfxd_arg_type(n), gfxd_arg_value(n))`. diff --git a/tools/ZAPD/lib/libgfxd/gbi.h b/tools/ZAPD/lib/libgfxd/gbi.h deleted file mode 100644 index 69fa7f12e5..0000000000 --- a/tools/ZAPD/lib/libgfxd/gbi.h +++ /dev/null @@ -1,3838 +0,0 @@ -/** - * gbi.h version 0.3.6 - * n64 graphics microcode interface library - * compatible with fast3d, f3dex, f3dex2, s2dex, and s2dex2 - * - * select a microcode with one of these preprocessor definitions; - * #define F3D_GBI - * for fast3d (selected automatically by default), or - * #define F3DEX_GBI - * for f3dex/s2dex, or - * #define F3DEX_GBI_2 - * for f3dex2/s2dex2 - * - * for early versions of fast3d and f3dex, also define the following; - * #define F3D_BETA - * - * ido incompatibilities; - * - use of c99 variadic macros - * - use of c99 fixed-width integer types - * - use of c99 designated initializers - * - use of c99 compound literals - * - use of c11 _Alignas - * - use of gnu c compound expressions - * - use of gnu c __typeof__ - * - * libultra incompatibilities; - * - many private, undocumented, or obsolete macros not commonly used by - * programmers are missing - * - many different implementation details that will produce matching gbi, - * but not matching code -**/ - -#ifndef N64_GBI_H -#define N64_GBI_H - -#include - -/* use fast3d by default */ -#if !defined(F3D_GBI) && !defined(F3DEX_GBI) && !defined(F3DEX_GBI_2) -# define F3D_GBI -#endif - -/* commands for fast3d and f3dex */ -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define G_SPNOOP 0x00 -# define G_MTX 0x01 -# define G_MOVEMEM 0x03 -# define G_VTX 0x04 -# define G_DL 0x06 -# if defined(F3D_BETA) -# define G_RDPHALF_2 0xB2 -# define G_RDPHALF_1 0xB3 -# define G_PERSPNORM 0xB4 -# else -# define G_RDPHALF_2 0xB3 -# define G_RDPHALF_1 0xB4 -# endif -# define G_LINE3D 0xB5 -# define G_CLEARGEOMETRYMODE 0xB6 -# define G_SETGEOMETRYMODE 0xB7 -# define G_ENDDL 0xB8 -# define G_SETOTHERMODE_L 0xB9 -# define G_SETOTHERMODE_H 0xBA -# define G_TEXTURE 0xBB -# define G_MOVEWORD 0xBC -# define G_POPMTX 0xBD -# define G_CULLDL 0xBE -# define G_TRI1 0xBF -# define G_NOOP 0xC0 -#endif - -/* commands for f3dex */ -#if defined(F3DEX_GBI) -# define G_LOAD_UCODE 0xAF -# define G_BRANCH_Z 0xB0 -# define G_TRI2 0xB1 -# if !defined(F3D_BETA) -# define G_MODIFYVTX 0xB2 -# endif -#endif - -/* commands for f3dex2 */ -#if defined(F3DEX_GBI_2) -# define G_NOOP 0x00 -# define G_VTX 0x01 -# define G_MODIFYVTX 0x02 -# define G_CULLDL 0x03 -# define G_BRANCH_Z 0x04 -# define G_TRI1 0x05 -# define G_TRI2 0x06 -# define G_QUAD 0x07 -# define G_LINE3D 0x08 -# define G_SPECIAL_3 0xD3 -# define G_SPECIAL_2 0xD4 -# define G_SPECIAL_1 0xD5 -# define G_DMA_IO 0xD6 -# define G_TEXTURE 0xD7 -# define G_POPMTX 0xD8 -# define G_GEOMETRYMODE 0xD9 -# define G_MTX 0xDA -# define G_MOVEWORD 0xDB -# define G_MOVEMEM 0xDC -# define G_LOAD_UCODE 0xDD -# define G_DL 0xDE -# define G_ENDDL 0xDF -# define G_SPNOOP 0xE0 -# define G_RDPHALF_1 0xE1 -# define G_SETOTHERMODE_L 0xE2 -# define G_SETOTHERMODE_H 0xE3 -# define G_RDPHALF_2 0xF1 -#endif - -/* rdp commands */ -#define G_TEXRECT 0xE4 -#define G_TEXRECTFLIP 0xE5 -#define G_RDPLOADSYNC 0xE6 -#define G_RDPPIPESYNC 0xE7 -#define G_RDPTILESYNC 0xE8 -#define G_RDPFULLSYNC 0xE9 -#define G_SETKEYGB 0xEA -#define G_SETKEYR 0xEB -#define G_SETCONVERT 0xEC -#define G_SETSCISSOR 0xED -#define G_SETPRIMDEPTH 0xEE -#define G_RDPSETOTHERMODE 0xEF -#define G_LOADTLUT 0xF0 -#define G_SETTILESIZE 0xF2 -#define G_LOADBLOCK 0xF3 -#define G_LOADTILE 0xF4 -#define G_SETTILE 0xF5 -#define G_FILLRECT 0xF6 -#define G_SETFILLCOLOR 0xF7 -#define G_SETFOGCOLOR 0xF8 -#define G_SETBLENDCOLOR 0xF9 -#define G_SETPRIMCOLOR 0xFA -#define G_SETENVCOLOR 0xFB -#define G_SETCOMBINE 0xFC -#define G_SETTIMG 0xFD -#define G_SETZIMG 0xFE -#define G_SETCIMG 0xFF - -/* commands for s2dex */ -#if defined(F3DEX_GBI) -# define G_BG_1CYC 0x01 -# define G_BG_COPY 0x02 -# define G_OBJ_RECTANGLE 0x03 -# define G_OBJ_SPRITE 0x04 -# define G_OBJ_MOVEMEM 0x05 -# define G_SELECT_DL 0xB0 -# define G_OBJ_RENDERMODE 0xB1 -# define G_OBJ_RECTANGLE_R 0xB2 -# define G_OBJ_LOADTXTR 0xC1 -# define G_OBJ_LDTX_SPRITE 0xC2 -# define G_OBJ_LDTX_RECT 0xC3 -# define G_OBJ_LDTX_RECT_R 0xC4 -#endif - -/* commands for s2dex2 */ -#if defined(F3DEX_GBI_2) -# define G_OBJ_RECTANGLE 0x01 -# define G_OBJ_SPRITE 0x02 -# define G_SELECT_DL 0x04 -# define G_OBJ_LOADTXTR 0x05 -# define G_OBJ_LDTX_SPRITE 0x06 -# define G_OBJ_LDTX_RECT 0x07 -# define G_OBJ_LDTX_RECT_R 0x08 -# define G_BG_1CYC 0x09 -# define G_BG_COPY 0x0A -# define G_OBJ_RENDERMODE 0x0B -# define G_OBJ_RECTANGLE_R 0xDA -# define G_OBJ_MOVEMEM 0xDC -#endif - -/* commands for s2dex and s2dex2 */ -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -# define G_RDPHALF_0 0xE4 -#endif - -/* image formats */ -#define G_IM_FMT_RGBA 0 -#define G_IM_FMT_YUV 1 -#define G_IM_FMT_CI 2 -#define G_IM_FMT_IA 3 -#define G_IM_FMT_I 4 -#define G_IM_SIZ_4b 0 -#define G_IM_SIZ_8b 1 -#define G_IM_SIZ_16b 2 -#define G_IM_SIZ_32b 3 - -/* texture settings */ -#define G_TX_NOMIRROR (gI_(0b0) << 0) -#define G_TX_MIRROR (gI_(0b1) << 0) -#define G_TX_WRAP (gI_(0b0) << 1) -#define G_TX_CLAMP (gI_(0b1) << 1) -#define G_TX_NOMASK gI_(0) -#define G_TX_NOLOD gI_(0) -#define G_OFF gI_(0) -#define G_ON gI_(1) - -/* tile indices */ -#define G_TX_LOADTILE 7 -#define G_TX_RENDERTILE 0 - -/* loadblock constants */ -#define G_TX_DXT_FRAC 11 -#define G_TX_LDBLK_MAX_TXL 2047 - -/* geometry mode */ -#define G_ZBUFFER (gI_(0b1) << 0) -#define G_SHADE (gI_(0b1) << 2) -#define G_CULL_BOTH (G_CULL_FRONT | G_CULL_BACK) -#define G_FOG (gI_(0b1) << 16) -#define G_LIGHTING (gI_(0b1) << 17) -#define G_TEXTURE_GEN (gI_(0b1) << 18) -#define G_TEXTURE_GEN_LINEAR (gI_(0b1) << 19) -#define G_LOD (gI_(0b1) << 20) - -/* geometry mode for fast3d */ -#if defined(F3D_GBI) -# define G_CLIPPING (gI_(0b0) << 0) -#endif - -/* geometry mode for fast3d and f3dex */ -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define G_TEXTURE_ENABLE (gI_(0b1) << 1) -# define G_SHADING_SMOOTH (gI_(0b1) << 9) -# define G_CULL_FRONT (gI_(0b1) << 12) -# define G_CULL_BACK (gI_(0b1) << 13) -#endif - -/* geometry mode for f3dex and f3dex2 */ -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -# define G_CLIPPING (gI_(0b1) << 23) -#endif - -/* geometry mode for f3dex2 */ -#if defined(F3DEX_GBI_2) -# define G_TEXTURE_ENABLE (gI_(0b0) << 0) -# define G_CULL_FRONT (gI_(0b1) << 9) -# define G_CULL_BACK (gI_(0b1) << 10) -# define G_SHADING_SMOOTH (gI_(0b1) << 21) -#endif - -/* othermode lo */ -#define G_MDSFT_ALPHACOMPARE 0 -#define G_MDSFT_ZSRCSEL 2 -#define G_MDSFT_RENDERMODE 3 -#define G_MDSFT_BLENDER 16 -#define G_MDSIZ_ALPHACOMPARE 2 -#define G_MDSIZ_ZSRCSEL 1 -#define G_MDSIZ_RENDERMODE 29 -#define G_MDSIZ_BLENDER 13 - -#define G_AC_NONE (gI_(0b00) << G_MDSFT_ALPHACOMPARE) -#define G_AC_THRESHOLD (gI_(0b01) << G_MDSFT_ALPHACOMPARE) -#define G_AC_DITHER (gI_(0b11) << G_MDSFT_ALPHACOMPARE) -#define G_ZS_PIXEL (gI_(0b0) << G_MDSFT_ZSRCSEL) -#define G_ZS_PRIM (gI_(0b1) << G_MDSFT_ZSRCSEL) -#define AA_EN (gI_(0b1) << (G_MDSFT_RENDERMODE + 0)) -#define Z_CMP (gI_(0b1) << (G_MDSFT_RENDERMODE + 1)) -#define Z_UPD (gI_(0b1) << (G_MDSFT_RENDERMODE + 2)) -#define IM_RD (gI_(0b1) << (G_MDSFT_RENDERMODE + 3)) -#define CLR_ON_CVG (gI_(0b1) << (G_MDSFT_RENDERMODE + 4)) -#define CVG_DST_CLAMP (gI_(0b00) << (G_MDSFT_RENDERMODE + 5)) -#define CVG_DST_WRAP (gI_(0b01) << (G_MDSFT_RENDERMODE + 5)) -#define CVG_DST_FULL (gI_(0b10) << (G_MDSFT_RENDERMODE + 5)) -#define CVG_DST_SAVE (gI_(0b11) << (G_MDSFT_RENDERMODE + 5)) -#define ZMODE_OPA (gI_(0b00) << (G_MDSFT_RENDERMODE + 7)) -#define ZMODE_INTER (gI_(0b01) << (G_MDSFT_RENDERMODE + 7)) -#define ZMODE_XLU (gI_(0b10) << (G_MDSFT_RENDERMODE + 7)) -#define ZMODE_DEC (gI_(0b11) << (G_MDSFT_RENDERMODE + 7)) -#define CVG_X_ALPHA (gI_(0b1) << (G_MDSFT_RENDERMODE + 9)) -#define ALPHA_CVG_SEL (gI_(0b1) << (G_MDSFT_RENDERMODE + 10)) -#define FORCE_BL (gI_(0b1) << (G_MDSFT_RENDERMODE + 11)) - -#define G_BL_1MA gI_(0b00) -#define G_BL_1 gI_(0b10) -#define G_BL_0 gI_(0b11) -#define G_BL_CLR_IN gI_(0b00) -#define G_BL_CLR_MEM gI_(0b01) -#define G_BL_CLR_BL gI_(0b10) -#define G_BL_CLR_FOG gI_(0b11) -#define G_BL_A_IN gI_(0b00) -#define G_BL_A_FOG gI_(0b01) -#define G_BL_A_MEM gI_(0b01) -#define G_BL_A_SHADE gI_(0b10) - -#define GBL_c1(p, a, m, b) \ - ( \ - gF_(p, 2, 30) | \ - gF_(a, 2, 26) | \ - gF_(m, 2, 22) | \ - gF_(b, 2, 18) \ - ) -#define GBL_c2(p, a, m, b) \ - ( \ - gF_(p, 2, 28) | \ - gF_(a, 2, 24) | \ - gF_(m, 2, 20) | \ - gF_(b, 2, 16) \ - ) - -/* render modes */ -#define G_RM_OPA_SURF \ - ( \ - CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_OPA_SURF2 \ - ( \ - CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_AA_OPA_SURF \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_OPA_SURF2 \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_OPA_SURF \ - ( \ - AA_EN | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_OPA_SURF2 \ - ( \ - AA_EN | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_ZB_OPA_SURF \ - ( \ - Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_ZB_OPA_SURF2 \ - ( \ - Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_OPA_SURF \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_OPA_SURF2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_ZB_OPA_SURF \ - ( \ - AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_ZB_OPA_SURF2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) - -#define G_RM_XLU_SURF \ - ( \ - IM_RD | CVG_DST_FULL | ZMODE_OPA | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_XLU_SURF2 \ - ( \ - IM_RD | CVG_DST_FULL | ZMODE_OPA | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_XLU_SURF \ - ( \ - AA_EN | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_OPA | \ - FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_XLU_SURF2 \ - ( \ - AA_EN | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_OPA | \ - FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_ZB_XLU_SURF \ - ( \ - Z_CMP | IM_RD | CVG_DST_FULL | ZMODE_XLU | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_ZB_XLU_SURF2 \ - ( \ - Z_CMP | IM_RD | CVG_DST_FULL | ZMODE_XLU | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_XLU_SURF \ - ( \ - AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | \ - ZMODE_XLU | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_XLU_SURF2 \ - ( \ - AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | \ - ZMODE_XLU | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_ZB_OPA_DECAL \ - ( \ - Z_CMP | CVG_DST_FULL | ZMODE_DEC | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_ZB_OPA_DECAL2 \ - ( \ - Z_CMP | CVG_DST_FULL | ZMODE_DEC | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_OPA_DECAL \ - ( \ - AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | ZMODE_DEC | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_OPA_DECAL2 \ - ( \ - AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | ZMODE_DEC | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_ZB_OPA_DECAL \ - ( \ - AA_EN | Z_CMP | CVG_DST_WRAP | ZMODE_DEC | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_ZB_OPA_DECAL2 \ - ( \ - AA_EN | Z_CMP | CVG_DST_WRAP | ZMODE_DEC | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) - -#define G_RM_ZB_XLU_DECAL \ - ( \ - Z_CMP | IM_RD | CVG_DST_FULL | ZMODE_DEC | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_ZB_XLU_DECAL2 \ - ( \ - Z_CMP | IM_RD | CVG_DST_FULL | ZMODE_DEC | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_XLU_DECAL \ - ( \ - AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | \ - ZMODE_DEC | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_XLU_DECAL2 \ - ( \ - AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | \ - ZMODE_DEC | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_AA_ZB_OPA_INTER \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_INTER | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_OPA_INTER2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_INTER | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_ZB_OPA_INTER \ - ( \ - AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | ZMODE_INTER | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_RA_ZB_OPA_INTER2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | ZMODE_INTER | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) - -#define G_RM_AA_ZB_XLU_INTER \ - ( \ - AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | \ - ZMODE_INTER | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_XLU_INTER2 \ - ( \ - AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | \ - ZMODE_INTER | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_AA_XLU_LINE \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_XLU_LINE2 \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_XLU_LINE \ - ( \ - AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | ZMODE_XLU | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_XLU_LINE2 \ - ( \ - AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | ZMODE_XLU | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_AA_DEC_LINE \ - ( \ - AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_DEC_LINE2 \ - ( \ - AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_DEC_LINE \ - ( \ - AA_EN | Z_CMP | IM_RD | CVG_DST_SAVE | ZMODE_DEC | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_DEC_LINE2 \ - ( \ - AA_EN | Z_CMP | IM_RD | CVG_DST_SAVE | ZMODE_DEC | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - - -#define G_RM_TEX_EDGE \ - ( \ - AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_TEX_EDGE2 \ - ( \ - AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_AA_TEX_EDGE \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_TEX_EDGE2 \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_TEX_EDGE \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_TEX_EDGE2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) - -#define G_RM_AA_ZB_TEX_INTER \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_INTER | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_TEX_INTER2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_INTER | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) - -#define G_RM_AA_SUB_SURF \ - ( \ - AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_SUB_SURF2 \ - ( \ - AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_SUB_SURF \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) -#define G_RM_AA_ZB_SUB_SURF2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) \ - ) - -#define G_RM_PCL_SURF \ - ( \ - G_AC_DITHER | CVG_DST_FULL | ZMODE_OPA | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_PCL_SURF2 \ - ( \ - G_AC_DITHER | CVG_DST_FULL | ZMODE_OPA | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_AA_PCL_SURF \ - ( \ - G_AC_DITHER | AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_PCL_SURF2 \ - ( \ - G_AC_DITHER | AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_ZB_PCL_SURF \ - ( \ - G_AC_DITHER | Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | \ - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_ZB_PCL_SURF2 \ - ( \ - G_AC_DITHER | Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | \ - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_AA_ZB_PCL_SURF \ - ( \ - G_AC_DITHER | AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ - ZMODE_OPA | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_PCL_SURF2 \ - ( \ - G_AC_DITHER | AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ - ZMODE_OPA | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_AA_OPA_TERR \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_OPA_TERR2 \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_OPA_TERR \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_OPA_TERR2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_AA_TEX_TERR \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_TEX_TERR2 \ - ( \ - AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_TEX_TERR \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_TEX_TERR2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_AA_SUB_TERR \ - ( \ - AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_SUB_TERR2 \ - ( \ - AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_SUB_TERR \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_ZB_SUB_TERR2 \ - ( \ - AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_CLD_SURF \ - ( \ - IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_CLD_SURF2 \ - ( \ - IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_ZB_CLD_SURF \ - ( \ - Z_CMP | IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_ZB_CLD_SURF2 \ - ( \ - Z_CMP | IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_ZB_OVL_SURF \ - ( \ - Z_CMP | IM_RD | CVG_DST_SAVE | ZMODE_DEC | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_ZB_OVL_SURF2 \ - ( \ - Z_CMP | IM_RD | CVG_DST_SAVE | ZMODE_DEC | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) - -#define G_RM_ADD \ - ( \ - IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_1) \ - ) -#define G_RM_ADD2 \ - ( \ - IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_1) \ - ) - -#define G_RM_FOG_SHADE_A \ - GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA) - -#define G_RM_FOG_PRIM_A \ - GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA) - -#define G_RM_PASS \ - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) - -#define G_RM_VISCVG \ - ( \ - IM_RD | FORCE_BL | \ - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_BL, G_BL_A_MEM) \ - ) -#define G_RM_VISCVG2 \ - ( \ - IM_RD | FORCE_BL | \ - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_BL, G_BL_A_MEM) \ - ) - -#define G_RM_OPA_CI \ - ( \ - CVG_DST_CLAMP | ZMODE_OPA | \ - GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) -#define G_RM_OPA_CI2 \ - ( \ - CVG_DST_CLAMP | ZMODE_OPA | \ - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) \ - ) - -#define G_RM_NOOP GBL_c1(0, 0, 0, 0) -#define G_RM_NOOP2 GBL_c2(0, 0, 0, 0) - -#define G_RM_SPRITE G_RM_OPA_SURF -#define G_RM_SPRITE2 G_RM_OPA_SURF2 -#define G_RM_RA_SPRITE \ - ( \ - AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | \ - GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_RA_SPRITE2 \ - ( \ - AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | \ - ALPHA_CVG_SEL | \ - GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) \ - ) -#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR -#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2 -#define G_RM_XLU_SPRITE G_RM_XLU_SURF -#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2 -#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF -#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2 - -#define G_OBJRM_NOTXCLAMP (gI_(0b1) << 0) -#define G_OBJRM_XLU (gI_(0b1) << 1) -#define G_OBJRM_ANTIALIAS (gI_(0b1) << 2) -#define G_OBJRM_BILERP (gI_(0b1) << 3) -#define G_OBJRM_SHRINKSIZE_1 (gI_(0b1) << 4) -#define G_OBJRM_SHRINKSIZE_2 (gI_(0b1) << 5) -#define G_OBJRM_WIDEN (gI_(0b1) << 6) - -/* othermode hi */ -#define G_MDSFT_ALPHADITHER 4 -#define G_MDSFT_RGBDITHER 6 -#define G_MDSFT_COMBKEY 8 -#define G_MDSFT_TEXTCONV 9 -#define G_MDSFT_TEXTFILT 12 -#define G_MDSFT_TEXTLUT 14 -#define G_MDSFT_TEXTLOD 16 -#define G_MDSFT_TEXTDETAIL 17 -#define G_MDSFT_TEXTPERSP 19 -#define G_MDSFT_CYCLETYPE 20 -#define G_MDSFT_PIPELINE 23 -#define G_MDSIZ_ALPHADITHER 2 -#define G_MDSIZ_RGBDITHER 2 -#define G_MDSIZ_COMBKEY 1 -#define G_MDSIZ_TEXTCONV 3 -#define G_MDSIZ_TEXTFILT 2 -#define G_MDSIZ_TEXTLUT 2 -#define G_MDSIZ_TEXTLOD 1 -#define G_MDSIZ_TEXTDETAIL 2 -#define G_MDSIZ_TEXTPERSP 1 -#define G_MDSIZ_CYCLETYPE 2 -#define G_MDSIZ_PIPELINE 1 - -#define G_AD_PATTERN (gI_(0b00) << G_MDSFT_ALPHADITHER) -#define G_AD_NOTPATTERN (gI_(0b01) << G_MDSFT_ALPHADITHER) -#define G_AD_NOISE (gI_(0b10) << G_MDSFT_ALPHADITHER) -#define G_AD_DISABLE (gI_(0b11) << G_MDSFT_ALPHADITHER) -#define G_CD_MAGICSQ (gI_(0b00) << G_MDSFT_RGBDITHER) -#define G_CD_BAYER (gI_(0b01) << G_MDSFT_RGBDITHER) -#define G_CD_NOISE (gI_(0b10) << G_MDSFT_RGBDITHER) -#define G_CD_DISABLE (gI_(0b11) << G_MDSFT_RGBDITHER) -#define G_CD_ENABLE (gI_(0b10) << G_MDSFT_RGBDITHER) -#define G_CK_NONE (gI_(0b0) << G_MDSFT_COMBKEY) -#define G_CK_KEY (gI_(0b1) << G_MDSFT_COMBKEY) -#define G_TC_CONV (gI_(0b000) << G_MDSFT_TEXTCONV) -#define G_TC_FILTCONV (gI_(0b101) << G_MDSFT_TEXTCONV) -#define G_TC_FILT (gI_(0b110) << G_MDSFT_TEXTCONV) -#define G_TF_POINT (gI_(0b00) << G_MDSFT_TEXTFILT) -#define G_TF_BILERP (gI_(0b10) << G_MDSFT_TEXTFILT) -#define G_TF_AVERAGE (gI_(0b11) << G_MDSFT_TEXTFILT) -#define G_TT_NONE (gI_(0b00) << G_MDSFT_TEXTLUT) -#define G_TT_RGBA16 (gI_(0b10) << G_MDSFT_TEXTLUT) -#define G_TT_IA16 (gI_(0b11) << G_MDSFT_TEXTLUT) -#define G_TL_TILE (gI_(0b0) << G_MDSFT_TEXTLOD) -#define G_TL_LOD (gI_(0b1) << G_MDSFT_TEXTLOD) -#define G_TD_CLAMP (gI_(0b00) << G_MDSFT_TEXTDETAIL) -#define G_TD_SHARPEN (gI_(0b01) << G_MDSFT_TEXTDETAIL) -#define G_TD_DETAIL (gI_(0b10) << G_MDSFT_TEXTDETAIL) -#define G_TP_NONE (gI_(0b0) << G_MDSFT_TEXTPERSP) -#define G_TP_PERSP (gI_(0b1) << G_MDSFT_TEXTPERSP) -#define G_CYC_1CYCLE (gI_(0b00) << G_MDSFT_CYCLETYPE) -#define G_CYC_2CYCLE (gI_(0b01) << G_MDSFT_CYCLETYPE) -#define G_CYC_COPY (gI_(0b10) << G_MDSFT_CYCLETYPE) -#define G_CYC_FILL (gI_(0b11) << G_MDSFT_CYCLETYPE) -#define G_PM_NPRIMITIVE (gI_(0b0) << G_MDSFT_PIPELINE) -#define G_PM_1PRIMITIVE (gI_(0b1) << G_MDSFT_PIPELINE) - -/* color conversion constants */ -#define G_CV_K0 (175) -#define G_CV_K1 (-43) -#define G_CV_K2 (-89) -#define G_CV_K3 (222) -#define G_CV_K4 (114) -#define G_CV_K5 (42) - -/* color combiner */ -#define G_CCMUX_COMBINED 0 -#define G_CCMUX_TEXEL0 1 -#define G_CCMUX_TEXEL1 2 -#define G_CCMUX_PRIMITIVE 3 -#define G_CCMUX_SHADE 4 -#define G_CCMUX_ENVIRONMENT 5 -#define G_CCMUX_1 6 -#define G_CCMUX_NOISE 7 -#define G_CCMUX_0 31 -#define G_CCMUX_CENTER 6 -#define G_CCMUX_K4 7 -#define G_CCMUX_SCALE 6 -#define G_CCMUX_COMBINED_ALPHA 7 -#define G_CCMUX_TEXEL0_ALPHA 8 -#define G_CCMUX_TEXEL1_ALPHA 9 -#define G_CCMUX_PRIMITIVE_ALPHA 10 -#define G_CCMUX_SHADE_ALPHA 11 -#define G_CCMUX_ENV_ALPHA 12 -#define G_CCMUX_LOD_FRACTION 13 -#define G_CCMUX_PRIM_LOD_FRAC 14 -#define G_CCMUX_K5 15 -#define G_ACMUX_COMBINED 0 -#define G_ACMUX_TEXEL0 1 -#define G_ACMUX_TEXEL1 2 -#define G_ACMUX_PRIMITIVE 3 -#define G_ACMUX_SHADE 4 -#define G_ACMUX_ENVIRONMENT 5 -#define G_ACMUX_1 6 -#define G_ACMUX_0 7 -#define G_ACMUX_LOD_FRACTION 0 -#define G_ACMUX_PRIM_LOD_FRAC 6 - -/* - * combine modes - * ( A - B ) * C + D -*/ -#define G_CC_MODULATEI \ - TEXEL0, 0, SHADE, 0, \ - 0, 0, 0, SHADE -#define G_CC_MODULATEIA \ - TEXEL0, 0, SHADE, 0, \ - TEXEL0, 0, SHADE, 0 -#define G_CC_MODULATEIDECALA \ - TEXEL0, 0, SHADE, 0, \ - 0, 0, 0, TEXEL0 -#define G_CC_MODULATERGB \ - G_CC_MODULATEI -#define G_CC_MODULATERGBA \ - G_CC_MODULATEIA -#define G_CC_MODULATERGBDECALA \ - G_CC_MODULATEIDECALA -#define G_CC_MODULATEI_PRIM \ - TEXEL0, 0, PRIMITIVE, 0, \ - 0, 0, 0, PRIMITIVE -#define G_CC_MODULATEIA_PRIM \ - TEXEL0, 0, PRIMITIVE, 0, \ - TEXEL0, 0, PRIMITIVE, 0 -#define G_CC_MODULATEIDECALA_PRIM \ - TEXEL0, 0, PRIMITIVE, 0, \ - 0, 0, 0, TEXEL0 -#define G_CC_MODULATERGB_PRIM \ - G_CC_MODULATEI_PRIM -#define G_CC_MODULATERGBA_PRIM \ - G_CC_MODULATEIA_PRIM -#define G_CC_MODULATERGBDECALA_PRIM \ - G_CC_MODULATEIDECALA_PRIM -#define G_CC_DECALRGB \ - 0, 0, 0, TEXEL0, \ - 0, 0, 0, SHADE -#define G_CC_DECALRGBA \ - 0, 0, 0, TEXEL0, \ - 0, 0, 0, TEXEL0 -#define G_CC_BLENDI \ - ENVIRONMENT, SHADE, TEXEL0, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_BLENDIA \ - ENVIRONMENT, SHADE, TEXEL0, SHADE, \ - TEXEL0, 0, SHADE, 0 -#define G_CC_BLENDIDECALA \ - ENVIRONMENT, SHADE, TEXEL0, SHADE, \ - 0, 0, 0, TEXEL0 -#define G_CC_BLENDRGBA \ - TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_BLENDRGBDECALA \ - TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, \ - 0, 0, 0, TEXEL0 -#define G_CC_REFLECTRGB \ - ENVIRONMENT, 0, TEXEL0, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_REFLECTRGBDECALA \ - ENVIRONMENT, 0, TEXEL0, SHADE, \ - 0, 0, 0, TEXEL0 -#define G_CC_HILITERGB \ - PRIMITIVE, SHADE, TEXEL0, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_HILITERGBA \ - PRIMITIVE, SHADE, TEXEL0, SHADE, \ - PRIMITIVE, SHADE, TEXEL0, SHADE -#define G_CC_HILITERGBDECALA \ - PRIMITIVE, SHADE, TEXEL0, SHADE, \ - 0, 0, 0, TEXEL0 -#define G_CC_1CYUV2RGB \ - TEXEL0, K4, K5, TEXEL0, \ - 0, 0, 0, SHADE -#define G_CC_PRIMITIVE \ - 0, 0, 0, PRIMITIVE, \ - 0, 0, 0, PRIMITIVE -#define G_CC_SHADE \ - 0, 0, 0, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_ADDRGB \ - 1, 0, TEXEL0, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_ADDRGBDECALA \ - 1, 0, TEXEL0, SHADE, \ - 0, 0, 0, TEXEL0 -#define G_CC_SHADEDECALA \ - 0, 0, 0, SHADE, \ - 0, 0, 0, TEXEL0 -#define G_CC_BLENDPE \ - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, \ - TEXEL0, 0, SHADE, 0 -#define G_CC_BLENDPEDECALA \ - PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, \ - 0, 0, 0, TEXEL0 -#define G_CC_TRILERP \ - TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, \ - TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0 -#define G_CC_TEMPLERP \ - TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, \ - TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0 -#define G_CC_INTERFERENCE \ - TEXEL0, 0, TEXEL1, 0, \ - TEXEL0, 0, TEXEL1, 0 -#define _G_CC_BLENDPE \ - ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, \ - TEXEL0, 0, SHADE, 0 -#define _G_CC_BLENDPEDECALA \ - ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, \ - 0, 0, 0, TEXEL0 -#define _G_CC_SPARSEST \ - PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0, \ - PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0 -#define _G_CC_TWOCOLORTEX \ - PRIMITIVE, SHADE, TEXEL0, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_MODULATEI2 \ - COMBINED, 0, SHADE, 0, \ - 0, 0, 0, SHADE -#define G_CC_MODULATEIA2 \ - COMBINED, 0, SHADE, 0, \ - COMBINED, 0, SHADE, 0 -#define G_CC_MODULATERGB2 \ - G_CC_MODULATEI2 -#define G_CC_MODULATERGBA2 \ - G_CC_MODULATEIA2 -#define G_CC_MODULATEI_PRIM2 \ - COMBINED, 0, PRIMITIVE, 0, \ - 0, 0, 0, PRIMITIVE -#define G_CC_MODULATEIA_PRIM2 \ - COMBINED, 0, PRIMITIVE, 0, \ - COMBINED, 0, PRIMITIVE, 0 -#define G_CC_MODULATERGB_PRIM2 \ - G_CC_MODULATEI_PRIM2 -#define G_CC_MODULATERGBA_PRIM2 \ - G_CC_MODULATEIA_PRIM2 -#define G_CC_DECALRGB2 \ - 0, 0, 0, COMBINED, \ - 0, 0, 0, SHADE -#define G_CC_BLENDI2 \ - ENVIRONMENT, SHADE, COMBINED, SHADE, \ - 0, 0, 0, SHADE -#define G_CC_BLENDIA2 \ - ENVIRONMENT, SHADE, COMBINED, SHADE, \ - COMBINED, 0, SHADE, 0 -#define G_CC_HILITERGB2 \ - ENVIRONMENT, COMBINED, TEXEL0, COMBINED, \ - 0, 0, 0, SHADE -#define G_CC_HILITERGBA2 \ - ENVIRONMENT, COMBINED, TEXEL0, COMBINED, \ - ENVIRONMENT, COMBINED, TEXEL0, COMBINED -#define G_CC_HILITERGBDECALA2 \ - ENVIRONMENT, COMBINED, TEXEL0, COMBINED, \ - 0, 0, 0, TEXEL0 -#define G_CC_HILITERGBPASSA2 \ - ENVIRONMENT, COMBINED, TEXEL0, COMBINED, \ - 0, 0, 0, COMBINED -#define G_CC_CHROMA_KEY2 \ - TEXEL0, CENTER, SCALE, 0, \ - 0, 0, 0, 0 -#define G_CC_YUV2RGB \ - TEXEL1, K4, K5, TEXEL1, \ - 0, 0, 0, 0 -#define G_CC_PASS2 \ - 0, 0, 0, COMBINED, \ - 0, 0, 0, COMBINED -#define G_CC_LERP(a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \ - a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \ - ( \ - gFL_(G_CCMUX_##a0, 4, 52) | \ - gFL_(G_CCMUX_##c0, 5, 47) | \ - gFL_(G_ACMUX_##Aa0, 3, 44) | \ - gFL_(G_ACMUX_##Ac0, 3, 41) | \ - gFL_(G_CCMUX_##a1, 4, 37) | \ - gFL_(G_CCMUX_##c1, 5, 32) | \ - gFL_(G_CCMUX_##b0, 4, 28) | \ - gFL_(G_CCMUX_##b1, 4, 24) | \ - gFL_(G_ACMUX_##Aa1, 3, 21) | \ - gFL_(G_ACMUX_##Ac1, 3, 18) | \ - gFL_(G_CCMUX_##d0, 3, 15) | \ - gFL_(G_ACMUX_##Ab0, 3, 12) | \ - gFL_(G_ACMUX_##Ad0, 3, 9) | \ - gFL_(G_CCMUX_##d1, 3, 6) | \ - gFL_(G_ACMUX_##Ab1, 3, 3) | \ - gFL_(G_ACMUX_##Ad1, 3, 0) \ - ) -#define G_CC_MODE(mode1, mode2) G_CC_LERP(mode1, mode2) - -/* scissor modes */ -#define G_SC_NON_INTERLACE gI_(0b00) -#define G_SC_EVEN_INTERLACE gI_(0b10) -#define G_SC_ODD_INTERLACE gI_(0b11) - -/* display list branch flags */ -#define G_DL_PUSH gI_(0b0) -#define G_DL_NOPUSH gI_(0b1) - -/* conditional branching flags (f3dex and f3dex2) */ -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -# define G_BZ_PERSP 0 -# define G_BZ_ORTHO 1 -#endif - -/* matrix params */ -#define G_MTX_MUL (gI_(0b0) << 1) -#define G_MTX_LOAD (gI_(0b1) << 1) - -/* matrix params for fast3d and f3dex */ -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define G_MTX_MODELVIEW (gI_(0b0) << 0) -# define G_MTX_PROJECTION (gI_(0b1) << 0) -# define G_MTX_NOPUSH (gI_(0b0) << 2) -# define G_MTX_PUSH (gI_(0b1) << 2) -#endif - -/* matrix params for f3dex2 */ -#if defined(F3DEX_GBI_2) -# define G_MTX_NOPUSH (gI_(0b0) << 0) -# define G_MTX_PUSH (gI_(0b1) << 0) -# define G_MTX_MODELVIEW (gI_(0b0) << 2) -# define G_MTX_PROJECTION (gI_(0b1) << 2) -#endif - -/* moveword indices */ -#define G_MW_MATRIX 0 -#define G_MW_NUMLIGHT 2 -#define G_MW_CLIP 4 -#define G_MW_SEGMENT 6 -#define G_MW_FOG 8 -#define G_MW_GENSTAT 8 -#define G_MW_LIGHTCOL 10 -#define G_MW_PERSPNORM 14 - -/* moveword indices for fast3d and f3dex */ -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define G_MW_POINTS 12 -#endif - -/* moveword indices for f3dex2 */ -#if defined(F3DEX_GBI_2) -# define G_MW_FORCEMTX 12 -#endif - -/* moveword offsets */ -#define G_MWO_NUMLIGHT gI_(0x00) -#define G_MWO_CLIP_RNX gI_(0x04) -#define G_MWO_CLIP_RNY gI_(0x0C) -#define G_MWO_CLIP_RPX gI_(0x14) -#define G_MWO_CLIP_RPY gI_(0x1C) -#define G_MWO_SEGMENT_0 gI_(0x00) -#define G_MWO_SEGMENT_1 gI_(0x04) -#define G_MWO_SEGMENT_2 gI_(0x08) -#define G_MWO_SEGMENT_3 gI_(0x0C) -#define G_MWO_SEGMENT_4 gI_(0x10) -#define G_MWO_SEGMENT_5 gI_(0x14) -#define G_MWO_SEGMENT_6 gI_(0x18) -#define G_MWO_SEGMENT_7 gI_(0x1C) -#define G_MWO_SEGMENT_8 gI_(0x20) -#define G_MWO_SEGMENT_9 gI_(0x24) -#define G_MWO_SEGMENT_A gI_(0x28) -#define G_MWO_SEGMENT_B gI_(0x2C) -#define G_MWO_SEGMENT_C gI_(0x30) -#define G_MWO_SEGMENT_D gI_(0x34) -#define G_MWO_SEGMENT_E gI_(0x38) -#define G_MWO_SEGMENT_F gI_(0x3C) -#define G_MWO_FOG gI_(0x00) -#define G_MWO_aLIGHT_1 gI_(0x00) -#define G_MWO_bLIGHT_1 gI_(0x04) -#define G_MWO_MATRIX_XX_XY_I gI_(0x00) -#define G_MWO_MATRIX_XZ_XW_I gI_(0x04) -#define G_MWO_MATRIX_YX_YY_I gI_(0x08) -#define G_MWO_MATRIX_YZ_YW_I gI_(0x0C) -#define G_MWO_MATRIX_ZX_ZY_I gI_(0x10) -#define G_MWO_MATRIX_ZZ_ZW_I gI_(0x14) -#define G_MWO_MATRIX_WX_WY_I gI_(0x18) -#define G_MWO_MATRIX_WZ_WW_I gI_(0x1C) -#define G_MWO_MATRIX_XX_XY_F gI_(0x20) -#define G_MWO_MATRIX_XZ_XW_F gI_(0x24) -#define G_MWO_MATRIX_YX_YY_F gI_(0x28) -#define G_MWO_MATRIX_YZ_YW_F gI_(0x2C) -#define G_MWO_MATRIX_ZX_ZY_F gI_(0x30) -#define G_MWO_MATRIX_ZZ_ZW_F gI_(0x34) -#define G_MWO_MATRIX_WX_WY_F gI_(0x38) -#define G_MWO_MATRIX_WZ_WW_F gI_(0x3C) -#define G_MWO_POINT_RGBA gI_(0x10) -#define G_MWO_POINT_ST gI_(0x14) -#define G_MWO_POINT_XYSCREEN gI_(0x18) -#define G_MWO_POINT_ZSCREEN gI_(0x1C) - -/* moveword offsets for fast3d and f3dex */ -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define G_MWO_aLIGHT_2 gI_(0x20) -# define G_MWO_bLIGHT_2 gI_(0x24) -# define G_MWO_aLIGHT_3 gI_(0x40) -# define G_MWO_bLIGHT_3 gI_(0x44) -# define G_MWO_aLIGHT_4 gI_(0x60) -# define G_MWO_bLIGHT_4 gI_(0x64) -# define G_MWO_aLIGHT_5 gI_(0x80) -# define G_MWO_bLIGHT_5 gI_(0x84) -# define G_MWO_aLIGHT_6 gI_(0xA0) -# define G_MWO_bLIGHT_6 gI_(0xA4) -# define G_MWO_aLIGHT_7 gI_(0xC0) -# define G_MWO_bLIGHT_7 gI_(0xC4) -# define G_MWO_aLIGHT_8 gI_(0xE0) -# define G_MWO_bLIGHT_8 gI_(0xE4) -#endif - -/* moveword offsets for f3dex2 */ -#if defined(F3DEX_GBI_2) -# define G_MWO_aLIGHT_2 gI_(0x18) -# define G_MWO_bLIGHT_2 gI_(0x1C) -# define G_MWO_aLIGHT_3 gI_(0x30) -# define G_MWO_bLIGHT_3 gI_(0x34) -# define G_MWO_aLIGHT_4 gI_(0x48) -# define G_MWO_bLIGHT_4 gI_(0x4C) -# define G_MWO_aLIGHT_5 gI_(0x60) -# define G_MWO_bLIGHT_5 gI_(0x64) -# define G_MWO_aLIGHT_6 gI_(0x78) -# define G_MWO_bLIGHT_6 gI_(0x7C) -# define G_MWO_aLIGHT_7 gI_(0x90) -# define G_MWO_bLIGHT_7 gI_(0x94) -# define G_MWO_aLIGHT_8 gI_(0xA8) -# define G_MWO_bLIGHT_8 gI_(0xAC) -#endif - -/* movemem params for fast3d and f3dex */ -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define G_MV_VIEWPORT 128 -# define G_MV_LOOKATY 130 -# define G_MV_LOOKATX 132 -# define G_MV_L0 134 -# define G_MV_L1 136 -# define G_MV_L2 138 -# define G_MV_L3 140 -# define G_MV_L4 142 -# define G_MV_L5 144 -# define G_MV_L6 146 -# define G_MV_L7 148 -# define G_MV_TXTATT 150 -# define G_MV_MATRIX_2 152 -# define G_MV_MATRIX_3 154 -# define G_MV_MATRIX_4 156 -# define G_MV_MATRIX_1 158 -#endif - -/* movemem params for f3dex2 */ -#if defined(F3DEX_GBI_2) -# define G_MV_MMTX 2 -# define G_MV_PMTX 6 -# define G_MV_VIEWPORT 8 -# define G_MV_LIGHT 10 -# define G_MV_POINT 12 -# define G_MV_MATRIX 14 -# define G_MVO_LOOKATX gI_(0 * 0x18) -# define G_MVO_LOOKATY gI_(1 * 0x18) -# define G_MVO_L0 gI_(2 * 0x18) -# define G_MVO_L1 gI_(3 * 0x18) -# define G_MVO_L2 gI_(4 * 0x18) -# define G_MVO_L3 gI_(5 * 0x18) -# define G_MVO_L4 gI_(6 * 0x18) -# define G_MVO_L5 gI_(7 * 0x18) -# define G_MVO_L6 gI_(8 * 0x18) -# define G_MVO_L7 gI_(9 * 0x18) -#endif - -/* frustum ratios */ -#define FRUSTRATIO_1 gI_(1) -#define FRUSTRATIO_2 gI_(2) -#define FRUSTRATIO_3 gI_(3) -#define FRUSTRATIO_4 gI_(4) -#define FRUSTRATIO_5 gI_(5) -#define FRUSTRATIO_6 gI_(6) - -/* light params */ -#define NUMLIGHTS_0 1 -#define NUMLIGHTS_1 1 -#define NUMLIGHTS_2 2 -#define NUMLIGHTS_3 3 -#define NUMLIGHTS_4 4 -#define NUMLIGHTS_5 5 -#define NUMLIGHTS_6 6 -#define NUMLIGHTS_7 7 -#define LIGHT_1 1 -#define LIGHT_2 2 -#define LIGHT_3 3 -#define LIGHT_4 4 -#define LIGHT_5 5 -#define LIGHT_6 6 -#define LIGHT_7 7 -#define LIGHT_8 8 - -/* light params for fast3d and f3dex */ -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define NUML(n) (((n) + 1) * 32 + 0x80000000) -#endif - -/* light params for f3dex2 */ -#if defined(F3DEX_GBI_2) -# define NUML(n) ((n) * 0x18) -#endif - -/* background load types */ -#define G_BGLT_LOADBLOCK gI_(0x0033) -#define G_BGLT_LOADTILE gI_(0xFFF4) - -/* background flags */ -#define G_BG_FLAG_FLIPS (gI_(0b1) << 0) -#define G_BG_FLAG_FLIPT (gI_(0b1) << 1) - -/* object load types */ -#define G_OBJLT_TXTRBLOCK gI_(0x00001033) -#define G_OBJLT_TXTRTILE gI_(0x00FC1034) -#define G_OBJLT_TLUT gI_(0x00000030) - -/* object flags */ -#define G_OBJ_FLAG_FLIPS (gI_(0b1) << 0) -#define G_OBJ_FLAG_FLIPT (gI_(0b1) << 4) - -/* color macros */ -#define G_MAXZ 0x03FF -#define G_MAXFBZ 0x3FFF -#define GPACK_RGBA5551(r, g, b, a) \ - ( \ - gF_(r, 5, 11) | \ - gF_(g, 5, 6) | \ - gF_(b, 5, 1) | \ - gF_(a, 1, 0) \ - ) -#define GPACK_RGBA8888(r, g, b, a) \ - ( \ - gF_(r, 8, 24) | \ - gF_(g, 8, 16) | \ - gF_(b, 8, 8) | \ - gF_(a, 8, 0) \ - ) -#define GPACK_RGB24A8(rgb, a) (gF_(rgb, 24, 8) | gF_(a, 8, 0)) -#define GPACK_ZDZ(z, dz) (gF_(z, 14, 2) | gF_(dz, 2, 0)) - -/* structure definition macros */ -#define gdSPDefMtx(xx, xy, xz, xw, \ - yx, yy, yz, yw, \ - zx, zy, zz, zw, \ - wx, wy, wz, ww) \ - ( \ - (Mtx) \ - { \ - .i = \ - { \ - (qs1616(xx) >> 16) & 0xFFFF, \ - (qs1616(xy) >> 16) & 0xFFFF, \ - (qs1616(xz) >> 16) & 0xFFFF, \ - (qs1616(xw) >> 16) & 0xFFFF, \ - (qs1616(yx) >> 16) & 0xFFFF, \ - (qs1616(yy) >> 16) & 0xFFFF, \ - (qs1616(yz) >> 16) & 0xFFFF, \ - (qs1616(yw) >> 16) & 0xFFFF, \ - (qs1616(zx) >> 16) & 0xFFFF, \ - (qs1616(zy) >> 16) & 0xFFFF, \ - (qs1616(zz) >> 16) & 0xFFFF, \ - (qs1616(zw) >> 16) & 0xFFFF, \ - (qs1616(wx) >> 16) & 0xFFFF, \ - (qs1616(wy) >> 16) & 0xFFFF, \ - (qs1616(wz) >> 16) & 0xFFFF, \ - (qs1616(ww) >> 16) & 0xFFFF, \ - }, \ - .f = \ - { \ - qs1616(xx) & 0xFFFF, \ - qs1616(xy) & 0xFFFF, \ - qs1616(xz) & 0xFFFF, \ - qs1616(xw) & 0xFFFF, \ - qs1616(yx) & 0xFFFF, \ - qs1616(yy) & 0xFFFF, \ - qs1616(yz) & 0xFFFF, \ - qs1616(yw) & 0xFFFF, \ - qs1616(zx) & 0xFFFF, \ - qs1616(zy) & 0xFFFF, \ - qs1616(zz) & 0xFFFF, \ - qs1616(zw) & 0xFFFF, \ - qs1616(wx) & 0xFFFF, \ - qs1616(wy) & 0xFFFF, \ - qs1616(wz) & 0xFFFF, \ - qs1616(ww) & 0xFFFF, \ - } \ - } \ - ) -#define gdSPDefLookAt(rx, ry, rz, ux, uy, uz) \ - ( \ - (LookAt) \ - { \ - .l[0].l = \ - { \ - .col = {0, 0, 0}, \ - .colc = {0, 0, 0}, \ - .dir = {rx, ry, rz}, \ - }, \ - .l[1].l = \ - { \ - .col = {0, 0x80, 0}, \ - .colc = {0, 0x80, 0}, \ - .dir = {ux, uy, uz}, \ - }, \ - } \ - ) -#define gdSPDefLights0(ar, ag, ab) \ - ( \ - (Lights0) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - } \ - } \ - ) -#define gdSPDefLights1(ar, ag, ab, \ - r1, g1, b1, x1, y1, z1) \ - ( \ - (Lights1) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - .col = {r1, g1, b1}, \ - .colc = {r1, g1, b1}, \ - .dir = {x1, y1, z1}, \ - } \ - } \ - ) -#define gdSPDefLights2(ar, ag, ab, \ - r1, g1, b1, x1, y1, z1, \ - r2, g2, b2, x2, y2, z2) \ - ( \ - (Lights2) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - .col = {r1, g1, b1}, \ - .colc = {r1, g1, b1}, \ - .dir = {x1, y1, z1}, \ - } \ - .l[1].l = \ - { \ - .col = {r2, g2, b2}, \ - .colc = {r2, g2, b2}, \ - .dir = {x2, y2, z2}, \ - } \ - } \ - ) -#define gdSPDefLights3(ar, ag, ab, \ - r1, g1, b1, x1, y1, z1, \ - r2, g2, b2, x2, y2, z2, \ - r3, g3, b3, x3, y3, z3) \ - ( \ - (Lights3) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - .col = {r1, g1, b1}, \ - .colc = {r1, g1, b1}, \ - .dir = {x1, y1, z1}, \ - } \ - .l[1].l = \ - { \ - .col = {r2, g2, b2}, \ - .colc = {r2, g2, b2}, \ - .dir = {x2, y2, z2}, \ - } \ - .l[2].l = \ - { \ - .col = {r3, g3, b3}, \ - .colc = {r3, g3, b3}, \ - .dir = {x3, y3, z3}, \ - } \ - } \ - ) -#define gdSPDefLights4(ar, ag, ab, \ - r1, g1, b1, x1, y1, z1, \ - r2, g2, b2, x2, y2, z2, \ - r3, g3, b3, x3, y3, z3, \ - r4, g4, b4, x4, y4, z4) \ - ( \ - (Lights4) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - .col = {r1, g1, b1}, \ - .colc = {r1, g1, b1}, \ - .dir = {x1, y1, z1}, \ - } \ - .l[1].l = \ - { \ - .col = {r2, g2, b2}, \ - .colc = {r2, g2, b2}, \ - .dir = {x2, y2, z2}, \ - } \ - .l[2].l = \ - { \ - .col = {r3, g3, b3}, \ - .colc = {r3, g3, b3}, \ - .dir = {x3, y3, z3}, \ - } \ - .l[3].l = \ - { \ - .col = {r4, g4, b4}, \ - .colc = {r4, g4, b4}, \ - .dir = {x4, y4, z4}, \ - } \ - } \ - ) -#define gdSPDefLights5(ar, ag, ab, \ - r1, g1, b1, x1, y1, z1, \ - r2, g2, b2, x2, y2, z2, \ - r3, g3, b3, x3, y3, z3, \ - r4, g4, b4, x4, y4, z4, \ - r5, g5, b5, x5, y5, z5) \ - ( \ - (Lights5) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - .col = {r1, g1, b1}, \ - .colc = {r1, g1, b1}, \ - .dir = {x1, y1, z1}, \ - } \ - .l[1].l = \ - { \ - .col = {r2, g2, b2}, \ - .colc = {r2, g2, b2}, \ - .dir = {x2, y2, z2}, \ - } \ - .l[2].l = \ - { \ - .col = {r3, g3, b3}, \ - .colc = {r3, g3, b3}, \ - .dir = {x3, y3, z3}, \ - } \ - .l[3].l = \ - { \ - .col = {r4, g4, b4}, \ - .colc = {r4, g4, b4}, \ - .dir = {x4, y4, z4}, \ - } \ - .l[4].l = \ - { \ - .col = {r5, g5, b5}, \ - .colc = {r5, g5, b5}, \ - .dir = {x5, y5, z5}, \ - } \ - } \ - ) -#define gdSPDefLights6(ar, ag, ab, \ - r1, g1, b1, x1, y1, z1, \ - r2, g2, b2, x2, y2, z2, \ - r3, g3, b3, x3, y3, z3, \ - r4, g4, b4, x4, y4, z4, \ - r5, g5, b5, x5, y5, z5, \ - r6, g6, b6, x6, y6, z6)\ - ( \ - (Lights6) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - .col = {r1, g1, b1}, \ - .colc = {r1, g1, b1}, \ - .dir = {x1, y1, z1}, \ - } \ - .l[1].l = \ - { \ - .col = {r2, g2, b2}, \ - .colc = {r2, g2, b2}, \ - .dir = {x2, y2, z2}, \ - } \ - .l[2].l = \ - { \ - .col = {r3, g3, b3}, \ - .colc = {r3, g3, b3}, \ - .dir = {x3, y3, z3}, \ - } \ - .l[3].l = \ - { \ - .col = {r4, g4, b4}, \ - .colc = {r4, g4, b4}, \ - .dir = {x4, y4, z4}, \ - } \ - .l[4].l = \ - { \ - .col = {r5, g5, b5}, \ - .colc = {r5, g5, b5}, \ - .dir = {x5, y5, z5}, \ - } \ - .l[5].l = \ - { \ - .col = {r6, g6, b6}, \ - .colc = {r6, g6, b6}, \ - .dir = {x6, y6, z6}, \ - } \ - } \ - ) -#define gdSPDefLights7(ar, ag, ab, \ - r1, g1, b1, x1, y1, z1, \ - r2, g2, b2, x2, y2, z2, \ - r3, g3, b3, x3, y3, z3, \ - r4, g4, b4, x4, y4, z4, \ - r5, g5, b5, x5, y5, z5, \ - r6, g6, b6, x6, y6, z6, \ - r7, g7, b7, x7, y7, z7) \ - ( \ - (Lights7) \ - { \ - .a.l = \ - { \ - .col = {ar, ag, ab}, \ - .colc = {ar, ag, ab}, \ - }, \ - .l[0].l = \ - { \ - .col = {r1, g1, b1}, \ - .colc = {r1, g1, b1}, \ - .dir = {x1, y1, z1}, \ - } \ - .l[1].l = \ - { \ - .col = {r2, g2, b2}, \ - .colc = {r2, g2, b2}, \ - .dir = {x2, y2, z2}, \ - } \ - .l[2].l = \ - { \ - .col = {r3, g3, b3}, \ - .colc = {r3, g3, b3}, \ - .dir = {x3, y3, z3}, \ - } \ - .l[3].l = \ - { \ - .col = {r4, g4, b4}, \ - .colc = {r4, g4, b4}, \ - .dir = {x4, y4, z4}, \ - } \ - .l[4].l = \ - { \ - .col = {r5, g5, b5}, \ - .colc = {r5, g5, b5}, \ - .dir = {x5, y5, z5}, \ - } \ - .l[5].l = \ - { \ - .col = {r6, g6, b6}, \ - .colc = {r6, g6, b6}, \ - .dir = {x6, y6, z6}, \ - } \ - .l[6].l = \ - { \ - .col = {r7, g7, b7}, \ - .colc = {r7, g7, b7}, \ - .dir = {x7, y7, z7}, \ - } \ - } \ - ) -#define gdSPDefVtx(x, y, z, s, t) \ - ( \ - (Vtx) \ - { \ - .v = \ - { \ - .ob = {x, y, z}, \ - .tc = {qs105(s), qs105(t)}, \ - } \ - } \ - ) -#define gdSPDefVtxC(x, y, z, s, t, cr, cg, cb, ca) \ - ( \ - (Vtx) \ - { \ - .v = \ - { \ - .ob = {x, y, z}, \ - .tc = {qs105(s), qs105(t)}, \ - .cn = {cr, cg, cb, ca}, \ - } \ - } \ - ) -#define gdSPDefVtxN(x, y, z, s, t, nx, ny, nz, ca) \ - ( \ - (Vtx) \ - { \ - .n = \ - { \ - .ob = {x, y, z}, \ - .tc = {qs105(s), qs105(t)}, \ - .n = {nx, ny, nz}, \ - .a = ca \ - } \ - } \ - ) - -/* instruction macros */ - -#define gsDPFillRectangle(ulx, uly, lrx, lry) \ - gO_( \ - G_FILLRECT, \ - gF_(lrx, 10, 14) | \ - gF_(lry, 10, 2), \ - gF_(ulx, 10, 14) | \ - gF_(uly, 10, 2)) - -#define gsDPScisFillRectangle(ulx, uly, lrx, lry) \ - gsDPFillRectangle(gScC_(ulx), gScC_(uly), gScC_(lrx), gScC_(lry)) - -#define gsDPFullSync() \ - gO_(G_RDPFULLSYNC, 0, 0) - -#define gsDPLoadSync() \ - gO_(G_RDPLOADSYNC, 0, 0) - -#define gsDPTileSync() \ - gO_(G_RDPTILESYNC, 0, 0) - -#define gsDPPipeSync() \ - gO_(G_RDPPIPESYNC, 0, 0) - -#define gsDPLoadTLUT_pal16(pal, dram) \ - gsDPLoadTLUT(16, 256 + (gI_(pal) & 0xF) * 16, dram) - -#define gsDPLoadTLUT_pal256(dram) \ - gsDPLoadTLUT(256, 256, dram) - -#define gLTB_(timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - dxt, tmem, rt, line) \ - gsDPSetTextureImage(fmt, G_SIZ_LDSIZ(siz), 1, timg), \ - gsDPSetTile( \ - fmt, G_SIZ_LDSIZ(siz), 0, tmem, G_TX_LOADTILE, 0, \ - cmt, maskt, shiftt, \ - cms, masks, shifts), \ - gsDPLoadSync(), \ - gsDPLoadBlock( \ - G_TX_LOADTILE, 0, 0, \ - G_LTB_LRS(width, height, siz), \ - dxt), \ - gsDPPipeSync(), \ - gsDPSetTile( \ - fmt, siz, line, tmem, rt, pal, \ - cmt, maskt, shiftt, \ - cms, masks, shifts), \ - gsDPSetTileSize(rt, 0, 0, qu102((width) - 1), qu102((height) - 1)) - -#define gsDPLoadTextureBlock(timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(siz, width), 0x0, G_TX_RENDERTILE, \ - ((width) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define gsDPLoadTextureBlockS(timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, 0x0, G_TX_RENDERTILE, \ - ((width) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define gsDPLoadTextureBlock_4b(timg, fmt, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, G_IM_SIZ_4b, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(G_IM_SIZ_4b, width), 0x0, G_TX_RENDERTILE, \ - ((width) * 4 + 63) / 64) - -#define gsDPLoadTextureBlock_4bS(timg, fmt, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, G_IM_SIZ_4b, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, 0x0, G_TX_RENDERTILE, \ - ((width) * 4 + 63) / 64) - -#define gsDPLoadTextureBlockYuv(timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(siz, width), 0x0, G_TX_RENDERTILE, \ - ((width) + 7) / 8) - -#define gsDPLoadTextureBlockYuvS(timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, 0x0, G_TX_RENDERTILE, \ - ((width) + 7) / 8) - -#define _gsDPLoadTextureBlock(timg, tmem, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(siz, width), tmem, G_TX_RENDERTILE, \ - ((width) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define _gsDPLoadTextureBlockS(timg, tmem, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, tmem, G_TX_RENDERTILE, \ - ((width) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define _gsDPLoadTextureBlock_4b(timg, tmem, fmt, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, G_IM_SIZ_4b, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(G_IM_SIZ_4b, width), tmem, G_TX_RENDERTILE, \ - ((width) * 4 + 63) / 64) - -#define _gsDPLoadTextureBlock_4bS(timg, tmem, fmt, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, G_IM_SIZ_4b, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, tmem, G_TX_RENDERTILE, \ - ((width) * 4 + 63) / 64) - -#define _gsDPLoadTextureBlockYuv(timg, tmem, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(siz, width), tmem, G_TX_RENDERTILE, \ - ((width) + 7) / 8) - -#define _gsDPLoadTextureBlockYuvS(timg, tmem, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, tmem, G_TX_RENDERTILE, \ - ((width) + 7) / 8) - -#define gsDPLoadMultiBlock(timg, tmem, rt, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(siz, width), tmem, rt, \ - ((width) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define gsDPLoadMultiBlockS(timg, tmem, rt, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, tmem, rt, \ - ((width) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define gsDPLoadMultiBlock_4b(timg, tmem, rt, fmt, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, G_IM_SIZ_4b, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(G_IM_SIZ_4b, width), tmem, rt, \ - ((width) * 4 + 63) / 64) - -#define gsDPLoadMultiBlock_4bS(timg, tmem, rt, fmt, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, G_IM_SIZ_4b, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, tmem, rt, \ - ((width) * 4 + 63) / 64) - -#define gsDPLoadMultiBlockYuv(timg, tmem, rt, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - G_DXT(siz, width), tmem, rt, \ - ((width) + 7) / 8) - -#define gsDPLoadMultiBlockYuvS(timg, tmem, rt, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTB_( \ - timg, fmt, siz, width, height, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0, tmem, rt, \ - ((width) + 7) / 8) - -#define gLTT_(timg, fmt, siz, width, height, uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, rt, line) \ - gsDPSetTextureImage(fmt, siz, width, timg), \ - gsDPSetTile( \ - fmt, siz, line, tmem, \ - G_TX_LOADTILE, 0, \ - cmt, maskt, shiftt, \ - cms, masks, shifts), \ - gsDPLoadSync(), \ - gsDPLoadTile( \ - G_TX_LOADTILE, \ - qu102(uls), qu102(ult), \ - qu102(lrs), qu102(lrt)), \ - gsDPPipeSync(), \ - gsDPSetTile( \ - fmt, siz, line, \ - tmem, rt, pal, \ - cmt, maskt, shiftt, \ - cms, masks, shifts), \ - gsDPSetTileSize( \ - rt, \ - qu102(uls), qu102(ult), \ - qu102(lrs), qu102(lrt)) - -#define gLTT4_(timg, fmt, width, height, uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, rt) \ - gsDPSetTextureImage(fmt, G_IM_SIZ_8b, (width) / 2, timg), \ - gsDPSetTile( \ - fmt, G_IM_SIZ_8b, \ - (((lrs) - (uls) + 1) / 2 + 7) / 8, \ - tmem, G_TX_LOADTILE, 0, \ - cmt, maskt, shiftt, \ - cms, masks, shifts), \ - gsDPLoadSync(), \ - gsDPLoadTile( \ - G_TX_LOADTILE, \ - qu102(uls) / 2, qu102(ult), \ - qu102(lrs) / 2, qu102(lrt)), \ - gsDPPipeSync(), \ - gsDPSetTile( \ - fmt, G_IM_SIZ_4b, \ - (((lrs) - (uls) + 1) / 2 + 7) / 8, \ - tmem, rt, pal, \ - cmt, maskt, shiftt, \ - cms, masks, shifts), \ - gsDPSetTileSize( \ - rt, \ - qu102(uls), qu102(ult), \ - qu102(lrs), qu102(lrt)) - -#define gsDPLoadTextureTile(timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT_( \ - timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0x0, G_TX_RENDERTILE, \ - (((lrs) - (uls) + 1) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define gsDPLoadTextureTile_4b(timg, fmt, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT4_( \ - timg, fmt, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0x0, G_TX_RENDERTILE) - -#define gsDPLoadTextureTileYuv(timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT_( \ - timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - 0x0, G_TX_RENDERTILE, \ - (((lrs) - (uls) + 1) + 7) / 8) - -#define _gsDPLoadTextureTile(timg, tmem, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT_( \ - timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, G_TX_RENDERTILE, \ - (((lrs) - (uls) + 1) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define _gsDPLoadTextureTile_4b(timg, tmem, fmt, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT4_( \ - timg, fmt, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, G_TX_RENDERTILE) - -#define _gsDPLoadTextureTileYuv(timg, tmem, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, cms, cmt, \ - masks, maskt, shifts, shiftt) \ - gLTT_( \ - timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, G_TX_RENDERTILE, \ - (((lrs) - (uls) + 1) + 7) / 8) - -#define gsDPLoadMultiTile(timg, tmem, rt, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT_( \ - timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, rt, \ - (((lrs) - (uls) + 1) * G_SIZ_LDBITS(siz) + 63) / 64) - -#define gsDPLoadMultiTile_4b(timg, tmem, rt, fmt, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT4_( \ - timg, fmt, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, rt) - -#define gsDPLoadMultiTileYuv(timg, tmem, rt, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt) \ - gLTT_( \ - timg, fmt, siz, width, height, \ - uls, ult, lrs, lrt, pal, \ - cms, cmt, masks, maskt, shifts, shiftt, \ - tmem, rt, \ - (((lrs) - (uls) + 1) + 7) / 8) - -#define gsDPLoadBlock(tile, uls, ult, lrs, dxt) \ - gO_( \ - G_LOADBLOCK, \ - gF_(uls, 12, 12) | \ - gF_(ult, 12, 0), \ - gF_(tile, 3, 24) | \ - gF_(G_LDBLK_TXL(lrs), 12, 12) | \ - gF_(dxt, 12, 0)) - -#define gsDPNoOp() \ - gsDPNoOpTag(0) - -#define gsDPNoOpTag(tag) \ - gO_(G_NOOP, 0, tag) - -#define gsDPPipelineMode(mode) \ - gsSPSetOtherModeHi(G_MDSFT_PIPELINE, G_MDSIZ_PIPELINE, mode) - -#define gsDPSetBlendColor(r, g, b, a) \ - gO_( \ - G_SETBLENDCOLOR, \ - 0, \ - gF_(r, 8, 24) | \ - gF_(g, 8, 16) | \ - gF_(b, 8, 8) | \ - gF_(a, 8, 0)) - -#define gsDPSetEnvColor(r, g, b, a) \ - gO_( \ - G_SETENVCOLOR, \ - 0, \ - gF_(r, 8, 24) | \ - gF_(g, 8, 16) | \ - gF_(b, 8, 8) | \ - gF_(a, 8, 0)) - -#define gsDPSetFillColor(c) \ - gO_(G_SETFILLCOLOR, 0, c) - -#define gsDPSetFogColor(r, g, b, a) \ - gO_( \ - G_SETFOGCOLOR, 0, \ - gF_(r, 8, 24) | \ - gF_(g, 8, 16) | \ - gF_(b, 8, 8) | \ - gF_(a, 8, 0)) - -#define gsDPSetPrimColor(m, l, r, g, b, a) \ - gO_( \ - G_SETPRIMCOLOR, \ - gF_(m, 8, 8) | \ - gF_(l, 8, 0), \ - gF_(r, 8, 24) | \ - gF_(g, 8, 16) | \ - gF_(b, 8, 8) | \ - gF_(a, 8, 0)) - -#define gsDPSetColorImage(fmt, siz, width, img) \ - gO_( \ - G_SETCIMG, \ - gF_(fmt, 3, 21) | \ - gF_(siz, 2, 19) | \ - gF_((width) - 1, 12, 0), \ - img) - -#define gsDPSetDepthImage(img) \ - gO_(G_SETZIMG, 0, img) - -#define gsDPSetTextureImage(fmt, siz, width, img) \ - gO_( \ - G_SETTIMG, \ - gF_(fmt, 3, 21) | \ - gF_(siz, 2, 19) | \ - gF_((width) - 1, 12, 0), \ - img) - -#define gsDPSetHilite1Tile(tile, hilite, width, height) \ - gsDPSetTileSize( \ - tile, \ - ((Hilite *)(hilite))->h.x1 & 0xFFF, \ - ((Hilite *)(hilite))->h.y1 & 0xFFF, \ - (((width) - 1) * 4 + ((Hilite *)(hilite))->h.x1) & 0xFFF, \ - (((height) - 1) * 4 + ((Hilite *)(hilite))->h.y1) & 0xFFF) - -#define gsDPSetHilite2Tile(tile, hilite, width, height) \ - gsDPSetTileSize( \ - tile, \ - ((Hilite *)(hilite))->h.x2 & 0xFFF, \ - ((Hilite *)(hilite))->h.y2 & 0xFFF, \ - (((width) - 1) * 4 + ((Hilite *)(hilite))->h.x2) & 0xFFF, \ - (((height) - 1) * 4 + ((Hilite *)(hilite))->h.y2) & 0xFFF) - -#define gsDPSetAlphaCompare(mode) \ - gsSPSetOtherModeLo(G_MDSFT_ALPHACOMPARE, G_MDSIZ_ALPHACOMPARE, mode) - -#define gsDPSetAlphaDither(type) \ - gsSPSetOtherModeHi(G_MDSFT_ALPHADITHER, G_MDSIZ_ALPHADITHER, type) - -#define gsDPSetColorDither(type) \ - gsSPSetOtherModeHi(G_MDSFT_RGBDITHER, G_MDSIZ_RGBDITHER, type) - -#define gsDPSetCombineMode(mode1, mode2) \ - gsDPSetCombineLERP(mode1, mode2) - -#define gsDPSetCombineLERP(a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \ - a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \ - gO_( \ - G_SETCOMBINE, \ - gF_(G_CCMUX_##a0, 4, 20) | \ - gF_(G_CCMUX_##c0, 5, 15) | \ - gF_(G_ACMUX_##Aa0, 3, 12) | \ - gF_(G_ACMUX_##Ac0, 3, 9) | \ - gF_(G_CCMUX_##a1, 4, 5) | \ - gF_(G_CCMUX_##c1, 5, 0), \ - gF_(G_CCMUX_##b0, 4, 28) | \ - gF_(G_CCMUX_##b1, 4, 24) | \ - gF_(G_ACMUX_##Aa1, 3, 21) | \ - gF_(G_ACMUX_##Ac1, 3, 18) | \ - gF_(G_CCMUX_##d0, 3, 15) | \ - gF_(G_ACMUX_##Ab0, 3, 12) | \ - gF_(G_ACMUX_##Ad0, 3, 9) | \ - gF_(G_CCMUX_##d1, 3, 6) | \ - gF_(G_ACMUX_##Ab1, 3, 3) | \ - gF_(G_ACMUX_##Ad1, 3, 0)) - -#define gsDPSetConvert(k0, k1, k2, k3, k4, k5) \ - gO_( \ - G_SETCONVERT, \ - gF_(k0, 9, 13) | \ - gF_(k1, 9, 4) | \ - gF_(gI_(k2) >> 5, 4, 0), \ - gF_(k2, 5, 27) | \ - gF_(k3, 9, 18) | \ - gF_(k4, 9, 9) | \ - gF_(k5, 9, 0)) - -#define gsDPSetTextureConvert(type) \ - gsSPSetOtherModeHi(G_MDSFT_TEXTCONV, G_MDSIZ_TEXTCONV, type) - -#define gsDPSetCycleType(type) \ - gsSPSetOtherModeHi(G_MDSFT_CYCLETYPE, G_MDSIZ_CYCLETYPE, type) - -#define gsDPSetDepthSource(source) \ - gsSPSetOtherModeLo(G_MDSFT_ZSRCSEL, G_MDSIZ_ZSRCSEL, source) - -#define gsDPSetCombineKey(type) \ - gsSPSetOtherModeHi(G_MDSFT_COMBKEY, G_MDSIZ_COMBKEY, type) - -#define gsDPSetKeyGB(cG, sG, wG, cB, sB, wB) \ - gO_( \ - G_SETKEYGB, \ - gF_(wG, 12, 12) | \ - gF_(wB, 12, 0), \ - gF_(cG, 8, 24) | \ - gF_(sG, 8, 16) | \ - gF_(cB, 8, 8) | \ - gF_(sB, 8, 0)) - -#define gsDPSetKeyR(cR, sR, wR) \ - gO_( \ - G_SETKEYR, 0, \ - gF_(wR, 12, 16) | \ - gF_(cR, 8, 8) | \ - gF_(sR, 8, 0)) - -#define gsDPSetPrimDepth(z, dz) \ - gO_( \ - G_SETPRIMDEPTH, \ - 0, \ - gF_(z, 16, 16) | \ - gF_(dz, 16, 0)) - -#define gsDPSetRenderMode(mode1, mode2) \ - gsSPSetOtherModeLo( \ - G_MDSFT_RENDERMODE, \ - G_MDSIZ_RENDERMODE, \ - gI_(mode1) | \ - gI_(mode2)) - -#define gsDPSetScissor(mode, ulx, uly, lrx, lry) \ - gsDPSetScissorFrac( \ - mode, \ - qu102(gI_(ulx)), \ - qu102(gI_(uly)), \ - qu102(gI_(lrx)), \ - qu102(gI_(lry))) - -#define gsDPSetScissorFrac(mode, ulx, uly, lrx, lry) \ - gO_( \ - G_SETSCISSOR, \ - gF_(ulx, 12, 12) | \ - gF_(uly, 12, 0), \ - gF_(mode, 2, 24) | \ - gF_(lrx, 12, 12) | \ - gF_(lry, 12, 0)) - -#define gsDPSetTextureDetail(type) \ - gsSPSetOtherModeHi(G_MDSFT_TEXTDETAIL, G_MDSIZ_TEXTDETAIL, type) - -#define gsDPSetTextureFilter(mode) \ - gsSPSetOtherModeHi(G_MDSFT_TEXTFILT, G_MDSIZ_TEXTFILT, mode) - -#define gsDPSetTextureLOD(mode) \ - gsSPSetOtherModeHi(G_MDSFT_TEXTLOD, G_MDSIZ_TEXTLOD, mode) - -#define gsDPSetTextureLUT(mode) \ - gsSPSetOtherModeHi(G_MDSFT_TEXTLUT, G_MDSIZ_TEXTLUT, mode) - -#define gsDPSetTexturePersp(enable) \ - gsSPSetOtherModeHi(G_MDSFT_TEXTPERSP, G_MDSIZ_TEXTPERSP, enable) - -#define gsDPSetTile(fmt, siz, line, tmem, tile, palette, \ - cmt, maskt, shiftt, cms, masks, shifts) \ - gO_( \ - G_SETTILE, \ - gF_(fmt, 3, 21) | \ - gF_(siz, 2, 19) | \ - gF_(line, 9, 9) | \ - gF_(tmem, 9, 0), \ - gF_(tile, 3, 24) | \ - gF_(palette, 4, 20) | \ - gF_(cmt, 2, 18) | \ - gF_(maskt, 4, 14) | \ - gF_(shiftt, 4, 10) | \ - gF_(cms, 2, 8) | \ - gF_(masks, 4, 4) | \ - gF_(shifts, 4, 0)) - -#define gsDPSetTileSize(tile, uls, ult, lrs, lrt) \ - gO_( \ - G_SETTILESIZE, \ - gF_(uls, 12, 12) | \ - gF_(ult, 12, 0), \ - gF_(tile, 3, 24) | \ - gF_(lrs, 12, 12) | \ - gF_(lrt, 12, 0)) - -#define gsSPBranchList(dl) \ - gsDisplayList(dl, 1) - -#define gsSPClipRatio(r) \ - gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNX, (uint16_t)(r)), \ - gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNY, (uint16_t)(r)), \ - gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPX, (uint16_t)-(r)), \ - gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPY, (uint16_t)-(r)) - -#define gsSPDisplayList(dl) \ - gsDisplayList(dl, 0) - -#define gsSPEndDisplayList() \ - gO_(G_ENDDL, 0, 0) - -#define gsSPFogFactor(fm, fo) \ - gsMoveWd( \ - G_MW_FOG, \ - G_MWO_FOG, \ - gF_(fm, 16, 16) | \ - gF_(fo, 16, 0)) - -#define gsSPFogPosition(min, max) \ - gsSPFogFactor( \ - (500 * 0x100) / ((max) - (min)), \ - (500 - (min)) * 0x100 / ((max) - (min))) - -#define gsSPLine3D(v0, v1, flag) \ - gsSPLineW3D(v0, v1, 0, flag) - -#define gsSPLookAt(l) \ - gsSPLookAtX(l), \ - gsSPLookAtY(gI_(l) + 0x10) - -#define gsSPSegment(seg, base) \ - gsMoveWd(G_MW_SEGMENT, (seg) * 4, base) - -#define gsSPSetLights0(lites) \ - gsSPNumLights(NUMLIGHTS_0), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).a, 2) - -#define gsSPSetLights1(lites) \ - gsSPNumLights(NUMLIGHTS_1), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).a, 2) - -#define gsSPSetLights2(lites) \ - gsSPNumLights(NUMLIGHTS_2), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).l[1], 2), \ - gsSPLight(&(lites).a, 3) - -#define gsSPSetLights3(lites) \ - gsSPNumLights(NUMLIGHTS_3), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).l[1], 2), \ - gsSPLight(&(lites).l[2], 3), \ - gsSPLight(&(lites).a, 4) - -#define gsSPSetLights4(lites) \ - gsSPNumLights(NUMLIGHTS_4), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).l[1], 2), \ - gsSPLight(&(lites).l[2], 3), \ - gsSPLight(&(lites).l[3], 4), \ - gsSPLight(&(lites).a, 5) - -#define gsSPSetLights5(lites) \ - gsSPNumLights(NUMLIGHTS_5), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).l[1], 2), \ - gsSPLight(&(lites).l[2], 3), \ - gsSPLight(&(lites).l[3], 4), \ - gsSPLight(&(lites).l[4], 5), \ - gsSPLight(&(lites).a, 6) - -#define gsSPSetLights6(lites) \ - gsSPNumLights(NUMLIGHTS_6), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).l[1], 2), \ - gsSPLight(&(lites).l[2], 3), \ - gsSPLight(&(lites).l[3], 4), \ - gsSPLight(&(lites).l[4], 5), \ - gsSPLight(&(lites).l[5], 6), \ - gsSPLight(&(lites).a, 7) - -#define gsSPSetLights7(lites) \ - gsSPNumLights(NUMLIGHTS_7), \ - gsSPLight(&(lites).l[0], 1), \ - gsSPLight(&(lites).l[1], 2), \ - gsSPLight(&(lites).l[2], 3), \ - gsSPLight(&(lites).l[3], 4), \ - gsSPLight(&(lites).l[4], 5), \ - gsSPLight(&(lites).l[5], 6), \ - gsSPLight(&(lites).l[6], 7), \ - gsSPLight(&(lites).a, 8) - -#define gsSPSetStatus(sid, val) \ - gsMoveWd(G_MW_GENSTAT, sid, val) - -#define gsSPNumLights(n) \ - gsMoveWd(G_MW_NUMLIGHT, G_MWO_NUMLIGHT, NUML(n)) - -#define gsSPLightColor(Lightnum, packedcolor) \ - gsMoveWd(G_MW_LIGHTCOL, G_MWO_a##Lightnum, packedcolor), \ - gsMoveWd(G_MW_LIGHTCOL, G_MWO_b##Lightnum, packedcolor) - -#define gsSPTextureRectangle(ulx, uly, lrx, lry, tile, s, t, dsdx, dtdy) \ - gsTexRect(ulx, uly, lrx, lry, tile), \ - gsDPHalf1(gF_(s, 16, 16) | gF_(t, 16, 0)), \ - gsDPHalf2(gF_(dsdx, 16, 16) | gF_(dtdy, 16, 0)) - -#define gsSPScisTextureRectangle(ulx, uly, lrx, lry, tile, s, t, dsdx, dtdy) \ - gsTexRect(gScC_(ulx), gScC_(uly), gScC_(lrx), gScC_(lry), tile), \ - gsDPHalf1( \ - gF_(gScD_(s, ulx, dsdx), 16, 16) | \ - gF_(gScD_(t, uly, dtdy), 16, 0)), \ - gsDPHalf2(gF_(dsdx, 16, 16) | gF_(dtdy, 16, 0)) - -#define gsSPTextureRectangleFlip(ulx, uly, lrx, lry, tile, s, t, dsdx, dtdy) \ - gsTexRectFlip(ulx, uly, lrx, lry, tile), \ - gsDPHalf1(gF_(s, 16, 16) | gF_(t, 16, 0)), \ - gsDPHalf2(gF_(dsdx, 16, 16) | gF_(dtdy, 16, 0)) - -#define gsSPScisTextureRectangleFlip( \ - ulx, uly, lrx, lry, tile, s, t, dsdx, dtdy) \ - gsTexRectFlip(gScC_(ulx), gScC_(uly), gScC_(lrx), gScC_(lry), tile), \ - gsDPHalf1( \ - gF_(gScD_(s, ulx, dsdx), 16, 16) | \ - gF_(gScD_(t, uly, dtdy), 16, 0)), \ - gsDPHalf2(gF_(dsdx, 16, 16) | gF_(dtdy, 16, 0)) - -#define gsSPBgRectCopy(bg) \ - gO_(G_BG_COPY, 0, bg) - -#define gsSPBgRect1Cyc(bg) \ - gO_(G_BG_1CYC, 0, bg) - -#define gsSPObjRectangle(sp) \ - gO_(G_OBJ_RECTANGLE, 0, sp) - -#define gsSPObjRectangleR(sp) \ - gO_(G_OBJ_RECTANGLE_R, 0, sp) - -#define gsSPObjSprite(sp) \ - gO_(G_OBJ_SPRITE, 0, sp) - -#define gsSPObjMatrix(mtx) \ - gO_( \ - G_OBJ_MOVEMEM, \ - gF_(sizeof(uObjMtx) - 1, 8, 16), \ - mtx) - -#define gsSPObjSubMatrix(mtx) \ - gO_( \ - G_OBJ_MOVEMEM, \ - gF_(sizeof(uObjSubMtx) - 1, 8, 16) | \ - gF_(2, 16, 0), \ - mtx) - -#define gsSPObjRenderMode(mode) \ - gO_(G_OBJ_RENDERMODE, 0, mode) - -#define gsSPObjLoadTxtr(tx) \ - gO_(G_OBJ_LOADTXTR, 23, tx) - -#define gsSPObjLoadTxRect(txsp) \ - gO_(G_OBJ_LDTX_RECT, 47, txsp) - -#define gsSPObjLoadTxRectR(txsp) \ - gO_(G_OBJ_LDTX_RECT_R, 47, txsp) - -#define gsSPObjLoadTxSprite(txsp) \ - gO_(G_OBJ_LDTX_SPRITE, 47, txsp) - -#define gsSPSelectDL(ldl, sid, flag, mask) \ - gO_( \ - G_RDPHALF_0, \ - gF_(sid, 8, 16) | \ - gF_(ldl, 16, 0), \ - flag), \ - gO_( \ - G_SELECT_DL, \ - gF_(0x00, 8, 16) | \ - gF_(gI_(ldl) >> 16, 16, 0), \ - mask) - -#define gsSPSelectBranchDL(bdl, sid, flag, mask) \ - gO_( \ - G_RDPHALF_0, \ - gF_(sid, 8, 16) | \ - gF_(bdl, 16, 0), \ - flag), \ - gO_( \ - G_SELECT_DL, \ - gF_(0x01, 8, 16) | \ - gF_(gI_(bdl) >> 16, 16, 0), \ - mask) - -/* unlisted instructions */ - -#define gsDPLoadTLUTCmd(tile, count) \ - gO_( \ - G_LOADTLUT, \ - 0, \ - gF_(tile, 3, 24) | \ - gF_(count, 10, 14)) - -#define gsDPLoadTLUT(count, tmem, dram) \ - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram), \ - gsDPTileSync(), \ - gsDPSetTile(0, 0, 0, tmem, G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0), \ - gsDPLoadSync(), \ - gsDPLoadTLUTCmd(G_TX_LOADTILE, (count) - 1), \ - gsDPPipeSync() - -#define gsDisplayList(dl, branch) \ - gO_(G_DL, gF_(branch, 8, 16), dl) - -#define gsDPLoadTile(tile, uls, ult, lrs, lrt) \ - gO_( \ - G_LOADTILE, \ - gF_(uls, 12, 12) | \ - gF_(ult, 12, 0), \ - gF_(tile, 3, 24) | \ - gF_(lrs, 12, 12) | \ - gF_(lrt, 12, 0)) - -#define gsDPSetCombine(c) \ - gO_( \ - G_SETCOMBINE, \ - (gL_(c) >> 32) & 0xFFFFFFFF, \ - (gL_(c) >> 0) & 0xFFFFFFFF) - -#define gsSPSetOtherModeLo(shift, length, data) \ - gsSPSetOtherMode(G_SETOTHERMODE_L, shift, length, data) - -#define gsSPSetOtherModeHi(shift, length, data) \ - gsSPSetOtherMode(G_SETOTHERMODE_H, shift, length, data) - -#define gsDPSetOtherMode(mode0, mode1) \ - gO_(G_RDPSETOTHERMODE, gF_(mode0, 24, 0), mode1) - -#define gsTexRect(ulx, uly, lrx, lry, tile) \ - gO_( \ - G_TEXRECT, \ - gF_(lrx, 12, 12) | \ - gF_(lry, 12, 0), \ - gF_(tile, 3, 24) | \ - gF_(ulx, 12, 12) | \ - gF_(uly, 12, 0)) - -#define gsTexRectFlip(ulx, uly, lrx, lry, tile) \ - gO_( \ - G_TEXRECTFLIP, \ - gF_(lrx, 12, 12) | \ - gF_(lry, 12, 0), \ - gF_(tile, 3, 24) | \ - gF_(ulx, 12, 12) | \ - gF_(uly, 12, 0)) - -#define gsSPNoOp() \ - gO_(G_SPNOOP, 0, 0) - -#define gsDPHalf1(wordhi) \ - gO_(G_RDPHALF_1, 0, wordhi) - -#define gsDPHalf2(wordlo) \ - gO_(G_RDPHALF_2, 0, wordlo) - -#define gsDPWord(wordhi, wordlo) \ - gsDPHalf1(wordhi), \ - gsDPHalf2(wordlo) - -/* instruction macros for fast3d */ - -#if defined(F3D_GBI) - -# define gsSP1Triangle(v0, v1, v2, flag) \ - gO_( \ - G_TRI1, \ - 0, \ - gF_(flag, 8, 24) | \ - gF_(gI_(v0) * 10, 8, 16) | \ - gF_(gI_(v1) * 10, 8, 8) | \ - gF_(gI_(v2) * 10, 8, 0)) - -# define gsSPCullDisplayList(v0, vn) \ - gO_( \ - G_CULLDL, \ - (gI_(v0) & 0xF) * 40, \ - gI_((vn) + 1) & 0xF) * 40) - -# define gsSPLineW3D(v0, v1, wd, flag) \ - gO_( \ - G_LINE3D, \ - 0, \ - gF_(flag, 8, 24) | \ - gF_(gI_(v0) * 10, 8, 16) | \ - gF_(gI_(v1) * 10, 8, 8) | \ - gF_(wd, 8, 0)) - -# define gsSPVertex(v, n, v0) \ - gO_( \ - G_VTX, \ - gF_((n) - 1, 4, 20) | \ - gF_(v0, 4, 16) | \ - gF_(sizeof(Vtx) * (n), 16, 0), \ - v) - -#endif - -/* instruction macros for fast3d and beta f3dex */ -#if defined(F3D_GBI) || (defined(F3D_BETA) && defined(F3DEX_GBI)) - -# define gsSPModifyVertex(vtx, where, val) \ - gsMoveWd(G_MW_POINTS, (vtx) * 40 + (where), val) - -#endif - -/* instruction macros for fast3d and f3dex */ - -#if defined(F3D_GBI) || defined(F3DEX_GBI) - -# define gsSPForceMatrix(mptr) \ - gsMoveMem(16, G_MV_MATRIX_1, (char *)(mptr)), \ - gsMoveMem(16, G_MV_MATRIX_2, (char *)(mptr) + 16), \ - gsMoveMem(16, G_MV_MATRIX_3, (char *)(mptr) + 32), \ - gsMoveMem(16, G_MV_MATRIX_4, (char *)(mptr) + 48) - -# define gsSPSetGeometryMode(mode) \ - gO_(G_SETGEOMETRYMODE, 0, gI_(mode)) - -# define gsSPClearGeometryMode(mode) \ - gO_(G_CLEARGEOMETRYMODE, 0, gI_(mode)) - -# define gsSPLoadGeometryMode(mode) \ - gsSPClearGeometryMode(~gI_(0)), \ - gsSPSetGeometryMode(mode) - -# define gsSPInsertMatrix(where, num) \ - gsMoveWd(G_MW_MATRIX, where, num) - -# define gsSPLookAtX(l) \ - gsMoveMem(sizeof(Light), G_MV_LOOKATX, l) - -# define gsSPLookAtY(l) \ - gsMoveMem(sizeof(Light), G_MV_LOOKATY, l) - -# define gsSPMatrix(matrix, param) \ - gO_( \ - G_MTX, \ - gF_(param, 8, 16) | \ - gF_(sizeof(Mtx), 16, 0), \ - matrix) - -# define gsSPPopMatrix(param) \ - gO_(G_POPMTX, 0, param) - -# define gsSPLight(l, n) \ - gsMoveMem(sizeof(Light), G_MV_L0 + ((n) - 1) * 2, l) - -# define gsSPTexture(sc, tc, level, tile, on) \ - gO_( \ - G_TEXTURE, \ - gF_(level, 3, 11) | \ - gF_(tile, 3, 8) | \ - gF_(on, 8, 0), \ - gF_(sc, 16, 16) | \ - gF_(tc, 16, 0)) - -# define gsSPViewport(v) \ - gsMoveMem(sizeof(Vp), G_MV_VIEWPORT, v) - -# define gsSPSetOtherMode(opc, shift, length, data) \ - gO_( \ - opc, \ - gF_(shift, 8, 8) | \ - gF_(length, 8, 0), \ - data) - -# define gsMoveWd(index, offset, data) \ - gO_( \ - G_MOVEWORD, \ - gF_(offset, 16, 8) | \ - gF_(index, 8, 0), \ - data) - -# define gsMoveMem(size, index, address) \ - gO_( \ - G_MOVEMEM, \ - gF_(index, 8, 16) | \ - gF_(size, 16, 0), \ - address) - -#endif - -/* instruction macros for f3dex */ - -#if defined(F3DEX_GBI) - -# define gsSP1Triangle(v0, v1, v2, flag) \ - gO_( \ - G_TRI1, \ - 0, \ - gF_(gV3_(v0, v1, v2, flag) * 2, 8, 16) | \ - gF_(gV3_(v1, v2, v0, flag) * 2, 8, 8) | \ - gF_(gV3_(v2, v0, v1, flag) * 2, 8, 0)) - -# define gsSP1Quadrangle(v0, v1, v2, v3, flag) \ - gO_( \ - G_TRI2, \ - gF_(gV4_(v0, v1, v2, v3, flag) * 2, 8, 16) | \ - gF_(gV4_(v1, v2, v3, v0, flag) * 2, 8, 8) | \ - gF_(gV4_(v2, v3, v0, v1, flag) * 2, 8, 0), \ - gF_(gV4_(v0, v1, v2, v3, flag) * 2, 8, 16) | \ - gF_(gV4_(v2, v3, v0, v1, flag) * 2, 8, 8) | \ - gF_(gV4_(v3, v0, v1, v2, flag) * 2, 8, 0)) - -# define gsSPLineW3D(v0, v1, wd, flag) \ - gO_( \ - G_LINE3D, \ - 0, \ - gF_(gV2_(v0, v1, flag) * 2, 8, 16) | \ - gF_(gV2_(v1, v0, flag) * 2, 8, 8) | \ - gF_(wd, 8, 0)) - -# define gsSPVertex(v, n, v0) \ - gO_( \ - G_VTX, \ - gF_((v0) * 2, 8, 16) | \ - gF_(n, 6, 10) | \ - gF_(sizeof(Vtx) * (n) - 1, 10, 0), \ - v) - -#endif - -/* instruction macros for f3dex and f3dex2 */ - -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - -# define gsSP2Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \ - gO_( \ - G_TRI2, \ - gF_(gV3_(v00, v01, v02, flag0) * 2, 8, 16) | \ - gF_(gV3_(v01, v02, v00, flag0) * 2, 8, 8) | \ - gF_(gV3_(v02, v00, v01, flag0) * 2, 8, 0), \ - gF_(gV3_(v10, v11, v12, flag1) * 2, 8, 16) | \ - gF_(gV3_(v11, v12, v10, flag1) * 2, 8, 8) | \ - gF_(gV3_(v12, v10, v11, flag1) * 2, 8, 0)) - -# define gsSPBranchLessZ(branchdl, vtx, zval, near, far, flag) \ - gsSPBranchLessZrg(branchdl, vtx, zval, near, far, flag, 0, G_MAXZ) - -# define gsSPBranchLessZrg(branchdl, vtx, zval, near, far, flag, zmin, zmax) \ - gsSPBranchLessZraw(branchdl, vtx, \ - G_DEPTOZSrg(zval, near, far, flag, zmin, zmax)) - -# define gsSPBranchLessZraw(branchdl, vtx, zval) \ - gsDPHalf1(branchdl), \ - gsBranchZ(vtx, zval) - -# define gsSPCullDisplayList(v0, vn) \ - gO_( \ - G_CULLDL, \ - gF_((v0) * 2, 16, 0), \ - gF_((vn) * 2, 16, 0)) - -# define gsSPLoadUcode(uc_start, uc_dstart) \ - gsSPLoadUcodeEx(uc_start, uc_dstart, 0x800) - -# define gsSPLoadUcodeL(ucode) \ - gsSPLoadUcode( \ - gI_(&ucode##TextStart) & 0x1FFFFFFF, \ - gI_(&ucode##DataStart) & 0x1FFFFFFF) - -# if !(defined(F3D_BETA) && defined(F3DEX_GBI)) -# define gsSPModifyVertex(vtx, where, val) \ - gO_( \ - G_MODIFYVTX, \ - gF_(where, 8, 16) | \ - gF_((vtx) * 2, 16, 0), \ - val) -# endif - -# define gsBranchZ(vtx, zval) \ - gO_( \ - G_BRANCH_Z, \ - gF_((vtx) * 5, 12, 12) | \ - gF_((vtx) * 2, 12, 0), \ - zval) - -# define gsLoadUcode(uc_start, uc_dsize) \ - gO_( \ - G_LOAD_UCODE, \ - gF_((uc_dsize) - 1, 16, 0), \ - uc_start) - -# define gsSPLoadUcodeEx(uc_start, uc_dstart, uc_dsize) \ - gsDPHalf1(uc_dstart), \ - gsLoadUcode(uc_start, uc_dsize) - -#endif - -/* instruction macros for f3dex2 */ - -#if defined(F3DEX_GBI_2) - -# define gsSP1Triangle(v0, v1, v2, flag) \ - gO_( \ - G_TRI1, \ - gF_(gV3_(v0, v1, v2, flag) * 2, 8, 16) | \ - gF_(gV3_(v1, v2, v0, flag) * 2, 8, 8) | \ - gF_(gV3_(v2, v0, v1, flag) * 2, 8, 0), \ - 0) - -# define gsSP1Quadrangle(v0, v1, v2, v3, flag) \ - gO_( \ - G_QUAD, \ - gF_(gV4_(v0, v1, v2, v3, flag) * 2, 8, 16) | \ - gF_(gV4_(v1, v2, v3, v0, flag) * 2, 8, 8) | \ - gF_(gV4_(v2, v3, v0, v1, flag) * 2, 8, 0), \ - gF_(gV4_(v0, v1, v2, v3, flag) * 2, 8, 16) | \ - gF_(gV4_(v2, v3, v0, v1, flag) * 2, 8, 8) | \ - gF_(gV4_(v3, v0, v1, v2, flag) * 2, 8, 0)) - -# define gsSPForceMatrix(mptr) \ - gsMoveMem(sizeof(Mtx), G_MV_MATRIX, 0, mptr), \ - gsMoveWd(G_MW_FORCEMTX, 0, 0x10000) - -# define gsSPSetGeometryMode(mode) \ - gsSPGeometryMode(0, mode) - -# define gsSPClearGeometryMode(mode) \ - gsSPGeometryMode(mode, 0) - -# define gsSPLoadGeometryMode(mode) \ - gsSPGeometryMode(~gI_(0), mode) - -# define gsSPLineW3D(v0, v1, wd, flag) \ - gO_( \ - G_LINE3D, \ - gF_(gV2_(v0, v1, flag) * 2, 8, 16) | \ - gF_(gV2_(v1, v0, flag) * 2, 8, 8) | \ - gF_(wd, 8, 0), \ - 0) - -# define gsSPLookAtX(l) \ - gsMoveMem(sizeof(Light), G_MV_LIGHT, G_MVO_LOOKATX, l) - -# define gsSPLookAtY(l) \ - gsMoveMem(sizeof(Light), G_MV_LIGHT, G_MVO_LOOKATY, l) - -# define gsSPMatrix(matrix, param) \ - gO_( \ - G_MTX, \ - gF_((sizeof(Mtx) - 1) / 8, 5, 19) | \ - gF_(gI_(param) ^ G_MTX_PUSH, 8, 0), \ - matrix) - -# define gsSPPopMatrix(param) \ - gsSPPopMatrixN(param, 1) - -# define gsSPPopMatrixN(param, n) \ - gO_( \ - G_POPMTX, \ - gF_((sizeof(Mtx) - 1) / 8, 5, 19) | \ - gF_(2, 8, 0), \ - sizeof(Mtx) * (n)) - -# define gsSPLight(l, n) \ - gsMoveMem(sizeof(Light), G_MV_LIGHT, ((n) + 1) * 0x18, l) - -# define gsSPTexture(sc, tc, level, tile, on) \ - gO_( \ - G_TEXTURE, \ - gF_(level, 3, 11) | \ - gF_(tile, 3, 8) | \ - gF_(on, 7, 1), \ - gF_(sc, 16, 16) | \ - gF_(tc, 16, 0)) - -# define gsSPVertex(v, n, v0) \ - gO_( \ - G_VTX, \ - gF_(n, 8, 12) | \ - gF_((v0) + (n), 7, 1), \ - v) - -# define gsSPViewport(v) \ - gsMoveMem(sizeof(Vp), G_MV_VIEWPORT, 0, v) - -# define gsSPGeometryMode(clearbits, setbits) \ - gO_( \ - G_GEOMETRYMODE, \ - gF_(~gI_(clearbits), 24, 0), \ - setbits) - -# define gsSPSetOtherMode(opc, shift, length, data) \ - gO_( \ - opc, \ - gF_(32 - (shift) - (length), 8, 8) | \ - gF_((length) - 1, 8, 0), \ - data) - -# define gsMoveWd(index, offset, data) \ - gO_( \ - G_MOVEWORD, \ - gF_(index, 8, 16) | \ - gF_(offset, 16, 0), \ - data) - -# define gsMoveMem(size, index, offset, address) \ - gO_( \ - G_MOVEMEM, \ - gF_((size - 1) / 8, 5, 19) | \ - gF_((offset) / 8, 8, 8) | \ - gF_(index, 8, 0), \ - address) - -# define gsSPDma_io(flag, dmem, dram, size) \ - gO_( \ - G_DMA_IO, \ - gF_(flag, 1, 23) | \ - gF_((dmem) / 8, 10, 13) | \ - gF_((size) - 1, 12, 0), \ - dram) - -# define gsSPDmaRead(dmem, dram, size) \ - gsSPDma_io(0, dmem, dram, size) - -# define gsSPDmaWrite(dmem, dram, size) \ - gsSPDma_io(1, dmem, dram, size) - -# define gsSpecial3(hi, lo) \ - gO_(G_SPECIAL_3, hi, lo) - -# define gsSpecial2(hi, lo) \ - gO_(G_SPECIAL_2, hi, lo) - -# define gsSpecial1(hi, lo) \ - gO_(G_SPECIAL_1, hi, lo) - -#endif - -/* instruction macros for beta fast3d and f3dex */ - -#if defined(F3D_BETA) && (defined(F3D_GBI) || defined(F3DEX_GBI)) - -# define gsSPPerspNormalize(scale) \ - gO_(G_PERSPNORM, 0, scale) - -#else - -# define gsSPPerspNormalize(scale) \ - gsMoveWd(G_MW_PERSPNORM, 0, scale) - -#endif - -/* dynamic instruction macros */ - -#define gDisplayListPut(gdl, ...) \ - ({ \ - Gfx Gd_[] = {__VA_ARGS__}; \ - for(size_t Gi_ = 0; Gi_ < sizeof(Gd_) / sizeof(Gfx); Gi_++) \ - { \ - *(Gfx *)(gdl) = Gd_[Gi_]; \ - } \ - (void)0; \ - }) -#define gDisplayListAppend(pgdl, ...) \ - ({ \ - Gfx Gd_[] = {__VA_ARGS__}; \ - for(size_t Gi_ = 0; Gi_ < sizeof(Gd_) / sizeof(Gfx); Gi_++) \ - { \ - *(*(Gfx **)(pgdl))++ = Gd_[Gi_]; \ - } \ - (void)0; \ - }) -#define gDisplayListData(pgdl, d) \ - ({ \ - Gfx **Gp_ = (void *)(pgdl); \ - struct \ - { \ - __typeof__(d) v; \ - } *Gd_, *Gs_; \ - *Gp_ -= (sizeof(*Gd_) + sizeof(Gfx) - 1) / sizeof(Gfx); \ - Gd_ = (void *)*Gp_; \ - Gs_ = (void *)&(d); \ - *Gd_ = *Gs_; \ - &Gd_->v; \ - }) -#define gDisplayListAlloc(pgdl, s) \ - ({ \ - Gfx **Gp_ = (void *)(pgdl); \ - *Gp_ -= ((s) + sizeof(Gfx) - 1) / sizeof(Gfx); \ - (void *)*Gp_; \ - }) - -#define gDPFillRectangle(gdl, ...) \ - gD_(gdl, gsDPFillRectangle, __VA_ARGS__) -#define gDPScisFillRectangle(gdl, ...) \ - gD_(gdl, gsDPScisFillRectangle, __VA_ARGS__) -#define gDPFullSync(gdl) \ - gDisplayListPut(gdl, gsDPFullSync()) -#define gDPLoadSync(gdl) \ - gDisplayListPut(gdl, gsDPLoadSync()) -#define gDPTileSync(gdl) \ - gDisplayListPut(gdl, gsDPTileSync()) -#define gDPPipeSync(gdl) \ - gDisplayListPut(gdl, gsDPPipeSync()) -#define gDPLoadTLUT_pal16(gdl, ...) \ - gD_(gdl, gsDPLoadTLUT_pal16, __VA_ARGS__) -#define gDPLoadTLUT_pal256(gdl, ...) \ - gD_(gdl, gsDPLoadTLUT_pal256, __VA_ARGS__) -#define gDPLoadTextureBlock(gdl, ...) \ - gD_(gdl, gsDPLoadTextureBlock, __VA_ARGS__) -#define gDPLoadTextureBlockS(gdl, ...) \ - gD_(gdl, gsDPLoadTextureBlockS, __VA_ARGS__) -#define gDPLoadTextureBlock_4b(gdl, ...) \ - gD_(gdl, gsDPLoadTextureBlock_4b, __VA_ARGS__) -#define gDPLoadTextureBlock_4bS(gdl, ...) \ - gD_(gdl, gsDPLoadTextureBlock_4bS, __VA_ARGS__) -#define gDPLoadTextureBlockYuv(gdl, ...) \ - gD_(gdl, gsDPLoadTextureBlockYuv, __VA_ARGS__) -#define gDPLoadTextureBlockYuvS(gdl, ...) \ - gD_(gdl, gsDPLoadTextureBlockYuvS, __VA_ARGS__) -#define _gDPLoadTextureBlock(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureBlock, __VA_ARGS__) -#define _gDPLoadTextureBlockS(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureBlockS, __VA_ARGS__) -#define _gDPLoadTextureBlock_4b(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureBlock_4b, __VA_ARGS__) -#define _gDPLoadTextureBlock_4bS(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureBlock_4bS, __VA_ARGS__) -#define _gDPLoadTextureBlockYuv(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureBlockYuv, __VA_ARGS__) -#define _gDPLoadTextureBlockYuvS(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureBlockYuvS, __VA_ARGS__) -#define gDPLoadMultiBlock(gdl, ...) \ - gD_(gdl, gsDPLoadMultiBlock, __VA_ARGS__) -#define gDPLoadMultiBlockS(gdl, ...) \ - gD_(gdl, gsDPLoadMultiBlockS, __VA_ARGS__) -#define gDPLoadMultiBlock_4b(gdl, ...) \ - gD_(gdl, gsDPLoadMultiBlock_4b, __VA_ARGS__) -#define gDPLoadMultiBlock_4bS(gdl, ...) \ - gD_(gdl, gsDPLoadMultiBlock_4bS, __VA_ARGS__) -#define gDPLoadMultiBlockYuv(gdl, ...) \ - gD_(gdl, gsDPLoadMultiBlockYuv, __VA_ARGS__) -#define gDPLoadMultiBlockYuvS(gdl, ...) \ - gD_(gdl, gsDPLoadMultiBlockYuvS, __VA_ARGS__) -#define gDPLoadTextureTile(gdl, ...) \ - gD_(gdl, gsDPLoadTextureTile, __VA_ARGS__) -#define gDPLoadTextureTile_4b(gdl, ...) \ - gD_(gdl, gsDPLoadTextureTile_4b, __VA_ARGS__) -#define gDPLoadTextureTileYuv(gdl, ...) \ - gD_(gdl, gsDPLoadTextureTileYuv, __VA_ARGS__) -#define _gDPLoadTextureTile(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureTile, __VA_ARGS__) -#define _gDPLoadTextureTile_4b(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureTile_4b, __VA_ARGS__) -#define _gDPLoadTextureTileYuv(gdl, ...) \ - gD_(gdl, _gsDPLoadTextureTileYuv, __VA_ARGS__) -#define gDPLoadMultiTile(gdl, ...) \ - gD_(gdl, gsDPLoadMultiTile, __VA_ARGS__) -#define gDPLoadMultiTile_4b(gdl, ...) \ - gD_(gdl, gsDPLoadMultiTile_4b, __VA_ARGS__) -#define gDPLoadMultiTileYuv(gdl, ...) \ - gD_(gdl, gsDPLoadMultiTileYuv, __VA_ARGS__) -#define gDPLoadBlock(gdl, ...) \ - gD_(gdl, gsDPLoadBlock, __VA_ARGS__) -#define gDPNoOp(gdl) \ - gDisplayListPut(gdl, gsDPNoOp()) -#define gDPNoOpTag(gdl, ...) \ - gD_(gdl, gsDPNoOpTag, __VA_ARGS__) -#define gDPPipelineMode(gdl, ...) \ - gD_(gdl, gsDPPipelineMode, __VA_ARGS__) -#define gDPSetBlendColor(gdl, ...) \ - gD_(gdl, gsDPSetBlendColor, __VA_ARGS__) -#define gDPSetEnvColor(gdl, ...) \ - gD_(gdl, gsDPSetEnvColor, __VA_ARGS__) -#define gDPSetFillColor(gdl, ...) \ - gD_(gdl, gsDPSetFillColor, __VA_ARGS__) -#define gDPSetFogColor(gdl, ...) \ - gD_(gdl, gsDPSetFogColor, __VA_ARGS__) -#define gDPSetPrimColor(gdl, ...) \ - gD_(gdl, gsDPSetPrimColor, __VA_ARGS__) -#define gDPSetColorImage(gdl, ...) \ - gD_(gdl, gsDPSetColorImage, __VA_ARGS__) -#define gDPSetDepthImage(gdl, ...) \ - gD_(gdl, gsDPSetDepthImage, __VA_ARGS__) -#define gDPSetTextureImage(gdl, ...) \ - gD_(gdl, gsDPSetTextureImage, __VA_ARGS__) -#define gDPSetHilite1Tile(gdl, ...) \ - gD_(gdl, gsDPSetHilite1Tile, __VA_ARGS__) -#define gDPSetHilite2Tile(gdl, ...) \ - gD_(gdl, gsDPSetHilite2Tile, __VA_ARGS__) -#define gDPSetAlphaCompare(gdl, ...) \ - gD_(gdl, gsDPSetAlphaCompare, __VA_ARGS__) -#define gDPSetAlphaDither(gdl, ...) \ - gD_(gdl, gsDPSetAlphaDither, __VA_ARGS__) -#define gDPSetColorDither(gdl, ...) \ - gD_(gdl, gsDPSetColorDither, __VA_ARGS__) -#define gDPSetCombineMode(gdl, ...) \ - gD_(gdl, gsDPSetCombineLERP, __VA_ARGS__) -#define gDPSetCombineLERP(gdl, ...) \ - gD_(gdl, gsDPSetCombineLERP, __VA_ARGS__) -#define gDPSetConvert(gdl, ...) \ - gD_(gdl, gsDPSetConvert, __VA_ARGS__) -#define gDPSetTextureConvert(gdl, ...) \ - gD_(gdl, gsDPSetTextureConvert, __VA_ARGS__) -#define gDPSetCycleType(gdl, ...) \ - gD_(gdl, gsDPSetCycleType, __VA_ARGS__) -#define gDPSetDepthSource(gdl, ...) \ - gD_(gdl, gsDPSetDepthSource, __VA_ARGS__) -#define gDPSetCombineKey(gdl, ...) \ - gD_(gdl, gsDPSetCombineKey, __VA_ARGS__) -#define gDPSetKeyGB(gdl, ...) \ - gD_(gdl, gsDPSetKeyGB, __VA_ARGS__) -#define gDPSetKeyR(gdl, ...) \ - gD_(gdl, gsDPSetKeyR, __VA_ARGS__) -#define gDPSetPrimDepth(gdl, ...) \ - gD_(gdl, gsDPSetPrimDepth, __VA_ARGS__) -#define gDPSetRenderMode(gdl, ...) \ - gD_(gdl, gsDPSetRenderMode, __VA_ARGS__) -#define gDPSetScissor(gdl, ...) \ - gD_(gdl, gsDPSetScissor, __VA_ARGS__) -#define gDPSetScissorFrac(gdl, ...) \ - gD_(gdl, gsDPSetScissorFrac, __VA_ARGS__) -#define gDPSetTextureDetail(gdl, ...) \ - gD_(gdl, gsDPSetTextureDetail, __VA_ARGS__) -#define gDPSetTextureFilter(gdl, ...) \ - gD_(gdl, gsDPSetTextureFilter, __VA_ARGS__) -#define gDPSetTextureLOD(gdl, ...) \ - gD_(gdl, gsDPSetTextureLOD, __VA_ARGS__) -#define gDPSetTextureLUT(gdl, ...) \ - gD_(gdl, gsDPSetTextureLUT, __VA_ARGS__) -#define gDPSetTexturePersp(gdl, ...) \ - gD_(gdl, gsDPSetTexturePersp, __VA_ARGS__) -#define gDPSetTile(gdl, ...) \ - gD_(gdl, gsDPSetTile, __VA_ARGS__) -#define gDPSetTileSize(gdl, ...) \ - gD_(gdl, gsDPSetTileSize, __VA_ARGS__) -#define gSP1Triangle(gdl, ...) \ - gD_(gdl, gsSP1Triangle, __VA_ARGS__) -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -# define gSP2Triangles(gdl, ...) \ - gD_(gdl, gsSP2Triangles, __VA_ARGS__) -# define gSP1Quadrangle(gdl, ...) \ - gD_(gdl, gsSP1Quadrangle, __VA_ARGS__) -# define gSPBranchLessZ(gdl, ...) \ - gD_(gdl, gsSPBranchLessZ, __VA_ARGS__) -# define gSPBranchLessZrg(gdl, ...) \ - gD_(gdl, gsSPBranchLessZrg, __VA_ARGS__) -# define gSPBranchLessZraw(gdl, ...) \ - gD_(gdl, gsSPBranchLessZraw, __VA_ARGS__) -#endif -#define gSPBranchList(gdl, ...) \ - gD_(gdl, gsSPBranchList, __VA_ARGS__) -#define gSPClipRatio(gdl, ...) \ - gD_(gdl, gsSPClipRatio, __VA_ARGS__) -#define gSPCullDisplayList(gdl, ...) \ - gD_(gdl, gsSPCullDisplayList, __VA_ARGS__) -#define gSPDisplayList(gdl, ...) \ - gD_(gdl, gsSPDisplayList, __VA_ARGS__) -#define gSPEndDisplayList(gdl) \ - gDisplayListPut(gdl, gsSPEndDisplayList()) -#define gSPFogFactor(gdl, ...) \ - gD_(gdl, gsSPFogFactor, __VA_ARGS__) -#define gSPFogPosition(gdl, ...) \ - gD_(gdl, gsSPFogPosition, __VA_ARGS__) -#define gSPForceMatrix(gdl, ...) \ - gD_(gdl, gsSPForceMatrix, __VA_ARGS__) -#define gSPSetGeometryMode(gdl, ...) \ - gD_(gdl, gsSPSetGeometryMode, __VA_ARGS__) -#define gSPClearGeometryMode(gdl, ...) \ - gD_(gdl, gsSPClearGeometryMode, __VA_ARGS__) -#define gSPLoadGeometryMode(gdl, ...) \ - gD_(gdl, gsSPLoadGeometryMode, __VA_ARGS__) -#if defined(F3D_GBI) || defined(F3DEX_GBI) -# define gSPInsertMatrix(gdl, ...) \ - gD_(gdl, gsSPInsertMatrix, __VA_ARGS__) -#endif -#define gSPLine3D(gdl, ...) \ - gD_(gdl, gsSPLine3D, __VA_ARGS__) -#define gSPLineW3D(gdl, ...) \ - gD_(gdl, gsSPLineW3D, __VA_ARGS__) -#define gSPLoadUcode(gdl, ...) \ - gD_(gdl, gsSPLoadUcode, __VA_ARGS__) -#define gSPLoadUcodeL(gdl, ...) \ - gD_(gdl, gsSPLoadUcodeL, __VA_ARGS__) -#define gSPLookAtX(gdl, ...) \ - gD_(gdl, gsSPLookAtX, __VA_ARGS__) -#define gSPLookAtY(gdl, ...) \ - gD_(gdl, gsSPLookAtY, __VA_ARGS__) -#define gSPLookAt(gdl, ...) \ - gD_(gdl, gsSPLookAt, __VA_ARGS__) -#define gSPMatrix(gdl, ...) \ - gD_(gdl, gsSPMatrix, __VA_ARGS__) -#define gSPModifyVertex(gdl, ...) \ - gD_(gdl, gsSPModifyVertex, __VA_ARGS__) -#define gSPPerspNormalize(gdl, ...) \ - gD_(gdl, gsSPPerspNormalize, __VA_ARGS__) -#define gSPPopMatrix(gdl, ...) \ - gD_(gdl, gsSPPopMatrix, __VA_ARGS__) -#if defined(F3DEX_GBI_2) -# define gSPPopMatrixN(gdl, ...) \ - gD_(gdl, gsSPPopMatrixN, __VA_ARGS__) -#endif -#define gSPSegment(gdl, ...) \ - gD_(gdl, gsSPSegment, __VA_ARGS__) -#define gSPSetLights0(gdl, ...) \ - gD_(gdl, gsSPSetLights0, __VA_ARGS__) -#define gSPSetLights1(gdl, ...) \ - gD_(gdl, gsSPSetLights1, __VA_ARGS__) -#define gSPSetLights2(gdl, ...) \ - gD_(gdl, gsSPSetLights2, __VA_ARGS__) -#define gSPSetLights3(gdl, ...) \ - gD_(gdl, gsSPSetLights3, __VA_ARGS__) -#define gSPSetLights4(gdl, ...) \ - gD_(gdl, gsSPSetLights4, __VA_ARGS__) -#define gSPSetLights5(gdl, ...) \ - gD_(gdl, gsSPSetLights5, __VA_ARGS__) -#define gSPSetLights6(gdl, ...) \ - gD_(gdl, gsSPSetLights6, __VA_ARGS__) -#define gSPSetLights7(gdl, ...) \ - gD_(gdl, gsSPSetLights7, __VA_ARGS__) -#define gSPSetStatus(gdl, ...) \ - gD_(gdl, gsSPSetStatus, __VA_ARGS__) -#define gSPNumLights(gdl, ...) \ - gD_(gdl, gsSPNumLights, __VA_ARGS__) -#define gSPLight(gdl, ...) \ - gD_(gdl, gsSPLight, __VA_ARGS__) -#define gSPLightColor(gdl, ...) \ - gD_(gdl, gsSPLightColor, __VA_ARGS__) -#define gSPTexture(gdl, ...) \ - gD_(gdl, gsSPTexture, __VA_ARGS__) -#define gSPTextureRectangle(gdl, ...) \ - gD_(gdl, gsSPTextureRectangle, __VA_ARGS__) -#define gSPScisTextureRectangle(gdl, ...) \ - gD_(gdl, gsSPScisTextureRectangle, __VA_ARGS__) -#define gSPTextureRectangleFlip(gdl, ...) \ - gD_(gdl, gsSPTextureRectangleFlip, __VA_ARGS__) -#define gSPScisTextureRectangleFlip(gdl, ...) \ - gD_(gdl, gsSPScisTextureRectangleFlip, __VA_ARGS__) -#define gSPVertex(gdl, ...) \ - gD_(gdl, gsSPVertex, __VA_ARGS__) -#define gSPViewport(gdl, ...) \ - gD_(gdl, gsSPViewport, __VA_ARGS__) -#define gSPBgRectCopy(gdl, ...) \ - gD_(gdl, gsSPBgRectCopy, __VA_ARGS__) -#define gSPBgRect1Cyc(gdl, ...) \ - gD_(gdl, gsSPBgRect1Cyc, __VA_ARGS__) -#define gSPObjRectangle(gdl, ...) \ - gD_(gdl, gsSPObjRectangle, __VA_ARGS__) -#define gSPObjRectangleR(gdl, ...) \ - gD_(gdl, gsSPObjRectangleR, __VA_ARGS__) -#define gSPObjSprite(gdl, ...) \ - gD_(gdl, gsSPObjSprite, __VA_ARGS__) -#define gSPObjMatrix(gdl, ...) \ - gD_(gdl, gsSPObjMatrix, __VA_ARGS__) -#define gSPObjSubMatrix(gdl, ...) \ - gD_(gdl, gsSPObjSubMatrix, __VA_ARGS__) -#define gSPObjRenderMode(gdl, ...) \ - gD_(gdl, gsSPObjRenderMode, __VA_ARGS__) -#define gSPObjLoadTxtr(gdl, ...) \ - gD_(gdl, gsSPObjLoadTxtr, __VA_ARGS__) -#define gSPObjLoadTxRect(gdl, ...) \ - gD_(gdl, gsSPObjLoadTxRect, __VA_ARGS__) -#define gSPObjLoadTxRectR(gdl, ...) \ - gD_(gdl, gsSPObjLoadTxRectR, __VA_ARGS__) -#define gSPObjLoadTxSprite(gdl, ...) \ - gD_(gdl, gsSPObjLoadTxSprite, __VA_ARGS__) -#define gSPSelectDL(gdl, ...) \ - gD_(gdl, gsSPSelectDL, __VA_ARGS__) -#define gSPSelectBranchDL(gdl, ...) \ - gD_(gdl, gsSPSelectBranchDL, __VA_ARGS__) -#define gDPLoadTLUTCmd(gdl, ...) \ - gD_(gdl, gsDPLoadTLUTCmd, __VA_ARGS__) -#define gDPLoadTLUT(gdl, ...) \ - gD_(gdl, gsDPLoadTLUT, __VA_ARGS__) -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -# define gBranchZ(gdl, ...) \ - gD_(gdl, gsBranchZ, __VA_ARGS__) -#endif -#define gDisplayList(gdl, ...) \ - gD_(gdl, gsDisplayList, __VA_ARGS__) -#define gDPHalf1(gdl, ...) \ - gD_(gdl, gsDPHalf1, __VA_ARGS__) -#define gDPHalf2(gdl, ...) \ - gD_(gdl, gsDPHalf2, __VA_ARGS__) -#define gDPLoadTile(gdl, ...) \ - gD_(gdl, gsDPLoadTile, __VA_ARGS__) -#define gDPSetCombine(gdl, ...) \ - gD_(gdl, gsDPSetCombine, __VA_ARGS__) -#if defined(F3DEX_GBI_2) -# define gSPGeometryMode(gdl, ...) \ - gD_(gdl, gsSPGeometryMode, __VA_ARGS__) -#endif -#define gSPSetOtherMode(gdl, ...) \ - gD_(gdl, gsSPSetOtherMode, __VA_ARGS__) -#define gSPSetOtherModeLo(gdl, ...) \ - gD_(gdl, gsSPSetOtherModeLo, __VA_ARGS__) -#define gSPSetOtherModeHi(gdl, ...) \ - gD_(gdl, gsSPSetOtherModeHi, __VA_ARGS__) -#define gDPSetOtherMode(gdl, ...) \ - gD_(gdl, gsDPSetOtherMode, __VA_ARGS__) -#define gMoveWd(gdl, ...) \ - gD_(gdl, gsMoveWd, __VA_ARGS__) -#define gMoveMem(gdl, ...) \ - gD_(gdl, gsMoveMem, __VA_ARGS__) -#if defined(F3DEX_GBI_2) -# define gSPDma_io(gdl, ...) \ - gD_(gdl, gsSPDma_io, __VA_ARGS__) -# define gSPDmaRead(gdl, ...) \ - gD_(gdl, gsSPDmaRead, __VA_ARGS__) -# define gSPDmaWrite(gdl, ...) \ - gD_(gdl, gsSPDmaWrite, __VA_ARGS__) -#endif -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -# define gLoadUcode(gdl, ...) \ - gD_(gdl, gsLoadUcode, __VA_ARGS__) -# define gSPLoadUcodeEx(gdl, ...) \ - gD_(gdl, gsSPLoadUcodeEx, __VA_ARGS__) -#endif -#define gTexRect(gdl, ...) \ - gD_(gdl, gsTexRect, __VA_ARGS__) -#define gTexRectFlip(gdl, ...) \ - gD_(gdl, gsTexRectFlip, __VA_ARGS__) -#define gSPNoOp(gdl) \ - gDisplayListPut(gdl, gsSPNoOp()) -#define gDPWord(gdl, ...) \ - gD_(gdl, gsDPWord, __VA_ARGS__) -#if defined(F3DEX_GBI_2) -# define gSpecial3(gdl, ...) \ - gD_(gdl, gsSpecial3, __VA_ARGS__) -# define gSpecial2(gdl, ...) \ - gD_(gdl, gsSpecial2, __VA_ARGS__) -# define gSpecial1(gdl, ...) \ - gD_(gdl, gsSpecial1, __VA_ARGS__) -#endif - -/* data types and structures */ -typedef uint8_t qu08_t; -typedef uint16_t qu016_t; -typedef int16_t qs48_t; -typedef int16_t qs510_t; -typedef uint16_t qu510_t; -typedef int16_t qs102_t; -typedef uint16_t qu102_t; -typedef int16_t qs105_t; -typedef uint16_t qu105_t; -typedef int16_t qs132_t; -typedef int16_t qs142_t; -typedef int32_t qs1516_t; -typedef int32_t qs1616_t; -typedef int32_t qs205_t; - -typedef uint16_t g_bglt_t; -typedef uint8_t g_ifmt_t; -typedef uint8_t g_isiz_t; -typedef uint16_t g_bgf_t; -typedef uint8_t g_objf_t; -typedef uint32_t g_objlt_t; - -typedef struct -{ - _Alignas(8) - uint32_t hi; - uint32_t lo; -} Gfx; - -typedef struct -{ - int32_t x1; - int32_t y1; - int32_t x2; - int32_t y2; -} Hilite_t; - -typedef union -{ - _Alignas(8) - Hilite_t h; -} Hilite; - -typedef int32_t Mtx_t[4][4]; - -typedef union -{ - _Alignas(8) - Mtx_t m; - int32_t l[16]; - struct - { - int16_t i[16]; - uint16_t f[16]; - }; -} Mtx; - -typedef struct -{ - uint8_t col[3]; - char pad1; - uint8_t colc[3]; - char pad2; - int8_t dir[3]; - char pad3; -} Light_t; - -typedef union -{ - _Alignas(8) - Light_t l; -} Light; - -typedef struct -{ - Light l[2]; -} LookAt; - -typedef struct -{ - uint8_t col[3]; - char pad1; - uint8_t colc[3]; - char pad2; -} Ambient_t; - -typedef union -{ - _Alignas(8) - Ambient_t l; -} Ambient; - -typedef struct -{ - Ambient a; - Light l[1]; -} Lights0, Lights1; - -typedef struct -{ - Ambient a; - Light l[2]; -} Lights2; - -typedef struct -{ - Ambient a; - Light l[3]; -} Lights3; - -typedef struct -{ - Ambient a; - Light l[4]; -} Lights4; - -typedef struct -{ - Ambient a; - Light l[5]; -} Lights5; - -typedef struct -{ - Ambient a; - Light l[6]; -} Lights6; - -typedef struct -{ - Ambient a; - Light l[7]; -} Lightsn, Lights7; - -typedef struct -{ - int16_t ob[3]; - uint16_t flag; - qs105_t tc[2]; - uint8_t cn[4]; -} Vtx_t; - -typedef struct -{ - int16_t ob[3]; - uint16_t flag; - qs105_t tc[2]; - int8_t n[3]; - uint8_t a; -} Vtx_tn; - -typedef union -{ - _Alignas(8) - Vtx_t v; - Vtx_tn n; -} Vtx; - -typedef struct -{ - qs142_t vscale[4]; - qs142_t vtrans[4]; -} Vp_t; - -typedef union -{ - _Alignas(8) - Vp_t vp; -} Vp; - -typedef struct -{ - qs1516_t A; - qs1516_t B; - qs1516_t C; - qs1516_t D; - qs102_t X; - qs102_t Y; - qu510_t BaseScaleX; - qu510_t BaseScaleY; -} uObjMtx_t; - -typedef union -{ - _Alignas(8) - uObjMtx_t m; -} uObjMtx; - -typedef struct -{ - qs102_t X; - qs102_t Y; - qu510_t BaseScaleX; - qu510_t BaseScaleY; -} uObjSubMtx_t; - -typedef union -{ - _Alignas(8) - uObjSubMtx_t m; -} uObjSubMtx; - -typedef struct -{ - qu105_t imageX; - qu102_t imageW; - qs102_t frameX; - qu102_t frameW; - qu105_t imageY; - qu102_t imageH; - qs102_t frameY; - qu102_t frameH; - uint64_t * imagePtr; - g_bglt_t imageLoad; - g_ifmt_t imageFmt; - g_isiz_t imageSiz; - uint16_t imagePal; - g_bgf_t imageFlip; - uint16_t tmemW; - qs132_t tmemH; - uint16_t tmemLoadSH; - uint16_t tmemLoadTH; - uint16_t tmemSizeW; - uint16_t tmemSize; -} uObjBg_t; - -typedef struct -{ - qu105_t imageX; - qu102_t imageW; - qs102_t frameX; - qu102_t frameW; - qu105_t imageY; - qu102_t imageH; - qs102_t frameY; - qu102_t frameH; - uint64_t * imagePtr; - g_bglt_t imageLoad; - g_ifmt_t imageFmt; - g_isiz_t imageSiz; - uint16_t imagePal; - g_bgf_t imageFlip; - qu510_t scaleW; - qu510_t scaleH; - qs205_t imageYorig; - char padding[4]; -} uObjScaleBg_t; - -typedef union -{ - _Alignas(8) - uObjBg_t b; - uObjScaleBg_t s; -} uObjBg; - -typedef struct -{ - qs102_t objX; - qu510_t scaleW; - qu105_t imageW; - uint16_t paddingX; - qs102_t objY; - qu510_t scaleH; - qu105_t imageH; - uint16_t paddingY; - uint16_t imageStride; - uint16_t imageAdrs; - g_ifmt_t imageFmt; - g_isiz_t imageSiz; - uint16_t imagePal; - g_objf_t imageFlags; -} uObjSprite_t; - -typedef union -{ - _Alignas(8) - uObjSprite_t s; -} uObjSprite; - -typedef struct -{ - g_objlt_t type; - uint64_t * image; - uint16_t tmem; - uint16_t tsize; - uint16_t tline; - uint16_t sid; - uint32_t flag; - uint32_t mask; -} uObjTxtrBlock_t; - -typedef struct -{ - g_objlt_t type; - uint64_t * image; - uint16_t tmem; - uint16_t twidth; - uint16_t theight; - uint16_t sid; - uint32_t flag; - uint32_t mask; -} uObjTxtrTile_t; - -typedef struct -{ - g_objlt_t type; - uint64_t * image; - uint16_t phead; - uint16_t pnum; - uint16_t zero; - uint16_t sid; - uint32_t flag; - uint32_t mask; -} uObjTxtrTLUT_t; - -typedef union -{ - _Alignas(8) - uObjTxtrBlock_t block; - uObjTxtrTile_t tile; - uObjTxtrTLUT_t tlut; -} uObjTxtr; - -typedef struct -{ - uObjTxtr txtr; - uObjSprite sprite; -} uObjTxSprite; - -/* rectangle scissoring macros */ -#define gScC_(c) ((c) < 0 ? 0 : (c)) -#define gScD_(t, c, d) \ - ( \ - (c) < 0 ? \ - ( \ - (d) < 0 ? \ - (t) + (c) * (d) / 0x80 : \ - (t) - (c) * (d) / 0x80 \ - ) : \ - (t) \ - ) - -/* texture loading helper macros */ -#define G_SIZ_LDSIZ(siz) ((siz) < G_IM_SIZ_16b ? G_IM_SIZ_16b : (siz)) -#define G_SIZ_BITS(siz) (4 << gI_(siz)) -#define G_SIZ_LDBITS(siz) ((siz) < G_IM_SIZ_16b ? G_SIZ_BITS(siz) : 16) -#define G_DXT(siz, width) \ - ( \ - (width) * G_SIZ_BITS(siz) > 64 ? \ - ((1 << 11) + (width) * G_SIZ_BITS(siz) / 64 - 1) / \ - ((width) * G_SIZ_BITS(siz) / 64) : \ - (1 << 11) \ - ) -#define G_LTB_LRS(width, height, siz) \ - ( \ - (((width) * (height) + 1) * G_SIZ_BITS(siz) - 1) / \ - G_SIZ_BITS(G_SIZ_LDSIZ(siz)) - 1 \ - ) -#define G_LDBLK_TXL(txl) \ - ( \ - (txl) > G_TX_LDBLK_MAX_TXL ? \ - G_TX_LDBLK_MAX_TXL : \ - (txl) \ - ) - -/* depth value macros */ -#define gZp_(zval, near, far) \ - ( \ - (1.f - (float)(near) / (float)(zval)) / \ - (1.f - (float)(near) / (float)(far)) \ - ) -#define gZo_(zval, near, far) \ - ( \ - ((float)(zval) - (float)(near)) / \ - ((float)(far) - (float)(near)) \ - ) -#define gZf_(zval, near, far, flag) \ - qs1616 \ - ( \ - (flag) == G_BZ_PERSP ? \ - gZp_(zval, near, far) : \ - gZo_(zval, near, far) \ - ) -#define G_DEPTOZSrg(zval, near, far, flag, zmin, zmax) \ - ( \ - gZf_(zval, near, far, flag) * \ - ((int32_t)((zmax) - (zmin)) & ~(int32_t)1) + \ - qs1616(zmin) \ - ) -#define G_DEPTOZS(zval, near, far, flag) \ - G_DEPTOZSrg(zval, near, far, flag, 0, G_MAXZ) - -/* vertex ordering macros */ -#define gV2_(v0, v1, flag) \ - ( \ - (flag) == 0 ? gI_(v0) : \ - gI_(v1) \ - ) -#define gV3_(v0, v1, v2, flag) \ - ( \ - (flag) == 0 ? gI_(v0) : \ - (flag) == 1 ? gI_(v1) : \ - gI_(v2) \ - ) -#define gV4_(v0, v1, v2, v3, flag) \ - ( \ - (flag) == 0 ? gI_(v0) : \ - (flag) == 1 ? gI_(v1) : \ - (flag) == 2 ? gI_(v2) : \ - gI_(v3) \ - ) - -/* sprite texture parameter macros */ -#define GS_PIX2TMEM(pix, siz) ((pix) * G_SIZ_BITS(siz) / 64) -#define GS_TB_TSIZE(pix, siz) (GS_PIX2TMEM(pix, siz) - 1) -#define GS_TB_TLINE(pix, siz) (((1 << 11) - 1) / GS_PIX2TMEM(pix, siz) + 1) -#define GS_TT_TWIDTH(pix, siz) (GS_PIX2TMEM(pix, siz) * 4 - 1) -#define GS_TT_THEIGHT(pix, siz) ((pix) * 4 - 1) -#define GS_PAL_HEAD(head) ((head) + 256) -#define GS_PAL_NUM(num) ((num) - 1) - -/* fixed-point conversion macros */ -#define qu08(n) ((qu08_t)((n) * 0x100)) -#define qu016(n) ((qu016_t)((n) * 0x10000)) -#define qs48(n) ((qs48_t)((n) * 0x0100)) -#define qs510(n) ((qs510_t)((n) * 0x0400)) -#define qu510(n) ((qu510_t)((n) * 0x0400)) -#define qs102(n) ((qs102_t)((n) * 0x0004)) -#define qu102(n) ((qu102_t)((n) * 0x0004)) -#define qs105(n) ((qs105_t)((n) * 0x0020)) -#define qu105(n) ((qu105_t)((n) * 0x0020)) -#define qs132(n) ((qs132_t)((n) * 0x0004)) -#define qs142(n) ((qs142_t)((n) * 0x0004)) -#define qs1516(n) ((qs1516_t)((n) * 0x00010000)) -#define qs1616(n) ((qs1616_t)((n) * 0x00010000)) -#define qs205(n) ((qs205_t)((n) * 0x00000020)) - -/* private helper macros */ -#define gI_(i) ((uint32_t)(i)) -#define gL_(l) ((uint64_t)(l)) -#define gF_(i, n, s) ((gI_(i) & ((gI_(1) << (n)) - 1)) << (s)) -#define gFL_(l, n, s) ((gL_(l) & ((gL_(1) << (n)) - 1)) << (s)) -#define gO_(opc, hi, lo) ((Gfx){gF_(opc, 8, 24) | gI_(hi), gI_(lo)}) -#define gD_(gdl, m, ...) gDisplayListPut(gdl, m(__VA_ARGS__)) - -#endif diff --git a/tools/ZAPD/lib/libgfxd/gfxd.c b/tools/ZAPD/lib/libgfxd/gfxd.c deleted file mode 100644 index 76d7ded8a7..0000000000 --- a/tools/ZAPD/lib/libgfxd/gfxd.c +++ /dev/null @@ -1,863 +0,0 @@ -#include -#include -#include -#include -#include -#ifdef _WIN32 -# include -# define read _read -# define write _write -#else -# include -#endif -#include "gbi.h" -#include "gfxd.h" -#include "priv.h" - -static TLOCAL struct gfxd_state state; - -static int buffer_input_fn(void *buf, int count) -{ - if (count > config.input_buf_size) - count = config.input_buf_size; - memcpy(buf, config.input_buf, count); - config.input_buf += count; - config.input_buf_size -= count; - return count; -} - -static int buffer_output_fn(const char *buf, int count) -{ - if (count > config.output_buf_size) - count = config.output_buf_size; - memcpy(config.output_buf, buf, count); - config.output_buf += count; - config.output_buf_size -= count; - return count; -} - -static int fd_input_fn(void *buf, int count) -{ - return read(config.input_fd, buf, count); -} - -static int fd_output_fn(const char *buf, int count) -{ - return write(config.output_fd, buf, count); -} - -static void swap_words(Gfx *gfx) -{ - uint8_t b[8]; - uint8_t *pw = (void *) gfx; - uint8_t *pb = b; - - int endian = config.endian; - int wordsize = config.wordsize; - - for (int i = 0; i < 8 / wordsize; i++) - { - if (endian == gfxd_endian_host) - { - switch (wordsize) - { - case 1: - { - uint8_t w = *(uint8_t *) pw; - *pb++ = w >> 0; - break; - } - case 2: - { - uint16_t w = *(uint16_t *) pw; - *pb++ = w >> 8; - *pb++ = w >> 0; - break; - } - case 4: - { - uint32_t w = *(uint32_t *) pw; - *pb++ = w >> 24; - *pb++ = w >> 16; - *pb++ = w >> 8; - *pb++ = w >> 0; - break; - } - case 8: - { - uint64_t w = *(uint64_t *) pw; - *pb++ = w >> 56; - *pb++ = w >> 48; - *pb++ = w >> 40; - *pb++ = w >> 32; - *pb++ = w >> 24; - *pb++ = w >> 16; - *pb++ = w >> 8; - *pb++ = w >> 0; - break; - } - } - } - else - { - for (int j = 0; j < wordsize; j++) - { - if (endian == gfxd_endian_little) - *pb++ = pw[wordsize - 1 - j]; - else - *pb++ = pw[j]; - } - } - pw += wordsize; - } - - gfx->hi = ((uint32_t) b[0] << 24) - | ((uint32_t) b[1] << 16) - | ((uint32_t) b[2] << 8) - | ((uint32_t) b[3] << 0); - gfx->lo = ((uint32_t) b[4] << 24) - | ((uint32_t) b[5] << 16) - | ((uint32_t) b[6] << 8) - | ((uint32_t) b[7] << 0); -} - -static void get_more_input(void) -{ - if (state.end_input != 0) - return; - - char *recv_buf = (void *) &state.gfx[0]; - - while (state.n_gfx < sizeof(state.gfx) / sizeof(state.gfx[0])) - { - int n_read = sizeof(state.gfx) - state.n_byte; - n_read = config.input_fn(&recv_buf[state.n_byte], n_read); - if (n_read == 0) - return; - state.n_byte += n_read; - - while (state.n_gfx < state.n_byte / sizeof(Gfx)) - { - Gfx gfx = state.gfx[state.n_gfx]; - gfxd_macro_t *m = &state.macro[state.n_gfx]; - - swap_words(&gfx); - - int ret = config.ucode->disas_fn(m, gfx.hi, gfx.lo); - if (ret != 0 && config.stop_on_invalid != 0) - { - state.end_input = 1; - state.ret = ret; - return; - } - - state.n_gfx++; - } - } -} - -static int32_t typed_arg_i(int type, int idx) -{ - const gfxd_value_t *v = gfxd_value_by_type(type, idx); - if (v != NULL) - return v->i; - else - return -1; -} - -static uint32_t typed_arg_u(int type, int idx) -{ - const gfxd_value_t *v = gfxd_value_by_type(type, idx); - if (v != NULL) - return v->u; - else - return 0; -} - - -TLOCAL struct gfxd_config config = -{ - .ucode = NULL, - .endian = gfxd_endian_big, - .wordsize = 4, - .arg = NULL, - - .stop_on_invalid = 1, - .stop_on_end = 1, - .emit_dec_color = 0, - .emit_q_macro = 0, - .emit_ext_macro = 0, - - .input_buf = NULL, - .input_buf_size = 0, - .input_fn = &buffer_input_fn, - - .output_buf = NULL, - .output_buf_size = 0, - .output_fn = &buffer_output_fn, - - .macro_fn = &gfxd_macro_dflt, - .arg_fn = &gfxd_arg_dflt, - - .tlut_fn = NULL, - .timg_fn = NULL, - .cimg_fn = NULL, - .zimg_fn = NULL, - .dl_fn = NULL, - .mtx_fn = NULL, - .lookat_fn = NULL, - .light_fn = NULL, - .seg_fn = NULL, - .vtx_fn = NULL, - .vp_fn = NULL, - .uctext_fn = NULL, - .ucdata_fn = NULL, - .dram_fn = NULL, -}; - -void gfxd_input_buffer(const void *buf, int size) -{ - config.input_buf = buf; - config.input_buf_size = size; - config.input_fn = &buffer_input_fn; -} - -void gfxd_output_buffer(char *buf, int size) -{ - config.output_buf = buf; - config.output_buf_size = size; - config.output_fn = &buffer_output_fn; -} - -void gfxd_input_fd(int fd) -{ - config.input_fd = fd; - config.input_fn = &fd_input_fn; -} - -void gfxd_output_fd(int fd) -{ - config.output_fd = fd; - config.output_fn = &fd_output_fn; -} - -void gfxd_input_callback(gfxd_input_fn_t *fn) -{ - if (fn != NULL) - config.input_fn = fn; - else - gfxd_input_buffer(NULL, 0); -} - -void gfxd_output_callback(gfxd_output_fn_t *fn) -{ - if (fn != NULL) - config.output_fn = fn; - else - gfxd_output_buffer(NULL, 0); -} - -void gfxd_macro_fn(gfxd_macro_fn_t *fn) -{ - if (fn != NULL) - config.macro_fn = fn; - else - config.macro_fn = gfxd_macro_dflt; -} - -void gfxd_arg_fn(gfxd_arg_fn_t *fn) -{ - if (fn != NULL) - config.arg_fn = fn; - else - config.arg_fn = gfxd_arg_dflt; -} - -int gfxd_write(const void *buf, int count) -{ - return config.output_fn(buf, count); -} - -int gfxd_puts(const char *str) -{ - return gfxd_write(str, strlen(str)); -} - -int gfxd_printf(const char *fmt, ...) -{ - char s[256]; - - va_list arg; - va_start(arg, fmt); - int n = vsnprintf(s, sizeof(s), fmt, arg); - va_end(arg); - - if (n > sizeof(s) - 1) - n = sizeof(s) - 1; - - return gfxd_write(s, n); -} - -int gfxd_print_value(int type, const gfxd_value_t *value) -{ - return config.ucode->arg_tbl[type].fn(value); -} - -int gfxd_macro_dflt(void) -{ - gfxd_macro_t *m = &state.macro[0]; - const gfxd_macro_type_t *t = &config.ucode->macro_tbl[m->id]; - - const char *name = gfxd_macro_name(); - if (name == NULL) - { - if (config.arg != NULL) - { - gfxd_puts(config.arg); - gfxd_puts(" = "); - } - - gfxd_puts("(Gfx){"); - } - else - { - gfxd_puts(name); - gfxd_puts("("); - - if (config.arg != NULL) - { - gfxd_puts(config.arg); - if (t->n_arg != 0) - gfxd_puts(", "); - } - } - - for (int i = 0; i < t->n_arg; i++) - { - if (i != 0) - gfxd_puts(", "); - - config.arg_fn(i); - } - - if (name == NULL) - gfxd_puts("}"); - else - gfxd_puts(")"); - - return 0; -} - -int gfxd_arg_callbacks(int arg_num) -{ - int id = gfxd_macro_id(); - - switch (gfxd_arg_type(arg_num)) - { - case gfxd_Tlut: - { - if (config.tlut_fn != NULL) - { - int32_t num; - if (id == gfxd_DPLoadTLUT_pal16) - num = 16; - else if (id == gfxd_DPLoadTLUT_pal256) - num = 256; - else - num = typed_arg_i(gfxd_Num, 0); - return config.tlut_fn( - typed_arg_u(gfxd_Tlut, 0), - typed_arg_i(gfxd_Pal, 0), - num); - } - break; - } - case gfxd_Timg: - { - if (config.timg_fn != NULL) - { - int32_t siz = typed_arg_i(gfxd_Siz, 0); - if (siz == -1) - siz = G_IM_SIZ_4b; - return config.timg_fn( - typed_arg_u(gfxd_Timg, 0), - typed_arg_i(gfxd_Fmt, 0), - siz, - typed_arg_i(gfxd_Dim, 0), - typed_arg_i(gfxd_Dim, 1), - typed_arg_i(gfxd_Pal, 0)); - } - break; - } - case gfxd_Cimg: - { - if (config.cimg_fn != NULL) - { - return config.cimg_fn( - typed_arg_u(gfxd_Cimg, 0), - typed_arg_i(gfxd_Fmt, 0), - typed_arg_i(gfxd_Siz, 0), - typed_arg_i(gfxd_Dim, 0)); - } - break; - } - case gfxd_Zimg: - { - if (config.zimg_fn != NULL) - { - return config.zimg_fn( - typed_arg_u(gfxd_Zimg, 0)); - } - break; - } - case gfxd_Dl: - { - if (config.dl_fn != NULL) - { - return config.dl_fn( - typed_arg_u(gfxd_Dl, 0)); - } - break; - } - case gfxd_Mtxptr: - { - if (config.mtx_fn != NULL) - { - return config.mtx_fn( - typed_arg_u(gfxd_Mtxptr, 0)); - } - break; - } - case gfxd_Lookatptr: - { - if (config.lookat_fn != NULL) - { - int32_t num; - if (id == gfxd_SPLookAt) - num = 2; - else - num = 1; - return config.lookat_fn( - typed_arg_u(gfxd_Lookatptr, 0), - num); - } - break; - } - case gfxd_Lightptr: - { - if (config.light_fn != NULL) - { - int32_t num; - if (id == gfxd_SPSetLights1) - num = 1; - else if (id == gfxd_SPSetLights2) - num = 2; - else if (id == gfxd_SPSetLights3) - num = 3; - else if (id == gfxd_SPSetLights4) - num = 4; - else if (id == gfxd_SPSetLights5) - num = 5; - else if (id == gfxd_SPSetLights6) - num = 6; - else if (id == gfxd_SPSetLights7) - num = 7; - else - num = 1; - return config.light_fn( - typed_arg_u(gfxd_Lightptr, 0), - num); - } - break; - - } - case gfxd_Segptr: - { - if (config.seg_fn != NULL) - { - return config.seg_fn( - typed_arg_u(gfxd_Segptr, 0), - typed_arg_i(gfxd_Seg, 0)); - } - break; - } - case gfxd_Vtxptr: - { - if (config.vtx_fn != NULL) - { - return config.vtx_fn( - typed_arg_u(gfxd_Vtxptr, 0), - typed_arg_i(gfxd_Num, 0)); - } - break; - } - case gfxd_Vpptr: - { - if (config.vp_fn != NULL) - { - return config.vp_fn( - typed_arg_u(gfxd_Vpptr, 0)); - } - break; - } - case gfxd_Uctext: - { - if (config.uctext_fn != NULL) - { - return config.uctext_fn( - typed_arg_u(gfxd_Uctext, 0), - 0x1000); - } - break; - } - case gfxd_Ucdata: - { - if (config.ucdata_fn != NULL) - { - uint32_t size; - if (id == gfxd_SPLoadUcodeEx) - size = typed_arg_u(gfxd_Size, 0); - else - size = 0x800; - return config.ucdata_fn( - typed_arg_u(gfxd_Ucdata, 0), - size); - } - break; - } - case gfxd_Dram: - { - if (config.dram_fn != NULL) - { - return config.dram_fn( - typed_arg_u(gfxd_Dram, 0), - typed_arg_u(gfxd_Size, 0)); - } - break; - } - } - - return 0; -} - -void gfxd_arg_dflt(int arg_num) -{ - if (gfxd_arg_callbacks(arg_num) == 0) - { - gfxd_arg_t *a = &state.macro[0].arg[arg_num]; - - gfxd_print_value(a->type, &a->value); - } -} - -void gfxd_tlut_callback(gfxd_tlut_fn_t *fn) -{ - config.tlut_fn = fn; -} - -void gfxd_timg_callback(gfxd_timg_fn_t *fn) -{ - config.timg_fn = fn; -} - -void gfxd_cimg_callback(gfxd_cimg_fn_t *fn) -{ - config.cimg_fn = fn; -} - -void gfxd_zimg_callback(gfxd_zimg_fn_t *fn) -{ - config.zimg_fn = fn; -} - -void gfxd_dl_callback(gfxd_dl_fn_t *fn) -{ - config.dl_fn = fn; -} - -void gfxd_mtx_callback(gfxd_mtx_fn_t *fn) -{ - config.mtx_fn = fn; -} - -void gfxd_lookat_callback(gfxd_lookat_fn_t *fn) -{ - config.lookat_fn = fn; -} - -void gfxd_light_callback(gfxd_light_fn_t *fn) -{ - config.light_fn = fn; -} - -void gfxd_seg_callback(gfxd_seg_fn_t *fn) -{ - config.seg_fn = fn; -} - -void gfxd_vtx_callback(gfxd_vtx_fn_t *fn) -{ - config.vtx_fn = fn; -} - -void gfxd_vp_callback(gfxd_vp_fn_t *fn) -{ - config.vp_fn = fn; -} - -void gfxd_uctext_callback(gfxd_uctext_fn_t *fn) -{ - config.uctext_fn = fn; -} - -void gfxd_ucdata_callback(gfxd_ucdata_fn_t *fn) -{ - config.ucdata_fn = fn; -} - -void gfxd_dram_callback(gfxd_dram_fn_t *fn) -{ - config.dram_fn = fn; -} - -void gfxd_target(gfxd_ucode_t ucode) -{ - config.ucode = ucode; -} - -void gfxd_endian(int endian, int wordsize) -{ - config.endian = endian; - config.wordsize = wordsize; -} - -void gfxd_dynamic(const char *arg) -{ - config.arg = arg; -} - -void gfxd_enable(int cap) -{ - switch (cap) - { - case gfxd_stop_on_invalid: - config.stop_on_invalid = 1; - break; - - case gfxd_stop_on_end: - config.stop_on_end = 1; - break; - - case gfxd_emit_dec_color: - config.emit_dec_color = 1; - break; - - case gfxd_emit_q_macro: - config.emit_q_macro = 1; - break; - - case gfxd_emit_ext_macro: - config.emit_ext_macro = 1; - break; - } -} - -void gfxd_disable(int cap) -{ - switch (cap) - { - case gfxd_stop_on_invalid: - config.stop_on_invalid = 0; - return; - - case gfxd_stop_on_end: - config.stop_on_end = 0; - return; - - case gfxd_emit_dec_color: - config.emit_dec_color = 0; - break; - - case gfxd_emit_q_macro: - config.emit_q_macro = 0; - break; - - case gfxd_emit_ext_macro: - config.emit_ext_macro = 0; - break; - } -} - -void gfxd_udata_set(void *ptr) -{ - config.udata = ptr; -} - -void *gfxd_udata_get(void) -{ - return config.udata; -} - -int gfxd_execute(void) -{ - state.macro_offset = 0; - state.n_byte = 0; - state.n_gfx = 0; - state.end_input = 0; - state.ret = 0; - - for (;;) - { - get_more_input(); - if (state.n_gfx == 0) - break; - - gfxd_macro_t *m = &state.macro[0]; - config.ucode->combine_fn(m, state.n_gfx); - - const gfxd_macro_type_t *t = &config.ucode->macro_tbl[m->id]; - if (t->ext != 0 && config.emit_ext_macro == 0) - { - Gfx gfx = state.gfx[0]; - swap_words(&gfx); - - t = &config.ucode->macro_tbl[gfxd_Invalid]; - t->disas_fn(m, gfx.hi, gfx.lo); - } - - int ret = config.macro_fn(); - if (ret != 0) - { - state.ret = ret; - break; - } - - if (config.stop_on_end != 0 - && (m->id == gfxd_SPBranchList - || m->id == gfxd_SPEndDisplayList)) - { - break; - } - - int n_pop = config.ucode->macro_tbl[m->id].n_gfx; - int n_rem = state.n_gfx - n_pop; - { - int n_byte = n_rem * sizeof(gfxd_macro_t); - memmove(&state.macro[0], &state.macro[n_pop], n_byte); - state.n_gfx = n_rem; - } - { - int n_byte = n_rem * sizeof(Gfx); - memmove(&state.gfx[0], &state.gfx[n_pop], n_byte); - state.n_byte = n_byte; - } - state.macro_offset += n_pop * sizeof(Gfx); - } - - return state.ret; -} - -int gfxd_macro_offset(void) -{ - return state.macro_offset; -} - -int gfxd_macro_packets(void) -{ - return config.ucode->macro_tbl[state.macro[0].id].n_gfx; -} - -const void *gfxd_macro_data(void) -{ - return state.gfx; -} - -int gfxd_macro_id(void) -{ - return state.macro[0].id; -} - -const char *gfxd_macro_name(void) -{ - int id = state.macro[0].id; - const gfxd_macro_type_t *t = &config.ucode->macro_tbl[id]; - - if (t->prefix == NULL && t->suffix == NULL) - { - return NULL; - } - else - { - static TLOCAL char buf[32]; - - char *p = buf; - if (t->prefix != NULL) - { - const char *s = t->prefix; - while (*s != '\0') - *p++ = *s++; - } - *p++ = 'g'; - if (config.arg == NULL) - *p++ = 's'; - if (t->suffix != NULL) - { - const char *s = t->suffix; - while (*s != '\0') - *p++ = *s++; - } - *p++ = '\0'; - - return buf; - } -} - -int gfxd_arg_count(void) -{ - return config.ucode->macro_tbl[state.macro[0].id].n_arg; -} - -int gfxd_arg_type(int arg_num) -{ - return state.macro[0].arg[arg_num].type; -} - -const char *gfxd_arg_name(int arg_num) -{ - return state.macro[0].arg[arg_num].name; -} - -int gfxd_arg_fmt(int arg_num) -{ - return config.ucode->arg_tbl[state.macro[0].arg[arg_num].type].fmt; -} - -const gfxd_value_t *gfxd_arg_value(int arg_num) -{ - return &state.macro[0].arg[arg_num].value; -} - -const gfxd_value_t *gfxd_value_by_type(int type, int idx) -{ - gfxd_macro_t *m = &state.macro[0]; - const gfxd_macro_type_t *t = &config.ucode->macro_tbl[m->id]; - - for (int i = 0; i < t->n_arg; i++) - { - gfxd_arg_t *a = &m->arg[i]; - if (a->type == type) - { - if (idx == 0) - return &a->value; - else - idx--; - } - } - - return NULL; -} - -int gfxd_arg_valid(int arg_num) -{ - return state.macro[0].arg[arg_num].bad == 0; -} diff --git a/tools/ZAPD/lib/libgfxd/gfxd.h b/tools/ZAPD/lib/libgfxd/gfxd.h deleted file mode 100644 index 268bbfa10f..0000000000 --- a/tools/ZAPD/lib/libgfxd/gfxd.h +++ /dev/null @@ -1,387 +0,0 @@ -#ifndef GFXD_H -#define GFXD_H -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -enum -{ - gfxd_Word, /* generic word */ - gfxd_Opcode, /* command opcode (G_*) */ - gfxd_Coordi, /* integer coordinate */ - gfxd_Coordq, /* fractional (q10.2) coordinate */ - gfxd_Pal, /* palette index */ - gfxd_Tlut, /* tlut pointer */ - gfxd_Timg, /* texture image pointer */ - gfxd_Tmem, /* tmem address */ - gfxd_Tile, /* tile index */ - gfxd_Fmt, /* texture format */ - gfxd_Siz, /* texture pixel size */ - gfxd_Dim, /* integer dimension (width / height) */ - gfxd_Cm, /* clamp and mirror flags */ - gfxd_Tm, /* tile mask */ - gfxd_Ts, /* tile shift */ - gfxd_Dxt, /* texture dxt */ - gfxd_Tag, /* generic tag */ - gfxd_Pm, /* pipeline mode */ - gfxd_Colorpart, /* color component */ - gfxd_Color, /* color */ - gfxd_Lodfrac, /* lod fraction (q0.8) */ - gfxd_Cimg, /* color image pointer */ - gfxd_Zimg, /* depth image pointer */ - gfxd_Ac, /* alpha compare mode */ - gfxd_Ad, /* alpha dither mode */ - gfxd_Cd, /* color dither mode */ - gfxd_Ccpre, /* color combiner preset index */ - gfxd_Ccmuxa, /* color mux operand (a) */ - gfxd_Ccmuxb, /* color mux operand (b) */ - gfxd_Ccmuxc, /* color mux operand (c) */ - gfxd_Ccmuxd, /* color mux operand (d) */ - gfxd_Acmuxabd, /* alpha mux operand (a, b, or d) */ - gfxd_Acmuxc, /* alpha mux operand (c) */ - gfxd_Cv, /* color convert operand */ - gfxd_Tc, /* texture convert mode */ - gfxd_Cyc, /* cycle type */ - gfxd_Zs, /* depth source mode */ - gfxd_Ck, /* combine key mode */ - gfxd_Keyscale, /* combine key scale */ - gfxd_Keywidth, /* combine key width */ - gfxd_Zi, /* integer depth */ - gfxd_Rm1, /* cycle 1 render mode */ - gfxd_Rm2, /* cycle 2 render mode */ - gfxd_Sc, /* scissor mode */ - gfxd_Td, /* texture detail mode */ - gfxd_Tf, /* texture filter mode */ - gfxd_Tl, /* texture LOD mode */ - gfxd_Tt, /* textuure LUT mode */ - gfxd_Tp, /* texture perspective mode */ - gfxd_Line, /* texture line size */ - gfxd_Vtx, /* vertex index */ - gfxd_Vtxflag, /* vertex flag */ - gfxd_Dl, /* display list pointer */ - gfxd_Zraw, /* raw depth value (q16.16) */ - gfxd_Dlflag, /* display list flag */ - gfxd_Cr, /* clip ratio */ - gfxd_Num, /* element count */ - gfxd_Fogz, /* fog factor */ - gfxd_Fogp, /* fog position (0 - 1000) */ - gfxd_Mtxptr, /* matrix pointer */ - gfxd_Gm, /* geometry mode */ - gfxd_Mwo_matrix, /* matrix moveword offset */ - gfxd_Linewd, /* line width (1.5 + q7.1) */ - gfxd_Uctext, /* microcode text pointer */ - gfxd_Ucdata, /* microcode data pointer */ - gfxd_Size, /* data size */ - gfxd_Lookatptr, /* lookat pointer */ - gfxd_Mtxparam, /* matrix param */ - gfxd_Mtxstack, /* matrix param (stack select only) */ - gfxd_Mwo_point, /* vertex moveword offset */ - gfxd_Wscale, /* w-component scale (perspnorm) */ - gfxd_Seg, /* segment number */ - gfxd_Segptr, /* segment pointer */ - gfxd_Lightsn, /* dereferenced Lighstn pointer */ - gfxd_Numlights, /* light count (NUMLIGHTS_*) */ - gfxd_Lightnum, /* light number (LIGHT_*) */ - gfxd_Lightptr, /* light pointer */ - gfxd_Tcscale, /* texture coordinate scale */ - gfxd_Switch, /* on-off value */ - gfxd_St, /* vertex coordinate (q10.5) */ - gfxd_Stdelta, /* vertex coordinate delta (q5.10) */ - gfxd_Vtxptr, /* vertex pointer */ - gfxd_Vpptr, /* viewport pointer */ - gfxd_Dram, /* generic dram address */ - gfxd_Sftlo, /* othermode lo shift */ - gfxd_Othermodelo, /* othermode lo value */ - gfxd_Sfthi, /* othermode hi shift */ - gfxd_Othermodehi, /* othermode hi value */ - gfxd_Mw, /* moveword index */ - gfxd_Mwo, /* moveword offset */ - gfxd_Mwo_clip, /* clip ratio moveword offset */ - gfxd_Mwo_lightcol, /* light color moveword offset */ - gfxd_Mv, /* movemem index */ - gfxd_Mvo, /* movemem offset */ - gfxd_Dmem, /* dmem address */ - gfxd_Dmaflag, /* dma io flag */ -}; - -enum -{ - gfxd_Invalid, - gfxd_DPFillRectangle, - gfxd_DPFullSync, - gfxd_DPLoadSync, - gfxd_DPTileSync, - gfxd_DPPipeSync, - gfxd_DPLoadTLUT_pal16, - gfxd_DPLoadTLUT_pal256, - gfxd_DPLoadMultiBlockYuvS, - gfxd_DPLoadMultiBlockYuv, - gfxd_DPLoadMultiBlock_4bS, - gfxd_DPLoadMultiBlock_4b, - gfxd_DPLoadMultiBlockS, - gfxd_DPLoadMultiBlock, - gfxd__DPLoadTextureBlockYuvS, - gfxd__DPLoadTextureBlockYuv, - gfxd__DPLoadTextureBlock_4bS, - gfxd__DPLoadTextureBlock_4b, - gfxd__DPLoadTextureBlockS, - gfxd__DPLoadTextureBlock, - gfxd_DPLoadTextureBlockYuvS, - gfxd_DPLoadTextureBlockYuv, - gfxd_DPLoadTextureBlock_4bS, - gfxd_DPLoadTextureBlock_4b, - gfxd_DPLoadTextureBlockS, - gfxd_DPLoadTextureBlock, - gfxd_DPLoadMultiTileYuv, - gfxd_DPLoadMultiTile_4b, - gfxd_DPLoadMultiTile, - gfxd__DPLoadTextureTileYuv, - gfxd__DPLoadTextureTile_4b, - gfxd__DPLoadTextureTile, - gfxd_DPLoadTextureTileYuv, - gfxd_DPLoadTextureTile_4b, - gfxd_DPLoadTextureTile, - gfxd_DPLoadBlock, - gfxd_DPNoOp, - gfxd_DPNoOpTag, - gfxd_DPPipelineMode, - gfxd_DPSetBlendColor, - gfxd_DPSetEnvColor, - gfxd_DPSetFillColor, - gfxd_DPSetFogColor, - gfxd_DPSetPrimColor, - gfxd_DPSetColorImage, - gfxd_DPSetDepthImage, - gfxd_DPSetTextureImage, - gfxd_DPSetAlphaCompare, - gfxd_DPSetAlphaDither, - gfxd_DPSetColorDither, - gfxd_DPSetCombineMode, - gfxd_DPSetCombineLERP, - gfxd_DPSetConvert, - gfxd_DPSetTextureConvert, - gfxd_DPSetCycleType, - gfxd_DPSetDepthSource, - gfxd_DPSetCombineKey, - gfxd_DPSetKeyGB, - gfxd_DPSetKeyR, - gfxd_DPSetPrimDepth, - gfxd_DPSetRenderMode, - gfxd_DPSetScissor, - gfxd_DPSetScissorFrac, - gfxd_DPSetTextureDetail, - gfxd_DPSetTextureFilter, - gfxd_DPSetTextureLOD, - gfxd_DPSetTextureLUT, - gfxd_DPSetTexturePersp, - gfxd_DPSetTile, - gfxd_DPSetTileSize, - gfxd_SP1Triangle, - gfxd_SP2Triangles, - gfxd_SP1Quadrangle, - gfxd_SPBranchLessZraw, - gfxd_SPBranchList, - gfxd_SPClipRatio, - gfxd_SPCullDisplayList, - gfxd_SPDisplayList, - gfxd_SPEndDisplayList, - gfxd_SPFogFactor, - gfxd_SPFogPosition, - gfxd_SPForceMatrix, - gfxd_SPSetGeometryMode, - gfxd_SPClearGeometryMode, - gfxd_SPLoadGeometryMode, - gfxd_SPInsertMatrix, - gfxd_SPLine3D, - gfxd_SPLineW3D, - gfxd_SPLoadUcode, - gfxd_SPLookAtX, - gfxd_SPLookAtY, - gfxd_SPLookAt, - gfxd_SPMatrix, - gfxd_SPModifyVertex, - gfxd_SPPerspNormalize, - gfxd_SPPopMatrix, - gfxd_SPPopMatrixN, - gfxd_SPSegment, - gfxd_SPSetLights1, - gfxd_SPSetLights2, - gfxd_SPSetLights3, - gfxd_SPSetLights4, - gfxd_SPSetLights5, - gfxd_SPSetLights6, - gfxd_SPSetLights7, - gfxd_SPNumLights, - gfxd_SPLight, - gfxd_SPLightColor, - gfxd_SPTexture, - gfxd_SPTextureRectangle, - gfxd_SPTextureRectangleFlip, - gfxd_SPVertex, - gfxd_SPViewport, - gfxd_DPLoadTLUTCmd, - gfxd_DPLoadTLUT, - gfxd_BranchZ, - gfxd_DisplayList, - gfxd_DPHalf1, - gfxd_DPHalf2, - gfxd_DPWord, - gfxd_DPLoadTile, - gfxd_SPGeometryMode, - gfxd_SPSetOtherMode, - gfxd_SPSetOtherModeLo, - gfxd_SPSetOtherModeHi, - gfxd_DPSetOtherMode, - gfxd_MoveWd, - gfxd_MoveMem, - gfxd_SPDma_io, - gfxd_SPDmaRead, - gfxd_SPDmaWrite, - gfxd_LoadUcode, - gfxd_SPLoadUcodeEx, - gfxd_TexRect, - gfxd_TexRectFlip, - gfxd_SPNoOp, - gfxd_Special3, - gfxd_Special2, - gfxd_Special1, -}; - -enum -{ - gfxd_stop_on_invalid, - gfxd_stop_on_end, - gfxd_emit_dec_color, - gfxd_emit_q_macro, - gfxd_emit_ext_macro, -}; - -enum -{ - gfxd_endian_big, - gfxd_endian_little, - gfxd_endian_host, -}; - -enum -{ - gfxd_argfmt_i, - gfxd_argfmt_u, - gfxd_argfmt_f, -}; - -typedef union -{ - int32_t i; - uint32_t u; - float f; -} gfxd_value_t; - -typedef const struct gfxd_ucode *gfxd_ucode_t; - -typedef int gfxd_input_fn_t(void *buf, int count); -void gfxd_input_buffer(const void *buf, int size); -void gfxd_input_fd(int fd); -void gfxd_input_callback(gfxd_input_fn_t *fn); - -typedef int gfxd_output_fn_t(const char *buf, int count); -void gfxd_output_buffer(char *buf, int size); -void gfxd_output_fd(int fd); -void gfxd_output_callback(gfxd_output_fn_t *fn); - -typedef int gfxd_macro_fn_t(void); -void gfxd_macro_fn(gfxd_macro_fn_t *fn); -gfxd_macro_fn_t gfxd_macro_dflt; - -typedef void gfxd_arg_fn_t(int arg_num); -void gfxd_arg_fn(gfxd_arg_fn_t *fn); -gfxd_arg_fn_t gfxd_arg_dflt; - -typedef int gfxd_tlut_fn_t(uint32_t tlut, int32_t idx, int32_t count); -void gfxd_tlut_callback(gfxd_tlut_fn_t *fn); - -typedef int gfxd_timg_fn_t(uint32_t timg, int32_t fmt, int32_t siz, - int32_t width, int32_t height, int32_t pal); -void gfxd_timg_callback(gfxd_timg_fn_t *fn); - -typedef int gfxd_cimg_fn_t(uint32_t cimg, int32_t fmt, int32_t siz, - int32_t width); -void gfxd_cimg_callback(gfxd_cimg_fn_t *fn); - -typedef int gfxd_zimg_fn_t(uint32_t zimg); -void gfxd_zimg_callback(gfxd_zimg_fn_t *fn); - -typedef int gfxd_dl_fn_t(uint32_t dl); -void gfxd_dl_callback(gfxd_dl_fn_t *fn); - -typedef int gfxd_mtx_fn_t(uint32_t mtx); -void gfxd_mtx_callback(gfxd_mtx_fn_t *fn); - -typedef int gfxd_lookat_fn_t(uint32_t lookat, int32_t count); -void gfxd_lookat_callback(gfxd_lookat_fn_t *fn); - -typedef int gfxd_light_fn_t(uint32_t light, int32_t count); -void gfxd_light_callback(gfxd_light_fn_t *fn); - -typedef int gfxd_seg_fn_t(uint32_t seg, int32_t num); -void gfxd_seg_callback(gfxd_seg_fn_t *fn); - -typedef int gfxd_vtx_fn_t(uint32_t vtx, int32_t num); -void gfxd_vtx_callback(gfxd_vtx_fn_t *fn); - -typedef int gfxd_vp_fn_t(uint32_t vp); -void gfxd_vp_callback(gfxd_vp_fn_t *fn); - -typedef int gfxd_uctext_fn_t(uint32_t text, uint32_t size); -void gfxd_uctext_callback(gfxd_uctext_fn_t *fn); - -typedef int gfxd_ucdata_fn_t(uint32_t data, uint32_t size); -void gfxd_ucdata_callback(gfxd_ucdata_fn_t *fn); - -typedef int gfxd_dram_fn_t(uint32_t dram, uint32_t size); -void gfxd_dram_callback(gfxd_dram_fn_t *fn); - -int gfxd_write(const void *buf, int count); -int gfxd_puts(const char *str); -int gfxd_printf(const char *fmt, ...); -int gfxd_print_value(int type, const gfxd_value_t *value); - -void gfxd_target(gfxd_ucode_t ucode); -void gfxd_endian(int endian, int wordsize); -void gfxd_dynamic(const char *arg); -void gfxd_enable(int cap); -void gfxd_disable(int cap); -void gfxd_udata_set(void *ptr); -void *gfxd_udata_get(void); - -int gfxd_execute(void); - -int gfxd_macro_offset(void); -int gfxd_macro_packets(void); -const void *gfxd_macro_data(void); -int gfxd_macro_id(void); -const char *gfxd_macro_name(void); - -int gfxd_arg_count(void); -int gfxd_arg_type(int arg_num); -const char *gfxd_arg_name(int arg_num); -int gfxd_arg_fmt(int arg_num); -const gfxd_value_t *gfxd_arg_value(int arg_num); -const gfxd_value_t *gfxd_value_by_type(int type, int idx); -int gfxd_arg_valid(int arg_num); -int gfxd_arg_callbacks(int arg_num); - -extern const gfxd_ucode_t gfxd_f3d; -extern const gfxd_ucode_t gfxd_f3db; -extern const gfxd_ucode_t gfxd_f3dex; -extern const gfxd_ucode_t gfxd_f3dexb; -extern const gfxd_ucode_t gfxd_f3dex2; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/ZAPD/lib/libgfxd/priv.h b/tools/ZAPD/lib/libgfxd/priv.h deleted file mode 100644 index 37cb66b683..0000000000 --- a/tools/ZAPD/lib/libgfxd/priv.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef GFXD_PRIV_H -#define GFXD_PRIV_H -#include "gfxd.h" - -#ifdef CONFIG_MT -# ifdef _MSC_VER -# define TLOCAL __declspec(thread) -# else -# define TLOCAL _Thread_local -# endif -#else -# define TLOCAL -#endif - -#define UCFUNC static inline - -#define config gfxd_config__ - -typedef int gfxd_argfn_t(const gfxd_value_t *v); - -typedef struct -{ - int fmt; - gfxd_argfn_t * fn; -} gfxd_arg_type_t; - -typedef struct -{ - int type; - const char * name; - gfxd_value_t value; - int bad; -} gfxd_arg_t; - -typedef struct -{ - int id; - gfxd_arg_t arg[18]; -} gfxd_macro_t; - -typedef int gfxd_disas_fn_t(gfxd_macro_t *macro, uint32_t hi, uint32_t lo); -typedef int gfxd_combine_fn_t(gfxd_macro_t *macro, int n_macro); - -typedef struct -{ - const char * prefix; - const char * suffix; - int opcode; - int n_arg; - int n_gfx; - gfxd_disas_fn_t * disas_fn; - gfxd_combine_fn_t * combine_fn; - int alias; - int ext; -} gfxd_macro_type_t; - -struct gfxd_ucode -{ - gfxd_disas_fn_t * disas_fn; - gfxd_combine_fn_t * combine_fn; - const gfxd_arg_type_t * arg_tbl; - const gfxd_macro_type_t * macro_tbl; -}; - -struct gfxd_state -{ - int macro_offset; - - Gfx gfx[9]; - int n_byte; - int n_gfx; - gfxd_macro_t macro[9]; - - int end_input; - int ret; -}; - -struct gfxd_config -{ - gfxd_ucode_t ucode; - int endian; - int wordsize; - const char * arg; - void * udata; - - int stop_on_invalid; - int stop_on_end; - int emit_dec_color; - int emit_q_macro; - int emit_ext_macro; - - const char * input_buf; - int input_buf_size; - int input_fd; - gfxd_input_fn_t * input_fn; - - char * output_buf; - int output_buf_size; - int output_fd; - gfxd_output_fn_t * output_fn; - - gfxd_macro_fn_t * macro_fn; - gfxd_arg_fn_t * arg_fn; - - gfxd_tlut_fn_t * tlut_fn; - gfxd_timg_fn_t * timg_fn; - gfxd_cimg_fn_t * cimg_fn; - gfxd_zimg_fn_t * zimg_fn; - gfxd_dl_fn_t * dl_fn; - gfxd_mtx_fn_t * mtx_fn; - gfxd_lookat_fn_t * lookat_fn; - gfxd_light_fn_t * light_fn; - gfxd_seg_fn_t * seg_fn; - gfxd_vtx_fn_t * vtx_fn; - gfxd_vp_fn_t * vp_fn; - gfxd_uctext_fn_t * uctext_fn; - gfxd_ucdata_fn_t * ucdata_fn; - gfxd_dram_fn_t * dram_fn; -}; - -extern TLOCAL struct gfxd_config gfxd_config__; - -#endif diff --git a/tools/ZAPD/lib/libgfxd/uc.c b/tools/ZAPD/lib/libgfxd/uc.c deleted file mode 100644 index 7efb091052..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include "gbi.h" -#include "gfxd.h" -#include "priv.h" - -#include "uc_argfn.c" -#include "uc_argtbl.c" -#include "uc_macrofn.c" -#include "uc_macrotbl.c" - -UCFUNC int disas(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int opcode = (hi >> 24) & 0xFF; - - for (int i = 0; i < sizeof(macro_tbl) / sizeof(macro_tbl[0]); i++) - { - const gfxd_macro_type_t *t = ¯o_tbl[i]; - if (t->disas_fn != NULL && t->opcode == opcode) - return t->disas_fn(m, hi, lo); - } - - return d_Invalid(m, hi, lo); -} - -UCFUNC int combine(gfxd_macro_t *m, int num) -{ - int opcode = macro_tbl[m->id].opcode; - - for (int i = 0; i < sizeof(macro_tbl) / sizeof(macro_tbl[0]); i++) - { - const gfxd_macro_type_t *t = ¯o_tbl[i]; - if (t->combine_fn != NULL - && t->opcode == opcode - && (t->ext == 0 || config.emit_ext_macro != 0)) - { - if (t->combine_fn(m, num) == 0) - return 0; - } - } - - return -1; -} - -static const struct gfxd_ucode uc = -{ - .disas_fn = disas, - .combine_fn = combine, - .arg_tbl = arg_tbl, - .macro_tbl = macro_tbl, -}; - -const gfxd_ucode_t uc_name = &uc; diff --git a/tools/ZAPD/lib/libgfxd/uc_argfn.c b/tools/ZAPD/lib/libgfxd/uc_argfn.c deleted file mode 100644 index f65feb60f7..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_argfn.c +++ /dev/null @@ -1,1814 +0,0 @@ -#define MDMASK(md) ((((uint32_t)1 << G_MDSIZ_##md) - 1) << G_MDSFT_##md) -#define MDMASK_RM_C1 ((uint32_t)0xCCCC0000) -#define MDMASK_RM_C2 ((uint32_t)0x33330000) -#define MDMASK_RM_LO ((uint32_t)0x0000FFF8) - -UCFUNC int argfn_i(const gfxd_value_t *v) -{ - return gfxd_printf("%" PRIi32, v->i); -} - -UCFUNC int argfn_u(const gfxd_value_t *v) -{ - return gfxd_printf("%" PRIu32, v->u); -} - -UCFUNC int argfn_x8(const gfxd_value_t *v) -{ - return gfxd_printf("0x%02" PRIX32, v->u); -} - -UCFUNC int argfn_x16(const gfxd_value_t *v) -{ - return gfxd_printf("0x%04" PRIX32, v->u); -} - -UCFUNC int argfn_x32(const gfxd_value_t *v) -{ - return gfxd_printf("0x%08" PRIX32, v->u); -} - -UCFUNC int argfn_color(const gfxd_value_t *v) -{ - if (config.emit_dec_color) - return gfxd_printf("%" PRIu32, v->u); - else - return gfxd_printf("0x%02" PRIX32, v->u); -} - -UCFUNC int argfn_qu08(const gfxd_value_t *v) -{ - if (v->u == 0) - return gfxd_puts("0"); - else if (config.emit_q_macro) - return gfxd_printf("qu08(%.16g)", v->u / 256.f); - else - return gfxd_printf("0x%02" PRIX32, v->u); -} - -UCFUNC int argfn_qu016(const gfxd_value_t *v) -{ - if (v->u == 0) - return gfxd_puts("0"); - else if (config.emit_q_macro) - return gfxd_printf("qu016(%.16g)", v->u / 65536.f); - else - return gfxd_printf("0x%04" PRIX32, v->u); -} - -UCFUNC int argfn_qs48(const gfxd_value_t *v) -{ - if (v->i == 0) - return gfxd_puts("0"); - else if (config.emit_q_macro) - return gfxd_printf("qs48(%.16g)", v->i / 256.f); - else - { - if (v->i < 0) - return gfxd_printf("-0x%04" PRIX32, (uint32_t)-v->i); - else - return gfxd_printf("0x%04" PRIX32, (uint32_t)v->i); - } -} - -UCFUNC int argfn_qs510(const gfxd_value_t *v) -{ - if (v->i == 0) - return gfxd_puts("0"); - else if (config.emit_q_macro) - return gfxd_printf("qs510(%.16g)", v->i / 1024.f); - else - { - if (v->i < 0) - return gfxd_printf("-0x%04" PRIX32, (uint32_t)-v->i); - else - return gfxd_printf("0x%04" PRIX32, (uint32_t)v->i); - } -} - -UCFUNC int argfn_qu102(const gfxd_value_t *v) -{ - if (v->u == 0) - return gfxd_puts("0"); - else if (config.emit_q_macro) - return gfxd_printf("qu102(%.16g)", v->u / 4.f); - else - return gfxd_printf("0x%04" PRIX32, v->u); -} - -UCFUNC int argfn_qs105(const gfxd_value_t *v) -{ - if (v->i == 0) - return gfxd_puts("0"); - else if (config.emit_q_macro) - return gfxd_printf("qs105(%.16g)", v->i / 32.f); - else - { - if (v->i < 0) - return gfxd_printf("-0x%04" PRIX32, (uint32_t)-v->i); - else - return gfxd_printf("0x%04" PRIX32, (uint32_t)v->i); - } -} - -UCFUNC int argfn_qs1616(const gfxd_value_t *v) -{ - if (v->i == 0) - return gfxd_puts("0"); - else if (config.emit_q_macro) - return gfxd_printf("qs1616(%.16g)", v->i / 65536.f); - else - { - if (v->i < 0) - return gfxd_printf("-0x%08" PRIX32, (uint32_t)-v->i); - else - return gfxd_printf("0x%08" PRIX32, (uint32_t)v->i); - } -} - -UCFUNC int argfn_opc(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_SPNOOP: - return gfxd_puts("G_SPNOOP"); - case G_MTX: - return gfxd_puts("G_MTX"); - case G_MOVEMEM: - return gfxd_puts("G_MOVEMEM"); - case G_VTX: - return gfxd_puts("G_VTX"); - case G_DL: - return gfxd_puts("G_DL"); - case G_RDPHALF_2: - return gfxd_puts("G_RDPHALF_2"); - case G_RDPHALF_1: - return gfxd_puts("G_RDPHALF_1"); -#if defined(F3D_BETA) && (defined(F3D_GBI) || defined(F3DEX_GBI)) - case G_PERSPNORM: - return gfxd_puts("G_PERSPNORM"); -#endif - case G_LINE3D: - return gfxd_puts("G_LINE3D"); -#if defined(F3D_GBI) || defined(F3DEX_GBI) - case G_CLEARGEOMETRYMODE: - return gfxd_puts("G_CLEARGEOMETRYMODE"); - case G_SETGEOMETRYMODE: - return gfxd_puts("G_SETGEOMETRYMODE"); -#endif - case G_ENDDL: - return gfxd_puts("G_ENDDL"); - case G_SETOTHERMODE_L: - return gfxd_puts("G_SETOTHERMODE_L"); - case G_SETOTHERMODE_H: - return gfxd_puts("G_SETOTHERMODE_H"); - case G_TEXTURE: - return gfxd_puts("G_TEXTURE"); - case G_MOVEWORD: - return gfxd_puts("G_MOVEWORD"); - case G_POPMTX: - return gfxd_puts("G_POPMTX"); - case G_CULLDL: - return gfxd_puts("G_CULLDL"); - case G_TRI1: - return gfxd_puts("G_TRI1"); - case G_NOOP: - return gfxd_puts("G_NOOP"); -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - case G_LOAD_UCODE: - return gfxd_puts("G_LOAD_UCODE"); - case G_BRANCH_Z: - return gfxd_puts("G_BRANCH_Z"); - case G_TRI2: - return gfxd_puts("G_TRI2"); -# if !(defined(F3D_BETA) && defined(F3DEX_GBI)) - case G_MODIFYVTX: - return gfxd_puts("G_MODIFYVTX"); -# endif -#endif -#if defined(F3DEX_GBI_2) - case G_QUAD: - return gfxd_puts("G_QUAD"); - case G_SPECIAL_3: - return gfxd_puts("G_SPECIAL_3"); - case G_SPECIAL_2: - return gfxd_puts("G_SPECIAL_2"); - case G_SPECIAL_1: - return gfxd_puts("G_SPECIAL_1"); - case G_DMA_IO: - return gfxd_puts("G_DMA_IO"); - case G_GEOMETRYMODE: - return gfxd_puts("G_GEOMETRYMODE"); -#endif - case G_TEXRECT: - return gfxd_puts("G_TEXRECT"); - case G_TEXRECTFLIP: - return gfxd_puts("G_TEXRECTFLIP"); - case G_RDPLOADSYNC: - return gfxd_puts("G_RDPLOADSYNC"); - case G_RDPPIPESYNC: - return gfxd_puts("G_RDPPIPESYNC"); - case G_RDPTILESYNC: - return gfxd_puts("G_RDPTILESYNC"); - case G_RDPFULLSYNC: - return gfxd_puts("G_RDPFULLSYNC"); - case G_SETKEYGB: - return gfxd_puts("G_SETKEYGB"); - case G_SETKEYR: - return gfxd_puts("G_SETKEYR"); - case G_SETCONVERT: - return gfxd_puts("G_SETCONVERT"); - case G_SETSCISSOR: - return gfxd_puts("G_SETSCISSOR"); - case G_SETPRIMDEPTH: - return gfxd_puts("G_SETPRIMDEPTH"); - case G_RDPSETOTHERMODE: - return gfxd_puts("G_RDPSETOTHERMODE"); - case G_LOADTLUT: - return gfxd_puts("G_LOADTLUT"); - case G_SETTILESIZE: - return gfxd_puts("G_SETTILESIZE"); - case G_LOADBLOCK: - return gfxd_puts("G_LOADBLOCK"); - case G_LOADTILE: - return gfxd_puts("G_LOADTILE"); - case G_SETTILE: - return gfxd_puts("G_SETTILE"); - case G_FILLRECT: - return gfxd_puts("G_FILLRECT"); - case G_SETFILLCOLOR: - return gfxd_puts("G_SETFILLCOLOR"); - case G_SETFOGCOLOR: - return gfxd_puts("G_SETFOGCOLOR"); - case G_SETBLENDCOLOR: - return gfxd_puts("G_SETBLENDCOLOR"); - case G_SETPRIMCOLOR: - return gfxd_puts("G_SETPRIMCOLOR"); - case G_SETENVCOLOR: - return gfxd_puts("G_SETENVCOLOR"); - case G_SETCOMBINE: - return gfxd_puts("G_SETCOMBINE"); - case G_SETTIMG: - return gfxd_puts("G_SETTIMG"); - case G_SETZIMG: - return gfxd_puts("G_SETZIMG"); - case G_SETCIMG: - return gfxd_puts("G_SETCIMG"); - default: - return gfxd_printf("0x%02" PRIX32, (uint32_t)v->i); - } -} - -UCFUNC int argfn_fmt(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_IM_FMT_RGBA: - return gfxd_puts("G_IM_FMT_RGBA"); - case G_IM_FMT_YUV: - return gfxd_puts("G_IM_FMT_YUV"); - case G_IM_FMT_CI: - return gfxd_puts("G_IM_FMT_CI"); - case G_IM_FMT_IA: - return gfxd_puts("G_IM_FMT_IA"); - case G_IM_FMT_I: - return gfxd_puts("G_IM_FMT_I"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int argfn_siz(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_IM_SIZ_4b: - return gfxd_puts("G_IM_SIZ_4b"); - case G_IM_SIZ_8b: - return gfxd_puts("G_IM_SIZ_8b"); - case G_IM_SIZ_16b: - return gfxd_puts("G_IM_SIZ_16b"); - case G_IM_SIZ_32b: - return gfxd_puts("G_IM_SIZ_32b"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int argfn_cm(const gfxd_value_t *v) -{ - int n = 0; - if (v->u & G_TX_MIRROR) - n += gfxd_puts("G_TX_MIRROR"); - else - n += gfxd_puts("G_TX_NOMIRROR"); - if (v->u & G_TX_CLAMP) - n += gfxd_puts(" | G_TX_CLAMP"); - else - n += gfxd_puts(" | G_TX_WRAP"); - return n; -} - -UCFUNC int argfn_tm(const gfxd_value_t *v) -{ - if (v->i == 0) - return gfxd_puts("G_TX_NOMASK"); - else - return gfxd_printf("%" PRIi32, v->i); -} - -UCFUNC int argfn_ts(const gfxd_value_t *v) -{ - if (v->i == 0) - return gfxd_puts("G_TX_NOLOD"); - else - return gfxd_printf("%" PRIi32, v->i); -} - -UCFUNC int argfn_switch(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_ON: - return gfxd_puts("G_ON"); - case G_OFF: - return gfxd_puts("G_OFF"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int argfn_tile(const gfxd_value_t *v) -{ - if (v->i == G_TX_LOADTILE) - return gfxd_puts("G_TX_LOADTILE"); - else if (v->i == G_TX_RENDERTILE) - return gfxd_puts("G_TX_RENDERTILE"); - else - return gfxd_printf("%" PRIi32, v->i); -} - -UCFUNC int argfn_gm(const gfxd_value_t *v) -{ - int n = 0; - uint32_t arg = v->u; - if (arg & G_ZBUFFER) - n += gfxd_puts("G_ZBUFFER"); - if (arg & G_TEXTURE_ENABLE) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_TEXTURE_ENABLE"); - } - if (arg & G_SHADE) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_SHADE"); - } - if ((arg & G_CULL_BOTH) == G_CULL_BOTH) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_CULL_BOTH"); - } - else - { - if (arg & G_CULL_FRONT) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_CULL_FRONT"); - } - if (arg & G_CULL_BACK) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_CULL_BACK"); - } - } - if (arg & G_FOG) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_FOG"); - } - if (arg & G_LIGHTING) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_LIGHTING"); - } - if (arg & G_TEXTURE_GEN) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_TEXTURE_GEN"); - } - if (arg & G_TEXTURE_GEN_LINEAR) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_TEXTURE_GEN_LINEAR"); - } - if (arg & G_LOD) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_LOD"); - } - if (arg & G_SHADING_SMOOTH) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_SHADING_SMOOTH"); - } - if (arg & G_CLIPPING) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("G_CLIPPING"); - } - arg = arg & ~(G_ZBUFFER | G_TEXTURE_ENABLE | G_SHADE | G_CULL_BOTH | - G_FOG | G_LIGHTING | G_TEXTURE_GEN | - G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | - G_CLIPPING); - if (arg) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_printf("0x%08" PRIX32, arg); - } - return n; -} - -UCFUNC int argfn_sftlo(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_MDSFT_ALPHACOMPARE: - return gfxd_puts("G_MDSFT_ALPHACOMPARE"); - case G_MDSFT_ZSRCSEL: - return gfxd_puts("G_MDSFT_ZSRCSEL"); - case G_MDSFT_RENDERMODE: - return gfxd_puts("G_MDSFT_RENDERMODE"); - case G_MDSFT_BLENDER: - return gfxd_puts("G_MDSFT_BLENDER"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int rm_mode_str(uint32_t arg) -{ - int n = 0; - if (arg & AA_EN) - n += gfxd_puts("AA_EN"); - if (arg & Z_CMP) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("Z_CMP"); - } - if (arg & Z_UPD) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("Z_UPD"); - } - if (arg & IM_RD) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("IM_RD"); - } - if (arg & CLR_ON_CVG) - { - if (n > 0) - n += gfxd_puts(" | "); - n += gfxd_puts("CLR_ON_CVG"); - } - if (n > 0) - n += gfxd_puts(" | "); - int cvg = arg & 0x00000300; - switch (cvg) - { - case CVG_DST_CLAMP: - n += gfxd_puts("CVG_DST_CLAMP"); - break; - case CVG_DST_WRAP: - n += gfxd_puts("CVG_DST_WRAP"); - break; - case CVG_DST_FULL: - n += gfxd_puts("CVG_DST_FULL"); - break; - case CVG_DST_SAVE: - n += gfxd_puts("CVG_DST_SAVE"); - break; - } - int zmode = arg & 0x00000C00; - switch (zmode) - { - case ZMODE_OPA: - n += gfxd_puts(" | ZMODE_OPA"); - break; - case ZMODE_INTER: - n += gfxd_puts(" | ZMODE_INTER"); - break; - case ZMODE_XLU: - n += gfxd_puts(" | ZMODE_XLU"); - break; - case ZMODE_DEC: - n += gfxd_puts(" | ZMODE_DEC"); - break; - } - if (arg & CVG_X_ALPHA) - n += gfxd_puts(" | CVG_X_ALPHA"); - if (arg & ALPHA_CVG_SEL) - n += gfxd_puts(" | ALPHA_CVG_SEL"); - if (arg & FORCE_BL) - n += gfxd_puts(" | FORCE_BL"); - return n; -} - -UCFUNC int rm_cbl_str(uint32_t arg, int c) -{ - int n = 0; - if (c == 2) - arg <<= 2; - int bp = (arg >> 30) & 0b11; - switch (bp) - { - case G_BL_CLR_IN: - n += gfxd_printf("GBL_c%i(G_BL_CLR_IN", c); - break; - case G_BL_CLR_MEM: - n += gfxd_printf("GBL_c%i(G_BL_CLR_MEM", c); - break; - case G_BL_CLR_BL: - n += gfxd_printf("GBL_c%i(G_BL_CLR_BL", c); - break; - case G_BL_CLR_FOG: - n += gfxd_printf("GBL_c%i(G_BL_CLR_FOG", c); - break; - } - int ba = (arg >> 26) & 0b11; - switch (ba) - { - case G_BL_A_IN: - n += gfxd_puts(", G_BL_A_IN"); - break; - case G_BL_A_FOG: - n += gfxd_puts(", G_BL_A_FOG"); - break; - case G_BL_A_SHADE: - n += gfxd_puts(", G_BL_A_SHADE"); - break; - case G_BL_0: - n += gfxd_puts(", G_BL_0"); - break; - } - int bm = (arg >> 22) & 0b11; - switch (bm) - { - case G_BL_CLR_IN: - n += gfxd_puts(", G_BL_CLR_IN"); - break; - case G_BL_CLR_MEM: - n += gfxd_puts(", G_BL_CLR_MEM"); - break; - case G_BL_CLR_BL: - n += gfxd_puts(", G_BL_CLR_BL"); - break; - case G_BL_CLR_FOG: - n += gfxd_puts(", G_BL_CLR_FOG"); - break; - } - int bb = (arg >> 18) & 0b11; - switch (bb) - { - case G_BL_1MA: - n += gfxd_puts(", G_BL_1MA)"); - break; - case G_BL_A_MEM: - n += gfxd_puts(", G_BL_A_MEM)"); - break; - case G_BL_1: - n += gfxd_puts(", G_BL_1)"); - break; - case G_BL_0: - n += gfxd_puts(", G_BL_0)"); - break; - } - return n; -} - -struct rm_preset -{ - uint32_t rm; - const char * name; -}; - -static const struct rm_preset rm_presets[] = -{ - {G_RM_OPA_SURF, "G_RM_OPA_SURF"}, - {G_RM_OPA_SURF2, "G_RM_OPA_SURF2"}, - {G_RM_AA_OPA_SURF, "G_RM_AA_OPA_SURF"}, - {G_RM_AA_OPA_SURF2, "G_RM_AA_OPA_SURF2"}, - {G_RM_RA_OPA_SURF, "G_RM_RA_OPA_SURF"}, - {G_RM_RA_OPA_SURF2, "G_RM_RA_OPA_SURF2"}, - {G_RM_ZB_OPA_SURF, "G_RM_ZB_OPA_SURF"}, - {G_RM_ZB_OPA_SURF2, "G_RM_ZB_OPA_SURF2"}, - {G_RM_AA_ZB_OPA_SURF, "G_RM_AA_ZB_OPA_SURF"}, - {G_RM_AA_ZB_OPA_SURF2, "G_RM_AA_ZB_OPA_SURF2"}, - {G_RM_RA_ZB_OPA_SURF, "G_RM_RA_ZB_OPA_SURF"}, - {G_RM_RA_ZB_OPA_SURF2, "G_RM_RA_ZB_OPA_SURF2"}, - {G_RM_XLU_SURF, "G_RM_XLU_SURF"}, - {G_RM_XLU_SURF2, "G_RM_XLU_SURF2"}, - {G_RM_AA_XLU_SURF, "G_RM_AA_XLU_SURF"}, - {G_RM_AA_XLU_SURF2, "G_RM_AA_XLU_SURF2"}, - {G_RM_ZB_XLU_SURF, "G_RM_ZB_XLU_SURF"}, - {G_RM_ZB_XLU_SURF2, "G_RM_ZB_XLU_SURF2"}, - {G_RM_AA_ZB_XLU_SURF, "G_RM_AA_ZB_XLU_SURF"}, - {G_RM_AA_ZB_XLU_SURF2, "G_RM_AA_ZB_XLU_SURF2"}, - {G_RM_ZB_OPA_DECAL, "G_RM_ZB_OPA_DECAL"}, - {G_RM_ZB_OPA_DECAL2, "G_RM_ZB_OPA_DECAL2"}, - {G_RM_AA_ZB_OPA_DECAL, "G_RM_AA_ZB_OPA_DECAL"}, - {G_RM_AA_ZB_OPA_DECAL2, "G_RM_AA_ZB_OPA_DECAL2"}, - {G_RM_RA_ZB_OPA_DECAL, "G_RM_RA_ZB_OPA_DECAL"}, - {G_RM_RA_ZB_OPA_DECAL2, "G_RM_RA_ZB_OPA_DECAL2"}, - {G_RM_ZB_XLU_DECAL, "G_RM_ZB_XLU_DECAL"}, - {G_RM_ZB_XLU_DECAL2, "G_RM_ZB_XLU_DECAL2"}, - {G_RM_AA_ZB_XLU_DECAL, "G_RM_AA_ZB_XLU_DECAL"}, - {G_RM_AA_ZB_XLU_DECAL2, "G_RM_AA_ZB_XLU_DECAL2"}, - {G_RM_AA_ZB_OPA_INTER, "G_RM_AA_ZB_OPA_INTER"}, - {G_RM_AA_ZB_OPA_INTER2, "G_RM_AA_ZB_OPA_INTER2"}, - {G_RM_RA_ZB_OPA_INTER, "G_RM_RA_ZB_OPA_INTER"}, - {G_RM_RA_ZB_OPA_INTER2, "G_RM_RA_ZB_OPA_INTER2"}, - {G_RM_AA_ZB_XLU_INTER, "G_RM_AA_ZB_XLU_INTER"}, - {G_RM_AA_ZB_XLU_INTER2, "G_RM_AA_ZB_XLU_INTER2"}, - {G_RM_AA_XLU_LINE, "G_RM_AA_XLU_LINE"}, - {G_RM_AA_XLU_LINE2, "G_RM_AA_XLU_LINE2"}, - {G_RM_AA_ZB_XLU_LINE, "G_RM_AA_ZB_XLU_LINE"}, - {G_RM_AA_ZB_XLU_LINE2, "G_RM_AA_ZB_XLU_LINE2"}, - {G_RM_AA_DEC_LINE, "G_RM_AA_DEC_LINE"}, - {G_RM_AA_DEC_LINE2, "G_RM_AA_DEC_LINE2"}, - {G_RM_AA_ZB_DEC_LINE, "G_RM_AA_ZB_DEC_LINE"}, - {G_RM_AA_ZB_DEC_LINE2, "G_RM_AA_ZB_DEC_LINE2"}, - {G_RM_TEX_EDGE, "G_RM_TEX_EDGE"}, - {G_RM_TEX_EDGE2, "G_RM_TEX_EDGE2"}, - {G_RM_AA_TEX_EDGE, "G_RM_AA_TEX_EDGE"}, - {G_RM_AA_TEX_EDGE2, "G_RM_AA_TEX_EDGE2"}, - {G_RM_AA_ZB_TEX_EDGE, "G_RM_AA_ZB_TEX_EDGE"}, - {G_RM_AA_ZB_TEX_EDGE2, "G_RM_AA_ZB_TEX_EDGE2"}, - {G_RM_AA_ZB_TEX_INTER, "G_RM_AA_ZB_TEX_INTER"}, - {G_RM_AA_ZB_TEX_INTER2, "G_RM_AA_ZB_TEX_INTER2"}, - {G_RM_AA_SUB_SURF, "G_RM_AA_SUB_SURF"}, - {G_RM_AA_SUB_SURF2, "G_RM_AA_SUB_SURF2"}, - {G_RM_AA_ZB_SUB_SURF, "G_RM_AA_ZB_SUB_SURF"}, - {G_RM_AA_ZB_SUB_SURF2, "G_RM_AA_ZB_SUB_SURF2"}, - {G_RM_PCL_SURF, "G_RM_PCL_SURF"}, - {G_RM_PCL_SURF2, "G_RM_PCL_SURF2"}, - {G_RM_AA_PCL_SURF, "G_RM_AA_PCL_SURF"}, - {G_RM_AA_PCL_SURF2, "G_RM_AA_PCL_SURF2"}, - {G_RM_ZB_PCL_SURF, "G_RM_ZB_PCL_SURF"}, - {G_RM_ZB_PCL_SURF2, "G_RM_ZB_PCL_SURF2"}, - {G_RM_AA_ZB_PCL_SURF, "G_RM_AA_ZB_PCL_SURF"}, - {G_RM_AA_ZB_PCL_SURF2, "G_RM_AA_ZB_PCL_SURF2"}, - {G_RM_AA_OPA_TERR, "G_RM_AA_OPA_TERR"}, - {G_RM_AA_OPA_TERR2, "G_RM_AA_OPA_TERR2"}, - {G_RM_AA_ZB_OPA_TERR, "G_RM_AA_ZB_OPA_TERR"}, - {G_RM_AA_ZB_OPA_TERR2, "G_RM_AA_ZB_OPA_TERR2"}, - {G_RM_AA_TEX_TERR, "G_RM_AA_TEX_TERR"}, - {G_RM_AA_TEX_TERR2, "G_RM_AA_TEX_TERR2"}, - {G_RM_AA_ZB_TEX_TERR, "G_RM_AA_ZB_TEX_TERR"}, - {G_RM_AA_ZB_TEX_TERR2, "G_RM_AA_ZB_TEX_TERR2"}, - {G_RM_AA_SUB_TERR, "G_RM_AA_SUB_TERR"}, - {G_RM_AA_SUB_TERR2, "G_RM_AA_SUB_TERR2"}, - {G_RM_AA_ZB_SUB_TERR, "G_RM_AA_ZB_SUB_TERR"}, - {G_RM_AA_ZB_SUB_TERR2, "G_RM_AA_ZB_SUB_TERR2"}, - {G_RM_CLD_SURF, "G_RM_CLD_SURF"}, - {G_RM_CLD_SURF2, "G_RM_CLD_SURF2"}, - {G_RM_ZB_CLD_SURF, "G_RM_ZB_CLD_SURF"}, - {G_RM_ZB_CLD_SURF2, "G_RM_ZB_CLD_SURF2"}, - {G_RM_ZB_OVL_SURF, "G_RM_ZB_OVL_SURF"}, - {G_RM_ZB_OVL_SURF2, "G_RM_ZB_OVL_SURF2"}, - {G_RM_ADD, "G_RM_ADD"}, - {G_RM_ADD2, "G_RM_ADD2"}, - {G_RM_VISCVG, "G_RM_VISCVG"}, - {G_RM_VISCVG2, "G_RM_VISCVG2"}, - {G_RM_OPA_CI, "G_RM_OPA_CI"}, - {G_RM_OPA_CI2, "G_RM_OPA_CI2"}, - {G_RM_RA_SPRITE, "G_RM_RA_SPRITE"}, - {G_RM_RA_SPRITE2, "G_RM_RA_SPRITE2"}, -}; - -static const struct rm_preset bl1_presets[] = -{ - {G_RM_FOG_SHADE_A, "G_RM_FOG_SHADE_A"}, - {G_RM_FOG_PRIM_A, "G_RM_FOG_PRIM_A"}, - {G_RM_PASS, "G_RM_PASS"}, - {G_RM_NOOP, "G_RM_NOOP"}, -}; - -static const struct rm_preset bl2_presets[] = -{ - {G_RM_NOOP2, "G_RM_NOOP2"}, -}; - -UCFUNC int othermodelo_str(uint32_t arg, uint32_t which) -{ - int n = 0; - uint32_t rm_c1_mask = MDMASK_RM_C1; - uint32_t rm_c2_mask = MDMASK_RM_C2; - uint32_t rm_mode_lo = MDMASK_RM_LO; - uint32_t rm_mask = rm_c1_mask | rm_c2_mask | rm_mode_lo; - const struct rm_preset *pre_c1 = NULL; - const struct rm_preset *pre_c2 = NULL; - int n_rm_presets = sizeof(rm_presets) / sizeof(*rm_presets); - for (int i = 0; i < n_rm_presets; i++) - { - const struct rm_preset *pre = &rm_presets[i]; - uint32_t pre_extra = pre->rm & ~rm_mask; - uint32_t rm_c1 = arg & (rm_c1_mask | rm_mode_lo | pre_extra); - if (!pre_c1 && rm_c1 == pre->rm) - pre_c1 = pre; - uint32_t rm_c2 = arg & (rm_c2_mask | rm_mode_lo | pre_extra); - if (!pre_c2 && rm_c2 == pre->rm) - pre_c2 = pre; - } - if (!pre_c1 || !pre_c2 || pre_c1 + 1 != pre_c2) - { - int n_bl1_presets = sizeof(bl1_presets) / sizeof(*bl1_presets); - for (int i = 0; i < n_bl1_presets; i++) - { - const struct rm_preset *pre = &bl1_presets[i]; - uint32_t pre_extra = pre->rm & ~rm_mask; - uint32_t rm_c1 = arg & (rm_c1_mask | pre_extra); - if (rm_c1 == pre->rm) - { - pre_c1 = pre; - break; - } - } - int n_bl2_presets = sizeof(bl2_presets) / sizeof(*bl2_presets); - for (int i = 0; i < n_bl2_presets; i++) - { - const struct rm_preset *pre = &bl2_presets[i]; - uint32_t pre_extra = pre->rm & ~rm_mask; - uint32_t rm_c2 = arg & (rm_c2_mask | pre_extra); - if (rm_c2 == pre->rm) - { - pre_c2 = pre; - break; - } - } - } - uint32_t pre_rm = 0; - if (pre_c1) - pre_rm |= pre_c1->rm; - if (pre_c2) - pre_rm |= pre_c2->rm; - uint32_t ac_mask = MDMASK(ALPHACOMPARE); - if (((arg & ~pre_rm) | which) & ac_mask) - { - uint32_t ac = arg & ac_mask; - switch (ac) - { - case G_AC_NONE: - n += gfxd_puts("G_AC_NONE"); - break; - case G_AC_THRESHOLD: - n += gfxd_puts("G_AC_THRESHOLD"); - break; - case G_AC_DITHER: - n += gfxd_puts("G_AC_DITHER"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, ac); - break; - } - } - uint32_t zs_mask = MDMASK(ZSRCSEL); - if (((arg & ~pre_rm) | which) & zs_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t zs = arg & zs_mask; - switch (zs) - { - case G_ZS_PIXEL: - n += gfxd_puts("G_ZS_PIXEL"); - break; - case G_ZS_PRIM: - n += gfxd_puts("G_ZS_PRIM"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, zs); - break; - } - } - uint32_t rm = arg & (rm_mask | pre_rm); - if (((arg & ~pre_rm) | which) & rm_mode_lo) - { - if (n > 0) - n += gfxd_puts(" | "); - n += rm_mode_str(rm); - } - int c = 0; - if (which & rm_c1_mask) - c |= 1; - if (which & rm_c2_mask) - c |= 2; - if (c & 1 || (c == 0 && arg & rm_c1_mask)) - { - if (n > 0) - n += gfxd_puts(" | "); - if (pre_c1) - n += gfxd_printf("%s", pre_c1->name); - else - n += rm_cbl_str(rm, 1); - } - if (c & 2 || (c == 0 && arg & rm_c2_mask)) - { - if (n > 0) - n += gfxd_puts(" | "); - if (pre_c2) - n += gfxd_printf("%s", pre_c2->name); - else - n += rm_cbl_str(rm, 2); - } - uint32_t unk_mask = ~(rm_mask | ac_mask | zs_mask); - if (arg & unk_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t unk = arg & unk_mask; - n += gfxd_printf("0x%08" PRIX32, unk); - } - return n; -} - -UCFUNC int argfn_ac(const gfxd_value_t *v) -{ - return othermodelo_str(v->u, MDMASK(ALPHACOMPARE)); -} - -UCFUNC int argfn_zs(const gfxd_value_t *v) -{ - return othermodelo_str(v->u, MDMASK(ZSRCSEL)); -} - -UCFUNC int argfn_rm1(const gfxd_value_t *v) -{ - return othermodelo_str(v->u, MDMASK_RM_C1); -} - -UCFUNC int argfn_rm2(const gfxd_value_t *v) -{ - return othermodelo_str(v->u, MDMASK_RM_C2); -} - -UCFUNC int argfn_othermodelo(const gfxd_value_t *v) -{ - uint32_t mask = MDMASK(ALPHACOMPARE) | MDMASK(ZSRCSEL) | MDMASK_RM_C1 | - MDMASK_RM_C2; - return othermodelo_str(v->u, mask); -} - -UCFUNC int argfn_sfthi(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_MDSFT_ALPHADITHER: - return gfxd_puts("G_MDSFT_ALPHADITHER"); - case G_MDSFT_RGBDITHER: - return gfxd_puts("G_MDSFT_RGBDITHER"); - case G_MDSFT_COMBKEY: - return gfxd_puts("G_MDSFT_COMBKEY"); - case G_MDSFT_TEXTCONV: - return gfxd_puts("G_MDSFT_TEXTCONV"); - case G_MDSFT_TEXTFILT: - return gfxd_puts("G_MDSFT_TEXTFILT"); - case G_MDSFT_TEXTLUT: - return gfxd_puts("G_MDSFT_TEXTLUT"); - case G_MDSFT_TEXTLOD: - return gfxd_puts("G_MDSFT_TEXTLOD"); - case G_MDSFT_TEXTDETAIL: - return gfxd_puts("G_MDSFT_TEXTDETAIL"); - case G_MDSFT_TEXTPERSP: - return gfxd_puts("G_MDSFT_TEXTPERSP"); - case G_MDSFT_CYCLETYPE: - return gfxd_puts("G_MDSFT_CYCLETYPE"); - case G_MDSFT_PIPELINE: - return gfxd_puts("G_MDSFT_PIPELINE"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int othermodehi_str(uint32_t arg, uint32_t which) -{ - int n = 0; - uint32_t ad_mask = MDMASK(ALPHADITHER); - if ((arg | which) & ad_mask) - { - uint32_t ad = arg & ad_mask; - switch (ad) - { - case G_AD_PATTERN: - n += gfxd_puts("G_AD_PATTERN"); - break; - case G_AD_NOTPATTERN: - n += gfxd_puts("G_AD_NOTPATTERN"); - break; - case G_AD_NOISE: - n += gfxd_puts("G_AD_NOISE"); - break; - case G_AD_DISABLE: - n += gfxd_puts("G_AD_DISABLE"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, ad); - break; - } - } - uint32_t cd_mask = MDMASK(RGBDITHER); - if ((arg | which) & cd_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t cd = arg & cd_mask; - switch (cd) - { - case G_CD_MAGICSQ: - n += gfxd_puts("G_CD_MAGICSQ"); - break; - case G_CD_BAYER: - n += gfxd_puts("G_CD_BAYER"); - break; - case G_CD_NOISE: - n += gfxd_puts("G_CD_NOISE"); - break; - case G_CD_DISABLE: - n += gfxd_puts("G_CD_DISABLE"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, cd); - break; - } - } - uint32_t ck_mask = MDMASK(COMBKEY); - if ((arg | which) & ck_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t ck = arg & ck_mask; - switch (ck) - { - case G_CK_NONE: - n += gfxd_puts("G_CK_NONE"); - break; - case G_CK_KEY: - n += gfxd_puts("G_CK_KEY"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, ck); - break; - } - } - uint32_t tc_mask = MDMASK(TEXTCONV); - if ((arg | which) & tc_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t tc = arg & tc_mask; - switch (tc) - { - case G_TC_CONV: - n += gfxd_puts("G_TC_CONV"); - break; - case G_TC_FILTCONV: - n += gfxd_puts("G_TC_FILTCONV"); - break; - case G_TC_FILT: - n += gfxd_puts("G_TC_FILT"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, tc); - break; - } - } - uint32_t tf_mask = MDMASK(TEXTFILT); - if ((arg | which) & tf_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t tf = arg & tf_mask; - switch (tf) - { - case G_TF_POINT: - n += gfxd_puts("G_TF_POINT"); - break; - case G_TF_BILERP: - n += gfxd_puts("G_TF_BILERP"); - break; - case G_TF_AVERAGE: - n += gfxd_puts("G_TF_AVERAGE"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, tf); - break; - } - } - uint32_t tt_mask = MDMASK(TEXTLUT); - if ((arg | which) & tt_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t tt = arg & tt_mask; - switch (tt) - { - case G_TT_NONE: - n += gfxd_puts("G_TT_NONE"); - break; - case G_TT_RGBA16: - n += gfxd_puts("G_TT_RGBA16"); - break; - case G_TT_IA16: - n += gfxd_puts("G_TT_IA16"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, tt); - break; - } - } - uint32_t tl_mask = MDMASK(TEXTLOD); - if ((arg | which) & tl_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t tl = arg & tl_mask; - switch (tl) - { - case G_TL_TILE: - n += gfxd_puts("G_TL_TILE"); - break; - case G_TL_LOD: - n += gfxd_puts("G_TL_LOD"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, tl); - break; - } - } - uint32_t td_mask = MDMASK(TEXTDETAIL); - if ((arg | which) & td_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t td = arg & td_mask; - switch (td) - { - case G_TD_CLAMP: - n += gfxd_puts("G_TD_CLAMP"); - break; - case G_TD_SHARPEN: - n += gfxd_puts("G_TD_SHARPEN"); - break; - case G_TD_DETAIL: - n += gfxd_puts("G_TD_DETAIL"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, td); - break; - } - } - uint32_t tp_mask = MDMASK(TEXTPERSP); - if ((arg | which) & tp_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t tp = arg & tp_mask; - switch (tp) - { - case G_TP_NONE: - n += gfxd_puts("G_TP_NONE"); - break; - case G_TP_PERSP: - n += gfxd_puts("G_TP_PERSP"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, tp); - break; - } - } - uint32_t cyc_mask = MDMASK(CYCLETYPE); - if ((arg | which) & cyc_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t cyc = arg & cyc_mask; - switch (cyc) - { - case G_CYC_1CYCLE: - n += gfxd_puts("G_CYC_1CYCLE"); - break; - case G_CYC_2CYCLE: - n += gfxd_puts("G_CYC_2CYCLE"); - break; - case G_CYC_COPY: - n += gfxd_puts("G_CYC_COPY"); - break; - case G_CYC_FILL: - n += gfxd_puts("G_CYC_FILL"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, cyc); - break; - } - } - uint32_t pm_mask = MDMASK(PIPELINE); - if ((arg | which) & pm_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t pm = arg & pm_mask; - switch (pm) - { - case G_PM_NPRIMITIVE: - n += gfxd_puts("G_PM_NPRIMITIVE"); - break; - case G_PM_1PRIMITIVE: - n += gfxd_puts("G_PM_1PRIMITIVE"); - break; - default: - n += gfxd_printf("0x%08" PRIX32, pm); - break; - } - } - uint32_t unk_mask = ~(ad_mask | cd_mask | ck_mask | tc_mask | tf_mask | - tt_mask | tl_mask | td_mask | tp_mask | - cyc_mask | pm_mask); - if (arg & unk_mask) - { - if (n > 0) - n += gfxd_puts(" | "); - uint32_t unk = arg & unk_mask; - n += gfxd_printf("0x%08" PRIX32, unk); - } - return n; -} - -UCFUNC int argfn_ad(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(ALPHADITHER)); -} - -UCFUNC int argfn_cd(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(RGBDITHER)); -} - -UCFUNC int argfn_ck(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(COMBKEY)); -} - -UCFUNC int argfn_tc(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(TEXTCONV)); -} - -UCFUNC int argfn_tf(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(TEXTFILT)); -} - -UCFUNC int argfn_tt(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(TEXTLUT)); -} - -UCFUNC int argfn_tl(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(TEXTLOD)); -} - -UCFUNC int argfn_td(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(TEXTDETAIL)); -} - -UCFUNC int argfn_tp(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(TEXTPERSP)); -} - -UCFUNC int argfn_cyc(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(CYCLETYPE)); -} - -UCFUNC int argfn_pm(const gfxd_value_t *v) -{ - return othermodehi_str(v->u, MDMASK(PIPELINE)); -} - -UCFUNC int argfn_othermodehi(const gfxd_value_t *v) -{ - uint32_t mask = MDMASK(ALPHADITHER) | - MDMASK(RGBDITHER) | - MDMASK(COMBKEY) | - MDMASK(TEXTCONV) | - MDMASK(TEXTFILT) | - MDMASK(TEXTLUT) | - MDMASK(TEXTLOD) | - MDMASK(TEXTDETAIL) | - MDMASK(TEXTPERSP) | - MDMASK(CYCLETYPE) | - MDMASK(PIPELINE); - return othermodehi_str(v->u, mask); -} - -UCFUNC int argfn_cv(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_CV_K0: - return gfxd_puts("G_CV_K0"); - case G_CV_K1: - return gfxd_puts("G_CV_K1"); - case G_CV_K2: - return gfxd_puts("G_CV_K2"); - case G_CV_K3: - return gfxd_puts("G_CV_K3"); - case G_CV_K4: - return gfxd_puts("G_CV_K4"); - case G_CV_K5: - return gfxd_puts("G_CV_K5"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int argfn_ccmuxa(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_CCMUX_COMBINED: - return gfxd_puts("COMBINED"); - case G_CCMUX_TEXEL0: - return gfxd_puts("TEXEL0"); - case G_CCMUX_TEXEL1: - return gfxd_puts("TEXEL1"); - case G_CCMUX_PRIMITIVE: - return gfxd_puts("PRIMITIVE"); - case G_CCMUX_SHADE: - return gfxd_puts("SHADE"); - case G_CCMUX_ENVIRONMENT: - return gfxd_puts("ENVIRONMENT"); - case G_CCMUX_1: - return gfxd_puts("1"); - case G_CCMUX_NOISE: - return gfxd_puts("NOISE"); - default: - return gfxd_puts("0"); - } -} - -UCFUNC int argfn_ccmuxb(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_CCMUX_COMBINED: - return gfxd_puts("COMBINED"); - case G_CCMUX_TEXEL0: - return gfxd_puts("TEXEL0"); - case G_CCMUX_TEXEL1: - return gfxd_puts("TEXEL1"); - case G_CCMUX_PRIMITIVE: - return gfxd_puts("PRIMITIVE"); - case G_CCMUX_SHADE: - return gfxd_puts("SHADE"); - case G_CCMUX_ENVIRONMENT: - return gfxd_puts("ENVIRONMENT"); - case G_CCMUX_CENTER: - return gfxd_puts("CENTER"); - case G_CCMUX_K4: - return gfxd_puts("K4"); - default: - return gfxd_puts("0"); - } -} - -UCFUNC int argfn_ccmuxc(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_CCMUX_COMBINED: - return gfxd_puts("COMBINED"); - case G_CCMUX_TEXEL0: - return gfxd_puts("TEXEL0"); - case G_CCMUX_TEXEL1: - return gfxd_puts("TEXEL1"); - case G_CCMUX_PRIMITIVE: - return gfxd_puts("PRIMITIVE"); - case G_CCMUX_SHADE: - return gfxd_puts("SHADE"); - case G_CCMUX_ENVIRONMENT: - return gfxd_puts("ENVIRONMENT"); - case G_CCMUX_SCALE: - return gfxd_puts("SCALE"); - case G_CCMUX_COMBINED_ALPHA: - return gfxd_puts("COMBINED_ALPHA"); - case G_CCMUX_TEXEL0_ALPHA: - return gfxd_puts("TEXEL0_ALPHA"); - case G_CCMUX_TEXEL1_ALPHA: - return gfxd_puts("TEXEL1_ALPHA"); - case G_CCMUX_PRIMITIVE_ALPHA: - return gfxd_puts("PRIMITIVE_ALPHA"); - case G_CCMUX_SHADE_ALPHA: - return gfxd_puts("SHADE_ALPHA"); - case G_CCMUX_ENV_ALPHA: - return gfxd_puts("ENV_ALPHA"); - case G_CCMUX_LOD_FRACTION: - return gfxd_puts("LOD_FRACTION"); - case G_CCMUX_PRIM_LOD_FRAC: - return gfxd_puts("PRIM_LOD_FRAC"); - case G_CCMUX_K5: - return gfxd_puts("K5"); - default: - return gfxd_puts("0"); - } -} - -UCFUNC int argfn_ccmuxd(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_CCMUX_COMBINED: - return gfxd_puts("COMBINED"); - case G_CCMUX_TEXEL0: - return gfxd_puts("TEXEL0"); - case G_CCMUX_TEXEL1: - return gfxd_puts("TEXEL1"); - case G_CCMUX_PRIMITIVE: - return gfxd_puts("PRIMITIVE"); - case G_CCMUX_SHADE: - return gfxd_puts("SHADE"); - case G_CCMUX_ENVIRONMENT: - return gfxd_puts("ENVIRONMENT"); - case G_CCMUX_1: - return gfxd_puts("1"); - default: - return gfxd_puts("0"); - } -} - -UCFUNC int argfn_acmuxabd(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_ACMUX_COMBINED: - return gfxd_puts("COMBINED"); - case G_ACMUX_TEXEL0: - return gfxd_puts("TEXEL0"); - case G_ACMUX_TEXEL1: - return gfxd_puts("TEXEL1"); - case G_ACMUX_PRIMITIVE: - return gfxd_puts("PRIMITIVE"); - case G_ACMUX_SHADE: - return gfxd_puts("SHADE"); - case G_ACMUX_ENVIRONMENT: - return gfxd_puts("ENVIRONMENT"); - case G_ACMUX_1: - return gfxd_puts("1"); - default: - return gfxd_puts("0"); - } -} - -UCFUNC int argfn_acmuxc(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_ACMUX_LOD_FRACTION: - return gfxd_puts("LOD_FRACTION"); - case G_ACMUX_TEXEL0: - return gfxd_puts("TEXEL0"); - case G_ACMUX_TEXEL1: - return gfxd_puts("TEXEL1"); - case G_ACMUX_PRIMITIVE: - return gfxd_puts("PRIMITIVE"); - case G_ACMUX_SHADE: - return gfxd_puts("SHADE"); - case G_ACMUX_ENVIRONMENT: - return gfxd_puts("ENVIRONMENT"); - case G_ACMUX_PRIM_LOD_FRAC: - return gfxd_puts("PRIM_LOD_FRAC"); - default: - return gfxd_puts("0"); - } -} - -struct cc_mode -{ - int a; - int b; - int c; - int d; - int Aa; - int Ab; - int Ac; - int Ad; -}; - -struct cc_preset -{ - struct cc_mode mode; - const char * name; -}; - -#define CC_(a,b,c,d,Aa,Ab,Ac,Ad) \ - { \ - G_CCMUX_##a, G_CCMUX_##b, \ - G_CCMUX_##c, G_CCMUX_##d, \ - G_ACMUX_##Aa, G_ACMUX_##Ab, \ - G_ACMUX_##Ac, G_ACMUX_##Ad \ - } -#define CC(m) CC_(m) -static const struct cc_preset cc_presets[] = -{ - {CC(G_CC_MODULATEI), "G_CC_MODULATEI"}, - {CC(G_CC_MODULATEIA), "G_CC_MODULATEIA"}, - {CC(G_CC_MODULATEIDECALA), "G_CC_MODULATEIDECALA"}, - {CC(G_CC_MODULATERGB), "G_CC_MODULATERGB"}, - {CC(G_CC_MODULATERGBA), "G_CC_MODULATERGBA"}, - {CC(G_CC_MODULATERGBDECALA), "G_CC_MODULATERGBDECALA"}, - {CC(G_CC_MODULATEI_PRIM), "G_CC_MODULATEI_PRIM"}, - {CC(G_CC_MODULATEIA_PRIM), "G_CC_MODULATEIA_PRIM"}, - {CC(G_CC_MODULATEIDECALA_PRIM), "G_CC_MODULATEIDECALA_PRIM"}, - {CC(G_CC_MODULATERGB_PRIM), "G_CC_MODULATERGB_PRIM"}, - {CC(G_CC_MODULATERGBA_PRIM), "G_CC_MODULATERGBA_PRIM"}, - {CC(G_CC_MODULATERGBDECALA_PRIM), "G_CC_MODULATERGBDECALA_PRIM"}, - {CC(G_CC_DECALRGB), "G_CC_DECALRGB"}, - {CC(G_CC_DECALRGBA), "G_CC_DECALRGBA"}, - {CC(G_CC_BLENDI), "G_CC_BLENDI"}, - {CC(G_CC_BLENDIA), "G_CC_BLENDIA"}, - {CC(G_CC_BLENDIDECALA), "G_CC_BLENDIDECALA"}, - {CC(G_CC_BLENDRGBA), "G_CC_BLENDRGBA"}, - {CC(G_CC_BLENDRGBDECALA), "G_CC_BLENDRGBDECALA"}, - {CC(G_CC_REFLECTRGB), "G_CC_REFLECTRGB"}, - {CC(G_CC_REFLECTRGBDECALA), "G_CC_REFLECTRGBDECALA"}, - {CC(G_CC_HILITERGB), "G_CC_HILITERGB"}, - {CC(G_CC_HILITERGBA), "G_CC_HILITERGBA"}, - {CC(G_CC_HILITERGBDECALA), "G_CC_HILITERGBDECALA"}, - {CC(G_CC_1CYUV2RGB), "G_CC_1CYUV2RGB"}, - {CC(G_CC_PRIMITIVE), "G_CC_PRIMITIVE"}, - {CC(G_CC_SHADE), "G_CC_SHADE"}, - {CC(G_CC_ADDRGB), "G_CC_ADDRGB"}, - {CC(G_CC_ADDRGBDECALA), "G_CC_ADDRGBDECALA"}, - {CC(G_CC_SHADEDECALA), "G_CC_SHADEDECALA"}, - {CC(G_CC_BLENDPE), "G_CC_BLENDPE"}, - {CC(G_CC_BLENDPEDECALA), "G_CC_BLENDPEDECALA"}, - {CC(G_CC_TRILERP), "G_CC_TRILERP"}, - {CC(G_CC_TEMPLERP), "G_CC_TEMPLERP"}, - {CC(G_CC_INTERFERENCE), "G_CC_INTERFERENCE"}, - {CC(_G_CC_BLENDPE), "_G_CC_BLENDPE"}, - {CC(_G_CC_BLENDPEDECALA), "_G_CC_BLENDPEDECALA"}, - {CC(_G_CC_SPARSEST), "_G_CC_SPARSEST"}, - {CC(_G_CC_TWOCOLORTEX), "_G_CC_TWOCOLORTEX"}, - {CC(G_CC_MODULATEI2), "G_CC_MODULATEI2"}, - {CC(G_CC_MODULATEIA2), "G_CC_MODULATEIA2"}, - {CC(G_CC_MODULATERGB2), "G_CC_MODULATERGB2"}, - {CC(G_CC_MODULATERGBA2), "G_CC_MODULATERGBA2"}, - {CC(G_CC_MODULATEI_PRIM2), "G_CC_MODULATEI_PRIM2"}, - {CC(G_CC_MODULATEIA_PRIM2), "G_CC_MODULATEIA_PRIM2"}, - {CC(G_CC_MODULATERGB_PRIM2), "G_CC_MODULATERGB_PRIM2"}, - {CC(G_CC_MODULATERGBA_PRIM2), "G_CC_MODULATERGBA_PRIM2"}, - {CC(G_CC_DECALRGB2), "G_CC_DECALRGB2"}, - {CC(G_CC_BLENDI2), "G_CC_BLENDI2"}, - {CC(G_CC_BLENDIA2), "G_CC_BLENDIA2"}, - {CC(G_CC_HILITERGB2), "G_CC_HILITERGB2"}, - {CC(G_CC_HILITERGBA2), "G_CC_HILITERGBA2"}, - {CC(G_CC_HILITERGBDECALA2), "G_CC_HILITERGBDECALA2"}, - {CC(G_CC_HILITERGBPASSA2), "G_CC_HILITERGBPASSA2"}, - {CC(G_CC_CHROMA_KEY2), "G_CC_CHROMA_KEY2"}, - {CC(G_CC_YUV2RGB), "G_CC_YUV2RGB"}, - {CC(G_CC_PASS2), "G_CC_PASS2"}, -}; -#undef CC_ -#undef CC - -UCFUNC int argfn_ccpre(const gfxd_value_t *v) -{ - return gfxd_printf("%s", cc_presets[v->i].name); -} - -UCFUNC int argfn_sc(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_SC_NON_INTERLACE: - return gfxd_puts("G_SC_NON_INTERLACE"); - case G_SC_EVEN_INTERLACE: - return gfxd_puts("G_SC_EVEN_INTERLACE"); - case G_SC_ODD_INTERLACE: - return gfxd_puts("G_SC_ODD_INTERLACE"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int argfn_bz(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_BZ_PERSP: - return gfxd_puts("G_BZ_PERSP"); - default: - return gfxd_puts("G_BZ_ORTHO"); - } -} -#endif - -UCFUNC int argfn_dlf(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_DL_PUSH: - return gfxd_puts("G_DL_PUSH"); - case G_DL_NOPUSH: - return gfxd_puts("G_DL_NOPUSH"); - default: - return gfxd_printf("%" PRIi32, v->i);; - } -} - -UCFUNC int argfn_mp(const gfxd_value_t *v) -{ - int n = 0; - if (v->u & G_MTX_PUSH) - n += gfxd_puts("G_MTX_PUSH"); - else - n += gfxd_puts("G_MTX_NOPUSH"); - if (v->u & G_MTX_LOAD) - n += gfxd_puts(" | G_MTX_LOAD"); - else - n += gfxd_puts(" | G_MTX_MUL"); - if (v->u & G_MTX_PROJECTION) - n += gfxd_puts(" | G_MTX_PROJECTION"); - else - n += gfxd_puts(" | G_MTX_MODELVIEW"); - for (int i = 3; i < 8; i++) - if (v->u & (1 << i)) - n += gfxd_printf(" | 0x%02x", 1 << i); - return n; -} - -UCFUNC int argfn_ms(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_MTX_MODELVIEW: - return gfxd_puts("G_MTX_MODELVIEW"); - case G_MTX_PROJECTION: - return gfxd_puts("G_MTX_PROJECTION"); - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int argfn_mw(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_MW_MATRIX: - return gfxd_puts("G_MW_MATRIX"); - case G_MW_NUMLIGHT: - return gfxd_puts("G_MW_NUMLIGHT"); - case G_MW_CLIP: - return gfxd_puts("G_MW_CLIP"); - case G_MW_SEGMENT: - return gfxd_puts("G_MW_SEGMENT"); - case G_MW_FOG: - return gfxd_puts("G_MW_FOG"); - case G_MW_LIGHTCOL: - return gfxd_puts("G_MW_LIGHTCOL"); - case G_MW_PERSPNORM: - return gfxd_puts("G_MW_PERSPNORM"); -#if defined(F3D_GBI) || defined(F3DEX_GBI) - case G_MW_POINTS: - return gfxd_puts("G_MW_POINTS"); -#endif -#if defined(F3DEX_GBI_2) - case G_MW_FORCEMTX: - return gfxd_puts("G_MW_FORCEMTX"); -#endif - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int argfn_mwo_clip(const gfxd_value_t *v) -{ - switch (v->u) - { - case G_MWO_CLIP_RNX: - return gfxd_puts("G_MWO_CLIP_RNX"); - case G_MWO_CLIP_RNY: - return gfxd_puts("G_MWO_CLIP_RNY"); - case G_MWO_CLIP_RPX: - return gfxd_puts("G_MWO_CLIP_RPX"); - case G_MWO_CLIP_RPY: - return gfxd_puts("G_MWO_CLIP_RPY"); - default: - return gfxd_printf("0x%04" PRIX32, v->u); - } -} - -UCFUNC int argfn_mwo_lightcol(const gfxd_value_t *v) -{ - switch (v->u) - { - case G_MWO_aLIGHT_1: - return gfxd_puts("G_MWO_aLIGHT_1"); - case G_MWO_bLIGHT_1: - return gfxd_puts("G_MWO_bLIGHT_1"); - case G_MWO_aLIGHT_2: - return gfxd_puts("G_MWO_aLIGHT_2"); - case G_MWO_bLIGHT_2: - return gfxd_puts("G_MWO_bLIGHT_2"); - case G_MWO_aLIGHT_3: - return gfxd_puts("G_MWO_aLIGHT_3"); - case G_MWO_bLIGHT_3: - return gfxd_puts("G_MWO_bLIGHT_3"); - case G_MWO_aLIGHT_4: - return gfxd_puts("G_MWO_aLIGHT_4"); - case G_MWO_bLIGHT_4: - return gfxd_puts("G_MWO_bLIGHT_4"); - case G_MWO_aLIGHT_5: - return gfxd_puts("G_MWO_aLIGHT_5"); - case G_MWO_bLIGHT_5: - return gfxd_puts("G_MWO_bLIGHT_5"); - case G_MWO_aLIGHT_6: - return gfxd_puts("G_MWO_aLIGHT_6"); - case G_MWO_bLIGHT_6: - return gfxd_puts("G_MWO_bLIGHT_6"); - case G_MWO_aLIGHT_7: - return gfxd_puts("G_MWO_aLIGHT_7"); - case G_MWO_bLIGHT_7: - return gfxd_puts("G_MWO_bLIGHT_7"); - case G_MWO_aLIGHT_8: - return gfxd_puts("G_MWO_aLIGHT_8"); - case G_MWO_bLIGHT_8: - return gfxd_puts("G_MWO_bLIGHT_8"); - default: - return gfxd_printf("0x%04" PRIX32, v->u); - } -} - -UCFUNC int argfn_lightnum(const gfxd_value_t *v) -{ - return gfxd_printf("LIGHT_%" PRIi32, v->i); -} - -UCFUNC int argfn_lightsn(const gfxd_value_t *v) -{ - return gfxd_printf("*(Lightsn *)0x%08" PRIX32, v->u); -} - -UCFUNC int argfn_mwo_matrix(const gfxd_value_t *v) -{ - switch (v->u) - { - case G_MWO_MATRIX_XX_XY_I: - return gfxd_puts("G_MWO_MATRIX_XX_XY_I"); - case G_MWO_MATRIX_XZ_XW_I: - return gfxd_puts("G_MWO_MATRIX_XZ_XW_I"); - case G_MWO_MATRIX_YX_YY_I: - return gfxd_puts("G_MWO_MATRIX_YX_YY_I"); - case G_MWO_MATRIX_YZ_YW_I: - return gfxd_puts("G_MWO_MATRIX_YZ_YW_I"); - case G_MWO_MATRIX_ZX_ZY_I: - return gfxd_puts("G_MWO_MATRIX_ZX_ZY_I"); - case G_MWO_MATRIX_ZZ_ZW_I: - return gfxd_puts("G_MWO_MATRIX_ZZ_ZW_I"); - case G_MWO_MATRIX_WX_WY_I: - return gfxd_puts("G_MWO_MATRIX_WX_WY_I"); - case G_MWO_MATRIX_WZ_WW_I: - return gfxd_puts("G_MWO_MATRIX_WZ_WW_I"); - case G_MWO_MATRIX_XX_XY_F: - return gfxd_puts("G_MWO_MATRIX_XX_XY_F"); - case G_MWO_MATRIX_XZ_XW_F: - return gfxd_puts("G_MWO_MATRIX_XZ_XW_F"); - case G_MWO_MATRIX_YX_YY_F: - return gfxd_puts("G_MWO_MATRIX_YX_YY_F"); - case G_MWO_MATRIX_YZ_YW_F: - return gfxd_puts("G_MWO_MATRIX_YZ_YW_F"); - case G_MWO_MATRIX_ZX_ZY_F: - return gfxd_puts("G_MWO_MATRIX_ZX_ZY_F"); - case G_MWO_MATRIX_ZZ_ZW_F: - return gfxd_puts("G_MWO_MATRIX_ZZ_ZW_F"); - case G_MWO_MATRIX_WX_WY_F: - return gfxd_puts("G_MWO_MATRIX_WX_WY_F"); - case G_MWO_MATRIX_WZ_WW_F: - return gfxd_puts("G_MWO_MATRIX_WZ_WW_F"); - default: - return gfxd_printf("0x%04" PRIX32, v->u); - } -} - -UCFUNC int argfn_mwo_point(const gfxd_value_t *v) -{ - switch (v->u) - { - case G_MWO_POINT_RGBA: - return gfxd_puts("G_MWO_POINT_RGBA"); - case G_MWO_POINT_ST: - return gfxd_puts("G_MWO_POINT_ST"); - case G_MWO_POINT_XYSCREEN: - return gfxd_puts("G_MWO_POINT_XYSCREEN"); - case G_MWO_POINT_ZSCREEN: - return gfxd_puts("G_MWO_POINT_ZSCREEN"); - default: - return gfxd_printf("0x%04" PRIX32, v->u); - } -} - -UCFUNC int argfn_mv(const gfxd_value_t *v) -{ - switch (v->i) - { - case G_MV_VIEWPORT: - return gfxd_puts("G_MV_VIEWPORT"); -#if defined(F3D_GBI) || defined(F3DEX_GBI) - case G_MV_LOOKATY: - return gfxd_puts("G_MV_LOOKATY"); - case G_MV_LOOKATX: - return gfxd_puts("G_MV_LOOKATX"); - case G_MV_L0: - return gfxd_puts("G_MV_L0"); - case G_MV_L1: - return gfxd_puts("G_MV_L1"); - case G_MV_L2: - return gfxd_puts("G_MV_L2"); - case G_MV_L3: - return gfxd_puts("G_MV_L3"); - case G_MV_L4: - return gfxd_puts("G_MV_L4"); - case G_MV_L5: - return gfxd_puts("G_MV_L5"); - case G_MV_L6: - return gfxd_puts("G_MV_L6"); - case G_MV_L7: - return gfxd_puts("G_MV_L7"); - case G_MV_TXTATT: - return gfxd_puts("G_MV_TXTATT"); - case G_MV_MATRIX_2: - return gfxd_puts("G_MV_MATRIX_2"); - case G_MV_MATRIX_3: - return gfxd_puts("G_MV_MATRIX_3"); - case G_MV_MATRIX_4: - return gfxd_puts("G_MV_MATRIX_4"); - case G_MV_MATRIX_1: - return gfxd_puts("G_MV_MATRIX_1"); -#elif defined(F3DEX_GBI_2) - case G_MV_MMTX: - return gfxd_puts("G_MV_MMTX"); - case G_MV_PMTX: - return gfxd_puts("G_MV_PMTX"); - case G_MV_LIGHT: - return gfxd_puts("G_MV_LIGHT"); - case G_MV_POINT: - return gfxd_puts("G_MV_POINT"); - case G_MV_MATRIX: - return gfxd_puts("G_MV_MATRIX"); -#endif - default: - return gfxd_printf("%" PRIi32, v->i); - } -} - -UCFUNC int argfn_cr(const gfxd_value_t *v) -{ - switch (v->u) - { - case FRUSTRATIO_1: - return gfxd_puts("FRUSTRATIO_1"); - case FRUSTRATIO_2: - return gfxd_puts("FRUSTRATIO_2"); - case FRUSTRATIO_3: - return gfxd_puts("FRUSTRATIO_3"); - case FRUSTRATIO_4: - return gfxd_puts("FRUSTRATIO_4"); - case FRUSTRATIO_5: - return gfxd_puts("FRUSTRATIO_5"); - case FRUSTRATIO_6: - return gfxd_puts("FRUSTRATIO_6"); - default: - return gfxd_printf("%" PRIu32, v->u); - } -} diff --git a/tools/ZAPD/lib/libgfxd/uc_argtbl.c b/tools/ZAPD/lib/libgfxd/uc_argtbl.c deleted file mode 100644 index 22a0b65009..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_argtbl.c +++ /dev/null @@ -1,485 +0,0 @@ -static const gfxd_arg_type_t arg_tbl[] = -{ - [gfxd_Word] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Opcode] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_opc, - }, - [gfxd_Coordi] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_u, - }, - [gfxd_Coordq] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_qu102, - }, - [gfxd_Pal] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Tlut] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Timg] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Tmem] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x16, - }, - [gfxd_Tile] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_tile, - }, - [gfxd_Fmt] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_fmt, - }, - [gfxd_Siz] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_siz, - }, - [gfxd_Dim] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Cm] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_cm, - }, - [gfxd_Tm] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_tm, - }, - [gfxd_Ts] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_ts, - }, - [gfxd_Dxt] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_u, - }, - [gfxd_Tag] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Pm] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_pm, - }, - [gfxd_Colorpart] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_color, - }, - [gfxd_Color] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Lodfrac] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_qu08, - }, - [gfxd_Cimg] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Zimg] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Ac] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_ac, - }, - [gfxd_Ad] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_ad, - }, - [gfxd_Cd] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_cd, - }, - [gfxd_Ccpre] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_ccpre, - }, - [gfxd_Ccmuxa] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_ccmuxa, - }, - [gfxd_Ccmuxb] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_ccmuxb, - }, - [gfxd_Ccmuxc] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_ccmuxc, - }, - [gfxd_Ccmuxd] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_ccmuxd, - }, - [gfxd_Acmuxabd] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_acmuxabd, - }, - [gfxd_Acmuxc] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_acmuxc, - }, - [gfxd_Cv] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_cv, - }, - [gfxd_Tc] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_tc, - }, - [gfxd_Cyc] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_cyc, - }, - [gfxd_Zs] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_zs, - }, - [gfxd_Ck] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_ck, - }, - [gfxd_Keyscale] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_color, - }, - [gfxd_Keywidth] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_qs48, - }, - [gfxd_Zi] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Rm1] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_rm1, - }, - [gfxd_Rm2] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_rm2, - }, - [gfxd_Sc] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_sc, - }, - [gfxd_Td] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_td, - }, - [gfxd_Tf] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_tf, - }, - [gfxd_Tl] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_tl, - }, - [gfxd_Tt] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_tt, - }, - [gfxd_Tp] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_tp, - }, - [gfxd_Line] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Vtx] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Vtxflag] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Dl] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - [gfxd_Zraw] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_qs1616, - }, -#endif - [gfxd_Dlflag] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_dlf, - }, - [gfxd_Cr] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_cr, - }, - [gfxd_Num] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Fogz] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Fogp] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Mtxptr] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Gm] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_gm, - }, - [gfxd_Mwo_matrix] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_mwo_matrix, - }, - [gfxd_Linewd] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Uctext] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Ucdata] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Size] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x16, - }, - [gfxd_Lookatptr] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Mtxparam] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_mp, - }, - [gfxd_Mtxstack] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_ms, - }, - [gfxd_Mwo_point] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_mwo_point, - }, - [gfxd_Wscale] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_qu016, - }, - [gfxd_Seg] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x8, - }, - [gfxd_Segptr] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Lightsn] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_lightsn, - }, - [gfxd_Numlights] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, - [gfxd_Lightnum] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_lightnum, - }, - [gfxd_Lightptr] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Tcscale] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_qu016, - }, - [gfxd_Switch] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_switch, - }, - [gfxd_St] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_qs105, - }, - [gfxd_Stdelta] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_qs510, - }, - [gfxd_Vtxptr] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Vpptr] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Dram] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x32, - }, - [gfxd_Sftlo] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_sftlo, - }, - [gfxd_Othermodelo] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_othermodelo, - }, - [gfxd_Sfthi] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_sfthi, - }, - [gfxd_Othermodehi] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_othermodehi, - }, - [gfxd_Mw] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_mw, - }, - [gfxd_Mwo] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x16, - }, - [gfxd_Mwo_clip] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_mwo_clip, - }, - [gfxd_Mwo_lightcol] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_mwo_lightcol, - }, - [gfxd_Mv] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_mv, - }, - [gfxd_Mvo] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x16, - }, - [gfxd_Dmem] = - { - .fmt = gfxd_argfmt_u, - .fn = argfn_x16, - }, - [gfxd_Dmaflag] = - { - .fmt = gfxd_argfmt_i, - .fn = argfn_i, - }, -}; diff --git a/tools/ZAPD/lib/libgfxd/uc_f3d.c b/tools/ZAPD/lib/libgfxd/uc_f3d.c deleted file mode 100644 index 9465515108..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_f3d.c +++ /dev/null @@ -1,4 +0,0 @@ -#define uc_name gfxd_f3d -#define F3D_GBI - -#include "uc.c" diff --git a/tools/ZAPD/lib/libgfxd/uc_f3db.c b/tools/ZAPD/lib/libgfxd/uc_f3db.c deleted file mode 100644 index cd4990412d..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_f3db.c +++ /dev/null @@ -1,5 +0,0 @@ -#define uc_name gfxd_f3db -#define F3D_GBI -#define F3D_BETA - -#include "uc.c" diff --git a/tools/ZAPD/lib/libgfxd/uc_f3dex.c b/tools/ZAPD/lib/libgfxd/uc_f3dex.c deleted file mode 100644 index 2ec70d8aba..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_f3dex.c +++ /dev/null @@ -1,4 +0,0 @@ -#define uc_name gfxd_f3dex -#define F3DEX_GBI - -#include "uc.c" diff --git a/tools/ZAPD/lib/libgfxd/uc_f3dex2.c b/tools/ZAPD/lib/libgfxd/uc_f3dex2.c deleted file mode 100644 index 9a19c99038..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_f3dex2.c +++ /dev/null @@ -1,4 +0,0 @@ -#define uc_name gfxd_f3dex2 -#define F3DEX_GBI_2 - -#include "uc.c" diff --git a/tools/ZAPD/lib/libgfxd/uc_f3dexb.c b/tools/ZAPD/lib/libgfxd/uc_f3dexb.c deleted file mode 100644 index 2b5c30a4a6..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_f3dexb.c +++ /dev/null @@ -1,5 +0,0 @@ -#define uc_name gfxd_f3dexb -#define F3DEX_GBI -#define F3D_BETA - -#include "uc.c" diff --git a/tools/ZAPD/lib/libgfxd/uc_macrofn.c b/tools/ZAPD/lib/libgfxd/uc_macrofn.c deleted file mode 100644 index 46d4b4ee8c..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_macrofn.c +++ /dev/null @@ -1,2507 +0,0 @@ -static inline uint32_t getfield(uint32_t w, int n, int s) -{ - return (w >> s) & (((uint32_t)1 << n) - 1); -} - -static inline int32_t argvi(gfxd_macro_t *m, int idx) -{ - return m->arg[idx].value.i; -} - -static inline uint32_t argvu(gfxd_macro_t *m, int idx) -{ - return m->arg[idx].value.u; -} - -static inline float argvf(gfxd_macro_t *m, int idx) -{ - return m->arg[idx].value.f; -} - -static inline void argi(gfxd_macro_t *m, int idx, const char *name, - int32_t value, int type) -{ - m->arg[idx].type = type; - m->arg[idx].name = name; - m->arg[idx].value.i = value; - m->arg[idx].bad = 0; -} - -static inline void argu(gfxd_macro_t *m, int idx, const char *name, - uint32_t value, int type) -{ - m->arg[idx].type = type; - m->arg[idx].name = name; - m->arg[idx].value.u = value; - m->arg[idx].bad = 0; -} - -static inline void argf(gfxd_macro_t *m, int idx, const char *name, - float value, int type) -{ - m->arg[idx].type = type; - m->arg[idx].name = name; - m->arg[idx].value.f = value; - m->arg[idx].bad = 0; -} - -static inline void badarg(gfxd_macro_t *m, int idx) -{ - m->arg[idx].bad = 1; -} - -UCFUNC int32_t sx(uint32_t n, int bits) -{ - int32_t smin = (int32_t)1 << (bits - 1); - int32_t smax = (int32_t)1 << bits; - int32_t i = n; - if (i < smin) - return i; - else - return i - smax; -} - -UCFUNC int d_Invalid(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_Invalid; - argu(m, 0, "hi", hi, gfxd_Word); - argu(m, 1, "lo", lo, gfxd_Word); - return -1; -} - -UCFUNC int d_DPFillRectangle(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPFillRectangle; - argu(m, 0, "ulx", getfield(lo, 10, 14), gfxd_Coordi); - argu(m, 1, "uly", getfield(lo, 10, 2), gfxd_Coordi); - argu(m, 2, "lrx", getfield(hi, 10, 14), gfxd_Coordi); - argu(m, 3, "lry", getfield(hi, 10, 2), gfxd_Coordi); - return 0; -} - -UCFUNC int d_DPFullSync(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPFullSync; - return 0; -} - -UCFUNC int d_DPLoadSync(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPLoadSync; - return 0; -} - -UCFUNC int d_DPTileSync(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPTileSync; - return 0; -} - -UCFUNC int d_DPPipeSync(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPPipeSync; - return 0; -} - -UCFUNC int c_DPLoadTLUT_pal16(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 6) - return -1; - if (m[0].id != gfxd_DPSetTextureImage - || argvi(&m[0], 0) != G_IM_FMT_RGBA - || argvi(&m[0], 1) != G_IM_SIZ_16b - || argvi(&m[0], 2) != 1) - { - return -1; - } - uint32_t dram = argvu(&m[0], 3); - if (m[1].id != gfxd_DPTileSync) - return -1; - if (m[2].id != gfxd_DPSetTile - || argvi(&m[2], 0) != 0 - || argvi(&m[2], 1) != 0 - || argvi(&m[2], 2) != 0 - || argvu(&m[2], 3) < 0x100 - || argvu(&m[2], 3) % 0x10 != 0 - || argvi(&m[2], 4) != G_TX_LOADTILE - || argvi(&m[2], 5) != 0 - || argvu(&m[2], 6) != 0 - || argvi(&m[2], 7) != 0 - || argvi(&m[2], 8) != 0 - || argvu(&m[2], 9) != 0 - || argvi(&m[2], 10) != 0 - || argvi(&m[2], 11) != 0) - { - return -1; - } - int pal = (argvu(&m[2], 3) - 0x100) / 0x10; - if (m[3].id != gfxd_DPLoadSync) - return -1; - if (m[4].id != gfxd_DPLoadTLUTCmd - || argvi(&m[4], 0) != G_TX_LOADTILE - || argvi(&m[4], 1) != 15) - { - return -1; - } - if (m[5].id != gfxd_DPPipeSync) - return -1; - m->id = gfxd_DPLoadTLUT_pal16; - argi(m, 0, "pal", pal, gfxd_Pal); - argu(m, 1, "dram", dram, gfxd_Tlut); - return 0; -} - -UCFUNC int c_DPLoadTLUT_pal256(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 6) - return -1; - if (m[0].id != gfxd_DPSetTextureImage - || argvi(&m[0], 0) != G_IM_FMT_RGBA - || argvi(&m[0], 1) != G_IM_SIZ_16b - || argvi(&m[0], 2) != 1) - { - return -1; - } - uint32_t dram = argvu(&m[0], 3); - if (m[1].id != gfxd_DPTileSync) - return -1; - if (m[2].id != gfxd_DPSetTile - || argvi(&m[2], 0) != 0 - || argvi(&m[2], 1) != 0 - || argvi(&m[2], 2) != 0 - || argvu(&m[2], 3) != 0x100 - || argvi(&m[2], 4) != G_TX_LOADTILE - || argvi(&m[2], 5) != 0 - || argvu(&m[2], 6) != 0 - || argvi(&m[2], 7) != 0 - || argvi(&m[2], 8) != 0 - || argvu(&m[2], 9) != 0 - || argvi(&m[2], 10) != 0 - || argvi(&m[2], 11) != 0) - { - return -1; - } - if (m[3].id != gfxd_DPLoadSync) - return -1; - if (m[4].id != gfxd_DPLoadTLUTCmd - || argvi(&m[4], 0) != G_TX_LOADTILE - || argvi(&m[4], 1) != 255) - { - return -1; - } - if (m[5].id != gfxd_DPPipeSync) - return -1; - m->id = gfxd_DPLoadTLUT_pal256; - argu(m, 0, "dram", dram, gfxd_Tlut); - return 0; -} - -UCFUNC int c_ltb(gfxd_macro_t *m, int n_macro, int id, int mdxt, int mtmem, - int mrt, int myuv, int m4b) -{ - if (n_macro < 7) - return -1; - if (m[0].id != gfxd_DPSetTextureImage || argvi(&m[0], 2) != 1) - return -1; - g_ifmt_t fmt = argvi(&m[0], 0); - g_isiz_t ldsiz = argvi(&m[0], 1); - uint32_t timg = argvu(&m[0], 3); - if (myuv && fmt != G_IM_FMT_YUV) - return -1; - if (m[1].id != gfxd_DPSetTile - || argvi(&m[1], 0) != fmt - || argvi(&m[1], 1) != ldsiz - || argvi(&m[1], 2) != 0 - || argvi(&m[1], 4) != G_TX_LOADTILE - || argvi(&m[1], 5) != 0) - { - return -1; - } - uint32_t tmem = argvu(&m[1], 3); - unsigned cms = argvu(&m[1], 9); - unsigned cmt = argvu(&m[1], 6); - int masks = argvi(&m[1], 10); - int maskt = argvi(&m[1], 7); - int shifts = argvi(&m[1], 11); - int shiftt = argvi(&m[1], 8); - if (m[2].id != gfxd_DPLoadSync) - return -1; - if (m[3].id != gfxd_DPLoadBlock - || argvi(&m[3], 0) != G_TX_LOADTILE - || argvu(&m[3], 1) != 0 - || argvu(&m[3], 2) != 0) - { - return -1; - } - qu102_t ldlrs = argvu(&m[3], 3); - unsigned lddxt = argvu(&m[3], 4); - if (m[4].id != gfxd_DPPipeSync) - return -1; - if (m[5].id != gfxd_DPSetTile - || argvi(&m[5], 0) != fmt - || G_SIZ_LDSIZ(argvi(&m[5], 1)) != ldsiz - || argvu(&m[5], 3) != tmem - || argvu(&m[5], 6) != cmt - || argvi(&m[5], 7) != maskt - || argvi(&m[5], 8) != shiftt - || argvu(&m[5], 9) != cms - || argvi(&m[5], 10) != masks - || argvi(&m[5], 11) != shifts) - { - return -1; - } - int siz = argvi(&m[5], 1); - int rdline = argvi(&m[5], 2); - int rt = argvi(&m[5], 4); - int pal = argvi(&m[5], 5); - if (m4b && siz != G_IM_SIZ_4b) - return -1; - if (!(mrt && rt != G_TX_RENDERTILE && tmem == 0) - && (tmem != 0) != mtmem) - { - return -1; - } - if ((rt != G_TX_RENDERTILE) != mrt) - return -1; - if (m[6].id != gfxd_DPSetTileSize - || argvi(&m[6], 0) != rt - || argvu(&m[6], 1) != 0 - || argvu(&m[6], 2) != 0 - || (argvu(&m[6], 3) & 3) - || (argvu(&m[6], 4) & 3)) - { - return -1; - } - int width = (argvu(&m[6], 3) >> 2) + 1; - int height = (argvu(&m[6], 4) >> 2) + 1; - unsigned lrs = G_LDBLK_TXL(G_LTB_LRS(width, height, siz)); - unsigned dxt = 0; - if (!mdxt) - dxt = G_DXT(siz, width); - int line; - if (myuv) - line = (width + 7) / 8; - else - line = (width * G_SIZ_LDBITS(siz) + 63) / 64; - if (ldlrs != lrs || lddxt != dxt || rdline != line) - return -1; - m->id = id; - int i = 0; - argu(m, i++, "timg", timg, gfxd_Timg); - if (mtmem) - argu(m, i++, "tmem", tmem, gfxd_Tmem); - if (mrt) - argi(m, i++, "rtile", rt, gfxd_Tile); - argi(m, i++, "fmt", fmt, gfxd_Fmt); - if (!m4b) - argi(m, i++, "siz", siz, gfxd_Siz); - argi(m, i++, "width", width, gfxd_Dim); - argi(m, i++, "height", height, gfxd_Dim); - argi(m, i++, "pal", pal, gfxd_Pal); - argu(m, i++, "cms", cms, gfxd_Cm); - argu(m, i++, "cmt", cmt, gfxd_Cm); - argi(m, i++, "masks", masks, gfxd_Tm); - argi(m, i++, "maskt", maskt, gfxd_Tm); - argi(m, i++, "shifts", shifts, gfxd_Ts); - argi(m, i++, "shiftt", shiftt, gfxd_Ts); - return 0; -} - -UCFUNC int c_DPLoadMultiBlockYuvS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadMultiBlockYuvS, 1, 1, 1, 1, 0); -} - -UCFUNC int c_DPLoadMultiBlockYuv(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadMultiBlockYuv, 0, 1, 1, 1, 0); -} - -UCFUNC int c_DPLoadMultiBlock_4bS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadMultiBlock_4bS, 1, 1, 1, 0, 1); -} - -UCFUNC int c_DPLoadMultiBlock_4b(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadMultiBlock_4b, 0, 1, 1, 0, 1); -} - -UCFUNC int c_DPLoadMultiBlockS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadMultiBlockS, 1, 1, 1, 0, 0); -} - -UCFUNC int c_DPLoadMultiBlock(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadMultiBlock, 0, 1, 1, 0, 0); -} - -UCFUNC int c__DPLoadTextureBlockYuvS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd__DPLoadTextureBlockYuvS, 1, 1, 0, 1, 0); -} - -UCFUNC int c__DPLoadTextureBlockYuv(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd__DPLoadTextureBlockYuv, 0, 1, 0, 1, 0); -} - -UCFUNC int c__DPLoadTextureBlock_4bS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd__DPLoadTextureBlock_4bS, 1, 1, 0, 0, 1); -} - -UCFUNC int c__DPLoadTextureBlock_4b(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd__DPLoadTextureBlock_4b, 0, 1, 0, 0, 1); -} - -UCFUNC int c__DPLoadTextureBlockS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd__DPLoadTextureBlockS, 1, 1, 0, 0, 0); -} - -UCFUNC int c__DPLoadTextureBlock(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd__DPLoadTextureBlock, 0, 1, 0, 0, 0); -} - -UCFUNC int c_DPLoadTextureBlockYuvS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadTextureBlockYuvS, 1, 0, 0, 1, 0); -} - -UCFUNC int c_DPLoadTextureBlockYuv(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadTextureBlockYuv, 0, 0, 0, 1, 0); -} - -UCFUNC int c_DPLoadTextureBlock_4bS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadTextureBlock_4bS, 1, 0, 0, 0, 1); -} - -UCFUNC int c_DPLoadTextureBlock_4b(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadTextureBlock_4b, 0, 0, 0, 0, 1); -} - -UCFUNC int c_DPLoadTextureBlockS(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadTextureBlockS, 1, 0, 0, 0, 0); -} - -UCFUNC int c_DPLoadTextureBlock(gfxd_macro_t *m, int n_macro) -{ - return c_ltb(m, n_macro, gfxd_DPLoadTextureBlock, 0, 0, 0, 0, 0); -} - -UCFUNC int c_ltt(gfxd_macro_t *m, int n_macro, int id, int mtmem, int mrt, - int myuv, int m4b) -{ - if (n_macro < 7) - return -1; - if (m[0].id != gfxd_DPSetTextureImage) - return -1; - g_ifmt_t fmt = argvi(&m[0], 0); - g_isiz_t ldsiz = argvi(&m[0], 1); - int width = argvi(&m[0], 2); - if (m4b) - { - if (ldsiz != G_IM_SIZ_8b) - return -1; - width *= 2; - } - uint32_t timg = argvu(&m[0], 3); - if (myuv && fmt != G_IM_FMT_YUV) - return -1; - if (m[1].id != gfxd_DPSetTile - || argvi(&m[1], 0) != fmt - || argvi(&m[1], 1) != ldsiz - || argvi(&m[1], 4) != G_TX_LOADTILE - || argvi(&m[1], 5) != 0) - { - return -1; - } - int ldline = argvi(&m[1], 2); - uint32_t tmem = argvu(&m[1], 3); - unsigned cms = argvu(&m[1], 9); - unsigned cmt = argvu(&m[1], 6); - int masks = argvi(&m[1], 10); - int maskt = argvi(&m[1], 7); - int shifts = argvi(&m[1], 11); - int shiftt = argvi(&m[1], 8); - if (m[2].id != gfxd_DPLoadSync) - return -1; - if (m[3].id != gfxd_DPLoadTile - || argvi(&m[3], 0) != G_TX_LOADTILE - || (argvu(&m[3], 1) & 1) - || (argvu(&m[3], 2) & 3) - || (argvu(&m[3], 3) & 1) - || (argvu(&m[3], 4) & 3)) - { - return -1; - } - qu102_t lduls = argvu(&m[3], 1); - qu102_t ldult = argvu(&m[3], 2); - qu102_t ldlrs = argvu(&m[3], 3); - qu102_t ldlrt = argvu(&m[3], 4); - if (m[4].id != gfxd_DPPipeSync) - return -1; - if (m[5].id != gfxd_DPSetTile - || argvi(&m[5], 0) != fmt - || argvi(&m[5], 2) != ldline - || argvu(&m[5], 3) != tmem - || argvu(&m[5], 6) != cmt - || argvi(&m[5], 7) != maskt - || argvi(&m[5], 8) != shiftt - || argvu(&m[5], 9) != cms - || argvi(&m[5], 10) != masks - || argvi(&m[5], 11) != shifts) - { - return -1; - } - int siz = argvi(&m[5], 1); - int rt = argvi(&m[5], 4); - int pal = argvi(&m[5], 5); - if (m4b) - { - if (siz != G_IM_SIZ_4b) - return -1; - } - else if (siz != ldsiz) - return -1; - if (!(mrt && rt != G_TX_RENDERTILE && tmem == 0) - && (tmem != 0) != mtmem) - { - return -1; - } - if ((rt != G_TX_RENDERTILE) != mrt) - return -1; - if (m[6].id != gfxd_DPSetTileSize - || argvi(&m[6], 0) != rt - || (argvu(&m[6], 1) & 3) - || (argvu(&m[6], 2) & 3) - || (argvu(&m[6], 3) & 3) - || (argvu(&m[6], 4) & 3)) - { - return -1; - } - unsigned uls = argvu(&m[6], 1) >> 2; - unsigned ult = argvu(&m[6], 2) >> 2; - unsigned lrs = argvu(&m[6], 3) >> 2; - unsigned lrt = argvu(&m[6], 4) >> 2; - int line; - if (myuv) - line = ((lrs - uls + 1) + 7) / 8; - else if (m4b) - line = ((lrs - uls + 1) / 2 + 7) / 8; - else - line = ((lrs - uls + 1) * G_SIZ_LDBITS(siz) + 63) / 64; - if (m4b) - { - if (lduls != qu102(uls) / 2 || ldlrs != qu102(lrs) / 2) - return -1; - } - else if (lduls != qu102(uls) || ldlrs != qu102(lrs)) - return -1; - if (ldult != qu102(ult) || ldlrt != qu102(lrt) || ldline != line) - return -1; - m->id = id; - int i = 0; - argu(m, i++, "timg", timg, gfxd_Timg); - if (mtmem) - argu(m, i++, "tmem", tmem, gfxd_Tmem); - if (mrt) - argi(m, i++, "rtile", rt, gfxd_Tile); - argi(m, i++, "fmt", fmt, gfxd_Fmt); - if (!m4b) - argi(m, i++, "siz", siz, gfxd_Siz); - argi(m, i++, "width", width, gfxd_Dim); - argi(m, i++, "height", 0, gfxd_Dim); - argu(m, i++, "uls", uls, gfxd_Coordi); - argu(m, i++, "ult", ult, gfxd_Coordi); - argu(m, i++, "lrs", lrs, gfxd_Coordi); - argu(m, i++, "lrt", lrt, gfxd_Coordi); - argi(m, i++, "pal", pal, gfxd_Pal); - argu(m, i++, "cms", cms, gfxd_Cm); - argu(m, i++, "cmt", cmt, gfxd_Cm); - argi(m, i++, "masks", masks, gfxd_Tm); - argi(m, i++, "maskt", maskt, gfxd_Tm); - argi(m, i++, "shifts", shifts, gfxd_Ts); - argi(m, i++, "shiftt", shiftt, gfxd_Ts); - return 0; -} - -UCFUNC int c_DPLoadMultiTileYuv(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd_DPLoadMultiTileYuv, 1, 1, 1, 0); -} - -UCFUNC int c_DPLoadMultiTile_4b(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd_DPLoadMultiTile_4b, 1, 1, 0, 1); -} - -UCFUNC int c_DPLoadMultiTile(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd_DPLoadMultiTile, 1, 1, 0, 0); -} - -UCFUNC int c__DPLoadTextureTileYuv(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd__DPLoadTextureTileYuv, 1, 0, 1, 0); -} - -UCFUNC int c__DPLoadTextureTile_4b(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd__DPLoadTextureTile_4b, 1, 0, 0, 1); -} - -UCFUNC int c__DPLoadTextureTile(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd__DPLoadTextureTile, 1, 0, 0, 0); -} - -UCFUNC int c_DPLoadTextureTileYuv(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd_DPLoadTextureTileYuv, 0, 0, 1, 0); -} - -UCFUNC int c_DPLoadTextureTile_4b(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd_DPLoadTextureTile_4b, 0, 0, 0, 1); -} - -UCFUNC int c_DPLoadTextureTile(gfxd_macro_t *m, int n_macro) -{ - return c_ltt(m, n_macro, gfxd_DPLoadTextureTile, 0, 0, 0, 0); -} - -UCFUNC int d_DPLoadBlock(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPLoadBlock; - argi(m, 0, "tile", getfield(lo, 3, 24), gfxd_Tile); - argu(m, 1, "uls", getfield(hi, 12, 12), gfxd_Coordi); - argu(m, 2, "ult", getfield(hi, 12, 0), gfxd_Coordi); - argu(m, 3, "lrs", getfield(lo, 12, 12), gfxd_Coordi); - argu(m, 4, "dxt", getfield(lo, 12, 0), gfxd_Dxt); - if (argvu(m, 3) > G_TX_LDBLK_MAX_TXL) { - badarg(m, 3); - return -1; - } - else { - return 0; - } -} - -UCFUNC int d_DPNoOp(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPNoOp; - return 0; -} - -UCFUNC int d_DPNoOpTag(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - if (lo == 0) - return d_DPNoOp(m, hi, lo); - else - { - m->id = gfxd_DPNoOpTag; - argu(m, 0, "tag", lo, gfxd_Tag); - return 0; - } -} - -UCFUNC int d_DPPipelineMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPPipelineMode; - argu(m, 0, "mode", lo, gfxd_Pm); - return 0; -} - -UCFUNC int d_DPSetBlendColor(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetBlendColor; - argu(m, 0, "r", getfield(lo, 8, 24), gfxd_Colorpart); - argu(m, 1, "g", getfield(lo, 8, 16), gfxd_Colorpart); - argu(m, 2, "b", getfield(lo, 8, 8), gfxd_Colorpart); - argu(m, 3, "a", getfield(lo, 8, 0), gfxd_Colorpart); - return 0; -} - -UCFUNC int d_DPSetEnvColor(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetEnvColor; - argu(m, 0, "r", getfield(lo, 8, 24), gfxd_Colorpart); - argu(m, 1, "g", getfield(lo, 8, 16), gfxd_Colorpart); - argu(m, 2, "b", getfield(lo, 8, 8), gfxd_Colorpart); - argu(m, 3, "a", getfield(lo, 8, 0), gfxd_Colorpart); - return 0; -} - -UCFUNC int d_DPSetFillColor(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetFillColor; - argu(m, 0, "c", lo, gfxd_Color); - return 0; -} - -UCFUNC int d_DPSetFogColor(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetFogColor; - argu(m, 0, "r", getfield(lo, 8, 24), gfxd_Colorpart); - argu(m, 1, "g", getfield(lo, 8, 16), gfxd_Colorpart); - argu(m, 2, "b", getfield(lo, 8, 8), gfxd_Colorpart); - argu(m, 3, "a", getfield(lo, 8, 0), gfxd_Colorpart); - return 0; -} - -UCFUNC int d_DPSetPrimColor(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetPrimColor; - argu(m, 0, "m", getfield(hi, 8, 8), gfxd_Lodfrac); - argu(m, 1, "l", getfield(hi, 8, 0), gfxd_Lodfrac); - argu(m, 2, "r", getfield(lo, 8, 24), gfxd_Colorpart); - argu(m, 3, "g", getfield(lo, 8, 16), gfxd_Colorpart); - argu(m, 4, "b", getfield(lo, 8, 8), gfxd_Colorpart); - argu(m, 5, "a", getfield(lo, 8, 0), gfxd_Colorpart); - return 0; -} - -UCFUNC int d_DPSetColorImage(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetColorImage; - argi(m, 0, "fmt", getfield(hi, 3, 21), gfxd_Fmt); - argi(m, 1, "siz", getfield(hi, 2, 19), gfxd_Siz); - argi(m, 2, "width", getfield(hi, 12, 0) + 1, gfxd_Dim); - argu(m, 3, "cimg", lo, gfxd_Cimg); - return 0; -} - -UCFUNC int d_DPSetDepthImage(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetDepthImage; - argu(m, 0, "zimg", lo, gfxd_Zimg); - return 0; -} - -UCFUNC int d_DPSetTextureImage(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTextureImage; - argi(m, 0, "fmt", getfield(hi, 3, 21), gfxd_Fmt); - argi(m, 1, "siz", getfield(hi, 2, 19), gfxd_Siz); - argi(m, 2, "width", getfield(hi, 12, 0) + 1, gfxd_Dim); - argu(m, 3, "timg", lo, gfxd_Timg); - return 0; -} - -UCFUNC int d_DPSetAlphaCompare(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetAlphaCompare; - argu(m, 0, "mode", lo, gfxd_Ac); - return 0; -} - -UCFUNC int d_DPSetAlphaDither(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetAlphaDither; - argu(m, 0, "mode", lo, gfxd_Ad); - return 0; -} - -UCFUNC int d_DPSetColorDither(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetColorDither; - argu(m, 0, "mode", lo, gfxd_Cd); - return 0; -} - -UCFUNC void cc_unpack(struct cc_mode *m0, struct cc_mode *m1, uint32_t hi, - uint32_t lo) -{ - m0->a = getfield(hi, 4, 20); - m0->b = getfield(lo, 4, 28); - m0->c = getfield(hi, 5, 15); - m0->d = getfield(lo, 3, 15); - m0->Aa = getfield(hi, 3, 12); - m0->Ab = getfield(lo, 3, 12); - m0->Ac = getfield(hi, 3, 9); - m0->Ad = getfield(lo, 3, 9); - m1->a = getfield(hi, 4, 5); - m1->b = getfield(lo, 4, 24); - m1->c = getfield(hi, 5, 0); - m1->d = getfield(lo, 3, 6); - m1->Aa = getfield(lo, 3, 21); - m1->Ab = getfield(lo, 3, 3); - m1->Ac = getfield(lo, 3, 18); - m1->Ad = getfield(lo, 3, 0); -} - -UCFUNC int cc_lookup(const struct cc_mode *m) -{ - struct cc_mode m_norm = *m; - if (m_norm.a > 0x7) m_norm.a = G_CCMUX_0; - if (m_norm.b > 0x7) m_norm.b = G_CCMUX_0; - if (m_norm.c > 0xF) m_norm.c = G_CCMUX_0; - if (m_norm.d > 0x6) m_norm.d = G_CCMUX_0; - m = &m_norm; - int n_presets = sizeof(cc_presets) / sizeof(*cc_presets); - for (int i = 0; i < n_presets; i++) - { - const struct cc_mode *p = &cc_presets[i].mode; - if (m->a == p->a - && m->b == p->b - && m->c == p->c - && m->d == p->d - && m->Aa == p->Aa - && m->Ab == p->Ab - && m->Ac == p->Ac - && m->Ad == p->Ad) - { - return i; - } - } - return -1; -} - -UCFUNC int d_DPSetCombineMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetCombineMode; - struct cc_mode m0; - struct cc_mode m1; - cc_unpack(&m0, &m1, hi, lo); - int p0 = cc_lookup(&m0); - int p1 = cc_lookup(&m1); - argi(m, 0, "mode1", p0, gfxd_Ccpre); - argi(m, 1, "mode2", p1, gfxd_Ccpre); - int ret = 0; - if (p0 == -1) - { - badarg(m, 0); - ret = -1; - } - if (p1 == -1) - { - badarg(m, 1); - ret = -1; - } - return ret; -} - -UCFUNC int d_DPSetCombineLERP(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - struct cc_mode m0; - struct cc_mode m1; - cc_unpack(&m0, &m1, hi, lo); - int p0 = cc_lookup(&m0); - int p1 = cc_lookup(&m1); - if (p0 != -1 && p1 != -1) - return d_DPSetCombineMode(m, hi, lo); - else - { - m->id = gfxd_DPSetCombineLERP; - argi(m, 0, "a0", m0.a, gfxd_Ccmuxa); - argi(m, 1, "b0", m0.b, gfxd_Ccmuxb); - argi(m, 2, "c0", m0.c, gfxd_Ccmuxc); - argi(m, 3, "d0", m0.d, gfxd_Ccmuxd); - argi(m, 4, "Aa0", m0.Aa, gfxd_Acmuxabd); - argi(m, 5, "Ab0", m0.Ab, gfxd_Acmuxabd); - argi(m, 6, "Ac0", m0.Ac, gfxd_Acmuxc); - argi(m, 7, "Ad0", m0.Ad, gfxd_Acmuxabd); - argi(m, 8, "a1", m1.a, gfxd_Ccmuxa); - argi(m, 9, "b1", m1.b, gfxd_Ccmuxb); - argi(m, 10, "c1", m1.c, gfxd_Ccmuxc); - argi(m, 11, "d1", m1.d, gfxd_Ccmuxd); - argi(m, 12, "Aa1", m1.Aa, gfxd_Acmuxabd); - argi(m, 13, "Ab1", m1.Ab, gfxd_Acmuxabd); - argi(m, 14, "Ac1", m1.Ac, gfxd_Acmuxc); - argi(m, 15, "Ad1", m1.Ad, gfxd_Acmuxabd); - return 0; - } -} - -UCFUNC int d_DPSetConvert(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetConvert; - argi(m, 0, "k0", sx(getfield(hi, 9, 13), 9), gfxd_Cv); - argi(m, 1, "k1", sx(getfield(hi, 9, 4), 9), gfxd_Cv); - argi(m, 2, "k2", sx((getfield(hi, 4, 0) << 5) | getfield(lo, 5, 27), 9), - gfxd_Cv); - argi(m, 3, "k3", sx(getfield(lo, 9, 18), 9), gfxd_Cv); - argi(m, 4, "k4", sx(getfield(lo, 9, 9), 9), gfxd_Cv); - argi(m, 5, "k5", sx(getfield(lo, 9, 0), 9), gfxd_Cv); - return 0; -} - -UCFUNC int d_DPSetTextureConvert(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTextureConvert; - argu(m, 0, "mode", lo, gfxd_Tc); - return 0; -} - -UCFUNC int d_DPSetCycleType(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetCycleType; - argu(m, 0, "mode", lo, gfxd_Cyc); - return 0; -} - -UCFUNC int d_DPSetDepthSource(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetDepthSource; - argu(m, 0, "mode", lo, gfxd_Zs); - return 0; -} - -UCFUNC int d_DPSetCombineKey(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetCombineKey; - argu(m, 0, "mode", lo, gfxd_Ck); - return 0; -} - -UCFUNC int d_DPSetKeyGB(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetKeyGB; - argu(m, 0, "cG", getfield(lo, 8, 24), gfxd_Color); - argu(m, 1, "sG", getfield(lo, 8, 16), gfxd_Keyscale); - argi(m, 2, "wG", sx(getfield(hi, 12, 12), 12), gfxd_Keywidth); - argu(m, 3, "cB", getfield(lo, 8, 8), gfxd_Color); - argu(m, 4, "sB", getfield(lo, 8, 0), gfxd_Keyscale); - argi(m, 5, "wB", sx(getfield(hi, 12, 0), 12), gfxd_Keywidth); - return 0; -} - -UCFUNC int d_DPSetKeyR(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetKeyR; - argu(m, 0, "cR", getfield(lo, 8, 8), gfxd_Color); - argu(m, 1, "sR", getfield(lo, 8, 0), gfxd_Keyscale); - argi(m, 2, "wR", sx(getfield(lo, 12, 16), 12), gfxd_Keywidth); - return 0; -} - -UCFUNC int d_DPSetPrimDepth(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetPrimDepth; - argi(m, 0, "z", sx(getfield(lo, 16, 16), 16), gfxd_Zi); - argi(m, 1, "dz", sx(getfield(lo, 16, 0), 16), gfxd_Zi); - return 0; -} - -UCFUNC int d_DPSetRenderMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetRenderMode; - argu(m, 0, "mode1", lo, gfxd_Rm1); - argu(m, 1, "mode2", lo, gfxd_Rm2); - return 0; -} - -UCFUNC int d_DPSetScissor(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetScissor; - argi(m, 0, "mode", getfield(lo, 2, 24), gfxd_Sc); - argu(m, 1, "ulx", getfield(hi, 10, 14), gfxd_Coordi); - argu(m, 2, "uly", getfield(hi, 10, 2), gfxd_Coordi); - argu(m, 3, "lrx", getfield(lo, 10, 14), gfxd_Coordi); - argu(m, 4, "lry", getfield(lo, 10, 2), gfxd_Coordi); - return 0; -} - -UCFUNC int d_DPSetScissorFrac(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - qu102_t ulx = getfield(hi, 12, 12); - qu102_t uly = getfield(hi, 12, 0); - qu102_t lrx = getfield(lo, 12, 12); - qu102_t lry = getfield(lo, 12, 0); - if ((ulx & 3) || (uly & 3) || (lrx & 3) || (lry & 3)) - { - m->id = gfxd_DPSetScissorFrac; - argi(m, 0, "mode", getfield(lo, 2, 24), gfxd_Sc); - argu(m, 1, "ulx", ulx, gfxd_Coordq); - argu(m, 2, "uly", uly, gfxd_Coordq); - argu(m, 3, "lrx", lrx, gfxd_Coordq); - argu(m, 4, "lry", lry, gfxd_Coordq); - return 0; - } - else - return d_DPSetScissor(m, hi, lo); -} - -UCFUNC int d_DPSetTextureDetail(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTextureDetail; - argu(m, 0, "mode", lo, gfxd_Td); - return 0; -} - -UCFUNC int d_DPSetTextureFilter(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTextureFilter; - argu(m, 0, "mode", lo, gfxd_Tf); - return 0; -} - -UCFUNC int d_DPSetTextureLOD(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTextureLOD; - argu(m, 0, "mode", lo, gfxd_Tl); - return 0; -} - -UCFUNC int d_DPSetTextureLUT(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTextureLUT; - argu(m, 0, "mode", lo, gfxd_Tt); - return 0; -} - -UCFUNC int d_DPSetTexturePersp(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTexturePersp; - argu(m, 0, "mode", lo, gfxd_Tp); - return 0; -} - -UCFUNC int d_DPSetTile(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTile; - argi(m, 0, "fmt", getfield(hi, 3, 21), gfxd_Fmt); - argi(m, 1, "siz", getfield(hi, 2, 19), gfxd_Siz); - argi(m, 2, "line", getfield(hi, 9, 9), gfxd_Line); - argu(m, 3, "tmem", getfield(hi, 9, 0), gfxd_Tmem); - argi(m, 4, "tile", getfield(lo, 3, 24), gfxd_Tile); - argi(m, 5, "pal", getfield(lo, 4, 20), gfxd_Pal); - argu(m, 6, "cmt", getfield(lo, 2, 18), gfxd_Cm); - argi(m, 7, "maskt", getfield(lo, 4, 14), gfxd_Tm); - argi(m, 8, "shiftt", getfield(lo, 4, 10), gfxd_Ts); - argu(m, 9, "cms", getfield(lo, 2, 8), gfxd_Cm); - argi(m, 10, "masks", getfield(lo, 4, 4), gfxd_Tm); - argi(m, 11, "shifts", getfield(lo, 4, 0), gfxd_Ts); - return 0; -} - -UCFUNC int d_DPSetTileSize(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetTileSize; - argi(m, 0, "tile", getfield(lo, 3, 24), gfxd_Tile); - argu(m, 1, "uls", getfield(hi, 12, 12), gfxd_Coordq); - argu(m, 2, "ult", getfield(hi, 12, 0), gfxd_Coordq); - argu(m, 3, "lrs", getfield(lo, 12, 12), gfxd_Coordq); - argu(m, 4, "lrt", getfield(lo, 12, 0), gfxd_Coordq); - return 0; -} - -#if defined(F3D_GBI) -UCFUNC int d_SP1Triangle(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SP1Triangle; - int n0 = getfield(lo, 8, 16); - int n1 = getfield(lo, 8, 8); - int n2 = getfield(lo, 8, 0); - argi(m, 0, "v0", n0 / 10, gfxd_Vtx); - argi(m, 1, "v1", n1 / 10, gfxd_Vtx); - argi(m, 2, "v2", n2 / 10, gfxd_Vtx); - argi(m, 3, "flag", getfield(lo, 8, 24), gfxd_Vtxflag); - int ret = 0; - if (n0 % 10 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 10 != 0) - { - badarg(m, 1); - ret = -1; - } - if (n2 % 10 != 0) - { - badarg(m, 2); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI) -UCFUNC int d_SP1Triangle(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SP1Triangle; - int n0 = getfield(lo, 8, 16); - int n1 = getfield(lo, 8, 8); - int n2 = getfield(lo, 8, 0); - argi(m, 0, "v0", n0 / 2, gfxd_Vtx); - argi(m, 1, "v1", n1 / 2, gfxd_Vtx); - argi(m, 2, "v2", n2 / 2, gfxd_Vtx); - argi(m, 3, "flag", 0, gfxd_Vtxflag); - int ret = 0; - if (n0 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - if (n2 % 2 != 0) - { - badarg(m, 2); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_SP1Triangle(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SP1Triangle; - int n0 = getfield(hi, 8, 16); - int n1 = getfield(hi, 8, 8); - int n2 = getfield(hi, 8, 0); - argi(m, 0, "v0", n0 / 2, gfxd_Vtx); - argi(m, 1, "v1", n1 / 2, gfxd_Vtx); - argi(m, 2, "v2", n2 / 2, gfxd_Vtx); - argi(m, 3, "flag", 0, gfxd_Vtxflag); - int ret = 0; - if (n0 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - if (n2 % 2 != 0) - { - badarg(m, 2); - ret = -1; - } - return ret; -} -#endif - -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int d_SP1Quadrangle(gfxd_macro_t *m, uint32_t hi, uint32_t lo); -UCFUNC int d_SP2Triangles(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int n00 = getfield(hi, 8, 16); - int n01 = getfield(hi, 8, 8); - int n02 = getfield(hi, 8, 0); - int n10 = getfield(lo, 8, 16); - int n11 = getfield(lo, 8, 8); - int n12 = getfield(lo, 8, 0); -#if defined(F3DEX_GBI) - if (n00 == n10 && n02 == n11) - return d_SP1Quadrangle(m, hi, lo); -#endif - m->id = gfxd_SP2Triangles; - argi(m, 0, "v00", n00 / 2, gfxd_Vtx); - argi(m, 1, "v01", n01 / 2, gfxd_Vtx); - argi(m, 2, "v02", n02 / 2, gfxd_Vtx); - argi(m, 3, "flag0", 0, gfxd_Vtxflag); - argi(m, 4, "v10", n10 / 2, gfxd_Vtx); - argi(m, 5, "v11", n11 / 2, gfxd_Vtx); - argi(m, 6, "v12", n12 / 2, gfxd_Vtx); - argi(m, 7, "flag1", 0, gfxd_Vtxflag); - int ret = 0; - if (n00 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n01 % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - if (n02 % 2 != 0) - { - badarg(m, 2); - ret = -1; - } - if (n10 % 2 != 0) - { - badarg(m, 4); - ret = -1; - } - if (n11 % 2 != 0) - { - badarg(m, 5); - ret = -1; - } - if (n12 % 2 != 0) - { - badarg(m, 6); - ret = -1; - } - return ret; -} - -UCFUNC int d_SP1Quadrangle(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SP1Quadrangle; - int n00 = getfield(hi, 8, 16); - int n01 = getfield(hi, 8, 8); - int n02 = getfield(hi, 8, 0); - int n10 = getfield(lo, 8, 16); - int n11 = getfield(lo, 8, 8); - int n12 = getfield(lo, 8, 0); - int v00 = n00 / 2; - int v01 = n01 / 2; - int v02 = n02 / 2; - int v10 = n10 / 2; - int v11 = n11 / 2; - int v12 = n12 / 2; - argi(m, 0, "v0", v00, gfxd_Vtx); - argi(m, 1, "v1", v01, gfxd_Vtx); - argi(m, 2, "v2", v11, gfxd_Vtx); - argi(m, 3, "v3", v12, gfxd_Vtx); - argi(m, 4, "flag", 0, gfxd_Vtxflag); - int ret = 0; - if (v00 != v10 || n00 % 2 != 0 || n10 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n01 % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - if (v02 != v11 || n02 % 2 != 0 || n11 % 2 != 0) - { - badarg(m, 2); - ret = -1; - } - if (n12 % 2 != 0) - { - badarg(m, 3); - ret = -1; - } - return ret; -} - -UCFUNC int c_SPBranchLessZraw(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_DPHalf1) - return -1; - uint32_t branchdl = argvu(&m[0], 0); - if (m[1].id != gfxd_BranchZ) - return -1; - int32_t vtx = argvi(&m[1], 0); - int32_t zval = argvi(&m[1], 1); - m->id = gfxd_SPBranchLessZraw; - argu(m, 0, "dl", branchdl, gfxd_Dl); - argi(m, 1, "vtx", vtx, gfxd_Vtx); - argi(m, 2, "zval", zval, gfxd_Zraw); - return 0; -} -#endif - -UCFUNC int d_SPBranchList(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPBranchList; - argu(m, 0, "dl", lo, gfxd_Dl); - return 0; -} - -UCFUNC int c_SPClipRatio(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 4) - return -1; - if (m[0].id != gfxd_MoveWd - || argvi(&m[0], 0) != G_MW_CLIP - || argvu(&m[0], 1) != G_MWO_CLIP_RNX) - { - return -1; - } - uint32_t r = argvu(&m[0], 2); - if (m[1].id != gfxd_MoveWd - || argvi(&m[1], 0) != G_MW_CLIP - || argvu(&m[1], 1) != G_MWO_CLIP_RNY - || argvu(&m[1], 2) != r) - { - return -1; - } - if (m[2].id != gfxd_MoveWd - || argvi(&m[2], 0) != G_MW_CLIP - || argvu(&m[2], 1) != G_MWO_CLIP_RPX - || ((uint32_t)1 << 16) - argvu(&m[2], 2) != r) - { - return -1; - } - if (m[3].id != gfxd_MoveWd - || argvi(&m[3], 0) != G_MW_CLIP - || argvu(&m[3], 1) != G_MWO_CLIP_RPY - || ((uint32_t)1 << 16) - argvu(&m[3], 2) != r) - { - return -1; - } - m->id = gfxd_SPClipRatio; - argi(m, 0, "r", r, gfxd_Cr); - return 0; -} - -#if defined(F3D_GBI) -UCFUNC int d_SPCullDisplayList(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPCullDisplayList; - int n0 = getfield(hi, 24, 0); - int nn = getfield(lo, 16, 0); - argi(m, 0, "v0", n0 / 40, gfxd_Vtx); - argi(m, 1, "vn", nn / 40 - 1, gfxd_Num); - int ret = 0; - if (n0 % 40 != 0) - { - badarg(m, 0); - ret = -1; - } - if (nn % 40 != 0) - { - badarg(m, 1); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int d_SPCullDisplayList(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPCullDisplayList; - int n0 = getfield(hi, 16, 0); - int nn = getfield(lo, 16, 0); - argi(m, 0, "v0", n0 / 2, gfxd_Vtx); - argi(m, 1, "vn", nn / 2, gfxd_Num); - int ret = 0; - if (n0 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (nn % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - return ret; -} -#endif - -UCFUNC int d_SPDisplayList(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPDisplayList; - argu(m, 0, "dl", lo, gfxd_Dl); - return 0; -} - -UCFUNC int d_SPEndDisplayList(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPEndDisplayList; - return 0; -} - -UCFUNC int d_SPFogFactor(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPFogFactor; - argi(m, 0, "fm", sx(getfield(lo, 16, 16), 16), gfxd_Fogz); - argi(m, 1, "fo", sx(getfield(lo, 16, 0), 16), gfxd_Fogz); - return 0; -} - -UCFUNC int d_SPFogPosition(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int x = sx(getfield(lo, 16, 16), 16); - int y = sx(getfield(lo, 16, 0), 16); - if (x == 0) - return d_SPFogFactor(m, hi, lo); - else - { - int d = 128000 / x; - int yd = y * d; - if (yd > 0) - yd += 255; - else if (yd < 0) - yd -= 255; - int min = 500 - yd / 256; - int max = d + min; - - if (min >= 0 && min <= 1000 && max >= 0 && max <= 1000) - { - m->id = gfxd_SPFogPosition; - argi(m, 0, "min", min, gfxd_Fogp); - argi(m, 1, "max", max, gfxd_Fogp); - return 0; - } - else - return d_SPFogFactor(m, hi, lo); - } -} - -#if defined(F3D_GBI) || defined(F3DEX_GBI) -UCFUNC int c_SPForceMatrix(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 4) - return -1; - for (int i = 0; i < 4; i++) - if (m[i].id != gfxd_MoveMem - || argvu(&m[i], 0) != 16 - || argvu(&m[i], 2) != argvu(&m[0], 2) + i * 16) - { - return -1; - } - if (argvi(&m[0], 1) != G_MV_MATRIX_1 - || argvi(&m[1], 1) != G_MV_MATRIX_2 - || argvi(&m[2], 1) != G_MV_MATRIX_3 - || argvi(&m[3], 1) != G_MV_MATRIX_4) - { - return -1; - } - uint32_t mptr = argvu(&m[0], 2); - m->id = gfxd_SPForceMatrix; - argu(m, 0, "mptr", mptr, gfxd_Mtxptr); - return 0; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int c_SPForceMatrix(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_MoveMem - || argvu(&m[0], 0) != sizeof(Mtx) - || argvi(&m[0], 1) != G_MV_MATRIX - || argvu(&m[0], 2) != 0) - { - return -1; - } - uint32_t mptr = argvu(&m[0], 3); - if (m[1].id != gfxd_MoveWd - || argvi(&m[1], 0) != G_MW_FORCEMTX - || argvu(&m[1], 1) != 0 - || argvu(&m[1], 2) != 0x10000) - { - return -1; - } - m->id = gfxd_SPForceMatrix; - argu(m, 0, "mptr", mptr, gfxd_Mtxptr); - return 0; -} -#endif - -UCFUNC int d_SPSetGeometryMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPSetGeometryMode; - argu(m, 0, "mode", lo, gfxd_Gm); - return 0; -} - -UCFUNC int d_SPClearGeometryMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPClearGeometryMode; -#if defined(F3D_GBI) || defined(F3DEX_GBI) - argu(m, 0, "mode", lo, gfxd_Gm); -#elif defined(F3DEX_GBI_2) - argu(m, 0, "mode", getfield(~hi, 24, 0), gfxd_Gm); -#endif - return 0; -} - -#if defined(F3D_GBI) || defined(F3DEX_GBI) -UCFUNC int c_SPLoadGeometryMode(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_SPClearGeometryMode - || argvu(&m[0], 0) != 0xFFFFFFFF - || m[1].id != gfxd_SPSetGeometryMode) - { - return -1; - } - uint32_t mode = argvu(&m[1], 0); - m->id = gfxd_SPLoadGeometryMode; - argu(m, 0, "mode", mode, gfxd_Gm); - return 0; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_SPLoadGeometryMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPLoadGeometryMode; - argu(m, 0, "mode", lo, gfxd_Gm); - return 0; -} -#endif - -#if defined(F3D_GBI) || defined(F3DEX_GBI) -UCFUNC int d_SPInsertMatrix(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPInsertMatrix; - argu(m, 0, "where", getfield(hi, 16, 8), gfxd_Mwo_matrix); - argu(m, 1, "val", lo, gfxd_Word); - return 0; -} -#endif - -#if defined(F3D_GBI) -UCFUNC int d_SPLine3D(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPLine3D; - int n0 = getfield(lo, 8, 16); - int n1 = getfield(lo, 8, 8); - argi(m, 0, "v0", n0 / 10, gfxd_Vtx); - argi(m, 1, "v1", n1 / 10, gfxd_Vtx); - argi(m, 2, "flag", getfield(lo, 8, 24), gfxd_Vtxflag); - int ret = 0; - if (n0 % 10 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 10 != 0) - { - badarg(m, 1); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI) -UCFUNC int d_SPLine3D(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPLine3D; - int n0 = getfield(lo, 8, 16); - int n1 = getfield(lo, 8, 8); - argi(m, 0, "v0", n0 / 2, gfxd_Vtx); - argi(m, 1, "v1", n1 / 2, gfxd_Vtx); - argi(m, 2, "flag", 0, gfxd_Vtxflag); - int ret = 0; - if (n0 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_SPLine3D(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPLine3D; - int n0 = getfield(hi, 8, 16); - int n1 = getfield(hi, 8, 8); - argi(m, 0, "v0", n0 / 2, gfxd_Vtx); - argi(m, 1, "v1", n1 / 2, gfxd_Vtx); - argi(m, 2, "flag", 0, gfxd_Vtxflag); - int ret = 0; - if (n0 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - return ret; -} -#endif - -#if defined(F3D_GBI) -UCFUNC int d_SPLineW3D(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int wd = getfield(lo, 8, 0); - if (wd == 0) - return d_SPLine3D(m, hi, lo); - else - { - m->id = gfxd_SPLineW3D; - int n0 = getfield(lo, 8, 16); - int n1 = getfield(lo, 8, 8); - argi(m, 0, "v0", n0 / 10, gfxd_Vtx); - argi(m, 1, "v1", n1 / 10, gfxd_Vtx); - argi(m, 2, "wd", wd, gfxd_Linewd); - argi(m, 3, "flag", getfield(lo, 8, 24), gfxd_Vtxflag); - int ret = 0; - if (n0 % 10 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 10 != 0) - { - badarg(m, 1); - ret = -1; - } - return ret; - } -} -#elif defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int d_SPLineW3D(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int wd = getfield(hi, 8, 0); - if (wd == 0) - return d_SPLine3D(m, hi, lo); - else - { - m->id = gfxd_SPLineW3D; - int n0 = getfield(hi, 8, 16); - int n1 = getfield(hi, 8, 8); - argi(m, 0, "v0", n0 / 2, gfxd_Vtx); - argi(m, 1, "v1", n1 / 2, gfxd_Vtx); - argi(m, 2, "wd", wd, gfxd_Linewd); - argi(m, 3, "flag", 0, gfxd_Vtxflag); - int ret = 0; - if (n0 % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - if (n1 % 2 != 0) - { - badarg(m, 1); - ret = -1; - } - return ret; - } -} -#endif - -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int c_SPLoadUcode(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_DPHalf1) - return -1; - uint32_t uc_dstart = argvu(&m[0], 0); - if (m[1].id != gfxd_LoadUcode) - return -1; - uint32_t uc_start = argvu(&m[1], 0); - uint32_t uc_dsize = argvu(&m[1], 1); - if (uc_dsize != 0x800) - return -1; - m->id = gfxd_SPLoadUcode; - argu(m, 0, "uc_start", uc_start, gfxd_Uctext); - argu(m, 1, "uc_dstart", uc_dstart, gfxd_Ucdata); - return 0; -} -#endif - -UCFUNC int d_SPLookAtX(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPLookAtX; - argu(m, 0, "l", lo, gfxd_Lookatptr); - return 0; -} - -UCFUNC int d_SPLookAtY(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPLookAtY; - argu(m, 0, "l", lo, gfxd_Lookatptr); - return 0; -} - -UCFUNC int c_SPLookAt(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_SPLookAtX) - return -1; - uint32_t l = argvu(&m[0], 0); - if (m[1].id != gfxd_SPLookAtY || argvu(&m[1], 0) != l + 0x10) - return -1; - m->id = gfxd_SPLookAt; - argu(m, 0, "l", l, gfxd_Lookatptr); - return 0; -} - -#if defined(F3D_GBI) || defined(F3DEX_GBI) -UCFUNC int d_SPMatrix(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPMatrix; - int x = getfield(hi, 16, 0); - argu(m, 0, "matrix", lo, gfxd_Mtxptr); - argi(m, 1, "param", getfield(hi, 8, 16), gfxd_Mtxparam); - if (x != sizeof(Mtx)) - return -1; - else - return 0; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_SPMatrix(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPMatrix; - int x = getfield(hi, 5, 19); - argu(m, 0, "matrix", lo, gfxd_Mtxptr); - argi(m, 1, "param", getfield(hi, 8, 0) ^ G_MTX_PUSH, gfxd_Mtxparam); - if (x != (sizeof(Mtx) - 1) / 8) - return -1; - else - return 0; -} -#endif - -#if defined(F3D_GBI) || (defined(F3D_BETA) && defined(F3DEX_GBI)) -UCFUNC int d_SPModifyVertex(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPModifyVertex; - int offset = getfield(hi, 16, 8); - argi(m, 0, "vtx", offset / 40, gfxd_Vtx); - argu(m, 1, "where", offset % 40, gfxd_Mwo_point); - argu(m, 2, "val", lo, gfxd_Word); - return 0; -} -#elif defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int d_SPModifyVertex(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPModifyVertex; - int vtx = getfield(hi, 16, 0); - argi(m, 0, "vtx", vtx / 2, gfxd_Vtx); - argu(m, 1, "where", getfield(hi, 8, 16), gfxd_Mwo_point); - argu(m, 2, "val", lo, gfxd_Word); - int ret = 0; - if (vtx % 2 != 0) - { - badarg(m, 0); - ret = -1; - } - return ret; -} -#endif - -UCFUNC int d_SPPerspNormalize(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPPerspNormalize; - argu(m, 0, "scale", getfield(lo, 16, 0), gfxd_Wscale); - return 0; -} - -UCFUNC int d_SPPopMatrix(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPPopMatrix; -#if defined(F3D_GBI) || defined(F3DEX_GBI) - argi(m, 0, "param", lo, gfxd_Mtxstack); -#elif defined(F3DEX_GBI_2) - argi(m, 0, "param", G_MTX_MODELVIEW, gfxd_Mtxstack); -#endif - return 0; -} - -#if defined(F3DEX_GBI_2) -UCFUNC int d_SPPopMatrixN(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int len = (getfield(hi, 5, 19) + 1) * 8; - int ofs = getfield(hi, 8, 8) * 8; - int idx = getfield(hi, 8, 0); - int n = lo / sizeof(Mtx); - if (lo % sizeof(Mtx) == 0 - && len == sizeof(Mtx) - && ofs == 0 - && idx == 2 - && n == 1) - { - return d_SPPopMatrix(m, hi, lo); - } - m->id = gfxd_SPPopMatrixN; - argi(m, 0, "param", G_MTX_MODELVIEW, gfxd_Mtxstack); - argi(m, 1, "num", n, gfxd_Num); - int ret = 0; - if (lo % sizeof(Mtx) != 0) - { - badarg(m, 1); - ret = -1; - } - if (len != sizeof(Mtx) || ofs != 0 || idx != 2) - ret = -1; - return ret; -} -#endif - -UCFUNC int d_SPSegment(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPSegment; -#if defined(F3D_GBI) || defined(F3DEX_GBI) - int offset = getfield(hi, 16, 8); -#elif defined(F3DEX_GBI_2) - int offset = getfield(hi, 16, 0); -#endif - argu(m, 0, "seg", offset / 4, gfxd_Seg); - argu(m, 1, "base", lo, gfxd_Segptr); - int ret = 0; - if (offset % 4 != 0) - { - badarg(m, 0); - ret = -1; - } - return ret; -} - -UCFUNC int c_SPSetLightsN(gfxd_macro_t *m, int n_macro, int id, int numlights) -{ - if (n_macro < 2 + numlights) - return -1; - if (m[0].id != gfxd_SPNumLights || argvi(&m[0], 0) != numlights) - return -1; - int a = 1 + numlights; - if (m[a].id != gfxd_SPLight || argvi(&m[a], 1) != a) - return -1; - uint32_t l = argvu(&m[a], 0); - for (int i = 1; i <= numlights; i++) - { - int offset = sizeof(Ambient) + sizeof(Light) * (i - 1); - if (m[i].id != gfxd_SPLight - || argvu(&m[i], 0) != l + offset - || argvi(&m[i], 1) != i) - { - return -1; - } - } - m->id = id; - argu(m, 0, "l", l, gfxd_Lightsn); - return 0; -} - -UCFUNC int c_SPSetLights1(gfxd_macro_t *m, int n_macro) -{ - return c_SPSetLightsN(m, n_macro, gfxd_SPSetLights1, NUMLIGHTS_1); -} - -UCFUNC int c_SPSetLights2(gfxd_macro_t *m, int n_macro) -{ - return c_SPSetLightsN(m, n_macro, gfxd_SPSetLights2, NUMLIGHTS_2); -} - -UCFUNC int c_SPSetLights3(gfxd_macro_t *m, int n_macro) -{ - return c_SPSetLightsN(m, n_macro, gfxd_SPSetLights3, NUMLIGHTS_3); -} - -UCFUNC int c_SPSetLights4(gfxd_macro_t *m, int n_macro) -{ - return c_SPSetLightsN(m, n_macro, gfxd_SPSetLights4, NUMLIGHTS_4); -} - -UCFUNC int c_SPSetLights5(gfxd_macro_t *m, int n_macro) -{ - return c_SPSetLightsN(m, n_macro, gfxd_SPSetLights5, NUMLIGHTS_5); -} - -UCFUNC int c_SPSetLights6(gfxd_macro_t *m, int n_macro) -{ - return c_SPSetLightsN(m, n_macro, gfxd_SPSetLights6, NUMLIGHTS_6); -} - -UCFUNC int c_SPSetLights7(gfxd_macro_t *m, int n_macro) -{ - return c_SPSetLightsN(m, n_macro, gfxd_SPSetLights7, NUMLIGHTS_7); -} - -#if defined(F3D_GBI) || defined(F3DEX_GBI) -UCFUNC int d_SPNumLights(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPNumLights; - argi(m, 0, "n", (lo - 0x80000000) / 32 - 1, gfxd_Numlights); - int ret = 0; - if (lo < 0x80000040 || lo % 32 != 0) - { - badarg(m, 0); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_SPNumLights(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPNumLights; - argi(m, 0, "n", lo / 24, gfxd_Numlights); - int ret = 0; - if (lo < 24 || lo % 24 != 0) - { - badarg(m, 0); - ret = -1; - } - return ret; -} -#endif - -#if defined(F3D_GBI) || defined(F3DEX_GBI) -UCFUNC int d_SPLight(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int n = (getfield(hi, 8, 16) - G_MV_L0) / 2 + 1; - m->id = gfxd_SPLight; - argu(m, 0, "l", lo, gfxd_Lightptr); - argi(m, 1, "n", n, gfxd_Num); - return 0; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_SPLight(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int n = (getfield(hi, 8, 8) * 8 / 24) - 1; - m->id = gfxd_SPLight; - argu(m, 0, "l", lo, gfxd_Lightptr); - argi(m, 1, "n", n, gfxd_Num); - return 0; -} -#endif - -UCFUNC int c_SPLightColor(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_MoveWd - || argvi(&m[0], 0) != G_MW_LIGHTCOL - || argvu(&m[0], 1) % 0x18 != 0 - || argvu(&m[0], 1) > G_MWO_aLIGHT_8) - { - return -1; - } - uint32_t offset = argvu(&m[0], 1); - uint32_t packedcolor = argvu(&m[0], 2); - if (m[1].id != gfxd_MoveWd - || argvi(&m[1], 0) != G_MW_LIGHTCOL - || argvu(&m[1], 1) != offset + 4 - || argvu(&m[1], 2) != packedcolor) - { - return -1; - } - m->id = gfxd_SPLightColor; - argi(m, 0, "n", offset / 0x18 + 1, gfxd_Lightnum); - argu(m, 1, "c", packedcolor, gfxd_Color); - return 0; -} - -UCFUNC int d_SPTexture(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPTexture; - argu(m, 0, "sc", getfield(lo, 16, 16), gfxd_Tcscale); - argu(m, 1, "tc", getfield(lo, 16, 0), gfxd_Tcscale); - argi(m, 2, "level", getfield(hi, 3, 11), gfxd_Num); - argi(m, 3, "tile", getfield(hi, 3, 8), gfxd_Tile); -#if defined(F3D_GBI) || defined(F3DEX_GBI) - argi(m, 4, "on", getfield(hi, 8, 0), gfxd_Switch); -#elif defined(F3DEX_GBI_2) - argi(m, 4, "on", getfield(hi, 7, 1), gfxd_Switch); -#endif - return 0; -} - -UCFUNC int c_SPTextureRectangle(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 3) - return -1; - if (m[0].id != gfxd_TexRect) - return -1; - qu102_t ulx = argvu(&m[0], 0); - qu102_t uly = argvu(&m[0], 1); - qu102_t lrx = argvu(&m[0], 2); - qu102_t lry = argvu(&m[0], 3); - int tile = argvi(&m[0], 4); - if (m[1].id != gfxd_DPHalf1) - return -1; - qs105_t s = sx(getfield(argvu(&m[1], 0), 16, 16), 16); - qs105_t t = sx(getfield(argvu(&m[1], 0), 16, 0), 16); - if (m[2].id != gfxd_DPHalf2) - return -1; - qs510_t dsdx = sx(getfield(argvu(&m[2], 0), 16, 16), 16); - qs510_t dtdy = sx(getfield(argvu(&m[2], 0), 16, 0), 16); - m->id = gfxd_SPTextureRectangle; - argu(m, 0, "ulx", ulx, gfxd_Coordq); - argu(m, 1, "uly", uly, gfxd_Coordq); - argu(m, 2, "lrx", lrx, gfxd_Coordq); - argu(m, 3, "lry", lry, gfxd_Coordq); - argi(m, 4, "tile", tile, gfxd_Tile); - argi(m, 5, "s", s, gfxd_St); - argi(m, 6, "t", t, gfxd_St); - argi(m, 7, "dsdx", dsdx, gfxd_Stdelta); - argi(m, 8, "dtdy", dtdy, gfxd_Stdelta); - return 0; -} - -UCFUNC int c_SPTextureRectangleFlip(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 3) - return -1; - if (m[0].id != gfxd_TexRectFlip) - return -1; - qu102_t ulx = argvu(&m[0], 0); - qu102_t uly = argvu(&m[0], 1); - qu102_t lrx = argvu(&m[0], 2); - qu102_t lry = argvu(&m[0], 3); - int tile = argvi(&m[0], 4); - if (m[1].id != gfxd_DPHalf1) - return -1; - qs105_t s = sx(getfield(argvu(&m[1], 0), 16, 16), 16); - qs105_t t = sx(getfield(argvu(&m[1], 0), 16, 0), 16); - if (m[2].id != gfxd_DPHalf2) - return -1; - qs510_t dsdx = sx(getfield(argvu(&m[2], 0), 16, 16), 16); - qs510_t dtdy = sx(getfield(argvu(&m[2], 0), 16, 0), 16); - m->id = gfxd_SPTextureRectangleFlip; - argu(m, 0, "ulx", ulx, gfxd_Coordq); - argu(m, 1, "uly", uly, gfxd_Coordq); - argu(m, 2, "lrx", lrx, gfxd_Coordq); - argu(m, 3, "lry", lry, gfxd_Coordq); - argi(m, 4, "tile", tile, gfxd_Tile); - argi(m, 5, "s", s, gfxd_St); - argi(m, 6, "t", t, gfxd_St); - argi(m, 7, "dsdx", dsdx, gfxd_Stdelta); - argi(m, 8, "dtdy", dtdy, gfxd_Stdelta); - return 0; -} - -#if defined(F3D_GBI) -UCFUNC int d_SPVertex(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPVertex; - int n = getfield(hi, 4, 20) + 1; - int v0 = getfield(hi, 4, 16); - int size = getfield(hi, 16, 0); - argu(m, 0, "v", lo, gfxd_Vtxptr); - argi(m, 1, "n", n, gfxd_Num); - argi(m, 2, "v0", v0, gfxd_Vtx); - int ret = 0; - if (size != sizeof(Vtx) * n) - { - badarg(m, 1); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI) -UCFUNC int d_SPVertex(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPVertex; - int n = getfield(hi, 6, 10); - int v0 = getfield(hi, 8, 16); - int size = getfield(hi, 10, 0); - argu(m, 0, "v", lo, gfxd_Vtxptr); - argi(m, 1, "n", n, gfxd_Num); - argi(m, 2, "v0", v0 / 2, gfxd_Vtx); - int ret = 0; - if (size != sizeof(Vtx) * n - 1) - { - badarg(m, 1); - ret = -1; - } - if (v0 % 2 != 0) - { - badarg(m, 2); - ret = -1; - } - return ret; -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_SPVertex(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPVertex; - int n = getfield(hi, 8, 12); - int v0 = getfield(hi, 7, 1) - n; - argu(m, 0, "v", lo, gfxd_Vtxptr); - argi(m, 1, "n", n, gfxd_Num); - argi(m, 2, "v0", v0, gfxd_Vtx); - return 0; -} -#endif - -UCFUNC int d_SPViewport(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPViewport; - argu(m, 0, "v", lo, gfxd_Vpptr); - return 0; -} - -UCFUNC int d_DPLoadTLUTCmd(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPLoadTLUTCmd; - argi(m, 0, "tile", getfield(lo, 3, 24), gfxd_Tile); - argi(m, 1, "count", getfield(lo, 10, 14), gfxd_Num); - return 0; -} - -UCFUNC int c_DPLoadTLUT(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 6) - return -1; - if (m[0].id != gfxd_DPSetTextureImage - || argvi(&m[0], 0) != G_IM_FMT_RGBA - || argvi(&m[0], 1) != G_IM_SIZ_16b - || argvi(&m[0], 2) != 1) - { - return -1; - } - uint32_t dram = argvu(&m[0], 3); - if (m[1].id != gfxd_DPTileSync) - return -1; - if (m[2].id != gfxd_DPSetTile - || argvi(&m[2], 0) != 0 - || argvi(&m[2], 1) != 0 - || argvi(&m[2], 2) != 0 - || argvi(&m[2], 4) != G_TX_LOADTILE - || argvi(&m[2], 5) != 0 - || argvu(&m[2], 6) != 0 - || argvi(&m[2], 7) != 0 - || argvi(&m[2], 8) != 0 - || argvu(&m[2], 9) != 0 - || argvi(&m[2], 10) != 0 - || argvi(&m[2], 11) != 0) - { - return -1; - } - uint32_t tmem = argvu(&m[2], 3); - if (m[3].id != gfxd_DPLoadSync) - return -1; - if (m[4].id != gfxd_DPLoadTLUTCmd || argvi(&m[4], 0) != G_TX_LOADTILE) - return -1; - int count = argvi(&m[4], 1) + 1; - if (m[5].id != gfxd_DPPipeSync) - return -1; - m->id = gfxd_DPLoadTLUT; - argi(m, 0, "count", count, gfxd_Num); - argu(m, 1, "tmem", tmem, gfxd_Tmem); - argu(m, 2, "dram", dram, gfxd_Tlut); - return 0; -} - -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int d_BranchZ(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_BranchZ; - int na = getfield(hi, 12, 12); - int nb = getfield(hi, 12, 0); - int32_t zval; - if (lo > 0x7FFFFFFF) - zval = INT32_MIN + (int32_t)(lo & 0x7FFFFFFF); - else - zval = lo; - argi(m, 0, "vtx", nb / 2, gfxd_Vtx); - argi(m, 1, "zval", zval, gfxd_Zraw); - int ret = 0; - if (nb % 2 != 0 || na / 5 != nb / 2 || na % 5 != 0) - { - badarg(m, 0); - ret = -1; - } - return ret; -} -#endif - -UCFUNC int d_DisplayList(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int flag = getfield(hi, 8, 16); - if (flag == 0) - return d_SPDisplayList(m, hi, lo); - else if (flag == 1) - return d_SPBranchList(m, hi, lo); - else - { - m->id = gfxd_DisplayList; - argu(m, 0, "dl", lo, gfxd_Dl); - argi(m, 1, "flag", flag, gfxd_Dlflag); - return 0; - } -} - -UCFUNC int d_DPHalf1(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPHalf1; - argu(m, 0, "hi", lo, gfxd_Word); - return 0; -} - -UCFUNC int d_DPHalf2(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPHalf2; - argu(m, 0, "lo", lo, gfxd_Word); - return 0; -} - -UCFUNC int c_DPWord(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_DPHalf1 || m[1].id != gfxd_DPHalf2) - return -1; - uint32_t wordhi = argvu(&m[0], 0); - uint32_t wordlo = argvu(&m[1], 0); - m->id = gfxd_DPWord; - argu(m, 0, "wordhi", wordhi, gfxd_Word); - argu(m, 1, "wordlo", wordlo, gfxd_Word); - return 0; -} - -UCFUNC int d_DPLoadTile(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPLoadTile; - argi(m, 0, "tile", getfield(lo, 3, 24), gfxd_Tile); - argu(m, 1, "uls", getfield(hi, 12, 12), gfxd_Coordq); - argu(m, 2, "ult", getfield(hi, 12, 0), gfxd_Coordq); - argu(m, 3, "lrs", getfield(lo, 12, 12), gfxd_Coordq); - argu(m, 4, "lrt", getfield(lo, 12, 0), gfxd_Coordq); - return 0; -} - -#if defined(F3DEX_GBI_2) -UCFUNC int d_SPGeometryMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - uint32_t clearbits = getfield(~hi, 24, 0); - uint32_t setbits = lo; - if (clearbits == 0 && setbits != 0) - return d_SPSetGeometryMode(m, hi, lo); - else if (clearbits != 0 && setbits == 0) - return d_SPClearGeometryMode(m, hi, lo); - else if (clearbits == 0x00FFFFFF) - return d_SPLoadGeometryMode(m, hi, lo); - else - { - m->id = gfxd_SPGeometryMode; - argu(m, 0, "c", clearbits, gfxd_Gm); - argu(m, 1, "s", setbits, gfxd_Gm); - return 0; - } -} -#endif - -UCFUNC int d_SPSetOtherMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPSetOtherMode; - int opc = getfield(hi, 8, 24); -#if defined(F3D_GBI) || defined(F3DEX_GBI) - int length = getfield(hi, 8, 0); - int shift = getfield(hi, 8, 8); -#elif defined(F3DEX_GBI_2) - int length = getfield(hi, 8, 0) + 1; - int shift = 32 - (getfield(hi, 8, 8) + length); -#endif - argi(m, 0, "opc", opc, gfxd_Opcode); - argi(m, 1, "sft", shift, gfxd_Sftlo); - argi(m, 2, "len", length, gfxd_Num); - if (opc == G_SETOTHERMODE_H) - argu(m, 3, "mode", lo, gfxd_Othermodehi); - else if (opc == G_SETOTHERMODE_L) - argu(m, 3, "mode", lo, gfxd_Othermodelo); - else - argu(m, 3, "mode", lo, gfxd_Word); - return 0; -} - -UCFUNC int d_SPSetOtherModeLo(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ -#if defined(F3D_GBI) || defined(F3DEX_GBI) - int length = getfield(hi, 8, 0); - int shift = getfield(hi, 8, 8); -#elif defined(F3DEX_GBI_2) - int length = getfield(hi, 8, 0) + 1; - int shift = 32 - (getfield(hi, 8, 8) + length); -#endif - if (shift == G_MDSFT_ALPHACOMPARE && length == G_MDSIZ_ALPHACOMPARE) - return d_DPSetAlphaCompare(m, hi, lo); - else if (shift == G_MDSFT_ZSRCSEL && length == G_MDSIZ_ZSRCSEL) - return d_DPSetDepthSource(m, hi, lo); - else if (shift == G_MDSFT_RENDERMODE && length == G_MDSIZ_RENDERMODE) - return d_DPSetRenderMode(m, hi, lo); - else if (config.emit_ext_macro) - { - m->id = gfxd_SPSetOtherModeLo; - argi(m, 0, "sft", shift, gfxd_Sftlo); - argi(m, 1, "len", length, gfxd_Num); - argu(m, 2, "mode", lo, gfxd_Othermodelo); - return 0; - } - else - return d_SPSetOtherMode(m, hi, lo); -} - -UCFUNC int d_SPSetOtherModeHi(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ -#if defined(F3D_GBI) || defined(F3DEX_GBI) - int length = getfield(hi, 8, 0); - int shift = getfield(hi, 8, 8); -#elif defined(F3DEX_GBI_2) - int length = getfield(hi, 8, 0) + 1; - int shift = 32 - (getfield(hi, 8, 8) + length); -#endif - if (shift == G_MDSFT_ALPHADITHER && length == G_MDSIZ_ALPHADITHER) - return d_DPSetAlphaDither(m, hi, lo); - else if (shift == G_MDSFT_RGBDITHER && length == G_MDSIZ_RGBDITHER) - return d_DPSetColorDither(m, hi, lo); - else if (shift == G_MDSFT_COMBKEY && length == G_MDSIZ_COMBKEY) - return d_DPSetCombineKey(m, hi, lo); - else if (shift == G_MDSFT_TEXTCONV && length == G_MDSIZ_TEXTCONV) - return d_DPSetTextureConvert(m, hi, lo); - else if (shift == G_MDSFT_TEXTFILT && length == G_MDSIZ_TEXTFILT) - return d_DPSetTextureFilter(m, hi, lo); - else if (shift == G_MDSFT_TEXTLUT && length == G_MDSIZ_TEXTLUT) - return d_DPSetTextureLUT(m, hi, lo); - else if (shift == G_MDSFT_TEXTLOD && length == G_MDSIZ_TEXTLOD) - return d_DPSetTextureLOD(m, hi, lo); - else if (shift == G_MDSFT_TEXTDETAIL && length == G_MDSIZ_TEXTDETAIL) - return d_DPSetTextureDetail(m, hi, lo); - else if (shift == G_MDSFT_TEXTPERSP && length == G_MDSIZ_TEXTPERSP) - return d_DPSetTexturePersp(m, hi, lo); - else if (shift == G_MDSFT_CYCLETYPE && length == G_MDSIZ_CYCLETYPE) - return d_DPSetCycleType(m, hi, lo); - else if (shift == G_MDSFT_PIPELINE && length == G_MDSIZ_PIPELINE) - return d_DPPipelineMode(m, hi, lo); - else if (config.emit_ext_macro) - { - m->id = gfxd_SPSetOtherModeHi; - argi(m, 0, "sft", shift, gfxd_Sfthi); - argi(m, 1, "len", length, gfxd_Num); - argu(m, 2, "mode", lo, gfxd_Othermodehi); - return 0; - } - else - return d_SPSetOtherMode(m, hi, lo); -} - -UCFUNC int d_DPSetOtherMode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_DPSetOtherMode; - argu(m, 0, "hi", getfield(hi, 24, 0), gfxd_Othermodehi); - argu(m, 1, "lo", lo, gfxd_Othermodelo); - return 0; -} - -UCFUNC int d_MoveWd(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ -#if defined(F3D_GBI) || defined(F3DEX_GBI) - int index = getfield(hi, 8, 0); - int offset = getfield(hi, 16, 8); -#elif defined(F3DEX_GBI_2) - int index = getfield(hi, 8, 16); - int offset = getfield(hi, 16, 0); -#endif - if (index == G_MW_FOG && offset == G_MWO_FOG) - return d_SPFogPosition(m, hi, lo); -#if !(defined(F3D_BETA) && (defined(F3D_GBI) || defined(F3DEX_GBI))) - else if (index == G_MW_PERSPNORM && offset == 0) - return d_SPPerspNormalize(m, hi, lo); -#endif - else if (index == G_MW_SEGMENT) - return d_SPSegment(m, hi, lo); - else if (index == G_MW_NUMLIGHT && offset == G_MWO_NUMLIGHT) - return d_SPNumLights(m, hi, lo); -#if defined(F3D_GBI) || (defined(F3D_BETA) && defined(F3DEX_GBI)) - else if (index == G_MW_POINTS) - return d_SPModifyVertex(m, hi, lo); -#endif -#if defined(F3D_GBI) || defined(F3DEX_GBI) - else if (index == G_MW_MATRIX) - return d_SPInsertMatrix(m, hi, lo); -#endif - else - { - m->id = gfxd_MoveWd; - argi(m, 0, "index", index, gfxd_Mw); - if (index == G_MW_MATRIX) - argu(m, 1, "offset", offset, gfxd_Mwo_matrix); - else if (index == G_MW_CLIP) - argu(m, 1, "offset", offset, gfxd_Mwo_clip); - else if (index == G_MW_LIGHTCOL) - argu(m, 1, "offset", offset, gfxd_Mwo_lightcol); - else - argu(m, 1, "offset", offset, gfxd_Mwo); - argu(m, 2, "value", lo, gfxd_Word); - } - return 0; -} - -#if defined(F3D_GBI) || defined(F3DEX_GBI) -UCFUNC int d_MoveMem(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int size = getfield(hi, 16, 0); - int index = getfield(hi, 8, 16); - if (size == sizeof(Light) - && index >= G_MV_L0 - && index <= G_MV_L7 - && index % 2 == 0) - { - return d_SPLight(m, hi, lo); - } - else if (size == sizeof(Light) && index == G_MV_LOOKATX) - return d_SPLookAtX(m, hi, lo); - else if (size == sizeof(Light) && index == G_MV_LOOKATY) - return d_SPLookAtY(m, hi, lo); - else if (size == sizeof(Vp) && index == G_MV_VIEWPORT) - return d_SPViewport(m, hi, lo); - else - { - m->id = gfxd_MoveMem; - argu(m, 0, "size", size, gfxd_Size); - argi(m, 1, "index", index, gfxd_Mv); - argu(m, 2, "dram", lo, gfxd_Dram); - return 0; - } -} -#elif defined(F3DEX_GBI_2) -UCFUNC int d_MoveMem(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int size = (getfield(hi, 5, 19) + 1) * 8; - int index = getfield(hi, 8, 0); - int offset = getfield(hi, 8, 8) * 8; - if (size == sizeof(Light) - && index == G_MV_LIGHT - && offset >= G_MVO_L0 - && offset <= G_MVO_L7 - && offset % 0x18 == 0) - { - return d_SPLight(m, hi, lo); - } - else if (size == sizeof(Light) - && index == G_MV_LIGHT - && offset == G_MVO_LOOKATX) - { - return d_SPLookAtX(m, hi, lo); - } - else if (size == sizeof(Light) - && index == G_MV_LIGHT - && offset == G_MVO_LOOKATY) - { - return d_SPLookAtY(m, hi, lo); - } - else if (size == sizeof(Vp) - && index == G_MV_VIEWPORT - && offset == 0) - { - return d_SPViewport(m, hi, lo); - } - else - { - m->id = gfxd_MoveMem; - argu(m, 0, "size", size, gfxd_Size); - argi(m, 1, "index", index, gfxd_Mv); - argu(m, 2, "offset", offset, gfxd_Size); - argu(m, 3, "dram", lo, gfxd_Dram); - return 0; - } -} -#endif - -#if defined(F3DEX_GBI_2) -UCFUNC int d_SPDmaRead(gfxd_macro_t *m, uint32_t hi, uint32_t lo); -UCFUNC int d_SPDmaWrite(gfxd_macro_t *m, uint32_t hi, uint32_t lo); -UCFUNC int d_SPDma_io(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - int flag = getfield(hi, 1, 23); - if (flag == 0) - return d_SPDmaRead(m, hi, lo); - else if (flag == 1) - return d_SPDmaWrite(m, hi, lo); - else - { - m->id = gfxd_SPDma_io; - argi(m, 0, "flag", flag, gfxd_Dmaflag); - argu(m, 1, "dmem", getfield(hi, 10, 13) * 8, gfxd_Dmem); - argu(m, 2, "dram", lo, gfxd_Dram); - argu(m, 3, "size", getfield(hi, 12, 10) + 1, gfxd_Size); - return 0; - } -} - -UCFUNC int d_SPDmaRead(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPDmaRead; - argu(m, 0, "dmem", getfield(hi, 10, 13) * 8, gfxd_Dmem); - argu(m, 1, "dram", lo, gfxd_Dram); - argu(m, 2, "size", getfield(hi, 12, 10) + 1, gfxd_Size); - return 0; -} - -UCFUNC int d_SPDmaWrite(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPDmaWrite; - argu(m, 0, "dmem", getfield(hi, 10, 13) * 8, gfxd_Dmem); - argu(m, 1, "dram", lo, gfxd_Dram); - argu(m, 2, "size", getfield(hi, 12, 10) + 1, gfxd_Size); - return 0; -} -#endif - -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) -UCFUNC int d_LoadUcode(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_LoadUcode; - argu(m, 0, "uc_start", lo, gfxd_Uctext); - argu(m, 1, "uc_dsize", getfield(hi, 16, 0) + 1, gfxd_Size); - return 0; -} - -UCFUNC int c_SPLoadUcodeEx(gfxd_macro_t *m, int n_macro) -{ - if (n_macro < 2) - return -1; - if (m[0].id != gfxd_DPHalf1) - return -1; - uint32_t uc_dstart = argvu(&m[0], 0); - if (m[1].id != gfxd_LoadUcode) - return -1; - uint32_t uc_start = argvu(&m[1], 0); - uint32_t uc_dsize = argvu(&m[1], 1); - m->id = gfxd_SPLoadUcodeEx; - argu(m, 0, "uc_start", uc_start, gfxd_Uctext); - argu(m, 1, "uc_dstart", uc_dstart, gfxd_Ucdata); - argu(m, 2, "uc_dsize", uc_dsize, gfxd_Size); - return 0; -} -#endif - -UCFUNC int d_TexRect(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_TexRect; - argu(m, 0, "ulx", getfield(lo, 12, 12), gfxd_Coordq); - argu(m, 1, "uly", getfield(lo, 12, 0), gfxd_Coordq); - argu(m, 2, "lrx", getfield(hi, 12, 12), gfxd_Coordq); - argu(m, 3, "lry", getfield(hi, 12, 0), gfxd_Coordq); - argi(m, 4, "tile", getfield(lo, 3, 24), gfxd_Tile); - return 0; -} - -UCFUNC int d_TexRectFlip(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_TexRectFlip; - argu(m, 0, "ulx", getfield(lo, 12, 12), gfxd_Coordq); - argu(m, 1, "uly", getfield(lo, 12, 0), gfxd_Coordq); - argu(m, 2, "lrx", getfield(hi, 12, 12), gfxd_Coordq); - argu(m, 3, "lry", getfield(hi, 12, 0), gfxd_Coordq); - argi(m, 4, "tile", getfield(lo, 3, 24), gfxd_Tile); - return 0; -} - -UCFUNC int d_SPNoOp(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_SPNoOp; - return 0; -} - -#if defined(F3DEX_GBI_2) -UCFUNC int d_Special3(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_Special3; - argu(m, 0, "hi", getfield(hi, 24, 0), gfxd_Word); - argu(m, 1, "lo", lo, gfxd_Word); - return 0; -} - -UCFUNC int d_Special2(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_Special2; - argu(m, 0, "hi", getfield(hi, 24, 0), gfxd_Word); - argu(m, 1, "lo", lo, gfxd_Word); - return 0; -} - -UCFUNC int d_Special1(gfxd_macro_t *m, uint32_t hi, uint32_t lo) -{ - m->id = gfxd_Special1; - argu(m, 0, "hi", getfield(hi, 24, 0), gfxd_Word); - argu(m, 1, "lo", lo, gfxd_Word); - return 0; -} -#endif diff --git a/tools/ZAPD/lib/libgfxd/uc_macrotbl.c b/tools/ZAPD/lib/libgfxd/uc_macrotbl.c deleted file mode 100644 index a8939cede0..0000000000 --- a/tools/ZAPD/lib/libgfxd/uc_macrotbl.c +++ /dev/null @@ -1,1397 +0,0 @@ -static const gfxd_macro_type_t macro_tbl[] = -{ - [gfxd_Invalid] = - { - .prefix = NULL, - .suffix = NULL, - .opcode = -1, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_Invalid, - }, - [gfxd_DPFillRectangle] = - { - .prefix = NULL, - .suffix = "DPFillRectangle", - .opcode = G_FILLRECT, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_DPFillRectangle, - }, - [gfxd_DPFullSync] = - { - .prefix = NULL, - .suffix = "DPFullSync", - .opcode = G_RDPFULLSYNC, - .n_gfx = 1, - .n_arg = 0, - .disas_fn = d_DPFullSync, - }, - [gfxd_DPLoadSync] = - { - .prefix = NULL, - .suffix = "DPLoadSync", - .opcode = G_RDPLOADSYNC, - .n_gfx = 1, - .n_arg = 0, - .disas_fn = d_DPLoadSync, - }, - [gfxd_DPTileSync] = - { - .prefix = NULL, - .suffix = "DPTileSync", - .opcode = G_RDPTILESYNC, - .n_gfx = 1, - .n_arg = 0, - .disas_fn = d_DPTileSync, - }, - [gfxd_DPPipeSync] = - { - .prefix = NULL, - .suffix = "DPPipeSync", - .opcode = G_RDPPIPESYNC, - .n_gfx = 1, - .n_arg = 0, - .disas_fn = d_DPPipeSync, - }, - [gfxd_DPLoadTLUT_pal16] = - { - .prefix = NULL, - .suffix = "DPLoadTLUT_pal16", - .opcode = G_SETTIMG, - .n_gfx = 6, - .n_arg = 2, - .combine_fn = c_DPLoadTLUT_pal16, - }, - [gfxd_DPLoadTLUT_pal256] = - { - .prefix = NULL, - .suffix = "DPLoadTLUT_pal256", - .opcode = G_SETTIMG, - .n_gfx = 6, - .n_arg = 1, - .combine_fn = c_DPLoadTLUT_pal256, - }, - [gfxd_DPLoadMultiBlockYuvS] = - { - .prefix = NULL, - .suffix = "DPLoadMultiBlockYuvS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 14, - .combine_fn = c_DPLoadMultiBlockYuvS, - .ext = 1, - }, - [gfxd_DPLoadMultiBlockYuv] = - { - .prefix = NULL, - .suffix = "DPLoadMultiBlockYuv", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 14, - .combine_fn = c_DPLoadMultiBlockYuv, - .ext = 1, - }, - [gfxd_DPLoadMultiBlock_4bS] = - { - .prefix = NULL, - .suffix = "DPLoadMultiBlock_4bS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 13, - .combine_fn = c_DPLoadMultiBlock_4bS, - }, - [gfxd_DPLoadMultiBlock_4b] = - { - .prefix = NULL, - .suffix = "DPLoadMultiBlock_4b", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 13, - .combine_fn = c_DPLoadMultiBlock_4b, - }, - [gfxd_DPLoadMultiBlockS] = - { - .prefix = NULL, - .suffix = "DPLoadMultiBlockS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 14, - .combine_fn = c_DPLoadMultiBlockS, - }, - [gfxd_DPLoadMultiBlock] = - { - .prefix = NULL, - .suffix = "DPLoadMultiBlock", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 14, - .combine_fn = c_DPLoadMultiBlock, - }, - [gfxd__DPLoadTextureBlockYuvS] = - { - .prefix = "_", - .suffix = "DPLoadTextureBlockYuvS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 13, - .combine_fn = c__DPLoadTextureBlockYuvS, - .ext = 1, - }, - [gfxd__DPLoadTextureBlockYuv] = - { - .prefix = "_", - .suffix = "DPLoadTextureBlockYuv", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 13, - .combine_fn = c__DPLoadTextureBlockYuv, - .ext = 1, - }, - [gfxd__DPLoadTextureBlock_4bS] = - { - .prefix = "_", - .suffix = "DPLoadTextureBlock_4bS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 12, - .combine_fn = c__DPLoadTextureBlock_4bS, - .ext = 1, - }, - [gfxd__DPLoadTextureBlock_4b] = - { - .prefix = "_", - .suffix = "DPLoadTextureBlock_4b", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 12, - .combine_fn = c__DPLoadTextureBlock_4b, - }, - [gfxd__DPLoadTextureBlockS] = - { - .prefix = "_", - .suffix = "DPLoadTextureBlockS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 13, - .combine_fn = c__DPLoadTextureBlockS, - .ext = 1, - }, - [gfxd__DPLoadTextureBlock] = - { - .prefix = "_", - .suffix = "DPLoadTextureBlock", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 13, - .combine_fn = c__DPLoadTextureBlock, - }, - [gfxd_DPLoadTextureBlockYuvS] = - { - .prefix = NULL, - .suffix = "DPLoadTextureBlockYuvS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 12, - .combine_fn = c_DPLoadTextureBlockYuvS, - .ext = 1, - }, - [gfxd_DPLoadTextureBlockYuv] = - { - .prefix = NULL, - .suffix = "DPLoadTextureBlockYuv", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 12, - .combine_fn = c_DPLoadTextureBlockYuv, - .ext = 1, - }, - [gfxd_DPLoadTextureBlock_4bS] = - { - .prefix = NULL, - .suffix = "DPLoadTextureBlock_4bS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 11, - .combine_fn = c_DPLoadTextureBlock_4bS, - }, - [gfxd_DPLoadTextureBlock_4b] = - { - .prefix = NULL, - .suffix = "DPLoadTextureBlock_4b", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 11, - .combine_fn = c_DPLoadTextureBlock_4b, - }, - [gfxd_DPLoadTextureBlockS] = - { - .prefix = NULL, - .suffix = "DPLoadTextureBlockS", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 12, - .combine_fn = c_DPLoadTextureBlockS, - }, - [gfxd_DPLoadTextureBlock] = - { - .prefix = NULL, - .suffix = "DPLoadTextureBlock", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 12, - .combine_fn = c_DPLoadTextureBlock, - }, - [gfxd_DPLoadMultiTileYuv] = - { - .prefix = NULL, - .suffix = "DPLoadMultiTileYuv", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 18, - .combine_fn = c_DPLoadMultiTileYuv, - .ext = 1, - }, - [gfxd_DPLoadMultiTile_4b] = - { - .prefix = NULL, - .suffix = "DPLoadMultiTile_4b", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 17, - .combine_fn = c_DPLoadMultiTile_4b, - }, - [gfxd_DPLoadMultiTile] = - { - .prefix = NULL, - .suffix = "DPLoadMultiTile", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 18, - .combine_fn = c_DPLoadMultiTile, - }, - [gfxd__DPLoadTextureTileYuv] = - { - .prefix = "_", - .suffix = "DPLoadTextureTileYuv", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 17, - .combine_fn = c__DPLoadTextureTileYuv, - .ext = 1, - }, - [gfxd__DPLoadTextureTile_4b] = - { - .prefix = "_", - .suffix = "DPLoadTextureTile_4b", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 16, - .combine_fn = c__DPLoadTextureTile_4b, - .ext = 1, - }, - [gfxd__DPLoadTextureTile] = - { - .prefix = "_", - .suffix = "DPLoadTextureTile", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 17, - .combine_fn = c__DPLoadTextureTile, - .ext = 1, - }, - [gfxd_DPLoadTextureTileYuv] = - { - .prefix = NULL, - .suffix = "DPLoadTextureTileYuv", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 16, - .combine_fn = c_DPLoadTextureTileYuv, - .ext = 1, - }, - [gfxd_DPLoadTextureTile_4b] = - { - .prefix = NULL, - .suffix = "DPLoadTextureTile_4b", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 15, - .combine_fn = c_DPLoadTextureTile_4b, - }, - [gfxd_DPLoadTextureTile] = - { - .prefix = NULL, - .suffix = "DPLoadTextureTile", - .opcode = G_SETTIMG, - .n_gfx = 7, - .n_arg = 16, - .combine_fn = c_DPLoadTextureTile, - }, - [gfxd_DPLoadBlock] = - { - .prefix = NULL, - .suffix = "DPLoadBlock", - .opcode = G_LOADBLOCK, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_DPLoadBlock, - }, - [gfxd_DPNoOp] = - { - .prefix = NULL, - .suffix = "DPNoOp", - .opcode = G_NOOP, - .n_gfx = 1, - .n_arg = 0, - .alias = gfxd_DPNoOpTag, - }, - [gfxd_DPNoOpTag] = - { - .prefix = NULL, - .suffix = "DPNoOpTag", - .opcode = G_NOOP, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_DPNoOpTag, - }, - [gfxd_DPPipelineMode] = - { - .prefix = NULL, - .suffix = "DPPipelineMode", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetBlendColor] = - { - .prefix = NULL, - .suffix = "DPSetBlendColor", - .opcode = G_SETBLENDCOLOR, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_DPSetBlendColor, - }, - [gfxd_DPSetEnvColor] = - { - .prefix = NULL, - .suffix = "DPSetEnvColor", - .opcode = G_SETENVCOLOR, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_DPSetEnvColor, - }, - [gfxd_DPSetFillColor] = - { - .prefix = NULL, - .suffix = "DPSetFillColor", - .opcode = G_SETFILLCOLOR, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_DPSetFillColor, - }, - [gfxd_DPSetFogColor] = - { - .prefix = NULL, - .suffix = "DPSetFogColor", - .opcode = G_SETFOGCOLOR, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_DPSetFogColor, - }, - [gfxd_DPSetPrimColor] = - { - .prefix = NULL, - .suffix = "DPSetPrimColor", - .opcode = G_SETPRIMCOLOR, - .n_gfx = 1, - .n_arg = 6, - .disas_fn = d_DPSetPrimColor, - }, - [gfxd_DPSetColorImage] = - { - .prefix = NULL, - .suffix = "DPSetColorImage", - .opcode = G_SETCIMG, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_DPSetColorImage, - }, - [gfxd_DPSetDepthImage] = - { - .prefix = NULL, - .suffix = "DPSetDepthImage", - .opcode = G_SETZIMG, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_DPSetDepthImage, - }, - [gfxd_DPSetTextureImage] = - { - .prefix = NULL, - .suffix = "DPSetTextureImage", - .opcode = G_SETTIMG, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_DPSetTextureImage, - }, - [gfxd_DPSetAlphaCompare] = - { - .prefix = NULL, - .suffix = "DPSetAlphaCompare", - .opcode = G_SETOTHERMODE_L, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeLo, - }, - [gfxd_DPSetAlphaDither] = - { - .prefix = NULL, - .suffix = "DPSetAlphaDither", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetColorDither] = - { - .prefix = NULL, - .suffix = "DPSetColorDither", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetCombineMode] = - { - .prefix = NULL, - .suffix = "DPSetCombineMode", - .opcode = G_SETCOMBINE, - .n_gfx = 1, - .n_arg = 2, - .alias = gfxd_DPSetCombineLERP, - }, - [gfxd_DPSetCombineLERP] = - { - .prefix = NULL, - .suffix = "DPSetCombineLERP", - .opcode = G_SETCOMBINE, - .n_gfx = 1, - .n_arg = 16, - .disas_fn = d_DPSetCombineLERP, - }, - [gfxd_DPSetConvert] = - { - .prefix = NULL, - .suffix = "DPSetConvert", - .opcode = G_SETCONVERT, - .n_gfx = 1, - .n_arg = 6, - .disas_fn = d_DPSetConvert, - }, - [gfxd_DPSetTextureConvert] = - { - .prefix = NULL, - .suffix = "DPSetTextureConvert", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetCycleType] = - { - .prefix = NULL, - .suffix = "DPSetCycleType", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetDepthSource] = - { - .prefix = NULL, - .suffix = "DPSetDepthSource", - .opcode = G_SETOTHERMODE_L, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeLo, - }, - [gfxd_DPSetCombineKey] = - { - .prefix = NULL, - .suffix = "DPSetCombineKey", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetKeyGB] = - { - .prefix = NULL, - .suffix = "DPSetKeyGB", - .opcode = G_SETKEYGB, - .n_gfx = 1, - .n_arg = 6, - .disas_fn = d_DPSetKeyGB, - }, - [gfxd_DPSetKeyR] = - { - .prefix = NULL, - .suffix = "DPSetKeyR", - .opcode = G_SETKEYR, - .n_gfx = 1, - .n_arg = 3, - .disas_fn = d_DPSetKeyR, - }, - [gfxd_DPSetPrimDepth] = - { - .prefix = NULL, - .suffix = "DPSetPrimDepth", - .opcode = G_SETPRIMDEPTH, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_DPSetPrimDepth, - }, - [gfxd_DPSetRenderMode] = - { - .prefix = NULL, - .suffix = "DPSetRenderMode", - .opcode = G_SETOTHERMODE_L, - .n_gfx = 1, - .n_arg = 2, - .alias = gfxd_SPSetOtherModeLo, - }, - [gfxd_DPSetScissor] = - { - .prefix = NULL, - .suffix = "DPSetScissor", - .opcode = G_SETSCISSOR, - .n_gfx = 1, - .n_arg = 5, - .alias = gfxd_DPSetScissorFrac, - }, - [gfxd_DPSetScissorFrac] = - { - .prefix = NULL, - .suffix = "DPSetScissorFrac", - .opcode = G_SETSCISSOR, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_DPSetScissorFrac, - }, - [gfxd_DPSetTextureDetail] = - { - .prefix = NULL, - .suffix = "DPSetTextureDetail", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetTextureFilter] = - { - .prefix = NULL, - .suffix = "DPSetTextureFilter", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetTextureLOD] = - { - .prefix = NULL, - .suffix = "DPSetTextureLOD", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetTextureLUT] = - { - .prefix = NULL, - .suffix = "DPSetTextureLUT", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetTexturePersp] = - { - .prefix = NULL, - .suffix = "DPSetTexturePersp", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPSetOtherModeHi, - }, - [gfxd_DPSetTile] = - { - .prefix = NULL, - .suffix = "DPSetTile", - .opcode = G_SETTILE, - .n_gfx = 1, - .n_arg = 12, - .disas_fn = d_DPSetTile, - }, - [gfxd_DPSetTileSize] = - { - .prefix = NULL, - .suffix = "DPSetTileSize", - .opcode = G_SETTILESIZE, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_DPSetTileSize, - }, - [gfxd_SP1Triangle] = - { - .prefix = NULL, - .suffix = "SP1Triangle", - .opcode = G_TRI1, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_SP1Triangle, - }, -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - [gfxd_SP2Triangles] = - { - .prefix = NULL, - .suffix = "SP2Triangles", - .opcode = G_TRI2, - .n_gfx = 1, - .n_arg = 8, - .disas_fn = d_SP2Triangles, - }, -#endif -#if defined(F3DEX_GBI) - [gfxd_SP1Quadrangle] = - { - .prefix = NULL, - .suffix = "SP1Quadrangle", - .opcode = G_TRI2, - .n_gfx = 1, - .n_arg = 5, - .alias = gfxd_SP2Triangles, - }, -#elif defined(F3DEX_GBI_2) - [gfxd_SP1Quadrangle] = - { - .prefix = NULL, - .suffix = "SP1Quadrangle", - .opcode = G_QUAD, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_SP1Quadrangle, - }, -#endif -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - [gfxd_SPBranchLessZraw] = - { - .prefix = NULL, - .suffix = "SPBranchLessZraw", - .opcode = G_RDPHALF_1, - .n_gfx = 2, - .n_arg = 3, - .combine_fn = c_SPBranchLessZraw, - }, -#endif - [gfxd_SPBranchList] = - { - .prefix = NULL, - .suffix = "SPBranchList", - .opcode = G_DL, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_DisplayList, - }, - [gfxd_SPClipRatio] = - { - .prefix = NULL, - .suffix = "SPClipRatio", - .opcode = G_MOVEWORD, - .n_gfx = 4, - .n_arg = 1, - .combine_fn = c_SPClipRatio, - }, - [gfxd_SPCullDisplayList] = - { - .prefix = NULL, - .suffix = "SPCullDisplayList", - .opcode = G_CULLDL, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_SPCullDisplayList, - }, - [gfxd_SPDisplayList] = - { - .prefix = NULL, - .suffix = "SPDisplayList", - .opcode = G_DL, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_DisplayList, - }, - [gfxd_SPEndDisplayList] = - { - .prefix = NULL, - .suffix = "SPEndDisplayList", - .opcode = G_ENDDL, - .n_gfx = 1, - .n_arg = 0, - .disas_fn = d_SPEndDisplayList, - }, - [gfxd_SPFogFactor] = - { - .prefix = NULL, - .suffix = "SPFogFactor", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 2, - .alias = gfxd_SPFogPosition, - }, - [gfxd_SPFogPosition] = - { - .prefix = NULL, - .suffix = "SPFogPosition", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 2, - .alias = gfxd_MoveWd, - }, -#if defined(F3D_GBI) || defined(F3DEX_GBI) - [gfxd_SPForceMatrix] = - { - .prefix = NULL, - .suffix = "SPForceMatrix", - .opcode = G_MOVEMEM, - .n_gfx = 4, - .n_arg = 1, - .combine_fn = c_SPForceMatrix, - }, - [gfxd_SPSetGeometryMode] = - { - .prefix = NULL, - .suffix = "SPSetGeometryMode", - .opcode = G_SETGEOMETRYMODE, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_SPSetGeometryMode, - }, - [gfxd_SPClearGeometryMode] = - { - .prefix = NULL, - .suffix = "SPClearGeometryMode", - .opcode = G_CLEARGEOMETRYMODE, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_SPClearGeometryMode, - }, - [gfxd_SPLoadGeometryMode] = - { - .prefix = NULL, - .suffix = "SPLoadGeometryMode", - .opcode = G_CLEARGEOMETRYMODE, - .n_gfx = 2, - .n_arg = 1, - .combine_fn = c_SPLoadGeometryMode, - }, -#elif defined(F3DEX_GBI_2) - [gfxd_SPForceMatrix] = - { - .prefix = NULL, - .suffix = "SPForceMatrix", - .opcode = G_MOVEMEM, - .n_gfx = 2, - .n_arg = 1, - .combine_fn = c_SPForceMatrix, - }, - [gfxd_SPSetGeometryMode] = - { - .prefix = NULL, - .suffix = "SPSetGeometryMode", - .opcode = G_GEOMETRYMODE, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPGeometryMode, - }, - [gfxd_SPClearGeometryMode] = - { - .prefix = NULL, - .suffix = "SPClearGeometryMode", - .opcode = G_GEOMETRYMODE, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPGeometryMode, - }, - [gfxd_SPLoadGeometryMode] = - { - .prefix = NULL, - .suffix = "SPLoadGeometryMode", - .opcode = G_GEOMETRYMODE, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPGeometryMode, - }, -#endif -#if defined(F3D_GBI) || defined(F3DEX_GBI) - [gfxd_SPInsertMatrix] = - { - .prefix = NULL, - .suffix = "SPInsertMatrix", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 2, - .alias = gfxd_MoveWd, - }, -#endif - [gfxd_SPLine3D] = - { - .prefix = NULL, - .suffix = "SPLine3D", - .opcode = G_LINE3D, - .n_gfx = 1, - .n_arg = 3, - .alias = gfxd_SPLineW3D, - }, - [gfxd_SPLineW3D] = - { - .prefix = NULL, - .suffix = "SPLineW3D", - .opcode = G_LINE3D, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_SPLineW3D, - }, -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - [gfxd_SPLoadUcode] = - { - .prefix = NULL, - .suffix = "SPLoadUcode", - .opcode = G_RDPHALF_1, - .n_gfx = 2, - .n_arg = 2, - .combine_fn = c_SPLoadUcode, - }, -#endif - [gfxd_SPLookAtX] = - { - .prefix = NULL, - .suffix = "SPLookAtX", - .opcode = G_MOVEMEM, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_MoveMem, - }, - [gfxd_SPLookAtY] = - { - .prefix = NULL, - .suffix = "SPLookAtY", - .opcode = G_MOVEMEM, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_MoveMem, - }, - [gfxd_SPLookAt] = - { - .prefix = NULL, - .suffix = "SPLookAt", - .opcode = G_MOVEMEM, - .n_gfx = 2, - .n_arg = 1, - .combine_fn = c_SPLookAt, - }, - [gfxd_SPMatrix] = - { - .prefix = NULL, - .suffix = "SPMatrix", - .opcode = G_MTX, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_SPMatrix, - }, -#if defined(F3D_GBI) || (defined(F3D_BETA) && defined(F3DEX_GBI)) - [gfxd_SPModifyVertex] = - { - .prefix = NULL, - .suffix = "SPModifyVertex", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 3, - .alias = gfxd_MoveWd, - }, -#elif defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - [gfxd_SPModifyVertex] = - { - .prefix = NULL, - .suffix = "SPModifyVertex", - .opcode = G_MODIFYVTX, - .n_gfx = 1, - .n_arg = 3, - .disas_fn = d_SPModifyVertex, - }, -#endif -#if defined(F3D_BETA) && (defined(F3D_GBI) || defined(F3DEX_GBI)) - [gfxd_SPPerspNormalize] = - { - .prefix = NULL, - .suffix = "SPPerspNormalize", - .opcode = G_PERSPNORM, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_SPPerspNormalize, - }, -#else - [gfxd_SPPerspNormalize] = - { - .prefix = NULL, - .suffix = "SPPerspNormalize", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_MoveWd, - }, -#endif -#if defined(F3D_GBI) || defined(F3DEX_GBI) - [gfxd_SPPopMatrix] = - { - .prefix = NULL, - .suffix = "SPPopMatrix", - .opcode = G_POPMTX, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_SPPopMatrix, - }, -#elif defined(F3DEX_GBI_2) - [gfxd_SPPopMatrix] = - { - .prefix = NULL, - .suffix = "SPPopMatrix", - .opcode = G_POPMTX, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_SPPopMatrixN, - }, - [gfxd_SPPopMatrixN] = - { - .prefix = NULL, - .suffix = "SPPopMatrixN", - .opcode = G_POPMTX, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_SPPopMatrixN, - }, -#endif - [gfxd_SPSegment] = - { - .prefix = NULL, - .suffix = "SPSegment", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 2, - .alias = gfxd_MoveWd, - }, - [gfxd_SPSetLights1] = - { - .prefix = NULL, - .suffix = "SPSetLights1", - .opcode = G_MOVEWORD, - .n_gfx = 3, - .n_arg = 1, - .combine_fn = c_SPSetLights1, - }, - [gfxd_SPSetLights2] = - { - .prefix = NULL, - .suffix = "SPSetLights2", - .opcode = G_MOVEWORD, - .n_gfx = 4, - .n_arg = 1, - .combine_fn = c_SPSetLights2, - }, - [gfxd_SPSetLights3] = - { - .prefix = NULL, - .suffix = "SPSetLights3", - .opcode = G_MOVEWORD, - .n_gfx = 5, - .n_arg = 1, - .combine_fn = c_SPSetLights3, - }, - [gfxd_SPSetLights4] = - { - .prefix = NULL, - .suffix = "SPSetLights4", - .opcode = G_MOVEWORD, - .n_gfx = 6, - .n_arg = 1, - .combine_fn = c_SPSetLights4, - }, - [gfxd_SPSetLights5] = - { - .prefix = NULL, - .suffix = "SPSetLights5", - .opcode = G_MOVEWORD, - .n_gfx = 7, - .n_arg = 1, - .combine_fn = c_SPSetLights5, - }, - [gfxd_SPSetLights6] = - { - .prefix = NULL, - .suffix = "SPSetLights6", - .opcode = G_MOVEWORD, - .n_gfx = 8, - .n_arg = 1, - .combine_fn = c_SPSetLights6, - }, - [gfxd_SPSetLights7] = - { - .prefix = NULL, - .suffix = "SPSetLights7", - .opcode = G_MOVEWORD, - .n_gfx = 9, - .n_arg = 1, - .combine_fn = c_SPSetLights7, - }, - [gfxd_SPNumLights] = - { - .prefix = NULL, - .suffix = "SPNumLights", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_MoveWd, - }, - [gfxd_SPLight] = - { - .prefix = NULL, - .suffix = "SPLight", - .opcode = G_MOVEMEM, - .n_gfx = 1, - .n_arg = 2, - .alias = gfxd_MoveMem, - }, - [gfxd_SPLightColor] = - { - .prefix = NULL, - .suffix = "SPLightColor", - .opcode = G_MOVEWORD, - .n_gfx = 2, - .n_arg = 2, - .combine_fn = c_SPLightColor, - }, - [gfxd_SPTexture] = - { - .prefix = NULL, - .suffix = "SPTexture", - .opcode = G_TEXTURE, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_SPTexture, - }, - [gfxd_SPTextureRectangle] = - { - .prefix = NULL, - .suffix = "SPTextureRectangle", - .opcode = G_TEXRECT, - .n_gfx = 3, - .n_arg = 9, - .combine_fn = c_SPTextureRectangle, - }, - [gfxd_SPTextureRectangleFlip] = - { - .prefix = NULL, - .suffix = "SPTextureRectangleFlip", - .opcode = G_TEXRECTFLIP, - .n_gfx = 3, - .n_arg = 9, - .combine_fn = c_SPTextureRectangleFlip, - }, - [gfxd_SPVertex] = - { - .prefix = NULL, - .suffix = "SPVertex", - .opcode = G_VTX, - .n_gfx = 1, - .n_arg = 3, - .disas_fn = d_SPVertex, - }, - [gfxd_SPViewport] = - { - .prefix = NULL, - .suffix = "SPViewport", - .opcode = G_MOVEMEM, - .n_gfx = 1, - .n_arg = 1, - .alias = gfxd_MoveMem, - }, - [gfxd_DPLoadTLUTCmd] = - { - .prefix = NULL, - .suffix = "DPLoadTLUTCmd", - .opcode = G_LOADTLUT, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_DPLoadTLUTCmd, - }, - [gfxd_DPLoadTLUT] = - { - .prefix = NULL, - .suffix = "DPLoadTLUT", - .opcode = G_SETTIMG, - .n_gfx = 6, - .n_arg = 3, - .combine_fn = c_DPLoadTLUT, - }, -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - [gfxd_BranchZ] = - { - .prefix = NULL, - .suffix = "BranchZ", - .opcode = G_BRANCH_Z, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_BranchZ, - .ext = 1, - }, -#endif - [gfxd_DisplayList] = - { - .prefix = NULL, - .suffix = "DisplayList", - .opcode = G_DL, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_DisplayList, - .ext = 1, - }, - [gfxd_DPHalf1] = - { - .prefix = NULL, - .suffix = "DPHalf1", - .opcode = G_RDPHALF_1, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_DPHalf1, - .ext = 1, - }, - [gfxd_DPHalf2] = - { - .prefix = NULL, - .suffix = "DPHalf2", - .opcode = G_RDPHALF_2, - .n_gfx = 1, - .n_arg = 1, - .disas_fn = d_DPHalf2, - .ext = 1, - }, - [gfxd_DPWord] = - { - .prefix = NULL, - .suffix = "DPWord", - .opcode = G_RDPHALF_1, - .n_gfx = 2, - .n_arg = 2, - .combine_fn = c_DPWord, - }, - [gfxd_DPLoadTile] = - { - .prefix = NULL, - .suffix = "DPLoadTile", - .opcode = G_LOADTILE, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_DPLoadTile, - }, -#if defined(F3DEX_GBI_2) - [gfxd_SPGeometryMode] = - { - .prefix = NULL, - .suffix = "SPGeometryMode", - .opcode = G_GEOMETRYMODE, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_SPGeometryMode, - }, -#endif - [gfxd_SPSetOtherMode] = - { - .prefix = NULL, - .suffix = "SPSetOtherMode", - .opcode = -1, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_SPSetOtherMode, - }, - [gfxd_SPSetOtherModeLo] = - { - .prefix = NULL, - .suffix = "SPSetOtherModeLo", - .opcode = G_SETOTHERMODE_L, - .n_gfx = 1, - .n_arg = 3, - .disas_fn = d_SPSetOtherModeLo, - .ext = 1, - }, - [gfxd_SPSetOtherModeHi] = - { - .prefix = NULL, - .suffix = "SPSetOtherModeHi", - .opcode = G_SETOTHERMODE_H, - .n_gfx = 1, - .n_arg = 3, - .disas_fn = d_SPSetOtherModeHi, - .ext = 1, - }, - [gfxd_DPSetOtherMode] = - { - .prefix = NULL, - .suffix = "DPSetOtherMode", - .opcode = G_RDPSETOTHERMODE, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_DPSetOtherMode, - }, - [gfxd_MoveWd] = - { - .prefix = NULL, - .suffix = "MoveWd", - .opcode = G_MOVEWORD, - .n_gfx = 1, - .n_arg = 3, - .disas_fn = d_MoveWd, - }, -#if defined(F3D_GBI) || defined(F3DEX_GBI) - [gfxd_MoveMem] = - { - .prefix = NULL, - .suffix = "MoveMem", - .opcode = G_MOVEMEM, - .n_gfx = 1, - .n_arg = 3, - .disas_fn = d_MoveMem, - .ext = 1, - }, -#elif defined(F3DEX_GBI_2) - [gfxd_MoveMem] = - { - .prefix = NULL, - .suffix = "MoveMem", - .opcode = G_MOVEMEM, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_MoveMem, - .ext = 1, - }, -#endif -#if defined(F3DEX_GBI_2) - [gfxd_SPDma_io] = - { - .prefix = NULL, - .suffix = "SPDma_io", - .opcode = G_DMA_IO, - .n_gfx = 1, - .n_arg = 4, - .disas_fn = d_SPDma_io, - }, - [gfxd_SPDmaRead] = - { - .prefix = NULL, - .suffix = "SPDmaRead", - .opcode = G_DMA_IO, - .n_gfx = 1, - .n_arg = 3, - .alias = gfxd_SPDma_io, - }, - [gfxd_SPDmaWrite] = - { - .prefix = NULL, - .suffix = "SPDmaWrite", - .opcode = G_DMA_IO, - .n_gfx = 1, - .n_arg = 3, - .alias = gfxd_SPDma_io, - }, -#endif -#if defined(F3DEX_GBI) || defined(F3DEX_GBI_2) - [gfxd_LoadUcode] = - { - .prefix = NULL, - .suffix = "LoadUcode", - .opcode = G_LOAD_UCODE, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_LoadUcode, - }, - [gfxd_SPLoadUcodeEx] = - { - .prefix = NULL, - .suffix = "SPLoadUcodeEx", - .opcode = G_RDPHALF_1, - .n_gfx = 2, - .n_arg = 3, - .combine_fn = c_SPLoadUcodeEx, - }, -#endif - [gfxd_TexRect] = - { - .prefix = NULL, - .suffix = "TexRect", - .opcode = G_TEXRECT, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_TexRect, - .ext = 1, - }, - [gfxd_TexRectFlip] = - { - .prefix = NULL, - .suffix = "TexRectFlip", - .opcode = G_TEXRECTFLIP, - .n_gfx = 1, - .n_arg = 5, - .disas_fn = d_TexRectFlip, - .ext = 1, - }, - [gfxd_SPNoOp] = - { - .prefix = NULL, - .suffix = "SPNoOp", - .opcode = G_SPNOOP, - .n_gfx = 1, - .n_arg = 0, - .disas_fn = d_SPNoOp, - }, -#if defined(F3DEX_GBI_2) - [gfxd_Special3] = - { - .prefix = NULL, - .suffix = "Special3", - .opcode = G_SPECIAL_3, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_Special3, - .ext = 1, - }, - [gfxd_Special2] = - { - .prefix = NULL, - .suffix = "Special2", - .opcode = G_SPECIAL_2, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_Special2, - .ext = 1, - }, - [gfxd_Special1] = - { - .prefix = NULL, - .suffix = "Special1", - .opcode = G_SPECIAL_1, - .n_gfx = 1, - .n_arg = 2, - .disas_fn = d_Special1, - .ext = 1, - }, -#endif -}; diff --git a/tools/ZAPD/lib/tinyxml2/tinyxml2.cpp b/tools/ZAPD/lib/tinyxml2/tinyxml2.cpp deleted file mode 100644 index 23a3a6ce47..0000000000 --- a/tools/ZAPD/lib/tinyxml2/tinyxml2.cpp +++ /dev/null @@ -1,2837 +0,0 @@ -/* -Original code by Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#include "tinyxml2.h" - -#include // yes, this one new style header, is in the Android SDK. -#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) -# include -# include -#else -# include -# include -#endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE) - // Microsoft Visual Studio, version 2005 and higher. Not WinCE. - /*int _snprintf_s( - char *buffer, - size_t sizeOfBuffer, - size_t count, - const char *format [, - argument] ... - );*/ - static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... ) - { - va_list va; - va_start( va, format ); - int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va ); - va_end( va ); - return result; - } - - static inline int TIXML_VSNPRINTF( char* buffer, size_t size, const char* format, va_list va ) - { - int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va ); - return result; - } - - #define TIXML_VSCPRINTF _vscprintf - #define TIXML_SSCANF sscanf_s -#elif defined _MSC_VER - // Microsoft Visual Studio 2003 and earlier or WinCE - #define TIXML_SNPRINTF _snprintf - #define TIXML_VSNPRINTF _vsnprintf - #define TIXML_SSCANF sscanf - #if (_MSC_VER < 1400 ) && (!defined WINCE) - // Microsoft Visual Studio 2003 and not WinCE. - #define TIXML_VSCPRINTF _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have. - #else - // Microsoft Visual Studio 2003 and earlier or WinCE. - static inline int TIXML_VSCPRINTF( const char* format, va_list va ) - { - int len = 512; - for (;;) { - len = len*2; - char* str = new char[len](); - const int required = _vsnprintf(str, len, format, va); - delete[] str; - if ( required != -1 ) { - TIXMLASSERT( required >= 0 ); - len = required; - break; - } - } - TIXMLASSERT( len >= 0 ); - return len; - } - #endif -#else - // GCC version 3 and higher - //#warning( "Using sn* functions." ) - #define TIXML_SNPRINTF snprintf - #define TIXML_VSNPRINTF vsnprintf - static inline int TIXML_VSCPRINTF( const char* format, va_list va ) - { - int len = vsnprintf( 0, 0, format, va ); - TIXMLASSERT( len >= 0 ); - return len; - } - #define TIXML_SSCANF sscanf -#endif - - -static const char LINE_FEED = (char)0x0a; // all line endings are normalized to LF -static const char LF = LINE_FEED; -static const char CARRIAGE_RETURN = (char)0x0d; // CR gets filtered out -static const char CR = CARRIAGE_RETURN; -static const char SINGLE_QUOTE = '\''; -static const char DOUBLE_QUOTE = '\"'; - -// Bunch of unicode info at: -// http://www.unicode.org/faq/utf_bom.html -// ef bb bf (Microsoft "lead bytes") - designates UTF-8 - -static const unsigned char TIXML_UTF_LEAD_0 = 0xefU; -static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; -static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - -namespace tinyxml2 -{ - -struct Entity { - const char* pattern; - int length; - char value; -}; - -static const int NUM_ENTITIES = 5; -static const Entity entities[NUM_ENTITIES] = { - { "quot", 4, DOUBLE_QUOTE }, - { "amp", 3, '&' }, - { "apos", 4, SINGLE_QUOTE }, - { "lt", 2, '<' }, - { "gt", 2, '>' } -}; - - -StrPair::~StrPair() -{ - Reset(); -} - - -void StrPair::TransferTo( StrPair* other ) -{ - if ( this == other ) { - return; - } - // This in effect implements the assignment operator by "moving" - // ownership (as in auto_ptr). - - TIXMLASSERT( other != 0 ); - TIXMLASSERT( other->_flags == 0 ); - TIXMLASSERT( other->_start == 0 ); - TIXMLASSERT( other->_end == 0 ); - - other->Reset(); - - other->_flags = _flags; - other->_start = _start; - other->_end = _end; - - _flags = 0; - _start = 0; - _end = 0; -} - - -void StrPair::Reset() -{ - if ( _flags & NEEDS_DELETE ) { - delete [] _start; - } - _flags = 0; - _start = 0; - _end = 0; -} - - -void StrPair::SetStr( const char* str, int flags ) -{ - TIXMLASSERT( str ); - Reset(); - size_t len = strlen( str ); - TIXMLASSERT( _start == 0 ); - _start = new char[ len+1 ]; - memcpy( _start, str, len+1 ); - _end = _start + len; - _flags = flags | NEEDS_DELETE; -} - - -char* StrPair::ParseText( char* p, const char* endTag, int strFlags, int* curLineNumPtr ) -{ - TIXMLASSERT( p ); - TIXMLASSERT( endTag && *endTag ); - TIXMLASSERT(curLineNumPtr); - - char* start = p; - char endChar = *endTag; - size_t length = strlen( endTag ); - - // Inner loop of text parsing. - while ( *p ) { - if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) { - Set( start, p, strFlags ); - return p + length; - } else if (*p == '\n') { - ++(*curLineNumPtr); - } - ++p; - TIXMLASSERT( p ); - } - return 0; -} - - -char* StrPair::ParseName( char* p ) -{ - if ( !p || !(*p) ) { - return 0; - } - if ( !XMLUtil::IsNameStartChar( *p ) ) { - return 0; - } - - char* const start = p; - ++p; - while ( *p && XMLUtil::IsNameChar( *p ) ) { - ++p; - } - - Set( start, p, 0 ); - return p; -} - - -void StrPair::CollapseWhitespace() -{ - // Adjusting _start would cause undefined behavior on delete[] - TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 ); - // Trim leading space. - _start = XMLUtil::SkipWhiteSpace( _start, 0 ); - - if ( *_start ) { - const char* p = _start; // the read pointer - char* q = _start; // the write pointer - - while( *p ) { - if ( XMLUtil::IsWhiteSpace( *p )) { - p = XMLUtil::SkipWhiteSpace( p, 0 ); - if ( *p == 0 ) { - break; // don't write to q; this trims the trailing space. - } - *q = ' '; - ++q; - } - *q = *p; - ++q; - ++p; - } - *q = 0; - } -} - - -const char* StrPair::GetStr() -{ - TIXMLASSERT( _start ); - TIXMLASSERT( _end ); - if ( _flags & NEEDS_FLUSH ) { - *_end = 0; - _flags ^= NEEDS_FLUSH; - - if ( _flags ) { - const char* p = _start; // the read pointer - char* q = _start; // the write pointer - - while( p < _end ) { - if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) { - // CR-LF pair becomes LF - // CR alone becomes LF - // LF-CR becomes LF - if ( *(p+1) == LF ) { - p += 2; - } - else { - ++p; - } - *q = LF; - ++q; - } - else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) { - if ( *(p+1) == CR ) { - p += 2; - } - else { - ++p; - } - *q = LF; - ++q; - } - else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) { - // Entities handled by tinyXML2: - // - special entities in the entity table [in/out] - // - numeric character reference [in] - // 中 or 中 - - if ( *(p+1) == '#' ) { - const int buflen = 10; - char buf[buflen] = { 0 }; - int len = 0; - char* adjusted = const_cast( XMLUtil::GetCharacterRef( p, buf, &len ) ); - if ( adjusted == 0 ) { - *q = *p; - ++p; - ++q; - } - else { - TIXMLASSERT( 0 <= len && len <= buflen ); - TIXMLASSERT( q + len <= adjusted ); - p = adjusted; - memcpy( q, buf, len ); - q += len; - } - } - else { - bool entityFound = false; - for( int i = 0; i < NUM_ENTITIES; ++i ) { - const Entity& entity = entities[i]; - if ( strncmp( p + 1, entity.pattern, entity.length ) == 0 - && *( p + entity.length + 1 ) == ';' ) { - // Found an entity - convert. - *q = entity.value; - ++q; - p += entity.length + 2; - entityFound = true; - break; - } - } - if ( !entityFound ) { - // fixme: treat as error? - ++p; - ++q; - } - } - } - else { - *q = *p; - ++p; - ++q; - } - } - *q = 0; - } - // The loop below has plenty going on, and this - // is a less useful mode. Break it out. - if ( _flags & NEEDS_WHITESPACE_COLLAPSING ) { - CollapseWhitespace(); - } - _flags = (_flags & NEEDS_DELETE); - } - TIXMLASSERT( _start ); - return _start; -} - - - - -// --------- XMLUtil ----------- // - -const char* XMLUtil::writeBoolTrue = "true"; -const char* XMLUtil::writeBoolFalse = "false"; - -void XMLUtil::SetBoolSerialization(const char* writeTrue, const char* writeFalse) -{ - static const char* defTrue = "true"; - static const char* defFalse = "false"; - - writeBoolTrue = (writeTrue) ? writeTrue : defTrue; - writeBoolFalse = (writeFalse) ? writeFalse : defFalse; -} - - -const char* XMLUtil::ReadBOM( const char* p, bool* bom ) -{ - TIXMLASSERT( p ); - TIXMLASSERT( bom ); - *bom = false; - const unsigned char* pu = reinterpret_cast(p); - // Check for BOM: - if ( *(pu+0) == TIXML_UTF_LEAD_0 - && *(pu+1) == TIXML_UTF_LEAD_1 - && *(pu+2) == TIXML_UTF_LEAD_2 ) { - *bom = true; - p += 3; - } - TIXMLASSERT( p ); - return p; -} - - -void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) -{ - const unsigned long BYTE_MASK = 0xBF; - const unsigned long BYTE_MARK = 0x80; - const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - - if (input < 0x80) { - *length = 1; - } - else if ( input < 0x800 ) { - *length = 2; - } - else if ( input < 0x10000 ) { - *length = 3; - } - else if ( input < 0x200000 ) { - *length = 4; - } - else { - *length = 0; // This code won't convert this correctly anyway. - return; - } - - output += *length; - - // Scary scary fall throughs are annotated with carefully designed comments - // to suppress compiler warnings such as -Wimplicit-fallthrough in gcc - switch (*length) { - case 4: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - //fall through - case 3: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - //fall through - case 2: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - //fall through - case 1: - --output; - *output = (char)(input | FIRST_BYTE_MARK[*length]); - break; - default: - TIXMLASSERT( false ); - } -} - - -const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) -{ - // Presume an entity, and pull it out. - *length = 0; - - if ( *(p+1) == '#' && *(p+2) ) { - unsigned long ucs = 0; - TIXMLASSERT( sizeof( ucs ) >= 4 ); - ptrdiff_t delta = 0; - unsigned mult = 1; - static const char SEMICOLON = ';'; - - if ( *(p+2) == 'x' ) { - // Hexadecimal. - const char* q = p+3; - if ( !(*q) ) { - return 0; - } - - q = strchr( q, SEMICOLON ); - - if ( !q ) { - return 0; - } - TIXMLASSERT( *q == SEMICOLON ); - - delta = q-p; - --q; - - while ( *q != 'x' ) { - unsigned int digit = 0; - - if ( *q >= '0' && *q <= '9' ) { - digit = *q - '0'; - } - else if ( *q >= 'a' && *q <= 'f' ) { - digit = *q - 'a' + 10; - } - else if ( *q >= 'A' && *q <= 'F' ) { - digit = *q - 'A' + 10; - } - else { - return 0; - } - TIXMLASSERT( digit < 16 ); - TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit ); - const unsigned int digitScaled = mult * digit; - TIXMLASSERT( ucs <= ULONG_MAX - digitScaled ); - ucs += digitScaled; - TIXMLASSERT( mult <= UINT_MAX / 16 ); - mult *= 16; - --q; - } - } - else { - // Decimal. - const char* q = p+2; - if ( !(*q) ) { - return 0; - } - - q = strchr( q, SEMICOLON ); - - if ( !q ) { - return 0; - } - TIXMLASSERT( *q == SEMICOLON ); - - delta = q-p; - --q; - - while ( *q != '#' ) { - if ( *q >= '0' && *q <= '9' ) { - const unsigned int digit = *q - '0'; - TIXMLASSERT( digit < 10 ); - TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit ); - const unsigned int digitScaled = mult * digit; - TIXMLASSERT( ucs <= ULONG_MAX - digitScaled ); - ucs += digitScaled; - } - else { - return 0; - } - TIXMLASSERT( mult <= UINT_MAX / 10 ); - mult *= 10; - --q; - } - } - // convert the UCS to UTF-8 - ConvertUTF32ToUTF8( ucs, value, length ); - return p + delta + 1; - } - return p+1; -} - - -void XMLUtil::ToStr( int v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%d", v ); -} - - -void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%u", v ); -} - - -void XMLUtil::ToStr( bool v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%s", v ? writeBoolTrue : writeBoolFalse); -} - -/* - ToStr() of a number is a very tricky topic. - https://github.com/leethomason/tinyxml2/issues/106 -*/ -void XMLUtil::ToStr( float v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%.8g", v ); -} - - -void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%.17g", v ); -} - - -void XMLUtil::ToStr(int64_t v, char* buffer, int bufferSize) -{ - // horrible syntax trick to make the compiler happy about %lld - TIXML_SNPRINTF(buffer, bufferSize, "%lld", (long long)v); -} - - -bool XMLUtil::ToInt( const char* str, int* value ) -{ - if ( TIXML_SSCANF( str, "%d", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToUnsigned( const char* str, unsigned *value ) -{ - if ( TIXML_SSCANF( str, "%u", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToBool( const char* str, bool* value ) -{ - int ival = 0; - if ( ToInt( str, &ival )) { - *value = (ival==0) ? false : true; - return true; - } - if ( StringEqual( str, "true" ) ) { - *value = true; - return true; - } - else if ( StringEqual( str, "false" ) ) { - *value = false; - return true; - } - return false; -} - - -bool XMLUtil::ToFloat( const char* str, float* value ) -{ - if ( TIXML_SSCANF( str, "%f", value ) == 1 ) { - return true; - } - return false; -} - - -bool XMLUtil::ToDouble( const char* str, double* value ) -{ - if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) { - return true; - } - return false; -} - - -bool XMLUtil::ToInt64(const char* str, int64_t* value) -{ - long long v = 0; // horrible syntax trick to make the compiler happy about %lld - if (TIXML_SSCANF(str, "%lld", &v) == 1) { - *value = (int64_t)v; - return true; - } - return false; -} - - -char* XMLDocument::Identify( char* p, XMLNode** node ) -{ - TIXMLASSERT( node ); - TIXMLASSERT( p ); - char* const start = p; - int const startLine = _parseCurLineNum; - p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum ); - if( !*p ) { - *node = 0; - TIXMLASSERT( p ); - return p; - } - - // These strings define the matching patterns: - static const char* xmlHeader = { "( _commentPool ); - returnNode->_parseLineNum = _parseCurLineNum; - p += xmlHeaderLen; - } - else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) { - returnNode = CreateUnlinkedNode( _commentPool ); - returnNode->_parseLineNum = _parseCurLineNum; - p += commentHeaderLen; - } - else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) { - XMLText* text = CreateUnlinkedNode( _textPool ); - returnNode = text; - returnNode->_parseLineNum = _parseCurLineNum; - p += cdataHeaderLen; - text->SetCData( true ); - } - else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) { - returnNode = CreateUnlinkedNode( _commentPool ); - returnNode->_parseLineNum = _parseCurLineNum; - p += dtdHeaderLen; - } - else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) { - returnNode = CreateUnlinkedNode( _elementPool ); - returnNode->_parseLineNum = _parseCurLineNum; - p += elementHeaderLen; - } - else { - returnNode = CreateUnlinkedNode( _textPool ); - returnNode->_parseLineNum = _parseCurLineNum; // Report line of first non-whitespace character - p = start; // Back it up, all the text counts. - _parseCurLineNum = startLine; - } - - TIXMLASSERT( returnNode ); - TIXMLASSERT( p ); - *node = returnNode; - return p; -} - - -bool XMLDocument::Accept( XMLVisitor* visitor ) const -{ - TIXMLASSERT( visitor ); - if ( visitor->VisitEnter( *this ) ) { - for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) { - if ( !node->Accept( visitor ) ) { - break; - } - } - } - return visitor->VisitExit( *this ); -} - - -// --------- XMLNode ----------- // - -XMLNode::XMLNode( XMLDocument* doc ) : - _document( doc ), - _parent( 0 ), - _value(), - _parseLineNum( 0 ), - _firstChild( 0 ), _lastChild( 0 ), - _prev( 0 ), _next( 0 ), - _userData( 0 ), - _memPool( 0 ) -{ -} - - -XMLNode::~XMLNode() -{ - DeleteChildren(); - if ( _parent ) { - _parent->Unlink( this ); - } -} - -const char* XMLNode::Value() const -{ - // Edge case: XMLDocuments don't have a Value. Return null. - if ( this->ToDocument() ) - return 0; - return _value.GetStr(); -} - -void XMLNode::SetValue( const char* str, bool staticMem ) -{ - if ( staticMem ) { - _value.SetInternedStr( str ); - } - else { - _value.SetStr( str ); - } -} - -XMLNode* XMLNode::DeepClone(XMLDocument* target) const -{ - XMLNode* clone = this->ShallowClone(target); - if (!clone) return 0; - - for (const XMLNode* child = this->FirstChild(); child; child = child->NextSibling()) { - XMLNode* childClone = child->DeepClone(target); - TIXMLASSERT(childClone); - clone->InsertEndChild(childClone); - } - return clone; -} - -void XMLNode::DeleteChildren() -{ - while( _firstChild ) { - TIXMLASSERT( _lastChild ); - DeleteChild( _firstChild ); - } - _firstChild = _lastChild = 0; -} - - -void XMLNode::Unlink( XMLNode* child ) -{ - TIXMLASSERT( child ); - TIXMLASSERT( child->_document == _document ); - TIXMLASSERT( child->_parent == this ); - if ( child == _firstChild ) { - _firstChild = _firstChild->_next; - } - if ( child == _lastChild ) { - _lastChild = _lastChild->_prev; - } - - if ( child->_prev ) { - child->_prev->_next = child->_next; - } - if ( child->_next ) { - child->_next->_prev = child->_prev; - } - child->_next = 0; - child->_prev = 0; - child->_parent = 0; -} - - -void XMLNode::DeleteChild( XMLNode* node ) -{ - TIXMLASSERT( node ); - TIXMLASSERT( node->_document == _document ); - TIXMLASSERT( node->_parent == this ); - Unlink( node ); - TIXMLASSERT(node->_prev == 0); - TIXMLASSERT(node->_next == 0); - TIXMLASSERT(node->_parent == 0); - DeleteNode( node ); -} - - -XMLNode* XMLNode::InsertEndChild( XMLNode* addThis ) -{ - TIXMLASSERT( addThis ); - if ( addThis->_document != _document ) { - TIXMLASSERT( false ); - return 0; - } - InsertChildPreamble( addThis ); - - if ( _lastChild ) { - TIXMLASSERT( _firstChild ); - TIXMLASSERT( _lastChild->_next == 0 ); - _lastChild->_next = addThis; - addThis->_prev = _lastChild; - _lastChild = addThis; - - addThis->_next = 0; - } - else { - TIXMLASSERT( _firstChild == 0 ); - _firstChild = _lastChild = addThis; - - addThis->_prev = 0; - addThis->_next = 0; - } - addThis->_parent = this; - return addThis; -} - - -XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis ) -{ - TIXMLASSERT( addThis ); - if ( addThis->_document != _document ) { - TIXMLASSERT( false ); - return 0; - } - InsertChildPreamble( addThis ); - - if ( _firstChild ) { - TIXMLASSERT( _lastChild ); - TIXMLASSERT( _firstChild->_prev == 0 ); - - _firstChild->_prev = addThis; - addThis->_next = _firstChild; - _firstChild = addThis; - - addThis->_prev = 0; - } - else { - TIXMLASSERT( _lastChild == 0 ); - _firstChild = _lastChild = addThis; - - addThis->_prev = 0; - addThis->_next = 0; - } - addThis->_parent = this; - return addThis; -} - - -XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ) -{ - TIXMLASSERT( addThis ); - if ( addThis->_document != _document ) { - TIXMLASSERT( false ); - return 0; - } - - TIXMLASSERT( afterThis ); - - if ( afterThis->_parent != this ) { - TIXMLASSERT( false ); - return 0; - } - if ( afterThis == addThis ) { - // Current state: BeforeThis -> AddThis -> OneAfterAddThis - // Now AddThis must disappear from it's location and then - // reappear between BeforeThis and OneAfterAddThis. - // So just leave it where it is. - return addThis; - } - - if ( afterThis->_next == 0 ) { - // The last node or the only node. - return InsertEndChild( addThis ); - } - InsertChildPreamble( addThis ); - addThis->_prev = afterThis; - addThis->_next = afterThis->_next; - afterThis->_next->_prev = addThis; - afterThis->_next = addThis; - addThis->_parent = this; - return addThis; -} - - - - -const XMLElement* XMLNode::FirstChildElement( const char* name ) const -{ - for( const XMLNode* node = _firstChild; node; node = node->_next ) { - const XMLElement* element = node->ToElementWithName( name ); - if ( element ) { - return element; - } - } - return 0; -} - - -const XMLElement* XMLNode::LastChildElement( const char* name ) const -{ - for( const XMLNode* node = _lastChild; node; node = node->_prev ) { - const XMLElement* element = node->ToElementWithName( name ); - if ( element ) { - return element; - } - } - return 0; -} - - -const XMLElement* XMLNode::NextSiblingElement( const char* name ) const -{ - for( const XMLNode* node = _next; node; node = node->_next ) { - const XMLElement* element = node->ToElementWithName( name ); - if ( element ) { - return element; - } - } - return 0; -} - - -const XMLElement* XMLNode::PreviousSiblingElement( const char* name ) const -{ - for( const XMLNode* node = _prev; node; node = node->_prev ) { - const XMLElement* element = node->ToElementWithName( name ); - if ( element ) { - return element; - } - } - return 0; -} - - -char* XMLNode::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) -{ - // This is a recursive method, but thinking about it "at the current level" - // it is a pretty simple flat list: - // - // - // - // With a special case: - // - // - // - // - // Where the closing element (/foo) *must* be the next thing after the opening - // element, and the names must match. BUT the tricky bit is that the closing - // element will be read by the child. - // - // 'endTag' is the end tag for this node, it is returned by a call to a child. - // 'parentEnd' is the end tag for the parent, which is filled in and returned. - - XMLDocument::DepthTracker tracker(_document); - if (_document->Error()) - return 0; - - while( p && *p ) { - XMLNode* node = 0; - - p = _document->Identify( p, &node ); - TIXMLASSERT( p ); - if ( node == 0 ) { - break; - } - - int initialLineNum = node->_parseLineNum; - - StrPair endTag; - p = node->ParseDeep( p, &endTag, curLineNumPtr ); - if ( !p ) { - DeleteNode( node ); - if ( !_document->Error() ) { - _document->SetError( XML_ERROR_PARSING, initialLineNum, 0); - } - break; - } - - XMLDeclaration* decl = node->ToDeclaration(); - if ( decl ) { - // Declarations are only allowed at document level - // - // Multiple declarations are allowed but all declarations - // must occur before anything else. - // - // Optimized due to a security test case. If the first node is - // a declaration, and the last node is a declaration, then only - // declarations have so far been addded. - bool wellLocated = false; - - if (ToDocument()) { - if (FirstChild()) { - wellLocated = - FirstChild() && - FirstChild()->ToDeclaration() && - LastChild() && - LastChild()->ToDeclaration(); - } - else { - wellLocated = true; - } - } - if ( !wellLocated ) { - _document->SetError( XML_ERROR_PARSING_DECLARATION, initialLineNum, "XMLDeclaration value=%s", decl->Value()); - DeleteNode( node ); - break; - } - } - - XMLElement* ele = node->ToElement(); - if ( ele ) { - // We read the end tag. Return it to the parent. - if ( ele->ClosingType() == XMLElement::CLOSING ) { - if ( parentEndTag ) { - ele->_value.TransferTo( parentEndTag ); - } - node->_memPool->SetTracked(); // created and then immediately deleted. - DeleteNode( node ); - return p; - } - - // Handle an end tag returned to this level. - // And handle a bunch of annoying errors. - bool mismatch = false; - if ( endTag.Empty() ) { - if ( ele->ClosingType() == XMLElement::OPEN ) { - mismatch = true; - } - } - else { - if ( ele->ClosingType() != XMLElement::OPEN ) { - mismatch = true; - } - else if ( !XMLUtil::StringEqual( endTag.GetStr(), ele->Name() ) ) { - mismatch = true; - } - } - if ( mismatch ) { - _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, initialLineNum, "XMLElement name=%s", ele->Name()); - DeleteNode( node ); - break; - } - } - InsertEndChild( node ); - } - return 0; -} - -/*static*/ void XMLNode::DeleteNode( XMLNode* node ) -{ - if ( node == 0 ) { - return; - } - TIXMLASSERT(node->_document); - if (!node->ToDocument()) { - node->_document->MarkInUse(node); - } - - MemPool* pool = node->_memPool; - node->~XMLNode(); - pool->Free( node ); -} - -void XMLNode::InsertChildPreamble( XMLNode* insertThis ) const -{ - TIXMLASSERT( insertThis ); - TIXMLASSERT( insertThis->_document == _document ); - - if (insertThis->_parent) { - insertThis->_parent->Unlink( insertThis ); - } - else { - insertThis->_document->MarkInUse(insertThis); - insertThis->_memPool->SetTracked(); - } -} - -const XMLElement* XMLNode::ToElementWithName( const char* name ) const -{ - const XMLElement* element = this->ToElement(); - if ( element == 0 ) { - return 0; - } - if ( name == 0 ) { - return element; - } - if ( XMLUtil::StringEqual( element->Name(), name ) ) { - return element; - } - return 0; -} - -// --------- XMLText ---------- // -char* XMLText::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) -{ - if ( this->CData() ) { - p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_CDATA, _parseLineNum, 0 ); - } - return p; - } - else { - int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES; - if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) { - flags |= StrPair::NEEDS_WHITESPACE_COLLAPSING; - } - - p = _value.ParseText( p, "<", flags, curLineNumPtr ); - if ( p && *p ) { - return p-1; - } - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_TEXT, _parseLineNum, 0 ); - } - } - return 0; -} - - -XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLText* text = doc->NewText( Value() ); // fixme: this will always allocate memory. Intern? - text->SetCData( this->CData() ); - return text; -} - - -bool XMLText::ShallowEqual( const XMLNode* compare ) const -{ - TIXMLASSERT( compare ); - const XMLText* text = compare->ToText(); - return ( text && XMLUtil::StringEqual( text->Value(), Value() ) ); -} - - -bool XMLText::Accept( XMLVisitor* visitor ) const -{ - TIXMLASSERT( visitor ); - return visitor->Visit( *this ); -} - - -// --------- XMLComment ---------- // - -XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLComment::~XMLComment() -{ -} - - -char* XMLComment::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) -{ - // Comment parses as text. - p = _value.ParseText( p, "-->", StrPair::COMMENT, curLineNumPtr ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_COMMENT, _parseLineNum, 0 ); - } - return p; -} - - -XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLComment* comment = doc->NewComment( Value() ); // fixme: this will always allocate memory. Intern? - return comment; -} - - -bool XMLComment::ShallowEqual( const XMLNode* compare ) const -{ - TIXMLASSERT( compare ); - const XMLComment* comment = compare->ToComment(); - return ( comment && XMLUtil::StringEqual( comment->Value(), Value() )); -} - - -bool XMLComment::Accept( XMLVisitor* visitor ) const -{ - TIXMLASSERT( visitor ); - return visitor->Visit( *this ); -} - - -// --------- XMLDeclaration ---------- // - -XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLDeclaration::~XMLDeclaration() -{ - //printf( "~XMLDeclaration\n" ); -} - - -char* XMLDeclaration::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) -{ - // Declaration parses as text. - p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_DECLARATION, _parseLineNum, 0 ); - } - return p; -} - - -XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLDeclaration* dec = doc->NewDeclaration( Value() ); // fixme: this will always allocate memory. Intern? - return dec; -} - - -bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const -{ - TIXMLASSERT( compare ); - const XMLDeclaration* declaration = compare->ToDeclaration(); - return ( declaration && XMLUtil::StringEqual( declaration->Value(), Value() )); -} - - - -bool XMLDeclaration::Accept( XMLVisitor* visitor ) const -{ - TIXMLASSERT( visitor ); - return visitor->Visit( *this ); -} - -// --------- XMLUnknown ---------- // - -XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLUnknown::~XMLUnknown() -{ -} - - -char* XMLUnknown::ParseDeep( char* p, StrPair*, int* curLineNumPtr ) -{ - // Unknown parses as text. - p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_UNKNOWN, _parseLineNum, 0 ); - } - return p; -} - - -XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLUnknown* text = doc->NewUnknown( Value() ); // fixme: this will always allocate memory. Intern? - return text; -} - - -bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const -{ - TIXMLASSERT( compare ); - const XMLUnknown* unknown = compare->ToUnknown(); - return ( unknown && XMLUtil::StringEqual( unknown->Value(), Value() )); -} - - -bool XMLUnknown::Accept( XMLVisitor* visitor ) const -{ - TIXMLASSERT( visitor ); - return visitor->Visit( *this ); -} - -// --------- XMLAttribute ---------- // - -const char* XMLAttribute::Name() const -{ - return _name.GetStr(); -} - -const char* XMLAttribute::Value() const -{ - return _value.GetStr(); -} - -char* XMLAttribute::ParseDeep( char* p, bool processEntities, int* curLineNumPtr ) -{ - // Parse using the name rules: bug fix, was using ParseText before - p = _name.ParseName( p ); - if ( !p || !*p ) { - return 0; - } - - // Skip white space before = - p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); - if ( *p != '=' ) { - return 0; - } - - ++p; // move up to opening quote - p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); - if ( *p != '\"' && *p != '\'' ) { - return 0; - } - - char endTag[2] = { *p, 0 }; - ++p; // move past opening quote - - p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES, curLineNumPtr ); - return p; -} - - -void XMLAttribute::SetName( const char* n ) -{ - _name.SetStr( n ); -} - - -XMLError XMLAttribute::QueryIntValue( int* value ) const -{ - if ( XMLUtil::ToInt( Value(), value )) { - return XML_SUCCESS; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const -{ - if ( XMLUtil::ToUnsigned( Value(), value )) { - return XML_SUCCESS; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryInt64Value(int64_t* value) const -{ - if (XMLUtil::ToInt64(Value(), value)) { - return XML_SUCCESS; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryBoolValue( bool* value ) const -{ - if ( XMLUtil::ToBool( Value(), value )) { - return XML_SUCCESS; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryFloatValue( float* value ) const -{ - if ( XMLUtil::ToFloat( Value(), value )) { - return XML_SUCCESS; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryDoubleValue( double* value ) const -{ - if ( XMLUtil::ToDouble( Value(), value )) { - return XML_SUCCESS; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -void XMLAttribute::SetAttribute( const char* v ) -{ - _value.SetStr( v ); -} - - -void XMLAttribute::SetAttribute( int v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -void XMLAttribute::SetAttribute( unsigned v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -void XMLAttribute::SetAttribute(int64_t v) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr(v, buf, BUF_SIZE); - _value.SetStr(buf); -} - - - -void XMLAttribute::SetAttribute( bool v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - -void XMLAttribute::SetAttribute( double v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - -void XMLAttribute::SetAttribute( float v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -// --------- XMLElement ---------- // -XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ), - _closingType( OPEN ), - _rootAttribute( 0 ) -{ -} - - -XMLElement::~XMLElement() -{ - while( _rootAttribute ) { - XMLAttribute* next = _rootAttribute->_next; - DeleteAttribute( _rootAttribute ); - _rootAttribute = next; - } -} - - -const XMLAttribute* XMLElement::FindAttribute( const char* name ) const -{ - for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) { - if ( XMLUtil::StringEqual( a->Name(), name ) ) { - return a; - } - } - return 0; -} - - -const char* XMLElement::Attribute( const char* name, const char* value ) const -{ - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return 0; - } - if ( !value || XMLUtil::StringEqual( a->Value(), value )) { - return a->Value(); - } - return 0; -} - -int XMLElement::IntAttribute(const char* name, int defaultValue) const -{ - int i = defaultValue; - QueryIntAttribute(name, &i); - return i; -} - -unsigned XMLElement::UnsignedAttribute(const char* name, unsigned defaultValue) const -{ - unsigned i = defaultValue; - QueryUnsignedAttribute(name, &i); - return i; -} - -int64_t XMLElement::Int64Attribute(const char* name, int64_t defaultValue) const -{ - int64_t i = defaultValue; - QueryInt64Attribute(name, &i); - return i; -} - -bool XMLElement::BoolAttribute(const char* name, bool defaultValue) const -{ - bool b = defaultValue; - QueryBoolAttribute(name, &b); - return b; -} - -double XMLElement::DoubleAttribute(const char* name, double defaultValue) const -{ - double d = defaultValue; - QueryDoubleAttribute(name, &d); - return d; -} - -float XMLElement::FloatAttribute(const char* name, float defaultValue) const -{ - float f = defaultValue; - QueryFloatAttribute(name, &f); - return f; -} - -const char* XMLElement::GetText() const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - return FirstChild()->Value(); - } - return 0; -} - - -void XMLElement::SetText( const char* inText ) -{ - if ( FirstChild() && FirstChild()->ToText() ) - FirstChild()->SetValue( inText ); - else { - XMLText* theText = GetDocument()->NewText( inText ); - InsertFirstChild( theText ); - } -} - - -void XMLElement::SetText( int v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - SetText( buf ); -} - - -void XMLElement::SetText( unsigned v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - SetText( buf ); -} - - -void XMLElement::SetText(int64_t v) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr(v, buf, BUF_SIZE); - SetText(buf); -} - - -void XMLElement::SetText( bool v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - SetText( buf ); -} - - -void XMLElement::SetText( float v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - SetText( buf ); -} - - -void XMLElement::SetText( double v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - SetText( buf ); -} - - -XMLError XMLElement::QueryIntText( int* ival ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->Value(); - if ( XMLUtil::ToInt( t, ival ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->Value(); - if ( XMLUtil::ToUnsigned( t, uval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryInt64Text(int64_t* ival) const -{ - if (FirstChild() && FirstChild()->ToText()) { - const char* t = FirstChild()->Value(); - if (XMLUtil::ToInt64(t, ival)) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryBoolText( bool* bval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->Value(); - if ( XMLUtil::ToBool( t, bval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryDoubleText( double* dval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->Value(); - if ( XMLUtil::ToDouble( t, dval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryFloatText( float* fval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->Value(); - if ( XMLUtil::ToFloat( t, fval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - -int XMLElement::IntText(int defaultValue) const -{ - int i = defaultValue; - QueryIntText(&i); - return i; -} - -unsigned XMLElement::UnsignedText(unsigned defaultValue) const -{ - unsigned i = defaultValue; - QueryUnsignedText(&i); - return i; -} - -int64_t XMLElement::Int64Text(int64_t defaultValue) const -{ - int64_t i = defaultValue; - QueryInt64Text(&i); - return i; -} - -bool XMLElement::BoolText(bool defaultValue) const -{ - bool b = defaultValue; - QueryBoolText(&b); - return b; -} - -double XMLElement::DoubleText(double defaultValue) const -{ - double d = defaultValue; - QueryDoubleText(&d); - return d; -} - -float XMLElement::FloatText(float defaultValue) const -{ - float f = defaultValue; - QueryFloatText(&f); - return f; -} - - -XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) -{ - XMLAttribute* last = 0; - XMLAttribute* attrib = 0; - for( attrib = _rootAttribute; - attrib; - last = attrib, attrib = attrib->_next ) { - if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { - break; - } - } - if ( !attrib ) { - attrib = CreateAttribute(); - TIXMLASSERT( attrib ); - if ( last ) { - TIXMLASSERT( last->_next == 0 ); - last->_next = attrib; - } - else { - TIXMLASSERT( _rootAttribute == 0 ); - _rootAttribute = attrib; - } - attrib->SetName( name ); - } - return attrib; -} - - -void XMLElement::DeleteAttribute( const char* name ) -{ - XMLAttribute* prev = 0; - for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) { - if ( XMLUtil::StringEqual( name, a->Name() ) ) { - if ( prev ) { - prev->_next = a->_next; - } - else { - _rootAttribute = a->_next; - } - DeleteAttribute( a ); - break; - } - prev = a; - } -} - - -char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) -{ - XMLAttribute* prevAttribute = 0; - - // Read the attributes. - while( p ) { - p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); - if ( !(*p) ) { - _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, "XMLElement name=%s", Name() ); - return 0; - } - - // attribute. - if (XMLUtil::IsNameStartChar( *p ) ) { - XMLAttribute* attrib = CreateAttribute(); - TIXMLASSERT( attrib ); - attrib->_parseLineNum = _document->_parseCurLineNum; - - int attrLineNum = attrib->_parseLineNum; - - p = attrib->ParseDeep( p, _document->ProcessEntities(), curLineNumPtr ); - if ( !p || Attribute( attrib->Name() ) ) { - DeleteAttribute( attrib ); - _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, attrLineNum, "XMLElement name=%s", Name() ); - return 0; - } - // There is a minor bug here: if the attribute in the source xml - // document is duplicated, it will not be detected and the - // attribute will be doubly added. However, tracking the 'prevAttribute' - // avoids re-scanning the attribute list. Preferring performance for - // now, may reconsider in the future. - if ( prevAttribute ) { - TIXMLASSERT( prevAttribute->_next == 0 ); - prevAttribute->_next = attrib; - } - else { - TIXMLASSERT( _rootAttribute == 0 ); - _rootAttribute = attrib; - } - prevAttribute = attrib; - } - // end of the tag - else if ( *p == '>' ) { - ++p; - break; - } - // end of the tag - else if ( *p == '/' && *(p+1) == '>' ) { - _closingType = CLOSED; - return p+2; // done; sealed element. - } - else { - _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, 0 ); - return 0; - } - } - return p; -} - -void XMLElement::DeleteAttribute( XMLAttribute* attribute ) -{ - if ( attribute == 0 ) { - return; - } - MemPool* pool = attribute->_memPool; - attribute->~XMLAttribute(); - pool->Free( attribute ); -} - -XMLAttribute* XMLElement::CreateAttribute() -{ - TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() ); - XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); - TIXMLASSERT( attrib ); - attrib->_memPool = &_document->_attributePool; - attrib->_memPool->SetTracked(); - return attrib; -} - -// -// -// foobar -// -char* XMLElement::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ) -{ - // Read the element name. - p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr ); - - // The closing element is the form. It is - // parsed just like a regular element then deleted from - // the DOM. - if ( *p == '/' ) { - _closingType = CLOSING; - ++p; - } - - p = _value.ParseName( p ); - if ( _value.Empty() ) { - return 0; - } - - p = ParseAttributes( p, curLineNumPtr ); - if ( !p || !*p || _closingType != OPEN ) { - return p; - } - - p = XMLNode::ParseDeep( p, parentEndTag, curLineNumPtr ); - return p; -} - - - -XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLElement* element = doc->NewElement( Value() ); // fixme: this will always allocate memory. Intern? - for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) { - element->SetAttribute( a->Name(), a->Value() ); // fixme: this will always allocate memory. Intern? - } - return element; -} - - -bool XMLElement::ShallowEqual( const XMLNode* compare ) const -{ - TIXMLASSERT( compare ); - const XMLElement* other = compare->ToElement(); - if ( other && XMLUtil::StringEqual( other->Name(), Name() )) { - - const XMLAttribute* a=FirstAttribute(); - const XMLAttribute* b=other->FirstAttribute(); - - while ( a && b ) { - if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) { - return false; - } - a = a->Next(); - b = b->Next(); - } - if ( a || b ) { - // different count - return false; - } - return true; - } - return false; -} - - -bool XMLElement::Accept( XMLVisitor* visitor ) const -{ - TIXMLASSERT( visitor ); - if ( visitor->VisitEnter( *this, _rootAttribute ) ) { - for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) { - if ( !node->Accept( visitor ) ) { - break; - } - } - } - return visitor->VisitExit( *this ); -} - - -// --------- XMLDocument ----------- // - -// Warning: List must match 'enum XMLError' -const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = { - "XML_SUCCESS", - "XML_NO_ATTRIBUTE", - "XML_WRONG_ATTRIBUTE_TYPE", - "XML_ERROR_FILE_NOT_FOUND", - "XML_ERROR_FILE_COULD_NOT_BE_OPENED", - "XML_ERROR_FILE_READ_ERROR", - "XML_ERROR_PARSING_ELEMENT", - "XML_ERROR_PARSING_ATTRIBUTE", - "XML_ERROR_PARSING_TEXT", - "XML_ERROR_PARSING_CDATA", - "XML_ERROR_PARSING_COMMENT", - "XML_ERROR_PARSING_DECLARATION", - "XML_ERROR_PARSING_UNKNOWN", - "XML_ERROR_EMPTY_DOCUMENT", - "XML_ERROR_MISMATCHED_ELEMENT", - "XML_ERROR_PARSING", - "XML_CAN_NOT_CONVERT_TEXT", - "XML_NO_TEXT_NODE", - "XML_ELEMENT_DEPTH_EXCEEDED" -}; - - -XMLDocument::XMLDocument( bool processEntities, Whitespace whitespaceMode ) : - XMLNode( 0 ), - _writeBOM( false ), - _processEntities( processEntities ), - _errorID(XML_SUCCESS), - _whitespaceMode( whitespaceMode ), - _errorStr(), - _errorLineNum( 0 ), - _charBuffer( 0 ), - _parseCurLineNum( 0 ), - _parsingDepth(0), - _unlinked(), - _elementPool(), - _attributePool(), - _textPool(), - _commentPool() -{ - // avoid VC++ C4355 warning about 'this' in initializer list (C4355 is off by default in VS2012+) - _document = this; -} - - -XMLDocument::~XMLDocument() -{ - Clear(); -} - - -void XMLDocument::MarkInUse(XMLNode* node) -{ - TIXMLASSERT(node); - TIXMLASSERT(node->_parent == 0); - - for (int i = 0; i < _unlinked.Size(); ++i) { - if (node == _unlinked[i]) { - _unlinked.SwapRemove(i); - break; - } - } -} - -void XMLDocument::Clear() -{ - DeleteChildren(); - while( _unlinked.Size()) { - DeleteNode(_unlinked[0]); // Will remove from _unlinked as part of delete. - } - -#ifdef TINYXML2_DEBUG - const bool hadError = Error(); -#endif - ClearError(); - - delete [] _charBuffer; - _charBuffer = 0; - _parsingDepth = 0; - -#if 0 - _textPool.Trace( "text" ); - _elementPool.Trace( "element" ); - _commentPool.Trace( "comment" ); - _attributePool.Trace( "attribute" ); -#endif - -#ifdef TINYXML2_DEBUG - if ( !hadError ) { - TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); - TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); - TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); - TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); - } -#endif -} - - -void XMLDocument::DeepCopy(XMLDocument* target) const -{ - TIXMLASSERT(target); - if (target == this) { - return; // technically success - a no-op. - } - - target->Clear(); - for (const XMLNode* node = this->FirstChild(); node; node = node->NextSibling()) { - target->InsertEndChild(node->DeepClone(target)); - } -} - -XMLElement* XMLDocument::NewElement( const char* name ) -{ - XMLElement* ele = CreateUnlinkedNode( _elementPool ); - ele->SetName( name ); - return ele; -} - - -XMLComment* XMLDocument::NewComment( const char* str ) -{ - XMLComment* comment = CreateUnlinkedNode( _commentPool ); - comment->SetValue( str ); - return comment; -} - - -XMLText* XMLDocument::NewText( const char* str ) -{ - XMLText* text = CreateUnlinkedNode( _textPool ); - text->SetValue( str ); - return text; -} - - -XMLDeclaration* XMLDocument::NewDeclaration( const char* str ) -{ - XMLDeclaration* dec = CreateUnlinkedNode( _commentPool ); - dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" ); - return dec; -} - - -XMLUnknown* XMLDocument::NewUnknown( const char* str ) -{ - XMLUnknown* unk = CreateUnlinkedNode( _commentPool ); - unk->SetValue( str ); - return unk; -} - -static FILE* callfopen( const char* filepath, const char* mode ) -{ - TIXMLASSERT( filepath ); - TIXMLASSERT( mode ); -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE) - FILE* fp = 0; - errno_t err = fopen_s( &fp, filepath, mode ); - if ( err ) { - return 0; - } -#else - FILE* fp = fopen( filepath, mode ); -#endif - return fp; -} - -void XMLDocument::DeleteNode( XMLNode* node ) { - TIXMLASSERT( node ); - TIXMLASSERT(node->_document == this ); - if (node->_parent) { - node->_parent->DeleteChild( node ); - } - else { - // Isn't in the tree. - // Use the parent delete. - // Also, we need to mark it tracked: we 'know' - // it was never used. - node->_memPool->SetTracked(); - // Call the static XMLNode version: - XMLNode::DeleteNode(node); - } -} - - -XMLError XMLDocument::LoadFile( const char* filename ) -{ - if ( !filename ) { - TIXMLASSERT( false ); - SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, "filename=" ); - return _errorID; - } - - Clear(); - FILE* fp = callfopen( filename, "rb" ); - if ( !fp ) { - SetError( XML_ERROR_FILE_NOT_FOUND, 0, "filename=%s", filename ); - return _errorID; - } - LoadFile( fp ); - fclose( fp ); - return _errorID; -} - -// This is likely overengineered template art to have a check that unsigned long value incremented -// by one still fits into size_t. If size_t type is larger than unsigned long type -// (x86_64-w64-mingw32 target) then the check is redundant and gcc and clang emit -// -Wtype-limits warning. This piece makes the compiler select code with a check when a check -// is useful and code with no check when a check is redundant depending on how size_t and unsigned long -// types sizes relate to each other. -template -= sizeof(size_t))> -struct LongFitsIntoSizeTMinusOne { - static bool Fits( unsigned long value ) - { - return value < (size_t)-1; - } -}; - -template <> -struct LongFitsIntoSizeTMinusOne { - static bool Fits( unsigned long ) - { - return true; - } -}; - -XMLError XMLDocument::LoadFile( FILE* fp ) -{ - Clear(); - - fseek( fp, 0, SEEK_SET ); - if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); - return _errorID; - } - - fseek( fp, 0, SEEK_END ); - const long filelength = ftell( fp ); - fseek( fp, 0, SEEK_SET ); - if ( filelength == -1L ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); - return _errorID; - } - TIXMLASSERT( filelength >= 0 ); - - if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) { - // Cannot handle files which won't fit in buffer together with null terminator - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); - return _errorID; - } - - if ( filelength == 0 ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - - const size_t size = filelength; - TIXMLASSERT( _charBuffer == 0 ); - _charBuffer = new char[size+1]; - size_t read = fread( _charBuffer, 1, size, fp ); - if ( read != size ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); - return _errorID; - } - - _charBuffer[size] = 0; - - Parse(); - return _errorID; -} - - -XMLError XMLDocument::SaveFile( const char* filename, bool compact ) -{ - if ( !filename ) { - TIXMLASSERT( false ); - SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, "filename=" ); - return _errorID; - } - - FILE* fp = callfopen( filename, "w" ); - if ( !fp ) { - SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, "filename=%s", filename ); - return _errorID; - } - SaveFile(fp, compact); - fclose( fp ); - return _errorID; -} - - -XMLError XMLDocument::SaveFile( FILE* fp, bool compact ) -{ - // Clear any error from the last save, otherwise it will get reported - // for *this* call. - ClearError(); - XMLPrinter stream( fp, compact ); - Print( &stream ); - return _errorID; -} - - -XMLError XMLDocument::Parse( const char* p, size_t len ) -{ - Clear(); - - if ( len == 0 || !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - if ( len == (size_t)(-1) ) { - len = strlen( p ); - } - TIXMLASSERT( _charBuffer == 0 ); - _charBuffer = new char[ len+1 ]; - memcpy( _charBuffer, p, len ); - _charBuffer[len] = 0; - - Parse(); - if ( Error() ) { - // clean up now essentially dangling memory. - // and the parse fail can put objects in the - // pools that are dead and inaccessible. - DeleteChildren(); - _elementPool.Clear(); - _attributePool.Clear(); - _textPool.Clear(); - _commentPool.Clear(); - } - return _errorID; -} - - -void XMLDocument::Print( XMLPrinter* streamer ) const -{ - if ( streamer ) { - Accept( streamer ); - } - else { - XMLPrinter stdoutStreamer( stdout ); - Accept( &stdoutStreamer ); - } -} - - -void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... ) -{ - TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT ); - _errorID = error; - _errorLineNum = lineNum; - _errorStr.Reset(); - - size_t BUFFER_SIZE = 1000; - char* buffer = new char[BUFFER_SIZE]; - - TIXMLASSERT(sizeof(error) <= sizeof(int)); - TIXML_SNPRINTF(buffer, BUFFER_SIZE, "Error=%s ErrorID=%d (0x%x) Line number=%d", ErrorIDToName(error), int(error), int(error), lineNum); - - if (format) { - size_t len = strlen(buffer); - TIXML_SNPRINTF(buffer + len, BUFFER_SIZE - len, ": "); - len = strlen(buffer); - - va_list va; - va_start(va, format); - TIXML_VSNPRINTF(buffer + len, BUFFER_SIZE - len, format, va); - va_end(va); - } - _errorStr.SetStr(buffer); - delete[] buffer; -} - - -/*static*/ const char* XMLDocument::ErrorIDToName(XMLError errorID) -{ - TIXMLASSERT( errorID >= 0 && errorID < XML_ERROR_COUNT ); - const char* errorName = _errorNames[errorID]; - TIXMLASSERT( errorName && errorName[0] ); - return errorName; -} - -const char* XMLDocument::ErrorStr() const -{ - return _errorStr.Empty() ? "" : _errorStr.GetStr(); -} - - -void XMLDocument::PrintError() const -{ - printf("%s\n", ErrorStr()); -} - -const char* XMLDocument::ErrorName() const -{ - return ErrorIDToName(_errorID); -} - -void XMLDocument::Parse() -{ - TIXMLASSERT( NoChildren() ); // Clear() must have been called previously - TIXMLASSERT( _charBuffer ); - _parseCurLineNum = 1; - _parseLineNum = 1; - char* p = _charBuffer; - p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum ); - p = const_cast( XMLUtil::ReadBOM( p, &_writeBOM ) ); - if ( !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return; - } - ParseDeep(p, 0, &_parseCurLineNum ); -} - -void XMLDocument::PushDepth() -{ - _parsingDepth++; - if (_parsingDepth == TINYXML2_MAX_ELEMENT_DEPTH) { - SetError(XML_ELEMENT_DEPTH_EXCEEDED, _parseCurLineNum, "Element nesting is too deep." ); - } -} - -void XMLDocument::PopDepth() -{ - TIXMLASSERT(_parsingDepth > 0); - --_parsingDepth; -} - -XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) : - _elementJustOpened( false ), - _stack(), - _firstElement( true ), - _fp( file ), - _depth( depth ), - _textDepth( -1 ), - _processEntities( true ), - _compactMode( compact ), - _buffer() -{ - for( int i=0; i'] = true; // not required, but consistency is nice - _buffer.Push( 0 ); -} - - -void XMLPrinter::Print( const char* format, ... ) -{ - va_list va; - va_start( va, format ); - - if ( _fp ) { - vfprintf( _fp, format, va ); - } - else { - const int len = TIXML_VSCPRINTF( format, va ); - // Close out and re-start the va-args - va_end( va ); - TIXMLASSERT( len >= 0 ); - va_start( va, format ); - TIXMLASSERT( _buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0 ); - char* p = _buffer.PushArr( len ) - 1; // back up over the null terminator. - TIXML_VSNPRINTF( p, len+1, format, va ); - } - va_end( va ); -} - - -void XMLPrinter::Write( const char* data, size_t size ) -{ - if ( _fp ) { - fwrite ( data , sizeof(char), size, _fp); - } - else { - char* p = _buffer.PushArr( static_cast(size) ) - 1; // back up over the null terminator. - memcpy( p, data, size ); - p[size] = 0; - } -} - - -void XMLPrinter::Putc( char ch ) -{ - if ( _fp ) { - fputc ( ch, _fp); - } - else { - char* p = _buffer.PushArr( sizeof(char) ) - 1; // back up over the null terminator. - p[0] = ch; - p[1] = 0; - } -} - - -void XMLPrinter::PrintSpace( int depth ) -{ - for( int i=0; i 0 && *q < ENTITY_RANGE ) { - // Check for entities. If one is found, flush - // the stream up until the entity, write the - // entity, and keep looking. - if ( flag[(unsigned char)(*q)] ) { - while ( p < q ) { - const size_t delta = q - p; - const int toPrint = ( INT_MAX < delta ) ? INT_MAX : (int)delta; - Write( p, toPrint ); - p += toPrint; - } - bool entityPatternPrinted = false; - for( int i=0; i( bom ) ); - } - if ( writeDec ) { - PushDeclaration( "xml version=\"1.0\"" ); - } -} - - -void XMLPrinter::OpenElement( const char* name, bool compactMode ) -{ - SealElementIfJustOpened(); - _stack.Push( name ); - - if ( _textDepth < 0 && !_firstElement && !compactMode ) { - Putc( '\n' ); - } - if ( !compactMode ) { - PrintSpace( _depth ); - } - - Write ( "<" ); - Write ( name ); - - _elementJustOpened = true; - _firstElement = false; - ++_depth; -} - - -void XMLPrinter::PushAttribute( const char* name, const char* value ) -{ - TIXMLASSERT( _elementJustOpened ); - Putc ( ' ' ); - Write( name ); - Write( "=\"" ); - PrintString( value, false ); - Putc ( '\"' ); -} - - -void XMLPrinter::PushAttribute( const char* name, int v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, unsigned v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute(const char* name, int64_t v) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr(v, buf, BUF_SIZE); - PushAttribute(name, buf); -} - - -void XMLPrinter::PushAttribute( const char* name, bool v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, double v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::CloseElement( bool compactMode ) -{ - --_depth; - const char* name = _stack.Pop(); - - if ( _elementJustOpened ) { - Write( "/>" ); - } - else { - if ( _textDepth < 0 && !compactMode) { - Putc( '\n' ); - PrintSpace( _depth ); - } - Write ( "" ); - } - - if ( _textDepth == _depth ) { - _textDepth = -1; - } - if ( _depth == 0 && !compactMode) { - Putc( '\n' ); - } - _elementJustOpened = false; -} - - -void XMLPrinter::SealElementIfJustOpened() -{ - if ( !_elementJustOpened ) { - return; - } - _elementJustOpened = false; - Putc( '>' ); -} - - -void XMLPrinter::PushText( const char* text, bool cdata ) -{ - _textDepth = _depth-1; - - SealElementIfJustOpened(); - if ( cdata ) { - Write( "" ); - } - else { - PrintString( text, true ); - } -} - -void XMLPrinter::PushText( int64_t value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - -void XMLPrinter::PushText( int value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( unsigned value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( bool value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( float value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( double value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushComment( const char* comment ) -{ - SealElementIfJustOpened(); - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Putc( '\n' ); - PrintSpace( _depth ); - } - _firstElement = false; - - Write( "" ); -} - - -void XMLPrinter::PushDeclaration( const char* value ) -{ - SealElementIfJustOpened(); - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Putc( '\n' ); - PrintSpace( _depth ); - } - _firstElement = false; - - Write( "" ); -} - - -void XMLPrinter::PushUnknown( const char* value ) -{ - SealElementIfJustOpened(); - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Putc( '\n' ); - PrintSpace( _depth ); - } - _firstElement = false; - - Write( "' ); -} - - -bool XMLPrinter::VisitEnter( const XMLDocument& doc ) -{ - _processEntities = doc.ProcessEntities(); - if ( doc.HasBOM() ) { - PushHeader( true, false ); - } - return true; -} - - -bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute ) -{ - const XMLElement* parentElem = 0; - if ( element.Parent() ) { - parentElem = element.Parent()->ToElement(); - } - const bool compactMode = parentElem ? CompactMode( *parentElem ) : _compactMode; - OpenElement( element.Name(), compactMode ); - while ( attribute ) { - PushAttribute( attribute->Name(), attribute->Value() ); - attribute = attribute->Next(); - } - return true; -} - - -bool XMLPrinter::VisitExit( const XMLElement& element ) -{ - CloseElement( CompactMode(element) ); - return true; -} - - -bool XMLPrinter::Visit( const XMLText& text ) -{ - PushText( text.Value(), text.CData() ); - return true; -} - - -bool XMLPrinter::Visit( const XMLComment& comment ) -{ - PushComment( comment.Value() ); - return true; -} - -bool XMLPrinter::Visit( const XMLDeclaration& declaration ) -{ - PushDeclaration( declaration.Value() ); - return true; -} - - -bool XMLPrinter::Visit( const XMLUnknown& unknown ) -{ - PushUnknown( unknown.Value() ); - return true; -} - -} // namespace tinyxml2 diff --git a/tools/ZAPD/lib/tinyxml2/tinyxml2.h b/tools/ZAPD/lib/tinyxml2/tinyxml2.h deleted file mode 100644 index 7cd3127363..0000000000 --- a/tools/ZAPD/lib/tinyxml2/tinyxml2.h +++ /dev/null @@ -1,2309 +0,0 @@ -/* -Original code by Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#ifndef TINYXML2_INCLUDED -#define TINYXML2_INCLUDED - -#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) -# include -# include -# include -# include -# include -# if defined(__PS3__) -# include -# endif -#else -# include -# include -# include -# include -# include -#endif -#include - -/* - TODO: intern strings instead of allocation. -*/ -/* - gcc: - g++ -Wall -DTINYXML2_DEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe - - Formatting, Artistic Style: - AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h -*/ - -#if defined( _DEBUG ) || defined (__DEBUG__) -# ifndef TINYXML2_DEBUG -# define TINYXML2_DEBUG -# endif -#endif - -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable: 4251) -#endif - -#ifdef _WIN32 -# ifdef TINYXML2_EXPORT -# define TINYXML2_LIB __declspec(dllexport) -# elif defined(TINYXML2_IMPORT) -# define TINYXML2_LIB __declspec(dllimport) -# else -# define TINYXML2_LIB -# endif -#elif __GNUC__ >= 4 -# define TINYXML2_LIB __attribute__((visibility("default"))) -#else -# define TINYXML2_LIB -#endif - - -#if defined(TINYXML2_DEBUG) -# if defined(_MSC_VER) -# // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like -# define TIXMLASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); } -# elif defined (ANDROID_NDK) -# include -# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); } -# else -# include -# define TIXMLASSERT assert -# endif -#else -# define TIXMLASSERT( x ) {} -#endif - - -/* Versioning, past 1.0.14: - http://semver.org/ -*/ -static const int TIXML2_MAJOR_VERSION = 7; -static const int TIXML2_MINOR_VERSION = 0; -static const int TIXML2_PATCH_VERSION = 1; - -#define TINYXML2_MAJOR_VERSION 7 -#define TINYXML2_MINOR_VERSION 0 -#define TINYXML2_PATCH_VERSION 1 - -// A fixed element depth limit is problematic. There needs to be a -// limit to avoid a stack overflow. However, that limit varies per -// system, and the capacity of the stack. On the other hand, it's a trivial -// attack that can result from ill, malicious, or even correctly formed XML, -// so there needs to be a limit in place. -static const int TINYXML2_MAX_ELEMENT_DEPTH = 100; - -namespace tinyxml2 -{ -class XMLDocument; -class XMLElement; -class XMLAttribute; -class XMLComment; -class XMLText; -class XMLDeclaration; -class XMLUnknown; -class XMLPrinter; - -/* - A class that wraps strings. Normally stores the start and end - pointers into the XML file itself, and will apply normalization - and entity translation if actually read. Can also store (and memory - manage) a traditional char[] - - Isn't clear why TINYXML2_LIB is needed; but seems to fix #719 -*/ -class TINYXML2_LIB StrPair -{ -public: - enum { - NEEDS_ENTITY_PROCESSING = 0x01, - NEEDS_NEWLINE_NORMALIZATION = 0x02, - NEEDS_WHITESPACE_COLLAPSING = 0x04, - - TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, - TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, - ATTRIBUTE_NAME = 0, - ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, - ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, - COMMENT = NEEDS_NEWLINE_NORMALIZATION - }; - - StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {} - ~StrPair(); - - void Set( char* start, char* end, int flags ) { - TIXMLASSERT( start ); - TIXMLASSERT( end ); - Reset(); - _start = start; - _end = end; - _flags = flags | NEEDS_FLUSH; - } - - const char* GetStr(); - - bool Empty() const { - return _start == _end; - } - - void SetInternedStr( const char* str ) { - Reset(); - _start = const_cast(str); - } - - void SetStr( const char* str, int flags=0 ); - - char* ParseText( char* in, const char* endTag, int strFlags, int* curLineNumPtr ); - char* ParseName( char* in ); - - void TransferTo( StrPair* other ); - void Reset(); - -private: - void CollapseWhitespace(); - - enum { - NEEDS_FLUSH = 0x100, - NEEDS_DELETE = 0x200 - }; - - int _flags; - char* _start; - char* _end; - - StrPair( const StrPair& other ); // not supported - void operator=( const StrPair& other ); // not supported, use TransferTo() -}; - - -/* - A dynamic array of Plain Old Data. Doesn't support constructors, etc. - Has a small initial memory pool, so that low or no usage will not - cause a call to new/delete -*/ -template -class DynArray -{ -public: - DynArray() : - _mem( _pool ), - _allocated( INITIAL_SIZE ), - _size( 0 ) - { - } - - ~DynArray() { - if ( _mem != _pool ) { - delete [] _mem; - } - } - - void Clear() { - _size = 0; - } - - void Push( T t ) { - TIXMLASSERT( _size < INT_MAX ); - EnsureCapacity( _size+1 ); - _mem[_size] = t; - ++_size; - } - - T* PushArr( int count ) { - TIXMLASSERT( count >= 0 ); - TIXMLASSERT( _size <= INT_MAX - count ); - EnsureCapacity( _size+count ); - T* ret = &_mem[_size]; - _size += count; - return ret; - } - - T Pop() { - TIXMLASSERT( _size > 0 ); - --_size; - return _mem[_size]; - } - - void PopArr( int count ) { - TIXMLASSERT( _size >= count ); - _size -= count; - } - - bool Empty() const { - return _size == 0; - } - - T& operator[](int i) { - TIXMLASSERT( i>= 0 && i < _size ); - return _mem[i]; - } - - const T& operator[](int i) const { - TIXMLASSERT( i>= 0 && i < _size ); - return _mem[i]; - } - - const T& PeekTop() const { - TIXMLASSERT( _size > 0 ); - return _mem[ _size - 1]; - } - - int Size() const { - TIXMLASSERT( _size >= 0 ); - return _size; - } - - int Capacity() const { - TIXMLASSERT( _allocated >= INITIAL_SIZE ); - return _allocated; - } - - void SwapRemove(int i) { - TIXMLASSERT(i >= 0 && i < _size); - TIXMLASSERT(_size > 0); - _mem[i] = _mem[_size - 1]; - --_size; - } - - const T* Mem() const { - TIXMLASSERT( _mem ); - return _mem; - } - - T* Mem() { - TIXMLASSERT( _mem ); - return _mem; - } - -private: - DynArray( const DynArray& ); // not supported - void operator=( const DynArray& ); // not supported - - void EnsureCapacity( int cap ) { - TIXMLASSERT( cap > 0 ); - if ( cap > _allocated ) { - TIXMLASSERT( cap <= INT_MAX / 2 ); - int newAllocated = cap * 2; - T* newMem = new T[newAllocated]; - TIXMLASSERT( newAllocated >= _size ); - memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs - if ( _mem != _pool ) { - delete [] _mem; - } - _mem = newMem; - _allocated = newAllocated; - } - } - - T* _mem; - T _pool[INITIAL_SIZE]; - int _allocated; // objects allocated - int _size; // number objects in use -}; - - -/* - Parent virtual class of a pool for fast allocation - and deallocation of objects. -*/ -class MemPool -{ -public: - MemPool() {} - virtual ~MemPool() {} - - virtual int ItemSize() const = 0; - virtual void* Alloc() = 0; - virtual void Free( void* ) = 0; - virtual void SetTracked() = 0; -}; - - -/* - Template child class to create pools of the correct type. -*/ -template< int ITEM_SIZE > -class MemPoolT : public MemPool -{ -public: - MemPoolT() : _blockPtrs(), _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {} - ~MemPoolT() { - MemPoolT< ITEM_SIZE >::Clear(); - } - - void Clear() { - // Delete the blocks. - while( !_blockPtrs.Empty()) { - Block* lastBlock = _blockPtrs.Pop(); - delete lastBlock; - } - _root = 0; - _currentAllocs = 0; - _nAllocs = 0; - _maxAllocs = 0; - _nUntracked = 0; - } - - virtual int ItemSize() const { - return ITEM_SIZE; - } - int CurrentAllocs() const { - return _currentAllocs; - } - - virtual void* Alloc() { - if ( !_root ) { - // Need a new block. - Block* block = new Block(); - _blockPtrs.Push( block ); - - Item* blockItems = block->items; - for( int i = 0; i < ITEMS_PER_BLOCK - 1; ++i ) { - blockItems[i].next = &(blockItems[i + 1]); - } - blockItems[ITEMS_PER_BLOCK - 1].next = 0; - _root = blockItems; - } - Item* const result = _root; - TIXMLASSERT( result != 0 ); - _root = _root->next; - - ++_currentAllocs; - if ( _currentAllocs > _maxAllocs ) { - _maxAllocs = _currentAllocs; - } - ++_nAllocs; - ++_nUntracked; - return result; - } - - virtual void Free( void* mem ) { - if ( !mem ) { - return; - } - --_currentAllocs; - Item* item = static_cast( mem ); -#ifdef TINYXML2_DEBUG - memset( item, 0xfe, sizeof( *item ) ); -#endif - item->next = _root; - _root = item; - } - void Trace( const char* name ) { - printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n", - name, _maxAllocs, _maxAllocs * ITEM_SIZE / 1024, _currentAllocs, - ITEM_SIZE, _nAllocs, _blockPtrs.Size() ); - } - - void SetTracked() { - --_nUntracked; - } - - int Untracked() const { - return _nUntracked; - } - - // This number is perf sensitive. 4k seems like a good tradeoff on my machine. - // The test file is large, 170k. - // Release: VS2010 gcc(no opt) - // 1k: 4000 - // 2k: 4000 - // 4k: 3900 21000 - // 16k: 5200 - // 32k: 4300 - // 64k: 4000 21000 - // Declared public because some compilers do not accept to use ITEMS_PER_BLOCK - // in private part if ITEMS_PER_BLOCK is private - enum { ITEMS_PER_BLOCK = (4 * 1024) / ITEM_SIZE }; - -private: - MemPoolT( const MemPoolT& ); // not supported - void operator=( const MemPoolT& ); // not supported - - union Item { - Item* next; - char itemData[ITEM_SIZE]; - }; - struct Block { - Item items[ITEMS_PER_BLOCK]; - }; - DynArray< Block*, 10 > _blockPtrs; - Item* _root; - - int _currentAllocs; - int _nAllocs; - int _maxAllocs; - int _nUntracked; -}; - - - -/** - Implements the interface to the "Visitor pattern" (see the Accept() method.) - If you call the Accept() method, it requires being passed a XMLVisitor - class to handle callbacks. For nodes that contain other nodes (Document, Element) - you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs - are simply called with Visit(). - - If you return 'true' from a Visit method, recursive parsing will continue. If you return - false, no children of this node or its siblings will be visited. - - All flavors of Visit methods have a default implementation that returns 'true' (continue - visiting). You need to only override methods that are interesting to you. - - Generally Accept() is called on the XMLDocument, although all nodes support visiting. - - You should never change the document from a callback. - - @sa XMLNode::Accept() -*/ -class TINYXML2_LIB XMLVisitor -{ -public: - virtual ~XMLVisitor() {} - - /// Visit a document. - virtual bool VisitEnter( const XMLDocument& /*doc*/ ) { - return true; - } - /// Visit a document. - virtual bool VisitExit( const XMLDocument& /*doc*/ ) { - return true; - } - - /// Visit an element. - virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) { - return true; - } - /// Visit an element. - virtual bool VisitExit( const XMLElement& /*element*/ ) { - return true; - } - - /// Visit a declaration. - virtual bool Visit( const XMLDeclaration& /*declaration*/ ) { - return true; - } - /// Visit a text node. - virtual bool Visit( const XMLText& /*text*/ ) { - return true; - } - /// Visit a comment node. - virtual bool Visit( const XMLComment& /*comment*/ ) { - return true; - } - /// Visit an unknown node. - virtual bool Visit( const XMLUnknown& /*unknown*/ ) { - return true; - } -}; - -// WARNING: must match XMLDocument::_errorNames[] -enum XMLError { - XML_SUCCESS = 0, - XML_NO_ATTRIBUTE, - XML_WRONG_ATTRIBUTE_TYPE, - XML_ERROR_FILE_NOT_FOUND, - XML_ERROR_FILE_COULD_NOT_BE_OPENED, - XML_ERROR_FILE_READ_ERROR, - XML_ERROR_PARSING_ELEMENT, - XML_ERROR_PARSING_ATTRIBUTE, - XML_ERROR_PARSING_TEXT, - XML_ERROR_PARSING_CDATA, - XML_ERROR_PARSING_COMMENT, - XML_ERROR_PARSING_DECLARATION, - XML_ERROR_PARSING_UNKNOWN, - XML_ERROR_EMPTY_DOCUMENT, - XML_ERROR_MISMATCHED_ELEMENT, - XML_ERROR_PARSING, - XML_CAN_NOT_CONVERT_TEXT, - XML_NO_TEXT_NODE, - XML_ELEMENT_DEPTH_EXCEEDED, - - XML_ERROR_COUNT -}; - - -/* - Utility functionality. -*/ -class TINYXML2_LIB XMLUtil -{ -public: - static const char* SkipWhiteSpace( const char* p, int* curLineNumPtr ) { - TIXMLASSERT( p ); - - while( IsWhiteSpace(*p) ) { - if (curLineNumPtr && *p == '\n') { - ++(*curLineNumPtr); - } - ++p; - } - TIXMLASSERT( p ); - return p; - } - static char* SkipWhiteSpace( char* p, int* curLineNumPtr ) { - return const_cast( SkipWhiteSpace( const_cast(p), curLineNumPtr ) ); - } - - // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't - // correct, but simple, and usually works. - static bool IsWhiteSpace( char p ) { - return !IsUTF8Continuation(p) && isspace( static_cast(p) ); - } - - inline static bool IsNameStartChar( unsigned char ch ) { - if ( ch >= 128 ) { - // This is a heuristic guess in attempt to not implement Unicode-aware isalpha() - return true; - } - if ( isalpha( ch ) ) { - return true; - } - return ch == ':' || ch == '_'; - } - - inline static bool IsNameChar( unsigned char ch ) { - return IsNameStartChar( ch ) - || isdigit( ch ) - || ch == '.' - || ch == '-'; - } - - inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { - if ( p == q ) { - return true; - } - TIXMLASSERT( p ); - TIXMLASSERT( q ); - TIXMLASSERT( nChar >= 0 ); - return strncmp( p, q, nChar ) == 0; - } - - inline static bool IsUTF8Continuation( char p ) { - return ( p & 0x80 ) != 0; - } - - static const char* ReadBOM( const char* p, bool* hasBOM ); - // p is the starting location, - // the UTF-8 value of the entity will be placed in value, and length filled in. - static const char* GetCharacterRef( const char* p, char* value, int* length ); - static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); - - // converts primitive types to strings - static void ToStr( int v, char* buffer, int bufferSize ); - static void ToStr( unsigned v, char* buffer, int bufferSize ); - static void ToStr( bool v, char* buffer, int bufferSize ); - static void ToStr( float v, char* buffer, int bufferSize ); - static void ToStr( double v, char* buffer, int bufferSize ); - static void ToStr(int64_t v, char* buffer, int bufferSize); - - // converts strings to primitive types - static bool ToInt( const char* str, int* value ); - static bool ToUnsigned( const char* str, unsigned* value ); - static bool ToBool( const char* str, bool* value ); - static bool ToFloat( const char* str, float* value ); - static bool ToDouble( const char* str, double* value ); - static bool ToInt64(const char* str, int64_t* value); - - // Changes what is serialized for a boolean value. - // Default to "true" and "false". Shouldn't be changed - // unless you have a special testing or compatibility need. - // Be careful: static, global, & not thread safe. - // Be sure to set static const memory as parameters. - static void SetBoolSerialization(const char* writeTrue, const char* writeFalse); - -private: - static const char* writeBoolTrue; - static const char* writeBoolFalse; -}; - - -/** XMLNode is a base class for every object that is in the - XML Document Object Model (DOM), except XMLAttributes. - Nodes have siblings, a parent, and children which can - be navigated. A node is always in a XMLDocument. - The type of a XMLNode can be queried, and it can - be cast to its more defined type. - - A XMLDocument allocates memory for all its Nodes. - When the XMLDocument gets deleted, all its Nodes - will also be deleted. - - @verbatim - A Document can contain: Element (container or leaf) - Comment (leaf) - Unknown (leaf) - Declaration( leaf ) - - An Element can contain: Element (container or leaf) - Text (leaf) - Attributes (not on tree) - Comment (leaf) - Unknown (leaf) - - @endverbatim -*/ -class TINYXML2_LIB XMLNode -{ - friend class XMLDocument; - friend class XMLElement; -public: - - /// Get the XMLDocument that owns this XMLNode. - const XMLDocument* GetDocument() const { - TIXMLASSERT( _document ); - return _document; - } - /// Get the XMLDocument that owns this XMLNode. - XMLDocument* GetDocument() { - TIXMLASSERT( _document ); - return _document; - } - - /// Safely cast to an Element, or null. - virtual XMLElement* ToElement() { - return 0; - } - /// Safely cast to Text, or null. - virtual XMLText* ToText() { - return 0; - } - /// Safely cast to a Comment, or null. - virtual XMLComment* ToComment() { - return 0; - } - /// Safely cast to a Document, or null. - virtual XMLDocument* ToDocument() { - return 0; - } - /// Safely cast to a Declaration, or null. - virtual XMLDeclaration* ToDeclaration() { - return 0; - } - /// Safely cast to an Unknown, or null. - virtual XMLUnknown* ToUnknown() { - return 0; - } - - virtual const XMLElement* ToElement() const { - return 0; - } - virtual const XMLText* ToText() const { - return 0; - } - virtual const XMLComment* ToComment() const { - return 0; - } - virtual const XMLDocument* ToDocument() const { - return 0; - } - virtual const XMLDeclaration* ToDeclaration() const { - return 0; - } - virtual const XMLUnknown* ToUnknown() const { - return 0; - } - - /** The meaning of 'value' changes for the specific type. - @verbatim - Document: empty (NULL is returned, not an empty string) - Element: name of the element - Comment: the comment text - Unknown: the tag contents - Text: the text string - @endverbatim - */ - const char* Value() const; - - /** Set the Value of an XML node. - @sa Value() - */ - void SetValue( const char* val, bool staticMem=false ); - - /// Gets the line number the node is in, if the document was parsed from a file. - int GetLineNum() const { return _parseLineNum; } - - /// Get the parent of this node on the DOM. - const XMLNode* Parent() const { - return _parent; - } - - XMLNode* Parent() { - return _parent; - } - - /// Returns true if this node has no children. - bool NoChildren() const { - return !_firstChild; - } - - /// Get the first child node, or null if none exists. - const XMLNode* FirstChild() const { - return _firstChild; - } - - XMLNode* FirstChild() { - return _firstChild; - } - - /** Get the first child element, or optionally the first child - element with the specified name. - */ - const XMLElement* FirstChildElement( const char* name = 0 ) const; - - XMLElement* FirstChildElement( const char* name = 0 ) { - return const_cast(const_cast(this)->FirstChildElement( name )); - } - - /// Get the last child node, or null if none exists. - const XMLNode* LastChild() const { - return _lastChild; - } - - XMLNode* LastChild() { - return _lastChild; - } - - /** Get the last child element or optionally the last child - element with the specified name. - */ - const XMLElement* LastChildElement( const char* name = 0 ) const; - - XMLElement* LastChildElement( const char* name = 0 ) { - return const_cast(const_cast(this)->LastChildElement(name) ); - } - - /// Get the previous (left) sibling node of this node. - const XMLNode* PreviousSibling() const { - return _prev; - } - - XMLNode* PreviousSibling() { - return _prev; - } - - /// Get the previous (left) sibling element of this node, with an optionally supplied name. - const XMLElement* PreviousSiblingElement( const char* name = 0 ) const ; - - XMLElement* PreviousSiblingElement( const char* name = 0 ) { - return const_cast(const_cast(this)->PreviousSiblingElement( name ) ); - } - - /// Get the next (right) sibling node of this node. - const XMLNode* NextSibling() const { - return _next; - } - - XMLNode* NextSibling() { - return _next; - } - - /// Get the next (right) sibling element of this node, with an optionally supplied name. - const XMLElement* NextSiblingElement( const char* name = 0 ) const; - - XMLElement* NextSiblingElement( const char* name = 0 ) { - return const_cast(const_cast(this)->NextSiblingElement( name ) ); - } - - /** - Add a child node as the last (right) child. - If the child node is already part of the document, - it is moved from its old location to the new location. - Returns the addThis argument or 0 if the node does not - belong to the same document. - */ - XMLNode* InsertEndChild( XMLNode* addThis ); - - XMLNode* LinkEndChild( XMLNode* addThis ) { - return InsertEndChild( addThis ); - } - /** - Add a child node as the first (left) child. - If the child node is already part of the document, - it is moved from its old location to the new location. - Returns the addThis argument or 0 if the node does not - belong to the same document. - */ - XMLNode* InsertFirstChild( XMLNode* addThis ); - /** - Add a node after the specified child node. - If the child node is already part of the document, - it is moved from its old location to the new location. - Returns the addThis argument or 0 if the afterThis node - is not a child of this node, or if the node does not - belong to the same document. - */ - XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ); - - /** - Delete all the children of this node. - */ - void DeleteChildren(); - - /** - Delete a child of this node. - */ - void DeleteChild( XMLNode* node ); - - /** - Make a copy of this node, but not its children. - You may pass in a Document pointer that will be - the owner of the new Node. If the 'document' is - null, then the node returned will be allocated - from the current Document. (this->GetDocument()) - - Note: if called on a XMLDocument, this will return null. - */ - virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0; - - /** - Make a copy of this node and all its children. - - If the 'target' is null, then the nodes will - be allocated in the current document. If 'target' - is specified, the memory will be allocated is the - specified XMLDocument. - - NOTE: This is probably not the correct tool to - copy a document, since XMLDocuments can have multiple - top level XMLNodes. You probably want to use - XMLDocument::DeepCopy() - */ - XMLNode* DeepClone( XMLDocument* target ) const; - - /** - Test if 2 nodes are the same, but don't test children. - The 2 nodes do not need to be in the same Document. - - Note: if called on a XMLDocument, this will return false. - */ - virtual bool ShallowEqual( const XMLNode* compare ) const = 0; - - /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the - XML tree will be conditionally visited and the host will be called back - via the XMLVisitor interface. - - This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse - the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this - interface versus any other.) - - The interface has been based on ideas from: - - - http://www.saxproject.org/ - - http://c2.com/cgi/wiki?HierarchicalVisitorPattern - - Which are both good references for "visiting". - - An example of using Accept(): - @verbatim - XMLPrinter printer; - tinyxmlDoc.Accept( &printer ); - const char* xmlcstr = printer.CStr(); - @endverbatim - */ - virtual bool Accept( XMLVisitor* visitor ) const = 0; - - /** - Set user data into the XMLNode. TinyXML-2 in - no way processes or interprets user data. - It is initially 0. - */ - void SetUserData(void* userData) { _userData = userData; } - - /** - Get user data set into the XMLNode. TinyXML-2 in - no way processes or interprets user data. - It is initially 0. - */ - void* GetUserData() const { return _userData; } - -protected: - explicit XMLNode( XMLDocument* ); - virtual ~XMLNode(); - - virtual char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr); - - XMLDocument* _document; - XMLNode* _parent; - mutable StrPair _value; - int _parseLineNum; - - XMLNode* _firstChild; - XMLNode* _lastChild; - - XMLNode* _prev; - XMLNode* _next; - - void* _userData; - -private: - MemPool* _memPool; - void Unlink( XMLNode* child ); - static void DeleteNode( XMLNode* node ); - void InsertChildPreamble( XMLNode* insertThis ) const; - const XMLElement* ToElementWithName( const char* name ) const; - - XMLNode( const XMLNode& ); // not supported - XMLNode& operator=( const XMLNode& ); // not supported -}; - - -/** XML text. - - Note that a text node can have child element nodes, for example: - @verbatim - This is bold - @endverbatim - - A text node can have 2 ways to output the next. "normal" output - and CDATA. It will default to the mode it was parsed from the XML file and - you generally want to leave it alone, but you can change the output mode with - SetCData() and query it with CData(). -*/ -class TINYXML2_LIB XMLText : public XMLNode -{ - friend class XMLDocument; -public: - virtual bool Accept( XMLVisitor* visitor ) const; - - virtual XMLText* ToText() { - return this; - } - virtual const XMLText* ToText() const { - return this; - } - - /// Declare whether this should be CDATA or standard text. - void SetCData( bool isCData ) { - _isCData = isCData; - } - /// Returns true if this is a CDATA text element. - bool CData() const { - return _isCData; - } - - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - explicit XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {} - virtual ~XMLText() {} - - char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); - -private: - bool _isCData; - - XMLText( const XMLText& ); // not supported - XMLText& operator=( const XMLText& ); // not supported -}; - - -/** An XML Comment. */ -class TINYXML2_LIB XMLComment : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLComment* ToComment() { - return this; - } - virtual const XMLComment* ToComment() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - explicit XMLComment( XMLDocument* doc ); - virtual ~XMLComment(); - - char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr); - -private: - XMLComment( const XMLComment& ); // not supported - XMLComment& operator=( const XMLComment& ); // not supported -}; - - -/** In correct XML the declaration is the first entry in the file. - @verbatim - - @endverbatim - - TinyXML-2 will happily read or write files without a declaration, - however. - - The text of the declaration isn't interpreted. It is parsed - and written as a string. -*/ -class TINYXML2_LIB XMLDeclaration : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLDeclaration* ToDeclaration() { - return this; - } - virtual const XMLDeclaration* ToDeclaration() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - explicit XMLDeclaration( XMLDocument* doc ); - virtual ~XMLDeclaration(); - - char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); - -private: - XMLDeclaration( const XMLDeclaration& ); // not supported - XMLDeclaration& operator=( const XMLDeclaration& ); // not supported -}; - - -/** Any tag that TinyXML-2 doesn't recognize is saved as an - unknown. It is a tag of text, but should not be modified. - It will be written back to the XML, unchanged, when the file - is saved. - - DTD tags get thrown into XMLUnknowns. -*/ -class TINYXML2_LIB XMLUnknown : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLUnknown* ToUnknown() { - return this; - } - virtual const XMLUnknown* ToUnknown() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - explicit XMLUnknown( XMLDocument* doc ); - virtual ~XMLUnknown(); - - char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); - -private: - XMLUnknown( const XMLUnknown& ); // not supported - XMLUnknown& operator=( const XMLUnknown& ); // not supported -}; - - - -/** An attribute is a name-value pair. Elements have an arbitrary - number of attributes, each with a unique name. - - @note The attributes are not XMLNodes. You may only query the - Next() attribute in a list. -*/ -class TINYXML2_LIB XMLAttribute -{ - friend class XMLElement; -public: - /// The name of the attribute. - const char* Name() const; - - /// The value of the attribute. - const char* Value() const; - - /// Gets the line number the attribute is in, if the document was parsed from a file. - int GetLineNum() const { return _parseLineNum; } - - /// The next attribute in the list. - const XMLAttribute* Next() const { - return _next; - } - - /** IntValue interprets the attribute as an integer, and returns the value. - If the value isn't an integer, 0 will be returned. There is no error checking; - use QueryIntValue() if you need error checking. - */ - int IntValue() const { - int i = 0; - QueryIntValue(&i); - return i; - } - - int64_t Int64Value() const { - int64_t i = 0; - QueryInt64Value(&i); - return i; - } - - /// Query as an unsigned integer. See IntValue() - unsigned UnsignedValue() const { - unsigned i=0; - QueryUnsignedValue( &i ); - return i; - } - /// Query as a boolean. See IntValue() - bool BoolValue() const { - bool b=false; - QueryBoolValue( &b ); - return b; - } - /// Query as a double. See IntValue() - double DoubleValue() const { - double d=0; - QueryDoubleValue( &d ); - return d; - } - /// Query as a float. See IntValue() - float FloatValue() const { - float f=0; - QueryFloatValue( &f ); - return f; - } - - /** QueryIntValue interprets the attribute as an integer, and returns the value - in the provided parameter. The function will return XML_SUCCESS on success, - and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. - */ - XMLError QueryIntValue( int* value ) const; - /// See QueryIntValue - XMLError QueryUnsignedValue( unsigned int* value ) const; - /// See QueryIntValue - XMLError QueryInt64Value(int64_t* value) const; - /// See QueryIntValue - XMLError QueryBoolValue( bool* value ) const; - /// See QueryIntValue - XMLError QueryDoubleValue( double* value ) const; - /// See QueryIntValue - XMLError QueryFloatValue( float* value ) const; - - /// Set the attribute to a string value. - void SetAttribute( const char* value ); - /// Set the attribute to value. - void SetAttribute( int value ); - /// Set the attribute to value. - void SetAttribute( unsigned value ); - /// Set the attribute to value. - void SetAttribute(int64_t value); - /// Set the attribute to value. - void SetAttribute( bool value ); - /// Set the attribute to value. - void SetAttribute( double value ); - /// Set the attribute to value. - void SetAttribute( float value ); - -private: - enum { BUF_SIZE = 200 }; - - XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {} - virtual ~XMLAttribute() {} - - XMLAttribute( const XMLAttribute& ); // not supported - void operator=( const XMLAttribute& ); // not supported - void SetName( const char* name ); - - char* ParseDeep( char* p, bool processEntities, int* curLineNumPtr ); - - mutable StrPair _name; - mutable StrPair _value; - int _parseLineNum; - XMLAttribute* _next; - MemPool* _memPool; -}; - - -/** The element is a container class. It has a value, the element name, - and can contain other elements, text, comments, and unknowns. - Elements also contain an arbitrary number of attributes. -*/ -class TINYXML2_LIB XMLElement : public XMLNode -{ - friend class XMLDocument; -public: - /// Get the name of an element (which is the Value() of the node.) - const char* Name() const { - return Value(); - } - /// Set the name of the element. - void SetName( const char* str, bool staticMem=false ) { - SetValue( str, staticMem ); - } - - virtual XMLElement* ToElement() { - return this; - } - virtual const XMLElement* ToElement() const { - return this; - } - virtual bool Accept( XMLVisitor* visitor ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none - exists. For example: - - @verbatim - const char* value = ele->Attribute( "foo" ); - @endverbatim - - The 'value' parameter is normally null. However, if specified, - the attribute will only be returned if the 'name' and 'value' - match. This allow you to write code: - - @verbatim - if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar(); - @endverbatim - - rather than: - @verbatim - if ( ele->Attribute( "foo" ) ) { - if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar(); - } - @endverbatim - */ - const char* Attribute( const char* name, const char* value=0 ) const; - - /** Given an attribute name, IntAttribute() returns the value - of the attribute interpreted as an integer. The default - value will be returned if the attribute isn't present, - or if there is an error. (For a method with error - checking, see QueryIntAttribute()). - */ - int IntAttribute(const char* name, int defaultValue = 0) const; - /// See IntAttribute() - unsigned UnsignedAttribute(const char* name, unsigned defaultValue = 0) const; - /// See IntAttribute() - int64_t Int64Attribute(const char* name, int64_t defaultValue = 0) const; - /// See IntAttribute() - bool BoolAttribute(const char* name, bool defaultValue = false) const; - /// See IntAttribute() - double DoubleAttribute(const char* name, double defaultValue = 0) const; - /// See IntAttribute() - float FloatAttribute(const char* name, float defaultValue = 0) const; - - /** Given an attribute name, QueryIntAttribute() returns - XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion - can't be performed, or XML_NO_ATTRIBUTE if the attribute - doesn't exist. If successful, the result of the conversion - will be written to 'value'. If not successful, nothing will - be written to 'value'. This allows you to provide default - value: - - @verbatim - int value = 10; - QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 - @endverbatim - */ - XMLError QueryIntAttribute( const char* name, int* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryIntValue( value ); - } - - /// See QueryIntAttribute() - XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryUnsignedValue( value ); - } - - /// See QueryIntAttribute() - XMLError QueryInt64Attribute(const char* name, int64_t* value) const { - const XMLAttribute* a = FindAttribute(name); - if (!a) { - return XML_NO_ATTRIBUTE; - } - return a->QueryInt64Value(value); - } - - /// See QueryIntAttribute() - XMLError QueryBoolAttribute( const char* name, bool* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryBoolValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryDoubleAttribute( const char* name, double* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryDoubleValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryFloatAttribute( const char* name, float* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryFloatValue( value ); - } - - /// See QueryIntAttribute() - XMLError QueryStringAttribute(const char* name, const char** value) const { - const XMLAttribute* a = FindAttribute(name); - if (!a) { - return XML_NO_ATTRIBUTE; - } - *value = a->Value(); - return XML_SUCCESS; - } - - - - /** Given an attribute name, QueryAttribute() returns - XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion - can't be performed, or XML_NO_ATTRIBUTE if the attribute - doesn't exist. It is overloaded for the primitive types, - and is a generally more convenient replacement of - QueryIntAttribute() and related functions. - - If successful, the result of the conversion - will be written to 'value'. If not successful, nothing will - be written to 'value'. This allows you to provide default - value: - - @verbatim - int value = 10; - QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 - @endverbatim - */ - XMLError QueryAttribute( const char* name, int* value ) const { - return QueryIntAttribute( name, value ); - } - - XMLError QueryAttribute( const char* name, unsigned int* value ) const { - return QueryUnsignedAttribute( name, value ); - } - - XMLError QueryAttribute(const char* name, int64_t* value) const { - return QueryInt64Attribute(name, value); - } - - XMLError QueryAttribute( const char* name, bool* value ) const { - return QueryBoolAttribute( name, value ); - } - - XMLError QueryAttribute( const char* name, double* value ) const { - return QueryDoubleAttribute( name, value ); - } - - XMLError QueryAttribute( const char* name, float* value ) const { - return QueryFloatAttribute( name, value ); - } - - /// Sets the named attribute to value. - void SetAttribute( const char* name, const char* value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, int value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, unsigned value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - - /// Sets the named attribute to value. - void SetAttribute(const char* name, int64_t value) { - XMLAttribute* a = FindOrCreateAttribute(name); - a->SetAttribute(value); - } - - /// Sets the named attribute to value. - void SetAttribute( const char* name, bool value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, double value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, float value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - - /** - Delete an attribute. - */ - void DeleteAttribute( const char* name ); - - /// Return the first attribute in the list. - const XMLAttribute* FirstAttribute() const { - return _rootAttribute; - } - /// Query a specific attribute in the list. - const XMLAttribute* FindAttribute( const char* name ) const; - - /** Convenience function for easy access to the text inside an element. Although easy - and concise, GetText() is limited compared to getting the XMLText child - and accessing it directly. - - If the first child of 'this' is a XMLText, the GetText() - returns the character string of the Text node, else null is returned. - - This is a convenient method for getting the text of simple contained text: - @verbatim - This is text - const char* str = fooElement->GetText(); - @endverbatim - - 'str' will be a pointer to "This is text". - - Note that this function can be misleading. If the element foo was created from - this XML: - @verbatim - This is text - @endverbatim - - then the value of str would be null. The first child node isn't a text node, it is - another element. From this XML: - @verbatim - This is text - @endverbatim - GetText() will return "This is ". - */ - const char* GetText() const; - - /** Convenience function for easy access to the text inside an element. Although easy - and concise, SetText() is limited compared to creating an XMLText child - and mutating it directly. - - If the first child of 'this' is a XMLText, SetText() sets its value to - the given string, otherwise it will create a first child that is an XMLText. - - This is a convenient method for setting the text of simple contained text: - @verbatim - This is text - fooElement->SetText( "Hullaballoo!" ); - Hullaballoo! - @endverbatim - - Note that this function can be misleading. If the element foo was created from - this XML: - @verbatim - This is text - @endverbatim - - then it will not change "This is text", but rather prefix it with a text element: - @verbatim - Hullaballoo!This is text - @endverbatim - - For this XML: - @verbatim - - @endverbatim - SetText() will generate - @verbatim - Hullaballoo! - @endverbatim - */ - void SetText( const char* inText ); - /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( int value ); - /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( unsigned value ); - /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText(int64_t value); - /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( bool value ); - /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( double value ); - /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( float value ); - - /** - Convenience method to query the value of a child text node. This is probably best - shown by example. Given you have a document is this form: - @verbatim - - 1 - 1.4 - - @endverbatim - - The QueryIntText() and similar functions provide a safe and easier way to get to the - "value" of x and y. - - @verbatim - int x = 0; - float y = 0; // types of x and y are contrived for example - const XMLElement* xElement = pointElement->FirstChildElement( "x" ); - const XMLElement* yElement = pointElement->FirstChildElement( "y" ); - xElement->QueryIntText( &x ); - yElement->QueryFloatText( &y ); - @endverbatim - - @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted - to the requested type, and XML_NO_TEXT_NODE if there is no child text to query. - - */ - XMLError QueryIntText( int* ival ) const; - /// See QueryIntText() - XMLError QueryUnsignedText( unsigned* uval ) const; - /// See QueryIntText() - XMLError QueryInt64Text(int64_t* uval) const; - /// See QueryIntText() - XMLError QueryBoolText( bool* bval ) const; - /// See QueryIntText() - XMLError QueryDoubleText( double* dval ) const; - /// See QueryIntText() - XMLError QueryFloatText( float* fval ) const; - - int IntText(int defaultValue = 0) const; - - /// See QueryIntText() - unsigned UnsignedText(unsigned defaultValue = 0) const; - /// See QueryIntText() - int64_t Int64Text(int64_t defaultValue = 0) const; - /// See QueryIntText() - bool BoolText(bool defaultValue = false) const; - /// See QueryIntText() - double DoubleText(double defaultValue = 0) const; - /// See QueryIntText() - float FloatText(float defaultValue = 0) const; - - // internal: - enum ElementClosingType { - OPEN, // - CLOSED, // - CLOSING // - }; - ElementClosingType ClosingType() const { - return _closingType; - } - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr ); - -private: - XMLElement( XMLDocument* doc ); - virtual ~XMLElement(); - XMLElement( const XMLElement& ); // not supported - void operator=( const XMLElement& ); // not supported - - XMLAttribute* FindOrCreateAttribute( const char* name ); - char* ParseAttributes( char* p, int* curLineNumPtr ); - static void DeleteAttribute( XMLAttribute* attribute ); - XMLAttribute* CreateAttribute(); - - enum { BUF_SIZE = 200 }; - ElementClosingType _closingType; - // The attribute list is ordered; there is no 'lastAttribute' - // because the list needs to be scanned for dupes before adding - // a new attribute. - XMLAttribute* _rootAttribute; -}; - - -enum Whitespace { - PRESERVE_WHITESPACE, - COLLAPSE_WHITESPACE -}; - - -/** A Document binds together all the functionality. - It can be saved, loaded, and printed to the screen. - All Nodes are connected and allocated to a Document. - If the Document is deleted, all its Nodes are also deleted. -*/ -class TINYXML2_LIB XMLDocument : public XMLNode -{ - friend class XMLElement; - // Gives access to SetError and Push/PopDepth, but over-access for everything else. - // Wishing C++ had "internal" scope. - friend class XMLNode; - friend class XMLText; - friend class XMLComment; - friend class XMLDeclaration; - friend class XMLUnknown; -public: - /// constructor - XMLDocument( bool processEntities = true, Whitespace whitespaceMode = PRESERVE_WHITESPACE ); - ~XMLDocument(); - - virtual XMLDocument* ToDocument() { - TIXMLASSERT( this == _document ); - return this; - } - virtual const XMLDocument* ToDocument() const { - TIXMLASSERT( this == _document ); - return this; - } - - /** - Parse an XML file from a character string. - Returns XML_SUCCESS (0) on success, or - an errorID. - - You may optionally pass in the 'nBytes', which is - the number of bytes which will be parsed. If not - specified, TinyXML-2 will assume 'xml' points to a - null terminated string. - */ - XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) ); - - /** - Load an XML file from disk. - Returns XML_SUCCESS (0) on success, or - an errorID. - */ - XMLError LoadFile( const char* filename ); - - /** - Load an XML file from disk. You are responsible - for providing and closing the FILE*. - - NOTE: The file should be opened as binary ("rb") - not text in order for TinyXML-2 to correctly - do newline normalization. - - Returns XML_SUCCESS (0) on success, or - an errorID. - */ - XMLError LoadFile( FILE* ); - - /** - Save the XML file to disk. - Returns XML_SUCCESS (0) on success, or - an errorID. - */ - XMLError SaveFile( const char* filename, bool compact = false ); - - /** - Save the XML file to disk. You are responsible - for providing and closing the FILE*. - - Returns XML_SUCCESS (0) on success, or - an errorID. - */ - XMLError SaveFile( FILE* fp, bool compact = false ); - - bool ProcessEntities() const { - return _processEntities; - } - Whitespace WhitespaceMode() const { - return _whitespaceMode; - } - - /** - Returns true if this document has a leading Byte Order Mark of UTF8. - */ - bool HasBOM() const { - return _writeBOM; - } - /** Sets whether to write the BOM when writing the file. - */ - void SetBOM( bool useBOM ) { - _writeBOM = useBOM; - } - - /** Return the root element of DOM. Equivalent to FirstChildElement(). - To get the first node, use FirstChild(). - */ - XMLElement* RootElement() { - return FirstChildElement(); - } - const XMLElement* RootElement() const { - return FirstChildElement(); - } - - /** Print the Document. If the Printer is not provided, it will - print to stdout. If you provide Printer, this can print to a file: - @verbatim - XMLPrinter printer( fp ); - doc.Print( &printer ); - @endverbatim - - Or you can use a printer to print to memory: - @verbatim - XMLPrinter printer; - doc.Print( &printer ); - // printer.CStr() has a const char* to the XML - @endverbatim - */ - void Print( XMLPrinter* streamer=0 ) const; - virtual bool Accept( XMLVisitor* visitor ) const; - - /** - Create a new Element associated with - this Document. The memory for the Element - is managed by the Document. - */ - XMLElement* NewElement( const char* name ); - /** - Create a new Comment associated with - this Document. The memory for the Comment - is managed by the Document. - */ - XMLComment* NewComment( const char* comment ); - /** - Create a new Text associated with - this Document. The memory for the Text - is managed by the Document. - */ - XMLText* NewText( const char* text ); - /** - Create a new Declaration associated with - this Document. The memory for the object - is managed by the Document. - - If the 'text' param is null, the standard - declaration is used.: - @verbatim - - @endverbatim - */ - XMLDeclaration* NewDeclaration( const char* text=0 ); - /** - Create a new Unknown associated with - this Document. The memory for the object - is managed by the Document. - */ - XMLUnknown* NewUnknown( const char* text ); - - /** - Delete a node associated with this document. - It will be unlinked from the DOM. - */ - void DeleteNode( XMLNode* node ); - - void ClearError() { - SetError(XML_SUCCESS, 0, 0); - } - - /// Return true if there was an error parsing the document. - bool Error() const { - return _errorID != XML_SUCCESS; - } - /// Return the errorID. - XMLError ErrorID() const { - return _errorID; - } - const char* ErrorName() const; - static const char* ErrorIDToName(XMLError errorID); - - /** Returns a "long form" error description. A hopefully helpful - diagnostic with location, line number, and/or additional info. - */ - const char* ErrorStr() const; - - /// A (trivial) utility function that prints the ErrorStr() to stdout. - void PrintError() const; - - /// Return the line where the error occurred, or zero if unknown. - int ErrorLineNum() const - { - return _errorLineNum; - } - - /// Clear the document, resetting it to the initial state. - void Clear(); - - /** - Copies this document to a target document. - The target will be completely cleared before the copy. - If you want to copy a sub-tree, see XMLNode::DeepClone(). - - NOTE: that the 'target' must be non-null. - */ - void DeepCopy(XMLDocument* target) const; - - // internal - char* Identify( char* p, XMLNode** node ); - - // internal - void MarkInUse(XMLNode*); - - virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const { - return 0; - } - virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const { - return false; - } - -private: - XMLDocument( const XMLDocument& ); // not supported - void operator=( const XMLDocument& ); // not supported - - bool _writeBOM; - bool _processEntities; - XMLError _errorID; - Whitespace _whitespaceMode; - mutable StrPair _errorStr; - int _errorLineNum; - char* _charBuffer; - int _parseCurLineNum; - int _parsingDepth; - // Memory tracking does add some overhead. - // However, the code assumes that you don't - // have a bunch of unlinked nodes around. - // Therefore it takes less memory to track - // in the document vs. a linked list in the XMLNode, - // and the performance is the same. - DynArray _unlinked; - - MemPoolT< sizeof(XMLElement) > _elementPool; - MemPoolT< sizeof(XMLAttribute) > _attributePool; - MemPoolT< sizeof(XMLText) > _textPool; - MemPoolT< sizeof(XMLComment) > _commentPool; - - static const char* _errorNames[XML_ERROR_COUNT]; - - void Parse(); - - void SetError( XMLError error, int lineNum, const char* format, ... ); - - // Something of an obvious security hole, once it was discovered. - // Either an ill-formed XML or an excessively deep one can overflow - // the stack. Track stack depth, and error out if needed. - class DepthTracker { - public: - explicit DepthTracker(XMLDocument * document) { - this->_document = document; - document->PushDepth(); - } - ~DepthTracker() { - _document->PopDepth(); - } - private: - XMLDocument * _document; - }; - void PushDepth(); - void PopDepth(); - - template - NodeType* CreateUnlinkedNode( MemPoolT& pool ); -}; - -template -inline NodeType* XMLDocument::CreateUnlinkedNode( MemPoolT& pool ) -{ - TIXMLASSERT( sizeof( NodeType ) == PoolElementSize ); - TIXMLASSERT( sizeof( NodeType ) == pool.ItemSize() ); - NodeType* returnNode = new (pool.Alloc()) NodeType( this ); - TIXMLASSERT( returnNode ); - returnNode->_memPool = &pool; - - _unlinked.Push(returnNode); - return returnNode; -} - -/** - A XMLHandle is a class that wraps a node pointer with null checks; this is - an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2 - DOM structure. It is a separate utility class. - - Take an example: - @verbatim - - - - - - - @endverbatim - - Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very - easy to write a *lot* of code that looks like: - - @verbatim - XMLElement* root = document.FirstChildElement( "Document" ); - if ( root ) - { - XMLElement* element = root->FirstChildElement( "Element" ); - if ( element ) - { - XMLElement* child = element->FirstChildElement( "Child" ); - if ( child ) - { - XMLElement* child2 = child->NextSiblingElement( "Child" ); - if ( child2 ) - { - // Finally do something useful. - @endverbatim - - And that doesn't even cover "else" cases. XMLHandle addresses the verbosity - of such code. A XMLHandle checks for null pointers so it is perfectly safe - and correct to use: - - @verbatim - XMLHandle docHandle( &document ); - XMLElement* child2 = docHandle.FirstChildElement( "Document" ).FirstChildElement( "Element" ).FirstChildElement().NextSiblingElement(); - if ( child2 ) - { - // do something useful - @endverbatim - - Which is MUCH more concise and useful. - - It is also safe to copy handles - internally they are nothing more than node pointers. - @verbatim - XMLHandle handleCopy = handle; - @endverbatim - - See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects. -*/ -class TINYXML2_LIB XMLHandle -{ -public: - /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. - explicit XMLHandle( XMLNode* node ) : _node( node ) { - } - /// Create a handle from a node. - explicit XMLHandle( XMLNode& node ) : _node( &node ) { - } - /// Copy constructor - XMLHandle( const XMLHandle& ref ) : _node( ref._node ) { - } - /// Assignment - XMLHandle& operator=( const XMLHandle& ref ) { - _node = ref._node; - return *this; - } - - /// Get the first child of this handle. - XMLHandle FirstChild() { - return XMLHandle( _node ? _node->FirstChild() : 0 ); - } - /// Get the first child element of this handle. - XMLHandle FirstChildElement( const char* name = 0 ) { - return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 ); - } - /// Get the last child of this handle. - XMLHandle LastChild() { - return XMLHandle( _node ? _node->LastChild() : 0 ); - } - /// Get the last child element of this handle. - XMLHandle LastChildElement( const char* name = 0 ) { - return XMLHandle( _node ? _node->LastChildElement( name ) : 0 ); - } - /// Get the previous sibling of this handle. - XMLHandle PreviousSibling() { - return XMLHandle( _node ? _node->PreviousSibling() : 0 ); - } - /// Get the previous sibling element of this handle. - XMLHandle PreviousSiblingElement( const char* name = 0 ) { - return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 ); - } - /// Get the next sibling of this handle. - XMLHandle NextSibling() { - return XMLHandle( _node ? _node->NextSibling() : 0 ); - } - /// Get the next sibling element of this handle. - XMLHandle NextSiblingElement( const char* name = 0 ) { - return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 ); - } - - /// Safe cast to XMLNode. This can return null. - XMLNode* ToNode() { - return _node; - } - /// Safe cast to XMLElement. This can return null. - XMLElement* ToElement() { - return ( _node ? _node->ToElement() : 0 ); - } - /// Safe cast to XMLText. This can return null. - XMLText* ToText() { - return ( _node ? _node->ToText() : 0 ); - } - /// Safe cast to XMLUnknown. This can return null. - XMLUnknown* ToUnknown() { - return ( _node ? _node->ToUnknown() : 0 ); - } - /// Safe cast to XMLDeclaration. This can return null. - XMLDeclaration* ToDeclaration() { - return ( _node ? _node->ToDeclaration() : 0 ); - } - -private: - XMLNode* _node; -}; - - -/** - A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the - same in all regards, except for the 'const' qualifiers. See XMLHandle for API. -*/ -class TINYXML2_LIB XMLConstHandle -{ -public: - explicit XMLConstHandle( const XMLNode* node ) : _node( node ) { - } - explicit XMLConstHandle( const XMLNode& node ) : _node( &node ) { - } - XMLConstHandle( const XMLConstHandle& ref ) : _node( ref._node ) { - } - - XMLConstHandle& operator=( const XMLConstHandle& ref ) { - _node = ref._node; - return *this; - } - - const XMLConstHandle FirstChild() const { - return XMLConstHandle( _node ? _node->FirstChild() : 0 ); - } - const XMLConstHandle FirstChildElement( const char* name = 0 ) const { - return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 ); - } - const XMLConstHandle LastChild() const { - return XMLConstHandle( _node ? _node->LastChild() : 0 ); - } - const XMLConstHandle LastChildElement( const char* name = 0 ) const { - return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 ); - } - const XMLConstHandle PreviousSibling() const { - return XMLConstHandle( _node ? _node->PreviousSibling() : 0 ); - } - const XMLConstHandle PreviousSiblingElement( const char* name = 0 ) const { - return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 ); - } - const XMLConstHandle NextSibling() const { - return XMLConstHandle( _node ? _node->NextSibling() : 0 ); - } - const XMLConstHandle NextSiblingElement( const char* name = 0 ) const { - return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 ); - } - - - const XMLNode* ToNode() const { - return _node; - } - const XMLElement* ToElement() const { - return ( _node ? _node->ToElement() : 0 ); - } - const XMLText* ToText() const { - return ( _node ? _node->ToText() : 0 ); - } - const XMLUnknown* ToUnknown() const { - return ( _node ? _node->ToUnknown() : 0 ); - } - const XMLDeclaration* ToDeclaration() const { - return ( _node ? _node->ToDeclaration() : 0 ); - } - -private: - const XMLNode* _node; -}; - - -/** - Printing functionality. The XMLPrinter gives you more - options than the XMLDocument::Print() method. - - It can: - -# Print to memory. - -# Print to a file you provide. - -# Print XML without a XMLDocument. - - Print to Memory - - @verbatim - XMLPrinter printer; - doc.Print( &printer ); - SomeFunction( printer.CStr() ); - @endverbatim - - Print to a File - - You provide the file pointer. - @verbatim - XMLPrinter printer( fp ); - doc.Print( &printer ); - @endverbatim - - Print without a XMLDocument - - When loading, an XML parser is very useful. However, sometimes - when saving, it just gets in the way. The code is often set up - for streaming, and constructing the DOM is just overhead. - - The Printer supports the streaming case. The following code - prints out a trivially simple XML file without ever creating - an XML document. - - @verbatim - XMLPrinter printer( fp ); - printer.OpenElement( "foo" ); - printer.PushAttribute( "foo", "bar" ); - printer.CloseElement(); - @endverbatim -*/ -class TINYXML2_LIB XMLPrinter : public XMLVisitor -{ -public: - /** Construct the printer. If the FILE* is specified, - this will print to the FILE. Else it will print - to memory, and the result is available in CStr(). - If 'compact' is set to true, then output is created - with only required whitespace and newlines. - */ - XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 ); - virtual ~XMLPrinter() {} - - /** If streaming, write the BOM and declaration. */ - void PushHeader( bool writeBOM, bool writeDeclaration ); - /** If streaming, start writing an element. - The element must be closed with CloseElement() - */ - void OpenElement( const char* name, bool compactMode=false ); - /// If streaming, add an attribute to an open element. - void PushAttribute( const char* name, const char* value ); - void PushAttribute( const char* name, int value ); - void PushAttribute( const char* name, unsigned value ); - void PushAttribute(const char* name, int64_t value); - void PushAttribute( const char* name, bool value ); - void PushAttribute( const char* name, double value ); - /// If streaming, close the Element. - virtual void CloseElement( bool compactMode=false ); - - /// Add a text node. - void PushText( const char* text, bool cdata=false ); - /// Add a text node from an integer. - void PushText( int value ); - /// Add a text node from an unsigned. - void PushText( unsigned value ); - /// Add a text node from an unsigned. - void PushText(int64_t value); - /// Add a text node from a bool. - void PushText( bool value ); - /// Add a text node from a float. - void PushText( float value ); - /// Add a text node from a double. - void PushText( double value ); - - /// Add a comment - void PushComment( const char* comment ); - - void PushDeclaration( const char* value ); - void PushUnknown( const char* value ); - - virtual bool VisitEnter( const XMLDocument& /*doc*/ ); - virtual bool VisitExit( const XMLDocument& /*doc*/ ) { - return true; - } - - virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute ); - virtual bool VisitExit( const XMLElement& element ); - - virtual bool Visit( const XMLText& text ); - virtual bool Visit( const XMLComment& comment ); - virtual bool Visit( const XMLDeclaration& declaration ); - virtual bool Visit( const XMLUnknown& unknown ); - - /** - If in print to memory mode, return a pointer to - the XML file in memory. - */ - const char* CStr() const { - return _buffer.Mem(); - } - /** - If in print to memory mode, return the size - of the XML file in memory. (Note the size returned - includes the terminating null.) - */ - int CStrSize() const { - return _buffer.Size(); - } - /** - If in print to memory mode, reset the buffer to the - beginning. - */ - void ClearBuffer() { - _buffer.Clear(); - _buffer.Push(0); - _firstElement = true; - } - -protected: - virtual bool CompactMode( const XMLElement& ) { return _compactMode; } - - /** Prints out the space before an element. You may override to change - the space and tabs used. A PrintSpace() override should call Print(). - */ - virtual void PrintSpace( int depth ); - void Print( const char* format, ... ); - void Write( const char* data, size_t size ); - inline void Write( const char* data ) { Write( data, strlen( data ) ); } - void Putc( char ch ); - - void SealElementIfJustOpened(); - bool _elementJustOpened; - DynArray< const char*, 10 > _stack; - -private: - void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities. - - bool _firstElement; - FILE* _fp; - int _depth; - int _textDepth; - bool _processEntities; - bool _compactMode; - - enum { - ENTITY_RANGE = 64, - BUF_SIZE = 200 - }; - bool _entityFlag[ENTITY_RANGE]; - bool _restrictedEntityFlag[ENTITY_RANGE]; - - DynArray< char, 20 > _buffer; - - // Prohibit cloning, intentionally not implemented - XMLPrinter( const XMLPrinter& ); - XMLPrinter& operator=( const XMLPrinter& ); -}; - - -} // tinyxml2 - -#if defined(_MSC_VER) -# pragma warning(pop) -#endif - -#endif // TINYXML2_INCLUDED diff --git a/tools/ZAPDConfigs/ActorList.txt b/tools/ZAPDConfigs/ActorList.txt deleted file mode 100644 index a0395eb277..0000000000 --- a/tools/ZAPDConfigs/ActorList.txt +++ /dev/null @@ -1,472 +0,0 @@ -ACTOR_PLAYER -ACTOR_UNSET_1 -ACTOR_EN_TEST -ACTOR_UNSET_3 -ACTOR_EN_GIRLA -ACTOR_UNSET_5 -ACTOR_UNSET_6 -ACTOR_EN_PART -ACTOR_EN_LIGHT -ACTOR_EN_DOOR -ACTOR_EN_BOX -ACTOR_BG_DY_YOSEIZO -ACTOR_BG_HIDAN_FIREWALL -ACTOR_EN_POH -ACTOR_EN_OKUTA -ACTOR_BG_YDAN_SP -ACTOR_EN_BOM -ACTOR_EN_WALLMAS -ACTOR_EN_DODONGO -ACTOR_EN_FIREFLY -ACTOR_EN_HORSE -ACTOR_EN_ITEM00 -ACTOR_EN_ARROW -ACTOR_UNSET_17 -ACTOR_EN_ELF -ACTOR_EN_NIW -ACTOR_UNSET_1A -ACTOR_EN_TITE -ACTOR_EN_REEBA -ACTOR_EN_PEEHAT -ACTOR_EN_BUTTE -ACTOR_UNSET_1F -ACTOR_EN_INSECT -ACTOR_EN_FISH -ACTOR_UNSET_22 -ACTOR_EN_HOLL -ACTOR_EN_SCENE_CHANGE -ACTOR_EN_ZF -ACTOR_EN_HATA -ACTOR_BOSS_DODONGO -ACTOR_BOSS_GOMA -ACTOR_EN_ZL1 -ACTOR_EN_VIEWER -ACTOR_EN_GOMA -ACTOR_BG_PUSHBOX -ACTOR_EN_BUBBLE -ACTOR_DOOR_SHUTTER -ACTOR_EN_DODOJR -ACTOR_EN_BDFIRE -ACTOR_UNSET_31 -ACTOR_EN_BOOM -ACTOR_EN_TORCH2 -ACTOR_EN_BILI -ACTOR_EN_TP -ACTOR_UNSET_36 -ACTOR_EN_ST -ACTOR_EN_BW -ACTOR_EN_A_OBJ -ACTOR_EN_EIYER -ACTOR_EN_RIVER_SOUND -ACTOR_EN_HORSE_NORMAL -ACTOR_EN_OSSAN -ACTOR_BG_TREEMOUTH -ACTOR_BG_DODOAGO -ACTOR_BG_HIDAN_DALM -ACTOR_BG_HIDAN_HROCK -ACTOR_EN_HORSE_GANON -ACTOR_BG_HIDAN_ROCK -ACTOR_BG_HIDAN_RSEKIZOU -ACTOR_BG_HIDAN_SEKIZOU -ACTOR_BG_HIDAN_SIMA -ACTOR_BG_HIDAN_SYOKU -ACTOR_EN_XC -ACTOR_BG_HIDAN_CURTAIN -ACTOR_BG_SPOT00_HANEBASI -ACTOR_EN_MB -ACTOR_EN_BOMBF -ACTOR_EN_ZL2 -ACTOR_BG_HIDAN_FSLIFT -ACTOR_EN_OE2 -ACTOR_BG_YDAN_HASI -ACTOR_BG_YDAN_MARUTA -ACTOR_BOSS_GANONDROF -ACTOR_UNSET_53 -ACTOR_EN_AM -ACTOR_EN_DEKUBABA -ACTOR_EN_M_FIRE1 -ACTOR_EN_M_THUNDER -ACTOR_BG_DDAN_JD -ACTOR_BG_BREAKWALL -ACTOR_EN_JJ -ACTOR_EN_HORSE_ZELDA -ACTOR_BG_DDAN_KD -ACTOR_DOOR_WARP1 -ACTOR_OBJ_SYOKUDAI -ACTOR_ITEM_B_HEART -ACTOR_EN_DEKUNUTS -ACTOR_BG_MENKURI_KAITEN -ACTOR_BG_MENKURI_EYE -ACTOR_EN_VALI -ACTOR_BG_MIZU_MOVEBG -ACTOR_BG_MIZU_WATER -ACTOR_ARMS_HOOK -ACTOR_EN_FHG -ACTOR_BG_MORI_HINERI -ACTOR_EN_BB -ACTOR_BG_TOKI_HIKARI -ACTOR_EN_YUKABYUN -ACTOR_BG_TOKI_SWD -ACTOR_EN_FHG_FIRE -ACTOR_BG_MJIN -ACTOR_BG_HIDAN_KOUSI -ACTOR_DOOR_TOKI -ACTOR_BG_HIDAN_HAMSTEP -ACTOR_EN_BIRD -ACTOR_UNSET_73 -ACTOR_UNSET_74 -ACTOR_UNSET_75 -ACTOR_UNSET_76 -ACTOR_EN_WOOD02 -ACTOR_UNSET_78 -ACTOR_UNSET_79 -ACTOR_UNSET_7A -ACTOR_UNSET_7B -ACTOR_EN_LIGHTBOX -ACTOR_EN_PU_BOX -ACTOR_UNSET_7E -ACTOR_UNSET_7F -ACTOR_EN_TRAP -ACTOR_EN_AROW_TRAP -ACTOR_EN_VASE -ACTOR_UNSET_83 -ACTOR_EN_TA -ACTOR_EN_TK -ACTOR_BG_MORI_BIGST -ACTOR_BG_MORI_ELEVATOR -ACTOR_BG_MORI_KAITENKABE -ACTOR_BG_MORI_RAKKATENJO -ACTOR_EN_VM -ACTOR_DEMO_EFFECT -ACTOR_DEMO_KANKYO -ACTOR_BG_HIDAN_FWBIG -ACTOR_EN_FLOORMAS -ACTOR_EN_HEISHI1 -ACTOR_EN_RD -ACTOR_EN_PO_SISTERS -ACTOR_BG_HEAVY_BLOCK -ACTOR_BG_PO_EVENT -ACTOR_OBJ_MURE -ACTOR_EN_SW -ACTOR_BOSS_FD -ACTOR_OBJECT_KANKYO -ACTOR_EN_DU -ACTOR_EN_FD -ACTOR_EN_HORSE_LINK_CHILD -ACTOR_DOOR_ANA -ACTOR_BG_SPOT02_OBJECTS -ACTOR_BG_HAKA -ACTOR_MAGIC_WIND -ACTOR_MAGIC_FIRE -ACTOR_UNSET_A0 -ACTOR_EN_RU1 -ACTOR_BOSS_FD2 -ACTOR_EN_FD_FIRE -ACTOR_EN_DH -ACTOR_EN_DHA -ACTOR_EN_RL -ACTOR_EN_ENCOUNT1 -ACTOR_DEMO_DU -ACTOR_DEMO_IM -ACTOR_DEMO_TRE_LGT -ACTOR_EN_FW -ACTOR_BG_VB_SIMA -ACTOR_EN_VB_BALL -ACTOR_BG_HAKA_MEGANE -ACTOR_BG_HAKA_MEGANEBG -ACTOR_BG_HAKA_SHIP -ACTOR_BG_HAKA_SGAMI -ACTOR_UNSET_B2 -ACTOR_EN_HEISHI2 -ACTOR_EN_ENCOUNT2 -ACTOR_EN_FIRE_ROCK -ACTOR_EN_BROB -ACTOR_MIR_RAY -ACTOR_BG_SPOT09_OBJ -ACTOR_BG_SPOT18_OBJ -ACTOR_BOSS_VA -ACTOR_BG_HAKA_TUBO -ACTOR_BG_HAKA_TRAP -ACTOR_BG_HAKA_HUTA -ACTOR_BG_HAKA_ZOU -ACTOR_BG_SPOT17_FUNEN -ACTOR_EN_SYATEKI_ITM -ACTOR_EN_SYATEKI_MAN -ACTOR_EN_TANA -ACTOR_EN_NB -ACTOR_BOSS_MO -ACTOR_EN_SB -ACTOR_EN_BIGOKUTA -ACTOR_EN_KAREBABA -ACTOR_BG_BDAN_OBJECTS -ACTOR_DEMO_SA -ACTOR_DEMO_GO -ACTOR_EN_IN -ACTOR_EN_TR -ACTOR_BG_SPOT16_BOMBSTONE -ACTOR_UNSET_CE -ACTOR_BG_HIDAN_KOWARERUKABE -ACTOR_BG_BOMBWALL -ACTOR_BG_SPOT08_ICEBLOCK -ACTOR_EN_RU2 -ACTOR_OBJ_DEKUJR -ACTOR_BG_MIZU_UZU -ACTOR_BG_SPOT06_OBJECTS -ACTOR_BG_ICE_OBJECTS -ACTOR_BG_HAKA_WATER -ACTOR_UNSET_D8 -ACTOR_EN_MA2 -ACTOR_EN_BOM_CHU -ACTOR_EN_HORSE_GAME_CHECK -ACTOR_BOSS_TW -ACTOR_EN_RR -ACTOR_EN_BA -ACTOR_EN_BX -ACTOR_EN_ANUBICE -ACTOR_EN_ANUBICE_FIRE -ACTOR_BG_MORI_HASHIGO -ACTOR_BG_MORI_HASHIRA4 -ACTOR_BG_MORI_IDOMIZU -ACTOR_BG_SPOT16_DOUGHNUT -ACTOR_BG_BDAN_SWITCH -ACTOR_EN_MA1 -ACTOR_BOSS_GANON -ACTOR_BOSS_SST -ACTOR_UNSET_EA -ACTOR_UNSET_EB -ACTOR_EN_NY -ACTOR_EN_FR -ACTOR_ITEM_SHIELD -ACTOR_BG_ICE_SHELTER -ACTOR_EN_ICE_HONO -ACTOR_ITEM_OCARINA -ACTOR_UNSET_F2 -ACTOR_UNSET_F3 -ACTOR_MAGIC_DARK -ACTOR_DEMO_6K -ACTOR_EN_ANUBICE_TAG -ACTOR_BG_HAKA_GATE -ACTOR_BG_SPOT15_SAKU -ACTOR_BG_JYA_GOROIWA -ACTOR_BG_JYA_ZURERUKABE -ACTOR_UNSET_FB -ACTOR_BG_JYA_COBRA -ACTOR_BG_JYA_KANAAMI -ACTOR_FISHING -ACTOR_OBJ_OSHIHIKI -ACTOR_BG_GATE_SHUTTER -ACTOR_EFF_DUST -ACTOR_BG_SPOT01_FUSYA -ACTOR_BG_SPOT01_IDOHASHIRA -ACTOR_BG_SPOT01_IDOMIZU -ACTOR_BG_PO_SYOKUDAI -ACTOR_BG_GANON_OTYUKA -ACTOR_BG_SPOT15_RRBOX -ACTOR_BG_UMAJUMP -ACTOR_UNSET_109 -ACTOR_ARROW_FIRE -ACTOR_ARROW_ICE -ACTOR_ARROW_LIGHT -ACTOR_UNSET_10D -ACTOR_UNSET_10E -ACTOR_ITEM_ETCETERA -ACTOR_OBJ_KIBAKO -ACTOR_OBJ_TSUBO -ACTOR_EN_WONDER_ITEM -ACTOR_EN_IK -ACTOR_DEMO_IK -ACTOR_EN_SKJ -ACTOR_EN_SKJNEEDLE -ACTOR_EN_G_SWITCH -ACTOR_DEMO_EXT -ACTOR_DEMO_SHD -ACTOR_EN_DNS -ACTOR_ELF_MSG -ACTOR_EN_HONOTRAP -ACTOR_EN_TUBO_TRAP -ACTOR_OBJ_ICE_POLY -ACTOR_BG_SPOT03_TAKI -ACTOR_BG_SPOT07_TAKI -ACTOR_EN_FZ -ACTOR_EN_PO_RELAY -ACTOR_BG_RELAY_OBJECTS -ACTOR_EN_DIVING_GAME -ACTOR_EN_KUSA -ACTOR_OBJ_BEAN -ACTOR_OBJ_BOMBIWA -ACTOR_UNSET_128 -ACTOR_UNSET_129 -ACTOR_OBJ_SWITCH -ACTOR_OBJ_ELEVATOR -ACTOR_OBJ_LIFT -ACTOR_OBJ_HSBLOCK -ACTOR_EN_OKARINA_TAG -ACTOR_EN_YABUSAME_MARK -ACTOR_EN_GOROIWA -ACTOR_EN_EX_RUPPY -ACTOR_EN_TORYO -ACTOR_EN_DAIKU -ACTOR_UNSET_134 -ACTOR_EN_NWC -ACTOR_EN_BLKOBJ -ACTOR_ITEM_INBOX -ACTOR_EN_GE1 -ACTOR_OBJ_BLOCKSTOP -ACTOR_EN_SDA -ACTOR_EN_CLEAR_TAG -ACTOR_EN_NIW_LADY -ACTOR_EN_GM -ACTOR_EN_MS -ACTOR_EN_HS -ACTOR_BG_INGATE -ACTOR_EN_KANBAN -ACTOR_EN_HEISHI3 -ACTOR_EN_SYATEKI_NIW -ACTOR_EN_ATTACK_NIW -ACTOR_BG_SPOT01_IDOSOKO -ACTOR_EN_SA -ACTOR_EN_WONDER_TALK -ACTOR_BG_GJYO_BRIDGE -ACTOR_EN_DS -ACTOR_EN_MK -ACTOR_EN_BOM_BOWL_MAN -ACTOR_EN_BOM_BOWL_PIT -ACTOR_EN_OWL -ACTOR_EN_ISHI -ACTOR_OBJ_HANA -ACTOR_OBJ_LIGHTSWITCH -ACTOR_OBJ_MURE2 -ACTOR_EN_GO -ACTOR_EN_FU -ACTOR_UNSET_154 -ACTOR_EN_CHANGER -ACTOR_BG_JYA_MEGAMI -ACTOR_BG_JYA_LIFT -ACTOR_BG_JYA_BIGMIRROR -ACTOR_BG_JYA_BOMBCHUIWA -ACTOR_BG_JYA_AMISHUTTER -ACTOR_BG_JYA_BOMBIWA -ACTOR_BG_SPOT18_BASKET -ACTOR_UNSET_15D -ACTOR_EN_GANON_ORGAN -ACTOR_EN_SIOFUKI -ACTOR_EN_STREAM -ACTOR_UNSET_161 -ACTOR_EN_MM -ACTOR_EN_KO -ACTOR_EN_KZ -ACTOR_EN_WEATHER_TAG -ACTOR_BG_SST_FLOOR -ACTOR_EN_ANI -ACTOR_EN_EX_ITEM -ACTOR_BG_JYA_IRONOBJ -ACTOR_EN_JS -ACTOR_EN_JSJUTAN -ACTOR_EN_CS -ACTOR_EN_MD -ACTOR_EN_HY -ACTOR_EN_GANON_MANT -ACTOR_EN_OKARINA_EFFECT -ACTOR_EN_MAG -ACTOR_DOOR_GERUDO -ACTOR_ELF_MSG2 -ACTOR_DEMO_GT -ACTOR_EN_PO_FIELD -ACTOR_EFC_ERUPC -ACTOR_BG_ZG -ACTOR_EN_HEISHI4 -ACTOR_EN_ZL3 -ACTOR_BOSS_GANON2 -ACTOR_EN_KAKASI -ACTOR_EN_TAKARA_MAN -ACTOR_OBJ_MAKEOSHIHIKI -ACTOR_OCEFF_SPOT -ACTOR_END_TITLE -ACTOR_UNSET_180 -ACTOR_EN_TORCH -ACTOR_DEMO_EC -ACTOR_SHOT_SUN -ACTOR_EN_DY_EXTRA -ACTOR_EN_WONDER_TALK2 -ACTOR_EN_GE2 -ACTOR_OBJ_ROOMTIMER -ACTOR_EN_SSH -ACTOR_EN_STH -ACTOR_OCEFF_WIPE -ACTOR_OCEFF_STORM -ACTOR_EN_WEIYER -ACTOR_BG_SPOT05_SOKO -ACTOR_BG_JYA_1FLIFT -ACTOR_BG_JYA_HAHENIRON -ACTOR_BG_SPOT12_GATE -ACTOR_BG_SPOT12_SAKU -ACTOR_EN_HINTNUTS -ACTOR_EN_NUTSBALL -ACTOR_BG_SPOT00_BREAK -ACTOR_EN_SHOPNUTS -ACTOR_EN_IT -ACTOR_EN_GELDB -ACTOR_OCEFF_WIPE2 -ACTOR_OCEFF_WIPE3 -ACTOR_EN_NIW_GIRL -ACTOR_EN_DOG -ACTOR_EN_SI -ACTOR_BG_SPOT01_OBJECTS2 -ACTOR_OBJ_COMB -ACTOR_BG_SPOT11_BAKUDANKABE -ACTOR_OBJ_KIBAKO2 -ACTOR_EN_DNT_DEMO -ACTOR_EN_DNT_JIJI -ACTOR_EN_DNT_NOMAL -ACTOR_EN_GUEST -ACTOR_BG_BOM_GUARD -ACTOR_EN_HS2 -ACTOR_DEMO_KEKKAI -ACTOR_BG_SPOT08_BAKUDANKABE -ACTOR_BG_SPOT17_BAKUDANKABE -ACTOR_UNSET_1AA -ACTOR_OBJ_MURE3 -ACTOR_EN_TG -ACTOR_EN_MU -ACTOR_EN_GO2 -ACTOR_EN_WF -ACTOR_EN_SKB -ACTOR_DEMO_GJ -ACTOR_DEMO_GEFF -ACTOR_BG_GND_FIREMEIRO -ACTOR_BG_GND_DARKMEIRO -ACTOR_BG_GND_SOULMEIRO -ACTOR_BG_GND_NISEKABE -ACTOR_BG_GND_ICEBLOCK -ACTOR_EN_GB -ACTOR_EN_GS -ACTOR_BG_MIZU_BWALL -ACTOR_BG_MIZU_SHUTTER -ACTOR_EN_DAIKU_KAKARIKO -ACTOR_BG_BOWL_WALL -ACTOR_EN_WALL_TUBO -ACTOR_EN_PO_DESERT -ACTOR_EN_CROW -ACTOR_DOOR_KILLER -ACTOR_BG_SPOT11_OASIS -ACTOR_BG_SPOT18_FUTA -ACTOR_BG_SPOT18_SHUTTER -ACTOR_EN_MA3 -ACTOR_EN_COW -ACTOR_BG_ICE_TURARA -ACTOR_BG_ICE_SHUTTER -ACTOR_EN_KAKASI2 -ACTOR_EN_KAKASI3 -ACTOR_OCEFF_WIPE4 -ACTOR_EN_EG -ACTOR_BG_MENKURI_NISEKABE -ACTOR_EN_ZO -ACTOR_OBJ_MAKEKINSUTA -ACTOR_EN_GE3 -ACTOR_OBJ_TIMEBLOCK -ACTOR_OBJ_HAMISHI -ACTOR_EN_ZL4 -ACTOR_EN_MM2 -ACTOR_BG_JYA_BLOCK -ACTOR_OBJ_WARP2BLOCK -ACTOR_ID_MAX \ No newline at end of file diff --git a/tools/ZAPDConfigs/EntranceList.txt b/tools/ZAPDConfigs/EntranceList.txt deleted file mode 100644 index 5ff4617df1..0000000000 --- a/tools/ZAPDConfigs/EntranceList.txt +++ /dev/null @@ -1,1556 +0,0 @@ -ENTR_DEKU_TREE_0 -ENTR_DEKU_TREE_0_1 -ENTR_DEKU_TREE_0_2 -ENTR_DEKU_TREE_0_3 -ENTR_DODONGOS_CAVERN_0 -ENTR_DODONGOS_CAVERN_0_1 -ENTR_DODONGOS_CAVERN_0_2 -ENTR_DODONGOS_CAVERN_0_3 -ENTR_GERUDO_TRAINING_GROUND_0 -ENTR_GERUDO_TRAINING_GROUND_0_1 -ENTR_GERUDO_TRAINING_GROUND_0_2 -ENTR_GERUDO_TRAINING_GROUND_0_3 -ENTR_FOREST_TEMPLE_BOSS_0 -ENTR_FOREST_TEMPLE_BOSS_0_1 -ENTR_FOREST_TEMPLE_BOSS_0_2 -ENTR_FOREST_TEMPLE_BOSS_0_3 -ENTR_WATER_TEMPLE_0 -ENTR_WATER_TEMPLE_0_1 -ENTR_WATER_TEMPLE_0_2 -ENTR_WATER_TEMPLE_0_3 -ENTR_UNUSED_6E -ENTR_UNUSED_6E_1 -ENTR_UNUSED_6E_2 -ENTR_UNUSED_6E_3 -ENTR_SASATEST_0 -ENTR_SASATEST_0_1 -ENTR_SASATEST_0_2 -ENTR_SASATEST_0_3 -ENTR_SYOTES_0 -ENTR_SYOTES_0_1 -ENTR_SYOTES_0_2 -ENTR_SYOTES_0_3 -ENTR_SYOTES2_0 -ENTR_SYOTES2_0_1 -ENTR_SYOTES2_0_2 -ENTR_SYOTES2_0_3 -ENTR_TESTROOM_0 -ENTR_TESTROOM_0_1 -ENTR_TESTROOM_0_2 -ENTR_TESTROOM_0_3 -ENTR_JABU_JABU_0 -ENTR_JABU_JABU_0_1 -ENTR_JABU_JABU_0_2 -ENTR_JABU_JABU_0_3 -ENTR_JABU_JABU_0_4 -ENTR_ROYAL_FAMILYS_TOMB_0 -ENTR_ROYAL_FAMILYS_TOMB_0_1 -ENTR_ROYAL_FAMILYS_TOMB_0_2 -ENTR_ROYAL_FAMILYS_TOMB_0_3 -ENTR_ROYAL_FAMILYS_TOMB_0_4 -ENTR_ROYAL_FAMILYS_TOMB_0_5 -ENTR_MARKET_ENTRANCE_DAY_0 -ENTR_MARKET_ENTRANCE_NIGHT_0_1 -ENTR_MARKET_ENTRANCE_RUINS_0_2 -ENTR_MARKET_ENTRANCE_RUINS_0_3 -ENTR_SHADOW_TEMPLE_0 -ENTR_SHADOW_TEMPLE_0_1 -ENTR_SHADOW_TEMPLE_0_2 -ENTR_SHADOW_TEMPLE_0_3 -ENTR_SHOOTING_GALLERY_0 -ENTR_SHOOTING_GALLERY_0_1 -ENTR_SHOOTING_GALLERY_0_2 -ENTR_SHOOTING_GALLERY_0_3 -ENTR_GROTTOS_0 -ENTR_GROTTOS_0_1 -ENTR_GROTTOS_0_2 -ENTR_GROTTOS_0_3 -ENTR_LAKESIDE_LABORATORY_0 -ENTR_LAKESIDE_LABORATORY_0_1 -ENTR_LAKESIDE_LABORATORY_0_2 -ENTR_LAKESIDE_LABORATORY_0_3 -ENTR_SUTARU_0 -ENTR_SUTARU_0_1 -ENTR_SUTARU_0_2 -ENTR_SUTARU_0_3 -ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0 -ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0_1 -ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0_2 -ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0_3 -ENTR_LON_LON_BUILDINGS_0 -ENTR_LON_LON_BUILDINGS_0_1 -ENTR_LON_LON_BUILDINGS_0_2 -ENTR_LON_LON_BUILDINGS_0_3 -ENTR_TEMPLE_OF_TIME_0 -ENTR_TEMPLE_OF_TIME_0_1 -ENTR_TEMPLE_OF_TIME_0_2 -ENTR_TEMPLE_OF_TIME_0_3 -ENTR_TEMPLE_OF_TIME_0_4 -ENTR_TEMPLE_OF_TIME_0_5 -ENTR_TEMPLE_OF_TIME_0_6 -ENTR_TEMPLE_OF_TIME_0_7 -ENTR_TEMPLE_OF_TIME_0_8 -ENTR_TEMPLE_OF_TIME_0_9 -ENTR_TEMPLE_OF_TIME_0_10 -ENTR_TEMPLE_OF_TIME_0_11 -ENTR_TEMPLE_OF_TIME_0_12 -ENTR_TEMPLE_OF_TIME_0_13 -ENTR_TEMPLE_OF_TIME_0_14 -ENTR_TEMPLE_OF_TIME_0_15 -ENTR_TREASURE_BOX_SHOP_0 -ENTR_TREASURE_BOX_SHOP_0_1 -ENTR_TREASURE_BOX_SHOP_0_2 -ENTR_TREASURE_BOX_SHOP_0_3 -ENTR_BACK_ALLEY_DAY_3 -ENTR_BACK_ALLEY_NIGHT_3_1 -ENTR_BACK_ALLEY_DAY_3_2 -ENTR_BACK_ALLEY_NIGHT_3_3 -ENTR_CHAMBER_OF_THE_SAGES_0 -ENTR_CHAMBER_OF_THE_SAGES_0_1 -ENTR_CHAMBER_OF_THE_SAGES_0_2 -ENTR_CHAMBER_OF_THE_SAGES_0_3 -ENTR_CHAMBER_OF_THE_SAGES_0_4 -ENTR_CHAMBER_OF_THE_SAGES_0_5 -ENTR_CHAMBER_OF_THE_SAGES_0_6 -ENTR_POTION_SHOP_GRANNY_0 -ENTR_POTION_SHOP_GRANNY_0_1 -ENTR_POTION_SHOP_GRANNY_0_2 -ENTR_POTION_SHOP_GRANNY_0_3 -ENTR_HAIRAL_NIWA2_0 -ENTR_HAIRAL_NIWA2_0_1 -ENTR_HAIRAL_NIWA2_0_2 -ENTR_HAIRAL_NIWA2_0_3 -ENTR_CASTLE_COURTYARD_GUARDS_DAY_0 -ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_0_1 -ENTR_CASTLE_COURTYARD_GUARDS_DAY_0_2 -ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_0_3 -ENTR_MARKET_GUARD_HOUSE_0 -ENTR_MARKET_GUARD_HOUSE_0_1 -ENTR_MARKET_GUARD_HOUSE_0_2 -ENTR_MARKET_GUARD_HOUSE_0_3 -ENTR_SPIRIT_TEMPLE_0 -ENTR_SPIRIT_TEMPLE_0_1 -ENTR_SPIRIT_TEMPLE_0_2 -ENTR_SPIRIT_TEMPLE_0_3 -ENTR_SPIRIT_TEMPLE_0_4 -ENTR_SPIRIT_TEMPLE_0_5 -ENTR_ICE_CAVERN_0 -ENTR_ICE_CAVERN_0_1 -ENTR_ICE_CAVERN_0_2 -ENTR_ICE_CAVERN_0_3 -ENTR_ICE_CAVERN_0_4 -ENTR_SPIRIT_TEMPLE_BOSS_0 -ENTR_SPIRIT_TEMPLE_BOSS_0_1 -ENTR_SPIRIT_TEMPLE_BOSS_0_2 -ENTR_SPIRIT_TEMPLE_BOSS_0_3 -ENTR_SPIRIT_TEMPLE_BOSS_0_4 -ENTR_SPIRIT_TEMPLE_BOSS_0_5 -ENTR_SPIRIT_TEMPLE_BOSS_0_6 -ENTR_TEST01_0 -ENTR_TEST01_0_1 -ENTR_TEST01_0_2 -ENTR_TEST01_0_3 -ENTR_BOTTOM_OF_THE_WELL_0 -ENTR_BOTTOM_OF_THE_WELL_0_1 -ENTR_BOTTOM_OF_THE_WELL_0_2 -ENTR_BOTTOM_OF_THE_WELL_0_3 -ENTR_TWINS_HOUSE_0 -ENTR_TWINS_HOUSE_0_1 -ENTR_TWINS_HOUSE_0_2 -ENTR_TWINS_HOUSE_0_3 -ENTR_CUTSCENE_MAP_0 -ENTR_CUTSCENE_MAP_0_1 -ENTR_CUTSCENE_MAP_0_2 -ENTR_CUTSCENE_MAP_0_3 -ENTR_CUTSCENE_MAP_0_4 -ENTR_CUTSCENE_MAP_0_5 -ENTR_CUTSCENE_MAP_0_6 -ENTR_CUTSCENE_MAP_0_7 -ENTR_CUTSCENE_MAP_0_8 -ENTR_CUTSCENE_MAP_0_9 -ENTR_CUTSCENE_MAP_0_10 -ENTR_CUTSCENE_MAP_0_11 -ENTR_CUTSCENE_MAP_0_12 -ENTR_BACK_ALLEY_DAY_0 -ENTR_BACK_ALLEY_NIGHT_0_1 -ENTR_BACK_ALLEY_DAY_0_2 -ENTR_BACK_ALLEY_NIGHT_0_3 -ENTR_MARKET_DAY_0 -ENTR_MARKET_NIGHT_0_1 -ENTR_MARKET_RUINS_0_2 -ENTR_MARKET_RUINS_0_3 -ENTR_MARKET_DAY_0_4 -ENTR_DEPTH_TEST_0 -ENTR_BAZAAR_0 -ENTR_BAZAAR_0_1 -ENTR_BAZAAR_0_2 -ENTR_BAZAAR_0_3 -ENTR_LINKS_HOUSE_0 -ENTR_LINKS_HOUSE_0_1 -ENTR_LINKS_HOUSE_0_2 -ENTR_LINKS_HOUSE_0_3 -ENTR_LINKS_HOUSE_0_4 -ENTR_LINKS_HOUSE_0_5 -ENTR_KOKIRI_SHOP_0 -ENTR_KOKIRI_SHOP_0_1 -ENTR_KOKIRI_SHOP_0_2 -ENTR_KOKIRI_SHOP_0_3 -ENTR_DODONGOS_CAVERN_1 -ENTR_DODONGOS_CAVERN_1_1 -ENTR_DODONGOS_CAVERN_1_2 -ENTR_DODONGOS_CAVERN_1_3 -ENTR_KNOW_IT_ALL_BROS_HOUSE_0 -ENTR_KNOW_IT_ALL_BROS_HOUSE_0_1 -ENTR_KNOW_IT_ALL_BROS_HOUSE_0_2 -ENTR_KNOW_IT_ALL_BROS_HOUSE_0_3 -ENTR_HYRULE_FIELD_0 -ENTR_HYRULE_FIELD_0_1 -ENTR_HYRULE_FIELD_0_2 -ENTR_HYRULE_FIELD_0_3 -ENTR_HYRULE_FIELD_0_4 -ENTR_HYRULE_FIELD_0_5 -ENTR_HYRULE_FIELD_0_6 -ENTR_HYRULE_FIELD_0_7 -ENTR_HYRULE_FIELD_0_8 -ENTR_HYRULE_FIELD_0_9 -ENTR_HYRULE_FIELD_0_10 -ENTR_HYRULE_FIELD_0_11 -ENTR_HYRULE_FIELD_0_12 -ENTR_HYRULE_FIELD_0_13 -ENTR_KAKARIKO_VILLAGE_0 -ENTR_KAKARIKO_VILLAGE_0_1 -ENTR_KAKARIKO_VILLAGE_0_2 -ENTR_KAKARIKO_VILLAGE_0_3 -ENTR_KAKARIKO_VILLAGE_0_4 -ENTR_KAKARIKO_VILLAGE_0_5 -ENTR_KAKARIKO_VILLAGE_0_6 -ENTR_KAKARIKO_VILLAGE_0_7 -ENTR_KAKARIKO_VILLAGE_0_8 -ENTR_GRAVEYARD_0 -ENTR_GRAVEYARD_0_1 -ENTR_GRAVEYARD_0_2 -ENTR_GRAVEYARD_0_3 -ENTR_GRAVEYARD_0_4 -ENTR_GRAVEYARD_0_5 -ENTR_ZORAS_RIVER_0 -ENTR_ZORAS_RIVER_0_1 -ENTR_ZORAS_RIVER_0_2 -ENTR_ZORAS_RIVER_0_3 -ENTR_KOKIRI_FOREST_0 -ENTR_KOKIRI_FOREST_0_1 -ENTR_KOKIRI_FOREST_0_2 -ENTR_KOKIRI_FOREST_0_3 -ENTR_KOKIRI_FOREST_0_4 -ENTR_KOKIRI_FOREST_0_5 -ENTR_KOKIRI_FOREST_0_6 -ENTR_KOKIRI_FOREST_0_7 -ENTR_KOKIRI_FOREST_0_8 -ENTR_KOKIRI_FOREST_0_9 -ENTR_KOKIRI_FOREST_0_10 -ENTR_KOKIRI_FOREST_0_11 -ENTR_KOKIRI_FOREST_0_12 -ENTR_KOKIRI_FOREST_0_13 -ENTR_SACRED_FOREST_MEADOW_0 -ENTR_SACRED_FOREST_MEADOW_0_1 -ENTR_SACRED_FOREST_MEADOW_0_2 -ENTR_SACRED_FOREST_MEADOW_0_3 -ENTR_SACRED_FOREST_MEADOW_0_4 -ENTR_SACRED_FOREST_MEADOW_0_5 -ENTR_LAKE_HYLIA_0 -ENTR_LAKE_HYLIA_0_1 -ENTR_LAKE_HYLIA_0_2 -ENTR_LAKE_HYLIA_0_3 -ENTR_LAKE_HYLIA_0_4 -ENTR_LAKE_HYLIA_0_5 -ENTR_ZORAS_DOMAIN_0 -ENTR_ZORAS_DOMAIN_0_1 -ENTR_ZORAS_DOMAIN_0_2 -ENTR_ZORAS_DOMAIN_0_3 -ENTR_ZORAS_DOMAIN_0_4 -ENTR_ZORAS_DOMAIN_0_5 -ENTR_ZORAS_FOUNTAIN_0 -ENTR_ZORAS_FOUNTAIN_0_1 -ENTR_ZORAS_FOUNTAIN_0_2 -ENTR_ZORAS_FOUNTAIN_0_3 -ENTR_ZORAS_FOUNTAIN_0_4 -ENTR_ZORAS_FOUNTAIN_0_5 -ENTR_ZORAS_FOUNTAIN_0_6 -ENTR_ZORAS_FOUNTAIN_0_7 -ENTR_ZORAS_FOUNTAIN_0_8 -ENTR_GERUDO_VALLEY_0 -ENTR_GERUDO_VALLEY_0_1 -ENTR_GERUDO_VALLEY_0_2 -ENTR_GERUDO_VALLEY_0_3 -ENTR_GERUDO_VALLEY_0_4 -ENTR_GERUDO_VALLEY_0_5 -ENTR_GERUDO_VALLEY_0_6 -ENTR_LOST_WOODS_0 -ENTR_LOST_WOODS_0_1 -ENTR_LOST_WOODS_0_2 -ENTR_LOST_WOODS_0_3 -ENTR_LOST_WOODS_0_4 -ENTR_DESERT_COLOSSUS_0 -ENTR_DESERT_COLOSSUS_0_1 -ENTR_DESERT_COLOSSUS_0_2 -ENTR_DESERT_COLOSSUS_0_3 -ENTR_DESERT_COLOSSUS_0_4 -ENTR_DESERT_COLOSSUS_0_5 -ENTR_GERUDOS_FORTRESS_0 -ENTR_GERUDOS_FORTRESS_0_1 -ENTR_GERUDOS_FORTRESS_0_2 -ENTR_GERUDOS_FORTRESS_0_3 -ENTR_GERUDOS_FORTRESS_0_4 -ENTR_GERUDOS_FORTRESS_0_5 -ENTR_GERUDOS_FORTRESS_0_6 -ENTR_HAUNTED_WASTELAND_0 -ENTR_HAUNTED_WASTELAND_0_1 -ENTR_HAUNTED_WASTELAND_0_2 -ENTR_HAUNTED_WASTELAND_0_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1_3 -ENTR_HYRULE_CASTLE_0 -ENTR_HYRULE_CASTLE_0_1 -ENTR_OUTSIDE_GANONS_CASTLE_0_2 -ENTR_OUTSIDE_GANONS_CASTLE_0_3 -ENTR_OUTSIDE_GANONS_CASTLE_0_4 -ENTR_DEATH_MOUNTAIN_TRAIL_0 -ENTR_DEATH_MOUNTAIN_TRAIL_0_1 -ENTR_DEATH_MOUNTAIN_TRAIL_0_2 -ENTR_DEATH_MOUNTAIN_TRAIL_0_3 -ENTR_DEATH_MOUNTAIN_TRAIL_0_4 -ENTR_DEATH_MOUNTAIN_TRAIL_0_5 -ENTR_DEATH_MOUNTAIN_TRAIL_0_6 -ENTR_DEATH_MOUNTAIN_TRAIL_0_7 -ENTR_DEATH_MOUNTAIN_TRAIL_0_8 -ENTR_DEATH_MOUNTAIN_TRAIL_0_9 -ENTR_DEATH_MOUNTAIN_CRATER_0 -ENTR_DEATH_MOUNTAIN_CRATER_0_1 -ENTR_DEATH_MOUNTAIN_CRATER_0_2 -ENTR_DEATH_MOUNTAIN_CRATER_0_3 -ENTR_DEATH_MOUNTAIN_CRATER_0_4 -ENTR_DEATH_MOUNTAIN_CRATER_0_5 -ENTR_GORON_CITY_0 -ENTR_GORON_CITY_0_1 -ENTR_GORON_CITY_0_2 -ENTR_GORON_CITY_0_3 -ENTR_GORON_CITY_0_4 -ENTR_GORON_CITY_0_5 -ENTR_ZORAS_DOMAIN_3 -ENTR_ZORAS_DOMAIN_3_1 -ENTR_ZORAS_DOMAIN_3_2 -ENTR_ZORAS_DOMAIN_3_3 -ENTR_LON_LON_RANCH_0 -ENTR_LON_LON_RANCH_0_1 -ENTR_LON_LON_RANCH_0_2 -ENTR_LON_LON_RANCH_0_3 -ENTR_LON_LON_RANCH_0_4 -ENTR_LON_LON_RANCH_0_5 -ENTR_LON_LON_RANCH_0_6 -ENTR_LON_LON_RANCH_0_7 -ENTR_LON_LON_RANCH_0_8 -ENTR_LON_LON_RANCH_0_9 -ENTR_LON_LON_RANCH_0_10 -ENTR_LON_LON_RANCH_0_11 -ENTR_LON_LON_RANCH_0_12 -ENTR_LON_LON_RANCH_0_13 -ENTR_FIRE_TEMPLE_0 -ENTR_FIRE_TEMPLE_0_1 -ENTR_FIRE_TEMPLE_0_2 -ENTR_FIRE_TEMPLE_0_3 -ENTR_FOREST_TEMPLE_0 -ENTR_FOREST_TEMPLE_0_1 -ENTR_FOREST_TEMPLE_0_2 -ENTR_FOREST_TEMPLE_0_3 -ENTR_SHOOTING_GALLERY_1 -ENTR_SHOOTING_GALLERY_1_1 -ENTR_SHOOTING_GALLERY_1_2 -ENTR_SHOOTING_GALLERY_1_3 -ENTR_TEMPLE_OF_TIME_EXTERIOR_DAY_0 -ENTR_TEMPLE_OF_TIME_EXTERIOR_NIGHT_0_1 -ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_0_2 -ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_0_3 -ENTR_FIRE_TEMPLE_1 -ENTR_FIRE_TEMPLE_1_1 -ENTR_FIRE_TEMPLE_1_2 -ENTR_FIRE_TEMPLE_1_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0_3 -ENTR_HYRULE_FIELD_1 -ENTR_HYRULE_FIELD_1_1 -ENTR_HYRULE_FIELD_1_2 -ENTR_HYRULE_FIELD_1_3 -ENTR_HYRULE_FIELD_2 -ENTR_HYRULE_FIELD_2_1 -ENTR_HYRULE_FIELD_2_2 -ENTR_HYRULE_FIELD_2_3 -ENTR_HYRULE_FIELD_3 -ENTR_HYRULE_FIELD_3_1 -ENTR_HYRULE_FIELD_3_2 -ENTR_HYRULE_FIELD_3_3 -ENTR_HYRULE_FIELD_4 -ENTR_HYRULE_FIELD_4_1 -ENTR_HYRULE_FIELD_4_2 -ENTR_HYRULE_FIELD_4_3 -ENTR_HYRULE_FIELD_5 -ENTR_HYRULE_FIELD_5_1 -ENTR_HYRULE_FIELD_5_2 -ENTR_HYRULE_FIELD_5_3 -ENTR_KAKARIKO_VILLAGE_1 -ENTR_KAKARIKO_VILLAGE_1_1 -ENTR_KAKARIKO_VILLAGE_1_2 -ENTR_KAKARIKO_VILLAGE_1_3 -ENTR_KAKARIKO_VILLAGE_2 -ENTR_KAKARIKO_VILLAGE_2_1 -ENTR_KAKARIKO_VILLAGE_2_2 -ENTR_KAKARIKO_VILLAGE_2_3 -ENTR_ZORAS_RIVER_1 -ENTR_ZORAS_RIVER_1_1 -ENTR_ZORAS_RIVER_1_2 -ENTR_ZORAS_RIVER_1_3 -ENTR_ZORAS_RIVER_2 -ENTR_ZORAS_RIVER_2_1 -ENTR_ZORAS_RIVER_2_2 -ENTR_ZORAS_RIVER_2_3 -ENTR_ZORAS_DOMAIN_1 -ENTR_ZORAS_DOMAIN_1_1 -ENTR_ZORAS_DOMAIN_1_2 -ENTR_ZORAS_DOMAIN_1_3 -ENTR_GERUDO_VALLEY_1 -ENTR_GERUDO_VALLEY_1_1 -ENTR_GERUDO_VALLEY_1_2 -ENTR_GERUDO_VALLEY_1_3 -ENTR_LOST_WOODS_1 -ENTR_LOST_WOODS_1_1 -ENTR_LOST_WOODS_1_2 -ENTR_LOST_WOODS_1_3 -ENTR_LOST_WOODS_2 -ENTR_LOST_WOODS_2_1 -ENTR_LOST_WOODS_2_2 -ENTR_LOST_WOODS_2_3 -ENTR_LOST_WOODS_3 -ENTR_LOST_WOODS_3_1 -ENTR_LOST_WOODS_3_2 -ENTR_LOST_WOODS_3_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2_3 -ENTR_DEATH_MOUNTAIN_TRAIL_1 -ENTR_DEATH_MOUNTAIN_TRAIL_1_1 -ENTR_DEATH_MOUNTAIN_TRAIL_1_2 -ENTR_DEATH_MOUNTAIN_TRAIL_1_3 -ENTR_DEATH_MOUNTAIN_TRAIL_2 -ENTR_DEATH_MOUNTAIN_TRAIL_2_1 -ENTR_DEATH_MOUNTAIN_TRAIL_2_2 -ENTR_DEATH_MOUNTAIN_TRAIL_2_3 -ENTR_GORON_CITY_1 -ENTR_GORON_CITY_1_1 -ENTR_GORON_CITY_1_2 -ENTR_GORON_CITY_1_3 -ENTR_LAKESIDE_LABORATORY_1 -ENTR_LAKESIDE_LABORATORY_1_1 -ENTR_LAKESIDE_LABORATORY_1_2 -ENTR_LAKESIDE_LABORATORY_1_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5_3 -ENTR_MARKET_DAY_8 -ENTR_MARKET_NIGHT_8_1 -ENTR_MARKET_RUINS_8_2 -ENTR_MARKET_RUINS_8_3 -ENTR_MARKET_DAY_9 -ENTR_MARKET_NIGHT_9_1 -ENTR_MARKET_RUINS_9_2 -ENTR_MARKET_RUINS_9_3 -ENTR_MARKET_DAY_10 -ENTR_MARKET_NIGHT_10_1 -ENTR_MARKET_RUINS_10_2 -ENTR_MARKET_RUINS_10_3 -ENTR_ZORAS_RIVER_3 -ENTR_ZORAS_RIVER_3_1 -ENTR_ZORAS_RIVER_3_2 -ENTR_ZORAS_RIVER_3_3 -ENTR_ZORAS_RIVER_4 -ENTR_ZORAS_RIVER_4_1 -ENTR_ZORAS_RIVER_4_2 -ENTR_ZORAS_RIVER_4_3 -ENTR_DESERT_COLOSSUS_1 -ENTR_DESERT_COLOSSUS_1_1 -ENTR_DESERT_COLOSSUS_1_2 -ENTR_DESERT_COLOSSUS_1_3 -ENTR_DESERT_COLOSSUS_2 -ENTR_DESERT_COLOSSUS_2_1 -ENTR_DESERT_COLOSSUS_2_2 -ENTR_DESERT_COLOSSUS_2_3 -ENTR_DESERT_COLOSSUS_3 -ENTR_DESERT_COLOSSUS_3_1 -ENTR_DESERT_COLOSSUS_3_2 -ENTR_DESERT_COLOSSUS_3_3 -ENTR_DESERT_COLOSSUS_4 -ENTR_DESERT_COLOSSUS_4_1 -ENTR_DESERT_COLOSSUS_4_2 -ENTR_DESERT_COLOSSUS_4_3 -ENTR_DESERT_COLOSSUS_5 -ENTR_DESERT_COLOSSUS_5_1 -ENTR_DESERT_COLOSSUS_5_2 -ENTR_DESERT_COLOSSUS_5_3 -ENTR_DESERT_COLOSSUS_6 -ENTR_DESERT_COLOSSUS_6_1 -ENTR_DESERT_COLOSSUS_6_2 -ENTR_DESERT_COLOSSUS_6_3 -ENTR_HYRULE_FIELD_6 -ENTR_HYRULE_FIELD_6_1 -ENTR_HYRULE_FIELD_6_2 -ENTR_HYRULE_FIELD_6_3 -ENTR_HYRULE_FIELD_7 -ENTR_HYRULE_FIELD_7_1 -ENTR_HYRULE_FIELD_7_2 -ENTR_HYRULE_FIELD_7_3 -ENTR_KAKARIKO_VILLAGE_3 -ENTR_KAKARIKO_VILLAGE_3_1 -ENTR_KAKARIKO_VILLAGE_3_2 -ENTR_KAKARIKO_VILLAGE_3_3 -ENTR_GRAVEYARD_1 -ENTR_GRAVEYARD_1_1 -ENTR_GRAVEYARD_1_2 -ENTR_GRAVEYARD_1_3 -ENTR_KOKIRI_FOREST_1 -ENTR_KOKIRI_FOREST_1_1 -ENTR_KOKIRI_FOREST_1_2 -ENTR_KOKIRI_FOREST_1_3 -ENTR_KOKIRI_FOREST_2 -ENTR_KOKIRI_FOREST_2_1 -ENTR_KOKIRI_FOREST_2_2 -ENTR_KOKIRI_FOREST_2_3 -ENTR_KOKIRI_FOREST_3 -ENTR_KOKIRI_FOREST_3_1 -ENTR_KOKIRI_FOREST_3_2 -ENTR_KOKIRI_FOREST_3_3 -ENTR_SACRED_FOREST_MEADOW_1 -ENTR_SACRED_FOREST_MEADOW_1_1 -ENTR_SACRED_FOREST_MEADOW_1_2 -ENTR_SACRED_FOREST_MEADOW_1_3 -ENTR_LAKE_HYLIA_1 -ENTR_LAKE_HYLIA_1_1 -ENTR_LAKE_HYLIA_1_2 -ENTR_LAKE_HYLIA_1_3 -ENTR_LAKE_HYLIA_2 -ENTR_LAKE_HYLIA_2_1 -ENTR_LAKE_HYLIA_2_2 -ENTR_LAKE_HYLIA_2_3 -ENTR_ZORAS_FOUNTAIN_1 -ENTR_ZORAS_FOUNTAIN_1_1 -ENTR_ZORAS_FOUNTAIN_1_2 -ENTR_ZORAS_FOUNTAIN_1_3 -ENTR_ZORAS_FOUNTAIN_2 -ENTR_ZORAS_FOUNTAIN_2_1 -ENTR_ZORAS_FOUNTAIN_2_2 -ENTR_ZORAS_FOUNTAIN_2_3 -ENTR_GERUDO_VALLEY_2 -ENTR_GERUDO_VALLEY_2_1 -ENTR_GERUDO_VALLEY_2_2 -ENTR_GERUDO_VALLEY_2_3 -ENTR_GERUDO_VALLEY_3 -ENTR_GERUDO_VALLEY_3_1 -ENTR_GERUDO_VALLEY_3_2 -ENTR_GERUDO_VALLEY_3_3 -ENTR_GERUDOS_FORTRESS_1 -ENTR_GERUDOS_FORTRESS_1_1 -ENTR_GERUDOS_FORTRESS_1_2 -ENTR_GERUDOS_FORTRESS_1_3 -ENTR_GERUDOS_FORTRESS_2 -ENTR_GERUDOS_FORTRESS_2_1 -ENTR_GERUDOS_FORTRESS_2_2 -ENTR_GERUDOS_FORTRESS_2_3 -ENTR_GERUDOS_FORTRESS_3 -ENTR_GERUDOS_FORTRESS_3_1 -ENTR_GERUDOS_FORTRESS_3_2 -ENTR_GERUDOS_FORTRESS_3_3 -ENTR_HYRULE_CASTLE_1 -ENTR_HYRULE_CASTLE_1_1 -ENTR_OUTSIDE_GANONS_CASTLE_1_2 -ENTR_OUTSIDE_GANONS_CASTLE_1_3 -ENTR_HYRULE_CASTLE_1_4 -ENTR_DEATH_MOUNTAIN_TRAIL_3 -ENTR_DEATH_MOUNTAIN_TRAIL_3_1 -ENTR_DEATH_MOUNTAIN_TRAIL_3_2 -ENTR_DEATH_MOUNTAIN_TRAIL_3_3 -ENTR_DEATH_MOUNTAIN_CRATER_1 -ENTR_DEATH_MOUNTAIN_CRATER_1_1 -ENTR_DEATH_MOUNTAIN_CRATER_1_2 -ENTR_DEATH_MOUNTAIN_CRATER_1_3 -ENTR_DEATH_MOUNTAIN_CRATER_2 -ENTR_DEATH_MOUNTAIN_CRATER_2_1 -ENTR_DEATH_MOUNTAIN_CRATER_2_2 -ENTR_DEATH_MOUNTAIN_CRATER_2_3 -ENTR_FOREST_TEMPLE_1 -ENTR_FOREST_TEMPLE_1_1 -ENTR_FOREST_TEMPLE_1_2 -ENTR_FOREST_TEMPLE_1_3 -ENTR_DEKU_TREE_1 -ENTR_DEKU_TREE_1_1 -ENTR_DEKU_TREE_1_2 -ENTR_DEKU_TREE_1_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3_3 -ENTR_MARKET_DAY_1 -ENTR_MARKET_NIGHT_1_1 -ENTR_MARKET_RUINS_1_2 -ENTR_MARKET_RUINS_1_3 -ENTR_MARKET_DAY_2 -ENTR_MARKET_NIGHT_2_1 -ENTR_MARKET_RUINS_2_2 -ENTR_MARKET_RUINS_2_3 -ENTR_MARKET_DAY_3 -ENTR_MARKET_NIGHT_3_1 -ENTR_MARKET_RUINS_3_2 -ENTR_MARKET_RUINS_3_3 -ENTR_KOKIRI_FOREST_4 -ENTR_KOKIRI_FOREST_4_1 -ENTR_KOKIRI_FOREST_4_2 -ENTR_KOKIRI_FOREST_4_3 -ENTR_KOKIRI_FOREST_5 -ENTR_KOKIRI_FOREST_5_1 -ENTR_KOKIRI_FOREST_5_2 -ENTR_KOKIRI_FOREST_5_3 -ENTR_MARKET_ENTRANCE_DAY_2 -ENTR_MARKET_ENTRANCE_NIGHT_2_1 -ENTR_MARKET_ENTRANCE_RUINS_2_2 -ENTR_MARKET_ENTRANCE_RUINS_2_3 -ENTR_LINKS_HOUSE_1 -ENTR_LINKS_HOUSE_1_1 -ENTR_LINKS_HOUSE_1_2 -ENTR_LINKS_HOUSE_1_3 -ENTR_MARKET_ENTRANCE_DAY_1 -ENTR_MARKET_ENTRANCE_NIGHT_1_1 -ENTR_MARKET_ENTRANCE_RUINS_1_2 -ENTR_MARKET_ENTRANCE_RUINS_1_3 -ENTR_HYRULE_FIELD_8 -ENTR_HYRULE_FIELD_8_1 -ENTR_HYRULE_FIELD_8_2 -ENTR_HYRULE_FIELD_8_3 -ENTR_HYRULE_FIELD_9 -ENTR_HYRULE_FIELD_9_1 -ENTR_HYRULE_FIELD_9_2 -ENTR_HYRULE_FIELD_9_3 -ENTR_HYRULE_FIELD_10 -ENTR_HYRULE_FIELD_10_1 -ENTR_HYRULE_FIELD_10_2 -ENTR_HYRULE_FIELD_10_3 -ENTR_KOKIRI_FOREST_6 -ENTR_KOKIRI_FOREST_6_1 -ENTR_KOKIRI_FOREST_6_2 -ENTR_KOKIRI_FOREST_6_3 -ENTR_HYRULE_FIELD_11 -ENTR_HYRULE_FIELD_11_1 -ENTR_HYRULE_FIELD_11_2 -ENTR_HYRULE_FIELD_11_3 -ENTR_HYRULE_FIELD_12 -ENTR_HYRULE_FIELD_12_1 -ENTR_HYRULE_FIELD_12_2 -ENTR_HYRULE_FIELD_12_3 -ENTR_HYRULE_FIELD_13 -ENTR_HYRULE_FIELD_13_1 -ENTR_HYRULE_FIELD_13_2 -ENTR_HYRULE_FIELD_13_3 -ENTR_CASTLE_COURTYARD_GUARDS_DAY_1 -ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_1_1 -ENTR_CASTLE_COURTYARD_GUARDS_DAY_1_2 -ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_1_3 -ENTR_BACK_ALLEY_DAY_1 -ENTR_BACK_ALLEY_NIGHT_1_1 -ENTR_BACK_ALLEY_DAY_1_2 -ENTR_BACK_ALLEY_NIGHT_1_3 -ENTR_MARKET_DAY_4 -ENTR_MARKET_NIGHT_4_1 -ENTR_MARKET_RUINS_4_2 -ENTR_MARKET_RUINS_4_3 -ENTR_MARKET_DAY_5 -ENTR_MARKET_NIGHT_5_1 -ENTR_MARKET_RUINS_5_2 -ENTR_MARKET_RUINS_5_3 -ENTR_KAKARIKO_VILLAGE_4 -ENTR_KAKARIKO_VILLAGE_4_1 -ENTR_KAKARIKO_VILLAGE_4_2 -ENTR_KAKARIKO_VILLAGE_4_3 -ENTR_GERUDOS_FORTRESS_4 -ENTR_GERUDOS_FORTRESS_4_1 -ENTR_GERUDOS_FORTRESS_4_2 -ENTR_GERUDOS_FORTRESS_4_3 -ENTR_LON_LON_RANCH_1 -ENTR_LON_LON_RANCH_1_1 -ENTR_LON_LON_RANCH_1_2 -ENTR_LON_LON_RANCH_1_3 -ENTR_SHADOW_TEMPLE_1 -ENTR_SHADOW_TEMPLE_1_1 -ENTR_SHADOW_TEMPLE_1_2 -ENTR_SHADOW_TEMPLE_1_3 -ENTR_SHADOW_TEMPLE_2 -ENTR_SHADOW_TEMPLE_2_1 -ENTR_SHADOW_TEMPLE_2_2 -ENTR_SHADOW_TEMPLE_2_3 -ENTR_GERUDOS_FORTRESS_5 -ENTR_GERUDOS_FORTRESS_5_1 -ENTR_GERUDOS_FORTRESS_5_2 -ENTR_GERUDOS_FORTRESS_5_3 -ENTR_GERUDOS_FORTRESS_6 -ENTR_GERUDOS_FORTRESS_6_1 -ENTR_GERUDOS_FORTRESS_6_2 -ENTR_GERUDOS_FORTRESS_6_3 -ENTR_GERUDOS_FORTRESS_7 -ENTR_GERUDOS_FORTRESS_7_1 -ENTR_GERUDOS_FORTRESS_7_2 -ENTR_GERUDOS_FORTRESS_7_3 -ENTR_GERUDOS_FORTRESS_8 -ENTR_GERUDOS_FORTRESS_8_1 -ENTR_GERUDOS_FORTRESS_8_2 -ENTR_GERUDOS_FORTRESS_8_3 -ENTR_TEMPLE_OF_TIME_2 -ENTR_TEMPLE_OF_TIME_2_1 -ENTR_TEMPLE_OF_TIME_2_2 -ENTR_TEMPLE_OF_TIME_2_3 -ENTR_CHAMBER_OF_THE_SAGES_1 -ENTR_CHAMBER_OF_THE_SAGES_1_1 -ENTR_CHAMBER_OF_THE_SAGES_1_2 -ENTR_CHAMBER_OF_THE_SAGES_1_3 -ENTR_GERUDOS_FORTRESS_9 -ENTR_GERUDOS_FORTRESS_9_1 -ENTR_GERUDOS_FORTRESS_9_2 -ENTR_GERUDOS_FORTRESS_9_3 -ENTR_GERUDOS_FORTRESS_10 -ENTR_GERUDOS_FORTRESS_10_1 -ENTR_GERUDOS_FORTRESS_10_2 -ENTR_GERUDOS_FORTRESS_10_3 -ENTR_GERUDOS_FORTRESS_11 -ENTR_GERUDOS_FORTRESS_11_1 -ENTR_GERUDOS_FORTRESS_11_2 -ENTR_GERUDOS_FORTRESS_11_3 -ENTR_GERUDOS_FORTRESS_12 -ENTR_GERUDOS_FORTRESS_12_1 -ENTR_GERUDOS_FORTRESS_12_2 -ENTR_GERUDOS_FORTRESS_12_3 -ENTR_LON_LON_RANCH_2 -ENTR_LON_LON_RANCH_2_1 -ENTR_LON_LON_RANCH_2_2 -ENTR_LON_LON_RANCH_2_3 -ENTR_LON_LON_RANCH_3 -ENTR_LON_LON_RANCH_3_1 -ENTR_LON_LON_RANCH_3_2 -ENTR_LON_LON_RANCH_3_3 -ENTR_TEST_SHOOTING_GALLERY_0 -ENTR_TEST_SHOOTING_GALLERY_0_1 -ENTR_TEST_SHOOTING_GALLERY_0_2 -ENTR_TEST_SHOOTING_GALLERY_0_3 -ENTR_TEST_SACRED_FOREST_MEADOW_0_4 -ENTR_TEST_CUTSCENE_MAP_0_5 -ENTR_TEST_SHOOTING_GALLERY_0_6 -ENTR_TEST_SHOOTING_GALLERY_0_7 -ENTR_TEST_SHOOTING_GALLERY_0_8 -ENTR_TEST_SHOOTING_GALLERY_0_9 -ENTR_TEST_SHOOTING_GALLERY_0_10 -ENTR_SPIRIT_TEMPLE_1 -ENTR_SPIRIT_TEMPLE_1_1 -ENTR_SPIRIT_TEMPLE_1_2 -ENTR_SPIRIT_TEMPLE_1_3 -ENTR_STABLE_0 -ENTR_STABLE_0_1 -ENTR_STABLE_0_2 -ENTR_STABLE_0_3 -ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0 -ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0_1 -ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0_2 -ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0_3 -ENTR_JABU_JABU_BOSS_0 -ENTR_JABU_JABU_BOSS_0_1 -ENTR_JABU_JABU_BOSS_0_2 -ENTR_JABU_JABU_BOSS_0_3 -ENTR_FIRE_TEMPLE_BOSS_0 -ENTR_FIRE_TEMPLE_BOSS_0_1 -ENTR_FIRE_TEMPLE_BOSS_0_2 -ENTR_FIRE_TEMPLE_BOSS_0_3 -ENTR_LAKE_HYLIA_6 -ENTR_LAKE_HYLIA_6_1 -ENTR_LAKE_HYLIA_6_2 -ENTR_LAKE_HYLIA_6_3 -ENTR_GRAVEKEEPERS_HUT_0 -ENTR_GRAVEKEEPERS_HUT_0_1 -ENTR_GRAVEKEEPERS_HUT_0_2 -ENTR_GRAVEKEEPERS_HUT_0_3 -ENTR_HYRULE_FIELD_14 -ENTR_HYRULE_FIELD_14_1 -ENTR_HYRULE_FIELD_14_2 -ENTR_HYRULE_FIELD_14_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_4 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_5 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_6 -ENTR_REDEAD_GRAVE_0 -ENTR_REDEAD_GRAVE_0_1 -ENTR_REDEAD_GRAVE_0_2 -ENTR_REDEAD_GRAVE_0_3 -ENTR_TEMPLE_OF_TIME_3 -ENTR_TEMPLE_OF_TIME_3_1 -ENTR_TEMPLE_OF_TIME_3_2 -ENTR_TEMPLE_OF_TIME_3_3 -ENTR_TEMPLE_OF_TIME_4 -ENTR_TEMPLE_OF_TIME_4_1 -ENTR_TEMPLE_OF_TIME_4_2 -ENTR_TEMPLE_OF_TIME_4_3 -ENTR_ZORAS_DOMAIN_4 -ENTR_ZORAS_DOMAIN_4_1 -ENTR_ZORAS_DOMAIN_4_2 -ENTR_ZORAS_DOMAIN_4_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4_3 -ENTR_KOKIRI_FOREST_7 -ENTR_KOKIRI_FOREST_7_1 -ENTR_KOKIRI_FOREST_7_2 -ENTR_KOKIRI_FOREST_7_3 -ENTR_KOKIRI_FOREST_8 -ENTR_KOKIRI_FOREST_8_1 -ENTR_KOKIRI_FOREST_8_2 -ENTR_KOKIRI_FOREST_8_3 -ENTR_HYRULE_CASTLE_2 -ENTR_HYRULE_CASTLE_2_1 -ENTR_OUTSIDE_GANONS_CASTLE_2_2 -ENTR_OUTSIDE_GANONS_CASTLE_2_3 -ENTR_HYRULE_CASTLE_2_4 -ENTR_KAKARIKO_VILLAGE_5 -ENTR_KAKARIKO_VILLAGE_5_1 -ENTR_KAKARIKO_VILLAGE_5_2 -ENTR_KAKARIKO_VILLAGE_5_3 -ENTR_KAKARIKO_VILLAGE_6 -ENTR_KAKARIKO_VILLAGE_6_1 -ENTR_KAKARIKO_VILLAGE_6_2 -ENTR_KAKARIKO_VILLAGE_6_3 -ENTR_KAKARIKO_VILLAGE_7 -ENTR_KAKARIKO_VILLAGE_7_1 -ENTR_KAKARIKO_VILLAGE_7_2 -ENTR_KAKARIKO_VILLAGE_7_3 -ENTR_KAKARIKO_VILLAGE_8 -ENTR_KAKARIKO_VILLAGE_8_1 -ENTR_KAKARIKO_VILLAGE_8_2 -ENTR_KAKARIKO_VILLAGE_8_3 -ENTR_GRAVEYARD_2 -ENTR_GRAVEYARD_2_1 -ENTR_GRAVEYARD_2_2 -ENTR_GRAVEYARD_2_3 -ENTR_GRAVEYARD_3 -ENTR_GRAVEYARD_3_1 -ENTR_GRAVEYARD_3_2 -ENTR_GRAVEYARD_3_3 -ENTR_GRAVEYARD_4 -ENTR_GRAVEYARD_4_1 -ENTR_GRAVEYARD_4_2 -ENTR_GRAVEYARD_4_3 -ENTR_GRAVEYARD_5 -ENTR_GRAVEYARD_5_1 -ENTR_GRAVEYARD_5_2 -ENTR_GRAVEYARD_5_3 -ENTR_HAUNTED_WASTELAND_1 -ENTR_HAUNTED_WASTELAND_1_1 -ENTR_HAUNTED_WASTELAND_1_2 -ENTR_HAUNTED_WASTELAND_1_3 -ENTR_HAUNTED_WASTELAND_2 -ENTR_HAUNTED_WASTELAND_2_1 -ENTR_HAUNTED_WASTELAND_2_2 -ENTR_HAUNTED_WASTELAND_2_3 -ENTR_FAIRYS_FOUNTAIN_0 -ENTR_FAIRYS_FOUNTAIN_0_1 -ENTR_FAIRYS_FOUNTAIN_0_2 -ENTR_FAIRYS_FOUNTAIN_0_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_4 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_5 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_6 -ENTR_LON_LON_RANCH_4 -ENTR_LON_LON_RANCH_4_1 -ENTR_LON_LON_RANCH_4_2 -ENTR_LON_LON_RANCH_4_3 -ENTR_GORON_SHOP_0 -ENTR_GORON_SHOP_0_1 -ENTR_GORON_SHOP_0_2 -ENTR_GORON_SHOP_0_3 -ENTR_ZORA_SHOP_0 -ENTR_ZORA_SHOP_0_1 -ENTR_ZORA_SHOP_0_2 -ENTR_ZORA_SHOP_0_3 -ENTR_POTION_SHOP_KAKARIKO_0 -ENTR_POTION_SHOP_KAKARIKO_0_1 -ENTR_POTION_SHOP_KAKARIKO_0_2 -ENTR_POTION_SHOP_KAKARIKO_0_3 -ENTR_POTION_SHOP_MARKET_0 -ENTR_POTION_SHOP_MARKET_0_1 -ENTR_POTION_SHOP_MARKET_0_2 -ENTR_POTION_SHOP_MARKET_0_3 -ENTR_BACK_ALLEY_DAY_4 -ENTR_BACK_ALLEY_NIGHT_4_1 -ENTR_BACK_ALLEY_DAY_4_2 -ENTR_BACK_ALLEY_NIGHT_4_3 -ENTR_BOMBCHU_SHOP_0 -ENTR_BOMBCHU_SHOP_0_1 -ENTR_BOMBCHU_SHOP_0_2 -ENTR_BOMBCHU_SHOP_0_3 -ENTR_ZORAS_FOUNTAIN_5 -ENTR_ZORAS_FOUNTAIN_5_1 -ENTR_ZORAS_FOUNTAIN_5_2 -ENTR_ZORAS_FOUNTAIN_5_3 -ENTR_DOG_LADY_HOUSE_0 -ENTR_DOG_LADY_HOUSE_0_1 -ENTR_DOG_LADY_HOUSE_0_2 -ENTR_DOG_LADY_HOUSE_0_3 -ENTR_IMPAS_HOUSE_0 -ENTR_IMPAS_HOUSE_0_1 -ENTR_IMPAS_HOUSE_0_2 -ENTR_IMPAS_HOUSE_0_3 -ENTR_CARPENTERS_TENT_0 -ENTR_CARPENTERS_TENT_0_1 -ENTR_CARPENTERS_TENT_0_2 -ENTR_CARPENTERS_TENT_0_3 -ENTR_GERUDOS_FORTRESS_13 -ENTR_GERUDOS_FORTRESS_13_1 -ENTR_GERUDOS_FORTRESS_13_2 -ENTR_GERUDOS_FORTRESS_13_3 -ENTR_GERUDOS_FORTRESS_14 -ENTR_GERUDOS_FORTRESS_14_1 -ENTR_GERUDOS_FORTRESS_14_2 -ENTR_GERUDOS_FORTRESS_14_3 -ENTR_GERUDOS_FORTRESS_15 -ENTR_GERUDOS_FORTRESS_15_1 -ENTR_GERUDOS_FORTRESS_15_2 -ENTR_GERUDOS_FORTRESS_15_3 -ENTR_GERUDOS_FORTRESS_16 -ENTR_GERUDOS_FORTRESS_16_1 -ENTR_GERUDOS_FORTRESS_16_2 -ENTR_GERUDOS_FORTRESS_16_3 -ENTR_GERUDOS_FORTRESS_17 -ENTR_GERUDOS_FORTRESS_17_1 -ENTR_GERUDOS_FORTRESS_17_2 -ENTR_GERUDOS_FORTRESS_17_3 -ENTR_MARKET_DAY_6 -ENTR_MARKET_NIGHT_6_1 -ENTR_MARKET_RUINS_6_2 -ENTR_MARKET_RUINS_6_3 -ENTR_MARKET_DAY_7 -ENTR_MARKET_NIGHT_7_1 -ENTR_MARKET_RUINS_7_2 -ENTR_MARKET_RUINS_7_3 -ENTR_BACK_ALLEY_DAY_2 -ENTR_BACK_ALLEY_NIGHT_2_1 -ENTR_BACK_ALLEY_DAY_2_2 -ENTR_BACK_ALLEY_NIGHT_2_3 -ENTR_ZORAS_DOMAIN_2 -ENTR_ZORAS_DOMAIN_2_1 -ENTR_ZORAS_DOMAIN_2_2 -ENTR_ZORAS_DOMAIN_2_3 -ENTR_LAKE_HYLIA_3 -ENTR_LAKE_HYLIA_3_1 -ENTR_LAKE_HYLIA_3_2 -ENTR_LAKE_HYLIA_3_3 -ENTR_LAKE_HYLIA_4 -ENTR_LAKE_HYLIA_4_1 -ENTR_LAKE_HYLIA_4_2 -ENTR_LAKE_HYLIA_4_3 -ENTR_GERUDO_VALLEY_4 -ENTR_GERUDO_VALLEY_4_1 -ENTR_GERUDO_VALLEY_4_2 -ENTR_GERUDO_VALLEY_4_3 -ENTR_ZORAS_FOUNTAIN_3 -ENTR_ZORAS_FOUNTAIN_3_1 -ENTR_ZORAS_FOUNTAIN_3_2 -ENTR_ZORAS_FOUNTAIN_3_3 -ENTR_ZORAS_FOUNTAIN_4 -ENTR_ZORAS_FOUNTAIN_4_1 -ENTR_ZORAS_FOUNTAIN_4_2 -ENTR_ZORAS_FOUNTAIN_4_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6_3 -ENTR_POTION_SHOP_KAKARIKO_1 -ENTR_POTION_SHOP_KAKARIKO_1_1 -ENTR_POTION_SHOP_KAKARIKO_1_2 -ENTR_POTION_SHOP_KAKARIKO_1_3 -ENTR_POTION_SHOP_KAKARIKO_2 -ENTR_POTION_SHOP_KAKARIKO_2_1 -ENTR_POTION_SHOP_KAKARIKO_2_2 -ENTR_POTION_SHOP_KAKARIKO_2_3 -ENTR_SPIRIT_TEMPLE_2 -ENTR_SPIRIT_TEMPLE_2_1 -ENTR_SPIRIT_TEMPLE_2_2 -ENTR_SPIRIT_TEMPLE_2_3 -ENTR_SPIRIT_TEMPLE_3 -ENTR_SPIRIT_TEMPLE_3_1 -ENTR_SPIRIT_TEMPLE_3_2 -ENTR_SPIRIT_TEMPLE_3_3 -ENTR_SPIRIT_TEMPLE_4 -ENTR_SPIRIT_TEMPLE_4_1 -ENTR_SPIRIT_TEMPLE_4_2 -ENTR_SPIRIT_TEMPLE_4_3 -ENTR_GORON_CITY_2 -ENTR_GORON_CITY_2_1 -ENTR_GORON_CITY_2_2 -ENTR_GORON_CITY_2_3 -ENTR_CASTLE_COURTYARD_ZELDA_0 -ENTR_CASTLE_COURTYARD_ZELDA_0_1 -ENTR_CASTLE_COURTYARD_ZELDA_0_2 -ENTR_CASTLE_COURTYARD_ZELDA_0_3 -ENTR_CASTLE_COURTYARD_ZELDA_0_4 -ENTR_CASTLE_COURTYARD_ZELDA_0_5 -ENTR_CASTLE_COURTYARD_ZELDA_0_6 -ENTR_JABU_JABU_1 -ENTR_JABU_JABU_1_1 -ENTR_JABU_JABU_1_2 -ENTR_JABU_JABU_1_3 -ENTR_DODONGOS_CAVERN_BOSS_0 -ENTR_DODONGOS_CAVERN_BOSS_0_1 -ENTR_DODONGOS_CAVERN_BOSS_0_2 -ENTR_DODONGOS_CAVERN_BOSS_0_3 -ENTR_DEKU_TREE_BOSS_0 -ENTR_DEKU_TREE_BOSS_0_1 -ENTR_DEKU_TREE_BOSS_0_2 -ENTR_DEKU_TREE_BOSS_0_3 -ENTR_SHADOW_TEMPLE_BOSS_0 -ENTR_SHADOW_TEMPLE_BOSS_0_1 -ENTR_SHADOW_TEMPLE_BOSS_0_2 -ENTR_SHADOW_TEMPLE_BOSS_0_3 -ENTR_WATER_TEMPLE_BOSS_0 -ENTR_WATER_TEMPLE_BOSS_0_1 -ENTR_WATER_TEMPLE_BOSS_0_2 -ENTR_WATER_TEMPLE_BOSS_0_3 -ENTR_GANONS_TOWER_0 -ENTR_GANONS_TOWER_0_1 -ENTR_GANONS_TOWER_0_2 -ENTR_GANONS_TOWER_0_3 -ENTR_GANONDORF_BOSS_0 -ENTR_GANONDORF_BOSS_0_1 -ENTR_GANONDORF_BOSS_0_2 -ENTR_GANONDORF_BOSS_0_3 -ENTR_WATER_TEMPLE_1 -ENTR_WATER_TEMPLE_1_1 -ENTR_WATER_TEMPLE_1_2 -ENTR_WATER_TEMPLE_1_3 -ENTR_GANONS_TOWER_1 -ENTR_GANONS_TOWER_1_1 -ENTR_GANONS_TOWER_1_2 -ENTR_GANONS_TOWER_1_3 -ENTR_GANONS_TOWER_2 -ENTR_GANONS_TOWER_2_1 -ENTR_GANONS_TOWER_2_2 -ENTR_GANONS_TOWER_2_3 -ENTR_LON_LON_RANCH_5 -ENTR_LON_LON_RANCH_5_1 -ENTR_LON_LON_RANCH_5_2 -ENTR_LON_LON_RANCH_5_3 -ENTR_MIDOS_HOUSE_0 -ENTR_MIDOS_HOUSE_0_1 -ENTR_MIDOS_HOUSE_0_2 -ENTR_MIDOS_HOUSE_0_3 -ENTR_SARIAS_HOUSE_0 -ENTR_SARIAS_HOUSE_0_1 -ENTR_SARIAS_HOUSE_0_2 -ENTR_SARIAS_HOUSE_0_3 -ENTR_BACK_ALLEY_HOUSE_0 -ENTR_BACK_ALLEY_HOUSE_0_1 -ENTR_BACK_ALLEY_HOUSE_0_2 -ENTR_BACK_ALLEY_HOUSE_0_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0_3 -ENTR_KOKIRI_FOREST_9 -ENTR_KOKIRI_FOREST_9_1 -ENTR_KOKIRI_FOREST_9_2 -ENTR_KOKIRI_FOREST_9_3 -ENTR_KOKIRI_FOREST_10 -ENTR_KOKIRI_FOREST_10_1 -ENTR_KOKIRI_FOREST_10_2 -ENTR_KOKIRI_FOREST_10_3 -ENTR_KAKARIKO_VILLAGE_9 -ENTR_KAKARIKO_VILLAGE_9_1 -ENTR_KAKARIKO_VILLAGE_9_2 -ENTR_KAKARIKO_VILLAGE_9_3 -ENTR_WINDMILL_AND_DAMPES_GRAVE_0 -ENTR_WINDMILL_AND_DAMPES_GRAVE_0_1 -ENTR_WINDMILL_AND_DAMPES_GRAVE_0_2 -ENTR_WINDMILL_AND_DAMPES_GRAVE_0_3 -ENTR_WINDMILL_AND_DAMPES_GRAVE_1 -ENTR_WINDMILL_AND_DAMPES_GRAVE_1_1 -ENTR_WINDMILL_AND_DAMPES_GRAVE_1_2 -ENTR_WINDMILL_AND_DAMPES_GRAVE_1_3 -ENTR_KOKIRI_FOREST_11 -ENTR_KOKIRI_FOREST_11_1 -ENTR_KOKIRI_FOREST_11_2 -ENTR_KOKIRI_FOREST_11_3 -ENTR_DEATH_MOUNTAIN_TRAIL_4 -ENTR_DEATH_MOUNTAIN_TRAIL_4_1 -ENTR_DEATH_MOUNTAIN_TRAIL_4_2 -ENTR_DEATH_MOUNTAIN_TRAIL_4_3 -ENTR_FISHING_POND_0 -ENTR_FISHING_POND_0_1 -ENTR_FISHING_POND_0_2 -ENTR_FISHING_POND_0_3 -ENTR_KAKARIKO_VILLAGE_10 -ENTR_KAKARIKO_VILLAGE_10_1 -ENTR_KAKARIKO_VILLAGE_10_2 -ENTR_KAKARIKO_VILLAGE_10_3 -ENTR_INSIDE_GANONS_CASTLE_0 -ENTR_INSIDE_GANONS_CASTLE_0_1 -ENTR_INSIDE_GANONS_CASTLE_0_2 -ENTR_INSIDE_GANONS_CASTLE_0_3 -ENTR_INSIDE_GANONS_CASTLE_0_4 -ENTR_INSIDE_GANONS_CASTLE_0_5 -ENTR_INSIDE_GANONS_CASTLE_0_6 -ENTR_INSIDE_GANONS_CASTLE_0_7 -ENTR_INSIDE_GANONS_CASTLE_0_8 -ENTR_INSIDE_GANONS_CASTLE_0_9 -ENTR_INSIDE_GANONS_CASTLE_0_10 -ENTR_TEMPLE_OF_TIME_EXTERIOR_DAY_1 -ENTR_TEMPLE_OF_TIME_EXTERIOR_NIGHT_1_1 -ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_1_2 -ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_1_3 -ENTR_HYRULE_FIELD_15 -ENTR_HYRULE_FIELD_15_1 -ENTR_HYRULE_FIELD_15_2 -ENTR_HYRULE_FIELD_15_3 -ENTR_DEATH_MOUNTAIN_TRAIL_5 -ENTR_DEATH_MOUNTAIN_TRAIL_5_1 -ENTR_DEATH_MOUNTAIN_TRAIL_5_2 -ENTR_DEATH_MOUNTAIN_TRAIL_5_3 -ENTR_HYRULE_CASTLE_4 -ENTR_HYRULE_CASTLE_4_1 -ENTR_OUTSIDE_GANONS_CASTLE_4_2 -ENTR_OUTSIDE_GANONS_CASTLE_4_3 -ENTR_DEATH_MOUNTAIN_CRATER_3 -ENTR_DEATH_MOUNTAIN_CRATER_3_1 -ENTR_DEATH_MOUNTAIN_CRATER_3_2 -ENTR_DEATH_MOUNTAIN_CRATER_3_3 -ENTR_THIEVES_HIDEOUT_0 -ENTR_THIEVES_HIDEOUT_0_1 -ENTR_THIEVES_HIDEOUT_0_2 -ENTR_THIEVES_HIDEOUT_0_3 -ENTR_THIEVES_HIDEOUT_1 -ENTR_THIEVES_HIDEOUT_1_1 -ENTR_THIEVES_HIDEOUT_1_2 -ENTR_THIEVES_HIDEOUT_1_3 -ENTR_THIEVES_HIDEOUT_2 -ENTR_THIEVES_HIDEOUT_2_1 -ENTR_THIEVES_HIDEOUT_2_2 -ENTR_THIEVES_HIDEOUT_2_3 -ENTR_THIEVES_HIDEOUT_3 -ENTR_THIEVES_HIDEOUT_3_1 -ENTR_THIEVES_HIDEOUT_3_2 -ENTR_THIEVES_HIDEOUT_3_3 -ENTR_THIEVES_HIDEOUT_4 -ENTR_THIEVES_HIDEOUT_4_1 -ENTR_THIEVES_HIDEOUT_4_2 -ENTR_THIEVES_HIDEOUT_4_3 -ENTR_THIEVES_HIDEOUT_5 -ENTR_THIEVES_HIDEOUT_5_1 -ENTR_THIEVES_HIDEOUT_5_2 -ENTR_THIEVES_HIDEOUT_5_3 -ENTR_THIEVES_HIDEOUT_6 -ENTR_THIEVES_HIDEOUT_6_1 -ENTR_THIEVES_HIDEOUT_6_2 -ENTR_THIEVES_HIDEOUT_6_3 -ENTR_THIEVES_HIDEOUT_7 -ENTR_THIEVES_HIDEOUT_7_1 -ENTR_THIEVES_HIDEOUT_7_2 -ENTR_THIEVES_HIDEOUT_7_3 -ENTR_THIEVES_HIDEOUT_8 -ENTR_THIEVES_HIDEOUT_8_1 -ENTR_THIEVES_HIDEOUT_8_2 -ENTR_THIEVES_HIDEOUT_8_3 -ENTR_THIEVES_HIDEOUT_9 -ENTR_THIEVES_HIDEOUT_9_1 -ENTR_THIEVES_HIDEOUT_9_2 -ENTR_THIEVES_HIDEOUT_9_3 -ENTR_THIEVES_HIDEOUT_10 -ENTR_THIEVES_HIDEOUT_10_1 -ENTR_THIEVES_HIDEOUT_10_2 -ENTR_THIEVES_HIDEOUT_10_3 -ENTR_THIEVES_HIDEOUT_11 -ENTR_THIEVES_HIDEOUT_11_1 -ENTR_THIEVES_HIDEOUT_11_2 -ENTR_THIEVES_HIDEOUT_11_3 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7_1 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7_2 -ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2_3 -ENTR_LOST_WOODS_4 -ENTR_LOST_WOODS_4_1 -ENTR_LOST_WOODS_4_2 -ENTR_LOST_WOODS_4_3 -ENTR_LON_LON_RANCH_6 -ENTR_LON_LON_RANCH_6_1 -ENTR_LON_LON_RANCH_6_2 -ENTR_LON_LON_RANCH_6_3 -ENTR_LON_LON_RANCH_7 -ENTR_LON_LON_RANCH_7_1 -ENTR_LON_LON_RANCH_7_2 -ENTR_LON_LON_RANCH_7_3 -ENTR_LOST_WOODS_5 -ENTR_LOST_WOODS_5_1 -ENTR_LOST_WOODS_5_2 -ENTR_LOST_WOODS_5_3 -ENTR_LOST_WOODS_6 -ENTR_LOST_WOODS_6_1 -ENTR_LOST_WOODS_6_2 -ENTR_LOST_WOODS_6_3 -ENTR_LOST_WOODS_7 -ENTR_LOST_WOODS_7_1 -ENTR_LOST_WOODS_7_2 -ENTR_LOST_WOODS_7_3 -ENTR_LOST_WOODS_8 -ENTR_LOST_WOODS_8_1 -ENTR_LOST_WOODS_8_2 -ENTR_LOST_WOODS_8_3 -ENTR_GORON_CITY_3 -ENTR_GORON_CITY_3_1 -ENTR_GORON_CITY_3_2 -ENTR_GORON_CITY_3_3 -ENTR_LAKE_HYLIA_5 -ENTR_LAKE_HYLIA_5_1 -ENTR_LAKE_HYLIA_5_2 -ENTR_LAKE_HYLIA_5_3 -ENTR_SHADOW_TEMPLE_3 -ENTR_SHADOW_TEMPLE_3_1 -ENTR_SHADOW_TEMPLE_3_2 -ENTR_SHADOW_TEMPLE_3_3 -ENTR_KAKARIKO_VILLAGE_11 -ENTR_KAKARIKO_VILLAGE_11_1 -ENTR_KAKARIKO_VILLAGE_11_2 -ENTR_KAKARIKO_VILLAGE_11_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3_3 -ENTR_DEATH_MOUNTAIN_CRATER_4 -ENTR_DEATH_MOUNTAIN_CRATER_4_1 -ENTR_DEATH_MOUNTAIN_CRATER_4_2 -ENTR_DEATH_MOUNTAIN_CRATER_4_3 -ENTR_HYRULE_CASTLE_3 -ENTR_HYRULE_CASTLE_3_1 -ENTR_OUTSIDE_GANONS_CASTLE_3_2 -ENTR_OUTSIDE_GANONS_CASTLE_3_3 -ENTR_HYRULE_CASTLE_3_4 -ENTR_KAKARIKO_VILLAGE_12 -ENTR_KAKARIKO_VILLAGE_12_1 -ENTR_KAKARIKO_VILLAGE_12_2 -ENTR_KAKARIKO_VILLAGE_12_3 -ENTR_WINDMILL_AND_DAMPES_GRAVE_2 -ENTR_WINDMILL_AND_DAMPES_GRAVE_2_1 -ENTR_WINDMILL_AND_DAMPES_GRAVE_2_2 -ENTR_WINDMILL_AND_DAMPES_GRAVE_2_3 -ENTR_BOMBCHU_BOWLING_ALLEY_0 -ENTR_BOMBCHU_BOWLING_ALLEY_0_1 -ENTR_BOMBCHU_BOWLING_ALLEY_0_2 -ENTR_BOMBCHU_BOWLING_ALLEY_0_3 -ENTR_GRAVEYARD_6 -ENTR_GRAVEYARD_6_1 -ENTR_GRAVEYARD_6_2 -ENTR_GRAVEYARD_6_3 -ENTR_HYRULE_FIELD_16 -ENTR_HYRULE_FIELD_16_1 -ENTR_HYRULE_FIELD_16_2 -ENTR_HYRULE_FIELD_16_3 -ENTR_KAKARIKO_VILLAGE_13 -ENTR_KAKARIKO_VILLAGE_13_1 -ENTR_KAKARIKO_VILLAGE_13_2 -ENTR_KAKARIKO_VILLAGE_13_3 -ENTR_GANON_BOSS_0 -ENTR_GANON_BOSS_0_1 -ENTR_GANON_BOSS_0_2 -ENTR_GANON_BOSS_0_3 -ENTR_GANON_BOSS_0_4 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6_3 -ENTR_BESITU_0 -ENTR_BESITU_0_1 -ENTR_BESITU_0_2 -ENTR_BESITU_0_3 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7_1 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7_2 -ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7_3 -ENTR_BOMBCHU_SHOP_1 -ENTR_BOMBCHU_SHOP_1_1 -ENTR_BOMBCHU_SHOP_1_2 -ENTR_BOMBCHU_SHOP_1_3 -ENTR_BAZAAR_1 -ENTR_BAZAAR_1_1 -ENTR_BAZAAR_1_2 -ENTR_BAZAAR_1_3 -ENTR_HAPPY_MASK_SHOP_0 -ENTR_HAPPY_MASK_SHOP_0_1 -ENTR_HAPPY_MASK_SHOP_0_2 -ENTR_HAPPY_MASK_SHOP_0_3 -ENTR_INSIDE_GANONS_CASTLE_1 -ENTR_INSIDE_GANONS_CASTLE_1_1 -ENTR_INSIDE_GANONS_CASTLE_1_2 -ENTR_INSIDE_GANONS_CASTLE_1_3 -ENTR_INSIDE_GANONS_CASTLE_2 -ENTR_INSIDE_GANONS_CASTLE_2_1 -ENTR_INSIDE_GANONS_CASTLE_2_2 -ENTR_INSIDE_GANONS_CASTLE_2_3 -ENTR_INSIDE_GANONS_CASTLE_3 -ENTR_INSIDE_GANONS_CASTLE_3_1 -ENTR_INSIDE_GANONS_CASTLE_3_2 -ENTR_INSIDE_GANONS_CASTLE_3_3 -ENTR_INSIDE_GANONS_CASTLE_4 -ENTR_INSIDE_GANONS_CASTLE_4_1 -ENTR_INSIDE_GANONS_CASTLE_4_2 -ENTR_INSIDE_GANONS_CASTLE_4_3 -ENTR_INSIDE_GANONS_CASTLE_5 -ENTR_INSIDE_GANONS_CASTLE_5_1 -ENTR_INSIDE_GANONS_CASTLE_5_2 -ENTR_INSIDE_GANONS_CASTLE_5_3 -ENTR_INSIDE_GANONS_CASTLE_6 -ENTR_INSIDE_GANONS_CASTLE_6_1 -ENTR_INSIDE_GANONS_CASTLE_6_2 -ENTR_INSIDE_GANONS_CASTLE_6_3 -ENTR_INSIDE_GANONS_CASTLE_7 -ENTR_INSIDE_GANONS_CASTLE_7_1 -ENTR_INSIDE_GANONS_CASTLE_7_2 -ENTR_INSIDE_GANONS_CASTLE_7_3 -ENTR_HOUSE_OF_SKULLTULA_0 -ENTR_HOUSE_OF_SKULLTULA_0_1 -ENTR_HOUSE_OF_SKULLTULA_0_2 -ENTR_HOUSE_OF_SKULLTULA_0_3 -ENTR_KAKARIKO_VILLAGE_14 -ENTR_KAKARIKO_VILLAGE_14_1 -ENTR_KAKARIKO_VILLAGE_14_2 -ENTR_KAKARIKO_VILLAGE_14_3 -ENTR_LON_LON_RANCH_8 -ENTR_LON_LON_RANCH_8_1 -ENTR_LON_LON_RANCH_8_2 -ENTR_LON_LON_RANCH_8_3 -ENTR_LON_LON_RANCH_9 -ENTR_LON_LON_RANCH_9_1 -ENTR_LON_LON_RANCH_9_2 -ENTR_LON_LON_RANCH_9_3 -ENTR_LAKE_HYLIA_7 -ENTR_LAKE_HYLIA_7_1 -ENTR_LAKE_HYLIA_7_2 -ENTR_LAKE_HYLIA_7_3 -ENTR_DEATH_MOUNTAIN_CRATER_5 -ENTR_DEATH_MOUNTAIN_CRATER_5_1 -ENTR_DEATH_MOUNTAIN_CRATER_5_2 -ENTR_DEATH_MOUNTAIN_CRATER_5_3 -ENTR_GRAVEYARD_7 -ENTR_GRAVEYARD_7_1 -ENTR_GRAVEYARD_7_2 -ENTR_GRAVEYARD_7_3 -ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0 -ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0_1 -ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0_2 -ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0_3 -ENTR_THIEVES_HIDEOUT_12 -ENTR_THIEVES_HIDEOUT_12_1 -ENTR_THIEVES_HIDEOUT_12_2 -ENTR_THIEVES_HIDEOUT_12_3 -ENTR_ROYAL_FAMILYS_TOMB_1 -ENTR_ROYAL_FAMILYS_TOMB_1_1 -ENTR_ROYAL_FAMILYS_TOMB_1_2 -ENTR_ROYAL_FAMILYS_TOMB_1_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1_3 -ENTR_DESERT_COLOSSUS_7 -ENTR_DESERT_COLOSSUS_7_1 -ENTR_DESERT_COLOSSUS_7_2 -ENTR_DESERT_COLOSSUS_7_3 -ENTR_GRAVEYARD_8 -ENTR_GRAVEYARD_8_1 -ENTR_GRAVEYARD_8_2 -ENTR_GRAVEYARD_8_3 -ENTR_FOREST_TEMPLE_2 -ENTR_FOREST_TEMPLE_2_1 -ENTR_FOREST_TEMPLE_2_2 -ENTR_FOREST_TEMPLE_2_3 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2_1 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2_2 -ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2_3 -ENTR_TEMPLE_OF_TIME_5 -ENTR_TEMPLE_OF_TIME_5_1 -ENTR_TEMPLE_OF_TIME_5_2 -ENTR_TEMPLE_OF_TIME_5_3 -ENTR_TEMPLE_OF_TIME_6 -ENTR_TEMPLE_OF_TIME_6_1 -ENTR_TEMPLE_OF_TIME_6_2 -ENTR_TEMPLE_OF_TIME_6_3 -ENTR_HYRULE_FIELD_17 -ENTR_HYRULE_FIELD_17_1 -ENTR_HYRULE_FIELD_17_2 -ENTR_HYRULE_FIELD_17_3 -ENTR_GROTTOS_1 -ENTR_GROTTOS_1_1 -ENTR_GROTTOS_1_2 -ENTR_GROTTOS_1_3 -ENTR_GROTTOS_2 -ENTR_GROTTOS_2_1 -ENTR_GROTTOS_2_2 -ENTR_GROTTOS_2_3 -ENTR_GROTTOS_3 -ENTR_GROTTOS_3_1 -ENTR_GROTTOS_3_2 -ENTR_GROTTOS_3_3 -ENTR_GROTTOS_4 -ENTR_GROTTOS_4_1 -ENTR_GROTTOS_4_2 -ENTR_GROTTOS_4_3 -ENTR_GROTTOS_5 -ENTR_GROTTOS_5_1 -ENTR_GROTTOS_5_2 -ENTR_GROTTOS_5_3 -ENTR_GROTTOS_6 -ENTR_GROTTOS_6_1 -ENTR_GROTTOS_6_2 -ENTR_GROTTOS_6_3 -ENTR_GROTTOS_7 -ENTR_GROTTOS_7_1 -ENTR_GROTTOS_7_2 -ENTR_GROTTOS_7_3 -ENTR_GROTTOS_8 -ENTR_GROTTOS_8_1 -ENTR_GROTTOS_8_2 -ENTR_GROTTOS_8_3 -ENTR_GROTTOS_9 -ENTR_GROTTOS_9_1 -ENTR_GROTTOS_9_2 -ENTR_GROTTOS_9_3 -ENTR_GROTTOS_10 -ENTR_GROTTOS_10_1 -ENTR_GROTTOS_10_2 -ENTR_GROTTOS_10_3 -ENTR_GROTTOS_11 -ENTR_GROTTOS_11_1 -ENTR_GROTTOS_11_2 -ENTR_GROTTOS_11_3 -ENTR_GROTTOS_12 -ENTR_GROTTOS_12_1 -ENTR_GROTTOS_12_2 -ENTR_GROTTOS_12_3 -ENTR_IMPAS_HOUSE_1 -ENTR_IMPAS_HOUSE_1_1 -ENTR_IMPAS_HOUSE_1_2 -ENTR_IMPAS_HOUSE_1_3 -ENTR_BOTTOM_OF_THE_WELL_1 -ENTR_BOTTOM_OF_THE_WELL_1_1 -ENTR_BOTTOM_OF_THE_WELL_1_2 -ENTR_BOTTOM_OF_THE_WELL_1_3 -ENTR_LON_LON_BUILDINGS_1 -ENTR_LON_LON_BUILDINGS_1_1 -ENTR_LON_LON_BUILDINGS_1_2 -ENTR_LON_LON_BUILDINGS_1_3 -ENTR_LON_LON_RANCH_10 -ENTR_LON_LON_RANCH_10_1 -ENTR_LON_LON_RANCH_10_2 -ENTR_LON_LON_RANCH_10_3 -ENTR_ICE_CAVERN_1 -ENTR_ICE_CAVERN_1_1 -ENTR_ICE_CAVERN_1_2 -ENTR_ICE_CAVERN_1_3 -ENTR_KAKARIKO_VILLAGE_15 -ENTR_KAKARIKO_VILLAGE_15_1 -ENTR_KAKARIKO_VILLAGE_15_2 -ENTR_KAKARIKO_VILLAGE_15_3 -ENTR_LOST_WOODS_9 -ENTR_LOST_WOODS_9_1 -ENTR_LOST_WOODS_9_2 -ENTR_LOST_WOODS_9_3 -ENTR_LON_LON_BUILDINGS_2 -ENTR_LON_LON_BUILDINGS_2_1 -ENTR_LON_LON_BUILDINGS_2_2 -ENTR_LON_LON_BUILDINGS_2_3 -ENTR_KOKIRI_FOREST_12 -ENTR_KOKIRI_FOREST_12_1 -ENTR_KOKIRI_FOREST_12_2 -ENTR_KOKIRI_FOREST_12_3 -ENTR_SPIRIT_TEMPLE_BOSS_2 -ENTR_SPIRIT_TEMPLE_BOSS_2_1 -ENTR_SPIRIT_TEMPLE_BOSS_2_2 -ENTR_SPIRIT_TEMPLE_BOSS_2_3 -ENTR_CASTLE_COURTYARD_ZELDA_1 -ENTR_CASTLE_COURTYARD_ZELDA_1_1 -ENTR_CASTLE_COURTYARD_ZELDA_1_2 -ENTR_CASTLE_COURTYARD_ZELDA_1_3 -ENTR_TEMPLE_OF_TIME_7 -ENTR_TEMPLE_OF_TIME_7_1 -ENTR_TEMPLE_OF_TIME_7_2 -ENTR_TEMPLE_OF_TIME_7_3 -ENTR_GERUDOS_FORTRESS_18 -ENTR_GERUDOS_FORTRESS_18_1 -ENTR_GERUDOS_FORTRESS_18_2 -ENTR_GERUDOS_FORTRESS_18_3 -ENTR_GROTTOS_13 -ENTR_GROTTOS_13_1 -ENTR_GROTTOS_13_2 -ENTR_GROTTOS_13_3 -ENTR_SACRED_FOREST_MEADOW_2 -ENTR_SACRED_FOREST_MEADOW_2_1 -ENTR_SACRED_FOREST_MEADOW_2_2 -ENTR_SACRED_FOREST_MEADOW_2_3 -ENTR_LAKE_HYLIA_8 -ENTR_LAKE_HYLIA_8_1 -ENTR_LAKE_HYLIA_8_2 -ENTR_LAKE_HYLIA_8_3 -ENTR_SACRED_FOREST_MEADOW_3 -ENTR_SACRED_FOREST_MEADOW_3_1 -ENTR_SACRED_FOREST_MEADOW_3_2 -ENTR_SACRED_FOREST_MEADOW_3_3 -ENTR_LAKE_HYLIA_9 -ENTR_LAKE_HYLIA_9_1 -ENTR_LAKE_HYLIA_9_2 -ENTR_LAKE_HYLIA_9_3 -ENTR_DESERT_COLOSSUS_8 -ENTR_DESERT_COLOSSUS_8_1 -ENTR_DESERT_COLOSSUS_8_2 -ENTR_DESERT_COLOSSUS_8_3 diff --git a/tools/ZAPDConfigs/EnumData.xml b/tools/ZAPDConfigs/EnumData.xml deleted file mode 100644 index bbe0b2d07a..0000000000 --- a/tools/ZAPDConfigs/EnumData.xml +++ /dev/null @@ -1,599 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/ZAPDConfigs/ObjectList.txt b/tools/ZAPDConfigs/ObjectList.txt deleted file mode 100644 index 1ecc3441bb..0000000000 --- a/tools/ZAPDConfigs/ObjectList.txt +++ /dev/null @@ -1,402 +0,0 @@ -OBJECT_INVALID -OBJECT_GAMEPLAY_KEEP -OBJECT_GAMEPLAY_FIELD_KEEP -OBJECT_GAMEPLAY_DANGEON_KEEP -OBJECT_UNSET_4 -OBJECT_UNSET_5 -OBJECT_HUMAN -OBJECT_OKUTA -OBJECT_CROW -OBJECT_POH -OBJECT_DY_OBJ -OBJECT_WALLMASTER -OBJECT_DODONGO -OBJECT_FIREFLY -OBJECT_BOX -OBJECT_FIRE -OBJECT_UNSET_10 -OBJECT_UNSET_11 -OBJECT_BUBBLE -OBJECT_NIW -OBJECT_LINK_BOY -OBJECT_LINK_CHILD -OBJECT_TITE -OBJECT_REEBA -OBJECT_PEEHAT -OBJECT_KINGDODONGO -OBJECT_HORSE -OBJECT_ZF -OBJECT_GOMA -OBJECT_ZL1 -OBJECT_GOL -OBJECT_DODOJR -OBJECT_TORCH2 -OBJECT_BL -OBJECT_TP -OBJECT_OA1 -OBJECT_ST -OBJECT_BW -OBJECT_EI -OBJECT_HORSE_NORMAL -OBJECT_OB1 -OBJECT_O_ANIME -OBJECT_SPOT04_OBJECTS -OBJECT_DDAN_OBJECTS -OBJECT_HIDAN_OBJECTS -OBJECT_HORSE_GANON -OBJECT_OA2 -OBJECT_SPOT00_OBJECTS -OBJECT_MB -OBJECT_BOMBF -OBJECT_SK2 -OBJECT_OE1 -OBJECT_OE_ANIME -OBJECT_OE2 -OBJECT_YDAN_OBJECTS -OBJECT_GND -OBJECT_AM -OBJECT_DEKUBABA -OBJECT_UNSET_3A -OBJECT_OA3 -OBJECT_OA4 -OBJECT_OA5 -OBJECT_OA6 -OBJECT_OA7 -OBJECT_JJ -OBJECT_OA8 -OBJECT_OA9 -OBJECT_OB2 -OBJECT_OB3 -OBJECT_OB4 -OBJECT_HORSE_ZELDA -OBJECT_OPENING_DEMO1 -OBJECT_WARP1 -OBJECT_B_HEART -OBJECT_DEKUNUTS -OBJECT_OE3 -OBJECT_OE4 -OBJECT_MENKURI_OBJECTS -OBJECT_OE5 -OBJECT_OE6 -OBJECT_OE7 -OBJECT_OE8 -OBJECT_OE9 -OBJECT_OE10 -OBJECT_OE11 -OBJECT_OE12 -OBJECT_VALI -OBJECT_OA10 -OBJECT_OA11 -OBJECT_MIZU_OBJECTS -OBJECT_FHG -OBJECT_OSSAN -OBJECT_MORI_HINERI1 -OBJECT_BB -OBJECT_TOKI_OBJECTS -OBJECT_YUKABYUN -OBJECT_ZL2 -OBJECT_MJIN -OBJECT_MJIN_FLASH -OBJECT_MJIN_DARK -OBJECT_MJIN_FLAME -OBJECT_MJIN_ICE -OBJECT_MJIN_SOUL -OBJECT_MJIN_WIND -OBJECT_MJIN_OKA -OBJECT_HAKA_OBJECTS -OBJECT_SPOT06_OBJECTS -OBJECT_ICE_OBJECTS -OBJECT_RELAY_OBJECTS -OBJECT_PO_FIELD -OBJECT_PO_COMPOSER -OBJECT_MORI_HINERI1A -OBJECT_MORI_HINERI2 -OBJECT_MORI_HINERI2A -OBJECT_MORI_OBJECTS -OBJECT_MORI_TEX -OBJECT_SPOT08_OBJ -OBJECT_WARP2 -OBJECT_HATA -OBJECT_BIRD -OBJECT_UNSET_78 -OBJECT_UNSET_79 -OBJECT_UNSET_7A -OBJECT_UNSET_7B -OBJECT_WOOD02 -OBJECT_UNSET_7D -OBJECT_UNSET_7E -OBJECT_UNSET_7F -OBJECT_UNSET_80 -OBJECT_LIGHTBOX -OBJECT_PU_BOX -OBJECT_UNSET_83 -OBJECT_UNSET_84 -OBJECT_TRAP -OBJECT_VASE -OBJECT_IM -OBJECT_TA -OBJECT_TK -OBJECT_XC -OBJECT_VM -OBJECT_BV -OBJECT_HAKACH_OBJECTS -OBJECT_EFC_CRYSTAL_LIGHT -OBJECT_EFC_FIRE_BALL -OBJECT_EFC_FLASH -OBJECT_EFC_LGT_SHOWER -OBJECT_EFC_STAR_FIELD -OBJECT_GOD_LGT -OBJECT_LIGHT_RING -OBJECT_TRIFORCE_SPOT -OBJECT_BDAN_OBJECTS -OBJECT_SD -OBJECT_RD -OBJECT_PO_SISTERS -OBJECT_HEAVY_OBJECT -OBJECT_GNDD -OBJECT_FD -OBJECT_DU -OBJECT_FW -OBJECT_MEDAL -OBJECT_HORSE_LINK_CHILD -OBJECT_SPOT02_OBJECTS -OBJECT_HAKA -OBJECT_RU1 -OBJECT_SYOKUDAI -OBJECT_FD2 -OBJECT_DH -OBJECT_RL -OBJECT_EFC_TW -OBJECT_DEMO_TRE_LGT -OBJECT_GI_KEY -OBJECT_MIR_RAY -OBJECT_BROB -OBJECT_GI_JEWEL -OBJECT_SPOT09_OBJ -OBJECT_SPOT18_OBJ -OBJECT_BDOOR -OBJECT_SPOT17_OBJ -OBJECT_SHOP_DUNGEN -OBJECT_NB -OBJECT_MO -OBJECT_SB -OBJECT_GI_MELODY -OBJECT_GI_HEART -OBJECT_GI_COMPASS -OBJECT_GI_BOSSKEY -OBJECT_GI_MEDAL -OBJECT_GI_NUTS -OBJECT_SA -OBJECT_GI_HEARTS -OBJECT_GI_ARROWCASE -OBJECT_GI_BOMBPOUCH -OBJECT_IN -OBJECT_TR -OBJECT_SPOT16_OBJ -OBJECT_OE1S -OBJECT_OE4S -OBJECT_OS_ANIME -OBJECT_GI_BOTTLE -OBJECT_GI_STICK -OBJECT_GI_MAP -OBJECT_OF1D_MAP -OBJECT_RU2 -OBJECT_GI_SHIELD_1 -OBJECT_DEKUJR -OBJECT_GI_MAGICPOT -OBJECT_GI_BOMB_1 -OBJECT_OF1S -OBJECT_MA2 -OBJECT_GI_PURSE -OBJECT_HNI -OBJECT_TW -OBJECT_RR -OBJECT_BXA -OBJECT_ANUBICE -OBJECT_GI_GERUDO -OBJECT_GI_ARROW -OBJECT_GI_BOMB_2 -OBJECT_GI_EGG -OBJECT_GI_SCALE -OBJECT_GI_SHIELD_2 -OBJECT_GI_HOOKSHOT -OBJECT_GI_OCARINA -OBJECT_GI_MILK -OBJECT_MA1 -OBJECT_GANON -OBJECT_SST -OBJECT_NY_UNUSED -OBJECT_UNSET_E4 -OBJECT_NY -OBJECT_FR -OBJECT_GI_PACHINKO -OBJECT_GI_BOOMERANG -OBJECT_GI_BOW -OBJECT_GI_GLASSES -OBJECT_GI_LIQUID -OBJECT_ANI -OBJECT_DEMO_6K -OBJECT_GI_SHIELD_3 -OBJECT_GI_LETTER -OBJECT_SPOT15_OBJ -OBJECT_JYA_OBJ -OBJECT_GI_CLOTHES -OBJECT_GI_BEAN -OBJECT_GI_FISH -OBJECT_GI_SAW -OBJECT_GI_HAMMER -OBJECT_GI_GRASS -OBJECT_GI_LONGSWORD -OBJECT_SPOT01_OBJECTS -OBJECT_MD_UNUSED -OBJECT_MD -OBJECT_KM1 -OBJECT_KW1 -OBJECT_ZO -OBJECT_KZ -OBJECT_UMAJUMP -OBJECT_MASTERKOKIRI -OBJECT_MASTERKOKIRIHEAD -OBJECT_MASTERGOLON -OBJECT_MASTERZOORA -OBJECT_AOB -OBJECT_IK -OBJECT_AHG -OBJECT_CNE -OBJECT_GI_NIWATORI -OBJECT_SKJ -OBJECT_GI_BOTTLE_LETTER -OBJECT_BJI -OBJECT_BBA -OBJECT_GI_OCARINA_0 -OBJECT_DS -OBJECT_ANE -OBJECT_BOJ -OBJECT_SPOT03_OBJECT -OBJECT_SPOT07_OBJECT -OBJECT_FZ -OBJECT_BOB -OBJECT_GE1 -OBJECT_YABUSAME_POINT -OBJECT_GI_BOOTS_2 -OBJECT_GI_SEED -OBJECT_GND_MAGIC -OBJECT_D_ELEVATOR -OBJECT_D_HSBLOCK -OBJECT_D_LIFT -OBJECT_MAMENOKI -OBJECT_GOROIWA -OBJECT_UNSET_120 -OBJECT_TORYO -OBJECT_DAIKU -OBJECT_UNSET_123 -OBJECT_NWC -OBJECT_BLKOBJ -OBJECT_GM -OBJECT_MS -OBJECT_HS -OBJECT_INGATE -OBJECT_LIGHTSWITCH -OBJECT_KUSA -OBJECT_TSUBO -OBJECT_GI_GLOVES -OBJECT_GI_COIN -OBJECT_KANBAN -OBJECT_GJYO_OBJECTS -OBJECT_OWL -OBJECT_MK -OBJECT_FU -OBJECT_GI_KI_TAN_MASK -OBJECT_GI_REDEAD_MASK -OBJECT_GI_SKJ_MASK -OBJECT_GI_RABIT_MASK -OBJECT_GI_TRUTH_MASK -OBJECT_GANON_OBJECTS -OBJECT_SIOFUKI -OBJECT_STREAM -OBJECT_MM -OBJECT_FA -OBJECT_OS -OBJECT_GI_EYE_LOTION -OBJECT_GI_POWDER -OBJECT_GI_MUSHROOM -OBJECT_GI_TICKETSTONE -OBJECT_GI_BROKENSWORD -OBJECT_JS -OBJECT_CS -OBJECT_GI_PRESCRIPTION -OBJECT_GI_BRACELET -OBJECT_GI_SOLDOUT -OBJECT_GI_FROG -OBJECT_MAG -OBJECT_DOOR_GERUDO -OBJECT_GT -OBJECT_EFC_ERUPC -OBJECT_ZL2_ANIME1 -OBJECT_ZL2_ANIME2 -OBJECT_GI_GOLONMASK -OBJECT_GI_ZORAMASK -OBJECT_GI_GERUDOMASK -OBJECT_GANON2 -OBJECT_KA -OBJECT_TS -OBJECT_ZG -OBJECT_GI_HOVERBOOTS -OBJECT_GI_M_ARROW -OBJECT_DS2 -OBJECT_EC -OBJECT_FISH -OBJECT_GI_SUTARU -OBJECT_GI_GODDESS -OBJECT_SSH -OBJECT_BIGOKUTA -OBJECT_BG -OBJECT_SPOT05_OBJECTS -OBJECT_SPOT12_OBJ -OBJECT_BOMBIWA -OBJECT_HINTNUTS -OBJECT_RS -OBJECT_SPOT00_BREAK -OBJECT_GLA -OBJECT_SHOPNUTS -OBJECT_GELDB -OBJECT_GR -OBJECT_DOG -OBJECT_JYA_IRON -OBJECT_JYA_DOOR -OBJECT_UNSET_16E -OBJECT_SPOT11_OBJ -OBJECT_KIBAKO2 -OBJECT_DNS -OBJECT_DNK -OBJECT_GI_FIRE -OBJECT_GI_INSECT -OBJECT_GI_BUTTERFLY -OBJECT_GI_GHOST -OBJECT_GI_SOUL -OBJECT_BOWL -OBJECT_DEMO_KEKKAI -OBJECT_EFC_DOUGHNUT -OBJECT_GI_DEKUPOUCH -OBJECT_GANON_ANIME1 -OBJECT_GANON_ANIME2 -OBJECT_GANON_ANIME3 -OBJECT_GI_RUPY -OBJECT_SPOT01_MATOYA -OBJECT_SPOT01_MATOYAB -OBJECT_MU -OBJECT_WF -OBJECT_SKB -OBJECT_GJ -OBJECT_GEFF -OBJECT_HAKA_DOOR -OBJECT_GS -OBJECT_PS -OBJECT_BWALL -OBJECT_COW -OBJECT_COB -OBJECT_GI_SWORD_1 -OBJECT_DOOR_KILLER -OBJECT_OUKE_HAKA -OBJECT_TIMEBLOCK -OBJECT_ZL4 \ No newline at end of file diff --git a/tools/ZAPDConfigs/SpecialEntranceList.txt b/tools/ZAPDConfigs/SpecialEntranceList.txt deleted file mode 100644 index fdd12773de..0000000000 --- a/tools/ZAPDConfigs/SpecialEntranceList.txt +++ /dev/null @@ -1,7 +0,0 @@ -ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_SPELLS -ENTR_RETURN_SHOOTING_GALLERY -ENTR_RETURN_2 -ENTR_RETURN_BAZAAR -ENTR_RETURN_4 -ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_MAGIC -ENTR_RETURN_GROTTO diff --git a/tools/ZAPDConfigs/gc-eu-mq-dbg/Config.xml b/tools/ZAPDConfigs/gc-eu-mq-dbg/Config.xml deleted file mode 100644 index 0b6ea61ff5..0000000000 --- a/tools/ZAPDConfigs/gc-eu-mq-dbg/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-eu-mq-dbg/SymbolMap.txt b/tools/ZAPDConfigs/gc-eu-mq-dbg/SymbolMap.txt deleted file mode 100644 index 54d92b15e1..0000000000 --- a/tools/ZAPDConfigs/gc-eu-mq-dbg/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -8012DB20 gIdentityMtx -80A8E610 sShadowTex diff --git a/tools/ZAPDConfigs/gc-eu-mq/Config.xml b/tools/ZAPDConfigs/gc-eu-mq/Config.xml deleted file mode 100644 index 0b6ea61ff5..0000000000 --- a/tools/ZAPDConfigs/gc-eu-mq/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-eu-mq/SymbolMap.txt b/tools/ZAPDConfigs/gc-eu-mq/SymbolMap.txt deleted file mode 100644 index 7e1132fc21..0000000000 --- a/tools/ZAPDConfigs/gc-eu-mq/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FBC00 gIdentityMtx -80A72FA0 sShadowTex diff --git a/tools/ZAPDConfigs/gc-eu/Config.xml b/tools/ZAPDConfigs/gc-eu/Config.xml deleted file mode 100644 index 0b6ea61ff5..0000000000 --- a/tools/ZAPDConfigs/gc-eu/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-eu/SymbolMap.txt b/tools/ZAPDConfigs/gc-eu/SymbolMap.txt deleted file mode 100644 index 99b8cf8c05..0000000000 --- a/tools/ZAPDConfigs/gc-eu/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FBC20 gIdentityMtx -80A73020 sShadowTex diff --git a/tools/ZAPDConfigs/gc-jp-ce/Config.xml b/tools/ZAPDConfigs/gc-jp-ce/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/gc-jp-ce/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-jp-ce/SymbolMap.txt b/tools/ZAPDConfigs/gc-jp-ce/SymbolMap.txt deleted file mode 100644 index 038e0ca7b4..0000000000 --- a/tools/ZAPDConfigs/gc-jp-ce/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FE2A0 gIdentityMtx -80A74120 sShadowTex diff --git a/tools/ZAPDConfigs/gc-jp-mq/Config.xml b/tools/ZAPDConfigs/gc-jp-mq/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/gc-jp-mq/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-jp-mq/SymbolMap.txt b/tools/ZAPDConfigs/gc-jp-mq/SymbolMap.txt deleted file mode 100644 index 5f5a09bdce..0000000000 --- a/tools/ZAPDConfigs/gc-jp-mq/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FE2A0 gIdentityMtx -80A740D0 sShadowTex diff --git a/tools/ZAPDConfigs/gc-jp/Config.xml b/tools/ZAPDConfigs/gc-jp/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/gc-jp/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-jp/SymbolMap.txt b/tools/ZAPDConfigs/gc-jp/SymbolMap.txt deleted file mode 100644 index 86349adc0f..0000000000 --- a/tools/ZAPDConfigs/gc-jp/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FE2C0 gIdentityMtx -80A74150 sShadowTex diff --git a/tools/ZAPDConfigs/gc-us-mq/Config.xml b/tools/ZAPDConfigs/gc-us-mq/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/gc-us-mq/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-us-mq/SymbolMap.txt b/tools/ZAPDConfigs/gc-us-mq/SymbolMap.txt deleted file mode 100644 index 252ade1105..0000000000 --- a/tools/ZAPDConfigs/gc-us-mq/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FE280 gIdentityMtx -80A740B0 sShadowTex diff --git a/tools/ZAPDConfigs/gc-us/Config.xml b/tools/ZAPDConfigs/gc-us/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/gc-us/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/gc-us/SymbolMap.txt b/tools/ZAPDConfigs/gc-us/SymbolMap.txt deleted file mode 100644 index 79433d6691..0000000000 --- a/tools/ZAPDConfigs/gc-us/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FE2A0 gIdentityMtx -80A74130 sShadowTex diff --git a/tools/ZAPDConfigs/ique-cn/Config.xml b/tools/ZAPDConfigs/ique-cn/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/ique-cn/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/ique-cn/SymbolMap.txt b/tools/ZAPDConfigs/ique-cn/SymbolMap.txt deleted file mode 100644 index 37a1f9a672..0000000000 --- a/tools/ZAPDConfigs/ique-cn/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -80106980 gIdentityMtx -80AE0B10 sShadowTex diff --git a/tools/ZAPDConfigs/ntsc-1.0/Config.xml b/tools/ZAPDConfigs/ntsc-1.0/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/ntsc-1.0/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/ntsc-1.0/SymbolMap.txt b/tools/ZAPDConfigs/ntsc-1.0/SymbolMap.txt deleted file mode 100644 index 0d0ae8d436..0000000000 --- a/tools/ZAPDConfigs/ntsc-1.0/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FEDB0 gIdentityMtx -80AE0AE0 sShadowTex diff --git a/tools/ZAPDConfigs/ntsc-1.1/Config.xml b/tools/ZAPDConfigs/ntsc-1.1/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/ntsc-1.1/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/ntsc-1.1/SymbolMap.txt b/tools/ZAPDConfigs/ntsc-1.1/SymbolMap.txt deleted file mode 100644 index d494cd2bfe..0000000000 --- a/tools/ZAPDConfigs/ntsc-1.1/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FEF70 gIdentityMtx -80AE0C80 sShadowTex diff --git a/tools/ZAPDConfigs/ntsc-1.2/Config.xml b/tools/ZAPDConfigs/ntsc-1.2/Config.xml deleted file mode 100644 index b2f4e3e4d3..0000000000 --- a/tools/ZAPDConfigs/ntsc-1.2/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/ntsc-1.2/SymbolMap.txt b/tools/ZAPDConfigs/ntsc-1.2/SymbolMap.txt deleted file mode 100644 index 5f7af0dc80..0000000000 --- a/tools/ZAPDConfigs/ntsc-1.2/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FF3F0 gIdentityMtx -80AE0FE0 sShadowTex diff --git a/tools/ZAPDConfigs/pal-1.0/Config.xml b/tools/ZAPDConfigs/pal-1.0/Config.xml deleted file mode 100644 index 0b6ea61ff5..0000000000 --- a/tools/ZAPDConfigs/pal-1.0/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/pal-1.0/SymbolMap.txt b/tools/ZAPDConfigs/pal-1.0/SymbolMap.txt deleted file mode 100644 index 5ebd4ad9ab..0000000000 --- a/tools/ZAPDConfigs/pal-1.0/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FCD00 gIdentityMtx -80AE19F0 sShadowTex diff --git a/tools/ZAPDConfigs/pal-1.1/Config.xml b/tools/ZAPDConfigs/pal-1.1/Config.xml deleted file mode 100644 index 0b6ea61ff5..0000000000 --- a/tools/ZAPDConfigs/pal-1.1/Config.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tools/ZAPDConfigs/pal-1.1/SymbolMap.txt b/tools/ZAPDConfigs/pal-1.1/SymbolMap.txt deleted file mode 100644 index d41f225318..0000000000 --- a/tools/ZAPDConfigs/pal-1.1/SymbolMap.txt +++ /dev/null @@ -1,2 +0,0 @@ -800FCD40 gIdentityMtx -80AE1B80 sShadowTex diff --git a/tools/assets/Makefile b/tools/assets/Makefile index d445d38794..324e19d571 100644 --- a/tools/assets/Makefile +++ b/tools/assets/Makefile @@ -1,8 +1,11 @@ all: +# must build n64texconv before build_from_png $(MAKE) -C n64texconv + $(MAKE) -C build_from_png clean: $(MAKE) -C n64texconv clean + $(MAKE) -C build_from_png clean distclean: clean $(MAKE) -C n64texconv distclean diff --git a/tools/assets/build_from_png/.gitignore b/tools/assets/build_from_png/.gitignore new file mode 100644 index 0000000000..e0d6a78806 --- /dev/null +++ b/tools/assets/build_from_png/.gitignore @@ -0,0 +1 @@ +build_from_png diff --git a/tools/assets/build_from_png/Makefile b/tools/assets/build_from_png/Makefile new file mode 100644 index 0000000000..4a74a0d6e8 --- /dev/null +++ b/tools/assets/build_from_png/Makefile @@ -0,0 +1,17 @@ +CFLAGS := -Wall -Werror -O3 + +ifeq ($(shell $(CC) --version | grep clang),) + OMPFLAGS := -fopenmp +else + OMPFLAGS := +endif + +default: build_from_png + +clean: + $(RM) build_from_png + +.PHONY: default clean + +build_from_png: build_from_png.c ../n64texconv/libn64texconv.a + $(CC) $(CFLAGS) -o $@ $^ $(OMPFLAGS) -lz -lm diff --git a/tools/assets/build_from_png/build_from_png.c b/tools/assets/build_from_png/build_from_png.c new file mode 100644 index 0000000000..0af45ce06d --- /dev/null +++ b/tools/assets/build_from_png/build_from_png.c @@ -0,0 +1,707 @@ +// SPDX-FileCopyrightText: © 2024 ZeldaRET +// SPDX-License-Identifier: MIT + +// Note: this is statically linked with GPL binaries, making the binary GPL-licensed + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../n64texconv/src/libn64texconv/bin2c.h" +#include "../n64texconv/src/libn64texconv/n64texconv.h" + +#define NUM_FORMATS 9 +static const struct fmt_info { + const char* name; + int fmt; + int siz; +} fmt_map[NUM_FORMATS] = { + // clang-format off + { "i4", G_IM_FMT_I, G_IM_SIZ_4b, }, + { "i8", G_IM_FMT_I, G_IM_SIZ_8b, }, + { "ci4", G_IM_FMT_CI, G_IM_SIZ_4b, }, + { "ci8", G_IM_FMT_CI, G_IM_SIZ_8b, }, + { "ia4", G_IM_FMT_IA, G_IM_SIZ_4b, }, + { "ia8", G_IM_FMT_IA, G_IM_SIZ_8b, }, + { "ia16", G_IM_FMT_IA, G_IM_SIZ_16b, }, + { "rgba16", G_IM_FMT_RGBA, G_IM_SIZ_16b, }, + { "rgba32", G_IM_FMT_RGBA, G_IM_SIZ_32b, }, + // clang-format on +}; + +enum sub_format { + SUBFMT_SPLIT_LO, + SUBFMT_SPLIT_HI, + SUBFMT_MAX, + SUBFMT_NONE +}; +static const char* subfmt_map[SUBFMT_MAX] = { + [SUBFMT_SPLIT_LO] = "split_lo", + [SUBFMT_SPLIT_HI] = "split_hi", +}; + +#define strequ(s1, s2) (strcmp(s1, s2) == 0) +#define strstartswith(s, prefix) (strncmp(s, prefix, strlen(prefix)) == 0) +static bool strendswith(const char* s, const char* suffix) { + size_t len_s = strlen(s); + size_t len_suffix = strlen(suffix); + return (len_s >= len_suffix) && (strncmp(s + len_s - len_suffix, suffix, len_suffix) == 0); +} + +static bool parse_png_p(char* png_p_buf, const struct fmt_info** fmtp, enum sub_format* subfmt, int* elem_sizep, + size_t* len_png_p_prefix, char** tlut_namep, int* tlut_elem_sizep, bool print_err) { + // The last 5 (or less) suffixes, without the '.' + const int max_n_suffixes = 5; + char* png_p_suffixes[max_n_suffixes]; + int n_suffixes_found = 0; + size_t i = strlen(png_p_buf); + while (i != 0) { + i--; + if (png_p_buf[i] == '.') { + png_p_suffixes[n_suffixes_found] = &png_p_buf[i + 1]; + n_suffixes_found++; + if (n_suffixes_found >= max_n_suffixes) { + break; + } + png_p_buf[i] = '\0'; + } + } + + if (n_suffixes_found == 0 || !strequ(png_p_suffixes[0], "png")) { + if (print_err) { + fprintf(stderr, "png path doesn't end with .png\n"); + } + return false; + } + int i_suffix = 1; + int i_suffix_elemtype = -1; + int i_suffix_tlut = -1; + int i_suffix_fmt = -1; + if (i_suffix < n_suffixes_found && + (strequ(png_p_suffixes[i_suffix], "u32") || strequ(png_p_suffixes[i_suffix], "u64"))) { + i_suffix_elemtype = i_suffix; + i_suffix++; + } + if (i_suffix < n_suffixes_found && strstartswith(png_p_suffixes[i_suffix], "tlut_")) { + i_suffix_tlut = i_suffix; + i_suffix++; + } + + *subfmt = SUBFMT_NONE; + if (i_suffix < n_suffixes_found) { + for (size_t i = 0; i < SUBFMT_MAX; i++) { + if (strequ(subfmt_map[i], png_p_suffixes[i_suffix])) { + i_suffix++; + *subfmt = i; + break; + } + } + } + + if (i_suffix >= n_suffixes_found) { + if (print_err) { + fprintf(stderr, "png path is missing a .format suffix\n"); + } + return false; + } + i_suffix_fmt = i_suffix; + + if (len_png_p_prefix != NULL) { + // The length of the png path up to the format suffix + *len_png_p_prefix = (png_p_suffixes[i_suffix] - strlen(".")) - png_p_buf; + } + + if (i_suffix_elemtype < 0) { + // No elem type suffix, default to u64 + *elem_sizep = 8; + } else { + if (strequ(png_p_suffixes[i_suffix_elemtype], "u64")) { + *elem_sizep = 8; + } else if (strequ(png_p_suffixes[i_suffix_elemtype], "u32")) { + *elem_sizep = 4; + } else { + // unreachable + assert(false); + } + } + + const struct fmt_info* fmt = NULL; + + for (size_t i = 0; i < NUM_FORMATS; i++) { + if (strequ(fmt_map[i].name, png_p_suffixes[i_suffix_fmt])) { + fmt = &fmt_map[i]; + break; + } + } + + if (fmt == NULL) { + if (print_err) { + fprintf(stderr, "png path is missing a .format suffix\n"); + } + return false; + } + + if ((*subfmt == SUBFMT_SPLIT_LO || *subfmt == SUBFMT_SPLIT_HI) && + !(fmt->fmt == G_IM_FMT_CI && fmt->siz == G_IM_SIZ_8b)) { + if (print_err) { + fprintf(stderr, "Can't use split_lo/split_hi sub-formats with a format other than ci8\n"); + } + return false; + } + + if (fmt->fmt == G_IM_FMT_CI && i_suffix_tlut >= 0) { + size_t tlut_elemtype_suffix_length; + if (strendswith(png_p_suffixes[i_suffix_tlut], "_u64")) { + *tlut_elem_sizep = 8; + tlut_elemtype_suffix_length = strlen("_u64"); + } else if (strendswith(png_p_suffixes[i_suffix_tlut], "_u32")) { + *tlut_elem_sizep = 4; + tlut_elemtype_suffix_length = strlen("_u32"); + } else { + // No tlut elem type, default to u64 + *tlut_elem_sizep = 8; + tlut_elemtype_suffix_length = 0; + } + // extract "ABC" from the "tlut_ABC_uXX" suffix + if (strlen(png_p_suffixes[i_suffix_tlut]) <= (strlen("tlut_") + tlut_elemtype_suffix_length)) { + if (print_err) { + fprintf(stderr, "png path with ci format has a bad .tlut_ suffix\n"); + } + return false; + } + png_p_suffixes[i_suffix_tlut][strlen(png_p_suffixes[i_suffix_tlut]) - tlut_elemtype_suffix_length] = '\0'; + *tlut_namep = strdup(png_p_suffixes[i_suffix_tlut] + strlen("tlut_")); + } + + *fmtp = fmt; + + return true; +} + +static void free_dir_list(char** dir_list) { + for (size_t i = 0; dir_list[i] != NULL; i++) { + free(dir_list[i]); + } + free(dir_list); +} + +/** + * Returns a NULL-terminated array of filenames in `dir_p`, + * or NULL if an error happens. + */ +static char** new_dir_list(const char* dir_p) { + DIR* dir = opendir(dir_p); + if (dir == NULL) { + perror("opendir"); + return NULL; + } + + size_t len_dir_list = 0; + size_t maxlen_dir_list = 16; + char** dir_list = malloc(sizeof(char* [maxlen_dir_list])); + + while (true) { + errno = 0; + struct dirent* dirent = readdir(dir); + if (dirent == NULL) { + if (errno != 0) { + perror("readdir"); + assert(len_dir_list < maxlen_dir_list); + dir_list[len_dir_list] = NULL; + free_dir_list(dir_list); + return NULL; + } + break; + } + assert(len_dir_list < maxlen_dir_list); + dir_list[len_dir_list] = strdup(dirent->d_name); + len_dir_list++; + + if (len_dir_list >= maxlen_dir_list) { + maxlen_dir_list *= 2; + dir_list = realloc(dir_list, sizeof(char* [maxlen_dir_list])); + } + } + + assert(len_dir_list < maxlen_dir_list); + dir_list[len_dir_list] = NULL; + + if (closedir(dir) != 0) { + perror("closedir"); + free_dir_list(dir_list); + return NULL; + } + return dir_list; +} + +static char* make_inc_c_p(const char* png_p, const char* out_dir_p) { + char* png_p_buf = strdup(png_p); + char* png_stem = basename(png_p_buf); + assert(strendswith(png_stem, ".png")); // checked by parse_png_p + png_stem[strlen(png_stem) - strlen(".png")] = '\0'; // cut off .png suffix + char* inc_c_p = malloc(strlen(out_dir_p) + strlen("/") + strlen(png_stem) + strlen(".inc.c") + 1); + sprintf(inc_c_p, "%s/%s.inc.c", out_dir_p, png_stem); + free(png_p_buf); + return inc_c_p; +} + +static bool handle_non_ci(const char* png_p, const struct fmt_info* fmt, int elem_size, const char* out_dir_p) { + bool success = true; + + // read png + struct n64_image* img = n64texconv_image_from_png(png_p, fmt->fmt, fmt->siz, G_IM_FMT_RGBA); + if (img == NULL) { + fprintf(stderr, "Could not read png %s\n", png_p); + success = false; + } + + // write image + if (success) { + char* inc_c_p = make_inc_c_p(png_p, out_dir_p); + + success = n64texconv_image_to_c_file(inc_c_p, img, false, false, elem_size) == 0; + if (!success) { + fprintf(stderr, "Could not write image to %s\n", inc_c_p); + } + + free(inc_c_p); + } + + if (img != NULL) { + n64texconv_image_free(img); + } + return success; +} + +static bool handle_ci_single(const char* png_p, const struct fmt_info* fmt, enum sub_format subfmt, int elem_size, + const char* out_dir_p, size_t len_png_p_prefix) { + const int tlut_elem_size = 8; + + bool success = true; + + if (subfmt != SUBFMT_NONE) { + // TODO + fprintf(stderr, "sub-formats are not supported for ci images with a non-shared tlut\n"); + return false; + } + + // read png + struct n64_image* img = n64texconv_image_from_png(png_p, fmt->fmt, fmt->siz, G_IM_FMT_RGBA); + if (img == NULL) { + fprintf(stderr, "Could not read png %s\n", png_p); + success = false; + } + + // write image + if (success) { + char* inc_c_p = make_inc_c_p(png_p, out_dir_p); + success = n64texconv_image_to_c_file(inc_c_p, img, false, false, elem_size) == 0; + if (!success) { + fprintf(stderr, "Could not write image to %s\n", inc_c_p); + } + free(inc_c_p); + } + + // write palette + if (success) { + char* png_p_buf = strdup(png_p); + png_p_buf[len_png_p_prefix] = '\0'; // cut off the suffixes + char* png_stem = basename(png_p_buf); + char* pal_inc_c_p = + malloc(strlen(out_dir_p) + strlen("/") + strlen(png_stem) + strlen(".tlut.rgba16.inc.c") + 1); + sprintf(pal_inc_c_p, "%s/%s.tlut.rgba16.inc.c", out_dir_p, png_stem); + free(png_p_buf); + + success = n64texconv_palette_to_c_file(pal_inc_c_p, img->pal, true, tlut_elem_size) == 0; + if (!success) { + fprintf(stderr, "Could not write palette to %s\n", pal_inc_c_p); + } + free(pal_inc_c_p); + } + + if (img != NULL) { + n64texconv_palette_free(img->pal); + n64texconv_image_free(img); + } + return success; +} + +static bool handle_ci_shared_tlut(const char* png_p, const struct fmt_info* fmt, enum sub_format subfmt, + const char* out_dir_p, char** in_dirs, int num_in_dirs, char* tlut_name, + int tlut_elem_size) { + const size_t len_out_dir_p = strlen(out_dir_p); + + size_t len_pngs_with_tlut = 0; + size_t maxlen_pngs_with_tlut = 16; + struct other_png_info { + char* png_p; + char* name; // pointer into png_p; don't free + int elem_size; + struct n64_image* img; + }* pngs_with_tlut = malloc(sizeof(struct other_png_info[maxlen_pngs_with_tlut])); + + // list pngs using the TLUT `tlut_name` into `pngs_with_tlut` + for (int j = 0; j < num_in_dirs; j++) { + const char* in_dir_p = in_dirs[j]; + const size_t len_in_dir_p = strlen(in_dir_p); + + char** in_dir_list = new_dir_list(in_dir_p); + if (in_dir_list == NULL) { + fprintf(stderr, "Couldn't list files in %s\n", in_dir_p); + return false; + } + + for (size_t i = 0; in_dir_list[i] != NULL; i++) { + char* direntry_name_buf = strdup(in_dir_list[i]); + const struct fmt_info* direntry_fmt; + enum sub_format direntry_subfmt; + int direntry_elem_size; + char* direntry_tlut_name = NULL; + int direntry_tlut_elem_size = -1; + if (parse_png_p(direntry_name_buf, &direntry_fmt, &direntry_subfmt, &direntry_elem_size, NULL, + &direntry_tlut_name, &direntry_tlut_elem_size, false)) { + if (direntry_fmt->fmt == G_IM_FMT_CI && direntry_tlut_name != NULL) { + if (strequ(tlut_name, direntry_tlut_name)) { + // TODO mismatching sub-format could be supported + if (direntry_fmt != fmt || direntry_subfmt != subfmt || + direntry_tlut_elem_size != tlut_elem_size) { + fprintf( + stderr, + "Images sharing TLUT \"%s\" have mismatching format, sub-format or tlut elem size:\n" + "%s\n" + "%s/%s\n", + tlut_name, png_p, in_dir_p, in_dir_list[i]); + free(direntry_name_buf); + free_dir_list(in_dir_list); + return false; + } + + bool png_name_already_found = false; + for (size_t k = 0; k < len_pngs_with_tlut; k++) { + if (strequ(pngs_with_tlut[k].name, in_dir_list[i])) { + png_name_already_found = true; + break; + } + } + + if (!png_name_already_found) { + if (len_pngs_with_tlut == maxlen_pngs_with_tlut) { + maxlen_pngs_with_tlut *= 2; + pngs_with_tlut = + realloc(pngs_with_tlut, sizeof(struct other_png_info[maxlen_pngs_with_tlut])); + } + assert(len_pngs_with_tlut < maxlen_pngs_with_tlut); + char* other_png_p = malloc(len_in_dir_p + strlen("/") + strlen(in_dir_list[i]) + 1); + sprintf(other_png_p, "%s/%s", in_dir_p, in_dir_list[i]); + pngs_with_tlut[len_pngs_with_tlut].png_p = other_png_p; + pngs_with_tlut[len_pngs_with_tlut].name = other_png_p + len_in_dir_p + strlen("/"); + pngs_with_tlut[len_pngs_with_tlut].elem_size = direntry_elem_size; + pngs_with_tlut[len_pngs_with_tlut].img = NULL; + len_pngs_with_tlut++; + } + } + } + } + free(direntry_name_buf); + } + assert(len_pngs_with_tlut <= maxlen_pngs_with_tlut); + + free_dir_list(in_dir_list); + } + + bool success = true; + + // read "reference" png + struct n64_image* ref_img = n64texconv_image_from_png(png_p, G_IM_FMT_CI, fmt->siz, G_IM_FMT_RGBA); + if (ref_img == NULL) { + fprintf(stderr, "Could not read png %s\n", png_p); + success = false; + } + + // read all pngs that share the TLUT + if (success) { + for (size_t i = 0; i < len_pngs_with_tlut; i++) { + struct n64_image* other_img = + n64texconv_image_from_png(pngs_with_tlut[i].png_p, G_IM_FMT_CI, fmt->siz, G_IM_FMT_RGBA); + pngs_with_tlut[i].img = other_img; + if (other_img == NULL) { + fprintf(stderr, "Could not read other png %s\n", pngs_with_tlut[i].png_p); + success = false; + break; + } + } + } + + if (success) { + // check if all palettes are the same + bool all_other_pngs_match_ref_img_pal = true; + for (size_t i = 0; i < len_pngs_with_tlut; i++) { + assert(pngs_with_tlut[i].img != NULL); +#ifdef VERBOSE + fprintf(stderr, "%s %s\n", pngs_with_tlut[i].name, pngs_with_tlut[i].png_p); +#endif + if (all_other_pngs_match_ref_img_pal) { + struct n64_image* other_img = pngs_with_tlut[i].img; + bool pal_matches_ref = other_img->pal->count == ref_img->pal->count && + memcmp(other_img->pal->texels, ref_img->pal->texels, + sizeof(struct color[ref_img->pal->count])) == 0; + if (!pal_matches_ref) { + all_other_pngs_match_ref_img_pal = false; + } + } + } + + char* pal_inc_c_p = + malloc(len_out_dir_p + strlen("/") + strlen(tlut_name) + strlen(".tlut.rgba16.uXX.inc.c") + 1); + assert(tlut_elem_size == 8 || tlut_elem_size == 4); + sprintf(pal_inc_c_p, "%s/%s.tlut.rgba16%s.inc.c", out_dir_p, tlut_name, tlut_elem_size == 8 ? "" : ".u32"); + + const bool is_split_palette = subfmt == SUBFMT_SPLIT_LO || subfmt == SUBFMT_SPLIT_HI; + const unsigned int max_colors = fmt->siz == G_IM_SIZ_4b ? 16 : is_split_palette ? 128 : 256; + + if (all_other_pngs_match_ref_img_pal && ref_img->pal->count <= max_colors) { + // write matching palette, and matching color indices for all pngs +#ifdef VERBOSE + fprintf(stderr, "Matching data detected!\n"); +#endif + + if (is_split_palette && ref_img->pal->count < max_colors) { + // split palettes must be exactly 128 colors, resize to full size + struct n64_palette* old_pal = ref_img->pal; + ref_img->pal = n64texconv_palette_resize(ref_img->pal, max_colors); + n64texconv_palette_free(old_pal); + } + + // pass pad_to_8b=true to account for the case where this is in fact not matching data + // (the png was silently palettized by n64texconv) + // Note: this forces all palette sizes to be 8-aligned, even u32-element-typed ones + int ret = n64texconv_palette_to_c_file(pal_inc_c_p, ref_img->pal, true, tlut_elem_size); + success = ret == 0; + if (!success) { + fprintf(stderr, "Could not write palette to %s (%d)\n", pal_inc_c_p, ret); + } + + if (success) { + for (size_t i = 0; i < len_pngs_with_tlut; i++) { + char* inc_c_p = make_inc_c_p(pngs_with_tlut[i].png_p, out_dir_p); + + if (subfmt == SUBFMT_SPLIT_HI) { + size_t size = pngs_with_tlut[i].img->width * pngs_with_tlut[i].img->height; + uint8_t bin[size]; + for (size_t j = 0; j < size; j++) { + // ensured by the `ref_img->pal->count <= max_colors` check + assert(pngs_with_tlut[i].img->color_indices[j] < 128); + + bin[j] = 128 + pngs_with_tlut[i].img->color_indices[j]; + } + success = bin2c_file(inc_c_p, bin, size, 0, pngs_with_tlut[i].elem_size) == 0; + } else { + success = n64texconv_image_to_c_file(inc_c_p, pngs_with_tlut[i].img, false, false, + pngs_with_tlut[i].elem_size) == 0; + } + if (!success) { + fprintf(stderr, "Could not write image to %s\n", inc_c_p); + } + free(inc_c_p); + if (!success) { + break; + } + } + } + } else { + // co-palettize all pngs +#ifdef VERBOSE + fprintf(stderr, "Non-matching data detected!\n"); +#endif + const bool copaletize_write_out_pngs = true; + + const size_t num_images = len_pngs_with_tlut; + uint8_t* out_indices[num_images]; + struct color* texels[num_images]; + size_t widths[num_images]; + size_t heights[num_images]; + for (size_t i = 0; i < len_pngs_with_tlut; i++) { + assert(pngs_with_tlut[i].img != NULL); + out_indices[i] = malloc(pngs_with_tlut[i].img->width * pngs_with_tlut[i].img->height); + texels[i] = pngs_with_tlut[i].img->texels; + widths[i] = pngs_with_tlut[i].img->width; + heights[i] = pngs_with_tlut[i].img->height; + } + struct color out_pal[max_colors]; + size_t out_pal_count; + const float dither_level = 0.5f; + + success = n64texconv_quantize_shared(out_indices, out_pal, &out_pal_count, texels, widths, heights, + num_images, max_colors, dither_level) == 0; + if (!success) { + fprintf(stderr, "Could not co-palettize images\n"); + } + + if (is_split_palette) { + for (size_t i = out_pal_count; i < max_colors; i++) { + out_pal[i] = (struct color){ .w = 0 }; + } + out_pal_count = max_colors; + } + + // write palette to .inc.c + struct n64_palette pal = { out_pal, G_IM_FMT_RGBA, out_pal_count }; + if (success) { + int ret = n64texconv_palette_to_c_file(pal_inc_c_p, &pal, true, tlut_elem_size); + success = ret == 0; + if (!success) { + fprintf(stderr, "Could not write generated palette to %s (%d)\n", pal_inc_c_p, ret); + } + } + // write palette to .png + if (success) { + if (copaletize_write_out_pngs) { + char* pal_out_png_p = strdup(pal_inc_c_p); + assert(strendswith(pal_inc_c_p, ".inc.c")); + pal_out_png_p[strlen(pal_out_png_p) - strlen(".inc.c")] = '\0'; + strcat(pal_out_png_p, ".png"); + success = n64texconv_palette_to_png(pal_out_png_p, &pal) == 0; + if (!success) { + fprintf(stderr, "Could not write generated palette to png %s\n", pal_out_png_p); + } + free(pal_out_png_p); + } + } + + // write images... + if (success) { + for (size_t i = 0; i < len_pngs_with_tlut; i++) { + char* other_png_p_buf = strdup(pngs_with_tlut[i].png_p); + char* other_png_stem = basename(other_png_p_buf); + assert(strendswith(other_png_stem, ".png")); // checked by parse_png_p + other_png_stem[strlen(other_png_stem) - strlen(".png")] = '\0'; // cut off .png suffix + char* inc_c_p = malloc(len_out_dir_p + strlen("/") + strlen(other_png_stem) + strlen(".inc.c") + 1); + sprintf(inc_c_p, "%s/%s.inc.c", out_dir_p, other_png_stem); + free(other_png_p_buf); + + struct n64_image img = { + pngs_with_tlut[i].img->width, + pngs_with_tlut[i].img->height, + G_IM_FMT_CI, + fmt->siz, + &pal, + pngs_with_tlut[i].img->texels, + out_indices[i], + }; + + // ... to .inc.c + if (subfmt == SUBFMT_SPLIT_HI) { + size_t size = img.width * img.height; + uint8_t bin[size]; + for (size_t j = 0; j < size; j++) { + // ensured by `max_colors` being 128 for SUBFMT_SPLIT_* + assert(img.color_indices[j] < 128); + + bin[j] = 128 + img.color_indices[j]; + } + success = bin2c_file(inc_c_p, bin, size, 0, pngs_with_tlut[i].elem_size) == 0; + } else { + success = + n64texconv_image_to_c_file(inc_c_p, &img, false, false, pngs_with_tlut[i].elem_size) == 0; + } + if (!success) { + fprintf(stderr, "Could not write palettized image to %s\n", inc_c_p); + break; + } + + // ... to .png + if (copaletize_write_out_pngs) { + char* out_png_p = strdup(inc_c_p); + assert(strendswith(inc_c_p, ".inc.c")); + out_png_p[strlen(out_png_p) - strlen(".inc.c")] = '\0'; + strcat(out_png_p, ".png"); + success = n64texconv_image_to_png(out_png_p, &img, false) == 0; + if (!success) { + fprintf(stderr, "Could not write palettized image to png %s\n", out_png_p); + } + free(out_png_p); + if (!success) { + break; + } + } + } + } + + for (size_t i = 0; i < num_images; i++) { + free(out_indices[i]); + } + } + + free(pal_inc_c_p); + } + + if (ref_img != NULL) { + n64texconv_image_free(ref_img); + } + + for (size_t i = 0; i < len_pngs_with_tlut; i++) { + free(pngs_with_tlut[i].png_p); + if (pngs_with_tlut[i].img != NULL) { + n64texconv_palette_free(pngs_with_tlut[i].img->pal); + n64texconv_image_free(pngs_with_tlut[i].img); + } + } + free(pngs_with_tlut); + + return success; +} + +int main(int argc, char** argv) { + if (argc < 3) { + usage: + fprintf(stderr, + "Usage: build_from_png path/to/file.png path/to/out/folder/ [path/to/input/folder1/ ...]\n" + "The png file should be named like:\n" + " - texName.format[.].png (non-ci formats or ci formats with a non-shared tlut)\n" + " - texName.ci<4|8>.tlut_tlutName[_][.].png (ci formats with a shared tlut)\n"); + return EXIT_FAILURE; + } + const char* png_p = argv[1]; + const char* out_dir_p = argv[2]; + char** in_dirs = argv + 3; + const int num_in_dirs = argc - 3; + + const struct fmt_info* fmt; + enum sub_format subfmt; + int elem_size; + size_t len_png_p_prefix; + char* tlut_name = NULL; + int tlut_elem_size = -1; + + { + char* png_p_buf = strdup(png_p); + bool success = + parse_png_p(png_p_buf, &fmt, &subfmt, &elem_size, &len_png_p_prefix, &tlut_name, &tlut_elem_size, true); + free(png_p_buf); + if (!success) { + goto usage; + } + } + + bool success; + + if (fmt->fmt != G_IM_FMT_CI) { + success = handle_non_ci(png_p, fmt, elem_size, out_dir_p); + } else { + if (tlut_name == NULL) { + success = handle_ci_single(png_p, fmt, subfmt, elem_size, out_dir_p, len_png_p_prefix); + } else { + success = + handle_ci_shared_tlut(png_p, fmt, subfmt, out_dir_p, in_dirs, num_in_dirs, tlut_name, tlut_elem_size); + free(tlut_name); + } + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/tools/assets/conf.py b/tools/assets/conf.py new file mode 100644 index 0000000000..f31582a988 --- /dev/null +++ b/tools/assets/conf.py @@ -0,0 +1,2 @@ +WRITE_HINTS = True +I_D_OMEGALUL = True # IDO specific things that may be otherwise different diff --git a/tools/assets/descriptor/README.md b/tools/assets/descriptor/README.md new file mode 100644 index 0000000000..6336e0d417 --- /dev/null +++ b/tools/assets/descriptor/README.md @@ -0,0 +1 @@ +This package serves as an abstraction layer wrapping assets xml files. diff --git a/tools/assets/descriptor/__main__.py b/tools/assets/descriptor/__main__.py new file mode 100644 index 0000000000..0d3f4e6dc3 --- /dev/null +++ b/tools/assets/descriptor/__main__.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from pprint import pprint as vanilla_pprint + +try: + from rich.pretty import pprint +except ImportError: + pprint = vanilla_pprint + +from tools import version_config + +from . import base + + +def main(): + vc = version_config.load_version_config("gc-eu-mq-dbg") + + pools = base.get_resources_desc(vc) + + try: + for pool in pools: + if any(coll.out_path.name == "gameplay_keep" for coll in pool.collections): + vanilla_pprint(pool) + else: + pprint(pool) + input("Press enter for next pool") + except KeyboardInterrupt: + print() + + +main() diff --git a/tools/assets/descriptor/base.py b/tools/assets/descriptor/base.py new file mode 100644 index 0000000000..a0833ec093 --- /dev/null +++ b/tools/assets/descriptor/base.py @@ -0,0 +1,318 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import abc +import dataclasses +from functools import cache +from pathlib import Path +from typing import Callable, Optional +from xml.etree import ElementTree + +from tools import version_config + + +class BackingMemory(abc.ABC): + pass + + +@dataclasses.dataclass +class BaseromFileBackingMemory(BackingMemory): + name: str + range: Optional[tuple[int, int]] + """If set, consider file_data[range[0]:range[1]] instead of the full file""" + + +@dataclasses.dataclass +class NoBackingMemory(BackingMemory): + pass + + +# eq=False so this uses id-based equality and hashing +# Subclasses must also be made to use id-based equality and hashing +@dataclasses.dataclass(eq=False) +class ResourceDesc(abc.ABC): + """A resource is a data unit. + For example, a symbol's data such as a DList or a texture.""" + + symbol_name: str + offset: int + """How many bytes into the backing memory the resource is located at""" + collection: "ResourcesDescCollection" = dataclasses.field(repr=False) + origin: object + """opaque object with data about where this resource comes from (for debugging)""" + + hack_modes: set[str] = dataclasses.field(init=False, default_factory=set) + + +class StartAddress(abc.ABC): + pass + + +@dataclasses.dataclass +class VRAMStartAddress(StartAddress): + vram: int + + +@dataclasses.dataclass +class SegmentStartAddress(StartAddress): + segment: int + + +@dataclasses.dataclass(eq=False) +class ResourcesDescCollection: + """A collection is a list of resources backed by the same memory.""" + + out_path: Path + backing_memory: BackingMemory + start_address: Optional[StartAddress] + resources: list[ResourceDesc] + last_modified_time: float + depends: list["ResourcesDescCollection"] + + +@dataclasses.dataclass(eq=False) +class ResourcesDescCollectionsPool: + """A pool contains a minimal set of interconnected collections. + For example, gkeep and all files using gkeep, + or more simply a single collection with no connection.""" + + collections: list[ResourcesDescCollection] + + +ResourceHandlerPass2Callback = Callable[[ResourcesDescCollectionsPool], None] + + +@dataclasses.dataclass +class ResourceHandlerNeedsPass2Exception(Exception): + resource: ResourceDesc + pass2_callback: ResourceHandlerPass2Callback + + +# eq=False so this uses id-based equality and hashing +@dataclasses.dataclass(eq=False) +class AssetConfigPiece: + ac: version_config.AssetConfig + last_modified_time: float = None + etree: ElementTree.ElementTree = None + depends: list["AssetConfigPiece"] = dataclasses.field(default_factory=list) + """The AssetConfigPiece s this instance depends on""" + collections: list[ResourcesDescCollection] = dataclasses.field(default_factory=list) + + +def get_resources_desc(vc: version_config.VersionConfig): + # Wrap AssetConfig objects in AssetConfigPiece for hashability and to collect data + acps = [AssetConfigPiece(ac) for ac in vc.assets] + + # Parse xmls + for acp in acps: + acp.last_modified_time = acp.ac.xml_path.stat().st_mtime + try: + with acp.ac.xml_path.open(encoding="UTF-8") as f: + etree = ElementTree.parse(f) + acp.etree = etree + except Exception as e: + raise Exception(f"Error when parsing XML for {acp}") from e + + # Resolve pools + acp_by_name = {acp.ac.name: acp for acp in acps} + pools = {acp: {acp} for acp in acps} + for acp in acps: + try: + rootelem = acp.etree.getroot() + assert rootelem.tag == "Root", rootelem.tag + for fileelem in rootelem: + assert fileelem.tag in {"ExternalFile", "File"}, fileelem.tag + if fileelem.tag == "ExternalFile": + externalfile_name = str( + Path(fileelem.attrib["OutPath"]).relative_to("assets") + ) + assert externalfile_name in acp_by_name, externalfile_name + externalfile_acp = acp_by_name[externalfile_name] + acp.depends.append(externalfile_acp) + acp_pool = pools[acp] + externalfile_acp_pool = pools[externalfile_acp] + merged_pool = acp_pool | externalfile_acp_pool + for merged_pool_acp in merged_pool: + pools[merged_pool_acp] = merged_pool + except Exception as e: + raise Exception(f"Error while resolving pools with {acp}") from e + + # List unique pools + pools_unique: list[set[AssetConfigPiece]] = [] + while pools: + pool = next(iter(pools.values())) + pools_unique.append(pool) + for acp in pool: + del pools[acp] + + # Build resources for all pools + pools: list[ResourcesDescCollectionsPool] = [] + for pool in pools_unique: + try: + all_needs_pass2_exceptions: list[ResourceHandlerNeedsPass2Exception] = [] + rescolls: list[ResourcesDescCollection] = [] + + # Pass 1: create Resource objects + for acp in pool: + try: + rootelem = acp.etree.getroot() + for fileelem in rootelem: + if fileelem.tag == "File": + rc, needs_pass2_exceptions = ( + _get_resources_fileelem_to_resourcescollection_pass1( + vc, pool, acp, fileelem + ) + ) + acp.collections.append(rc) + rescolls.append(rc) + all_needs_pass2_exceptions.extend(needs_pass2_exceptions) + except Exception as e: + raise Exception(f"Error with {acp}") from e + + rcpool = ResourcesDescCollectionsPool(rescolls) + + # + for acp in pool: + for acp_coll in acp.collections: + acp_coll.depends.extend( + (_coll for _coll in acp.collections if _coll != acp_coll) + ) + for acp_dep in acp.depends: + acp_coll.depends.extend(acp_dep.collections) + + # Pass 2: execute callbacks + for needs_pass2_exc in all_needs_pass2_exceptions: + try: + needs_pass2_exc.pass2_callback(rcpool) + except Exception as e: + raise Exception( + f"Error with pass 2 callback for {needs_pass2_exc.resource}" + ) from e + + pools.append(rcpool) + + except Exception as e: + raise Exception(f"Error with pool {pool}") from e + + return pools + + +def _get_resources_fileelem_to_resourcescollection_pass1( + vc: version_config.VersionConfig, + pool: list[AssetConfigPiece], + acp: AssetConfigPiece, + fileelem: ElementTree.Element, +): + # Determine backing_memory + if acp.ac.start_offset is None: + assert acp.ac.end_offset is None + baserom_file_range = None + else: + assert acp.ac.end_offset is not None + baserom_file_range = (acp.ac.start_offset, acp.ac.end_offset) + backing_memory = BaseromFileBackingMemory( + name=fileelem.attrib["Name"], + range=baserom_file_range, + ) + + # Determine start_address + if any( + acp.ac.name.startswith(_prefix) for _prefix in ("code/", "n64dd/", "overlays/") + ): + # File start address is vram + assert "Segment" not in fileelem.attrib + assert acp.ac.start_offset is not None and acp.ac.end_offset is not None, ( + "Unsupported combination: " + f"start/end offset not in config for vram asset {acp.ac.name}" + ) + if acp.ac.name.startswith("overlays/"): + overlay_name = acp.ac.name.split("/")[1] + start_address = VRAMStartAddress( + vc.dmadata_segments[overlay_name].vram + acp.ac.start_offset + ) + else: + file_name = acp.ac.name.split("/")[0] # "code" or "n64dd" + start_address = VRAMStartAddress( + vc.dmadata_segments[file_name].vram + acp.ac.start_offset + ) + elif "Segment" in fileelem.attrib: + # File start address is a segmented address + assert acp.ac.start_offset is None and acp.ac.end_offset is None, ( + "Unsupported combination: " + "start/end offset in config and file starts at a segmented address" + ) + start_address = SegmentStartAddress(int(fileelem.attrib["Segment"])) + else: + # File does not have a start address + start_address = None + + # resources + resources: list[ResourceDesc] = [] + collection = ResourcesDescCollection( + Path(acp.ac.name), + backing_memory, + start_address, + resources, + acp.last_modified_time, + [], + ) + needs_pass2_exceptions: list[ResourceHandlerNeedsPass2Exception] = [] + for reselem in fileelem: + try: + symbol_name = reselem.attrib["Name"] + offset = int(reselem.attrib["Offset"], 16) + res_handler = _get_resource_handler(reselem.tag) + try: + res = res_handler(symbol_name, offset, collection, reselem) + except ResourceHandlerNeedsPass2Exception as needs_pass2_exc: + res = needs_pass2_exc.resource + needs_pass2_exceptions.append(needs_pass2_exc) + assert isinstance(res, ResourceDesc) + resources.append(res) + except Exception as e: + raise Exception( + "Error with resource element:\n" + + ElementTree.tostring(reselem, encoding="unicode") + ) from e + + return collection, needs_pass2_exceptions + + +ResourceHandler = Callable[ + [str, int, ResourcesDescCollection, ElementTree.Element], + ResourceDesc, +] + + +@cache +def _get_resource_handler(tag: str) -> ResourceHandler: + from . import n64resources + from . import z64resources + + resource_handlers = { + "DList": n64resources.handler_DList, + "Blob": n64resources.handler_Blob, + "Mtx": n64resources.handler_Mtx, + "Array": n64resources.handler_Array, + "Texture": n64resources.handler_Texture, + "Collision": z64resources.handler_Collision, + "Animation": z64resources.handler_Animation, + "PlayerAnimation": z64resources.handler_PlayerAnimation, + "LegacyAnimation": z64resources.handler_LegacyAnimation, + "Cutscene": z64resources.handler_Cutscene, + "Scene": z64resources.handler_Scene, + "Room": z64resources.handler_Room, + "PlayerAnimationData": z64resources.handler_PlayerAnimationData, + "Path": z64resources.handler_PathList, + "Skeleton": z64resources.handler_Skeleton, + "Limb": z64resources.handler_Limb, + "CurveAnimation": z64resources.handler_CurveAnimation, + "LimbTable": z64resources.handler_LimbTable, + } + + rh = resource_handlers.get(tag) + + if rh is None: + raise Exception(f"Unknown resource tag {tag}") + else: + return rh diff --git a/tools/assets/descriptor/n64resources.py b/tools/assets/descriptor/n64resources.py new file mode 100644 index 0000000000..fe7c7172da --- /dev/null +++ b/tools/assets/descriptor/n64resources.py @@ -0,0 +1,241 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import dataclasses +import enum +from xml.etree.ElementTree import Element + +from ..n64 import G_IM_FMT, G_IM_SIZ + +from .base import ( + ResourceDesc, + ResourcesDescCollection, + ResourcesDescCollectionsPool, + ResourceHandlerNeedsPass2Exception, + BaseromFileBackingMemory, +) +from . import xml_errors + +# TODO remove +STATIC_ATTRIB = {"Static"} + + +class GfxMicroCode(enum.Enum): + F3DEX = enum.auto() + F3DEX2 = enum.auto() + + +@dataclasses.dataclass(eq=False) +class DListResourceDesc(ResourceDesc): + ucode: GfxMicroCode + raw_pointers: set[int] = dataclasses.field(default_factory=set) + """Pointers in the dlist that are fine to keep raw ("in hex") instead of using symbols""" + + +def handler_DList(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib( + reselem, {"Name", "Offset"}, {"Ucode", "RawPointers"} | STATIC_ATTRIB + ) + if "Ucode" in reselem.attrib: + ucode = GfxMicroCode[reselem.attrib["Ucode"].upper()] + else: + ucode = GfxMicroCode.F3DEX2 + res = DListResourceDesc(symbol_name, offset, collection, reselem, ucode) + raw_pointers_str = reselem.attrib.get("RawPointers") + if raw_pointers_str: + for rp_str in raw_pointers_str.split(","): + res.raw_pointers.add(int(rp_str, 16)) + return res + + +@dataclasses.dataclass(eq=False) +class BlobResourceDesc(ResourceDesc): + size: int + + +def handler_Blob(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset", "Size"}, STATIC_ATTRIB) + size = int(reselem.attrib["Size"], 16) + return BlobResourceDesc(symbol_name, offset, collection, reselem, size) + + +@dataclasses.dataclass(eq=False) +class MtxResourceDesc(ResourceDesc): + pass + + +def handler_Mtx(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}, STATIC_ATTRIB) + return MtxResourceDesc(symbol_name, offset, collection, reselem) + + +@dataclasses.dataclass(eq=False) +class S16ArrayResourceDesc(ResourceDesc): + count: int + + +@dataclasses.dataclass(eq=False) +class Vec3sArrayResourceDesc(ResourceDesc): + count: int + + +@dataclasses.dataclass(eq=False) +class VtxArrayResourceDesc(ResourceDesc): + count: int + + +def handler_Array(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset", "Count"}, STATIC_ATTRIB) + count = int(reselem.attrib["Count"]) + assert len(reselem) == 1, "Expected exactly one child of Array node" + array_elem = reselem[0] + if array_elem.tag == "Vtx": + array_resource_type = VtxArrayResourceDesc + elif ( + array_elem.tag == "Vector" + and array_elem.attrib["Type"] == "s16" + and int(array_elem.attrib["Dimensions"]) == 3 + ): + array_resource_type = Vec3sArrayResourceDesc + elif array_elem.tag == "Scalar" and array_elem.attrib["Type"] == "s16": + array_resource_type = S16ArrayResourceDesc + else: + raise NotImplementedError(f"Array of {array_elem.tag}") + return array_resource_type(symbol_name, offset, collection, reselem, count) + + +class TextureFormat(enum.Enum): + RGBA16 = (G_IM_FMT.RGBA, G_IM_SIZ._16b) + RGBA32 = (G_IM_FMT.RGBA, G_IM_SIZ._32b) + CI4 = (G_IM_FMT.CI, G_IM_SIZ._4b) + CI8 = (G_IM_FMT.CI, G_IM_SIZ._8b) + I4 = (G_IM_FMT.I, G_IM_SIZ._4b) + I8 = (G_IM_FMT.I, G_IM_SIZ._8b) + IA4 = (G_IM_FMT.IA, G_IM_SIZ._4b) + IA8 = (G_IM_FMT.IA, G_IM_SIZ._8b) + IA16 = (G_IM_FMT.IA, G_IM_SIZ._16b) + + def __init__(self, fmt: G_IM_FMT, siz: G_IM_SIZ): + self.fmt = fmt + self.siz = siz + + +@dataclasses.dataclass(eq=False) +class TextureResourceDesc(ResourceDesc): + format: TextureFormat + width: int + height: int + + +@dataclasses.dataclass(eq=False) +class CITextureResourceDesc(TextureResourceDesc): + tlut: TextureResourceDesc + + +def handler_Texture( + symbol_name, offset, collection: ResourcesDescCollection, reselem: Element +): + xml_errors.check_attrib( + reselem, + {"Name", "Offset", "Format", "Width", "Height"}, + # TODO remove OutName, SplitTlut + { + "OutName", + "SplitTlut", + "TlutOffset", + "ExternalTlut", + "ExternalTlutOffset", + "HackMode", + } + | STATIC_ATTRIB, + ) + format = TextureFormat[reselem.attrib["Format"].upper()] + width = int(reselem.attrib["Width"]) + height = int(reselem.attrib["Height"]) + if format.fmt == G_IM_FMT.CI: + res = CITextureResourceDesc( + symbol_name, offset, collection, reselem, format, width, height, None + ) + + if reselem.attrib.get("SplitTlut") == "true": + res.hack_modes.add("hackmode_split_tlut_true") + if reselem.attrib.get("SplitTlut") == "false": + res.hack_modes.add("hackmode_split_tlut_false") + + assert ( + "TlutOffset" in reselem.attrib or "ExternalTlutOffset" in reselem.attrib + ), f"CI texture {symbol_name} is missing a tlut offset" + + if "TlutOffset" in reselem.attrib: + xml_errors.check_attrib( + reselem, + {"Name", "Offset", "Format", "Width", "Height", "TlutOffset"}, + # TODO remove OutName, SplitTlut + {"OutName", "SplitTlut", "HackMode"} | STATIC_ATTRIB, + ) + tlut_offset = int(reselem.attrib["TlutOffset"], 16) + + def pass2_callback(pool: ResourcesDescCollectionsPool): + matching_tlut_resources = [ + res for res in collection.resources if res.offset == tlut_offset + ] + assert len(matching_tlut_resources) == 1, ( + f"Found {len(matching_tlut_resources)} resources at TlutOffset " + f"0x{tlut_offset:X} instead of exactly one" + ) + assert isinstance( + matching_tlut_resources[0], TextureResourceDesc + ), matching_tlut_resources[0] + res.tlut = matching_tlut_resources[0] + + else: + xml_errors.check_attrib( + reselem, + { + "Name", + "Offset", + "Format", + "Width", + "Height", + "ExternalTlut", + "ExternalTlutOffset", + }, + # TODO remove OutName, SplitTlut + {"OutName", "SplitTlut", "HackMode"} | STATIC_ATTRIB, + ) + external_tlut_file = reselem.attrib["ExternalTlut"] + external_tlut_offset = int(reselem.attrib["ExternalTlutOffset"], 16) + + def pass2_callback(pool: ResourcesDescCollectionsPool): + matching_collections = [ + coll + for coll in pool.collections + if isinstance(coll.backing_memory, BaseromFileBackingMemory) + and coll.backing_memory.name == external_tlut_file + ] + assert len(matching_collections) == 1 + matching_tlut_resources = [ + res + for res in matching_collections[0].resources + if res.offset == external_tlut_offset + ] + assert len(matching_tlut_resources) == 1, matching_tlut_resources + assert isinstance( + matching_tlut_resources[0], TextureResourceDesc + ), matching_tlut_resources[0] + res.tlut = matching_tlut_resources[0] + + raise ResourceHandlerNeedsPass2Exception(res, pass2_callback) + else: + xml_errors.check_attrib( + reselem, + {"Name", "Offset", "Format", "Width", "Height"}, + # TODO remove OutName + {"OutName", "HackMode"} | STATIC_ATTRIB, + ) + res = TextureResourceDesc( + symbol_name, offset, collection, reselem, format, width, height + ) + if reselem.attrib.get("HackMode") == "ignore_orphaned_tlut": + res.hack_modes.add("hackmode_ignore_orphaned_tlut") + return res diff --git a/tools/assets/descriptor/spec.md b/tools/assets/descriptor/spec.md new file mode 100644 index 0000000000..c038a13f82 --- /dev/null +++ b/tools/assets/descriptor/spec.md @@ -0,0 +1,291 @@ +This document describes the expected structure of xml files describing assets. + +# Top elements + +## `Root` + +```xml + + ... + +``` + +This is the root element in the file, containing exclusively `` and `` elements as direct children. + +## `File` + +```xml + + ... + +``` + +A `` contains resources elements as children. + +- Required attributes: `Name` +- Optional attributes: `Segment` + +`Name` is the name of the baserom file from which the data is to be extracted. + +`Segment` (decimal) is the segment number for the file. + +## `ExternalFile` + +```xml + +``` + +Declare the ``s in the xml may reference symbols from an external file. + +The external file is located by matching its name against the list of assets in the version's `config.yml`. + +For example, `baseroms/gc-eu/config.yml` contains + +```yml +assets: +- name: objects/gameplay_keep + xml_path: assets/xml/objects/gameplay_keep_pal.xml +``` + +then `` refers to that gameplay_keep entry, which uses the `gameplay_keep_pal.xml` xml file when extracting assets for version gc-eu. + + +# Resource elements + +Resource elements describe resources. Resources are pieces of data corresponding to a symbol each. + +Two attributes are required on all resource elements: `Name` and `Offset`. + +- `Name` is the name of the symbol associated to the resource. +- `Offset` is the location in bytes from the start of the file data. + +## `Blob` + +```xml + +``` + +Unstructured binary data. + +- Required attributes: `Size` + +`Size` is the size of the binary blob in bytes. + +## `DList` + +```xml + +``` + +A display list. + +- Optional attributes: `Ucode`, `RawPointers` + +`Ucode` (defaults to `f3dex2`) picks the graphics microcode for which to disassemble the dlist. It may be `f3dex` or `f3dex2`. + +`RawPointers` (defaults to an empty value) is a comma-separated list of values the display list uses as raw pointers ("hex" instead of a symbol). The purpose of this attribute is to silence extraction warnings. + +## `Mtx` + +```xml + +``` + +A fixed-point matrix. + +## `Texture` + +```xml + + + +``` + +A texture, an image in one of the native N64 formats. + +- Required attributes for all formats: `Format`, `Width`, `Height` +- Required attributes for CI formats (`ci4`, `ci8`): `TlutOffset`, or `ExternalTlut` and `ExternalTlutOffset` + +`Format` is the format of the texture, one of `rgba32`, `rgba16`, `i4`, `i8`, `ia4`, `ia8`, `ia16`, `ci4` or `ci8`. + +`Width` and `Height` specify the dimensions of the texture. + +For CI formats, the TLUT (Texture Look Up Table, or palette) must be specified with either `TlutOffset` if the TLUT is in the same file as the texture, or both of `ExternalTlut` and `ExternalTlutOffset` if the TLUT is in a different file. `ExternalTlut` is the name of the baserom file where the TLUT is. In both cases, the TLUT must also be declared as a resource. + +## `Array` + +```xml + + + + + + + + + +``` + +An array of vertices, vectors or scalars. The child element determines the array's element type. + +- Required attributes: `Count` + +`Count` is the length of the array. + +The child element may be one of `` (for `Vtx[]`), `` (for `Vec3s[]`) or `` (for `s16[]`). + +## `Scene` + +```xml + +``` + +Scene commands. + +## `Room` + +```xml + +``` + +Room commands. + +## `Collision` + +```xml + +``` + +Collision header. + +## `Cutscene` + +```xml + +``` + +Cutscene script. + +## `Path` + +```xml + +``` + +Path list. + +- Required attributes: `NumPaths` + +`NumPaths` is the length of the path list. + +## `Skeleton` + +```xml + +``` + +Skeleton header. + +- Required attributes: `Type`, `LimbType` +- Optional attributes: `LimbNone`, `LimbMax`, `EnumName` + +`Type` is the type of the skeleton, one of `Normal`, `Flex` or `Curve`. + +`LimbType` is the type of limb used in the skeleton, one of `Standard`, `LOD`, `Skin`, `Curve` or `Legacy`. + +Not all skeleton types are compatible with all limb types: + +`LimbType` | Compatible skeleton `Type` +-----------|--------------------------- +`Standard` | `Normal`, `Flex` +`LOD` | `Normal`, `Flex` +`Skin` | `Normal` +`Curve` | `Curve` +`Legacy` | none + +`LimbNone`, `LimbMax`, `EnumName` can be set to override the corresponding names in the generated limb enum: + +```c +typedef enum NameLimb { + NAME_LIMB_NONE, + ... + NAME_LIMB_MAX +} NameLimb; +``` + +## `LimbTable` + +```xml + +``` + +Limb table. + +- Required attributes: `LimbType`, `Count` + +`LimbType` is one of `Standard`, `LOD`, `Skin`, `Curve` or `Legacy`. + +`Count` is the amount of limbs. + +## `Limb` + +```xml + +``` + +Limb of a skeleton. + +- Required attributes: `LimbType` +- Optional attributes: `EnumName` + +`LimbType` is one of `Standard`, `LOD`, `Skin`, `Curve` or `Legacy`. + +`EnumName` can be set to override the limb name in the generated limb enum. + +## `Animation` + +```xml + +``` + +Animation header. + +## `CurveAnimation` + +```xml + +``` + +Curve animation header. + +- Required attributes: `SkelOffset` + +`SkelOffset` is the offset of the skeleton which uses this animation. The skeleton must also be declared as a resource. + +## `LegacyAnimation` + +```xml + +``` + +Legacy animation header. + +## `PlayerAnimation` + +```xml + +``` + +Player animation header. + +## `PlayerAnimationData` + +```xml + +``` + +Player animation data. + +- Required attributes: `FrameCount` + +`FrameCount` is the amount of frames in the animation. diff --git a/tools/assets/descriptor/xml_errors.py b/tools/assets/descriptor/xml_errors.py new file mode 100644 index 0000000000..7d7f6e0197 --- /dev/null +++ b/tools/assets/descriptor/xml_errors.py @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from xml.etree import ElementTree + + +class XMLDescError(Exception): + pass + + +def check_attrib( + elem: ElementTree.Element, + required: set[str], + optional: set[str] = set(), +): + required_and_missing = required - elem.attrib.keys() + if required_and_missing: + raise XMLDescError( + "Missing attributes on " + + ElementTree.tostring(elem, encoding="unicode") + + ": " + + ", ".join(required_and_missing) + ) + unknown = elem.attrib.keys() - required - optional + if unknown: + raise XMLDescError( + "Unknown attributes on " + + ElementTree.tostring(elem, encoding="unicode") + + ": " + + ", ".join(unknown) + ) diff --git a/tools/assets/descriptor/z64resources.py b/tools/assets/descriptor/z64resources.py new file mode 100644 index 0000000000..fba264151f --- /dev/null +++ b/tools/assets/descriptor/z64resources.py @@ -0,0 +1,218 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import dataclasses +import enum +from typing import Optional +from xml.etree.ElementTree import Element + +from .base import ( + ResourceDesc, + ResourcesDescCollection, + ResourceHandlerNeedsPass2Exception, +) +from . import xml_errors + + +@dataclasses.dataclass(eq=False) +class CollisionResourceDesc(ResourceDesc): + pass + + +def handler_Collision(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}) + return CollisionResourceDesc(symbol_name, offset, collection, reselem) + + +@dataclasses.dataclass(eq=False) +class AnimationResourceDesc(ResourceDesc): + pass + + +def handler_Animation(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}) + return AnimationResourceDesc(symbol_name, offset, collection, reselem) + + +@dataclasses.dataclass(eq=False) +class PlayerAnimationResourceDesc(ResourceDesc): + pass + + +def handler_PlayerAnimation(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}) + return PlayerAnimationResourceDesc(symbol_name, offset, collection, reselem) + + +@dataclasses.dataclass(eq=False) +class LegacyAnimationResourceDesc(ResourceDesc): + pass + + +def handler_LegacyAnimation(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}) + return LegacyAnimationResourceDesc(symbol_name, offset, collection, reselem) + + +@dataclasses.dataclass(eq=False) +class CutsceneResourceDesc(ResourceDesc): + pass + + +def handler_Cutscene(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}) + return CutsceneResourceDesc(symbol_name, offset, collection, reselem) + + +@dataclasses.dataclass(eq=False) +class SceneResourceDesc(ResourceDesc): + pass + + +def handler_Scene(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}) + return SceneResourceDesc(symbol_name, offset, collection, reselem) + + +@dataclasses.dataclass(eq=False) +class RoomResourceDesc(ResourceDesc): + pass + + +def handler_Room(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset"}, {"HackMode"}) + res = RoomResourceDesc(symbol_name, offset, collection, reselem) + if reselem.attrib.get("HackMode") == "syotes_room": + res.hack_modes.add("hackmode_syotes_room") + return res + + +@dataclasses.dataclass(eq=False) +class PlayerAnimationDataResourceDesc(ResourceDesc): + frame_count: int + + +def handler_PlayerAnimationData(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset", "FrameCount"}) + frame_count = int(reselem.attrib["FrameCount"]) + return PlayerAnimationDataResourceDesc( + symbol_name, offset, collection, reselem, frame_count + ) + + +@dataclasses.dataclass(eq=False) +class PathListResourceDesc(ResourceDesc): + num_paths: int + + +def handler_PathList(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset", "NumPaths"}) + num_paths = int(reselem.attrib["NumPaths"]) + return PathListResourceDesc(symbol_name, offset, collection, reselem, num_paths) + + +class SkeletonType(enum.Enum): + NORMAL = enum.auto() + FLEX = enum.auto() + CURVE = enum.auto() + + +class LimbType(enum.Enum): + STANDARD = enum.auto() + LOD = enum.auto() + SKIN = enum.auto() + CURVE = enum.auto() + LEGACY = enum.auto() + + +@dataclasses.dataclass(eq=False) +class SkeletonResourceDesc(ResourceDesc): + type: SkeletonType + limb_type: LimbType + limb_enum_name: Optional[str] + limb_enum_none_member_name: Optional[str] + limb_enum_max_member_name: Optional[str] + + +def handler_Skeleton(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib( + reselem, + {"Name", "Offset", "Type", "LimbType"}, + {"EnumName", "LimbNone", "LimbMax"}, + ) + skel_type = SkeletonType[reselem.attrib["Type"].upper()] + limb_type = LimbType[reselem.attrib["LimbType"].upper()] + return SkeletonResourceDesc( + symbol_name, + offset, + collection, + reselem, + skel_type, + limb_type, + reselem.attrib.get("EnumName"), + reselem.attrib.get("LimbNone"), + reselem.attrib.get("LimbMax"), + ) + + +@dataclasses.dataclass(eq=False) +class LimbResourceDesc(ResourceDesc): + limb_type: LimbType + limb_enum_member_name: Optional[str] + + +def handler_Limb(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset", "LimbType"}, {"EnumName"}) + limb_type = LimbType[reselem.attrib["LimbType"].upper()] + return LimbResourceDesc( + symbol_name, + offset, + collection, + reselem, + limb_type, + reselem.attrib.get("EnumName"), + ) + + +@dataclasses.dataclass(eq=False) +class LimbTableResourceDesc(ResourceDesc): + limb_type: LimbType + count: int + + +def handler_LimbTable(symbol_name, offset, collection, reselem: Element): + xml_errors.check_attrib(reselem, {"Name", "Offset", "LimbType", "Count"}) + limb_type = LimbType[reselem.attrib["LimbType"].upper()] + count = int(reselem.attrib["Count"]) + return LimbTableResourceDesc( + symbol_name, offset, collection, reselem, limb_type, count + ) + + +@dataclasses.dataclass(eq=False) +class CurveAnimationResourceDesc(ResourceDesc): + skeleton: SkeletonResourceDesc + + +def handler_CurveAnimation( + symbol_name, offset, collection: ResourcesDescCollection, reselem: Element +): + xml_errors.check_attrib(reselem, {"Name", "Offset", "SkelOffset"}) + res = CurveAnimationResourceDesc(symbol_name, offset, collection, reselem, None) + + skel_offset = int(reselem.attrib["SkelOffset"], 16) + + def pass2_callback(pool): + matching_tlut_resources = [ + res for res in collection.resources if res.offset == skel_offset + ] + assert len(matching_tlut_resources) == 1, ( + f"Found {len(matching_tlut_resources)} resources at SkelOffset " + f"0x{skel_offset:X} instead of exactly one" + ) + assert isinstance( + matching_tlut_resources[0], SkeletonResourceDesc + ), matching_tlut_resources[0] + res.skeleton = matching_tlut_resources[0] + + raise ResourceHandlerNeedsPass2Exception(res, pass2_callback) diff --git a/tools/assets/extract/__main__.py b/tools/assets/extract/__main__.py new file mode 100644 index 0000000000..62676350b5 --- /dev/null +++ b/tools/assets/extract/__main__.py @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from . import extract_xml_z64 + +if __name__ == "__main__": + profile = False + if profile: + import cProfile + + cProfile.run("extract_xml_z64.main()", "cprofile_extract_assets.txt") + else: + extract_xml_z64.main() diff --git a/tools/assets/extract/extase/__init__.py b/tools/assets/extract/extase/__init__.py new file mode 100644 index 0000000000..029b20d214 --- /dev/null +++ b/tools/assets/extract/extase/__init__.py @@ -0,0 +1,1139 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from pathlib import Path +import abc +from dataclasses import dataclass +import enum +import reprlib + +import io +from typing import TYPE_CHECKING, Sequence, Optional, Union, Any, Iterable + +from pprint import pprint + +if TYPE_CHECKING: + from .memorymap import MemoryContext + + +# 0: nothing, 1: in progress & waiting, 2: all +VERBOSE_FILE_TRY_PARSE_DATA = 0 +VERBOSE_REPORT_RESBUF = False + +DUMP_REPORTERS_IN_SOURCE = False +DUMP_XML_IN_SOURCE = False + +DONT_MERGE_RESOURCE_BUFFERS_FROM_DIFFERENT_USERS = False + +# +# file +# + +# sentinel value +RESOURCE_PARSE_SUCCESS = object() + + +class ResourceParseException(Exception): + pass + + +class ResourceParseWaiting(ResourceParseException): + """Resource has nothing to do and can't be parsed yet, try again later. + + For example, another resource may need to be parsed first. + + If all resources fail to parse in this way, it means parsing has come to a deadlock. + """ + + def __init__(self, *args, waiting_for: list[Any]): + """ + waiting_for should be a non-empty list of things the resource is currently waiting for. + (one item per meaningful thing that is waited for) + It is only meant for informational purpose (such as debugging). + It may contain more than the strict minimum the resource needs to make some progress, + and less than everything the resource needs to be fully parsed. + """ + assert waiting_for + super().__init__(*args, waiting_for) + self.waiting_for = waiting_for + + +class ResourceParseInProgress(ResourceParseException): + """Resource can't be parsed yet, try again later. + But there was progress (as opposed to ResourceParseWaiting indicating no progress). + + "Progress" includes: + - other resources were reported + - information was passed to or made available to other resources + - data was partially parsed + """ + + def __init__(self, *args, new_progress_done: list[Any], waiting_for: list[Any]): + """ + new_progress_done, waiting_for: see ResourceParseWaiting.__init__ + """ + assert new_progress_done and waiting_for + super().__init__(*args, new_progress_done, waiting_for) + self.new_progress_done = new_progress_done + self.waiting_for = waiting_for + + +class ResourceParseImpossible(ResourceParseException): + """Resource cannot be parsed, neither now nor later. + + For example, there is unexpected data or values that cannot be handled properly. + """ + + pass + + +class GetResourceAtResult(enum.Enum): + DEFINITIVE = enum.auto() + PERHAPS = enum.auto() + NONE_YET = enum.auto() + + +@dataclass +class ResourceBufferMarker: + name: str + file_start: int + file_end: int + users: set["Resource"] + + +@dataclass +class ResourcesOverlapError(Exception): + overlaps: list[tuple["Resource", "Resource"]] + + +class File: + """A file is a collection of resources + + It typically corresponds to a rom file (segment) but doesn't have to + It doesn't even need to correspond to the entirety of one or more .c files, + it can be only a fraction + + It can also correspond to how some memory is laid out, + for example what a segment "contains" in the context of a file or resource. + """ + + def __init__( + self, + name: str, + *, + data: Optional[memoryview] = None, + size: Optional[int] = None, + alignment: int = 8, + ): + self.name = name + if data is None != size is None: + raise Exception( + "Exactly one of either data or size must be provided", data, size + ) + if data is not None: + self.data = data + self.size = len(data) + else: + assert size is not None + self.data = None + self.size = size + self.alignment = alignment + self._resources: list[Resource] = [] + self._is_resources_sorted = True + self.referenced_files: set[File] = set() + self.resource_buffer_markers_by_resource_type: dict[ + type[Resource], list[ResourceBufferMarker] + ] = dict() + + def add_resource(self, resource: "Resource"): + assert resource is not None + assert resource not in self._resources + self._resources.append(resource) + self._is_resources_sorted = False + + def extend_resources(self, resources: Sequence["Resource"]): + self._resources.extend(resources) + self._is_resources_sorted = False + + def sort_resources(self): + self._resources.sort(key=lambda resource: resource.range_start) + self._is_resources_sorted = True + + def get_resource_at(self, offset: int): + if __debug__: + # FIXME when resources overlap during parse, nothing catches that + # (and nothing can really catch it because of the unk-size resources) + # probably implement this check properly by finding all resources at the offset below, + # hopefully there is at most one and do normal operation, + # or if there are >=2 then error (or best_effort: pick the furthest resource?) + self.sort_resources() + self.check_overlapping_resources() + assert offset < self.size + + # Resources may use a defined range with both start and end defined, + # or a range that only has its start defined. + + # While looking for a resource with a defined range the request offset + # belongs to, also keep track of the last resource that starts at or before + # offset (note: that resource may or may not have an end range defined). + last_resource_before_offset: Union[Resource, None] = None + + for resource in self._resources: + + if resource.range_start <= offset: + if ( + last_resource_before_offset is None + or last_resource_before_offset.range_start < resource.range_start + ): + last_resource_before_offset = resource + + if resource.range_end is not None: + # If the requested offset falls within a defined range, return that + # resource with GetResourceAtResult.DEFINITIVE . + if resource.range_start <= offset < resource.range_end: + return GetResourceAtResult.DEFINITIVE, resource + + # If the loop exits normally, without returning a defined range resource, + # check if the last resource starting at or before the requested offset + # (if any) has an undefined range. + if ( + last_resource_before_offset is not None + and last_resource_before_offset.range_end is None + ): + if last_resource_before_offset.range_start == offset: + # Resources are always more than 0 bytes in size, so if the resource + # starts exactly at the requested offset, then it is guaranteed to + # cover (at least) that offset. + return GetResourceAtResult.DEFINITIVE, last_resource_before_offset + else: + # Return it with GetResourceAtResult.PERHAPS , as it may extend up to + # and beyond the requested offset (or not). + return GetResourceAtResult.PERHAPS, last_resource_before_offset + else: + # No (potential) resource at that offset (currently). + return GetResourceAtResult.NONE_YET, None + + def get_overlapping_resources(self): + if not self._is_resources_sorted: + raise Exception("sort resources first") + + overlaps: list[tuple[Resource, Resource]] = [] + + for i in range(1, len(self._resources)): + resource_a = self._resources[i - 1] + + if resource_a.range_end is not None: + for j in range(i, len(self._resources)): + resource_b = self._resources[j] + + # This should hold true, as resources are sorted + assert resource_a.range_start <= resource_b.range_start + + if resource_a.range_end > resource_b.range_start: + overlaps.append((resource_a, resource_b)) + else: + break + else: + for j in range(i, len(self._resources)): + resource_b = self._resources[j] + + assert resource_a.range_start <= resource_b.range_start + + if resource_a.range_start == resource_b.range_start: + overlaps.append((resource_a, resource_b)) + else: + break + + return overlaps + + def check_overlapping_resources(self): + try: + overlaps = self.get_overlapping_resources() + if overlaps: + raise ResourcesOverlapError(overlaps) + except: + print(self.str_report()) + raise + + def get_non_parsed_resources(self): + return [resource for resource in self._resources if not resource.is_data_parsed] + + def check_non_parsed_resources(self): + try: + resources_data_not_parsed = self.get_non_parsed_resources() + if resources_data_not_parsed: + print(len(resources_data_not_parsed), "resource(s) not parsed:") + for resource in resources_data_not_parsed: + print(resource) + if hasattr(resource, "last_parse_waiting_e"): + print( + " last_parse_waiting_e =", + repr(resource.last_parse_waiting_e), + ) + else: + print("??? no last_parse_waiting_e ???") + print("then why has", resource.name, "not been parsed?") + BEST_EFFORT = False # TODO move + if BEST_EFFORT: + print("BEST_EFFORT: removing non-parsed resources") + for resource in resources_data_not_parsed: + self._resources.remove(resource) + self.add_resource( + BinaryBlobResource( + self, + resource.range_start, + ( + resource.range_end + if resource.range_end is not None + else ( + resource.range_start + + 4 # TODO 4 if I_D_OMEGALUL else 1 + ) + ), + f"{resource.name}_bin_placeholder", + ) + ) + return + raise Exception( + "resources not parsed", + len(resources_data_not_parsed), + [(r.name, r.__class__) for r in resources_data_not_parsed], + resources_data_not_parsed, + ) + except: + print(self.str_report()) + raise + + def try_parse_resources_data(self, file_memory_context: "MemoryContext"): + """Returns true if any progress was made between the method being called and the method returning.""" + any_progress = False + + while True: + any_data_parsed = False + + # Parsing resources may add more, copy the list + # to avoid concurrent modification while iterating + resources_copy = self._resources.copy() + + for resource in resources_copy: + if resource.is_data_parsed: + pass + else: + resource.last_parse_waiting_e = None + resource_memory_context = file_memory_context # TODO + try: + ret_try_parse_data = resource.try_parse_data( + resource_memory_context + ) + except ResourceParseInProgress as e: + any_progress = True + if VERBOSE_FILE_TRY_PARSE_DATA >= 1: + pprint( + ( + "(in progress) Defering parsing", + resource, + "progress:", + e.new_progress_done, + "waiting:", + e.waiting_for, + ) + ) + except ResourceParseWaiting as e: + if VERBOSE_FILE_TRY_PARSE_DATA >= 1: + pprint( + ( + "(waiting) Defering parsing", + resource, + "waiting:", + e.waiting_for, + ) + ) + resource.last_parse_waiting_e = e + except ( + ResourceParseException + ) as e: # TODO ResourceParseImpossible ? + # TODO replace resource with binblob or something idk + print("Error while attempting to parse data", resource) + raise + except: + # TODO replace resource with binblob or something idk + print("Error while attempting to parse data", resource) + raise + else: + # Catch try_parse_data mistakenly returning successfully + # (instead of raising) by enforcing having it return a sentinel value + assert ret_try_parse_data is RESOURCE_PARSE_SUCCESS, ( + "Resources should return RESOURCE_PARSE_SUCCESS when parsing is successful, " + "or raise ResourceParseInProgress/ResourceParseWaiting if parsing is unsuccessful", + resource, + resource.try_parse_data, + ) + + # resource parsed successfully + if VERBOSE_FILE_TRY_PARSE_DATA >= 2: + pprint(("(success) Done parsing", resource)) + any_progress = True + assert resource.range_end is not None, ( + resource, + resource.__class__, + ) + resource.is_data_parsed = True + any_data_parsed = True + + any_resource_added = len(self._resources) != len(resources_copy) + keep_looping = any_data_parsed or any_resource_added + if not keep_looping: + break + + return any_progress + + def mark_resource_buffer( + self, + reporter: "Resource", + resource_type: type["Resource"], + name: str, + file_start: int, + file_end: int, + ): + # Ignore markers falling within existing resources + result, resource = self.get_resource_at(file_start) + if result == GetResourceAtResult.DEFINITIVE: + if resource.range_start <= file_start < file_end <= resource.range_end: + assert isinstance(resource, resource_type) + resource.reporters.add(reporter) + return + + # Check for intersection with existing resources + for resource in self._resources: + # TODO and when resource.range_end is None ? + if resource.range_end is not None and ( + resource.range_start <= file_start < resource.range_end + or resource.range_start < file_end <= resource.range_end + ): + raise Exception( + f"Resource buffer {name=} of {resource_type=}" + f" to be marked at {file_start:#X}-{file_end:#X}" + f" intersects with existing {resource=}" + ) + + resource_buffer_markers = ( + self.resource_buffer_markers_by_resource_type.setdefault(resource_type, []) + ) + resource_buffer_markers.append( + ResourceBufferMarker(name, file_start, file_end, {reporter}) + ) + + resource_buffer_markers.sort(key=lambda rbm: rbm.file_start) + + def do_fuse(i_start, i_end): + assert i_start < i_end + if i_start + 1 == i_end: + return False + fused = resource_buffer_markers[i_start:i_end] + users = set() + for rbm in fused: + users.update(rbm.users) + resource_buffer_markers[i_start:i_end] = [ + ResourceBufferMarker( + fused[0].name.removesuffix("_fused_") + "_fused_", # TODO + min(map(lambda _f: _f.file_start, fused)), + max(map(lambda _f: _f.file_end, fused)), + users, + ) + ] + return True + + def fuse_more(): + stride_first_i = None + for i, rbm in enumerate(resource_buffer_markers): + if stride_first_i is None: + stride_first_i = i + else: + assert i > 0 + prev = resource_buffer_markers[i - 1] + if prev.file_end < rbm.file_start or ( + DONT_MERGE_RESOURCE_BUFFERS_FROM_DIFFERENT_USERS + and prev.file_end == rbm.file_start + and prev.users != rbm.users + ): + # disjointed + if do_fuse(stride_first_i, i): + return True + stride_first_i = i + if stride_first_i is not None: + return do_fuse(stride_first_i, len(resource_buffer_markers)) + else: + return False + + while fuse_more(): + pass + + def commit_resource_buffers(self): + # TODO rework resource buffers handling + # this won't play well with manually defined vtx arrays + # probably can't merge the vbuf refs so quick + for ( + resource_type, + resource_buffer_markers, + ) in self.resource_buffer_markers_by_resource_type.items(): + if VERBOSE_REPORT_RESBUF: + print(resource_type, resource_buffer_markers) + for rbm in resource_buffer_markers: + result, resource = self.get_resource_at(rbm.file_start) + assert ( + result != GetResourceAtResult.PERHAPS + ), "commit_resource_buffers should be called at a point where all resources have a definitive range" + if result == GetResourceAtResult.NONE_YET: + resource = resource_type( + self, rbm.file_start, rbm.file_end, rbm.name + ) + resource.reporters.update(rbm.users) + self.add_resource(resource) + else: + assert result == GetResourceAtResult.DEFINITIVE + assert ( + resource.range_start + <= rbm.file_start + < rbm.file_end + <= resource.range_end + ), ( + "marked resource buffer overlaps with existing resource but also extends out of that resource", + hex(rbm.file_start), + hex(rbm.file_end), + rbm, + resource, + ) + + # TODO ? not really reporters but at least users, figure out reporters/users + resource.reporters.update(rbm.users) + self.resource_buffer_markers_by_resource_type = dict() + + def add_unaccounted_resources(self, *, I_D_OMEGALUL: bool): + assert self._is_resources_sorted + assert self.data is not None + + unaccounted_resources: list[Resource] = [] + + def add_unaccounted(range_start, range_end): + if I_D_OMEGALUL: + # IDO aligns every declaration to 4, so declaring zeros + # that is actually padding for that purpose throws off matching. + # This block strips such zeros from the unaccounted range. + + # Compute the amount of bytes from range_start to the + # next multiple of 4. + pad_bytes = (4 - range_start % 4) % 4 + if pad_bytes != 0: + pad_range_end = range_start + pad_bytes + assert pad_range_end <= range_end + pad_data = self.data[range_start:pad_range_end] + if set(pad_data) != {0}: + raise Exception( + "Expected pad bytes to be 0", + hex(range_start), + hex(pad_range_end), + set(pad_data), + bytes(pad_data), + ) + pad_resource = ZeroPaddingResource( + self, + range_start, + pad_range_end, + f"{self.name}_zero_padding_{range_start:06X}", + include_in_source=False, + ) + unaccounted_resources.append(pad_resource) + range_start += pad_bytes + if range_start == range_end: + # It turns out the whole unaccounted range is + # zero padding, so do nothing else + return + assert range_start < range_end + unaccounted_data = self.data[range_start:range_end] + if set(unaccounted_data) == {0}: + unaccounted_resource = ZeroPaddingResource( + self, + range_start, + range_end, + f"{self.name}_zeros_{range_start:06X}", + ) + else: + unaccounted_resource = BinaryBlobResource( + self, + range_start, + range_end, + f"{self.name}_unaccounted_{range_start:06X}", + ) + unaccounted_resources.append(unaccounted_resource) + + if self._resources: + # Add unaccounted if needed at the start of the file + resource_first = self._resources[0] + if resource_first.range_start > 0: + add_unaccounted( + 0, + resource_first.range_start, + ) + + # Add unaccounted if needed at the end of the file + resource_last = self._resources[-1] + if resource_last.range_end < len(self.data): + add_unaccounted( + resource_last.range_end, + len(self.data), + ) + else: + # Add unaccounted for the whole file + add_unaccounted(0, len(self.data)) + + for i in range(1, len(self._resources)): + resource_a = self._resources[i - 1] + resource_b = self._resources[i] + assert resource_a.range_end <= resource_b.range_start + + # Add unaccounted if needed between two successive resources + if resource_a.range_end < resource_b.range_start: + try: + add_unaccounted( + resource_a.range_end, + resource_b.range_start, + ) + except: + print( + "Could not add an unaccounted resource between the two resources:" + ) + print(resource_a) + print(resource_b) + raise + + self.extend_resources(unaccounted_resources) + + def set_resources_paths(self, extracted_path, build_path, out_path): + for resource in self._resources: + resource.set_paths(extracted_path, build_path, out_path) + + def write_resources_extracted(self, file_memory_context: "MemoryContext"): + for resource in self._resources: + assert resource.is_data_parsed, resource + resource_memory_context = file_memory_context # TODO + try: + resource.extract_to_path.parent.mkdir(parents=True, exist_ok=True) + resource.write_extracted(resource_memory_context) + except: + print("Couldn't write extracted resource", resource) + raise + + # These two are set by calling set_source_path + source_c_path: Path + source_h_path: Path + + def set_source_path(self, source_path: Path): + file_name = self.name + + # May catch random problems but not a hard requirement otherwise + assert file_name and all( + (c in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789") + for c in file_name + ), file_name + + self.source_file_name = file_name + self.source_c_path = source_path / f"{file_name}.c" + self.source_h_path = source_path / f"{file_name}.h" + + def write_source(self): + assert hasattr( + self, "source_c_path" + ), "set_source_path must be called before write_source" + assert hasattr(self, "source_h_path") + self.source_c_path.parent.mkdir(parents=True, exist_ok=True) + self.source_h_path.parent.mkdir(parents=True, exist_ok=True) + with self.source_c_path.open("w") as c: + with self.source_h_path.open("w") as h: + + # Paths to files to be included + file_include_paths_complete: list[Path] = [] + file_include_paths_complete.append(self.source_h_path) + for referenced_file in self.referenced_files: + assert isinstance(referenced_file, File), referenced_file + assert hasattr(referenced_file, "source_c_path"), ( + "set_source_path must be called on all files before any write_source call", + referenced_file, + ) + assert hasattr(referenced_file, "source_h_path") + file_include_paths_complete.append(referenced_file.source_h_path) + + # Same as file_include_paths_complete, + # but paths that can be are made relative to the source C. + file_include_paths: list[Path] = [] + for path_complete in file_include_paths_complete: + try: + path = path_complete.relative_to(self.source_c_path.parent) + except ValueError: + # Included path is not relative to this file's source C folder. + # Just use the complete path. + path = path_complete + file_include_paths.append(path) + + included_headers_in_c = set() + included_headers_in_h = set() + + for resource in self._resources: + incls = resource.get_c_includes() + assert not isinstance(incls, str) + included_headers_in_c.update(incls) + + incls = resource.get_h_includes() + assert not isinstance(incls, str) + included_headers_in_h.update(incls) + + for file_include_path in file_include_paths: + c.write(f'#include "{file_include_path}"\n') + c.write("\n") + c.writelines( + f'#include "{_h}"\n' for _h in sorted(included_headers_in_c) + ) + c.write("\n") + + INCLUDE_GUARD = self.source_file_name.upper() + "_H" + + h.writelines( + ( + f"#ifndef {INCLUDE_GUARD}\n", + f"#define {INCLUDE_GUARD}\n", + "\n", + ) + ) + h.writelines( + f'#include "{_h}"\n' for _h in sorted(included_headers_in_h) + ) + h.write("\n") + + if not self._is_resources_sorted: + self.sort_resources() + for resource in self._resources: + + if resource.write_c_definition(c): + c.write("\n") + + resource.write_c_declaration(h) + + h.writelines( + ( + "\n", + "#endif\n", + ) + ) + + def str_report(self): + return "\n".join( + f"0x{resource.range_start:06X}-" + + ( + f"0x{resource.range_end:06X}" + if resource.range_end is not None + else "..." + ) + + f" {resource.name}" + for resource in self._resources + ) + + @reprlib.recursive_repr() + def __repr__(self): + return ( + self.__class__.__qualname__ + + f"({self.name!r}, data is None={self.data is None}, size={self.size}, {self._resources!r})" + ) + + def __rich_repr__(self): + yield "name", self.name + yield "data is None", self.data is None + yield "size", self.size + yield "resources", self._resources + + __rich_repr__.angular = True + + +# +# resources +# + + +class Resource(abc.ABC): + """A resource is a blob of data inside a file. + + (at least for now,) one resource = one symbol + + Examples: + - a struct-defined piece of data, such as a SkeletonHeader + - an array of data, such as a display list Gfx[], or a texture u64[] + """ + + braces_in_source = True + + def __init_subclass__(cls, /, can_size_be_unknown=False, **kwargs): + super().__init_subclass__(**kwargs) + cls.can_size_be_unknown = can_size_be_unknown + + def __init__( + self, + file: File, + range_start: int, + range_end: Optional[int], + name: str, + ): + assert ( + 0 <= range_start < file.size + ), f"{range_start=:#08X} out of range [0,{file.size=:#08X})" + if range_end is None: + assert self.can_size_be_unknown + else: + assert ( + range_start < range_end <= file.size + ), f"{range_end=:#08X} out of range [{range_start=:#08X},{file.size=:#08X})" + + self.file = file + + self.range_start = range_start + """Offset in the file data this resource starts at (inclusive) + + Example: + range_start = 1 and range_end = 3 + means the resource is two bytes, the second and third bytes in the file + """ + + self.range_end = range_end + """Offset in the file data this resource end at (exclusive) + + May be None if the resource size isn't known yet + (only if can_size_be_unknown is True, see __init_subclass__) + Must be set at the latest before try_parse_data returns normally (without raising) + + See range_start + """ + + self.name = name + """Name of this resource, for logging/reporting. + + This member is NOT to be used as a C identifier, symbol name or file name. + + See also: + - symbol_name + - get_filename_stem + """ + + self.symbol_name = name + """Name of the symbol to use to reference this resource""" + + self.is_data_parsed = False + """Will be set to true when the resource is successfully parsed + (after a successful try_parse_data call) + """ + + self.reporters: set[Resource] = set() + """Collection of all the resources having reported this resource + TODO figure out what to do with this, for now thinking debugging""" + + @abc.abstractmethod + def try_parse_data(self, memory_context: "MemoryContext"): + """Parse this resource's data bytes + + This can typically result in finding more resources, + for example from pointer types. + + If data can't be parsed yet, ResourceParseInProgress or ResourceParseWaiting should be raised. + Then this will be called again later. + + Raising other ResourceParseException s abandons parsing this resource. + Other exceptions raised are not caught. + + Note this can both add found resources to the file, + and wait before further parsing its own data (by raising ResourceParseInProgress). + + If data is successfully parsed, the method should return normally + and RESOURCE_PARSE_SUCCESS should be returned. + Then this will not be called again. + """ + ... + + @abc.abstractmethod + def get_c_reference(self, resource_offset: int) -> str: + """Get a C expression for referencing data in this resource (as a pointer) + + The offset `resource_offset` is relative to the resource: + 0 means the start of the resource data, + and NOT the start of the file the resource is in. + + Should raise `ValueError` if the `resource_offset` isn't meaningful. + + Examples: + - `StructData data`, `get_c_reference(0)` -> `&data` + - `u8 array[]`, `get_c_reference(0)` -> `&array[0]` + - `u8 array[]`, `get_c_reference(6)` -> `&array[6]` + - `u16 array[]`, `get_c_reference(6)` -> `&array[3]` + - `u16 array[]`, `get_c_reference(1)` -> raises `ValueError` + - `u64 texture[]`, `get_c_reference(0)` -> `texture` + """ + ... + + def get_c_expression_length(self, resource_offset: int): + """Get a C expression for referencing the length of data in this resource + + The offset `resource_offset` is relative to the resource, as in get_c_reference. + + Should raise `ValueError` if the `resource_offset` isn't meaningful. + + Examples: + - `StructData data`, `get_c_expression_length(0)` -> raises `ValueError` + - `u8 array[]`, `get_c_reference(0)` -> `ARRAY_COUNT(array)` + - `u8 array[]`, `get_c_reference(1)` -> raises `ValueError` + """ + # Override in children classes if needed + raise ValueError( + "This resource has no data with a length that can be referenced", + self.__class__, + self, + ) + + needs_build = False + """Whether this resource needs processing by the build system. + + If False, it is extracted directly as .inc.c and included as is. + + See set_paths + """ + + extracted_path_suffix = ".inc.c" + """The file extension for constructing the path to extract this resource to. + + See set_paths + """ + + def get_filename_stem(self): + """Stem (name without suffix) for the file to write this resource to + + See set_paths + """ + return self.name + + # These two are set by calling set_paths + extract_to_path: Path + inc_c_path: Path + + def set_paths(self, extracted_path: Path, build_path: Path, out_path: Path): + """Compute and set `self.extract_to_path` and `self.inc_c_path` + + Examples with + extracted_path: `extracted/VERSION/` + build_path: `build/VERSION/` + out_path: `assets/.../` + + Binary: extracted_path_suffix = ".bin" + with get_filename_stem() = "blob" + extract_to_path: `extracted/VERSION/assets/.../blob.bin` + inc_c_path: `assets/.../blob.inc.c` + + C: extracted_path_suffix = ".inc.c" + with get_filename_stem() = "data" + extract_to_path: `extracted/VERSION/assets/.../data.inc.c` + inc_c_path: `assets/.../data.inc.c` + + rgba16 image: extracted_path_suffix = ".png" + with get_filename_stem() = "img.rgba16" + extract_to_path: `extracted/VERSION/assets/.../img.rgba16.png` + inc_c_path: `assets/.../img.rgba16.inc.c` + """ + + filename_stem = self.get_filename_stem() + + extract_to_path = ( + extracted_path / out_path / (filename_stem + self.extracted_path_suffix) + ) + + if not self.needs_build: + assert self.extracted_path_suffix == ".inc.c" + inc_c_path = out_path / (filename_stem + ".inc.c") + + self.extract_to_path = extract_to_path + self.inc_c_path = inc_c_path + + def get_c_includes(self) -> Iterable[str]: + return () + + def get_h_includes(self) -> Iterable[str]: + return () + + @abc.abstractmethod + def write_extracted(self, memory_context: "MemoryContext") -> None: + """Write the extracted resource data to self.extract_to_path""" + ... + + @abc.abstractmethod + def get_c_declaration_base(self) -> str: + """Get the base source for declaring this resource's symbol in C. + + For example: + - "u8 blob[]", `return f"u8 {self.symbol_name}[]"` + - "DataStruct data", `return f"DataStruct {self.symbol_name}"` + """ + ... + + def get_as_xml(self) -> str: + raise NotImplementedError() + + def write_c_definition(self, c: io.TextIOBase) -> bool: + """ + Returns True if something was written + """ + + if DUMP_REPORTERS_IN_SOURCE: + c.write(f"//R: {' '.join(_r.name for _r in self.reporters)}\n") + if DUMP_XML_IN_SOURCE: + try: + xml = self.get_as_xml() + except NotImplementedError: + pass + else: + c.write("/*\n") + c.write(xml) + c.write("\n") + c.write("*/\n") + + if hasattr(self, "HACK_IS_STATIC_ON"): + c.write("static ") + c.write(self.get_c_declaration_base()) + if self.braces_in_source: + c.write(" = {\n") + else: + c.write(" =\n") + + c.write(f'#include "{self.inc_c_path}"\n') + if self.braces_in_source: + c.write("};\n") + else: + c.write(";\n") + + return True + + def write_c_declaration(self, h: io.TextIOBase) -> None: + + if hasattr(self, "HACK_IS_STATIC_ON"): + h.write("static ") + else: + h.write("extern ") + h.write(self.get_c_declaration_base()) + h.write(";\n") + + @reprlib.recursive_repr() + def __repr__(self): + return ( + self.__class__.__qualname__ + + "(" + + ", ".join( + ( + repr(self.name), + ( + f"0x{self.range_start:08X}-" + + ( + f"0x{self.range_end:08X}" + if self.range_end is not None + else "..." + ) + ), + f"file.name={self.file.name!r}", + ) + ) + + ")" + ) + + def __rich_repr__(self): + yield self.name + yield ( + f"0x{self.range_start:08X}-" + + (f"0x{self.range_end:08X}" if self.range_end is not None else "...") + ) + yield "file.name", self.file.name + + __rich_repr__.angular = True + + +class ZeroPaddingResource(Resource): + def __init__( + self, + file: File, + range_start: int, + range_end: int, + name: str, + *, + include_in_source=True, + ): + # TODO move to try_parse_data ? + assert set(file.data[range_start:range_end]) == {0} + super().__init__(file, range_start, range_end, name) + self.include_in_source = include_in_source + + def try_parse_data(self, memory_context): + # Nothing specific to do + return RESOURCE_PARSE_SUCCESS + + def get_c_reference(self, resource_offset): + raise ValueError("Referencing zero padding should not happen") + + def get_c_includes(self): + return ("ultra64.h",) + + def write_extracted(self, memory_context): + # No need to extract zeros + pass + + def get_c_declaration_base(self): + length_bytes = self.range_end - self.range_start + assert length_bytes > 0 + return f"u8 {self.symbol_name}[{length_bytes}]" + + def write_c_definition(self, c: io.TextIOBase): + if self.include_in_source: + c.write(self.get_c_declaration_base()) + c.write(" = { 0 };\n") + return True + else: + return False + + def write_c_declaration(self, h: io.TextIOBase): + # No need to declare zeros + pass + + +class BinaryBlobResource(Resource): + needs_build = True + extracted_path_suffix = "" + + def try_parse_data(self, memory_context): + # Nothing specific to do + return RESOURCE_PARSE_SUCCESS + + def get_as_xml(self): + return f"""\ + """ + + def get_c_reference(self, resource_offset): + return f"&{self.symbol_name}[{resource_offset}]" + + def get_filename_stem(self): + return super().get_filename_stem() + ".bin" + + def get_h_includes(self): + return ("ultra64.h",) + + def write_extracted(self, memory_context): + data = self.file.data[self.range_start : self.range_end] + assert len(data) == self.range_end - self.range_start + self.extract_to_path.write_bytes(data) + + def get_c_declaration_base(self): + return f"u8 {self.symbol_name}[]" + + def get_c_expression_length(self, resource_offset: int): + raise Exception( + "A binary blob resource could support returning a C expression for its length, " + "but it would be error-prone due to the 'anything goes' nature of binary blobs. " + "Make a dedicated resource instead" + ) diff --git a/tools/assets/extract/extase/cdata_resources.py b/tools/assets/extract/extase/cdata_resources.py new file mode 100644 index 0000000000..d959a0c1f5 --- /dev/null +++ b/tools/assets/extract/extase/cdata_resources.py @@ -0,0 +1,521 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import abc +import dataclasses +import io +from typing import TYPE_CHECKING, Callable, Any, Sequence, Union + +if TYPE_CHECKING: + from .memorymap import MemoryContext + +from . import ( + RESOURCE_PARSE_SUCCESS, + Resource, + File, + ResourceParseWaiting, +) + +from .repr_c_struct import ( + CData, + CData_Value, + CData_Struct, + CData_Array, +) + + +@dataclasses.dataclass +class CDataExtWriteContext: + f: io.TextIOBase + line_prefix: str + inhibit_top_braces: bool + + +class CDataExt(CData, abc.ABC): + + report_f = None + write_f = None + + def set_report( + self, report_f: Callable[["CDataResource", "MemoryContext", Any], None] + ): + self.report_f = report_f + return self + + def set_write( + self, + write_f: Callable[ + ["CDataResource", "MemoryContext", Any, CDataExtWriteContext], + bool, + ], + ): + """ + write_f should return True if it wrote anything + """ + self.write_f = write_f + return self + + def freeze(self): + self.set_report = None + self.set_write = None + return self + + @abc.abstractmethod + def write_default( + self, + resource: "CDataResource", + memory_context: "MemoryContext", + v: Any, + f: io.TextIOBase, + line_prefix: str, + *, + inhibit_top_braces: bool, + ) -> bool: ... + + def report( + self, + resource: "CDataResource", + memory_context: "MemoryContext", + v: Any, + ): + if self.report_f: + try: + self.report_f(resource, memory_context, v) + except: + print("Error reporting data", self, self.report_f, resource, v) + raise + + def write( + self, + resource: "CDataResource", + memory_context: "MemoryContext", + v: Any, + f: io.TextIOBase, + line_prefix: str, + *, + inhibit_top_braces: bool, + ) -> bool: + """ + Returns True if something has been written + (typically, False will be returned if this data is struct padding) + """ + if self.write_f: + ret = self.write_f( + resource, + memory_context, + v, + CDataExtWriteContext(f, line_prefix, inhibit_top_braces), + ) + # This assert is meant to ensure the function returns a value at all, + # since it's easy to forget to return a value (typically True) + assert isinstance(ret, bool), ("must return a bool", self.write_f) + else: + ret = self.write_default( + resource, + memory_context, + v, + f, + line_prefix, + inhibit_top_braces=inhibit_top_braces, + ) + assert isinstance(ret, bool), self + return ret + + +class CDataExt_Value(CData_Value, CDataExt): + is_padding = False + + def padding(self): + self.is_padding = True + return self + + def freeze(self): + self.padding = None + return super().freeze() + + def set_write_str_v(self, str_v: Callable[[Any], str]): + """Utility wrapper for set_write, writes the value as stringified by str_v.""" + + def write_f( + resource: "CDataResource", + memory_context: "MemoryContext", + v: Any, + wctx: CDataExtWriteContext, + ): + wctx.f.write(wctx.line_prefix) + wctx.f.write(str_v(v)) + return True + + self.set_write(write_f) + return self + + def report(self, resource, memory_context, v): + super().report(resource, memory_context, v) + if self.is_padding: + if v != 0: + raise Exception("non-0 padding") + + def write_default( + self, resource, memory_context, v, f, line_prefix, *, inhibit_top_braces + ): + assert ( + not inhibit_top_braces + ), "CDataExt_Value can't inhibit top braces, it doesn't have any" + if not self.is_padding: + f.write(line_prefix) + f.write(str(v)) + return True + else: + return False + + +CDataExt_Value.s8 = CDataExt_Value("b").freeze() +CDataExt_Value.u8 = CDataExt_Value("B").freeze() +CDataExt_Value.s16 = CDataExt_Value("h").freeze() +CDataExt_Value.u16 = CDataExt_Value("H").freeze() +CDataExt_Value.s32 = CDataExt_Value("i").freeze() +CDataExt_Value.u32 = CDataExt_Value("I").freeze() +CDataExt_Value.f32 = CDataExt_Value("f").freeze() +CDataExt_Value.f64 = CDataExt_Value("d").freeze() +CDataExt_Value.pointer = CDataExt_Value("I").freeze() + +CDataExt_Value.pad8 = CDataExt_Value("b").padding().freeze() +CDataExt_Value.pad16 = CDataExt_Value("h").padding().freeze() +CDataExt_Value.pad32 = CDataExt_Value("i").padding().freeze() + + +INDENT = " " * 4 + + +class CDataExt_Array(CData_Array, CDataExt): + def __init__(self, element_cdata_ext: CDataExt, length: int): + super().__init__(element_cdata_ext, length) + self.element_cdata_ext = element_cdata_ext + + def report(self, resource, memory_context, v): + assert isinstance(v, list) + super().report(resource, memory_context, v) + for elem in v: + self.element_cdata_ext.report(resource, memory_context, elem) + + def write_default( + self, resource, memory_context, v, f, line_prefix, *, inhibit_top_braces + ): + assert isinstance(v, list) + if not inhibit_top_braces: + f.write(line_prefix) + f.write("{\n") + for i, elem in enumerate(v): + ret = self.element_cdata_ext.write( + resource, + memory_context, + elem, + f, + line_prefix + INDENT, + inhibit_top_braces=False, + ) + assert ret + f.write(f", // {i}\n") + if not inhibit_top_braces: + f.write(line_prefix) + f.write("}") + return True + + +class CDataExt_Struct(CData_Struct, CDataExt): + def __init__(self, members: Sequence[tuple[str, CDataExt]]): + super().__init__(members) + self.members_ext = members + + def report(self, resource, memory_context, v): + assert isinstance(v, dict) + super().report(resource, memory_context, v) + for member_name, member_cdata_ext in self.members_ext: + member_cdata_ext.report(resource, memory_context, v[member_name]) + + def write_default( + self, resource, memory_context, v, f, line_prefix, *, inhibit_top_braces + ): + assert isinstance(v, dict) + if not inhibit_top_braces: + f.write(line_prefix) + f.write("{\n") + for member_name, member_cdata_ext in self.members_ext: + if member_cdata_ext.write( + resource, + memory_context, + v[member_name], + f, + line_prefix + INDENT, + inhibit_top_braces=False, + ): + f.write(f", // {member_name}\n") + if not inhibit_top_braces: + f.write(line_prefix) + f.write("}") + return True + + +class CDataResource(Resource): + + # Set by child classes + cdata_ext: CDataExt + + # Resource implementation + + def __init__(self, file: File, range_start: int, name: str): + if not self.can_size_be_unknown: + assert hasattr(self, "cdata_ext"), self.__class__ + assert self.cdata_ext is not None + range_end = range_start + self.cdata_ext.size + else: + if hasattr(self, "cdata_ext") and self.cdata_ext is not None: + range_end = range_start + self.cdata_ext.size + else: + range_end = None + super().__init__(file, range_start, range_end, name) + self._is_cdata_processed = False + + def try_parse_data(self, memory_context: "MemoryContext"): + if self.can_size_be_unknown: + assert hasattr(self, "cdata_ext") and self.cdata_ext is not None, ( + "Subclasses with can_size_be_unknown=True should redefine try_parse_data" + " and call the superclass definition (CDataResource.try_parse_data)" + " only once cdata_ext has been set", + self.__class__, + ) + assert ( + self.range_end is not None + ), "Subclasses with can_size_be_unknown=True should also set range_end once the size is known" + assert hasattr(self, "cdata_ext") + assert self.cdata_ext is not None + + # In case the subclass does more involved processing, the self.is_data_parsed + # bool wouldn't necessarily reflect the state of the cdata. + # Use own bool self._is_cdata_processed to remember if cdata has been unpacked and + # reported already. + if not self._is_cdata_processed: + self.cdata_unpacked = self.cdata_ext.unpack_from( + self.file.data, self.range_start + ) + + self.cdata_ext.report(self, memory_context, self.cdata_unpacked) + + self._is_cdata_processed = True + + return RESOURCE_PARSE_SUCCESS + + def write_extracted(self, memory_context): + with self.extract_to_path.open("w") as f: + self.cdata_ext.write( + self, + memory_context, + self.cdata_unpacked, + f, + "", + inhibit_top_braces=self.braces_in_source, + ) + f.write("\n") + + +class CDataArrayResource(CDataResource): + """Helper for variable-length array resources. + + The length is unknown at object creation, and must be set eventually + with set_length (for example by another resource). + + The length being set then allows this resource to be parsed. + + For static-length array resources, just use CDataResource. + """ + + def __init_subclass__(cls, /, **kwargs): + super().__init_subclass__(can_size_be_unknown=True, **kwargs) + + elem_cdata_ext: CDataExt + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + self._length: Union[None, int] = None + + def set_length(self, length: int): + if self._length is not None: + if self._length != length: + raise Exception( + "length already set and is different", self._length, length + ) + assert length > 0 + self._length = length + + def try_parse_data(self, memory_context: "MemoryContext"): + if self._length is None: + raise ResourceParseWaiting(waiting_for=["self._length"]) + assert isinstance(self.elem_cdata_ext, CDataExt), (self.__class__, self) + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, self._length) + self.range_end = self.range_start + self.cdata_ext.size + return super().try_parse_data(memory_context) + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError + + def get_c_expression_length(self, resource_offset: int): + if resource_offset == 0: + return f"ARRAY_COUNT({self.symbol_name})" + else: + raise ValueError + + +class CDataArrayNamedLengthResource(CDataArrayResource): + """CDataArrayResource and with a macro (define) for its length. + + This is useful for arrays that have a length that should be referenced somewhere, + but cannot due to the order the definitions are in. + + This writes a macro to the .h for the length, along the symbol declaration, + to be used in the declaration base (! by the subclass, in get_c_declaration_base) + """ + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + self.length_name = f"LENGTH_{self.symbol_name}" + + def write_c_declaration(self, h: io.TextIOBase): + h.write(f"#define {self.length_name} {self._length}\n") + super().write_c_declaration(h) + + +cdata_ext_Vec3s = CDataExt_Struct( + ( + ("x", CDataExt_Value.s16), + ("y", CDataExt_Value.s16), + ("z", CDataExt_Value.s16), + ) +).freeze() + + +def write_Vec3s_aligned(resource, memory_context, v, wctx: CDataExtWriteContext): + s = f'{v["x"]:6}, {v["y"]:6}, {v["z"]:6}' + if not wctx.inhibit_top_braces: + s = "{ " + s + " }" + wctx.f.write(wctx.line_prefix) + wctx.f.write(s) + return True + + +cdata_ext_Vec3s_aligned = ( + CDataExt_Struct( + ( + ("x", CDataExt_Value.s16), + ("y", CDataExt_Value.s16), + ("z", CDataExt_Value.s16), + ) + ) + .set_write(write_Vec3s_aligned) + .freeze() +) + + +class Vec3sArrayResource(CDataResource): + + elem_cdata_ext = cdata_ext_Vec3s + + def __init__(self, file: File, range_start: int, name: str, length: int): + assert length > 0 + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, length) + super().__init__(file, range_start, name) + + def get_c_declaration_base(self): + return f"Vec3s {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_c_expression_length(self, resource_offset: int): + if resource_offset == 0: + return f"ARRAY_COUNT({self.symbol_name})" + else: + raise ValueError() + + def get_h_includes(self): + return ("z_math.h",) + + +class S16ArrayResource(CDataResource): + + elem_cdata_ext = CDataExt_Value.s16 + + def __init__(self, file: File, range_start: int, name: str, length: int): + assert length > 0 + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, length) + super().__init__(file, range_start, name) + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON"): + return f"s16 {self.symbol_name}[{self.cdata_ext.size // self.elem_cdata_ext.size}]" + return f"s16 {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_c_expression_length(self, resource_offset: int): + if resource_offset == 0: + return f"ARRAY_COUNT({self.symbol_name})" + else: + raise ValueError() + + def get_h_includes(self): + return ("ultra64.h",) + + +cdata_ext_Vec3f = CDataExt_Struct( + ( + ("x", CDataExt_Value.f32), + ("y", CDataExt_Value.f32), + ("z", CDataExt_Value.f32), + ) +) + + +def fmt_hex_s(v: int, nibbles: int = 0): + """Format v to 0x-prefixed uppercase hexadecimal, using (at least) the specified amount of nibbles. + + Meant for signed values (_s suffix), + adds a space in place of where the - sign would be for positive values. + + Note compared to this, + - f"{v:#X}" would produce an uppercase 0X (1 -> 0X1) + - f"0x{v:X}" doesn't work with negative values (-1 -> 0x-1) + """ + v_str = f"{v:0{nibbles}X}" + if v < 0: + v_str = v_str.removeprefix("-") + return f"-0x{v_str}" + else: + return f" 0x{v_str}" + + +def fmt_hex_u(v: int, nibbles: int = 0): + """Format v to 0x-prefixed uppercase hexadecimal, using (at least) the specified amount of nibbles. + + Meant for unsigned values (_u suffix), + but won't fail for negative values. + + See: fmt_hex_s + """ + v_str = f"{v:0{nibbles}X}" + if v < 0: + # Also handle v being negative just in case, + # it will only mean the output isn't aligned as expected + v_str = v_str.removeprefix("-") + return f"-0x{v_str}" + else: + return f"0x{v_str}" diff --git a/tools/assets/extract/extase/memorymap.py b/tools/assets/extract/extase/memorymap.py new file mode 100644 index 0000000000..0064357bfe --- /dev/null +++ b/tools/assets/extract/extase/memorymap.py @@ -0,0 +1,428 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import abc +from dataclasses import dataclass + +from typing import Callable, TypeVar, Generic + +try: + from rich.pretty import pprint as rich_pprint +except ImportError: + rich_pprint = print + +from . import Resource, File, GetResourceAtResult + + +# when failing to resolve an address, +# (try to) keep going by creating "fake" files/resources +# or defaulting to poor choices (e.g. raw addresses) +BEST_EFFORT = True +if BEST_EFFORT: + VERBOSE_BEST_EFFORT = 1 + VERBOSE_BEST_EFFORT_LVL1_IGNORED_SEGS = { + 1, # billboard matrix segment + 8, # often used for eye/mouth textures, or various dlist callbacks. same for 9-0xC + 9, + 0xA, + 0xB, + 0xC, + 0xD, # matrix buffer for skeletons dlists + } + + +# RangeMap + +RangeMapValueT = TypeVar("RangeMapValueT") + + +class RangeMap(Generic[RangeMapValueT]): + def __init__(self): + self.values_by_range: dict[tuple[int, int], RangeMapValueT] = dict() + + def set(self, range_start: int, range_end: int, value: RangeMapValueT): + assert range_start < range_end + current_values_in_range = self.get_all_in_range(range_start, range_end) + if current_values_in_range: + raise Exception( + "Range already used (at least partially)", + hex(range_start), + hex(range_end), + current_values_in_range, + ) + self.values_by_range[(range_start, range_end)] = value + + def get_all_by_predicate(self, predicate: Callable[[int, int], bool]): + """Return all values associated to a range for which the predicate returns True""" + values: dict[tuple[int, int], RangeMapValueT] = dict() + for (range_start, range_end), value in self.values_by_range.items(): + if predicate(range_start, range_end): + values[(range_start, range_end)] = value + return values + + def get_all_in_range(self, range_start: int, range_end: int): + """Return all values associated to a range intersecting with the given range""" + assert range_start < range_end + + def check_intersect(value_range_start, value_range_end): + assert value_range_start < value_range_end + if range_end <= value_range_start: + return False + if value_range_end <= range_start: + return False + return True + + return self.get_all_by_predicate(check_intersect) + + def get(self, offset) -> RangeMapValueT: + """Return the value associated to the range the given offset is in, + if any, or raise IndexError""" + + def check_belong(value_range_start, value_range_end): + assert value_range_start < value_range_end + return value_range_start <= offset < value_range_end + + values = self.get_all_by_predicate(check_belong) + assert len(values) <= 1, values + if values: + return next(iter(values.values())) + else: + raise IndexError(offset) + + def copy(self): + """Returns a shallow copy""" + other = RangeMap() + other.values_by_range = self.values_by_range.copy() + return other + + +class NoResourceError(Exception): + """There is no resource at the requested address""" + + pass + + +class UnexpectedResourceTypeError(Exception): + """There is a resource at the requested address, but of the wrong type""" + + pass + + +class UnmappedAddressError(Exception): + """Indicates an address could not be resolved because nothing was found for the address.""" + + pass + + +AttributeValueT = TypeVar("AttributeValueT") + + +@dataclass(frozen=True) +class Attribute(Generic[AttributeValueT]): + name: str # Uniquely identifies the attribute + value_type: type[AttributeValueT] + + def __eq__(self, other): + if isinstance(other, Attribute): + return self.name == other.name + else: + return False + + def __hash__(self): + return hash(self.name) + + +class Attributes: + c_reference = Attribute("c_reference", str) + c_expression_length = Attribute("c_expression_length", str) + + +ResourceT = TypeVar("ResourceT", bound="Resource") + + +class AddressResolveResult: + def __init__(self, original_address: int, file: File, file_offset: int): + self.original_address = original_address + """Original address that was resolved to this result (for debugging purposes)""" + + self.file = file + self.file_offset = file_offset + + def get_resource(self, resource_type: type[ResourceT]) -> ResourceT: + result, resource = self.file.get_resource_at(self.file_offset) + if result != GetResourceAtResult.DEFINITIVE: + raise NoResourceError("No definitive resource", result) + assert resource is not None + if resource.range_start != self.file_offset: + raise NoResourceError( + "No resource at (exactly) the requested address", resource + ) + if not isinstance(resource, resource_type): + raise UnexpectedResourceTypeError(resource, resource_type) + return resource + + def get_attribute(self, attribute: Attribute[AttributeValueT]) -> AttributeValueT: + result, resource = self.file.get_resource_at(self.file_offset) + + if result != GetResourceAtResult.DEFINITIVE: + raise Exception("No definitive resource", result) + assert resource is not None + + resource_offset = self.file_offset - resource.range_start + + if attribute == Attributes.c_reference: + value = resource.get_c_reference(resource_offset) + elif attribute == Attributes.c_expression_length: + value = resource.get_c_expression_length(resource_offset) + else: + raise NotImplementedError(attribute) + + if not isinstance(value, attribute.value_type): + raise Exception( + "Resource gave an attribute value of unexpected type", + resource, + attribute, + value, + type(value), + ) + + return value + + def __repr__(self): + return ( + "AddressResolveResult(" + f"original_address=0x{self.original_address:08X}, " + f"file_name={self.file.name!r}, " + f"file_offset=0x{self.file_offset:X})" + ) + + +class AddressResolver(abc.ABC): + @abc.abstractmethod + def resolve( + self, original_address: int, address_offset: int + ) -> AddressResolveResult: ... + + +class MemoryMap: + def __init__(self): + self.direct = RangeMap[AddressResolver]() + self.segments: dict[int, RangeMap[AddressResolver]] = { + segment_num: RangeMap[AddressResolver]() for segment_num in range(1, 16) + } + + def copy(self): + """Returns a copy that is independently mutable + + (only the mappings are copied, the underlying AddressResolver s are the same) + """ + other = MemoryMap() + other.direct = self.direct.copy() + other.segments = { + segment_num: segment_range_map.copy() + for segment_num, segment_range_map in self.segments.items() + } + return other + + +def get_segment_num(address: int): + return (address & 0x0F00_0000) >> 24 + + +@dataclass +class FileDirectAddressResolver(AddressResolver): + direct_file_offset_start: int + target_file: File + + def resolve(self, original_address, address_offset): + file_offset = address_offset - self.direct_file_offset_start + return AddressResolveResult(original_address, self.target_file, file_offset) + + +@dataclass +class FileSegmentAddressResolver(AddressResolver): + target_file: File + + def resolve(self, original_address, address_offset): + file_offset = address_offset + return AddressResolveResult(original_address, self.target_file, file_offset) + + +class MemoryContext: + """ + handles segmented addresses, pointers, external symbols (eg gMtxClear) + + maps offsets to data + """ + + def __init__(self, dmadata_table_rom_file_name_by_vrom): + self.memory_map = MemoryMap() + self.dmadata_table_rom_file_name_by_vrom = dmadata_table_rom_file_name_by_vrom + + def copy(self): + other = MemoryContext(self.dmadata_table_rom_file_name_by_vrom) + other.memory_map = self.memory_map.copy() + return other + + def get_dmadata_table_rom_file_name_from_vrom(self, vromStart, vromEnd): + return self.dmadata_table_rom_file_name_by_vrom[(vromStart, vromEnd)] + + def _direct_address_to_offset(self, address: int): + segment_num = get_segment_num(address) + if segment_num != 0: + raise ValueError("Address is segmented, not direct", hex(address)) + # The 0xF000_0000 bits are ignored. Not 100% correct but simplest + offset = address & 0x00FF_FFFF + return offset + + def set_direct_file(self, address: int, target_file: File): + direct_file_offset_start = self._direct_address_to_offset(address) + direct_file_offset_end = direct_file_offset_start + target_file.size + + self.memory_map.direct.set( + direct_file_offset_start, + direct_file_offset_end, + FileDirectAddressResolver(direct_file_offset_start, target_file), + ) + + def set_segment_file(self, segment_num: int, target_file: File): + if not (1 <= segment_num < 16): + raise ValueError( + "Segment number must be between 1 and 15 (inclusive)", segment_num + ) + + self.memory_map.segments[segment_num].set( + 0, 0x0100_0000, FileSegmentAddressResolver(target_file) + ) + + def resolve_direct(self, address: int): + offset = self._direct_address_to_offset(address) + try: + address_resolver = self.memory_map.direct.get(offset) + except IndexError as e: + raise UnmappedAddressError( + "direct address is not mapped", f"0x{address:08X}" + ) from e + return address_resolver.resolve(address, offset) + + def resolve_segmented(self, address: int): + segment_num = get_segment_num(address) + if segment_num == 0: + return self.resolve_direct(address) + else: + assert address & 0xF000_0000 == 0 + offset = address & 0x00FF_FFFF + try: + address_resolver = self.memory_map.segments[segment_num].get(offset) + except IndexError as e: + raise UnmappedAddressError( + "segment address is not mapped", f"0x{address:08X}" + ) from e + return address_resolver.resolve(address, offset) + + def report_resource_at_segmented( + self, + reporter: Resource, + address: int, + resource_type: type[ResourceT], + new_resource_pointed_to: Callable[[File, int], ResourceT], + ) -> ResourceT: + try: + resolve_result = self.resolve_segmented(address) + except UnmappedAddressError as e: + if BEST_EFFORT: + fake_file = File(f"besteffort_fakefile_{address:08X}", size=0x0100_0000) + fake_resource = new_resource_pointed_to(fake_file, 0) + fake_resource.reporters.add(reporter) + fake_file.add_resource(fake_resource) + if VERBOSE_BEST_EFFORT >= 2 or ( + VERBOSE_BEST_EFFORT >= 1 + and (address >> 24) not in VERBOSE_BEST_EFFORT_LVL1_IGNORED_SEGS + ): + print("BEST_EFFORT: ignored error e=") + rich_pprint(e) + print(" on resource report by reporter=") + rich_pprint(reporter) + print(f" at {address=:#08X}") + print(" and created fake_file=") + rich_pprint(fake_file), + print(" and fake_resource=") + rich_pprint(fake_resource) + fake_file.FAKE_FOR_BEST_EFFORT = True + fake_resource.FAKE_FOR_BEST_EFFORT = True + return fake_resource + raise + try: + resource = resolve_result.get_resource(resource_type) + except NoResourceError: + resource = None + except UnexpectedResourceTypeError: + print("Could not resolve segment address for reporting", resolve_result) + raise + else: + assert resource is not None + if resource is None: + resource = new_resource_pointed_to( + resolve_result.file, + resolve_result.file_offset, + ) + resolve_result.file.add_resource(resource) + resource.reporters.add(reporter) + return resource + + def mark_resource_buffer_at_segmented( + self, + reporter: Resource, + resource_type: type[Resource], + name: str, + address_start: int, + address_end: int, + ): + # Note: this function assumes the whole address_start-address_end range resolves the same way. + # It not being the case would be very weird, but it's not checked here + try: + resolve_result = self.resolve_segmented(address_start) + except UnmappedAddressError as e: + if BEST_EFFORT: + if VERBOSE_BEST_EFFORT >= 2 or ( + VERBOSE_BEST_EFFORT >= 1 + and (address_start >> 24) + not in VERBOSE_BEST_EFFORT_LVL1_IGNORED_SEGS + ): + print("BEST_EFFORT: ignored error e=") + rich_pprint(e) + print(" and skipping marking resource buffer for reporter=") + rich_pprint(reporter) + print( + f" {resource_type=} {address_start=:#08X} {address_end=:#08X}" + ) + return + raise + file_start = resolve_result.file_offset + file_end = file_start + address_end - address_start + resolve_result.file.mark_resource_buffer( + reporter, resource_type, name, file_start, file_end + ) + + def get_attribute_at_segmented( + self, address: int, attribute: Attribute[AttributeValueT] + ): + return self.resolve_segmented(address).get_attribute(attribute) + + def get_c_reference_at_segmented(self, address: int): + try: + return self.get_attribute_at_segmented(address, Attributes.c_reference) + except UnmappedAddressError as e: + if BEST_EFFORT: + if VERBOSE_BEST_EFFORT >= 2 or ( + VERBOSE_BEST_EFFORT >= 1 + and (address >> 24) not in VERBOSE_BEST_EFFORT_LVL1_IGNORED_SEGS + ): + print("BEST_EFFORT: ignored error e="), + rich_pprint(e) + print(f" and returning raw address=0x{address:08X}") + return f"0x{address:08X}" + raise + + def get_c_expression_length_at_segmented(self, address: int): + return self.get_attribute_at_segmented(address, Attributes.c_expression_length) diff --git a/tools/assets/extract/extase/repr_c_struct.py b/tools/assets/extract/extase/repr_c_struct.py new file mode 100644 index 0000000000..3548ede370 --- /dev/null +++ b/tools/assets/extract/extase/repr_c_struct.py @@ -0,0 +1,223 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import struct +import abc +from typing import Sequence, Any + + +# NOTE: this system does NOT handle struct alignment/padding automatically, it should be made explicit + +# this system voluntarily does not handle variable length arrays. which is not a valid "type" in C anyway (?) +# having variable-sized data is too messy to handle, because it needs a size at some point anyway +# This choice allows the root CData ABC to have a size as a guaranteed attribute + + +# BOSA = "Byte Order, Size, and Alignment" for the struct module +# Big Endian +STRUCT_BOSA_CHAR = ">" + + +class CData(abc.ABC): + @abc.abstractmethod + def __init__(self, size: int): + self.size = size + + # Unpack + + @abc.abstractmethod + def unpack_from(self, data: memoryview, offset: int = 0) -> Any: ... + + +class CData_Value(CData): + def __init__(self, format_char: str): + assert format_char in set("bBhHiIfd") + self.unpack_struct = struct.Struct(STRUCT_BOSA_CHAR + format_char) + super().__init__(self.unpack_struct.size) + + def unpack_from(self, data: memoryview, offset: int = 0): + return self.unpack_struct.unpack_from(data, offset)[0] + + +CData_Value.s8 = CData_Value("b") +CData_Value.u8 = CData_Value("B") +CData_Value.s16 = CData_Value("h") +CData_Value.u16 = CData_Value("H") +CData_Value.s32 = CData_Value("i") +CData_Value.u32 = CData_Value("I") +CData_Value.f32 = CData_Value("f") +CData_Value.f64 = CData_Value("d") +CData_Value.pointer = CData_Value("I") + + +class CData_Array(CData): + def __init__(self, element_cdata: CData, length: int): + assert length > 0 + self.element_cdata = element_cdata + self.length = length + super().__init__(element_cdata.size * length) + + def unpack_from(self, data: memoryview, offset: int = 0): + array_unpacked = [] + + for i in range(self.length): + unpacked = self.element_cdata.unpack_from(data, offset) + array_unpacked.append(unpacked) + offset += self.element_cdata.size + + assert len(array_unpacked) == self.length + + return array_unpacked + + +class CData_Struct(CData): + def __init__(self, members: Sequence[tuple[str, CData]]): + # assert all members have different names + assert len(members) == len( + set(member_name for member_name, member_cdata in members) + ), members + + self.members = members + super().__init__( + sum(member_cdata.size for member_name, member_cdata in members) + ) + + if __debug__: + # Check alignment + + # This may mess up with CData instances other than CData_Value, Array and Struct + def get_required_alignment(cdata: CData): + if isinstance(cdata, CData_Struct): + return max( + get_required_alignment(cdata_member_cdata) + for cdata_member_name, cdata_member_cdata in cdata.members + ) + elif isinstance(cdata, CData_Array): + return get_required_alignment(cdata.element_cdata) + else: + # Assume the alignment requirement corresponds to the size + # (e.g. this is correct for CData_Value) + return cdata.size + + # Check alignment of the members of the struct + offset = 0 + for member_name, member_cdata in members: + alignment = get_required_alignment(member_cdata) + assert offset % alignment == 0, (member_name, offset, alignment) + offset += member_cdata.size + + # Check alignment of the struct size + alignment = get_required_alignment(self) + assert self.size % alignment == 0, (self.size, alignment) + + def unpack_from(self, data: memoryview, offset: int = 0): + struct_unpacked = dict() + + for member_name, member_cdata in self.members: + member_unpacked = member_cdata.unpack_from(data, offset) + struct_unpacked[member_name] = member_unpacked + offset += member_cdata.size + + return struct_unpacked + + +def try_stuff(): + """ + struct { + s8 fun; + // u8 pad; + s16 games; + } array[] = { { 1, 2 }, { 3, 4 } }; + + + u8 varLenArray[] = { 1, 2, 3 }; + + struct { + u8* ptr; + u16 len; + struct { + s32 secret1; + u32 secret2; + } mySubStruct; + } data = { varLenArray, 3, { 421, 0x01020304 } }; + """ + + array_bytes = bytes( + [ + 1, + 0, + *(0, 2), + 3, + 0, + *(0, 4), + ] + ) + varLenArray_bytes = bytes([1, 2, 3]) + data_bytes = bytes( + [ + *(0x12, 0x34, 0x56, 0x78), + *(0, 3), + 0, + 0, + *(0, 0, 421 >> 8, 421 & 0xFF), + *(1, 2, 3, 4), + ] + ) + + arrayElem_CData_Struct = CData_Struct( + ( + ("fun", CData_Value.s8), + ("pad1", CData_Value.s8), + ("games", CData_Value.s16), + ) + ) + array_CData_Array = CData_Array(arrayElem_CData_Struct, 2) + + print(array_CData_Array.unpack_from(array_bytes)) + + mySubStruct_CData_Struct = CData_Struct( + ( + ("secret1", CData_Value.s32), + ("secret2", CData_Value.u32), + ) + ) + + data_CData_Struct = CData_Struct( + ( + ("ptr", CData_Value.pointer), + ("len", CData_Value.u16), + ("pad_6", CData_Value.s16), + ("mySubStruct", mySubStruct_CData_Struct), + ) + ) + + data_unpacked = data_CData_Struct.unpack_from(data_bytes) + print(data_unpacked) + + varLenArray_CData_Array = CData_Array(CData_Value.u8, data_unpacked["len"]) + + print(varLenArray_CData_Array.unpack_from(varLenArray_bytes)) + + data_integratedSubStruct_CData_Struct = CData_Struct( + ( + ("ptr", CData_Value.pointer), + ("len", CData_Value.u16), + ("pad_6", CData_Value.s16), + ( + "mySubStruct", + CData_Struct( + ( + ("secret1", CData_Value.s32), + ("secret2", CData_Value.u32), + ) + ), + ), + ) + ) + + data_unpacked = data_integratedSubStruct_CData_Struct.unpack_from(data_bytes) + print(data_unpacked) + + +if __name__ == "__main__": + try_stuff() diff --git a/tools/assets/extract/extase_oot64/animation_resources.py b/tools/assets/extract/extase_oot64/animation_resources.py new file mode 100644 index 0000000000..7a54f00c85 --- /dev/null +++ b/tools/assets/extract/extase_oot64/animation_resources.py @@ -0,0 +1,213 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase import ( + RESOURCE_PARSE_SUCCESS, + ResourceParseWaiting, + File, +) +from ..extase.cdata_resources import ( + CDataResource, + CDataExt_Value, + CDataExt_Struct, + CDataExt_Array, + CDataExtWriteContext, +) + + +class AnimationFrameDataResource(CDataResource, can_size_be_unknown=True): + def write_binang(resource, memory_context, v, wctx: CDataExtWriteContext): + wctx.f.write(wctx.line_prefix) + wctx.f.write(f" 0x{v:04X}" if v >= 0 else "-0x" + f"{v:04X}".removeprefix("-")) + return True + + elem_cdata_ext = CDataExt_Value("h").set_write(write_binang) + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + self.length = None + + def try_parse_data(self, memory_context): + if self.length is not None: + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, self.length) + self.range_end = self.range_start + self.cdata_ext.size + return super().try_parse_data(memory_context) + else: + raise ResourceParseWaiting(waiting_for=["self.length"]) + + def get_c_declaration_base(self): + return f"s16 {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_h_includes(self): + return ("ultra64.h",) + + +class AnimationJointIndicesResource(CDataResource, can_size_be_unknown=True): + elem_cdata_ext = CDataExt_Struct( + ( + ("x", CDataExt_Value.u16), + ("y", CDataExt_Value.u16), + ("z", CDataExt_Value.u16), + ) + ) + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + self.length = None + + def try_parse_data(self, memory_context): + if self.length is not None: + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, self.length) + self.range_end = self.range_start + self.cdata_ext.size + return super().try_parse_data(memory_context) + else: + raise ResourceParseWaiting(waiting_for=["self.length"]) + + def get_c_declaration_base(self): + return f"JointIndex {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_h_includes(self): + return ("animation.h",) + + +class AnimationResource(CDataResource): + def write_frameData( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def write_jointIndices( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ( + "common", + CDataExt_Struct((("frameCount", CDataExt_Value.s16),)), + ), + ("pad2", CDataExt_Value.pad16), + ( + "frameData", + CDataExt_Value("I").set_write(write_frameData), + ), + ( + "jointIndices", + CDataExt_Value("I").set_write(write_jointIndices), + ), + ("staticIndexMax", CDataExt_Value.u16), + ("padE", CDataExt_Value.pad16), + ) + ) + + def try_parse_data(self, memory_context): + super().try_parse_data(memory_context) + + frameData_address = self.cdata_unpacked["frameData"] + assert isinstance(frameData_address, int) + resource_frameData = memory_context.report_resource_at_segmented( + self, + frameData_address, + AnimationFrameDataResource, + lambda file, offset: AnimationFrameDataResource( + file, + offset, + ( + f"{self.name.removesuffix('Anim')}FrameData" + if self.name.endswith("Anim") + else f"{self.name}_{frameData_address:08X}_FrameData" + ), + ), + ) + + jointIndices_address = self.cdata_unpacked["jointIndices"] + assert isinstance(jointIndices_address, int) + resource_jointIndices = memory_context.report_resource_at_segmented( + self, + jointIndices_address, + AnimationJointIndicesResource, + lambda file, offset: AnimationJointIndicesResource( + file, + offset, + ( + f"{self.name.removesuffix('Anim')}JointIndices" + if self.name.endswith("Anim") + else f"{self.name}_{jointIndices_address:08X}_JointIndices" + ), + ), + ) + + # The length of the frameData and jointIndices arrays is + # for now assumed to fill the space to the animation, + # at the very least before subtracting the offsets check that + # the offsets belong to the same file + # TODO better idea for computing this data's size + + if not (resource_frameData.file == resource_jointIndices.file == self.file): + raise NotImplementedError( + "Expected frameData and jointIndices to be in the same file as the animation", + self.cdata_unpacked, + resource_frameData.file, + resource_jointIndices.file, + self.file, + ) + + if ( + resource_frameData.range_start + < resource_jointIndices.range_start + < self.range_start + ): + resource_frameData.length = ( + resource_jointIndices.range_start - resource_frameData.range_start + ) // AnimationFrameDataResource.elem_cdata_ext.size + resource_jointIndices.length = ( + self.range_start - resource_jointIndices.range_start + ) // AnimationJointIndicesResource.elem_cdata_ext.size + else: + raise NotImplementedError( + "Expected offsets of frameData, jointIndices, animation to be in order", + self.cdata_unpacked, + hex(resource_frameData.range_start), + hex(resource_jointIndices.range_start), + hex(self.range_start), + ) + + return RESOURCE_PARSE_SUCCESS + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_c_declaration_base(self): + return f"AnimationHeader {self.symbol_name}" + + def get_h_includes(self): + return ("animation.h",) diff --git a/tools/assets/extract/extase_oot64/collision_resources.py b/tools/assets/extract/extase_oot64/collision_resources.py new file mode 100644 index 0000000000..d8005ba446 --- /dev/null +++ b/tools/assets/extract/extase_oot64/collision_resources.py @@ -0,0 +1,832 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import TYPE_CHECKING, Optional + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase import ( + File, + RESOURCE_PARSE_SUCCESS, + ResourceParseInProgress, + ResourceParseWaiting, +) +from ..extase.cdata_resources import ( + CDataResource, + CDataExt_Struct, + CDataExt_Array, + CDataExt_Value, + CDataExtWriteContext, + cdata_ext_Vec3s, + cdata_ext_Vec3s_aligned, + INDENT, + fmt_hex_u, +) + +from .. import oot64_data + +# TODO would be better for array resources to be of unknown size at instanciation +# and have their size set later, like LimbsArrayResource, +# which allows declaring them with offsets in xmls and have the data parsing +# fill in the length for both cases of it instantiating the array, +# and it being instantiated much earlier from the xml + + +class CollisionVtxListResource(CDataResource): + cdata_ext_elem = cdata_ext_Vec3s_aligned + + def __init__(self, file: File, range_start: int, name: str, length: int): + self.cdata_ext = CDataExt_Array(self.cdata_ext_elem, length) + super().__init__(file, range_start, name) + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON"): + return f"Vec3s {self.symbol_name}[{self.cdata_ext.length}]" + return f"Vec3s {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_c_expression_length(self, resource_offset: int): + if resource_offset == 0: + return f"ARRAY_COUNT({self.symbol_name})" + else: + raise ValueError() + + def get_h_includes(self): + return ("z_math.h",) + + +class CollisionPolyListResource(CDataResource): + def write_vtxData( + resource: "CollisionPolyListResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, list) + assert len(v) == 3 + vtxData = v + f = wctx.f + f.write(wctx.line_prefix) + f.write("{\n") + for i in range(3): + vI = vtxData[i] + vtxId = vI & 0x1FFF + flags = (vI & 0xE000) >> 13 + flags_str_list = [] + if i == 0: + if flags & 1: + flags &= ~1 + flags_str_list.append("COLPOLY_IGNORE_CAMERA") + if flags & 2: + flags &= ~2 + flags_str_list.append("COLPOLY_IGNORE_ENTITY") + if flags & 4: + flags &= ~4 + flags_str_list.append("COLPOLY_IGNORE_PROJECTILES") + elif i == 1: + if flags & 1: + flags &= ~1 + flags_str_list.append("COLPOLY_IS_FLOOR_CONVEYOR") + if flags != 0: + flags_str_list.append(f"0x{flags:X}") + if flags_str_list: + flags_str = " | ".join(flags_str_list) + else: + flags_str = "0" + f.write(wctx.line_prefix) + f.write(INDENT) + f.write(f"COLPOLY_VTX({vtxId}, {flags_str}), // {i}\n") + f.write(wctx.line_prefix) + f.write("}") + return True + + def write_normal_component( + resource: "CollisionPolyListResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, int) + nf = v / 0x7FFF + + if int(round(nf, 5) * 0x7FFF) != v: + if v < 0: + nf -= 0.000_01 + elif v > 0: + nf += 0.000_01 + + ns = f"{nf:.5f}" + while ns[-1] == "0" and ns[-2] != ".": + ns = ns[:-1] + + wctx.f.write(wctx.line_prefix) + wctx.f.write(f"COLPOLY_SNORMAL({ns})") + + return True + + normal_component = CDataExt_Value("h").set_write(write_normal_component) + cdata_ext_elem = CDataExt_Struct( + ( + ("type", CDataExt_Value.u16), + ("vtxData", CDataExt_Array(CDataExt_Value.u16, 3).set_write(write_vtxData)), + ( + "normal", + CDataExt_Struct( + ( + ("x", normal_component), + ("y", normal_component), + ("z", normal_component), + ) + ), + ), + ("dist", CDataExt_Value.s16), + ) + ) + + def __init__(self, file: File, range_start: int, name: str, length: int): + self.cdata_ext = CDataExt_Array(self.cdata_ext_elem, length) + super().__init__(file, range_start, name) + + def try_parse_data(self, memory_context): + super().try_parse_data(memory_context) + self.max_surface_type_index = max(elem["type"] for elem in self.cdata_unpacked) + assert isinstance(self.max_surface_type_index, int) + return RESOURCE_PARSE_SUCCESS + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON"): + return f"CollisionPoly {self.symbol_name}[{self.cdata_ext.length}]" + return f"CollisionPoly {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_c_expression_length(self, resource_offset: int): + if resource_offset == 0: + return f"ARRAY_COUNT({self.symbol_name})" + else: + raise ValueError() + + def get_h_includes(self): + return ("bgcheck.h",) + + +class CollisionSurfaceTypeListResource(CDataResource): + def write_data( + resource: "CollisionSurfaceTypeListResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, list) + assert len(v) == 2 + f = wctx.f + + f.write(wctx.line_prefix) + f.write("{\n") + + for i_data, bitfield_info in ( + ( + 0, + ( + (0x000000FF, 0, "bgCamIndex", int), + (0x00001F00, 8, "exitIndex", int), + (0x0003E000, 13, "floorType", oot64_data.misc_ids.FLOOR_TYPES), + (0x001C0000, 18, "unk18", int), + (0x03E00000, 21, "wallType", oot64_data.misc_ids.WALL_TYPES), + ( + 0x3C000000, + 26, + "floorProperty", + oot64_data.misc_ids.FLOOR_PROPERTIES, + ), + (0x40000000, 30, "isSoft", bool), + (0x80000000, 31, "isHorseBlocked", bool), + ), + ), + ( + 1, + ( + (0x0000000F, 0, "material", oot64_data.misc_ids.SURFACE_MATERIALS), + (0x00000030, 4, "floorEffect", oot64_data.misc_ids.FLOOR_EFFECTS), + (0x000007C0, 6, "lightSetting", int), + (0x0001F800, 11, "echo", int), + (0x00020000, 17, "canHookshot", bool), + ( + 0x001C0000, + 18, + "conveyorSpeed", + oot64_data.misc_ids.CONVEYOR_SPEEDS, + ), + ( + 0x07E00000, + 21, + "conveyorDirection", + lambda val: f"CONVEYOR_DIRECTION_FROM_BINANG({fmt_hex_u(val * (0x10000 // 64))})", + ), + (0x08000000, 27, "unk27", bool), + ), + ), + ): + + data_val = v[i_data] + + f.write(wctx.line_prefix) + f.write(INDENT) + f.write(f"SURFACETYPE{i_data}(\n") + + lines = [] + for mask, shift, name, fmt_info in bitfield_info: + val = (data_val & mask) >> shift + + if fmt_info == int: + lines.append(f"/* {name} */ {val}") + elif fmt_info == bool: + assert val in {0, 1} + lines.append(f"/* {name} */ {'true' if val else 'false'}") + elif isinstance(fmt_info, dict): + lines.append(fmt_info[val]) + elif callable(fmt_info): + lines.append(fmt_info(val)) + else: + lines.append(f"/* {name} */ {val}") + + f.write(",\n".join(f"{wctx.line_prefix}{INDENT * 2}{_l}" for _l in lines)) + + f.write("\n") + f.write(wctx.line_prefix) + f.write(INDENT) + f.write("),\n") + + f.write(wctx.line_prefix) + f.write("}") + + return True + + cdata_ext_elem = CDataExt_Struct( + (("data", CDataExt_Array(CDataExt_Value.u32, 2).set_write(write_data)),) + ) + + def __init__(self, file: File, range_start: int, name: str, length: int): + self.cdata_ext = CDataExt_Array(self.cdata_ext_elem, length) + super().__init__(file, range_start, name) + + def try_parse_data(self, memory_context): + super().try_parse_data(memory_context) + self.max_bgCamIndex = max( + elem["data"][0] & 0xFF for elem in self.cdata_unpacked + ) + self.max_exitIndex = max( + (elem["data"][0] & 0x00001F00) >> 8 for elem in self.cdata_unpacked + ) + return RESOURCE_PARSE_SUCCESS + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON"): + return f"SurfaceType {self.symbol_name}[{self.cdata_ext.length}]" + return f"SurfaceType {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_c_includes(self): + return ("stdbool.h",) + + def get_h_includes(self): + return ("bgcheck.h",) + + +class BgCamFuncDataResource(CDataResource): + element_cdata_ext = cdata_ext_Vec3s + + def __init__(self, file: File, range_start: int, range_end: int, name: str): + count = (range_end - range_start) // self.element_cdata_ext.size + self.cdata_ext = CDataExt_Array(self.element_cdata_ext, count) + super().__init__(file, range_start, name) + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON"): + return f"Vec3s {self.symbol_name}[{self.cdata_ext.length}]" + return f"Vec3s {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset % self.element_cdata_ext.size != 0: + raise ValueError( + "unaligned offset into Vec3s array (BgCamFuncData)", + hex(resource_offset), + self.element_cdata_ext.size, + ) + index = resource_offset // self.element_cdata_ext.size + return f"&{self.symbol_name}[{index}]" + + def get_h_includes(self): + return ("z_math.h",) + + +class CollisionBgCamListResource(CDataResource): + def write_bgCamFuncData( + resource: "CollisionSurfaceTypeListResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + if address != 0: + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + else: + wctx.f.write("NULL") + return True + + cdata_ext_elem = CDataExt_Struct( + ( + ( + "setting", + CDataExt_Value("H").set_write_str_v( + lambda v: oot64_data.get_camera_setting_type_name(v) + ), + ), + ("count", CDataExt_Value.s16), + ( + "bgCamFuncData", + CDataExt_Value("I").set_write(write_bgCamFuncData), + ), # Vec3s* + ) + ) + + def __init__(self, file: File, range_start: int, name: str, length: int): + self.cdata_ext = CDataExt_Array(self.cdata_ext_elem, length) + super().__init__(file, range_start, name) + + def try_parse_data(self, memory_context): + super().try_parse_data(memory_context) + # Note: operating directly on the segmented addresses here, + # so assuming from the start all bgCamFuncData use the same segment + bgCamFuncData_buffer_start = None + bgCamFuncData_buffer_end = None + for bgCamInfo in self.cdata_unpacked: + count = bgCamInfo["count"] + assert isinstance(count, int) + bgCamFuncData = bgCamInfo["bgCamFuncData"] + assert isinstance(bgCamFuncData, int) + + if bgCamFuncData == 0: + continue + + if bgCamFuncData_buffer_start is None: + bgCamFuncData_buffer_start = bgCamFuncData + bgCamFuncData_buffer_end = ( + bgCamFuncData + count * BgCamFuncDataResource.element_cdata_ext.size + ) + continue + + assert bgCamFuncData_buffer_start is not None + assert bgCamFuncData_buffer_end is not None + if bgCamFuncData != bgCamFuncData_buffer_end: + raise NotImplementedError( + "bgCamFuncData buffer not used in the same order as its elements" + ) + bgCamFuncData_buffer_end += ( + count * BgCamFuncDataResource.element_cdata_ext.size + ) + if bgCamFuncData_buffer_start is not None: + assert bgCamFuncData_buffer_end is not None + memory_context.report_resource_at_segmented( + self, + bgCamFuncData_buffer_start, + BgCamFuncDataResource, + lambda file, offset: BgCamFuncDataResource( + file, + offset, + offset + bgCamFuncData_buffer_end - bgCamFuncData_buffer_start, + f"{self.name}_{bgCamFuncData_buffer_start:08X}_BgCamFuncData", + ), + ) + return RESOURCE_PARSE_SUCCESS + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON"): + return f"BgCamInfo {self.symbol_name}[{self.cdata_ext.length}]" + return f"BgCamInfo {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_c_includes(self): + return ("camera.h",) + + def get_h_includes(self): + return ("bgcheck.h",) + + +class CollisionWaterBoxesResource(CDataResource): + + def write_properties(v): + bgCamIndex = (v >> 0) & 0xFF + lightIndex = (v >> 8) & 0x1F + room = (v >> 13) & 0x3F + setFlag19 = (v >> 19) & 1 + return f"WATERBOX_PROPERTIES(/* bgCamIndex */ {bgCamIndex}, /* lightIndex */ {lightIndex}, /* room */ {room}, /* setFlag19 */ {'true' if setFlag19 else 'false'})" + + elem_cdata_ext = CDataExt_Struct( + ( + ("xMin", CDataExt_Value.s16), + ("ySurface", CDataExt_Value.s16), + ("zMin", CDataExt_Value.s16), + ("xLength", CDataExt_Value.s16), + ("zLength", CDataExt_Value.s16), + ("pad12", CDataExt_Value.pad16), + ("properties", CDataExt_Value("I").set_write_str_v(write_properties)), + ) + ) + + def __init__(self, file: File, range_start: int, name: str, length: int): + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, length) + super().__init__(file, range_start, name) + + def get_c_declaration_base(self): + return f"WaterBox {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError + + def get_c_expression_length(self, resource_offset: int): + if resource_offset == 0: + return f"ARRAY_COUNT({self.symbol_name})" + else: + raise ValueError + + def get_c_includes(self): + return ("stdbool.h",) + + def get_h_includes(self): + return ("bgcheck.h",) + + +def transfer_HACK_IS_STATIC_ON(source, dest): + if hasattr(source, "HACK_IS_STATIC_ON"): + dest.HACK_IS_STATIC_ON = source.HACK_IS_STATIC_ON + return dest + + +class CollisionResource(CDataResource): + def write_numVertices( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + wctx.f.write(wctx.line_prefix) + wctx.f.write( + memory_context.get_c_expression_length_at_segmented( + resource.cdata_unpacked["vtxList"] + ) + ) + return True + + def report_vtxList( + resource: "CollisionResource", memory_context: "MemoryContext", v + ): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + CollisionVtxListResource, + lambda file, offset: transfer_HACK_IS_STATIC_ON( + resource, + CollisionVtxListResource( + file, + offset, + ( + f"{resource.name.removesuffix('Col')}VtxList" + if resource.name.endswith("Col") + else f"{resource.name}_{address:08X}_VtxList" + ), + resource.cdata_unpacked["numVertices"], + ), + ), + ) + + def write_vtxList( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(v)) + return True + + def write_numPolygons( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + wctx.f.write(wctx.line_prefix) + wctx.f.write( + memory_context.get_c_expression_length_at_segmented( + resource.cdata_unpacked["polyList"] + ) + ) + return True + + def report_polyList( + resource: "CollisionResource", memory_context: "MemoryContext", v + ): + assert isinstance(v, int) + address = v + resource.resource_polyList = memory_context.report_resource_at_segmented( + resource, + address, + CollisionPolyListResource, + lambda file, offset: transfer_HACK_IS_STATIC_ON( + resource, + CollisionPolyListResource( + file, + offset, + ( + f"{resource.name.removesuffix('Col')}PolyList" + if resource.name.endswith("Col") + else f"{resource.name}_{address:08X}_PolyList" + ), + resource.cdata_unpacked["numPolygons"], + ), + ), + ) + + def write_polyList( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def write_numWaterBoxes( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + wctx.f.write(wctx.line_prefix) + length = resource.cdata_unpacked["numWaterBoxes"] + if length != 0: + wctx.f.write( + memory_context.get_c_expression_length_at_segmented( + resource.cdata_unpacked["waterBoxes"] + ) + ) + else: + wctx.f.write("0") + return True + + def report_waterBoxes( + resource: "CollisionResource", memory_context: "MemoryContext", v + ): + assert isinstance(v, int) + address = v + length = resource.cdata_unpacked["numWaterBoxes"] + if length != 0: + assert address != 0, address # should not be NULL + memory_context.report_resource_at_segmented( + resource, + address, + CollisionWaterBoxesResource, + lambda file, offset: transfer_HACK_IS_STATIC_ON( + resource, + CollisionWaterBoxesResource( + file, + offset, + ( + f"{resource.name.removesuffix('Col')}WaterBoxes" + if resource.name.endswith("Col") + else f"{resource.name}_{address:08X}_WaterBoxes" + ), + length, + ), + ), + ) + + def write_surfaceTypeList( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(v)) + return True + + def write_bgCamList( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(v)) + return True + + def write_waterBoxes( + resource: "CollisionResource", + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, + ): + assert isinstance(v, int) + length = resource.cdata_unpacked["numWaterBoxes"] + f = wctx.f + f.write(wctx.line_prefix) + if length != 0: + f.write(memory_context.get_c_reference_at_segmented(v)) + else: + if v == 0: + f.write("NULL") + else: + f.write(f"0x{v:08X}") + return True + + cdata_ext = CDataExt_Struct( + ( + ("minBounds", cdata_ext_Vec3s), + ("maxBounds", cdata_ext_Vec3s), + ("numVertices", CDataExt_Value("H").set_write(write_numVertices)), + ("pad14", CDataExt_Value.pad16), + ( + "vtxList", + CDataExt_Value("I").set_report(report_vtxList).set_write(write_vtxList), + ), # Vec3s* + ("numPolygons", CDataExt_Value("H").set_write(write_numPolygons)), + ("pad22", CDataExt_Value.pad16), + ( + "polyList", + CDataExt_Value("I") + .set_report(report_polyList) + .set_write(write_polyList), + ), # CollisionPoly* + ( + "surfaceTypeList", + CDataExt_Value("I").set_write(write_surfaceTypeList), + ), # SurfaceType* + ("bgCamList", CDataExt_Value("I").set_write(write_bgCamList)), # BgCamInfo* + ("numWaterBoxes", CDataExt_Value("H").set_write(write_numWaterBoxes)), + ("pad38", CDataExt_Value.pad16), + ( + "waterBoxes", + CDataExt_Value("I") + .set_report(report_waterBoxes) + .set_write(write_waterBoxes), + ), # WaterBox* + ) + ) + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + + self.length_exitList: Optional[int] = None + + self.resource_polyList: Optional[CollisionPolyListResource] = None + self.resource_surfaceTypeList: Optional[CollisionSurfaceTypeListResource] = None + self.resource_bgCamList: Optional[CollisionBgCamListResource] = None + + def try_parse_data(self, memory_context): + super().try_parse_data(memory_context) + + assert self.resource_polyList is not None + + new_progress_done = [] + waiting_for = [] + + # If the CollisionPolyListResource is parsed + if self.resource_polyList.is_data_parsed: + # report surfaceTypeList based on its length guessed from polyList data + length_surfaceTypeList = self.resource_polyList.max_surface_type_index + 1 + surfaceTypeList_address = self.cdata_unpacked["surfaceTypeList"] + assert isinstance(surfaceTypeList_address, int) + self.resource_surfaceTypeList = memory_context.report_resource_at_segmented( + self, + surfaceTypeList_address, + CollisionSurfaceTypeListResource, + lambda file, offset: transfer_HACK_IS_STATIC_ON( + self, + CollisionSurfaceTypeListResource( + file, + offset, + ( + f"{self.name.removesuffix('Col')}SurfaceTypes" + if self.name.endswith("Col") + else f"{self.name}_{surfaceTypeList_address:08X}_SurfaceTypes" + ), + length_surfaceTypeList, # TODO change CollisionSurfaceTypeListResource to a CDataArrayResource (same with more resources) + ), + ), + ) + + new_progress_done.append("reported CollisionSurfaceTypeListResource") + else: + waiting_for.append( + ( + "waiting for CollisionPolyListResource" + " to be parsed to report CollisionSurfaceTypeListResource", + self.resource_polyList, + ) + ) + + if self.resource_surfaceTypeList is not None: + # If the CollisionSurfaceTypeListResource is parsed + if self.resource_surfaceTypeList.is_data_parsed: + # report bgCamList based on its length guessed from surfaceTypeList data + length_bgCamList = self.resource_surfaceTypeList.max_bgCamIndex + 1 + bgCamList_address = self.cdata_unpacked["bgCamList"] + assert isinstance(bgCamList_address, int) + self.resource_bgCamList = memory_context.report_resource_at_segmented( + self, + bgCamList_address, + CollisionBgCamListResource, + lambda file, offset: transfer_HACK_IS_STATIC_ON( + self, + CollisionBgCamListResource( + file, + offset, + ( + f"{self.name.removesuffix('Col')}BgCamList" + if self.name.endswith("Col") + else f"{self.name}_{bgCamList_address:08X}_BgCamList" + ), + length_bgCamList, + ), + ), + ) + + # exitIndex is 1-indexed, so e.g. if the max is 1 the list is of length 1. + self.length_exitList = self.resource_surfaceTypeList.max_exitIndex + + new_progress_done.append("reported CollisionBgCamListResource") + else: + waiting_for.append( + ( + "waiting for CollisionSurfaceTypeListResource" + " to be parsed to report CollisionBgCamListResource", + self.resource_surfaceTypeList, + ) + ) + else: + waiting_for.append("self.resource_surfaceTypeList") + + if waiting_for: + if new_progress_done: + raise ResourceParseInProgress( + new_progress_done=new_progress_done, waiting_for=waiting_for + ) + else: + raise ResourceParseWaiting(waiting_for=waiting_for) + + assert ( + self.resource_surfaceTypeList is not None + and self.resource_bgCamList is not None + and self.length_exitList is not None + ) + return RESOURCE_PARSE_SUCCESS + + def get_c_declaration_base(self): + return f"CollisionHeader {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("bgcheck.h",) diff --git a/tools/assets/extract/extase_oot64/dlist_resources.py b/tools/assets/extract/extase_oot64/dlist_resources.py new file mode 100644 index 0000000000..f80a2f9954 --- /dev/null +++ b/tools/assets/extract/extase_oot64/dlist_resources.py @@ -0,0 +1,1612 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import enum +import io +from pathlib import Path +import reprlib + +from typing import TYPE_CHECKING, Union, Optional, Callable + +try: + from rich.pretty import pprint as rich_pprint +except ImportError: + rich_pprint = print + +import pygfxd + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext +from ..extase.memorymap import UnmappedAddressError, UnexpectedResourceTypeError + +from ..extase import ( + RESOURCE_PARSE_SUCCESS, + ResourceParseWaiting, + Resource, + File, +) +from ..extase.cdata_resources import ( + CDataResource, + CDataExt_Array, + CDataExt_Struct, + CDataExt_Value, + CDataExtWriteContext, + INDENT, + fmt_hex_s, + fmt_hex_u, +) + + +BEST_EFFORT = True + +VERBOSE_ColorIndexedTexturesManager = False +VERBOSE_BEST_EFFORT_TLUT_NO_REAL_USER = True + +EXPLICIT_DL_AND_TEX_SIZES = True +TEXS_SHORTER_NAMES = True + + +class MtxResource(CDataResource): + braces_in_source = False + + def write_mtx(resource, memory_context, v, wctx: CDataExtWriteContext): + assert isinstance(v, dict) + assert v.keys() == {"intPart", "fracPart"} + intPart = v["intPart"] + fracPart = v["fracPart"] + + f = wctx.f + f.write(wctx.line_prefix) + f.write("gdSPDefMtx(\n") + + for i in range(4): + if i != 0: + f.write(",\n") + f.write(wctx.line_prefix + INDENT) + + for j in range(4): + # #define IPART(x) (((s32)((x) * 0x10000) >> 16) & 0xFFFF) + xi = intPart[j][i] + # #define FPART(x) ((s32)((x) * 0x10000) & 0xFFFF) + xf = fracPart[j][i] + # Reconstruct the `(s32)((x) * 0x10000)` but as a u32 + # (u32 since intPart and fracPart are u16 arrays) + # This works since `(s32)((x) * 0x10000)` in the IPART and FPART + # macros could be switched to `(u32)(s32)((x) * 0x10000)` without issue + u32_x_s15_16 = (xi << 16) | xf + # Cast to s32 (`(s32)(u32)(s32)((x) * 0x10000)` == `(s32)((x) * 0x10000)`) + s32_x_s15_16 = ( + u32_x_s15_16 + if u32_x_s15_16 < 0x8000_0000 + else u32_x_s15_16 - 0x1_0000_0000 + ) + x = s32_x_s15_16 / 0x10000 + + if j != 0: + f.write(", ") + f.write(f"{x}f") + f.write("\n") + + f.write(wctx.line_prefix) + f.write(")") + + return True + + cdata_ext = CDataExt_Struct( + ( + ("intPart", CDataExt_Array(CDataExt_Array(CDataExt_Value.u16, 4), 4)), + ("fracPart", CDataExt_Array(CDataExt_Array(CDataExt_Value.u16, 4), 4)), + ) + ).set_write(write_mtx) + + def get_c_declaration_base(self): + return f"Mtx {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError + + def get_h_includes(self): + return ("ultra64.h",) + + +class VtxArrayResource(CDataResource): + def write_elem(resource, memory_context, v, wctx: CDataExtWriteContext): + assert isinstance(v, dict) + wctx.f.write(wctx.line_prefix) + wctx.f.write( + f"VTX({v['x']:6}, {v['y']:6}, {v['z']:6}, " + f"{fmt_hex_s(v['s']):>7}, {fmt_hex_s(v['t']):>7}, " + f"{fmt_hex_u(v['crnx'], 2)}, {fmt_hex_u(v['cgny'], 2)}, {fmt_hex_u(v['cbnz'], 2)}, {fmt_hex_u(v['a'], 2)})" + ) + return True + + element_cdata_ext = CDataExt_Struct( + ( + ("x", CDataExt_Value.s16), + ("y", CDataExt_Value.s16), + ("z", CDataExt_Value.s16), + ( + "pad6", + CDataExt_Value.pad16, + ), # Not technically padding but unused and expected to always be 0 + ("s", CDataExt_Value.s16), + ("t", CDataExt_Value.s16), + ("crnx", CDataExt_Value.u8), + ("cgny", CDataExt_Value.u8), + ("cbnz", CDataExt_Value.u8), + ("a", CDataExt_Value.u8), + ) + ).set_write(write_elem) + + def __init__(self, file: File, range_start: int, range_end: int, name: str): + num = (range_end - range_start) // self.element_cdata_ext.size + self.cdata_ext = CDataExt_Array(self.element_cdata_ext, num) + super().__init__(file, range_start, name) + + def get_as_xml(self): + return f"""\ + + + """ + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON"): + return f"Vtx {self.symbol_name}[{self.cdata_ext.length}]" + return f"Vtx {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset % self.element_cdata_ext.size != 0: + raise ValueError( + "unaligned offset into vtx array", + hex(resource_offset), + self.element_cdata_ext.size, + ) + index = resource_offset // self.element_cdata_ext.size + return f"&{self.symbol_name}[{index}]" + + def get_c_includes(self): + return ("gfx.h",) + + def get_h_includes(self): + return ("ultra64.h",) + + +from ...n64 import G_IM_FMT, G_IM_SIZ, G_TT, G_MDSFT_TEXTLUT +from ... import n64texconv + +G_IM_FMT_n64texconv_by_n64 = { + G_IM_FMT.RGBA: n64texconv.G_IM_FMT_RGBA, + G_IM_FMT.YUV: n64texconv.G_IM_FMT_YUV, + G_IM_FMT.CI: n64texconv.G_IM_FMT_CI, + G_IM_FMT.IA: n64texconv.G_IM_FMT_IA, + G_IM_FMT.I: n64texconv.G_IM_FMT_I, +} +G_IM_SIZ_n64texconv_by_n64 = { + G_IM_SIZ._4b: n64texconv.G_IM_SIZ_4b, + G_IM_SIZ._8b: n64texconv.G_IM_SIZ_8b, + G_IM_SIZ._16b: n64texconv.G_IM_SIZ_16b, + G_IM_SIZ._32b: n64texconv.G_IM_SIZ_32b, +} + + +def write_n64_image_to_png( + path: Path, width: int, height: int, fmt: G_IM_FMT, siz: G_IM_SIZ, data: memoryview +): + n64texconv.N64Image.from_bin( + data, + width, + height, + G_IM_FMT_n64texconv_by_n64[fmt], + G_IM_SIZ_n64texconv_by_n64[siz], + ).to_png(str(path), False) + + +def write_n64_image_to_png_color_indexed( + path: Path, + width: int, + height: int, + fmt: G_IM_FMT, + siz: G_IM_SIZ, + data: memoryview, + tlut_data: memoryview, + tlut_count: int, + tlut_fmt: G_IM_FMT, +): + assert tlut_count * 2 == len(tlut_data) + n64texconv.N64Image.from_bin( + data, + width, + height, + G_IM_FMT_n64texconv_by_n64[fmt], + G_IM_SIZ_n64texconv_by_n64[siz], + n64texconv.N64Palette.from_bin(tlut_data, G_IM_FMT_n64texconv_by_n64[tlut_fmt]), + ).to_png(str(path), False) + + +class TextureResource(Resource): + needs_build = True + extracted_path_suffix = ".png" + + def __init__( + self, + file: File, + range_start: int, + name: str, + fmt: G_IM_FMT, + siz: G_IM_SIZ, + width: int, + height: int, + ): + size_bits = siz.bpp * width * height + assert size_bits % 8 == 0, size_bits + size_bytes = size_bits // 8 + range_end = range_start + size_bytes + + super().__init__(file, range_start, range_end, name) + + self.fmt = fmt + self.siz = siz + self.width = width + self.height = height + + # For handling color-indexed textures: + self.resource_tlut: Optional[TextureResource] = None + """For CI textures, the TLUT used""" + self.resources_ci_list: list[TextureResource] = [] + """For TLUT "textures", the CI textures using it""" + + if size_bytes % 8 == 0 and (file.alignment + range_start) % 8 == 0: + self.alignment = 8 + elif size_bytes % 4 == 0 and (file.alignment + range_start) % 4 == 0: + self.alignment = 4 + else: + raise NotImplementedError( + "unimplemented: unaligned texture size/offset", + hex(size_bytes), + hex(range_start), + ) + + alignment_bits = self.alignment * 8 + self.elem_type = f"u{alignment_bits}" + assert self.elem_type in {"u64", "u32"} + + self.width_name = f"{self.symbol_name}_WIDTH" + self.height_name = f"{self.symbol_name}_HEIGHT" + + def get_as_xml(self): + tlut_offset_attr = ( + f' TlutOffset="0x{self.resource_tlut.range_start:X}"' + if self.resource_tlut + else "" + ) + return f"""\ + """ + + def check_declare_length(self): + return ( + hasattr(self, "HACK_IS_STATIC_ON") or EXPLICIT_DL_AND_TEX_SIZES + ) and not self.is_tlut() + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON") and self.is_tlut(): + raise NotImplementedError + if self.check_declare_length(): + return ( + f"{self.elem_type} {self.symbol_name}" + f"[TEX_LEN({self.elem_type}, {self.width_name}, {self.height_name}, {self.siz.bpp})]" + ) + return f"{self.elem_type} {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError(self, hex(resource_offset)) + + def resources_ci_list_append(self, resource_ci: "TextureResource"): + if resource_ci not in self.resources_ci_list: + self.resources_ci_list.append(resource_ci) + + HACK_NO_CHECK_TLUT_BOUNDS = self.name in { + # this TLUT should be 184 colors instead of 136 as defined in the xml, + # but then it would overlap with gZelda2_6TLUT. + "gZelda2_5TLUT", + # the skybox TLUTs are used "weirdly" (TODO understand) + "gSunriseSkyboxTLUT", + "gSunsetSkyboxTLUT", + "gDayOvercastSkyboxTLUT", + "gNightOvercastSkyboxTLUT", + "gHoly1SkyboxTLUT", + } + + if __debug__ and not HACK_NO_CHECK_TLUT_BOUNDS: + # if not a TLUTResource, but only a TextureResource, + # this TLUT is xml-defined (using ) + if self.__class__ == TextureResource: + # check the CI texture doesn't index OOB into this tlut + + if resource_ci.file.data is None: + # TODO see similar in TLUTResource.resources_ci_list_append + return + + # Copypasted from TLUTResource.resources_ci_list_append + + resource_ci_data = resource_ci.file.data[ + resource_ci.range_start : resource_ci.range_end + ] + + assert resource_ci.siz in {G_IM_SIZ._4b, G_IM_SIZ._8b} + + if resource_ci.siz == G_IM_SIZ._4b: + v_max = max(max((b >> 4) & 0xF, b & 0xF) for b in resource_ci_data) + assert v_max < 16 + + if resource_ci.siz == G_IM_SIZ._8b: + v_max = max(resource_ci_data) + assert v_max < 256 + + new_min_count = v_max + 1 + + # end Copypasted + + cur_count = self.width * self.height + + assert cur_count >= new_min_count, ( + "TLUT resource", + self, + "is defined as having", + cur_count, + "colors, but there is an image using it as having at least", + new_min_count, + "colors:", + resource_ci, + ) + + def set_tlut(self, resource_tlut: "TextureResource"): + assert self.fmt == G_IM_FMT.CI, (self, resource_tlut) + if self.resource_tlut is not None: + HACK_NO_FAIL_MULTIPLE_TLUTS = self.name in { + "gZelda2Tex_003A08", + } + if self.resource_tlut != resource_tlut and not HACK_NO_FAIL_MULTIPLE_TLUTS: + # Technically not impossible so NotImplementedError + raise NotImplementedError( + "Color-indexed texture using two different TLUTs", + self, + resource_tlut, + ) + return + + # Assert resource_tlut is rgba16. + # Note it could be ia16, but that's not implemented + assert ( + resource_tlut.fmt == G_IM_FMT.RGBA and resource_tlut.siz == G_IM_SIZ._16b + ), resource_tlut + + self.resource_tlut = resource_tlut + assert self not in resource_tlut.resources_ci_list + resource_tlut.resources_ci_list_append(self) + + def try_parse_data(self, memory_context): + if self.fmt != G_IM_FMT.CI: + # Nothing to do + return RESOURCE_PARSE_SUCCESS + else: + if self.resource_tlut is None: + raise ResourceParseWaiting(waiting_for=["self.resource_tlut"]) + return RESOURCE_PARSE_SUCCESS + + def is_tlut(self): + """The result is only meaningful after all resources have been parsed + + (otherwise, for example, the dlists referencing this resource + as a tlut may not have been parsed and this would be considered + a regular texture) + """ + return len(self.resources_ci_list) != 0 + + def is_shared_tlut(self): + # Same caveat as is_tlut + return len(self.resources_ci_list) >= 2 + + def tlut_can_omit_tlut_info_from_users(self): + assert self.is_tlut() + return len(self.resources_ci_list) == 1 and self.alignment == 8 + + def tlut_get_count(self): + assert self.is_tlut() + return self.width * self.height + + def get_filename_stem(self): + format_name = f"{self.fmt.name.lower()}{self.siz.bpp}" + + if self.elem_type != "u64": + elem_type_suffix = f".{self.elem_type}" + else: + elem_type_suffix = "" + + if self.fmt == G_IM_FMT.CI: + assert self.resource_tlut is not None + tlut_info = f"tlut_{self.resource_tlut.name}" + if self.resource_tlut.elem_type != "u64": + tlut_info += f"_{self.resource_tlut.elem_type}" + if not self.resource_tlut.tlut_can_omit_tlut_info_from_users(): + return f"{self.name}.{format_name}.{tlut_info}{elem_type_suffix}" + else: + return f"{self.name}.{format_name}{elem_type_suffix}" + elif self.is_tlut(): + if not self.tlut_can_omit_tlut_info_from_users(): + return f"{self.name}.tlut.{format_name}{elem_type_suffix}" + else: + return f"{self.resources_ci_list[0].name}.tlut.{format_name}{elem_type_suffix}" + else: + return f"{self.name}.{format_name}{elem_type_suffix}" + + def write_extracted(self, memory_context): + if self.is_tlut(): + # TLUTs are extracted as part of the color-indexed textures using them + + def is_all_resources_fake(): + return all( + hasattr(res, "FAKE_FOR_BEST_EFFORT") + for res in self.resources_ci_list + ) + + if BEST_EFFORT: + if is_all_resources_fake(): + assert self.fmt == G_IM_FMT.RGBA + + if VERBOSE_BEST_EFFORT_TLUT_NO_REAL_USER and not getattr( + self, "HACK_ignore_orphaned_tlut", False + ): + print( + "BEST_EFFORT", + "no real (non-fake for best effort) ci resource uses this tlut", + ) + rich_pprint(self) + print( + " extracting the tlut as its own png", + self.extract_to_path.resolve().as_uri(), + "instead of relying on it being generated", + "\n (note while the result may build and match the tlut probably is", + "the wrong size since there was no ci image to take/guess its length from)", + ) + + # Extract the tlut as png instead of relying on + # it being generated from pngs using it, since + # there are no such pngs. + # (Copypaste of the general case (non-tlut) below): + data = self.file.data[self.range_start : self.range_end] + assert len(data) == self.range_end - self.range_start + write_n64_image_to_png( + self.extract_to_path, + self.width, + self.height, + self.fmt, + self.siz, + data, + ) + else: + # assert this TLUT is used by at least one real resource, + # otherwise it won't be generated by anything + assert not is_all_resources_fake() + return + + data = self.file.data[self.range_start : self.range_end] + assert len(data) == self.range_end - self.range_start + if self.fmt == G_IM_FMT.CI: + tlut_data = self.resource_tlut.file.data[ + self.resource_tlut.range_start : self.resource_tlut.range_end + ] + tlut_count = self.resource_tlut.tlut_get_count() + tlut_fmt = self.resource_tlut.fmt + write_n64_image_to_png_color_indexed( + self.extract_to_path, + self.width, + self.height, + self.fmt, + self.siz, + data, + tlut_data, + tlut_count, + tlut_fmt, + ) + else: + write_n64_image_to_png( + self.extract_to_path, self.width, self.height, self.fmt, self.siz, data + ) + + def write_c_declaration(self, h: io.TextIOBase): + if self.is_tlut(): + # TODO + h.writelines( + (f"//#define {self.symbol_name}_TLUT_COUNT {self.tlut_get_count()}\n",) + ) + else: + h.writelines( + ( + f"#define {self.width_name} {self.width}\n", + f"#define {self.height_name} {self.height}\n", + ) + ) + super().write_c_declaration(h) + + def get_h_includes(self): + return ( + "ultra64.h", + *(("tex_len.h",) if self.check_declare_length() else ()), + ) + + @reprlib.recursive_repr() + def __repr__(self): + return super().__repr__().removesuffix(")") + ( + f", fmt={self.fmt}, siz={self.siz}" + f", width={self.width}, height={self.height}" + f", elem_type={self.elem_type}" + f", resource_tlut={self.resource_tlut}, resources_ci_list={self.resources_ci_list}" + ")" + ) + + def __rich_repr__(self): + yield from super().__rich_repr__() + yield "fmt", self.fmt + yield "siz", self.siz + yield "width", self.width + yield "height", self.height + yield "elem_type", self.elem_type + yield "resource_tlut", self.resource_tlut + yield "resources_ci_list", self.resources_ci_list + + __rich_repr__.angular = True + + +class TLUTResource(TextureResource, can_size_be_unknown=True): + """ + Note this resource is only used for discovered TLUTs, not tluts from xmls + (TODO maybe change the xmls eventually) + Discovered TLUTs are different because their size is unknown + """ + + def __init__(self, file: File, range_start: int, name: str, fmt: G_IM_FMT): + assert fmt in {G_IM_FMT.RGBA, G_IM_FMT.IA} + + # just to make TextureResource.__init__ happy + # Note these values are picked so u64 elem_type is possible + fake_width = 4 + fake_height = 1 + + super().__init__( + file, range_start, name, fmt, G_IM_SIZ._16b, fake_width, fake_height + ) + + def tlut_get_count(self): + if self.range_end is None: + raise Exception("cannot tlut_get_count, unknown count yet") + return super().tlut_get_count() + + def resources_ci_list_append(self, resource_ci: "TextureResource"): + super().resources_ci_list_append(resource_ci) + + if resource_ci.file.data is None: + # Can't expand length, the user CI texture has no data attached + # TODO handle better? but idk + # maybe just a warning + return + + resource_ci_data = resource_ci.file.data[ + resource_ci.range_start : resource_ci.range_end + ] + + assert resource_ci.siz in {G_IM_SIZ._4b, G_IM_SIZ._8b} + + if resource_ci.siz == G_IM_SIZ._4b: + v_max = max(max((b >> 4) & 0xF, b & 0xF) for b in resource_ci_data) + assert v_max < 16 + + if resource_ci.siz == G_IM_SIZ._8b: + v_max = max(resource_ci_data) + assert v_max < 256 + + new_min_count = v_max + 1 + + assert self.height == 1 + if new_min_count > self.width: + # round width up to a multiple of 4, for elem_type=u64 + self.width = (new_min_count + 3) // 4 * 4 + + assert self.width <= 256 + + # TODO HACK this is hacky because not explicitly permitted, + # once set self.range_end is assumed to be fixed + # but surely it'll be fine (copium) + # In practice nothing should reference inside a tlut, + # so the resource has all the time to expand. + # A better implementation would be to give a "final warning" kind of signal + # to the resource on try_parse_data (add optional tryhard_parse_data ?) + assert self.siz == G_IM_SIZ._16b + self.range_end = self.range_start + self.width * self.height * 2 + + +class TextureSplitTlutResource(TextureResource): + + def __init__(self, file, range_start, name, fmt, siz, width, height, lo_half: bool): + assert fmt == G_IM_FMT.CI + assert siz == G_IM_SIZ._8b + super().__init__(file, range_start, name, fmt, siz, width, height) + self.lo_half = lo_half + + def get_filename_stem(self): + assert self.elem_type == "u64" + assert self.resource_tlut.elem_type == "u64" + + return f"{self.name}.ci8.split_{'lo' if self.lo_half else 'hi'}.tlut_{self.resource_tlut.name}" + + def write_extracted(self, memory_context): + data = self.file.data[self.range_start : self.range_end] + assert len(data) == self.range_end - self.range_start + + if self.lo_half: + assert all(_b < 128 for _b in data) + else: + assert all(_b >= 128 for _b in data) + data = bytes(_b - 128 for _b in data) + + tlut_data = self.resource_tlut.file.data[ + self.resource_tlut.range_start : self.resource_tlut.range_end + ] + + assert self.resource_tlut.tlut_get_count() == 128 + + write_n64_image_to_png_color_indexed( + self.extract_to_path, + self.width, + self.height, + self.fmt, + self.siz, + data, + tlut_data, + 128, + self.resource_tlut.fmt, + ) + + +def gfxdis( + *, + input_buffer: Union[bytes, memoryview], + output_callback: Optional[ + Callable[[bytes], None] # deviates a bit from gfxd, no count arg/return + ] = None, + enable_caps: set[pygfxd.GfxdCap] = { + pygfxd.GfxdCap.stop_on_end, + pygfxd.GfxdCap.emit_dec_color, + }, + target: pygfxd.gfx_ucode_t = pygfxd.gfxd_f3dex2, + vtx_callback: Optional[Callable[[int, int], int]] = None, + timg_callback: Optional[Callable[[int, int, int, int, int, int], int]] = None, + tlut_callback: Optional[Callable[[int, int, int], int]] = None, + mtx_callback: Optional[Callable[[int], int]] = None, + dl_callback: Optional[Callable[[int], int]] = None, + macro_fn: Optional[Callable[[], int]] = None, + arg_fn: Optional[Callable[[int], None]] = None, +): + for cap in ( + pygfxd.GfxdCap.stop_on_invalid, + pygfxd.GfxdCap.stop_on_end, + pygfxd.GfxdCap.emit_dec_color, + pygfxd.GfxdCap.emit_q_macro, + pygfxd.GfxdCap.emit_ext_macro, + ): + if cap in enable_caps: + pygfxd.gfxd_enable(cap) + else: + pygfxd.gfxd_disable(cap) + + pygfxd.gfxd_target(target) + + pygfxd.gfxd_input_buffer(bytes(input_buffer)) + + uncaught_exc_infos = [] + + # output_callback + + if output_callback: + + def output_callback_wrapper(buf, count): + try: + output_callback(buf) + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + return count + + else: + + def output_callback_wrapper(buf, count): + return count + + pygfxd.gfxd_output_callback(output_callback_wrapper) + + # vtx_callback + + if vtx_callback: + + def vtx_callback_wrapper(vtx, num): + try: + ret = vtx_callback(vtx, num) + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + + ret = 0 + return ret + + else: + + def vtx_callback_wrapper(vtx, num): + return 0 + + pygfxd.gfxd_vtx_callback(vtx_callback_wrapper) + + # timg_callback + + if timg_callback: + + def timg_callback_wrapper(timg, fmt, siz, width, height, pal): + try: + ret = timg_callback(timg, fmt, siz, width, height, pal) + assert isinstance(ret, int) + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + + ret = 0 + return ret + + else: + + def timg_callback_wrapper(timg, fmt, siz, width, height, pal): + return 0 + + pygfxd.gfxd_timg_callback(timg_callback_wrapper) + + # tlut_callback + + if tlut_callback: + + def tlut_callback_wrapper(tlut, idx, count): + try: + ret = tlut_callback(tlut, idx, count) + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + + ret = 0 + return ret + + else: + + def tlut_callback_wrapper(tlut, idx, count): + return 0 + + pygfxd.gfxd_tlut_callback(tlut_callback_wrapper) + + # mtx_callback + + if mtx_callback: + + def mtx_callback_wrapper(mtx): + try: + ret = mtx_callback(mtx) + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + + ret = 0 + return ret + + else: + + def mtx_callback_wrapper(mtx): + return 0 + + pygfxd.gfxd_mtx_callback(mtx_callback_wrapper) + + # dl_callback + + if dl_callback: + + def dl_callback_wrapper(dl): + try: + ret = dl_callback(dl) + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + + ret = 0 + return ret + + else: + + def dl_callback_wrapper(dl): + return 0 + + pygfxd.gfxd_dl_callback(dl_callback_wrapper) + + # macro_fn + + if macro_fn: + + def macro_fn_wrapper(): + try: + ret = macro_fn() + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + + ret = 0 + + # TODO consider: + if uncaught_exc_infos: + pygfxd.gfxd_input_buffer( + b"" + ) # interrupt current execution TODO check if this is safe and if it works + ret = 1 + + return ret + + else: + + def macro_fn_wrapper(): + ret = pygfxd.gfxd_macro_dflt() + + # TODO consider: + if uncaught_exc_infos: + pygfxd.gfxd_input_buffer(b"") # TODO see same line above + ret = 1 + + return ret + + pygfxd.gfxd_macro_fn(macro_fn_wrapper) + + # arg_fn + + if arg_fn: + + def arg_fn_wrapper(arg_num): + try: + arg_fn(arg_num) + except: + import sys + + exc_info = sys.exc_info() + uncaught_exc_infos.append(exc_info) + + pygfxd.gfxd_arg_fn(arg_fn_wrapper) + else: + pygfxd.gfxd_arg_fn(None) + + # Execute + + pygfxd.gfxd_execute() + + # The offset is in bytes and indicates the last command, + # so add 8 (sizeof(Gfx)) + size = pygfxd.gfxd_macro_offset() + 8 + + if uncaught_exc_infos: + import traceback + + msg = "There were uncaught python errors in callbacks during gfxd execution." + + print() + print(msg) + print("vvv See below for a list of the traces of the uncaught errors:") + + for exc_info in uncaught_exc_infos: + import sys + + print() + traceback.print_exception(*exc_info, file=sys.stdout) + + print() + print(msg) + print("^^^ See above for a list of the traces of the uncaught errors.") + + raise Exception( + msg, + "See the standard output for a list of the traces of the uncaught errors.", + uncaught_exc_infos, + ) + + return size + + +class StringWrapper: + def __init__( + self, + data: Union[str, bytes], + max_line_length, + writer: Callable[[Union[str, bytes]], None], + ): + self.max_line_length = max_line_length + self.pending_data = data + self.writer = writer + self.newline_char = "\n" if isinstance(data, str) else b"\n" + self.space_char = " " if isinstance(data, str) else b" " + + def append(self, data: Union[str, bytes]): + self.pending_data += data + self.proc() + + def proc(self, flush=False): + while len(self.pending_data) > self.max_line_length or ( + flush and self.pending_data + ): + i = self.pending_data.find(self.newline_char, 0, self.max_line_length) + if i >= 0: + i += 1 + self.writer(self.pending_data[:i]) + self.pending_data = self.pending_data[i:] + continue + + i = self.pending_data.rfind(self.space_char, 1, self.max_line_length) + if i < 0: + i = self.pending_data.find(self.space_char, 1) + if i < 0: + if flush: + i = len(self.pending_data) + else: + # Avoid adding a line return in the middle of a word + return + self.writer(self.pending_data[:i]) + self.pending_data = self.pending_data[i:] + if not flush or self.pending_data: + self.writer(self.newline_char) + + def flush(self): + self.proc(flush=True) + + +class Ucode(enum.Enum): + f3dex = pygfxd.gfxd_f3dex + f3dex2 = pygfxd.gfxd_f3dex2 + + def __init__(self, gfxd_ucode: pygfxd.gfx_ucode_t): + self.gfxd_ucode = gfxd_ucode + + +# TODO probably need to split TLUTResource from TextureResource +# to achieve cleaner code, +# tluts behave very differently + + +# TODO maybe refactor this once it works tm +class ColorIndexedTexturesManager: + from dataclasses import dataclass + + @dataclass + class Tex: + timg: int + fmt: G_IM_FMT + siz: G_IM_SIZ + width: int + height: int + pal: int + + @dataclass + class Tlut: + tlut: int + idx: int + count: int + + @dataclass + class CIState: + tlut_mode: G_TT + tluts_count: int + tluts: dict[int, "ColorIndexedTexturesManager.Tlut"] + texs: list["ColorIndexedTexturesManager.Tex"] + + def __init__(self, *, HACK_late_SetTextureLUT=False): + self.cur_tlut_mode: G_TT = None + + self.cur_tluts_count: int = None + self.cur_tluts: dict[int, ColorIndexedTexturesManager.Tlut] = dict() + self.cur_texs: list[ColorIndexedTexturesManager.Tex] = [] + + self.ci_states: list[ColorIndexedTexturesManager.CIState] = [] + + # Rarely, + # gsDPSetTextureLUT comes after gsDPLoadTextureBlock and gsDPLoadTLUT, + # instead of before + self.HACK_late_SetTextureLUT = HACK_late_SetTextureLUT + + def ci_timg(self, timg, fmt: G_IM_FMT, siz: G_IM_SIZ, width, height, pal): + if VERBOSE_ColorIndexedTexturesManager: + print( + "ColorIndexedTexturesManager.ci_timg", + hex(timg), + fmt, + siz, + width, + height, + pal, + ) + assert fmt == G_IM_FMT.CI + if not self.HACK_late_SetTextureLUT: + assert self.cur_tlut_mode != G_TT.NONE + + self.cur_texs.append( + ColorIndexedTexturesManager.Tex(timg, fmt, siz, width, height, pal) + ) + + def tlut(self, tlut, idx, count): + if VERBOSE_ColorIndexedTexturesManager: + print("ColorIndexedTexturesManager.tlut", hex(tlut), idx, count) + if idx == -1: + # HACK idx==-1 may be a libgfxd bug? + assert count == 256 + idx = 0 + if not self.HACK_late_SetTextureLUT: + assert self.cur_tlut_mode != G_TT.NONE + if self.cur_tluts_count != count: + self.cur_tluts.clear() # TODO ? idk. (at worst it will cause errors) + self.cur_tluts_count = count + self.cur_tluts[idx] = ColorIndexedTexturesManager.Tlut(tlut, idx, count) + + def tlut_mode(self, tt: G_TT): + if VERBOSE_ColorIndexedTexturesManager: + print("ColorIndexedTexturesManager.tlut_mode", tt) + if self.cur_tlut_mode != tt: + if not self.HACK_late_SetTextureLUT: + self.cur_tluts.clear() # TODO ? idk. (at worst it will cause errors) + self.cur_tlut_mode = tt + + def commit_state(self): + if self.cur_tlut_mode == G_TT.NONE: + return + if not self.cur_texs: + return + assert self.cur_tluts + assert self.cur_tluts_count is not None + if self.cur_tlut_mode is None: + if BEST_EFFORT: + # Some dlists (eg gMegamiPiece2DL) inherit G_TT_RGBA16 + # since ia16 is uncommon if not unused, just default to that + self.cur_tlut_mode = G_TT.RGBA16 + assert self.cur_tlut_mode is not None + cur_state = ColorIndexedTexturesManager.CIState( + self.cur_tlut_mode, + self.cur_tluts_count, + self.cur_tluts.copy(), + self.cur_texs, + ) + self.cur_texs = [] + self.ci_states.append(cur_state) + if VERBOSE_ColorIndexedTexturesManager: + print( + "ColorIndexedTexturesManager.commit_state", + "cur_state =", + cur_state, + ) + + def report_states(self, reporter: Resource, memory_context: "MemoryContext"): + if VERBOSE_ColorIndexedTexturesManager: + print("ColorIndexedTexturesManager.report_states") + for ci_state in self.ci_states: + if VERBOSE_ColorIndexedTexturesManager: + print(" ci_state =", ci_state) + assert ci_state.tlut_mode != G_TT.NONE + for tex in ci_state.texs: + if VERBOSE_ColorIndexedTexturesManager: + print(" tex =", tex) + assert tex.fmt == G_IM_FMT.CI + + # HACK + if ( + reporter.file.name + in { + "jyasinzou_room_5", + "jyasinzou_room_25", + } + and ci_state.tluts_count == 256 + and tex.siz == G_IM_SIZ._4b + ): + # For some reason jyasinzou_room_5DL_008EC0 has this: + """ + gsDPLoadTextureBlock_4b(jyasinzou_sceneTex_019320, G_IM_FMT_CI, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR + | G_TX_WRAP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTLUT_pal16(0, jyasinzou_sceneTLUT_018000), + gsDPLoadTextureBlock(jyasinzou_room_5Tex_00DFC8, G_IM_FMT_CI, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTLUT_pal256(jyasinzou_sceneTLUT_017DE0), + """ + # (where the first texture & tlut loads are useless, overriden by the latter two) + + # -> Ignore the first texture (in `tex` at this point) + + # similar thing in jyasinzou_room_25DL_005050 + + # (note the condition to restrict this to the above cases is very broad, + # just checking reporter.file.name, so this may happen more in those files + # and not have been caught and documented here) + + continue + + # Not a proper hard requirement but if this fails + # something is probably wrong, look at details then + assert ( + ci_state.tluts_count + == { + G_IM_SIZ._4b: 16, + G_IM_SIZ._8b: 256, + }[tex.siz] + ), (reporter, ci_state, tex) + + if ci_state.tluts_count > 16: + assert ci_state.tluts.keys() == {0}, ci_state.tluts + + resource = memory_context.report_resource_at_segmented( + reporter, + tex.timg, + TextureResource, + lambda file, offset: TextureResource( + file, + offset, + f"{file.name if TEXS_SHORTER_NAMES else reporter.name}_{offset:08X}_CITex", + tex.fmt, + tex.siz, + tex.width, + tex.height, + ), + ) + + tlut = ci_state.tluts[tex.pal] + assert tlut.idx == tex.pal + assert tlut.count == ci_state.tluts_count + + resource_tlut = memory_context.report_resource_at_segmented( + reporter, + tlut.tlut, + # TLUTs declared in xmls use so are TextureResource, + # so we can only expects a TextureResource + # (TLUTResource is a subclass of TextureResource) + TextureResource, + lambda file, offset: TLUTResource( + file, + offset, + f"{file.name if TEXS_SHORTER_NAMES else reporter.name}_{offset:08X}_TLUT", + { + G_TT.RGBA16: G_IM_FMT.RGBA, + G_TT.IA16: G_IM_FMT.IA, + }[ci_state.tlut_mode], + ), + ) + + resource.set_tlut(resource_tlut) + + +class DListResource(Resource, can_size_be_unknown=True): + def __init__( + self, + file: File, + range_start: int, + name: str, + *, + target_ucode: Ucode = Ucode.f3dex2, + ): + super().__init__(file, range_start, None, name) + self.target_ucode = target_ucode + self.ignored_raw_pointers: set[int] = set() + + def try_parse_data(self, memory_context): + offset = self.range_start + + if VERBOSE2: + print(self.name, hex(offset)) + + def vtx_cb(vtx, num): + if vtx in self.ignored_raw_pointers: + return 0 + + # TODO be smarter about buffer merging + # (don't merge buffers from two different DLs, if they can be split cleanly) + # if that even happens + memory_context.mark_resource_buffer_at_segmented( + self, + VtxArrayResource, + f"{self.name}_{vtx:08X}_Vtx", + vtx, + vtx + num * VtxArrayResource.element_cdata_ext.size, + ) + return 0 + + ci_tex_manager = ColorIndexedTexturesManager( + # TODO + HACK_late_SetTextureLUT=(self.name in {"gEponaHeadLimb_0600AC20_DL"}) + ) + + def timg_cb(timg, fmt, siz, width, height, pal): + if timg in self.ignored_raw_pointers: + return 0 + + g_fmt = G_IM_FMT.by_i[fmt] + g_siz = G_IM_SIZ.by_i[siz] + + if g_fmt == G_IM_FMT.CI: + ci_tex_manager.ci_timg(timg, g_fmt, g_siz, width, height, pal) + else: + memory_context.report_resource_at_segmented( + self, + timg, + TextureResource, + lambda file, offset: TextureResource( + file, + offset, + f"{file.name if TEXS_SHORTER_NAMES else self.name}_{offset:08X}_Tex", + g_fmt, + g_siz, + width, + height, + ), + ) + return 0 + + def tlut_cb(tlut, idx, count): + if tlut in self.ignored_raw_pointers: + return 0 + + ci_tex_manager.tlut(tlut, idx, count) + return 0 + + def mtx_cb(mtx): + if mtx in self.ignored_raw_pointers: + return 0 + + memory_context.report_resource_at_segmented( + self, + mtx, + MtxResource, + lambda file, offset: MtxResource( + file, offset, f"{self.name}_{mtx:08X}_Mtx" + ), + ) + return 0 + + def dl_cb(dl): + if dl in self.ignored_raw_pointers: + return 0 + + memory_context.report_resource_at_segmented( + self, + dl, + DListResource, + lambda file, offset: DListResource( + file, + offset, + f"{self.name}_{dl:08X}_DL", + target_ucode=self.target_ucode, + ), + ) + return 0 + + def macro_fn(): + tt = pygfxd.gfxd_value_by_type(pygfxd.GfxdArgType.Tt, 0) + if tt is not None: + tt = tt[1] + else: + othermodehi = pygfxd.gfxd_value_by_type( + pygfxd.GfxdArgType.Othermodehi, 0 + ) + if othermodehi is not None: + othermodehi = othermodehi[1] + tt = othermodehi & (0b11 << G_MDSFT_TEXTLUT) + else: + tt = None + if tt is not None: + g_tt = G_TT.by_i[tt] + ci_tex_manager.tlut_mode(g_tt) + + macro_id = pygfxd.gfxd_macro_id() + if macro_id in { + pygfxd.GfxdMacroId.SP1Triangle, + pygfxd.GfxdMacroId.SP2Triangles, + }: + ci_tex_manager.commit_state() + + return pygfxd.gfxd_macro_dflt() + + size = gfxdis( + input_buffer=self.file.data[self.range_start :], + target=self.target_ucode.gfxd_ucode, + vtx_callback=vtx_cb, + timg_callback=timg_cb, + tlut_callback=tlut_cb, + mtx_callback=mtx_cb, + dl_callback=dl_cb, + macro_fn=macro_fn, + ) + + # Also commit state at the end of the display list. + # This handles "material" dlists that only load a texture, + # without drawing geometry. + ci_tex_manager.commit_state() + + ci_tex_manager.report_states(self, memory_context) + + self.range_end = self.range_start + size + + if VERBOSE2: + print(self.name, hex(offset), hex(self.range_end)) + + return RESOURCE_PARSE_SUCCESS + + def get_as_xml(self): + return f"""\ + """ + + def get_c_declaration_base(self): + if hasattr(self, "HACK_IS_STATIC_ON") or EXPLICIT_DL_AND_TEX_SIZES: + length = (self.range_end - self.range_start) // 8 + return f"Gfx {self.symbol_name}[{length}]" + return f"Gfx {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def write_extracted(self, memory_context): + def macro_fn(): + pygfxd.gfxd_puts(INDENT) + ret = pygfxd.gfxd_macro_dflt() + pygfxd.gfxd_puts(",\n") + return ret + + def arg_fn_handle_Dim(arg_num: int): + timg = pygfxd.gfxd_value_by_type(pygfxd.GfxdArgType.Timg, 0) + if timg is None: + return False + _, timg_segmented, _ = timg + dim_args_i = [] + for arg_i in range(pygfxd.gfxd_arg_count()): + if pygfxd.gfxd_arg_type(arg_i) == pygfxd.GfxdArgType.Dim: + dim_args_i.append(arg_i) + assert arg_num in dim_args_i + assert len(dim_args_i) <= 2 + if len(dim_args_i) != 2: + return False + width_arg_i, height_arg_i = dim_args_i + try: + timg_resolved = memory_context.resolve_segmented(timg_segmented) + except UnmappedAddressError: + # TODO store failed resolutions somewhere, for later printing + # (in general, it would be nice to fail less and *firmly* warn more instead, + # even if it means having compilation fail on purpose (#error)) + return False + try: + resolved_resource = timg_resolved.get_resource(TextureResource) + except UnexpectedResourceTypeError: + # TODO investigate. eg spot18 uses 0x0800_0000 as both a DL and Tex ? + return False + + assert isinstance(resolved_resource, TextureResource), ( + hex(timg_segmented), + resolved_resource, + resolved_resource.__class__, + ) + width_arg_value = pygfxd.gfxd_arg_value(width_arg_i)[1] + height_arg_value = pygfxd.gfxd_arg_value(height_arg_i)[1] + if (resolved_resource.width, resolved_resource.height) == ( + width_arg_value, + height_arg_value, + ): + if arg_num == width_arg_i: + if resolved_resource.width_name: + pygfxd.gfxd_puts(resolved_resource.width_name) + return True + else: + assert arg_num == height_arg_i + if resolved_resource.height_name: + pygfxd.gfxd_puts(resolved_resource.height_name) + return True + else: + HACK_no_warn_bad_dims_DLs = { + "sPresentedByNintendoDL", # uses gsDPLoadTextureTile, in which height is unused, so disassembled as 0 by gfxdis + "gMantUnusedMaterialDL", # DList bug + "gSunDL", # DList loads bigger chunks than the individual texture pieces (overlaps) + } + HACK_no_warn_bad_dims_Texs = { + "gPoeComposerFlatHeadDL_000060E0_Tex", # used as both rgba16 16x16 and rgba16 8x8 + "gDekuStickTex", # used as both i8 8x8 and i8 16x16 + "gHilite1Tex", # used as both rgba16 16x16 and rgba16 32x32 + "gHilite2Tex", # used as both rgba16 16x16 and rgba16 32x32 + "gUnknownCircle4Tex", # used as both i8 16x16 and rgba16 32x32 + "gLinkChildLowerBootTex", # used as both ci8 32x32 and ci8 16x16 + "gDecorativeFlameMaskTex", # used as both i4 32x128 and i4 32x64 + } + if ( + arg_num == width_arg_i + and self.name not in HACK_no_warn_bad_dims_DLs + and resolved_resource.name not in HACK_no_warn_bad_dims_Texs + ): + print( + "Unexpected texture dimensions used: in dlist =", + self, + "texture =", + resolved_resource, + "texture resource has WxH =", + (resolved_resource.width, resolved_resource.height), + "but dlist uses WxH =", + (width_arg_value, height_arg_value), + ) + pygfxd.gfxd_puts( + " /* ! Unexpected texture dimensions !" + f" DL={width_arg_value}x{height_arg_value}" + f" vs Tex={resolved_resource.width}x{resolved_resource.height} */ " + ) + return False + + arg_fn_handlers = { + pygfxd.GfxdArgType.Dim: arg_fn_handle_Dim, + } + + def arg_fn(arg_num: int): + arg_type = pygfxd.gfxd_arg_type(arg_num) + arg_handler = arg_fn_handlers.get(arg_type) + + if arg_handler is not None: + inhibit_default = arg_handler(arg_num) + else: + inhibit_default = False + + if not inhibit_default: + pygfxd.gfxd_arg_dflt(arg_num) + + def vtx_cb(vtx, num): + if vtx in self.ignored_raw_pointers: + return 0 + + pygfxd.gfxd_puts(memory_context.get_c_reference_at_segmented(vtx)) + return 1 + + def timg_cb(timg, fmt, siz, width, height, pal): + if timg in self.ignored_raw_pointers: + return 0 + + try: + timg_c_ref = memory_context.get_c_reference_at_segmented(timg) + # except NoSegmentBaseError: # TODO + # timg_c_ref = None + except ValueError: + if BEST_EFFORT: + # (turns out I needed this because of a mistake in a xml so it can be useful) + import traceback + + print("vvv /* BAD TIMG REF */ vvv") + traceback.print_exc() + pygfxd.gfxd_puts("/* BAD TIMG REF */") + return 0 + else: + raise + if timg_c_ref: + pygfxd.gfxd_puts(timg_c_ref) + return 1 + return 0 + + def tlut_cb(tlut, idx, count): + if tlut in self.ignored_raw_pointers: + return 0 + + tlut_c_ref = memory_context.get_c_reference_at_segmented(tlut) + pygfxd.gfxd_puts(tlut_c_ref) + return 1 + + def mtx_cb(mtx): + if mtx in self.ignored_raw_pointers: + return 0 + + mtx_c_ref = memory_context.get_c_reference_at_segmented(mtx) + pygfxd.gfxd_puts(mtx_c_ref) + return 1 + + def dl_cb(dl): + if dl in self.ignored_raw_pointers: + return 0 + + dl_c_ref = memory_context.get_c_reference_at_segmented(dl) + pygfxd.gfxd_puts(dl_c_ref) + return 1 + + with self.extract_to_path.open("wb") as f: + if not self.braces_in_source: + f.write(b"{\n") + + out_string_wrapper = StringWrapper(b"", 120, f.write) + + def output_cb(buf: bytes): + out_string_wrapper.append(buf) + + gfxdis( + input_buffer=self.file.data[self.range_start : self.range_end], + output_callback=output_cb, + enable_caps={pygfxd.GfxdCap.emit_dec_color}, + target=self.target_ucode.gfxd_ucode, + vtx_callback=vtx_cb, + timg_callback=timg_cb, + tlut_callback=tlut_cb, + mtx_callback=mtx_cb, + dl_callback=dl_cb, + macro_fn=macro_fn, + arg_fn=arg_fn, + ) + + out_string_wrapper.flush() + + if not self.braces_in_source: + f.write(b"}\n") + + def get_c_includes(self): + return ( + # TODO these are not always needed: + "sys_matrix.h", # for gIdentityMtx + ) + + def get_h_includes(self): + return ("ultra64.h",) + + +def report_gfx_segmented(resource: Resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + if address != 0: + memory_context.report_resource_at_segmented( + resource, + address, + DListResource, + lambda file, offset: DListResource( + file, + offset, + f"{resource.name}_{address:08X}_DL", + ), + ) + + +def write_gfx_segmented( + resource: Resource, + memory_context: "MemoryContext", + v, + wctx: CDataExtWriteContext, +): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + if address == 0: + wctx.f.write("NULL") + else: + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + +cdata_ext_gfx_segmented = ( + CDataExt_Value("I").set_report(report_gfx_segmented).set_write(write_gfx_segmented) +) + +VERBOSE2 = False diff --git a/tools/assets/extract/extase_oot64/misc_resources.py b/tools/assets/extract/extase_oot64/misc_resources.py new file mode 100644 index 0000000000..b4c02c82c5 --- /dev/null +++ b/tools/assets/extract/extase_oot64/misc_resources.py @@ -0,0 +1,63 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import struct + +from ..extase import ( + RESOURCE_PARSE_SUCCESS, + File, + Resource, +) + +from tools import csdis + + +class CutsceneResource(Resource, can_size_be_unknown=True): + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, None, name) + + def try_parse_data(self, memory_context): + assert self.range_start % 4 == 0 + data = self.file.data[self.range_start :] + num_bytes = len(data) + if num_bytes % 4 != 0: + data = data[: -(num_bytes % 4)] + data_words = [unpacked[0] for unpacked in struct.iter_unpack(">I", data)] + size_words, cs_source = csdis.disassemble_cutscene(data_words) + self.range_end = self.range_start + 4 * size_words + self.cs_source = cs_source + return RESOURCE_PARSE_SUCCESS + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError + + extracted_path_suffix = ".inc.c" + + def get_filename_stem(self): + return f"{self.name}.csdata" + + def write_extracted(self, memory_context): + with self.extract_to_path.open("w") as f: + if not self.braces_in_source: + f.write("{\n") + f.write(self.cs_source) + if not self.braces_in_source: + f.write("}\n") + + def get_c_declaration_base(self): + return f"CutsceneData {self.symbol_name}[]" + + def get_c_includes(self): + return ( + "cutscene_commands.h", + # TODO these are not always needed: + "ocarina.h", # for OCARINA_ACTION_* + "player.h", # for PLAYER_CUEID_* + ) + + def get_h_includes(self): + return ("cutscene.h",) diff --git a/tools/assets/extract/extase_oot64/playeranim_resources.py b/tools/assets/extract/extase_oot64/playeranim_resources.py new file mode 100644 index 0000000000..9dd9dd960e --- /dev/null +++ b/tools/assets/extract/extase_oot64/playeranim_resources.py @@ -0,0 +1,102 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ..extase import MemoryContext + +from ..extase.cdata_resources import ( + CDataResource, + CDataArrayResource, + CDataExt_Struct, + CDataExt_Value, + CDataExtWriteContext, + fmt_hex_s, +) + + +class PlayerAnimationDataResource(CDataArrayResource): + elem_cdata_ext = CDataExt_Value("h").set_write_str_v(lambda v: fmt_hex_s(v)) + + def __init__(self, file, range_start, name): + super().__init__(file, range_start, name) + self.frame_count_name = f"FRAMECOUNT_{self.symbol_name}" + + def set_frame_count(self, frame_count: int): + self.set_length(frame_count * (22 * 3 + 1)) + self.frame_count = frame_count + + def write_c_declaration(self, h): + h.write(f"#define {self.frame_count_name} {self.frame_count}\n") + super().write_c_declaration(h) + + def get_c_declaration_base(self): + return f"s16 {self.symbol_name}[{self.frame_count_name} * (PLAYER_LIMB_MAX * 3 + 1)]" + + def get_h_includes(self): + return ("ultra64.h", "player.h") + + +class PlayerAnimationResource(CDataResource): + + def report(resource, memory_context: "MemoryContext", v): + assert isinstance(v, dict) + segment = v["segment"] + assert isinstance(segment, int) + player_animation_data_res = memory_context.report_resource_at_segmented( + resource, + segment, + PlayerAnimationDataResource, + lambda file, offset: PlayerAnimationDataResource( + file, offset, f"{resource.name}_{segment:08X}_PlayerAnimData" + ), + ) + player_animation_data_res.set_frame_count(v["common"]["frameCount"]) + + def write_frameCount( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + address = resource.cdata_unpacked["segment"] + assert isinstance(address, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write( + memory_context.resolve_segmented(address) + .get_resource(PlayerAnimationDataResource) + .frame_count_name + ) + return True + + def write_segment( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ( + "common", + CDataExt_Struct( + (("frameCount", CDataExt_Value("h").set_write(write_frameCount)),) + ), + ), + ("pad2", CDataExt_Value.pad16), + ("segment", CDataExt_Value("I").set_write(write_segment)), + ) + ).set_report(report) + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_c_declaration_base(self): + return f"LinkAnimationHeader {self.symbol_name}" + + def get_h_includes(self): + return ("animation.h",) diff --git a/tools/assets/extract/extase_oot64/room_shape_resources.py b/tools/assets/extract/extase_oot64/room_shape_resources.py new file mode 100644 index 0000000000..935c5045b0 --- /dev/null +++ b/tools/assets/extract/extase_oot64/room_shape_resources.py @@ -0,0 +1,557 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import enum +from typing import TYPE_CHECKING + +from .. import oot64_data + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + + +from ..extase import ( + Resource, + File, + RESOURCE_PARSE_SUCCESS, +) +from ..extase.cdata_resources import ( + CDataResource, + CDataArrayNamedLengthResource, + CDataExt_Struct, + CDataExt_Value, + CDataExtWriteContext, + cdata_ext_Vec3s, +) + +from . import dlist_resources + + +class RoomShapeType(enum.Enum): + ROOM_SHAPE_TYPE_NORMAL = 0 + ROOM_SHAPE_TYPE_IMAGE = enum.auto() + ROOM_SHAPE_TYPE_CULLABLE = enum.auto() + + +class RoomShapeImageAmountType(enum.Enum): + ROOM_SHAPE_IMAGE_AMOUNT_SINGLE = 1 + ROOM_SHAPE_IMAGE_AMOUNT_MULTI = enum.auto() + + +def report_room_shape_at_segmented( + reporter: Resource, memory_context: "MemoryContext", address: int, name_base: str +): + def new_resource_pointed_to(file: File, offset: int): + resource_type = get_room_shape_resource_type(file, offset) + name_suffix = resource_type.__name__.removesuffix("Resource") + return resource_type( + file, + offset, + f"{name_base}_{address:08X}_{name_suffix}", + ) + + memory_context.report_resource_at_segmented( + reporter, address, Resource, new_resource_pointed_to + ) + + +def get_room_shape_resource_type(file: File, offset: int): + room_shape_type_int = file.data[offset] + room_shape_type = RoomShapeType(room_shape_type_int) + + resource_type = None + + if room_shape_type == RoomShapeType.ROOM_SHAPE_TYPE_NORMAL: + resource_type = RoomShapeNormalResource + + if room_shape_type == RoomShapeType.ROOM_SHAPE_TYPE_IMAGE: + room_shape_image_amount_type_int = file.data[offset + 1] + room_shape_image_amount_type = RoomShapeImageAmountType( + room_shape_image_amount_type_int + ) + if ( + room_shape_image_amount_type + == RoomShapeImageAmountType.ROOM_SHAPE_IMAGE_AMOUNT_SINGLE + ): + resource_type = RoomShapeImageSingleResource + if ( + room_shape_image_amount_type + == RoomShapeImageAmountType.ROOM_SHAPE_IMAGE_AMOUNT_MULTI + ): + resource_type = RoomShapeImageMultiResource + + if room_shape_type == RoomShapeType.ROOM_SHAPE_TYPE_CULLABLE: + resource_type = RoomShapeCullableResource + + assert resource_type is not None + + return resource_type + + +cdata_ext_RoomShapeBase = CDataExt_Struct( + ( + ( + "type", + CDataExt_Value("B").set_write_str_v(oot64_data.get_room_shape_type_name), + ), + ) +) + +cdata_ext_RoomShapeDListsEntry = CDataExt_Struct( + ( + ("opa", dlist_resources.cdata_ext_gfx_segmented), + ("xlu", dlist_resources.cdata_ext_gfx_segmented), + ) +) + + +# TODO check if this even needs a named length +class RoomShapeNormalEntryArrayResource(CDataArrayNamedLengthResource): + elem_cdata_ext = cdata_ext_RoomShapeDListsEntry + + def get_c_declaration_base(self): + return f"RoomShapeDListsEntry {self.symbol_name}[{self.length_name}]" + + def get_h_includes(self): + return ("room.h",) + + +class RoomShapeNormalResource(CDataResource): + def write_numEntries( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + address = resource.cdata_unpacked["entries"] + assert isinstance(address, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_expression_length_at_segmented(address)) + return True + + def report_entries(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + entries_resource = memory_context.report_resource_at_segmented( + resource, + address, + RoomShapeNormalEntryArrayResource, + lambda file, offset: RoomShapeNormalEntryArrayResource( + file, offset, f"{resource.name}_{address:08X}_DListsEntries" + ), + ) + assert isinstance(entries_resource, RoomShapeNormalEntryArrayResource) + numEntries = resource.cdata_unpacked["numEntries"] + assert isinstance(numEntries, int) + entries_resource.set_length(numEntries) + + def write_entries( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def write_entriesEnd( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + address = resource.cdata_unpacked["entries"] + assert isinstance(address, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + wctx.f.write(" + ") + wctx.f.write(memory_context.get_c_expression_length_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("base", cdata_ext_RoomShapeBase), + ("numEntries", CDataExt_Value("B").set_write(write_numEntries)), + ("pad2", CDataExt_Value.pad16), + ( + "entries", + CDataExt_Value("I").set_report(report_entries).set_write(write_entries), + ), + ( + "entriesEnd", + CDataExt_Value("I").set_write(write_entriesEnd), + ), + ) + ) + + def get_c_declaration_base(self): + return f"RoomShapeNormal {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError + + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("room.h",) + + +class RoomShapeDListsEntryResource(CDataResource): + cdata_ext = cdata_ext_RoomShapeDListsEntry + + def get_c_declaration_base(self): + return f"RoomShapeDListsEntry {self.symbol_name}" + + def get_c_reference(self, resource_offset): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError + + def get_h_includes(self): + return ("room.h",) + + +def report_RoomShapeImageBase_entry(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + RoomShapeDListsEntryResource, + lambda file, offset: RoomShapeDListsEntryResource( + file, offset, f"{resource.name}_{address:08X}_RoomShapeDListsEntry" + ), + ) + + +def write_RoomShapeImageBase_entry( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext +): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + +cdata_ext_RoomShapeImageBase = CDataExt_Struct( + ( + ("base", cdata_ext_RoomShapeBase), + ( + "amountType", + CDataExt_Value("B").set_write_str_v( + oot64_data.get_room_shape_image_amount_type_name + ), + ), + ("pad2", CDataExt_Value.pad16), + ( + "entry", + ( + CDataExt_Value("I") + .set_report(report_RoomShapeImageBase_entry) + .set_write(write_RoomShapeImageBase_entry) + ), + ), # RoomShapeDListsEntry* + ) +) + + +class JFIFResource(Resource): + def __init__(self, file, range_start, name): + super().__init__(file, range_start, range_start + 320 * 240 * 2, name) + + def try_parse_data(self, memory_context): + return RESOURCE_PARSE_SUCCESS + + needs_build = True + extracted_path_suffix = "" + + def get_filename_stem(self): + return f"{self.name}.jpg" + + def write_extracted(self, memory_context): + # TODO trim zeros at the end of the data + self.extract_to_path.write_bytes( + self.file.data[self.range_start : self.range_end] + ) + + def get_c_declaration_base(self): + return f"u64 {self.symbol_name}[SCREEN_WIDTH * SCREEN_HEIGHT * G_IM_SIZ_16b_BYTES / sizeof(u64)]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError + + def get_h_includes(self): + return ( + "ultra64.h", + "gfx.h", # for SCREEN_WIDTH, SCREEN_HEIGHT + ) + + +class RoomShapeImageSingleResource(CDataResource): + def report_source(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + JFIFResource, + lambda file, offset: JFIFResource( + file, + offset, + f"{resource.name}_{address:08X}_JFIF", + ), + ) + + def write_source( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("base", cdata_ext_RoomShapeImageBase), + ( + "source", + CDataExt_Value("I").set_report(report_source).set_write(write_source), + ), + ("unk_0C", CDataExt_Value.u32), + ("tlut", CDataExt_Value.pointer), # TODO + ("width", CDataExt_Value.u16), + ("height", CDataExt_Value.u16), + ("fmt", CDataExt_Value.u8), # TODO + ("siz", CDataExt_Value.u8), # TODO + ("tlutMode", CDataExt_Value.u16), + ("tlutCount", CDataExt_Value.u16), + ("pad1E", CDataExt_Value.pad16), + ) + ) + + def get_c_declaration_base(self): + return f"RoomShapeImageSingle {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError + + def get_h_includes(self): + return ("room.h",) + + +class RoomShapeImageMultiBgEntryArrayResource(CDataArrayNamedLengthResource): + def report_source(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + JFIFResource, + lambda file, offset: JFIFResource( + file, + offset, + f"{resource.name}_{address:08X}_JFIF", + ), + ) + + def write_source( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + elem_cdata_ext = CDataExt_Struct( + ( + ("unk_00", CDataExt_Value.u16), + ("bgCamIndex", CDataExt_Value.u8), + ("pad3", CDataExt_Value.pad8), + ( + "source", + CDataExt_Value("I").set_report(report_source).set_write(write_source), + ), + ("unk_0C", CDataExt_Value.u32), + ("tlut", CDataExt_Value.pointer), # TODO + ("width", CDataExt_Value.u16), + ("height", CDataExt_Value.u16), + ("fmt", CDataExt_Value.u8), # TODO + ("siz", CDataExt_Value.u8), # TODO + ("tlutMode", CDataExt_Value.u16), + ("tlutCount", CDataExt_Value.u16), + ("pad1A", CDataExt_Value.pad16), + ) + ) + + def get_c_declaration_base(self): + return f"RoomShapeImageMultiBgEntry {self.name}[{self.length_name}]" + + def get_h_includes(self): + return ("room.h",) + + +class RoomShapeImageMultiResource(CDataResource): + def write_numBackgrounds( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + address = resource.cdata_unpacked["backgrounds"] + assert isinstance(address, int) + backgrounds_resource = memory_context.resolve_segmented(address).get_resource( + RoomShapeImageMultiBgEntryArrayResource + ) + wctx.f.write(wctx.line_prefix) + wctx.f.write(backgrounds_resource.length_name) + return True + + def report_backgrounds(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + backgrounds_resource = memory_context.report_resource_at_segmented( + resource, + address, + RoomShapeImageMultiBgEntryArrayResource, + lambda file, offset: RoomShapeImageMultiBgEntryArrayResource( + file, + offset, + f"{resource.name}_{address:08X}_RoomShapeImageMultiBgEntries", + ), + ) + backgrounds_resource.set_length(resource.cdata_unpacked["numBackgrounds"]) + + def write_backgrounds( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("base", cdata_ext_RoomShapeImageBase), + ("numBackgrounds", CDataExt_Value("B").set_write(write_numBackgrounds)), + ("pad9", CDataExt_Value.pad8), + ("padA", CDataExt_Value.pad16), + ( + "backgrounds", + ( + CDataExt_Value("I") + .set_report(report_backgrounds) + .set_write(write_backgrounds) + ), + ), # RoomShapeImageMultiBgEntry* + ) + ) + + def get_c_declaration_base(self): + return f"RoomShapeImageMulti {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError + + def get_h_includes(self): + return ("room.h",) + + +class RoomShapeCullableEntryArrayResource(CDataArrayNamedLengthResource): + elem_cdata_ext = CDataExt_Struct( + ( + ("boundsSphereCenter", cdata_ext_Vec3s), + ("boundsSphereRadius", CDataExt_Value.s16), + ("opa", dlist_resources.cdata_ext_gfx_segmented), + ("xlu", dlist_resources.cdata_ext_gfx_segmented), + ) + ) + + def get_c_declaration_base(self): + return f"RoomShapeCullableEntry {self.symbol_name}[{self.length_name}]" + + def get_h_includes(self): + return ("room.h",) + + +class RoomShapeCullableResource(CDataResource): + def write_numEntries( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + address = resource.cdata_unpacked["entries"] + assert isinstance(address, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_expression_length_at_segmented(address)) + return True + + def report_entries(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + entries_resource = memory_context.report_resource_at_segmented( + resource, + address, + RoomShapeCullableEntryArrayResource, + lambda file, offset: RoomShapeCullableEntryArrayResource( + file, offset, f"{resource.name}_{address:08X}_CullableEntries" + ), + ) + assert isinstance(entries_resource, RoomShapeCullableEntryArrayResource) + numEntries = resource.cdata_unpacked["numEntries"] + assert isinstance(numEntries, int) + entries_resource.set_length(numEntries) + + def write_entries( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def write_entriesEnd( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + address = resource.cdata_unpacked["entries"] + assert isinstance(address, int) + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + wctx.f.write(" + ") + wctx.f.write(memory_context.get_c_expression_length_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("base", cdata_ext_RoomShapeBase), + ("numEntries", CDataExt_Value("B").set_write(write_numEntries)), + ("pad2", CDataExt_Value.pad16), + ( + "entries", + CDataExt_Value("I").set_report(report_entries).set_write(write_entries), + ), + ( + "entriesEnd", + CDataExt_Value("I").set_write(write_entriesEnd), + ), + ) + ) + + def get_c_declaration_base(self): + return f"RoomShapeCullable {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError + + def get_h_includes(self): + return ("room.h",) diff --git a/tools/assets/extract/extase_oot64/scene_commands_resource.py b/tools/assets/extract/extase_oot64/scene_commands_resource.py new file mode 100644 index 0000000000..57f2cbf440 --- /dev/null +++ b/tools/assets/extract/extase_oot64/scene_commands_resource.py @@ -0,0 +1,717 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import enum +import struct +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase import ( + File, + Resource, + RESOURCE_PARSE_SUCCESS, + ResourceParseInProgress, + ResourceParseWaiting, +) +from ..extase.cdata_resources import ( + CDataArrayResource, + CDataExt_Value, + CDataExtWriteContext, +) + +from .. import oot64_data + +from . import scene_rooms_resources +from . import collision_resources +from . import room_shape_resources +from . import misc_resources + + +def _SHIFTR(v: int, s: int, w: int): + assert isinstance(v, int) + assert isinstance(s, int) + assert isinstance(w, int) + assert v >= 0 + assert s >= 0 + assert w >= 1 + return (v >> s) & ((1 << w) - 1) + + +VERBOSE_NOT_FULLY_PARSED_SCENECMD = False + + +class SceneCmdId(enum.Enum): + # keep the SCENE_CMD_ID_ prefix for grepability + SCENE_CMD_ID_SPAWN_LIST = 0 + SCENE_CMD_ID_ACTOR_LIST = enum.auto() + SCENE_CMD_ID_UNUSED_2 = enum.auto() + SCENE_CMD_ID_COLLISION_HEADER = enum.auto() + SCENE_CMD_ID_ROOM_LIST = enum.auto() + SCENE_CMD_ID_WIND_SETTINGS = enum.auto() + SCENE_CMD_ID_ENTRANCE_LIST = enum.auto() + SCENE_CMD_ID_SPECIAL_FILES = enum.auto() + SCENE_CMD_ID_ROOM_BEHAVIOR = enum.auto() + SCENE_CMD_ID_UNDEFINED_9 = enum.auto() + SCENE_CMD_ID_ROOM_SHAPE = enum.auto() + SCENE_CMD_ID_OBJECT_LIST = enum.auto() + SCENE_CMD_ID_LIGHT_LIST = enum.auto() + SCENE_CMD_ID_PATH_LIST = enum.auto() + SCENE_CMD_ID_TRANSITION_ACTOR_LIST = enum.auto() + SCENE_CMD_ID_LIGHT_SETTINGS_LIST = enum.auto() + SCENE_CMD_ID_TIME_SETTINGS = enum.auto() + SCENE_CMD_ID_SKYBOX_SETTINGS = enum.auto() + SCENE_CMD_ID_SKYBOX_DISABLES = enum.auto() + SCENE_CMD_ID_EXIT_LIST = enum.auto() + SCENE_CMD_ID_END = enum.auto() + SCENE_CMD_ID_SOUND_SETTINGS = enum.auto() + SCENE_CMD_ID_ECHO_SETTINGS = enum.auto() + SCENE_CMD_ID_CUTSCENE_DATA = enum.auto() + SCENE_CMD_ID_ALTERNATE_HEADER_LIST = enum.auto() + SCENE_CMD_ID_MISC_SETTINGS = enum.auto() + + +scene_cmd_macro_name_by_cmd_id = { + SceneCmdId.SCENE_CMD_ID_SPAWN_LIST: "SCENE_CMD_SPAWN_LIST", + SceneCmdId.SCENE_CMD_ID_ACTOR_LIST: "SCENE_CMD_ACTOR_LIST", + SceneCmdId.SCENE_CMD_ID_UNUSED_2: "SCENE_CMD_UNUSED_02", + SceneCmdId.SCENE_CMD_ID_COLLISION_HEADER: "SCENE_CMD_COL_HEADER", + SceneCmdId.SCENE_CMD_ID_ROOM_LIST: "SCENE_CMD_ROOM_LIST", + SceneCmdId.SCENE_CMD_ID_WIND_SETTINGS: "SCENE_CMD_WIND_SETTINGS", + SceneCmdId.SCENE_CMD_ID_ENTRANCE_LIST: "SCENE_CMD_ENTRANCE_LIST", + SceneCmdId.SCENE_CMD_ID_SPECIAL_FILES: "SCENE_CMD_SPECIAL_FILES", + SceneCmdId.SCENE_CMD_ID_ROOM_BEHAVIOR: "SCENE_CMD_ROOM_BEHAVIOR", + SceneCmdId.SCENE_CMD_ID_UNDEFINED_9: "SCENE_CMD_UNK_09", + SceneCmdId.SCENE_CMD_ID_ROOM_SHAPE: "SCENE_CMD_ROOM_SHAPE", + SceneCmdId.SCENE_CMD_ID_OBJECT_LIST: "SCENE_CMD_OBJECT_LIST", + SceneCmdId.SCENE_CMD_ID_LIGHT_LIST: "SCENE_CMD_LIGHT_LIST", + SceneCmdId.SCENE_CMD_ID_PATH_LIST: "SCENE_CMD_PATH_LIST", + SceneCmdId.SCENE_CMD_ID_TRANSITION_ACTOR_LIST: "SCENE_CMD_TRANSITION_ACTOR_LIST", + SceneCmdId.SCENE_CMD_ID_LIGHT_SETTINGS_LIST: "SCENE_CMD_ENV_LIGHT_SETTINGS", + SceneCmdId.SCENE_CMD_ID_TIME_SETTINGS: "SCENE_CMD_TIME_SETTINGS", + SceneCmdId.SCENE_CMD_ID_SKYBOX_SETTINGS: "SCENE_CMD_SKYBOX_SETTINGS", + SceneCmdId.SCENE_CMD_ID_SKYBOX_DISABLES: "SCENE_CMD_SKYBOX_DISABLES", + SceneCmdId.SCENE_CMD_ID_EXIT_LIST: "SCENE_CMD_EXIT_LIST", + SceneCmdId.SCENE_CMD_ID_END: "SCENE_CMD_END", + SceneCmdId.SCENE_CMD_ID_SOUND_SETTINGS: "SCENE_CMD_SOUND_SETTINGS", + SceneCmdId.SCENE_CMD_ID_ECHO_SETTINGS: "SCENE_CMD_ECHO_SETTINGS", + SceneCmdId.SCENE_CMD_ID_CUTSCENE_DATA: "SCENE_CMD_CUTSCENE_DATA", + SceneCmdId.SCENE_CMD_ID_ALTERNATE_HEADER_LIST: "SCENE_CMD_ALTERNATE_HEADER_LIST", + SceneCmdId.SCENE_CMD_ID_MISC_SETTINGS: "SCENE_CMD_MISC_SETTINGS", +} + + +class SceneCommandsResource(Resource, can_size_be_unknown=True): + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, None, name) + self.parsed_commands: set[SceneCmdId] = set() + self.player_entry_list_length = None + self.room_list_length = None + self.exit_list_length = None + + def try_parse_data(self, memory_context: "MemoryContext"): + data = self.file.data[self.range_start :] + + new_progress_done = [] + waiting_for = [] + + offset = 0 + cmd_id = None + end_offset = None + + found_commands: set[SceneCmdId] = set() + + while offset + 8 <= len(data): + (cmd_id_int, data1, pad2, data2_I) = struct.unpack_from( + ">BBHI", data, offset + ) + (_, data2_H0, data2_H1) = struct.unpack_from(">IHH", data, offset) + (_, data2_B0, data2_B1, data2_B2, data2_B3) = struct.unpack_from( + ">IBBBB", data, offset + ) + + offset += 8 + cmd_id = SceneCmdId(cmd_id_int) + assert pad2 == 0 + + found_commands.add(cmd_id) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_END: + assert data1 == 0 + assert data2_I == 0 + end_offset = offset + self.parsed_commands.add(cmd_id) + break + + if cmd_id in self.parsed_commands: + continue + + if cmd_id == SceneCmdId.SCENE_CMD_ID_ACTOR_LIST: + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.ActorEntryListResource, + lambda file, offset: scene_rooms_resources.ActorEntryListResource( + file, offset, f"{self.name}_{data2_I:08X}_ActorEntryList" + ), + ) + resource.set_length(data1) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported ActorEntryListResource", cmd_id)) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_OBJECT_LIST: + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.ObjectListResource, + lambda file, offset: scene_rooms_resources.ObjectListResource( + file, offset, f"{self.name}_{data2_I:08X}_ObjectList" + ), + ) + resource.set_length(data1) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported ObjectListResource", cmd_id)) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_ROOM_SHAPE: + room_shape_resources.report_room_shape_at_segmented( + self, memory_context, data2_I, self.name + ) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported room shape resource", cmd_id)) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_ROOM_LIST: + self.room_list_length = data1 + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.RoomListResource, + lambda file, offset: scene_rooms_resources.RoomListResource( + file, offset, f"{self.name}_{data2_I:08X}_RoomList" + ), + ) + resource.set_length(data1) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported RoomListResource", cmd_id)) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_COLLISION_HEADER: + assert data1 == 0 + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + collision_resources.CollisionResource, + lambda file, offset: collision_resources.CollisionResource( + file, offset, f"{self.name}_{data2_I:08X}_Col" + ), + ) + new_progress_done.append(("reported CollisionResource", cmd_id)) + if resource.is_data_parsed: + self.exit_list_length = resource.length_exitList + self.parsed_commands.add(cmd_id) + new_progress_done.append( + ("set self.exit_list_length from CollisionResource", cmd_id) + ) + else: + waiting_for.append( + ( + "CollisionResource to be parsed to set self.exit_list_length", + cmd_id, + resource, + ) + ) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_ENTRANCE_LIST: + assert data1 == 0 + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.SpawnListResource, + lambda file, offset: scene_rooms_resources.SpawnListResource( + file, offset, f"{self.name}_{data2_I:08X}_SpawnList" + ), + ) + new_progress_done.append(("reported SpawnListResource", cmd_id)) + if ( + self.player_entry_list_length is not None + and self.room_list_length is not None + ): + resource.player_entry_list_length = self.player_entry_list_length + resource.room_list_length = self.room_list_length + self.parsed_commands.add(cmd_id) + new_progress_done.append( + ("passed lengths to SpawnListResource", cmd_id) + ) + else: + waiting_for.append( + ( + "self.player_entry_list_length and self.room_list_length" + " to pass to SpawnListResource", + cmd_id, + ) + ) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_SPAWN_LIST: + self.player_entry_list_length = data1 + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.ActorEntryListResource, + lambda file, offset: scene_rooms_resources.ActorEntryListResource( + file, offset, f"{self.name}_{data2_I:08X}_PlayerEntryList" + ), + ) + resource.set_length(data1) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported ActorEntryListResource", cmd_id)) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_EXIT_LIST: + # TODO length from collision + assert data1 == 0 + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.ExitListResource, + lambda file, offset: scene_rooms_resources.ExitListResource( + file, offset, f"{self.name}_{data2_I:08X}_ExitList" + ), + ) + new_progress_done.append(("reported ExitListResource", cmd_id)) + if self.exit_list_length is not None: + # TODO this doesnt work very well, eg need to trim to avoid overlaps + length = self.exit_list_length + # blindly align length to 2 (could/should check for zeros) + length = max(2, (length + 1) // 2 * 2) + # trim based on overlaps + while True: + _, other_resource = resource.file.get_resource_at( + resource.range_start + + length * resource.elem_cdata_ext.size + - 1 + ) + if other_resource is resource: + break + length -= 2 + assert length > 0 + resource.set_length(length) + self.parsed_commands.add(cmd_id) + new_progress_done.append( + ("passed length to ExitListResource", cmd_id, resource) + ) + else: + waiting_for.append( + ( + "self.exit_list_length to (guess a length to) pass to ExitListResource", + cmd_id, + ) + ) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_LIGHT_SETTINGS_LIST: + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.EnvLightSettingsListResource, + lambda file, offset: scene_rooms_resources.EnvLightSettingsListResource( + file, offset, f"{self.name}_{data2_I:08X}_EnvLightSettingsList" + ), + ) + resource.set_length(data1) + self.parsed_commands.add(cmd_id) + new_progress_done.append( + ("reported EnvLightSettingsListResource", cmd_id) + ) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_TRANSITION_ACTOR_LIST: + resource = memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.TransitionActorEntryListResource, + lambda file, offset: scene_rooms_resources.TransitionActorEntryListResource( + file, + offset, + f"{self.name}_{data2_I:08X}_TransitionActorEntryList", + ), + ) + resource.set_length(data1) + self.parsed_commands.add(cmd_id) + new_progress_done.append( + ("reported TransitionActorEntryListResource", cmd_id) + ) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_PATH_LIST: + assert data1 == 0 + memory_context.report_resource_at_segmented( + self, + data2_I, + scene_rooms_resources.PathListResource, + lambda file, offset: scene_rooms_resources.PathListResource( + file, offset, f"{self.name}_{data2_I:08X}_PathList" + ), + ) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported PathListResource", cmd_id)) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_ALTERNATE_HEADER_LIST: + assert data1 == 0 + memory_context.report_resource_at_segmented( + self, + data2_I, + AltHeadersResource, + lambda file, offset: AltHeadersResource( + file, offset, f"{self.name}_{data2_I:08X}_AltHeaders" + ), + ) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported AltHeadersResource", cmd_id)) + + if cmd_id == SceneCmdId.SCENE_CMD_ID_CUTSCENE_DATA: + assert data1 == 0 + memory_context.report_resource_at_segmented( + self, + data2_I, + misc_resources.CutsceneResource, + lambda file, offset: misc_resources.CutsceneResource( + file, offset, f"{self.name}_{data2_I:08X}_Cs" + ), + ) + self.parsed_commands.add(cmd_id) + new_progress_done.append(("reported CutsceneResource", cmd_id)) + + if cmd_id != SceneCmdId.SCENE_CMD_ID_END: + raise Exception("reached end of data without encountering end marker") + assert end_offset is not None + + # Nothing to parse for these commands + found_commands.discard(SceneCmdId.SCENE_CMD_ID_SOUND_SETTINGS) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_MISC_SETTINGS) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_SPECIAL_FILES) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_SKYBOX_SETTINGS) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_TIME_SETTINGS) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_ROOM_BEHAVIOR) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_ECHO_SETTINGS) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_SKYBOX_DISABLES) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_UNDEFINED_9) + found_commands.discard(SceneCmdId.SCENE_CMD_ID_WIND_SETTINGS) + + self.range_end = self.range_start + end_offset + assert self.parsed_commands.issubset(found_commands) + + if found_commands - self.parsed_commands: + if VERBOSE_NOT_FULLY_PARSED_SCENECMD: + print( + "NOT FULLY PARSED:", + self, + "Found commands:", + found_commands, + "Parsed commands:", + self.parsed_commands, + "FOUND BUT NOT PARSED:", + found_commands - self.parsed_commands, + ) + + if waiting_for: + if new_progress_done: + raise ResourceParseInProgress( + new_progress_done=new_progress_done, waiting_for=waiting_for + ) + else: + raise ResourceParseWaiting(waiting_for=waiting_for) + + assert self.parsed_commands == found_commands + return RESOURCE_PARSE_SUCCESS + + def get_c_declaration_base(self): + return f"SceneCmd {self.symbol_name}[]" + + def write_extracted(self, memory_context): + data = self.file.data[self.range_start : self.range_end] + with self.extract_to_path.open("w") as f: + if not self.braces_in_source: + f.write("{\n") + for offset in range(0, len(data), 8): + (cmd_id_int, data1, pad2, data2_I) = struct.unpack_from( + ">BBHI", data, offset + ) + (_, data2_H0, data2_H1) = struct.unpack_from(">IHH", data, offset) + (_, data2_B0, data2_B1, data2_B2, data2_B3) = struct.unpack_from( + ">IBBBB", data, offset + ) + cmd_id = SceneCmdId(cmd_id_int) + f.write(" " * 4) + f.write(scene_cmd_macro_name_by_cmd_id[cmd_id]) + f.write("(") + if cmd_id == SceneCmdId.SCENE_CMD_ID_SPAWN_LIST: + address = data2_I + f.write( + memory_context.get_c_expression_length_at_segmented(address) + ) + f.write(", ") + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_ACTOR_LIST: + address = data2_I + f.write( + memory_context.get_c_expression_length_at_segmented(address) + ) + f.write(", ") + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_UNUSED_2: + raise NotImplementedError(cmd_id) + if cmd_id == SceneCmdId.SCENE_CMD_ID_COLLISION_HEADER: + assert data1 == 0 + address = data2_I + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_ROOM_LIST: + address = data2_I + f.write( + memory_context.get_c_expression_length_at_segmented(address) + ) + f.write(", ") + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_WIND_SETTINGS: + assert data1 == 0 + # TODO cast x,y,z to s8 + xDir = data2_B0 + yDir = data2_B1 + zDir = data2_B2 + strength = data2_B3 + f.write(f"{xDir}, {yDir}, {zDir}, {strength}") + if cmd_id == SceneCmdId.SCENE_CMD_ID_ENTRANCE_LIST: + assert data1 == 0 + address = data2_I + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_SPECIAL_FILES: + naviQuestHintFileId = data1 + keepObjectId = data2_I + f.write( + f"{oot64_data.get_navi_quest_hint_file_id_name(naviQuestHintFileId)}, " + f"{oot64_data.get_object_id_name(keepObjectId)}" + ) + if cmd_id == SceneCmdId.SCENE_CMD_ID_ROOM_BEHAVIOR: + gpFlags1 = data1 + gpFlags2 = data2_I + behaviorType1 = gpFlags1 + behaviorType2 = _SHIFTR(gpFlags2, 0, 8) + lensMode = _SHIFTR(gpFlags2, 8, 1) + disableWarpSongs = _SHIFTR(gpFlags2, 10, 1) + behaviorType1_name = oot64_data.get_room_behavior_type1_name( + behaviorType1 + ) + behaviorType2_name = oot64_data.get_room_behavior_type2_name( + behaviorType2 + ) + lensMode_name = oot64_data.get_lens_mode_name(lensMode) + disableWarpSongs_name = ( + "true /* no warp songs */" + if disableWarpSongs + else "false /* warp songs enabled */" + ) + f.write( + f"{behaviorType1_name}, {behaviorType2_name}, {lensMode_name}, {disableWarpSongs_name}" + ) + if cmd_id == SceneCmdId.SCENE_CMD_ID_UNDEFINED_9: + assert data1 == 0 + assert data2_I == 0 + if cmd_id == SceneCmdId.SCENE_CMD_ID_ROOM_SHAPE: + assert data1 == 0 # TODO these asserts should be done on parse? + address = data2_I + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_OBJECT_LIST: + address = data2_I + f.write( + memory_context.get_c_expression_length_at_segmented(address) + ) + f.write(", ") + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_LIGHT_LIST: + raise NotImplementedError(cmd_id) + if cmd_id == SceneCmdId.SCENE_CMD_ID_PATH_LIST: + assert data1 == 0 + address = data2_I + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_TRANSITION_ACTOR_LIST: + address = data2_I + f.write( + memory_context.get_c_expression_length_at_segmented(address) + ) + f.write(", ") + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_LIGHT_SETTINGS_LIST: + address = data2_I + f.write( + memory_context.get_c_expression_length_at_segmented(address) + ) + f.write(", ") + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_TIME_SETTINGS: + assert data1 == 0 + hour = data2_B0 + min_ = data2_B1 + timeSpeed = data2_B2 + assert data2_B3 == 0 + + hour_str = "0xFF" if hour == 0xFF else str(hour) + min_str = "0xFF" if min_ == 0xFF else str(min_) + timeSpeed_str = "0xFF" if timeSpeed == 0xFF else str(timeSpeed) + + if hour == 0xFF or min_ == 0xFF: + f.write("/* don't set time */ ") + f.write(f"{hour_str}, {min_str}, {timeSpeed_str}") + if timeSpeed == 0xFF or timeSpeed == 0: + f.write(" /* time doesn't move */") + if cmd_id == SceneCmdId.SCENE_CMD_ID_SKYBOX_SETTINGS: + assert data1 == 0 + skyboxId = data2_B0 + skyboxConfig = data2_B1 + envLightMode = data2_B2 + assert data2_B3 == 0 + f.write( + f"{oot64_data.get_skybox_id(skyboxId)}, " + f"{skyboxConfig}, " + f"{oot64_data.get_light_mode(envLightMode)}" + ) + if cmd_id == SceneCmdId.SCENE_CMD_ID_SKYBOX_DISABLES: + assert data1 == 0 + skyboxDisabled = data2_B0 + sunMoonDisabled = data2_B1 + assert data2_B2 == data2_B3 == 0 + skyboxDisabled_name = ( + "true /* no skybox */" + if skyboxDisabled + else "false /* skybox enabled */" + ) + sunMoonDisabled_name = ( + "true /* no sun/moon */" + if sunMoonDisabled + else "false /* sun/moon enabled */" + ) + f.write(f"{skyboxDisabled_name}, {sunMoonDisabled_name}") + if cmd_id == SceneCmdId.SCENE_CMD_ID_EXIT_LIST: + assert data1 == 0 + address = data2_I + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_END: + assert data1 == 0 + assert data2_I == 0 + if cmd_id == SceneCmdId.SCENE_CMD_ID_SOUND_SETTINGS: + specId = data1 + assert data2_B0 == 0 + assert data2_B1 == 0 + natureAmbienceId = data2_B2 + seqId = data2_B3 + natureAmbienceId_name = oot64_data.get_nature_ambience_id_name( + natureAmbienceId + ) + seqId_name = oot64_data.get_sequence_id_name(seqId) + f.write(f"{specId}, {natureAmbienceId_name}, {seqId_name}") + if cmd_id == SceneCmdId.SCENE_CMD_ID_ECHO_SETTINGS: + assert data1 == 0 + assert data2_B0 == data2_B1 == data2_B2 == 0 + echo = data2_B3 + f.write(f"{echo}") + if cmd_id == SceneCmdId.SCENE_CMD_ID_CUTSCENE_DATA: + assert data1 == 0 + address = data2_I + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_ALTERNATE_HEADER_LIST: + assert data1 == 0 + address = data2_I + f.write(memory_context.get_c_reference_at_segmented(address)) + if cmd_id == SceneCmdId.SCENE_CMD_ID_MISC_SETTINGS: + sceneCamType = data1 + worldMapLocation = data2_I + sceneCamType_name = oot64_data.get_scene_cam_type_name(sceneCamType) + f.write(f"{sceneCamType_name}, {worldMapLocation}") + + f.write("),\n") + + if not self.braces_in_source: + f.write("}\n") + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError + + def get_c_includes(self): + return ( + "array_count.h", + "object.h", # for OBJECT_* + # TODO these are not always needed: + "sequence.h", # for NATURE_ID_* and NA_BGM_* + "skybox.h", # for SKYBOX_* + ) + + def get_h_includes(self): + return ("scene.h",) + + +class AltHeadersResource(CDataArrayResource): + def report_elem(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + if address != 0: + memory_context.report_resource_at_segmented( + resource, + address, + SceneCommandsResource, + lambda file, offset: SceneCommandsResource( + file, offset, f"{resource.name}_{address:08X}_Cmds" + ), + ) + + def write_elem( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + if address == 0: + wctx.f.write("NULL") + else: + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + elem_cdata_ext = ( + CDataExt_Value("I").set_report(report_elem).set_write(write_elem) + ) # SceneCmd* + + def try_parse_data(self, memory_context): + length = 0 + for i, (v,) in enumerate( + struct.iter_unpack(">I", self.file.data[self.range_start :]) + ): + if v == 0: + if i < 3: + length = i + 1 + continue + else: + break + + try: + resolve_result = memory_context.resolve_segmented(v) + except: + break + data_may_be_scenecmds = False + for j in range( + resolve_result.file_offset, len(resolve_result.file.data), 8 + ): + cmd_id_int = resolve_result.file.data[j] + try: + cmd_id = SceneCmdId(cmd_id_int) + except ValueError: + break + if cmd_id == SceneCmdId.SCENE_CMD_ID_END: + data_may_be_scenecmds = True + break + if not data_may_be_scenecmds: + break + length = i + 1 + assert length > 0 + self.set_length(length) + return super().try_parse_data(memory_context) + + def get_c_declaration_base(self): + return f"SceneCmd* {self.symbol_name}[]" + + def get_h_includes(self): + return ("scene.h",) diff --git a/tools/assets/extract/extase_oot64/scene_rooms_resources.py b/tools/assets/extract/extase_oot64/scene_rooms_resources.py new file mode 100644 index 0000000000..d3b8903f2a --- /dev/null +++ b/tools/assets/extract/extase_oot64/scene_rooms_resources.py @@ -0,0 +1,457 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase import ( + ResourceParseWaiting, +) + +from ..extase.cdata_resources import ( + CDataArrayResource, + CDataArrayNamedLengthResource, + CDataExt_Struct, + CDataExt_Array, + CDataExt_Value, + CDataExtWriteContext, + cdata_ext_Vec3s, + INDENT, + Vec3sArrayResource, + fmt_hex_s, +) + +from .. import oot64_data + + +VERBOSE_SPAWN_LIST_LENGTH_GUESSING = False + + +class ActorEntryListResource(CDataArrayNamedLengthResource): + def write_elem(resource, memory_context, v, wctx: CDataExtWriteContext): + assert isinstance(v, dict) + f = wctx.f + f.write(wctx.line_prefix) + f.write("{\n") + + f.write(wctx.line_prefix + INDENT) + f.write(oot64_data.get_actor_id_name(v["id"])) + f.write(",\n") + + f.write(wctx.line_prefix + INDENT) + f.write("{ ") + f.write(", ".join(f"{p:6}" for p in (v["pos"][axis] for axis in "xyz"))) + f.write(" }, // pos\n") + + f.write(wctx.line_prefix + INDENT) + f.write("{ ") + f.write(", ".join(fmt_hex_s(r, 4) for r in (v["rot"][axis] for axis in "xyz"))) + f.write(" }, // rot\n") + + f.write(wctx.line_prefix + INDENT) + params = v["params"] + f.write(fmt_hex_s(params, 4)) + if params < 0: + params_u16 = params + 0x1_0000 + f.write(f" /* 0x{params_u16:04X} */") + f.write(", // params\n") + + f.write(wctx.line_prefix) + f.write("}") + + return True + + elem_cdata_ext = CDataExt_Struct( + ( + ("id", CDataExt_Value.s16), + ("pos", cdata_ext_Vec3s), + ("rot", cdata_ext_Vec3s), + ("params", CDataExt_Value.s16), + ) + ).set_write(write_elem) + + def get_c_declaration_base(self): + return f"ActorEntry {self.symbol_name}[{self.length_name}]" + + def get_c_includes(self): + return ("actor.h",) + + def get_h_includes(self): + return ("scene.h",) + + +class ObjectListResource(CDataArrayNamedLengthResource): + elem_cdata_ext = CDataExt_Value("h").set_write_str_v( + lambda v: oot64_data.get_object_id_name(v) + ) + + def get_c_declaration_base(self): + return f"s16 {self.symbol_name}[{self.length_name}]" + + def get_c_includes(self): + return ("object.h",) + + def get_h_includes(self): + return ("ultra64.h",) + + +def write_RomFile( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext +): + assert isinstance(v, dict) + vromStart = v["vromStart"] + vromEnd = v["vromEnd"] + rom_file_name = memory_context.get_dmadata_table_rom_file_name_from_vrom( + vromStart, vromEnd + ) + wctx.f.write(wctx.line_prefix) + wctx.f.write(f"ROM_FILE({rom_file_name})") + return True + + +cdata_ext_RomFile = CDataExt_Struct( + ( + ("vromStart", CDataExt_Value.u32), + ("vromEnd", CDataExt_Value.u32), + ) +).set_write(write_RomFile) + + +class RoomListResource(CDataArrayNamedLengthResource): + elem_cdata_ext = cdata_ext_RomFile + + def get_c_declaration_base(self): + return f"RomFile {self.symbol_name}[{self.length_name}]" + + def get_c_includes(self): + # TODO use DECLARE_ROM_SEGMENT to declare rooms rom files + return ("segment_symbols.h",) + + def get_h_includes(self): + return ("romfile.h",) + + +class SpawnListResource(CDataArrayResource): + elem_cdata_ext = CDataExt_Struct( + ( + ("playerEntryIndex", CDataExt_Value.u8), + ("room", CDataExt_Value.u8), + ) + ) + + # (eventually) set by SceneCommandsResource + player_entry_list_length = None + room_list_length = None + + def try_parse_data(self, memory_context): + if self.player_entry_list_length is None or self.room_list_length is None: + raise ResourceParseWaiting( + waiting_for=[ + msg + for is_waiting, msg in ( + ( + self.player_entry_list_length is None, + "self.player_entry_list_length", + ), + ( + self.room_list_length is None, + "self.room_list_length", + ), + ) + if is_waiting + ] + ) + + # File.name comes from the Name attribute on a element, + # which is also used to make the path to the baserom file to read from. + # So File.name is the name of the baserom file. + # This may change in the future though ¯\_(ツ)_/¯ + rom_file_name = self.file.name + # This way we can get the scene ID of the file + scene_id = oot64_data.get_scene_id_from_rom_file_name(rom_file_name) + scene_id_name = oot64_data.get_scene_id_name(scene_id) + # Get all the spawns used by all entrances using the scene + entrance_ids = oot64_data.get_entrance_ids_from_scene_id_name(scene_id_name) + all_used_spawns = set() + for entrance_id in entrance_ids: + entrance_spawn = oot64_data.get_entrance_spawn(entrance_id) + all_used_spawns.add(entrance_spawn) + num_spawns = max(all_used_spawns) + 1 + + # Handle the cases where the entrance table references spawn outside the spawn list, + # by checking if the indices in the last spawn in the list make sense. + # This is required for a few scenes in practice, otherwise the spawn list and exit list overlap. + while True: + last_spawn_unpacked = self.elem_cdata_ext.unpack_from( + self.file.data, + self.range_start + (num_spawns - 1) * self.elem_cdata_ext.size, + ) + if ( + last_spawn_unpacked["playerEntryIndex"] < self.player_entry_list_length + and last_spawn_unpacked["room"] < self.room_list_length + ): + break + if VERBOSE_SPAWN_LIST_LENGTH_GUESSING: + print( + self, + "Removing one spawn because the last spawn of the list has bad indices", + last_spawn_unpacked, + num_spawns, + "->", + num_spawns - 1, + ) + num_spawns -= 1 + assert num_spawns > 0 + + # Handle the case where there may be an unused spawn, in the place of + # what would otherwise be padding. + if oot64_data.I_D_OMEGALUL: + assert self.elem_cdata_ext.size == 2 + if num_spawns % 2 == 1: + data_to_next_4align = self.file.data[ + self.range_start + num_spawns * 2 : + ][:2] + if data_to_next_4align != b"\x00\x00": + if VERBOSE_SPAWN_LIST_LENGTH_GUESSING: + print( + self, + "Adding one spawn because the next supposedly-padding" + " two bytes are not padding (not zero)", + bytes(data_to_next_4align), + num_spawns, + "->", + num_spawns + 1, + ) + num_spawns += 1 + + # Trim the list to avoid overlaps + # TODO this may be linked to headers for cutscene layers not having the spawns the entrance table expects + # for example spot00 hyrule field seems to always have a single 0,0 spawn for cutscene layers? + # (so the above approach using the entrance table does not generalize to cutscene layers) + # so it may be relevant to have the layer type when parsing the spawn list + # Alternatively, somehow trim the variable-length resources when overlapping + while True: + range_end = self.range_start + num_spawns * self.elem_cdata_ext.size + result, resource = self.file.get_resource_at(range_end - 1) + if resource is self: + break + if VERBOSE_SPAWN_LIST_LENGTH_GUESSING: + print( + self, + "Removing one spawn because the last spawn of the list overlaps with another resource", + resource, + num_spawns, + "->", + num_spawns - 1, + ) + num_spawns -= 1 + assert num_spawns > 0 + + self.set_length(num_spawns) + return super().try_parse_data(memory_context) + + def get_c_declaration_base(self): + return f"Spawn {self.symbol_name}[]" + + def get_h_includes(self): + return ("scene.h",) + + +class ExitListResource(CDataArrayResource): + elem_cdata_ext = CDataExt_Value("h").set_write_str_v( + lambda v: oot64_data.get_entrance_id_name(v) + ) + + # length set by SceneCommandsResource.try_parse_data + + def get_c_declaration_base(self): + return f"s16 {self.symbol_name}[]" + + def get_h_includes(self): + return ("ultra64.h",) + + +class EnvLightSettingsListResource(CDataArrayNamedLengthResource): + + def write_color(resource, memory_context, v, wctx: CDataExtWriteContext): + assert not wctx.inhibit_top_braces + wctx.f.write(wctx.line_prefix) + wctx.f.write("{ " + f"{v[0]:3}, {v[1]:3}, {v[2]:3}" + " }") + return True + + color_cdata_ext = CDataExt_Array(CDataExt_Value.u8, 3).set_write(write_color) + + def write_dir(resource, memory_context, v, wctx: CDataExtWriteContext): + assert not wctx.inhibit_top_braces + wctx.f.write(wctx.line_prefix) + wctx.f.write("{ " + f"{v[0]:4}, {v[1]:4}, {v[2]:4}" + " }") + return True + + dir_cdata_ext = CDataExt_Array(CDataExt_Value.s8, 3).set_write(write_dir) + + def write_blendRateAndFogNear(v): + blendRate = (v >> 10) * 4 + fogNear = v & 0x3FF + return f"(({blendRate} / 4) << 10) | {fogNear}" + + elem_cdata_ext = CDataExt_Struct( + ( + ("ambientColor", color_cdata_ext), + ("light1Dir", dir_cdata_ext), + ("light1Color", color_cdata_ext), + ("light2Dir", dir_cdata_ext), + ("light2Color", color_cdata_ext), + ("fogColor", color_cdata_ext), + ( + "blendRateAndFogNear", + CDataExt_Value("h").set_write_str_v(write_blendRateAndFogNear), + ), + ("zFar", CDataExt_Value.s16), + ) + ) + + def get_c_declaration_base(self): + return f"EnvLightSettings {self.symbol_name}[{self.length_name}]" + + def get_h_includes(self): + return ("environment.h",) + + +class TransitionActorEntryListResource(CDataArrayNamedLengthResource): + def write_elem(resource, memory_context, v, wctx: CDataExtWriteContext): + assert isinstance(v, dict) + f = wctx.f + f.write(wctx.line_prefix) + f.write("{\n") + + f.write(wctx.line_prefix + INDENT) + f.write("{\n") + f.write(wctx.line_prefix + 2 * INDENT) + f.write("// { room, bgCamIndex }\n") + for side_i in range(2): + side = v["sides"][side_i] + room = side["room"] + bgCamIndex = side["bgCamIndex"] + f.write(wctx.line_prefix + 2 * INDENT) + f.write("{ ") + f.write(f"{room}, {bgCamIndex}") + f.write(" },\n") + f.write(wctx.line_prefix + INDENT) + f.write("}, // sides\n") + + f.write(wctx.line_prefix + INDENT) + f.write(oot64_data.get_actor_id_name(v["id"])) + f.write(",\n") + + f.write(wctx.line_prefix + INDENT) + f.write("{ ") + f.write(", ".join(f"{p:6}" for p in (v["pos"][axis] for axis in "xyz"))) + f.write(" }, // pos\n") + + f.write(wctx.line_prefix + INDENT) + f.write(fmt_hex_s(v["rotY"], 4)) + f.write(", // rotY\n") + + f.write(wctx.line_prefix + INDENT) + params = v["params"] + f.write(fmt_hex_s(params, 4)) + if params < 0: + params_u16 = params + 0x1_0000 + f.write(f" /* 0x{params_u16:04X} */") + f.write(", // params\n") + + f.write(wctx.line_prefix) + f.write("}") + + return True + + elem_cdata_ext = CDataExt_Struct( + ( + ( + "sides", + CDataExt_Array( + CDataExt_Struct( + ( + ("room", CDataExt_Value.s8), + ("bgCamIndex", CDataExt_Value.s8), + ) + ), + 2, + ), + ), + ("id", CDataExt_Value.s16), + ("pos", cdata_ext_Vec3s), + ("rotY", CDataExt_Value.s16), + ("params", CDataExt_Value.s16), + ) + ).set_write(write_elem) + + def get_c_declaration_base(self): + return f"TransitionActorEntry {self.symbol_name}[{self.length_name}]" + + def get_c_includes(self): + return ("actor.h",) + + def get_h_includes(self): + return ("scene.h",) + + +class PathListResource(CDataArrayResource): + def report_elem(resource, memory_context: "MemoryContext", v): + assert isinstance(v, dict) + count = v["count"] + assert isinstance(count, int) + points = v["points"] + assert isinstance(points, int) + memory_context.report_resource_at_segmented( + resource, + points, + Vec3sArrayResource, + lambda file, offset: Vec3sArrayResource( + file, offset, f"{resource.name}_{points:08X}_Points", count + ), + ) + + def write_elem( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, dict) + count = v["count"] + assert isinstance(count, int) + points = v["points"] + assert isinstance(points, int) + f = wctx.f + f.write(wctx.line_prefix) + f.write("{ ") + f.write(memory_context.get_c_expression_length_at_segmented(points)) + f.write(", ") + f.write(memory_context.get_c_reference_at_segmented(points)) + f.write(" }") + return True + + elem_cdata_ext = ( + CDataExt_Struct( + ( + ("count", CDataExt_Value.u8), + ("pad1", CDataExt_Value.pad8), + ("pad2", CDataExt_Value.pad16), + ("points", CDataExt_Value("I")), # Vec3s* + ) + ) + .set_report(report_elem) + .set_write(write_elem) + ) + + def try_parse_data(self, memory_context): + if self._length is None: + # TODO guess + self.set_length(1) + return super().try_parse_data(memory_context) + + def get_c_declaration_base(self): + return f"Path {self.symbol_name}[]" + + def get_h_includes(self): + return ("path.h",) diff --git a/tools/assets/extract/extase_oot64/skelanime_legacy_resources.py b/tools/assets/extract/extase_oot64/skelanime_legacy_resources.py new file mode 100644 index 0000000000..42cf8c4c3f --- /dev/null +++ b/tools/assets/extract/extase_oot64/skelanime_legacy_resources.py @@ -0,0 +1,222 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import TYPE_CHECKING + +from ..extase import RESOURCE_PARSE_SUCCESS + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase.cdata_resources import ( + CDataResource, + CDataArrayResource, + CDataExt_Struct, + CDataExtWriteContext, + cdata_ext_Vec3f, + cdata_ext_Vec3s, + CDataExt_Value, +) + +from . import animation_resources +from . import dlist_resources +from . import skeleton_resources + + +class LegacyLimbResource(CDataResource): + + def report_limb(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + if address != 0: + memory_context.report_resource_at_segmented( + resource, + address, + LegacyLimbResource, + lambda file, offset: LegacyLimbResource( + file, + offset, + f"{resource.name}_{address:08X}_LegacyLimb", + ), + ) + + def write_limb( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + if address == 0: + wctx.f.write("NULL") + else: + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("dList", dlist_resources.cdata_ext_gfx_segmented), + ("trans", cdata_ext_Vec3f), + ("rot", cdata_ext_Vec3s), + ("pad16", CDataExt_Value.pad16), + ( + "sibling", + CDataExt_Value("I").set_report(report_limb).set_write(write_limb), + ), # LegacyLimb* + ( + "child", + CDataExt_Value("I").set_report(report_limb).set_write(write_limb), + ), # LegacyLimb* + ) + ) + + def get_c_declaration_base(self): + return f"LegacyLimb {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("animation_legacy.h",) + + +class LegacyJointKeyArrayResource(CDataArrayResource): + elem_cdata_ext = CDataExt_Struct( + ( + ("xMax", CDataExt_Value.s16), + ("x", CDataExt_Value.s16), + ("yMax", CDataExt_Value.s16), + ("y", CDataExt_Value.s16), + ("zMax", CDataExt_Value.s16), + ("z", CDataExt_Value.s16), + ) + ) + + def get_c_declaration_base(self): + return f"LegacyJointKey {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("animation_legacy.h",) + + +class LegacyAnimationResource(CDataResource): + + def write_frameData( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def write_jointKey( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("frameCount", CDataExt_Value.s16), + ("limbCount", CDataExt_Value.s16), + ("frameData", CDataExt_Value("I").set_write(write_frameData)), # s16* + ( + "jointKey", + CDataExt_Value("I").set_write(write_jointKey), + ), # LegacyJointKey* + ) + ) + + def try_parse_data(self, memory_context): + super().try_parse_data(memory_context) + + address_frameData = self.cdata_unpacked["frameData"] + assert isinstance(address_frameData, int) + resource_frameData = memory_context.report_resource_at_segmented( + self, + address_frameData, + animation_resources.AnimationFrameDataResource, + lambda file, offset: animation_resources.AnimationFrameDataResource( + file, + offset, + f"{self.name}_{address_frameData:08X}_FrameData", + ), + ) + + address_jointKey = self.cdata_unpacked["jointKey"] + assert isinstance(address_jointKey, int) + resource_jointKey = memory_context.report_resource_at_segmented( + self, + address_jointKey, + LegacyJointKeyArrayResource, + lambda file, offset: LegacyJointKeyArrayResource( + file, + offset, + ( + f"{self.symbol_name.removesuffix('Anim')}JointKeys" + if self.symbol_name.endswith("Anim") + else f"{self.symbol_name}_{address_jointKey:08X}_JointKeys" + ), + ), + ) + resource_jointKey.set_length(self.cdata_unpacked["limbCount"] + 1) + + # The length of the frameData array is + # for now assumed to fill the space to the jointKey data, + # at the very least before subtracting the offsets check that + # the offsets belong to the same file + # TODO better idea for computing this data's size + + if not (resource_frameData.file == resource_jointKey.file): + raise NotImplementedError( + "Expected frameData and jointIndices to be in the same file", + self.cdata_unpacked, + resource_frameData.file, + resource_jointKey.file, + ) + + if resource_frameData.range_start < resource_jointKey.range_start: + resource_frameData.length = ( + resource_jointKey.range_start - resource_frameData.range_start + ) // animation_resources.AnimationFrameDataResource.elem_cdata_ext.size + else: + raise NotImplementedError( + "Expected offsets of frameData, jointKey to be in order", + self.cdata_unpacked, + hex(resource_frameData.range_start), + hex(resource_jointKey.range_start), + ) + + return RESOURCE_PARSE_SUCCESS + + def get_c_declaration_base(self): + return f"LegacyAnimationHeader {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("animation_legacy.h",) + + +class LegacyLimbsArrayResource(skeleton_resources.LimbsArrayResourceABC): + limb_type = LegacyLimbResource + c_limb_type = "LegacyLimb" + + def get_h_includes(self): + return ("animation_legacy.h",) diff --git a/tools/assets/extract/extase_oot64/skelcurve_resources.py b/tools/assets/extract/extase_oot64/skelcurve_resources.py new file mode 100644 index 0000000000..ea872b8bc1 --- /dev/null +++ b/tools/assets/extract/extase_oot64/skelcurve_resources.py @@ -0,0 +1,378 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase import ( + File, + RESOURCE_PARSE_SUCCESS, + ResourceParseWaiting, +) +from ..extase.cdata_resources import ( + CDataResource, + CDataExt_Struct, + CDataExt_Value, + CDataExt_Array, + CDataExtWriteContext, +) + +from . import dlist_resources + + +class KnotCountsArrayResource(CDataResource, can_size_be_unknown=True): + elem_cdata_ext = CDataExt_Value.u8 + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + self.length = None + + def try_parse_data(self, memory_context: "MemoryContext"): + if self.length is not None: + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, self.length) + self.range_end = self.range_start + self.cdata_ext.size + return super().try_parse_data(memory_context) + else: + raise ResourceParseWaiting(waiting_for=["self.length"]) + + def get_c_declaration_base(self): + return f"u8 {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_h_includes(self): + return ("ultra64.h",) + + +class CurveInterpKnotArrayResource(CDataResource, can_size_be_unknown=True): + elem_cdata_ext = CDataExt_Struct( + ( + ("flags", CDataExt_Value.u16), + ("abscissa", CDataExt_Value.s16), + ("leftGradient", CDataExt_Value.s16), + ("rightGradient", CDataExt_Value.s16), + ("ordinate", CDataExt_Value.f32), + ) + ) + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + self.length = None + + def try_parse_data(self, memory_context: "MemoryContext"): + if self.length is not None: + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, self.length) + self.range_end = self.range_start + self.cdata_ext.size + return super().try_parse_data(memory_context) + else: + raise ResourceParseWaiting(waiting_for=["self.length"]) + + def get_c_declaration_base(self): + return f"CurveInterpKnot {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_h_includes(self): + return ("curve.h",) + + +class ConstantDataArrayResource(CDataResource, can_size_be_unknown=True): + elem_cdata_ext = CDataExt_Value.s16 + + def __init__(self, file: File, range_start: int, name: str): + super().__init__(file, range_start, name) + self.length = None + + def try_parse_data(self, memory_context: "MemoryContext"): + if self.length is not None: + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, self.length) + self.range_end = self.range_start + self.cdata_ext.size + return super().try_parse_data(memory_context) + else: + raise ResourceParseWaiting(waiting_for=["self.length"]) + + def get_c_declaration_base(self): + return f"s16 {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_h_includes(self): + return ("ultra64.h",) + + +class CurveAnimationHeaderResource(CDataResource): + def report_knotCounts(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + KnotCountsArrayResource, + lambda file, offset: KnotCountsArrayResource( + file, offset, f"{resource.name}_{address:08X}_KnotCounts" + ), + ) + + def write_knotCounts( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def report_interpolationData(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + CurveInterpKnotArrayResource, + lambda file, offset: CurveInterpKnotArrayResource( + file, offset, f"{resource.name}_{address:08X}_InterpolationData" + ), + ) + + def write_interpolationData( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def report_constantData(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + ConstantDataArrayResource, + lambda file, offset: ConstantDataArrayResource( + file, offset, f"{resource.name}_{address:08X}_ConstantData" + ), + ) + + def write_constantData( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ( + "knotCounts", + CDataExt_Value("I") + .set_report(report_knotCounts) + .set_write(write_knotCounts), + ), # u8* + ( + "interpolationData", + CDataExt_Value("I") + .set_report(report_interpolationData) + .set_write(write_interpolationData), + ), # CurveInterpKnot* + ( + "constantData", + CDataExt_Value("I") + .set_report(report_constantData) + .set_write(write_constantData), + ), # s16* + ("unk_0C", CDataExt_Value.s16), + ("frameCount", CDataExt_Value.s16), + ) + ) + + def try_parse_data(self, memory_context): + super().try_parse_data(memory_context) + knotCounts = self.cdata_unpacked["knotCounts"] + interpolationData = self.cdata_unpacked["interpolationData"] + constantData = self.cdata_unpacked["constantData"] + resource_knotCounts = memory_context.resolve_segmented(knotCounts).get_resource( + KnotCountsArrayResource + ) + resource_interpolationData = memory_context.resolve_segmented( + interpolationData + ).get_resource(CurveInterpKnotArrayResource) + resource_constantData = memory_context.resolve_segmented( + constantData + ).get_resource(ConstantDataArrayResource) + if ( + resource_knotCounts.file + == resource_interpolationData.file + == resource_constantData.file + == self.file + ): + knotCounts_offset = resource_knotCounts.range_start + constantData_offset = resource_constantData.range_start + interpolationData_offset = resource_interpolationData.range_start + animHeader_offset = self.range_start + assert ( + knotCounts_offset + < constantData_offset + < interpolationData_offset + < animHeader_offset + ) + resource_knotCounts.length = ( + constantData_offset - knotCounts_offset + ) // resource_knotCounts.elem_cdata_ext.size + resource_constantData.length = ( + interpolationData_offset - constantData_offset + ) // resource_constantData.elem_cdata_ext.size + resource_interpolationData.length = ( + animHeader_offset - interpolationData_offset + ) // resource_interpolationData.elem_cdata_ext.size + + return RESOURCE_PARSE_SUCCESS + else: + raise NotImplementedError + + def get_c_declaration_base(self): + return f"CurveAnimationHeader {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + raise ValueError() + + def get_h_includes(self): + return ("curve.h",) + + +class SkelCurveLimbResource(CDataResource): + cdata_ext = CDataExt_Struct( + ( + ("child", CDataExt_Value.u8), + ("sibling", CDataExt_Value.u8), + ("pad2", CDataExt_Value.pad16), + ( + "dList", + CDataExt_Array( + dlist_resources.cdata_ext_gfx_segmented, # Gfx* + 2, + ), + ), + ) + ) + + def get_c_declaration_base(self): + return f"SkelCurveLimb {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("curve.h",) + + +class SkelCurveLimbArrayResource(CDataResource): + def report_limb_element(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + SkelCurveLimbResource, + lambda file, offset: SkelCurveLimbResource( + file, offset, f"{resource.name}_{address:08X}" + ), + ) + + def write_limb_element( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + elem_cdata_ext = ( + CDataExt_Value("I") + .set_report(report_limb_element) + .set_write(write_limb_element) + ) + + def __init__(self, file: File, range_start: int, name: str, length: int): + self.cdata_ext = CDataExt_Array(self.elem_cdata_ext, length) + super().__init__(file, range_start, name) + + def get_c_declaration_base(self): + return f"SkelCurveLimb* {self.symbol_name}[]" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return self.symbol_name + else: + raise ValueError() + + def get_h_includes(self): + return ("curve.h",) + + +class CurveSkeletonHeaderResource(CDataResource): + def report_limbs(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + memory_context.report_resource_at_segmented( + resource, + address, + SkelCurveLimbArrayResource, + lambda file, offset: SkelCurveLimbArrayResource( + file, + offset, + f"{resource.name}_Limbs_", + resource.cdata_unpacked["limbCount"], + ), + ) + + def write_limbs( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ( + "limbs", + CDataExt_Value("I").set_report(report_limbs).set_write(write_limbs), + ), # SkelCurveLimb** + ("limbCount", CDataExt_Value.u8), + ("pad5", CDataExt_Value.pad8), + ("pad6", CDataExt_Value.pad16), + ) + ) + + def get_c_declaration_base(self): + return f"CurveSkeletonHeader {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + raise ValueError() + + def get_h_includes(self): + return ("curve.h",) diff --git a/tools/assets/extract/extase_oot64/skeleton_resources.py b/tools/assets/extract/extase_oot64/skeleton_resources.py new file mode 100644 index 0000000000..12fe050a61 --- /dev/null +++ b/tools/assets/extract/extase_oot64/skeleton_resources.py @@ -0,0 +1,368 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import abc +from typing import TYPE_CHECKING + +from ..extase import ( + RESOURCE_PARSE_SUCCESS, + ResourceParseInProgress, + ResourceParseWaiting, +) + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase.cdata_resources import ( + CDataResource, + CDataArrayResource, + CDataExt_Value, + CDataExt_Struct, + CDataExt_Array, + CDataExtWriteContext, + cdata_ext_Vec3s, +) + +from . import dlist_resources + + +class StandardLimbResource(CDataResource): + def write_limb_index( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + f = wctx.f + f.write(wctx.line_prefix) + if resource.skeleton_resource is None: + f.write(f"{v}") + else: + f.write(f"/* {v} */ ") + if v == 0xFF: + f.write("LIMB_DONE") + else: + f.write( + resource.skeleton_resource.limbs_array_resource.limbs[ + v + ].enum_member_name + ) + f.write(" - 1") + return True + + cdata_ext = CDataExt_Struct( + ( + ("jointPos", cdata_ext_Vec3s), + ("child", CDataExt_Value("B").set_write(write_limb_index)), + ("sibling", CDataExt_Value("B").set_write(write_limb_index)), + ("dList", dlist_resources.cdata_ext_gfx_segmented), + ) + ) + + def __init__(self, file, range_start, name): + super().__init__(file, range_start, name) + self.enum_member_name = f"LIMB_{file.name.upper()}_{range_start:06X}" + self.skeleton_resource: "SkeletonResourceBaseABC | None" = None + + def set_enum_member_name(self, enum_member_name: str): + self.enum_member_name = enum_member_name + + def get_as_xml(self) -> str: + return f"""\ + """ + + def get_c_declaration_base(self): + return f"StandardLimb {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("animation.h",) + + +class LODLimbResource(CDataResource): + cdata_ext = CDataExt_Struct( + ( + ("jointPos", cdata_ext_Vec3s), + ( + "child", + CDataExt_Value("B").set_write(StandardLimbResource.write_limb_index), + ), + ( + "sibling", + CDataExt_Value("B").set_write(StandardLimbResource.write_limb_index), + ), + ("dLists", CDataExt_Array(dlist_resources.cdata_ext_gfx_segmented, 2)), + ) + ) + + def __init__(self, file, range_start, name): + super().__init__(file, range_start, name) + self.enum_member_name = f"LIMB_{file.name.upper()}_{range_start:06X}" + + def set_enum_member_name(self, enum_member_name: str): + self.enum_member_name = enum_member_name + + def get_as_xml(self): + return f"""\ + """ + + def get_c_declaration_base(self): + return f"LodLimb {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("animation.h",) + + +class LimbsArrayResourceABC(CDataArrayResource): + limb_type: type[CDataResource] + c_limb_type: str + + def write_limb_element( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + elem_cdata_ext = CDataExt_Value("I").set_write(write_limb_element) + + def __init__(self, file, range_start, name): + super().__init__(file, range_start, name) + self.limbs = None + + def try_parse_data(self, memory_context): + ret = super().try_parse_data(memory_context) + assert ret == RESOURCE_PARSE_SUCCESS + self.limbs: list[self.limb_type] = [] + for address in self.cdata_unpacked: + limb = memory_context.report_resource_at_segmented( + self, + address, + self.limb_type, + lambda file, offset: self.limb_type( + file, + offset, + f"{self.name}_{address:08X}_{self.c_limb_type}", + ), + ) + self.limbs.append(limb) + return RESOURCE_PARSE_SUCCESS + + def get_c_declaration_base(self): + return f"void* {self.symbol_name}[]" + + +class StandardLimbsArrayResource(LimbsArrayResourceABC): + limb_type = StandardLimbResource + c_limb_type = "StandardLimb" + + +class LODLimbsArrayResource(LimbsArrayResourceABC): + limb_type = LODLimbResource + c_limb_type = "LodLimb" + + +class SkeletonResourceBaseABC(CDataResource): + limbs_array_type: type[LimbsArrayResourceABC] + + def __init__(self, file, range_start, name): + super().__init__(file, range_start, name) + self.enum_name = f"{self.symbol_name}Limb" + self.enum_member_name_none = f"LIMB_{file.name.upper()}_{range_start:06X}_NONE" + self.enum_member_name_max = f"LIMB_{file.name.upper()}_{range_start:06X}_MAX" + self.limbs_array_resource = None + + def set_enum_name(self, enum_name: str): + self.enum_name = enum_name + + def set_enum_member_name_none(self, enum_member_name_none: str): + self.enum_member_name_none = enum_member_name_none + + def set_enum_member_name_max(self, enum_member_name_max: str): + self.enum_member_name_max = enum_member_name_max + + def try_parse_data(self, memory_context): + if self.limbs_array_resource is None: + ret = super().try_parse_data(memory_context) + assert ret == RESOURCE_PARSE_SUCCESS + data = self.get_skeleton_header_cdata_unpacked() + segment_resolve_result = memory_context.resolve_segmented(data["segment"]) + self.limbs_array_resource = segment_resolve_result.get_resource( + self.limbs_array_type + ) + if self.limbs_array_resource.limbs is None: + raise ResourceParseInProgress( + new_progress_done=["reported limbs array"], + waiting_for=["self.limbs_array_resource.limbs"], + ) + else: + if self.limbs_array_resource.limbs is None: + raise ResourceParseWaiting( + waiting_for=["self.limbs_array_resource.limbs"], + ) + for limb in self.limbs_array_resource.limbs: + limb.skeleton_resource = self + return RESOURCE_PARSE_SUCCESS + + def write_c_declaration(self, h): + h.write(f"typedef enum {self.enum_name} {{\n") + limb_enum_members = ( + self.enum_member_name_none, + *(limb.enum_member_name for limb in self.limbs_array_resource.limbs), + self.enum_member_name_max, + ) + h.write( + ",\n".join( + f" /* {i:2} */ {enum_member}" + for i, enum_member in enumerate(limb_enum_members) + ) + + "\n" + ) + h.write(f"}} {self.enum_name};\n") + super().write_c_declaration(h) + return True + + @abc.abstractmethod + def get_skeleton_header_cdata_unpacked(self) -> dict: ... + + +class SkeletonResourceABC(SkeletonResourceBaseABC): + + def report_segment(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + resource_limbs = memory_context.report_resource_at_segmented( + resource, + address, + resource.limbs_array_type, + lambda file, offset: resource.limbs_array_type( + file, + offset, + ( + f"{resource.name.removesuffix('Skel')}Limbs" + if resource.name.endswith("Skel") + else f"{resource.name}_{address:08X}_Limbs" + ), + ), + ) + resource_limbs.set_length( + resource.get_skeleton_header_cdata_unpacked()["limbCount"] + ) + + def write_segment( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def write_limbCount( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + wctx.f.write(wctx.line_prefix) + wctx.f.write( + memory_context.get_c_expression_length_at_segmented( + resource.get_skeleton_header_cdata_unpacked()["segment"] + ) + ) + return True + + cdata_ext = CDataExt_Struct( + ( + ( + "segment", + CDataExt_Value("I").set_report(report_segment).set_write(write_segment), + ), + ( + "limbCount", + CDataExt_Value("B").set_write(write_limbCount), + ), + ("pad5", CDataExt_Value.pad8), + ("pad6", CDataExt_Value.pad16), + ) + ) + + def get_skeleton_header_cdata_unpacked(self): + return self.cdata_unpacked + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_c_declaration_base(self): + return f"SkeletonHeader {self.symbol_name}" + + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("animation.h",) + + +class SkeletonNormalResource(SkeletonResourceABC): + limbs_array_type = StandardLimbsArrayResource + + +class SkeletonNormalLODResource(SkeletonResourceABC): + limbs_array_type = LODLimbsArrayResource + + +class SkeletonFlexResourceABC(SkeletonResourceBaseABC): + skeleton_type: type[SkeletonResourceABC] + + # For SkeletonResourceABC.report_segment + @property + def limbs_array_type(self): + return self.skeleton_type.limbs_array_type + + def __init__(self, file, range_start, name): + self.cdata_ext = CDataExt_Struct( + ( + ("sh", self.skeleton_type.cdata_ext), + ("dListCount", CDataExt_Value.u8), + ("pad9", CDataExt_Value.pad8), + ("pad10", CDataExt_Value.pad16), + ) + ) + super().__init__(file, range_start, name) + + def get_skeleton_header_cdata_unpacked(self): + return self.cdata_unpacked["sh"] + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_c_declaration_base(self): + return f"FlexSkeletonHeader {self.symbol_name}" + + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("animation.h",) + + +class SkeletonFlexResource(SkeletonFlexResourceABC): + skeleton_type = SkeletonNormalResource + + +class SkeletonFlexLODResource(SkeletonFlexResourceABC): + skeleton_type = SkeletonNormalLODResource diff --git a/tools/assets/extract/extase_oot64/skeleton_skin_resources.py b/tools/assets/extract/extase_oot64/skeleton_skin_resources.py new file mode 100644 index 0000000000..e4b06e7001 --- /dev/null +++ b/tools/assets/extract/extase_oot64/skeleton_skin_resources.py @@ -0,0 +1,279 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import TYPE_CHECKING + +from ..oot64_data.misc_ids import SKIN_LIMB_TYPES + +if TYPE_CHECKING: + from ..extase.memorymap import MemoryContext + +from ..extase.cdata_resources import ( + CDataResource, + CDataArrayResource, + CDataExt_Value, + CDataExt_Struct, + CDataExtWriteContext, + cdata_ext_Vec3s, +) + +from . import dlist_resources +from . import skeleton_resources + + +class SkinVertexArrayResource(CDataArrayResource): + elem_cdata_ext = CDataExt_Struct( + ( + ("index", CDataExt_Value.u16), + ("s", CDataExt_Value.s16), + ("t", CDataExt_Value.s16), + ("normX", CDataExt_Value.s8), + ("normY", CDataExt_Value.s8), + ("normZ", CDataExt_Value.s8), + ("alpha", CDataExt_Value.u8), + ) + ) + + def get_c_declaration_base(self): + return f"SkinVertex {self.symbol_name}[]" + + def get_h_includes(self): + return ("skin.h",) + + +class SkinTransformationArrayResource(CDataArrayResource): + elem_cdata_ext = CDataExt_Struct( + ( + ("limbIndex", CDataExt_Value.u8), + ("pad1", CDataExt_Value.pad8), + ("x", CDataExt_Value.s16), + ("y", CDataExt_Value.s16), + ("z", CDataExt_Value.s16), + ("scale", CDataExt_Value.u8), + ("pad9", CDataExt_Value.pad8), + ) + ) + + def get_c_declaration_base(self): + return f"SkinTransformation {self.symbol_name}[]" + + def get_h_includes(self): + return ("skin.h",) + + +class SkinLimbModifArrayResource(CDataArrayResource): + def report_elem(resource, memory_context: "MemoryContext", v): + assert isinstance(v, dict) + + address = v["skinVertices"] + assert isinstance(address, int) + skin_vertices_res = memory_context.report_resource_at_segmented( + resource, + address, + SkinVertexArrayResource, + lambda file, offset: SkinVertexArrayResource( + file, + offset, + f"{resource.name}_{offset:08X}_SkinVertices", + ), + ) + skin_vertices_res.set_length(v["vtxCount"]) + + address = v["limbTransformations"] + assert isinstance(address, int) + skin_vertices_res = memory_context.report_resource_at_segmented( + resource, + address, + SkinTransformationArrayResource, + lambda file, offset: SkinTransformationArrayResource( + file, + offset, + f"{resource.name}_{offset:08X}_SkinTransforms", + ), + ) + skin_vertices_res.set_length(v["transformCount"]) + + def write_skinVertices( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + def write_limbTransformations( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + elem_cdata_ext = CDataExt_Struct( + ( + ("vtxCount", CDataExt_Value.u16), + ("transformCount", CDataExt_Value.u16), + ("unk_4", CDataExt_Value.u16), + ("pad6", CDataExt_Value.pad16), + ( + "skinVertices", + (CDataExt_Value("I").set_write(write_skinVertices)), + ), # SkinVertex* + ( + "limbTransformations", + (CDataExt_Value("I").set_write(write_limbTransformations)), + ), # SkinTransformation* + ) + ).set_report(report_elem) + + def get_c_declaration_base(self): + return f"SkinLimbModif {self.symbol_name}[]" + + def get_h_includes(self): + return ("skin.h",) + + +class SkinAnimatedLimbDataResource(CDataResource): + def report_limbModifications(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + skin_vertices_res = memory_context.report_resource_at_segmented( + resource, + address, + SkinLimbModifArrayResource, + lambda file, offset: SkinLimbModifArrayResource( + file, + offset, + f"{resource.name}_{offset:08X}_SkinLimbModifs", + ), + ) + skin_vertices_res.set_length(resource.cdata_unpacked["limbModifCount"]) + + def write_limbModifications( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("totalVtxCount", CDataExt_Value.u16), + ("limbModifCount", CDataExt_Value.u16), + ( + "limbModifications", + ( + CDataExt_Value("I") + .set_report(report_limbModifications) + .set_write(write_limbModifications) + ), + ), # SkinLimbModif* + ("dlist", dlist_resources.cdata_ext_gfx_segmented), + ) + ) + + def get_c_declaration_base(self): + return f"SkinAnimatedLimbData {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("skin.h",) + + +class SkinLimbResource(CDataResource): + def report_segment(resource, memory_context: "MemoryContext", v): + assert isinstance(v, int) + address = v + segmentType = resource.cdata_unpacked["segmentType"] + if segmentType == 4: # SKIN_LIMB_TYPE_ANIMATED + # segment is SkinAnimatedLimbData* + assert address != 0 + memory_context.report_resource_at_segmented( + resource, + address, + SkinAnimatedLimbDataResource, + lambda file, offset: SkinAnimatedLimbDataResource( + file, offset, f"{resource.name}_{address:08X}_SkinAnimatedLimbData" + ), + ) + elif segmentType == 11: # SKIN_LIMB_TYPE_NORMAL + # segment is Gfx* + assert address != 0 + dlist_resources.report_gfx_segmented(resource, memory_context, address) + + def write_segment( + resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext + ): + assert isinstance(v, int) + address = v + wctx.f.write(wctx.line_prefix) + if address == 0: + wctx.f.write("NULL") + else: + wctx.f.write(memory_context.get_c_reference_at_segmented(address)) + return True + + cdata_ext = CDataExt_Struct( + ( + ("jointPos", cdata_ext_Vec3s), + ( + "child", + CDataExt_Value("B").set_write( + skeleton_resources.StandardLimbResource.write_limb_index + ), + ), + ( + "sibling", + CDataExt_Value("B").set_write( + skeleton_resources.StandardLimbResource.write_limb_index + ), + ), + ( + "segmentType", + CDataExt_Value("i").set_write_str_v( + lambda v: SKIN_LIMB_TYPES.get(v, f"{v}") + ), + ), + ( + "segment", + CDataExt_Value("I").set_report(report_segment).set_write(write_segment), + ), + ) + ) + + def __init__(self, file, range_start, name): + super().__init__(file, range_start, name) + self.enum_member_name = f"LIMB_{file.name.upper()}_{range_start:06X}" + + def set_enum_member_name(self, enum_member_name: str): + self.enum_member_name = enum_member_name + + def get_c_declaration_base(self): + return f"SkinLimb {self.symbol_name}" + + def get_c_reference(self, resource_offset: int): + if resource_offset == 0: + return f"&{self.symbol_name}" + else: + raise ValueError() + + def get_h_includes(self): + return ("skin.h",) + + +class SkinLimbsArrayResource(skeleton_resources.LimbsArrayResourceABC): + limb_type = SkinLimbResource + c_limb_type = "SkinLimb" + + +class SkeletonSkinResource(skeleton_resources.SkeletonResourceABC): + limbs_array_type = SkinLimbsArrayResource diff --git a/tools/assets/extract/extract_xml_z64.py b/tools/assets/extract/extract_xml_z64.py new file mode 100644 index 0000000000..79756908fa --- /dev/null +++ b/tools/assets/extract/extract_xml_z64.py @@ -0,0 +1,517 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import dataclasses +from pathlib import Path + +from ..descriptor.base import ( + BaseromFileBackingMemory, + get_resources_desc, + ResourceDesc, + ResourcesDescCollection, + ResourcesDescCollectionsPool, + SegmentStartAddress, + VRAMStartAddress, +) + +from .extase import File, Resource +from .extase.memorymap import MemoryContext + +from . import z64_resource_handlers + +try: + import rich + import rich.console + import rich.pretty +except ImportError: + USE_RICH = False +else: + USE_RICH = True + +# +# main +# + +VERBOSE1 = False +VERBOSE2 = False +VERBOSE3 = False + +# "options" +RM_SOURCE = True +WRITE_SOURCE = True +RM_EXTRACT = True +WRITE_EXTRACT = True +from ..conf import WRITE_HINTS, I_D_OMEGALUL + + +@dataclasses.dataclass +class ExtractionContext: + oot_version: str + version_memctx_base: MemoryContext + baserom_path: Path + build_path: Path + extracted_path: Path + write_source: set[str] + """Paths of source .c files to write""" + + def get_baserom_file_data(self, baserom_file_name: str): + return memoryview((self.baserom_path / baserom_file_name).read_bytes()) + + +def create_file_resources(rescoll: ResourcesDescCollection, file: File): + """Collect resources described by the collection into the file object. + + Does not do any processing of the data itself: no parsing, no discovering more resources. + """ + + file_resources_by_desc: dict[ResourceDesc, Resource] = dict() + + list_ResourceNeedsPostProcessWithPoolResourcesException: list[ + z64_resource_handlers.ResourceNeedsPostProcessWithPoolResourcesException + ] = [] + + for resource_desc in rescoll.resources: + + try: + resource = z64_resource_handlers.get_resource_from_desc(file, resource_desc) + except ( + z64_resource_handlers.ResourceNeedsPostProcessWithPoolResourcesException + ) as e: + resource = e.resource + list_ResourceNeedsPostProcessWithPoolResourcesException.append(e) + except Exception as e: + raise Exception( + "Error while creating resource from description:", resource_desc + ) from e + + # TODO nice hack right here. + # probably instead rework the "c declaration" system into a more opaque object + # not that this is really a required long term feature as it's only relevant + # for writing the source files (main .c/.h), not extracting + if file.name.startswith("ovl_") and file.name != "ovl_file_choose": + resource.HACK_IS_STATIC_ON = ... + + file.add_resource(resource) + + file_resources_by_desc[resource_desc] = resource + + if VERBOSE1: + print(file) + print(file.name, file._resources) + + # Check if described resources overlap + file.sort_resources() + file.check_overlapping_resources() + + return ( + file_resources_by_desc, + list_ResourceNeedsPostProcessWithPoolResourcesException, + ) + + +def process_pool( + extraction_ctx: ExtractionContext, pool_desc: ResourcesDescCollectionsPool +): + if VERBOSE1: + print("> process_pool") + colls_str = " + ".join(set(map(str, (_c.out_path for _c in pool_desc.collections)))) + if USE_RICH: + rich.print(f"[b]{colls_str}[/b]") + else: + print(colls_str) + + file_by_rescoll: dict[ResourcesDescCollection, File] = dict() + + # 1) Create File and Resource objects + + pool_resources_by_desc: dict[ResourceDesc, Resource] = dict() + list_all_ResourceNeedsPostProcessWithPoolResourcesException: list[ + z64_resource_handlers.ResourceNeedsPostProcessWithPoolResourcesException + ] = [] + for rescoll in pool_desc.collections: + if not isinstance(rescoll.backing_memory, BaseromFileBackingMemory): + raise NotImplementedError(rescoll.backing_memory) + data = extraction_ctx.get_baserom_file_data(rescoll.backing_memory.name) + if rescoll.backing_memory.range is not None: + range_start, range_end = rescoll.backing_memory.range + data = data[range_start:range_end] + + if isinstance(rescoll.start_address, VRAMStartAddress): + if rescoll.start_address.vram % 8 == 0: + alignment = 8 + elif rescoll.start_address.vram % 4 == 0: + alignment = 4 + else: + raise NotImplementedError( + f"alignment for {rescoll.start_address.vram=:#08X}" + ) + elif ( + isinstance(rescoll.start_address, SegmentStartAddress) + or rescoll.start_address is None + ): + alignment = 8 + else: + raise NotImplementedError(rescoll.start_address) + # TODO File.name + file = File(rescoll.backing_memory.name, data=data, alignment=alignment) + file_by_rescoll[rescoll] = file + + ( + file_resources_by_desc, + list_ResourceNeedsPostProcessWithPoolResourcesException, + ) = create_file_resources(rescoll, file) + pool_resources_by_desc |= file_resources_by_desc + list_all_ResourceNeedsPostProcessWithPoolResourcesException.extend( + list_ResourceNeedsPostProcessWithPoolResourcesException + ) + + for e in list_all_ResourceNeedsPostProcessWithPoolResourcesException: + e.callback(pool_resources_by_desc) + + # 2) Build a MemoryContext for each File + + memctx_base = extraction_ctx.version_memctx_base.copy() + memctx_by_file: dict[File, MemoryContext] = dict() + + for rescoll, file in file_by_rescoll.items(): + if VERBOSE2: + print("Building MemoryContext for", file.name) + files_by_segment: dict[int, list[File]] = dict() + file_memctx = memctx_base.copy() + + for rescoll_dep in (rescoll, *rescoll.depends): + file_dep = file_by_rescoll[rescoll_dep] + + if rescoll_dep.start_address is None: + pass + elif isinstance(rescoll_dep.start_address, SegmentStartAddress): + files_by_segment.setdefault( + rescoll_dep.start_address.segment, [] + ).append(file_dep) + elif isinstance(rescoll_dep.start_address, VRAMStartAddress): + file_memctx.set_direct_file(rescoll_dep.start_address.vram, file_dep) + if file_dep != file: + file.referenced_files.add(file_dep) + else: + raise NotImplementedError(rescoll_dep.start_address) + + disputed_segments = [] + + for segment, files in files_by_segment.items(): + if len(files) == 1: + file_memctx.set_segment_file(segment, files[0]) + if files[0] != file: + file.referenced_files.add(files[0]) + if VERBOSE2: + print("segment", segment, "set to", files[0].name) + else: + disputed_segments.append(segment) + + if VERBOSE2: + print(f"{disputed_segments=}") + + if ( + isinstance(rescoll.start_address, SegmentStartAddress) + and rescoll.start_address.segment in disputed_segments + ): + if VERBOSE2: + print( + "disputed segment", + rescoll.start_address.segment, + "set to own file for file's memctx", + file.name, + ) + file_memctx.set_segment_file(rescoll.start_address.segment, file) + memctx_by_file[file] = file_memctx + + # 3) parse: iteratively discover and parse data + # (discover = add resources, parse = make friendlier than binary) + + def parse_all_files(): + while True: + any_progress = False + for file, file_memctx in memctx_by_file.items(): + if VERBOSE3: + print(file.name, ".try_parse_resources_data()") + if file.try_parse_resources_data(file_memctx): + any_progress = True + if not any_progress: + break + + for file in memctx_by_file.keys(): + file.check_non_parsed_resources() + + if VERBOSE3: + print("parse_all_files() ...") + parse_all_files() + + for file in memctx_by_file.keys(): + file.commit_resource_buffers() + + if VERBOSE3: + print("parse new resources (resource buffers) ...") + parse_all_files() # parse new resources (resource buffers) + + for file in memctx_by_file.keys(): + file.sort_resources() + file.check_overlapping_resources() + + # 4) add dummy (binary) resources for the unaccounted gaps + + if VERBOSE3: + print("unaccounted...") + + for file in memctx_by_file.keys(): + file.add_unaccounted_resources(I_D_OMEGALUL=I_D_OMEGALUL) + + parse_all_files() # FIXME this is to set is_data_parsed=True on binary blob unaccounteds, handle better + + for file in memctx_by_file.keys(): + file.sort_resources() + assert not file.get_overlapping_resources() + + # At this point all files are completely mapped with resources + + # 5) + + for rescoll, file in file_by_rescoll.items(): + file.set_source_path( + extraction_ctx.extracted_path / "assets" / rescoll.out_path + ) + + file.set_resources_paths( + extraction_ctx.extracted_path, + extraction_ctx.build_path, + Path("assets") / rescoll.out_path, + ) + + for file, file_memctx in memctx_by_file.items(): + # write to extracted/ + if WRITE_EXTRACT: + file.write_resources_extracted(file_memctx) + + # "source" refers to the main .c and .h `#include`ing all the extracted resources + if WRITE_SOURCE and ( + str(file.source_c_path.relative_to(extraction_ctx.extracted_path)) + in extraction_ctx.write_source + ): + file.write_source() + + +def process_pool_wrapped(extraction_ctx, pd): + try: + process_pool(extraction_ctx, pd) + except Exception as e: + import traceback + import sys + + # Some exceptions can't be pickled for passing back to the main process + # so print them now as well as reraising + traceback.print_exc(file=sys.stdout) + raise Exception( + "ERROR with pool_desc collections:", + [str(rescoll.out_path) for rescoll in pd.collections], + ) from e + + +# Make interrupting jobs with ^C less jank +# https://stackoverflow.com/questions/72967793/keyboardinterrupt-with-python-multiprocessing-pool +def set_sigint_ignored(): + import signal + + signal.signal(signal.SIGINT, signal.SIG_IGN) + + +def main(): + import argparse + import json + import re + import time + + from tools import version_config + from tools import dmadata + + parser = argparse.ArgumentParser() + parser.add_argument( + "baserom_segments_dir", + type=Path, + help="Directory of uncompressed ROM segments", + ) + parser.add_argument( + "output_dir", + type=Path, + help="Output directory to place files in", + ) + parser.add_argument("-v", dest="oot_version", default="gc-eu-mq-dbg") + parser.add_argument("-j", dest="jobs", nargs="?", default=False, type=int) + parser.add_argument("-f", dest="force", action="store_true") + parser.add_argument("-s", dest="single", default=None) + parser.add_argument("-r", dest="single_is_regex", default=None, action="store_true") + args = parser.parse_args() + + vc = version_config.load_version_config(args.oot_version) + + dma_entries = dmadata.read_dmadata( + memoryview((args.baserom_segments_dir / "dmadata").read_bytes()), 0 + ) + dmadata_table_rom_file_name_by_vrom = dict() + for dma_entry, name in zip(dma_entries, vc.dmadata_segments.keys(), strict=True): + dmadata_table_rom_file_name_by_vrom[ + (dma_entry.vrom_start, dma_entry.vrom_end) + ] = name + + pools_desc = get_resources_desc(vc) + + last_extracts_json_p = args.output_dir / "last_extracts.json" + try: + with last_extracts_json_p.open("r") as f: + last_extracts = json.load(f) + except (OSError, json.decoder.JSONDecodeError): + last_extracts = dict() + + def is_pool_desc_modified(pool_desc: ResourcesDescCollectionsPool): + modified = False + for rdc in pool_desc.collections: + if isinstance(rdc.backing_memory, BaseromFileBackingMemory): + if rdc.last_modified_time > last_extracts.get( + f"{rdc.out_path} {rdc.backing_memory.name}", 0 + ): + modified = True + return modified + + def set_pool_desc_modified(pool_desc: ResourcesDescCollectionsPool): + for rdc in pool_desc.collections: + if isinstance(rdc.backing_memory, BaseromFileBackingMemory): + last_extracts[f"{rdc.out_path} {rdc.backing_memory.name}"] = ( + rdc.last_modified_time + ) + + version_memctx_base = MemoryContext(dmadata_table_rom_file_name_by_vrom) + + from .extase_oot64.dlist_resources import MtxResource, TextureResource + from ..n64 import G_IM_FMT, G_IM_SIZ + + file_gIdentityMtx = File("sys_matrix__gIdentityMtx", size=0x40) + file_gIdentityMtx.add_resource(MtxResource(file_gIdentityMtx, 0, "gIdentityMtx")) + version_memctx_base.set_direct_file(vc.variables["gIdentityMtx"], file_gIdentityMtx) + + file_sShadowTex = File("z_en_jsjutan__sShadowTex", size=0x800) + file_sShadowTex.add_resource( + TextureResource( + file_sShadowTex, 0, "sShadowTex", G_IM_FMT.I, G_IM_SIZ._8b, 32, 64 + ) + ) + version_memctx_base.set_direct_file(vc.variables["sShadowTex"], file_sShadowTex) + + extraction_ctx = ExtractionContext( + args.oot_version, + version_memctx_base, + args.baserom_segments_dir, + Path("build") / args.oot_version, + args.output_dir, + set((Path(__file__).parent / "write_source.txt").read_text().splitlines()), + ) + + z64_resource_handlers.register_resource_handlers() + + try: + if args.single is not None: + any_match = False + any_pool_processed = False + for pool_desc in pools_desc: + pool_matches = False + for coll in pool_desc.collections: + if isinstance(coll.backing_memory, BaseromFileBackingMemory): + if args.single_is_regex: + if re.fullmatch(args.single, coll.backing_memory.name): + pool_matches = True + else: + if coll.backing_memory.name == args.single: + pool_matches = True + if pool_matches: + any_match = True + if args.force or is_pool_desc_modified(pool_desc): + process_pool(extraction_ctx, pool_desc) + set_pool_desc_modified(pool_desc) + any_pool_processed = True + if any_pool_processed: + print("Done!") + elif not any_match: + print("Not found:", args.single) + else: + print("Nothing to do") + elif args.jobs is False: # everything on one process + any_pool_processed = False + for pool_desc in pools_desc: + if args.force or is_pool_desc_modified(pool_desc): + process_pool(extraction_ctx, pool_desc) + set_pool_desc_modified(pool_desc) + any_pool_processed = True + if any_pool_processed: + print("All done!") + else: + print("Nothing to do") + else: # multiprocessing + import multiprocessing + + if args.force: + pools_desc_to_extract = pools_desc + else: + pools_desc_modified = [ + pool_desc + for pool_desc in pools_desc + if is_pool_desc_modified(pool_desc) + ] + pools_desc_to_extract = pools_desc_modified + + if pools_desc_to_extract: + with multiprocessing.get_context("fork").Pool( + processes=args.jobs, initializer=set_sigint_ignored + ) as pool: + jobs = [ + ( + pd, + pool.apply_async( + process_pool_wrapped, (extraction_ctx, pd) + ), + ) + for pd in pools_desc_to_extract + ] + while jobs: + any_finished = False + still_waiting_for_jobs = [] + for pd, ar in jobs: + try: + ar.get(0) + except multiprocessing.TimeoutError: + still_waiting_for_jobs.append((pd, ar)) + else: + any_finished = True + set_pool_desc_modified(pd) + jobs = still_waiting_for_jobs + if not any_finished: + time.sleep(0.001) + print("All done!") + else: + print("Nothing to do") + except Exception as e: + import traceback + import sys + + if USE_RICH: + rich.console.Console().print_exception() + # TODO implement more __rich_repr__ + if e.__class__ in (Exception, AssertionError, NotImplementedError): + print("rich.pretty.pprint(e.args):") + rich.pretty.pprint(e.args, indent_guides=False) + else: + print("rich.pretty.pprint(e):") + rich.pretty.pprint(e, indent_guides=False) + else: + traceback.print_exc(file=sys.stdout) + print("Install rich for prettier output (`pip install rich`)") + + sys.exit(1) + finally: + with last_extracts_json_p.open("w") as f: + json.dump(last_extracts, f) diff --git a/tools/assets/extract/oot64_data/Makefile b/tools/assets/extract/oot64_data/Makefile new file mode 100644 index 0000000000..b36b6542f3 --- /dev/null +++ b/tools/assets/extract/oot64_data/Makefile @@ -0,0 +1,56 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +ROOT := ../../../../ + +DATA_FILES := actor_ids.py object_ids.py entrance_table_mini.py scene_table_mini.py + +default: + @echo 'Run `make all` or with the appropriate target to (re)build data files' + +all: $(DATA_FILES) + +distclean: + $(RM) $(DATA_FILES) + +.PHONY: default all distclean + +actor_ids.py: $(ROOT)/include/tables/actor_table.h + echo '# This file was generated from $<' > $@ + echo >> $@ + echo 'DATA = (' >> $@ + cpp -P \ + -D'DEFINE_ACTOR(_0,enumValue,_2,_3)=#enumValue,' \ + -D'DEFINE_ACTOR_UNSET(enumValue)=#enumValue,' \ + -D'DEFINE_ACTOR_INTERNAL=DEFINE_ACTOR' \ + $< >> $@ + echo ')' >> $@ + +object_ids.py: $(ROOT)/include/tables/object_table.h + echo '# This file was generated from $<' > $@ + echo >> $@ + echo 'DATA = (' >> $@ + cpp -P \ + -D'DEFINE_OBJECT(_0,enumValue)=#enumValue,' \ + -D'DEFINE_OBJECT_UNSET(enumValue)=#enumValue,' \ + -D'DEFINE_OBJECT_NULL(_0,enumValue)=#enumValue,' \ + $< >> $@ + echo ')' >> $@ + +entrance_table_mini.py: $(ROOT)/include/tables/entrance_table.h + echo '# This file was generated from $<' > $@ + echo >> $@ + echo 'DATA = (' >> $@ + cpp -P \ + -D'DEFINE_ENTRANCE(enumValue, sceneId, spawn, _3, _4, _5, _6)=(#enumValue, #sceneId, spawn),' \ + $< >> $@ + echo ')' >> $@ + +scene_table_mini.py: $(ROOT)/include/tables/scene_table.h + echo '# This file was generated from $<' > $@ + echo >> $@ + echo 'DATA = (' >> $@ + cpp -P \ + -D'DEFINE_SCENE(name, _1, enumValue, _3, _4, _5)=(#name, #enumValue),' \ + $< >> $@ + echo ')' >> $@ diff --git a/tools/assets/extract/oot64_data/__init__.py b/tools/assets/extract/oot64_data/__init__.py new file mode 100644 index 0000000000..8fac94032f --- /dev/null +++ b/tools/assets/extract/oot64_data/__init__.py @@ -0,0 +1,131 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import Sequence + + +I_D_OMEGALUL = True + + +from . import actor_ids + + +def get_actor_id_name(actor_id: int) -> str: + return actor_ids.DATA[actor_id] + + +from . import object_ids + + +def get_object_id_name(object_id: int) -> str: + return object_ids.DATA[object_id] + + +from . import entrance_table_mini +from . import entrance_ids_special + + +def get_entrance_id_name(entrance_id: int) -> str: + if entrance_id in entrance_ids_special.DATA: + return entrance_ids_special.DATA[entrance_id] + return entrance_table_mini.DATA[entrance_id][0] + + +def get_entrance_scene_id_name(entrance_id: int) -> str: + return entrance_table_mini.DATA[entrance_id][1] + + +def get_entrance_spawn(entrance_id: int) -> int: + return entrance_table_mini.DATA[entrance_id][2] + + +entrance_ids_by_scene_id_name: dict[str, list[int]] = dict() +for ( + entrance_id, + ( + entrance_id_name, + entrance_scene_id_name, + entrance_spawn, + ), +) in enumerate(entrance_table_mini.DATA): + entrance_ids_by_scene_id_name.setdefault(entrance_scene_id_name, []).append( + entrance_id + ) + + +def get_entrance_ids_from_scene_id_name(scene_id_name: str) -> Sequence[int]: + return entrance_ids_by_scene_id_name[scene_id_name] + + +from . import scene_table_mini + + +def get_scene_rom_file_name(scene_id: int) -> str: + return scene_table_mini.DATA[scene_id][0] + + +def get_scene_id_name(scene_id: int) -> str: + return scene_table_mini.DATA[scene_id][1] + + +scene_id_by_rom_file_name = { + rom_file_name: scene_id + for scene_id, (rom_file_name, scene_id_name) in enumerate(scene_table_mini.DATA) +} + + +def get_scene_id_from_rom_file_name(rom_file_name: str) -> int: + return scene_id_by_rom_file_name[rom_file_name] + + +from . import audio_ids + + +def get_sequence_id_name(sequence_id: int) -> str: + return audio_ids.SEQ_IDS[sequence_id] + + +def get_nature_ambience_id_name(nature_ambience_id: int) -> str: + return audio_ids.NATURE_AMBIENCE_IDS[nature_ambience_id] + + +from . import misc_ids + + +def get_scene_cam_type_name(scene_cam_type: int) -> str: + return misc_ids.SCENE_CAM_TYPES[scene_cam_type] + + +def get_room_behavior_type1_name(behavior_type1: int) -> str: + return misc_ids.ROOM_BEHAVIOR_TYPE1_NAMES[behavior_type1] + + +def get_room_behavior_type2_name(behavior_type2: int) -> str: + return misc_ids.ROOM_BEHAVIOR_TYPE2_NAMES[behavior_type2] + + +def get_lens_mode_name(lens_mode: int) -> str: + return misc_ids.LENS_MODES[lens_mode] + + +def get_camera_setting_type_name(camera_setting_type: int) -> str: + return misc_ids.CAMERA_SETTING_TYPES[camera_setting_type] + + +def get_room_shape_type_name(room_shape_type: int) -> str: + return misc_ids.ROOM_SHAPE_TYPE[room_shape_type] + + +def get_room_shape_image_amount_type_name(room_shape_image_amount_type: int) -> str: + return misc_ids.ROOM_SHAPE_IMAGE_AMOUNT_TYPE[room_shape_image_amount_type] + + +def get_skybox_id(skybox_id: int) -> str: + return misc_ids.SKYBOX_IDS[skybox_id] + + +def get_light_mode(light_mode: int) -> str: + return misc_ids.LIGHT_MODES[light_mode] + +def get_navi_quest_hint_file_id_name(navi_quest_hint_file_id: int) -> str: + return misc_ids.NAVI_QUEST_HINT_FILE_IDS[navi_quest_hint_file_id] diff --git a/tools/assets/extract/oot64_data/actor_ids.py b/tools/assets/extract/oot64_data/actor_ids.py new file mode 100644 index 0000000000..3654a9d2a2 --- /dev/null +++ b/tools/assets/extract/oot64_data/actor_ids.py @@ -0,0 +1,475 @@ +# This file was generated from ../../../..//include/tables/actor_table.h + +DATA = ( + "ACTOR_PLAYER", + "ACTOR_UNSET_1", + "ACTOR_EN_TEST", + "ACTOR_UNSET_3", + "ACTOR_EN_GIRLA", + "ACTOR_UNSET_5", + "ACTOR_UNSET_6", + "ACTOR_EN_PART", + "ACTOR_EN_LIGHT", + "ACTOR_EN_DOOR", + "ACTOR_EN_BOX", + "ACTOR_BG_DY_YOSEIZO", + "ACTOR_BG_HIDAN_FIREWALL", + "ACTOR_EN_POH", + "ACTOR_EN_OKUTA", + "ACTOR_BG_YDAN_SP", + "ACTOR_EN_BOM", + "ACTOR_EN_WALLMAS", + "ACTOR_EN_DODONGO", + "ACTOR_EN_FIREFLY", + "ACTOR_EN_HORSE", + "ACTOR_EN_ITEM00", + "ACTOR_EN_ARROW", + "ACTOR_UNSET_17", + "ACTOR_EN_ELF", + "ACTOR_EN_NIW", + "ACTOR_UNSET_1A", + "ACTOR_EN_TITE", + "ACTOR_EN_REEBA", + "ACTOR_EN_PEEHAT", + "ACTOR_EN_BUTTE", + "ACTOR_UNSET_1F", + "ACTOR_EN_INSECT", + "ACTOR_EN_FISH", + "ACTOR_UNSET_22", + "ACTOR_EN_HOLL", + "ACTOR_EN_SCENE_CHANGE", + "ACTOR_EN_ZF", + "ACTOR_EN_HATA", + "ACTOR_BOSS_DODONGO", + "ACTOR_BOSS_GOMA", + "ACTOR_EN_ZL1", + "ACTOR_EN_VIEWER", + "ACTOR_EN_GOMA", + "ACTOR_BG_PUSHBOX", + "ACTOR_EN_BUBBLE", + "ACTOR_DOOR_SHUTTER", + "ACTOR_EN_DODOJR", + "ACTOR_EN_BDFIRE", + "ACTOR_UNSET_31", + "ACTOR_EN_BOOM", + "ACTOR_EN_TORCH2", + "ACTOR_EN_BILI", + "ACTOR_EN_TP", + "ACTOR_UNSET_36", + "ACTOR_EN_ST", + "ACTOR_EN_BW", + "ACTOR_EN_A_OBJ", + "ACTOR_EN_EIYER", + "ACTOR_EN_RIVER_SOUND", + "ACTOR_EN_HORSE_NORMAL", + "ACTOR_EN_OSSAN", + "ACTOR_BG_TREEMOUTH", + "ACTOR_BG_DODOAGO", + "ACTOR_BG_HIDAN_DALM", + "ACTOR_BG_HIDAN_HROCK", + "ACTOR_EN_HORSE_GANON", + "ACTOR_BG_HIDAN_ROCK", + "ACTOR_BG_HIDAN_RSEKIZOU", + "ACTOR_BG_HIDAN_SEKIZOU", + "ACTOR_BG_HIDAN_SIMA", + "ACTOR_BG_HIDAN_SYOKU", + "ACTOR_EN_XC", + "ACTOR_BG_HIDAN_CURTAIN", + "ACTOR_BG_SPOT00_HANEBASI", + "ACTOR_EN_MB", + "ACTOR_EN_BOMBF", + "ACTOR_EN_ZL2", + "ACTOR_BG_HIDAN_FSLIFT", + "ACTOR_EN_OE2", + "ACTOR_BG_YDAN_HASI", + "ACTOR_BG_YDAN_MARUTA", + "ACTOR_BOSS_GANONDROF", + "ACTOR_UNSET_53", + "ACTOR_EN_AM", + "ACTOR_EN_DEKUBABA", + "ACTOR_EN_M_FIRE1", + "ACTOR_EN_M_THUNDER", + "ACTOR_BG_DDAN_JD", + "ACTOR_BG_BREAKWALL", + "ACTOR_EN_JJ", + "ACTOR_EN_HORSE_ZELDA", + "ACTOR_BG_DDAN_KD", + "ACTOR_DOOR_WARP1", + "ACTOR_OBJ_SYOKUDAI", + "ACTOR_ITEM_B_HEART", + "ACTOR_EN_DEKUNUTS", + "ACTOR_BG_MENKURI_KAITEN", + "ACTOR_BG_MENKURI_EYE", + "ACTOR_EN_VALI", + "ACTOR_BG_MIZU_MOVEBG", + "ACTOR_BG_MIZU_WATER", + "ACTOR_ARMS_HOOK", + "ACTOR_EN_FHG", + "ACTOR_BG_MORI_HINERI", + "ACTOR_EN_BB", + "ACTOR_BG_TOKI_HIKARI", + "ACTOR_EN_YUKABYUN", + "ACTOR_BG_TOKI_SWD", + "ACTOR_EN_FHG_FIRE", + "ACTOR_BG_MJIN", + "ACTOR_BG_HIDAN_KOUSI", + "ACTOR_DOOR_TOKI", + "ACTOR_BG_HIDAN_HAMSTEP", + "ACTOR_EN_BIRD", + "ACTOR_UNSET_73", + "ACTOR_UNSET_74", + "ACTOR_UNSET_75", + "ACTOR_UNSET_76", + "ACTOR_EN_WOOD02", + "ACTOR_UNSET_78", + "ACTOR_UNSET_79", + "ACTOR_UNSET_7A", + "ACTOR_UNSET_7B", + "ACTOR_EN_LIGHTBOX", + "ACTOR_EN_PU_BOX", + "ACTOR_UNSET_7E", + "ACTOR_UNSET_7F", + "ACTOR_EN_TRAP", + "ACTOR_EN_AROW_TRAP", + "ACTOR_EN_VASE", + "ACTOR_UNSET_83", + "ACTOR_EN_TA", + "ACTOR_EN_TK", + "ACTOR_BG_MORI_BIGST", + "ACTOR_BG_MORI_ELEVATOR", + "ACTOR_BG_MORI_KAITENKABE", + "ACTOR_BG_MORI_RAKKATENJO", + "ACTOR_EN_VM", + "ACTOR_DEMO_EFFECT", + "ACTOR_DEMO_KANKYO", + "ACTOR_BG_HIDAN_FWBIG", + "ACTOR_EN_FLOORMAS", + "ACTOR_EN_HEISHI1", + "ACTOR_EN_RD", + "ACTOR_EN_PO_SISTERS", + "ACTOR_BG_HEAVY_BLOCK", + "ACTOR_BG_PO_EVENT", + "ACTOR_OBJ_MURE", + "ACTOR_EN_SW", + "ACTOR_BOSS_FD", + "ACTOR_OBJECT_KANKYO", + "ACTOR_EN_DU", + "ACTOR_EN_FD", + "ACTOR_EN_HORSE_LINK_CHILD", + "ACTOR_DOOR_ANA", + "ACTOR_BG_SPOT02_OBJECTS", + "ACTOR_BG_HAKA", + "ACTOR_MAGIC_WIND", + "ACTOR_MAGIC_FIRE", + "ACTOR_UNSET_A0", + "ACTOR_EN_RU1", + "ACTOR_BOSS_FD2", + "ACTOR_EN_FD_FIRE", + "ACTOR_EN_DH", + "ACTOR_EN_DHA", + "ACTOR_EN_RL", + "ACTOR_EN_ENCOUNT1", + "ACTOR_DEMO_DU", + "ACTOR_DEMO_IM", + "ACTOR_DEMO_TRE_LGT", + "ACTOR_EN_FW", + "ACTOR_BG_VB_SIMA", + "ACTOR_EN_VB_BALL", + "ACTOR_BG_HAKA_MEGANE", + "ACTOR_BG_HAKA_MEGANEBG", + "ACTOR_BG_HAKA_SHIP", + "ACTOR_BG_HAKA_SGAMI", + "ACTOR_UNSET_B2", + "ACTOR_EN_HEISHI2", + "ACTOR_EN_ENCOUNT2", + "ACTOR_EN_FIRE_ROCK", + "ACTOR_EN_BROB", + "ACTOR_MIR_RAY", + "ACTOR_BG_SPOT09_OBJ", + "ACTOR_BG_SPOT18_OBJ", + "ACTOR_BOSS_VA", + "ACTOR_BG_HAKA_TUBO", + "ACTOR_BG_HAKA_TRAP", + "ACTOR_BG_HAKA_HUTA", + "ACTOR_BG_HAKA_ZOU", + "ACTOR_BG_SPOT17_FUNEN", + "ACTOR_EN_SYATEKI_ITM", + "ACTOR_EN_SYATEKI_MAN", + "ACTOR_EN_TANA", + "ACTOR_EN_NB", + "ACTOR_BOSS_MO", + "ACTOR_EN_SB", + "ACTOR_EN_BIGOKUTA", + "ACTOR_EN_KAREBABA", + "ACTOR_BG_BDAN_OBJECTS", + "ACTOR_DEMO_SA", + "ACTOR_DEMO_GO", + "ACTOR_EN_IN", + "ACTOR_EN_TR", + "ACTOR_BG_SPOT16_BOMBSTONE", + "ACTOR_UNSET_CE", + "ACTOR_BG_HIDAN_KOWARERUKABE", + "ACTOR_BG_BOMBWALL", + "ACTOR_BG_SPOT08_ICEBLOCK", + "ACTOR_EN_RU2", + "ACTOR_OBJ_DEKUJR", + "ACTOR_BG_MIZU_UZU", + "ACTOR_BG_SPOT06_OBJECTS", + "ACTOR_BG_ICE_OBJECTS", + "ACTOR_BG_HAKA_WATER", + "ACTOR_UNSET_D8", + "ACTOR_EN_MA2", + "ACTOR_EN_BOM_CHU", + "ACTOR_EN_HORSE_GAME_CHECK", + "ACTOR_BOSS_TW", + "ACTOR_EN_RR", + "ACTOR_EN_BA", + "ACTOR_EN_BX", + "ACTOR_EN_ANUBICE", + "ACTOR_EN_ANUBICE_FIRE", + "ACTOR_BG_MORI_HASHIGO", + "ACTOR_BG_MORI_HASHIRA4", + "ACTOR_BG_MORI_IDOMIZU", + "ACTOR_BG_SPOT16_DOUGHNUT", + "ACTOR_BG_BDAN_SWITCH", + "ACTOR_EN_MA1", + "ACTOR_BOSS_GANON", + "ACTOR_BOSS_SST", + "ACTOR_UNSET_EA", + "ACTOR_UNSET_EB", + "ACTOR_EN_NY", + "ACTOR_EN_FR", + "ACTOR_ITEM_SHIELD", + "ACTOR_BG_ICE_SHELTER", + "ACTOR_EN_ICE_HONO", + "ACTOR_ITEM_OCARINA", + "ACTOR_UNSET_F2", + "ACTOR_UNSET_F3", + "ACTOR_MAGIC_DARK", + "ACTOR_DEMO_6K", + "ACTOR_EN_ANUBICE_TAG", + "ACTOR_BG_HAKA_GATE", + "ACTOR_BG_SPOT15_SAKU", + "ACTOR_BG_JYA_GOROIWA", + "ACTOR_BG_JYA_ZURERUKABE", + "ACTOR_UNSET_FB", + "ACTOR_BG_JYA_COBRA", + "ACTOR_BG_JYA_KANAAMI", + "ACTOR_FISHING", + "ACTOR_OBJ_OSHIHIKI", + "ACTOR_BG_GATE_SHUTTER", + "ACTOR_EFF_DUST", + "ACTOR_BG_SPOT01_FUSYA", + "ACTOR_BG_SPOT01_IDOHASHIRA", + "ACTOR_BG_SPOT01_IDOMIZU", + "ACTOR_BG_PO_SYOKUDAI", + "ACTOR_BG_GANON_OTYUKA", + "ACTOR_BG_SPOT15_RRBOX", + "ACTOR_BG_UMAJUMP", + "ACTOR_UNSET_109", + "ACTOR_ARROW_FIRE", + "ACTOR_ARROW_ICE", + "ACTOR_ARROW_LIGHT", + "ACTOR_UNSET_10D", + "ACTOR_UNSET_10E", + "ACTOR_ITEM_ETCETERA", + "ACTOR_OBJ_KIBAKO", + "ACTOR_OBJ_TSUBO", + "ACTOR_EN_WONDER_ITEM", + "ACTOR_EN_IK", + "ACTOR_DEMO_IK", + "ACTOR_EN_SKJ", + "ACTOR_EN_SKJNEEDLE", + "ACTOR_EN_G_SWITCH", + "ACTOR_DEMO_EXT", + "ACTOR_DEMO_SHD", + "ACTOR_EN_DNS", + "ACTOR_ELF_MSG", + "ACTOR_EN_HONOTRAP", + "ACTOR_EN_TUBO_TRAP", + "ACTOR_OBJ_ICE_POLY", + "ACTOR_BG_SPOT03_TAKI", + "ACTOR_BG_SPOT07_TAKI", + "ACTOR_EN_FZ", + "ACTOR_EN_PO_RELAY", + "ACTOR_BG_RELAY_OBJECTS", + "ACTOR_EN_DIVING_GAME", + "ACTOR_EN_KUSA", + "ACTOR_OBJ_BEAN", + "ACTOR_OBJ_BOMBIWA", + "ACTOR_UNSET_128", + "ACTOR_UNSET_129", + "ACTOR_OBJ_SWITCH", + "ACTOR_OBJ_ELEVATOR", + "ACTOR_OBJ_LIFT", + "ACTOR_OBJ_HSBLOCK", + "ACTOR_EN_OKARINA_TAG", + "ACTOR_EN_YABUSAME_MARK", + "ACTOR_EN_GOROIWA", + "ACTOR_EN_EX_RUPPY", + "ACTOR_EN_TORYO", + "ACTOR_EN_DAIKU", + "ACTOR_UNSET_134", + "ACTOR_EN_NWC", + "ACTOR_EN_BLKOBJ", + "ACTOR_ITEM_INBOX", + "ACTOR_EN_GE1", + "ACTOR_OBJ_BLOCKSTOP", + "ACTOR_EN_SDA", + "ACTOR_EN_CLEAR_TAG", + "ACTOR_EN_NIW_LADY", + "ACTOR_EN_GM", + "ACTOR_EN_MS", + "ACTOR_EN_HS", + "ACTOR_BG_INGATE", + "ACTOR_EN_KANBAN", + "ACTOR_EN_HEISHI3", + "ACTOR_EN_SYATEKI_NIW", + "ACTOR_EN_ATTACK_NIW", + "ACTOR_BG_SPOT01_IDOSOKO", + "ACTOR_EN_SA", + "ACTOR_EN_WONDER_TALK", + "ACTOR_BG_GJYO_BRIDGE", + "ACTOR_EN_DS", + "ACTOR_EN_MK", + "ACTOR_EN_BOM_BOWL_MAN", + "ACTOR_EN_BOM_BOWL_PIT", + "ACTOR_EN_OWL", + "ACTOR_EN_ISHI", + "ACTOR_OBJ_HANA", + "ACTOR_OBJ_LIGHTSWITCH", + "ACTOR_OBJ_MURE2", + "ACTOR_EN_GO", + "ACTOR_EN_FU", + "ACTOR_UNSET_154", + "ACTOR_EN_CHANGER", + "ACTOR_BG_JYA_MEGAMI", + "ACTOR_BG_JYA_LIFT", + "ACTOR_BG_JYA_BIGMIRROR", + "ACTOR_BG_JYA_BOMBCHUIWA", + "ACTOR_BG_JYA_AMISHUTTER", + "ACTOR_BG_JYA_BOMBIWA", + "ACTOR_BG_SPOT18_BASKET", + "ACTOR_UNSET_15D", + "ACTOR_EN_GANON_ORGAN", + "ACTOR_EN_SIOFUKI", + "ACTOR_EN_STREAM", + "ACTOR_UNSET_161", + "ACTOR_EN_MM", + "ACTOR_EN_KO", + "ACTOR_EN_KZ", + "ACTOR_EN_WEATHER_TAG", + "ACTOR_BG_SST_FLOOR", + "ACTOR_EN_ANI", + "ACTOR_EN_EX_ITEM", + "ACTOR_BG_JYA_IRONOBJ", + "ACTOR_EN_JS", + "ACTOR_EN_JSJUTAN", + "ACTOR_EN_CS", + "ACTOR_EN_MD", + "ACTOR_EN_HY", + "ACTOR_EN_GANON_MANT", + "ACTOR_EN_OKARINA_EFFECT", + "ACTOR_EN_MAG", + "ACTOR_DOOR_GERUDO", + "ACTOR_ELF_MSG2", + "ACTOR_DEMO_GT", + "ACTOR_EN_PO_FIELD", + "ACTOR_EFC_ERUPC", + "ACTOR_BG_ZG", + "ACTOR_EN_HEISHI4", + "ACTOR_EN_ZL3", + "ACTOR_BOSS_GANON2", + "ACTOR_EN_KAKASI", + "ACTOR_EN_TAKARA_MAN", + "ACTOR_OBJ_MAKEOSHIHIKI", + "ACTOR_OCEFF_SPOT", + "ACTOR_END_TITLE", + "ACTOR_UNSET_180", + "ACTOR_EN_TORCH", + "ACTOR_DEMO_EC", + "ACTOR_SHOT_SUN", + "ACTOR_EN_DY_EXTRA", + "ACTOR_EN_WONDER_TALK2", + "ACTOR_EN_GE2", + "ACTOR_OBJ_ROOMTIMER", + "ACTOR_EN_SSH", + "ACTOR_EN_STH", + "ACTOR_OCEFF_WIPE", + "ACTOR_OCEFF_STORM", + "ACTOR_EN_WEIYER", + "ACTOR_BG_SPOT05_SOKO", + "ACTOR_BG_JYA_1FLIFT", + "ACTOR_BG_JYA_HAHENIRON", + "ACTOR_BG_SPOT12_GATE", + "ACTOR_BG_SPOT12_SAKU", + "ACTOR_EN_HINTNUTS", + "ACTOR_EN_NUTSBALL", + "ACTOR_BG_SPOT00_BREAK", + "ACTOR_EN_SHOPNUTS", + "ACTOR_EN_IT", + "ACTOR_EN_GELDB", + "ACTOR_OCEFF_WIPE2", + "ACTOR_OCEFF_WIPE3", + "ACTOR_EN_NIW_GIRL", + "ACTOR_EN_DOG", + "ACTOR_EN_SI", + "ACTOR_BG_SPOT01_OBJECTS2", + "ACTOR_OBJ_COMB", + "ACTOR_BG_SPOT11_BAKUDANKABE", + "ACTOR_OBJ_KIBAKO2", + "ACTOR_EN_DNT_DEMO", + "ACTOR_EN_DNT_JIJI", + "ACTOR_EN_DNT_NOMAL", + "ACTOR_EN_GUEST", + "ACTOR_BG_BOM_GUARD", + "ACTOR_EN_HS2", + "ACTOR_DEMO_KEKKAI", + "ACTOR_BG_SPOT08_BAKUDANKABE", + "ACTOR_BG_SPOT17_BAKUDANKABE", + "ACTOR_UNSET_1AA", + "ACTOR_OBJ_MURE3", + "ACTOR_EN_TG", + "ACTOR_EN_MU", + "ACTOR_EN_GO2", + "ACTOR_EN_WF", + "ACTOR_EN_SKB", + "ACTOR_DEMO_GJ", + "ACTOR_DEMO_GEFF", + "ACTOR_BG_GND_FIREMEIRO", + "ACTOR_BG_GND_DARKMEIRO", + "ACTOR_BG_GND_SOULMEIRO", + "ACTOR_BG_GND_NISEKABE", + "ACTOR_BG_GND_ICEBLOCK", + "ACTOR_EN_GB", + "ACTOR_EN_GS", + "ACTOR_BG_MIZU_BWALL", + "ACTOR_BG_MIZU_SHUTTER", + "ACTOR_EN_DAIKU_KAKARIKO", + "ACTOR_BG_BOWL_WALL", + "ACTOR_EN_WALL_TUBO", + "ACTOR_EN_PO_DESERT", + "ACTOR_EN_CROW", + "ACTOR_DOOR_KILLER", + "ACTOR_BG_SPOT11_OASIS", + "ACTOR_BG_SPOT18_FUTA", + "ACTOR_BG_SPOT18_SHUTTER", + "ACTOR_EN_MA3", + "ACTOR_EN_COW", + "ACTOR_BG_ICE_TURARA", + "ACTOR_BG_ICE_SHUTTER", + "ACTOR_EN_KAKASI2", + "ACTOR_EN_KAKASI3", + "ACTOR_OCEFF_WIPE4", + "ACTOR_EN_EG", + "ACTOR_BG_MENKURI_NISEKABE", + "ACTOR_EN_ZO", + "ACTOR_OBJ_MAKEKINSUTA", + "ACTOR_EN_GE3", + "ACTOR_OBJ_TIMEBLOCK", + "ACTOR_OBJ_HAMISHI", + "ACTOR_EN_ZL4", + "ACTOR_EN_MM2", + "ACTOR_BG_JYA_BLOCK", + "ACTOR_OBJ_WARP2BLOCK", +) diff --git a/tools/assets/extract/oot64_data/audio_ids.py b/tools/assets/extract/oot64_data/audio_ids.py new file mode 100644 index 0000000000..8bcf2b60b8 --- /dev/null +++ b/tools/assets/extract/oot64_data/audio_ids.py @@ -0,0 +1,141 @@ +# This file was made manually + +SEQ_IDS = { + 0x00: "NA_BGM_GENERAL_SFX", + 0x01: "NA_BGM_NATURE_AMBIENCE", + 0x02: "NA_BGM_FIELD_LOGIC", + 0x03: "NA_BGM_FIELD_INIT", + 0x04: "NA_BGM_FIELD_DEFAULT_1", + 0x05: "NA_BGM_FIELD_DEFAULT_2", + 0x06: "NA_BGM_FIELD_DEFAULT_3", + 0x07: "NA_BGM_FIELD_DEFAULT_4", + 0x08: "NA_BGM_FIELD_DEFAULT_5", + 0x09: "NA_BGM_FIELD_DEFAULT_6", + 0x0A: "NA_BGM_FIELD_DEFAULT_7", + 0x0B: "NA_BGM_FIELD_DEFAULT_8", + 0x0C: "NA_BGM_FIELD_DEFAULT_9", + 0x0D: "NA_BGM_FIELD_DEFAULT_A", + 0x0E: "NA_BGM_FIELD_DEFAULT_B", + 0x0F: "NA_BGM_FIELD_ENEMY_INIT", + 0x10: "NA_BGM_FIELD_ENEMY_1", + 0x11: "NA_BGM_FIELD_ENEMY_2", + 0x12: "NA_BGM_FIELD_ENEMY_3", + 0x13: "NA_BGM_FIELD_ENEMY_4", + 0x14: "NA_BGM_FIELD_STILL_1", + 0x15: "NA_BGM_FIELD_STILL_2", + 0x16: "NA_BGM_FIELD_STILL_3", + 0x17: "NA_BGM_FIELD_STILL_4", + 0x18: "NA_BGM_DUNGEON", + 0x19: "NA_BGM_KAKARIKO_ADULT", + 0x1A: "NA_BGM_ENEMY", + 0x1B: "NA_BGM_BOSS", + 0x1C: "NA_BGM_INSIDE_DEKU_TREE", + 0x1D: "NA_BGM_MARKET", + 0x1E: "NA_BGM_TITLE", + 0x1F: "NA_BGM_LINK_HOUSE", + 0x20: "NA_BGM_GAME_OVER", + 0x21: "NA_BGM_BOSS_CLEAR", + 0x22: "NA_BGM_ITEM_GET", + 0x23: "NA_BGM_OPENING_GANON", + 0x24: "NA_BGM_HEART_GET", + 0x25: "NA_BGM_OCA_LIGHT", + 0x26: "NA_BGM_JABU_JABU", + 0x27: "NA_BGM_KAKARIKO_KID", + 0x28: "NA_BGM_GREAT_FAIRY", + 0x29: "NA_BGM_ZELDA_THEME", + 0x2A: "NA_BGM_FIRE_TEMPLE", + 0x2B: "NA_BGM_OPEN_TRE_BOX", + 0x2C: "NA_BGM_FOREST_TEMPLE", + 0x2D: "NA_BGM_COURTYARD", + 0x2E: "NA_BGM_GANON_TOWER", + 0x2F: "NA_BGM_LONLON", + 0x30: "NA_BGM_GORON_CITY", + 0x31: "NA_BGM_FIELD_MORNING", + 0x32: "NA_BGM_SPIRITUAL_STONE", + 0x33: "NA_BGM_OCA_BOLERO", + 0x34: "NA_BGM_OCA_MINUET", + 0x35: "NA_BGM_OCA_SERENADE", + 0x36: "NA_BGM_OCA_REQUIEM", + 0x37: "NA_BGM_OCA_NOCTURNE", + 0x38: "NA_BGM_MINI_BOSS", + 0x39: "NA_BGM_SMALL_ITEM_GET", + 0x3A: "NA_BGM_TEMPLE_OF_TIME", + 0x3B: "NA_BGM_EVENT_CLEAR", + 0x3C: "NA_BGM_KOKIRI", + 0x3D: "NA_BGM_OCA_FAIRY_GET", + 0x3E: "NA_BGM_SARIA_THEME", + 0x3F: "NA_BGM_SPIRIT_TEMPLE", + 0x40: "NA_BGM_HORSE", + 0x41: "NA_BGM_HORSE_GOAL", + 0x42: "NA_BGM_INGO", + 0x43: "NA_BGM_MEDALLION_GET", + 0x44: "NA_BGM_OCA_SARIA", + 0x45: "NA_BGM_OCA_EPONA", + 0x46: "NA_BGM_OCA_ZELDA", + 0x47: "NA_BGM_OCA_SUNS", + 0x48: "NA_BGM_OCA_TIME", + 0x49: "NA_BGM_OCA_STORM", + 0x4A: "NA_BGM_NAVI_OPENING", + 0x4B: "NA_BGM_DEKU_TREE_CS", + 0x4C: "NA_BGM_WINDMILL", + 0x4D: "NA_BGM_HYRULE_CS", + 0x4E: "NA_BGM_MINI_GAME", + 0x4F: "NA_BGM_SHEIK", + 0x50: "NA_BGM_ZORA_DOMAIN", + 0x51: "NA_BGM_APPEAR", + 0x52: "NA_BGM_ADULT_LINK", + 0x53: "NA_BGM_MASTER_SWORD", + 0x54: "NA_BGM_INTRO_GANON", + 0x55: "NA_BGM_SHOP", + 0x56: "NA_BGM_CHAMBER_OF_SAGES", + 0x57: "NA_BGM_FILE_SELECT", + 0x58: "NA_BGM_ICE_CAVERN", + 0x59: "NA_BGM_DOOR_OF_TIME", + 0x5A: "NA_BGM_OWL", + 0x5B: "NA_BGM_SHADOW_TEMPLE", + 0x5C: "NA_BGM_WATER_TEMPLE", + 0x5D: "NA_BGM_BRIDGE_TO_GANONS", + 0x5E: "NA_BGM_OCARINA_OF_TIME", + 0x5F: "NA_BGM_GERUDO_VALLEY", + 0x60: "NA_BGM_POTION_SHOP", + 0x61: "NA_BGM_KOTAKE_KOUME", + 0x62: "NA_BGM_ESCAPE", + 0x63: "NA_BGM_UNDERGROUND", + 0x64: "NA_BGM_GANONDORF_BOSS", + 0x65: "NA_BGM_GANON_BOSS", + 0x66: "NA_BGM_END_DEMO", + 0x67: "NA_BGM_STAFF_1", + 0x68: "NA_BGM_STAFF_2", + 0x69: "NA_BGM_STAFF_3", + 0x6A: "NA_BGM_STAFF_4", + 0x6B: "NA_BGM_FIRE_BOSS", + 0x6C: "NA_BGM_TIMED_MINI_GAME", + 0x6D: "NA_BGM_CUTSCENE_EFFECTS", + 0x7F: "NA_BGM_NO_MUSIC", + 0x80: "NA_BGM_NATURE_SFX_RAIN", + 0xFFFF: "NA_BGM_DISABLED", +} + +NATURE_AMBIENCE_IDS = { + 0x00: "NATURE_ID_GENERAL_NIGHT", + 0x01: "NATURE_ID_MARKET_ENTRANCE", + 0x02: "NATURE_ID_KAKARIKO_REGION", + 0x03: "NATURE_ID_MARKET_RUINS", + 0x04: "NATURE_ID_KOKIRI_REGION", + 0x05: "NATURE_ID_MARKET_NIGHT", + 0x06: "NATURE_ID_06", + 0x07: "NATURE_ID_GANONS_LAIR", + 0x08: "NATURE_ID_08", + 0x09: "NATURE_ID_09", + 0x0A: "NATURE_ID_WASTELAND", + 0x0B: "NATURE_ID_COLOSSUS", + 0x0C: "NATURE_ID_DEATH_MOUNTAIN_TRAIL", + 0x0D: "NATURE_ID_0D", + 0x0E: "NATURE_ID_0E", + 0x0F: "NATURE_ID_0F", + 0x10: "NATURE_ID_10", + 0x11: "NATURE_ID_11", + 0x12: "NATURE_ID_12", + 0x13: "NATURE_ID_NONE", + 0xFF: "NATURE_ID_DISABLED", +} diff --git a/tools/assets/extract/oot64_data/entrance_ids_special.py b/tools/assets/extract/oot64_data/entrance_ids_special.py new file mode 100644 index 0000000000..48a798f253 --- /dev/null +++ b/tools/assets/extract/oot64_data/entrance_ids_special.py @@ -0,0 +1,11 @@ +# This file was made manually + +DATA = { + 0x7FF9: "ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_SPELLS", + 0x7FFA: "ENTR_RETURN_SHOOTING_GALLERY", + 0x7FFB: "ENTR_RETURN_2", + 0x7FFC: "ENTR_RETURN_BAZAAR", + 0x7FFD: "ENTR_RETURN_4", + 0x7FFE: "ENTR_RETURN_GREAT_FAIRYS_FOUNTAIN_MAGIC", + 0x7FFF: "ENTR_RETURN_GROTTO", +} diff --git a/tools/assets/extract/oot64_data/entrance_table_mini.py b/tools/assets/extract/oot64_data/entrance_table_mini.py new file mode 100644 index 0000000000..9b23c6135c --- /dev/null +++ b/tools/assets/extract/oot64_data/entrance_table_mini.py @@ -0,0 +1,1560 @@ +# This file was generated from ../../../..//include/tables/entrance_table.h + +DATA = ( + ("ENTR_DEKU_TREE_0", "SCENE_DEKU_TREE", 0), + ("ENTR_DEKU_TREE_0_1", "SCENE_DEKU_TREE", 0), + ("ENTR_DEKU_TREE_0_2", "SCENE_DEKU_TREE", 0), + ("ENTR_DEKU_TREE_0_3", "SCENE_DEKU_TREE", 0), + ("ENTR_DODONGOS_CAVERN_0", "SCENE_DODONGOS_CAVERN", 0), + ("ENTR_DODONGOS_CAVERN_0_1", "SCENE_DODONGOS_CAVERN", 0), + ("ENTR_DODONGOS_CAVERN_0_2", "SCENE_DODONGOS_CAVERN", 0), + ("ENTR_DODONGOS_CAVERN_0_3", "SCENE_DODONGOS_CAVERN", 0), + ("ENTR_GERUDO_TRAINING_GROUND_0", "SCENE_GERUDO_TRAINING_GROUND", 0), + ("ENTR_GERUDO_TRAINING_GROUND_0_1", "SCENE_GERUDO_TRAINING_GROUND", 0), + ("ENTR_GERUDO_TRAINING_GROUND_0_2", "SCENE_GERUDO_TRAINING_GROUND", 0), + ("ENTR_GERUDO_TRAINING_GROUND_0_3", "SCENE_GERUDO_TRAINING_GROUND", 0), + ("ENTR_FOREST_TEMPLE_BOSS_0", "SCENE_FOREST_TEMPLE_BOSS", 0), + ("ENTR_FOREST_TEMPLE_BOSS_0_1", "SCENE_FOREST_TEMPLE_BOSS", 0), + ("ENTR_FOREST_TEMPLE_BOSS_0_2", "SCENE_FOREST_TEMPLE_BOSS", 0), + ("ENTR_FOREST_TEMPLE_BOSS_0_3", "SCENE_FOREST_TEMPLE_BOSS", 0), + ("ENTR_WATER_TEMPLE_0", "SCENE_WATER_TEMPLE", 0), + ("ENTR_WATER_TEMPLE_0_1", "SCENE_WATER_TEMPLE", 0), + ("ENTR_WATER_TEMPLE_0_2", "SCENE_WATER_TEMPLE", 0), + ("ENTR_WATER_TEMPLE_0_3", "SCENE_WATER_TEMPLE", 0), + ("ENTR_UNUSED_6E", "SCENE_UNUSED_6E", 0), + ("ENTR_UNUSED_6E_1", "SCENE_UNUSED_6E", 0), + ("ENTR_UNUSED_6E_2", "SCENE_UNUSED_6E", 0), + ("ENTR_UNUSED_6E_3", "SCENE_UNUSED_6E", 0), + ("ENTR_SASATEST_0", "SCENE_SASATEST", 0), + ("ENTR_SASATEST_0_1", "SCENE_SASATEST", 0), + ("ENTR_SASATEST_0_2", "SCENE_SASATEST", 0), + ("ENTR_SASATEST_0_3", "SCENE_SASATEST", 0), + ("ENTR_SYOTES_0", "SCENE_SYOTES", 0), + ("ENTR_SYOTES_0_1", "SCENE_SYOTES", 0), + ("ENTR_SYOTES_0_2", "SCENE_SYOTES", 0), + ("ENTR_SYOTES_0_3", "SCENE_SYOTES", 0), + ("ENTR_SYOTES2_0", "SCENE_SYOTES2", 0), + ("ENTR_SYOTES2_0_1", "SCENE_SYOTES2", 0), + ("ENTR_SYOTES2_0_2", "SCENE_SYOTES2", 0), + ("ENTR_SYOTES2_0_3", "SCENE_SYOTES2", 0), + ("ENTR_TESTROOM_0", "SCENE_TESTROOM", 0), + ("ENTR_TESTROOM_0_1", "SCENE_TESTROOM", 0), + ("ENTR_TESTROOM_0_2", "SCENE_TESTROOM", 0), + ("ENTR_TESTROOM_0_3", "SCENE_TESTROOM", 0), + ("ENTR_JABU_JABU_0", "SCENE_JABU_JABU", 0), + ("ENTR_JABU_JABU_0_1", "SCENE_JABU_JABU", 0), + ("ENTR_JABU_JABU_0_2", "SCENE_JABU_JABU", 0), + ("ENTR_JABU_JABU_0_3", "SCENE_JABU_JABU", 0), + ("ENTR_JABU_JABU_0_4", "SCENE_JABU_JABU", 0), + ("ENTR_ROYAL_FAMILYS_TOMB_0", "SCENE_ROYAL_FAMILYS_TOMB", 0), + ("ENTR_ROYAL_FAMILYS_TOMB_0_1", "SCENE_ROYAL_FAMILYS_TOMB", 0), + ("ENTR_ROYAL_FAMILYS_TOMB_0_2", "SCENE_ROYAL_FAMILYS_TOMB", 0), + ("ENTR_ROYAL_FAMILYS_TOMB_0_3", "SCENE_ROYAL_FAMILYS_TOMB", 0), + ("ENTR_ROYAL_FAMILYS_TOMB_0_4", "SCENE_ROYAL_FAMILYS_TOMB", 0), + ("ENTR_ROYAL_FAMILYS_TOMB_0_5", "SCENE_ROYAL_FAMILYS_TOMB", 0), + ("ENTR_MARKET_ENTRANCE_DAY_0", "SCENE_MARKET_ENTRANCE_DAY", 0), + ("ENTR_MARKET_ENTRANCE_NIGHT_0_1", "SCENE_MARKET_ENTRANCE_NIGHT", 0), + ("ENTR_MARKET_ENTRANCE_RUINS_0_2", "SCENE_MARKET_ENTRANCE_RUINS", 0), + ("ENTR_MARKET_ENTRANCE_RUINS_0_3", "SCENE_MARKET_ENTRANCE_RUINS", 0), + ("ENTR_SHADOW_TEMPLE_0", "SCENE_SHADOW_TEMPLE", 0), + ("ENTR_SHADOW_TEMPLE_0_1", "SCENE_SHADOW_TEMPLE", 0), + ("ENTR_SHADOW_TEMPLE_0_2", "SCENE_SHADOW_TEMPLE", 0), + ("ENTR_SHADOW_TEMPLE_0_3", "SCENE_SHADOW_TEMPLE", 0), + ("ENTR_SHOOTING_GALLERY_0", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_SHOOTING_GALLERY_0_1", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_SHOOTING_GALLERY_0_2", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_SHOOTING_GALLERY_0_3", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_GROTTOS_0", "SCENE_GROTTOS", 0), + ("ENTR_GROTTOS_0_1", "SCENE_GROTTOS", 0), + ("ENTR_GROTTOS_0_2", "SCENE_GROTTOS", 0), + ("ENTR_GROTTOS_0_3", "SCENE_GROTTOS", 0), + ("ENTR_LAKESIDE_LABORATORY_0", "SCENE_LAKESIDE_LABORATORY", 0), + ("ENTR_LAKESIDE_LABORATORY_0_1", "SCENE_LAKESIDE_LABORATORY", 0), + ("ENTR_LAKESIDE_LABORATORY_0_2", "SCENE_LAKESIDE_LABORATORY", 0), + ("ENTR_LAKESIDE_LABORATORY_0_3", "SCENE_LAKESIDE_LABORATORY", 0), + ("ENTR_SUTARU_0", "SCENE_SUTARU", 0), + ("ENTR_SUTARU_0_1", "SCENE_SUTARU", 0), + ("ENTR_SUTARU_0_2", "SCENE_SUTARU", 0), + ("ENTR_SUTARU_0_3", "SCENE_SUTARU", 0), + ("ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0", "SCENE_GRAVE_WITH_FAIRYS_FOUNTAIN", 0), + ("ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0_1", "SCENE_GRAVE_WITH_FAIRYS_FOUNTAIN", 0), + ("ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0_2", "SCENE_GRAVE_WITH_FAIRYS_FOUNTAIN", 0), + ("ENTR_GRAVE_WITH_FAIRYS_FOUNTAIN_0_3", "SCENE_GRAVE_WITH_FAIRYS_FOUNTAIN", 0), + ("ENTR_LON_LON_BUILDINGS_0", "SCENE_LON_LON_BUILDINGS", 0), + ("ENTR_LON_LON_BUILDINGS_0_1", "SCENE_LON_LON_BUILDINGS", 0), + ("ENTR_LON_LON_BUILDINGS_0_2", "SCENE_LON_LON_BUILDINGS", 0), + ("ENTR_LON_LON_BUILDINGS_0_3", "SCENE_LON_LON_BUILDINGS", 0), + ("ENTR_TEMPLE_OF_TIME_0", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_1", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_2", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_3", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_4", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_5", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_6", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_7", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_8", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_9", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_10", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_11", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_12", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_13", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_14", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TEMPLE_OF_TIME_0_15", "SCENE_TEMPLE_OF_TIME", 0), + ("ENTR_TREASURE_BOX_SHOP_0", "SCENE_TREASURE_BOX_SHOP", 0), + ("ENTR_TREASURE_BOX_SHOP_0_1", "SCENE_TREASURE_BOX_SHOP", 0), + ("ENTR_TREASURE_BOX_SHOP_0_2", "SCENE_TREASURE_BOX_SHOP", 0), + ("ENTR_TREASURE_BOX_SHOP_0_3", "SCENE_TREASURE_BOX_SHOP", 0), + ("ENTR_BACK_ALLEY_DAY_3", "SCENE_BACK_ALLEY_DAY", 3), + ("ENTR_BACK_ALLEY_NIGHT_3_1", "SCENE_BACK_ALLEY_NIGHT", 3), + ("ENTR_BACK_ALLEY_DAY_3_2", "SCENE_BACK_ALLEY_DAY", 3), + ("ENTR_BACK_ALLEY_NIGHT_3_3", "SCENE_BACK_ALLEY_NIGHT", 3), + ("ENTR_CHAMBER_OF_THE_SAGES_0", "SCENE_CHAMBER_OF_THE_SAGES", 0), + ("ENTR_CHAMBER_OF_THE_SAGES_0_1", "SCENE_CHAMBER_OF_THE_SAGES", 0), + ("ENTR_CHAMBER_OF_THE_SAGES_0_2", "SCENE_CHAMBER_OF_THE_SAGES", 0), + ("ENTR_CHAMBER_OF_THE_SAGES_0_3", "SCENE_CHAMBER_OF_THE_SAGES", 0), + ("ENTR_CHAMBER_OF_THE_SAGES_0_4", "SCENE_CHAMBER_OF_THE_SAGES", 0), + ("ENTR_CHAMBER_OF_THE_SAGES_0_5", "SCENE_CHAMBER_OF_THE_SAGES", 0), + ("ENTR_CHAMBER_OF_THE_SAGES_0_6", "SCENE_CHAMBER_OF_THE_SAGES", 0), + ("ENTR_POTION_SHOP_GRANNY_0", "SCENE_POTION_SHOP_GRANNY", 0), + ("ENTR_POTION_SHOP_GRANNY_0_1", "SCENE_POTION_SHOP_GRANNY", 0), + ("ENTR_POTION_SHOP_GRANNY_0_2", "SCENE_POTION_SHOP_GRANNY", 0), + ("ENTR_POTION_SHOP_GRANNY_0_3", "SCENE_POTION_SHOP_GRANNY", 0), + ("ENTR_HAIRAL_NIWA2_0", "SCENE_HAIRAL_NIWA2", 0), + ("ENTR_HAIRAL_NIWA2_0_1", "SCENE_HAIRAL_NIWA2", 0), + ("ENTR_HAIRAL_NIWA2_0_2", "SCENE_HAIRAL_NIWA2", 0), + ("ENTR_HAIRAL_NIWA2_0_3", "SCENE_HAIRAL_NIWA2", 0), + ("ENTR_CASTLE_COURTYARD_GUARDS_DAY_0", "SCENE_CASTLE_COURTYARD_GUARDS_DAY", 0), + ("ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_0_1", "SCENE_CASTLE_COURTYARD_GUARDS_NIGHT", 0), + ("ENTR_CASTLE_COURTYARD_GUARDS_DAY_0_2", "SCENE_CASTLE_COURTYARD_GUARDS_DAY", 0), + ("ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_0_3", "SCENE_CASTLE_COURTYARD_GUARDS_NIGHT", 0), + ("ENTR_MARKET_GUARD_HOUSE_0", "SCENE_MARKET_GUARD_HOUSE", 0), + ("ENTR_MARKET_GUARD_HOUSE_0_1", "SCENE_MARKET_GUARD_HOUSE", 0), + ("ENTR_MARKET_GUARD_HOUSE_0_2", "SCENE_MARKET_GUARD_HOUSE", 0), + ("ENTR_MARKET_GUARD_HOUSE_0_3", "SCENE_MARKET_GUARD_HOUSE", 0), + ("ENTR_SPIRIT_TEMPLE_0", "SCENE_SPIRIT_TEMPLE", 0), + ("ENTR_SPIRIT_TEMPLE_0_1", "SCENE_SPIRIT_TEMPLE", 0), + ("ENTR_SPIRIT_TEMPLE_0_2", "SCENE_SPIRIT_TEMPLE", 0), + ("ENTR_SPIRIT_TEMPLE_0_3", "SCENE_SPIRIT_TEMPLE", 0), + ("ENTR_SPIRIT_TEMPLE_0_4", "SCENE_SPIRIT_TEMPLE", 0), + ("ENTR_SPIRIT_TEMPLE_0_5", "SCENE_SPIRIT_TEMPLE", 0), + ("ENTR_ICE_CAVERN_0", "SCENE_ICE_CAVERN", 0), + ("ENTR_ICE_CAVERN_0_1", "SCENE_ICE_CAVERN", 0), + ("ENTR_ICE_CAVERN_0_2", "SCENE_ICE_CAVERN", 0), + ("ENTR_ICE_CAVERN_0_3", "SCENE_ICE_CAVERN", 0), + ("ENTR_ICE_CAVERN_0_4", "SCENE_ICE_CAVERN", 0), + ("ENTR_SPIRIT_TEMPLE_BOSS_0", "SCENE_SPIRIT_TEMPLE_BOSS", 0), + ("ENTR_SPIRIT_TEMPLE_BOSS_0_1", "SCENE_SPIRIT_TEMPLE_BOSS", 0), + ("ENTR_SPIRIT_TEMPLE_BOSS_0_2", "SCENE_SPIRIT_TEMPLE_BOSS", 0), + ("ENTR_SPIRIT_TEMPLE_BOSS_0_3", "SCENE_SPIRIT_TEMPLE_BOSS", 0), + ("ENTR_SPIRIT_TEMPLE_BOSS_0_4", "SCENE_SPIRIT_TEMPLE_BOSS", 0), + ("ENTR_SPIRIT_TEMPLE_BOSS_0_5", "SCENE_SPIRIT_TEMPLE_BOSS", 0), + ("ENTR_SPIRIT_TEMPLE_BOSS_0_6", "SCENE_SPIRIT_TEMPLE_BOSS", 0), + ("ENTR_TEST01_0", "SCENE_TEST01", 0), + ("ENTR_TEST01_0_1", "SCENE_TEST01", 0), + ("ENTR_TEST01_0_2", "SCENE_TEST01", 0), + ("ENTR_TEST01_0_3", "SCENE_TEST01", 0), + ("ENTR_BOTTOM_OF_THE_WELL_0", "SCENE_BOTTOM_OF_THE_WELL", 0), + ("ENTR_BOTTOM_OF_THE_WELL_0_1", "SCENE_BOTTOM_OF_THE_WELL", 0), + ("ENTR_BOTTOM_OF_THE_WELL_0_2", "SCENE_BOTTOM_OF_THE_WELL", 0), + ("ENTR_BOTTOM_OF_THE_WELL_0_3", "SCENE_BOTTOM_OF_THE_WELL", 0), + ("ENTR_TWINS_HOUSE_0", "SCENE_TWINS_HOUSE", 0), + ("ENTR_TWINS_HOUSE_0_1", "SCENE_TWINS_HOUSE", 0), + ("ENTR_TWINS_HOUSE_0_2", "SCENE_TWINS_HOUSE", 0), + ("ENTR_TWINS_HOUSE_0_3", "SCENE_TWINS_HOUSE", 0), + ("ENTR_CUTSCENE_MAP_0", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_1", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_2", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_3", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_4", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_5", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_6", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_7", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_8", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_9", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_10", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_11", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_CUTSCENE_MAP_0_12", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_BACK_ALLEY_DAY_0", "SCENE_BACK_ALLEY_DAY", 0), + ("ENTR_BACK_ALLEY_NIGHT_0_1", "SCENE_BACK_ALLEY_NIGHT", 0), + ("ENTR_BACK_ALLEY_DAY_0_2", "SCENE_BACK_ALLEY_DAY", 0), + ("ENTR_BACK_ALLEY_NIGHT_0_3", "SCENE_BACK_ALLEY_NIGHT", 0), + ("ENTR_MARKET_DAY_0", "SCENE_MARKET_DAY", 0), + ("ENTR_MARKET_NIGHT_0_1", "SCENE_MARKET_NIGHT", 0), + ("ENTR_MARKET_RUINS_0_2", "SCENE_MARKET_RUINS", 0), + ("ENTR_MARKET_RUINS_0_3", "SCENE_MARKET_RUINS", 0), + ("ENTR_MARKET_DAY_0_4", "SCENE_MARKET_DAY", 0), + ("ENTR_DEPTH_TEST_0", "SCENE_DEPTH_TEST", 0), + ("ENTR_BAZAAR_0", "SCENE_BAZAAR", 0), + ("ENTR_BAZAAR_0_1", "SCENE_BAZAAR", 0), + ("ENTR_BAZAAR_0_2", "SCENE_BAZAAR", 0), + ("ENTR_BAZAAR_0_3", "SCENE_BAZAAR", 0), + ("ENTR_LINKS_HOUSE_0", "SCENE_LINKS_HOUSE", 0), + ("ENTR_LINKS_HOUSE_0_1", "SCENE_LINKS_HOUSE", 0), + ("ENTR_LINKS_HOUSE_0_2", "SCENE_LINKS_HOUSE", 0), + ("ENTR_LINKS_HOUSE_0_3", "SCENE_LINKS_HOUSE", 0), + ("ENTR_LINKS_HOUSE_0_4", "SCENE_LINKS_HOUSE", 0), + ("ENTR_LINKS_HOUSE_0_5", "SCENE_LINKS_HOUSE", 0), + ("ENTR_KOKIRI_SHOP_0", "SCENE_KOKIRI_SHOP", 0), + ("ENTR_KOKIRI_SHOP_0_1", "SCENE_KOKIRI_SHOP", 0), + ("ENTR_KOKIRI_SHOP_0_2", "SCENE_KOKIRI_SHOP", 0), + ("ENTR_KOKIRI_SHOP_0_3", "SCENE_KOKIRI_SHOP", 0), + ("ENTR_DODONGOS_CAVERN_1", "SCENE_DODONGOS_CAVERN", 1), + ("ENTR_DODONGOS_CAVERN_1_1", "SCENE_DODONGOS_CAVERN", 1), + ("ENTR_DODONGOS_CAVERN_1_2", "SCENE_DODONGOS_CAVERN", 1), + ("ENTR_DODONGOS_CAVERN_1_3", "SCENE_DODONGOS_CAVERN", 1), + ("ENTR_KNOW_IT_ALL_BROS_HOUSE_0", "SCENE_KNOW_IT_ALL_BROS_HOUSE", 0), + ("ENTR_KNOW_IT_ALL_BROS_HOUSE_0_1", "SCENE_KNOW_IT_ALL_BROS_HOUSE", 0), + ("ENTR_KNOW_IT_ALL_BROS_HOUSE_0_2", "SCENE_KNOW_IT_ALL_BROS_HOUSE", 0), + ("ENTR_KNOW_IT_ALL_BROS_HOUSE_0_3", "SCENE_KNOW_IT_ALL_BROS_HOUSE", 0), + ("ENTR_HYRULE_FIELD_0", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_1", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_2", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_3", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_4", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_5", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_6", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_7", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_8", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_9", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_10", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_11", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_12", "SCENE_HYRULE_FIELD", 0), + ("ENTR_HYRULE_FIELD_0_13", "SCENE_HYRULE_FIELD", 0), + ("ENTR_KAKARIKO_VILLAGE_0", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_1", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_2", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_3", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_4", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_5", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_6", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_7", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_KAKARIKO_VILLAGE_0_8", "SCENE_KAKARIKO_VILLAGE", 0), + ("ENTR_GRAVEYARD_0", "SCENE_GRAVEYARD", 0), + ("ENTR_GRAVEYARD_0_1", "SCENE_GRAVEYARD", 0), + ("ENTR_GRAVEYARD_0_2", "SCENE_GRAVEYARD", 0), + ("ENTR_GRAVEYARD_0_3", "SCENE_GRAVEYARD", 0), + ("ENTR_GRAVEYARD_0_4", "SCENE_GRAVEYARD", 0), + ("ENTR_GRAVEYARD_0_5", "SCENE_GRAVEYARD", 0), + ("ENTR_ZORAS_RIVER_0", "SCENE_ZORAS_RIVER", 0), + ("ENTR_ZORAS_RIVER_0_1", "SCENE_ZORAS_RIVER", 0), + ("ENTR_ZORAS_RIVER_0_2", "SCENE_ZORAS_RIVER", 0), + ("ENTR_ZORAS_RIVER_0_3", "SCENE_ZORAS_RIVER", 0), + ("ENTR_KOKIRI_FOREST_0", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_1", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_2", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_3", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_4", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_5", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_6", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_7", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_8", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_9", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_10", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_11", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_12", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_KOKIRI_FOREST_0_13", "SCENE_KOKIRI_FOREST", 0), + ("ENTR_SACRED_FOREST_MEADOW_0", "SCENE_SACRED_FOREST_MEADOW", 0), + ("ENTR_SACRED_FOREST_MEADOW_0_1", "SCENE_SACRED_FOREST_MEADOW", 0), + ("ENTR_SACRED_FOREST_MEADOW_0_2", "SCENE_SACRED_FOREST_MEADOW", 0), + ("ENTR_SACRED_FOREST_MEADOW_0_3", "SCENE_SACRED_FOREST_MEADOW", 0), + ("ENTR_SACRED_FOREST_MEADOW_0_4", "SCENE_SACRED_FOREST_MEADOW", 0), + ("ENTR_SACRED_FOREST_MEADOW_0_5", "SCENE_SACRED_FOREST_MEADOW", 0), + ("ENTR_LAKE_HYLIA_0", "SCENE_LAKE_HYLIA", 0), + ("ENTR_LAKE_HYLIA_0_1", "SCENE_LAKE_HYLIA", 0), + ("ENTR_LAKE_HYLIA_0_2", "SCENE_LAKE_HYLIA", 0), + ("ENTR_LAKE_HYLIA_0_3", "SCENE_LAKE_HYLIA", 0), + ("ENTR_LAKE_HYLIA_0_4", "SCENE_LAKE_HYLIA", 0), + ("ENTR_LAKE_HYLIA_0_5", "SCENE_LAKE_HYLIA", 0), + ("ENTR_ZORAS_DOMAIN_0", "SCENE_ZORAS_DOMAIN", 0), + ("ENTR_ZORAS_DOMAIN_0_1", "SCENE_ZORAS_DOMAIN", 0), + ("ENTR_ZORAS_DOMAIN_0_2", "SCENE_ZORAS_DOMAIN", 0), + ("ENTR_ZORAS_DOMAIN_0_3", "SCENE_ZORAS_DOMAIN", 0), + ("ENTR_ZORAS_DOMAIN_0_4", "SCENE_ZORAS_DOMAIN", 0), + ("ENTR_ZORAS_DOMAIN_0_5", "SCENE_ZORAS_DOMAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_1", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_2", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_3", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_4", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_5", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_6", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_7", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_ZORAS_FOUNTAIN_0_8", "SCENE_ZORAS_FOUNTAIN", 0), + ("ENTR_GERUDO_VALLEY_0", "SCENE_GERUDO_VALLEY", 0), + ("ENTR_GERUDO_VALLEY_0_1", "SCENE_GERUDO_VALLEY", 0), + ("ENTR_GERUDO_VALLEY_0_2", "SCENE_GERUDO_VALLEY", 0), + ("ENTR_GERUDO_VALLEY_0_3", "SCENE_GERUDO_VALLEY", 0), + ("ENTR_GERUDO_VALLEY_0_4", "SCENE_GERUDO_VALLEY", 0), + ("ENTR_GERUDO_VALLEY_0_5", "SCENE_GERUDO_VALLEY", 0), + ("ENTR_GERUDO_VALLEY_0_6", "SCENE_GERUDO_VALLEY", 0), + ("ENTR_LOST_WOODS_0", "SCENE_LOST_WOODS", 0), + ("ENTR_LOST_WOODS_0_1", "SCENE_LOST_WOODS", 0), + ("ENTR_LOST_WOODS_0_2", "SCENE_LOST_WOODS", 0), + ("ENTR_LOST_WOODS_0_3", "SCENE_LOST_WOODS", 0), + ("ENTR_LOST_WOODS_0_4", "SCENE_LOST_WOODS", 0), + ("ENTR_DESERT_COLOSSUS_0", "SCENE_DESERT_COLOSSUS", 0), + ("ENTR_DESERT_COLOSSUS_0_1", "SCENE_DESERT_COLOSSUS", 0), + ("ENTR_DESERT_COLOSSUS_0_2", "SCENE_DESERT_COLOSSUS", 0), + ("ENTR_DESERT_COLOSSUS_0_3", "SCENE_DESERT_COLOSSUS", 0), + ("ENTR_DESERT_COLOSSUS_0_4", "SCENE_DESERT_COLOSSUS", 0), + ("ENTR_DESERT_COLOSSUS_0_5", "SCENE_DESERT_COLOSSUS", 0), + ("ENTR_GERUDOS_FORTRESS_0", "SCENE_GERUDOS_FORTRESS", 0), + ("ENTR_GERUDOS_FORTRESS_0_1", "SCENE_GERUDOS_FORTRESS", 0), + ("ENTR_GERUDOS_FORTRESS_0_2", "SCENE_GERUDOS_FORTRESS", 0), + ("ENTR_GERUDOS_FORTRESS_0_3", "SCENE_GERUDOS_FORTRESS", 0), + ("ENTR_GERUDOS_FORTRESS_0_4", "SCENE_GERUDOS_FORTRESS", 0), + ("ENTR_GERUDOS_FORTRESS_0_5", "SCENE_GERUDOS_FORTRESS", 0), + ("ENTR_GERUDOS_FORTRESS_0_6", "SCENE_GERUDOS_FORTRESS", 0), + ("ENTR_HAUNTED_WASTELAND_0", "SCENE_HAUNTED_WASTELAND", 0), + ("ENTR_HAUNTED_WASTELAND_0_1", "SCENE_HAUNTED_WASTELAND", 0), + ("ENTR_HAUNTED_WASTELAND_0_2", "SCENE_HAUNTED_WASTELAND", 0), + ("ENTR_HAUNTED_WASTELAND_0_3", "SCENE_HAUNTED_WASTELAND", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_1_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 1), + ("ENTR_HYRULE_CASTLE_0", "SCENE_HYRULE_CASTLE", 0), + ("ENTR_HYRULE_CASTLE_0_1", "SCENE_HYRULE_CASTLE", 0), + ("ENTR_OUTSIDE_GANONS_CASTLE_0_2", "SCENE_OUTSIDE_GANONS_CASTLE", 0), + ("ENTR_OUTSIDE_GANONS_CASTLE_0_3", "SCENE_OUTSIDE_GANONS_CASTLE", 0), + ("ENTR_OUTSIDE_GANONS_CASTLE_0_4", "SCENE_OUTSIDE_GANONS_CASTLE", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_1", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_2", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_3", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_4", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_5", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_6", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_7", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_8", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_TRAIL_0_9", "SCENE_DEATH_MOUNTAIN_TRAIL", 0), + ("ENTR_DEATH_MOUNTAIN_CRATER_0", "SCENE_DEATH_MOUNTAIN_CRATER", 0), + ("ENTR_DEATH_MOUNTAIN_CRATER_0_1", "SCENE_DEATH_MOUNTAIN_CRATER", 0), + ("ENTR_DEATH_MOUNTAIN_CRATER_0_2", "SCENE_DEATH_MOUNTAIN_CRATER", 0), + ("ENTR_DEATH_MOUNTAIN_CRATER_0_3", "SCENE_DEATH_MOUNTAIN_CRATER", 0), + ("ENTR_DEATH_MOUNTAIN_CRATER_0_4", "SCENE_DEATH_MOUNTAIN_CRATER", 0), + ("ENTR_DEATH_MOUNTAIN_CRATER_0_5", "SCENE_DEATH_MOUNTAIN_CRATER", 0), + ("ENTR_GORON_CITY_0", "SCENE_GORON_CITY", 0), + ("ENTR_GORON_CITY_0_1", "SCENE_GORON_CITY", 0), + ("ENTR_GORON_CITY_0_2", "SCENE_GORON_CITY", 0), + ("ENTR_GORON_CITY_0_3", "SCENE_GORON_CITY", 0), + ("ENTR_GORON_CITY_0_4", "SCENE_GORON_CITY", 0), + ("ENTR_GORON_CITY_0_5", "SCENE_GORON_CITY", 0), + ("ENTR_ZORAS_DOMAIN_3", "SCENE_ZORAS_DOMAIN", 3), + ("ENTR_ZORAS_DOMAIN_3_1", "SCENE_ZORAS_DOMAIN", 3), + ("ENTR_ZORAS_DOMAIN_3_2", "SCENE_ZORAS_DOMAIN", 3), + ("ENTR_ZORAS_DOMAIN_3_3", "SCENE_ZORAS_DOMAIN", 3), + ("ENTR_LON_LON_RANCH_0", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_1", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_2", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_3", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_4", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_5", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_6", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_7", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_8", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_9", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_10", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_11", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_12", "SCENE_LON_LON_RANCH", 0), + ("ENTR_LON_LON_RANCH_0_13", "SCENE_LON_LON_RANCH", 0), + ("ENTR_FIRE_TEMPLE_0", "SCENE_FIRE_TEMPLE", 0), + ("ENTR_FIRE_TEMPLE_0_1", "SCENE_FIRE_TEMPLE", 0), + ("ENTR_FIRE_TEMPLE_0_2", "SCENE_FIRE_TEMPLE", 0), + ("ENTR_FIRE_TEMPLE_0_3", "SCENE_FIRE_TEMPLE", 0), + ("ENTR_FOREST_TEMPLE_0", "SCENE_FOREST_TEMPLE", 0), + ("ENTR_FOREST_TEMPLE_0_1", "SCENE_FOREST_TEMPLE", 0), + ("ENTR_FOREST_TEMPLE_0_2", "SCENE_FOREST_TEMPLE", 0), + ("ENTR_FOREST_TEMPLE_0_3", "SCENE_FOREST_TEMPLE", 0), + ("ENTR_SHOOTING_GALLERY_1", "SCENE_SHOOTING_GALLERY", 1), + ("ENTR_SHOOTING_GALLERY_1_1", "SCENE_SHOOTING_GALLERY", 1), + ("ENTR_SHOOTING_GALLERY_1_2", "SCENE_SHOOTING_GALLERY", 1), + ("ENTR_SHOOTING_GALLERY_1_3", "SCENE_SHOOTING_GALLERY", 1), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_DAY_0", "SCENE_TEMPLE_OF_TIME_EXTERIOR_DAY", 0), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_NIGHT_0_1", "SCENE_TEMPLE_OF_TIME_EXTERIOR_NIGHT", 0), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_0_2", "SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS", 0), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_0_3", "SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS", 0), + ("ENTR_FIRE_TEMPLE_1", "SCENE_FIRE_TEMPLE", 1), + ("ENTR_FIRE_TEMPLE_1_1", "SCENE_FIRE_TEMPLE", 1), + ("ENTR_FIRE_TEMPLE_1_2", "SCENE_FIRE_TEMPLE", 1), + ("ENTR_FIRE_TEMPLE_1_3", "SCENE_FIRE_TEMPLE", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_0_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 0), + ("ENTR_HYRULE_FIELD_1", "SCENE_HYRULE_FIELD", 1), + ("ENTR_HYRULE_FIELD_1_1", "SCENE_HYRULE_FIELD", 1), + ("ENTR_HYRULE_FIELD_1_2", "SCENE_HYRULE_FIELD", 1), + ("ENTR_HYRULE_FIELD_1_3", "SCENE_HYRULE_FIELD", 1), + ("ENTR_HYRULE_FIELD_2", "SCENE_HYRULE_FIELD", 2), + ("ENTR_HYRULE_FIELD_2_1", "SCENE_HYRULE_FIELD", 2), + ("ENTR_HYRULE_FIELD_2_2", "SCENE_HYRULE_FIELD", 2), + ("ENTR_HYRULE_FIELD_2_3", "SCENE_HYRULE_FIELD", 2), + ("ENTR_HYRULE_FIELD_3", "SCENE_HYRULE_FIELD", 3), + ("ENTR_HYRULE_FIELD_3_1", "SCENE_HYRULE_FIELD", 3), + ("ENTR_HYRULE_FIELD_3_2", "SCENE_HYRULE_FIELD", 3), + ("ENTR_HYRULE_FIELD_3_3", "SCENE_HYRULE_FIELD", 3), + ("ENTR_HYRULE_FIELD_4", "SCENE_HYRULE_FIELD", 4), + ("ENTR_HYRULE_FIELD_4_1", "SCENE_HYRULE_FIELD", 4), + ("ENTR_HYRULE_FIELD_4_2", "SCENE_HYRULE_FIELD", 4), + ("ENTR_HYRULE_FIELD_4_3", "SCENE_HYRULE_FIELD", 4), + ("ENTR_HYRULE_FIELD_5", "SCENE_HYRULE_FIELD", 5), + ("ENTR_HYRULE_FIELD_5_1", "SCENE_HYRULE_FIELD", 5), + ("ENTR_HYRULE_FIELD_5_2", "SCENE_HYRULE_FIELD", 5), + ("ENTR_HYRULE_FIELD_5_3", "SCENE_HYRULE_FIELD", 5), + ("ENTR_KAKARIKO_VILLAGE_1", "SCENE_KAKARIKO_VILLAGE", 1), + ("ENTR_KAKARIKO_VILLAGE_1_1", "SCENE_KAKARIKO_VILLAGE", 1), + ("ENTR_KAKARIKO_VILLAGE_1_2", "SCENE_KAKARIKO_VILLAGE", 1), + ("ENTR_KAKARIKO_VILLAGE_1_3", "SCENE_KAKARIKO_VILLAGE", 1), + ("ENTR_KAKARIKO_VILLAGE_2", "SCENE_KAKARIKO_VILLAGE", 2), + ("ENTR_KAKARIKO_VILLAGE_2_1", "SCENE_KAKARIKO_VILLAGE", 2), + ("ENTR_KAKARIKO_VILLAGE_2_2", "SCENE_KAKARIKO_VILLAGE", 2), + ("ENTR_KAKARIKO_VILLAGE_2_3", "SCENE_KAKARIKO_VILLAGE", 2), + ("ENTR_ZORAS_RIVER_1", "SCENE_ZORAS_RIVER", 1), + ("ENTR_ZORAS_RIVER_1_1", "SCENE_ZORAS_RIVER", 1), + ("ENTR_ZORAS_RIVER_1_2", "SCENE_ZORAS_RIVER", 1), + ("ENTR_ZORAS_RIVER_1_3", "SCENE_ZORAS_RIVER", 1), + ("ENTR_ZORAS_RIVER_2", "SCENE_ZORAS_RIVER", 2), + ("ENTR_ZORAS_RIVER_2_1", "SCENE_ZORAS_RIVER", 2), + ("ENTR_ZORAS_RIVER_2_2", "SCENE_ZORAS_RIVER", 2), + ("ENTR_ZORAS_RIVER_2_3", "SCENE_ZORAS_RIVER", 2), + ("ENTR_ZORAS_DOMAIN_1", "SCENE_ZORAS_DOMAIN", 1), + ("ENTR_ZORAS_DOMAIN_1_1", "SCENE_ZORAS_DOMAIN", 1), + ("ENTR_ZORAS_DOMAIN_1_2", "SCENE_ZORAS_DOMAIN", 1), + ("ENTR_ZORAS_DOMAIN_1_3", "SCENE_ZORAS_DOMAIN", 1), + ("ENTR_GERUDO_VALLEY_1", "SCENE_GERUDO_VALLEY", 1), + ("ENTR_GERUDO_VALLEY_1_1", "SCENE_GERUDO_VALLEY", 1), + ("ENTR_GERUDO_VALLEY_1_2", "SCENE_GERUDO_VALLEY", 1), + ("ENTR_GERUDO_VALLEY_1_3", "SCENE_GERUDO_VALLEY", 1), + ("ENTR_LOST_WOODS_1", "SCENE_LOST_WOODS", 1), + ("ENTR_LOST_WOODS_1_1", "SCENE_LOST_WOODS", 1), + ("ENTR_LOST_WOODS_1_2", "SCENE_LOST_WOODS", 1), + ("ENTR_LOST_WOODS_1_3", "SCENE_LOST_WOODS", 1), + ("ENTR_LOST_WOODS_2", "SCENE_LOST_WOODS", 2), + ("ENTR_LOST_WOODS_2_1", "SCENE_LOST_WOODS", 2), + ("ENTR_LOST_WOODS_2_2", "SCENE_LOST_WOODS", 2), + ("ENTR_LOST_WOODS_2_3", "SCENE_LOST_WOODS", 2), + ("ENTR_LOST_WOODS_3", "SCENE_LOST_WOODS", 3), + ("ENTR_LOST_WOODS_3_1", "SCENE_LOST_WOODS", 3), + ("ENTR_LOST_WOODS_3_2", "SCENE_LOST_WOODS", 3), + ("ENTR_LOST_WOODS_3_3", "SCENE_LOST_WOODS", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 2), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 2), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 2), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_2_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 2), + ("ENTR_DEATH_MOUNTAIN_TRAIL_1", "SCENE_DEATH_MOUNTAIN_TRAIL", 1), + ("ENTR_DEATH_MOUNTAIN_TRAIL_1_1", "SCENE_DEATH_MOUNTAIN_TRAIL", 1), + ("ENTR_DEATH_MOUNTAIN_TRAIL_1_2", "SCENE_DEATH_MOUNTAIN_TRAIL", 1), + ("ENTR_DEATH_MOUNTAIN_TRAIL_1_3", "SCENE_DEATH_MOUNTAIN_TRAIL", 1), + ("ENTR_DEATH_MOUNTAIN_TRAIL_2", "SCENE_DEATH_MOUNTAIN_TRAIL", 2), + ("ENTR_DEATH_MOUNTAIN_TRAIL_2_1", "SCENE_DEATH_MOUNTAIN_TRAIL", 2), + ("ENTR_DEATH_MOUNTAIN_TRAIL_2_2", "SCENE_DEATH_MOUNTAIN_TRAIL", 2), + ("ENTR_DEATH_MOUNTAIN_TRAIL_2_3", "SCENE_DEATH_MOUNTAIN_TRAIL", 2), + ("ENTR_GORON_CITY_1", "SCENE_GORON_CITY", 1), + ("ENTR_GORON_CITY_1_1", "SCENE_GORON_CITY", 1), + ("ENTR_GORON_CITY_1_2", "SCENE_GORON_CITY", 1), + ("ENTR_GORON_CITY_1_3", "SCENE_GORON_CITY", 1), + ("ENTR_LAKESIDE_LABORATORY_1", "SCENE_LAKESIDE_LABORATORY", 1), + ("ENTR_LAKESIDE_LABORATORY_1_1", "SCENE_LAKESIDE_LABORATORY", 1), + ("ENTR_LAKESIDE_LABORATORY_1_2", "SCENE_LAKESIDE_LABORATORY", 1), + ("ENTR_LAKESIDE_LABORATORY_1_3", "SCENE_LAKESIDE_LABORATORY", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 5), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 5), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 5), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_5_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 5), + ("ENTR_MARKET_DAY_8", "SCENE_MARKET_DAY", 8), + ("ENTR_MARKET_NIGHT_8_1", "SCENE_MARKET_NIGHT", 8), + ("ENTR_MARKET_RUINS_8_2", "SCENE_MARKET_RUINS", 8), + ("ENTR_MARKET_RUINS_8_3", "SCENE_MARKET_RUINS", 8), + ("ENTR_MARKET_DAY_9", "SCENE_MARKET_DAY", 9), + ("ENTR_MARKET_NIGHT_9_1", "SCENE_MARKET_NIGHT", 9), + ("ENTR_MARKET_RUINS_9_2", "SCENE_MARKET_RUINS", 9), + ("ENTR_MARKET_RUINS_9_3", "SCENE_MARKET_RUINS", 9), + ("ENTR_MARKET_DAY_10", "SCENE_MARKET_DAY", 10), + ("ENTR_MARKET_NIGHT_10_1", "SCENE_MARKET_NIGHT", 10), + ("ENTR_MARKET_RUINS_10_2", "SCENE_MARKET_RUINS", 10), + ("ENTR_MARKET_RUINS_10_3", "SCENE_MARKET_RUINS", 10), + ("ENTR_ZORAS_RIVER_3", "SCENE_ZORAS_RIVER", 3), + ("ENTR_ZORAS_RIVER_3_1", "SCENE_ZORAS_RIVER", 3), + ("ENTR_ZORAS_RIVER_3_2", "SCENE_ZORAS_RIVER", 3), + ("ENTR_ZORAS_RIVER_3_3", "SCENE_ZORAS_RIVER", 3), + ("ENTR_ZORAS_RIVER_4", "SCENE_ZORAS_RIVER", 4), + ("ENTR_ZORAS_RIVER_4_1", "SCENE_ZORAS_RIVER", 4), + ("ENTR_ZORAS_RIVER_4_2", "SCENE_ZORAS_RIVER", 4), + ("ENTR_ZORAS_RIVER_4_3", "SCENE_ZORAS_RIVER", 4), + ("ENTR_DESERT_COLOSSUS_1", "SCENE_DESERT_COLOSSUS", 1), + ("ENTR_DESERT_COLOSSUS_1_1", "SCENE_DESERT_COLOSSUS", 1), + ("ENTR_DESERT_COLOSSUS_1_2", "SCENE_DESERT_COLOSSUS", 1), + ("ENTR_DESERT_COLOSSUS_1_3", "SCENE_DESERT_COLOSSUS", 1), + ("ENTR_DESERT_COLOSSUS_2", "SCENE_DESERT_COLOSSUS", 2), + ("ENTR_DESERT_COLOSSUS_2_1", "SCENE_DESERT_COLOSSUS", 2), + ("ENTR_DESERT_COLOSSUS_2_2", "SCENE_DESERT_COLOSSUS", 2), + ("ENTR_DESERT_COLOSSUS_2_3", "SCENE_DESERT_COLOSSUS", 2), + ("ENTR_DESERT_COLOSSUS_3", "SCENE_DESERT_COLOSSUS", 3), + ("ENTR_DESERT_COLOSSUS_3_1", "SCENE_DESERT_COLOSSUS", 3), + ("ENTR_DESERT_COLOSSUS_3_2", "SCENE_DESERT_COLOSSUS", 3), + ("ENTR_DESERT_COLOSSUS_3_3", "SCENE_DESERT_COLOSSUS", 3), + ("ENTR_DESERT_COLOSSUS_4", "SCENE_DESERT_COLOSSUS", 4), + ("ENTR_DESERT_COLOSSUS_4_1", "SCENE_DESERT_COLOSSUS", 4), + ("ENTR_DESERT_COLOSSUS_4_2", "SCENE_DESERT_COLOSSUS", 4), + ("ENTR_DESERT_COLOSSUS_4_3", "SCENE_DESERT_COLOSSUS", 4), + ("ENTR_DESERT_COLOSSUS_5", "SCENE_DESERT_COLOSSUS", 5), + ("ENTR_DESERT_COLOSSUS_5_1", "SCENE_DESERT_COLOSSUS", 5), + ("ENTR_DESERT_COLOSSUS_5_2", "SCENE_DESERT_COLOSSUS", 5), + ("ENTR_DESERT_COLOSSUS_5_3", "SCENE_DESERT_COLOSSUS", 5), + ("ENTR_DESERT_COLOSSUS_6", "SCENE_DESERT_COLOSSUS", 6), + ("ENTR_DESERT_COLOSSUS_6_1", "SCENE_DESERT_COLOSSUS", 6), + ("ENTR_DESERT_COLOSSUS_6_2", "SCENE_DESERT_COLOSSUS", 6), + ("ENTR_DESERT_COLOSSUS_6_3", "SCENE_DESERT_COLOSSUS", 6), + ("ENTR_HYRULE_FIELD_6", "SCENE_HYRULE_FIELD", 6), + ("ENTR_HYRULE_FIELD_6_1", "SCENE_HYRULE_FIELD", 6), + ("ENTR_HYRULE_FIELD_6_2", "SCENE_HYRULE_FIELD", 6), + ("ENTR_HYRULE_FIELD_6_3", "SCENE_HYRULE_FIELD", 6), + ("ENTR_HYRULE_FIELD_7", "SCENE_HYRULE_FIELD", 7), + ("ENTR_HYRULE_FIELD_7_1", "SCENE_HYRULE_FIELD", 7), + ("ENTR_HYRULE_FIELD_7_2", "SCENE_HYRULE_FIELD", 7), + ("ENTR_HYRULE_FIELD_7_3", "SCENE_HYRULE_FIELD", 7), + ("ENTR_KAKARIKO_VILLAGE_3", "SCENE_KAKARIKO_VILLAGE", 3), + ("ENTR_KAKARIKO_VILLAGE_3_1", "SCENE_KAKARIKO_VILLAGE", 3), + ("ENTR_KAKARIKO_VILLAGE_3_2", "SCENE_KAKARIKO_VILLAGE", 3), + ("ENTR_KAKARIKO_VILLAGE_3_3", "SCENE_KAKARIKO_VILLAGE", 3), + ("ENTR_GRAVEYARD_1", "SCENE_GRAVEYARD", 1), + ("ENTR_GRAVEYARD_1_1", "SCENE_GRAVEYARD", 1), + ("ENTR_GRAVEYARD_1_2", "SCENE_GRAVEYARD", 1), + ("ENTR_GRAVEYARD_1_3", "SCENE_GRAVEYARD", 1), + ("ENTR_KOKIRI_FOREST_1", "SCENE_KOKIRI_FOREST", 1), + ("ENTR_KOKIRI_FOREST_1_1", "SCENE_KOKIRI_FOREST", 1), + ("ENTR_KOKIRI_FOREST_1_2", "SCENE_KOKIRI_FOREST", 1), + ("ENTR_KOKIRI_FOREST_1_3", "SCENE_KOKIRI_FOREST", 1), + ("ENTR_KOKIRI_FOREST_2", "SCENE_KOKIRI_FOREST", 2), + ("ENTR_KOKIRI_FOREST_2_1", "SCENE_KOKIRI_FOREST", 2), + ("ENTR_KOKIRI_FOREST_2_2", "SCENE_KOKIRI_FOREST", 2), + ("ENTR_KOKIRI_FOREST_2_3", "SCENE_KOKIRI_FOREST", 2), + ("ENTR_KOKIRI_FOREST_3", "SCENE_KOKIRI_FOREST", 3), + ("ENTR_KOKIRI_FOREST_3_1", "SCENE_KOKIRI_FOREST", 3), + ("ENTR_KOKIRI_FOREST_3_2", "SCENE_KOKIRI_FOREST", 3), + ("ENTR_KOKIRI_FOREST_3_3", "SCENE_KOKIRI_FOREST", 3), + ("ENTR_SACRED_FOREST_MEADOW_1", "SCENE_SACRED_FOREST_MEADOW", 1), + ("ENTR_SACRED_FOREST_MEADOW_1_1", "SCENE_SACRED_FOREST_MEADOW", 1), + ("ENTR_SACRED_FOREST_MEADOW_1_2", "SCENE_SACRED_FOREST_MEADOW", 1), + ("ENTR_SACRED_FOREST_MEADOW_1_3", "SCENE_SACRED_FOREST_MEADOW", 1), + ("ENTR_LAKE_HYLIA_1", "SCENE_LAKE_HYLIA", 1), + ("ENTR_LAKE_HYLIA_1_1", "SCENE_LAKE_HYLIA", 1), + ("ENTR_LAKE_HYLIA_1_2", "SCENE_LAKE_HYLIA", 1), + ("ENTR_LAKE_HYLIA_1_3", "SCENE_LAKE_HYLIA", 1), + ("ENTR_LAKE_HYLIA_2", "SCENE_LAKE_HYLIA", 2), + ("ENTR_LAKE_HYLIA_2_1", "SCENE_LAKE_HYLIA", 2), + ("ENTR_LAKE_HYLIA_2_2", "SCENE_LAKE_HYLIA", 2), + ("ENTR_LAKE_HYLIA_2_3", "SCENE_LAKE_HYLIA", 2), + ("ENTR_ZORAS_FOUNTAIN_1", "SCENE_ZORAS_FOUNTAIN", 1), + ("ENTR_ZORAS_FOUNTAIN_1_1", "SCENE_ZORAS_FOUNTAIN", 1), + ("ENTR_ZORAS_FOUNTAIN_1_2", "SCENE_ZORAS_FOUNTAIN", 1), + ("ENTR_ZORAS_FOUNTAIN_1_3", "SCENE_ZORAS_FOUNTAIN", 1), + ("ENTR_ZORAS_FOUNTAIN_2", "SCENE_ZORAS_FOUNTAIN", 2), + ("ENTR_ZORAS_FOUNTAIN_2_1", "SCENE_ZORAS_FOUNTAIN", 2), + ("ENTR_ZORAS_FOUNTAIN_2_2", "SCENE_ZORAS_FOUNTAIN", 2), + ("ENTR_ZORAS_FOUNTAIN_2_3", "SCENE_ZORAS_FOUNTAIN", 2), + ("ENTR_GERUDO_VALLEY_2", "SCENE_GERUDO_VALLEY", 2), + ("ENTR_GERUDO_VALLEY_2_1", "SCENE_GERUDO_VALLEY", 2), + ("ENTR_GERUDO_VALLEY_2_2", "SCENE_GERUDO_VALLEY", 2), + ("ENTR_GERUDO_VALLEY_2_3", "SCENE_GERUDO_VALLEY", 2), + ("ENTR_GERUDO_VALLEY_3", "SCENE_GERUDO_VALLEY", 3), + ("ENTR_GERUDO_VALLEY_3_1", "SCENE_GERUDO_VALLEY", 3), + ("ENTR_GERUDO_VALLEY_3_2", "SCENE_GERUDO_VALLEY", 3), + ("ENTR_GERUDO_VALLEY_3_3", "SCENE_GERUDO_VALLEY", 3), + ("ENTR_GERUDOS_FORTRESS_1", "SCENE_GERUDOS_FORTRESS", 1), + ("ENTR_GERUDOS_FORTRESS_1_1", "SCENE_GERUDOS_FORTRESS", 1), + ("ENTR_GERUDOS_FORTRESS_1_2", "SCENE_GERUDOS_FORTRESS", 1), + ("ENTR_GERUDOS_FORTRESS_1_3", "SCENE_GERUDOS_FORTRESS", 1), + ("ENTR_GERUDOS_FORTRESS_2", "SCENE_GERUDOS_FORTRESS", 2), + ("ENTR_GERUDOS_FORTRESS_2_1", "SCENE_GERUDOS_FORTRESS", 2), + ("ENTR_GERUDOS_FORTRESS_2_2", "SCENE_GERUDOS_FORTRESS", 2), + ("ENTR_GERUDOS_FORTRESS_2_3", "SCENE_GERUDOS_FORTRESS", 2), + ("ENTR_GERUDOS_FORTRESS_3", "SCENE_GERUDOS_FORTRESS", 3), + ("ENTR_GERUDOS_FORTRESS_3_1", "SCENE_GERUDOS_FORTRESS", 3), + ("ENTR_GERUDOS_FORTRESS_3_2", "SCENE_GERUDOS_FORTRESS", 3), + ("ENTR_GERUDOS_FORTRESS_3_3", "SCENE_GERUDOS_FORTRESS", 3), + ("ENTR_HYRULE_CASTLE_1", "SCENE_HYRULE_CASTLE", 1), + ("ENTR_HYRULE_CASTLE_1_1", "SCENE_HYRULE_CASTLE", 1), + ("ENTR_OUTSIDE_GANONS_CASTLE_1_2", "SCENE_OUTSIDE_GANONS_CASTLE", 1), + ("ENTR_OUTSIDE_GANONS_CASTLE_1_3", "SCENE_OUTSIDE_GANONS_CASTLE", 1), + ("ENTR_HYRULE_CASTLE_1_4", "SCENE_HYRULE_CASTLE", 1), + ("ENTR_DEATH_MOUNTAIN_TRAIL_3", "SCENE_DEATH_MOUNTAIN_TRAIL", 3), + ("ENTR_DEATH_MOUNTAIN_TRAIL_3_1", "SCENE_DEATH_MOUNTAIN_TRAIL", 3), + ("ENTR_DEATH_MOUNTAIN_TRAIL_3_2", "SCENE_DEATH_MOUNTAIN_TRAIL", 3), + ("ENTR_DEATH_MOUNTAIN_TRAIL_3_3", "SCENE_DEATH_MOUNTAIN_TRAIL", 3), + ("ENTR_DEATH_MOUNTAIN_CRATER_1", "SCENE_DEATH_MOUNTAIN_CRATER", 1), + ("ENTR_DEATH_MOUNTAIN_CRATER_1_1", "SCENE_DEATH_MOUNTAIN_CRATER", 1), + ("ENTR_DEATH_MOUNTAIN_CRATER_1_2", "SCENE_DEATH_MOUNTAIN_CRATER", 1), + ("ENTR_DEATH_MOUNTAIN_CRATER_1_3", "SCENE_DEATH_MOUNTAIN_CRATER", 1), + ("ENTR_DEATH_MOUNTAIN_CRATER_2", "SCENE_DEATH_MOUNTAIN_CRATER", 2), + ("ENTR_DEATH_MOUNTAIN_CRATER_2_1", "SCENE_DEATH_MOUNTAIN_CRATER", 2), + ("ENTR_DEATH_MOUNTAIN_CRATER_2_2", "SCENE_DEATH_MOUNTAIN_CRATER", 2), + ("ENTR_DEATH_MOUNTAIN_CRATER_2_3", "SCENE_DEATH_MOUNTAIN_CRATER", 2), + ("ENTR_FOREST_TEMPLE_1", "SCENE_FOREST_TEMPLE", 1), + ("ENTR_FOREST_TEMPLE_1_1", "SCENE_FOREST_TEMPLE", 1), + ("ENTR_FOREST_TEMPLE_1_2", "SCENE_FOREST_TEMPLE", 1), + ("ENTR_FOREST_TEMPLE_1_3", "SCENE_FOREST_TEMPLE", 1), + ("ENTR_DEKU_TREE_1", "SCENE_DEKU_TREE", 1), + ("ENTR_DEKU_TREE_1_1", "SCENE_DEKU_TREE", 1), + ("ENTR_DEKU_TREE_1_2", "SCENE_DEKU_TREE", 1), + ("ENTR_DEKU_TREE_1_3", "SCENE_DEKU_TREE", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_3_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 3), + ("ENTR_MARKET_DAY_1", "SCENE_MARKET_DAY", 1), + ("ENTR_MARKET_NIGHT_1_1", "SCENE_MARKET_NIGHT", 1), + ("ENTR_MARKET_RUINS_1_2", "SCENE_MARKET_RUINS", 1), + ("ENTR_MARKET_RUINS_1_3", "SCENE_MARKET_RUINS", 1), + ("ENTR_MARKET_DAY_2", "SCENE_MARKET_DAY", 2), + ("ENTR_MARKET_NIGHT_2_1", "SCENE_MARKET_NIGHT", 2), + ("ENTR_MARKET_RUINS_2_2", "SCENE_MARKET_RUINS", 2), + ("ENTR_MARKET_RUINS_2_3", "SCENE_MARKET_RUINS", 2), + ("ENTR_MARKET_DAY_3", "SCENE_MARKET_DAY", 3), + ("ENTR_MARKET_NIGHT_3_1", "SCENE_MARKET_NIGHT", 3), + ("ENTR_MARKET_RUINS_3_2", "SCENE_MARKET_RUINS", 3), + ("ENTR_MARKET_RUINS_3_3", "SCENE_MARKET_RUINS", 3), + ("ENTR_KOKIRI_FOREST_4", "SCENE_KOKIRI_FOREST", 4), + ("ENTR_KOKIRI_FOREST_4_1", "SCENE_KOKIRI_FOREST", 4), + ("ENTR_KOKIRI_FOREST_4_2", "SCENE_KOKIRI_FOREST", 4), + ("ENTR_KOKIRI_FOREST_4_3", "SCENE_KOKIRI_FOREST", 4), + ("ENTR_KOKIRI_FOREST_5", "SCENE_KOKIRI_FOREST", 5), + ("ENTR_KOKIRI_FOREST_5_1", "SCENE_KOKIRI_FOREST", 5), + ("ENTR_KOKIRI_FOREST_5_2", "SCENE_KOKIRI_FOREST", 5), + ("ENTR_KOKIRI_FOREST_5_3", "SCENE_KOKIRI_FOREST", 5), + ("ENTR_MARKET_ENTRANCE_DAY_2", "SCENE_MARKET_ENTRANCE_DAY", 2), + ("ENTR_MARKET_ENTRANCE_NIGHT_2_1", "SCENE_MARKET_ENTRANCE_NIGHT", 2), + ("ENTR_MARKET_ENTRANCE_RUINS_2_2", "SCENE_MARKET_ENTRANCE_RUINS", 2), + ("ENTR_MARKET_ENTRANCE_RUINS_2_3", "SCENE_MARKET_ENTRANCE_RUINS", 2), + ("ENTR_LINKS_HOUSE_1", "SCENE_LINKS_HOUSE", 1), + ("ENTR_LINKS_HOUSE_1_1", "SCENE_LINKS_HOUSE", 1), + ("ENTR_LINKS_HOUSE_1_2", "SCENE_LINKS_HOUSE", 1), + ("ENTR_LINKS_HOUSE_1_3", "SCENE_LINKS_HOUSE", 1), + ("ENTR_MARKET_ENTRANCE_DAY_1", "SCENE_MARKET_ENTRANCE_DAY", 1), + ("ENTR_MARKET_ENTRANCE_NIGHT_1_1", "SCENE_MARKET_ENTRANCE_NIGHT", 1), + ("ENTR_MARKET_ENTRANCE_RUINS_1_2", "SCENE_MARKET_ENTRANCE_RUINS", 1), + ("ENTR_MARKET_ENTRANCE_RUINS_1_3", "SCENE_MARKET_ENTRANCE_RUINS", 1), + ("ENTR_HYRULE_FIELD_8", "SCENE_HYRULE_FIELD", 8), + ("ENTR_HYRULE_FIELD_8_1", "SCENE_HYRULE_FIELD", 8), + ("ENTR_HYRULE_FIELD_8_2", "SCENE_HYRULE_FIELD", 8), + ("ENTR_HYRULE_FIELD_8_3", "SCENE_HYRULE_FIELD", 8), + ("ENTR_HYRULE_FIELD_9", "SCENE_HYRULE_FIELD", 9), + ("ENTR_HYRULE_FIELD_9_1", "SCENE_HYRULE_FIELD", 9), + ("ENTR_HYRULE_FIELD_9_2", "SCENE_HYRULE_FIELD", 9), + ("ENTR_HYRULE_FIELD_9_3", "SCENE_HYRULE_FIELD", 9), + ("ENTR_HYRULE_FIELD_10", "SCENE_HYRULE_FIELD", 10), + ("ENTR_HYRULE_FIELD_10_1", "SCENE_HYRULE_FIELD", 10), + ("ENTR_HYRULE_FIELD_10_2", "SCENE_HYRULE_FIELD", 10), + ("ENTR_HYRULE_FIELD_10_3", "SCENE_HYRULE_FIELD", 10), + ("ENTR_KOKIRI_FOREST_6", "SCENE_KOKIRI_FOREST", 6), + ("ENTR_KOKIRI_FOREST_6_1", "SCENE_KOKIRI_FOREST", 6), + ("ENTR_KOKIRI_FOREST_6_2", "SCENE_KOKIRI_FOREST", 6), + ("ENTR_KOKIRI_FOREST_6_3", "SCENE_KOKIRI_FOREST", 6), + ("ENTR_HYRULE_FIELD_11", "SCENE_HYRULE_FIELD", 11), + ("ENTR_HYRULE_FIELD_11_1", "SCENE_HYRULE_FIELD", 11), + ("ENTR_HYRULE_FIELD_11_2", "SCENE_HYRULE_FIELD", 11), + ("ENTR_HYRULE_FIELD_11_3", "SCENE_HYRULE_FIELD", 11), + ("ENTR_HYRULE_FIELD_12", "SCENE_HYRULE_FIELD", 12), + ("ENTR_HYRULE_FIELD_12_1", "SCENE_HYRULE_FIELD", 12), + ("ENTR_HYRULE_FIELD_12_2", "SCENE_HYRULE_FIELD", 12), + ("ENTR_HYRULE_FIELD_12_3", "SCENE_HYRULE_FIELD", 12), + ("ENTR_HYRULE_FIELD_13", "SCENE_HYRULE_FIELD", 13), + ("ENTR_HYRULE_FIELD_13_1", "SCENE_HYRULE_FIELD", 13), + ("ENTR_HYRULE_FIELD_13_2", "SCENE_HYRULE_FIELD", 13), + ("ENTR_HYRULE_FIELD_13_3", "SCENE_HYRULE_FIELD", 13), + ("ENTR_CASTLE_COURTYARD_GUARDS_DAY_1", "SCENE_CASTLE_COURTYARD_GUARDS_DAY", 1), + ("ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_1_1", "SCENE_CASTLE_COURTYARD_GUARDS_NIGHT", 1), + ("ENTR_CASTLE_COURTYARD_GUARDS_DAY_1_2", "SCENE_CASTLE_COURTYARD_GUARDS_DAY", 1), + ("ENTR_CASTLE_COURTYARD_GUARDS_NIGHT_1_3", "SCENE_CASTLE_COURTYARD_GUARDS_NIGHT", 1), + ("ENTR_BACK_ALLEY_DAY_1", "SCENE_BACK_ALLEY_DAY", 1), + ("ENTR_BACK_ALLEY_NIGHT_1_1", "SCENE_BACK_ALLEY_NIGHT", 1), + ("ENTR_BACK_ALLEY_DAY_1_2", "SCENE_BACK_ALLEY_DAY", 1), + ("ENTR_BACK_ALLEY_NIGHT_1_3", "SCENE_BACK_ALLEY_NIGHT", 1), + ("ENTR_MARKET_DAY_4", "SCENE_MARKET_DAY", 4), + ("ENTR_MARKET_NIGHT_4_1", "SCENE_MARKET_NIGHT", 4), + ("ENTR_MARKET_RUINS_4_2", "SCENE_MARKET_RUINS", 4), + ("ENTR_MARKET_RUINS_4_3", "SCENE_MARKET_RUINS", 4), + ("ENTR_MARKET_DAY_5", "SCENE_MARKET_DAY", 5), + ("ENTR_MARKET_NIGHT_5_1", "SCENE_MARKET_NIGHT", 5), + ("ENTR_MARKET_RUINS_5_2", "SCENE_MARKET_RUINS", 5), + ("ENTR_MARKET_RUINS_5_3", "SCENE_MARKET_RUINS", 5), + ("ENTR_KAKARIKO_VILLAGE_4", "SCENE_KAKARIKO_VILLAGE", 4), + ("ENTR_KAKARIKO_VILLAGE_4_1", "SCENE_KAKARIKO_VILLAGE", 4), + ("ENTR_KAKARIKO_VILLAGE_4_2", "SCENE_KAKARIKO_VILLAGE", 4), + ("ENTR_KAKARIKO_VILLAGE_4_3", "SCENE_KAKARIKO_VILLAGE", 4), + ("ENTR_GERUDOS_FORTRESS_4", "SCENE_GERUDOS_FORTRESS", 4), + ("ENTR_GERUDOS_FORTRESS_4_1", "SCENE_GERUDOS_FORTRESS", 4), + ("ENTR_GERUDOS_FORTRESS_4_2", "SCENE_GERUDOS_FORTRESS", 4), + ("ENTR_GERUDOS_FORTRESS_4_3", "SCENE_GERUDOS_FORTRESS", 4), + ("ENTR_LON_LON_RANCH_1", "SCENE_LON_LON_RANCH", 1), + ("ENTR_LON_LON_RANCH_1_1", "SCENE_LON_LON_RANCH", 1), + ("ENTR_LON_LON_RANCH_1_2", "SCENE_LON_LON_RANCH", 1), + ("ENTR_LON_LON_RANCH_1_3", "SCENE_LON_LON_RANCH", 1), + ("ENTR_SHADOW_TEMPLE_1", "SCENE_SHADOW_TEMPLE", 1), + ("ENTR_SHADOW_TEMPLE_1_1", "SCENE_SHADOW_TEMPLE", 1), + ("ENTR_SHADOW_TEMPLE_1_2", "SCENE_SHADOW_TEMPLE", 1), + ("ENTR_SHADOW_TEMPLE_1_3", "SCENE_SHADOW_TEMPLE", 1), + ("ENTR_SHADOW_TEMPLE_2", "SCENE_SHADOW_TEMPLE", 2), + ("ENTR_SHADOW_TEMPLE_2_1", "SCENE_SHADOW_TEMPLE", 2), + ("ENTR_SHADOW_TEMPLE_2_2", "SCENE_SHADOW_TEMPLE", 2), + ("ENTR_SHADOW_TEMPLE_2_3", "SCENE_SHADOW_TEMPLE", 2), + ("ENTR_GERUDOS_FORTRESS_5", "SCENE_GERUDOS_FORTRESS", 5), + ("ENTR_GERUDOS_FORTRESS_5_1", "SCENE_GERUDOS_FORTRESS", 5), + ("ENTR_GERUDOS_FORTRESS_5_2", "SCENE_GERUDOS_FORTRESS", 5), + ("ENTR_GERUDOS_FORTRESS_5_3", "SCENE_GERUDOS_FORTRESS", 5), + ("ENTR_GERUDOS_FORTRESS_6", "SCENE_GERUDOS_FORTRESS", 6), + ("ENTR_GERUDOS_FORTRESS_6_1", "SCENE_GERUDOS_FORTRESS", 6), + ("ENTR_GERUDOS_FORTRESS_6_2", "SCENE_GERUDOS_FORTRESS", 6), + ("ENTR_GERUDOS_FORTRESS_6_3", "SCENE_GERUDOS_FORTRESS", 6), + ("ENTR_GERUDOS_FORTRESS_7", "SCENE_GERUDOS_FORTRESS", 7), + ("ENTR_GERUDOS_FORTRESS_7_1", "SCENE_GERUDOS_FORTRESS", 7), + ("ENTR_GERUDOS_FORTRESS_7_2", "SCENE_GERUDOS_FORTRESS", 7), + ("ENTR_GERUDOS_FORTRESS_7_3", "SCENE_GERUDOS_FORTRESS", 7), + ("ENTR_GERUDOS_FORTRESS_8", "SCENE_GERUDOS_FORTRESS", 8), + ("ENTR_GERUDOS_FORTRESS_8_1", "SCENE_GERUDOS_FORTRESS", 8), + ("ENTR_GERUDOS_FORTRESS_8_2", "SCENE_GERUDOS_FORTRESS", 8), + ("ENTR_GERUDOS_FORTRESS_8_3", "SCENE_GERUDOS_FORTRESS", 8), + ("ENTR_TEMPLE_OF_TIME_2", "SCENE_TEMPLE_OF_TIME", 2), + ("ENTR_TEMPLE_OF_TIME_2_1", "SCENE_TEMPLE_OF_TIME", 2), + ("ENTR_TEMPLE_OF_TIME_2_2", "SCENE_TEMPLE_OF_TIME", 2), + ("ENTR_TEMPLE_OF_TIME_2_3", "SCENE_TEMPLE_OF_TIME", 2), + ("ENTR_CHAMBER_OF_THE_SAGES_1", "SCENE_CHAMBER_OF_THE_SAGES", 1), + ("ENTR_CHAMBER_OF_THE_SAGES_1_1", "SCENE_CHAMBER_OF_THE_SAGES", 1), + ("ENTR_CHAMBER_OF_THE_SAGES_1_2", "SCENE_CHAMBER_OF_THE_SAGES", 1), + ("ENTR_CHAMBER_OF_THE_SAGES_1_3", "SCENE_CHAMBER_OF_THE_SAGES", 1), + ("ENTR_GERUDOS_FORTRESS_9", "SCENE_GERUDOS_FORTRESS", 9), + ("ENTR_GERUDOS_FORTRESS_9_1", "SCENE_GERUDOS_FORTRESS", 9), + ("ENTR_GERUDOS_FORTRESS_9_2", "SCENE_GERUDOS_FORTRESS", 9), + ("ENTR_GERUDOS_FORTRESS_9_3", "SCENE_GERUDOS_FORTRESS", 9), + ("ENTR_GERUDOS_FORTRESS_10", "SCENE_GERUDOS_FORTRESS", 10), + ("ENTR_GERUDOS_FORTRESS_10_1", "SCENE_GERUDOS_FORTRESS", 10), + ("ENTR_GERUDOS_FORTRESS_10_2", "SCENE_GERUDOS_FORTRESS", 10), + ("ENTR_GERUDOS_FORTRESS_10_3", "SCENE_GERUDOS_FORTRESS", 10), + ("ENTR_GERUDOS_FORTRESS_11", "SCENE_GERUDOS_FORTRESS", 11), + ("ENTR_GERUDOS_FORTRESS_11_1", "SCENE_GERUDOS_FORTRESS", 11), + ("ENTR_GERUDOS_FORTRESS_11_2", "SCENE_GERUDOS_FORTRESS", 11), + ("ENTR_GERUDOS_FORTRESS_11_3", "SCENE_GERUDOS_FORTRESS", 11), + ("ENTR_GERUDOS_FORTRESS_12", "SCENE_GERUDOS_FORTRESS", 12), + ("ENTR_GERUDOS_FORTRESS_12_1", "SCENE_GERUDOS_FORTRESS", 12), + ("ENTR_GERUDOS_FORTRESS_12_2", "SCENE_GERUDOS_FORTRESS", 12), + ("ENTR_GERUDOS_FORTRESS_12_3", "SCENE_GERUDOS_FORTRESS", 12), + ("ENTR_LON_LON_RANCH_2", "SCENE_LON_LON_RANCH", 2), + ("ENTR_LON_LON_RANCH_2_1", "SCENE_LON_LON_RANCH", 2), + ("ENTR_LON_LON_RANCH_2_2", "SCENE_LON_LON_RANCH", 2), + ("ENTR_LON_LON_RANCH_2_3", "SCENE_LON_LON_RANCH", 2), + ("ENTR_LON_LON_RANCH_3", "SCENE_LON_LON_RANCH", 3), + ("ENTR_LON_LON_RANCH_3_1", "SCENE_LON_LON_RANCH", 3), + ("ENTR_LON_LON_RANCH_3_2", "SCENE_LON_LON_RANCH", 3), + ("ENTR_LON_LON_RANCH_3_3", "SCENE_LON_LON_RANCH", 3), + ("ENTR_TEST_SHOOTING_GALLERY_0", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_1", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_2", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_3", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SACRED_FOREST_MEADOW_0_4", "SCENE_SACRED_FOREST_MEADOW", 0), + ("ENTR_TEST_CUTSCENE_MAP_0_5", "SCENE_CUTSCENE_MAP", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_6", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_7", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_8", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_9", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_TEST_SHOOTING_GALLERY_0_10", "SCENE_SHOOTING_GALLERY", 0), + ("ENTR_SPIRIT_TEMPLE_1", "SCENE_SPIRIT_TEMPLE", 1), + ("ENTR_SPIRIT_TEMPLE_1_1", "SCENE_SPIRIT_TEMPLE", 1), + ("ENTR_SPIRIT_TEMPLE_1_2", "SCENE_SPIRIT_TEMPLE", 1), + ("ENTR_SPIRIT_TEMPLE_1_3", "SCENE_SPIRIT_TEMPLE", 1), + ("ENTR_STABLE_0", "SCENE_STABLE", 0), + ("ENTR_STABLE_0_1", "SCENE_STABLE", 0), + ("ENTR_STABLE_0_2", "SCENE_STABLE", 0), + ("ENTR_STABLE_0_3", "SCENE_STABLE", 0), + ("ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0", "SCENE_KAKARIKO_CENTER_GUEST_HOUSE", 0), + ("ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0_1", "SCENE_KAKARIKO_CENTER_GUEST_HOUSE", 0), + ("ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0_2", "SCENE_KAKARIKO_CENTER_GUEST_HOUSE", 0), + ("ENTR_KAKARIKO_CENTER_GUEST_HOUSE_0_3", "SCENE_KAKARIKO_CENTER_GUEST_HOUSE", 0), + ("ENTR_JABU_JABU_BOSS_0", "SCENE_JABU_JABU_BOSS", 0), + ("ENTR_JABU_JABU_BOSS_0_1", "SCENE_JABU_JABU_BOSS", 0), + ("ENTR_JABU_JABU_BOSS_0_2", "SCENE_JABU_JABU_BOSS", 0), + ("ENTR_JABU_JABU_BOSS_0_3", "SCENE_JABU_JABU_BOSS", 0), + ("ENTR_FIRE_TEMPLE_BOSS_0", "SCENE_FIRE_TEMPLE_BOSS", 0), + ("ENTR_FIRE_TEMPLE_BOSS_0_1", "SCENE_FIRE_TEMPLE_BOSS", 0), + ("ENTR_FIRE_TEMPLE_BOSS_0_2", "SCENE_FIRE_TEMPLE_BOSS", 0), + ("ENTR_FIRE_TEMPLE_BOSS_0_3", "SCENE_FIRE_TEMPLE_BOSS", 0), + ("ENTR_LAKE_HYLIA_6", "SCENE_LAKE_HYLIA", 6), + ("ENTR_LAKE_HYLIA_6_1", "SCENE_LAKE_HYLIA", 6), + ("ENTR_LAKE_HYLIA_6_2", "SCENE_LAKE_HYLIA", 6), + ("ENTR_LAKE_HYLIA_6_3", "SCENE_LAKE_HYLIA", 6), + ("ENTR_GRAVEKEEPERS_HUT_0", "SCENE_GRAVEKEEPERS_HUT", 0), + ("ENTR_GRAVEKEEPERS_HUT_0_1", "SCENE_GRAVEKEEPERS_HUT", 0), + ("ENTR_GRAVEKEEPERS_HUT_0_2", "SCENE_GRAVEKEEPERS_HUT", 0), + ("ENTR_GRAVEKEEPERS_HUT_0_3", "SCENE_GRAVEKEEPERS_HUT", 0), + ("ENTR_HYRULE_FIELD_14", "SCENE_HYRULE_FIELD", 14), + ("ENTR_HYRULE_FIELD_14_1", "SCENE_HYRULE_FIELD", 14), + ("ENTR_HYRULE_FIELD_14_2", "SCENE_HYRULE_FIELD", 14), + ("ENTR_HYRULE_FIELD_14_3", "SCENE_HYRULE_FIELD", 14), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_4", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_5", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_0_6", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 0), + ("ENTR_REDEAD_GRAVE_0", "SCENE_REDEAD_GRAVE", 0), + ("ENTR_REDEAD_GRAVE_0_1", "SCENE_REDEAD_GRAVE", 0), + ("ENTR_REDEAD_GRAVE_0_2", "SCENE_REDEAD_GRAVE", 0), + ("ENTR_REDEAD_GRAVE_0_3", "SCENE_REDEAD_GRAVE", 0), + ("ENTR_TEMPLE_OF_TIME_3", "SCENE_TEMPLE_OF_TIME", 3), + ("ENTR_TEMPLE_OF_TIME_3_1", "SCENE_TEMPLE_OF_TIME", 3), + ("ENTR_TEMPLE_OF_TIME_3_2", "SCENE_TEMPLE_OF_TIME", 3), + ("ENTR_TEMPLE_OF_TIME_3_3", "SCENE_TEMPLE_OF_TIME", 3), + ("ENTR_TEMPLE_OF_TIME_4", "SCENE_TEMPLE_OF_TIME", 4), + ("ENTR_TEMPLE_OF_TIME_4_1", "SCENE_TEMPLE_OF_TIME", 4), + ("ENTR_TEMPLE_OF_TIME_4_2", "SCENE_TEMPLE_OF_TIME", 4), + ("ENTR_TEMPLE_OF_TIME_4_3", "SCENE_TEMPLE_OF_TIME", 4), + ("ENTR_ZORAS_DOMAIN_4", "SCENE_ZORAS_DOMAIN", 4), + ("ENTR_ZORAS_DOMAIN_4_1", "SCENE_ZORAS_DOMAIN", 4), + ("ENTR_ZORAS_DOMAIN_4_2", "SCENE_ZORAS_DOMAIN", 4), + ("ENTR_ZORAS_DOMAIN_4_3", "SCENE_ZORAS_DOMAIN", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 2), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 2), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 2), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_2_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 2), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_3_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 3), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_4_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 4), + ("ENTR_KOKIRI_FOREST_7", "SCENE_KOKIRI_FOREST", 7), + ("ENTR_KOKIRI_FOREST_7_1", "SCENE_KOKIRI_FOREST", 7), + ("ENTR_KOKIRI_FOREST_7_2", "SCENE_KOKIRI_FOREST", 7), + ("ENTR_KOKIRI_FOREST_7_3", "SCENE_KOKIRI_FOREST", 7), + ("ENTR_KOKIRI_FOREST_8", "SCENE_KOKIRI_FOREST", 8), + ("ENTR_KOKIRI_FOREST_8_1", "SCENE_KOKIRI_FOREST", 8), + ("ENTR_KOKIRI_FOREST_8_2", "SCENE_KOKIRI_FOREST", 8), + ("ENTR_KOKIRI_FOREST_8_3", "SCENE_KOKIRI_FOREST", 8), + ("ENTR_HYRULE_CASTLE_2", "SCENE_HYRULE_CASTLE", 2), + ("ENTR_HYRULE_CASTLE_2_1", "SCENE_HYRULE_CASTLE", 2), + ("ENTR_OUTSIDE_GANONS_CASTLE_2_2", "SCENE_OUTSIDE_GANONS_CASTLE", 2), + ("ENTR_OUTSIDE_GANONS_CASTLE_2_3", "SCENE_OUTSIDE_GANONS_CASTLE", 2), + ("ENTR_HYRULE_CASTLE_2_4", "SCENE_HYRULE_CASTLE", 2), + ("ENTR_KAKARIKO_VILLAGE_5", "SCENE_KAKARIKO_VILLAGE", 5), + ("ENTR_KAKARIKO_VILLAGE_5_1", "SCENE_KAKARIKO_VILLAGE", 5), + ("ENTR_KAKARIKO_VILLAGE_5_2", "SCENE_KAKARIKO_VILLAGE", 5), + ("ENTR_KAKARIKO_VILLAGE_5_3", "SCENE_KAKARIKO_VILLAGE", 5), + ("ENTR_KAKARIKO_VILLAGE_6", "SCENE_KAKARIKO_VILLAGE", 6), + ("ENTR_KAKARIKO_VILLAGE_6_1", "SCENE_KAKARIKO_VILLAGE", 6), + ("ENTR_KAKARIKO_VILLAGE_6_2", "SCENE_KAKARIKO_VILLAGE", 6), + ("ENTR_KAKARIKO_VILLAGE_6_3", "SCENE_KAKARIKO_VILLAGE", 6), + ("ENTR_KAKARIKO_VILLAGE_7", "SCENE_KAKARIKO_VILLAGE", 7), + ("ENTR_KAKARIKO_VILLAGE_7_1", "SCENE_KAKARIKO_VILLAGE", 7), + ("ENTR_KAKARIKO_VILLAGE_7_2", "SCENE_KAKARIKO_VILLAGE", 7), + ("ENTR_KAKARIKO_VILLAGE_7_3", "SCENE_KAKARIKO_VILLAGE", 7), + ("ENTR_KAKARIKO_VILLAGE_8", "SCENE_KAKARIKO_VILLAGE", 8), + ("ENTR_KAKARIKO_VILLAGE_8_1", "SCENE_KAKARIKO_VILLAGE", 8), + ("ENTR_KAKARIKO_VILLAGE_8_2", "SCENE_KAKARIKO_VILLAGE", 8), + ("ENTR_KAKARIKO_VILLAGE_8_3", "SCENE_KAKARIKO_VILLAGE", 8), + ("ENTR_GRAVEYARD_2", "SCENE_GRAVEYARD", 2), + ("ENTR_GRAVEYARD_2_1", "SCENE_GRAVEYARD", 2), + ("ENTR_GRAVEYARD_2_2", "SCENE_GRAVEYARD", 2), + ("ENTR_GRAVEYARD_2_3", "SCENE_GRAVEYARD", 2), + ("ENTR_GRAVEYARD_3", "SCENE_GRAVEYARD", 3), + ("ENTR_GRAVEYARD_3_1", "SCENE_GRAVEYARD", 3), + ("ENTR_GRAVEYARD_3_2", "SCENE_GRAVEYARD", 3), + ("ENTR_GRAVEYARD_3_3", "SCENE_GRAVEYARD", 3), + ("ENTR_GRAVEYARD_4", "SCENE_GRAVEYARD", 4), + ("ENTR_GRAVEYARD_4_1", "SCENE_GRAVEYARD", 4), + ("ENTR_GRAVEYARD_4_2", "SCENE_GRAVEYARD", 4), + ("ENTR_GRAVEYARD_4_3", "SCENE_GRAVEYARD", 4), + ("ENTR_GRAVEYARD_5", "SCENE_GRAVEYARD", 5), + ("ENTR_GRAVEYARD_5_1", "SCENE_GRAVEYARD", 5), + ("ENTR_GRAVEYARD_5_2", "SCENE_GRAVEYARD", 5), + ("ENTR_GRAVEYARD_5_3", "SCENE_GRAVEYARD", 5), + ("ENTR_HAUNTED_WASTELAND_1", "SCENE_HAUNTED_WASTELAND", 1), + ("ENTR_HAUNTED_WASTELAND_1_1", "SCENE_HAUNTED_WASTELAND", 1), + ("ENTR_HAUNTED_WASTELAND_1_2", "SCENE_HAUNTED_WASTELAND", 1), + ("ENTR_HAUNTED_WASTELAND_1_3", "SCENE_HAUNTED_WASTELAND", 1), + ("ENTR_HAUNTED_WASTELAND_2", "SCENE_HAUNTED_WASTELAND", 2), + ("ENTR_HAUNTED_WASTELAND_2_1", "SCENE_HAUNTED_WASTELAND", 2), + ("ENTR_HAUNTED_WASTELAND_2_2", "SCENE_HAUNTED_WASTELAND", 2), + ("ENTR_HAUNTED_WASTELAND_2_3", "SCENE_HAUNTED_WASTELAND", 2), + ("ENTR_FAIRYS_FOUNTAIN_0", "SCENE_FAIRYS_FOUNTAIN", 0), + ("ENTR_FAIRYS_FOUNTAIN_0_1", "SCENE_FAIRYS_FOUNTAIN", 0), + ("ENTR_FAIRYS_FOUNTAIN_0_2", "SCENE_FAIRYS_FOUNTAIN", 0), + ("ENTR_FAIRYS_FOUNTAIN_0_3", "SCENE_FAIRYS_FOUNTAIN", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_4", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_5", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 0), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0_6", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 0), + ("ENTR_LON_LON_RANCH_4", "SCENE_LON_LON_RANCH", 4), + ("ENTR_LON_LON_RANCH_4_1", "SCENE_LON_LON_RANCH", 4), + ("ENTR_LON_LON_RANCH_4_2", "SCENE_LON_LON_RANCH", 4), + ("ENTR_LON_LON_RANCH_4_3", "SCENE_LON_LON_RANCH", 4), + ("ENTR_GORON_SHOP_0", "SCENE_GORON_SHOP", 0), + ("ENTR_GORON_SHOP_0_1", "SCENE_GORON_SHOP", 0), + ("ENTR_GORON_SHOP_0_2", "SCENE_GORON_SHOP", 0), + ("ENTR_GORON_SHOP_0_3", "SCENE_GORON_SHOP", 0), + ("ENTR_ZORA_SHOP_0", "SCENE_ZORA_SHOP", 0), + ("ENTR_ZORA_SHOP_0_1", "SCENE_ZORA_SHOP", 0), + ("ENTR_ZORA_SHOP_0_2", "SCENE_ZORA_SHOP", 0), + ("ENTR_ZORA_SHOP_0_3", "SCENE_ZORA_SHOP", 0), + ("ENTR_POTION_SHOP_KAKARIKO_0", "SCENE_POTION_SHOP_KAKARIKO", 0), + ("ENTR_POTION_SHOP_KAKARIKO_0_1", "SCENE_POTION_SHOP_KAKARIKO", 0), + ("ENTR_POTION_SHOP_KAKARIKO_0_2", "SCENE_POTION_SHOP_KAKARIKO", 0), + ("ENTR_POTION_SHOP_KAKARIKO_0_3", "SCENE_POTION_SHOP_KAKARIKO", 0), + ("ENTR_POTION_SHOP_MARKET_0", "SCENE_POTION_SHOP_MARKET", 0), + ("ENTR_POTION_SHOP_MARKET_0_1", "SCENE_POTION_SHOP_MARKET", 0), + ("ENTR_POTION_SHOP_MARKET_0_2", "SCENE_POTION_SHOP_MARKET", 0), + ("ENTR_POTION_SHOP_MARKET_0_3", "SCENE_POTION_SHOP_MARKET", 0), + ("ENTR_BACK_ALLEY_DAY_4", "SCENE_BACK_ALLEY_DAY", 4), + ("ENTR_BACK_ALLEY_NIGHT_4_1", "SCENE_BACK_ALLEY_NIGHT", 4), + ("ENTR_BACK_ALLEY_DAY_4_2", "SCENE_BACK_ALLEY_DAY", 4), + ("ENTR_BACK_ALLEY_NIGHT_4_3", "SCENE_BACK_ALLEY_NIGHT", 4), + ("ENTR_BOMBCHU_SHOP_0", "SCENE_BOMBCHU_SHOP", 0), + ("ENTR_BOMBCHU_SHOP_0_1", "SCENE_BOMBCHU_SHOP", 0), + ("ENTR_BOMBCHU_SHOP_0_2", "SCENE_BOMBCHU_SHOP", 0), + ("ENTR_BOMBCHU_SHOP_0_3", "SCENE_BOMBCHU_SHOP", 0), + ("ENTR_ZORAS_FOUNTAIN_5", "SCENE_ZORAS_FOUNTAIN", 5), + ("ENTR_ZORAS_FOUNTAIN_5_1", "SCENE_ZORAS_FOUNTAIN", 5), + ("ENTR_ZORAS_FOUNTAIN_5_2", "SCENE_ZORAS_FOUNTAIN", 5), + ("ENTR_ZORAS_FOUNTAIN_5_3", "SCENE_ZORAS_FOUNTAIN", 5), + ("ENTR_DOG_LADY_HOUSE_0", "SCENE_DOG_LADY_HOUSE", 0), + ("ENTR_DOG_LADY_HOUSE_0_1", "SCENE_DOG_LADY_HOUSE", 0), + ("ENTR_DOG_LADY_HOUSE_0_2", "SCENE_DOG_LADY_HOUSE", 0), + ("ENTR_DOG_LADY_HOUSE_0_3", "SCENE_DOG_LADY_HOUSE", 0), + ("ENTR_IMPAS_HOUSE_0", "SCENE_IMPAS_HOUSE", 0), + ("ENTR_IMPAS_HOUSE_0_1", "SCENE_IMPAS_HOUSE", 0), + ("ENTR_IMPAS_HOUSE_0_2", "SCENE_IMPAS_HOUSE", 0), + ("ENTR_IMPAS_HOUSE_0_3", "SCENE_IMPAS_HOUSE", 0), + ("ENTR_CARPENTERS_TENT_0", "SCENE_CARPENTERS_TENT", 0), + ("ENTR_CARPENTERS_TENT_0_1", "SCENE_CARPENTERS_TENT", 0), + ("ENTR_CARPENTERS_TENT_0_2", "SCENE_CARPENTERS_TENT", 0), + ("ENTR_CARPENTERS_TENT_0_3", "SCENE_CARPENTERS_TENT", 0), + ("ENTR_GERUDOS_FORTRESS_13", "SCENE_GERUDOS_FORTRESS", 13), + ("ENTR_GERUDOS_FORTRESS_13_1", "SCENE_GERUDOS_FORTRESS", 13), + ("ENTR_GERUDOS_FORTRESS_13_2", "SCENE_GERUDOS_FORTRESS", 13), + ("ENTR_GERUDOS_FORTRESS_13_3", "SCENE_GERUDOS_FORTRESS", 13), + ("ENTR_GERUDOS_FORTRESS_14", "SCENE_GERUDOS_FORTRESS", 14), + ("ENTR_GERUDOS_FORTRESS_14_1", "SCENE_GERUDOS_FORTRESS", 14), + ("ENTR_GERUDOS_FORTRESS_14_2", "SCENE_GERUDOS_FORTRESS", 14), + ("ENTR_GERUDOS_FORTRESS_14_3", "SCENE_GERUDOS_FORTRESS", 14), + ("ENTR_GERUDOS_FORTRESS_15", "SCENE_GERUDOS_FORTRESS", 15), + ("ENTR_GERUDOS_FORTRESS_15_1", "SCENE_GERUDOS_FORTRESS", 15), + ("ENTR_GERUDOS_FORTRESS_15_2", "SCENE_GERUDOS_FORTRESS", 15), + ("ENTR_GERUDOS_FORTRESS_15_3", "SCENE_GERUDOS_FORTRESS", 15), + ("ENTR_GERUDOS_FORTRESS_16", "SCENE_GERUDOS_FORTRESS", 16), + ("ENTR_GERUDOS_FORTRESS_16_1", "SCENE_GERUDOS_FORTRESS", 16), + ("ENTR_GERUDOS_FORTRESS_16_2", "SCENE_GERUDOS_FORTRESS", 16), + ("ENTR_GERUDOS_FORTRESS_16_3", "SCENE_GERUDOS_FORTRESS", 16), + ("ENTR_GERUDOS_FORTRESS_17", "SCENE_GERUDOS_FORTRESS", 17), + ("ENTR_GERUDOS_FORTRESS_17_1", "SCENE_GERUDOS_FORTRESS", 17), + ("ENTR_GERUDOS_FORTRESS_17_2", "SCENE_GERUDOS_FORTRESS", 17), + ("ENTR_GERUDOS_FORTRESS_17_3", "SCENE_GERUDOS_FORTRESS", 17), + ("ENTR_MARKET_DAY_6", "SCENE_MARKET_DAY", 6), + ("ENTR_MARKET_NIGHT_6_1", "SCENE_MARKET_NIGHT", 6), + ("ENTR_MARKET_RUINS_6_2", "SCENE_MARKET_RUINS", 6), + ("ENTR_MARKET_RUINS_6_3", "SCENE_MARKET_RUINS", 6), + ("ENTR_MARKET_DAY_7", "SCENE_MARKET_DAY", 7), + ("ENTR_MARKET_NIGHT_7_1", "SCENE_MARKET_NIGHT", 7), + ("ENTR_MARKET_RUINS_7_2", "SCENE_MARKET_RUINS", 7), + ("ENTR_MARKET_RUINS_7_3", "SCENE_MARKET_RUINS", 7), + ("ENTR_BACK_ALLEY_DAY_2", "SCENE_BACK_ALLEY_DAY", 2), + ("ENTR_BACK_ALLEY_NIGHT_2_1", "SCENE_BACK_ALLEY_NIGHT", 2), + ("ENTR_BACK_ALLEY_DAY_2_2", "SCENE_BACK_ALLEY_DAY", 2), + ("ENTR_BACK_ALLEY_NIGHT_2_3", "SCENE_BACK_ALLEY_NIGHT", 2), + ("ENTR_ZORAS_DOMAIN_2", "SCENE_ZORAS_DOMAIN", 2), + ("ENTR_ZORAS_DOMAIN_2_1", "SCENE_ZORAS_DOMAIN", 2), + ("ENTR_ZORAS_DOMAIN_2_2", "SCENE_ZORAS_DOMAIN", 2), + ("ENTR_ZORAS_DOMAIN_2_3", "SCENE_ZORAS_DOMAIN", 2), + ("ENTR_LAKE_HYLIA_3", "SCENE_LAKE_HYLIA", 3), + ("ENTR_LAKE_HYLIA_3_1", "SCENE_LAKE_HYLIA", 3), + ("ENTR_LAKE_HYLIA_3_2", "SCENE_LAKE_HYLIA", 3), + ("ENTR_LAKE_HYLIA_3_3", "SCENE_LAKE_HYLIA", 3), + ("ENTR_LAKE_HYLIA_4", "SCENE_LAKE_HYLIA", 4), + ("ENTR_LAKE_HYLIA_4_1", "SCENE_LAKE_HYLIA", 4), + ("ENTR_LAKE_HYLIA_4_2", "SCENE_LAKE_HYLIA", 4), + ("ENTR_LAKE_HYLIA_4_3", "SCENE_LAKE_HYLIA", 4), + ("ENTR_GERUDO_VALLEY_4", "SCENE_GERUDO_VALLEY", 4), + ("ENTR_GERUDO_VALLEY_4_1", "SCENE_GERUDO_VALLEY", 4), + ("ENTR_GERUDO_VALLEY_4_2", "SCENE_GERUDO_VALLEY", 4), + ("ENTR_GERUDO_VALLEY_4_3", "SCENE_GERUDO_VALLEY", 4), + ("ENTR_ZORAS_FOUNTAIN_3", "SCENE_ZORAS_FOUNTAIN", 3), + ("ENTR_ZORAS_FOUNTAIN_3_1", "SCENE_ZORAS_FOUNTAIN", 3), + ("ENTR_ZORAS_FOUNTAIN_3_2", "SCENE_ZORAS_FOUNTAIN", 3), + ("ENTR_ZORAS_FOUNTAIN_3_3", "SCENE_ZORAS_FOUNTAIN", 3), + ("ENTR_ZORAS_FOUNTAIN_4", "SCENE_ZORAS_FOUNTAIN", 4), + ("ENTR_ZORAS_FOUNTAIN_4_1", "SCENE_ZORAS_FOUNTAIN", 4), + ("ENTR_ZORAS_FOUNTAIN_4_2", "SCENE_ZORAS_FOUNTAIN", 4), + ("ENTR_ZORAS_FOUNTAIN_4_3", "SCENE_ZORAS_FOUNTAIN", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_4_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 4), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 5), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 5), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 5), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_5_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 5), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 6), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 6), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 6), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_6_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 6), + ("ENTR_POTION_SHOP_KAKARIKO_1", "SCENE_POTION_SHOP_KAKARIKO", 1), + ("ENTR_POTION_SHOP_KAKARIKO_1_1", "SCENE_POTION_SHOP_KAKARIKO", 1), + ("ENTR_POTION_SHOP_KAKARIKO_1_2", "SCENE_POTION_SHOP_KAKARIKO", 1), + ("ENTR_POTION_SHOP_KAKARIKO_1_3", "SCENE_POTION_SHOP_KAKARIKO", 1), + ("ENTR_POTION_SHOP_KAKARIKO_2", "SCENE_POTION_SHOP_KAKARIKO", 2), + ("ENTR_POTION_SHOP_KAKARIKO_2_1", "SCENE_POTION_SHOP_KAKARIKO", 2), + ("ENTR_POTION_SHOP_KAKARIKO_2_2", "SCENE_POTION_SHOP_KAKARIKO", 2), + ("ENTR_POTION_SHOP_KAKARIKO_2_3", "SCENE_POTION_SHOP_KAKARIKO", 2), + ("ENTR_SPIRIT_TEMPLE_2", "SCENE_SPIRIT_TEMPLE", 2), + ("ENTR_SPIRIT_TEMPLE_2_1", "SCENE_SPIRIT_TEMPLE", 2), + ("ENTR_SPIRIT_TEMPLE_2_2", "SCENE_SPIRIT_TEMPLE", 2), + ("ENTR_SPIRIT_TEMPLE_2_3", "SCENE_SPIRIT_TEMPLE", 2), + ("ENTR_SPIRIT_TEMPLE_3", "SCENE_SPIRIT_TEMPLE", 3), + ("ENTR_SPIRIT_TEMPLE_3_1", "SCENE_SPIRIT_TEMPLE", 3), + ("ENTR_SPIRIT_TEMPLE_3_2", "SCENE_SPIRIT_TEMPLE", 3), + ("ENTR_SPIRIT_TEMPLE_3_3", "SCENE_SPIRIT_TEMPLE", 3), + ("ENTR_SPIRIT_TEMPLE_4", "SCENE_SPIRIT_TEMPLE", 4), + ("ENTR_SPIRIT_TEMPLE_4_1", "SCENE_SPIRIT_TEMPLE", 4), + ("ENTR_SPIRIT_TEMPLE_4_2", "SCENE_SPIRIT_TEMPLE", 4), + ("ENTR_SPIRIT_TEMPLE_4_3", "SCENE_SPIRIT_TEMPLE", 4), + ("ENTR_GORON_CITY_2", "SCENE_GORON_CITY", 2), + ("ENTR_GORON_CITY_2_1", "SCENE_GORON_CITY", 2), + ("ENTR_GORON_CITY_2_2", "SCENE_GORON_CITY", 2), + ("ENTR_GORON_CITY_2_3", "SCENE_GORON_CITY", 2), + ("ENTR_CASTLE_COURTYARD_ZELDA_0", "SCENE_CASTLE_COURTYARD_ZELDA", 0), + ("ENTR_CASTLE_COURTYARD_ZELDA_0_1", "SCENE_CASTLE_COURTYARD_ZELDA", 0), + ("ENTR_CASTLE_COURTYARD_ZELDA_0_2", "SCENE_CASTLE_COURTYARD_ZELDA", 0), + ("ENTR_CASTLE_COURTYARD_ZELDA_0_3", "SCENE_CASTLE_COURTYARD_ZELDA", 0), + ("ENTR_CASTLE_COURTYARD_ZELDA_0_4", "SCENE_CASTLE_COURTYARD_ZELDA", 0), + ("ENTR_CASTLE_COURTYARD_ZELDA_0_5", "SCENE_CASTLE_COURTYARD_ZELDA", 0), + ("ENTR_CASTLE_COURTYARD_ZELDA_0_6", "SCENE_CASTLE_COURTYARD_ZELDA", 0), + ("ENTR_JABU_JABU_1", "SCENE_JABU_JABU", 1), + ("ENTR_JABU_JABU_1_1", "SCENE_JABU_JABU", 1), + ("ENTR_JABU_JABU_1_2", "SCENE_JABU_JABU", 1), + ("ENTR_JABU_JABU_1_3", "SCENE_JABU_JABU", 1), + ("ENTR_DODONGOS_CAVERN_BOSS_0", "SCENE_DODONGOS_CAVERN_BOSS", 0), + ("ENTR_DODONGOS_CAVERN_BOSS_0_1", "SCENE_DODONGOS_CAVERN_BOSS", 0), + ("ENTR_DODONGOS_CAVERN_BOSS_0_2", "SCENE_DODONGOS_CAVERN_BOSS", 0), + ("ENTR_DODONGOS_CAVERN_BOSS_0_3", "SCENE_DODONGOS_CAVERN_BOSS", 0), + ("ENTR_DEKU_TREE_BOSS_0", "SCENE_DEKU_TREE_BOSS", 0), + ("ENTR_DEKU_TREE_BOSS_0_1", "SCENE_DEKU_TREE_BOSS", 0), + ("ENTR_DEKU_TREE_BOSS_0_2", "SCENE_DEKU_TREE_BOSS", 0), + ("ENTR_DEKU_TREE_BOSS_0_3", "SCENE_DEKU_TREE_BOSS", 0), + ("ENTR_SHADOW_TEMPLE_BOSS_0", "SCENE_SHADOW_TEMPLE_BOSS", 0), + ("ENTR_SHADOW_TEMPLE_BOSS_0_1", "SCENE_SHADOW_TEMPLE_BOSS", 0), + ("ENTR_SHADOW_TEMPLE_BOSS_0_2", "SCENE_SHADOW_TEMPLE_BOSS", 0), + ("ENTR_SHADOW_TEMPLE_BOSS_0_3", "SCENE_SHADOW_TEMPLE_BOSS", 0), + ("ENTR_WATER_TEMPLE_BOSS_0", "SCENE_WATER_TEMPLE_BOSS", 0), + ("ENTR_WATER_TEMPLE_BOSS_0_1", "SCENE_WATER_TEMPLE_BOSS", 0), + ("ENTR_WATER_TEMPLE_BOSS_0_2", "SCENE_WATER_TEMPLE_BOSS", 0), + ("ENTR_WATER_TEMPLE_BOSS_0_3", "SCENE_WATER_TEMPLE_BOSS", 0), + ("ENTR_GANONS_TOWER_0", "SCENE_GANONS_TOWER", 0), + ("ENTR_GANONS_TOWER_0_1", "SCENE_GANONS_TOWER", 0), + ("ENTR_GANONS_TOWER_0_2", "SCENE_GANONS_TOWER", 0), + ("ENTR_GANONS_TOWER_0_3", "SCENE_GANONS_TOWER", 0), + ("ENTR_GANONDORF_BOSS_0", "SCENE_GANONDORF_BOSS", 0), + ("ENTR_GANONDORF_BOSS_0_1", "SCENE_GANONDORF_BOSS", 0), + ("ENTR_GANONDORF_BOSS_0_2", "SCENE_GANONDORF_BOSS", 0), + ("ENTR_GANONDORF_BOSS_0_3", "SCENE_GANONDORF_BOSS", 0), + ("ENTR_WATER_TEMPLE_1", "SCENE_WATER_TEMPLE", 1), + ("ENTR_WATER_TEMPLE_1_1", "SCENE_WATER_TEMPLE", 1), + ("ENTR_WATER_TEMPLE_1_2", "SCENE_WATER_TEMPLE", 1), + ("ENTR_WATER_TEMPLE_1_3", "SCENE_WATER_TEMPLE", 1), + ("ENTR_GANONS_TOWER_1", "SCENE_GANONS_TOWER", 1), + ("ENTR_GANONS_TOWER_1_1", "SCENE_GANONS_TOWER", 1), + ("ENTR_GANONS_TOWER_1_2", "SCENE_GANONS_TOWER", 1), + ("ENTR_GANONS_TOWER_1_3", "SCENE_GANONS_TOWER", 1), + ("ENTR_GANONS_TOWER_2", "SCENE_GANONS_TOWER", 2), + ("ENTR_GANONS_TOWER_2_1", "SCENE_GANONS_TOWER", 2), + ("ENTR_GANONS_TOWER_2_2", "SCENE_GANONS_TOWER", 2), + ("ENTR_GANONS_TOWER_2_3", "SCENE_GANONS_TOWER", 2), + ("ENTR_LON_LON_RANCH_5", "SCENE_LON_LON_RANCH", 5), + ("ENTR_LON_LON_RANCH_5_1", "SCENE_LON_LON_RANCH", 5), + ("ENTR_LON_LON_RANCH_5_2", "SCENE_LON_LON_RANCH", 5), + ("ENTR_LON_LON_RANCH_5_3", "SCENE_LON_LON_RANCH", 5), + ("ENTR_MIDOS_HOUSE_0", "SCENE_MIDOS_HOUSE", 0), + ("ENTR_MIDOS_HOUSE_0_1", "SCENE_MIDOS_HOUSE", 0), + ("ENTR_MIDOS_HOUSE_0_2", "SCENE_MIDOS_HOUSE", 0), + ("ENTR_MIDOS_HOUSE_0_3", "SCENE_MIDOS_HOUSE", 0), + ("ENTR_SARIAS_HOUSE_0", "SCENE_SARIAS_HOUSE", 0), + ("ENTR_SARIAS_HOUSE_0_1", "SCENE_SARIAS_HOUSE", 0), + ("ENTR_SARIAS_HOUSE_0_2", "SCENE_SARIAS_HOUSE", 0), + ("ENTR_SARIAS_HOUSE_0_3", "SCENE_SARIAS_HOUSE", 0), + ("ENTR_BACK_ALLEY_HOUSE_0", "SCENE_BACK_ALLEY_HOUSE", 0), + ("ENTR_BACK_ALLEY_HOUSE_0_1", "SCENE_BACK_ALLEY_HOUSE", 0), + ("ENTR_BACK_ALLEY_HOUSE_0_2", "SCENE_BACK_ALLEY_HOUSE", 0), + ("ENTR_BACK_ALLEY_HOUSE_0_3", "SCENE_BACK_ALLEY_HOUSE", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 0), + ("ENTR_KOKIRI_FOREST_9", "SCENE_KOKIRI_FOREST", 9), + ("ENTR_KOKIRI_FOREST_9_1", "SCENE_KOKIRI_FOREST", 9), + ("ENTR_KOKIRI_FOREST_9_2", "SCENE_KOKIRI_FOREST", 9), + ("ENTR_KOKIRI_FOREST_9_3", "SCENE_KOKIRI_FOREST", 9), + ("ENTR_KOKIRI_FOREST_10", "SCENE_KOKIRI_FOREST", 10), + ("ENTR_KOKIRI_FOREST_10_1", "SCENE_KOKIRI_FOREST", 10), + ("ENTR_KOKIRI_FOREST_10_2", "SCENE_KOKIRI_FOREST", 10), + ("ENTR_KOKIRI_FOREST_10_3", "SCENE_KOKIRI_FOREST", 10), + ("ENTR_KAKARIKO_VILLAGE_9", "SCENE_KAKARIKO_VILLAGE", 9), + ("ENTR_KAKARIKO_VILLAGE_9_1", "SCENE_KAKARIKO_VILLAGE", 9), + ("ENTR_KAKARIKO_VILLAGE_9_2", "SCENE_KAKARIKO_VILLAGE", 9), + ("ENTR_KAKARIKO_VILLAGE_9_3", "SCENE_KAKARIKO_VILLAGE", 9), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_0", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 0), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_0_1", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 0), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_0_2", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 0), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_0_3", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 0), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_1", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 1), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_1_1", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 1), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_1_2", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 1), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_1_3", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 1), + ("ENTR_KOKIRI_FOREST_11", "SCENE_KOKIRI_FOREST", 11), + ("ENTR_KOKIRI_FOREST_11_1", "SCENE_KOKIRI_FOREST", 11), + ("ENTR_KOKIRI_FOREST_11_2", "SCENE_KOKIRI_FOREST", 11), + ("ENTR_KOKIRI_FOREST_11_3", "SCENE_KOKIRI_FOREST", 11), + ("ENTR_DEATH_MOUNTAIN_TRAIL_4", "SCENE_DEATH_MOUNTAIN_TRAIL", 4), + ("ENTR_DEATH_MOUNTAIN_TRAIL_4_1", "SCENE_DEATH_MOUNTAIN_TRAIL", 4), + ("ENTR_DEATH_MOUNTAIN_TRAIL_4_2", "SCENE_DEATH_MOUNTAIN_TRAIL", 4), + ("ENTR_DEATH_MOUNTAIN_TRAIL_4_3", "SCENE_DEATH_MOUNTAIN_TRAIL", 4), + ("ENTR_FISHING_POND_0", "SCENE_FISHING_POND", 0), + ("ENTR_FISHING_POND_0_1", "SCENE_FISHING_POND", 0), + ("ENTR_FISHING_POND_0_2", "SCENE_FISHING_POND", 0), + ("ENTR_FISHING_POND_0_3", "SCENE_FISHING_POND", 0), + ("ENTR_KAKARIKO_VILLAGE_10", "SCENE_KAKARIKO_VILLAGE", 10), + ("ENTR_KAKARIKO_VILLAGE_10_1", "SCENE_KAKARIKO_VILLAGE", 10), + ("ENTR_KAKARIKO_VILLAGE_10_2", "SCENE_KAKARIKO_VILLAGE", 10), + ("ENTR_KAKARIKO_VILLAGE_10_3", "SCENE_KAKARIKO_VILLAGE", 10), + ("ENTR_INSIDE_GANONS_CASTLE_0", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_1", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_2", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_3", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_4", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_5", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_6", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_7", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_8", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_9", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_0_10", "SCENE_INSIDE_GANONS_CASTLE", 0), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_DAY_1", "SCENE_TEMPLE_OF_TIME_EXTERIOR_DAY", 1), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_NIGHT_1_1", "SCENE_TEMPLE_OF_TIME_EXTERIOR_NIGHT", 1), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_1_2", "SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS", 1), + ("ENTR_TEMPLE_OF_TIME_EXTERIOR_RUINS_1_3", "SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS", 1), + ("ENTR_HYRULE_FIELD_15", "SCENE_HYRULE_FIELD", 15), + ("ENTR_HYRULE_FIELD_15_1", "SCENE_HYRULE_FIELD", 15), + ("ENTR_HYRULE_FIELD_15_2", "SCENE_HYRULE_FIELD", 15), + ("ENTR_HYRULE_FIELD_15_3", "SCENE_HYRULE_FIELD", 15), + ("ENTR_DEATH_MOUNTAIN_TRAIL_5", "SCENE_DEATH_MOUNTAIN_TRAIL", 5), + ("ENTR_DEATH_MOUNTAIN_TRAIL_5_1", "SCENE_DEATH_MOUNTAIN_TRAIL", 5), + ("ENTR_DEATH_MOUNTAIN_TRAIL_5_2", "SCENE_DEATH_MOUNTAIN_TRAIL", 5), + ("ENTR_DEATH_MOUNTAIN_TRAIL_5_3", "SCENE_DEATH_MOUNTAIN_TRAIL", 5), + ("ENTR_HYRULE_CASTLE_4", "SCENE_HYRULE_CASTLE", 4), + ("ENTR_HYRULE_CASTLE_4_1", "SCENE_HYRULE_CASTLE", 4), + ("ENTR_OUTSIDE_GANONS_CASTLE_4_2", "SCENE_OUTSIDE_GANONS_CASTLE", 4), + ("ENTR_OUTSIDE_GANONS_CASTLE_4_3", "SCENE_OUTSIDE_GANONS_CASTLE", 4), + ("ENTR_DEATH_MOUNTAIN_CRATER_3", "SCENE_DEATH_MOUNTAIN_CRATER", 3), + ("ENTR_DEATH_MOUNTAIN_CRATER_3_1", "SCENE_DEATH_MOUNTAIN_CRATER", 3), + ("ENTR_DEATH_MOUNTAIN_CRATER_3_2", "SCENE_DEATH_MOUNTAIN_CRATER", 3), + ("ENTR_DEATH_MOUNTAIN_CRATER_3_3", "SCENE_DEATH_MOUNTAIN_CRATER", 3), + ("ENTR_THIEVES_HIDEOUT_0", "SCENE_THIEVES_HIDEOUT", 0), + ("ENTR_THIEVES_HIDEOUT_0_1", "SCENE_THIEVES_HIDEOUT", 0), + ("ENTR_THIEVES_HIDEOUT_0_2", "SCENE_THIEVES_HIDEOUT", 0), + ("ENTR_THIEVES_HIDEOUT_0_3", "SCENE_THIEVES_HIDEOUT", 0), + ("ENTR_THIEVES_HIDEOUT_1", "SCENE_THIEVES_HIDEOUT", 1), + ("ENTR_THIEVES_HIDEOUT_1_1", "SCENE_THIEVES_HIDEOUT", 1), + ("ENTR_THIEVES_HIDEOUT_1_2", "SCENE_THIEVES_HIDEOUT", 1), + ("ENTR_THIEVES_HIDEOUT_1_3", "SCENE_THIEVES_HIDEOUT", 1), + ("ENTR_THIEVES_HIDEOUT_2", "SCENE_THIEVES_HIDEOUT", 2), + ("ENTR_THIEVES_HIDEOUT_2_1", "SCENE_THIEVES_HIDEOUT", 2), + ("ENTR_THIEVES_HIDEOUT_2_2", "SCENE_THIEVES_HIDEOUT", 2), + ("ENTR_THIEVES_HIDEOUT_2_3", "SCENE_THIEVES_HIDEOUT", 2), + ("ENTR_THIEVES_HIDEOUT_3", "SCENE_THIEVES_HIDEOUT", 3), + ("ENTR_THIEVES_HIDEOUT_3_1", "SCENE_THIEVES_HIDEOUT", 3), + ("ENTR_THIEVES_HIDEOUT_3_2", "SCENE_THIEVES_HIDEOUT", 3), + ("ENTR_THIEVES_HIDEOUT_3_3", "SCENE_THIEVES_HIDEOUT", 3), + ("ENTR_THIEVES_HIDEOUT_4", "SCENE_THIEVES_HIDEOUT", 4), + ("ENTR_THIEVES_HIDEOUT_4_1", "SCENE_THIEVES_HIDEOUT", 4), + ("ENTR_THIEVES_HIDEOUT_4_2", "SCENE_THIEVES_HIDEOUT", 4), + ("ENTR_THIEVES_HIDEOUT_4_3", "SCENE_THIEVES_HIDEOUT", 4), + ("ENTR_THIEVES_HIDEOUT_5", "SCENE_THIEVES_HIDEOUT", 5), + ("ENTR_THIEVES_HIDEOUT_5_1", "SCENE_THIEVES_HIDEOUT", 5), + ("ENTR_THIEVES_HIDEOUT_5_2", "SCENE_THIEVES_HIDEOUT", 5), + ("ENTR_THIEVES_HIDEOUT_5_3", "SCENE_THIEVES_HIDEOUT", 5), + ("ENTR_THIEVES_HIDEOUT_6", "SCENE_THIEVES_HIDEOUT", 6), + ("ENTR_THIEVES_HIDEOUT_6_1", "SCENE_THIEVES_HIDEOUT", 6), + ("ENTR_THIEVES_HIDEOUT_6_2", "SCENE_THIEVES_HIDEOUT", 6), + ("ENTR_THIEVES_HIDEOUT_6_3", "SCENE_THIEVES_HIDEOUT", 6), + ("ENTR_THIEVES_HIDEOUT_7", "SCENE_THIEVES_HIDEOUT", 7), + ("ENTR_THIEVES_HIDEOUT_7_1", "SCENE_THIEVES_HIDEOUT", 7), + ("ENTR_THIEVES_HIDEOUT_7_2", "SCENE_THIEVES_HIDEOUT", 7), + ("ENTR_THIEVES_HIDEOUT_7_3", "SCENE_THIEVES_HIDEOUT", 7), + ("ENTR_THIEVES_HIDEOUT_8", "SCENE_THIEVES_HIDEOUT", 8), + ("ENTR_THIEVES_HIDEOUT_8_1", "SCENE_THIEVES_HIDEOUT", 8), + ("ENTR_THIEVES_HIDEOUT_8_2", "SCENE_THIEVES_HIDEOUT", 8), + ("ENTR_THIEVES_HIDEOUT_8_3", "SCENE_THIEVES_HIDEOUT", 8), + ("ENTR_THIEVES_HIDEOUT_9", "SCENE_THIEVES_HIDEOUT", 9), + ("ENTR_THIEVES_HIDEOUT_9_1", "SCENE_THIEVES_HIDEOUT", 9), + ("ENTR_THIEVES_HIDEOUT_9_2", "SCENE_THIEVES_HIDEOUT", 9), + ("ENTR_THIEVES_HIDEOUT_9_3", "SCENE_THIEVES_HIDEOUT", 9), + ("ENTR_THIEVES_HIDEOUT_10", "SCENE_THIEVES_HIDEOUT", 10), + ("ENTR_THIEVES_HIDEOUT_10_1", "SCENE_THIEVES_HIDEOUT", 10), + ("ENTR_THIEVES_HIDEOUT_10_2", "SCENE_THIEVES_HIDEOUT", 10), + ("ENTR_THIEVES_HIDEOUT_10_3", "SCENE_THIEVES_HIDEOUT", 10), + ("ENTR_THIEVES_HIDEOUT_11", "SCENE_THIEVES_HIDEOUT", 11), + ("ENTR_THIEVES_HIDEOUT_11_1", "SCENE_THIEVES_HIDEOUT", 11), + ("ENTR_THIEVES_HIDEOUT_11_2", "SCENE_THIEVES_HIDEOUT", 11), + ("ENTR_THIEVES_HIDEOUT_11_3", "SCENE_THIEVES_HIDEOUT", 11), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 7), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7_1", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 7), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7_2", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 7), + ("ENTR_GANONS_TOWER_COLLAPSE_INTERIOR_7_3", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR", 7), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 1), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_1_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_1_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 2), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 2), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 2), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_2_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 2), + ("ENTR_LOST_WOODS_4", "SCENE_LOST_WOODS", 4), + ("ENTR_LOST_WOODS_4_1", "SCENE_LOST_WOODS", 4), + ("ENTR_LOST_WOODS_4_2", "SCENE_LOST_WOODS", 4), + ("ENTR_LOST_WOODS_4_3", "SCENE_LOST_WOODS", 4), + ("ENTR_LON_LON_RANCH_6", "SCENE_LON_LON_RANCH", 6), + ("ENTR_LON_LON_RANCH_6_1", "SCENE_LON_LON_RANCH", 6), + ("ENTR_LON_LON_RANCH_6_2", "SCENE_LON_LON_RANCH", 6), + ("ENTR_LON_LON_RANCH_6_3", "SCENE_LON_LON_RANCH", 6), + ("ENTR_LON_LON_RANCH_7", "SCENE_LON_LON_RANCH", 7), + ("ENTR_LON_LON_RANCH_7_1", "SCENE_LON_LON_RANCH", 7), + ("ENTR_LON_LON_RANCH_7_2", "SCENE_LON_LON_RANCH", 7), + ("ENTR_LON_LON_RANCH_7_3", "SCENE_LON_LON_RANCH", 7), + ("ENTR_LOST_WOODS_5", "SCENE_LOST_WOODS", 5), + ("ENTR_LOST_WOODS_5_1", "SCENE_LOST_WOODS", 5), + ("ENTR_LOST_WOODS_5_2", "SCENE_LOST_WOODS", 5), + ("ENTR_LOST_WOODS_5_3", "SCENE_LOST_WOODS", 5), + ("ENTR_LOST_WOODS_6", "SCENE_LOST_WOODS", 6), + ("ENTR_LOST_WOODS_6_1", "SCENE_LOST_WOODS", 6), + ("ENTR_LOST_WOODS_6_2", "SCENE_LOST_WOODS", 6), + ("ENTR_LOST_WOODS_6_3", "SCENE_LOST_WOODS", 6), + ("ENTR_LOST_WOODS_7", "SCENE_LOST_WOODS", 7), + ("ENTR_LOST_WOODS_7_1", "SCENE_LOST_WOODS", 7), + ("ENTR_LOST_WOODS_7_2", "SCENE_LOST_WOODS", 7), + ("ENTR_LOST_WOODS_7_3", "SCENE_LOST_WOODS", 7), + ("ENTR_LOST_WOODS_8", "SCENE_LOST_WOODS", 8), + ("ENTR_LOST_WOODS_8_1", "SCENE_LOST_WOODS", 8), + ("ENTR_LOST_WOODS_8_2", "SCENE_LOST_WOODS", 8), + ("ENTR_LOST_WOODS_8_3", "SCENE_LOST_WOODS", 8), + ("ENTR_GORON_CITY_3", "SCENE_GORON_CITY", 3), + ("ENTR_GORON_CITY_3_1", "SCENE_GORON_CITY", 3), + ("ENTR_GORON_CITY_3_2", "SCENE_GORON_CITY", 3), + ("ENTR_GORON_CITY_3_3", "SCENE_GORON_CITY", 3), + ("ENTR_LAKE_HYLIA_5", "SCENE_LAKE_HYLIA", 5), + ("ENTR_LAKE_HYLIA_5_1", "SCENE_LAKE_HYLIA", 5), + ("ENTR_LAKE_HYLIA_5_2", "SCENE_LAKE_HYLIA", 5), + ("ENTR_LAKE_HYLIA_5_3", "SCENE_LAKE_HYLIA", 5), + ("ENTR_SHADOW_TEMPLE_3", "SCENE_SHADOW_TEMPLE", 3), + ("ENTR_SHADOW_TEMPLE_3_1", "SCENE_SHADOW_TEMPLE", 3), + ("ENTR_SHADOW_TEMPLE_3_2", "SCENE_SHADOW_TEMPLE", 3), + ("ENTR_SHADOW_TEMPLE_3_3", "SCENE_SHADOW_TEMPLE", 3), + ("ENTR_KAKARIKO_VILLAGE_11", "SCENE_KAKARIKO_VILLAGE", 11), + ("ENTR_KAKARIKO_VILLAGE_11_1", "SCENE_KAKARIKO_VILLAGE", 11), + ("ENTR_KAKARIKO_VILLAGE_11_2", "SCENE_KAKARIKO_VILLAGE", 11), + ("ENTR_KAKARIKO_VILLAGE_11_3", "SCENE_KAKARIKO_VILLAGE", 11), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 3), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 3), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 3), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_MAGIC_3_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC", 3), + ("ENTR_DEATH_MOUNTAIN_CRATER_4", "SCENE_DEATH_MOUNTAIN_CRATER", 4), + ("ENTR_DEATH_MOUNTAIN_CRATER_4_1", "SCENE_DEATH_MOUNTAIN_CRATER", 4), + ("ENTR_DEATH_MOUNTAIN_CRATER_4_2", "SCENE_DEATH_MOUNTAIN_CRATER", 4), + ("ENTR_DEATH_MOUNTAIN_CRATER_4_3", "SCENE_DEATH_MOUNTAIN_CRATER", 4), + ("ENTR_HYRULE_CASTLE_3", "SCENE_HYRULE_CASTLE", 3), + ("ENTR_HYRULE_CASTLE_3_1", "SCENE_HYRULE_CASTLE", 3), + ("ENTR_OUTSIDE_GANONS_CASTLE_3_2", "SCENE_OUTSIDE_GANONS_CASTLE", 3), + ("ENTR_OUTSIDE_GANONS_CASTLE_3_3", "SCENE_OUTSIDE_GANONS_CASTLE", 3), + ("ENTR_HYRULE_CASTLE_3_4", "SCENE_HYRULE_CASTLE", 3), + ("ENTR_KAKARIKO_VILLAGE_12", "SCENE_KAKARIKO_VILLAGE", 12), + ("ENTR_KAKARIKO_VILLAGE_12_1", "SCENE_KAKARIKO_VILLAGE", 12), + ("ENTR_KAKARIKO_VILLAGE_12_2", "SCENE_KAKARIKO_VILLAGE", 12), + ("ENTR_KAKARIKO_VILLAGE_12_3", "SCENE_KAKARIKO_VILLAGE", 12), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_2", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 2), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_2_1", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 2), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_2_2", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 2), + ("ENTR_WINDMILL_AND_DAMPES_GRAVE_2_3", "SCENE_WINDMILL_AND_DAMPES_GRAVE", 2), + ("ENTR_BOMBCHU_BOWLING_ALLEY_0", "SCENE_BOMBCHU_BOWLING_ALLEY", 0), + ("ENTR_BOMBCHU_BOWLING_ALLEY_0_1", "SCENE_BOMBCHU_BOWLING_ALLEY", 0), + ("ENTR_BOMBCHU_BOWLING_ALLEY_0_2", "SCENE_BOMBCHU_BOWLING_ALLEY", 0), + ("ENTR_BOMBCHU_BOWLING_ALLEY_0_3", "SCENE_BOMBCHU_BOWLING_ALLEY", 0), + ("ENTR_GRAVEYARD_6", "SCENE_GRAVEYARD", 6), + ("ENTR_GRAVEYARD_6_1", "SCENE_GRAVEYARD", 6), + ("ENTR_GRAVEYARD_6_2", "SCENE_GRAVEYARD", 6), + ("ENTR_GRAVEYARD_6_3", "SCENE_GRAVEYARD", 6), + ("ENTR_HYRULE_FIELD_16", "SCENE_HYRULE_FIELD", 16), + ("ENTR_HYRULE_FIELD_16_1", "SCENE_HYRULE_FIELD", 16), + ("ENTR_HYRULE_FIELD_16_2", "SCENE_HYRULE_FIELD", 16), + ("ENTR_HYRULE_FIELD_16_3", "SCENE_HYRULE_FIELD", 16), + ("ENTR_KAKARIKO_VILLAGE_13", "SCENE_KAKARIKO_VILLAGE", 13), + ("ENTR_KAKARIKO_VILLAGE_13_1", "SCENE_KAKARIKO_VILLAGE", 13), + ("ENTR_KAKARIKO_VILLAGE_13_2", "SCENE_KAKARIKO_VILLAGE", 13), + ("ENTR_KAKARIKO_VILLAGE_13_3", "SCENE_KAKARIKO_VILLAGE", 13), + ("ENTR_GANON_BOSS_0", "SCENE_GANON_BOSS", 0), + ("ENTR_GANON_BOSS_0_1", "SCENE_GANON_BOSS", 0), + ("ENTR_GANON_BOSS_0_2", "SCENE_GANON_BOSS", 0), + ("ENTR_GANON_BOSS_0_3", "SCENE_GANON_BOSS", 0), + ("ENTR_GANON_BOSS_0_4", "SCENE_GANON_BOSS", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 6), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 6), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 6), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_6_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 6), + ("ENTR_BESITU_0", "SCENE_BESITU", 0), + ("ENTR_BESITU_0_1", "SCENE_BESITU", 0), + ("ENTR_BESITU_0_2", "SCENE_BESITU", 0), + ("ENTR_BESITU_0_3", "SCENE_BESITU", 0), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 7), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7_1", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 7), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7_2", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 7), + ("ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_7_3", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR", 7), + ("ENTR_BOMBCHU_SHOP_1", "SCENE_BOMBCHU_SHOP", 1), + ("ENTR_BOMBCHU_SHOP_1_1", "SCENE_BOMBCHU_SHOP", 1), + ("ENTR_BOMBCHU_SHOP_1_2", "SCENE_BOMBCHU_SHOP", 1), + ("ENTR_BOMBCHU_SHOP_1_3", "SCENE_BOMBCHU_SHOP", 1), + ("ENTR_BAZAAR_1", "SCENE_BAZAAR", 1), + ("ENTR_BAZAAR_1_1", "SCENE_BAZAAR", 1), + ("ENTR_BAZAAR_1_2", "SCENE_BAZAAR", 1), + ("ENTR_BAZAAR_1_3", "SCENE_BAZAAR", 1), + ("ENTR_HAPPY_MASK_SHOP_0", "SCENE_HAPPY_MASK_SHOP", 0), + ("ENTR_HAPPY_MASK_SHOP_0_1", "SCENE_HAPPY_MASK_SHOP", 0), + ("ENTR_HAPPY_MASK_SHOP_0_2", "SCENE_HAPPY_MASK_SHOP", 0), + ("ENTR_HAPPY_MASK_SHOP_0_3", "SCENE_HAPPY_MASK_SHOP", 0), + ("ENTR_INSIDE_GANONS_CASTLE_1", "SCENE_INSIDE_GANONS_CASTLE", 1), + ("ENTR_INSIDE_GANONS_CASTLE_1_1", "SCENE_INSIDE_GANONS_CASTLE", 1), + ("ENTR_INSIDE_GANONS_CASTLE_1_2", "SCENE_INSIDE_GANONS_CASTLE", 1), + ("ENTR_INSIDE_GANONS_CASTLE_1_3", "SCENE_INSIDE_GANONS_CASTLE", 1), + ("ENTR_INSIDE_GANONS_CASTLE_2", "SCENE_INSIDE_GANONS_CASTLE", 2), + ("ENTR_INSIDE_GANONS_CASTLE_2_1", "SCENE_INSIDE_GANONS_CASTLE", 2), + ("ENTR_INSIDE_GANONS_CASTLE_2_2", "SCENE_INSIDE_GANONS_CASTLE", 2), + ("ENTR_INSIDE_GANONS_CASTLE_2_3", "SCENE_INSIDE_GANONS_CASTLE", 2), + ("ENTR_INSIDE_GANONS_CASTLE_3", "SCENE_INSIDE_GANONS_CASTLE", 3), + ("ENTR_INSIDE_GANONS_CASTLE_3_1", "SCENE_INSIDE_GANONS_CASTLE", 3), + ("ENTR_INSIDE_GANONS_CASTLE_3_2", "SCENE_INSIDE_GANONS_CASTLE", 3), + ("ENTR_INSIDE_GANONS_CASTLE_3_3", "SCENE_INSIDE_GANONS_CASTLE", 3), + ("ENTR_INSIDE_GANONS_CASTLE_4", "SCENE_INSIDE_GANONS_CASTLE", 4), + ("ENTR_INSIDE_GANONS_CASTLE_4_1", "SCENE_INSIDE_GANONS_CASTLE", 4), + ("ENTR_INSIDE_GANONS_CASTLE_4_2", "SCENE_INSIDE_GANONS_CASTLE", 4), + ("ENTR_INSIDE_GANONS_CASTLE_4_3", "SCENE_INSIDE_GANONS_CASTLE", 4), + ("ENTR_INSIDE_GANONS_CASTLE_5", "SCENE_INSIDE_GANONS_CASTLE", 5), + ("ENTR_INSIDE_GANONS_CASTLE_5_1", "SCENE_INSIDE_GANONS_CASTLE", 5), + ("ENTR_INSIDE_GANONS_CASTLE_5_2", "SCENE_INSIDE_GANONS_CASTLE", 5), + ("ENTR_INSIDE_GANONS_CASTLE_5_3", "SCENE_INSIDE_GANONS_CASTLE", 5), + ("ENTR_INSIDE_GANONS_CASTLE_6", "SCENE_INSIDE_GANONS_CASTLE", 6), + ("ENTR_INSIDE_GANONS_CASTLE_6_1", "SCENE_INSIDE_GANONS_CASTLE", 6), + ("ENTR_INSIDE_GANONS_CASTLE_6_2", "SCENE_INSIDE_GANONS_CASTLE", 6), + ("ENTR_INSIDE_GANONS_CASTLE_6_3", "SCENE_INSIDE_GANONS_CASTLE", 6), + ("ENTR_INSIDE_GANONS_CASTLE_7", "SCENE_INSIDE_GANONS_CASTLE", 7), + ("ENTR_INSIDE_GANONS_CASTLE_7_1", "SCENE_INSIDE_GANONS_CASTLE", 7), + ("ENTR_INSIDE_GANONS_CASTLE_7_2", "SCENE_INSIDE_GANONS_CASTLE", 7), + ("ENTR_INSIDE_GANONS_CASTLE_7_3", "SCENE_INSIDE_GANONS_CASTLE", 7), + ("ENTR_HOUSE_OF_SKULLTULA_0", "SCENE_HOUSE_OF_SKULLTULA", 0), + ("ENTR_HOUSE_OF_SKULLTULA_0_1", "SCENE_HOUSE_OF_SKULLTULA", 0), + ("ENTR_HOUSE_OF_SKULLTULA_0_2", "SCENE_HOUSE_OF_SKULLTULA", 0), + ("ENTR_HOUSE_OF_SKULLTULA_0_3", "SCENE_HOUSE_OF_SKULLTULA", 0), + ("ENTR_KAKARIKO_VILLAGE_14", "SCENE_KAKARIKO_VILLAGE", 14), + ("ENTR_KAKARIKO_VILLAGE_14_1", "SCENE_KAKARIKO_VILLAGE", 14), + ("ENTR_KAKARIKO_VILLAGE_14_2", "SCENE_KAKARIKO_VILLAGE", 14), + ("ENTR_KAKARIKO_VILLAGE_14_3", "SCENE_KAKARIKO_VILLAGE", 14), + ("ENTR_LON_LON_RANCH_8", "SCENE_LON_LON_RANCH", 8), + ("ENTR_LON_LON_RANCH_8_1", "SCENE_LON_LON_RANCH", 8), + ("ENTR_LON_LON_RANCH_8_2", "SCENE_LON_LON_RANCH", 8), + ("ENTR_LON_LON_RANCH_8_3", "SCENE_LON_LON_RANCH", 8), + ("ENTR_LON_LON_RANCH_9", "SCENE_LON_LON_RANCH", 9), + ("ENTR_LON_LON_RANCH_9_1", "SCENE_LON_LON_RANCH", 9), + ("ENTR_LON_LON_RANCH_9_2", "SCENE_LON_LON_RANCH", 9), + ("ENTR_LON_LON_RANCH_9_3", "SCENE_LON_LON_RANCH", 9), + ("ENTR_LAKE_HYLIA_7", "SCENE_LAKE_HYLIA", 7), + ("ENTR_LAKE_HYLIA_7_1", "SCENE_LAKE_HYLIA", 7), + ("ENTR_LAKE_HYLIA_7_2", "SCENE_LAKE_HYLIA", 7), + ("ENTR_LAKE_HYLIA_7_3", "SCENE_LAKE_HYLIA", 7), + ("ENTR_DEATH_MOUNTAIN_CRATER_5", "SCENE_DEATH_MOUNTAIN_CRATER", 5), + ("ENTR_DEATH_MOUNTAIN_CRATER_5_1", "SCENE_DEATH_MOUNTAIN_CRATER", 5), + ("ENTR_DEATH_MOUNTAIN_CRATER_5_2", "SCENE_DEATH_MOUNTAIN_CRATER", 5), + ("ENTR_DEATH_MOUNTAIN_CRATER_5_3", "SCENE_DEATH_MOUNTAIN_CRATER", 5), + ("ENTR_GRAVEYARD_7", "SCENE_GRAVEYARD", 7), + ("ENTR_GRAVEYARD_7_1", "SCENE_GRAVEYARD", 7), + ("ENTR_GRAVEYARD_7_2", "SCENE_GRAVEYARD", 7), + ("ENTR_GRAVEYARD_7_3", "SCENE_GRAVEYARD", 7), + ("ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0", "SCENE_INSIDE_GANONS_CASTLE_COLLAPSE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0_1", "SCENE_INSIDE_GANONS_CASTLE_COLLAPSE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0_2", "SCENE_INSIDE_GANONS_CASTLE_COLLAPSE", 0), + ("ENTR_INSIDE_GANONS_CASTLE_COLLAPSE_0_3", "SCENE_INSIDE_GANONS_CASTLE_COLLAPSE", 0), + ("ENTR_THIEVES_HIDEOUT_12", "SCENE_THIEVES_HIDEOUT", 12), + ("ENTR_THIEVES_HIDEOUT_12_1", "SCENE_THIEVES_HIDEOUT", 12), + ("ENTR_THIEVES_HIDEOUT_12_2", "SCENE_THIEVES_HIDEOUT", 12), + ("ENTR_THIEVES_HIDEOUT_12_3", "SCENE_THIEVES_HIDEOUT", 12), + ("ENTR_ROYAL_FAMILYS_TOMB_1", "SCENE_ROYAL_FAMILYS_TOMB", 1), + ("ENTR_ROYAL_FAMILYS_TOMB_1_1", "SCENE_ROYAL_FAMILYS_TOMB", 1), + ("ENTR_ROYAL_FAMILYS_TOMB_1_2", "SCENE_ROYAL_FAMILYS_TOMB", 1), + ("ENTR_ROYAL_FAMILYS_TOMB_1_3", "SCENE_ROYAL_FAMILYS_TOMB", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 1), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_1_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 1), + ("ENTR_DESERT_COLOSSUS_7", "SCENE_DESERT_COLOSSUS", 7), + ("ENTR_DESERT_COLOSSUS_7_1", "SCENE_DESERT_COLOSSUS", 7), + ("ENTR_DESERT_COLOSSUS_7_2", "SCENE_DESERT_COLOSSUS", 7), + ("ENTR_DESERT_COLOSSUS_7_3", "SCENE_DESERT_COLOSSUS", 7), + ("ENTR_GRAVEYARD_8", "SCENE_GRAVEYARD", 8), + ("ENTR_GRAVEYARD_8_1", "SCENE_GRAVEYARD", 8), + ("ENTR_GRAVEYARD_8_2", "SCENE_GRAVEYARD", 8), + ("ENTR_GRAVEYARD_8_3", "SCENE_GRAVEYARD", 8), + ("ENTR_FOREST_TEMPLE_2", "SCENE_FOREST_TEMPLE", 2), + ("ENTR_FOREST_TEMPLE_2_1", "SCENE_FOREST_TEMPLE", 2), + ("ENTR_FOREST_TEMPLE_2_2", "SCENE_FOREST_TEMPLE", 2), + ("ENTR_FOREST_TEMPLE_2_3", "SCENE_FOREST_TEMPLE", 2), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 2), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2_1", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 2), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2_2", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 2), + ("ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_2_3", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS", 2), + ("ENTR_TEMPLE_OF_TIME_5", "SCENE_TEMPLE_OF_TIME", 5), + ("ENTR_TEMPLE_OF_TIME_5_1", "SCENE_TEMPLE_OF_TIME", 5), + ("ENTR_TEMPLE_OF_TIME_5_2", "SCENE_TEMPLE_OF_TIME", 5), + ("ENTR_TEMPLE_OF_TIME_5_3", "SCENE_TEMPLE_OF_TIME", 5), + ("ENTR_TEMPLE_OF_TIME_6", "SCENE_TEMPLE_OF_TIME", 6), + ("ENTR_TEMPLE_OF_TIME_6_1", "SCENE_TEMPLE_OF_TIME", 6), + ("ENTR_TEMPLE_OF_TIME_6_2", "SCENE_TEMPLE_OF_TIME", 6), + ("ENTR_TEMPLE_OF_TIME_6_3", "SCENE_TEMPLE_OF_TIME", 6), + ("ENTR_HYRULE_FIELD_17", "SCENE_HYRULE_FIELD", 17), + ("ENTR_HYRULE_FIELD_17_1", "SCENE_HYRULE_FIELD", 17), + ("ENTR_HYRULE_FIELD_17_2", "SCENE_HYRULE_FIELD", 17), + ("ENTR_HYRULE_FIELD_17_3", "SCENE_HYRULE_FIELD", 17), + ("ENTR_GROTTOS_1", "SCENE_GROTTOS", 1), + ("ENTR_GROTTOS_1_1", "SCENE_GROTTOS", 1), + ("ENTR_GROTTOS_1_2", "SCENE_GROTTOS", 1), + ("ENTR_GROTTOS_1_3", "SCENE_GROTTOS", 1), + ("ENTR_GROTTOS_2", "SCENE_GROTTOS", 2), + ("ENTR_GROTTOS_2_1", "SCENE_GROTTOS", 2), + ("ENTR_GROTTOS_2_2", "SCENE_GROTTOS", 2), + ("ENTR_GROTTOS_2_3", "SCENE_GROTTOS", 2), + ("ENTR_GROTTOS_3", "SCENE_GROTTOS", 3), + ("ENTR_GROTTOS_3_1", "SCENE_GROTTOS", 3), + ("ENTR_GROTTOS_3_2", "SCENE_GROTTOS", 3), + ("ENTR_GROTTOS_3_3", "SCENE_GROTTOS", 3), + ("ENTR_GROTTOS_4", "SCENE_GROTTOS", 4), + ("ENTR_GROTTOS_4_1", "SCENE_GROTTOS", 4), + ("ENTR_GROTTOS_4_2", "SCENE_GROTTOS", 4), + ("ENTR_GROTTOS_4_3", "SCENE_GROTTOS", 4), + ("ENTR_GROTTOS_5", "SCENE_GROTTOS", 5), + ("ENTR_GROTTOS_5_1", "SCENE_GROTTOS", 5), + ("ENTR_GROTTOS_5_2", "SCENE_GROTTOS", 5), + ("ENTR_GROTTOS_5_3", "SCENE_GROTTOS", 5), + ("ENTR_GROTTOS_6", "SCENE_GROTTOS", 6), + ("ENTR_GROTTOS_6_1", "SCENE_GROTTOS", 6), + ("ENTR_GROTTOS_6_2", "SCENE_GROTTOS", 6), + ("ENTR_GROTTOS_6_3", "SCENE_GROTTOS", 6), + ("ENTR_GROTTOS_7", "SCENE_GROTTOS", 7), + ("ENTR_GROTTOS_7_1", "SCENE_GROTTOS", 7), + ("ENTR_GROTTOS_7_2", "SCENE_GROTTOS", 7), + ("ENTR_GROTTOS_7_3", "SCENE_GROTTOS", 7), + ("ENTR_GROTTOS_8", "SCENE_GROTTOS", 8), + ("ENTR_GROTTOS_8_1", "SCENE_GROTTOS", 8), + ("ENTR_GROTTOS_8_2", "SCENE_GROTTOS", 8), + ("ENTR_GROTTOS_8_3", "SCENE_GROTTOS", 8), + ("ENTR_GROTTOS_9", "SCENE_GROTTOS", 9), + ("ENTR_GROTTOS_9_1", "SCENE_GROTTOS", 9), + ("ENTR_GROTTOS_9_2", "SCENE_GROTTOS", 9), + ("ENTR_GROTTOS_9_3", "SCENE_GROTTOS", 9), + ("ENTR_GROTTOS_10", "SCENE_GROTTOS", 10), + ("ENTR_GROTTOS_10_1", "SCENE_GROTTOS", 10), + ("ENTR_GROTTOS_10_2", "SCENE_GROTTOS", 10), + ("ENTR_GROTTOS_10_3", "SCENE_GROTTOS", 10), + ("ENTR_GROTTOS_11", "SCENE_GROTTOS", 11), + ("ENTR_GROTTOS_11_1", "SCENE_GROTTOS", 11), + ("ENTR_GROTTOS_11_2", "SCENE_GROTTOS", 11), + ("ENTR_GROTTOS_11_3", "SCENE_GROTTOS", 11), + ("ENTR_GROTTOS_12", "SCENE_GROTTOS", 12), + ("ENTR_GROTTOS_12_1", "SCENE_GROTTOS", 12), + ("ENTR_GROTTOS_12_2", "SCENE_GROTTOS", 12), + ("ENTR_GROTTOS_12_3", "SCENE_GROTTOS", 12), + ("ENTR_IMPAS_HOUSE_1", "SCENE_IMPAS_HOUSE", 1), + ("ENTR_IMPAS_HOUSE_1_1", "SCENE_IMPAS_HOUSE", 1), + ("ENTR_IMPAS_HOUSE_1_2", "SCENE_IMPAS_HOUSE", 1), + ("ENTR_IMPAS_HOUSE_1_3", "SCENE_IMPAS_HOUSE", 1), + ("ENTR_BOTTOM_OF_THE_WELL_1", "SCENE_BOTTOM_OF_THE_WELL", 1), + ("ENTR_BOTTOM_OF_THE_WELL_1_1", "SCENE_BOTTOM_OF_THE_WELL", 1), + ("ENTR_BOTTOM_OF_THE_WELL_1_2", "SCENE_BOTTOM_OF_THE_WELL", 1), + ("ENTR_BOTTOM_OF_THE_WELL_1_3", "SCENE_BOTTOM_OF_THE_WELL", 1), + ("ENTR_LON_LON_BUILDINGS_1", "SCENE_LON_LON_BUILDINGS", 1), + ("ENTR_LON_LON_BUILDINGS_1_1", "SCENE_LON_LON_BUILDINGS", 1), + ("ENTR_LON_LON_BUILDINGS_1_2", "SCENE_LON_LON_BUILDINGS", 1), + ("ENTR_LON_LON_BUILDINGS_1_3", "SCENE_LON_LON_BUILDINGS", 1), + ("ENTR_LON_LON_RANCH_10", "SCENE_LON_LON_RANCH", 10), + ("ENTR_LON_LON_RANCH_10_1", "SCENE_LON_LON_RANCH", 10), + ("ENTR_LON_LON_RANCH_10_2", "SCENE_LON_LON_RANCH", 10), + ("ENTR_LON_LON_RANCH_10_3", "SCENE_LON_LON_RANCH", 10), + ("ENTR_ICE_CAVERN_1", "SCENE_ICE_CAVERN", 1), + ("ENTR_ICE_CAVERN_1_1", "SCENE_ICE_CAVERN", 1), + ("ENTR_ICE_CAVERN_1_2", "SCENE_ICE_CAVERN", 1), + ("ENTR_ICE_CAVERN_1_3", "SCENE_ICE_CAVERN", 1), + ("ENTR_KAKARIKO_VILLAGE_15", "SCENE_KAKARIKO_VILLAGE", 15), + ("ENTR_KAKARIKO_VILLAGE_15_1", "SCENE_KAKARIKO_VILLAGE", 15), + ("ENTR_KAKARIKO_VILLAGE_15_2", "SCENE_KAKARIKO_VILLAGE", 15), + ("ENTR_KAKARIKO_VILLAGE_15_3", "SCENE_KAKARIKO_VILLAGE", 15), + ("ENTR_LOST_WOODS_9", "SCENE_LOST_WOODS", 9), + ("ENTR_LOST_WOODS_9_1", "SCENE_LOST_WOODS", 9), + ("ENTR_LOST_WOODS_9_2", "SCENE_LOST_WOODS", 9), + ("ENTR_LOST_WOODS_9_3", "SCENE_LOST_WOODS", 9), + ("ENTR_LON_LON_BUILDINGS_2", "SCENE_LON_LON_BUILDINGS", 2), + ("ENTR_LON_LON_BUILDINGS_2_1", "SCENE_LON_LON_BUILDINGS", 2), + ("ENTR_LON_LON_BUILDINGS_2_2", "SCENE_LON_LON_BUILDINGS", 2), + ("ENTR_LON_LON_BUILDINGS_2_3", "SCENE_LON_LON_BUILDINGS", 2), + ("ENTR_KOKIRI_FOREST_12", "SCENE_KOKIRI_FOREST", 12), + ("ENTR_KOKIRI_FOREST_12_1", "SCENE_KOKIRI_FOREST", 12), + ("ENTR_KOKIRI_FOREST_12_2", "SCENE_KOKIRI_FOREST", 12), + ("ENTR_KOKIRI_FOREST_12_3", "SCENE_KOKIRI_FOREST", 12), + ("ENTR_SPIRIT_TEMPLE_BOSS_2", "SCENE_SPIRIT_TEMPLE_BOSS", 2), + ("ENTR_SPIRIT_TEMPLE_BOSS_2_1", "SCENE_SPIRIT_TEMPLE_BOSS", 2), + ("ENTR_SPIRIT_TEMPLE_BOSS_2_2", "SCENE_SPIRIT_TEMPLE_BOSS", 2), + ("ENTR_SPIRIT_TEMPLE_BOSS_2_3", "SCENE_SPIRIT_TEMPLE_BOSS", 2), + ("ENTR_CASTLE_COURTYARD_ZELDA_1", "SCENE_CASTLE_COURTYARD_ZELDA", 1), + ("ENTR_CASTLE_COURTYARD_ZELDA_1_1", "SCENE_CASTLE_COURTYARD_ZELDA", 1), + ("ENTR_CASTLE_COURTYARD_ZELDA_1_2", "SCENE_CASTLE_COURTYARD_ZELDA", 1), + ("ENTR_CASTLE_COURTYARD_ZELDA_1_3", "SCENE_CASTLE_COURTYARD_ZELDA", 1), + ("ENTR_TEMPLE_OF_TIME_7", "SCENE_TEMPLE_OF_TIME", 7), + ("ENTR_TEMPLE_OF_TIME_7_1", "SCENE_TEMPLE_OF_TIME", 7), + ("ENTR_TEMPLE_OF_TIME_7_2", "SCENE_TEMPLE_OF_TIME", 7), + ("ENTR_TEMPLE_OF_TIME_7_3", "SCENE_TEMPLE_OF_TIME", 7), + ("ENTR_GERUDOS_FORTRESS_18", "SCENE_GERUDOS_FORTRESS", 18), + ("ENTR_GERUDOS_FORTRESS_18_1", "SCENE_GERUDOS_FORTRESS", 18), + ("ENTR_GERUDOS_FORTRESS_18_2", "SCENE_GERUDOS_FORTRESS", 18), + ("ENTR_GERUDOS_FORTRESS_18_3", "SCENE_GERUDOS_FORTRESS", 18), + ("ENTR_GROTTOS_13", "SCENE_GROTTOS", 13), + ("ENTR_GROTTOS_13_1", "SCENE_GROTTOS", 13), + ("ENTR_GROTTOS_13_2", "SCENE_GROTTOS", 13), + ("ENTR_GROTTOS_13_3", "SCENE_GROTTOS", 13), + ("ENTR_SACRED_FOREST_MEADOW_2", "SCENE_SACRED_FOREST_MEADOW", 2), + ("ENTR_SACRED_FOREST_MEADOW_2_1", "SCENE_SACRED_FOREST_MEADOW", 2), + ("ENTR_SACRED_FOREST_MEADOW_2_2", "SCENE_SACRED_FOREST_MEADOW", 2), + ("ENTR_SACRED_FOREST_MEADOW_2_3", "SCENE_SACRED_FOREST_MEADOW", 2), + ("ENTR_LAKE_HYLIA_8", "SCENE_LAKE_HYLIA", 8), + ("ENTR_LAKE_HYLIA_8_1", "SCENE_LAKE_HYLIA", 8), + ("ENTR_LAKE_HYLIA_8_2", "SCENE_LAKE_HYLIA", 8), + ("ENTR_LAKE_HYLIA_8_3", "SCENE_LAKE_HYLIA", 8), + ("ENTR_SACRED_FOREST_MEADOW_3", "SCENE_SACRED_FOREST_MEADOW", 3), + ("ENTR_SACRED_FOREST_MEADOW_3_1", "SCENE_SACRED_FOREST_MEADOW", 3), + ("ENTR_SACRED_FOREST_MEADOW_3_2", "SCENE_SACRED_FOREST_MEADOW", 3), + ("ENTR_SACRED_FOREST_MEADOW_3_3", "SCENE_SACRED_FOREST_MEADOW", 3), + ("ENTR_LAKE_HYLIA_9", "SCENE_LAKE_HYLIA", 9), + ("ENTR_LAKE_HYLIA_9_1", "SCENE_LAKE_HYLIA", 9), + ("ENTR_LAKE_HYLIA_9_2", "SCENE_LAKE_HYLIA", 9), + ("ENTR_LAKE_HYLIA_9_3", "SCENE_LAKE_HYLIA", 9), + ("ENTR_DESERT_COLOSSUS_8", "SCENE_DESERT_COLOSSUS", 8), + ("ENTR_DESERT_COLOSSUS_8_1", "SCENE_DESERT_COLOSSUS", 8), + ("ENTR_DESERT_COLOSSUS_8_2", "SCENE_DESERT_COLOSSUS", 8), + ("ENTR_DESERT_COLOSSUS_8_3", "SCENE_DESERT_COLOSSUS", 8), +) diff --git a/tools/assets/extract/oot64_data/misc_ids.py b/tools/assets/extract/oot64_data/misc_ids.py new file mode 100644 index 0000000000..69c118ebe6 --- /dev/null +++ b/tools/assets/extract/oot64_data/misc_ids.py @@ -0,0 +1,235 @@ +# This file was made manually + +SCENE_CAM_TYPES = { + 0: "SCENE_CAM_TYPE_DEFAULT", + 0x10: "SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT", + 0x20: "SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT", + 0x30: "SCENE_CAM_TYPE_FIXED", + 0x40: "SCENE_CAM_TYPE_FIXED_MARKET", + 0x50: "SCENE_CAM_TYPE_SHOOTING_GALLERY", +} + +ROOM_BEHAVIOR_TYPE1_NAMES = { + 0: "ROOM_TYPE_NORMAL", + 1: "ROOM_TYPE_DUNGEON", + 2: "ROOM_TYPE_INDOORS", + 3: "ROOM_TYPE_3", + 4: "ROOM_TYPE_4", + 5: "ROOM_TYPE_BOSS", +} + +ROOM_BEHAVIOR_TYPE2_NAMES = { + 0: "ROOM_ENV_DEFAULT", + 1: "ROOM_ENV_COLD", + 2: "ROOM_ENV_WARM", + 3: "ROOM_ENV_HOT", + 4: "ROOM_ENV_UNK_STRETCH_1", + 5: "ROOM_ENV_UNK_STRETCH_2", + 6: "ROOM_ENV_UNK_STRETCH_3", +} + +LENS_MODES = { + 0: "LENS_MODE_SHOW_ACTORS", + 1: "LENS_MODE_HIDE_ACTORS", +} + +CAMERA_SETTING_TYPES = { + 0x00: "CAM_SET_NONE", + 0x01: "CAM_SET_NORMAL0", + 0x02: "CAM_SET_NORMAL1", + 0x03: "CAM_SET_DUNGEON0", + 0x04: "CAM_SET_DUNGEON1", + 0x05: "CAM_SET_NORMAL3", + 0x06: "CAM_SET_HORSE", + 0x07: "CAM_SET_BOSS_GOHMA", + 0x08: "CAM_SET_BOSS_DODONGO", + 0x09: "CAM_SET_BOSS_BARINADE", + 0x0A: "CAM_SET_BOSS_PHANTOM_GANON", + 0x0B: "CAM_SET_BOSS_VOLVAGIA", + 0x0C: "CAM_SET_BOSS_BONGO", + 0x0D: "CAM_SET_BOSS_MORPHA", + 0x0E: "CAM_SET_BOSS_TWINROVA_PLATFORM", + 0x0F: "CAM_SET_BOSS_TWINROVA_FLOOR", + 0x10: "CAM_SET_BOSS_GANONDORF", + 0x11: "CAM_SET_BOSS_GANON", + 0x12: "CAM_SET_TOWER_CLIMB", + 0x13: "CAM_SET_TOWER_UNUSED", + 0x14: "CAM_SET_MARKET_BALCONY", + 0x15: "CAM_SET_CHU_BOWLING", + 0x16: "CAM_SET_PIVOT_CRAWLSPACE", + 0x17: "CAM_SET_PIVOT_SHOP_BROWSING", + 0x18: "CAM_SET_PIVOT_IN_FRONT", + 0x19: "CAM_SET_PREREND_FIXED", + 0x1A: "CAM_SET_PREREND_PIVOT", + 0x1B: "CAM_SET_PREREND_SIDE_SCROLL", + 0x1C: "CAM_SET_DOOR0", + 0x1D: "CAM_SET_DOORC", + 0x1E: "CAM_SET_CRAWLSPACE", + 0x1F: "CAM_SET_START0", + 0x20: "CAM_SET_START1", + 0x21: "CAM_SET_FREE0", + 0x22: "CAM_SET_FREE2", + 0x23: "CAM_SET_PIVOT_CORNER", + 0x24: "CAM_SET_PIVOT_WATER_SURFACE", + 0x25: "CAM_SET_CS_0", + 0x26: "CAM_SET_CS_TWISTED_HALLWAY", + 0x27: "CAM_SET_FOREST_BIRDS_EYE", + 0x28: "CAM_SET_SLOW_CHEST_CS", + 0x29: "CAM_SET_ITEM_UNUSED", + 0x2A: "CAM_SET_CS_3", + 0x2B: "CAM_SET_CS_ATTENTION", + 0x2C: "CAM_SET_BEAN_GENERIC", + 0x2D: "CAM_SET_BEAN_LOST_WOODS", + 0x2E: "CAM_SET_SCENE_UNUSED", + 0x2F: "CAM_SET_SCENE_TRANSITION", + 0x30: "CAM_SET_ELEVATOR_PLATFORM", + 0x31: "CAM_SET_FIRE_STAIRCASE", + 0x32: "CAM_SET_FOREST_UNUSED", + 0x33: "CAM_SET_FOREST_DEFEAT_POE", + 0x34: "CAM_SET_BIG_OCTO", + 0x35: "CAM_SET_MEADOW_BIRDS_EYE", + 0x36: "CAM_SET_MEADOW_UNUSED", + 0x37: "CAM_SET_FIRE_BIRDS_EYE", + 0x38: "CAM_SET_TURN_AROUND", + 0x39: "CAM_SET_PIVOT_VERTICAL", + 0x3A: "CAM_SET_NORMAL2", + 0x3B: "CAM_SET_FISHING", + 0x3C: "CAM_SET_CS_C", + 0x3D: "CAM_SET_JABU_TENTACLE", + 0x3E: "CAM_SET_DUNGEON2", + 0x3F: "CAM_SET_DIRECTED_YAW", + 0x40: "CAM_SET_PIVOT_FROM_SIDE", + 0x41: "CAM_SET_NORMAL4", +} + +SKIN_LIMB_TYPES = { + 4: "SKIN_LIMB_TYPE_ANIMATED", + 11: "SKIN_LIMB_TYPE_NORMAL", +} + +ROOM_SHAPE_TYPE = { + 0: "ROOM_SHAPE_TYPE_NORMAL", + 1: "ROOM_SHAPE_TYPE_IMAGE", + 2: "ROOM_SHAPE_TYPE_CULLABLE", +} + +ROOM_SHAPE_IMAGE_AMOUNT_TYPE = { + 1: "ROOM_SHAPE_IMAGE_AMOUNT_SINGLE", + 2: "ROOM_SHAPE_IMAGE_AMOUNT_MULTI", +} + +SKYBOX_IDS = { + 0x00: "SKYBOX_NONE", + 0x01: "SKYBOX_NORMAL_SKY", + 0x02: "SKYBOX_BAZAAR", + 0x03: "SKYBOX_OVERCAST_SUNSET", + 0x04: "SKYBOX_MARKET_ADULT", + 0x05: "SKYBOX_CUTSCENE_MAP", + 0x07: "SKYBOX_HOUSE_LINK", + 0x09: "SKYBOX_MARKET_CHILD_DAY", + 0x0A: "SKYBOX_MARKET_CHILD_NIGHT", + 0x0B: "SKYBOX_HAPPY_MASK_SHOP", + 0x0C: "SKYBOX_HOUSE_KNOW_IT_ALL_BROTHERS", + 0x0E: "SKYBOX_HOUSE_OF_TWINS", + 0x0F: "SKYBOX_STABLES", + 0x10: "SKYBOX_HOUSE_KAKARIKO", + 0x11: "SKYBOX_KOKIRI_SHOP", + 0x13: "SKYBOX_GORON_SHOP", + 0x14: "SKYBOX_ZORA_SHOP", + 0x16: "SKYBOX_POTION_SHOP_KAKARIKO", + 0x17: "SKYBOX_POTION_SHOP_MARKET", + 0x18: "SKYBOX_BOMBCHU_SHOP", + 0x1A: "SKYBOX_HOUSE_RICHARD", + 0x1B: "SKYBOX_HOUSE_IMPA", + 0x1C: "SKYBOX_TENT", + 0x1D: "SKYBOX_UNSET_1D", + 0x20: "SKYBOX_HOUSE_MIDO", + 0x21: "SKYBOX_HOUSE_SARIA", + 0x22: "SKYBOX_HOUSE_ALLEY", + 0x27: "SKYBOX_UNSET_27", +} + +LIGHT_MODES = { + 0: "LIGHT_MODE_TIME", + 1: "LIGHT_MODE_SETTINGS", +} + +NAVI_QUEST_HINT_FILE_IDS = { + 0: "NAVI_QUEST_HINTS_NONE", + 1: "NAVI_QUEST_HINTS_OVERWORLD", + 2: "NAVI_QUEST_HINTS_DUNGEON", +} + +FLOOR_TYPES = { + 0: "FLOOR_TYPE_0", + 1: "FLOOR_TYPE_1", + 2: "FLOOR_TYPE_2", + 3: "FLOOR_TYPE_3", + 4: "FLOOR_TYPE_4", + 5: "FLOOR_TYPE_5", + 6: "FLOOR_TYPE_6", + 7: "FLOOR_TYPE_7", + 8: "FLOOR_TYPE_8", + 9: "FLOOR_TYPE_9", + 10: "FLOOR_TYPE_10", + 11: "FLOOR_TYPE_11", + 12: "FLOOR_TYPE_12", +} + +WALL_TYPES = { + 0: "WALL_TYPE_0", + 1: "WALL_TYPE_1", + 2: "WALL_TYPE_2", + 3: "WALL_TYPE_3", + 4: "WALL_TYPE_4", + 5: "WALL_TYPE_5", + 6: "WALL_TYPE_6", + 7: "WALL_TYPE_7", + 8: "WALL_TYPE_8", + 9: "WALL_TYPE_9", + 10: "WALL_TYPE_10", + 11: "WALL_TYPE_11", + 12: "WALL_TYPE_12", +} + +FLOOR_PROPERTIES = { + 0: "FLOOR_PROPERTY_0", + 5: "FLOOR_PROPERTY_5", + 6: "FLOOR_PROPERTY_6", + 7: "FLOOR_PROPERTY_7", + 8: "FLOOR_PROPERTY_8", + 9: "FLOOR_PROPERTY_9", + 11: "FLOOR_PROPERTY_11", + 12: "FLOOR_PROPERTY_12", +} + +SURFACE_MATERIALS = { + 0: "SURFACE_MATERIAL_DIRT", + 1: "SURFACE_MATERIAL_SAND", + 2: "SURFACE_MATERIAL_STONE", + 3: "SURFACE_MATERIAL_JABU", + 4: "SURFACE_MATERIAL_WATER_SHALLOW", + 5: "SURFACE_MATERIAL_WATER_DEEP", + 6: "SURFACE_MATERIAL_TALL_GRASS", + 7: "SURFACE_MATERIAL_LAVA", + 8: "SURFACE_MATERIAL_GRASS", + 9: "SURFACE_MATERIAL_BRIDGE", + 10: "SURFACE_MATERIAL_WOOD", + 11: "SURFACE_MATERIAL_DIRT_SOFT", + 12: "SURFACE_MATERIAL_ICE", + 13: "SURFACE_MATERIAL_CARPET", + 14: "SURFACE_MATERIAL_MAX", +} + +FLOOR_EFFECTS = { + 0: "FLOOR_EFFECT_0", + 1: "FLOOR_EFFECT_1", + 2: "FLOOR_EFFECT_2", +} + +CONVEYOR_SPEEDS = { + 0: "CONVEYOR_SPEED_DISABLED", + 1: "CONVEYOR_SPEED_SLOW", + 2: "CONVEYOR_SPEED_MEDIUM", + 3: "CONVEYOR_SPEED_FAST", +} diff --git a/tools/assets/extract/oot64_data/object_ids.py b/tools/assets/extract/oot64_data/object_ids.py new file mode 100644 index 0000000000..2db79aa5c1 --- /dev/null +++ b/tools/assets/extract/oot64_data/object_ids.py @@ -0,0 +1,406 @@ +# This file was generated from ../../../..//include/tables/object_table.h + +DATA = ( + "OBJECT_INVALID", + "OBJECT_GAMEPLAY_KEEP", + "OBJECT_GAMEPLAY_FIELD_KEEP", + "OBJECT_GAMEPLAY_DANGEON_KEEP", + "OBJECT_UNSET_4", + "OBJECT_UNSET_5", + "OBJECT_HUMAN", + "OBJECT_OKUTA", + "OBJECT_CROW", + "OBJECT_POH", + "OBJECT_DY_OBJ", + "OBJECT_WALLMASTER", + "OBJECT_DODONGO", + "OBJECT_FIREFLY", + "OBJECT_BOX", + "OBJECT_FIRE", + "OBJECT_UNSET_10", + "OBJECT_UNSET_11", + "OBJECT_BUBBLE", + "OBJECT_NIW", + "OBJECT_LINK_BOY", + "OBJECT_LINK_CHILD", + "OBJECT_TITE", + "OBJECT_REEBA", + "OBJECT_PEEHAT", + "OBJECT_KINGDODONGO", + "OBJECT_HORSE", + "OBJECT_ZF", + "OBJECT_GOMA", + "OBJECT_ZL1", + "OBJECT_GOL", + "OBJECT_DODOJR", + "OBJECT_TORCH2", + "OBJECT_BL", + "OBJECT_TP", + "OBJECT_OA1", + "OBJECT_ST", + "OBJECT_BW", + "OBJECT_EI", + "OBJECT_HORSE_NORMAL", + "OBJECT_OB1", + "OBJECT_O_ANIME", + "OBJECT_SPOT04_OBJECTS", + "OBJECT_DDAN_OBJECTS", + "OBJECT_HIDAN_OBJECTS", + "OBJECT_HORSE_GANON", + "OBJECT_OA2", + "OBJECT_SPOT00_OBJECTS", + "OBJECT_MB", + "OBJECT_BOMBF", + "OBJECT_SK2", + "OBJECT_OE1", + "OBJECT_OE_ANIME", + "OBJECT_OE2", + "OBJECT_YDAN_OBJECTS", + "OBJECT_GND", + "OBJECT_AM", + "OBJECT_DEKUBABA", + "OBJECT_UNSET_3A", + "OBJECT_OA3", + "OBJECT_OA4", + "OBJECT_OA5", + "OBJECT_OA6", + "OBJECT_OA7", + "OBJECT_JJ", + "OBJECT_OA8", + "OBJECT_OA9", + "OBJECT_OB2", + "OBJECT_OB3", + "OBJECT_OB4", + "OBJECT_HORSE_ZELDA", + "OBJECT_OPENING_DEMO1", + "OBJECT_WARP1", + "OBJECT_B_HEART", + "OBJECT_DEKUNUTS", + "OBJECT_OE3", + "OBJECT_OE4", + "OBJECT_MENKURI_OBJECTS", + "OBJECT_OE5", + "OBJECT_OE6", + "OBJECT_OE7", + "OBJECT_OE8", + "OBJECT_OE9", + "OBJECT_OE10", + "OBJECT_OE11", + "OBJECT_OE12", + "OBJECT_VALI", + "OBJECT_OA10", + "OBJECT_OA11", + "OBJECT_MIZU_OBJECTS", + "OBJECT_FHG", + "OBJECT_OSSAN", + "OBJECT_MORI_HINERI1", + "OBJECT_BB", + "OBJECT_TOKI_OBJECTS", + "OBJECT_YUKABYUN", + "OBJECT_ZL2", + "OBJECT_MJIN", + "OBJECT_MJIN_FLASH", + "OBJECT_MJIN_DARK", + "OBJECT_MJIN_FLAME", + "OBJECT_MJIN_ICE", + "OBJECT_MJIN_SOUL", + "OBJECT_MJIN_WIND", + "OBJECT_MJIN_OKA", + "OBJECT_HAKA_OBJECTS", + "OBJECT_SPOT06_OBJECTS", + "OBJECT_ICE_OBJECTS", + "OBJECT_RELAY_OBJECTS", + "OBJECT_PO_FIELD", + "OBJECT_PO_COMPOSER", + "OBJECT_MORI_HINERI1A", + "OBJECT_MORI_HINERI2", + "OBJECT_MORI_HINERI2A", + "OBJECT_MORI_OBJECTS", + "OBJECT_MORI_TEX", + "OBJECT_SPOT08_OBJ", + "OBJECT_WARP2", + "OBJECT_HATA", + "OBJECT_BIRD", + "OBJECT_UNSET_78", + "OBJECT_UNSET_79", + "OBJECT_UNSET_7A", + "OBJECT_UNSET_7B", + "OBJECT_WOOD02", + "OBJECT_UNSET_7D", + "OBJECT_UNSET_7E", + "OBJECT_UNSET_7F", + "OBJECT_UNSET_80", + "OBJECT_LIGHTBOX", + "OBJECT_PU_BOX", + "OBJECT_UNSET_83", + "OBJECT_UNSET_84", + "OBJECT_TRAP", + "OBJECT_VASE", + "OBJECT_IM", + "OBJECT_TA", + "OBJECT_TK", + "OBJECT_XC", + "OBJECT_VM", + "OBJECT_BV", + "OBJECT_HAKACH_OBJECTS", + "OBJECT_EFC_CRYSTAL_LIGHT", + "OBJECT_EFC_FIRE_BALL", + "OBJECT_EFC_FLASH", + "OBJECT_EFC_LGT_SHOWER", + "OBJECT_EFC_STAR_FIELD", + "OBJECT_GOD_LGT", + "OBJECT_LIGHT_RING", + "OBJECT_TRIFORCE_SPOT", + "OBJECT_BDAN_OBJECTS", + "OBJECT_SD", + "OBJECT_RD", + "OBJECT_PO_SISTERS", + "OBJECT_HEAVY_OBJECT", + "OBJECT_GNDD", + "OBJECT_FD", + "OBJECT_DU", + "OBJECT_FW", + "OBJECT_MEDAL", + "OBJECT_HORSE_LINK_CHILD", + "OBJECT_SPOT02_OBJECTS", + "OBJECT_HAKA", + "OBJECT_RU1", + "OBJECT_SYOKUDAI", + "OBJECT_FD2", + "OBJECT_DH", + "OBJECT_RL", + "OBJECT_EFC_TW", + "OBJECT_DEMO_TRE_LGT", + "OBJECT_GI_KEY", + "OBJECT_MIR_RAY", + "OBJECT_BROB", + "OBJECT_GI_JEWEL", + "OBJECT_SPOT09_OBJ", + "OBJECT_SPOT18_OBJ", + "OBJECT_BDOOR", + "OBJECT_SPOT17_OBJ", + "OBJECT_SHOP_DUNGEN", + "OBJECT_NB", + "OBJECT_MO", + "OBJECT_SB", + "OBJECT_GI_MELODY", + "OBJECT_GI_HEART", + "OBJECT_GI_COMPASS", + "OBJECT_GI_BOSSKEY", + "OBJECT_GI_MEDAL", + "OBJECT_GI_NUTS", + "OBJECT_SA", + "OBJECT_GI_HEARTS", + "OBJECT_GI_ARROWCASE", + "OBJECT_GI_BOMBPOUCH", + "OBJECT_IN", + "OBJECT_TR", + "OBJECT_SPOT16_OBJ", + "OBJECT_OE1S", + "OBJECT_OE4S", + "OBJECT_OS_ANIME", + "OBJECT_GI_BOTTLE", + "OBJECT_GI_STICK", + "OBJECT_GI_MAP", + "OBJECT_OF1D_MAP", + "OBJECT_RU2", + "OBJECT_GI_SHIELD_1", + "OBJECT_DEKUJR", + "OBJECT_GI_MAGICPOT", + "OBJECT_GI_BOMB_1", + "OBJECT_OF1S", + "OBJECT_MA2", + "OBJECT_GI_PURSE", + "OBJECT_HNI", + "OBJECT_TW", + "OBJECT_RR", + "OBJECT_BXA", + "OBJECT_ANUBICE", + "OBJECT_GI_GERUDO", + "OBJECT_GI_ARROW", + "OBJECT_GI_BOMB_2", + "OBJECT_GI_EGG", + "OBJECT_GI_SCALE", + "OBJECT_GI_SHIELD_2", + "OBJECT_GI_HOOKSHOT", + "OBJECT_GI_OCARINA", + "OBJECT_GI_MILK", + "OBJECT_MA1", + "OBJECT_GANON", + "OBJECT_SST", + "OBJECT_NY_UNUSED", + "OBJECT_UNSET_E4", + "OBJECT_NY", + "OBJECT_FR", + "OBJECT_GI_PACHINKO", + "OBJECT_GI_BOOMERANG", + "OBJECT_GI_BOW", + "OBJECT_GI_GLASSES", + "OBJECT_GI_LIQUID", + "OBJECT_ANI", + "OBJECT_DEMO_6K", + "OBJECT_GI_SHIELD_3", + "OBJECT_GI_LETTER", + "OBJECT_SPOT15_OBJ", + "OBJECT_JYA_OBJ", + "OBJECT_GI_CLOTHES", + "OBJECT_GI_BEAN", + "OBJECT_GI_FISH", + "OBJECT_GI_SAW", + "OBJECT_GI_HAMMER", + "OBJECT_GI_GRASS", + "OBJECT_GI_LONGSWORD", + "OBJECT_SPOT01_OBJECTS", + "OBJECT_MD_UNUSED", + "OBJECT_MD", + "OBJECT_KM1", + "OBJECT_KW1", + "OBJECT_ZO", + "OBJECT_KZ", + "OBJECT_UMAJUMP", + "OBJECT_MASTERKOKIRI", + "OBJECT_MASTERKOKIRIHEAD", + "OBJECT_MASTERGOLON", + "OBJECT_MASTERZOORA", + "OBJECT_AOB", + "OBJECT_IK", + "OBJECT_AHG", + "OBJECT_CNE", + "OBJECT_GI_NIWATORI", + "OBJECT_SKJ", + "OBJECT_GI_BOTTLE_LETTER", + "OBJECT_BJI", + "OBJECT_BBA", + "OBJECT_GI_OCARINA_0", + "OBJECT_DS", + "OBJECT_ANE", + "OBJECT_BOJ", + "OBJECT_SPOT03_OBJECT", + "OBJECT_SPOT07_OBJECT", + "OBJECT_FZ", + "OBJECT_BOB", + "OBJECT_GE1", + "OBJECT_YABUSAME_POINT", + "OBJECT_GI_BOOTS_2", + "OBJECT_GI_SEED", + "OBJECT_GND_MAGIC", + "OBJECT_D_ELEVATOR", + "OBJECT_D_HSBLOCK", + "OBJECT_D_LIFT", + "OBJECT_MAMENOKI", + "OBJECT_GOROIWA", + "OBJECT_UNSET_120", + "OBJECT_TORYO", + "OBJECT_DAIKU", + "OBJECT_UNSET_123", + "OBJECT_NWC", + "OBJECT_BLKOBJ", + "OBJECT_GM", + "OBJECT_MS", + "OBJECT_HS", + "OBJECT_INGATE", + "OBJECT_LIGHTSWITCH", + "OBJECT_KUSA", + "OBJECT_TSUBO", + "OBJECT_GI_GLOVES", + "OBJECT_GI_COIN", + "OBJECT_KANBAN", + "OBJECT_GJYO_OBJECTS", + "OBJECT_OWL", + "OBJECT_MK", + "OBJECT_FU", + "OBJECT_GI_KI_TAN_MASK", + "OBJECT_GI_REDEAD_MASK", + "OBJECT_GI_SKJ_MASK", + "OBJECT_GI_RABIT_MASK", + "OBJECT_GI_TRUTH_MASK", + "OBJECT_GANON_OBJECTS", + "OBJECT_SIOFUKI", + "OBJECT_STREAM", + "OBJECT_MM", + "OBJECT_FA", + "OBJECT_OS", + "OBJECT_GI_EYE_LOTION", + "OBJECT_GI_POWDER", + "OBJECT_GI_MUSHROOM", + "OBJECT_GI_TICKETSTONE", + "OBJECT_GI_BROKENSWORD", + "OBJECT_JS", + "OBJECT_CS", + "OBJECT_GI_PRESCRIPTION", + "OBJECT_GI_BRACELET", + "OBJECT_GI_SOLDOUT", + "OBJECT_GI_FROG", + "OBJECT_MAG", + "OBJECT_DOOR_GERUDO", + "OBJECT_GT", + "OBJECT_EFC_ERUPC", + "OBJECT_ZL2_ANIME1", + "OBJECT_ZL2_ANIME2", + "OBJECT_GI_GOLONMASK", + "OBJECT_GI_ZORAMASK", + "OBJECT_GI_GERUDOMASK", + "OBJECT_GANON2", + "OBJECT_KA", + "OBJECT_TS", + "OBJECT_ZG", + "OBJECT_GI_HOVERBOOTS", + "OBJECT_GI_M_ARROW", + "OBJECT_DS2", + "OBJECT_EC", + "OBJECT_FISH", + "OBJECT_GI_SUTARU", + "OBJECT_GI_GODDESS", + "OBJECT_SSH", + "OBJECT_BIGOKUTA", + "OBJECT_BG", + "OBJECT_SPOT05_OBJECTS", + "OBJECT_SPOT12_OBJ", + "OBJECT_BOMBIWA", + "OBJECT_HINTNUTS", + "OBJECT_RS", + "OBJECT_SPOT00_BREAK", + "OBJECT_GLA", + "OBJECT_SHOPNUTS", + "OBJECT_GELDB", + "OBJECT_GR", + "OBJECT_DOG", + "OBJECT_JYA_IRON", + "OBJECT_JYA_DOOR", + "OBJECT_UNSET_16E", + "OBJECT_SPOT11_OBJ", + "OBJECT_KIBAKO2", + "OBJECT_DNS", + "OBJECT_DNK", + "OBJECT_GI_FIRE", + "OBJECT_GI_INSECT", + "OBJECT_GI_BUTTERFLY", + "OBJECT_GI_GHOST", + "OBJECT_GI_SOUL", + "OBJECT_BOWL", + "OBJECT_DEMO_KEKKAI", + "OBJECT_EFC_DOUGHNUT", + "OBJECT_GI_DEKUPOUCH", + "OBJECT_GANON_ANIME1", + "OBJECT_GANON_ANIME2", + "OBJECT_GANON_ANIME3", + "OBJECT_GI_RUPY", + "OBJECT_SPOT01_MATOYA", + "OBJECT_SPOT01_MATOYAB", + "OBJECT_MU", + "OBJECT_WF", + "OBJECT_SKB", + "OBJECT_GJ", + "OBJECT_GEFF", + "OBJECT_HAKA_DOOR", + "OBJECT_GS", + "OBJECT_PS", + "OBJECT_BWALL", + "OBJECT_COW", + "OBJECT_COB", + "OBJECT_GI_SWORD_1", + "OBJECT_DOOR_KILLER", + "OBJECT_OUKE_HAKA", + "OBJECT_TIMEBLOCK", + "OBJECT_ZL4", +) diff --git a/tools/assets/extract/oot64_data/scene_table_mini.py b/tools/assets/extract/oot64_data/scene_table_mini.py new file mode 100644 index 0000000000..682ee8fd38 --- /dev/null +++ b/tools/assets/extract/oot64_data/scene_table_mini.py @@ -0,0 +1,114 @@ +# This file was generated from ../../../..//include/tables/scene_table.h + +DATA = ( + ("ydan_scene", "SCENE_DEKU_TREE"), + ("ddan_scene", "SCENE_DODONGOS_CAVERN"), + ("bdan_scene", "SCENE_JABU_JABU"), + ("Bmori1_scene", "SCENE_FOREST_TEMPLE"), + ("HIDAN_scene", "SCENE_FIRE_TEMPLE"), + ("MIZUsin_scene", "SCENE_WATER_TEMPLE"), + ("jyasinzou_scene", "SCENE_SPIRIT_TEMPLE"), + ("HAKAdan_scene", "SCENE_SHADOW_TEMPLE"), + ("HAKAdanCH_scene", "SCENE_BOTTOM_OF_THE_WELL"), + ("ice_doukutu_scene", "SCENE_ICE_CAVERN"), + ("ganon_scene", "SCENE_GANONS_TOWER"), + ("men_scene", "SCENE_GERUDO_TRAINING_GROUND"), + ("gerudoway_scene", "SCENE_THIEVES_HIDEOUT"), + ("ganontika_scene", "SCENE_INSIDE_GANONS_CASTLE"), + ("ganon_sonogo_scene", "SCENE_GANONS_TOWER_COLLAPSE_INTERIOR"), + ("ganontikasonogo_scene", "SCENE_INSIDE_GANONS_CASTLE_COLLAPSE"), + ("takaraya_scene", "SCENE_TREASURE_BOX_SHOP"), + ("ydan_boss_scene", "SCENE_DEKU_TREE_BOSS"), + ("ddan_boss_scene", "SCENE_DODONGOS_CAVERN_BOSS"), + ("bdan_boss_scene", "SCENE_JABU_JABU_BOSS"), + ("moribossroom_scene", "SCENE_FOREST_TEMPLE_BOSS"), + ("FIRE_bs_scene", "SCENE_FIRE_TEMPLE_BOSS"), + ("MIZUsin_bs_scene", "SCENE_WATER_TEMPLE_BOSS"), + ("jyasinboss_scene", "SCENE_SPIRIT_TEMPLE_BOSS"), + ("HAKAdan_bs_scene", "SCENE_SHADOW_TEMPLE_BOSS"), + ("ganon_boss_scene", "SCENE_GANONDORF_BOSS"), + ("ganon_final_scene", "SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR"), + ("entra_scene", "SCENE_MARKET_ENTRANCE_DAY"), + ("entra_n_scene", "SCENE_MARKET_ENTRANCE_NIGHT"), + ("enrui_scene", "SCENE_MARKET_ENTRANCE_RUINS"), + ("market_alley_scene", "SCENE_BACK_ALLEY_DAY"), + ("market_alley_n_scene", "SCENE_BACK_ALLEY_NIGHT"), + ("market_day_scene", "SCENE_MARKET_DAY"), + ("market_night_scene", "SCENE_MARKET_NIGHT"), + ("market_ruins_scene", "SCENE_MARKET_RUINS"), + ("shrine_scene", "SCENE_TEMPLE_OF_TIME_EXTERIOR_DAY"), + ("shrine_n_scene", "SCENE_TEMPLE_OF_TIME_EXTERIOR_NIGHT"), + ("shrine_r_scene", "SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS"), + ("kokiri_home_scene", "SCENE_KNOW_IT_ALL_BROS_HOUSE"), + ("kokiri_home3_scene", "SCENE_TWINS_HOUSE"), + ("kokiri_home4_scene", "SCENE_MIDOS_HOUSE"), + ("kokiri_home5_scene", "SCENE_SARIAS_HOUSE"), + ("kakariko_scene", "SCENE_KAKARIKO_CENTER_GUEST_HOUSE"), + ("kakariko3_scene", "SCENE_BACK_ALLEY_HOUSE"), + ("shop1_scene", "SCENE_BAZAAR"), + ("kokiri_shop_scene", "SCENE_KOKIRI_SHOP"), + ("golon_scene", "SCENE_GORON_SHOP"), + ("zoora_scene", "SCENE_ZORA_SHOP"), + ("drag_scene", "SCENE_POTION_SHOP_KAKARIKO"), + ("alley_shop_scene", "SCENE_POTION_SHOP_MARKET"), + ("night_shop_scene", "SCENE_BOMBCHU_SHOP"), + ("face_shop_scene", "SCENE_HAPPY_MASK_SHOP"), + ("link_home_scene", "SCENE_LINKS_HOUSE"), + ("impa_scene", "SCENE_DOG_LADY_HOUSE"), + ("malon_stable_scene", "SCENE_STABLE"), + ("labo_scene", "SCENE_IMPAS_HOUSE"), + ("hylia_labo_scene", "SCENE_LAKESIDE_LABORATORY"), + ("tent_scene", "SCENE_CARPENTERS_TENT"), + ("hut_scene", "SCENE_GRAVEKEEPERS_HUT"), + ("daiyousei_izumi_scene", "SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC"), + ("yousei_izumi_tate_scene", "SCENE_FAIRYS_FOUNTAIN"), + ("yousei_izumi_yoko_scene", "SCENE_GREAT_FAIRYS_FOUNTAIN_SPELLS"), + ("kakusiana_scene", "SCENE_GROTTOS"), + ("hakaana_scene", "SCENE_REDEAD_GRAVE"), + ("hakaana2_scene", "SCENE_GRAVE_WITH_FAIRYS_FOUNTAIN"), + ("hakaana_ouke_scene", "SCENE_ROYAL_FAMILYS_TOMB"), + ("syatekijyou_scene", "SCENE_SHOOTING_GALLERY"), + ("tokinoma_scene", "SCENE_TEMPLE_OF_TIME"), + ("kenjyanoma_scene", "SCENE_CHAMBER_OF_THE_SAGES"), + ("hairal_niwa_scene", "SCENE_CASTLE_COURTYARD_GUARDS_DAY"), + ("hairal_niwa_n_scene", "SCENE_CASTLE_COURTYARD_GUARDS_NIGHT"), + ("hiral_demo_scene", "SCENE_CUTSCENE_MAP"), + ("hakasitarelay_scene", "SCENE_WINDMILL_AND_DAMPES_GRAVE"), + ("turibori_scene", "SCENE_FISHING_POND"), + ("nakaniwa_scene", "SCENE_CASTLE_COURTYARD_ZELDA"), + ("bowling_scene", "SCENE_BOMBCHU_BOWLING_ALLEY"), + ("souko_scene", "SCENE_LON_LON_BUILDINGS"), + ("miharigoya_scene", "SCENE_MARKET_GUARD_HOUSE"), + ("mahouya_scene", "SCENE_POTION_SHOP_GRANNY"), + ("ganon_demo_scene", "SCENE_GANON_BOSS"), + ("kinsuta_scene", "SCENE_HOUSE_OF_SKULLTULA"), + ("spot00_scene", "SCENE_HYRULE_FIELD"), + ("spot01_scene", "SCENE_KAKARIKO_VILLAGE"), + ("spot02_scene", "SCENE_GRAVEYARD"), + ("spot03_scene", "SCENE_ZORAS_RIVER"), + ("spot04_scene", "SCENE_KOKIRI_FOREST"), + ("spot05_scene", "SCENE_SACRED_FOREST_MEADOW"), + ("spot06_scene", "SCENE_LAKE_HYLIA"), + ("spot07_scene", "SCENE_ZORAS_DOMAIN"), + ("spot08_scene", "SCENE_ZORAS_FOUNTAIN"), + ("spot09_scene", "SCENE_GERUDO_VALLEY"), + ("spot10_scene", "SCENE_LOST_WOODS"), + ("spot11_scene", "SCENE_DESERT_COLOSSUS"), + ("spot12_scene", "SCENE_GERUDOS_FORTRESS"), + ("spot13_scene", "SCENE_HAUNTED_WASTELAND"), + ("spot15_scene", "SCENE_HYRULE_CASTLE"), + ("spot16_scene", "SCENE_DEATH_MOUNTAIN_TRAIL"), + ("spot17_scene", "SCENE_DEATH_MOUNTAIN_CRATER"), + ("spot18_scene", "SCENE_GORON_CITY"), + ("spot20_scene", "SCENE_LON_LON_RANCH"), + ("ganon_tou_scene", "SCENE_OUTSIDE_GANONS_CASTLE"), + ("test01_scene", "SCENE_TEST01"), + ("besitu_scene", "SCENE_BESITU"), + ("depth_test_scene", "SCENE_DEPTH_TEST"), + ("syotes_scene", "SCENE_SYOTES"), + ("syotes2_scene", "SCENE_SYOTES2"), + ("sutaru_scene", "SCENE_SUTARU"), + ("hairal_niwa2_scene", "SCENE_HAIRAL_NIWA2"), + ("sasatest_scene", "SCENE_SASATEST"), + ("testroom_scene", "SCENE_TESTROOM"), +) diff --git a/tools/assets/extract/write_source.txt b/tools/assets/extract/write_source.txt new file mode 100644 index 0000000000..5d19b2a10a --- /dev/null +++ b/tools/assets/extract/write_source.txt @@ -0,0 +1,998 @@ +assets/code/fbdemo_circle/code.c +assets/code/fbdemo_triforce/code.c +assets/code/fbdemo_wipe1/code.c +assets/misc/link_animetion/link_animetion.c +assets/misc/z_select_static/z_select_static.c +assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.c +assets/objects/gameplay_field_keep/gameplay_field_keep.c +assets/objects/gameplay_keep/gameplay_keep.c +assets/objects/object_ahg/object_ahg.c +assets/objects/object_am/object_am.c +assets/objects/object_ane/object_ane.c +assets/objects/object_ani/object_ani.c +assets/objects/object_anubice/object_anubice.c +assets/objects/object_aob/object_aob.c +assets/objects/object_bba/object_bba.c +assets/objects/object_Bb/object_Bb.c +assets/objects/object_bdan_objects/object_bdan_objects.c +assets/objects/object_bdoor/object_bdoor.c +assets/objects/object_bg/object_bg.c +assets/objects/object_b_heart/object_b_heart.c +assets/objects/object_bigokuta/object_bigokuta.c +assets/objects/object_bird/object_bird.c +assets/objects/object_bji/object_bji.c +assets/objects/object_blkobj/object_blkobj.c +assets/objects/object_bl/object_bl.c +assets/objects/object_bob/object_bob.c +assets/objects/object_boj/object_boj.c +assets/objects/object_bombf/object_bombf.c +assets/objects/object_bombiwa/object_bombiwa.c +assets/objects/object_bowl/object_bowl.c +assets/objects/object_box/object_box.c +assets/objects/object_brob/object_brob.c +assets/objects/object_bubble/object_bubble.c +assets/objects/object_bv/object_bv.c +assets/objects/object_bwall/object_bwall.c +assets/objects/object_bw/object_bw.c +assets/objects/object_bxa/object_bxa.c +assets/objects/object_cne/object_cne.c +assets/objects/object_cob/object_cob.c +assets/objects/object_cow/object_cow.c +assets/objects/object_crow/object_crow.c +assets/objects/object_cs/object_cs.c +assets/objects/object_daiku/object_daiku.c +assets/objects/object_ddan_objects/object_ddan_objects.c +assets/objects/object_dekubaba/object_dekubaba.c +assets/objects/object_dekujr/object_dekujr.c +assets/objects/object_dekunuts/object_dekunuts.c +assets/objects/object_d_elevator/object_d_elevator.c +assets/objects/object_demo_6k/object_demo_6k.c +assets/objects/object_demo_kekkai/object_demo_kekkai.c +assets/objects/object_demo_tre_lgt/object_demo_tre_lgt.c +assets/objects/object_dh/object_dh.c +assets/objects/object_d_hsblock/object_d_hsblock.c +assets/objects/object_d_lift/object_d_lift.c +assets/objects/object_dnk/object_dnk.c +assets/objects/object_dns/object_dns.c +assets/objects/object_dodojr/object_dodojr.c +assets/objects/object_dodongo/object_dodongo.c +assets/objects/object_dog/object_dog.c +assets/objects/object_door_gerudo/object_door_gerudo.c +assets/objects/object_door_killer/object_door_killer.c +assets/objects/object_ds2/object_ds2.c +assets/objects/object_ds/object_ds.c +assets/objects/object_du/object_du.c +assets/objects/object_dy_obj/object_dy_obj.c +assets/objects/object_ec/object_ec.c +assets/objects/object_efc_crystal_light/object_efc_crystal_light.c +assets/objects/object_efc_doughnut/object_efc_doughnut.c +assets/objects/object_efc_erupc/object_efc_erupc.c +assets/objects/object_efc_fire_ball/object_efc_fire_ball.c +assets/objects/object_efc_flash/object_efc_flash.c +assets/objects/object_efc_lgt_shower/object_efc_lgt_shower.c +assets/objects/object_efc_star_field/object_efc_star_field.c +assets/objects/object_efc_tw/object_efc_tw.c +assets/objects/object_ei/object_ei.c +assets/objects/object_fa/object_fa.c +assets/objects/object_fd2/object_fd2.c +assets/objects/object_fd/object_fd.c +assets/objects/object_fhg/object_fhg.c +assets/objects/object_firefly/object_firefly.c +assets/objects/object_fire/object_fire.c +assets/objects/object_fish/object_fish.c +assets/objects/object_fr/object_fr.c +assets/objects/object_fu/object_fu.c +assets/objects/object_fw/object_fw.c +assets/objects/object_fz/object_fz.c +assets/objects/object_ganon2/object_ganon2.c +assets/objects/object_ganon_anime1/object_ganon_anime1.c +assets/objects/object_ganon_anime2/object_ganon_anime2.c +assets/objects/object_ganon_anime3/object_ganon_anime3.c +assets/objects/object_ganon/object_ganon.c +assets/objects/object_ganon_objects/object_ganon_objects.c +assets/objects/object_ge1/object_ge1.c +assets/objects/object_geff/object_geff.c +assets/objects/object_geldb/object_geldb.c +assets/objects/object_gi_arrowcase/object_gi_arrowcase.c +assets/objects/object_gi_arrow/object_gi_arrow.c +assets/objects/object_gi_bean/object_gi_bean.c +assets/objects/object_gi_bomb_1/object_gi_bomb_1.c +assets/objects/object_gi_bomb_2/object_gi_bomb_2.c +assets/objects/object_gi_bombpouch/object_gi_bombpouch.c +assets/objects/object_gi_boomerang/object_gi_boomerang.c +assets/objects/object_gi_boots_2/object_gi_boots_2.c +assets/objects/object_gi_bosskey/object_gi_bosskey.c +assets/objects/object_gi_bottle_letter/object_gi_bottle_letter.c +assets/objects/object_gi_bottle/object_gi_bottle.c +assets/objects/object_gi_bow/object_gi_bow.c +assets/objects/object_gi_bracelet/object_gi_bracelet.c +assets/objects/object_gi_brokensword/object_gi_brokensword.c +assets/objects/object_gi_butterfly/object_gi_butterfly.c +assets/objects/object_gi_clothes/object_gi_clothes.c +assets/objects/object_gi_coin/object_gi_coin.c +assets/objects/object_gi_compass/object_gi_compass.c +assets/objects/object_gi_dekupouch/object_gi_dekupouch.c +assets/objects/object_gi_egg/object_gi_egg.c +assets/objects/object_gi_eye_lotion/object_gi_eye_lotion.c +assets/objects/object_gi_fire/object_gi_fire.c +assets/objects/object_gi_fish/object_gi_fish.c +assets/objects/object_gi_frog/object_gi_frog.c +assets/objects/object_gi_gerudomask/object_gi_gerudomask.c +assets/objects/object_gi_gerudo/object_gi_gerudo.c +assets/objects/object_gi_ghost/object_gi_ghost.c +assets/objects/object_gi_glasses/object_gi_glasses.c +assets/objects/object_gi_gloves/object_gi_gloves.c +assets/objects/object_gi_goddess/object_gi_goddess.c +assets/objects/object_gi_golonmask/object_gi_golonmask.c +assets/objects/object_gi_grass/object_gi_grass.c +assets/objects/object_gi_hammer/object_gi_hammer.c +assets/objects/object_gi_heart/object_gi_heart.c +assets/objects/object_gi_hearts/object_gi_hearts.c +assets/objects/object_gi_hookshot/object_gi_hookshot.c +assets/objects/object_gi_hoverboots/object_gi_hoverboots.c +assets/objects/object_gi_insect/object_gi_insect.c +assets/objects/object_gi_jewel/object_gi_jewel.c +assets/objects/object_gi_key/object_gi_key.c +assets/objects/object_gi_ki_tan_mask/object_gi_ki_tan_mask.c +assets/objects/object_gi_letter/object_gi_letter.c +assets/objects/object_gi_liquid/object_gi_liquid.c +assets/objects/object_gi_longsword/object_gi_longsword.c +assets/objects/object_gi_magicpot/object_gi_magicpot.c +assets/objects/object_gi_map/object_gi_map.c +assets/objects/object_gi_m_arrow/object_gi_m_arrow.c +assets/objects/object_gi_medal/object_gi_medal.c +assets/objects/object_gi_melody/object_gi_melody.c +assets/objects/object_gi_milk/object_gi_milk.c +assets/objects/object_gi_mushroom/object_gi_mushroom.c +assets/objects/object_gi_niwatori/object_gi_niwatori.c +assets/objects/object_gi_nuts/object_gi_nuts.c +assets/objects/object_gi_ocarina_0/object_gi_ocarina_0.c +assets/objects/object_gi_ocarina/object_gi_ocarina.c +assets/objects/object_gi_pachinko/object_gi_pachinko.c +assets/objects/object_gi_powder/object_gi_powder.c +assets/objects/object_gi_prescription/object_gi_prescription.c +assets/objects/object_gi_purse/object_gi_purse.c +assets/objects/object_gi_rabit_mask/object_gi_rabit_mask.c +assets/objects/object_gi_redead_mask/object_gi_redead_mask.c +assets/objects/object_gi_rupy/object_gi_rupy.c +assets/objects/object_gi_saw/object_gi_saw.c +assets/objects/object_gi_scale/object_gi_scale.c +assets/objects/object_gi_seed/object_gi_seed.c +assets/objects/object_gi_shield_1/object_gi_shield_1.c +assets/objects/object_gi_shield_2/object_gi_shield_2.c +assets/objects/object_gi_shield_3/object_gi_shield_3.c +assets/objects/object_gi_skj_mask/object_gi_skj_mask.c +assets/objects/object_gi_soldout/object_gi_soldout.c +assets/objects/object_gi_soul/object_gi_soul.c +assets/objects/object_gi_stick/object_gi_stick.c +assets/objects/object_gi_sutaru/object_gi_sutaru.c +assets/objects/object_gi_sword_1/object_gi_sword_1.c +assets/objects/object_gi_ticketstone/object_gi_ticketstone.c +assets/objects/object_gi_truth_mask/object_gi_truth_mask.c +assets/objects/object_gi_zoramask/object_gi_zoramask.c +assets/objects/object_gj/object_gj.c +assets/objects/object_gjyo_objects/object_gjyo_objects.c +assets/objects/object_gla/object_gla.c +assets/objects/object_gm/object_gm.c +assets/objects/object_gndd/object_gndd.c +assets/objects/object_gnd_magic/object_gnd_magic.c +assets/objects/object_gnd/object_gnd.c +assets/objects/object_god_lgt/object_god_lgt.c +assets/objects/object_gol/object_gol.c +assets/objects/object_goma/object_goma.c +assets/objects/object_goroiwa/object_goroiwa.c +assets/objects/object_gr/object_gr.c +assets/objects/object_gs/object_gs.c +assets/objects/object_gt/object_gt.c +assets/objects/object_hakach_objects/object_hakach_objects.c +assets/objects/object_haka_door/object_haka_door.c +assets/objects/object_haka/object_haka.c +assets/objects/object_haka_objects/object_haka_objects.c +assets/objects/object_hata/object_hata.c +assets/objects/object_heavy_object/object_heavy_object.c +assets/objects/object_hidan_objects/object_hidan_objects.c +assets/objects/object_hintnuts/object_hintnuts.c +assets/objects/object_hni/object_hni.c +assets/objects/object_horse_ganon/object_horse_ganon.c +assets/objects/object_horse_link_child/object_horse_link_child.c +assets/objects/object_horse_normal/object_horse_normal.c +assets/objects/object_horse/object_horse.c +assets/objects/object_horse_zelda/object_horse_zelda.c +assets/objects/object_hs/object_hs.c +assets/objects/object_human/object_human.c +assets/objects/object_ice_objects/object_ice_objects.c +assets/objects/object_ik/object_ik.c +assets/objects/object_im/object_im.c +assets/objects/object_ingate/object_ingate.c +assets/objects/object_in/object_in.c +assets/objects/object_jj/object_jj.c +assets/objects/object_js/object_js.c +assets/objects/object_jya_door/object_jya_door.c +assets/objects/object_jya_iron/object_jya_iron.c +assets/objects/object_jya_obj/object_jya_obj.c +assets/objects/object_kanban/object_kanban.c +assets/objects/object_ka/object_ka.c +assets/objects/object_kibako2/object_kibako2.c +assets/objects/object_kingdodongo/object_kingdodongo.c +assets/objects/object_km1/object_km1.c +assets/objects/object_kusa/object_kusa.c +assets/objects/object_kw1/object_kw1.c +assets/objects/object_kz/object_kz.c +assets/objects/object_lightbox/object_lightbox.c +assets/objects/object_light_ring/object_light_ring.c +assets/objects/object_lightswitch/object_lightswitch.c +assets/objects/object_ma1/object_ma1.c +assets/objects/object_ma2/object_ma2.c +assets/objects/object_mag/object_mag.c +assets/objects/object_mamenoki/object_mamenoki.c +assets/objects/object_mastergolon/object_mastergolon.c +assets/objects/object_masterkokirihead/object_masterkokirihead.c +assets/objects/object_masterkokiri/object_masterkokiri.c +assets/objects/object_masterzoora/object_masterzoora.c +assets/objects/object_mb/object_mb.c +assets/objects/object_md/object_md.c +assets/objects/object_medal/object_medal.c +assets/objects/object_menkuri_objects/object_menkuri_objects.c +assets/objects/object_mir_ray/object_mir_ray.c +assets/objects/object_mizu_objects/object_mizu_objects.c +assets/objects/object_mjin_dark/object_mjin_dark.c +assets/objects/object_mjin_flame/object_mjin_flame.c +assets/objects/object_mjin_flash/object_mjin_flash.c +assets/objects/object_mjin_ice/object_mjin_ice.c +assets/objects/object_mjin/object_mjin.c +assets/objects/object_mjin_oka/object_mjin_oka.c +assets/objects/object_mjin_soul/object_mjin_soul.c +assets/objects/object_mjin_wind/object_mjin_wind.c +assets/objects/object_mk/object_mk.c +assets/objects/object_mm/object_mm.c +assets/objects/object_mo/object_mo.c +assets/objects/object_mori_hineri1a/object_mori_hineri1a.c +assets/objects/object_mori_hineri1/object_mori_hineri1.c +assets/objects/object_mori_hineri2a/object_mori_hineri2a.c +assets/objects/object_mori_hineri2/object_mori_hineri2.c +assets/objects/object_mori_objects/object_mori_objects.c +assets/objects/object_mori_tex/object_mori_tex.c +assets/objects/object_ms/object_ms.c +assets/objects/object_mu/object_mu.c +assets/objects/object_nb/object_nb.c +assets/objects/object_niw/object_niw.c +assets/objects/object_nwc/object_nwc.c +assets/objects/object_ny/object_ny.c +assets/objects/object_oA10/object_oA10.c +assets/objects/object_oA11/object_oA11.c +assets/objects/object_oA1/object_oA1.c +assets/objects/object_oA2/object_oA2.c +assets/objects/object_oA3/object_oA3.c +assets/objects/object_oA4/object_oA4.c +assets/objects/object_oA5/object_oA5.c +assets/objects/object_oA6/object_oA6.c +assets/objects/object_oA7/object_oA7.c +assets/objects/object_oA8/object_oA8.c +assets/objects/object_oA9/object_oA9.c +assets/objects/object_o_anime/object_o_anime.c +assets/objects/object_oB1/object_oB1.c +assets/objects/object_oB2/object_oB2.c +assets/objects/object_oB3/object_oB3.c +assets/objects/object_oB4/object_oB4.c +assets/objects/object_oE10/object_oE10.c +assets/objects/object_oE11/object_oE11.c +assets/objects/object_oE12/object_oE12.c +assets/objects/object_oE1/object_oE1.c +assets/objects/object_oE1s/object_oE1s.c +assets/objects/object_oE2/object_oE2.c +assets/objects/object_oE3/object_oE3.c +assets/objects/object_oE4/object_oE4.c +assets/objects/object_oE4s/object_oE4s.c +assets/objects/object_oE5/object_oE5.c +assets/objects/object_oE6/object_oE6.c +assets/objects/object_oE7/object_oE7.c +assets/objects/object_oE8/object_oE8.c +assets/objects/object_oE9/object_oE9.c +assets/objects/object_oE_anime/object_oE_anime.c +assets/objects/object_oF1d_map/object_oF1d_map.c +assets/objects/object_oF1s/object_oF1s.c +assets/objects/object_okuta/object_okuta.c +assets/objects/object_opening_demo1/object_opening_demo1.c +assets/objects/object_os_anime/object_os_anime.c +assets/objects/object_os/object_os.c +assets/objects/object_ossan/object_ossan.c +assets/objects/object_ouke_haka/object_ouke_haka.c +assets/objects/object_owl/object_owl.c +assets/objects/object_peehat/object_peehat.c +assets/objects/object_po_composer/object_po_composer.c +assets/objects/object_po_field/object_po_field.c +assets/objects/object_poh/object_poh.c +assets/objects/object_po_sisters/object_po_sisters.c +assets/objects/object_ps/object_ps.c +assets/objects/object_pu_box/object_pu_box.c +assets/objects/object_rd/object_rd.c +assets/objects/object_reeba/object_reeba.c +assets/objects/object_relay_objects/object_relay_objects.c +assets/objects/object_rl/object_rl.c +assets/objects/object_rr/object_rr.c +assets/objects/object_rs/object_rs.c +assets/objects/object_ru1/object_ru1.c +assets/objects/object_ru2/object_ru2.c +assets/objects/object_sa/object_sa.c +assets/objects/object_sb/object_sb.c +assets/objects/object_sd/object_sd.c +assets/objects/object_shop_dungen/object_shop_dungen.c +assets/objects/object_shopnuts/object_shopnuts.c +assets/objects/object_siofuki/object_siofuki.c +assets/objects/object_sk2/object_sk2.c +assets/objects/object_skb/object_skb.c +assets/objects/object_skj/object_skj.c +assets/objects/object_spot00_break/object_spot00_break.c +assets/objects/object_spot00_objects/object_spot00_objects.c +assets/objects/object_spot01_matoyab/object_spot01_matoyab.c +assets/objects/object_spot01_matoya/object_spot01_matoya.c +assets/objects/object_spot01_objects2/object_spot01_objects2.c +assets/objects/object_spot01_objects/object_spot01_objects.c +assets/objects/object_spot02_objects/object_spot02_objects.c +assets/objects/object_spot03_object/object_spot03_object.c +assets/objects/object_spot04_objects/object_spot04_objects.c +assets/objects/object_spot05_objects/object_spot05_objects.c +assets/objects/object_spot06_objects/object_spot06_objects.c +assets/objects/object_spot07_object/object_spot07_object.c +assets/objects/object_spot08_obj/object_spot08_obj.c +assets/objects/object_spot09_obj/object_spot09_obj.c +assets/objects/object_spot11_obj/object_spot11_obj.c +assets/objects/object_spot12_obj/object_spot12_obj.c +assets/objects/object_spot15_obj/object_spot15_obj.c +assets/objects/object_spot16_obj/object_spot16_obj.c +assets/objects/object_spot17_obj/object_spot17_obj.c +assets/objects/object_spot18_obj/object_spot18_obj.c +assets/objects/object_ssh/object_ssh.c +assets/objects/object_sst/object_sst.c +assets/objects/object_st/object_st.c +assets/objects/object_stream/object_stream.c +assets/objects/object_syokudai/object_syokudai.c +assets/objects/object_ta/object_ta.c +assets/objects/object_timeblock/object_timeblock.c +assets/objects/object_tite/object_tite.c +assets/objects/object_tk/object_tk.c +assets/objects/object_toki_objects/object_toki_objects.c +assets/objects/object_torch2/object_torch2.c +assets/objects/object_toryo/object_toryo.c +assets/objects/object_tp/object_tp.c +assets/objects/object_trap/object_trap.c +assets/objects/object_triforce_spot/object_triforce_spot.c +assets/objects/object_tr/object_tr.c +assets/objects/object_ts/object_ts.c +assets/objects/object_tsubo/object_tsubo.c +assets/objects/object_tw/object_tw.c +assets/objects/object_umajump/object_umajump.c +assets/objects/object_vali/object_vali.c +assets/objects/object_vase/object_vase.c +assets/objects/object_vm/object_vm.c +assets/objects/object_wallmaster/object_wallmaster.c +assets/objects/object_warp1/object_warp1.c +assets/objects/object_warp2/object_warp2.c +assets/objects/object_wf/object_wf.c +assets/objects/object_wood02/object_wood02.c +assets/objects/object_xc/object_xc.c +assets/objects/object_yabusame_point/object_yabusame_point.c +assets/objects/object_ydan_objects/object_ydan_objects.c +assets/objects/object_yukabyun/object_yukabyun.c +assets/objects/object_zf/object_zf.c +assets/objects/object_zg/object_zg.c +assets/objects/object_zl1/object_zl1.c +assets/objects/object_zl2_anime1/object_zl2_anime1.c +assets/objects/object_zl2_anime2/object_zl2_anime2.c +assets/objects/object_zl2/object_zl2.c +assets/objects/object_zl4/object_zl4.c +assets/objects/object_zo/object_zo.c +assets/overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.c +assets/overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.c +assets/overlays/ovl_Boss_Sst/ovl_Boss_Sst.c +assets/overlays/ovl_Demo_Shd/ovl_Demo_Shd.c +assets/overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.c +assets/overlays/ovl_Elf_Msg/ovl_Elf_Msg.c +assets/overlays/ovl_En_Bili/ovl_En_Bili.c +assets/overlays/ovl_En_Clear_Tag/ovl_En_Clear_Tag.c +assets/overlays/ovl_En_Ganon_Organ/ovl_En_Ganon_Organ.c +assets/overlays/ovl_En_Mag/ovl_En_Mag.c +assets/overlays/ovl_En_Sda/ovl_En_Sda.c +assets/overlays/ovl_En_Ssh/ovl_En_Ssh.c +assets/overlays/ovl_En_Sth/ovl_En_Sth.c +assets/overlays/ovl_file_choose/ovl_file_choose.c +assets/overlays/ovl_Magic_Dark/ovl_Magic_Dark.c +assets/overlays/ovl_Magic_Fire/ovl_Magic_Fire.c +assets/overlays/ovl_Magic_Wind/ovl_Magic_Wind.c +assets/overlays/ovl_Oceff_Spot/ovl_Oceff_Spot.c +assets/overlays/ovl_Oceff_Storm/ovl_Oceff_Storm.c +assets/overlays/ovl_Oceff_Wipe2/ovl_Oceff_Wipe2.c +assets/overlays/ovl_Oceff_Wipe3/ovl_Oceff_Wipe3.c +assets/overlays/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4.c +assets/overlays/ovl_Oceff_Wipe/ovl_Oceff_Wipe.c +assets/scenes/dungeons/bdan/bdan_room_0.c +assets/scenes/dungeons/bdan/bdan_room_10.c +assets/scenes/dungeons/bdan/bdan_room_11.c +assets/scenes/dungeons/bdan/bdan_room_12.c +assets/scenes/dungeons/bdan/bdan_room_13.c +assets/scenes/dungeons/bdan/bdan_room_14.c +assets/scenes/dungeons/bdan/bdan_room_15.c +assets/scenes/dungeons/bdan/bdan_room_1.c +assets/scenes/dungeons/bdan/bdan_room_2.c +assets/scenes/dungeons/bdan/bdan_room_3.c +assets/scenes/dungeons/bdan/bdan_room_4.c +assets/scenes/dungeons/bdan/bdan_room_5.c +assets/scenes/dungeons/bdan/bdan_room_6.c +assets/scenes/dungeons/bdan/bdan_room_7.c +assets/scenes/dungeons/bdan/bdan_room_8.c +assets/scenes/dungeons/bdan/bdan_room_9.c +assets/scenes/dungeons/bdan/bdan_scene.c +assets/scenes/dungeons/bdan_boss/bdan_boss_room_0.c +assets/scenes/dungeons/bdan_boss/bdan_boss_room_1.c +assets/scenes/dungeons/bdan_boss/bdan_boss_scene.c +assets/scenes/dungeons/Bmori1/Bmori1_room_0.c +assets/scenes/dungeons/Bmori1/Bmori1_room_10.c +assets/scenes/dungeons/Bmori1/Bmori1_room_11.c +assets/scenes/dungeons/Bmori1/Bmori1_room_12.c +assets/scenes/dungeons/Bmori1/Bmori1_room_13.c +assets/scenes/dungeons/Bmori1/Bmori1_room_14.c +assets/scenes/dungeons/Bmori1/Bmori1_room_15.c +assets/scenes/dungeons/Bmori1/Bmori1_room_16.c +assets/scenes/dungeons/Bmori1/Bmori1_room_17.c +assets/scenes/dungeons/Bmori1/Bmori1_room_18.c +assets/scenes/dungeons/Bmori1/Bmori1_room_19.c +assets/scenes/dungeons/Bmori1/Bmori1_room_1.c +assets/scenes/dungeons/Bmori1/Bmori1_room_20.c +assets/scenes/dungeons/Bmori1/Bmori1_room_21.c +assets/scenes/dungeons/Bmori1/Bmori1_room_22.c +assets/scenes/dungeons/Bmori1/Bmori1_room_2.c +assets/scenes/dungeons/Bmori1/Bmori1_room_3.c +assets/scenes/dungeons/Bmori1/Bmori1_room_4.c +assets/scenes/dungeons/Bmori1/Bmori1_room_5.c +assets/scenes/dungeons/Bmori1/Bmori1_room_6.c +assets/scenes/dungeons/Bmori1/Bmori1_room_7.c +assets/scenes/dungeons/Bmori1/Bmori1_room_8.c +assets/scenes/dungeons/Bmori1/Bmori1_room_9.c +assets/scenes/dungeons/Bmori1/Bmori1_scene.c +assets/scenes/dungeons/ddan_boss/ddan_boss_room_0.c +assets/scenes/dungeons/ddan_boss/ddan_boss_room_1.c +assets/scenes/dungeons/ddan_boss/ddan_boss_scene.c +assets/scenes/dungeons/ddan/ddan_room_0.c +assets/scenes/dungeons/ddan/ddan_room_10.c +assets/scenes/dungeons/ddan/ddan_room_11.c +assets/scenes/dungeons/ddan/ddan_room_12.c +assets/scenes/dungeons/ddan/ddan_room_13.c +assets/scenes/dungeons/ddan/ddan_room_14.c +assets/scenes/dungeons/ddan/ddan_room_15.c +assets/scenes/dungeons/ddan/ddan_room_16.c +assets/scenes/dungeons/ddan/ddan_room_1.c +assets/scenes/dungeons/ddan/ddan_room_2.c +assets/scenes/dungeons/ddan/ddan_room_3.c +assets/scenes/dungeons/ddan/ddan_room_4.c +assets/scenes/dungeons/ddan/ddan_room_5.c +assets/scenes/dungeons/ddan/ddan_room_6.c +assets/scenes/dungeons/ddan/ddan_room_7.c +assets/scenes/dungeons/ddan/ddan_room_8.c +assets/scenes/dungeons/ddan/ddan_room_9.c +assets/scenes/dungeons/ddan/ddan_scene.c +assets/scenes/dungeons/FIRE_bs/FIRE_bs_room_0.c +assets/scenes/dungeons/FIRE_bs/FIRE_bs_room_1.c +assets/scenes/dungeons/FIRE_bs/FIRE_bs_scene.c +assets/scenes/dungeons/ganon_boss/ganon_boss_room_0.c +assets/scenes/dungeons/ganon_boss/ganon_boss_scene.c +assets/scenes/dungeons/ganon_demo/ganon_demo_room_0.c +assets/scenes/dungeons/ganon_demo/ganon_demo_scene.c +assets/scenes/dungeons/ganon_final/ganon_final_room_0.c +assets/scenes/dungeons/ganon_final/ganon_final_scene.c +assets/scenes/dungeons/ganon/ganon_room_0.c +assets/scenes/dungeons/ganon/ganon_room_1.c +assets/scenes/dungeons/ganon/ganon_room_2.c +assets/scenes/dungeons/ganon/ganon_room_3.c +assets/scenes/dungeons/ganon/ganon_room_4.c +assets/scenes/dungeons/ganon/ganon_room_5.c +assets/scenes/dungeons/ganon/ganon_room_6.c +assets/scenes/dungeons/ganon/ganon_room_7.c +assets/scenes/dungeons/ganon/ganon_room_8.c +assets/scenes/dungeons/ganon/ganon_room_9.c +assets/scenes/dungeons/ganon/ganon_scene.c +assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_0.c +assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_1.c +assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_2.c +assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_3.c +assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_room_4.c +assets/scenes/dungeons/ganon_sonogo/ganon_sonogo_scene.c +assets/scenes/dungeons/ganontika/ganontika_room_0.c +assets/scenes/dungeons/ganontika/ganontika_room_10.c +assets/scenes/dungeons/ganontika/ganontika_room_11.c +assets/scenes/dungeons/ganontika/ganontika_room_12.c +assets/scenes/dungeons/ganontika/ganontika_room_13.c +assets/scenes/dungeons/ganontika/ganontika_room_14.c +assets/scenes/dungeons/ganontika/ganontika_room_15.c +assets/scenes/dungeons/ganontika/ganontika_room_16.c +assets/scenes/dungeons/ganontika/ganontika_room_17.c +assets/scenes/dungeons/ganontika/ganontika_room_18.c +assets/scenes/dungeons/ganontika/ganontika_room_19.c +assets/scenes/dungeons/ganontika/ganontika_room_1.c +assets/scenes/dungeons/ganontika/ganontika_room_2.c +assets/scenes/dungeons/ganontika/ganontika_room_3.c +assets/scenes/dungeons/ganontika/ganontika_room_4.c +assets/scenes/dungeons/ganontika/ganontika_room_5.c +assets/scenes/dungeons/ganontika/ganontika_room_6.c +assets/scenes/dungeons/ganontika/ganontika_room_7.c +assets/scenes/dungeons/ganontika/ganontika_room_8.c +assets/scenes/dungeons/ganontika/ganontika_room_9.c +assets/scenes/dungeons/ganontika/ganontika_scene.c +assets/scenes/dungeons/ganontikasonogo/ganontikasonogo_room_0.c +assets/scenes/dungeons/ganontikasonogo/ganontikasonogo_room_1.c +assets/scenes/dungeons/ganontikasonogo/ganontikasonogo_scene.c +assets/scenes/dungeons/gerudoway/gerudoway_room_0.c +assets/scenes/dungeons/gerudoway/gerudoway_room_1.c +assets/scenes/dungeons/gerudoway/gerudoway_room_2.c +assets/scenes/dungeons/gerudoway/gerudoway_room_3.c +assets/scenes/dungeons/gerudoway/gerudoway_room_4.c +assets/scenes/dungeons/gerudoway/gerudoway_room_5.c +assets/scenes/dungeons/gerudoway/gerudoway_scene.c +assets/scenes/dungeons/HAKAdan_bs/HAKAdan_bs_room_0.c +assets/scenes/dungeons/HAKAdan_bs/HAKAdan_bs_room_1.c +assets/scenes/dungeons/HAKAdan_bs/HAKAdan_bs_scene.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_0.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_1.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_2.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_3.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_4.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_5.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_room_6.c +assets/scenes/dungeons/HAKAdanCH/HAKAdanCH_scene.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_0.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_10.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_11.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_12.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_13.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_14.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_15.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_16.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_17.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_18.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_19.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_1.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_20.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_21.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_22.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_2.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_3.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_4.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_5.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_6.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_7.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_8.c +assets/scenes/dungeons/HAKAdan/HAKAdan_room_9.c +assets/scenes/dungeons/HAKAdan/HAKAdan_scene.c +assets/scenes/dungeons/HIDAN/HIDAN_room_0.c +assets/scenes/dungeons/HIDAN/HIDAN_room_10.c +assets/scenes/dungeons/HIDAN/HIDAN_room_11.c +assets/scenes/dungeons/HIDAN/HIDAN_room_12.c +assets/scenes/dungeons/HIDAN/HIDAN_room_13.c +assets/scenes/dungeons/HIDAN/HIDAN_room_14.c +assets/scenes/dungeons/HIDAN/HIDAN_room_15.c +assets/scenes/dungeons/HIDAN/HIDAN_room_16.c +assets/scenes/dungeons/HIDAN/HIDAN_room_17.c +assets/scenes/dungeons/HIDAN/HIDAN_room_18.c +assets/scenes/dungeons/HIDAN/HIDAN_room_19.c +assets/scenes/dungeons/HIDAN/HIDAN_room_1.c +assets/scenes/dungeons/HIDAN/HIDAN_room_20.c +assets/scenes/dungeons/HIDAN/HIDAN_room_21.c +assets/scenes/dungeons/HIDAN/HIDAN_room_22.c +assets/scenes/dungeons/HIDAN/HIDAN_room_23.c +assets/scenes/dungeons/HIDAN/HIDAN_room_24.c +assets/scenes/dungeons/HIDAN/HIDAN_room_25.c +assets/scenes/dungeons/HIDAN/HIDAN_room_26.c +assets/scenes/dungeons/HIDAN/HIDAN_room_2.c +assets/scenes/dungeons/HIDAN/HIDAN_room_3.c +assets/scenes/dungeons/HIDAN/HIDAN_room_4.c +assets/scenes/dungeons/HIDAN/HIDAN_room_5.c +assets/scenes/dungeons/HIDAN/HIDAN_room_6.c +assets/scenes/dungeons/HIDAN/HIDAN_room_7.c +assets/scenes/dungeons/HIDAN/HIDAN_room_8.c +assets/scenes/dungeons/HIDAN/HIDAN_room_9.c +assets/scenes/dungeons/HIDAN/HIDAN_scene.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_0.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_10.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_11.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_1.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_2.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_3.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_4.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_5.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_6.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_7.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_8.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_room_9.c +assets/scenes/dungeons/ice_doukutu/ice_doukutu_scene.c +assets/scenes/dungeons/jyasinboss/jyasinboss_room_0.c +assets/scenes/dungeons/jyasinboss/jyasinboss_room_1.c +assets/scenes/dungeons/jyasinboss/jyasinboss_room_2.c +assets/scenes/dungeons/jyasinboss/jyasinboss_room_3.c +assets/scenes/dungeons/jyasinboss/jyasinboss_scene.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_0.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_10.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_11.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_12.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_13.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_14.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_15.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_16.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_17.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_18.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_19.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_1.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_20.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_21.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_22.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_23.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_24.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_25.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_26.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_27.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_28.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_2.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_3.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_4.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_5.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_6.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_7.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_8.c +assets/scenes/dungeons/jyasinzou/jyasinzou_room_9.c +assets/scenes/dungeons/jyasinzou/jyasinzou_scene.c +assets/scenes/dungeons/men/men_room_0.c +assets/scenes/dungeons/men/men_room_10.c +assets/scenes/dungeons/men/men_room_1.c +assets/scenes/dungeons/men/men_room_2.c +assets/scenes/dungeons/men/men_room_3.c +assets/scenes/dungeons/men/men_room_4.c +assets/scenes/dungeons/men/men_room_5.c +assets/scenes/dungeons/men/men_room_6.c +assets/scenes/dungeons/men/men_room_7.c +assets/scenes/dungeons/men/men_room_8.c +assets/scenes/dungeons/men/men_room_9.c +assets/scenes/dungeons/men/men_scene.c +assets/scenes/dungeons/MIZUsin_bs/MIZUsin_bs_room_0.c +assets/scenes/dungeons/MIZUsin_bs/MIZUsin_bs_room_1.c +assets/scenes/dungeons/MIZUsin_bs/MIZUsin_bs_scene.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_0.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_10.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_11.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_12.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_13.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_14.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_15.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_16.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_17.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_18.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_19.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_1.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_20.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_21.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_22.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_2.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_3.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_4.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_5.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_6.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_7.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_8.c +assets/scenes/dungeons/MIZUsin/MIZUsin_room_9.c +assets/scenes/dungeons/MIZUsin/MIZUsin_scene.c +assets/scenes/dungeons/moribossroom/moribossroom_room_0.c +assets/scenes/dungeons/moribossroom/moribossroom_room_1.c +assets/scenes/dungeons/moribossroom/moribossroom_scene.c +assets/scenes/dungeons/ydan_boss/ydan_boss_room_0.c +assets/scenes/dungeons/ydan_boss/ydan_boss_room_1.c +assets/scenes/dungeons/ydan_boss/ydan_boss_scene.c +assets/scenes/dungeons/ydan/ydan_room_0.c +assets/scenes/dungeons/ydan/ydan_room_10.c +assets/scenes/dungeons/ydan/ydan_room_11.c +assets/scenes/dungeons/ydan/ydan_room_1.c +assets/scenes/dungeons/ydan/ydan_room_2.c +assets/scenes/dungeons/ydan/ydan_room_3.c +assets/scenes/dungeons/ydan/ydan_room_4.c +assets/scenes/dungeons/ydan/ydan_room_5.c +assets/scenes/dungeons/ydan/ydan_room_6.c +assets/scenes/dungeons/ydan/ydan_room_7.c +assets/scenes/dungeons/ydan/ydan_room_8.c +assets/scenes/dungeons/ydan/ydan_room_9.c +assets/scenes/dungeons/ydan/ydan_scene.c +assets/scenes/indoors/bowling/bowling_room_0.c +assets/scenes/indoors/bowling/bowling_scene.c +assets/scenes/indoors/daiyousei_izumi/daiyousei_izumi_room_0.c +assets/scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.c +assets/scenes/indoors/hairal_niwa2/hairal_niwa2_room_0.c +assets/scenes/indoors/hairal_niwa2/hairal_niwa2_scene.c +assets/scenes/indoors/hairal_niwa/hairal_niwa_room_0.c +assets/scenes/indoors/hairal_niwa/hairal_niwa_scene.c +assets/scenes/indoors/hairal_niwa_n/hairal_niwa_n_room_0.c +assets/scenes/indoors/hairal_niwa_n/hairal_niwa_n_scene.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_room_0.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_room_1.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_room_2.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_room_3.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_room_4.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_room_5.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_room_6.c +assets/scenes/indoors/hakasitarelay/hakasitarelay_scene.c +assets/scenes/indoors/hut/hut_room_0.c +assets/scenes/indoors/hut/hut_scene.c +assets/scenes/indoors/hylia_labo/hylia_labo_room_0.c +assets/scenes/indoors/hylia_labo/hylia_labo_scene.c +assets/scenes/indoors/impa/impa_room_0.c +assets/scenes/indoors/impa/impa_scene.c +assets/scenes/indoors/kakariko/kakariko_room_0.c +assets/scenes/indoors/kakariko/kakariko_scene.c +assets/scenes/indoors/kenjyanoma/kenjyanoma_room_0.c +assets/scenes/indoors/kenjyanoma/kenjyanoma_scene.c +assets/scenes/indoors/kokiri_home3/kokiri_home3_room_0.c +assets/scenes/indoors/kokiri_home3/kokiri_home3_scene.c +assets/scenes/indoors/kokiri_home4/kokiri_home4_room_0.c +assets/scenes/indoors/kokiri_home4/kokiri_home4_scene.c +assets/scenes/indoors/kokiri_home5/kokiri_home5_room_0.c +assets/scenes/indoors/kokiri_home5/kokiri_home5_scene.c +assets/scenes/indoors/kokiri_home/kokiri_home_room_0.c +assets/scenes/indoors/kokiri_home/kokiri_home_scene.c +assets/scenes/indoors/labo/labo_room_0.c +assets/scenes/indoors/labo/labo_scene.c +assets/scenes/indoors/link_home/link_home_room_0.c +assets/scenes/indoors/link_home/link_home_scene.c +assets/scenes/indoors/mahouya/mahouya_room_0.c +assets/scenes/indoors/mahouya/mahouya_scene.c +assets/scenes/indoors/malon_stable/malon_stable_room_0.c +assets/scenes/indoors/malon_stable/malon_stable_scene.c +assets/scenes/indoors/miharigoya/miharigoya_room_0.c +assets/scenes/indoors/miharigoya/miharigoya_scene.c +assets/scenes/indoors/nakaniwa/nakaniwa_room_0.c +assets/scenes/indoors/nakaniwa/nakaniwa_scene.c +assets/scenes/indoors/souko/souko_room_0.c +assets/scenes/indoors/souko/souko_room_1.c +assets/scenes/indoors/souko/souko_room_2.c +assets/scenes/indoors/souko/souko_scene.c +assets/scenes/indoors/syatekijyou/syatekijyou_room_0.c +assets/scenes/indoors/syatekijyou/syatekijyou_scene.c +assets/scenes/indoors/takaraya/takaraya_room_0.c +assets/scenes/indoors/takaraya/takaraya_room_1.c +assets/scenes/indoors/takaraya/takaraya_room_2.c +assets/scenes/indoors/takaraya/takaraya_room_3.c +assets/scenes/indoors/takaraya/takaraya_room_4.c +assets/scenes/indoors/takaraya/takaraya_room_5.c +assets/scenes/indoors/takaraya/takaraya_room_6.c +assets/scenes/indoors/takaraya/takaraya_scene.c +assets/scenes/indoors/tent/tent_room_0.c +assets/scenes/indoors/tent/tent_scene.c +assets/scenes/indoors/tokinoma/tokinoma_room_0.c +assets/scenes/indoors/tokinoma/tokinoma_room_1.c +assets/scenes/indoors/tokinoma/tokinoma_scene.c +assets/scenes/indoors/yousei_izumi_tate/yousei_izumi_tate_room_0.c +assets/scenes/indoors/yousei_izumi_tate/yousei_izumi_tate_scene.c +assets/scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_room_0.c +assets/scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.c +assets/scenes/misc/enrui/enrui_room_0.c +assets/scenes/misc/enrui/enrui_scene.c +assets/scenes/misc/entra/entra_room_0.c +assets/scenes/misc/entra/entra_scene.c +assets/scenes/misc/entra_n/entra_n_room_0.c +assets/scenes/misc/entra_n/entra_n_scene.c +assets/scenes/misc/hakaana2/hakaana2_room_0.c +assets/scenes/misc/hakaana2/hakaana2_scene.c +assets/scenes/misc/hakaana/hakaana_room_0.c +assets/scenes/misc/hakaana/hakaana_scene.c +assets/scenes/misc/hakaana_ouke/hakaana_ouke_room_0.c +assets/scenes/misc/hakaana_ouke/hakaana_ouke_room_1.c +assets/scenes/misc/hakaana_ouke/hakaana_ouke_room_2.c +assets/scenes/misc/hakaana_ouke/hakaana_ouke_scene.c +assets/scenes/misc/hiral_demo/hiral_demo_room_0.c +assets/scenes/misc/hiral_demo/hiral_demo_scene.c +assets/scenes/misc/kakariko3/kakariko3_room_0.c +assets/scenes/misc/kakariko3/kakariko3_scene.c +assets/scenes/misc/kakusiana/kakusiana_room_0.c +assets/scenes/misc/kakusiana/kakusiana_room_10.c +assets/scenes/misc/kakusiana/kakusiana_room_11.c +assets/scenes/misc/kakusiana/kakusiana_room_12.c +assets/scenes/misc/kakusiana/kakusiana_room_13.c +assets/scenes/misc/kakusiana/kakusiana_room_1.c +assets/scenes/misc/kakusiana/kakusiana_room_2.c +assets/scenes/misc/kakusiana/kakusiana_room_3.c +assets/scenes/misc/kakusiana/kakusiana_room_4.c +assets/scenes/misc/kakusiana/kakusiana_room_5.c +assets/scenes/misc/kakusiana/kakusiana_room_6.c +assets/scenes/misc/kakusiana/kakusiana_room_7.c +assets/scenes/misc/kakusiana/kakusiana_room_8.c +assets/scenes/misc/kakusiana/kakusiana_room_9.c +assets/scenes/misc/kakusiana/kakusiana_scene.c +assets/scenes/misc/kinsuta/kinsuta_room_0.c +assets/scenes/misc/kinsuta/kinsuta_scene.c +assets/scenes/misc/market_alley/market_alley_room_0.c +assets/scenes/misc/market_alley/market_alley_scene.c +assets/scenes/misc/market_alley_n/market_alley_n_room_0.c +assets/scenes/misc/market_alley_n/market_alley_n_scene.c +assets/scenes/misc/market_day/market_day_room_0.c +assets/scenes/misc/market_day/market_day_scene.c +assets/scenes/misc/market_night/market_night_room_0.c +assets/scenes/misc/market_night/market_night_scene.c +assets/scenes/misc/market_ruins/market_ruins_room_0.c +assets/scenes/misc/market_ruins/market_ruins_scene.c +assets/scenes/misc/shrine_n/shrine_n_room_0.c +assets/scenes/misc/shrine_n/shrine_n_scene.c +assets/scenes/misc/shrine_r/shrine_r_room_0.c +assets/scenes/misc/shrine_r/shrine_r_scene.c +assets/scenes/misc/shrine/shrine_room_0.c +assets/scenes/misc/shrine/shrine_scene.c +assets/scenes/misc/turibori/turibori_room_0.c +assets/scenes/misc/turibori/turibori_scene.c +assets/scenes/overworld/ganon_tou/ganon_tou_room_0.c +assets/scenes/overworld/ganon_tou/ganon_tou_scene.c +assets/scenes/overworld/spot00/spot00_room_0.c +assets/scenes/overworld/spot00/spot00_scene.c +assets/scenes/overworld/spot01/spot01_room_0.c +assets/scenes/overworld/spot01/spot01_scene.c +assets/scenes/overworld/spot02/spot02_room_0.c +assets/scenes/overworld/spot02/spot02_room_1.c +assets/scenes/overworld/spot02/spot02_scene.c +assets/scenes/overworld/spot03/spot03_room_0.c +assets/scenes/overworld/spot03/spot03_room_1.c +assets/scenes/overworld/spot03/spot03_scene.c +assets/scenes/overworld/spot04/spot04_room_0.c +assets/scenes/overworld/spot04/spot04_room_1.c +assets/scenes/overworld/spot04/spot04_room_2.c +assets/scenes/overworld/spot04/spot04_scene.c +assets/scenes/overworld/spot05/spot05_room_0.c +assets/scenes/overworld/spot05/spot05_scene.c +assets/scenes/overworld/spot06/spot06_room_0.c +assets/scenes/overworld/spot06/spot06_scene.c +assets/scenes/overworld/spot07/spot07_room_0.c +assets/scenes/overworld/spot07/spot07_room_1.c +assets/scenes/overworld/spot07/spot07_scene.c +assets/scenes/overworld/spot08/spot08_room_0.c +assets/scenes/overworld/spot08/spot08_scene.c +assets/scenes/overworld/spot09/spot09_room_0.c +assets/scenes/overworld/spot09/spot09_scene.c +assets/scenes/overworld/spot10/spot10_room_0.c +assets/scenes/overworld/spot10/spot10_room_1.c +assets/scenes/overworld/spot10/spot10_room_2.c +assets/scenes/overworld/spot10/spot10_room_3.c +assets/scenes/overworld/spot10/spot10_room_4.c +assets/scenes/overworld/spot10/spot10_room_5.c +assets/scenes/overworld/spot10/spot10_room_6.c +assets/scenes/overworld/spot10/spot10_room_7.c +assets/scenes/overworld/spot10/spot10_room_8.c +assets/scenes/overworld/spot10/spot10_room_9.c +assets/scenes/overworld/spot10/spot10_scene.c +assets/scenes/overworld/spot11/spot11_room_0.c +assets/scenes/overworld/spot11/spot11_scene.c +assets/scenes/overworld/spot12/spot12_room_0.c +assets/scenes/overworld/spot12/spot12_room_1.c +assets/scenes/overworld/spot12/spot12_scene.c +assets/scenes/overworld/spot13/spot13_room_0.c +assets/scenes/overworld/spot13/spot13_room_1.c +assets/scenes/overworld/spot13/spot13_scene.c +assets/scenes/overworld/spot15/spot15_room_0.c +assets/scenes/overworld/spot15/spot15_scene.c +assets/scenes/overworld/spot16/spot16_room_0.c +assets/scenes/overworld/spot16/spot16_scene.c +assets/scenes/overworld/spot17/spot17_room_0.c +assets/scenes/overworld/spot17/spot17_room_1.c +assets/scenes/overworld/spot17/spot17_scene.c +assets/scenes/overworld/spot18/spot18_room_0.c +assets/scenes/overworld/spot18/spot18_room_1.c +assets/scenes/overworld/spot18/spot18_room_2.c +assets/scenes/overworld/spot18/spot18_room_3.c +assets/scenes/overworld/spot18/spot18_scene.c +assets/scenes/overworld/spot20/spot20_room_0.c +assets/scenes/overworld/spot20/spot20_scene.c +assets/scenes/shops/alley_shop/alley_shop_room_0.c +assets/scenes/shops/alley_shop/alley_shop_scene.c +assets/scenes/shops/drag/drag_room_0.c +assets/scenes/shops/drag/drag_scene.c +assets/scenes/shops/face_shop/face_shop_room_0.c +assets/scenes/shops/face_shop/face_shop_scene.c +assets/scenes/shops/golon/golon_room_0.c +assets/scenes/shops/golon/golon_scene.c +assets/scenes/shops/kokiri_shop/kokiri_shop_room_0.c +assets/scenes/shops/kokiri_shop/kokiri_shop_scene.c +assets/scenes/shops/night_shop/night_shop_room_0.c +assets/scenes/shops/night_shop/night_shop_scene.c +assets/scenes/shops/shop1/shop1_room_0.c +assets/scenes/shops/shop1/shop1_scene.c +assets/scenes/shops/zoora/zoora_room_0.c +assets/scenes/shops/zoora/zoora_scene.c +assets/scenes/test_levels/besitu/besitu_room_0.c +assets/scenes/test_levels/besitu/besitu_scene.c +assets/scenes/test_levels/depth_test/depth_test_room_0.c +assets/scenes/test_levels/depth_test/depth_test_scene.c +assets/scenes/test_levels/sasatest/sasatest_room_0.c +assets/scenes/test_levels/sasatest/sasatest_scene.c +assets/scenes/test_levels/sutaru/sutaru_room_0.c +assets/scenes/test_levels/sutaru/sutaru_scene.c +assets/scenes/test_levels/syotes2/syotes2_room_0.c +assets/scenes/test_levels/syotes2/syotes2_scene.c +assets/scenes/test_levels/syotes/syotes_room_0.c +assets/scenes/test_levels/syotes/syotes_scene.c +assets/scenes/test_levels/test01/test01_room_0.c +assets/scenes/test_levels/test01/test01_scene.c +assets/scenes/test_levels/testroom/testroom_room_0.c +assets/scenes/test_levels/testroom/testroom_room_1.c +assets/scenes/test_levels/testroom/testroom_room_2.c +assets/scenes/test_levels/testroom/testroom_room_3.c +assets/scenes/test_levels/testroom/testroom_room_4.c +assets/scenes/test_levels/testroom/testroom_scene.c +assets/textures/backgrounds/vr_ALVR_pal_static.c +assets/textures/backgrounds/vr_ALVR_static.c +assets/textures/backgrounds/vr_DGVR_pal_static.c +assets/textures/backgrounds/vr_DGVR_static.c +assets/textures/backgrounds/vr_FCVR_pal_static.c +assets/textures/backgrounds/vr_FCVR_static.c +assets/textures/backgrounds/vr_GLVR_pal_static.c +assets/textures/backgrounds/vr_GLVR_static.c +assets/textures/backgrounds/vr_IPVR_pal_static.c +assets/textures/backgrounds/vr_IPVR_static.c +assets/textures/backgrounds/vr_K3VR_pal_static.c +assets/textures/backgrounds/vr_K3VR_static.c +assets/textures/backgrounds/vr_K4VR_pal_static.c +assets/textures/backgrounds/vr_K4VR_static.c +assets/textures/backgrounds/vr_K5VR_pal_static.c +assets/textures/backgrounds/vr_K5VR_static.c +assets/textures/backgrounds/vr_KHVR_pal_static.c +assets/textures/backgrounds/vr_KHVR_static.c +assets/textures/backgrounds/vr_KKRVR_pal_static.c +assets/textures/backgrounds/vr_KKRVR_static.c +assets/textures/backgrounds/vr_KR3VR_pal_static.c +assets/textures/backgrounds/vr_KR3VR_static.c +assets/textures/backgrounds/vr_KSVR_pal_static.c +assets/textures/backgrounds/vr_KSVR_static.c +assets/textures/backgrounds/vr_LBVR_pal_static.c +assets/textures/backgrounds/vr_LBVR_static.c +assets/textures/backgrounds/vr_LHVR_pal_static.c +assets/textures/backgrounds/vr_LHVR_static.c +assets/textures/backgrounds/vr_MDVR_pal_static.c +assets/textures/backgrounds/vr_MDVR_static.c +assets/textures/backgrounds/vr_MLVR_pal_static.c +assets/textures/backgrounds/vr_MLVR_static.c +assets/textures/backgrounds/vr_MNVR_pal_static.c +assets/textures/backgrounds/vr_MNVR_static.c +assets/textures/backgrounds/vr_NSVR_pal_static.c +assets/textures/backgrounds/vr_NSVR_static.c +assets/textures/backgrounds/vr_RUVR_pal_static.c +assets/textures/backgrounds/vr_RUVR_static.c +assets/textures/backgrounds/vr_SP1a_pal_static.c +assets/textures/backgrounds/vr_SP1a_static.c +assets/textures/backgrounds/vr_TTVR_pal_static.c +assets/textures/backgrounds/vr_TTVR_static.c +assets/textures/backgrounds/vr_ZRVR_pal_static.c +assets/textures/backgrounds/vr_ZRVR_static.c +assets/textures/do_action_static/do_action_static.c +assets/textures/icon_item_dungeon_static/icon_item_dungeon_static.c +assets/textures/icon_item_field_static/icon_item_field_static.c +assets/textures/icon_item_gameover_static/icon_item_gameover_static.c +assets/textures/icon_item_static/icon_item_static.c +assets/textures/kanji/kanji.c +assets/textures/map_48x85_static/map_48x85_static.c +assets/textures/map_grand_static/map_grand_static.c +assets/textures/map_i_static/map_i_static.c +assets/textures/map_name_static/map_name_static.c +assets/textures/message_static/message_static.c +assets/textures/message_texture_static/message_texture_static.c +assets/textures/nes_font_static/nes_font_static.c +assets/textures/nintendo_rogo_static/nintendo_rogo_static.c +assets/textures/parameter_static/parameter_static.c +assets/textures/skyboxes/vr_cloud0_pal_static.c +assets/textures/skyboxes/vr_cloud0_static.c +assets/textures/skyboxes/vr_cloud1_pal_static.c +assets/textures/skyboxes/vr_cloud1_static.c +assets/textures/skyboxes/vr_cloud2_pal_static.c +assets/textures/skyboxes/vr_cloud2_static.c +assets/textures/skyboxes/vr_cloud3_pal_static.c +assets/textures/skyboxes/vr_cloud3_static.c +assets/textures/skyboxes/vr_fine0_pal_static.c +assets/textures/skyboxes/vr_fine0_static.c +assets/textures/skyboxes/vr_fine1_pal_static.c +assets/textures/skyboxes/vr_fine1_static.c +assets/textures/skyboxes/vr_fine2_pal_static.c +assets/textures/skyboxes/vr_fine2_static.c +assets/textures/skyboxes/vr_fine3_pal_static.c +assets/textures/skyboxes/vr_fine3_static.c +assets/textures/skyboxes/vr_holy0_pal_static.c +assets/textures/skyboxes/vr_holy0_static.c +assets/textures/skyboxes/vr_holy1_pal_static.c +assets/textures/skyboxes/vr_holy1_static.c +assets/textures/title_static/title_static.c diff --git a/tools/assets/extract/z64_resource_handlers.py b/tools/assets/extract/z64_resource_handlers.py new file mode 100644 index 0000000000..d0b6c2067a --- /dev/null +++ b/tools/assets/extract/z64_resource_handlers.py @@ -0,0 +1,469 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +from typing import Callable + +from ..descriptor.base import ResourceDesc +from ..descriptor import n64resources +from ..descriptor import z64resources + +from .extase import ( + File, + Resource, + BinaryBlobResource, +) +from .extase.cdata_resources import Vec3sArrayResource, S16ArrayResource + +from .extase_oot64 import ( + skeleton_resources, + skeleton_skin_resources, + animation_resources, + collision_resources, + dlist_resources, + playeranim_resources, + skelcurve_resources, + misc_resources, + scene_rooms_resources, + scene_commands_resource, + skelanime_legacy_resources, + room_shape_resources, +) + + +# +# resource handlers +# + + +class ResourceHandlerException(Exception): ... + + +class ResourceNeedsPostProcessWithPoolResourcesException(ResourceHandlerException): + def __init__( + self, + *args, + resource: Resource, + callback: Callable[[dict[ResourceDesc, Resource]], None], + ): + super().__init__(*args) + self.resource = resource + self.callback = callback + + def __repr__(self) -> str: + return ( + super().__repr__().removesuffix(")") + + f", resource={self.resource!r}" + + f", callback={self.callback!r})" + ) + + +ResourceHandler = Callable[[File, ResourceDesc], Resource] + + +def register_resource_handlers(): + + def skeleton_resource_handler( + file: File, + resource_desc: z64resources.SkeletonResourceDesc, + ): + offset = resource_desc.offset + if resource_desc.limb_type == z64resources.LimbType.STANDARD: + if resource_desc.type == z64resources.SkeletonType.NORMAL: + res = skeleton_resources.SkeletonNormalResource( + file, + offset, + resource_desc.symbol_name, + ) + elif resource_desc.type == z64resources.SkeletonType.FLEX: + res = skeleton_resources.SkeletonFlexResource( + file, + offset, + resource_desc.symbol_name, + ) + else: + raise NotImplementedError( + "unimplemented SkeletonType", + resource_desc.type, + ) + elif resource_desc.limb_type == z64resources.LimbType.LOD: + if resource_desc.type == z64resources.SkeletonType.NORMAL: + res = skeleton_resources.SkeletonNormalLODResource( + file, offset, resource_desc.symbol_name + ) + elif resource_desc.type == z64resources.SkeletonType.FLEX: + res = skeleton_resources.SkeletonFlexLODResource( + file, offset, resource_desc.symbol_name + ) + else: + raise NotImplementedError( + "LimbType=LOD", + "unimplemented SkeletonType", + resource_desc.type, + ) + elif resource_desc.limb_type == z64resources.LimbType.SKIN: + assert resource_desc.type == z64resources.SkeletonType.NORMAL + res = skeleton_skin_resources.SkeletonSkinResource( + file, offset, resource_desc.symbol_name + ) + elif resource_desc.limb_type == z64resources.LimbType.CURVE: + assert resource_desc.type == z64resources.SkeletonType.CURVE + res = skelcurve_resources.CurveSkeletonHeaderResource( + file, offset, resource_desc.symbol_name + ) + else: + raise NotImplementedError( + "unimplemented Skeleton LimbType", + resource_desc.limb_type, + ) + # TODO check is this works for SkeletonSkinResource + # TODO implement for CurveSkeletonHeaderResource + if resource_desc.limb_enum_name is not None: + res.set_enum_name(resource_desc.limb_enum_name) + if resource_desc.limb_enum_none_member_name is not None: + res.set_enum_member_name_none(resource_desc.limb_enum_none_member_name) + if resource_desc.limb_enum_max_member_name is not None: + res.set_enum_member_name_max(resource_desc.limb_enum_max_member_name) + return res + + def limb_resource_handler( + file: File, + resource_desc: z64resources.LimbResourceDesc, + ): + offset = resource_desc.offset + if resource_desc.limb_type == z64resources.LimbType.STANDARD: + res = skeleton_resources.StandardLimbResource( + file, + offset, + resource_desc.symbol_name, + ) + elif resource_desc.limb_type == z64resources.LimbType.SKIN: + res = skeleton_skin_resources.SkinLimbResource( + file, offset, resource_desc.symbol_name + ) + elif resource_desc.limb_type == z64resources.LimbType.LOD: + res = skeleton_resources.LODLimbResource( + file, offset, resource_desc.symbol_name + ) + elif resource_desc.limb_type == z64resources.LimbType.LEGACY: + return skelanime_legacy_resources.LegacyLimbResource( + file, offset, resource_desc.symbol_name + ) + elif resource_desc.limb_type == z64resources.LimbType.CURVE: + res = skelcurve_resources.SkelCurveLimbResource( + file, offset, resource_desc.symbol_name + ) + else: + raise NotImplementedError( + "unimplemented LimbType", + resource_desc.limb_type, + ) + # TODO check this works for SkinLimbResource + # TODO implement for SkelCurveLimbResource + if resource_desc.limb_enum_member_name is not None: + res.set_enum_member_name(resource_desc.limb_enum_member_name) + return res + + def limb_table_handler( + file: File, + resource_desc: z64resources.LimbTableResourceDesc, + ): + if resource_desc.limb_type == z64resources.LimbType.STANDARD: + resource = skeleton_resources.StandardLimbsArrayResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + resource.set_length(resource_desc.count) + return resource + elif resource_desc.limb_type == z64resources.LimbType.SKIN: + resource = skeleton_skin_resources.SkinLimbsArrayResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + resource.set_length(resource_desc.count) + return resource + elif resource_desc.limb_type == z64resources.LimbType.LOD: + resource = skeleton_resources.LODLimbsArrayResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + resource.set_length(resource_desc.count) + return resource + elif resource_desc.limb_type == z64resources.LimbType.LEGACY: + resource = skelanime_legacy_resources.LegacyLimbsArrayResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + ) + resource.set_length(resource_desc.count) + return resource + else: + raise NotImplementedError("LimbTable of limb type", resource_desc.limb_type) + + def animation_resource_handler( + file: File, + resource_desc: z64resources.AnimationResourceDesc, + ): + return animation_resources.AnimationResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + ) + + def collision_resource_handler( + file: File, + resource_desc: z64resources.CollisionResourceDesc, + ): + return collision_resources.CollisionResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + ) + + def dlist_resource_handler( + file: File, + resource_desc: n64resources.DListResourceDesc, + ): + res = dlist_resources.DListResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + target_ucode={ + n64resources.GfxMicroCode.F3DEX: dlist_resources.Ucode.f3dex, + n64resources.GfxMicroCode.F3DEX2: dlist_resources.Ucode.f3dex2, + }[resource_desc.ucode], + ) + res.ignored_raw_pointers |= resource_desc.raw_pointers + return res + + def texture_resource_handler( + file: File, resource_desc: n64resources.TextureResourceDesc + ): + res = dlist_resources.TextureResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + resource_desc.format.fmt, + resource_desc.format.siz, + resource_desc.width, + resource_desc.height, + ) + if "hackmode_ignore_orphaned_tlut" in resource_desc.hack_modes: + res.HACK_ignore_orphaned_tlut = True + return res + + def ci_texture_resource_handler( + file: File, resource_desc: n64resources.CITextureResourceDesc + ): + if ( + "hackmode_split_tlut_true" in resource_desc.hack_modes + or "hackmode_split_tlut_false" in resource_desc.hack_modes + ): + resource = dlist_resources.TextureSplitTlutResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + resource_desc.format.fmt, + resource_desc.format.siz, + resource_desc.width, + resource_desc.height, + "hackmode_split_tlut_false" in resource_desc.hack_modes, + ) + else: + resource = dlist_resources.TextureResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + resource_desc.format.fmt, + resource_desc.format.siz, + resource_desc.width, + resource_desc.height, + ) + + def callback_set_tlut(pool_resources_by_desc): + resource_tlut_desc = resource_desc.tlut + resource_tlut = pool_resources_by_desc[resource_tlut_desc] + resource.set_tlut(resource_tlut) + + raise ResourceNeedsPostProcessWithPoolResourcesException( + resource=resource, callback=callback_set_tlut + ) + + def PlayerAnimationData_handler( + file: File, + resource_desc: z64resources.PlayerAnimationDataResourceDesc, + ): + res = playeranim_resources.PlayerAnimationDataResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + ) + res.set_frame_count(resource_desc.frame_count) + return res + + def PlayerAnimation_handler( + file: File, + resource_desc: z64resources.PlayerAnimationResourceDesc, + ): + return playeranim_resources.PlayerAnimationResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + ) + + def vec3s_array_resource_handler( + file: File, + resource_desc: n64resources.Vec3sArrayResourceDesc, + ): + return Vec3sArrayResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + resource_desc.count, + ) + + def s16_array_resource_handler( + file: File, + resource_desc: n64resources.S16ArrayResourceDesc, + ): + return S16ArrayResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + resource_desc.count, + ) + + def vtx_array_resource_handler( + file: File, + resource_desc: n64resources.VtxArrayResourceDesc, + ): + return dlist_resources.VtxArrayResource( + file, + resource_desc.offset, + ( + resource_desc.offset + + ( + resource_desc.count + * dlist_resources.VtxArrayResource.element_cdata_ext.size + ) + ), + resource_desc.symbol_name, + ) + + def binary_blob_resource_handler( + file: File, + resource_desc: n64resources.BlobResourceDesc, + ): + return BinaryBlobResource( + file, + resource_desc.offset, + resource_desc.offset + resource_desc.size, + resource_desc.symbol_name, + ) + + def CurveAnimation_handler( + file: File, + resource_desc: z64resources.CurveAnimationResourceDesc, + ): + # TODO use resource_desc.skeleton + return skelcurve_resources.CurveAnimationHeaderResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + + def Mtx_handler( + file: File, + resource_desc: n64resources.MtxResourceDesc, + ): + return dlist_resources.MtxResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + + def cutscene_resource_handler( + file: File, + resource_desc: z64resources.CutsceneResourceDesc, + ): + return misc_resources.CutsceneResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + + def scene_resource_handler( + file: File, + resource_desc: z64resources.SceneResourceDesc, + ): + return scene_commands_resource.SceneCommandsResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + + def room_resource_handler( + file: File, + resource_desc: z64resources.RoomResourceDesc, + ): + if "hackmode_syotes_room" in resource_desc.hack_modes: + return room_shape_resources.RoomShapeNormalResource( + file, + resource_desc.offset, + resource_desc.symbol_name, + ) + return scene_commands_resource.SceneCommandsResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + + def path_list_resource_handler( + file: File, + resource_desc: z64resources.PathListResourceDesc, + ): + resource = scene_rooms_resources.PathListResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + resource.set_length(resource_desc.num_paths) + return resource + + def legacy_animation_handler( + file: File, + resource_desc: z64resources.LegacyAnimationResourceDesc, + ): + return skelanime_legacy_resources.LegacyAnimationResource( + file, resource_desc.offset, resource_desc.symbol_name + ) + + RESOURCE_HANDLERS.update( + { + z64resources.SkeletonResourceDesc: skeleton_resource_handler, + z64resources.LimbResourceDesc: limb_resource_handler, + z64resources.AnimationResourceDesc: animation_resource_handler, + z64resources.CollisionResourceDesc: collision_resource_handler, + n64resources.DListResourceDesc: dlist_resource_handler, + n64resources.TextureResourceDesc: texture_resource_handler, + n64resources.CITextureResourceDesc: ci_texture_resource_handler, + z64resources.PlayerAnimationDataResourceDesc: PlayerAnimationData_handler, + n64resources.Vec3sArrayResourceDesc: vec3s_array_resource_handler, + n64resources.S16ArrayResourceDesc: s16_array_resource_handler, + n64resources.VtxArrayResourceDesc: vtx_array_resource_handler, + z64resources.PlayerAnimationResourceDesc: PlayerAnimation_handler, + n64resources.BlobResourceDesc: binary_blob_resource_handler, + n64resources.MtxResourceDesc: Mtx_handler, + z64resources.LegacyAnimationResourceDesc: legacy_animation_handler, + z64resources.LimbTableResourceDesc: limb_table_handler, + z64resources.CurveAnimationResourceDesc: CurveAnimation_handler, + z64resources.SceneResourceDesc: scene_resource_handler, + z64resources.RoomResourceDesc: room_resource_handler, + z64resources.PathListResourceDesc: path_list_resource_handler, + z64resources.CutsceneResourceDesc: cutscene_resource_handler, + } + ) + + +RESOURCE_HANDLERS: dict[str, ResourceHandler] = {} + + +def get_resource_from_desc( + file: File, + resource_desc: ResourceDesc, +) -> Resource: + resource_handler = RESOURCE_HANDLERS.get(type(resource_desc)) + + if resource_handler is None: + raise Exception("Unknown resource descriptor type", resource_desc) + + try: + resource = resource_handler(file, resource_desc) + except ResourceHandlerException: + raise + + return resource diff --git a/tools/assets/n64.py b/tools/assets/n64.py new file mode 100644 index 0000000000..e3ebf70528 --- /dev/null +++ b/tools/assets/n64.py @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: © 2025 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +import enum + + +class G_IM_FMT(enum.Enum): + RGBA = 0 + YUV = 1 + CI = 2 + IA = 3 + I = 4 + + def __init__(self, i: int): + self.i = i + + by_i: dict[int, "G_IM_FMT"] + + +G_IM_FMT.by_i = {fmt.i: fmt for fmt in G_IM_FMT} + + +class G_IM_SIZ(enum.Enum): + _4b = (0, 4) + _8b = (1, 8) + _16b = (2, 16) + _32b = (3, 32) + + def __init__(self, i: int, bpp: int): + self.i = i + self.bpp = bpp + + by_i: dict[int, "G_IM_SIZ"] + + +G_IM_SIZ.by_i = {siz.i: siz for siz in G_IM_SIZ} + + +G_MDSFT_TEXTLUT = 14 + + +class G_TT(enum.Enum): + NONE = 0b00 << G_MDSFT_TEXTLUT + RGBA16 = 0b10 << G_MDSFT_TEXTLUT + IA16 = 0b11 << G_MDSFT_TEXTLUT + + def __init__(self, i: int): + self.i = i + + by_i: dict[int, "G_TT"] + + +G_TT.by_i = {tt.i: tt for tt in G_TT} diff --git a/tools/assets/n64texconv/__init__.py b/tools/assets/n64texconv/__init__.py index 9e4ea1c510..82c4c4a3db 100644 --- a/tools/assets/n64texconv/__init__.py +++ b/tools/assets/n64texconv/__init__.py @@ -245,6 +245,13 @@ class N64Palette(Structure): _object_refcount.add_ref(pal) return deref(pal) + def resize(self, new_count : int) -> Optional["N64Palette"]: + if new_count > 256: + raise ValueError("The largest possible palette size is 256") + pal = ln64texconv.n64texconv_palette_resize(byref(self), new_count) + _object_refcount.add_ref(pal) + return deref(pal) + @staticmethod def from_png(path : str, fmt : int) -> Optional["N64Palette"]: if fmt not in (G_IM_FMT_RGBA, G_IM_FMT_IA): @@ -306,6 +313,10 @@ ln64texconv.n64texconv_palette_copy.restype = POINTER(N64Palette) ln64texconv.n64texconv_palette_reformat.argtypes = [POINTER(N64Palette), c_int] ln64texconv.n64texconv_palette_reformat.restype = POINTER(N64Palette) +# struct n64_palette *n64texconv_palette_resize(struct n64_palette *pal, size_t new_count); +ln64texconv.n64texconv_palette_resize.argtypes = [POINTER(N64Palette), c_size_t] +ln64texconv.n64texconv_palette_resize.restype = POINTER(N64Palette) + # struct n64_palette *n64texconv_palette_from_png(const char *path, int fmt); ln64texconv.n64texconv_palette_from_png.argtypes = [c_char_p, c_int] ln64texconv.n64texconv_palette_from_png.restype = POINTER(N64Palette) @@ -354,9 +365,9 @@ class N64Image(Structure): return deref(ln64texconv.n64texconv_image_new(width, height, fmt, siz, pal)) def __del__(self): - ln64texconv.n64texconv_image_free(byref(self)) # Also free the palette if the reference count drops to 0 _object_refcount.rm_ref(self.pal, ln64texconv.n64texconv_palette_free) + ln64texconv.n64texconv_image_free(byref(self)) def copy(self) -> Optional["N64Image"]: _object_refcount.add_ref(self.pal) diff --git a/tools/assets/n64texconv/src/libn64texconv/n64texconv.c b/tools/assets/n64texconv/src/libn64texconv/n64texconv.c index 06caf36f60..6f533b0b49 100644 --- a/tools/assets/n64texconv/src/libn64texconv/n64texconv.c +++ b/tools/assets/n64texconv/src/libn64texconv/n64texconv.c @@ -119,7 +119,7 @@ n64texconv_quantize(uint8_t *out_indices, struct color *out_pal, size_t *out_pal * out_indices, out_pal, out_pal_count, texels, widths, heights are all arrays of size num_images * texels[i] and out_indices[i] are arrays of size widths[i] * heights[i] */ -UNUSED static int +int n64texconv_quantize_shared(uint8_t **out_indices, struct color *out_pal, size_t *out_pal_count, struct color **texels, size_t *widths, size_t *heights, size_t num_images, unsigned int max_colors, float dither_level) @@ -590,6 +590,24 @@ n64texconv_palette_reformat(struct n64_palette *pal, int fmt) return new_pal; } +struct n64_palette * +n64texconv_palette_resize(struct n64_palette *pal, size_t new_count) +{ + assert(pal != NULL); + + struct n64_palette *new_pal = n64texconv_palette_new(new_count, pal->fmt); + + size_t min_count = (new_count < pal->count) ? new_count : pal->count; + + size_t i; + for (i = 0; i < min_count; i++) + new_pal->texels[i] = pal->texels[i]; + for (i = min_count; i < new_count; i++) + new_pal->texels[i] = (struct color){ .w = 0 }; + + return new_pal; +} + struct n64_palette * n64texconv_palette_from_png(const char *path, int fmt) { @@ -880,13 +898,10 @@ n64texconv_image_from_png(const char *path, int fmt, int siz, int pal_fmt) if (plte.n_entries == 0) goto error_post_create_img; - // TODO ZAPD always writes 256-color palettes which breaks this, enable it when we can -#if 0 // Palette must have sufficiently few colors for the target format. If there are too // many, requantize to the maximum amount for the target format. if (plte.n_entries > max_colors) goto requantize; -#endif pal = n64texconv_palette_new(plte.n_entries, pal_fmt); if (pal == NULL) @@ -922,9 +937,9 @@ n64texconv_image_from_png(const char *path, int fmt, int siz, int pal_fmt) assert(rv == 0); } else { // Input is not an indexed png, quantize and generate palette -#if 0 + requantize: // Input is an indexed png but has too many colors, requantize with new palette -#endif + rv = spng_decode_image(ctx, (void *)img->texels, nbytes, SPNG_FMT_RGBA8, 0); assert(rv == 0); diff --git a/tools/assets/n64texconv/src/libn64texconv/n64texconv.h b/tools/assets/n64texconv/src/libn64texconv/n64texconv.h index 1c2dd98fcc..85962f72a1 100644 --- a/tools/assets/n64texconv/src/libn64texconv/n64texconv.h +++ b/tools/assets/n64texconv/src/libn64texconv/n64texconv.h @@ -55,6 +55,9 @@ n64texconv_palette_copy(struct n64_palette *pal); struct n64_palette * n64texconv_palette_reformat(struct n64_palette *pal, int fmt); +struct n64_palette * +n64texconv_palette_resize(struct n64_palette *pal, size_t new_count); + struct n64_palette * n64texconv_palette_from_png(const char *path, int fmt); @@ -119,4 +122,9 @@ n64texconv_image_to_c_file(const char *out_path, struct n64_image *img, bool pad const char * n64texconv_png_extension(struct n64_image *img); +int +n64texconv_quantize_shared(uint8_t **out_indices, struct color *out_pal, size_t *out_pal_count, struct color **texels, + size_t *widths, size_t *heights, size_t num_images, unsigned int max_colors, + float dither_level); + #endif diff --git a/tools/audio/extraction/audio_extract.py b/tools/audio/extraction/audio_extract.py index 29bf632e3a..a524312be1 100644 --- a/tools/audio/extraction/audio_extract.py +++ b/tools/audio/extraction/audio_extract.py @@ -49,7 +49,7 @@ BASEROM_DEBUG = False # Run # ====================================================================================================================== -def collect_sample_banks(audiotable_seg : memoryview, extracted_dir : str, version_info : GameVersionInfo, +def collect_sample_banks(audiotable_seg : memoryview, output_dir : str, version_info : GameVersionInfo, table : AudioCodeTable, samplebank_descs : Dict[int, SampleBankExtractionDescription]): sample_banks : List[Union[AudioTableFile, int]] = [] @@ -76,7 +76,7 @@ def collect_sample_banks(audiotable_seg : memoryview, extracted_dir : str, versi extraction_desc=samplebank_descs.get(i, None)) if BASEROM_DEBUG: - bank.dump_bin(f"{extracted_dir}/baserom_audiotest/audiotable_files/{bank.file_name}.bin") + bank.dump_bin(f"{output_dir}/baserom_audiotest/audiotable_files/{bank.file_name}.bin") sample_banks.append(bank) @@ -90,7 +90,7 @@ def bank_data_lookup(sample_banks : List[Union[AudioTableFile, int]], e : Union[ else: return e -def collect_soundfonts(audiobank_seg : memoryview, extracted_dir : str, version_info : GameVersionInfo, +def collect_soundfonts(audiobank_seg : memoryview, output_dir : str, version_info : GameVersionInfo, sound_font_table : AudioCodeTable, soundfont_descs : Dict[int, SoundFontExtractionDescription], sample_banks : List[Union[AudioTableFile, int]]): soundfonts = [] @@ -110,7 +110,7 @@ def collect_soundfonts(audiobank_seg : memoryview, extracted_dir : str, version_ if BASEROM_DEBUG: # Write the individual file for debugging and comparison - soundfont.dump_bin(f"{extracted_dir}/baserom_audiotest/audiobank_files/{soundfont.file_name}.bin") + soundfont.dump_bin(f"{output_dir}/baserom_audiotest/audiobank_files/{soundfont.file_name}.bin") return soundfonts @@ -133,17 +133,17 @@ def aifc_extract_one_bin(base_path : str, sample : AudioTableData): else: sample.to_file(f"{base_path}/{sample.filename}") -def extract_samplebank(pool : ThreadPool, extracted_dir : str, sample_banks : List[Union[AudioTableFile, int]], +def extract_samplebank(pool : ThreadPool, output_dir : str, sample_banks : List[Union[AudioTableFile, int]], bank : AudioTableFile, write_xml : bool): # deal with remaining gaps, have to blob them unless we can find an exact match in another bank bank.finalize_coverage(sample_banks) # assign names bank.assign_names() - base_path = f"{extracted_dir}/assets/audio/samples/{bank.name}" + base_path = f"{output_dir}/assets/audio/samples/{bank.name}" # write xml - with open(f"{extracted_dir}/assets/audio/samplebanks/{bank.file_name}.xml", "w") as outfile: + with open(f"{output_dir}/assets/audio/samplebanks/{bank.file_name}.xml", "w") as outfile: outfile.write(bank.to_xml(f"assets/audio/samples/{bank.name}")) # write the extraction xml if specified @@ -175,17 +175,17 @@ def extract_samplebank(pool : ThreadPool, extracted_dir : str, sample_banks : Li if not BASEROM_DEBUG: shutil.rmtree(f"{base_path}/aifc") -def disassemble_one_sequence(extracted_dir : str, version_info : GameVersionInfo, soundfonts : List[AudiobankFile], +def disassemble_one_sequence(output_dir : str, version_info : GameVersionInfo, soundfonts : List[AudiobankFile], enum_names : List[str], id : int, data : bytes, name : str, filename : str, fonts : memoryview): - out_filename = f"{extracted_dir}/assets/audio/sequences/{filename}.seq" + out_filename = f"{output_dir}/assets/audio/sequences/{filename}.seq" disas = SequenceDisassembler(id, data, version_info.seq_disas_tables.get(id, None), CMD_SPEC, version_info.mml_version, out_filename, name, [soundfonts[i] for i in fonts], enum_names) disas.analyze() disas.emit() -def extract_sequences(audioseq_seg : memoryview, extracted_dir : str, version_info : GameVersionInfo, write_xml : bool, +def extract_sequences(audioseq_seg : memoryview, output_dir : str, version_info : GameVersionInfo, write_xml : bool, sequence_table : AudioCodeTable, sequence_font_table : memoryview, sequence_descs : Dict[int, SequenceExtractionDescription], soundfonts : List[AudiobankFile]): @@ -198,9 +198,9 @@ def extract_sequences(audioseq_seg : memoryview, extracted_dir : str, version_in assert len(seq_enum_names) == len(sequence_table) if BASEROM_DEBUG: - os.makedirs(f"{extracted_dir}/baserom_audiotest/audioseq_files", exist_ok=True) + os.makedirs(f"{output_dir}/baserom_audiotest/audioseq_files", exist_ok=True) - os.makedirs(f"{extracted_dir}/assets/audio/sequences", exist_ok=True) + os.makedirs(f"{output_dir}/assets/audio/sequences", exist_ok=True) if write_xml: os.makedirs(f"assets/xml/audio/sequences", exist_ok=True) @@ -235,7 +235,7 @@ def extract_sequences(audioseq_seg : memoryview, extracted_dir : str, version_in if BASEROM_DEBUG: # Extract original sequence binary for comparison - with open(f"{extracted_dir}/baserom_audiotest/audioseq_files/seq_{i}{ext}.aseq", "wb") as outfile: + with open(f"{output_dir}/baserom_audiotest/audioseq_files/seq_{i}{ext}.aseq", "wb") as outfile: outfile.write(seq_data) extraction_desc = sequence_descs.get(i, None) @@ -301,12 +301,12 @@ def extract_sequences(audioseq_seg : memoryview, extracted_dir : str, version_in # Disassemble to text for job in disas_jobs: - disassemble_one_sequence(extracted_dir, version_info, soundfonts, seq_enum_names, *job) + disassemble_one_sequence(output_dir, version_info, soundfonts, seq_enum_names, *job) dt = time.time() - t print(f"Sequences extraction took {dt:.3f}s") -def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : str, read_xml : bool, write_xml : bool): +def extract_audio_for_version(version_info : GameVersionInfo, output_dir : str, baserom_segments_dir : str, read_xml : bool, write_xml : bool): print("Setting up...") # Open baserom segments @@ -316,16 +316,16 @@ def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : st audiobank_seg = None audioseq_seg = None - with open(f"{extracted_dir}/baserom/code", "rb") as infile: + with open(f"{baserom_segments_dir}/code", "rb") as infile: code_seg = memoryview(infile.read()) - with open(f"{extracted_dir}/baserom/Audiotable", "rb") as infile: + with open(f"{baserom_segments_dir}/Audiotable", "rb") as infile: audiotable_seg = memoryview(infile.read()) - with open(f"{extracted_dir}/baserom/Audiobank", "rb") as infile: + with open(f"{baserom_segments_dir}/Audiobank", "rb") as infile: audiobank_seg = memoryview(infile.read()) - with open(f"{extracted_dir}/baserom/Audioseq", "rb") as infile: + with open(f"{baserom_segments_dir}/Audioseq", "rb") as infile: audioseq_seg = memoryview(infile.read()) # ================================================================================================================== @@ -342,18 +342,18 @@ def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : st if BASEROM_DEBUG: # Extract Table Binaries - os.makedirs(f"{extracted_dir}/baserom_audiotest/audio_code_tables/", exist_ok=True) + os.makedirs(f"{output_dir}/baserom_audiotest/audio_code_tables/", exist_ok=True) - with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/samplebank_table.bin", "wb") as outfile: + with open(f"{output_dir}/baserom_audiotest/audio_code_tables/samplebank_table.bin", "wb") as outfile: outfile.write(sample_bank_table.data) - with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/soundfont_table.bin", "wb") as outfile: + with open(f"{output_dir}/baserom_audiotest/audio_code_tables/soundfont_table.bin", "wb") as outfile: outfile.write(sound_font_table.data) - with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/sequence_table.bin", "wb") as outfile: + with open(f"{output_dir}/baserom_audiotest/audio_code_tables/sequence_table.bin", "wb") as outfile: outfile.write(sequence_table.data) - with open(f"{extracted_dir}/baserom_audiotest/audio_code_tables/sequence_font_table.bin", "wb") as outfile: + with open(f"{output_dir}/baserom_audiotest/audio_code_tables/sequence_font_table.bin", "wb") as outfile: outfile.write(sequence_font_table) # ================================================================================================================== @@ -384,16 +384,16 @@ def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : st # ================================================================================================================== if BASEROM_DEBUG: - os.makedirs(f"{extracted_dir}/baserom_audiotest/audiotable_files", exist_ok=True) - sample_banks = collect_sample_banks(audiotable_seg, extracted_dir, version_info, sample_bank_table, samplebank_descs) + os.makedirs(f"{output_dir}/baserom_audiotest/audiotable_files", exist_ok=True) + sample_banks = collect_sample_banks(audiotable_seg, output_dir, version_info, sample_bank_table, samplebank_descs) # ================================================================================================================== # Collect soundfonts # ================================================================================================================== if BASEROM_DEBUG: - os.makedirs(f"{extracted_dir}/baserom_audiotest/audiobank_files", exist_ok=True) - soundfonts = collect_soundfonts(audiobank_seg, extracted_dir, version_info, sound_font_table, soundfont_descs, + os.makedirs(f"{output_dir}/baserom_audiotest/audiobank_files", exist_ok=True) + soundfonts = collect_soundfonts(audiobank_seg, output_dir, version_info, sound_font_table, soundfont_descs, sample_banks) # ================================================================================================================== @@ -413,14 +413,14 @@ def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : st # Check that the sampleconv binary is available assert os.path.isfile(SAMPLECONV_PATH) , "Compile sampleconv" - os.makedirs(f"{extracted_dir}/assets/audio/samplebanks", exist_ok=True) + os.makedirs(f"{output_dir}/assets/audio/samplebanks", exist_ok=True) if write_xml: os.makedirs(f"assets/xml/audio/samplebanks", exist_ok=True) with ThreadPool(processes=os.cpu_count()) as pool: for bank in sample_banks: if isinstance(bank, AudioTableFile): - extract_samplebank(pool, extracted_dir, sample_banks, bank, write_xml) + extract_samplebank(pool, output_dir, sample_banks, bank, write_xml) # ================================================================================================================== # Extract soundfonts @@ -428,7 +428,7 @@ def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : st print("Extracting soundfonts...") - os.makedirs(f"{extracted_dir}/assets/audio/soundfonts", exist_ok=True) + os.makedirs(f"{output_dir}/assets/audio/soundfonts", exist_ok=True) if write_xml: os.makedirs(f"assets/xml/audio/soundfonts", exist_ok=True) @@ -441,7 +441,7 @@ def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : st sf.finalize() # write the soundfont xml itself - with open(f"{extracted_dir}/assets/audio/soundfonts/{sf.file_name}.xml", "w") as outfile: + with open(f"{output_dir}/assets/audio/soundfonts/{sf.file_name}.xml", "w") as outfile: outfile.write(sf.to_xml(f"Soundfont_{i}", "assets/audio/samplebanks")) # write the extraction xml if specified @@ -454,5 +454,5 @@ def extract_audio_for_version(version_info : GameVersionInfo, extracted_dir : st print("Extracting sequences...") - extract_sequences(audioseq_seg, extracted_dir, version_info, write_xml, sequence_table, sequence_font_table, + extract_sequences(audioseq_seg, output_dir, version_info, write_xml, sequence_table, sequence_font_table, sequence_descs, soundfonts) diff --git a/tools/csdis.py b/tools/csdis.py index f83efd3aa1..d4baec1398 100755 --- a/tools/csdis.py +++ b/tools/csdis.py @@ -306,6 +306,138 @@ sequence_ids = { 0xFFFF: "NA_BGM_DISABLED", } +cutscene_cmd_ids = { + 0xFFFF: "CS_CMD_END_OF_SCRIPT", + 0x0001: "CS_CMD_CAM_EYE_SPLINE", + 0x0002: "CS_CMD_CAM_AT_SPLINE", + 0x0003: "CS_CMD_MISC", + 0x0004: "CS_CMD_LIGHT_SETTING", + 0x0005: "CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER", + 0x0006: "CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER", + 0x0007: "CS_CMD_CAM_EYE", + 0x0008: "CS_CMD_CAM_AT", + 0x0009: "CS_CMD_RUMBLE_CONTROLLER", + 0x000A: "CS_CMD_PLAYER_CUE", + 0x000B: "CS_CMD_UNIMPLEMENTED_B", + 0x000D: "CS_CMD_UNIMPLEMENTED_D", + 0x000E: "CS_CMD_ACTOR_CUE_1_0", + 0x000F: "CS_CMD_ACTOR_CUE_0_0", + 0x0010: "CS_CMD_ACTOR_CUE_1_1", + 0x0011: "CS_CMD_ACTOR_CUE_0_1", + 0x0012: "CS_CMD_ACTOR_CUE_0_2", + 0x0013: "CS_CMD_TEXT", + 0x0015: "CS_CMD_UNIMPLEMENTED_15", + 0x0016: "CS_CMD_UNIMPLEMENTED_16", + 0x0017: "CS_CMD_ACTOR_CUE_0_3", + 0x0018: "CS_CMD_ACTOR_CUE_1_2", + 0x0019: "CS_CMD_ACTOR_CUE_2_0", + 0x001B: "CS_CMD_UNIMPLEMENTED_1B", + 0x001C: "CS_CMD_UNIMPLEMENTED_1C", + 0x001D: "CS_CMD_ACTOR_CUE_3_0", + 0x001E: "CS_CMD_ACTOR_CUE_4_0", + 0x001F: "CS_CMD_ACTOR_CUE_6_0", + 0x0020: "CS_CMD_UNIMPLEMENTED_20", + 0x0021: "CS_CMD_UNIMPLEMENTED_21", + 0x0022: "CS_CMD_ACTOR_CUE_0_4", + 0x0023: "CS_CMD_ACTOR_CUE_1_3", + 0x0024: "CS_CMD_ACTOR_CUE_2_1", + 0x0025: "CS_CMD_ACTOR_CUE_3_1", + 0x0026: "CS_CMD_ACTOR_CUE_4_1", + 0x0027: "CS_CMD_ACTOR_CUE_0_5", + 0x0028: "CS_CMD_ACTOR_CUE_1_4", + 0x0029: "CS_CMD_ACTOR_CUE_2_2", + 0x002A: "CS_CMD_ACTOR_CUE_3_2", + 0x002B: "CS_CMD_ACTOR_CUE_4_2", + 0x002C: "CS_CMD_ACTOR_CUE_5_0", + 0x002D: "CS_CMD_TRANSITION", + 0x002E: "CS_CMD_ACTOR_CUE_0_6", + 0x002F: "CS_CMD_ACTOR_CUE_4_3", + 0x0030: "CS_CMD_ACTOR_CUE_1_5", + 0x0031: "CS_CMD_ACTOR_CUE_7_0", + 0x0032: "CS_CMD_ACTOR_CUE_2_3", + 0x0033: "CS_CMD_ACTOR_CUE_3_3", + 0x0034: "CS_CMD_ACTOR_CUE_6_1", + 0x0035: "CS_CMD_ACTOR_CUE_3_4", + 0x0036: "CS_CMD_ACTOR_CUE_4_4", + 0x0037: "CS_CMD_ACTOR_CUE_5_1", + 0x0039: "CS_CMD_ACTOR_CUE_6_2", + 0x003A: "CS_CMD_ACTOR_CUE_6_3", + 0x003B: "CS_CMD_UNIMPLEMENTED_3B", + 0x003C: "CS_CMD_ACTOR_CUE_7_1", + 0x003D: "CS_CMD_UNIMPLEMENTED_3D", + 0x003E: "CS_CMD_ACTOR_CUE_8_0", + 0x003F: "CS_CMD_ACTOR_CUE_3_5", + 0x0040: "CS_CMD_ACTOR_CUE_1_6", + 0x0041: "CS_CMD_ACTOR_CUE_3_6", + 0x0042: "CS_CMD_ACTOR_CUE_3_7", + 0x0043: "CS_CMD_ACTOR_CUE_2_4", + 0x0044: "CS_CMD_ACTOR_CUE_1_7", + 0x0045: "CS_CMD_ACTOR_CUE_2_5", + 0x0046: "CS_CMD_ACTOR_CUE_1_8", + 0x0047: "CS_CMD_UNIMPLEMENTED_47", + 0x0048: "CS_CMD_ACTOR_CUE_2_6", + 0x0049: "CS_CMD_UNIMPLEMENTED_49", + 0x004A: "CS_CMD_ACTOR_CUE_2_7", + 0x004B: "CS_CMD_ACTOR_CUE_3_8", + 0x004C: "CS_CMD_ACTOR_CUE_0_7", + 0x004D: "CS_CMD_ACTOR_CUE_5_2", + 0x004E: "CS_CMD_ACTOR_CUE_1_9", + 0x004F: "CS_CMD_ACTOR_CUE_4_5", + 0x0050: "CS_CMD_ACTOR_CUE_1_10", + 0x0051: "CS_CMD_ACTOR_CUE_2_8", + 0x0052: "CS_CMD_ACTOR_CUE_3_9", + 0x0053: "CS_CMD_ACTOR_CUE_4_6", + 0x0054: "CS_CMD_ACTOR_CUE_5_3", + 0x0055: "CS_CMD_ACTOR_CUE_0_8", + 0x0056: "CS_CMD_START_SEQ", + 0x0057: "CS_CMD_STOP_SEQ", + 0x0058: "CS_CMD_ACTOR_CUE_6_4", + 0x0059: "CS_CMD_ACTOR_CUE_7_2", + 0x005A: "CS_CMD_ACTOR_CUE_5_4", + 0x005D: "CS_CMD_ACTOR_CUE_0_9", + 0x005E: "CS_CMD_ACTOR_CUE_1_11", + 0x0069: "CS_CMD_ACTOR_CUE_0_10", + 0x006A: "CS_CMD_ACTOR_CUE_2_9", + 0x006B: "CS_CMD_ACTOR_CUE_0_11", + 0x006C: "CS_CMD_ACTOR_CUE_3_10", + 0x006D: "CS_CMD_UNIMPLEMENTED_6D", + 0x006E: "CS_CMD_ACTOR_CUE_0_12", + 0x006F: "CS_CMD_ACTOR_CUE_7_3", + 0x0070: "CS_CMD_UNIMPLEMENTED_70", + 0x0071: "CS_CMD_UNIMPLEMENTED_71", + 0x0072: "CS_CMD_ACTOR_CUE_7_4", + 0x0073: "CS_CMD_ACTOR_CUE_6_5", + 0x0074: "CS_CMD_ACTOR_CUE_1_12", + 0x0075: "CS_CMD_ACTOR_CUE_2_10", + 0x0076: "CS_CMD_ACTOR_CUE_1_13", + 0x0077: "CS_CMD_ACTOR_CUE_0_13", + 0x0078: "CS_CMD_ACTOR_CUE_1_14", + 0x0079: "CS_CMD_ACTOR_CUE_2_11", + 0x007B: "CS_CMD_ACTOR_CUE_0_14", + 0x007C: "CS_CMD_FADE_OUT_SEQ", + 0x007D: "CS_CMD_ACTOR_CUE_1_15", + 0x007E: "CS_CMD_ACTOR_CUE_2_12", + 0x007F: "CS_CMD_ACTOR_CUE_3_11", + 0x0080: "CS_CMD_ACTOR_CUE_4_7", + 0x0081: "CS_CMD_ACTOR_CUE_5_5", + 0x0082: "CS_CMD_ACTOR_CUE_6_6", + 0x0083: "CS_CMD_ACTOR_CUE_1_16", + 0x0084: "CS_CMD_ACTOR_CUE_2_13", + 0x0085: "CS_CMD_ACTOR_CUE_3_12", + 0x0086: "CS_CMD_ACTOR_CUE_7_5", + 0x0087: "CS_CMD_ACTOR_CUE_4_8", + 0x0088: "CS_CMD_ACTOR_CUE_5_6", + 0x0089: "CS_CMD_ACTOR_CUE_6_7", + 0x008A: "CS_CMD_ACTOR_CUE_0_15", + 0x008B: "CS_CMD_ACTOR_CUE_0_16", + 0x008C: "CS_CMD_TIME", + 0x008D: "CS_CMD_ACTOR_CUE_1_17", + 0x008E: "CS_CMD_ACTOR_CUE_7_6", + 0x008F: "CS_CMD_ACTOR_CUE_9_0", + 0x0090: "CS_CMD_ACTOR_CUE_0_17", + 0x03E8: "CS_CMD_DESTINATION", +} + cutscene_misc_types = { 0x00: "CS_MISC_UNIMPLEMENTED_0", 0x01: "CS_MISC_RAIN", @@ -508,17 +640,17 @@ cutscene_command_macros = { 10: ("CS_PLAYER_CUE_LIST(%w1:1:s)", 2, None, 0, "CS_PLAYER_CUE(%h2:1:e6, %h1:1:s, %h2:2:s, %h1:2:x, %h2:3:x, %h1:3:x, %w1:4:s, %w1:5:s, %w1:6:s, %w1:7:s, %w1:8:s, %w1:9:s, %w1:10:f, %w1:11:f, %w1:12:f)", 12), - (15,17,18,23,34,39,46,76,85,93,105,107,110,119,123,138,139,144, # npc action 1 - 14,16,24,35,40,48,64,68,70,78,80,94,116,118,120,125,131,141, # npc action 2 - 25,36,41,50,67,69,72,74,81,106,117,121,126,132, # npc action 3 - 29,37,42,51,53,63,65,66,75,82,108,127,133, # npc action 4 - 30,38,43,47,54,79,83,128,135, # npc action 5 - 44,55,77,84,90,129,136, # npc action 6 - 31,52,57,58,88,115,130,137, # npc action 7 - 49,60,89,111,114,134,142, # npc action 8 - 62, # npc action 9 - 143): # npc action 10 - ("CS_ACTOR_CUE_LIST(%w1:0:s, %w1:1:s)", 2, None, 0, + (15,17,18,23,34,39,46,76,85,93,105,107,110,119,123,138,139,144, # actor cue 1 + 14,16,24,35,40,48,64,68,70,78,80,94,116,118,120,125,131,141, # actor cue 2 + 25,36,41,50,67,69,72,74,81,106,117,121,126,132, # actor cue 3 + 29,37,42,51,53,63,65,66,75,82,108,127,133, # actor cue 4 + 30,38,43,47,54,79,83,128,135, # actor cue 5 + 44,55,77,84,90,129,136, # actor cue 6 + 31,52,57,58,88,115,130,137, # actor cue 7 + 49,60,89,111,114,134,142, # actor cue 8 + 62, # actor cue 9 + 143): # actor cue 10 + ("CS_ACTOR_CUE_LIST(%w1:0:e8, %w1:1:s)", 2, None, 0, "CS_ACTOR_CUE(%h2:1:x, %h1:1:s, %h2:2:s, %h1:2:x, %h2:3:x, %h1:3:x, %w1:4:s, %w1:5:s, %w1:6:s, %w1:7:s, %w1:8:s, %w1:9:s, %w1:10:f, %w1:11:f, %w1:12:f)", 12), 1: ("CS_CAM_EYE_SPLINE(%h1:1:s, %h2:2:s)", 3, 0, None, @@ -672,6 +804,8 @@ def format_arg(arg, words): result = player_cue_ids[unsigned_value] elif enum_no == 7: result = fade_out_seq_player[unsigned_value] + elif enum_no == 8: + result = cutscene_cmd_ids[unsigned_value] elif format_type == "u": result = str(value) elif format_type == "s": diff --git a/tools/extract_assets.py b/tools/extract_assets.py deleted file mode 100755 index 09519cb1ea..0000000000 --- a/tools/extract_assets.py +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import json -import os -import signal -import time -import multiprocessing -from pathlib import Path - -import version_config - - -def SignalHandler(sig, frame): - print(f'Signal {sig} received. Aborting...') - mainAbort.set() - # Don't exit immediately to update the extracted assets file. - -def ExtractFile(assetConfig: version_config.AssetConfig, outputPath: Path, outputSourcePath: Path): - name = assetConfig.name - xmlPath = assetConfig.xml_path - version = globalVersionConfig.version - if globalAbort.is_set(): - # Don't extract if another file wasn't extracted properly. - return - - zapdPath = Path("tools") / "ZAPD" / "ZAPD.out" - configPath = Path("tools") / "ZAPDConfigs" / version / "Config.xml" - - outputPath.mkdir(parents=True, exist_ok=True) - outputSourcePath.mkdir(parents=True, exist_ok=True) - - execStr = f"{zapdPath} e -eh -i {xmlPath} -b {globalBaseromSegmentsDir} -o {outputPath} -osf {outputSourcePath} -gsf 1 -rconf {configPath} --cs-float both {ZAPDArgs}" - - if name.startswith("code/") or name.startswith("n64dd/") or name.startswith("overlays/"): - assert assetConfig.start_offset is not None - assert assetConfig.end_offset is not None - - execStr += f" --start-offset 0x{assetConfig.start_offset:X}" - execStr += f" --end-offset 0x{assetConfig.end_offset:X}" - - if name.startswith("overlays/"): - overlayName = name.split("/")[1] - baseAddress = globalVersionConfig.dmadata_segments[overlayName].vram + assetConfig.start_offset - - execStr += f" --base-address 0x{baseAddress:X}" - execStr += " --static" - - if globalUnaccounted: - execStr += " -Wunaccounted" - - print(execStr) - exitValue = os.system(execStr) - if exitValue != 0: - globalAbort.set() - print("\n") - print(f"Error when extracting from file {xmlPath}", file=os.sys.stderr) - print("Aborting...", file=os.sys.stderr) - print("\n") - -def ExtractFunc(assetConfig: version_config.AssetConfig): - objectName = assetConfig.name - xml_path = assetConfig.xml_path - xml_path_str = str(xml_path) - - outPath = globalOutputDir / objectName - outSourcePath = outPath - - if xml_path_str in globalExtractedAssetsTracker: - timestamp = globalExtractedAssetsTracker[xml_path_str]["timestamp"] - modificationTime = int(os.path.getmtime(xml_path)) - if modificationTime < timestamp: - # XML has not been modified since last extraction. - return - - currentTimeStamp = int(time.time()) - - ExtractFile(assetConfig, outPath, outSourcePath) - - if not globalAbort.is_set(): - # Only update timestamp on successful extractions - if xml_path_str not in globalExtractedAssetsTracker: - globalExtractedAssetsTracker[xml_path_str] = globalManager.dict() - globalExtractedAssetsTracker[xml_path_str]["timestamp"] = currentTimeStamp - -def initializeWorker(versionConfig: version_config.VersionConfig, abort, unaccounted: bool, extractedAssetsTracker: dict, manager, baseromSegmentsDir: Path, outputDir: Path): - global globalVersionConfig - global globalAbort - global globalUnaccounted - global globalExtractedAssetsTracker - global globalManager - global globalBaseromSegmentsDir - global globalOutputDir - globalVersionConfig = versionConfig - globalAbort = abort - globalUnaccounted = unaccounted - globalExtractedAssetsTracker = extractedAssetsTracker - globalManager = manager - globalBaseromSegmentsDir = baseromSegmentsDir - globalOutputDir = outputDir - -def processZAPDArgs(argsZ): - badZAPDArg = False - for z in argsZ: - if z[0] == '-': - print(f'error: argument "{z}" starts with "-", which is not supported.', file=os.sys.stderr) - badZAPDArg = True - - if badZAPDArg: - exit(1) - - ZAPDArgs = " ".join(f"-{z}" for z in argsZ) - print("Using extra ZAPD arguments: " + ZAPDArgs) - return ZAPDArgs - -def main(): - parser = argparse.ArgumentParser(description="baserom asset extractor") - parser.add_argument( - "baserom_segments_dir", - type=Path, - help="Directory of uncompressed ROM segments", - ) - parser.add_argument( - "output_dir", - type=Path, - help="Output directory to place files in", - ) - parser.add_argument("-v", "--version", dest="oot_version", help="OOT game version", default="gc-eu-mq-dbg") - parser.add_argument("-s", "--single", help="Extract a single asset by name, e.g. objects/gameplay_keep") - parser.add_argument("-f", "--force", help="Force the extraction of every xml instead of checking the touched ones (overwriting current files).", action="store_true") - parser.add_argument("-j", "--jobs", help="Number of cpu cores to extract with.") - parser.add_argument("-u", "--unaccounted", help="Enables ZAPD unaccounted detector warning system.", action="store_true") - parser.add_argument("-Z", help="Pass the argument on to ZAPD, e.g. `-ZWunaccounted` to warn about unaccounted blocks in XMLs. Each argument should be passed separately, *without* the leading dash.", metavar="ZAPD_ARG", action="append") - args = parser.parse_args() - - baseromSegmentsDir: Path = args.baserom_segments_dir - version: str = args.oot_version - outputDir: Path = args.output_dir - - args.output_dir.mkdir(parents=True, exist_ok=True) - - versionConfig = version_config.load_version_config(version) - - global ZAPDArgs - ZAPDArgs = processZAPDArgs(args.Z) if args.Z else "" - - global mainAbort - mainAbort = multiprocessing.Event() - manager = multiprocessing.Manager() - signal.signal(signal.SIGINT, SignalHandler) - - extraction_times_p = outputDir / "assets_extraction_times.json" - extractedAssetsTracker = manager.dict() - if extraction_times_p.exists() and not args.force: - with extraction_times_p.open(encoding='utf-8') as f: - extractedAssetsTracker.update(json.load(f, object_hook=manager.dict)) - - singleAssetName = args.single - if singleAssetName is not None: - assetConfig = None - for asset in versionConfig.assets: - if asset.name == singleAssetName: - assetConfig = asset - break - else: - print(f"Error. Asset {singleAssetName} not found in config.", file=os.sys.stderr) - exit(1) - - initializeWorker(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager, baseromSegmentsDir, outputDir) - # Always extract if -s is used. - xml_path_str = str(assetConfig.xml_path) - if xml_path_str in extractedAssetsTracker: - del extractedAssetsTracker[xml_path_str] - ExtractFunc(assetConfig) - else: - class CannotMultiprocessError(Exception): - pass - - try: - numCores = int(args.jobs or 0) - if numCores <= 0: - numCores = 1 - print("Extracting assets with " + str(numCores) + " CPU core" + ("s" if numCores > 1 else "") + ".") - try: - mp_context = multiprocessing.get_context("fork") - except ValueError as e: - raise CannotMultiprocessError() from e - with mp_context.Pool(numCores, initializer=initializeWorker, initargs=(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager, baseromSegmentsDir, outputDir)) as p: - p.map(ExtractFunc, versionConfig.assets) - except (multiprocessing.ProcessError, TypeError, CannotMultiprocessError): - print("Warning: Multiprocessing exception occurred.", file=os.sys.stderr) - print("Disabling mutliprocessing.", file=os.sys.stderr) - - initializeWorker(versionConfig, mainAbort, args.unaccounted, extractedAssetsTracker, manager, baseromSegmentsDir, outputDir) - for assetConfig in versionConfig.assets: - ExtractFunc(assetConfig) - - with extraction_times_p.open('w', encoding='utf-8') as f: - serializableDict = dict() - for xml, data in extractedAssetsTracker.items(): - serializableDict[xml] = dict(data) - json.dump(dict(serializableDict), f, ensure_ascii=False, indent=4) - - if mainAbort.is_set(): - exit(1) - -if __name__ == "__main__": - main() diff --git a/tools/extract_assets.sh b/tools/extract_assets.sh new file mode 100755 index 0000000000..bda2b587da --- /dev/null +++ b/tools/extract_assets.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: © 2024 ZeldaRET +# SPDX-License-Identifier: CC0-1.0 + +if [ $# -eq 0 ] +then + echo "Usage: $0 [args...]" + exit 1 +fi + +v=$1 +.venv/bin/python3 -m tools.assets.extract extracted/$v/baserom extracted/$v -v $v "${@:2}" diff --git a/tools/extract_audio.py b/tools/extract_audio.py index ab5d5b3fb4..c67d7b1650 100644 --- a/tools/extract_audio.py +++ b/tools/extract_audio.py @@ -14,7 +14,8 @@ from audio.extraction.disassemble_sequence import MMLVersion, SequenceTableSpec, if __name__ == '__main__': parser = argparse.ArgumentParser(description="baserom audio asset extractor") - parser.add_argument("-o", "--extracted-dir", required=True, help="path to extracted directory") + parser.add_argument("-b", "--baserom-segments-dir", required=True, help="Directory of uncompressed ROM segments") + parser.add_argument("-o", "--output-dir", required=True, help="path to output directory") parser.add_argument("-v", "--version", required=True, help="version name") parser.add_argument("--read-xml", required=False, action="store_true", help="Read extraction xml files") parser.add_argument("--write-xml", required=False, action="store_true", help="Write extraction xml files") @@ -196,4 +197,4 @@ if __name__ == '__main__': audiotable_buffer_bugs, seq_disas_tables) - extract_audio_for_version(version_info, args.extracted_dir, args.read_xml, args.write_xml) + extract_audio_for_version(version_info, args.output_dir, args.baserom_segments_dir, args.read_xml, args.write_xml) diff --git a/tools/fix_bss.py b/tools/fix_bss.py index 61cb4985d8..743085cd17 100755 --- a/tools/fix_bss.py +++ b/tools/fix_bss.py @@ -82,7 +82,8 @@ class Pointer: @dataclass class BssSection: - start_address: int + base_start_address: int + build_start_address: int pointers: list[Pointer] @@ -294,7 +295,26 @@ def compare_pointers(version: str) -> dict[Path, BssSection]: object_file = Path("src/code/z_message.o") c_file = object_file.with_suffix(".c") - bss_sections[c_file] = BssSection(file.vram, pointers_in_section) + + # For the baserom, assume that the lowest address is the start of the BSS section. This might + # not be true if the first BSS variable is not referenced so account for that specifically. + + base_start_address = ( + min(p.base_value for p in pointers_in_section) + if pointers_in_section + else 0 + ) + # Account for the fact that z_rumble starts with unreferenced bss + if str(c_file) == "src/code/z_rumble.c": + base_start_address -= 0x10 + elif str(c_file) == "src/boot/z_locale.c": + base_start_address -= 0x18 + + build_start_address = file.vram + + bss_sections[c_file] = BssSection( + base_start_address, build_start_address, pointers_in_section + ) return bss_sections @@ -436,12 +456,10 @@ def determine_base_bss_ordering( build_bss_symbols: list[BssSymbol], bss_section: BssSection, ) -> list[BssSymbol]: - base_start_address = min(p.base_value for p in bss_section.pointers) - found_symbols: dict[str, BssSymbol] = {} for p in bss_section.pointers: - base_offset = p.base_value - base_start_address - build_offset = p.build_value - bss_section.start_address + base_offset = p.base_value - bss_section.base_start_address + build_offset = p.build_value - bss_section.build_start_address new_symbol = None new_offset = 0 @@ -814,18 +832,10 @@ def main(): for file, bss_section in bss_sections.items(): if not bss_section.pointers: continue - # The following heuristic doesn't work for z_locale, since the first pointer into BSS is not - # at the start of the section. Fortunately z_locale either has one BSS variable (in GC versions) - # or none (in N64 versions), so we can just skip it. - if str(file) == "src/boot/z_locale.c": - continue - # For the baserom, assume that the lowest address is the start of the BSS section. This might - # not be true if the first BSS variable is not referenced, but in practice this doesn't happen - # (except for z_locale above). - base_min_address = min(p.base_value for p in bss_section.pointers) - build_min_address = bss_section.start_address + if not all( - p.build_value - build_min_address == p.base_value - base_min_address + p.build_value - bss_section.build_start_address + == p.base_value - bss_section.base_start_address for p in bss_section.pointers ): files_with_reordering.append(file) diff --git a/tools/ido_block_numbers.py b/tools/ido_block_numbers.py index 292a14d387..188cf8f36d 100755 --- a/tools/ido_block_numbers.py +++ b/tools/ido_block_numbers.py @@ -483,7 +483,7 @@ def find_compiler_command_line( found = 0 for line in make_log: parts = line.split() - if "-o" in parts and str(filename) in parts: + if "./tools/preprocess.sh" in parts and "-o" in parts and str(filename) in parts: compiler_command_line = parts found += 1 @@ -551,7 +551,7 @@ def main(): command_line = find_compiler_command_line(make_log, args.filename) if command_line is None: print( - f"Error: could not determine compiler command line for {filename}", + f"Error: could not determine compiler command line for {args.filename}", file=sys.stderr, ) sys.exit(1)