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

Merge commit '324db1d578^' into doc_pause_menu

This commit is contained in:
Dragorn421 2024-01-27 22:45:29 +01:00
commit f53d0adebb
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335
495 changed files with 8605 additions and 9774 deletions

5
Jenkinsfile vendored
View file

@ -4,11 +4,6 @@ pipeline {
} }
stages { stages {
stage('Check for unused asm') {
steps {
sh './tools/find_unused_asm.sh'
}
}
stage('Setup') { stage('Setup') {
steps { steps {
sh 'cp /usr/local/etc/roms/baserom_oot.z64 baserom_original.z64' sh 'cp /usr/local/etc/roms/baserom_oot.z64 baserom_original.z64'

220
Makefile
View file

@ -7,13 +7,16 @@ SHELL = /bin/bash
# Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value' # Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value'
# If COMPARE is 1, check the output md5sum after building # If COMPARE is 1, check the output md5sum after building
COMPARE ?= 1 COMPARE := 1
# If NON_MATCHING is 1, define the NON_MATCHING C flag when building # If NON_MATCHING is 1, define the NON_MATCHING C flag when building
NON_MATCHING ?= 0 NON_MATCHING := 0
# If ORIG_COMPILER is 1, compile with QEMU_IRIX and the original compiler # If ORIG_COMPILER is 1, compile with QEMU_IRIX and the original compiler
ORIG_COMPILER ?= 0 ORIG_COMPILER := 0
# If COMPILER is "gcc", compile with GCC instead of IDO. # If COMPILER is "gcc", compile with GCC instead of IDO.
COMPILER ?= ido COMPILER := ido
# Target game version. Currently only the following version is supported:
# gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug (default)
VERSION := gc-eu-mq-dbg
CFLAGS ?= CFLAGS ?=
CPPFLAGS ?= CPPFLAGS ?=
@ -33,7 +36,7 @@ endif
# Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk! # Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk!
# In nearly all cases, not having 'mips-linux-gnu-*' binaries on the PATH is indicative of missing dependencies # In nearly all cases, not having 'mips-linux-gnu-*' binaries on the PATH is indicative of missing dependencies
MIPS_BINUTILS_PREFIX ?= mips-linux-gnu- MIPS_BINUTILS_PREFIX := mips-linux-gnu-
ifeq ($(NON_MATCHING),1) ifeq ($(NON_MATCHING),1)
CFLAGS += -DNON_MATCHING -DAVOID_UB CFLAGS += -DNON_MATCHING -DAVOID_UB
@ -41,10 +44,19 @@ ifeq ($(NON_MATCHING),1)
COMPARE := 0 COMPARE := 0
endif endif
# Version-specific settings
ifeq ($(VERSION),gc-eu-mq-dbg)
OPTFLAGS := -O2
else
$(error Unsupported version $(VERSION))
endif
PROJECT_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) PROJECT_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
BUILD_DIR := build/$(VERSION)
MAKE = make MAKE = make
CPPFLAGS += -fno-dollars-in-identifiers -P CFLAGS += -DOOT_DEBUG
CPPFLAGS += -DOOT_DEBUG -fno-dollars-in-identifiers -P
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
DETECTED_OS=windows DETECTED_OS=windows
@ -60,7 +72,7 @@ else
endif endif
endif endif
N_THREADS ?= $(shell nproc) N_THREADS := $(shell nproc)
#### Tools #### #### Tools ####
ifneq ($(shell type $(MIPS_BINUTILS_PREFIX)ld >/dev/null 2>/dev/null; echo $$?), 0) ifneq ($(shell type $(MIPS_BINUTILS_PREFIX)ld >/dev/null 2>/dev/null; echo $$?), 0)
@ -70,14 +82,12 @@ endif
# Detect compiler and set variables appropriately. # Detect compiler and set variables appropriately.
ifeq ($(COMPILER),gcc) ifeq ($(COMPILER),gcc)
CC := $(MIPS_BINUTILS_PREFIX)gcc CC := $(MIPS_BINUTILS_PREFIX)gcc
else else ifeq ($(COMPILER),ido)
ifeq ($(COMPILER),ido)
CC := tools/ido_recomp/$(DETECTED_OS)/7.1/cc CC := tools/ido_recomp/$(DETECTED_OS)/7.1/cc
CC_OLD := tools/ido_recomp/$(DETECTED_OS)/5.3/cc CC_OLD := tools/ido_recomp/$(DETECTED_OS)/5.3/cc
else else
$(error Unsupported compiler. Please use either ido or gcc as the COMPILER variable.) $(error Unsupported compiler. Please use either ido or gcc as the COMPILER variable.)
endif endif
endif
# if ORIG_COMPILER is 1, check that either QEMU_IRIX is set or qemu-irix package installed # if ORIG_COMPILER is 1, check that either QEMU_IRIX is set or qemu-irix package installed
ifeq ($(ORIG_COMPILER),1) ifeq ($(ORIG_COMPILER),1)
@ -91,14 +101,14 @@ ifeq ($(ORIG_COMPILER),1)
CC_OLD = $(QEMU_IRIX) -L tools/ido5.3_compiler tools/ido5.3_compiler/usr/bin/cc CC_OLD = $(QEMU_IRIX) -L tools/ido5.3_compiler tools/ido5.3_compiler/usr/bin/cc
endif endif
AS := $(MIPS_BINUTILS_PREFIX)as AS := $(MIPS_BINUTILS_PREFIX)as
LD := $(MIPS_BINUTILS_PREFIX)ld LD := $(MIPS_BINUTILS_PREFIX)ld
OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
EMULATOR ?=
EMU_FLAGS ?=
INC := -Iinclude -Iinclude/libc -Isrc -Ibuild -I. N64_EMULATOR ?=
INC := -Iinclude -Iinclude/libc -Isrc -I$(BUILD_DIR) -I.
# Check code syntax with host compiler # Check code syntax with host compiler
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces
@ -110,10 +120,12 @@ ELF2ROM := tools/elf2rom
ZAPD := tools/ZAPD/ZAPD.out ZAPD := tools/ZAPD/ZAPD.out
FADO := tools/fado/fado.elf FADO := tools/fado/fado.elf
# Command to replace path variables in the spec file. We can't use the C
# preprocessor for this because it won't substitute inside string literals.
SPEC_REPLACE_VARS := sed -e 's|$$(BUILD_DIR)|$(BUILD_DIR)|g'
ifeq ($(COMPILER),gcc) ifeq ($(COMPILER),gcc)
OPTFLAGS := -Os -ffast-math -fno-unsafe-math-optimizations OPTFLAGS := -Os -ffast-math -fno-unsafe-math-optimizations
else
OPTFLAGS := -O2
endif endif
ASFLAGS := -march=vr4300 -32 -no-pad-sections -Iinclude ASFLAGS := -march=vr4300 -32 -no-pad-sections -Iinclude
@ -147,7 +159,7 @@ OBJDUMP_FLAGS := -d -r -z -Mreg-names=32
#### Files #### #### Files ####
# ROM image # ROM image
ROM := zelda_ocarina_mq_dbg.z64 ROM := oot-$(VERSION).z64
ELF := $(ROM:.z64=.elf) ELF := $(ROM:.z64=.elf)
# description of ROM segments # description of ROM segments
SPEC := spec SPEC := spec
@ -162,19 +174,19 @@ ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*" -not -p
ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.xml)) ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.xml))
ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin)) ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin))
ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \ ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \
$(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f) \ $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),$(BUILD_DIR)/$f) \
$(foreach f,$(wildcard assets/text/*.c),build/$(f:.c=.o)) $(foreach f,$(wildcard assets/text/*.c),$(BUILD_DIR)/$(f:.c=.o))
UNDECOMPILED_DATA_DIRS := $(shell find data -type d) UNDECOMPILED_DATA_DIRS := $(shell find data -type d)
# source files # source files
C_FILES := $(filter-out %.inc.c,$(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c))) C_FILES := $(filter-out %.inc.c,$(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c)))
S_FILES := $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(wildcard $(dir)/*.s)) S_FILES := $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(wildcard $(dir)/*.s))
O_FILES := $(foreach f,$(S_FILES:.s=.o),build/$f) \ O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(C_FILES:.c=.o),build/$f) \ $(foreach f,$(C_FILES:.c=.o),$(BUILD_DIR)/$f) \
$(foreach f,$(wildcard baserom/*),build/$f.o) $(foreach f,$(wildcard baserom/*),$(BUILD_DIR)/$f.o)
OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | grep -o '[^"]*_reloc.o' ) OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(SPEC_REPLACE_VARS) | grep -o '[^"]*_reloc.o' )
# Automatic dependency files # Automatic dependency files
# (Only asm_processor dependencies and reloc dependencies are handled for now) # (Only asm_processor dependencies and reloc dependencies are handled for now)
@ -183,63 +195,63 @@ DEP_FILES := $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d)
TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png)) TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png))
TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg)) TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg))
TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),build/$f) \ TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),$(BUILD_DIR)/$f) \
$(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),build/$f) \ $(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),$(BUILD_DIR)/$f) \
# create build directories # create build directories
$(shell mkdir -p build/baserom build/assets/text $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS) $(ASSET_BIN_DIRS),build/$(dir))) $(shell mkdir -p $(BUILD_DIR)/baserom $(BUILD_DIR)/assets/text $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS) $(ASSET_BIN_DIRS),$(BUILD_DIR)/$(dir)))
ifeq ($(COMPILER),ido) ifeq ($(COMPILER),ido)
build/src/code/fault.o: CFLAGS += -trapuv $(BUILD_DIR)/src/code/fault.o: CFLAGS += -trapuv
build/src/code/fault.o: OPTFLAGS := -O2 -g3 $(BUILD_DIR)/src/code/fault.o: OPTFLAGS := -O2 -g3
build/src/code/fault_drawer.o: CFLAGS += -trapuv $(BUILD_DIR)/src/code/fault_drawer.o: CFLAGS += -trapuv
build/src/code/fault_drawer.o: OPTFLAGS := -O2 -g3 $(BUILD_DIR)/src/code/fault_drawer.o: OPTFLAGS := -O2 -g3
build/src/code/ucode_disas.o: OPTFLAGS := -O2 -g3 $(BUILD_DIR)/src/code/ucode_disas.o: OPTFLAGS := -O2 -g3
build/src/code/fmodf.o: OPTFLAGS := -g $(BUILD_DIR)/src/code/fmodf.o: OPTFLAGS := -g
build/src/code/__osMemset.o: OPTFLAGS := -g $(BUILD_DIR)/src/code/__osMemset.o: OPTFLAGS := -g
build/src/code/__osMemmove.o: OPTFLAGS := -g $(BUILD_DIR)/src/code/__osMemmove.o: OPTFLAGS := -g
build/src/audio/%.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) # Use signed chars instead of unsigned for this audio file (needed to match AudioDebug_ScrPrt)
build/src/audio/general.o: CFLAGS += -signed $(BUILD_DIR)/src/audio/general.o: CFLAGS += -signed
# Put string literals in .data for some audio files (needed to match these files with literals) # Put string literals in .data for some audio files (needed to match these files with literals)
build/src/audio/sfx.o: CFLAGS += -use_readwrite_const $(BUILD_DIR)/src/audio/sfx.o: CFLAGS += -use_readwrite_const
build/src/audio/sequence.o: CFLAGS += -use_readwrite_const $(BUILD_DIR)/src/audio/sequence.o: CFLAGS += -use_readwrite_const
build/src/libultra/libc/absf.o: OPTFLAGS := -O2 -g3 $(BUILD_DIR)/src/libultra/libc/absf.o: OPTFLAGS := -O2 -g3
build/src/libultra/libc/sqrt.o: OPTFLAGS := -O2 -g3 $(BUILD_DIR)/src/libultra/libc/sqrt.o: OPTFLAGS := -O2 -g3
build/src/libultra/libc/ll.o: OPTFLAGS := -O1 $(BUILD_DIR)/src/libultra/libc/ll.o: OPTFLAGS := -O1
build/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32 $(BUILD_DIR)/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32
build/src/libultra/libc/llcvt.o: OPTFLAGS := -O1 $(BUILD_DIR)/src/libultra/libc/llcvt.o: OPTFLAGS := -O1
build/src/libultra/libc/llcvt.o: MIPS_VERSION := -mips3 -32 $(BUILD_DIR)/src/libultra/libc/llcvt.o: MIPS_VERSION := -mips3 -32
build/src/libultra/os/%.o: OPTFLAGS := -O1 $(BUILD_DIR)/src/libultra/os/%.o: OPTFLAGS := -O1
build/src/libultra/io/%.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/libultra/io/%.o: OPTFLAGS := -O2
build/src/libultra/libc/%.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/libultra/libc/%.o: OPTFLAGS := -O2
build/src/libultra/rmon/%.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/libultra/rmon/%.o: OPTFLAGS := -O2
build/src/libultra/gu/%.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/libultra/gu/%.o: OPTFLAGS := -O2
build/assets/misc/z_select_static/%.o: CFLAGS += -DF3DEX_GBI $(BUILD_DIR)/assets/misc/z_select_static/%.o: CFLAGS += -DF3DEX_GBI
build/src/libultra/gu/%.o: CC := $(CC_OLD) $(BUILD_DIR)/src/libultra/gu/%.o: CC := $(CC_OLD)
build/src/libultra/io/%.o: CC := $(CC_OLD) $(BUILD_DIR)/src/libultra/io/%.o: CC := $(CC_OLD)
build/src/libultra/libc/%.o: CC := $(CC_OLD) $(BUILD_DIR)/src/libultra/libc/%.o: CC := $(CC_OLD)
build/src/libultra/os/%.o: CC := $(CC_OLD) $(BUILD_DIR)/src/libultra/os/%.o: CC := $(CC_OLD)
build/src/libultra/rmon/%.o: CC := $(CC_OLD) $(BUILD_DIR)/src/libultra/rmon/%.o: CC := $(CC_OLD)
build/src/code/jpegutils.o: CC := $(CC_OLD) $(BUILD_DIR)/src/code/jpegutils.o: CC := $(CC_OLD)
build/src/code/jpegdecoder.o: CC := $(CC_OLD) $(BUILD_DIR)/src/code/jpegdecoder.o: CC := $(CC_OLD)
build/src/boot/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) -- $(BUILD_DIR)/src/boot/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/src/code/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) -- $(BUILD_DIR)/src/code/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/src/overlays/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) -- $(BUILD_DIR)/src/overlays/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/assets/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) -- $(BUILD_DIR)/assets/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
else else
build/src/libultra/libc/ll.o: OPTFLAGS := -Ofast $(BUILD_DIR)/src/libultra/libc/ll.o: OPTFLAGS := -Ofast
build/src/%.o: CC := $(CC) -fexec-charset=euc-jp $(BUILD_DIR)/src/%.o: CC := $(CC) -fexec-charset=euc-jp
endif endif
#### Main Targets ### #### Main Targets ###
@ -251,12 +263,12 @@ ifeq ($(COMPARE),1)
endif endif
clean: clean:
$(RM) -r $(ROM) $(ELF) build $(RM) -r $(ROM) $(ELF) $(BUILD_DIR)
assetclean: assetclean:
$(RM) -r $(ASSET_BIN_DIRS) $(RM) -r $(ASSET_BIN_DIRS)
$(RM) -r assets/text/*.h $(RM) -r assets/text/*.h
$(RM) -r build/assets $(RM) -r $(BUILD_DIR)/assets
$(RM) -r .extracted-assets.json $(RM) -r .extracted-assets.json
distclean: clean assetclean distclean: clean assetclean
@ -270,10 +282,10 @@ setup:
python3 extract_assets.py -j$(N_THREADS) python3 extract_assets.py -j$(N_THREADS)
run: $(ROM) run: $(ROM)
ifeq ($(EMULATOR),) ifeq ($(N64_EMULATOR),)
$(error Emulator path not set. Set EMULATOR in the Makefile or define it as an environment variable) $(error Emulator path not set. Set N64_EMULATOR in the Makefile or define it as an environment variable)
endif endif
$(EMULATOR) $(EMU_FLAGS) $< $(N64_EMULATOR) $<
.PHONY: all clean setup run distclean assetclean .PHONY: all clean setup run distclean assetclean
@ -283,8 +295,8 @@ endif
$(ROM): $(ELF) $(ROM): $(ELF)
$(ELF2ROM) -cic 6105 $< $@ $(ELF2ROM) -cic 6105 $< $@
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) build/ldscript.txt build/undefined_syms.txt $(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(BUILD_DIR)/ldscript.txt $(BUILD_DIR)/undefined_syms.txt
$(LD) -T build/undefined_syms.txt -T build/ldscript.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map build/z64.map -o $@ $(LD) -T $(BUILD_DIR)/undefined_syms.txt -T $(BUILD_DIR)/ldscript.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(BUILD_DIR)/z64.map -o $@
## Order-only prerequisites ## Order-only prerequisites
# These ensure e.g. the O_FILES are built before the OVL_RELOC_FILES. # These ensure e.g. the O_FILES are built before the OVL_RELOC_FILES.
@ -298,84 +310,84 @@ $(O_FILES): | asset_files
.PHONY: o_files asset_files .PHONY: o_files asset_files
build/$(SPEC): $(SPEC) $(BUILD_DIR)/$(SPEC): $(SPEC)
$(CPP) $(CPPFLAGS) $< > $@ $(CPP) $(CPPFLAGS) $< | $(SPEC_REPLACE_VARS) > $@
build/ldscript.txt: build/$(SPEC) $(BUILD_DIR)/ldscript.txt: $(BUILD_DIR)/$(SPEC)
$(MKLDSCRIPT) $< $@ $(MKLDSCRIPT) $< $@
build/undefined_syms.txt: undefined_syms.txt $(BUILD_DIR)/undefined_syms.txt: undefined_syms.txt
$(CPP) $(CPPFLAGS) $< > $@ $(CPP) $(CPPFLAGS) $< > $@
build/baserom/%.o: baserom/% $(BUILD_DIR)/baserom/%.o: baserom/%
$(OBJCOPY) -I binary -O elf32-big $< $@ $(OBJCOPY) -I binary -O elf32-big $< $@
build/data/%.o: data/%.s $(BUILD_DIR)/data/%.o: data/%.s
$(AS) $(ASFLAGS) $< -o $@ $(AS) $(ASFLAGS) $< -o $@
build/assets/text/%.enc.h: assets/text/%.h assets/text/charmap.txt $(BUILD_DIR)/assets/text/%.enc.h: assets/text/%.h assets/text/charmap.txt
python3 tools/msgenc.py assets/text/charmap.txt $< $@ python3 tools/msgenc.py assets/text/charmap.txt $< $@
# Dependencies for files including message data headers # Dependencies for files including message data headers
# TODO remove when full header dependencies are used. # TODO remove when full header dependencies are used.
build/assets/text/fra_message_data_static.o: build/assets/text/message_data.enc.h $(BUILD_DIR)/assets/text/fra_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.h
build/assets/text/ger_message_data_static.o: build/assets/text/message_data.enc.h $(BUILD_DIR)/assets/text/ger_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.h
build/assets/text/nes_message_data_static.o: build/assets/text/message_data.enc.h $(BUILD_DIR)/assets/text/nes_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.h
build/assets/text/staff_message_data_static.o: build/assets/text/message_data_staff.enc.h $(BUILD_DIR)/assets/text/staff_message_data_static.o: $(BUILD_DIR)/assets/text/message_data_staff.enc.h
build/src/code/z_message_PAL.o: build/assets/text/message_data.enc.h build/assets/text/message_data_staff.enc.h $(BUILD_DIR)/src/code/z_message_PAL.o: $(BUILD_DIR)/assets/text/message_data.enc.h $(BUILD_DIR)/assets/text/message_data_staff.enc.h
build/assets/%.o: assets/%.c $(BUILD_DIR)/assets/%.o: assets/%.c
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
$(OBJCOPY) -O binary $@ $@.bin $(OBJCOPY) -O binary $@ $@.bin
build/src/%.o: src/%.s $(BUILD_DIR)/src/%.o: src/%.s
$(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@ $(CPP) $(CPPFLAGS) -Iinclude $< | $(AS) $(ASFLAGS) -o $@
build/dmadata_table_spec.h: build/$(SPEC) $(BUILD_DIR)/dmadata_table_spec.h: $(BUILD_DIR)/$(SPEC)
$(MKDMADATA) $< $@ $(MKDMADATA) $< $@
# Dependencies for files that may include the dmadata header automatically generated from the spec file # Dependencies for files that may include the dmadata header automatically generated from the spec file
build/src/boot/z_std_dma.o: build/dmadata_table_spec.h $(BUILD_DIR)/src/boot/z_std_dma.o: $(BUILD_DIR)/dmadata_table_spec.h
build/src/dmadata/dmadata.o: build/dmadata_table_spec.h $(BUILD_DIR)/src/dmadata/dmadata.o: $(BUILD_DIR)/dmadata_table_spec.h
# Dependencies for files including from include/tables/ # Dependencies for files including from include/tables/
# TODO remove when full header dependencies are used. # TODO remove when full header dependencies are used.
build/src/code/graph.o: include/tables/gamestate_table.h $(BUILD_DIR)/src/code/graph.o: include/tables/gamestate_table.h
build/src/code/object_table.o: include/tables/object_table.h $(BUILD_DIR)/src/code/object_table.o: include/tables/object_table.h
build/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.o: include/tables/actor_table.h # so uses of ACTOR_ID_MAX update when the table length changes
build/src/code/z_actor_dlftbls.o: include/tables/actor_table.h $(BUILD_DIR)/src/code/z_actor_dlftbls.o: include/tables/actor_table.h
build/src/code/z_effect_soft_sprite_dlftbls.o: include/tables/effect_ss_table.h $(BUILD_DIR)/src/code/z_effect_soft_sprite_dlftbls.o: include/tables/effect_ss_table.h
build/src/code/z_game_dlftbls.o: include/tables/gamestate_table.h $(BUILD_DIR)/src/code/z_game_dlftbls.o: include/tables/gamestate_table.h
build/src/code/z_scene_table.o: include/tables/scene_table.h include/tables/entrance_table.h $(BUILD_DIR)/src/code/z_scene_table.o: include/tables/scene_table.h include/tables/entrance_table.h
build/src/%.o: src/%.c $(BUILD_DIR)/src/%.o: src/%.c
$(CC_CHECK) $< $(CC_CHECK) $<
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
@$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s) @$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
build/src/libultra/libc/ll.o: src/libultra/libc/ll.c $(BUILD_DIR)/src/libultra/libc/ll.o: src/libultra/libc/ll.c
$(CC_CHECK) $< $(CC_CHECK) $<
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
python3 tools/set_o32abi_bit.py $@ python3 tools/set_o32abi_bit.py $@
@$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s) @$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
build/src/libultra/libc/llcvt.o: src/libultra/libc/llcvt.c $(BUILD_DIR)/src/libultra/libc/llcvt.o: src/libultra/libc/llcvt.c
$(CC_CHECK) $< $(CC_CHECK) $<
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
python3 tools/set_o32abi_bit.py $@ python3 tools/set_o32abi_bit.py $@
@$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s) @$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
build/src/overlays/%_reloc.o: build/$(SPEC) $(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/$(SPEC)
$(FADO) $$(tools/reloc_prereq $< $(notdir $*)) -n $(notdir $*) -o $(@:.o=.s) -M $(@:.o=.d) $(FADO) $$(tools/reloc_prereq $< $(notdir $*)) -n $(notdir $*) -o $(@:.o=.s) -M $(@:.o=.d)
$(AS) $(ASFLAGS) $(@:.o=.s) -o $@ $(AS) $(ASFLAGS) $(@:.o=.s) -o $@
build/%.inc.c: %.png $(BUILD_DIR)/%.inc.c: %.png
$(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@ $(ZAPD) btex -eh -tt $(subst .,,$(suffix $*)) -i $< -o $@
build/assets/%.bin.inc.c: assets/%.bin $(BUILD_DIR)/assets/%.bin.inc.c: assets/%.bin
$(ZAPD) bblb -eh -i $< -o $@ $(ZAPD) bblb -eh -i $< -o $@
build/assets/%.jpg.inc.c: assets/%.jpg $(BUILD_DIR)/assets/%.jpg.inc.c: assets/%.jpg
$(ZAPD) bren -eh -i $< -o $@ $(ZAPD) bren -eh -i $< -o $@
-include $(DEP_FILES) -include $(DEP_FILES)

View file

@ -29,7 +29,7 @@ The only build currently supported is Master Quest (Debug), but other versions a
It builds the following ROM: It builds the following ROM:
* zelda_ocarina_mq_dbg.z64 `md5: f0b7f35375f9cc8ca1b2d59d78e35405` * oot-gc-eu-mq-dbg.z64 `md5: f0b7f35375f9cc8ca1b2d59d78e35405`
**Note: This repository does not include any of the assets necessary to build the ROM. A prior copy of the game is required to extract the needed assets.** **Note: This repository does not include any of the assets necessary to build the ROM. A prior copy of the game is required to extract the needed assets.**
@ -123,16 +123,16 @@ Make sure your path to the project is not too long, otherwise this process may e
make make
``` ```
If all goes well, a new ROM called "zelda_ocarina_mq_debug.z64" should be built and the following text should be printed: If all goes well, a new ROM called "oot-gc-eu-mq-dbg.z64" should be built and the following text should be printed:
```bash ```bash
zelda_ocarina_mq_dbg.z64: OK oot-gc-eu-mq-dbg.z64: OK
``` ```
If you instead see the following: If you instead see the following:
```bash ```bash
zelda_ocarina_mq_dbg.z64: FAILED oot-gc-eu-mq-dbg.z64: FAILED
md5sum: WARNING: 1 computed checksum did NOT match md5sum: WARNING: 1 computed checksum did NOT match
``` ```

View file

@ -1,25 +1,25 @@
<Root> <Root>
<File Name="object_brob" Segment="6"> <File Name="object_brob" Segment="6">
<Animation Name="object_brob_Anim_000290" Offset="0x290"/> <Animation Name="gBrobStunnedAnim" Offset="0x290"/>
<DList Name="object_brob_DL_0007E0" Offset="0x7E0"/> <DList Name="gBrobBaseSegmentDL" Offset="0x7E0"/>
<DList Name="object_brob_DL_000898" Offset="0x898"/> <DList Name="gBrobLowerSegmentDL" Offset="0x898"/>
<DList Name="object_brob_DL_0009D0" Offset="0x9D0"/> <DList Name="gBrobMiddleSegmentDL" Offset="0x9D0"/>
<DList Name="object_brob_DL_000AE8" Offset="0xAE8"/> <DList Name="gBrobUpperSegmentDL" Offset="0xAE8"/>
<DList Name="object_brob_DL_000C00" Offset="0xC00"/> <DList Name="gBrobTopSegmentDL" Offset="0xC00"/>
<Texture Name="object_brob_Tex_000D48" OutName="tex_00000D48" Format="rgba16" Width="32" Height="32" Offset="0xD48"/> <Texture Name="gBrobFleshTex" OutName="flesh" Format="rgba16" Width="32" Height="32" Offset="0xD48"/>
<Limb Name="object_brob_Limb_001548" LimbType="Standard" Offset="0x1548"/> <Limb Name="gBrobRootLimb" LimbType="Standard" Offset="0x1548"/>
<Limb Name="object_brob_Limb_001554" LimbType="Standard" Offset="0x1554"/> <Limb Name="gBrobBaseSegmentRootLimb" LimbType="Standard" Offset="0x1554"/>
<Limb Name="object_brob_Limb_001560" LimbType="Standard" Offset="0x1560"/> <Limb Name="gBrobBaseSegmentLimb" LimbType="Standard" Offset="0x1560"/>
<Limb Name="object_brob_Limb_00156C" LimbType="Standard" Offset="0x156C"/> <Limb Name="gBrobLowerSegmentRootLimb" LimbType="Standard" Offset="0x156C"/>
<Limb Name="object_brob_Limb_001578" LimbType="Standard" Offset="0x1578"/> <Limb Name="gBrobLowerSegmentLimb" LimbType="Standard" Offset="0x1578"/>
<Limb Name="object_brob_Limb_001584" LimbType="Standard" Offset="0x1584"/> <Limb Name="gBrobMiddleSegmentLimb" LimbType="Standard" Offset="0x1584"/>
<Limb Name="object_brob_Limb_001590" LimbType="Standard" Offset="0x1590"/> <Limb Name="gBrobUpperSegmentRootLimb" LimbType="Standard" Offset="0x1590"/>
<Limb Name="object_brob_Limb_00159C" LimbType="Standard" Offset="0x159C"/> <Limb Name="gBrobUpperSegmentLimb" LimbType="Standard" Offset="0x159C"/>
<Limb Name="object_brob_Limb_0015A8" LimbType="Standard" Offset="0x15A8"/> <Limb Name="gBrobTopSegmentLimb" LimbType="Standard" Offset="0x15A8"/>
<Skeleton Name="object_brob_Skel_0015D8" Type="Flex" LimbType="Standard" Offset="0x15D8"/> <Skeleton Name="gBrobSkel" Type="Flex" LimbType="Standard" Offset="0x15D8"/>
<Animation Name="object_brob_Anim_001678" Offset="0x1678"/> <Animation Name="gBrobShockAnim" Offset="0x1678"/>
<Animation Name="object_brob_Anim_001750" Offset="0x1750"/> <Animation Name="gBrobMoveUpAnim" Offset="0x1750"/>
<Animation Name="object_brob_Anim_001958" Offset="0x1958"/> <Animation Name="gBrobWobbleAnim" Offset="0x1958"/>
<Collision Name="object_brob_Col_001A70" Offset="0x1A70"/> <Collision Name="gBrobCol" Offset="0x1A70"/>
</File> </File>
</Root> </Root>

View file

@ -105,7 +105,7 @@
<DList Name="gLinkChildBottleDL" Offset="0x18478"/> <DList Name="gLinkChildBottleDL" Offset="0x18478"/>
<DList Name="gLinkChildDL_18580" Offset="0x18580"/> <DList Name="gLinkChildDL_18580" Offset="0x18580"/>
<DList Name="gLinkChildBottle2DL" Offset="0x18648"/> <DList Name="gLinkChildBottle2DL" Offset="0x18648"/>
<DList Name="gLinkChildSlinghotStringDL" Offset="0x221A8"/> <DList Name="gLinkChildSlingshotStringDL" Offset="0x221A8"/>
<DList Name="gLinkChildDekuShieldDL" Offset="0x224F8"/> <DList Name="gLinkChildDekuShieldDL" Offset="0x224F8"/>
<Mtx Name="gLinkChildDekuShieldMtx" Offset="0x22648"/> <Mtx Name="gLinkChildDekuShieldMtx" Offset="0x22648"/>
<DList Name="gLinkChildDekuShieldWithMatrixDL" Offset="0x22688"/> <DList Name="gLinkChildDekuShieldWithMatrixDL" Offset="0x22688"/>

View file

@ -1,25 +1,25 @@
<Root> <Root>
<File Name="object_ma1" Segment="6"> <File Name="object_ma1" Segment="6">
<Skeleton Name="gMalonChildSkel" Type="Flex" LimbType="Standard" Offset="0x8460"/> <Skeleton Name="gMalonChildSkel" Type="Flex" LimbType="Standard" LimbNone="CHILD_MALON_LIMB_NONE" LimbMax="CHILD_MALON_LIMB_MAX" EnumName="ChildMalonLimb" Offset="0x8460"/>
<Limb Name="gMalonChildRootLimb" LimbType="Standard" Offset="0x8340"/> <Limb Name="gMalonChildRootLimb" LimbType="Standard" EnumName="CHILD_MALON_ROOT" Offset="0x8340"/>
<Limb Name="gMalonChildLeftThighLimb" LimbType="Standard" Offset="0x834C"/> <Limb Name="gMalonChildLeftThighLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_LEFT_THIGH" Offset="0x834C"/>
<Limb Name="gMalonChildLeftShinLimb" LimbType="Standard" Offset="0x8358"/> <Limb Name="gMalonChildLeftShinLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_LEFT_SHIN" Offset="0x8358"/>
<Limb Name="gMalonChildLeftFootLimb" LimbType="Standard" Offset="0x8364"/> <Limb Name="gMalonChildLeftFootLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_LEFT_FOOT" Offset="0x8364"/>
<Limb Name="gMalonChildRightThighLimb" LimbType="Standard" Offset="0x8370"/> <Limb Name="gMalonChildRightThighLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_RIGHT_THIGH" Offset="0x8370"/>
<Limb Name="gMalonChildRightShinLimb" LimbType="Standard" Offset="0x837C"/> <Limb Name="gMalonChildRightShinLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_RIGHT_SHIN" Offset="0x837C"/>
<Limb Name="gMalonChildRightFootLimb" LimbType="Standard" Offset="0x8388"/> <Limb Name="gMalonChildRightFootLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_RIGHT_FOOT" Offset="0x8388"/>
<Limb Name="gMalonChildChestLimb" LimbType="Standard" Offset="0x8394"/> <Limb Name="gMalonChildChestLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_CHEST" Offset="0x8394"/>
<Limb Name="gMalonChildLeftShoulderLimb" LimbType="Standard" Offset="0x83A0"/> <Limb Name="gMalonChildLeftShoulderLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_LEFT_SHOULDER" Offset="0x83A0"/>
<Limb Name="gMalonChildLeftArmLimb" LimbType="Standard" Offset="0x83AC"/> <Limb Name="gMalonChildLeftArmLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_LEFT_ARM" Offset="0x83AC"/>
<Limb Name="gMalonChildLeftHandLimb" LimbType="Standard" Offset="0x83B8"/> <Limb Name="gMalonChildLeftHandLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_LEFT_HAND" Offset="0x83B8"/>
<Limb Name="gMalonChildRightShoulderLimb" LimbType="Standard" Offset="0x83C4"/> <Limb Name="gMalonChildRightShoulderLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_RIGHT_SHOULDER" Offset="0x83C4"/>
<Limb Name="gMalonChildRightArmLimb" LimbType="Standard" Offset="0x83D0"/> <Limb Name="gMalonChildRightArmLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_RIGHT_ARM" Offset="0x83D0"/>
<Limb Name="gMalonChildRightHandLimb" LimbType="Standard" Offset="0x83DC"/> <Limb Name="gMalonChildRightHandLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_RIGHT_HAND" Offset="0x83DC"/>
<Limb Name="gMalonChildHeadLimb" LimbType="Standard" Offset="0x83E8"/> <Limb Name="gMalonChildHeadLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_HEAD" Offset="0x83E8"/>
<Limb Name="gMalonChildLimb_0083F4" LimbType="Standard" Offset="0x83F4"/> <Limb Name="gMalonChildDressUpperLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_DRESS_UPPER" Offset="0x83F4"/>
<Limb Name="gMalonChildDressMiddleLimb" LimbType="Standard" Offset="0x8400"/> <Limb Name="gMalonChildDressMiddleLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_DRESS_MIDDLE" Offset="0x8400"/>
<Limb Name="gMalonChildDressLowerLimb" LimbType="Standard" Offset="0x840C"/> <Limb Name="gMalonChildDressLowerLimb" LimbType="Standard" EnumName="CHILD_MALON_LIMB_DRESS_LOWER" Offset="0x840C"/>
<Animation Name="gMalonChildRaiseHandsAnim" Offset="0x244"/> <Animation Name="gMalonChildRaiseHandsAnim" Offset="0x244"/>
<Animation Name="gMalonChildIdleAnim" Offset="0x820"/> <Animation Name="gMalonChildIdleAnim" Offset="0x820"/>

View file

@ -1,15 +1,15 @@
<Root> <Root>
<File Name="object_mizu_objects" Segment="6"> <File Name="object_mizu_objects" Segment="6">
<DList Name="gObjectMizuObjectsMovebgDL_000190" Offset="0x0190"/> <DList Name="gWaterTempleFloatingPlatformOutsideCentralPillarDL" Offset="0x0190"/>
<Collision Name="gObjectMizuObjectsMovebgCol_0003F0" Offset="0x03F0"/> <Collision Name="gWaterTempleFloatingPlatformOutsideCentralPillarCol" Offset="0x03F0"/>
<DList Name="gObjectMizuObjectsMovebgDL_000680" Offset="0x0680"/> <DList Name="gWaterTempleFloatingPlatformWestDL" Offset="0x0680"/>
<Collision Name="gObjectMizuObjectsMovebgCol_000998" Offset="0x0998"/> <Collision Name="gWaterTempleFloatingPlatformWestCol" Offset="0x0998"/>
<DList Name="gObjectMizuObjectsMovebgDL_000C20" Offset="0x0C20"/> <DList Name="gWaterTempleFloatingPlatformInsideCentralPillarDL" Offset="0x0C20"/>
<Collision Name="gObjectMizuObjectsMovebgCol_000ED0" Offset="0x0ED0"/> <Collision Name="gWaterTempleFloatingPlatformInsideCentralPillarCol" Offset="0x0ED0"/>
<DList Name="gObjectMizuObjectsMovebgDL_0011F0" Offset="0x11F0"/> <DList Name="gWaterTempleHookshotPlatformDL" Offset="0x11F0"/>
<Collision Name="gObjectMizuObjectsMovebgCol_0015F8" Offset="0x15F8"/> <Collision Name="gWaterTempleHookshotPlatformCol" Offset="0x15F8"/>
<DList Name="gObjectMizuObjectsMovebgDL_002E10" Offset="0x2E10"/> <DList Name="gWaterTempleDragonStatueDL" Offset="0x2E10"/>
<Collision Name="gObjectMizuObjectsMovebgCol_003590" Offset="0x3590"/> <Collision Name="gWaterTempleDragonStatueCol" Offset="0x3590"/>
<DList Name="gObjectMizuObjectsBwallDL_001770" Offset="0x1770"/> <DList Name="gObjectMizuObjectsBwallDL_001770" Offset="0x1770"/>
<DList Name="gObjectMizuObjectsBwallDL_001A30" Offset="0x1A30"/> <DList Name="gObjectMizuObjectsBwallDL_001A30" Offset="0x1A30"/>

View file

@ -1 +1 @@
f0b7f35375f9cc8ca1b2d59d78e35405 zelda_ocarina_mq_dbg.z64 f0b7f35375f9cc8ca1b2d59d78e35405 oot-gc-eu-mq-dbg.z64

View file

@ -1,6 +1,6 @@
def apply(config, args): def apply(config, args):
config['mapfile'] = 'build/z64.map' config['mapfile'] = 'build/gc-eu-mq-dbg/z64.map'
config['myimg'] = 'zelda_ocarina_mq_dbg.z64' config['myimg'] = 'oot-gc-eu-mq-dbg.z64'
config['baseimg'] = 'baserom.z64' config['baseimg'] = 'baserom.z64'
config['makeflags'] = [] config['makeflags'] = []
config['source_directories'] = ['src', 'include', 'spec'] config['source_directories'] = ['src', 'include', 'spec']

View file

@ -772,7 +772,7 @@ Once preliminary cleanup and struct filling is done, most time spent matching fu
In order to use `diff.py` with the symbol names, we need a copy of the code to compare against. This is done by copying the `build` directory into a directory called `expected`. Copying in Windows on WSL is very slow, so run In order to use `diff.py` with the symbol names, we need a copy of the code to compare against. This is done by copying the `build` directory into a directory called `expected`. Copying in Windows on WSL is very slow, so run
``` ```
$ mkdir expected $ mkdir expected
cp -r build/ expected/ cp -r build expected/
``` ```
from the main directory of the repository. You should end up with the directory structure `expected/build/...`. from the main directory of the repository. You should end up with the directory structure `expected/build/...`.
@ -914,7 +914,7 @@ It turns out that this is enough to completely fix the diff:
Everything *looks* fine, but we only know for sure when we run `make`. Thankfully doing so gives Everything *looks* fine, but we only know for sure when we run `make`. Thankfully doing so gives
``` ```
zelda_ocarina_mq_dbg.z64: OK oot-gc-eu-mq-dbg.z64: OK
``` ```
which is either a sense of triumph or relief depending on how long you've spent on a function. which is either a sense of triumph or relief depending on how long you've spent on a function.

View file

@ -118,18 +118,18 @@ Now, open the file called `spec` in the base directory, find the section corresp
``` ```
beginseg beginseg
name "ovl_En_Tg" name "ovl_En_Tg"
include "build/src/overlays/actors/ovl_En_Tg/z_en_tg.o" include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o"
include "build/data/overlays/actors/z_en_tg.data.o" include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.data.o"
include "build/data/overlays/actors/z_en_tg.reloc.o" include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.reloc.o"
endseg endseg
``` ```
and comment out the .data line, and comment out the .data line,
``` ```
beginseg beginseg
name "ovl_En_Tg" name "ovl_En_Tg"
include "build/src/overlays/actors/ovl_En_Tg/z_en_tg.o" include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Tg/z_en_tg.o"
//include "build/data/overlays/actors/z_en_tg.data.o" //include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.data.o"
include "build/data/overlays/actors/z_en_tg.reloc.o" include "$(BUILD_DIR)/data/overlays/actors/z_en_tg.reloc.o"
endseg endseg
``` ```
to tell the compiler not to look for the data in that file any more. Now run `make -j`, and if you did both steps correctly, you should get `OK`. to tell the compiler not to look for the data in that file any more. Now run `make -j`, and if you did both steps correctly, you should get `OK`.
@ -262,18 +262,18 @@ First, we tell the compiler to ignore the original data file. To do this, open t
``` ```
beginseg beginseg
name "ovl_En_Jj" name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o" include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
include "build/data/overlays/actors/z_en_jj.data.o" include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o"
include "build/data/overlays/actors/z_en_jj.reloc.o" include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o"
endseg endseg
``` ```
We will eventually remove both of the bottom two lines and replace them with our own reloc file, but for now, just comment out the data line: We will eventually remove both of the bottom two lines and replace them with our own reloc file, but for now, just comment out the data line:
``` ```
beginseg beginseg
name "ovl_En_Jj" name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o" include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
//include "build/data/overlays/actors/z_en_jj.data.o" //include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o"
include "build/data/overlays/actors/z_en_jj.reloc.o" include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o"
endseg endseg
``` ```
@ -557,7 +557,7 @@ Ignore the first line: `gDmaDataTable` is always different if the ROM is shifted
To fix this, we use a binary diff program. A suitable one is `vbindiff`: run it on the baserom and the zelda_whatever one the compiler generates: To fix this, we use a binary diff program. A suitable one is `vbindiff`: run it on the baserom and the zelda_whatever one the compiler generates:
``` ```
vbindiff baserom.z64 zelda_ocarina_mq_dbg.z64 vbindiff baserom.z64 oot-gc-eu-mq-dbg.z64
``` ```
In this, press `g` to open up goto position, and paste in the address `0xE3ED10` from the first important line of the `first_diff` output. This gives us the following: In this, press `g` to open up goto position, and paste in the address `0xE3ED10` from the first important line of the `first_diff` output. This gives us the following:
@ -623,7 +623,7 @@ static ColliderCylinderInit sCylinderInit =
Running `make -j` again, Running `make -j` again,
``` ```
zelda_ocarina_mq_dbg.z64: OK oot-gc-eu-mq-dbg.z64: OK
``` ```
Hooray, we won! Hooray, we won!

View file

@ -26,9 +26,9 @@ Specifically, to use the automatically generated reloc, rather than the original
``` ```
beginseg beginseg
name "ovl_En_Jj" name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o" include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
//include "build/data/overlays/actors/z_en_jj.data.o" //include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.data.o"
include "build/data/overlays/actors/z_en_jj.reloc.o" include "$(BUILD_DIR)/data/overlays/actors/z_en_jj.reloc.o"
endseg endseg
``` ```
@ -37,8 +37,8 @@ and change to use our reloc:
``` ```
beginseg beginseg
name "ovl_En_Jj" name "ovl_En_Jj"
include "build/src/overlays/actors/ovl_En_Jj/z_en_jj.o" include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/z_en_jj.o"
include "build/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o" include "$(BUILD_DIR)/src/overlays/actors/ovl_En_Jj/ovl_En_Jj_reloc.o"
endseg endseg
``` ```

View file

@ -113,13 +113,13 @@ If in doubt, look at completed objects in the repo, and if still in doubt, ask.
Just as when you decomp an actor you have to change the `spec` to tell it to use the new files, you have to do a similar thing for the object. Find the appropriate section for the object you have decompiled, and replace the line Just as when you decomp an actor you have to change the `spec` to tell it to use the new files, you have to do a similar thing for the object. Find the appropriate section for the object you have decompiled, and replace the line
```c ```c
include "build/baserom/object_name.o" include "$(BUILD_DIR)/baserom/object_name.o"
``` ```
by by
```c ```c
include "build/assets/objects/object_name/object_name.o" include "$(BUILD_DIR)/assets/objects/object_name/object_name.o"
number 6 number 6
``` ```

View file

@ -83,7 +83,7 @@ to extract the contents of the object into the new folder, change the spec to us
beginseg beginseg
name "object_bg" name "object_bg"
romalign 0x1000 romalign 0x1000
include "build/baserom/object_bg.o" include "$(BUILD_DIR)/baserom/object_bg.o"
endseg endseg
``` ```
@ -93,7 +93,7 @@ to
beginseg beginseg
name "object_bg" name "object_bg"
romalign 0x1000 romalign 0x1000
include "build/assets/objects/object_bg/object_bg.o" include "$(BUILD_DIR)/assets/objects/object_bg/object_bg.o"
number 6 number 6
endseg endseg
``` ```

View file

@ -380,7 +380,7 @@ void func_80A87CEC(EnJj *this, PlayState *play) {
play->csCtx.script = &D_80A88164; play->csCtx.script = &D_80A88164;
gSaveContext.cutsceneTrigger = (u8)1U; gSaveContext.cutsceneTrigger = (u8)1U;
func_8003EBF8(play, &play->colCtx.dyna, (s32) temp_v1->bgId); func_8003EBF8(play, &play->colCtx.dyna, (s32) temp_v1->bgId);
func_8005B1A4(play->cameraPtrs[play->activeCamId]); Camera_SetFinishedFlag(play->cameraPtrs[play->activeCamId]);
gSaveContext.unkEDA = (u16) (gSaveContext.unkEDA | 0x400); gSaveContext.unkEDA = (u16) (gSaveContext.unkEDA | 0x400);
Sfx_PlaySfxCentered((u16)0x4802U); Sfx_PlaySfxCentered((u16)0x4802U);
} }
@ -396,7 +396,7 @@ Easy things to sort out:
- `play->cameraPtrs[play->activeCamId]` has a macro: it is `GET_ACTIVE_CAM(play)`, so this line can be written as - `play->cameraPtrs[play->activeCamId]` has a macro: it is `GET_ACTIVE_CAM(play)`, so this line can be written as
```C ```C
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
``` ```
- `gSaveContext.unkEDA` we have dealt with before: it is `gSaveContext.save.info.eventChkInf[3]`. This is a flag-setting function; it can be written more compactly as - `gSaveContext.unkEDA` we have dealt with before: it is `gSaveContext.save.info.eventChkInf[3]`. This is a flag-setting function; it can be written more compactly as
@ -418,13 +418,13 @@ void func_80A87CEC(EnJj *this, PlayState *play) {
play->csCtx.script = &D_80A88164; play->csCtx.script = &D_80A88164;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
func_8003EBF8(play, &play->colCtx.dyna, child->bgId); func_8003EBF8(play, &play->colCtx.dyna, child->bgId);
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
gSaveContext.save.info.eventChkInf[3] |= 0x400; gSaveContext.save.info.eventChkInf[3] |= 0x400;
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
} }
``` ```
matches, but generates a complier warning for `func_8005B1A4`, which it can't find. To fix this, add it to `functions.h`, in as near as possible the correct position in numerical order. Some detective work with VSCode's Search shows that this function lives in `z_camera.c`, and its prototype is `s16 func_8005B1A4(Camera* camera)`, so add this line to `functions.h` at the bottom of the camera functions part. matches, but generates a complier warning for `Camera_SetFinishedFlag`, which it can't find. To fix this, add it to `functions.h`, in as near as possible the correct position in numerical order. Some detective work with VSCode's Search shows that this function lives in `z_camera.c`, and its prototype is `s16 Camera_SetFinishedFlag(Camera* camera)`, so add this line to `functions.h` at the bottom of the camera functions part.
Lastly, we prefer to limit use of early `return`s, and use `else`s instead if possible. That applies here: the function can be rewritten as Lastly, we prefer to limit use of early `return`s, and use `else`s instead if possible. That applies here: the function can be rewritten as
```C ```C
@ -437,7 +437,7 @@ void func_80A87CEC(EnJj* this, PlayState* play) {
play->csCtx.script = &D_80A88164; play->csCtx.script = &D_80A88164;
gSaveContext.cutsceneTrigger = 1; gSaveContext.cutsceneTrigger = 1;
func_8003EBF8(play, &play->colCtx.dyna, child->bgId); func_8003EBF8(play, &play->colCtx.dyna, child->bgId);
func_8005B1A4(GET_ACTIVE_CAM(play)); Camera_SetFinishedFlag(GET_ACTIVE_CAM(play));
gSaveContext.save.info.eventChkInf[3] |= 0x400; gSaveContext.save.info.eventChkInf[3] |= 0x400;
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
} }

View file

@ -50,11 +50,12 @@ You can create a `.vscode/c_cpp_properties.json` file with `C/C++: Edit Configur
"includePath": [ // Matches makefile's includes "includePath": [ // Matches makefile's includes
"${workspaceFolder}/**", "${workspaceFolder}/**",
"src", "src",
"build", "build/gc-eu-mq-dbg",
"include" "include"
], ],
"defines": [ "defines": [
"_LANGUAGE_C" // For gbi.h "_LANGUAGE_C", // For gbi.h
"OOT_DEBUG" // If targeting a debug version
], ],
"cStandard": "gnu89", // C89 + some GNU extensions from C99 like C++ comments "cStandard": "gnu89", // C89 + some GNU extensions from C99 like C++ comments
"cppStandard": "${default}" // Only ZAPD uses C++, so doesn't really matter "cppStandard": "${default}" // Only ZAPD uses C++, so doesn't really matter

View file

@ -39,15 +39,15 @@ def firstDiffMain():
parser = argparse.ArgumentParser(description="Find the first difference(s) between the built ROM and the base ROM.") parser = argparse.ArgumentParser(description="Find the first difference(s) between the built ROM and the base ROM.")
parser.add_argument("-c", "--count", type=int, default=5, help="find up to this many instruction difference(s)") parser.add_argument("-c", "--count", type=int, default=5, help="find up to this many instruction difference(s)")
parser.add_argument("-v", "--version", help="Which version should be processed", default="mq_dbg") parser.add_argument("-v", "--version", help="Which version should be processed", default="gc-eu-mq-dbg")
parser.add_argument("-a", "--add-colons", action='store_true', help="Add colon between bytes" ) parser.add_argument("-a", "--add-colons", action='store_true', help="Add colon between bytes" )
args = parser.parse_args() args = parser.parse_args()
buildFolder = Path("build") buildFolder = Path("build") / args.version
BUILTROM = Path(f"zelda_ocarina_{args.version}.z64") BUILTROM = Path(f"oot-{args.version}.z64")
BUILTMAP = buildFolder / f"z64.map" BUILTMAP = buildFolder / "z64.map"
EXPECTEDROM = Path("baserom.z64") EXPECTEDROM = Path("baserom.z64")
EXPECTEDMAP = "expected" / BUILTMAP EXPECTEDMAP = "expected" / BUILTMAP

View file

@ -29,7 +29,7 @@ APPLY_OPTS = "--format --style=file"
# Compiler options used with Clang-Tidy # Compiler options used with Clang-Tidy
# Normal warnings are disabled with -Wno-everything to focus only on tidying # Normal warnings are disabled with -Wno-everything to focus only on tidying
INCLUDES = "-Iinclude -Isrc -Ibuild -I." INCLUDES = "-Iinclude -Isrc -Ibuild/gc-eu-mq-dbg -I."
DEFINES = "-D_LANGUAGE_C -DNON_MATCHING" DEFINES = "-D_LANGUAGE_C -DNON_MATCHING"
COMPILER_OPTS = f"-fno-builtin -std=gnu90 -m32 -Wno-everything {INCLUDES} {DEFINES}" COMPILER_OPTS = f"-fno-builtin -std=gnu90 -m32 -Wno-everything {INCLUDES} {DEFINES}"
@ -108,7 +108,7 @@ def format_files(src_files: List[str], extra_files: List[str], nb_jobs: int):
if nb_jobs != 1: if nb_jobs != 1:
print(f"Formatting files with {nb_jobs} jobs") print(f"Formatting files with {nb_jobs} jobs")
else: else:
print(f"Formatting files with a single job (consider using -j to make this faster)") print("Formatting files with a single job (consider using -j to make this faster)")
# Format files in chunks to improve performance while still utilizing jobs # Format files in chunks to improve performance while still utilizing jobs
file_chunks = list(list_chunks(src_files, (len(src_files) // nb_jobs) + 1)) file_chunks = list(list_chunks(src_files, (len(src_files) // nb_jobs) + 1))

33
include/audiomgr.h Normal file
View file

@ -0,0 +1,33 @@
#ifndef AUDIOMGR_H
#define AUDIOMGR_H
#include "sched.h"
#include "z64audio.h"
typedef enum {
/* 0 */ AUDIOMGR_DEBUG_LEVEL_NONE,
/* 1 */ AUDIOMGR_DEBUG_LEVEL_NO_RSP,
/* 2 */ AUDIOMGR_DEBUG_LEVEL_NO_UPDATE
} AudioMgrDebugLevel;
typedef struct {
/* 0x0000 */ IrqMgr* irqMgr;
/* 0x0004 */ Scheduler* sched;
/* 0x0008 */ OSScTask audioTask;
/* 0x0070 */ AudioTask* rspTask;
/* 0x0074 */ OSMesgQueue interruptQueue;
/* 0x008C */ OSMesg interruptMsgBuf[8];
/* 0x00AC */ OSMesgQueue taskDoneQueue;
/* 0x00C4 */ OSMesg taskDoneMsg;
/* 0x00C8 */ OSMesgQueue initQueue;
/* 0x00E0 */ OSMesg initMsg;
/* 0x00E8 */ OSThread thread;
} AudioMgr; // size = 0x298
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Scheduler* sched, IrqMgr* irqMgr);
void AudioMgr_WaitForInit(AudioMgr* audioMgr);
void AudioMgr_StopAllSfx(void);
#endif

View file

@ -391,15 +391,15 @@ Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContex
Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx); Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx);
void func_8002EBCC(Actor* actor, PlayState* play, s32 flag); void func_8002EBCC(Actor* actor, PlayState* play, s32 flag);
void func_8002ED80(Actor* actor, PlayState* play, s32 flag); void func_8002ED80(Actor* actor, PlayState* play, s32 flag);
PosRot* Actor_GetFocus(PosRot* dest, Actor* actor); PosRot Actor_GetFocus(Actor* actor);
PosRot* Actor_GetWorld(PosRot* dest, Actor* actor); PosRot Actor_GetWorld(Actor* actor);
PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor); PosRot Actor_GetWorldPosShapeRot(Actor* actor);
s32 func_8002F0C8(Actor* actor, Player* player, s32 flag); s32 func_8002F0C8(Actor* actor, Player* player, s32 flag);
u32 Actor_ProcessTalkRequest(Actor* actor, PlayState* play); s32 Actor_TalkOfferAccepted(Actor* actor, PlayState* play);
s32 func_8002F1C4(Actor* actor, PlayState* play, f32 arg2, f32 arg3, u32 exchangeItemId); s32 Actor_OfferTalkExchange(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, u32 exchangeItemId);
s32 func_8002F298(Actor* actor, PlayState* play, f32 arg2, u32 exchangeItemId); s32 Actor_OfferTalkExchangeEquiCylinder(Actor* actor, PlayState* play, f32 radius, u32 exchangeItemId);
s32 func_8002F2CC(Actor* actor, PlayState* play, f32 arg2); s32 Actor_OfferTalk(Actor* actor, PlayState* play, f32 radius);
s32 func_8002F2F4(Actor* actor, PlayState* play); s32 Actor_OfferTalkNearColChkInfoCylinder(Actor* actor, PlayState* play);
u32 Actor_TextboxIsClosing(Actor* actor, PlayState* play); u32 Actor_TextboxIsClosing(Actor* actor, PlayState* play);
s8 func_8002F368(PlayState* play); s8 func_8002F368(PlayState* play);
void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y); void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y);
@ -494,7 +494,7 @@ void func_8003555C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel);
void func_800355B8(PlayState* play, Vec3f* pos); void func_800355B8(PlayState* play, Vec3f* pos);
u8 func_800355E4(PlayState* play, Collider* collider); u8 func_800355E4(PlayState* play, Collider* collider);
u8 Actor_ApplyDamage(Actor* actor); u8 Actor_ApplyDamage(Actor* actor);
void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag); void Actor_SetDropFlag(Actor* actor, ColliderElement* elem, s32 freezeFlag);
void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag); void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag);
void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3); void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3);
Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused,
@ -634,12 +634,12 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player);
s16 Camera_ChangeStatus(Camera* camera, s16 status); s16 Camera_ChangeStatus(Camera* camera, s16 status);
Vec3s Camera_Update(Camera* camera); Vec3s Camera_Update(Camera* camera);
void Camera_Finish(Camera* camera); void Camera_Finish(Camera* camera);
s32 Camera_ChangeMode(Camera* camera, s16 mode); s32 Camera_RequestMode(Camera* camera, s16 mode);
s32 Camera_CheckValidMode(Camera* camera, s16 mode); s32 Camera_CheckValidMode(Camera* camera, s16 mode);
s32 Camera_ChangeSetting(Camera* camera, s16 setting); s32 Camera_RequestSetting(Camera* camera, s16 setting);
s32 Camera_ChangeBgCamIndex(Camera* camera, s32 bgCamIndex); s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex);
s16 Camera_GetInputDirYaw(Camera* camera); s16 Camera_GetInputDirYaw(Camera* camera);
Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera); Vec3s Camera_GetCamDir(Camera* camera);
s16 Camera_GetCamDirPitch(Camera* camera); s16 Camera_GetCamDirPitch(Camera* camera);
s16 Camera_GetCamDirYaw(Camera* camera); s16 Camera_GetCamDirYaw(Camera* camera);
s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration); s32 Camera_RequestQuake(Camera* camera, s32 unused, s16 y, s32 duration);
@ -653,53 +653,52 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa
s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2, s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 bgCamIndex, f32 arg3, s16 timer1, s16 timer2,
s16 timer3); s16 timer3);
s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera); s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera);
Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera); Vec3f Camera_GetQuakeOffset(Camera* camera);
void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3, void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* data1, s16 data2, s16 data3,
UNK_TYPE arg6); UNK_TYPE arg6);
s32 func_8005B198(void); s32 func_8005B198(void);
s16 func_8005B1A4(Camera* camera); s16 Camera_SetFinishedFlag(Camera* camera);
DamageTable* DamageTable_Get(s32 index); DamageTable* DamageTable_Get(s32 index);
void DamageTable_Clear(DamageTable* table); void DamageTable_Clear(DamageTable* table);
void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC);
void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b);
s32 Collider_InitJntSph(PlayState* play, ColliderJntSph* collider); s32 Collider_InitJntSph(PlayState* play, ColliderJntSph* jntSph);
s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* collider); s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* jntSph);
s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* collider); s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* jntSph);
s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJntSphInitToActor* src); s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJntSphInitToActor* src);
s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* dest, Actor* actor, s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* dest, Actor* actor,
ColliderJntSphInitType1* src); ColliderJntSphInitType1* src);
s32 Collider_SetJntSphAlloc(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src); s32 Collider_SetJntSphAlloc(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src);
s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src, s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src,
ColliderJntSphElement* elements); ColliderJntSphElement* jntSphElements);
s32 Collider_ResetJntSphAT(PlayState* play, Collider* collider); s32 Collider_ResetJntSphAT(PlayState* play, Collider* col);
s32 Collider_ResetJntSphAC(PlayState* play, Collider* collider); s32 Collider_ResetJntSphAC(PlayState* play, Collider* col);
s32 Collider_ResetJntSphOC(PlayState* play, Collider* collider); s32 Collider_ResetJntSphOC(PlayState* play, Collider* col);
s32 Collider_InitCylinder(PlayState* play, ColliderCylinder* collider); s32 Collider_InitCylinder(PlayState* play, ColliderCylinder* cyl);
s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* collider); s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* cyl);
s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* collider, ColliderCylinderInitToActor* src); s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* dest, ColliderCylinderInitToActor* src);
s32 Collider_SetCylinderType1(PlayState* play, ColliderCylinder* collider, Actor* actor, s32 Collider_SetCylinderType1(PlayState* play, ColliderCylinder* dest, Actor* actor, ColliderCylinderInitType1* src);
ColliderCylinderInitType1* src); s32 Collider_SetCylinder(PlayState* play, ColliderCylinder* dest, Actor* actor, ColliderCylinderInit* src);
s32 Collider_SetCylinder(PlayState* play, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src); s32 Collider_ResetCylinderAT(PlayState* play, Collider* col);
s32 Collider_ResetCylinderAT(PlayState* play, Collider* collider); s32 Collider_ResetCylinderAC(PlayState* play, Collider* col);
s32 Collider_ResetCylinderAC(PlayState* play, Collider* collider); s32 Collider_ResetCylinderOC(PlayState* play, Collider* col);
s32 Collider_ResetCylinderOC(PlayState* play, Collider* collider);
s32 Collider_InitTris(PlayState* play, ColliderTris* tris); s32 Collider_InitTris(PlayState* play, ColliderTris* tris);
s32 Collider_FreeTris(PlayState* play, ColliderTris* tris); s32 Collider_FreeTris(PlayState* play, ColliderTris* tris);
s32 Collider_DestroyTris(PlayState* play, ColliderTris* tris); s32 Collider_DestroyTris(PlayState* play, ColliderTris* tris);
s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src); s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src);
s32 Collider_SetTrisAlloc(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src); s32 Collider_SetTrisAlloc(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src);
s32 Collider_SetTris(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src, s32 Collider_SetTris(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src,
ColliderTrisElement* elements); ColliderTrisElement* trisElements);
s32 Collider_ResetTrisAT(PlayState* play, Collider* collider); s32 Collider_ResetTrisAT(PlayState* play, Collider* col);
s32 Collider_ResetTrisAC(PlayState* play, Collider* collider); s32 Collider_ResetTrisAC(PlayState* play, Collider* col);
s32 Collider_ResetTrisOC(PlayState* play, Collider* collider); s32 Collider_ResetTrisOC(PlayState* play, Collider* col);
s32 Collider_InitQuad(PlayState* play, ColliderQuad* collider); s32 Collider_InitQuad(PlayState* play, ColliderQuad* quad);
s32 Collider_DestroyQuad(PlayState* play, ColliderQuad* collider); s32 Collider_DestroyQuad(PlayState* play, ColliderQuad* quad);
s32 Collider_SetQuadType1(PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src); s32 Collider_SetQuadType1(PlayState* play, ColliderQuad* dest, Actor* actor, ColliderQuadInitType1* src);
s32 Collider_SetQuad(PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src); s32 Collider_SetQuad(PlayState* play, ColliderQuad* dest, Actor* actor, ColliderQuadInit* src);
s32 Collider_ResetQuadAT(PlayState* play, Collider* collider); s32 Collider_ResetQuadAT(PlayState* play, Collider* col);
s32 Collider_ResetQuadAC(PlayState* play, Collider* collider); s32 Collider_ResetQuadAC(PlayState* play, Collider* col);
s32 Collider_ResetQuadOC(PlayState* play, Collider* collider); s32 Collider_ResetQuadOC(PlayState* play, Collider* col);
s32 Collider_InitLine(PlayState* play, OcLine* line); s32 Collider_InitLine(PlayState* play, OcLine* line);
s32 Collider_DestroyLine(PlayState* play, OcLine* line); s32 Collider_DestroyLine(PlayState* play, OcLine* line);
s32 Collider_SetLinePoints(PlayState* play, OcLine* ocLine, Vec3f* a, Vec3f* b); s32 Collider_SetLinePoints(PlayState* play, OcLine* ocLine, Vec3f* a, Vec3f* b);
@ -710,7 +709,7 @@ void CollisionCheck_DestroyContext(PlayState* play, CollisionCheckContext* colCh
void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colChkCtx);
void CollisionCheck_EnableSAC(PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_EnableSAC(PlayState* play, CollisionCheckContext* colChkCtx);
void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colChkCtx);
void Collider_Draw(PlayState* play, Collider* collider); void Collider_Draw(PlayState* play, Collider* col);
void CollisionCheck_DrawCollision(PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_DrawCollision(PlayState* play, CollisionCheckContext* colChkCtx);
s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider); s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider);
s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index);
@ -732,12 +731,12 @@ void CollisionCheck_Damage(PlayState* play, CollisionCheckContext* colChkCtx);
s32 CollisionCheck_LineOCCheckAll(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b); s32 CollisionCheck_LineOCCheckAll(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b);
s32 CollisionCheck_LineOCCheck(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, s32 CollisionCheck_LineOCCheck(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b,
Actor** exclusions, s32 numExclusions); Actor** exclusions, s32 numExclusions);
void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider); void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* cyl);
void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos); void Collider_SetCylinderPosition(ColliderCylinder* cyl, Vec3s* pos);
void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); void Collider_SetQuadVertices(ColliderQuad* quad, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d);
void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c); void Collider_SetTrisVertices(ColliderTris* tris, s32 elemIndex, Vec3f* a, Vec3f* b, Vec3f* c);
void Collider_SetTrisDim(PlayState* play, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* src); void Collider_SetTrisDim(PlayState* play, ColliderTris* tris, s32 elemIndex, ColliderTrisElementDimInit* src);
void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider); void Collider_UpdateSpheres(s32 limb, ColliderJntSph* jntSph);
void CollisionCheck_SpawnRedBlood(PlayState* play, Vec3f* v); void CollisionCheck_SpawnRedBlood(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v); void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v); void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v);
@ -775,7 +774,7 @@ void SfxSource_UpdateAll(PlayState* play);
void SfxSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 duration, u16 sfxId); void SfxSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, s32 duration, u16 sfxId);
u16 QuestHint_GetSariaTextId(PlayState* play); u16 QuestHint_GetSariaTextId(PlayState* play);
u16 QuestHint_GetNaviTextId(PlayState* play); u16 QuestHint_GetNaviTextId(PlayState* play);
u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet); u16 MaskReaction_GetTextId(PlayState* play, u32 maskReactionSet);
void CutsceneFlags_UnsetAll(PlayState* play); void CutsceneFlags_UnsetAll(PlayState* play);
void CutsceneFlags_Set(PlayState* play, s16 flag); void CutsceneFlags_Set(PlayState* play, s16 flag);
void CutsceneFlags_Unset(PlayState* play, s16 flag); void CutsceneFlags_Unset(PlayState* play, s16 flag);
@ -923,12 +922,12 @@ f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b);
f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b); f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b);
f32 OLib_ClampMinDist(f32 val, f32 min); f32 OLib_ClampMinDist(f32 val, f32 min);
f32 OLib_ClampMaxDist(f32 val, f32 max); f32 OLib_ClampMaxDist(f32 val, f32 max);
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b); Vec3f OLib_Vec3fDistNormalize(Vec3f* a, Vec3f* b);
Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo); Vec3f OLib_VecGeoToVec3f(VecGeo* geo);
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec); VecSph OLib_Vec3fToVecSph(Vec3f* vec);
VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec); VecGeo OLib_Vec3fToVecGeo(Vec3f* vec);
VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b); VecGeo OLib_Vec3fDiffToVecGeo(Vec3f* a, Vec3f* b);
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b); Vec3f OLib_Vec3fDiffRad(Vec3f* a, Vec3f* b);
s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s16 parentCamId); s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s16 parentCamId);
s16 OnePointCutscene_EndCutscene(PlayState* play, s16 subCamId); s16 OnePointCutscene_EndCutscene(PlayState* play, s16 subCamId);
s32 OnePointCutscene_Attention(PlayState* play, Actor* actor); s32 OnePointCutscene_Attention(PlayState* play, Actor* actor);
@ -1271,7 +1270,7 @@ s32 Play_SetCameraFov(PlayState* this, s16 camId, f32 fov);
s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll); s32 Play_SetCameraRoll(PlayState* this, s16 camId, s16 roll);
void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId); void Play_CopyCamera(PlayState* this, s16 destCamId, s16 srcCamId);
s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s16 setting); s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s16 setting);
s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting); s32 Play_RequestCameraSetting(PlayState* this, s16 camId, s16 setting);
void Play_ReturnToMainCam(PlayState* this, s16 camId, s16 duration); void Play_ReturnToMainCam(PlayState* this, s16 camId, s16 duration);
void Play_SaveSceneFlags(PlayState* this); void Play_SaveSceneFlags(PlayState* this);
void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams); void Play_SetupRespawnPoint(PlayState* this, s32 respawnMode, s32 playerParams);
@ -1295,13 +1294,6 @@ void func_800C213C(PreRender* this, Gfx** gfxP);
void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP); void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP);
void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP); void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP);
void PreRender_ApplyFilters(PreRender* this); void PreRender_ApplyFilters(PreRender* this);
void AudioMgr_StopAllSfx(void);
void func_800C3C80(AudioMgr* audioMgr);
void AudioMgr_HandleRetrace(AudioMgr* audioMgr);
void AudioMgr_HandlePreNMI(AudioMgr* audioMgr);
void AudioMgr_ThreadEntry(void* arg0);
void AudioMgr_Unlock(AudioMgr* audioMgr);
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Scheduler* sched, IrqMgr* irqMgr);
void GameState_FaultPrint(void); void GameState_FaultPrint(void);
void GameState_SetFBFilter(Gfx** gfxP); void GameState_SetFBFilter(Gfx** gfxP);
void GameState_DrawInputDisplay(u16 input, Gfx** gfxP); void GameState_DrawInputDisplay(u16 input, Gfx** gfxP);
@ -1437,9 +1429,13 @@ void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode);
void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation); void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation);
void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot); void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot);
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest); Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest);
#ifdef OOT_DEBUG
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line); Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line);
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line); Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line);
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx); #else
Mtx* Matrix_ToMtx(Mtx* dest);
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx);
#endif
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest); void Matrix_MultVec3f(Vec3f* src, Vec3f* dest);
void Matrix_MtxFCopy(MtxF* dest, MtxF* src); void Matrix_MtxFCopy(MtxF* dest, MtxF* src);
void Matrix_MtxToMtxF(Mtx* src, MtxF* dest); void Matrix_MtxToMtxF(Mtx* src, MtxF* dest);

View file

@ -100,12 +100,15 @@
#define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) #define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask))
#ifdef OOT_DEBUG
#define LOG(exp, value, format, file, line) \ #define LOG(exp, value, format, file, line) \
do { \ do { \
LogUtils_LogThreadId(file, line); \ LogUtils_LogThreadId(file, line); \
osSyncPrintf(exp " = " format "\n", value); \ osSyncPrintf(exp " = " format "\n", value); \
} while (0) } while (0)
#else
#define LOG(exp, value, format, file, line) (void)0
#endif
#define LOG_STRING(string, file, line) LOG(#string, string, "%s", file, line) #define LOG_STRING(string, file, line) LOG(#string, string, "%s", file, line)
#define LOG_ADDRESS(exp, value, file, line) LOG(exp, value, "%08x", file, line) #define LOG_ADDRESS(exp, value, file, line) LOG(exp, value, "%08x", file, line)
@ -141,6 +144,8 @@ extern struct GraphicsContext* __gfxCtx;
#define POLY_XLU_DISP __gfxCtx->polyXlu.p #define POLY_XLU_DISP __gfxCtx->polyXlu.p
#define OVERLAY_DISP __gfxCtx->overlay.p #define OVERLAY_DISP __gfxCtx->overlay.p
#ifdef OOT_DEBUG
// __gfxCtx shouldn't be used directly. // __gfxCtx shouldn't be used directly.
// Use the DISP macros defined above when writing to display buffers. // Use the DISP macros defined above when writing to display buffers.
#define OPEN_DISPS(gfxCtx, file, line) \ #define OPEN_DISPS(gfxCtx, file, line) \
@ -156,6 +161,48 @@ extern struct GraphicsContext* __gfxCtx;
} \ } \
(void)0 (void)0
#define GRAPH_ALLOC(gfxCtx, size) Graph_Alloc(gfxCtx, size)
#define MATRIX_TO_MTX(gfxCtx, file, line) Matrix_ToMtx(gfxCtx, file, line)
#define MATRIX_NEW(gfxCtx, file, line) Matrix_NewMtx(gfxCtx, file, line)
#define MATRIX_CHECK_FLOATS(mtx, file, line) Matrix_CheckFloats(mtx, file, line)
#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line)
#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, file, line)
#define GAME_STATE_ALLOC(gameState, size, file, line) GameState_Alloc(gameState, size, file, line)
#define SYSTEM_ARENA_MALLOC(size, file, line) SystemArena_MallocDebug(size, file, line)
#define SYSTEM_ARENA_MALLOC_R(size, file, line) SystemArena_MallocRDebug(size, file, line)
#define SYSTEM_ARENA_FREE(size, file, line) SystemArena_FreeDebug(size, file, line)
#define ZELDA_ARENA_MALLOC(size, file, line) ZeldaArena_MallocDebug(size, file, line)
#define ZELDA_ARENA_MALLOC_R(size, file, line) ZeldaArena_MallocRDebug(size, file, line)
#define ZELDA_ARENA_FREE(size, file, line) ZeldaArena_FreeDebug(size, file, line)
#else
#define OPEN_DISPS(gfxCtx, file, line) \
{ \
GraphicsContext* __gfxCtx = gfxCtx; \
s32 __dispPad
#define CLOSE_DISPS(gfxCtx, file, line) \
(void)0; \
} \
(void)0
#define GRAPH_ALLOC(gfxCtx, size) ((void*)((gfxCtx)->polyOpa.d = (Gfx*)((u8*)(gfxCtx)->polyOpa.d - ALIGN16(size))))
#define MATRIX_TO_MTX(gfxCtx, file, line) Matrix_ToMtx(gfxCtx)
#define MATRIX_NEW(gfxCtx, file, line) Matrix_NewMtx(gfxCtx)
#define MATRIX_CHECK_FLOATS(mtx, file, line) (mtx)
#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSync(ram, vrom, size)
#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg)
#define GAME_STATE_ALLOC(gameState, size, file, line) THA_AllocTailAlign16(&(gameState)->tha, size)
#define SYSTEM_ARENA_MALLOC(size, file, line) SystemArena_Malloc(size)
#define SYSTEM_ARENA_MALLOC_R(size, file, line) SystemArena_MallocR(size)
#define SYSTEM_ARENA_FREE(size, file, line) SystemArena_Free(size)
#define ZELDA_ARENA_MALLOC(size, file, line) ZeldaArena_Malloc(size)
#define ZELDA_ARENA_MALLOC_R(size, file, line) ZeldaArena_MallocR(size)
#define ZELDA_ARENA_FREE(size, file, line) ZeldaArena_Free(size)
#endif /* OOT_DEBUG */
/** /**
* `x` vertex x * `x` vertex x
* `y` vertex y * `y` vertex y

View file

@ -48,6 +48,7 @@
#define R_ENV_TIME_SPEED_OLD REG(15) // Most likely used during development. Unused in the final game. #define R_ENV_TIME_SPEED_OLD REG(15) // Most likely used during development. Unused in the final game.
#define R_RUN_SPEED_LIMIT REG(45) #define R_RUN_SPEED_LIMIT REG(45)
#define R_ENABLE_ARENA_DBG SREG(0) #define R_ENABLE_ARENA_DBG SREG(0)
#define R_AUDIOMGR_DEBUG_LEVEL SREG(20)
#define R_ROOM_IMAGE_NODRAW_FLAGS SREG(25) #define R_ROOM_IMAGE_NODRAW_FLAGS SREG(25)
#define R_ROOM_BG2D_FORCE_SCALEBG SREG(26) #define R_ROOM_BG2D_FORCE_SCALEBG SREG(26)
#define R_UPDATE_RATE SREG(30) #define R_UPDATE_RATE SREG(30)

View file

@ -5123,6 +5123,8 @@ _DW({ \
#define gDPNoOpTag(pkt, tag) gDPParam(pkt, G_NOOP, tag) #define gDPNoOpTag(pkt, tag) gDPParam(pkt, G_NOOP, tag)
#define gsDPNoOpTag(tag) gsDPParam( G_NOOP, tag) #define gsDPNoOpTag(tag) gsDPParam( G_NOOP, tag)
#ifdef OOT_DEBUG
#define gDPNoOpHere(pkt, file, line) gDma1p(pkt, G_NOOP, file, line, 1) #define gDPNoOpHere(pkt, file, line) gDma1p(pkt, G_NOOP, file, line, 1)
#define gDPNoOpString(pkt, data, n) gDma1p(pkt, G_NOOP, data, n, 2) #define gDPNoOpString(pkt, data, n) gDma1p(pkt, G_NOOP, data, n, 2)
#define gDPNoOpWord(pkt, data, n) gDma1p(pkt, G_NOOP, data, n, 3) #define gDPNoOpWord(pkt, data, n) gDma1p(pkt, G_NOOP, data, n, 3)
@ -5134,6 +5136,21 @@ _DW({ \
#define gDPNoOpCloseDisp(pkt, file, line) gDma1p(pkt, G_NOOP, file, line, 8) #define gDPNoOpCloseDisp(pkt, file, line) gDma1p(pkt, G_NOOP, file, line, 8)
#define gDPNoOpTag3(pkt, type, data, n) gDma1p(pkt, G_NOOP, data, n, type) #define gDPNoOpTag3(pkt, type, data, n) gDma1p(pkt, G_NOOP, data, n, type)
#else
#define gDPNoOpHere(pkt, file, line)
#define gDPNoOpString(pkt, data, n)
#define gDPNoOpWord(pkt, data, n)
#define gDPNoOpFloat(pkt, data, n)
#define gDPNoOpQuiet(pkt)
#define gDPNoOpVerbose(pkt, n)
#define gDPNoOpCallBack(pkt, callback, arg)
#define gDPNoOpOpenDisp(pkt, file, line)
#define gDPNoOpCloseDisp(pkt, file, line)
#define gDPNoOpTag3(pkt, type, data, n)
#endif /* OOT_DEBUG */
#endif #endif
#endif #endif

View file

@ -4,6 +4,7 @@
#include "ultra64.h" #include "ultra64.h"
#include "ultra64/gs2dex.h" #include "ultra64/gs2dex.h"
#include "attributes.h" #include "attributes.h"
#include "audiomgr.h"
#include "z64save.h" #include "z64save.h"
#include "z64light.h" #include "z64light.h"
#include "z64bgcheck.h" #include "z64bgcheck.h"
@ -272,6 +273,8 @@ typedef struct {
/* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config /* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config
} RoomContext; // size = 0x78 } RoomContext; // size = 0x78
#define SAC_ENABLE (1 << 0)
typedef struct { typedef struct {
/* 0x000 */ s16 colATCount; /* 0x000 */ s16 colATCount;
/* 0x002 */ u16 sacFlags; /* 0x002 */ u16 sacFlags;
@ -695,20 +698,6 @@ typedef struct {
/* 0x10 */ u8 data[1]; /* 0x10 */ u8 data[1];
} Yaz0Header; // size = 0x10 ("data" is not part of the header) } Yaz0Header; // size = 0x10 ("data" is not part of the header)
typedef struct {
/* 0x0000 */ IrqMgr* irqMgr;
/* 0x0004 */ Scheduler* sched;
/* 0x0008 */ OSScTask audioTask;
/* 0x0070 */ AudioTask* rspTask;
/* 0x0074 */ OSMesgQueue interruptQueue;
/* 0x008C */ OSMesg interruptMsgBuf[8];
/* 0x00AC */ OSMesgQueue taskQueue;
/* 0x00C4 */ OSMesg taskMsgBuf[1];
/* 0x00C8 */ OSMesgQueue lockQueue;
/* 0x00E0 */ OSMesg lockMsgBuf[1];
/* 0x00E8 */ OSThread thread;
} AudioMgr; // size = 0x298
struct ArenaNode; struct ArenaNode;
typedef struct Arena { typedef struct Arena {

View file

@ -147,7 +147,10 @@ typedef struct {
#define ACTOR_FLAG_5 (1 << 5) #define ACTOR_FLAG_5 (1 << 5)
#define ACTOR_FLAG_6 (1 << 6) #define ACTOR_FLAG_6 (1 << 6)
#define ACTOR_FLAG_7 (1 << 7) #define ACTOR_FLAG_7 (1 << 7)
#define ACTOR_FLAG_8 (1 << 8) // Signals that player has accepted an offer to talk to an actor
// Player will retain this flag until the player is finished talking
// Actor will retain this flag until `Actor_TalkOfferAccepted` is called or manually turned off by the actor
#define ACTOR_FLAG_TALK (1 << 8)
#define ACTOR_FLAG_9 (1 << 9) #define ACTOR_FLAG_9 (1 << 9)
#define ACTOR_FLAG_10 (1 << 10) #define ACTOR_FLAG_10 (1 << 10)
#define ACTOR_FLAG_ENKUSA_CUT (1 << 11) #define ACTOR_FLAG_ENKUSA_CUT (1 << 11)

View file

@ -814,13 +814,6 @@ typedef struct {
/* 0x10 */ AudioTableEntry entries[1]; // (dynamic size) /* 0x10 */ AudioTableEntry entries[1]; // (dynamic size)
} AudioTable; // size >= 0x20 } AudioTable; // size >= 0x20
typedef struct {
/* 0x00 */ OSTask task;
/* 0x40 */ OSMesgQueue* msgQueue;
/* 0x44 */ void* unk_44; // probably a message that gets unused.
/* 0x48 */ char unk_48[0x8];
} AudioTask; // size = 0x50
typedef struct { typedef struct {
/* 0x00 */ u8* ramAddr; /* 0x00 */ u8* ramAddr;
/* 0x04 */ u32 devAddr; /* 0x04 */ u32 devAddr;
@ -831,6 +824,13 @@ typedef struct {
/* 0x0E */ u8 ttl; // duration after which the DMA can be discarded /* 0x0E */ u8 ttl; // duration after which the DMA can be discarded
} SampleDma; // size = 0x10 } SampleDma; // size = 0x10
typedef struct {
/* 0x00 */ OSTask task;
/* 0x40 */ OSMesgQueue* msgQueue;
/* 0x44 */ void* unk_44; // probably a message that gets unused.
/* 0x48 */ char unk_48[0x8];
} AudioTask; // size = 0x50
typedef struct { typedef struct {
/* 0x0000 */ char unk_0000; /* 0x0000 */ char unk_0000;
/* 0x0001 */ s8 numSynthesisReverbs; /* 0x0001 */ s8 numSynthesisReverbs;

View file

@ -84,33 +84,33 @@
#define CAM_INTERFACE_FIELD(letterboxFlag, hudVisibilityMode, funcFlags) \ #define CAM_INTERFACE_FIELD(letterboxFlag, hudVisibilityMode, funcFlags) \
(((letterboxFlag) & CAM_LETTERBOX_MASK) | CAM_HUD_VISIBILITY(hudVisibilityMode) | ((funcFlags) & 0xFF)) (((letterboxFlag) & CAM_LETTERBOX_MASK) | CAM_HUD_VISIBILITY(hudVisibilityMode) | ((funcFlags) & 0xFF))
// Camera behaviorFlags. Flags specifically for settings, modes, and bgCam // Camera behaviorFlags. Flags specifically for settings, modes, and bgCam. Reset every frame.
// Used to store current state, only CAM_BEHAVIOR_SETTING_1 and CAM_BEHAVIOR_BG_2 are read from and used in logic // Used to store current state, only CAM_BEHAVIOR_SETTING_CHECK_PRIORITY and CAM_BEHAVIOR_BG_PROCESSED are read from and used in logic
// Setting (0x1, 0x10) // Setting (0x1, 0x10)
#define CAM_BEHAVIOR_SETTING_1 (1 << 0) #define CAM_BEHAVIOR_SETTING_CHECK_PRIORITY (1 << 0)
#define CAM_BEHAVIOR_SETTING_2 (1 << 4) #define CAM_BEHAVIOR_SETTING_VALID (1 << 4) // Set when a valid camera setting is requested
// Mode (0x2, 0x20) // Mode (0x2, 0x20)
#define CAM_BEHAVIOR_MODE_1 (1 << 1) #define CAM_BEHAVIOR_MODE_SUCCESS (1 << 1) // Set when the camera mode is the requested mode
#define CAM_BEHAVIOR_MODE_2 (1 << 5) #define CAM_BEHAVIOR_MODE_VALID (1 << 5) // Set when a valid camera mode is requested
// bgCam (0x4, 0x40) // bgCam (0x4, 0x40)
#define CAM_BEHAVIOR_BG_1 (1 << 2) #define CAM_BEHAVIOR_BG_SUCCESS (1 << 2)
#define CAM_BEHAVIOR_BG_2 (1 << 6) #define CAM_BEHAVIOR_BG_PROCESSED (1 << 6)
// Camera stateFlags. Variety of generic flags // Camera stateFlags. Variety of generic flags
#define CAM_STATE_0 (1 << 0) // Must be set for the camera to change settings based on the bg surface #define CAM_STATE_CHECK_BG_ALT (1 << 0) // Must be set for the camera to change settings based on the bg surface
#define CAM_STATE_1 (1 << 1) // Must be set for Camera_UpdateWater to run #define CAM_STATE_CHECK_WATER (1 << 1) // Must be set for Camera_UpdateWater to run
#define CAM_STATE_2 (1 << 2) #define CAM_STATE_CHECK_BG (1 << 2) // Must be set for the camera to change settings based on the bg surface
#define CAM_STATE_3 (1 << 3) // Customizable flag for different functions #define CAM_STATE_EXTERNAL_FINISHED (1 << 3) // Signal from the external systems to camera that the current cam-update function is no longer needed
#define CAM_STATE_4 (1 << 4) #define CAM_STATE_CAM_FUNC_FINISH (1 << 4) // Signal from camera to player that the cam-update function is finished its primary purpose
#define CAM_STATE_5 (1 << 5) #define CAM_STATE_LOCK_MODE (1 << 5) // Prevents camera from changing mode, unless overriden by `forceModeChange` passed to `Camera_RequestModeImpl`
#define CAM_STATE_6 (1 << 6) #define CAM_STATE_DISTORTION (1 << 6) // Set when camera distortion is on
#define CAM_STATE_7 (1 << 7) // Set in play, unused #define CAM_STATE_PLAY_INIT (1 << 7) // Set in Play_Init, never used or changed
#define CAM_STATE_8 (1 << 8) // Camera (eye) is underwater #define CAM_STATE_CAMERA_IN_WATER (1 << 8) // Camera (eye) is underwater
#define CAM_STATE_9 (1 << 9) #define CAM_STATE_PLAYER_IN_WATER (1 << 9) // Player is swimming in water
#define CAM_STATE_10 (1 << 10) // Prevents the camera from changing settings based on the bg surface #define CAM_STATE_BLOCK_BG (1 << 10) // Prevents the camera from changing settings based on the bg surface for 1 frame
#define CAM_STATE_12 (1 << 12) // Set in Camera_Demo7, but Camera_Demo7 is never called #define CAM_STATE_DEMO7 (1 << 12) // Set in Camera_Demo7, but this function is never called
#define CAM_STATE_14 (1 << 14) // isInitialized. Turned on in Camera Init, never used or changed #define CAM_STATE_CAM_INIT (1 << 14) // Set in Camera_Init, never used or changed
#define CAM_STATE_15 ((s16)(1 << 15)) #define CAM_STATE_PLAYER_DIVING ((s16)(1 << 15)) // Diving from the surface of the water down
// Camera viewFlags. Set params related to view // Camera viewFlags. Set params related to view
#define CAM_VIEW_AT (1 << 0) // camera->at #define CAM_VIEW_AT (1 << 0) // camera->at

View file

@ -8,226 +8,9 @@
struct Actor; struct Actor;
typedef struct { /*
/* 0x00 */ struct Actor* actor; // Attached actor * Bases for all shapes of colliders
/* 0x04 */ struct Actor* at; // Actor attached to what it collided with as an AT collider. */
/* 0x08 */ struct Actor* ac; // Actor attached to what it collided with as an AC collider.
/* 0x0C */ struct Actor* oc; // Actor attached to what it collided with as an OC collider.
/* 0x10 */ u8 atFlags; // Information flags for AT collisions.
/* 0x11 */ u8 acFlags; // Information flags for AC collisions.
/* 0x12 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x13 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with.
/* 0x14 */ u8 colType; // Determines hitmarks and sound effects during AC collisions.
/* 0x15 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} Collider; // size = 0x18
typedef struct {
/* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions.
/* 0x01 */ u8 atFlags; // Information flags for AT collisions.
/* 0x02 */ u8 acFlags; // Information flags for AC collisions.
/* 0x03 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x04 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with.
/* 0x05 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} ColliderInit; // size = 0x06
typedef struct {
/* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions.
/* 0x01 */ u8 atFlags; // Information flags for AT collisions.
/* 0x02 */ u8 acFlags; // Information flags for AC collisions.
/* 0x03 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x04 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} ColliderInitType1; // size = 0x05
typedef struct {
/* 0x00 */ struct Actor* actor;
/* 0x04 */ u8 atFlags; // Information flags for AT collisions.
/* 0x05 */ u8 acFlags; // Information flags for AC collisions.
/* 0x06 */ u8 ocFlags1; // Information flags for OC collisions.
/* 0x07 */ u8 shape; // JntSph, Cylinder, Tris, or Quad
} ColliderInitToActor; // size = 0x08
typedef struct {
/* 0x00 */ u32 dmgFlags; // Toucher damage type flags.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 damage; // Damage or Stun Timer
} ColliderTouch; // size = 0x08
typedef struct {
/* 0x00 */ u32 dmgFlags; // Bumper damage type flags.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense; // Damage Resistance
/* 0x06 */ Vec3s hitPos; // Point of contact
} ColliderBump; // size = 0x0C
typedef struct {
/* 0x00 */ u32 dmgFlags; // Bumper exclusion mask
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense; // Damage Resistance
} ColliderBumpInit; // size = 0x08
typedef struct ColliderInfo {
/* 0x00 */ ColliderTouch toucher; // Damage properties when acting as an AT collider
/* 0x08 */ ColliderBump bumper; // Damage properties when acting as an AC collider
/* 0x14 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown.
/* 0x15 */ u8 toucherFlags; // Information flags for AT collisions
/* 0x16 */ u8 bumperFlags; // Information flags for AC collisions
/* 0x17 */ u8 ocElemFlags; // Information flags for OC collisions
/* 0x18 */ Collider* atHit; // object touching this element's AT collider
/* 0x1C */ Collider* acHit; // object touching this element's AC collider
/* 0x20 */ struct ColliderInfo* atHitInfo; // element that hit the AT collider
/* 0x24 */ struct ColliderInfo* acHitInfo; // element that hit the AC collider
} ColliderInfo; // size = 0x28
typedef struct {
/* 0x00 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown.
/* 0x04 */ ColliderTouch toucher; // Damage properties when acting as an AT collider
/* 0x0C */ ColliderBumpInit bumper; // Damage properties when acting as an AC collider
/* 0x14 */ u8 toucherFlags; // Information flags for AT collisions
/* 0x15 */ u8 bumperFlags; // Information flags for AC collisions
/* 0x16 */ u8 ocElemFlags; // Information flags for OC collisions
} ColliderInfoInit; // size = 0x18
typedef struct {
/* 0x00 */ Sphere16 modelSphere; // model space sphere
/* 0x08 */ Sphere16 worldSphere; // world space sphere
/* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01
/* 0x14 */ u8 limb; // attached limb
} ColliderJntSphElementDim; // size = 0x18
typedef struct {
/* 0x00 */ u8 limb; // attached limb
/* 0x02 */ Sphere16 modelSphere; // model space sphere
/* 0x0A */ s16 scale; // world space sphere = model * scale * 0.01
} ColliderJntSphElementDimInit; // size = 0x0C
typedef struct {
/* 0x00 */ ColliderInfo info;
/* 0x28 */ ColliderJntSphElementDim dim;
} ColliderJntSphElement; // size = 0x40
typedef struct {
/* 0x00 */ ColliderInfoInit info;
/* 0x18 */ ColliderJntSphElementDimInit dim;
} ColliderJntSphElementInit; // size = 0x24
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ s32 count;
/* 0x1C */ ColliderJntSphElement* elements;
} ColliderJntSph; // size = 0x20
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInit; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInitType1; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInitToActor base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInitToActor; // size = 0x10
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ ColliderInfo info;
/* 0x40 */ Cylinder16 dim;
} ColliderCylinder; // size = 0x4C
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInit; // size = 0x2C
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInitType1; // size = 0x2C
typedef struct {
/* 0x00 */ ColliderInitToActor base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInitToActor; // size = 0x2C
typedef struct {
/* 0x00 */ Vec3f vtx[3];
} ColliderTrisElementDimInit; // size = 0x24
typedef struct {
/* 0x00 */ ColliderInfo info;
/* 0x28 */ TriNorm dim;
} ColliderTrisElement; // size = 0x5C
typedef struct {
/* 0x00 */ ColliderInfoInit info;
/* 0x18 */ ColliderTrisElementDimInit dim;
} ColliderTrisElementInit; // size = 0x3C
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ s32 count;
/* 0x1C */ ColliderTrisElement* elements;
} ColliderTris; // size = 0x20
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisElementInit* elements;
} ColliderTrisInit; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisElementInit* elements;
} ColliderTrisInitType1; // size = 0x10
typedef struct {
/* 0x00 */ Vec3f quad[4];
/* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c
/* 0x36 */ Vec3s baMid; // midpoint of vectors b, a
/* 0x3C */ f32 acDistSq; // distance to nearest AC collision this frame, squared.
} ColliderQuadDim; // size = 0x40
typedef struct {
/* 0x00 */ Vec3f quad[4];
} ColliderQuadDimInit; // size = 0x30
typedef struct {
/* 0x00 */ ColliderInfo info;
/* 0x24 */ ColliderQuadDim dim;
} ColliderQuadElement; // size = 0x68
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ ColliderInfo info;
/* 0x40 */ ColliderQuadDim dim;
} ColliderQuad; // size = 0x80
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ ColliderQuadDimInit dim;
} ColliderQuadInit; // size = 0x50
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderInfoInit info;
/* 0x20 */ ColliderQuadDimInit dim;
} ColliderQuadInitType1; // size = 0x50
typedef struct {
/* 0x00 */ Linef line;
/* 0x18 */ u16 ocFlags;
} OcLine; // size = 0x1C
typedef enum { typedef enum {
/* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark /* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark
@ -254,6 +37,63 @@ typedef enum {
/* 4 */ COLSHAPE_MAX /* 4 */ COLSHAPE_MAX
} ColliderShape; } ColliderShape;
typedef struct {
/* 0x00 */ struct Actor* actor; // Attached actor
/* 0x04 */ struct Actor* at; // Actor attached to what it collided with as an AT collider.
/* 0x08 */ struct Actor* ac; // Actor attached to what it collided with as an AC collider.
/* 0x0C */ struct Actor* oc; // Actor attached to what it collided with as an OC collider.
/* 0x10 */ u8 atFlags;
/* 0x11 */ u8 acFlags;
/* 0x12 */ u8 ocFlags1;
/* 0x13 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with.
/* 0x14 */ u8 colType; // Determines hitmarks and sound effects during AC collisions. See `ColliderType` enum
/* 0x15 */ u8 shape; // See `ColliderShape` enum
} Collider; // size = 0x18
typedef struct {
/* 0x00 */ u8 colType;
/* 0x01 */ u8 atFlags;
/* 0x02 */ u8 acFlags;
/* 0x03 */ u8 ocFlags1;
/* 0x04 */ u8 ocFlags2;
/* 0x05 */ u8 shape;
} ColliderInit; // size = 0x06
typedef struct {
/* 0x00 */ u8 colType;
/* 0x01 */ u8 atFlags;
/* 0x02 */ u8 acFlags;
/* 0x03 */ u8 ocFlags1;
/* 0x04 */ u8 shape;
} ColliderInitType1; // size = 0x05
typedef struct {
/* 0x00 */ struct Actor* actor;
/* 0x04 */ u8 atFlags;
/* 0x05 */ u8 acFlags;
/* 0x06 */ u8 ocFlags1;
/* 0x07 */ u8 shape;
} ColliderInitToActor; // size = 0x08
typedef struct {
/* 0x00 */ u32 dmgFlags; // Toucher damage type flags.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 damage; // Damage or Stun Timer
} ColliderElementTouch; // size = 0x08
typedef struct {
/* 0x00 */ u32 dmgFlags; // Bumper damage type flags.
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense; // Damage Resistance
/* 0x06 */ Vec3s hitPos; // Point of contact
} ColliderElementBump; // size = 0x0C
typedef struct {
/* 0x00 */ u32 dmgFlags; // Bumper exclusion mask
/* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.)
/* 0x05 */ u8 defense; // Damage Resistance
} ColliderElementBumpInit; // size = 0x08
/** /**
* Affects the sound Link's sword makes when hitting it, hookability, * Affects the sound Link's sword makes when hitting it, hookability,
* and possibly other things. It's definitely not flags, as all checks * and possibly other things. It's definitely not flags, as all checks
@ -271,7 +111,204 @@ typedef enum {
/* 7 */ ELEMTYPE_UNK7 /* 7 */ ELEMTYPE_UNK7
} ElementType; } ElementType;
#define SAC_ENABLE (1 << 0) typedef struct ColliderElement {
/* 0x00 */ ColliderElementTouch toucher; // Damage properties when acting as an AT collider
/* 0x08 */ ColliderElementBump bumper; // Damage properties when acting as an AC collider
/* 0x14 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown.
/* 0x15 */ u8 toucherFlags; // Information flags for AT collisions
/* 0x16 */ u8 bumperFlags; // Information flags for AC collisions
/* 0x17 */ u8 ocElemFlags; // Information flags for OC collisions
/* 0x18 */ Collider* atHit; // object touching this element's AT collider
/* 0x1C */ Collider* acHit; // object touching this element's AC collider
/* 0x20 */ struct ColliderElement* atHitElem; // element that hit the AT collider
/* 0x24 */ struct ColliderElement* acHitElem; // element that hit the AC collider
} ColliderElement; // size = 0x28
typedef struct {
/* 0x00 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown.
/* 0x04 */ ColliderElementTouch toucher; // Damage properties when acting as an AT collider
/* 0x0C */ ColliderElementBumpInit bumper; // Damage properties when acting as an AC collider
/* 0x14 */ u8 toucherFlags; // Information flags for AT collisions
/* 0x15 */ u8 bumperFlags; // Information flags for AC collisions
/* 0x16 */ u8 ocElemFlags; // Information flags for OC collisions
} ColliderElementInit; // size = 0x18
/*
* JntSph - A collider made of sphere shaped elements. Each sphere can attach to a skeleton joint (limb).
*/
// collider structs
typedef struct {
/* 0x00 */ Sphere16 modelSphere; // model space sphere
/* 0x08 */ Sphere16 worldSphere; // world space sphere
/* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01
/* 0x14 */ u8 limb; // attached limb
} ColliderJntSphElementDim; // size = 0x18
typedef struct {
/* 0x00 */ ColliderElement base;
/* 0x28 */ ColliderJntSphElementDim dim;
} ColliderJntSphElement; // size = 0x40
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ s32 count;
/* 0x1C */ ColliderJntSphElement* elements;
} ColliderJntSph; // size = 0x20
// init data structs
typedef struct {
/* 0x00 */ u8 limb; // attached limb
/* 0x02 */ Sphere16 modelSphere; // model space sphere
/* 0x0A */ s16 scale; // world space sphere = model * scale * 0.01
} ColliderJntSphElementDimInit; // size = 0x0C
typedef struct {
/* 0x00 */ ColliderElementInit base;
/* 0x18 */ ColliderJntSphElementDimInit dim;
} ColliderJntSphElementInit; // size = 0x24
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInit; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInitType1; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInitToActor base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderJntSphElementInit* elements;
} ColliderJntSphInitToActor; // size = 0x10
/*
* Cylinder - A single cylinder shaped collider
*/
// collider structs
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ ColliderElement elem;
/* 0x40 */ Cylinder16 dim;
} ColliderCylinder; // size = 0x4C
// init data structs
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderElementInit elem;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInit; // size = 0x2C
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderElementInit elem;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInitType1; // size = 0x2C
typedef struct {
/* 0x00 */ ColliderInitToActor base;
/* 0x08 */ ColliderElementInit elem;
/* 0x20 */ Cylinder16 dim;
} ColliderCylinderInitToActor; // size = 0x2C
/*
* Tris - A collider made of triangle shaped elements
*/
// collider structs
typedef struct {
/* 0x00 */ ColliderElement base;
/* 0x28 */ TriNorm dim;
} ColliderTrisElement; // size = 0x5C
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ s32 count;
/* 0x1C */ ColliderTrisElement* elements;
} ColliderTris; // size = 0x20
// init data structs
typedef struct {
/* 0x00 */ Vec3f vtx[3];
} ColliderTrisElementDimInit; // size = 0x24
typedef struct {
/* 0x00 */ ColliderElementInit base;
/* 0x18 */ ColliderTrisElementDimInit dim;
} ColliderTrisElementInit; // size = 0x3C
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisElementInit* elements;
} ColliderTrisInit; // size = 0x10
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ s32 count;
/* 0x0C */ ColliderTrisElementInit* elements;
} ColliderTrisInitType1; // size = 0x10
/*
* Quad - A single quad shaped collider
*/
// collider structs
typedef struct {
/* 0x00 */ Vec3f quad[4];
/* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c
/* 0x36 */ Vec3s baMid; // midpoint of vectors b, a
/* 0x3C */ f32 acDistSq; // distance to nearest AC collision this frame, squared.
} ColliderQuadDim; // size = 0x40
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ ColliderElement elem;
/* 0x40 */ ColliderQuadDim dim;
} ColliderQuad; // size = 0x80
// init data structs
typedef struct {
/* 0x00 */ Vec3f quad[4];
} ColliderQuadDimInit; // size = 0x30
typedef struct {
/* 0x00 */ ColliderInit base;
/* 0x08 */ ColliderElementInit elem;
/* 0x20 */ ColliderQuadDimInit dim;
} ColliderQuadInit; // size = 0x50
typedef struct {
/* 0x00 */ ColliderInitType1 base;
/* 0x08 */ ColliderElementInit elem;
/* 0x20 */ ColliderQuadDimInit dim;
} ColliderQuadInitType1; // size = 0x50
/*
* Line collider
*/
typedef struct {
/* 0x00 */ Linef line;
/* 0x18 */ u16 ocFlags;
} OcLine; // size = 0x1C
/*
* Collider properties, for all shapes
*/
#define AT_NONE 0 // No flags set. Cannot have AT collisions when set as AT #define AT_NONE 0 // No flags set. Cannot have AT collisions when set as AT
#define AT_ON (1 << 0) // Can have AT collisions when set as AT #define AT_ON (1 << 0) // Can have AT collisions when set as AT

View file

@ -43,10 +43,12 @@ extern size_t gDmaMgrDmaBuffSize;
// Standard DMA Requests // Standard DMA Requests
s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size);
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, s32 line);
s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue, s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
OSMesg msg, const char* file, s32 line); OSMesg msg);
s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size);
s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
OSMesg msg, const char* file, s32 line);
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, s32 line);
// Special-purpose DMA Requests // Special-purpose DMA Requests

View file

@ -308,7 +308,7 @@ typedef enum {
/* 0x99 */ ITEM_DEKU_STICK_UPGRADE_30, /* 0x99 */ ITEM_DEKU_STICK_UPGRADE_30,
/* 0x9A */ ITEM_DEKU_NUT_UPGRADE_30, /* 0x9A */ ITEM_DEKU_NUT_UPGRADE_30,
/* 0x9B */ ITEM_DEKU_NUT_UPGRADE_40, /* 0x9B */ ITEM_DEKU_NUT_UPGRADE_40,
/* 0xFC */ ITEM_LAST_USED = 0xFC, /* 0xFC */ ITEM_SWORD_CS = 0xFC,
/* 0xFE */ ITEM_NONE_FE = 0xFE, /* 0xFE */ ITEM_NONE_FE = 0xFE,
/* 0xFF */ ITEM_NONE = 0xFF /* 0xFF */ ITEM_NONE = 0xFF
} ItemID; } ItemID;

View file

@ -82,6 +82,70 @@ typedef enum {
/* 0x37 */ MSGMODE_PAUSED // Causes the message system to do nothing until external code sets a new message mode or calls a public function /* 0x37 */ MSGMODE_PAUSED // Causes the message system to do nothing until external code sets a new message mode or calls a public function
} MessageMode; } MessageMode;
typedef enum MaskReactionSet {
/* 0x00 */ MASK_REACTION_SET_CARPENTER_BOSS,
/* 0x01 */ MASK_REACTION_SET_CARPENTER_1,
/* 0x02 */ MASK_REACTION_SET_CARPENTER_2,
/* 0x03 */ MASK_REACTION_SET_CARPENTER_3,
/* 0x04 */ MASK_REACTION_SET_CARPENTER_4,
/* 0x05 */ MASK_REACTION_SET_HYRULIAN_GUARD,
/* 0x06 */ MASK_REACTION_SET_HEISHI4_1,
/* 0x07 */ MASK_REACTION_SET_HEISHI4_2,
/* 0x08 */ MASK_REACTION_SET_CUCCO_LADY,
/* 0x09 */ MASK_REACTION_SET_CARPENTERS_SON,
/* 0x0A */ MASK_REACTION_SET_KAKARIKO_ROOF_MAN,
/* 0x0B */ MASK_REACTION_SET_WINDMILL_MAN,
/* 0x0C */ MASK_REACTION_SET_12, // Unused
/* 0x0D */ MASK_REACTION_SET_CURSED_SKULLTULA_MAN,
/* 0x0E */ MASK_REACTION_SET_DAMPE,
/* 0x0F */ MASK_REACTION_SET_GRAVEYARD_KID,
/* 0x10 */ MASK_REACTION_SET_SARIA,
/* 0x11 */ MASK_REACTION_SET_MIDO,
/* 0x12 */ MASK_REACTION_SET_FADO,
/* 0x13 */ MASK_REACTION_SET_KOKIRI_1,
/* 0x14 */ MASK_REACTION_SET_KOKIRI_2,
/* 0x15 */ MASK_REACTION_SET_SKULL_KID,
/* 0x16 */ MASK_REACTION_SET_ZELDA,
/* 0x17 */ MASK_REACTION_SET_MALON,
/* 0x18 */ MASK_REACTION_SET_TALON,
/* 0x19 */ MASK_REACTION_SET_INGO,
/* 0x1A */ MASK_REACTION_SET_LAKESIDE_PROFESSOR,
/* 0x1B */ MASK_REACTION_SET_MAGIC_BEAN_SALESMAN,
/* 0x1C */ MASK_REACTION_SET_RUNNING_MAN,
/* 0x1D */ MASK_REACTION_SET_ZORA,
/* 0x1E */ MASK_REACTION_SET_KING_ZORA,
/* 0x1F */ MASK_REACTION_SET_RUTO,
/* 0x20 */ MASK_REACTION_SET_GORON,
/* 0x21 */ MASK_REACTION_SET_DARUNIA,
/* 0x22 */ MASK_REACTION_SET_GERUDO_WHITE,
/* 0x23 */ MASK_REACTION_SET_NABOORU,
/* 0x24 */ MASK_REACTION_SET_DANCING_COUPLE,
/* 0x25 */ MASK_REACTION_SET_37, // ENHY_TYPE_AOB
/* 0x26 */ MASK_REACTION_SET_38, // ENHY_TYPE_COB
/* 0x27 */ MASK_REACTION_SET_39, // ENHY_TYPE_AHG_2
/* 0x28 */ MASK_REACTION_SET_40, // ENHY_TYPE_BOJ_3
/* 0x29 */ MASK_REACTION_SET_41, // ENHY_TYPE_AHG_4
/* 0x2A */ MASK_REACTION_SET_42, // ENHY_TYPE_BOJ_5
/* 0x2B */ MASK_REACTION_SET_43, // ENHY_TYPE_BBA
/* 0x2C */ MASK_REACTION_SET_44, // ENHY_TYPE_BJI_7
/* 0x2D */ MASK_REACTION_SET_45, // ENHY_TYPE_CNE_8
/* 0x2E */ MASK_REACTION_SET_46, // ENHY_TYPE_BOJ_9
/* 0x2F */ MASK_REACTION_SET_47, // ENHY_TYPE_BOJ_10
/* 0x30 */ MASK_REACTION_SET_48, // ENHY_TYPE_CNE_11
/* 0x31 */ MASK_REACTION_SET_49, // ENHY_TYPE_BOJ_12
/* 0x32 */ MASK_REACTION_SET_50, // ENHY_TYPE_AHG_13
/* 0x33 */ MASK_REACTION_SET_51, // ENHY_TYPE_BOJ_14
/* 0x34 */ MASK_REACTION_SET_52, // ENHY_TYPE_BJI_15
/* 0x35 */ MASK_REACTION_SET_53, // ENHY_TYPE_BOJ_16
/* 0x36 */ MASK_REACTION_SET_54, // ENHY_TYPE_AHG_17
/* 0x37 */ MASK_REACTION_SET_55, // ENHY_TYPE_BOB_18
/* 0x38 */ MASK_REACTION_SET_56, // ENHY_TYPE_BJI_19
/* 0x39 */ MASK_REACTION_SET_57, // ENHY_TYPE_AHG_20
/* 0x3A */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_1,
/* 0x3B */ MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_2,
/* 0x3C */ MASK_REACTION_SET_MAX
} MaskReactionSet;
typedef enum { typedef enum {
/* 0 */ TEXT_STATE_NONE, /* 0 */ TEXT_STATE_NONE,
/* 1 */ TEXT_STATE_DONE_HAS_NEXT, /* 1 */ TEXT_STATE_DONE_HAS_NEXT,

View file

@ -71,7 +71,7 @@ typedef enum {
typedef enum { typedef enum {
/* 0x00 */ PLAYER_IA_NONE, /* 0x00 */ PLAYER_IA_NONE,
/* 0x01 */ PLAYER_IA_LAST_USED, /* 0x01 */ PLAYER_IA_SWORD_CS, // Hold sword without shield in hand. The sword is not useable.
/* 0x02 */ PLAYER_IA_FISHING_POLE, /* 0x02 */ PLAYER_IA_FISHING_POLE,
/* 0x03 */ PLAYER_IA_SWORD_MASTER, /* 0x03 */ PLAYER_IA_SWORD_MASTER,
/* 0x04 */ PLAYER_IA_SWORD_KOKIRI, /* 0x04 */ PLAYER_IA_SWORD_KOKIRI,
@ -229,9 +229,9 @@ typedef enum {
} PlayerDoorType; } PlayerDoorType;
typedef enum { typedef enum {
/* 0x00 */ PLAYER_MODELGROUP_0, // unused (except with the `func_80091880` bug) /* 0x00 */ PLAYER_MODELGROUP_0, // unused (except for a bug in `Player_OverrideLimbDrawPause`)
/* 0x01 */ PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD, // kokiri/master sword, shield not in hand /* 0x01 */ PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD, //hold sword only. used for holding sword only as child link with hylian shield equipped
/* 0x02 */ PLAYER_MODELGROUP_SWORD, // kokiri/master sword and possibly shield /* 0x02 */ PLAYER_MODELGROUP_SWORD_AND_SHIELD, // hold sword and shield or just sword if no shield is equipped
/* 0x03 */ PLAYER_MODELGROUP_DEFAULT, // non-specific models, for items that don't have particular link models /* 0x03 */ PLAYER_MODELGROUP_DEFAULT, // non-specific models, for items that don't have particular link models
/* 0x04 */ PLAYER_MODELGROUP_4, // unused, same as PLAYER_MODELGROUP_DEFAULT /* 0x04 */ PLAYER_MODELGROUP_4, // unused, same as PLAYER_MODELGROUP_DEFAULT
/* 0x05 */ PLAYER_MODELGROUP_BGS, // biggoron sword /* 0x05 */ PLAYER_MODELGROUP_BGS, // biggoron sword
@ -244,7 +244,7 @@ typedef enum {
/* 0x0C */ PLAYER_MODELGROUP_OCARINA, // ocarina /* 0x0C */ PLAYER_MODELGROUP_OCARINA, // ocarina
/* 0x0D */ PLAYER_MODELGROUP_OOT, // ocarina of time /* 0x0D */ PLAYER_MODELGROUP_OOT, // ocarina of time
/* 0x0E */ PLAYER_MODELGROUP_BOTTLE, // bottles (drawn separately) /* 0x0E */ PLAYER_MODELGROUP_BOTTLE, // bottles (drawn separately)
/* 0x0F */ PLAYER_MODELGROUP_15, // "last used" /* 0x0F */ PLAYER_MODELGROUP_SWORD, // hold sword and no shield, even if one is equipped
/* 0x10 */ PLAYER_MODELGROUP_MAX /* 0x10 */ PLAYER_MODELGROUP_MAX
} PlayerModelGroup; } PlayerModelGroup;
@ -822,7 +822,7 @@ typedef struct Player {
/* 0x088E */ u8 unk_88E; /* 0x088E */ u8 unk_88E;
/* 0x088F */ u8 unk_88F; /* 0x088F */ u8 unk_88F;
/* 0x0890 */ u8 unk_890; /* 0x0890 */ u8 unk_890;
/* 0x0891 */ u8 shockTimer; /* 0x0891 */ u8 bodyShockTimer;
/* 0x0892 */ u8 unk_892; /* 0x0892 */ u8 unk_892;
/* 0x0893 */ u8 hoverBootsTimer; /* 0x0893 */ u8 hoverBootsTimer;
/* 0x0894 */ s16 fallStartHeight; // last truncated Y position before falling /* 0x0894 */ s16 fallStartHeight; // last truncated Y position before falling
@ -842,8 +842,8 @@ typedef struct Player {
/* 0x0908 */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX]; /* 0x0908 */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX];
/* 0x09E0 */ MtxF mf_9E0; /* 0x09E0 */ MtxF mf_9E0;
/* 0x0A20 */ MtxF shieldMf; /* 0x0A20 */ MtxF shieldMf;
/* 0x0A60 */ u8 isBurning; /* 0x0A60 */ u8 bodyIsBurning;
/* 0x0A61 */ u8 flameTimers[PLAYER_BODYPART_MAX]; // one flame per body part /* 0x0A61 */ u8 bodyFlameTimers[PLAYER_BODYPART_MAX]; // one flame per body part
/* 0x0A73 */ u8 unk_A73; /* 0x0A73 */ u8 unk_A73;
/* 0x0A74 */ PlayerFuncA74 func_A74; /* 0x0A74 */ PlayerFuncA74 func_A74;
/* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame) /* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame)

View file

@ -414,13 +414,13 @@ typedef enum {
#define EVENTCHKINF_0B 0x0B #define EVENTCHKINF_0B 0x0B
#define EVENTCHKINF_0C 0x0C #define EVENTCHKINF_0C 0x0C
#define EVENTCHKINF_0F 0x0F #define EVENTCHKINF_0F 0x0F
#define EVENTCHKINF_10 0x10 #define EVENTCHKINF_TALKED_TO_MALON_FIRST_TIME 0x10
#define EVENTCHKINF_11 0x11 #define EVENTCHKINF_11 0x11
#define EVENTCHKINF_12 0x12 #define EVENTCHKINF_RECEIVED_WEIRD_EGG 0x12
#define EVENTCHKINF_TALON_WOKEN_IN_CASTLE 0x13 #define EVENTCHKINF_TALON_WOKEN_IN_CASTLE 0x13
#define EVENTCHKINF_TALON_RETURNED_FROM_CASTLE 0x14 #define EVENTCHKINF_TALON_RETURNED_FROM_CASTLE 0x14
#define EVENTCHKINF_15 0x15 #define EVENTCHKINF_TALKED_TO_CHILD_MALON_AT_RANCH 0x15
#define EVENTCHKINF_16 0x16 #define EVENTCHKINF_CAN_LEARN_EPONAS_SONG 0x16
#define EVENTCHKINF_EPONA_OBTAINED 0x18 #define EVENTCHKINF_EPONA_OBTAINED 0x18
#define EVENTCHKINF_1B 0x1B #define EVENTCHKINF_1B 0x1B
#define EVENTCHKINF_1C 0x1C #define EVENTCHKINF_1C 0x1C
@ -688,9 +688,9 @@ typedef enum {
#define INFTABLE_76 0x76 #define INFTABLE_76 0x76
#define INFTABLE_77 0x77 #define INFTABLE_77 0x77
#define INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE 0x7E #define INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE 0x7E
#define INFTABLE_84 0x84 #define INFTABLE_TALKED_TO_MALON_FIRST_TIME 0x84
#define INFTABLE_85 0x85 #define INFTABLE_TOLD_EPONA_IS_SCARED 0x85
#define INFTABLE_8B 0x8B #define INFTABLE_MALON_SPAWNED_AT_HYRULE_CASTLE 0x8B
#define INFTABLE_8C 0x8C #define INFTABLE_8C 0x8C
#define INFTABLE_8D 0x8D #define INFTABLE_8D 0x8D
#define INFTABLE_8E 0x8E #define INFTABLE_8E 0x8E

View file

@ -2,7 +2,6 @@
import argparse import argparse
import json import json
import csv
import git import git
import os import os
import re import re
@ -59,10 +58,10 @@ def GetNonMatchingSize(path):
return size return size
def IsCFile(objfile): def IsCFile(objfile):
srcfile = objfile.strip().replace("build/", "").replace(".o", ".c") srcfile = objfile.strip().replace("build/gc-eu-mq-dbg/", "").replace(".o", ".c")
return os.path.isfile(srcfile) return os.path.isfile(srcfile)
mapFile = ReadAllLines("build/z64.map") mapFile = ReadAllLines("build/gc-eu-mq-dbg/z64.map")
curSegment = None curSegment = None
src = 0 src = 0
code = 0 code = 0
@ -86,15 +85,15 @@ for line in mapFile:
objFile = lineSplit[3] objFile = lineSplit[3]
if (section == ".text" and IsCFile(objFile)): if (section == ".text" and IsCFile(objFile)):
if (objFile.startswith("build/src")): if objFile.startswith("build/gc-eu-mq-dbg/src"):
src += size src += size
if (objFile.startswith("build/src/code") or (objFile.startswith("build/src/libultra/") and curSegment == "code")): if curSegment == "code":
code += size code += size
elif (objFile.startswith("build/src/boot") or (objFile.startswith("build/src/libultra/") and curSegment == "boot")): elif curSegment == "boot":
boot += size boot += size
elif (objFile.startswith("build/src/overlays")): else:
ovl += size ovl += size
nonMatchingASM = GetNonMatchingSize("asm/non_matchings") nonMatchingASM = GetNonMatchingSize("asm/non_matchings")
nonMatchingASMBoot = GetNonMatchingSize("asm/non_matchings/boot") nonMatchingASMBoot = GetNonMatchingSize("asm/non_matchings/boot")

4718
spec

File diff suppressed because it is too large Load diff

View file

@ -269,7 +269,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) {
adsr->delay = 1; adsr->delay = 1;
} }
adsr->target = adsr->envelope[adsr->envIndex].arg / 32767.0f; adsr->target = adsr->envelope[adsr->envIndex].arg / 32767.0f;
adsr->target = adsr->target * adsr->target; adsr->target = SQ(adsr->target);
adsr->velocity = (adsr->target - adsr->current) / adsr->delay; adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
adsr->action.s.state = ADSR_STATE_FADE; adsr->action.s.state = ADSR_STATE_FADE;
adsr->envIndex++; adsr->envIndex++;

View file

@ -1356,8 +1356,8 @@ void AudioHeap_ChangeStorage(StorageChange* change, Sample* sample) {
u32 startAddr = change->oldAddr; u32 startAddr = change->oldAddr;
u32 endAddr = change->oldAddr + change->size; u32 endAddr = change->oldAddr + change->size;
if (startAddr <= (u32)sample->sampleAddr && (u32)sample->sampleAddr < endAddr) { if (((u32)sample->sampleAddr >= startAddr) && ((u32)sample->sampleAddr < endAddr)) {
sample->sampleAddr = sample->sampleAddr - startAddr + change->newAddr; sample->sampleAddr += -startAddr + change->newAddr;
sample->medium = change->newMedium; sample->medium = change->newMedium;
} }
} }

View file

@ -789,7 +789,7 @@ AudioTable* AudioLoad_GetLoadTable(s32 tableType) {
* Also relocate offsets into pointers within this loaded soundFont * Also relocate offsets into pointers within this loaded soundFont
* *
* @param fontId index of font being processed * @param fontId index of font being processed
* @param fontData ram address of raw soundfont binary loaded into cache * @param fontDataStartAddr ram address of raw soundfont binary loaded into cache
* @param sampleBankReloc information on the sampleBank containing raw audio samples * @param sampleBankReloc information on the sampleBank containing raw audio samples
*/ */
void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, SampleBankRelocInfo* sampleBankReloc) { void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, SampleBankRelocInfo* sampleBankReloc) {
@ -811,7 +811,6 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
// The first u32 in fontData is an offset to a list of offsets to the drums // The first u32 in fontData is an offset to a list of offsets to the drums
soundListOffset = fontData[0]; soundListOffset = fontData[0];
if (1) {}
// If the soundFont has drums // If the soundFont has drums
if ((soundListOffset != 0) && (numDrums != 0)) { if ((soundListOffset != 0) && (numDrums != 0)) {
@ -824,20 +823,24 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
soundOffset = (u32)((Drum**)fontData[0])[i]; soundOffset = (u32)((Drum**)fontData[0])[i];
// Some drum data entries are empty, represented by an offset of 0 in the list of drum offsets // Some drum data entries are empty, represented by an offset of 0 in the list of drum offsets
if (soundOffset != 0) { if (soundOffset == 0) {
soundOffset = RELOC_TO_RAM(soundOffset); continue;
((Drum**)fontData[0])[i] = drum = (Drum*)soundOffset;
// The drum may be in the list multiple times and already relocated
if (!drum->isRelocated) {
AudioLoad_RelocateSample(&drum->tunedSample, fontDataStartAddr, sampleBankReloc);
soundOffset = (u32)drum->envelope;
drum->envelope = (EnvelopePoint*)RELOC_TO_RAM(soundOffset);
drum->isRelocated = true;
}
} }
soundOffset = RELOC_TO_RAM(soundOffset);
((Drum**)fontData[0])[i] = drum = (Drum*)soundOffset;
// The drum may be in the list multiple times and already relocated
if (drum->isRelocated) {
continue;
}
AudioLoad_RelocateSample(&drum->tunedSample, fontDataStartAddr, sampleBankReloc);
soundOffset = (u32)drum->envelope;
drum->envelope = (EnvelopePoint*)RELOC_TO_RAM(soundOffset);
drum->isRelocated = true;
} }
} }
@ -845,7 +848,6 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
// The second u32 in fontData is an offset to the first sound effect entry // The second u32 in fontData is an offset to the first sound effect entry
soundListOffset = fontData[1]; soundListOffset = fontData[1];
if (1) {}
// If the soundFont has sound effects // If the soundFont has sound effects
if ((soundListOffset != 0) && (numSfx != 0)) { if ((soundListOffset != 0) && (numSfx != 0)) {
@ -859,9 +861,11 @@ void AudioLoad_RelocateFont(s32 fontId, SoundFontData* fontDataStartAddr, Sample
soundEffect = (SoundEffect*)soundOffset; soundEffect = (SoundEffect*)soundOffset;
// Check for NULL (note: the pointer is guaranteed to be in fontData and can never be NULL) // Check for NULL (note: the pointer is guaranteed to be in fontData and can never be NULL)
if ((soundEffect != NULL) && ((u32)soundEffect->tunedSample.sample != 0)) { if ((soundEffect == NULL) || ((u32)soundEffect->tunedSample.sample == 0)) {
AudioLoad_RelocateSample(&soundEffect->tunedSample, fontDataStartAddr, sampleBankReloc); continue;
} }
AudioLoad_RelocateSample(&soundEffect->tunedSample, fontDataStartAddr, sampleBankReloc);
} }
} }

View file

@ -23,8 +23,8 @@ void Main_ThreadEntry(void* arg) {
DmaMgr_Init(); DmaMgr_Init();
osSyncPrintf("codeセグメントロード中..."); osSyncPrintf("codeセグメントロード中...");
time = osGetTime(); time = osGetTime();
DmaMgr_RequestSyncDebug(_codeSegmentStart, (uintptr_t)_codeSegmentRomStart, DMA_REQUEST_SYNC(_codeSegmentStart, (uintptr_t)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart,
_codeSegmentRomEnd - _codeSegmentRomStart, "../idle.c", 238); "../idle.c", 238);
time -= osGetTime(); time -= osGetTime();
osSyncPrintf("\rcodeセグメントロード中...完了\n"); osSyncPrintf("\rcodeセグメントロード中...完了\n");
osSyncPrintf("転送時間 %6.3f\n"); osSyncPrintf("転送時間 %6.3f\n");

View file

@ -446,9 +446,11 @@ void DmaMgr_ThreadEntry(void* arg) {
} }
/** /**
* Submits a DMA request to the DMA manager. For internal use only. * Submit an asynchronous DMA request. Unlike other DMA requests, this will not block the current thread. Data arrival
* is not immediate however, ensure that the request has completed by awaiting a message sent to `queue` when the DMA
* operation has completed.
* *
* @param req DMA request, filled out internally. * @param req DMA request structure, filled out internally.
* @param ram Location in DRAM for data to be written. * @param ram Location in DRAM for data to be written.
* @param vrom Virtual ROM location for data to be read. * @param vrom Virtual ROM location for data to be read.
* @param size Transfer size. * @param size Transfer size.
@ -456,8 +458,8 @@ void DmaMgr_ThreadEntry(void* arg) {
* @param msg Message to send to `queue` once the transfer is complete. * @param msg Message to send to `queue` once the transfer is complete.
* @return 0 * @return 0
*/ */
s32 DmaMgr_SendRequest(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue,
OSMesg msg) { OSMesg msg) {
static s32 sDmaMgrQueueFullLogged = 0; static s32 sDmaMgrQueueFullLogged = 0;
if ((1 && (ram == NULL)) || (osMemSize < OS_K0_TO_PHYSICAL(ram) + size) || (vrom & 1) || (vrom > 0x4000000) || if ((1 && (ram == NULL)) || (osMemSize < OS_K0_TO_PHYSICAL(ram) + size) || (vrom & 1) || (vrom > 0x4000000) ||
@ -504,8 +506,8 @@ s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size) {
s32 ret; s32 ret;
osCreateMesgQueue(&queue, &msg, 1); osCreateMesgQueue(&queue, &msg, 1);
ret = DmaMgr_SendRequest(&req, ram, vrom, size, 0, &queue, NULL); ret = DmaMgr_RequestAsync(&req, ram, vrom, size, 0, &queue, NULL);
if (ret == -1) { // DmaMgr_SendRequest only returns 0 if (ret == -1) { // DmaMgr_RequestAsync only returns 0
return ret; return ret;
} }
@ -564,25 +566,15 @@ void DmaMgr_Init(void) {
} }
/** /**
* Submit an asynchronous DMA request. Unlike other DMA requests, this will not block the current thread. Data arrival * Asynchronous DMA Request with source file and line info for debugging.
* is not immediate however, ensure that the request has completed by awaiting a message sent to `queue` when the DMA
* operation has completed.
* *
* @param req DMA request structure, filled out internally. * @see DmaMgr_RequestAsync
* @param ram Location in DRAM for data to be written.
* @param vrom Virtual ROM location for data to be read.
* @param size Transfer size.
* @param queue Message queue to notify with `msg` once the transfer is complete.
* @param msg Message to send to `queue` once the transfer is complete.
* @param file Debug filename of caller.
* @param line Debug line number of caller.
* @return 0
*/ */
s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue, s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
OSMesg msg, const char* file, s32 line) { OSMesg msg, const char* file, s32 line) {
req->filename = file; req->filename = file;
req->line = line; req->line = line;
return DmaMgr_SendRequest(req, ram, vrom, size, unk5, queue, msg); return DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg);
} }
/** /**
@ -600,8 +592,8 @@ s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char*
req.filename = file; req.filename = file;
req.line = line; req.line = line;
osCreateMesgQueue(&queue, &msg, 1); osCreateMesgQueue(&queue, &msg, 1);
ret = DmaMgr_SendRequest(&req, ram, vrom, size, 0, &queue, NULL); ret = DmaMgr_RequestAsync(&req, ram, vrom, size, 0, &queue, NULL);
if (ret == -1) { // DmaMgr_SendRequest only returns 0 if (ret == -1) { // DmaMgr_RequestAsync only returns 0
return ret; return ret;
} }

View file

@ -1,82 +1,134 @@
/**
* @file audio_thread_manager.c
*
* This file implements basic thread features for the audio driver. It manages updating the driver on vertical retrace
* and sending the audio rsp tasks generated by the driver to the task scheduler.
*/
#include "global.h" #include "global.h"
void func_800C3C80(AudioMgr* audioMgr) { void AudioMgr_NotifyTaskDone(AudioMgr* audioMgr) {
AudioTask* task = audioMgr->rspTask; AudioTask* task = audioMgr->rspTask;
// If the audio rsp task has a message queue to receive task done notifications, post a message to it.
if (audioMgr->rspTask->msgQueue != NULL) { if (audioMgr->rspTask->msgQueue != NULL) {
osSendMesg(task->msgQueue, NULL, OS_MESG_BLOCK); osSendMesg(task->msgQueue, NULL, OS_MESG_BLOCK);
} }
} }
/**
* Handle retrace event.
* Update the audio driver and schedule audio rsp tasks.
*/
void AudioMgr_HandleRetrace(AudioMgr* audioMgr) { void AudioMgr_HandleRetrace(AudioMgr* audioMgr) {
AudioTask* rspTask; AudioTask* rspTask;
if (SREG(20) > 0) { if (R_AUDIOMGR_DEBUG_LEVEL > AUDIOMGR_DEBUG_LEVEL_NONE) {
// Inhibit audio rsp task processing
audioMgr->rspTask = NULL; audioMgr->rspTask = NULL;
} }
if (audioMgr->rspTask != NULL) { if (audioMgr->rspTask != NULL) {
// Got an rsp task to process, build the OSScTask and forward it to the scheduler to run
audioMgr->audioTask.next = NULL; audioMgr->audioTask.next = NULL;
audioMgr->audioTask.flags = OS_SC_NEEDS_RSP; audioMgr->audioTask.flags = OS_SC_NEEDS_RSP;
audioMgr->audioTask.framebuffer = NULL; audioMgr->audioTask.framebuffer = NULL;
audioMgr->audioTask.list = audioMgr->rspTask->task; audioMgr->audioTask.list = audioMgr->rspTask->task;
audioMgr->audioTask.msgQueue = &audioMgr->taskQueue; audioMgr->audioTask.msgQueue = &audioMgr->taskDoneQueue;
audioMgr->audioTask.msg = NULL; audioMgr->audioTask.msg = NULL;
osSendMesg(&audioMgr->sched->cmdQueue, (OSMesg)&audioMgr->audioTask, OS_MESG_BLOCK); osSendMesg(&audioMgr->sched->cmdQueue, (OSMesg)&audioMgr->audioTask, OS_MESG_BLOCK);
Sched_Notify(audioMgr->sched); Sched_Notify(audioMgr->sched);
} }
// Update the audio driver
gAudioThreadUpdateTimeStart = osGetTime(); gAudioThreadUpdateTimeStart = osGetTime();
if (SREG(20) >= 2) {
if (R_AUDIOMGR_DEBUG_LEVEL >= AUDIOMGR_DEBUG_LEVEL_NO_UPDATE) {
// Skip update, no rsp task produced
rspTask = NULL; rspTask = NULL;
} else { } else {
rspTask = func_800E4FE0(); rspTask = func_800E4FE0();
} }
gAudioThreadUpdateTimeAcc += osGetTime() - gAudioThreadUpdateTimeStart; gAudioThreadUpdateTimeAcc += osGetTime() - gAudioThreadUpdateTimeStart;
gAudioThreadUpdateTimeStart = 0; gAudioThreadUpdateTimeStart = 0;
if (audioMgr->rspTask != NULL) { if (audioMgr->rspTask != NULL) {
osRecvMesg(&audioMgr->taskQueue, NULL, OS_MESG_BLOCK); // Wait for the audio rsp task scheduled on the previous retrace to complete. This looks like it should wait
func_800C3C80(audioMgr); // for the task scheduled on the current retrace, earlier in this function, but since the queue is initially
// filled in AudioMgr_Init this osRecvMesg call doesn't wait for the task scheduler to post a message for the
// most recent task as there is already a message waiting.
osRecvMesg(&audioMgr->taskDoneQueue, NULL, OS_MESG_BLOCK);
// Report task done
//! @bug As the above osRecvMesg is waiting for the previous task to complete rather than the current task,
//! the task done notification is sent to the task done queue for the current task as soon as the previous task
//! is completed, without waiting for the current task.
//! In practice, task done notifications are not used by the audio driver so this is inconsequential.
AudioMgr_NotifyTaskDone(audioMgr);
} }
// Update rsp task to be scheduled on next retrace
audioMgr->rspTask = rspTask; audioMgr->rspTask = rspTask;
} }
/**
* Handle Pre-NMI event.
* Implemented by the audio driver.
*
* @see Audio_PreNMI
*/
void AudioMgr_HandlePreNMI(AudioMgr* audioMgr) { void AudioMgr_HandlePreNMI(AudioMgr* audioMgr) {
// "Audio manager received OS_SC_PRE_NMI_MSG" // "Audio manager received OS_SC_PRE_NMI_MSG"
osSyncPrintf("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n"); osSyncPrintf("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n");
Audio_PreNMI(); Audio_PreNMI();
} }
void AudioMgr_ThreadEntry(void* arg0) { void AudioMgr_ThreadEntry(void* arg) {
AudioMgr* audioMgr = (AudioMgr*)arg0; AudioMgr* audioMgr = (AudioMgr*)arg;
IrqMgrClient irqClient; IrqMgrClient irqClient;
s16* msg = NULL; s16* msg = NULL;
osSyncPrintf("オーディオマネージャスレッド実行開始\n"); // "Start running audio manager thread" // "Start running audio manager thread"
osSyncPrintf("オーディオマネージャスレッド実行開始\n");
// Initialize audio driver
Audio_Init(); Audio_Init();
AudioLoad_SetDmaHandler(DmaMgr_AudioDmaHandler); AudioLoad_SetDmaHandler(DmaMgr_AudioDmaHandler);
Audio_InitSound(); Audio_InitSound();
osSendMesg(&audioMgr->lockQueue, NULL, OS_MESG_BLOCK);
// Fill init queue to signal that the audio driver is initialized
osSendMesg(&audioMgr->initQueue, NULL, OS_MESG_BLOCK);
IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->interruptQueue); IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->interruptQueue);
// Spin waiting for events
while (true) { while (true) {
osRecvMesg(&audioMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK); osRecvMesg(&audioMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK);
switch (*msg) { switch (*msg) {
case OS_SC_RETRACE_MSG: case OS_SC_RETRACE_MSG:
AudioMgr_HandleRetrace(audioMgr); AudioMgr_HandleRetrace(audioMgr);
// Empty the interrupt queue
while (!MQ_IS_EMPTY(&audioMgr->interruptQueue)) { while (!MQ_IS_EMPTY(&audioMgr->interruptQueue)) {
osRecvMesg(&audioMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK); osRecvMesg(&audioMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK);
switch (*msg) { switch (*msg) {
case OS_SC_RETRACE_MSG: case OS_SC_RETRACE_MSG:
// Don't process a retrace more than once in quick succession
break; break;
case OS_SC_PRE_NMI_MSG: case OS_SC_PRE_NMI_MSG:
// Always handle Pre-NMI
AudioMgr_HandlePreNMI(audioMgr); AudioMgr_HandlePreNMI(audioMgr);
break; break;
} }
} }
break; break;
case OS_SC_PRE_NMI_MSG: case OS_SC_PRE_NMI_MSG:
AudioMgr_HandlePreNMI(audioMgr); AudioMgr_HandlePreNMI(audioMgr);
break; break;
@ -84,8 +136,15 @@ void AudioMgr_ThreadEntry(void* arg0) {
} }
} }
void AudioMgr_Unlock(AudioMgr* audioMgr) { /**
osRecvMesg(&audioMgr->lockQueue, NULL, OS_MESG_BLOCK); * Stalls the current thread until the audio thread is sufficiently initialized.
*
* Note this function only works once. After the first call the message that the audio thread posted to the init queue
* will have been removed, subsequent calls to this function will block indefinitely as the audio thread does not refill
* the queue.
*/
void AudioMgr_WaitForInit(AudioMgr* audioMgr) {
osRecvMesg(&audioMgr->initQueue, NULL, OS_MESG_BLOCK);
} }
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Scheduler* sched, IrqMgr* irqMgr) { void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Scheduler* sched, IrqMgr* irqMgr) {
@ -95,11 +154,12 @@ void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, Schedule
audioMgr->irqMgr = irqMgr; audioMgr->irqMgr = irqMgr;
audioMgr->rspTask = NULL; audioMgr->rspTask = NULL;
osCreateMesgQueue(&audioMgr->taskQueue, audioMgr->taskMsgBuf, ARRAY_COUNT(audioMgr->taskMsgBuf)); osCreateMesgQueue(&audioMgr->taskDoneQueue, &audioMgr->taskDoneMsg, 1);
osCreateMesgQueue(&audioMgr->interruptQueue, audioMgr->interruptMsgBuf, ARRAY_COUNT(audioMgr->interruptMsgBuf)); osCreateMesgQueue(&audioMgr->interruptQueue, audioMgr->interruptMsgBuf, ARRAY_COUNT(audioMgr->interruptMsgBuf));
osCreateMesgQueue(&audioMgr->lockQueue, audioMgr->lockMsgBuf, ARRAY_COUNT(audioMgr->lockMsgBuf)); osCreateMesgQueue(&audioMgr->initQueue, &audioMgr->initMsg, 1);
osSendMesg(&audioMgr->taskQueue, NULL, OS_MESG_BLOCK); // Send a message to the task done queue so it is initially full
osSendMesg(&audioMgr->taskDoneQueue, NULL, OS_MESG_BLOCK);
osCreateThread(&audioMgr->thread, id, AudioMgr_ThreadEntry, audioMgr, stack, pri); osCreateThread(&audioMgr->thread, id, AudioMgr_ThreadEntry, audioMgr, stack, pri);
osStartThread(&audioMgr->thread); osStartThread(&audioMgr->thread);

View file

@ -13,7 +13,7 @@ typedef struct InitFunc {
// .data // .data
void* sInitFuncs = NULL; void* sInitFuncs = NULL;
char sNew[] = { 'n', 'e', 'w' }; char sNew[] = "new";
char D_80134488[0x18] = { char D_80134488[0x18] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00,
@ -100,7 +100,7 @@ void func_800FCB34(void) {
initFunc = (InitFunc*)((s32)initFunc + nextOffset); initFunc = (InitFunc*)((s32)initFunc + nextOffset);
if (initFunc->func != NULL) { if (initFunc->func != NULL) {
(*initFunc->func)(); initFunc->func();
} }
nextOffset = initFunc->nextOffset; nextOffset = initFunc->nextOffset;

View file

@ -50,8 +50,8 @@ f32 Math_FAtanTaylorQF(f32 x) {
if (poly + term == poly) { if (poly + term == poly) {
break; break;
} }
poly = poly + term; poly += term;
exp = exp * sq; exp *= sq;
} }
return poly; return poly;

View file

@ -95,25 +95,21 @@ static DebugCam* sDebugCamPtr;
static s16 D_8016110C; static s16 D_8016110C;
static DebugCamAnim sDebugCamAnim; static DebugCamAnim sDebugCamAnim;
Vec3f* DebugCamera_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) { Vec3f DebugCamera_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) {
Vec3f sum; Vec3f sum;
Vec3f b; Vec3f b = OLib_VecGeoToVec3f(geo);
OLib_VecGeoToVec3f(&b, geo);
sum.x = a->x + b.x; sum.x = a->x + b.x;
sum.y = a->y + b.y; sum.y = a->y + b.y;
sum.z = a->z + b.z; sum.z = a->z + b.z;
*dest = sum; return sum;
return dest;
} }
/** /**
* Calculates a new Up vector from the pitch, yaw, roll * Calculates a new Up vector from the pitch, yaw, roll
*/ */
Vec3f* DebugCamera_CalcUpFromPitchYawRoll(Vec3f* viewUp, s16 pitch, s16 yaw, s16 roll) { Vec3f DebugCamera_CalcUpFromPitchYawRoll(s16 pitch, s16 yaw, s16 roll) {
f32 sinP = Math_SinS(pitch); f32 sinP = Math_SinS(pitch);
f32 cosP = Math_CosS(pitch); f32 cosP = Math_CosS(pitch);
f32 sinY = Math_SinS(yaw); f32 sinY = Math_SinS(yaw);
@ -155,9 +151,7 @@ Vec3f* DebugCamera_CalcUpFromPitchYawRoll(Vec3f* viewUp, s16 pitch, s16 yaw, s16
up.y = DOTXYZ(baseUp, rollMtxRow2); up.y = DOTXYZ(baseUp, rollMtxRow2);
up.z = DOTXYZ(baseUp, rollMtxRow3); up.z = DOTXYZ(baseUp, rollMtxRow3);
*viewUp = up; return up;
return viewUp;
} }
char* DebugCamera_SetTextValue(s16 value, char* str, u8 endIdx) { char* DebugCamera_SetTextValue(s16 value, char* str, u8 endIdx) {
@ -221,9 +215,9 @@ void func_800B3F94(PosRot* posRot, Vec3f* vec, Vec3s* out) {
VecGeo geo; VecGeo geo;
Vec3f tempVec; Vec3f tempVec;
OLib_Vec3fDiffToVecGeo(&geo, &posRot->pos, vec); geo = OLib_Vec3fDiffToVecGeo(&posRot->pos, vec);
geo.yaw -= posRot->rot.y; geo.yaw -= posRot->rot.y;
OLib_VecGeoToVec3f(&tempVec, &geo); tempVec = OLib_VecGeoToVec3f(&geo);
DebugCamera_Vec3FToS(&tempVec, out); DebugCamera_Vec3FToS(&tempVec, out);
} }
@ -232,9 +226,9 @@ void func_800B3FF4(PosRot* posRot, Vec3f* vec, Vec3f* out) {
Vec3f tempVec; Vec3f tempVec;
DebugCamera_CopyVec3f(vec, &tempVec); DebugCamera_CopyVec3f(vec, &tempVec);
OLib_Vec3fToVecGeo(&geo, &tempVec); geo = OLib_Vec3fToVecGeo(&tempVec);
geo.yaw += posRot->rot.y; geo.yaw += posRot->rot.y;
DebugCamera_AddVecGeoToVec3f(out, &posRot->pos, &geo); *out = DebugCamera_AddVecGeoToVec3f(&posRot->pos, &geo);
} }
void func_800B404C(PosRot* posRot, Vec3s* vec, Vec3f* out) { void func_800B404C(PosRot* posRot, Vec3s* vec, Vec3f* out) {
@ -335,7 +329,7 @@ s32 func_800B4370(DebugCam* debugCam, s16 idx, Camera* cam) {
geo.pitch = 0x2000; geo.pitch = 0x2000;
geo.yaw -= 0x7FFF; geo.yaw -= 0x7FFF;
geo.r = 250.0f; geo.r = 250.0f;
DebugCamera_AddVecGeoToVec3f(&debugCam->eye, &debugCam->at, &geo); debugCam->eye = DebugCamera_AddVecGeoToVec3f(&debugCam->at, &geo);
debugCam->roll = lookAt->cameraRoll; debugCam->roll = lookAt->cameraRoll;
debugCam->rollDegrees = debugCam->roll * (360.0f / 256.0f); debugCam->rollDegrees = debugCam->roll * (360.0f / 256.0f);
debugCam->fov = lookAt->viewAngle; debugCam->fov = lookAt->viewAngle;
@ -668,9 +662,9 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
phi_s0 = sp124; phi_s0 = sp124;
if (!D_80161144) { if (!D_80161144) {
OLib_Vec3fDiffToVecGeo(&sp104, sp7C, sp80); sp104 = OLib_Vec3fDiffToVecGeo(sp7C, sp80);
} else { } else {
OLib_Vec3fDiffToVecGeo(&sp104, sp80, sp7C); sp104 = OLib_Vec3fDiffToVecGeo(sp80, sp7C);
} }
if (debugCam->unk_44 > 100) { if (debugCam->unk_44 > 100) {
@ -706,11 +700,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = temp_f2; spFC.r = temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 0xB) { if (debugCam->unk_40 == 0xB) {
debugCam->unk_44++; debugCam->unk_44++;
@ -734,11 +728,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = -temp_f2; spFC.r = -temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 0xC) { if (debugCam->unk_40 == 0xC) {
debugCam->unk_44++; debugCam->unk_44++;
@ -757,10 +751,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 1) { if (debugCam->unk_40 == 1) {
@ -775,10 +769,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 2) { if (debugCam->unk_40 == 2) {
debugCam->unk_44++; debugCam->unk_44++;
@ -792,9 +786,9 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0x3FFF; spFC.pitch = 0x3FFF;
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
if (!D_80161144) { if (!D_80161144) {
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 3) { if (debugCam->unk_40 == 3) {
debugCam->unk_44++; debugCam->unk_44++;
@ -808,9 +802,9 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = -0x3FFF; spFC.pitch = -0x3FFF;
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
if (!D_80161144) { if (!D_80161144) {
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 4) { if (debugCam->unk_40 == 4) {
debugCam->unk_44++; debugCam->unk_44++;
@ -825,10 +819,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw + 0x3FFF; spFC.yaw = sp104.yaw + 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw - 0x3FFF; spFC.yaw = sp104.yaw - 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 5) { if (debugCam->unk_40 == 5) {
debugCam->unk_44++; debugCam->unk_44++;
@ -843,10 +837,10 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.pitch = 0; spFC.pitch = 0;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw - 0x3FFF; spFC.yaw = sp104.yaw - 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.yaw = sp104.yaw + 0x3FFF; spFC.yaw = sp104.yaw + 0x3FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 6) { if (debugCam->unk_40 == 6) {
debugCam->unk_44++; debugCam->unk_44++;
@ -870,11 +864,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = temp_f2; spFC.r = temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 0xB) { if (debugCam->unk_40 == 0xB) {
debugCam->unk_44++; debugCam->unk_44++;
@ -899,11 +893,11 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
spFC.r = -temp_f2; spFC.r = -temp_f2;
if (!D_80161144) { if (!D_80161144) {
spFC.yaw = sp104.yaw; spFC.yaw = sp104.yaw;
DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); *sp7C = DebugCamera_AddVecGeoToVec3f(sp7C, &spFC);
} else { } else {
spFC.pitch = -spFC.pitch; spFC.pitch = -spFC.pitch;
spFC.yaw = sp104.yaw - 0x7FFF; spFC.yaw = sp104.yaw - 0x7FFF;
DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); *sp80 = DebugCamera_AddVecGeoToVec3f(sp80, &spFC);
} }
if (debugCam->unk_40 == 0xC) { if (debugCam->unk_40 == 0xC) {
debugCam->unk_44++; debugCam->unk_44++;
@ -961,20 +955,20 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
if (!D_80161144) { if (!D_80161144) {
sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? pitch : -pitch); sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? pitch : -pitch);
sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? yaw : -yaw); sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? yaw : -yaw);
DebugCamera_AddVecGeoToVec3f(sp80, sp7C, &sp104); *sp80 = DebugCamera_AddVecGeoToVec3f(sp7C, &sp104);
debugCam->sub.unk_104A.x = -sp104.pitch; debugCam->sub.unk_104A.x = -sp104.pitch;
debugCam->sub.unk_104A.y = sp104.yaw - 0x7FFF; debugCam->sub.unk_104A.y = sp104.yaw - 0x7FFF;
} else { } else {
sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? -pitch : pitch); sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? -pitch : pitch);
sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? -yaw : yaw); sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? -yaw : yaw);
DebugCamera_AddVecGeoToVec3f(sp7C, sp80, &sp104); *sp7C = DebugCamera_AddVecGeoToVec3f(sp80, &sp104);
debugCam->sub.unk_104A.x = sp104.pitch; debugCam->sub.unk_104A.x = sp104.pitch;
debugCam->sub.unk_104A.y = sp104.yaw; debugCam->sub.unk_104A.y = sp104.yaw;
} }
OLib_Vec3fDiffToVecGeo(&spF4, sp80, sp7C); spF4 = OLib_Vec3fDiffToVecGeo(sp80, sp7C);
DebugCamera_CalcUpFromPitchYawRoll(&debugCam->unk_1C, spF4.pitch, spF4.yaw, debugCam->unk_1C =
CAM_DEG_TO_BINANG(debugCam->rollDegrees)); DebugCamera_CalcUpFromPitchYawRoll(spF4.pitch, spF4.yaw, CAM_DEG_TO_BINANG(debugCam->rollDegrees));
if (debugCam->unk_00 == 1) { if (debugCam->unk_00 == 1) {
if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_CRIGHT)) { if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_CRIGHT)) {
cam->inputDir = debugCam->sub.unk_104A; cam->inputDir = debugCam->sub.unk_104A;
@ -982,7 +976,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
cam->at = *sp7C; cam->at = *sp7C;
spFC = sp104; spFC = sp104;
spFC.r = new_var2; spFC.r = new_var2;
DebugCamera_AddVecGeoToVec3f(&cam->eye, &cam->at, &spFC); cam->eye = DebugCamera_AddVecGeoToVec3f(&cam->at, &spFC);
} }
} }
} }
@ -1380,7 +1374,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
DebugCamera_ScreenTextColored(30, 25, DEBUG_CAM_TEXT_BROWN, &sp110); DebugCamera_ScreenTextColored(30, 25, DEBUG_CAM_TEXT_BROWN, &sp110);
} else { } else {
if (D_8012CEE0[0]) {} if (D_8012CEE0[0]) {}
OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp7C); spFC = OLib_Vec3fDiffToVecGeo(sp90, sp7C);
spFC.yaw -= cam->playerPosRot.rot.y; spFC.yaw -= cam->playerPosRot.rot.y;
DebugCamera_ScreenTextColored( DebugCamera_ScreenTextColored(
3, 22, 3, 22,
@ -1394,7 +1388,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D0F8); DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D0F8);
DebugCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); DebugCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6);
DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_ORANGE, D_8012D0D4); DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_ORANGE, D_8012D0D4);
OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp80); spFC = OLib_Vec3fDiffToVecGeo(sp90, sp80);
spFC.yaw -= cam->playerPosRot.rot.y; spFC.yaw -= cam->playerPosRot.rot.y;
DebugCamera_ScreenTextColored(30, 22, DebugCamera_ScreenTextColored(30, 22,
((debugCam->sub.unk_08 == 1) && (debugCam->sub.unk_0A == 4) && D_80161144) ((debugCam->sub.unk_08 == 1) && (debugCam->sub.unk_0A == 4) && D_80161144)
@ -1425,7 +1419,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
func_800B404C(temp_s6, &(debugCam->sub.lookAt + i)->pos, &spB8); func_800B404C(temp_s6, &(debugCam->sub.lookAt + i)->pos, &spB8);
func_800B404C(temp_s6, &(debugCam->sub.position + i)->pos, &spAC); func_800B404C(temp_s6, &(debugCam->sub.position + i)->pos, &spAC);
} }
OLib_Vec3fDiffToVecGeo(&spFC, &spAC, &spB8); spFC = OLib_Vec3fDiffToVecGeo(&spAC, &spB8);
spAA = debugCam->sub.lookAt[i].cameraRoll * 0xB6; spAA = debugCam->sub.lookAt[i].cameraRoll * 0xB6;
if (i == debugCam->sub.unkIdx) { if (i == debugCam->sub.unkIdx) {
DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f, DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f,
@ -1496,7 +1490,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
D_8012D110++; D_8012D110++;
D_8012D110 %= 50; D_8012D110 %= 50;
OLib_Vec3fDiffToVecGeo(&spA0, &cam->eye, &cam->at); spA0 = OLib_Vec3fDiffToVecGeo(&cam->eye, &cam->at);
DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF, DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF,
0xFF, 0x7F, 0x2D, 0, cam->play->view.gfxCtx); 0xFF, 0x7F, 0x2D, 0, cam->play->view.gfxCtx);
DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F, DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F,
@ -1507,7 +1501,7 @@ void DebugCamera_Update(DebugCam* debugCam, Camera* cam) {
0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx); 0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx);
DebugDisplay_AddObject(cam->at.x, cam->at.y, cam->at.z, spA0.pitch * -1, spA0.yaw, 0, 1.5f, 2.0f, 1.0f, 0xFF, DebugDisplay_AddObject(cam->at.x, cam->at.y, cam->at.z, spA0.pitch * -1, spA0.yaw, 0, 1.5f, 2.0f, 1.0f, 0xFF,
0x7F, 0x7F, 0x80, 4, cam->play->view.gfxCtx); 0x7F, 0x7F, 0x80, 4, cam->play->view.gfxCtx);
OLib_Vec3fDiffToVecGeo(&spA0, &cam->eyeNext, &cam->at); spA0 = OLib_Vec3fDiffToVecGeo(&cam->eyeNext, &cam->at);
DebugDisplay_AddObject(cam->eyeNext.x, cam->eyeNext.y, cam->eyeNext.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f, DebugDisplay_AddObject(cam->eyeNext.x, cam->eyeNext.y, cam->eyeNext.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f,
.5f, 0xFF, 0xC0, 0x7F, 0x50, 5, cam->play->view.gfxCtx); .5f, 0xFF, 0xC0, 0x7F, 0x50, 5, cam->play->view.gfxCtx);
} }
@ -2183,9 +2177,9 @@ s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) {
Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
} }
OLib_Vec3fDiffToVecGeo(&sp5C, &debugCam->eye, &debugCam->at); sp5C = OLib_Vec3fDiffToVecGeo(&debugCam->eye, &debugCam->at);
DebugCamera_CalcUpFromPitchYawRoll(&debugCam->unk_1C, sp5C.pitch, sp5C.yaw, debugCam->unk_1C =
CAM_DEG_TO_BINANG(debugCam->rollDegrees)); DebugCamera_CalcUpFromPitchYawRoll(sp5C.pitch, sp5C.yaw, CAM_DEG_TO_BINANG(debugCam->rollDegrees));
return 2; return 2;
} }

View file

@ -29,7 +29,7 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin
} }
void* GameAlloc_Malloc(GameAlloc* this, u32 size) { void* GameAlloc_Malloc(GameAlloc* this, u32 size) {
GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93); GameAllocEntry* ptr = SYSTEM_ARENA_MALLOC(size + sizeof(GameAllocEntry), "../gamealloc.c", 93);
if (ptr != NULL) { if (ptr != NULL) {
ptr->size = size; ptr->size = size;
@ -54,7 +54,7 @@ void GameAlloc_Free(GameAlloc* this, void* data) {
ptr->prev->next = ptr->next; ptr->prev->next = ptr->next;
ptr->next->prev = ptr->prev; ptr->next->prev = ptr->prev;
this->head = this->base.prev; this->head = this->base.prev;
SystemArena_FreeDebug(ptr, "../gamealloc.c", 125); SYSTEM_ARENA_FREE(ptr, "../gamealloc.c", 125);
} }
} }
@ -65,7 +65,7 @@ void GameAlloc_Cleanup(GameAlloc* this) {
while (&this->base != next) { while (&this->base != next) {
cur = next; cur = next;
next = next->next; next = next->next;
SystemArena_FreeDebug(cur, "../gamealloc.c", 145); SYSTEM_ARENA_FREE(cur, "../gamealloc.c", 145);
} }
this->head = &this->base; this->head = &this->base;

View file

@ -181,7 +181,6 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_HREG_MODE = HREG_MODE_UCODE_DISAS;
R_UCODE_DISAS_TOGGLE = 1; R_UCODE_DISAS_TOGGLE = 1;
R_UCODE_DISAS_LOG_LEVEL = 2; R_UCODE_DISAS_LOG_LEVEL = 2;
sPrevTaskWorkBuffer = sPrevTaskWorkBuffer;
Graph_DisassembleUCode(sPrevTaskWorkBuffer); Graph_DisassembleUCode(sPrevTaskWorkBuffer);
} }
@ -426,7 +425,7 @@ void Graph_ThreadEntry(void* arg0) {
size = ovl->instanceSize; size = ovl->instanceSize;
osSyncPrintf("クラスサイズ=%dバイト\n", size); // "Class size = %d bytes" osSyncPrintf("クラスサイズ=%dバイト\n", size); // "Class size = %d bytes"
gameState = SystemArena_MallocDebug(size, "../graph.c", 1196); gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196);
if (gameState == NULL) { if (gameState == NULL) {
osSyncPrintf("確保失敗\n"); // "Failure to secure" osSyncPrintf("確保失敗\n"); // "Failure to secure"
@ -443,7 +442,7 @@ void Graph_ThreadEntry(void* arg0) {
nextOvl = Graph_GetNextGameState(gameState); nextOvl = Graph_GetNextGameState(gameState);
GameState_Destroy(gameState); GameState_Destroy(gameState);
SystemArena_FreeDebug(gameState, "../graph.c", 1227); SYSTEM_ARENA_FREE(gameState, "../graph.c", 1227);
Overlay_FreeGameState(ovl); Overlay_FreeGameState(ovl);
} }
Graph_Destroy(&gfxCtx); Graph_Destroy(&gfxCtx);

View file

@ -154,7 +154,7 @@ s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* out
if (sym) { if (sym) {
*outCoeff = JpegDecoder_ReadBits(sym); *outCoeff = JpegDecoder_ReadBits(sym);
if (*outCoeff < (1 << (sym - 1))) { if (*outCoeff < (1 << (sym - 1))) {
*outCoeff += (-1 << sym) + 1; *outCoeff += (-1U << sym) + 1;
} }
} }

View file

@ -7,7 +7,7 @@ ListAlloc* ListAlloc_Init(ListAlloc* this) {
} }
void* ListAlloc_Alloc(ListAlloc* this, u32 size) { void* ListAlloc_Alloc(ListAlloc* this, u32 size) {
ListAlloc* ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), "../listalloc.c", 40); ListAlloc* ptr = SYSTEM_ARENA_MALLOC(size + sizeof(ListAlloc), "../listalloc.c", 40);
ListAlloc* next; ListAlloc* next;
if (ptr == NULL) { if (ptr == NULL) {
@ -49,7 +49,7 @@ void ListAlloc_Free(ListAlloc* this, void* data) {
this->next = ptr->prev; this->next = ptr->prev;
} }
SystemArena_FreeDebug(ptr, "../listalloc.c", 72); SYSTEM_ARENA_FREE(ptr, "../listalloc.c", 72);
} }
void ListAlloc_FreeAll(ListAlloc* this) { void ListAlloc_FreeAll(ListAlloc* this) {

View file

@ -1,8 +1,7 @@
#include "global.h" #include "global.h"
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) { void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) {
void* allocatedRamAddr = void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31);
SystemArena_MallocRDebug((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31);
if (gOverlayLogSeverity >= 3) { if (gOverlayLogSeverity >= 3) {
osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vramStart, vramEnd, allocatedRamAddr, osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vramStart, vramEnd, allocatedRamAddr,

View file

@ -61,7 +61,7 @@ void Main(void* arg) {
debugHeapSize = PHYS_TO_K0(0x600000) - (uintptr_t)debugHeapStart; debugHeapSize = PHYS_TO_K0(0x600000) - (uintptr_t)debugHeapStart;
} else { } else {
debugHeapSize = 0x400; debugHeapSize = 0x400;
debugHeapStart = SystemArena_MallocDebug(debugHeapSize, "../main.c", 565); debugHeapStart = SYSTEM_ARENA_MALLOC(debugHeapSize, "../main.c", 565);
} }
osSyncPrintf("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize); osSyncPrintf("debug_InitArena(%08x, %08x)\n", debugHeapStart, debugHeapSize);
DebugArena_Init(debugHeapStart, debugHeapSize); DebugArena_Init(debugHeapStart, debugHeapSize);
@ -90,7 +90,7 @@ void Main(void* arg) {
StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, STACK_TOP(sPadMgrStack), 0, 0x100, "padmgr"); StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, STACK_TOP(sPadMgrStack), 0, 0x100, "padmgr");
PadMgr_Init(&gPadMgr, &sSerialEventQueue, &gIrqMgr, THREAD_ID_PADMGR, THREAD_PRI_PADMGR, STACK_TOP(sPadMgrStack)); PadMgr_Init(&gPadMgr, &sSerialEventQueue, &gIrqMgr, THREAD_ID_PADMGR, THREAD_PRI_PADMGR, STACK_TOP(sPadMgrStack));
AudioMgr_Unlock(&gAudioMgr); AudioMgr_WaitForInit(&gAudioMgr);
StackCheck_Init(&sGraphStackInfo, sGraphStack, STACK_TOP(sGraphStack), 0, 0x100, "graph"); StackCheck_Init(&sGraphStackInfo, sGraphStack, STACK_TOP(sGraphStack), 0, 0x100, "graph");
osCreateThread(&sGraphThread, THREAD_ID_GRAPH, Graph_ThreadEntry, arg, STACK_TOP(sGraphStack), THREAD_PRI_GRAPH); osCreateThread(&sGraphThread, THREAD_ID_GRAPH, Graph_ThreadEntry, arg, STACK_TOP(sGraphStack), THREAD_PRI_GRAPH);

View file

@ -20,7 +20,7 @@ MtxF* sMatrixStack; // "Matrix_stack"
MtxF* sCurrentMatrix; // "Matrix_now" MtxF* sCurrentMatrix; // "Matrix_now"
void Matrix_Init(GameState* gameState) { void Matrix_Init(GameState* gameState) {
sCurrentMatrix = GameState_Alloc(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153); sCurrentMatrix = GAME_STATE_ALLOC(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153);
sMatrixStack = sCurrentMatrix; sMatrixStack = sCurrentMatrix;
} }
@ -603,16 +603,30 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) {
return dest; return dest;
} }
#ifdef OOT_DEBUG
Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) { Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) {
return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest); return Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(sCurrentMatrix, file, line), dest);
} }
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) { Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) {
return Matrix_ToMtx(Graph_Alloc(gfxCtx, sizeof(Mtx)), file, line); return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)), file, line);
} }
#else
Mtx* Matrix_ToMtx(Mtx* dest) {
return Matrix_MtxFToMtx(sCurrentMatrix, dest);
}
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx) {
return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
}
#endif /* OOT_DEBUG */
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) { Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) {
return Matrix_MtxFToMtx(src, Graph_Alloc(gfxCtx, sizeof(Mtx))); return Matrix_MtxFToMtx(src, GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
} }
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) { void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) {

View file

@ -104,7 +104,7 @@ void Overlay_FreeGameState(GameStateOverlay* overlayEntry) {
overlayEntry->unk_24 = NULL; overlayEntry->unk_24 = NULL;
} }
SystemArena_FreeDebug(overlayEntry->loadedRamAddr, "../z_DLF.c", 149); SYSTEM_ARENA_FREE(overlayEntry->loadedRamAddr, "../z_DLF.c", 149);
overlayEntry->loadedRamAddr = NULL; overlayEntry->loadedRamAddr = NULL;
} }
} }

View file

@ -54,7 +54,7 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, PlayState* play, Gfx* dlist,
temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.shadowScale; temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.shadowScale;
Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY); Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 1588), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 1588),
G_MTX_MODELVIEW | G_MTX_LOAD); G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, dlist); gSPDisplayList(POLY_OPA_DISP++, dlist);
@ -94,7 +94,7 @@ void ActorShadow_DrawFoot(PlayState* play, Light* light, MtxF* arg2, s32 arg3, f
Matrix_RotateY(sp58, MTXMODE_APPLY); Matrix_RotateY(sp58, MTXMODE_APPLY);
Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY); Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 1687), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 1687), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, gFootShadowDL); gSPDisplayList(POLY_OPA_DISP++, gFootShadowDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 1693); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 1693);
@ -377,7 +377,7 @@ void func_8002C124(TargetContext* targetCtx, PlayState* play) {
Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY); Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY);
Matrix_Push(); Matrix_Push();
Matrix_Translate(entry->unk_0C, entry->unk_0C, 0.0f, MTXMODE_APPLY); Matrix_Translate(entry->unk_0C, entry->unk_0C, 0.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 2116), gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 2116),
G_MTX_MODELVIEW | G_MTX_LOAD); G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(OVERLAY_DISP++, gZTargetLockOnTriangleDL); gSPDisplayList(OVERLAY_DISP++, gZTargetLockOnTriangleDL);
Matrix_Pop(); Matrix_Pop();
@ -404,8 +404,7 @@ void func_8002C124(TargetContext* targetCtx, PlayState* play) {
Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, MTXMODE_APPLY); Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, MTXMODE_APPLY);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, naviColor->inner.r, naviColor->inner.g, naviColor->inner.b, 255); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, naviColor->inner.r, naviColor->inner.g, naviColor->inner.b, 255);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 2153), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 2153), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, gZTargetArrowDL); gSPDisplayList(POLY_XLU_DISP++, gZTargetArrowDL);
} }
@ -679,7 +678,7 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void*
u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart; u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
if ((size != 0) && (size <= 0x3000)) { if ((size != 0) && (size <= 0x3000)) {
DmaMgr_RequestSyncDebug(texture, loadedScene->titleFile.vromStart, size, "../z_actor.c", 2765); DMA_REQUEST_SYNC(texture, loadedScene->titleFile.vromStart, size, "../z_actor.c", 2765);
} }
titleCtx->texture = texture; titleCtx->texture = texture;
@ -1039,7 +1038,7 @@ void func_8002DE04(PlayState* play, Actor* actorA, Actor* actorB) {
void func_8002DE74(PlayState* play, Player* player) { void func_8002DE74(PlayState* play, Player* player) {
if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && Play_CamIsNotFixed(play)) { if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && Play_CamIsNotFixed(play)) {
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE); Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE);
} }
} }
@ -1363,11 +1362,11 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext*
LookAt* lookAt; LookAt* lookAt;
f32 correctedEyeX; f32 correctedEyeX;
lookAt = Graph_Alloc(gfxCtx, sizeof(LookAt)); lookAt = GRAPH_ALLOC(gfxCtx, sizeof(LookAt));
correctedEyeX = (eye->x == object->x) && (eye->z == object->z) ? eye->x + 0.001f : eye->x; correctedEyeX = (eye->x == object->x) && (eye->z == object->z) ? eye->x + 0.001f : eye->x;
*hilite = Graph_Alloc(gfxCtx, sizeof(Hilite)); *hilite = GRAPH_ALLOC(gfxCtx, sizeof(Hilite));
if (R_HREG_MODE == HREG_MODE_PRINT_HILITE_INFO) { if (R_HREG_MODE == HREG_MODE_PRINT_HILITE_INFO) {
osSyncPrintf("z_actor.c 3529 eye=[%f(%f) %f %f] object=[%f %f %f] light_direction=[%f %f %f]\n", correctedEyeX, osSyncPrintf("z_actor.c 3529 eye=[%f(%f) %f %f] object=[%f %f %f] light_direction=[%f %f %f]\n", correctedEyeX,
@ -1426,7 +1425,7 @@ void func_8002EBCC(Actor* actor, PlayState* play, s32 flag) {
hilite = func_8002EABC(&actor->world.pos, &play->view.eye, &lightDir, play->state.gfxCtx); hilite = func_8002EABC(&actor->world.pos, &play->view.eye, &lightDir, play->state.gfxCtx);
if (flag != 0) { if (flag != 0) {
displayList = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Gfx)); displayList = GRAPH_ALLOC(play->state.gfxCtx, 2 * sizeof(Gfx));
displayListHead = displayList; displayListHead = displayList;
OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 4384); OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 4384);
@ -1452,7 +1451,7 @@ void func_8002ED80(Actor* actor, PlayState* play, s32 flag) {
hilite = func_8002EB44(&actor->world.pos, &play->view.eye, &lightDir, play->state.gfxCtx); hilite = func_8002EB44(&actor->world.pos, &play->view.eye, &lightDir, play->state.gfxCtx);
if (flag != 0) { if (flag != 0) {
displayList = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Gfx)); displayList = GRAPH_ALLOC(play->state.gfxCtx, 2 * sizeof(Gfx));
displayListHead = displayList; displayListHead = displayList;
OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 4429); OPEN_DISPS(play->state.gfxCtx, "../z_actor.c", 4429);
@ -1465,26 +1464,21 @@ void func_8002ED80(Actor* actor, PlayState* play, s32 flag) {
} }
} }
PosRot* Actor_GetFocus(PosRot* dest, Actor* actor) { PosRot Actor_GetFocus(Actor* actor) {
*dest = actor->focus; return actor->focus;
return dest;
} }
PosRot* Actor_GetWorld(PosRot* dest, Actor* actor) { PosRot Actor_GetWorld(Actor* actor) {
*dest = actor->world; return actor->world;
return dest;
} }
PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor) { PosRot Actor_GetWorldPosShapeRot(Actor* actor) {
PosRot sp1C; PosRot worldPosRot;
Math_Vec3f_Copy(&sp1C.pos, &actor->world.pos); Math_Vec3f_Copy(&worldPosRot.pos, &actor->world.pos);
sp1C.rot = actor->shape.rot; worldPosRot.rot = actor->shape.rot;
*arg0 = sp1C;
return arg0; return worldPosRot;
} }
f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) {
@ -1549,22 +1543,39 @@ s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) {
return false; return false;
} }
u32 Actor_ProcessTalkRequest(Actor* actor, PlayState* play) { /**
if (actor->flags & ACTOR_FLAG_8) { * When a given talk offer is accepted, Player will set `ACTOR_FLAG_TALK` for that actor.
actor->flags &= ~ACTOR_FLAG_8; * This function serves to acknowledge that the offer was accepted by Player, and notifies the actor
* that it should proceed with its own internal processes for handling dialogue.
*
* @return true if the talk offer was accepted, false otherwise
*/
s32 Actor_TalkOfferAccepted(Actor* actor, PlayState* play) {
if (actor->flags & ACTOR_FLAG_TALK) {
actor->flags &= ~ACTOR_FLAG_TALK;
return true; return true;
} }
return false; return false;
} }
s32 func_8002F1C4(Actor* actor, PlayState* play, f32 arg2, f32 arg3, u32 exchangeItemId) { /**
* This function covers offering the ability to talk with the player.
* Passing an exchangeItemId (see `ExchangeItemID`) allows the player to also use the item to initiate the
* conversation.
*
* This function carries a talk exchange offer to the player actor if context allows it (e.g. the player is in range
* and not busy with certain things).
*
* @return true If the player actor is capable of accepting the offer.
*/
s32 Actor_OfferTalkExchange(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, u32 exchangeItemId) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if ((player->actor.flags & ACTOR_FLAG_8) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(play)) || if ((player->actor.flags & ACTOR_FLAG_TALK) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(play)) ||
(!actor->isTargeted && (!actor->isTargeted &&
((arg3 < fabsf(actor->yDistToPlayer)) || (player->targetActorDistance < actor->xzDistToPlayer) || ((yRange < fabsf(actor->yDistToPlayer)) || (player->targetActorDistance < actor->xzDistToPlayer) ||
(arg2 < actor->xzDistToPlayer)))) { (xzRange < actor->xzDistToPlayer)))) {
return false; return false;
} }
@ -1575,18 +1586,28 @@ s32 func_8002F1C4(Actor* actor, PlayState* play, f32 arg2, f32 arg3, u32 exchang
return true; return true;
} }
s32 func_8002F298(Actor* actor, PlayState* play, f32 arg2, u32 exchangeItemId) { /**
return func_8002F1C4(actor, play, arg2, arg2, exchangeItemId); * Offers a talk exchange request within an equilateral cylinder with the radius specified.
*/
s32 Actor_OfferTalkExchangeEquiCylinder(Actor* actor, PlayState* play, f32 radius, u32 exchangeItemId) {
return Actor_OfferTalkExchange(actor, play, radius, radius, exchangeItemId);
} }
s32 func_8002F2CC(Actor* actor, PlayState* play, f32 arg2) { /**
return func_8002F298(actor, play, arg2, EXCH_ITEM_NONE); * Offers a talk request within an equilateral cylinder with the radius specified.
*/
s32 Actor_OfferTalk(Actor* actor, PlayState* play, f32 radius) {
return Actor_OfferTalkExchangeEquiCylinder(actor, play, radius, EXCH_ITEM_NONE);
} }
s32 func_8002F2F4(Actor* actor, PlayState* play) { /**
f32 var1 = 50.0f + actor->colChkInfo.cylRadius; * Offers a talk request within an equilateral cylinder whose radius is determined by the actor's collision check
* cylinder's radius.
*/
s32 Actor_OfferTalkNearColChkInfoCylinder(Actor* actor, PlayState* play) {
f32 cylRadius = 50.0f + actor->colChkInfo.cylRadius;
return func_8002F2CC(actor, play, var1); return Actor_OfferTalk(actor, play, cylRadius);
} }
u32 Actor_TextboxIsClosing(Actor* actor, PlayState* play) { u32 Actor_TextboxIsClosing(Actor* actor, PlayState* play) {
@ -2012,14 +2033,14 @@ void Actor_DrawFaroresWindPointer(PlayState* play) {
gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 255);
Matrix_RotateZ(BINANG_TO_RAD_ALT2((play->gameplayFrames * 1500) & 0xFFFF), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD_ALT2((play->gameplayFrames * 1500) & 0xFFFF), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 5458), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 5458),
G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL);
Matrix_Pop(); Matrix_Pop();
Matrix_RotateZ(BINANG_TO_RAD_ALT2(~((play->gameplayFrames * 1200) & 0xFFFF)), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD_ALT2(~((play->gameplayFrames * 1200) & 0xFFFF)), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 5463), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 5463),
G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL);
} }
@ -2667,7 +2688,7 @@ void func_80031C3C(ActorContext* actorCtx, PlayState* play) {
} }
if (actorCtx->absoluteSpace != NULL) { if (actorCtx->absoluteSpace != NULL) {
ZeldaArena_FreeDebug(actorCtx->absoluteSpace, "../z_actor.c", 6731); ZELDA_ARENA_FREE(actorCtx->absoluteSpace, "../z_actor.c", 6731);
actorCtx->absoluteSpace = NULL; actorCtx->absoluteSpace = NULL;
} }
@ -2753,7 +2774,7 @@ void Actor_FreeOverlay(ActorOverlay* actorOverlay) {
if (HREG(20) != 0) { if (HREG(20) != 0) {
osSyncPrintf("オーバーレイ解放します\n"); // "Overlay deallocated" osSyncPrintf("オーバーレイ解放します\n"); // "Overlay deallocated"
} }
ZeldaArena_FreeDebug(actorOverlay->loadedRamAddr, "../z_actor.c", 6834); ZELDA_ARENA_FREE(actorOverlay->loadedRamAddr, "../z_actor.c", 6834);
actorOverlay->loadedRamAddr = NULL; actorOverlay->loadedRamAddr = NULL;
} }
} }
@ -2811,8 +2832,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
if (actorCtx->absoluteSpace == NULL) { if (actorCtx->absoluteSpace == NULL) {
// "AMF: absolute magic field" // "AMF: absolute magic field"
actorCtx->absoluteSpace = actorCtx->absoluteSpace = ZELDA_ARENA_MALLOC_R(ACTOROVL_ABSOLUTE_SPACE_SIZE, "AMF:絶対魔法領域", 0);
ZeldaArena_MallocRDebug(ACTOROVL_ABSOLUTE_SPACE_SIZE, "AMF:絶対魔法領域", 0);
if (HREG(20) != 0) { if (HREG(20) != 0) {
// "Absolute magic field reservation - %d bytes reserved" // "Absolute magic field reservation - %d bytes reserved"
osSyncPrintf("絶対魔法領域確保 %d バイト確保\n", ACTOROVL_ABSOLUTE_SPACE_SIZE); osSyncPrintf("絶対魔法領域確保 %d バイト確保\n", ACTOROVL_ABSOLUTE_SPACE_SIZE);
@ -2821,9 +2841,9 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
overlayEntry->loadedRamAddr = actorCtx->absoluteSpace; overlayEntry->loadedRamAddr = actorCtx->absoluteSpace;
} else if (overlayEntry->allocType & ACTOROVL_ALLOC_PERSISTENT) { } else if (overlayEntry->allocType & ACTOROVL_ALLOC_PERSISTENT) {
overlayEntry->loadedRamAddr = ZeldaArena_MallocRDebug(overlaySize, name, 0); overlayEntry->loadedRamAddr = ZELDA_ARENA_MALLOC_R(overlaySize, name, 0);
} else { } else {
overlayEntry->loadedRamAddr = ZeldaArena_MallocDebug(overlaySize, name, 0); overlayEntry->loadedRamAddr = ZELDA_ARENA_MALLOC(overlaySize, name, 0);
} }
if (overlayEntry->loadedRamAddr == NULL) { if (overlayEntry->loadedRamAddr == NULL) {
@ -2864,7 +2884,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
return NULL; return NULL;
} }
actor = ZeldaArena_MallocDebug(actorInit->instanceSize, name, 1); actor = ZELDA_ARENA_MALLOC(actorInit->instanceSize, name, 1);
if (actor == NULL) { if (actor == NULL) {
// "Actor class cannot be reserved! %s <size%d bytes>" // "Actor class cannot be reserved! %s <size%d bytes>"
@ -2985,7 +3005,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
if ((player != NULL) && (actor == player->unk_664)) { if ((player != NULL) && (actor == player->unk_664)) {
func_8008EDF0(player); func_8008EDF0(player);
Camera_ChangeMode(Play_GetCamera(play, Play_GetActiveCamId(play)), 0); Camera_RequestMode(Play_GetCamera(play, Play_GetActiveCamId(play)), CAM_MODE_NORMAL);
} }
if (actor == actorCtx->targetCtx.arrowPointedActor) { if (actor == actorCtx->targetCtx.arrowPointedActor) {
@ -3005,7 +3025,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
newHead = Actor_RemoveFromCategory(play, actorCtx, actor); newHead = Actor_RemoveFromCategory(play, actorCtx, actor);
ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242); ZELDA_ARENA_FREE(actor, "../z_actor.c", 7242);
if (overlayEntry->vramStart == NULL) { if (overlayEntry->vramStart == NULL) {
if (HREG(20) != 0) { if (HREG(20) != 0) {
@ -3183,15 +3203,15 @@ void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) {
u32 objectSlotsSize; u32 objectSlotsSize;
matricesSize = (count + 1) * sizeof(*bodyBreak->matrices); matricesSize = (count + 1) * sizeof(*bodyBreak->matrices);
bodyBreak->matrices = ZeldaArena_MallocDebug(matricesSize, "../z_actor.c", 7540); bodyBreak->matrices = ZELDA_ARENA_MALLOC(matricesSize, "../z_actor.c", 7540);
if (bodyBreak->matrices != NULL) { if (bodyBreak->matrices != NULL) {
dListsSize = (count + 1) * sizeof(*bodyBreak->dLists); dListsSize = (count + 1) * sizeof(*bodyBreak->dLists);
bodyBreak->dLists = ZeldaArena_MallocDebug(dListsSize, "../z_actor.c", 7543); bodyBreak->dLists = ZELDA_ARENA_MALLOC(dListsSize, "../z_actor.c", 7543);
if (bodyBreak->dLists != NULL) { if (bodyBreak->dLists != NULL) {
objectSlotsSize = (count + 1) * sizeof(*bodyBreak->objectSlots); objectSlotsSize = (count + 1) * sizeof(*bodyBreak->objectSlots);
bodyBreak->objectSlots = ZeldaArena_MallocDebug(objectSlotsSize, "../z_actor.c", 7546); bodyBreak->objectSlots = ZELDA_ARENA_MALLOC(objectSlotsSize, "../z_actor.c", 7546);
if (bodyBreak->objectSlots != NULL) { if (bodyBreak->objectSlots != NULL) {
Lib_MemSet((u8*)bodyBreak->matrices, matricesSize, 0); Lib_MemSet((u8*)bodyBreak->matrices, matricesSize, 0);
@ -3204,15 +3224,15 @@ void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) {
} }
if (bodyBreak->matrices != NULL) { if (bodyBreak->matrices != NULL) {
ZeldaArena_FreeDebug(bodyBreak->matrices, "../z_actor.c", 7558); ZELDA_ARENA_FREE(bodyBreak->matrices, "../z_actor.c", 7558);
} }
if (bodyBreak->dLists != NULL) { if (bodyBreak->dLists != NULL) {
ZeldaArena_FreeDebug(bodyBreak->dLists, "../z_actor.c", 7561); ZELDA_ARENA_FREE(bodyBreak->dLists, "../z_actor.c", 7561);
} }
if (bodyBreak->objectSlots != NULL) { if (bodyBreak->objectSlots != NULL) {
ZeldaArena_FreeDebug(bodyBreak->objectSlots, "../z_actor.c", 7564); ZELDA_ARENA_FREE(bodyBreak->objectSlots, "../z_actor.c", 7564);
} }
} }
@ -3279,9 +3299,9 @@ s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s1
bodyBreak->val = BODYBREAK_STATUS_FINISHED; bodyBreak->val = BODYBREAK_STATUS_FINISHED;
ZeldaArena_FreeDebug(bodyBreak->matrices, "../z_actor.c", 7678); ZELDA_ARENA_FREE(bodyBreak->matrices, "../z_actor.c", 7678);
ZeldaArena_FreeDebug(bodyBreak->dLists, "../z_actor.c", 7679); ZELDA_ARENA_FREE(bodyBreak->dLists, "../z_actor.c", 7679);
ZeldaArena_FreeDebug(bodyBreak->objectSlots, "../z_actor.c", 7680); ZELDA_ARENA_FREE(bodyBreak->objectSlots, "../z_actor.c", 7680);
return true; return true;
} }
@ -3375,6 +3395,12 @@ Actor* func_80033684(PlayState* play, Actor* explosiveActor) {
* This is done by moving it to the corresponding category list and setting its category variable accordingly. * This is done by moving it to the corresponding category list and setting its category variable accordingly.
*/ */
void Actor_ChangeCategory(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory) { void Actor_ChangeCategory(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory) {
//! @bug Calling this function immediately moves an actor from one category list to the other.
//! So, if Actor_ChangeCategory is called during an actor update, the inner loop in
//! Actor_UpdateAll will continue from the next actor in the new category, rather than the next
//! actor in the old category. This will cause any actors after this one in the old category to
//! be skipped over and not updated, and any actors in the new category to be updated more than
//! once.
Actor_RemoveFromCategory(play, actorCtx, actor); Actor_RemoveFromCategory(play, actorCtx, actor);
Actor_AddToCategory(actorCtx, actor, actorCategory); Actor_AddToCategory(actorCtx, actor, actorCategory);
} }
@ -3612,7 +3638,7 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play) {
Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY); Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 8149), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8149), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, gCircleShadowDL); gSPDisplayList(POLY_OPA_DISP++, gCircleShadowDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8155); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8155);
@ -3700,8 +3726,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) {
Matrix_Scale(entry->chainsScale, entry->chainsScale, entry->chainsScale, MTXMODE_APPLY); Matrix_Scale(entry->chainsScale, entry->chainsScale, entry->chainsScale, MTXMODE_APPLY);
} }
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 8299), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8299), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, entry->chainDL); gSPDisplayList(POLY_OPA_DISP++, entry->chainDL);
if (i % 2) { if (i % 2) {
@ -3716,7 +3741,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) {
Matrix_Put(&baseMtxF); Matrix_Put(&baseMtxF);
Matrix_Scale(frame * 0.1f, frame * 0.1f, frame * 0.1f, MTXMODE_APPLY); Matrix_Scale(frame * 0.1f, frame * 0.1f, frame * 0.1f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_actor.c", 8314), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_actor.c", 8314), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, entry->lockDL); gSPDisplayList(POLY_OPA_DISP++, entry->lockDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8319); CLOSE_DISPS(play->state.gfxCtx, "../z_actor.c", 8319);
@ -3776,7 +3801,7 @@ s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interac
s16 x; s16 x;
s16 y; s16 y;
if (Actor_ProcessTalkRequest(actor, play)) { if (Actor_TalkOfferAccepted(actor, play)) {
*talkState = NPC_TALK_STATE_TALKING; *talkState = NPC_TALK_STATE_TALKING;
return true; return true;
} }
@ -3792,7 +3817,7 @@ s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interac
return false; return false;
} }
if (!func_8002F2CC(actor, play, interactRange)) { if (!Actor_OfferTalk(actor, play, interactRange)) {
return false; return false;
} }
@ -4037,7 +4062,7 @@ void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex
Gfx* func_80034B28(GraphicsContext* gfxCtx) { Gfx* func_80034B28(GraphicsContext* gfxCtx) {
Gfx* displayList; Gfx* displayList;
displayList = Graph_Alloc(gfxCtx, sizeof(Gfx)); displayList = GRAPH_ALLOC(gfxCtx, sizeof(Gfx));
gSPEndDisplayList(displayList); gSPEndDisplayList(displayList);
return displayList; return displayList;
@ -4047,7 +4072,7 @@ Gfx* func_80034B54(GraphicsContext* gfxCtx) {
Gfx* displayListHead; Gfx* displayListHead;
Gfx* displayList; Gfx* displayList;
displayList = displayListHead = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx)); displayList = displayListHead = GRAPH_ALLOC(gfxCtx, 2 * sizeof(Gfx));
gDPSetRenderMode(displayListHead++, G_RM_FOG_SHADE_A, gDPSetRenderMode(displayListHead++, G_RM_FOG_SHADE_A,
AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
@ -4269,28 +4294,27 @@ u8 Actor_ApplyDamage(Actor* actor) {
return actor->colChkInfo.health; return actor->colChkInfo.health;
} }
void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag) { void Actor_SetDropFlag(Actor* actor, ColliderElement* elem, s32 freezeFlag) {
if (colInfo->acHitInfo == NULL) { if (elem->acHitElem == NULL) {
actor->dropFlag = 0x00; actor->dropFlag = 0x00;
} else if (freezeFlag && } else if (freezeFlag && (elem->acHitElem->toucher.dmgFlags & (DMG_UNKNOWN_1 | DMG_MAGIC_ICE | DMG_MAGIC_FIRE))) {
(colInfo->acHitInfo->toucher.dmgFlags & (DMG_UNKNOWN_1 | DMG_MAGIC_ICE | DMG_MAGIC_FIRE))) { actor->freezeTimer = elem->acHitElem->toucher.damage;
actor->freezeTimer = colInfo->acHitInfo->toucher.damage;
actor->dropFlag = 0x00; actor->dropFlag = 0x00;
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_FIRE) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_FIRE) {
actor->dropFlag = 0x01; actor->dropFlag = 0x01;
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_ICE) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_ICE) {
actor->dropFlag = 0x02; actor->dropFlag = 0x02;
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK1) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_UNK1) {
actor->dropFlag = 0x04; actor->dropFlag = 0x04;
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK2) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_UNK2) {
actor->dropFlag = 0x08; actor->dropFlag = 0x08;
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK3) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_UNK3) {
actor->dropFlag = 0x10; actor->dropFlag = 0x10;
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_LIGHT) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_LIGHT) {
actor->dropFlag = 0x20; actor->dropFlag = 0x20;
} else if (colInfo->acHitInfo->toucher.dmgFlags & DMG_MAGIC_LIGHT) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_MAGIC_LIGHT) {
if (freezeFlag) { if (freezeFlag) {
actor->freezeTimer = colInfo->acHitInfo->toucher.damage; actor->freezeTimer = elem->acHitElem->toucher.damage;
} }
actor->dropFlag = 0x40; actor->dropFlag = 0x40;
} else { } else {
@ -4299,35 +4323,35 @@ void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag) {
} }
void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) { void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) {
ColliderInfo* curColInfo; ColliderElement* elem;
s32 flag; s32 flag;
s32 i; s32 i;
actor->dropFlag = 0x00; actor->dropFlag = 0x00;
for (i = jntSph->count - 1; i >= 0; i--) { for (i = jntSph->count - 1; i >= 0; i--) {
curColInfo = &jntSph->elements[i].info; elem = &jntSph->elements[i].base;
if (curColInfo->acHitInfo == NULL) { if (elem->acHitElem == NULL) {
flag = 0x00; flag = 0x00;
} else if (freezeFlag && } else if (freezeFlag &&
(curColInfo->acHitInfo->toucher.dmgFlags & (DMG_UNKNOWN_1 | DMG_MAGIC_ICE | DMG_MAGIC_FIRE))) { (elem->acHitElem->toucher.dmgFlags & (DMG_UNKNOWN_1 | DMG_MAGIC_ICE | DMG_MAGIC_FIRE))) {
actor->freezeTimer = curColInfo->acHitInfo->toucher.damage; actor->freezeTimer = elem->acHitElem->toucher.damage;
flag = 0x00; flag = 0x00;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_FIRE) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_FIRE) {
flag = 0x01; flag = 0x01;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_ICE) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_ICE) {
flag = 0x02; flag = 0x02;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK1) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_UNK1) {
flag = 0x04; flag = 0x04;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK2) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_UNK2) {
flag = 0x08; flag = 0x08;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_UNK3) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_UNK3) {
flag = 0x10; flag = 0x10;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_ARROW_LIGHT) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_ARROW_LIGHT) {
flag = 0x20; flag = 0x20;
} else if (curColInfo->acHitInfo->toucher.dmgFlags & DMG_MAGIC_LIGHT) { } else if (elem->acHitElem->toucher.dmgFlags & DMG_MAGIC_LIGHT) {
if (freezeFlag) { if (freezeFlag) {
actor->freezeTimer = curColInfo->acHitInfo->toucher.damage; actor->freezeTimer = elem->acHitElem->toucher.damage;
} }
flag = 0x40; flag = 0x40;
} else { } else {
@ -4754,7 +4778,7 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
Flags_GetEventChkInf(EVENTCHKINF_37)) { Flags_GetEventChkInf(EVENTCHKINF_37)) {
retTextId = 0x7006; retTextId = 0x7006;
} else { } else {
if (Flags_GetEventChkInf(EVENTCHKINF_12)) { if (Flags_GetEventChkInf(EVENTCHKINF_RECEIVED_WEIRD_EGG)) {
if (Flags_GetInfTable(INFTABLE_71)) { if (Flags_GetInfTable(INFTABLE_71)) {
retTextId = 0x7072; retTextId = 0x7072;
} else { } else {
@ -5116,16 +5140,16 @@ u32 func_80035BFC(PlayState* play, s16 arg1) {
} }
break; break;
case 71: case 71:
if (Flags_GetEventChkInf(EVENTCHKINF_16)) { if (Flags_GetEventChkInf(EVENTCHKINF_CAN_LEARN_EPONAS_SONG)) {
retTextId = 0x2049; retTextId = 0x2049;
} else if (Flags_GetEventChkInf(EVENTCHKINF_15)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_TALKED_TO_CHILD_MALON_AT_RANCH)) {
retTextId = 0x2048; retTextId = 0x2048;
} else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
retTextId = 0x2047; retTextId = 0x2047;
} else if (Flags_GetEventChkInf(EVENTCHKINF_12) && } else if (Flags_GetEventChkInf(EVENTCHKINF_RECEIVED_WEIRD_EGG) &&
!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) { !Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
retTextId = 0x2044; retTextId = 0x2044;
} else if (Flags_GetEventChkInf(EVENTCHKINF_10)) { } else if (Flags_GetEventChkInf(EVENTCHKINF_TALKED_TO_MALON_FIRST_TIME)) {
if (Flags_GetEventChkInf(EVENTCHKINF_11)) { if (Flags_GetEventChkInf(EVENTCHKINF_11)) {
retTextId = 0x2043; retTextId = 0x2043;
} else { } else {
@ -5417,16 +5441,16 @@ void func_80036E50(u16 textId, s16 arg1) {
return; return;
case 71: case 71:
if (textId == 0x2041) { if (textId == 0x2041) {
Flags_SetEventChkInf(EVENTCHKINF_10); Flags_SetEventChkInf(EVENTCHKINF_TALKED_TO_MALON_FIRST_TIME);
} }
if (textId == 0x2044) { if (textId == 0x2044) {
Flags_SetEventChkInf(EVENTCHKINF_12); Flags_SetEventChkInf(EVENTCHKINF_RECEIVED_WEIRD_EGG);
} }
if (textId == 0x2047) { if (textId == 0x2047) {
Flags_SetEventChkInf(EVENTCHKINF_15); Flags_SetEventChkInf(EVENTCHKINF_TALKED_TO_CHILD_MALON_AT_RANCH);
} }
if (textId == 0x2048) { if (textId == 0x2048) {
Flags_SetEventChkInf(EVENTCHKINF_16); Flags_SetEventChkInf(EVENTCHKINF_CAN_LEARN_EPONAS_SONG);
} }
return; return;
case 72: case 72:
@ -5568,7 +5592,7 @@ s32 func_800374E0(PlayState* play, Actor* actor, u16 textId) {
ret = 0; ret = 0;
break; break;
case 0x2043: case 0x2043:
if (Flags_GetEventChkInf(EVENTCHKINF_12)) { if (Flags_GetEventChkInf(EVENTCHKINF_RECEIVED_WEIRD_EGG)) {
break; break;
} }
func_80035B18(play, actor, 0x2044); func_80035B18(play, actor, 0x2044);
@ -5674,7 +5698,7 @@ s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3) {
s16 sp2A; s16 sp2A;
s16 abs_var; s16 abs_var;
if (Actor_ProcessTalkRequest(actor, play)) { if (Actor_TalkOfferAccepted(actor, play)) {
*arg3 = 1; *arg3 = 1;
return true; return true;
} }
@ -5704,11 +5728,11 @@ s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3) {
} }
if (actor->xyzDistToPlayerSq <= SQ(80.0f)) { if (actor->xyzDistToPlayerSq <= SQ(80.0f)) {
if (func_8002F2CC(actor, play, 80.0f)) { if (Actor_OfferTalk(actor, play, 80.0f)) {
actor->textId = func_80037C30(play, arg2); actor->textId = func_80037C30(play, arg2);
} }
} else { } else {
if (func_8002F2F4(actor, play)) { if (Actor_OfferTalkNearColChkInfoCylinder(actor, play)) {
actor->textId = func_80037C30(play, arg2); actor->textId = func_80037C30(play, arg2);
} }
} }

View file

@ -2503,7 +2503,7 @@ void SSNodeList_Alloc(PlayState* play, SSNodeList* this, s32 tblMax, s32 numPoly
ASSERT(this->tbl != NULL, "this->short_slist_node_tbl != NULL", "../z_bgcheck.c", 5975); ASSERT(this->tbl != NULL, "this->short_slist_node_tbl != NULL", "../z_bgcheck.c", 5975);
this->polyCheckTbl = GameState_Alloc(&play->state, numPolys, "../z_bgcheck.c", 5979); this->polyCheckTbl = GAME_STATE_ALLOC(&play->state, numPolys, "../z_bgcheck.c", 5979);
ASSERT(this->polyCheckTbl != NULL, "this->polygon_check != NULL", "../z_bgcheck.c", 5981); ASSERT(this->polyCheckTbl != NULL, "this->polygon_check != NULL", "../z_bgcheck.c", 5981);
} }

File diff suppressed because it is too large Load diff

View file

@ -4,8 +4,7 @@ void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) {
OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 214); OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 214);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_cheap_proc.c", 216), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_cheap_proc.c", 216), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, dlist); gSPDisplayList(POLY_OPA_DISP++, dlist);
CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 219); CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 219);
@ -15,8 +14,7 @@ void Gfx_DrawDListXlu(PlayState* play, Gfx* dlist) {
OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 228); OPEN_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 228);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_cheap_proc.c", 230), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_cheap_proc.c", 230), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, dlist); gSPDisplayList(POLY_XLU_DISP++, dlist);
CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 233); CLOSE_DISPS(play->state.gfxCtx, "../z_cheap_proc.c", 233);

File diff suppressed because it is too large Load diff

View file

@ -34,15 +34,15 @@ void Interface_Init(PlayState* play) {
// "Permanent PARAMETER Segment = %x" // "Permanent PARAMETER Segment = %x"
osSyncPrintf("常駐PARAMETERセグメント=%x\n", parameterSize); osSyncPrintf("常駐PARAMETERセグメント=%x\n", parameterSize);
interfaceCtx->parameterSegment = GameState_Alloc(&play->state, parameterSize, "../z_construct.c", 159); interfaceCtx->parameterSegment = GAME_STATE_ALLOC(&play->state, parameterSize, "../z_construct.c", 159);
osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment); osSyncPrintf("parameter->parameterSegment=%x\n", interfaceCtx->parameterSegment);
ASSERT(interfaceCtx->parameterSegment != NULL, "parameter->parameterSegment != NULL", "../z_construct.c", 161); ASSERT(interfaceCtx->parameterSegment != NULL, "parameter->parameterSegment != NULL", "../z_construct.c", 161);
DmaMgr_RequestSyncDebug(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize, DMA_REQUEST_SYNC(interfaceCtx->parameterSegment, (uintptr_t)_parameter_staticSegmentRomStart, parameterSize,
"../z_construct.c", 162); "../z_construct.c", 162);
interfaceCtx->doActionSegment = GameState_Alloc(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166); interfaceCtx->doActionSegment = GAME_STATE_ALLOC(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166);
osSyncPrintf("DOアクション テクスチャ初期=%x\n", 3 * DO_ACTION_TEX_SIZE); // "DO Action Texture Initialization" osSyncPrintf("DOアクション テクスチャ初期=%x\n", 3 * DO_ACTION_TEX_SIZE); // "DO Action Texture Initialization"
osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment); osSyncPrintf("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
@ -57,8 +57,8 @@ void Interface_Init(PlayState* play) {
doActionOffset = (LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE; doActionOffset = (LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_ATTACK) * DO_ACTION_TEX_SIZE;
} }
DmaMgr_RequestSyncDebug(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DMA_REQUEST_SYNC(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset,
2 * DO_ACTION_TEX_SIZE, "../z_construct.c", 174); 2 * DO_ACTION_TEX_SIZE, "../z_construct.c", 174);
if (gSaveContext.language == LANGUAGE_ENG) { if (gSaveContext.language == LANGUAGE_ENG) {
doActionOffset = (LANGUAGE_ENG * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE; doActionOffset = (LANGUAGE_ENG * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE;
@ -68,11 +68,11 @@ void Interface_Init(PlayState* play) {
doActionOffset = (LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE; doActionOffset = (LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_RETURN) * DO_ACTION_TEX_SIZE;
} }
DmaMgr_RequestSyncDebug(interfaceCtx->doActionSegment + 2 * DO_ACTION_TEX_SIZE, DMA_REQUEST_SYNC(interfaceCtx->doActionSegment + 2 * DO_ACTION_TEX_SIZE,
(uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DO_ACTION_TEX_SIZE, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DO_ACTION_TEX_SIZE,
"../z_construct.c", 178); "../z_construct.c", 178);
interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, ICON_ITEM_SEGMENT_SIZE, "../z_construct.c", 190); interfaceCtx->iconItemSegment = GAME_STATE_ALLOC(&play->state, ICON_ITEM_SEGMENT_SIZE, "../z_construct.c", 190);
// "Icon Item Texture Initialization = %x" // "Icon Item Texture Initialization = %x"
osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", ICON_ITEM_SEGMENT_SIZE); osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", ICON_ITEM_SEGMENT_SIZE);
@ -85,33 +85,33 @@ void Interface_Init(PlayState* play) {
gSaveContext.save.info.equips.buttonItems[3]); gSaveContext.save.info.equips.buttonItems[3]);
if (gSaveContext.save.info.equips.buttonItems[0] < 0xF0) { if (gSaveContext.save.info.equips.buttonItems[0] < 0xF0) {
DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE,
"../z_construct.c", 198); "../z_construct.c", 198);
} else if (gSaveContext.save.info.equips.buttonItems[0] != 0xFF) { } else if (gSaveContext.save.info.equips.buttonItems[0] != 0xFF) {
DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE,
"../z_construct.c", 203); "../z_construct.c", 203);
} }
if (gSaveContext.save.info.equips.buttonItems[1] < 0xF0) { if (gSaveContext.save.info.equips.buttonItems[1] < 0xF0) {
DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (1 * ITEM_ICON_SIZE), DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (1 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[1]), ITEM_ICON_SIZE, GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[1]), ITEM_ICON_SIZE,
"../z_construct.c", 209); "../z_construct.c", 209);
} }
if (gSaveContext.save.info.equips.buttonItems[2] < 0xF0) { if (gSaveContext.save.info.equips.buttonItems[2] < 0xF0) {
DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (2 * ITEM_ICON_SIZE), DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (2 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[2]), ITEM_ICON_SIZE, GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[2]), ITEM_ICON_SIZE,
"../z_construct.c", 214); "../z_construct.c", 214);
} }
if (gSaveContext.save.info.equips.buttonItems[3] < 0xF0) { if (gSaveContext.save.info.equips.buttonItems[3] < 0xF0) {
DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (3 * ITEM_ICON_SIZE), DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (3 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[3]), ITEM_ICON_SIZE, GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[3]), ITEM_ICON_SIZE,
"../z_construct.c", 219); "../z_construct.c", 219);
} }
osSyncPrintf("%d\n", ((void)0, gSaveContext.timerState)); osSyncPrintf("%d\n", ((void)0, gSaveContext.timerState));
@ -190,7 +190,7 @@ void Message_Init(PlayState* play) {
View_Init(&msgCtx->view, play->state.gfxCtx); View_Init(&msgCtx->view, play->state.gfxCtx);
msgCtx->textboxSegment = GameState_Alloc(&play->state, TEXTBOX_SEGMENT_SIZE, "../z_construct.c", 349); msgCtx->textboxSegment = GAME_STATE_ALLOC(&play->state, TEXTBOX_SEGMENT_SIZE, "../z_construct.c", 349);
osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment); osSyncPrintf("message->fukidashiSegment=%x\n", msgCtx->textboxSegment);

View file

@ -97,7 +97,7 @@ char sRegGroupChars[REG_GROUPS] = {
void Regs_Init(void) { void Regs_Init(void) {
s32 i; s32 i;
gRegEditor = SystemArena_MallocDebug(sizeof(RegEditor), "../z_debug.c", 260); gRegEditor = SYSTEM_ARENA_MALLOC(sizeof(RegEditor), "../z_debug.c", 260);
gRegEditor->regPage = 0; gRegEditor->regPage = 0;
gRegEditor->regGroup = 0; gRegEditor->regGroup = 0;
gRegEditor->regCur = 0; gRegEditor->regCur = 0;

View file

@ -34,7 +34,7 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX,
GraphicsContext* gfxCtx) { GraphicsContext* gfxCtx) {
DebugDispObject* prevHead = sDebugObjectListHead; DebugDispObject* prevHead = sDebugObjectListHead;
sDebugObjectListHead = Graph_Alloc(gfxCtx, sizeof(DebugDispObject)); sDebugObjectListHead = GRAPH_ALLOC(gfxCtx, sizeof(DebugDispObject));
sDebugObjectListHead->pos.x = posX; sDebugObjectListHead->pos.x = posX;
sDebugObjectListHead->pos.y = posY; sDebugObjectListHead->pos.y = posY;
@ -81,7 +81,7 @@ void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayStat
gDPLoadTextureBlock(POLY_XLU_DISP++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, gDPLoadTextureBlock(POLY_XLU_DISP++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 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); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_debug_display.c", 189), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_debug_display.c", 189),
G_MTX_MODELVIEW | G_MTX_LOAD); G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, gDebugSpriteDL); gSPDisplayList(POLY_XLU_DISP++, gDebugSpriteDL);
@ -100,7 +100,7 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dlist, PlayState*
Matrix_SetTranslateRotateYXZ(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot); Matrix_SetTranslateRotateYXZ(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY); Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_debug_display.c", 228), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_debug_display.c", 228),
G_MTX_MODELVIEW | G_MTX_LOAD); G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, dlist); gSPDisplayList(POLY_XLU_DISP++, dlist);

View file

@ -1530,7 +1530,7 @@ s32 CutsceneCmd_UpdateCamEyeSpline(PlayState* play, CutsceneContext* csCtx, u8*
csCtx->camEyeSplinePointsAppliedFrame = cmd->startFrame; csCtx->camEyeSplinePointsAppliedFrame = cmd->startFrame;
if (gUseCutsceneCam) { if (gUseCutsceneCam) {
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0);
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId)); Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId));
@ -1569,7 +1569,7 @@ s32 CutsceneCmd_UpdateCamAtSpline(PlayState* play, CutsceneContext* csCtx, u8* s
gCamAtSplinePointsAppliedFrame = cmd->startFrame; gCamAtSplinePointsAppliedFrame = cmd->startFrame;
if (gUseCutsceneCam) { if (gUseCutsceneCam) {
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_CS_0);
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId)); Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId));
@ -1616,7 +1616,7 @@ s32 CutsceneCmd_SetCamEye(PlayState* play, CutsceneContext* csCtx, u8* script, u
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0);
roll = csCtx->camAtPoints->cameraRoll * 1.40625f; roll = csCtx->camAtPoints->cameraRoll * 1.40625f;
Camera_SetViewParam(subCam, CAM_VIEW_ROLL, &roll); Camera_SetViewParam(subCam, CAM_VIEW_ROLL, &roll);
@ -1664,7 +1664,7 @@ s32 CutsceneCmd_SetCamAt(PlayState* play, CutsceneContext* csCtx, u8* script, u8
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
Play_ChangeCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0); Play_RequestCameraSetting(play, csCtx->subCamId, CAM_SET_FREE0);
at.x = csCtx->camAtPoints->pos.x; at.x = csCtx->camAtPoints->pos.x;
at.y = csCtx->camAtPoints->pos.y; at.y = csCtx->camAtPoints->pos.y;
@ -2254,7 +2254,7 @@ void CutsceneHandler_StopScript(PlayState* play, CutsceneContext* csCtx) {
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_ACTIVE); Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_ACTIVE);
Play_ClearCamera(play, csCtx->subCamId); Play_ClearCamera(play, csCtx->subCamId);
func_8005B1A4(play->cameraPtrs[sReturnToCamId]); Camera_SetFinishedFlag(play->cameraPtrs[sReturnToCamId]);
} }
Audio_SetCutsceneFlag(0); Audio_SetCutsceneFlag(0);

View file

@ -385,7 +385,7 @@ void GetItem_DrawMaskOrBombchu(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 556); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 556);
Gfx_SetupDL_26Opa(play->state.gfxCtx); Gfx_SetupDL_26Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 565); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 565);
@ -397,7 +397,7 @@ void GetItem_DrawSoldOut(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 572); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 572);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 581); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 581);
@ -409,7 +409,7 @@ void GetItem_DrawBlueFire(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 588); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 588);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
@ -420,7 +420,7 @@ void GetItem_DrawBlueFire(PlayState* play, s16 drawId) {
Matrix_Push(); Matrix_Push();
Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY);
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
Matrix_Pop(); Matrix_Pop();
@ -433,11 +433,11 @@ void GetItem_DrawPoes(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 628); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 628);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPSegment(POLY_XLU_DISP++, 0x08, gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0),
@ -445,7 +445,7 @@ void GetItem_DrawPoes(PlayState* play, s16 drawId) {
1 * -(play->state.frames * 6), 16, 32)); 1 * -(play->state.frames * 6), 16, 32));
Matrix_Push(); Matrix_Push();
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
Matrix_Pop(); Matrix_Pop();
@ -459,11 +459,11 @@ void GetItem_DrawFairy(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 670); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 670);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPSegment(POLY_XLU_DISP++, 0x08, gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0),
@ -471,7 +471,7 @@ void GetItem_DrawFairy(PlayState* play, s16 drawId) {
1 * -(play->state.frames * 6), 32, 32)); 1 * -(play->state.frames * 6), 32, 32));
Matrix_Push(); Matrix_Push();
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
Matrix_Pop(); Matrix_Pop();
@ -488,11 +488,11 @@ void GetItem_DrawMirrorShield(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0) % 256, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0) % 256,
1 * (play->state.frames * 2) % 256, 64, 64, 1, 0 * (play->state.frames * 0) % 128, 1 * (play->state.frames * 2) % 256, 64, 64, 1, 0 * (play->state.frames * 0) % 128,
1 * (play->state.frames * 1) % 128, 32, 32)); 1 * (play->state.frames * 1) % 128, 32, 32));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 735); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 735);
@ -504,7 +504,7 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 742); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 742);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
@ -512,7 +512,7 @@ void GetItem_DrawSkullToken(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0),
1 * -(play->state.frames * 5), 32, 32, 1, 0 * (play->state.frames * 0), 1 * -(play->state.frames * 5), 32, 32, 1, 0 * (play->state.frames * 0),
0 * (play->state.frames * 0), 32, 64)); 0 * (play->state.frames * 0), 32, 64));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 765); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 765);
@ -524,7 +524,7 @@ void GetItem_DrawEggOrMedallion(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 772);
Gfx_SetupDL_26Opa(play->state.gfxCtx); Gfx_SetupDL_26Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
@ -537,11 +537,11 @@ void GetItem_DrawCompass(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 811); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 811);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_5);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 827); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 827);
@ -557,14 +557,14 @@ void GetItem_DrawPotion(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -1 * (play->state.frames * 1), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, -1 * (play->state.frames * 1),
1 * (play->state.frames * 1), 32, 32, 1, -1 * (play->state.frames * 1), 1 * (play->state.frames * 1), 32, 32, 1, -1 * (play->state.frames * 1),
1 * (play->state.frames * 1), 32, 32)); 1 * (play->state.frames * 1), 32, 32));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[3]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[5]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[5]);
@ -581,7 +581,7 @@ void GetItem_DrawGoronSword(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 1), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 1),
0 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 1), 0 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 1),
0 * (play->state.frames * 1), 32, 32)); 0 * (play->state.frames * 1), 32, 32));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 883); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 883);
@ -597,7 +597,7 @@ void GetItem_DrawDekuNuts(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 6), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 6),
1 * (play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 6), 1 * (play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 6),
1 * (play->state.frames * 6), 32, 32)); 1 * (play->state.frames * 6), 32, 32));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 906); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 906);
@ -613,7 +613,7 @@ void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 1), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 1),
1 * -(play->state.frames * 3), 32, 32, 1, 0 * (play->state.frames * 1), 1 * -(play->state.frames * 3), 32, 32, 1, 0 * (play->state.frames * 1),
1 * -(play->state.frames * 2), 32, 32)); 1 * -(play->state.frames * 2), 32, 32));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 929); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 929);
@ -629,7 +629,7 @@ void GetItem_DrawFish(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 * (play->state.frames * 0),
1 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 0), 1 * (play->state.frames * 1), 32, 32, 1, 0 * (play->state.frames * 0),
1 * (play->state.frames * 1), 32, 32)); 1 * (play->state.frames * 1), 32, 32));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 952); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 952);
@ -641,7 +641,7 @@ void GetItem_DrawOpa0(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 959); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 959);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 968); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 968);
@ -653,11 +653,11 @@ void GetItem_DrawOpa0Xlu1(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 975); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 975);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 991); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 991);
@ -669,7 +669,7 @@ void GetItem_DrawXlu01(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 998);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
@ -682,12 +682,12 @@ void GetItem_DrawOpa10Xlu2(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1015); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1015);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1032); CLOSE_DISPS(play->state.gfxCtx, "../z_draw.c", 1032);
@ -699,11 +699,11 @@ void GetItem_DrawMagicArrow(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1039); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1039);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
@ -720,7 +720,7 @@ void GetItem_DrawMagicSpell(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 2), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 2),
1 * -(play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 1), 1 * -(play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 1),
-1 * (play->state.frames * 2), 32, 32)); -1 * (play->state.frames * 2), 32, 32));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
@ -734,7 +734,7 @@ void GetItem_DrawOpa1023(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1088); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1088);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]);
@ -749,12 +749,12 @@ void GetItem_DrawOpa10Xlu32(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1108); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1108);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
@ -769,12 +769,12 @@ void GetItem_DrawSmallRupee(PlayState* play, s16 drawId) {
Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY); Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
@ -791,7 +791,7 @@ void GetItem_DrawScale(PlayState* play, s16 drawId) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 2), Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 1 * (play->state.frames * 2),
-1 * (play->state.frames * 2), 64, 64, 1, 1 * (play->state.frames * 4), -1 * (play->state.frames * 2), 64, 64, 1, 1 * (play->state.frames * 4),
1 * -(play->state.frames * 4), 32, 32)); 1 * -(play->state.frames * 4), 32, 32));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[1]);
@ -806,12 +806,12 @@ void GetItem_DrawBulletBag(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1188);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[2]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[4]);
@ -825,7 +825,7 @@ void GetItem_DrawWallet(PlayState* play, s16 drawId) {
OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1214); OPEN_DISPS(play->state.gfxCtx, "../z_draw.c", 1214);
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]); gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[2]);

View file

@ -393,7 +393,7 @@ void EffectBlure_DrawElemNoInterpolation(EffectBlure* this, EffectBlureElement*
Math_Vec3s_ToVec3f(&sp6C, &this->elements[0].p2); Math_Vec3s_ToVec3f(&sp6C, &this->elements[0].p2);
vtx = Graph_Alloc(gfxCtx, sizeof(Vtx[4])); vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[4]));
if (vtx == NULL) { if (vtx == NULL) {
// "Vertices cannot be secured." // "Vertices cannot be secured."
osSyncPrintf("z_eff_blure.c::SQ_NoInterpolate_disp() 頂点確保できず。\n"); osSyncPrintf("z_eff_blure.c::SQ_NoInterpolate_disp() 頂点確保できず。\n");
@ -554,7 +554,7 @@ void EffectBlure_DrawElemHermiteInterpolation(EffectBlure* this, EffectBlureElem
Math_Vec3f_Scale(&sp174, 0.5f); Math_Vec3f_Scale(&sp174, 0.5f);
Math_Vec3f_Scale(&sp168, 0.5f); Math_Vec3f_Scale(&sp168, 0.5f);
vtx = Graph_Alloc(gfxCtx, sizeof(Vtx[16])); vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[16]));
if (vtx == NULL) { if (vtx == NULL) {
// "Vertices cannot be secured." // "Vertices cannot be secured."
osSyncPrintf("z_eff_blure.c::SQ_HermiteInterpolate_disp() 頂点確保できず。\n"); osSyncPrintf("z_eff_blure.c::SQ_HermiteInterpolate_disp() 頂点確保できず。\n");
@ -849,7 +849,7 @@ void EffectBlure_DrawSimple(EffectBlure* this2, GraphicsContext* gfxCtx) {
if (this->numElements >= 2) { if (this->numElements >= 2) {
vtxCount = this->numElements * 4; vtxCount = this->numElements * 4;
vtx = Graph_Alloc(gfxCtx, vtxCount * sizeof(Vtx)); vtx = GRAPH_ALLOC(gfxCtx, vtxCount * sizeof(Vtx));
if (vtx == NULL) { if (vtx == NULL) {
// "Vertices cannot be secured. Forced termination" // "Vertices cannot be secured. Forced termination"
osSyncPrintf("ブラ─表示:頂点確保できず。強制終了\n"); osSyncPrintf("ブラ─表示:頂点確保できず。強制終了\n");
@ -943,7 +943,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
Gfx_SetupDL_38Xlu(gfxCtx); Gfx_SetupDL_38Xlu(gfxCtx);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
vtx = Graph_Alloc(gfxCtx, sizeof(Vtx[32])); vtx = GRAPH_ALLOC(gfxCtx, sizeof(Vtx[32]));
if (vtx == NULL) { if (vtx == NULL) {
// "Blure display: Vertex table could not be secured" // "Blure display: Vertex table could not be secured"
osSyncPrintf("ブラ─表示:頂点テーブル確保できず\n"); osSyncPrintf("ブラ─表示:頂点テーブル確保できず\n");
@ -973,14 +973,14 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio); vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio);
break; break;
case 3: case 3:
ratio = ratio * 0.5f; ratio *= 0.5f;
vtx[j].v.ob[0] = EffectSs_LerpS16(elem->p1.x, elem->p2.x, ratio); vtx[j].v.ob[0] = EffectSs_LerpS16(elem->p1.x, elem->p2.x, ratio);
vtx[j].v.ob[1] = EffectSs_LerpS16(elem->p1.y, elem->p2.y, ratio); vtx[j].v.ob[1] = EffectSs_LerpS16(elem->p1.y, elem->p2.y, ratio);
vtx[j].v.ob[2] = EffectSs_LerpS16(elem->p1.z, elem->p2.z, ratio); vtx[j].v.ob[2] = EffectSs_LerpS16(elem->p1.z, elem->p2.z, ratio);
vtx[j + 1].v.ob[0] = EffectSs_LerpS16(elem->p2.x, elem->p1.x, ratio); vtx[j + 1].v.ob[0] = EffectSs_LerpS16(elem->p2.x, elem->p1.x, ratio);
vtx[j + 1].v.ob[1] = EffectSs_LerpS16(elem->p2.y, elem->p1.y, ratio); vtx[j + 1].v.ob[1] = EffectSs_LerpS16(elem->p2.y, elem->p1.y, ratio);
vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio); vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio);
ratio = ratio + ratio; ratio *= 2.0f;
break; break;
case 0: case 0:
default: default:

View file

@ -171,7 +171,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
gSPSetGeometryMode(POLY_XLU_DISP++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH); gSPSetGeometryMode(POLY_XLU_DISP++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
vertices = Graph_Alloc(gfxCtx, this->numElements * sizeof(Vtx[4])); vertices = GRAPH_ALLOC(gfxCtx, this->numElements * sizeof(Vtx[4]));
if (vertices == NULL) { if (vertices == NULL) {
// "Memory Allocation Failure graph_malloc" // "Memory Allocation Failure graph_malloc"
osSyncPrintf("EffectSparkInfo_disp():メモリー確保失敗 graph_malloc\n"); osSyncPrintf("EffectSparkInfo_disp():メモリー確保失敗 graph_malloc\n");

View file

@ -160,24 +160,24 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
s32 i; s32 i;
for (i = 0; i < SPARK_COUNT; i++) { for (i = 0; i < SPARK_COUNT; i++) {
if (sEffectContext.sparks[i].status.active) { if (!sEffectContext.sparks[i].status.active) {
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx); continue;
} }
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
} }
for (i = 0; i < BLURE_COUNT; i++) { for (i = 0; i < BLURE_COUNT; i++) {
if (sEffectContext.blures[i].status.active) { if (!sEffectContext.blures[i].status.active) {
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx); continue;
} }
if (1) {} // Necessary to match sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
if (1) {}
} }
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) { for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (sEffectContext.shieldParticles[i].status.active) { if (!sEffectContext.shieldParticles[i].status.active) {
if (gfxCtx) {} // Necessary to match continue;
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
} }
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
} }
} }

View file

@ -15,7 +15,8 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
overlay->vromEnd - overlay->vromStart); overlay->vromEnd - overlay->vromStart);
} }
sEffectSsInfo.table = GameState_Alloc(&play->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289); sEffectSsInfo.table =
GAME_STATE_ALLOC(&play->state, tableSize * sizeof(EffectSs), "../z_effect_soft_sprite.c", 289);
ASSERT(sEffectSsInfo.table != NULL, "EffectSS2Info.data_table != NULL", "../z_effect_soft_sprite.c", 290); ASSERT(sEffectSsInfo.table != NULL, "EffectSS2Info.data_table != NULL", "../z_effect_soft_sprite.c", 290);
sEffectSsInfo.searchStartIndex = 0; sEffectSsInfo.searchStartIndex = 0;
@ -52,7 +53,7 @@ void EffectSs_ClearAll(PlayState* play) {
addr = overlay->loadedRamAddr; addr = overlay->loadedRamAddr;
if (addr != NULL) { if (addr != NULL) {
ZeldaArena_FreeDebug(addr, "../z_effect_soft_sprite.c", 337); ZELDA_ARENA_FREE(addr, "../z_effect_soft_sprite.c", 337);
} }
overlay->loadedRamAddr = NULL; overlay->loadedRamAddr = NULL;
@ -189,7 +190,7 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initParams) {
initInfo = overlayEntry->initInfo; initInfo = overlayEntry->initInfo;
} else { } else {
if (overlayEntry->loadedRamAddr == NULL) { if (overlayEntry->loadedRamAddr == NULL) {
overlayEntry->loadedRamAddr = ZeldaArena_MallocRDebug(overlaySize, "../z_effect_soft_sprite.c", 585); overlayEntry->loadedRamAddr = ZELDA_ARENA_MALLOC_R(overlaySize, "../z_effect_soft_sprite.c", 585);
if (overlayEntry->loadedRamAddr == NULL) { if (overlayEntry->loadedRamAddr == NULL) {
osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf(VT_FGCOL(RED));

View file

@ -204,10 +204,10 @@ void EnAObj_WaitTalk(EnAObj* this, PlayState* play) {
relYawTowardsPlayer = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; relYawTowardsPlayer = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
if (ABS(relYawTowardsPlayer) < 0x2800 || if (ABS(relYawTowardsPlayer) < 0x2800 ||
(this->dyna.actor.params == A_OBJ_SIGNPOST_ARROW && ABS(relYawTowardsPlayer) > 0x5800)) { (this->dyna.actor.params == A_OBJ_SIGNPOST_ARROW && ABS(relYawTowardsPlayer) > 0x5800)) {
if (Actor_ProcessTalkRequest(&this->dyna.actor, play)) { if (Actor_TalkOfferAccepted(&this->dyna.actor, play)) {
EnAObj_SetupAction(this, EnAObj_WaitFinishedTalking); EnAObj_SetupAction(this, EnAObj_WaitFinishedTalking);
} else { } else {
func_8002F2F4(&this->dyna.actor, play); Actor_OfferTalkNearColChkInfoCylinder(&this->dyna.actor, play);
} }
} }
} }
@ -353,8 +353,7 @@ void EnAObj_Draw(Actor* thisx, PlayState* play) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50); gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50);
} }
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_a_keep.c", 712), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_a_keep.c", 712), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, sDLists[type]); gSPDisplayList(POLY_OPA_DISP++, sDLists[type]);
CLOSE_DISPS(play->state.gfxCtx, "../z_en_a_keep.c", 715); CLOSE_DISPS(play->state.gfxCtx, "../z_en_a_keep.c", 715);

View file

@ -831,8 +831,7 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) {
texIndex = this->actor.params - 0x10; texIndex = this->actor.params - 0x10;
} }
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1562), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTex[texIndex])); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTex[texIndex]));
@ -861,8 +860,7 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex])); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex]));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1607), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, gItemDropDL); gSPDisplayList(POLY_OPA_DISP++, gItemDropDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1611); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1611);
@ -878,14 +876,12 @@ void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) {
Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx);
func_8002EBCC(&this->actor, play, 0); func_8002EBCC(&this->actor, play, 0);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1634), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1634), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, gHeartPieceExteriorDL); gSPDisplayList(POLY_OPA_DISP++, gHeartPieceExteriorDL);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
func_8002ED80(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1644), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1644), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, gHeartContainerInteriorDL); gSPDisplayList(POLY_XLU_DISP++, gHeartContainerInteriorDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1647); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1647);
@ -901,8 +897,7 @@ void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
func_8002ED80(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_item00.c", 1670), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1670), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_XLU_DISP++, gHeartPieceInteriorDL); gSPDisplayList(POLY_XLU_DISP++, gHeartPieceInteriorDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1673); CLOSE_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1673);

View file

@ -1,70 +1,189 @@
#include "global.h" #include "global.h"
u16 sReactionTextIds[][PLAYER_MASK_MAX] = { u16 sMaskReactionSetTextIds[MASK_REACTION_SET_MAX][PLAYER_MASK_MAX] = {
// MASK_REACTION_SET_CARPENTER_BOSS
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 }, { 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
// MASK_REACTION_SET_CARPENTER_1
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B }, { 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
// MASK_REACTION_SET_CARPENTER_2
{ 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 }, { 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 },
// MASK_REACTION_SET_CARPENTER_3
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B }, { 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
// MASK_REACTION_SET_CARPENTER_4
{ 0x0000, 0x7128, 0x7129, 0x712B, 0x7128, 0x7128, 0x7128, 0x7129, 0x7128 }, { 0x0000, 0x7128, 0x7129, 0x712B, 0x7128, 0x7128, 0x7128, 0x7129, 0x7128 },
// MASK_REACTION_SET_HYRULIAN_GUARD
{ 0x0000, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712F }, { 0x0000, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712D, 0x712F },
// MASK_REACTION_SET_HEISHI4_1
{ 0x0000, 0x712C, 0x712C, 0x712C, 0x712E, 0x712C, 0x712C, 0x712F, 0x712F }, { 0x0000, 0x712C, 0x712C, 0x712C, 0x712E, 0x712C, 0x712C, 0x712F, 0x712F },
// MASK_REACTION_SET_HEISHI4_2
{ 0x0000, 0x712C, 0x712C, 0x712C, 0x712F, 0x712C, 0x712C, 0x712F, 0x712F }, { 0x0000, 0x712C, 0x712C, 0x712C, 0x712F, 0x712C, 0x712C, 0x712F, 0x712F },
// MASK_REACTION_SET_CUCCO_LADY
{ 0x0000, 0x7130, 0x7132, 0x7133, 0x7130, 0x7130, 0x7131, 0x7132, 0x7131 }, { 0x0000, 0x7130, 0x7132, 0x7133, 0x7130, 0x7130, 0x7131, 0x7132, 0x7131 },
// MASK_REACTION_SET_CARPENTERS_SON
{ 0x0000, 0x7134, 0x7137, 0x7135, 0x7134, 0x7136, 0x7135, 0x7134, 0x7135 }, { 0x0000, 0x7134, 0x7137, 0x7135, 0x7134, 0x7136, 0x7135, 0x7134, 0x7135 },
// MASK_REACTION_SET_KAKARIKO_ROOF_MAN
{ 0x0000, 0x7138, 0x713A, 0x7138, 0x7139, 0x713A, 0x7138, 0x7139, 0x713B }, { 0x0000, 0x7138, 0x713A, 0x7138, 0x7139, 0x713A, 0x7138, 0x7139, 0x713B },
// MASK_REACTION_SET_WINDMILL_MAN
{ 0x0000, 0x7144, 0x7146, 0x7144, 0x7146, 0x7147, 0x7145, 0x7145, 0x7147 }, { 0x0000, 0x7144, 0x7146, 0x7144, 0x7146, 0x7147, 0x7145, 0x7145, 0x7147 },
// MASK_REACTION_SET_12
{ 0x0000, 0x7148, 0x7149, 0x7149, 0x714A, 0x714A, 0x714B, 0x7149, 0x714B }, { 0x0000, 0x7148, 0x7149, 0x7149, 0x714A, 0x714A, 0x714B, 0x7149, 0x714B },
// MASK_REACTION_SET_CURSED_SKULLTULA_MAN
{ 0x0000, 0x714C, 0x714D, 0x714C, 0x714C, 0x714E, 0x714C, 0x714E, 0x714F }, { 0x0000, 0x714C, 0x714D, 0x714C, 0x714C, 0x714E, 0x714C, 0x714E, 0x714F },
// MASK_REACTION_SET_DAMPE
{ 0x0000, 0x7150, 0x7153, 0x7152, 0x7150, 0x7151, 0x7153, 0x7153, 0x7151 }, { 0x0000, 0x7150, 0x7153, 0x7152, 0x7150, 0x7151, 0x7153, 0x7153, 0x7151 },
// MASK_REACTION_SET_GRAVEYARD_KID
{ 0x0000, 0x7155, 0x7156, 0x7157, 0x7154, 0x7156, 0x7156, 0x7156, 0x7156 }, { 0x0000, 0x7155, 0x7156, 0x7157, 0x7154, 0x7156, 0x7156, 0x7156, 0x7156 },
// MASK_REACTION_SET_SARIA
{ 0x0000, 0x715A, 0x7159, 0x715B, 0x715A, 0x715A, 0x7158, 0x7158, 0x715B }, { 0x0000, 0x715A, 0x7159, 0x715B, 0x715A, 0x715A, 0x7158, 0x7158, 0x715B },
// MASK_REACTION_SET_MIDO
{ 0x0000, 0x715E, 0x715D, 0x715D, 0x715F, 0x715E, 0x715C, 0x715C, 0x715D }, { 0x0000, 0x715E, 0x715D, 0x715D, 0x715F, 0x715E, 0x715C, 0x715C, 0x715D },
// MASK_REACTION_SET_FADO
{ 0x0000, 0x7163, 0x7162, 0x7160, 0x7163, 0x7160, 0x7161, 0x7161, 0x7160 }, { 0x0000, 0x7163, 0x7162, 0x7160, 0x7163, 0x7160, 0x7161, 0x7161, 0x7160 },
// MASK_REACTION_SET_KOKIRI_1
{ 0x0000, 0x7164, 0x7166, 0x7164, 0x7167, 0x7164, 0x7164, 0x7164, 0x7167 }, { 0x0000, 0x7164, 0x7166, 0x7164, 0x7167, 0x7164, 0x7164, 0x7164, 0x7167 },
// MASK_REACTION_SET_KOKIRI_2
{ 0x0000, 0x716B, 0x7169, 0x7168, 0x716B, 0x716A, 0x716B, 0x716B, 0x716A }, { 0x0000, 0x716B, 0x7169, 0x7168, 0x716B, 0x716A, 0x716B, 0x716B, 0x716A },
// MASK_REACTION_SET_SKULL_KID
{ 0x0000, 0x716C, 0x716D, 0x716F, 0x716C, 0x716E, 0x716E, 0x716E, 0x716F }, { 0x0000, 0x716C, 0x716D, 0x716F, 0x716C, 0x716E, 0x716E, 0x716E, 0x716F },
// MASK_REACTION_SET_ZELDA
{ 0x0000, 0x7171, 0x7173, 0x7170, 0x7172, 0x0000, 0x0000, 0x0000, 0x0000 }, { 0x0000, 0x7171, 0x7173, 0x7170, 0x7172, 0x0000, 0x0000, 0x0000, 0x0000 },
// MASK_REACTION_SET_MALON
{ 0x0000, 0x7176, 0x7177, 0x7174, 0x7174, 0x7175, 0x7174, 0x7174, 0x7177 }, { 0x0000, 0x7176, 0x7177, 0x7174, 0x7174, 0x7175, 0x7174, 0x7174, 0x7177 },
// MASK_REACTION_SET_TALON
{ 0x0000, 0x7178, 0x7179, 0x7179, 0x717B, 0x717A, 0x717B, 0x717A, 0x717B }, { 0x0000, 0x7178, 0x7179, 0x7179, 0x717B, 0x717A, 0x717B, 0x717A, 0x717B },
// MASK_REACTION_SET_INGO
{ 0x0000, 0x717D, 0x717C, 0x717C, 0x717D, 0x717F, 0x717C, 0x717E, 0x717D }, { 0x0000, 0x717D, 0x717C, 0x717C, 0x717D, 0x717F, 0x717C, 0x717E, 0x717D },
// MASK_REACTION_SET_LAKESIDE_PROFESSOR
{ 0x0000, 0x7183, 0x7181, 0x7180, 0x7183, 0x7182, 0x7183, 0x7181, 0x7183 }, { 0x0000, 0x7183, 0x7181, 0x7180, 0x7183, 0x7182, 0x7183, 0x7181, 0x7183 },
// MASK_REACTION_SET_MAGIC_BEAN_SALESMAN
{ 0x0000, 0x7184, 0x7186, 0x7185, 0x7186, 0x7184, 0x7187, 0x7186, 0x7184 }, { 0x0000, 0x7184, 0x7186, 0x7185, 0x7186, 0x7184, 0x7187, 0x7186, 0x7184 },
// MASK_REACTION_SET_RUNNING_MAN
{ 0x0000, 0x71A4, 0x71A6, 0x71A5, 0x0000, 0x71A6, 0x71A6, 0x71A6, 0x71A7 }, { 0x0000, 0x71A4, 0x71A6, 0x71A5, 0x0000, 0x71A6, 0x71A6, 0x71A6, 0x71A7 },
// MASK_REACTION_SET_ZORA
{ 0x0000, 0x7188, 0x7188, 0x7189, 0x7188, 0x7189, 0x718B, 0x718A, 0x7189 }, { 0x0000, 0x7188, 0x7188, 0x7189, 0x7188, 0x7189, 0x718B, 0x718A, 0x7189 },
// MASK_REACTION_SET_KING_ZORA
{ 0x0000, 0x718C, 0x718C, 0x718D, 0x718C, 0x718E, 0x718F, 0x718D, 0x718C }, { 0x0000, 0x718C, 0x718C, 0x718D, 0x718C, 0x718E, 0x718F, 0x718D, 0x718C },
// MASK_REACTION_SET_RUTO
{ 0x0000, 0x7190, 0x7190, 0x7191, 0x7192, 0x7191, 0x7193, 0x7190, 0x7191 }, { 0x0000, 0x7190, 0x7190, 0x7191, 0x7192, 0x7191, 0x7193, 0x7190, 0x7191 },
// MASK_REACTION_SET_GORON
{ 0x0000, 0x7196, 0x7194, 0x7195, 0x7196, 0x7197, 0x7194, 0x7196, 0x7195 }, { 0x0000, 0x7196, 0x7194, 0x7195, 0x7196, 0x7197, 0x7194, 0x7196, 0x7195 },
// MASK_REACTION_SET_DARUNIA
{ 0x0000, 0x7199, 0x719A, 0x7198, 0x7198, 0x719A, 0x719A, 0x719B, 0x7198 }, { 0x0000, 0x7199, 0x719A, 0x7198, 0x7198, 0x719A, 0x719A, 0x719B, 0x7198 },
// MASK_REACTION_SET_GERUDO_WHITE
{ 0x0000, 0x719D, 0x719C, 0x719E, 0x719D, 0x719D, 0x719C, 0x719F, 0x719E }, { 0x0000, 0x719D, 0x719C, 0x719E, 0x719D, 0x719D, 0x719C, 0x719F, 0x719E },
// MASK_REACTION_SET_NABOORU
{ 0x0000, 0x71A1, 0x71A0, 0x71A1, 0x71A2, 0x71A1, 0x71A2, 0x71A3, 0x71A2 }, { 0x0000, 0x71A1, 0x71A0, 0x71A1, 0x71A2, 0x71A1, 0x71A2, 0x71A3, 0x71A2 },
// MASK_REACTION_SET_DANCING_COUPLE
{ 0x0000, 0x711C, 0x711E, 0x711C, 0x711F, 0x711E, 0x711C, 0x711D, 0x711F }, { 0x0000, 0x711C, 0x711E, 0x711C, 0x711F, 0x711E, 0x711C, 0x711D, 0x711F },
// MASK_REACTION_SET_37
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7107, 0x7105, 0x7106, 0x7107, 0x7107 }, { 0x0000, 0x7104, 0x7105, 0x7107, 0x7107, 0x7105, 0x7106, 0x7107, 0x7107 },
// MASK_REACTION_SET_38
{ 0x0000, 0x7107, 0x7105, 0x7107, 0x7107, 0x7106, 0x7107, 0x7107, 0x7105 }, { 0x0000, 0x7107, 0x7105, 0x7107, 0x7107, 0x7106, 0x7107, 0x7107, 0x7105 },
// MASK_REACTION_SET_39
{ 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 }, { 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 },
// MASK_REACTION_SET_40
{ 0x0000, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7111, 0x7113 }, { 0x0000, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7113, 0x7111, 0x7113 },
// MASK_REACTION_SET_41
{ 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 }, { 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 },
// MASK_REACTION_SET_42
{ 0x0000, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7113 }, { 0x0000, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7117, 0x7113 },
// MASK_REACTION_SET_43
{ 0x0000, 0x7101, 0x7100, 0x7102, 0x7103, 0x7101, 0x7100, 0x7102, 0x7103 }, { 0x0000, 0x7101, 0x7100, 0x7102, 0x7103, 0x7101, 0x7100, 0x7102, 0x7103 },
// MASK_REACTION_SET_44
{ 0x0000, 0x7100, 0x7102, 0x7100, 0x7100, 0x7100, 0x7100, 0x7100, 0x7102 }, { 0x0000, 0x7100, 0x7102, 0x7100, 0x7100, 0x7100, 0x7100, 0x7100, 0x7102 },
// MASK_REACTION_SET_45
{ 0x0000, 0x710A, 0x7109, 0x7109, 0x710A, 0x710B, 0x7108, 0x7109, 0x710B }, { 0x0000, 0x710A, 0x7109, 0x7109, 0x710A, 0x710B, 0x7108, 0x7109, 0x710B },
// MASK_REACTION_SET_46
{ 0x0000, 0x7117, 0x7112, 0x7113, 0x7110, 0x710C, 0x7117, 0x710E, 0x7112 }, { 0x0000, 0x7117, 0x7112, 0x7113, 0x7110, 0x710C, 0x7117, 0x710E, 0x7112 },
// MASK_REACTION_SET_47
{ 0x0000, 0x710D, 0x710F, 0x710C, 0x7112, 0x710D, 0x710C, 0x710C, 0x710F }, { 0x0000, 0x710D, 0x710F, 0x710C, 0x7112, 0x710D, 0x710C, 0x710C, 0x710F },
// MASK_REACTION_SET_48
{ 0x0000, 0x710A, 0x7109, 0x711A, 0x710A, 0x7109, 0x7108, 0x710B, 0x7109 }, { 0x0000, 0x710A, 0x7109, 0x711A, 0x710A, 0x7109, 0x7108, 0x710B, 0x7109 },
// MASK_REACTION_SET_49
{ 0x0000, 0x710C, 0x710F, 0x7113, 0x7110, 0x710D, 0x7112, 0x7116, 0x710D }, { 0x0000, 0x710C, 0x710F, 0x7113, 0x7110, 0x710D, 0x7112, 0x7116, 0x710D },
// MASK_REACTION_SET_50
{ 0x0000, 0x7115, 0x7114, 0x7114, 0x7115, 0x7114, 0x7114, 0x7116, 0x7117 }, { 0x0000, 0x7115, 0x7114, 0x7114, 0x7115, 0x7114, 0x7114, 0x7116, 0x7117 },
// MASK_REACTION_SET_51
{ 0x0000, 0x7113, 0x710F, 0x7113, 0x7110, 0x710C, 0x711A, 0x710D, 0x7112 }, { 0x0000, 0x7113, 0x710F, 0x7113, 0x7110, 0x710C, 0x711A, 0x710D, 0x7112 },
// MASK_REACTION_SET_52
{ 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 }, { 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 },
// MASK_REACTION_SET_53
{ 0x0000, 0x7112, 0x710E, 0x7112, 0x710E, 0x710D, 0x7112, 0x710E, 0x710F }, { 0x0000, 0x7112, 0x710E, 0x7112, 0x710E, 0x710D, 0x7112, 0x710E, 0x710F },
// MASK_REACTION_SET_54
{ 0x0000, 0x7142, 0x7141, 0x7142, 0x7143, 0x7140, 0x7140, 0x7141, 0x7143 }, { 0x0000, 0x7142, 0x7141, 0x7142, 0x7143, 0x7140, 0x7140, 0x7141, 0x7143 },
// MASK_REACTION_SET_55
{ 0x0000, 0x713C, 0x713D, 0x713D, 0x713E, 0x713E, 0x713F, 0x713D, 0x713F }, { 0x0000, 0x713C, 0x713D, 0x713D, 0x713E, 0x713E, 0x713F, 0x713D, 0x713F },
// MASK_REACTION_SET_56
{ 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 }, { 0x0000, 0x7101, 0x7102, 0x7103, 0x7101, 0x7100, 0x7100, 0x7102, 0x7100 },
// MASK_REACTION_SET_57
{ 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 }, { 0x0000, 0x7113, 0x7117, 0x7113, 0x7110, 0x7112, 0x7112, 0x7116, 0x7112 },
// MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_1
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x7105, 0x7105, 0x7107, 0x7107 }, { 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x7105, 0x7105, 0x7107, 0x7107 },
// MASK_REACTION_SET_HAGGLING_TOWNSPEOPLE_2
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 }, { 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 },
}; };
u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet) { u16 MaskReaction_GetTextId(PlayState* play, u32 maskReactionSet) {
u8 currentMask = Player_GetMask(play); u8 currentMask = Player_GetMask(play);
return sReactionTextIds[reactionSet][currentMask]; return sMaskReactionSetTextIds[maskReactionSet][currentMask];
} }

View file

@ -133,19 +133,19 @@ void TransitionTile_Destroy(TransitionTile* this) {
Sleep_Msec(100); Sleep_Msec(100);
if (this->vtxData != NULL) { if (this->vtxData != NULL) {
SystemArena_FreeDebug(this->vtxData, "../z_fbdemo.c", 180); SYSTEM_ARENA_FREE(this->vtxData, "../z_fbdemo.c", 180);
this->vtxData = NULL; this->vtxData = NULL;
} }
if (this->vtxFrame1 != NULL) { if (this->vtxFrame1 != NULL) {
SystemArena_FreeDebug(this->vtxFrame1, "../z_fbdemo.c", 181); SYSTEM_ARENA_FREE(this->vtxFrame1, "../z_fbdemo.c", 181);
this->vtxFrame1 = NULL; this->vtxFrame1 = NULL;
} }
if (this->vtxFrame2 != NULL) { if (this->vtxFrame2 != NULL) {
SystemArena_FreeDebug(this->vtxFrame2, "../z_fbdemo.c", 182); SYSTEM_ARENA_FREE(this->vtxFrame2, "../z_fbdemo.c", 182);
this->vtxFrame2 = NULL; this->vtxFrame2 = NULL;
} }
if (this->gfx != NULL) { if (this->gfx != NULL) {
SystemArena_FreeDebug(this->gfx, "../z_fbdemo.c", 183); SYSTEM_ARENA_FREE(this->gfx, "../z_fbdemo.c", 183);
this->gfx = NULL; this->gfx = NULL;
} }
} }
@ -156,28 +156,27 @@ TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows) {
this->frame = 0; this->frame = 0;
this->cols = cols; this->cols = cols;
this->rows = rows; this->rows = rows;
this->vtxData = this->vtxData = SYSTEM_ARENA_MALLOC((cols + 1) * sizeof(TransitionTileVtxData) * (rows + 1), "../z_fbdemo.c", 195);
SystemArena_MallocDebug((cols + 1) * sizeof(TransitionTileVtxData) * (rows + 1), "../z_fbdemo.c", 195); this->vtxFrame1 = SYSTEM_ARENA_MALLOC((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 196);
this->vtxFrame1 = SystemArena_MallocDebug((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 196); this->vtxFrame2 = SYSTEM_ARENA_MALLOC((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 197);
this->vtxFrame2 = SystemArena_MallocDebug((cols + 1) * sizeof(Vtx) * (rows + 1), "../z_fbdemo.c", 197); this->gfx = SYSTEM_ARENA_MALLOC((this->rows * (1 + this->cols * 9) + 2) * sizeof(Gfx), "../z_fbdemo.c", 198);
this->gfx = SystemArena_MallocDebug((this->rows * (1 + this->cols * 9) + 2) * sizeof(Gfx), "../z_fbdemo.c", 198);
if ((this->vtxData == NULL) || (this->vtxFrame1 == NULL) || (this->vtxFrame2 == NULL) || (this->gfx == NULL)) { if ((this->vtxData == NULL) || (this->vtxFrame1 == NULL) || (this->vtxFrame2 == NULL) || (this->gfx == NULL)) {
osSyncPrintf("fbdemo_init allocation error\n"); osSyncPrintf("fbdemo_init allocation error\n");
if (this->vtxData != NULL) { if (this->vtxData != NULL) {
SystemArena_FreeDebug(this->vtxData, "../z_fbdemo.c", 202); SYSTEM_ARENA_FREE(this->vtxData, "../z_fbdemo.c", 202);
this->vtxData = NULL; this->vtxData = NULL;
} }
if (this->vtxFrame1 != NULL) { if (this->vtxFrame1 != NULL) {
SystemArena_FreeDebug(this->vtxFrame1, "../z_fbdemo.c", 203); SYSTEM_ARENA_FREE(this->vtxFrame1, "../z_fbdemo.c", 203);
this->vtxFrame1 = NULL; this->vtxFrame1 = NULL;
} }
if (this->vtxFrame2 != NULL) { if (this->vtxFrame2 != NULL) {
SystemArena_FreeDebug(this->vtxFrame2, "../z_fbdemo.c", 204); SYSTEM_ARENA_FREE(this->vtxFrame2, "../z_fbdemo.c", 204);
this->vtxFrame2 = NULL; this->vtxFrame2 = NULL;
} }
if (this->gfx != NULL) { if (this->gfx != NULL) {
SystemArena_FreeDebug(this->gfx, "../z_fbdemo.c", 205); SYSTEM_ARENA_FREE(this->gfx, "../z_fbdemo.c", 205);
this->gfx = NULL; this->gfx = NULL;
} }
return NULL; return NULL;

View file

@ -52,8 +52,8 @@ s32 SkelCurve_Init(PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* s
skelCurve->limbCount = skeletonHeader->limbCount; skelCurve->limbCount = skeletonHeader->limbCount;
skelCurve->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->limbs); skelCurve->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->limbs);
skelCurve->jointTable = ZeldaArena_MallocDebug(sizeof(*skelCurve->jointTable) * skelCurve->limbCount, skelCurve->jointTable =
"../z_fcurve_data_skelanime.c", 125); ZELDA_ARENA_MALLOC(sizeof(*skelCurve->jointTable) * skelCurve->limbCount, "../z_fcurve_data_skelanime.c", 125);
ASSERT(skelCurve->jointTable != NULL, "this->now_joint != NULL", "../z_fcurve_data_skelanime.c", 127); ASSERT(skelCurve->jointTable != NULL, "this->now_joint != NULL", "../z_fcurve_data_skelanime.c", 127);
skelCurve->curFrame = 0.0f; skelCurve->curFrame = 0.0f;
return true; return true;
@ -64,7 +64,7 @@ s32 SkelCurve_Init(PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* s
*/ */
void SkelCurve_Destroy(PlayState* play, SkelCurve* skelCurve) { void SkelCurve_Destroy(PlayState* play, SkelCurve* skelCurve) {
if (skelCurve->jointTable != NULL) { if (skelCurve->jointTable != NULL) {
ZeldaArena_FreeDebug(skelCurve->jointTable, "../z_fcurve_data_skelanime.c", 146); ZELDA_ARENA_FREE(skelCurve->jointTable, "../z_fcurve_data_skelanime.c", 146);
} }
} }
@ -192,7 +192,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov
dList = limb->dList[0]; dList = limb->dList[0];
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 321),
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, dList); gSPDisplayList(POLY_OPA_DISP++, dList);
} }
@ -201,13 +201,13 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov
dList = limb->dList[0]; dList = limb->dList[0];
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 332),
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, dList); gSPDisplayList(POLY_OPA_DISP++, dList);
} }
dList = limb->dList[1]; dList = limb->dList[1];
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_fcurve_data_skelanime.c", 338),
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, dList); gSPDisplayList(POLY_XLU_DISP++, dList);
} }

View file

@ -57,7 +57,7 @@ void KaleidoManager_Init(PlayState* play) {
osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestSize); osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestSize);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
sKaleidoAreaPtr = GameState_Alloc(&play->state, largestSize, "../z_kaleido_manager.c", 150); sKaleidoAreaPtr = GAME_STATE_ALLOC(&play->state, largestSize, "../z_kaleido_manager.c", 150);
LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 151); LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 151);
osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf(VT_FGCOL(GREEN));

View file

@ -9,9 +9,9 @@ void func_8006EE50(Font* font, u16 arg1, u16 arg2) {
* at `codePointIndex`. The value of `character` is the ASCII codepoint subtract ' '/0x20. * at `codePointIndex`. The value of `character` is the ASCII codepoint subtract ' '/0x20.
*/ */
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) { void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) {
DmaMgr_RequestSyncDebug(&font->charTexBuf[codePointIndex], DMA_REQUEST_SYNC(&font->charTexBuf[codePointIndex],
(uintptr_t)_nes_font_staticSegmentRomStart + character * FONT_CHAR_TEX_SIZE, (uintptr_t)_nes_font_staticSegmentRomStart + character * FONT_CHAR_TEX_SIZE, FONT_CHAR_TEX_SIZE,
FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 93); "../z_kanfont.c", 93);
} }
/** /**
@ -20,10 +20,10 @@ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) {
* The different icons are given in the MessageBoxIcon enum. * The different icons are given in the MessageBoxIcon enum.
*/ */
void Font_LoadMessageBoxIcon(Font* font, u16 icon) { void Font_LoadMessageBoxIcon(Font* font, u16 icon) {
DmaMgr_RequestSyncDebug(font->iconBuf, DMA_REQUEST_SYNC(font->iconBuf,
(uintptr_t)_message_staticSegmentRomStart + 4 * MESSAGE_STATIC_TEX_SIZE + (uintptr_t)_message_staticSegmentRomStart + 4 * MESSAGE_STATIC_TEX_SIZE +
icon * FONT_CHAR_TEX_SIZE, icon * FONT_CHAR_TEX_SIZE,
FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 100); FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 100);
} }
/** /**
@ -42,8 +42,8 @@ void Font_LoadOrderedFont(Font* font) {
font->msgOffset = _message_0xFFFC_nes - (const char*)_nes_message_data_staticSegmentStart; font->msgOffset = _message_0xFFFC_nes - (const char*)_nes_message_data_staticSegmentStart;
len = font->msgLength = _message_0xFFFD_nes - _message_0xFFFC_nes; len = font->msgLength = _message_0xFFFD_nes - _message_0xFFFC_nes;
DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len, DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len,
"../z_kanfont.c", 122); "../z_kanfont.c", 122);
osSyncPrintf("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, jj = len); osSyncPrintf("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, jj = len);
len = jj; len = jj;
@ -60,7 +60,7 @@ void Font_LoadOrderedFont(Font* font) {
osSyncPrintf("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]); osSyncPrintf("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]);
offset = (font->msgBuf[codePointIndex] - ' ') * FONT_CHAR_TEX_SIZE; offset = (font->msgBuf[codePointIndex] - ' ') * FONT_CHAR_TEX_SIZE;
DmaMgr_RequestSyncDebug(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134); DMA_REQUEST_SYNC(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134);
fontBufIndex += FONT_CHAR_TEX_SIZE / 8; fontBufIndex += FONT_CHAR_TEX_SIZE / 8;
} }
} }

View file

@ -710,9 +710,9 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
size = gNormalSkyFiles[newSkybox1Index].file.vromEnd - gNormalSkyFiles[newSkybox1Index].file.vromStart; size = gNormalSkyFiles[newSkybox1Index].file.vromEnd - gNormalSkyFiles[newSkybox1Index].file.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->staticSegments[0], DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->staticSegments[0],
gNormalSkyFiles[newSkybox1Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL, gNormalSkyFiles[newSkybox1Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL,
"../z_kankyo.c", 1264); "../z_kankyo.c", 1264);
envCtx->skybox1Index = newSkybox1Index; envCtx->skybox1Index = newSkybox1Index;
} }
@ -721,9 +721,9 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
size = gNormalSkyFiles[newSkybox2Index].file.vromEnd - gNormalSkyFiles[newSkybox2Index].file.vromStart; size = gNormalSkyFiles[newSkybox2Index].file.vromEnd - gNormalSkyFiles[newSkybox2Index].file.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->staticSegments[1], DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->staticSegments[1],
gNormalSkyFiles[newSkybox2Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL, gNormalSkyFiles[newSkybox2Index].file.vromStart, size, 0, &envCtx->loadQueue, NULL,
"../z_kankyo.c", 1281); "../z_kankyo.c", 1281);
envCtx->skybox2Index = newSkybox2Index; envCtx->skybox2Index = newSkybox2Index;
} }
@ -735,16 +735,16 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
gNormalSkyFiles[newSkybox1Index].palette.vromStart; gNormalSkyFiles[newSkybox1Index].palette.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->palettes, DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->palettes,
gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL,
NULL, "../z_kankyo.c", 1307); "../z_kankyo.c", 1307);
} else { } else {
size = gNormalSkyFiles[newSkybox1Index].palette.vromEnd - size = gNormalSkyFiles[newSkybox1Index].palette.vromEnd -
gNormalSkyFiles[newSkybox1Index].palette.vromStart; gNormalSkyFiles[newSkybox1Index].palette.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
DmaMgr_RequestAsync(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size, DMA_REQUEST_ASYNC(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size,
gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, gNormalSkyFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL,
NULL, "../z_kankyo.c", 1320); "../z_kankyo.c", 1320);
} }
} }
@ -756,16 +756,16 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
gNormalSkyFiles[newSkybox2Index].palette.vromStart; gNormalSkyFiles[newSkybox2Index].palette.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
DmaMgr_RequestAsync(&envCtx->dmaRequest, skyboxCtx->palettes, DMA_REQUEST_ASYNC(&envCtx->dmaRequest, skyboxCtx->palettes,
gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL,
NULL, "../z_kankyo.c", 1342); "../z_kankyo.c", 1342);
} else { } else {
size = gNormalSkyFiles[newSkybox2Index].palette.vromEnd - size = gNormalSkyFiles[newSkybox2Index].palette.vromEnd -
gNormalSkyFiles[newSkybox2Index].palette.vromStart; gNormalSkyFiles[newSkybox2Index].palette.vromStart;
osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1);
DmaMgr_RequestAsync(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size, DMA_REQUEST_ASYNC(&envCtx->dmaRequest, (u8*)skyboxCtx->palettes + size,
gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, gNormalSkyFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL,
NULL, "../z_kankyo.c", 1355); "../z_kankyo.c", 1355);
} }
} }
@ -1427,7 +1427,7 @@ void Environment_DrawSunAndMoon(PlayState* play) {
scale = (color * 2.0f) + 10.0f; scale = (color * 2.0f) + 10.0f;
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_kankyo.c", 2364), G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 2364), G_MTX_LOAD);
Gfx_SetupDL_54Opa(play->state.gfxCtx); Gfx_SetupDL_54Opa(play->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, gSunDL); gSPDisplayList(POLY_OPA_DISP++, gSunDL);
@ -1446,7 +1446,7 @@ void Environment_DrawSunAndMoon(PlayState* play) {
alpha = temp * 255.0f; alpha = temp * 255.0f;
if (alpha > 0.0f) { if (alpha > 0.0f) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_kankyo.c", 2406), G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 2406), G_MTX_LOAD);
Gfx_SetupDL_51Opa(play->state.gfxCtx); Gfx_SetupDL_51Opa(play->state.gfxCtx);
gDPPipeSync(POLY_OPA_DISP++); gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 240, 255, 180, alpha); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 240, 255, 180, alpha);
@ -1620,7 +1620,7 @@ void Environment_DrawLensFlare(PlayState* play, EnvironmentContext* envCtx, View
POLY_XLU_DISP = func_800947AC(POLY_XLU_DISP++); POLY_XLU_DISP = func_800947AC(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, lensFlareColors[i].r, lensFlareColors[i].g, lensFlareColors[i].b, gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, lensFlareColors[i].r, lensFlareColors[i].g, lensFlareColors[i].b,
alpha * envCtx->lensFlareAlphaScale); alpha * envCtx->lensFlareAlphaScale);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_kankyo.c", 2662), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2662),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0,
0, PRIMITIVE, 0); 0, PRIMITIVE, 0);
@ -1703,7 +1703,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx)
Vec3f windDirection = { 0.0f, 0.0f, 0.0f }; Vec3f windDirection = { 0.0f, 0.0f, 0.0f };
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_8) && if (!(play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_CAMERA_IN_WATER) &&
(play->envCtx.precipitation[PRECIP_SNOW_CUR] == 0)) { (play->envCtx.precipitation[PRECIP_SNOW_CUR] == 0)) {
OPEN_DISPS(gfxCtx, "../z_kankyo.c", 2799); OPEN_DISPS(gfxCtx, "../z_kankyo.c", 2799);
@ -1754,7 +1754,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx)
Matrix_RotateY(-rotY, MTXMODE_APPLY); Matrix_RotateY(-rotY, MTXMODE_APPLY);
Matrix_RotateX(M_PI / 2 - rotX, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2 - rotX, MTXMODE_APPLY);
Matrix_Scale(0.4f, 1.2f, 0.4f, MTXMODE_APPLY); Matrix_Scale(0.4f, 1.2f, 0.4f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_kankyo.c", 2887), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2887),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gRaindropDL); gSPDisplayList(POLY_XLU_DISP++, gRaindropDL);
} }
@ -1781,7 +1781,7 @@ void Environment_DrawRain(PlayState* play, View* view, GraphicsContext* gfxCtx)
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
} }
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_kankyo.c", 2940), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_kankyo.c", 2940),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL);
} }
@ -2025,7 +2025,7 @@ void Environment_DrawLightning(PlayState* play, s32 unused) {
Matrix_Scale(22.0f, 100.0f, 22.0f, MTXMODE_APPLY); Matrix_Scale(22.0f, 100.0f, 22.0f, MTXMODE_APPLY);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 128); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 128);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, 128); gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, 128);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_kankyo.c", 3333), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 3333),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(lightningTextures[sLightningBolts[i].textureIndex])); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(lightningTextures[sLightningBolts[i].textureIndex]));
Gfx_SetupDL_61Xlu(play->state.gfxCtx); Gfx_SetupDL_61Xlu(play->state.gfxCtx);
@ -2419,17 +2419,17 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) {
if (ABS(primA - primA1) < 9) { if (ABS(primA - primA1) < 9) {
primA = primA1; primA = primA1;
} else if (primA1 < primA) { } else if (primA1 < primA) {
primA = primA - 9; primA -= 9;
} else { } else {
primA = primA + 9; primA += 9;
} }
if (ABS(envA - envA1) < 9) { if (ABS(envA - envA1) < 9) {
envA = envA1; envA = envA1;
} else if (envA1 < envA) { } else if (envA1 < envA) {
envA = envA - 9; envA -= 9;
} else { } else {
envA = envA + 9; envA += 9;
} }
play->envCtx.sandstormPrimA = primA; play->envCtx.sandstormPrimA = primA;

View file

@ -475,7 +475,7 @@ void Health_DrawMeter(PlayState* play) {
} }
{ {
Mtx* matrix = Graph_Alloc(gfxCtx, sizeof(Mtx)); Mtx* matrix = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
Matrix_SetTranslateScaleMtx2( Matrix_SetTranslateScaleMtx2(
matrix, 1.0f - (0.32f * beatingHeartPulsingSize), 1.0f - (0.32f * beatingHeartPulsingSize), matrix, 1.0f - (0.32f * beatingHeartPulsingSize), 1.0f - (0.32f * beatingHeartPulsingSize),
1.0f - (0.32f * beatingHeartPulsingSize), -130.0f + offsetX, 94.5f - offsetY, 0.0f); 1.0f - (0.32f * beatingHeartPulsingSize), -130.0f + offsetX, 94.5f - offsetY, 0.0f);

View file

@ -108,7 +108,7 @@ void Lights_BindPoint(Lights* lights, LightParams* params, Vec3f* vec) {
if (light != NULL) { if (light != NULL) {
posDiff = sqrtf(posDiff); posDiff = sqrtf(posDiff);
if (1) {}
scale = posDiff / scale; scale = posDiff / scale;
scale = 1 - SQ(scale); scale = 1 - SQ(scale);
@ -279,7 +279,7 @@ Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8
Lights* lights; Lights* lights;
s32 i; s32 i;
lights = Graph_Alloc(gfxCtx, sizeof(Lights)); lights = GRAPH_ALLOC(gfxCtx, sizeof(Lights));
lights->l.a.l.col[0] = lights->l.a.l.colc[0] = ambientR; lights->l.a.l.col[0] = lights->l.a.l.colc[0] = ambientR;
lights->l.a.l.col[1] = lights->l.a.l.colc[1] = ambientG; lights->l.a.l.col[1] = lights->l.a.l.colc[1] = ambientG;
@ -303,7 +303,7 @@ Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8
Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB) { Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB) {
Lights* lights; Lights* lights;
lights = Graph_Alloc(gfxCtx, sizeof(Lights)); lights = GRAPH_ALLOC(gfxCtx, sizeof(Lights));
lights->l.a.l.col[0] = lights->l.a.l.colc[0] = ambientR; lights->l.a.l.col[0] = lights->l.a.l.colc[0] = ambientR;
lights->l.a.l.col[1] = lights->l.a.l.colc[1] = ambientG; lights->l.a.l.col[1] = lights->l.a.l.colc[1] = ambientG;
@ -388,7 +388,7 @@ void Lights_DrawGlow(PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50);
Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW); Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_lights.c", 918), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_lights.c", 918),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL); gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL);
} }

View file

@ -130,10 +130,10 @@ void Map_InitData(PlayState* play, s16 room) {
osSyncPrintf("%d\n", extendedMapIndex); osSyncPrintf("%d\n", extendedMapIndex);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
sEntranceIconMapIndex = extendedMapIndex; sEntranceIconMapIndex = extendedMapIndex;
DmaMgr_RequestSyncDebug(interfaceCtx->mapSegment, DMA_REQUEST_SYNC(interfaceCtx->mapSegment,
(uintptr_t)_map_grand_staticSegmentRomStart + (uintptr_t)_map_grand_staticSegmentRomStart +
gMapData->owMinimapTexOffset[extendedMapIndex], gMapData->owMinimapTexOffset[extendedMapIndex],
gMapData->owMinimapTexSize[mapIndex], "../z_map_exp.c", 309); gMapData->owMinimapTexSize[mapIndex], "../z_map_exp.c", 309);
interfaceCtx->unk_258 = mapIndex; interfaceCtx->unk_258 = mapIndex;
break; break;
case SCENE_DEKU_TREE: case SCENE_DEKU_TREE:
@ -159,10 +159,10 @@ void Map_InitData(PlayState* play, s16 room) {
osSyncPrintf("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room, osSyncPrintf("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room,
mapIndex, VREG(30)); mapIndex, VREG(30));
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
DmaMgr_RequestSyncDebug(play->interfaceCtx.mapSegment, DMA_REQUEST_SYNC(play->interfaceCtx.mapSegment,
(uintptr_t)_map_i_staticSegmentRomStart + (uintptr_t)_map_i_staticSegmentRomStart +
((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE), ((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * MAP_I_TEX_SIZE),
MAP_I_TEX_SIZE, "../z_map_exp.c", 346); MAP_I_TEX_SIZE, "../z_map_exp.c", 346);
R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room]; R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room];
R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room]; R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room];
Map_SetFloorPalettesData(play, VREG(30)); Map_SetFloorPalettesData(play, VREG(30));
@ -232,7 +232,7 @@ void Map_Init(PlayState* play) {
interfaceCtx->unk_258 = -1; interfaceCtx->unk_258 = -1;
interfaceCtx->unk_25A = -1; interfaceCtx->unk_25A = -1;
interfaceCtx->mapSegment = GameState_Alloc(&play->state, 0x1000, "../z_map_exp.c", 457); interfaceCtx->mapSegment = GAME_STATE_ALLOC(&play->state, 0x1000, "../z_map_exp.c", 457);
// " texture initialization scene_data_ID=%d mapSegment=%x" // " texture initialization scene_data_ID=%d mapSegment=%x"
osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneId, osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneId,
interfaceCtx->mapSegment, play); interfaceCtx->mapSegment, play);
@ -334,7 +334,7 @@ void Minimap_DrawCompassIcons(PlayState* play) {
Matrix_RotateX(-1.6f, MTXMODE_APPLY); Matrix_RotateX(-1.6f, MTXMODE_APPLY);
tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400; tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400;
Matrix_RotateY(tempX / 10.0f, MTXMODE_APPLY); Matrix_RotateY(tempX / 10.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_map_exp.c", 585), gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_map_exp.c", 585),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255);
@ -348,7 +348,7 @@ void Minimap_DrawCompassIcons(PlayState* play) {
Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY); Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY);
Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY); Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY);
Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY); Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_map_exp.c", 603), gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_map_exp.c", 603),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255); gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255);

View file

@ -57,7 +57,7 @@ void MapMark_Init(PlayState* play) {
MapMarkDataOverlay* overlay = &sMapMarkDataOvl; MapMarkDataOverlay* overlay = &sMapMarkDataOvl;
u32 overlaySize = (uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart; u32 overlaySize = (uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart;
overlay->loadedRamAddr = GameState_Alloc(&play->state, overlaySize, "../z_map_mark.c", 235); overlay->loadedRamAddr = GAME_STATE_ALLOC(&play->state, overlaySize, "../z_map_mark.c", 235);
LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236); LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236);
Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr); Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr);

View file

@ -848,7 +848,7 @@ void Message_HandleOcarina(PlayState* play) {
*/ */
void Message_DrawText(PlayState* play, Gfx** gfxP) { void Message_DrawText(PlayState* play, Gfx** gfxP) {
MessageContext* msgCtx = &play->msgCtx; MessageContext* msgCtx = &play->msgCtx;
u16 lookAheadCharacter; s16 pad;
u8 character; u8 character;
u16 j; u16 j;
u16 i; u16 i;
@ -928,15 +928,13 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) { msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) {
j = i; j = i;
while (true) { while (true) {
lookAheadCharacter = msgCtx->msgBufDecoded[j]; character = msgCtx->msgBufDecoded[j];
if (lookAheadCharacter == MESSAGE_SHIFT) { if (character == MESSAGE_SHIFT) {
j += 2; j += 2;
} else if ((lookAheadCharacter != MESSAGE_QUICKTEXT_DISABLE) && } else if ((character != MESSAGE_QUICKTEXT_DISABLE) && (character != MESSAGE_PERSISTENT) &&
(lookAheadCharacter != MESSAGE_PERSISTENT) && (character != MESSAGE_EVENT) && (character != MESSAGE_BOX_BREAK_DELAYED) &&
(lookAheadCharacter != MESSAGE_EVENT) && (character != MESSAGE_AWAIT_BUTTON_PRESS) && (character != MESSAGE_BOX_BREAK) &&
(lookAheadCharacter != MESSAGE_BOX_BREAK_DELAYED) && (character != MESSAGE_END)) {
(lookAheadCharacter != MESSAGE_AWAIT_BUTTON_PRESS) &&
(lookAheadCharacter != MESSAGE_BOX_BREAK) && (lookAheadCharacter != MESSAGE_END)) {
j++; j++;
} else { } else {
break; break;
@ -944,8 +942,6 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
} }
i = j - 1; i = j - 1;
msgCtx->textDrawPos = i + 1; msgCtx->textDrawPos = i + 1;
if (character) {}
} }
FALLTHROUGH; FALLTHROUGH;
case MESSAGE_QUICKTEXT_DISABLE: case MESSAGE_QUICKTEXT_DISABLE:
@ -1165,16 +1161,16 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) {
R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem32XOffsets[gSaveContext.language]; R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem32XOffsets[gSaveContext.language];
R_TEXTBOX_ICON_YPOS = y + ((44 - ITEM_ICON_HEIGHT) / 2); R_TEXTBOX_ICON_YPOS = y + ((44 - ITEM_ICON_HEIGHT) / 2);
R_TEXTBOX_ICON_DIMENSION = ITEM_ICON_WIDTH; // assumes the image is square R_TEXTBOX_ICON_DIMENSION = ITEM_ICON_WIDTH; // assumes the image is square
DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_ITEM_ICON_VROM(itemId), DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_ITEM_ICON_VROM(itemId), ITEM_ICON_SIZE,
ITEM_ICON_SIZE, "../z_message_PAL.c", 1473); "../z_message_PAL.c", 1473);
// "Item 32-0" // "Item 32-0"
osSyncPrintf("アイテム32-0\n"); osSyncPrintf("アイテム32-0\n");
} else { } else {
R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[gSaveContext.language]; R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[gSaveContext.language];
R_TEXTBOX_ICON_YPOS = y + ((44 - QUEST_ICON_HEIGHT) / 2); R_TEXTBOX_ICON_YPOS = y + ((44 - QUEST_ICON_HEIGHT) / 2);
R_TEXTBOX_ICON_DIMENSION = QUEST_ICON_WIDTH; // assumes the image is square R_TEXTBOX_ICON_DIMENSION = QUEST_ICON_WIDTH; // assumes the image is square
DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_QUEST_ICON_VROM(itemId), DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, GET_QUEST_ICON_VROM(itemId), QUEST_ICON_SIZE,
QUEST_ICON_SIZE, "../z_message_PAL.c", 1482); "../z_message_PAL.c", 1482);
// "Item 24" // "Item 24"
osSyncPrintf("アイテム24%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84); osSyncPrintf("アイテム24%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84);
} }
@ -1435,7 +1431,6 @@ void Message_Decode(PlayState* play) {
digits[2]++; digits[2]++;
digits[3] -= 10; digits[3] -= 10;
} }
if (curChar) {}
loadChar = false; loadChar = false;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
@ -1532,14 +1527,14 @@ void Message_Decode(PlayState* play) {
msgCtx->textboxBackgroundBackColorIdx = font->msgBuf[msgCtx->msgBufPos + 2] & 0xF; msgCtx->textboxBackgroundBackColorIdx = font->msgBuf[msgCtx->msgBufPos + 2] & 0xF;
msgCtx->textboxBackgroundYOffsetIdx = (font->msgBuf[msgCtx->msgBufPos + 3] & 0xF0) >> 4; msgCtx->textboxBackgroundYOffsetIdx = (font->msgBuf[msgCtx->msgBufPos + 3] & 0xF0) >> 4;
msgCtx->textboxBackgroundUnkArg = font->msgBuf[msgCtx->msgBufPos + 3] & 0xF; msgCtx->textboxBackgroundUnkArg = font->msgBuf[msgCtx->msgBufPos + 3] & 0xF;
DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE,
(uintptr_t)_message_texture_staticSegmentRomStart + (uintptr_t)_message_texture_staticSegmentRomStart +
msgCtx->textboxBackgroundIdx * MESSAGE_TEXTURE_STATIC_TEX_SIZE, msgCtx->textboxBackgroundIdx * MESSAGE_TEXTURE_STATIC_TEX_SIZE,
MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1830); MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1830);
DmaMgr_RequestSyncDebug(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + MESSAGE_TEXTURE_STATIC_TEX_SIZE, DMA_REQUEST_SYNC(msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + MESSAGE_TEXTURE_STATIC_TEX_SIZE,
(uintptr_t)_message_texture_staticSegmentRomStart + (uintptr_t)_message_texture_staticSegmentRomStart +
(msgCtx->textboxBackgroundIdx + 1) * MESSAGE_TEXTURE_STATIC_TEX_SIZE, (msgCtx->textboxBackgroundIdx + 1) * MESSAGE_TEXTURE_STATIC_TEX_SIZE,
MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1834); MESSAGE_TEXTURE_STATIC_TEX_SIZE, "../z_message_PAL.c", 1834);
msgCtx->msgBufPos += 3; msgCtx->msgBufPos += 3;
R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8; R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8;
numLines = 2; numLines = 2;
@ -1634,24 +1629,24 @@ void Message_OpenText(PlayState* play, u16 textId) {
if (sTextIsCredits) { if (sTextIsCredits) {
Message_FindCreditsMessage(play, textId); Message_FindCreditsMessage(play, textId);
msgCtx->msgLength = font->msgLength; msgCtx->msgLength = font->msgLength;
DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset, DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_staff_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1954); font->msgLength, "../z_message_PAL.c", 1954);
} else { } else {
if (gSaveContext.language == LANGUAGE_ENG) { if (gSaveContext.language == LANGUAGE_ENG) {
Message_FindMessage(play, textId); Message_FindMessage(play, textId);
msgCtx->msgLength = font->msgLength; msgCtx->msgLength = font->msgLength;
DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1966); font->msgLength, "../z_message_PAL.c", 1966);
} else if (gSaveContext.language == LANGUAGE_GER) { } else if (gSaveContext.language == LANGUAGE_GER) {
Message_FindMessage(play, textId); Message_FindMessage(play, textId);
msgCtx->msgLength = font->msgLength; msgCtx->msgLength = font->msgLength;
DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset, DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1978); font->msgLength, "../z_message_PAL.c", 1978);
} else { } else {
Message_FindMessage(play, textId); Message_FindMessage(play, textId);
msgCtx->msgLength = font->msgLength; msgCtx->msgLength = font->msgLength;
DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset, DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1990); font->msgLength, "../z_message_PAL.c", 1990);
} }
} }
msgCtx->textBoxProperties = font->charTexBuf[0]; msgCtx->textBoxProperties = font->charTexBuf[0];
@ -1661,10 +1656,10 @@ void Message_OpenText(PlayState* play, u16 textId) {
// "Text Box Type" // "Text Box Type"
osSyncPrintf("吹き出し種類=%d\n", msgCtx->textBoxType); osSyncPrintf("吹き出し種類=%d\n", msgCtx->textBoxType);
if (textBoxType < TEXTBOX_TYPE_NONE_BOTTOM) { if (textBoxType < TEXTBOX_TYPE_NONE_BOTTOM) {
DmaMgr_RequestSyncDebug(msgCtx->textboxSegment, DMA_REQUEST_SYNC(msgCtx->textboxSegment,
(uintptr_t)_message_staticSegmentRomStart + (uintptr_t)_message_staticSegmentRomStart +
(messageStaticIndices[textBoxType] * MESSAGE_STATIC_TEX_SIZE), (messageStaticIndices[textBoxType] * MESSAGE_STATIC_TEX_SIZE),
MESSAGE_STATIC_TEX_SIZE, "../z_message_PAL.c", 2006); MESSAGE_STATIC_TEX_SIZE, "../z_message_PAL.c", 2006);
if (textBoxType == TEXTBOX_TYPE_BLACK) { if (textBoxType == TEXTBOX_TYPE_BLACK) {
msgCtx->textboxColorRed = 0; msgCtx->textboxColorRed = 0;
msgCtx->textboxColorGreen = 0; msgCtx->textboxColorGreen = 0;

View file

@ -50,7 +50,7 @@ f32 OLib_ClampMaxDist(f32 val, f32 max) {
/** /**
* Takes the difference of points b and a, and creates a normal vector * Takes the difference of points b and a, and creates a normal vector
*/ */
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b) { Vec3f OLib_Vec3fDistNormalize(Vec3f* a, Vec3f* b) {
Vec3f v1; Vec3f v1;
Vec3f v2; Vec3f v2;
f32 dist; f32 dist;
@ -65,15 +65,13 @@ Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b) {
v2.y = v1.y / dist; v2.y = v1.y / dist;
v2.z = v1.z / dist; v2.z = v1.z / dist;
*dest = v2; return v2;
return dest;
} }
/** /**
* Takes the spherical coordinate `sph`, and converts it into a x,y,z position * Takes the spherical coordinate `sph`, and converts it into a x,y,z position
*/ */
Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) { Vec3f OLib_VecSphToVec3f(VecSph* sph) {
Vec3f v; Vec3f v;
f32 sinPitch; f32 sinPitch;
f32 cosPitch = Math_CosS(sph->pitch); f32 cosPitch = Math_CosS(sph->pitch);
@ -87,28 +85,26 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) {
v.y = sph->r * cosPitch; v.y = sph->r * cosPitch;
v.z = sph->r * sinPitch * cosYaw; v.z = sph->r * sinPitch * cosYaw;
*dest = v; return v;
return dest;
} }
/** /**
* Takes the geographic point `geo` and converts it into a x,y,z position * Takes the geographic point `geo` and converts it into a x,y,z position
*/ */
Vec3f* OLib_VecGeoToVec3f(Vec3f* dest, VecGeo* geo) { Vec3f OLib_VecGeoToVec3f(VecGeo* geo) {
VecSph sph; VecSph sph;
sph.r = geo->r; sph.r = geo->r;
sph.pitch = 0x3FFF - geo->pitch; sph.pitch = 0x3FFF - geo->pitch;
sph.yaw = geo->yaw; sph.yaw = geo->yaw;
return OLib_VecSphToVec3f(dest, &sph); return OLib_VecSphToVec3f(&sph);
} }
/** /**
* Takes the point `vec`, and converts it into a spherical coordinate * Takes the point `vec`, and converts it into a spherical coordinate
*/ */
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) { VecSph OLib_Vec3fToVecSph(Vec3f* vec) {
VecSph sph; VecSph sph;
f32 distXZSq = SQ(vec->x) + SQ(vec->z); f32 distXZSq = SQ(vec->x) + SQ(vec->z);
f32 distXZ = sqrtf(distXZSq); f32 distXZ = sqrtf(distXZSq);
@ -126,98 +122,88 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
sph.yaw = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(vec->x, vec->z))); sph.yaw = CAM_DEG_TO_BINANG(RAD_TO_DEG(Math_FAtan2F(vec->x, vec->z)));
} }
*dest = sph; return sph;
return dest;
} }
/** /**
* Takes the point `vec`, and converts it to a geographic coordinate * Takes the point `vec`, and converts it to a geographic coordinate
*/ */
VecGeo* OLib_Vec3fToVecGeo(VecGeo* dest, Vec3f* vec) { VecGeo OLib_Vec3fToVecGeo(Vec3f* vec) {
VecSph sph; VecSph sph;
OLib_Vec3fToVecSph(&sph, vec); sph = OLib_Vec3fToVecSph(vec);
sph.pitch = 0x3FFF - sph.pitch; sph.pitch = 0x3FFF - sph.pitch;
*dest = sph; return sph;
return dest;
} }
/** /**
* Takes the differences of positions `a` and `b`, and converts them to spherical coordinates * Takes the differences of positions `a` and `b`, and converts them to spherical coordinates
*/ */
VecSph* OLib_Vec3fDiffToVecSph(VecSph* dest, Vec3f* a, Vec3f* b) { VecSph OLib_Vec3fDiffToVecSph(Vec3f* a, Vec3f* b) {
Vec3f diff; Vec3f diff;
diff.x = b->x - a->x; diff.x = b->x - a->x;
diff.y = b->y - a->y; diff.y = b->y - a->y;
diff.z = b->z - a->z; diff.z = b->z - a->z;
return OLib_Vec3fToVecSph(dest, &diff); return OLib_Vec3fToVecSph(&diff);
} }
/** /**
* Takes the difference of positions `a` and `b`, and converts them to geographic coordinates * Takes the difference of positions `a` and `b`, and converts them to geographic coordinates
*/ */
VecGeo* OLib_Vec3fDiffToVecGeo(VecGeo* dest, Vec3f* a, Vec3f* b) { VecGeo OLib_Vec3fDiffToVecGeo(Vec3f* a, Vec3f* b) {
Vec3f diff; Vec3f diff;
diff.x = b->x - a->x; diff.x = b->x - a->x;
diff.y = b->y - a->y; diff.y = b->y - a->y;
diff.z = b->z - a->z; diff.z = b->z - a->z;
return OLib_Vec3fToVecGeo(dest, &diff); return OLib_Vec3fToVecGeo(&diff);
} }
/** /**
* Gets the pitch/yaw of the vector formed from `b`-`a`, result is in radians * Gets the pitch/yaw of the vector formed from `b`-`a`, result is in radians
*/ */
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b) { Vec3f OLib_Vec3fDiffRad(Vec3f* a, Vec3f* b) {
Vec3f anglesRad; Vec3f anglesRad;
anglesRad.x = Math_FAtan2F(b->z - a->z, b->y - a->y); anglesRad.x = Math_FAtan2F(b->z - a->z, b->y - a->y);
anglesRad.y = Math_FAtan2F(b->x - a->x, b->z - a->z); anglesRad.y = Math_FAtan2F(b->x - a->x, b->z - a->z);
anglesRad.z = 0; anglesRad.z = 0;
*dest = anglesRad; return anglesRad;
return dest;
} }
/** /**
* Gets the pitch/yaw of the vector formed from `b`-`a`, result is in degrees * Gets the pitch/yaw of the vector formed from `b`-`a`, result is in degrees
*/ */
Vec3f* OLib_Vec3fDiffDegF(Vec3f* dest, Vec3f* a, Vec3f* b) { Vec3f OLib_Vec3fDiffDegF(Vec3f* a, Vec3f* b) {
Vec3f anglesRad; Vec3f anglesRad;
Vec3f anglesDegrees; Vec3f anglesDegrees;
OLib_Vec3fDiffRad(&anglesRad, a, b); anglesRad = OLib_Vec3fDiffRad(a, b);
anglesDegrees.x = RAD_TO_DEG(anglesRad.x); anglesDegrees.x = RAD_TO_DEG(anglesRad.x);
anglesDegrees.y = RAD_TO_DEG(anglesRad.y); anglesDegrees.y = RAD_TO_DEG(anglesRad.y);
anglesDegrees.z = 0.0f; anglesDegrees.z = 0.0f;
*dest = anglesDegrees; return anglesDegrees;
return dest;
} }
/** /**
* Gets the pitch/yaw of the vector formed from `b`-`a`, result is in binary degrees * Gets the pitch/yaw of the vector formed from `b`-`a`, result is in binary degrees
*/ */
Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b) { Vec3s OLib_Vec3fDiffBinAng(Vec3f* a, Vec3f* b) {
Vec3f anglesRad; Vec3f anglesRad;
Vec3s anglesBinAng; Vec3s anglesBinAng;
OLib_Vec3fDiffRad(&anglesRad, a, b); anglesRad = OLib_Vec3fDiffRad(a, b);
anglesBinAng.x = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.x)); anglesBinAng.x = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.x));
anglesBinAng.y = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.y)); anglesBinAng.y = CAM_DEG_TO_BINANG(RAD_TO_DEG(anglesRad.y));
anglesBinAng.z = 0.0f; anglesBinAng.z = 0.0f;
*dest = anglesBinAng; return anglesBinAng;
return dest;
} }

View file

@ -9,19 +9,15 @@ static s32 sPrevFrameCs1100 = -4096;
#include "z_onepointdemo_data.inc.c" #include "z_onepointdemo_data.inc.c"
Vec3f* OnePointCutscene_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) { Vec3f OnePointCutscene_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) {
Vec3f sum; Vec3f sum;
Vec3f b; Vec3f b = OLib_VecGeoToVec3f(geo);
OLib_VecGeoToVec3f(&b, geo);
sum.x = a->x + b.x; sum.x = a->x + b.x;
sum.y = a->y + b.y; sum.y = a->y + b.y;
sum.z = a->z + b.z; sum.z = a->z + b.z;
*dest = sum; return sum;
return dest;
} }
s16 OnePointCutscene_Vec3fYaw(Vec3f* vec1, Vec3f* vec2) { s16 OnePointCutscene_Vec3fYaw(Vec3f* vec1, Vec3f* vec2) {
@ -98,7 +94,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_80120964[0].atTargetInit = play->view.at; D_80120964[0].atTargetInit = play->view.at;
D_80120964[0].eyeTargetInit = play->view.eye; D_80120964[0].eyeTargetInit = play->view.eye;
D_80120964[0].fovTargetInit = play->view.fovy; D_80120964[0].fovTargetInit = play->view.fovy;
OLib_Vec3fDiffToVecGeo(&spD0, &mainCam->at, &mainCam->eye); spD0 = OLib_Vec3fDiffToVecGeo(&mainCam->at, &mainCam->eye);
D_80120964[1].eyeTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw); D_80120964[1].eyeTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
D_80120964[1].timerInit = timer - 1; D_80120964[1].timerInit = timer - 1;
@ -112,9 +108,9 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_801209B4[0].atTargetInit = D_801209B4[1].atTargetInit = play->view.at; D_801209B4[0].atTargetInit = D_801209B4[1].atTargetInit = play->view.at;
D_801209B4[0].eyeTargetInit = play->view.eye; D_801209B4[0].eyeTargetInit = play->view.eye;
D_801209B4[0].fovTargetInit = D_801209B4[2].fovTargetInit = play->view.fovy; D_801209B4[0].fovTargetInit = D_801209B4[2].fovTargetInit = play->view.fovy;
OLib_Vec3fDiffToVecGeo(&spD0, &actor->focus.pos, &mainCam->at); spD0 = OLib_Vec3fDiffToVecGeo(&actor->focus.pos, &mainCam->at);
spD0.r = mainCam->dist; spD0.r = mainCam->dist;
OnePointCutscene_AddVecGeoToVec3f(&D_801209B4[1].eyeTargetInit, &D_801209B4[1].atTargetInit, &spD0); D_801209B4[1].eyeTargetInit = OnePointCutscene_AddVecGeoToVec3f(&D_801209B4[1].atTargetInit, &spD0);
D_801209B4[1].atTargetInit.y += 20.0f; D_801209B4[1].atTargetInit.y += 20.0f;
csInfo->keyFrames = D_801209B4; csInfo->keyFrames = D_801209B4;
@ -310,15 +306,15 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 4500: case 4500:
Actor_GetFocus(&spA0, actor); spA0 = Actor_GetFocus(actor);
spC0 = spA0.pos; spC0 = spA0.pos;
spC0.y = OnePointCutscene_RaycastDown(&play->colCtx, &spC0) + 40.0f; spC0.y = OnePointCutscene_RaycastDown(&play->colCtx, &spC0) + 40.0f;
spD0.r = 150.0f; spD0.r = 150.0f;
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.pitch = 0x3E8; spD0.pitch = 0x3E8;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
subCam->roll = 0; subCam->roll = 0;
@ -329,7 +325,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 2210: case 2210:
OLib_Vec3fDiffToVecGeo(&spD0, &player->actor.world.pos, &actor->world.pos); spD0 = OLib_Vec3fDiffToVecGeo(&player->actor.world.pos, &actor->world.pos);
D_801213B4[0].eyeTargetInit.y = D_801213B4[1].eyeTargetInit.y = D_801213B4[2].eyeTargetInit.y = D_801213B4[0].eyeTargetInit.y = D_801213B4[1].eyeTargetInit.y = D_801213B4[2].eyeTargetInit.y =
D_801213B4[2].atTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw); D_801213B4[2].atTargetInit.y = CAM_BINANG_TO_DEG(spD0.yaw);
if (Rand_ZeroOne() < 0.0f) { if (Rand_ZeroOne() < 0.0f) {
@ -344,22 +340,22 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 1010: case 1010:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &childCam->at, &childCam->eye); Play_SetCameraAtEye(play, subCamId, &childCam->at, &childCam->eye);
Play_SetCameraFov(play, subCamId, childCam->fov); Play_SetCameraFov(play, subCamId, childCam->fov);
Play_SetCameraRoll(play, subCamId, childCam->roll); Play_SetCameraRoll(play, subCamId, childCam->roll);
break; break;
case 9601: // Leaving a crawlspace forwards case 9601: // Leaving a crawlspace forwards
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Play_ChangeCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting); Play_RequestCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting);
OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer, OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer,
sCrawlspaceAtPoints, sCrawlspaceForwardsEyePoints); sCrawlspaceAtPoints, sCrawlspaceForwardsEyePoints);
break; break;
case 9602: // Leaving a crawlspace backwards case 9602: // Leaving a crawlspace backwards
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Play_ChangeCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting); Play_RequestCameraSetting(play, CAM_ID_MAIN, mainCam->prevSetting);
OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer, OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer,
sCrawlspaceAtPoints, sCrawlspaceBackwardsEyePoints); sCrawlspaceAtPoints, sCrawlspaceBackwardsEyePoints);
break; break;
@ -378,7 +374,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spB4.x = -1979.0f; spB4.x = -1979.0f;
spB4.y = 703.0f; spB4.y = 703.0f;
spB4.z = -269.0f; spB4.z = -269.0f;
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 6; subCam->roll = 6;
subCam->fov = 75.0f; subCam->fov = 75.0f;
@ -454,7 +450,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
case 3100: case 3100:
VEC_SET(spB4, 0.0f, -280.0f, -1400.0f); VEC_SET(spB4, 0.0f, -280.0f, -1400.0f);
Actor_GetFocus(&spA0, actor); spA0 = Actor_GetFocus(actor);
spC0 = spA0.pos; spC0 = spA0.pos;
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_PIVOT_VERTICAL); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_PIVOT_VERTICAL);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
@ -486,7 +482,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3050: case 3050:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Player_SetCsActionWithHaltedActors(play, &player->actor, PLAYER_CSACTION_5); Player_SetCsActionWithHaltedActors(play, &player->actor, PLAYER_CSACTION_5);
OnePointCutscene_SetCsCamPoints(subCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C); OnePointCutscene_SetCsCamPoints(subCam, D_80120304 | 0x2000, D_80120300, D_8012013C, D_8012021C);
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
@ -514,7 +510,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
case 3120: case 3120:
csInfo->keyFrames = D_80121954[-(timer + 101)]; csInfo->keyFrames = D_80121954[-(timer + 101)];
subCam->timer = 100; subCam->timer = 100;
subCam->stateFlags |= CAM_STATE_1; subCam->stateFlags |= CAM_STATE_CHECK_WATER;
csInfo->keyFrameCount = ARRAY_COUNT(D_80121954[0]); csInfo->keyFrameCount = ARRAY_COUNT(D_80121954[0]);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
@ -527,7 +523,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
subCam->stateFlags |= CAM_STATE_1; subCam->stateFlags |= CAM_STATE_CHECK_WATER;
break; break;
case 3140: case 3140:
@ -548,7 +544,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spB4.x = 1729.0f; spB4.x = 1729.0f;
spB4.y = 995.0f; spB4.y = 995.0f;
spB4.z = -1405.0f; spB4.z = -1405.0f;
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0x50; subCam->roll = 0x50;
subCam->fov = 55.0f; subCam->fov = 55.0f;
@ -556,15 +552,15 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3170: case 3170:
Actor_GetWorld(&spA0, actor); spA0 = Actor_GetWorld(actor);
spC0 = spA0.pos; spC0 = spA0.pos;
spD0.pitch = -0x5DC; spD0.pitch = -0x5DC;
spC0.y += 50.0f; spC0.y += 50.0f;
spD0.r = 250.0f; spD0.r = 250.0f;
Actor_GetWorld(&spA0, &player->actor); spA0 = Actor_GetWorld(&player->actor);
spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0; spD0.yaw = OnePointCutscene_Vec3fYaw(&spC0, &spA0.pos) - 0x7D0;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
Play_CopyCamera(play, CAM_ID_MAIN, subCamId); Play_CopyCamera(play, CAM_ID_MAIN, subCamId);
subCam->roll = -1; subCam->roll = -1;
@ -573,13 +569,13 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3160: case 3160:
Actor_GetWorld(&spA0, actor); spA0 = Actor_GetWorld(actor);
spC0 = spA0.pos; spC0 = spA0.pos;
spD0.pitch = 0; spD0.pitch = 0;
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.r = 150.0f; spD0.r = 150.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
subCam->fov = 55.0f; subCam->fov = 55.0f;
@ -587,14 +583,14 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3180: case 3180:
Actor_GetWorldPosShapeRot(&spA0, actor); spA0 = Actor_GetWorldPosShapeRot(actor);
spC0 = spA0.pos; spC0 = spA0.pos;
spC0.y += 120.0f; spC0.y += 120.0f;
spD0.r = 300.0f; spD0.r = 300.0f;
spD0.yaw = spA0.rot.y; spD0.yaw = spA0.rot.y;
spD0.pitch = -0xAF0; spD0.pitch = -0xAF0;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
subCam->fov = 60.0f; subCam->fov = 60.0f;
@ -602,8 +598,8 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3190: case 3190:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FOREST_DEFEAT_POE); Play_RequestCameraSetting(play, subCamId, CAM_SET_FOREST_DEFEAT_POE);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Player_SetCsAction(play, actor, PLAYER_CSACTION_12); Player_SetCsAction(play, actor, PLAYER_CSACTION_12);
break; break;
@ -614,20 +610,20 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
spB4.x = 80.0f; spB4.x = 80.0f;
spB4.y = 445.0f; spB4.y = 445.0f;
spB4.z = -1425.0f; spB4.z = -1425.0f;
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0x1E; subCam->roll = 0x1E;
subCam->fov = 75.0f; subCam->fov = 75.0f;
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
Actor_GetWorldPosShapeRot(&spA0, actor); spA0 = Actor_GetWorldPosShapeRot(actor);
Actor_GetFocus(&sp8C, &player->actor); sp8C = Actor_GetFocus(&player->actor);
spC0.x = sp8C.pos.x; spC0.x = sp8C.pos.x;
spC0.y = sp8C.pos.y + 70.0f; spC0.y = sp8C.pos.y + 70.0f;
spC0.z = sp8C.pos.z; spC0.z = sp8C.pos.z;
OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &sp8C.pos); spD0 = OLib_Vec3fDiffToVecGeo(&spA0.pos, &sp8C.pos);
spD0.pitch = 0x5DC; spD0.pitch = 0x5DC;
spD0.r = 120.0f; spD0.r = 120.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_SetCameraAtEye(play, CAM_ID_MAIN, &spC0, &spB4); Play_SetCameraAtEye(play, CAM_ID_MAIN, &spC0, &spB4);
i = Quake_Request(subCam, QUAKE_TYPE_3); i = Quake_Request(subCam, QUAKE_TYPE_3);
@ -637,14 +633,14 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 6010: case 6010:
Actor_GetWorld(&spA0, actor); spA0 = Actor_GetWorld(actor);
spC0 = spA0.pos; spC0 = spA0.pos;
spD0.pitch = 0; spD0.pitch = 0;
spC0.y += 70.0f; spC0.y += 70.0f;
spD0.yaw = spA0.rot.y + 0x7FFF; spD0.yaw = spA0.rot.y + 0x7FFF;
spD0.r = 300.0f; spD0.r = 300.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
subCam->fov = 45.0f; subCam->fov = 45.0f;
@ -652,14 +648,14 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3220: case 3220:
Actor_GetFocus(&spA0, actor); spA0 = Actor_GetFocus(actor);
spC0 = spA0.pos; spC0 = spA0.pos;
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_PIVOT_VERTICAL); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_PIVOT_VERTICAL);
Actor_GetWorld(&spA0, &player->actor); spA0 = Actor_GetWorld(&player->actor);
OLib_Vec3fDiffToVecGeo(&spD0, &spC0, &spA0.pos); spD0 = OLib_Vec3fDiffToVecGeo(&spC0, &spA0.pos);
spD0.yaw += 0x3E8; spD0.yaw += 0x3E8;
spD0.r = 400.0f; spD0.r = 400.0f;
OnePointCutscene_AddVecGeoToVec3f(&spB4, &spC0, &spD0); spB4 = OnePointCutscene_AddVecGeoToVec3f(&spC0, &spD0);
spB4.y = spA0.pos.y + 60.0f; spB4.y = spA0.pos.y + 60.0f;
Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); Play_SetCameraAtEye(play, subCamId, &spC0, &spB4);
subCam->roll = 0; subCam->roll = 0;
@ -679,9 +675,9 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 6001: case 6001:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Actor_GetWorld(&spA0, actor); spA0 = Actor_GetWorld(actor);
if (spA0.pos.z > -750.0f) { if (spA0.pos.z > -750.0f) {
OnePointCutscene_SetCsCamPoints(subCam, D_801208E8, D_801208E4, D_801206A0, D_80120820); OnePointCutscene_SetCsCamPoints(subCam, D_801208E8, D_801208E4, D_801206A0, D_80120820);
} else { } else {
@ -695,7 +691,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3400: case 3400:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_CS_3); Play_RequestCameraSetting(play, subCamId, CAM_SET_CS_3);
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
OnePointCutscene_SetCsCamPoints(subCam, D_8012069C | 0x2000, D_80120698, D_801204D4, D_801205B4); OnePointCutscene_SetCsCamPoints(subCam, D_8012069C | 0x2000, D_80120698, D_801204D4, D_801205B4);
OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_801205B4[D_80120694 - 2].pos); OnePointCutscene_Vec3sToVec3f(&mainCam->eye, &D_801205B4[D_80120694 - 2].pos);
@ -718,7 +714,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 3310: case 3310:
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FIRE_STAIRCASE); Play_RequestCameraSetting(play, subCamId, CAM_SET_FIRE_STAIRCASE);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Play_CopyCamera(play, subCamId, CAM_ID_MAIN); Play_CopyCamera(play, subCamId, CAM_ID_MAIN);
@ -732,7 +728,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
D_80121F1C[0].atTargetInit = play->view.at; D_80121F1C[0].atTargetInit = play->view.at;
D_80121F1C[0].eyeTargetInit = play->view.eye; D_80121F1C[0].eyeTargetInit = play->view.eye;
D_80121F1C[0].fovTargetInit = play->view.fovy; D_80121F1C[0].fovTargetInit = play->view.fovy;
Actor_GetFocus(&spA0, actor); spA0 = Actor_GetFocus(actor);
player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = spA0.rot.y; player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = spA0.rot.y;
csInfo->keyFrames = D_80121F1C; csInfo->keyFrames = D_80121F1C;
@ -884,7 +880,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_801227B4); csInfo->keyFrameCount = ARRAY_COUNT(D_801227B4);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
break; break;
case 4150: case 4150:
@ -892,7 +888,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_801228A4); csInfo->keyFrameCount = ARRAY_COUNT(D_801228A4);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -901,7 +897,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_8012296C); csInfo->keyFrameCount = ARRAY_COUNT(D_8012296C);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -910,7 +906,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_80122A0C); csInfo->keyFrameCount = ARRAY_COUNT(D_80122A0C);
Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8); Player_SetCsActionWithHaltedActors(play, NULL, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -919,7 +915,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_80122A5C); csInfo->keyFrameCount = ARRAY_COUNT(D_80122A5C);
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -928,7 +924,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
csInfo->keyFrameCount = ARRAY_COUNT(D_80122B9C); csInfo->keyFrameCount = ARRAY_COUNT(D_80122B9C);
Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8); Player_SetCsAction(play, &player->actor, PLAYER_CSACTION_8);
Camera_ChangeMode(mainCam, CAM_MODE_NORMAL); Camera_RequestMode(mainCam, CAM_MODE_NORMAL);
Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C);
break; break;
@ -1002,8 +998,8 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
break; break;
case 8700: case 8700:
Actor_GetFocus(&spA0, actor); spA0 = Actor_GetFocus(actor);
Actor_GetFocus(&sp8C, &player->actor); sp8C = Actor_GetFocus(&player->actor);
D_80122E44[timer & 1][0].atTargetInit.y = ((spA0.pos.y - sp8C.pos.y) / 10.0f) + 90.0f; D_80122E44[timer & 1][0].atTargetInit.y = ((spA0.pos.y - sp8C.pos.y) / 10.0f) + 90.0f;
D_80122E44[timer & 1][5].atTargetInit = mainCam->at; D_80122E44[timer & 1][5].atTargetInit = mainCam->at;
@ -1041,7 +1037,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
subCam->data2 = 0xC; subCam->data2 = 0xC;
} else { } else {
Play_CopyCamera(play, subCamId, CAM_ID_MAIN); Play_CopyCamera(play, subCamId, CAM_ID_MAIN);
Play_ChangeCameraSetting(play, subCamId, CAM_SET_FREE2); Play_RequestCameraSetting(play, subCamId, CAM_SET_FREE2);
} }
break; break;
@ -1052,13 +1048,13 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
if (player->stateFlags1 & PLAYER_STATE1_27) { if (player->stateFlags1 & PLAYER_STATE1_27) {
D_801231B4[2].atTargetInit.z = 0.0f; D_801231B4[2].atTargetInit.z = 0.0f;
} }
Actor_GetWorldPosShapeRot(&spA0, &player->actor); spA0 = Actor_GetWorldPosShapeRot(&player->actor);
OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &mainCam->at); spD0 = OLib_Vec3fDiffToVecGeo(&spA0.pos, &mainCam->at);
spD0.yaw -= spA0.rot.y; spD0.yaw -= spA0.rot.y;
OLib_VecGeoToVec3f(&D_801231B4[3].atTargetInit, &spD0); D_801231B4[3].atTargetInit = OLib_VecGeoToVec3f(&spD0);
OLib_Vec3fDiffToVecGeo(&spD0, &spA0.pos, &mainCam->eye); spD0 = OLib_Vec3fDiffToVecGeo(&spA0.pos, &mainCam->eye);
spD0.yaw -= spA0.rot.y; spD0.yaw -= spA0.rot.y;
OLib_VecGeoToVec3f(&D_801231B4[3].eyeTargetInit, &spD0); D_801231B4[3].eyeTargetInit = OLib_VecGeoToVec3f(&spD0);
D_801231B4[3].fovTargetInit = mainCam->fov; D_801231B4[3].fovTargetInit = mainCam->fov;
D_801231B4[3].timerInit = timer - 50; D_801231B4[3].timerInit = timer - 50;
@ -1358,7 +1354,7 @@ s32 OnePointCutscene_Attention(PlayState* play, Actor* actor) {
parentCam = play->cameraPtrs[CAM_ID_MAIN]; parentCam = play->cameraPtrs[CAM_ID_MAIN];
if (parentCam->mode == CAM_MODE_FOLLOW_BOOMERANG) { if (parentCam->mode == CAM_MODE_FOLLOW_BOOMERANG) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "actor attention demo camera: change mode BOOKEEPON -> NORMAL\n" VT_RST); osSyncPrintf(VT_COL(YELLOW, BLACK) "actor attention demo camera: change mode BOOKEEPON -> NORMAL\n" VT_RST);
Camera_ChangeMode(parentCam, CAM_MODE_NORMAL); Camera_RequestMode(parentCam, CAM_MODE_NORMAL);
} }
// Finds the camera of the first actor attention demo with a lower category actor, or the first non-attention demo // Finds the camera of the first actor attention demo with a lower category actor, or the first non-attention demo

View file

@ -1307,9 +1307,9 @@ void Interface_LoadItemIcon1(PlayState* play, u16 button) {
InterfaceContext* interfaceCtx = &play->interfaceCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE), DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_160, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0, GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0,
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171); &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
} }
@ -1317,9 +1317,9 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) {
InterfaceContext* interfaceCtx = &play->interfaceCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE), DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_180, interfaceCtx->iconItemSegment + (button * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0, GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[button]), ITEM_ICON_SIZE, 0,
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193); &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
} }
@ -2120,10 +2120,10 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l
(action != LANGUAGE_GER * DO_ACTION_MAX + DO_ACTION_NONE) && (action != LANGUAGE_GER * DO_ACTION_MAX + DO_ACTION_NONE) &&
(action != LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_NONE)) { (action != LANGUAGE_FRA * DO_ACTION_MAX + DO_ACTION_NONE)) {
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_160,
interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE), interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), (uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE),
DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145); DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
} else { } else {
gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment); gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment);
@ -2184,9 +2184,9 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) {
interfaceCtx->unk_1FC = action; interfaceCtx->unk_1FC = action;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
DmaMgr_RequestAsync(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE, DMA_REQUEST_ASYNC(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE, (uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228); 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
interfaceCtx->unk_1FA = true; interfaceCtx->unk_1FA = true;
@ -2990,8 +2990,7 @@ void Interface_DrawActionButton(PlayState* play) {
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_parameter.c", 3177), gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_parameter.c", 3177), G_MTX_MODELVIEW | G_MTX_LOAD);
G_MTX_MODELVIEW | G_MTX_LOAD);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0);
gDPLoadTextureBlock(OVERLAY_DISP++, gButtonBackgroundTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, gDPLoadTextureBlock(OVERLAY_DISP++, gButtonBackgroundTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
@ -3007,7 +3006,7 @@ void Interface_InitVertices(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx;
s16 i; s16 i;
interfaceCtx->actionVtx = Graph_Alloc(play->state.gfxCtx, 8 * sizeof(Vtx)); interfaceCtx->actionVtx = GRAPH_ALLOC(play->state.gfxCtx, 8 * sizeof(Vtx));
interfaceCtx->actionVtx[0].v.ob[0] = interfaceCtx->actionVtx[2].v.ob[0] = -14; interfaceCtx->actionVtx[0].v.ob[0] = interfaceCtx->actionVtx[2].v.ob[0] = -14;
interfaceCtx->actionVtx[1].v.ob[0] = interfaceCtx->actionVtx[3].v.ob[0] = interfaceCtx->actionVtx[0].v.ob[0] + 28; interfaceCtx->actionVtx[1].v.ob[0] = interfaceCtx->actionVtx[3].v.ob[0] = interfaceCtx->actionVtx[0].v.ob[0] + 28;
@ -3049,7 +3048,7 @@ void Interface_InitVertices(PlayState* play) {
interfaceCtx->actionVtx[5].v.tc[0] = interfaceCtx->actionVtx[7].v.tc[0] = 1536; interfaceCtx->actionVtx[5].v.tc[0] = interfaceCtx->actionVtx[7].v.tc[0] = 1536;
interfaceCtx->actionVtx[6].v.tc[1] = interfaceCtx->actionVtx[7].v.tc[1] = 512; interfaceCtx->actionVtx[6].v.tc[1] = interfaceCtx->actionVtx[7].v.tc[1] = 512;
interfaceCtx->beatingHeartVtx = Graph_Alloc(play->state.gfxCtx, 4 * sizeof(Vtx)); interfaceCtx->beatingHeartVtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Vtx));
interfaceCtx->beatingHeartVtx[0].v.ob[0] = interfaceCtx->beatingHeartVtx[2].v.ob[0] = -8; interfaceCtx->beatingHeartVtx[0].v.ob[0] = interfaceCtx->beatingHeartVtx[2].v.ob[0] = -8;
interfaceCtx->beatingHeartVtx[1].v.ob[0] = interfaceCtx->beatingHeartVtx[3].v.ob[0] = 8; interfaceCtx->beatingHeartVtx[1].v.ob[0] = interfaceCtx->beatingHeartVtx[3].v.ob[0] = 8;
@ -3358,7 +3357,7 @@ void Interface_Draw(PlayState* play) {
Matrix_Translate(0.0f, 0.0f, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW); Matrix_Translate(0.0f, 0.0f, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_parameter.c", 3701), gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_parameter.c", 3701),
G_MTX_MODELVIEW | G_MTX_LOAD); G_MTX_MODELVIEW | G_MTX_LOAD);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0);

View file

@ -25,8 +25,8 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
} \ } \
} while (0) } while (0)
void Play_ChangeViewpointBgCamIndex(PlayState* this) { void Play_RequestViewpointBgCam(PlayState* this) {
Camera_ChangeBgCamIndex(GET_ACTIVE_CAM(this), this->viewpoint - 1); Camera_RequestBgCam(GET_ACTIVE_CAM(this), this->viewpoint - 1);
} }
void Play_SetViewpoint(PlayState* this, s16 viewpoint) { void Play_SetViewpoint(PlayState* this, s16 viewpoint) {
@ -42,7 +42,7 @@ void Play_SetViewpoint(PlayState* this, s16 viewpoint) {
&gSfxDefaultReverb); &gSfxDefaultReverb);
} }
Play_ChangeViewpointBgCamIndex(this); Play_RequestViewpointBgCam(this);
} }
/** /**
@ -255,8 +255,9 @@ void Play_Init(GameState* thisx) {
this->cameraPtrs[CAM_ID_MAIN] = &this->mainCamera; this->cameraPtrs[CAM_ID_MAIN] = &this->mainCamera;
this->cameraPtrs[CAM_ID_MAIN]->uid = 0; this->cameraPtrs[CAM_ID_MAIN]->uid = 0;
this->activeCamId = CAM_ID_MAIN; this->activeCamId = CAM_ID_MAIN;
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_0 | CAM_STATE_1 | CAM_STATE_2 | CAM_STATE_3 | CAM_STATE_4 | Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_CHECK_BG_ALT | CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG |
CAM_STATE_5 | CAM_STATE_6 | CAM_STATE_7); CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_CAM_FUNC_FINISH |
CAM_STATE_LOCK_MODE | CAM_STATE_DISTORTION | CAM_STATE_PLAY_INIT);
Sram_Init(this, &this->sramCtx); Sram_Init(this, &this->sramCtx);
Regs_InitData(this); Regs_InitData(this);
Message_Init(this); Message_Init(this);
@ -396,7 +397,7 @@ void Play_Init(GameState* thisx) {
osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetRemaining(&this->state.tha)); osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetRemaining(&this->state.tha));
zAllocSize = THA_GetRemaining(&this->state.tha); zAllocSize = THA_GetRemaining(&this->state.tha);
zAlloc = (uintptr_t)GameState_Alloc(&this->state, zAllocSize, "../z_play.c", 2918); zAlloc = (uintptr_t)GAME_STATE_ALLOC(&this->state, zAllocSize, "../z_play.c", 2918);
zAllocAligned = (zAlloc + 8) & ~0xF; zAllocAligned = (zAlloc + 8) & ~0xF;
ZeldaArena_Init((void*)zAllocAligned, zAllocSize - (zAllocAligned - zAlloc)); ZeldaArena_Init((void*)zAllocAligned, zAllocSize - (zAllocAligned - zAlloc));
// "Zelda Heap" // "Zelda Heap"
@ -412,12 +413,12 @@ void Play_Init(GameState* thisx) {
player = GET_PLAYER(this); player = GET_PLAYER(this);
Camera_InitDataUsingPlayer(&this->mainCamera, player); Camera_InitDataUsingPlayer(&this->mainCamera, player);
Camera_ChangeMode(&this->mainCamera, CAM_MODE_NORMAL); Camera_RequestMode(&this->mainCamera, CAM_MODE_NORMAL);
playerStartBgCamIndex = player->actor.params & 0xFF; playerStartBgCamIndex = player->actor.params & 0xFF;
if (playerStartBgCamIndex != 0xFF) { if (playerStartBgCamIndex != 0xFF) {
osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex); osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex);
Camera_ChangeBgCamIndex(&this->mainCamera, playerStartBgCamIndex); Camera_RequestBgCam(&this->mainCamera, playerStartBgCamIndex);
} }
if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) { if (R_SCENE_CAM_TYPE == SCENE_CAM_TYPE_FIXED_TOGGLE_VIEWPOINT) {
@ -943,7 +944,7 @@ void Play_Update(PlayState* this) {
} }
} }
Play_ChangeViewpointBgCamIndex(this); Play_RequestViewpointBgCam(this);
} }
PLAY_LOG(3708); PLAY_LOG(3708);
@ -1076,8 +1077,8 @@ void Play_Draw(PlayState* this) {
this->billboardMtxF.mf[3][0] = this->billboardMtxF.mf[3][1] = this->billboardMtxF.mf[3][2] = 0.0f; this->billboardMtxF.mf[3][0] = this->billboardMtxF.mf[3][1] = this->billboardMtxF.mf[3][2] = 0.0f;
// This transpose is where the viewing matrix is properly converted into a billboard matrix // This transpose is where the viewing matrix is properly converted into a billboard matrix
Matrix_Transpose(&this->billboardMtxF); Matrix_Transpose(&this->billboardMtxF);
this->billboardMtx = Matrix_MtxFToMtx(Matrix_CheckFloats(&this->billboardMtxF, "../z_play.c", 4005), this->billboardMtx = Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(&this->billboardMtxF, "../z_play.c", 4005),
Graph_Alloc(gfxCtx, sizeof(Mtx))); GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx); gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx);
@ -1199,7 +1200,7 @@ void Play_Draw(PlayState* this) {
(GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) { (GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) {
Vec3f quakeOffset; Vec3f quakeOffset;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(this)); quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(this));
Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + quakeOffset.x, Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + quakeOffset.x,
this->view.eye.y + quakeOffset.y, this->view.eye.z + quakeOffset.z); this->view.eye.y + quakeOffset.y, this->view.eye.z + quakeOffset.z);
} }
@ -1412,8 +1413,8 @@ void* Play_LoadFile(PlayState* this, RomFile* file) {
void* allocp; void* allocp;
size = file->vromEnd - file->vromStart; size = file->vromEnd - file->vromStart;
allocp = GameState_Alloc(&this->state, size, "../z_play.c", 4692); allocp = GAME_STATE_ALLOC(&this->state, size, "../z_play.c", 4692);
DmaMgr_RequestSyncDebug(allocp, file->vromStart, size, "../z_play.c", 4694); DMA_REQUEST_SYNC(allocp, file->vromStart, size, "../z_play.c", 4694);
return allocp; return allocp;
} }
@ -1447,6 +1448,7 @@ void Play_InitScene(PlayState* this, s32 spawn) {
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) { void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
SceneTableEntry* scene = &gSceneTable[sceneId]; SceneTableEntry* scene = &gSceneTable[sceneId];
u32 size;
scene->unk_13 = 0; scene->unk_13 = 0;
this->loadedScene = scene; this->loadedScene = scene;
@ -1463,7 +1465,9 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
Play_InitScene(this, spawn); Play_InitScene(this, spawn);
osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(this, &this->roomCtx) / 1024.0f); size = func_80096FE8(this, &this->roomCtx);
osSyncPrintf("ROOM SIZE=%fK\n", size / 1024.0f);
} }
void Play_GetScreenPos(PlayState* this, Vec3f* src, Vec3f* dest) { void Play_GetScreenPos(PlayState* this, Vec3f* src, Vec3f* dest) {
@ -1640,11 +1644,11 @@ s32 Play_InitCameraDataUsingPlayer(PlayState* this, s16 camId, Player* player, s
camera = this->cameraPtrs[camIdx]; camera = this->cameraPtrs[camIdx];
Camera_InitDataUsingPlayer(camera, player); Camera_InitDataUsingPlayer(camera, player);
return Camera_ChangeSetting(camera, setting); return Camera_RequestSetting(camera, setting);
} }
s32 Play_ChangeCameraSetting(PlayState* this, s16 camId, s16 setting) { s32 Play_RequestCameraSetting(PlayState* this, s16 camId, s16 setting) {
return Camera_ChangeSetting(Play_GetCamera(this, camId), setting); return Camera_RequestSetting(Play_GetCamera(this, camId), setting);
} }
/** /**

View file

@ -21,73 +21,73 @@ s16 sBootData[PLAYER_BOOTS_MAX][17] = {
// Used to map item actions to model groups // Used to map item actions to model groups
u8 sActionModelGroups[PLAYER_IA_MAX] = { u8 sActionModelGroups[PLAYER_IA_MAX] = {
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_NONE PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_NONE
PLAYER_MODELGROUP_15, // PLAYER_IA_LAST_USED PLAYER_MODELGROUP_SWORD, // PLAYER_IA_SWORD_CS
PLAYER_MODELGROUP_10, // PLAYER_IA_FISHING_POLE PLAYER_MODELGROUP_10, // PLAYER_IA_FISHING_POLE
PLAYER_MODELGROUP_SWORD, // PLAYER_IA_SWORD_MASTER PLAYER_MODELGROUP_SWORD_AND_SHIELD, // PLAYER_IA_SWORD_MASTER
PLAYER_MODELGROUP_SWORD, // PLAYER_IA_SWORD_KOKIRI PLAYER_MODELGROUP_SWORD_AND_SHIELD, // PLAYER_IA_SWORD_KOKIRI
PLAYER_MODELGROUP_BGS, // PLAYER_IA_SWORD_BIGGORON PLAYER_MODELGROUP_BGS, // PLAYER_IA_SWORD_BIGGORON
PLAYER_MODELGROUP_10, // PLAYER_IA_DEKU_STICK PLAYER_MODELGROUP_10, // PLAYER_IA_DEKU_STICK
PLAYER_MODELGROUP_HAMMER, // PLAYER_IA_HAMMER PLAYER_MODELGROUP_HAMMER, // PLAYER_IA_HAMMER
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_FIRE PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_FIRE
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_ICE PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_ICE
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_LIGHT PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_LIGHT
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_0C PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_0C
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_0D PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_0D
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_0E PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW_0E
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_SLINGSHOT PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_SLINGSHOT
PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_IA_HOOKSHOT PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_IA_HOOKSHOT
PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_IA_LONGSHOT PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_IA_LONGSHOT
PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_IA_BOMB PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_IA_BOMB
PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_IA_BOMBCHU PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_IA_BOMBCHU
PLAYER_MODELGROUP_BOOMERANG, // PLAYER_IA_BOOMERANG PLAYER_MODELGROUP_BOOMERANG, // PLAYER_IA_BOOMERANG
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MAGIC_SPELL_15 PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MAGIC_SPELL_15
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MAGIC_SPELL_16 PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MAGIC_SPELL_16
PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_MAGIC_SPELL_17 PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_MAGIC_SPELL_17
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_FARORES_WIND PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_FARORES_WIND
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_NAYRUS_LOVE PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_NAYRUS_LOVE
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DINS_FIRE PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DINS_FIRE
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DEKU_NUT PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DEKU_NUT
PLAYER_MODELGROUP_OCARINA, // PLAYER_IA_OCARINA_FAIRY PLAYER_MODELGROUP_OCARINA, // PLAYER_IA_OCARINA_FAIRY
PLAYER_MODELGROUP_OOT, // PLAYER_IA_OCARINA_OF_TIME PLAYER_MODELGROUP_OOT, // PLAYER_IA_OCARINA_OF_TIME
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FISH PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FISH
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FIRE PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FIRE
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_BUG PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_BUG
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POE PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POE
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_BIG_POE PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_BIG_POE
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_RUTOS_LETTER PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_RUTOS_LETTER
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_RED PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_RED
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_BLUE PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_BLUE
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_GREEN PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_GREEN
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_MILK_FULL PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_MILK_FULL
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_MILK_HALF PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_MILK_HALF
PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FAIRY PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FAIRY
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_ZELDAS_LETTER PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_ZELDAS_LETTER
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_WEIRD_EGG PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_WEIRD_EGG
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_CHICKEN PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_CHICKEN
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MAGIC_BEAN PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MAGIC_BEAN
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_POCKET_EGG PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_POCKET_EGG
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_POCKET_CUCCO PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_POCKET_CUCCO
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_COJIRO PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_COJIRO
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_ODD_MUSHROOM PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_ODD_MUSHROOM
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_ODD_POTION PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_ODD_POTION
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_POACHERS_SAW PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_POACHERS_SAW
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_BROKEN_GORONS_SWORD PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_BROKEN_GORONS_SWORD
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_PRESCRIPTION PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_PRESCRIPTION
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_FROG PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_FROG
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_EYEDROPS PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_EYEDROPS
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_CLAIM_CHECK PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_CLAIM_CHECK
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_KEATON PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_KEATON
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_SKULL PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_SKULL
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_SPOOKY PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_SPOOKY
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_BUNNY_HOOD PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_BUNNY_HOOD
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GORON PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GORON
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_ZORA PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_ZORA
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GERUDO PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GERUDO
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_TRUTH PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_TRUTH
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS_OF_TRUTH PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS_OF_TRUTH
}; };
typedef struct { typedef struct {
@ -110,7 +110,7 @@ u8 gPlayerModelTypes[PLAYER_MODELGROUP_MAX][PLAYER_MODELGROUPENTRY_MAX] = {
/* PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD */ /* PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD */
{ PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_19, { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_19,
PLAYER_MODELTYPE_WAIST }, PLAYER_MODELTYPE_WAIST },
/* PLAYER_MODELGROUP_SWORD */ /* PLAYER_MODELGROUP_SWORD_AND_SHIELD */
{ PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_SWORD, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_17, { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_SWORD, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_17,
PLAYER_MODELTYPE_WAIST }, PLAYER_MODELTYPE_WAIST },
/* PLAYER_MODELGROUP_DEFAULT */ /* PLAYER_MODELGROUP_DEFAULT */
@ -149,7 +149,7 @@ u8 gPlayerModelTypes[PLAYER_MODELGROUP_MAX][PLAYER_MODELGROUPENTRY_MAX] = {
/* PLAYER_MODELGROUP_BOTTLE */ /* PLAYER_MODELGROUP_BOTTLE */
{ PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_BOTTLE, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_18, { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_BOTTLE, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_18,
PLAYER_MODELTYPE_WAIST }, PLAYER_MODELTYPE_WAIST },
/* PLAYER_MODELGROUP_15 */ /* PLAYER_MODELGROUP_SWORD */
{ PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_SWORD, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_19, { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_SWORD, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_19,
PLAYER_MODELTYPE_WAIST }, PLAYER_MODELTYPE_WAIST },
}; };
@ -511,7 +511,7 @@ int Player_IsChildWithHylianShield(Player* this) {
s32 Player_ActionToModelGroup(Player* this, s32 itemAction) { s32 Player_ActionToModelGroup(Player* this, s32 itemAction) {
s32 modelGroup = sActionModelGroups[itemAction]; s32 modelGroup = sActionModelGroups[itemAction];
if ((modelGroup == PLAYER_MODELGROUP_SWORD) && Player_IsChildWithHylianShield(this)) { if ((modelGroup == PLAYER_MODELGROUP_SWORD_AND_SHIELD) && Player_IsChildWithHylianShield(this)) {
// child, using kokiri sword with hylian shield equipped // child, using kokiri sword with hylian shield equipped
return PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD; return PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD;
} else { } else {
@ -626,7 +626,7 @@ void func_8008EEAC(PlayState* play, Actor* actor) {
this->unk_684 = actor; this->unk_684 = actor;
this->stateFlags1 |= PLAYER_STATE1_16; this->stateFlags1 |= PLAYER_STATE1_16;
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, actor); Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, actor);
Camera_ChangeMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_TARGET_FRIENDLY); Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_TARGET_FRIENDLY);
} }
s32 func_8008EF30(PlayState* play) { s32 func_8008EF30(PlayState* play) {
@ -767,7 +767,7 @@ s32 Player_GetExplosiveHeld(Player* this) {
s32 func_8008F2BC(Player* this, s32 itemAction) { s32 func_8008F2BC(Player* this, s32 itemAction) {
s32 sword = 0; s32 sword = 0;
if (itemAction != PLAYER_IA_LAST_USED) { if (itemAction != PLAYER_IA_SWORD_CS) {
sword = itemAction - PLAYER_IA_SWORD_MASTER; sword = itemAction - PLAYER_IA_SWORD_MASTER;
if ((sword < 0) || (sword >= 3)) { if ((sword < 0) || (sword >= 3)) {
goto return_neg; goto return_neg;
@ -1025,7 +1025,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p
sp50 = Math_FAtan2F(sp58, sp60); sp50 = Math_FAtan2F(sp58, sp60);
temp1 = RAD_TO_BINANG(M_PI - (Math_FAtan2F(sp5C, sp58) + ((M_PI / 2) - sp50))); temp1 = RAD_TO_BINANG(M_PI - (Math_FAtan2F(sp5C, sp58) + ((M_PI / 2) - sp50)));
temp1 = temp1 - skelAnime->jointTable[shinLimbIndex].z; temp1 -= skelAnime->jointTable[shinLimbIndex].z;
if ((s16)(ABS(skelAnime->jointTable[shinLimbIndex].x) + ABS(skelAnime->jointTable[shinLimbIndex].y)) < 0) { if ((s16)(ABS(skelAnime->jointTable[shinLimbIndex].x) + ABS(skelAnime->jointTable[shinLimbIndex].y)) < 0) {
temp1 += 0x8000; temp1 += 0x8000;
@ -1061,7 +1061,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
// Note: The increment would not be done for the root limb, even if it had a non-NULL `dList`. // Note: The increment would not be done for the root limb, even if it had a non-NULL `dList`.
// So if the root limb had a non-NULL `dList` (which is not the case in vanilla), // So if the root limb had a non-NULL `dList` (which is not the case in vanilla),
// an out-of-bounds write to `bodyPartsPos` would occur. // an out-of-bounds write to `bodyPartsPos` would occur.
sCurBodyPartPos = &this->bodyPartsPos[-1]; sCurBodyPartPos = &this->bodyPartsPos[0] - 1;
if (!LINK_IS_ADULT) { if (!LINK_IS_ADULT) {
if (!(this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2) || (this->skelAnime.moveFlags & ANIM_FLAG_0)) { if (!(this->skelAnime.moveFlags & ANIM_FLAG_PLAYER_2) || (this->skelAnime.moveFlags & ANIM_FLAG_0)) {
@ -1368,7 +1368,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) {
Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW); Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW);
Matrix_Scale(sp60, sp60, sp60, MTXMODE_APPLY); Matrix_Scale(sp60, sp60, sp60, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2587), gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2587),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment); gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment);
gSPDisplayList(OVERLAY_DISP++, gLinkAdultHookshotReticleDL); gSPDisplayList(OVERLAY_DISP++, gLinkAdultHookshotReticleDL);
@ -1410,8 +1410,8 @@ Color_RGB8 sBottleColors[] = {
Vec3f D_80126128 = { 398.0f, 1419.0f, 244.0f }; Vec3f D_80126128 = { 398.0f, 1419.0f, 244.0f };
BowSlingshotStringData sBowSlingshotStringData[] = { BowSlingshotStringData sBowSlingshotStringData[] = {
{ gLinkAdultBowStringDL, { 0.0f, -360.4f, 0.0f } }, // Bow { gLinkAdultBowStringDL, { 0.0f, -360.4f, 0.0f } }, // Bow
{ gLinkChildSlinghotStringDL, { 606.0f, 236.0f, 0.0f } }, // Slingshot { gLinkChildSlingshotStringDL, { 606.0f, 236.0f, 0.0f } }, // Slingshot
}; };
// Coordinates of the shield quad collider vertices, in the right hand limb's own model space. // Coordinates of the shield quad collider vertices, in the right hand limb's own model space.
@ -1475,7 +1475,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY); Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY);
Matrix_Scale(1.0f, this->unk_85C, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, this->unk_85C, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2653), gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2653),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL); gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL);
@ -1496,7 +1496,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2710); OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2710);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2712), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2712),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetEnvColor(POLY_XLU_DISP++, bottleColor->r, bottleColor->g, bottleColor->b, 0); gDPSetEnvColor(POLY_XLU_DISP++, bottleColor->r, bottleColor->g, bottleColor->b, 0);
gSPDisplayList(POLY_XLU_DISP++, sBottleDLists[((void)0, gSaveContext.save.linkAge)]); gSPDisplayList(POLY_XLU_DISP++, sBottleDLists[((void)0, gSaveContext.save.linkAge)]);
@ -1569,7 +1569,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve
Matrix_RotateZ(this->unk_858 * -0.2f, MTXMODE_APPLY); Matrix_RotateZ(this->unk_858 * -0.2f, MTXMODE_APPLY);
} }
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2804), gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_player_lib.c", 2804),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, stringData->dList); gSPDisplayList(POLY_XLU_DISP++, stringData->dList);
@ -1648,11 +1648,11 @@ u32 Player_InitPauseDrawData(PlayState* play, u8* segment, SkelAnime* skelAnime)
size = gObjectTable[OBJECT_GAMEPLAY_KEEP].vromEnd - gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart; size = gObjectTable[OBJECT_GAMEPLAY_KEEP].vromEnd - gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart;
ptr = segment + PAUSE_EQUIP_BUFFER_SIZE; ptr = segment + PAUSE_EQUIP_BUFFER_SIZE;
DmaMgr_RequestSyncDebug(ptr, gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart, size, "../z_player_lib.c", 2982); DMA_REQUEST_SYNC(ptr, gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart, size, "../z_player_lib.c", 2982);
size = gObjectTable[linkObjectId].vromEnd - gObjectTable[linkObjectId].vromStart; size = gObjectTable[linkObjectId].vromEnd - gObjectTable[linkObjectId].vromStart;
ptr = segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE; ptr = segment + PAUSE_EQUIP_BUFFER_SIZE + PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP_BUFFER_SIZE;
DmaMgr_RequestSyncDebug(ptr, gObjectTable[linkObjectId].vromStart, size, "../z_player_lib.c", 2988); DMA_REQUEST_SYNC(ptr, gObjectTable[linkObjectId].vromStart, size, "../z_player_lib.c", 2988);
ptr = (void*)ALIGN16((uintptr_t)ptr + size); ptr = (void*)ALIGN16((uintptr_t)ptr + size);
@ -1668,9 +1668,9 @@ u32 Player_InitPauseDrawData(PlayState* play, u8* segment, SkelAnime* skelAnime)
} }
u8 sPauseModelGroupBySword[] = { u8 sPauseModelGroupBySword[] = {
PLAYER_MODELGROUP_SWORD, // PLAYER_SWORD_KOKIRI PLAYER_MODELGROUP_SWORD_AND_SHIELD, // PLAYER_SWORD_KOKIRI
PLAYER_MODELGROUP_SWORD, // PLAYER_SWORD_MASTER PLAYER_MODELGROUP_SWORD_AND_SHIELD, // PLAYER_SWORD_MASTER
PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BIGGORON PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BIGGORON
}; };
s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) { s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) {
@ -1682,7 +1682,7 @@ s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Ve
s32 dListOffset = 0; s32 dListOffset = 0;
Gfx** dLists; Gfx** dLists;
if ((modelGroup == PLAYER_MODELGROUP_SWORD) && !LINK_IS_ADULT && if ((modelGroup == PLAYER_MODELGROUP_SWORD_AND_SHIELD) && !LINK_IS_ADULT &&
(playerSwordAndShield[1] == PLAYER_SHIELD_HYLIAN)) { (playerSwordAndShield[1] == PLAYER_SHIELD_HYLIAN)) {
modelGroup = PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD; modelGroup = PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD;
} }
@ -1728,8 +1728,8 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject,
Gfx* opaRef; Gfx* opaRef;
Gfx* xluRef; Gfx* xluRef;
u16 perspNorm; u16 perspNorm;
Mtx* perspMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx)); Mtx* perspMtx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx));
Mtx* lookAtMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx)); Mtx* lookAtMtx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx));
OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 3129); OPEN_DISPS(play->state.gfxCtx, "../z_player_lib.c", 3129);

View file

@ -22,18 +22,15 @@ QuakeRequest sQuakeRequests[4];
s16 sQuakeUnused = 1; s16 sQuakeUnused = 1;
s16 sQuakeRequestCount = 0; s16 sQuakeRequestCount = 0;
Vec3f* Quake_AddVecGeoToVec3f(Vec3f* dst, Vec3f* a, VecGeo* geo) { Vec3f Quake_AddVecGeoToVec3f(Vec3f* a, VecGeo* geo) {
Vec3f vec; Vec3f sum;
Vec3f b; Vec3f b = OLib_VecGeoToVec3f(geo);
OLib_VecGeoToVec3f(&b, geo); sum.x = a->x + b.x;
vec.x = a->x + b.x; sum.y = a->y + b.y;
vec.y = a->y + b.y; sum.z = a->z + b.z;
vec.z = a->z + b.z;
*dst = vec; return sum;
return dst;
} }
void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) { void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
@ -47,7 +44,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
offset.x = 0; offset.x = 0;
offset.y = 0; offset.y = 0;
offset.z = 0; offset.z = 0;
OLib_Vec3fDiffToVecGeo(&eyeToAtGeo, eye, at); eyeToAtGeo = OLib_Vec3fDiffToVecGeo(eye, at);
// y shake // y shake
geo.r = req->y * y; geo.r = req->y * y;
@ -55,7 +52,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
geo.pitch = eyeToAtGeo.pitch + req->orientation.x + 0x4000; geo.pitch = eyeToAtGeo.pitch + req->orientation.x + 0x4000;
geo.yaw = eyeToAtGeo.yaw + req->orientation.y; geo.yaw = eyeToAtGeo.yaw + req->orientation.y;
// apply y shake // apply y shake
Quake_AddVecGeoToVec3f(&offset, &offset, &geo); offset = Quake_AddVecGeoToVec3f(&offset, &geo);
// x shake // x shake
geo.r = req->x * x; geo.r = req->x * x;
@ -63,7 +60,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
geo.pitch = eyeToAtGeo.pitch + req->orientation.x; geo.pitch = eyeToAtGeo.pitch + req->orientation.x;
geo.yaw = eyeToAtGeo.yaw + req->orientation.y + 0x4000; geo.yaw = eyeToAtGeo.yaw + req->orientation.y + 0x4000;
// apply x shake // apply x shake
Quake_AddVecGeoToVec3f(&offset, &offset, &geo); offset = Quake_AddVecGeoToVec3f(&offset, &geo);
} else { } else {
offset.x = 0; offset.x = 0;
offset.y = req->y * y; offset.y = req->y * y;
@ -71,7 +68,7 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
geo.r = req->x * x; geo.r = req->x * x;
geo.pitch = req->orientation.x; geo.pitch = req->orientation.x;
geo.yaw = req->orientation.y; geo.yaw = req->orientation.y;
Quake_AddVecGeoToVec3f(&offset, &offset, &geo); offset = Quake_AddVecGeoToVec3f(&offset, &geo);
} }
shake->atOffset = shake->eyeOffset = offset; shake->atOffset = shake->eyeOffset = offset;

View file

@ -1380,7 +1380,7 @@ Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y) {
} }
Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) { Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) {
Gfx* displayList = Graph_Alloc(gfxCtx, 3 * sizeof(Gfx)); Gfx* displayList = GRAPH_ALLOC(gfxCtx, 3 * sizeof(Gfx));
x %= 512 << 2; x %= 512 << 2;
y %= 512 << 2; y %= 512 << 2;
@ -1394,7 +1394,7 @@ Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height)
Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
u32 y2, s32 width2, s32 height2) { u32 y2, s32 width2, s32 height2) {
Gfx* displayList = Graph_Alloc(gfxCtx, 5 * sizeof(Gfx)); Gfx* displayList = GRAPH_ALLOC(gfxCtx, 5 * sizeof(Gfx));
x1 %= 512 << 2; x1 %= 512 << 2;
y1 %= 512 << 2; y1 %= 512 << 2;
@ -1412,7 +1412,7 @@ Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 wi
Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a) { u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a) {
Gfx* displayList = Graph_Alloc(gfxCtx, 6 * sizeof(Gfx)); Gfx* displayList = GRAPH_ALLOC(gfxCtx, 6 * sizeof(Gfx));
x1 %= 512 << 2; x1 %= 512 << 2;
y1 %= 512 << 2; y1 %= 512 << 2;
@ -1430,7 +1430,7 @@ Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1
} }
Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a) { Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a) {
Gfx* displayList = Graph_Alloc(gfxCtx, 2 * sizeof(Gfx)); Gfx* displayList = GRAPH_ALLOC(gfxCtx, 2 * sizeof(Gfx));
gDPSetEnvColor(displayList, r, g, b, a); gDPSetEnvColor(displayList, r, g, b, a);
gSPEndDisplayList(displayList + 1); gSPEndDisplayList(displayList + 1);

View file

@ -389,7 +389,7 @@ void Room_DrawImageSingle(PlayState* play, Room* room, u32 flags) {
Vec3f quakeOffset; Vec3f quakeOffset;
gfx = POLY_OPA_DISP; gfx = POLY_OPA_DISP;
Camera_GetQuakeOffset(&quakeOffset, activeCam); quakeOffset = Camera_GetQuakeOffset(activeCam);
Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height, Room_DrawBackground2D(&gfx, roomShape->source, roomShape->tlut, roomShape->width, roomShape->height,
roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount, roomShape->fmt, roomShape->siz, roomShape->tlutMode, roomShape->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,
@ -487,7 +487,7 @@ void Room_DrawImageMulti(PlayState* play, Room* room, u32 flags) {
Vec3f quakeOffset; Vec3f quakeOffset;
gfx = POLY_OPA_DISP; gfx = POLY_OPA_DISP;
Camera_GetQuakeOffset(&quakeOffset, activeCam); quakeOffset = Camera_GetQuakeOffset(activeCam);
Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height, Room_DrawBackground2D(&gfx, bgEntry->source, bgEntry->tlut, bgEntry->width, bgEntry->height,
bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount, bgEntry->fmt, bgEntry->siz, bgEntry->tlutMode, bgEntry->tlutCount,
(quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f, (quakeOffset.x + quakeOffset.z) * 1.2f + quakeOffset.y * 0.6f,
@ -571,7 +571,7 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf(VT_FGCOL(YELLOW));
// "Room buffer size=%08x(%5.1fK)" // "Room buffer size=%08x(%5.1fK)"
osSyncPrintf("部屋バッファサイズ=%08x(%5.1fK)\n", maxRoomSize, maxRoomSize / 1024.0f); osSyncPrintf("部屋バッファサイズ=%08x(%5.1fK)\n", maxRoomSize, maxRoomSize / 1024.0f);
roomCtx->bufPtrs[0] = GameState_Alloc(&play->state, maxRoomSize, "../z_room.c", 946); roomCtx->bufPtrs[0] = GAME_STATE_ALLOC(&play->state, maxRoomSize, "../z_room.c", 946);
// "Room buffer initial pointer=%08x" // "Room buffer initial pointer=%08x"
osSyncPrintf("部屋バッファ開始ポインタ=%08x\n", roomCtx->bufPtrs[0]); osSyncPrintf("部屋バッファ開始ポインタ=%08x\n", roomCtx->bufPtrs[0]);
roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + maxRoomSize); roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + maxRoomSize);
@ -604,8 +604,8 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
(void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7)); (void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1); osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
DmaMgr_RequestAsync(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0, DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
&roomCtx->loadQueue, NULL, "../z_room.c", 1036); &roomCtx->loadQueue, NULL, "../z_room.c", 1036);
roomCtx->unk_30 ^= 1; roomCtx->unk_30 ^= 1;
return true; return true;

View file

@ -22,7 +22,7 @@ void Sample_Draw(SampleState* this) {
View_Apply(view, VIEW_ALL); View_Apply(view, VIEW_ALL);
{ {
Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
guPosition(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42)); guPosition(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42));
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD);
@ -79,8 +79,8 @@ void Sample_SetupView(SampleState* this) {
void Sample_LoadTitleStatic(SampleState* this) { void Sample_LoadTitleStatic(SampleState* this) {
u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart; u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart;
this->staticSegment = GameState_Alloc(&this->state, size, "../z_sample.c", 163); this->staticSegment = GAME_STATE_ALLOC(&this->state, size, "../z_sample.c", 163);
DmaMgr_RequestSyncDebug(this->staticSegment, (uintptr_t)_title_staticSegmentRomStart, size, "../z_sample.c", 164); DMA_REQUEST_SYNC(this->staticSegment, (uintptr_t)_title_staticSegmentRomStart, size, "../z_sample.c", 164);
} }
void Sample_Init(GameState* thisx) { void Sample_Init(GameState* thisx) {

View file

@ -32,8 +32,8 @@ s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 objectId) {
"this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment", "this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment",
"../z_scene.c", 142); "../z_scene.c", 142);
DmaMgr_RequestSyncDebug(objectCtx->slots[objectCtx->numEntries].segment, gObjectTable[objectId].vromStart, size, DMA_REQUEST_SYNC(objectCtx->slots[objectCtx->numEntries].segment, gObjectTable[objectId].vromStart, size,
"../z_scene.c", 145); "../z_scene.c", 145);
if (objectCtx->numEntries < (ARRAY_COUNT(objectCtx->slots) - 1)) { if (objectCtx->numEntries < (ARRAY_COUNT(objectCtx->slots) - 1)) {
objectCtx->slots[objectCtx->numEntries + 1].segment = objectCtx->slots[objectCtx->numEntries + 1].segment =
@ -81,7 +81,8 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) {
osSyncPrintf("オブジェクト入れ替えバンク情報 %8.3fKB\n", spaceSize / 1024.0f); osSyncPrintf("オブジェクト入れ替えバンク情報 %8.3fKB\n", spaceSize / 1024.0f);
osSyncPrintf(VT_RST); osSyncPrintf(VT_RST);
objectCtx->spaceStart = objectCtx->slots[0].segment = GameState_Alloc(&play->state, spaceSize, "../z_scene.c", 219); objectCtx->spaceStart = objectCtx->slots[0].segment =
GAME_STATE_ALLOC(&play->state, spaceSize, "../z_scene.c", 219);
objectCtx->spaceEnd = (void*)((uintptr_t)objectCtx->spaceStart + spaceSize); objectCtx->spaceEnd = (void*)((uintptr_t)objectCtx->spaceStart + spaceSize);
objectCtx->mainKeepSlot = Object_SpawnPersistent(objectCtx, OBJECT_GAMEPLAY_KEEP); objectCtx->mainKeepSlot = Object_SpawnPersistent(objectCtx, OBJECT_GAMEPLAY_KEEP);
@ -103,8 +104,8 @@ void Object_UpdateEntries(ObjectContext* objectCtx) {
osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, size / 1024.0f, entry->segment); osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, size / 1024.0f, entry->segment);
DmaMgr_RequestAsync(&entry->dmaRequest, entry->segment, objectFile->vromStart, size, 0, DMA_REQUEST_ASYNC(&entry->dmaRequest, entry->segment, objectFile->vromStart, size, 0, &entry->loadQueue,
&entry->loadQueue, NULL, "../z_scene.c", 266); NULL, "../z_scene.c", 266);
} else if (osRecvMesg(&entry->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) { } else if (osRecvMesg(&entry->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) {
entry->id = -entry->id; entry->id = -entry->id;
} }
@ -145,7 +146,7 @@ void func_800981B8(ObjectContext* objectCtx) {
objectCtx->slots[i].segment); objectCtx->slots[i].segment);
osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->numEntries, (uintptr_t)objectCtx->slots[i].segment + size, osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->numEntries, (uintptr_t)objectCtx->slots[i].segment + size,
objectCtx->spaceEnd); objectCtx->spaceEnd);
DmaMgr_RequestSyncDebug(objectCtx->slots[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342); DMA_REQUEST_SYNC(objectCtx->slots[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342);
} }
} }

View file

@ -157,7 +157,7 @@ void* sDCLavaFloorTextures[] = {
void Scene_DrawConfigDodongosCavern(PlayState* play) { void Scene_DrawConfigDodongosCavern(PlayState* play) {
u32 gameplayFrames; u32 gameplayFrames;
s32 pad; s32 pad;
Gfx* displayListHead = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Gfx[3])); Gfx* displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 2 * sizeof(Gfx[3]));
OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 4905); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 4905);
@ -193,7 +193,7 @@ void Scene_DrawConfigDodongosCavern(PlayState* play) {
void Scene_DrawConfigTempleOfTime(PlayState* play) { void Scene_DrawConfigTempleOfTime(PlayState* play) {
f32 temp; f32 temp;
Gfx* displayListHead = Graph_Alloc(play->state.gfxCtx, 18 * sizeof(Gfx)); Gfx* displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 18 * sizeof(Gfx));
OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5069); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 5069);
@ -784,7 +784,7 @@ void Scene_DrawConfigGerudoTrainingGround(PlayState* play) {
Gfx* Gfx_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, Gfx* Gfx_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a) { u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a) {
Gfx* displayList = Graph_Alloc(gfxCtx, 10 * sizeof(Gfx)); Gfx* displayList = GRAPH_ALLOC(gfxCtx, 10 * sizeof(Gfx));
x1 %= 512 << 2; x1 %= 512 << 2;
y1 %= 512 << 2; y1 %= 512 << 2;
@ -966,7 +966,7 @@ void Scene_DrawConfigHyruleField(PlayState* play) {
u32 gameplayFrames; u32 gameplayFrames;
Gfx* displayListHead; Gfx* displayListHead;
displayListHead = Graph_Alloc(play->state.gfxCtx, 3 * sizeof(Gfx)); displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 3 * sizeof(Gfx));
OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6814); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 6814);
@ -1065,7 +1065,7 @@ void Scene_DrawConfigKokiriForest(PlayState* play) {
spA3 = 128; spA3 = 128;
spA0 = 500; spA0 = 500;
displayListHead = Graph_Alloc(play->state.gfxCtx, 6 * sizeof(Gfx)); displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 6 * sizeof(Gfx));
if (1) {} if (1) {}
if (1) {} if (1) {}
@ -1335,7 +1335,7 @@ void Scene_DrawConfigHyruleCastle(PlayState* play) {
} }
void Scene_DrawConfigDeathMountainTrail(PlayState* play) { void Scene_DrawConfigDeathMountainTrail(PlayState* play) {
Gfx* displayListHead = Graph_Alloc(play->state.gfxCtx, 3 * sizeof(Gfx)); Gfx* displayListHead = GRAPH_ALLOC(play->state.gfxCtx, 3 * sizeof(Gfx));
OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7461); OPEN_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7461);
@ -1537,7 +1537,7 @@ void Scene_DrawConfigJabuJabu(PlayState* play) {
Matrix_Scale(1.005f, sinf(D_8012A398) * 0.8f, 1.005f, MTXMODE_NEW); Matrix_Scale(1.005f, sinf(D_8012A398) * 0.8f, 1.005f, MTXMODE_NEW);
} }
gSPSegment(POLY_OPA_DISP++, 0x0D, Matrix_NewMtx(play->state.gfxCtx, "../z_scene_table.c", 7809)); gSPSegment(POLY_OPA_DISP++, 0x0D, MATRIX_NEW(play->state.gfxCtx, "../z_scene_table.c", 7809));
CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7811); CLOSE_DISPS(play->state.gfxCtx, "../z_scene_table.c", 7811);
} }

View file

@ -39,7 +39,7 @@ void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 805), G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 805), G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, dList); gSPDisplayList(POLY_OPA_DISP++, dList);
} }
} }
@ -97,7 +97,7 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 881), G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, dList); gSPDisplayList(POLY_OPA_DISP++, dList);
} }
} }
@ -143,7 +143,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton,
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (newDList != NULL) { if (newDList != NULL) {
Matrix_ToMtx(*mtx, "../z_skelanime.c", 945); MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 945);
{ {
OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 946); OPEN_DISPS(play->state.gfxCtx, "../z_skelanime.c", 946);
gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD);
@ -152,7 +152,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton,
} }
(*mtx)++; (*mtx)++;
} else if (limbDList != NULL) { } else if (limbDList != NULL) {
Matrix_ToMtx(*mtx, "../z_skelanime.c", 954); MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 954);
(*mtx)++; (*mtx)++;
} }
} }
@ -185,7 +185,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
Gfx* limbDList; Gfx* limbDList;
Vec3f pos; Vec3f pos;
Vec3s rot; Vec3s rot;
Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(Mtx)); Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, dListCount * sizeof(Mtx));
if (skeleton == NULL) { if (skeleton == NULL) {
osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf(VT_FGCOL(RED));
@ -211,12 +211,12 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (newDList != NULL) { if (newDList != NULL) {
Matrix_ToMtx(mtx, "../z_skelanime.c", 1033); MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1033);
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, newDList); gSPDisplayList(POLY_OPA_DISP++, newDList);
mtx++; mtx++;
} else if (limbDList != NULL) { } else if (limbDList != NULL) {
Matrix_ToMtx(mtx, "../z_skelanime.c", 1040); MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1040);
mtx++; mtx++;
} }
} }
@ -258,7 +258,7 @@ void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1103), G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1103), G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, dList); gSPDisplayList(POLY_OPA_DISP++, dList);
} }
} }
@ -314,7 +314,7 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1176), G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1176), G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, dList); gSPDisplayList(POLY_OPA_DISP++, dList);
} }
} }
@ -361,12 +361,12 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton,
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (newDList != NULL) { if (newDList != NULL) {
Matrix_ToMtx(*limbMatrices, "../z_skelanime.c", 1242); MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1242);
gSPMatrix(POLY_OPA_DISP++, *limbMatrices, G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, *limbMatrices, G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, newDList); gSPDisplayList(POLY_OPA_DISP++, newDList);
(*limbMatrices)++; (*limbMatrices)++;
} else if (limbDList != NULL) { } else if (limbDList != NULL) {
Matrix_ToMtx(*limbMatrices, "../z_skelanime.c", 1249); MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1249);
(*limbMatrices)++; (*limbMatrices)++;
} }
} }
@ -402,7 +402,7 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable,
Gfx* limbDList; Gfx* limbDList;
Vec3f pos; Vec3f pos;
Vec3s rot; Vec3s rot;
Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(Mtx)); Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, dListCount * sizeof(Mtx));
if (skeleton == NULL) { if (skeleton == NULL) {
osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf(VT_FGCOL(RED));
@ -430,12 +430,12 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable,
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (newDList != NULL) { if (newDList != NULL) {
Matrix_ToMtx(mtx, "../z_skelanime.c", 1327); MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1327);
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, newDList); gSPDisplayList(POLY_OPA_DISP++, newDList);
mtx++; mtx++;
} else if (limbDList != NULL) { } else if (limbDList != NULL) {
Matrix_ToMtx(mtx, "../z_skelanime.c", 1334); MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1334);
mtx++; mtx++;
} }
} }
@ -522,7 +522,7 @@ Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s*
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg, &gfx)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg, &gfx)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD); gSPMatrix(gfx++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1489), G_MTX_LOAD);
gSPDisplayList(gfx++, dList); gSPDisplayList(gfx++, dList);
} }
} }
@ -578,7 +578,7 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg, &gfx)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg, &gfx)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (dList != NULL) { if (dList != NULL) {
gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD); gSPMatrix(gfx++, MATRIX_NEW(play->state.gfxCtx, "../z_skelanime.c", 1558), G_MTX_LOAD);
gSPDisplayList(gfx++, dList); gSPDisplayList(gfx++, dList);
} }
} }
@ -622,12 +622,12 @@ Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg, &gfx)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg, &gfx)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (newDList != NULL) { if (newDList != NULL) {
Matrix_ToMtx(*mtx, "../z_skelanime.c", 1623); MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 1623);
gSPMatrix(gfx++, *mtx, G_MTX_LOAD); gSPMatrix(gfx++, *mtx, G_MTX_LOAD);
gSPDisplayList(gfx++, newDList); gSPDisplayList(gfx++, newDList);
(*mtx)++; (*mtx)++;
} else if (limbDList != NULL) { } else if (limbDList != NULL) {
Matrix_ToMtx(*mtx, "../z_skelanime.c", 1630); MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 1630);
(*mtx)++; (*mtx)++;
} }
} }
@ -662,7 +662,7 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32
Gfx* limbDList; Gfx* limbDList;
Vec3f pos; Vec3f pos;
Vec3s rot; Vec3s rot;
Mtx* mtx = Graph_Alloc(play->state.gfxCtx, dListCount * sizeof(*mtx)); Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, dListCount * sizeof(*mtx));
if (skeleton == NULL) { if (skeleton == NULL) {
osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf(VT_FGCOL(RED));
@ -687,12 +687,12 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg, &gfx)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg, &gfx)) {
Matrix_TranslateRotateZYX(&pos, &rot); Matrix_TranslateRotateZYX(&pos, &rot);
if (newDList != NULL) { if (newDList != NULL) {
Matrix_ToMtx(mtx, "../z_skelanime.c", 1710); MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1710);
gSPMatrix(gfx++, mtx, G_MTX_LOAD); gSPMatrix(gfx++, mtx, G_MTX_LOAD);
gSPDisplayList(gfx++, newDList); gSPDisplayList(gfx++, newDList);
mtx++; mtx++;
} else if (limbDList != NULL) { } else if (limbDList != NULL) {
Matrix_ToMtx(mtx, "../z_skelanime.c", 1717); MATRIX_TO_MTX(mtx, "../z_skelanime.c", 1717);
mtx++; mtx++;
} }
} }
@ -845,10 +845,9 @@ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animati
s32 pad; s32 pad;
osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1); osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1);
DmaMgr_RequestAsync(&entry->data.load.req, frameTable, DMA_REQUEST_ASYNC(&entry->data.load.req, frameTable,
LINK_ANIMATION_OFFSET(linkAnimHeader->segment, ((sizeof(Vec3s) * limbCount + 2) * frame)), LINK_ANIMATION_OFFSET(linkAnimHeader->segment, ((sizeof(Vec3s) * limbCount + 2) * frame)),
sizeof(Vec3s) * limbCount + 2, 0, &entry->data.load.msgQueue, NULL, "../z_skelanime.c", sizeof(Vec3s) * limbCount + 2, 0, &entry->data.load.msgQueue, NULL, "../z_skelanime.c", 2004);
2004);
} }
} }
@ -1068,8 +1067,8 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade
} }
if (jointTable == NULL) { if (jointTable == NULL) {
skelAnime->jointTable = ZeldaArena_MallocDebug(allocSize, "../z_skelanime.c", 2364); skelAnime->jointTable = ZELDA_ARENA_MALLOC(allocSize, "../z_skelanime.c", 2364);
skelAnime->morphTable = ZeldaArena_MallocDebug(allocSize, "../z_skelanime.c", 2365); skelAnime->morphTable = ZELDA_ARENA_MALLOC(allocSize, "../z_skelanime.c", 2365);
} else { } else {
ASSERT(limbBufCount == limbCount, "joint_buff_num == joint_num", "../z_skelanime.c", 2369); ASSERT(limbBufCount == limbCount, "joint_buff_num == joint_num", "../z_skelanime.c", 2369);
@ -1384,9 +1383,9 @@ SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHe
skelAnime->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->segment); skelAnime->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->segment);
if (jointTable == NULL) { if (jointTable == NULL) {
skelAnime->jointTable = skelAnime->jointTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 2968); ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 2968);
skelAnime->morphTable = skelAnime->morphTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 2969); ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 2969);
} else { } else {
ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 2973); ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 2973);
skelAnime->jointTable = jointTable; skelAnime->jointTable = jointTable;
@ -1417,10 +1416,10 @@ SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* sk
if (jointTable == NULL) { if (jointTable == NULL) {
skelAnime->jointTable = skelAnime->jointTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3047); ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3047);
skelAnime->morphTable = skelAnime->morphTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3048); ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3048);
} else { } else {
ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 3052); ASSERT(limbCount == skelAnime->limbCount, "joint_buff_num == this->joint_num", "../z_skelanime.c", 3052);
skelAnime->jointTable = jointTable; skelAnime->jointTable = jointTable;
@ -1449,9 +1448,9 @@ SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skelet
skelAnime->limbCount = skeletonHeader->limbCount + 1; skelAnime->limbCount = skeletonHeader->limbCount + 1;
skelAnime->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->segment); skelAnime->skeleton = SEGMENTED_TO_VIRTUAL(skeletonHeader->segment);
skelAnime->jointTable = skelAnime->jointTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3120); ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->jointTable), "../z_skelanime.c", 3120);
skelAnime->morphTable = skelAnime->morphTable =
ZeldaArena_MallocDebug(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3121); ZELDA_ARENA_MALLOC(skelAnime->limbCount * sizeof(*skelAnime->morphTable), "../z_skelanime.c", 3121);
if ((skelAnime->jointTable == NULL) || (skelAnime->morphTable == NULL)) { if ((skelAnime->jointTable == NULL) || (skelAnime->morphTable == NULL)) {
osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf(VT_FGCOL(RED));
// "Memory allocation error" // "Memory allocation error"
@ -1839,13 +1838,13 @@ s32 Animation_OnFrame(SkelAnime* skelAnime, f32 frame) {
*/ */
void SkelAnime_Free(SkelAnime* skelAnime, PlayState* play) { void SkelAnime_Free(SkelAnime* skelAnime, PlayState* play) {
if (skelAnime->jointTable != NULL) { if (skelAnime->jointTable != NULL) {
ZeldaArena_FreeDebug(skelAnime->jointTable, "../z_skelanime.c", 3729); ZELDA_ARENA_FREE(skelAnime->jointTable, "../z_skelanime.c", 3729);
} else { } else {
osSyncPrintf("now_joint あきまへん!!\n"); // "now_joint is freed! !" osSyncPrintf("now_joint あきまへん!!\n"); // "now_joint is freed! !"
} }
if (skelAnime->morphTable != NULL) { if (skelAnime->morphTable != NULL) {
ZeldaArena_FreeDebug(skelAnime->morphTable, "../z_skelanime.c", 3731); ZELDA_ARENA_FREE(skelAnime->morphTable, "../z_skelanime.c", 3731);
} else { } else {
osSyncPrintf("morf_joint あきまへん!!\n"); // "morf_joint is freed !!" osSyncPrintf("morf_joint あきまへん!!\n"); // "morf_joint is freed !!"
} }

View file

@ -48,7 +48,7 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim
skeleton = SEGMENTED_TO_VIRTUAL(skin->skeletonHeader->segment); skeleton = SEGMENTED_TO_VIRTUAL(skin->skeletonHeader->segment);
limbCount = skin->skeletonHeader->limbCount; limbCount = skin->skeletonHeader->limbCount;
skin->vtxTable = ZeldaArena_MallocDebug(limbCount * sizeof(SkinLimbVtx), "../z_skin_awb.c", 212); skin->vtxTable = ZELDA_ARENA_MALLOC(limbCount * sizeof(SkinLimbVtx), "../z_skin_awb.c", 212);
ASSERT(skin->vtxTable != NULL, "pskin_awb->avb_tbl != NULL", "../z_skin_awb.c", 214); ASSERT(skin->vtxTable != NULL, "pskin_awb->avb_tbl != NULL", "../z_skin_awb.c", 214);
@ -67,11 +67,11 @@ void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, Anim
vtxEntry->index = 0; vtxEntry->index = 0;
vtxEntry->buf[0] = vtxEntry->buf[0] =
ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 235); ZELDA_ARENA_MALLOC(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 235);
ASSERT(vtxEntry->buf[0] != NULL, "psavb->buf[0] != NULL", "../z_skin_awb.c", 237); ASSERT(vtxEntry->buf[0] != NULL, "psavb->buf[0] != NULL", "../z_skin_awb.c", 237);
vtxEntry->buf[1] = vtxEntry->buf[1] =
ZeldaArena_MallocDebug(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 240); ZELDA_ARENA_MALLOC(animatedLimbData->totalVtxCount * sizeof(Vtx), "../z_skin_awb.c", 240);
ASSERT(vtxEntry->buf[1] != NULL, "psavb->buf[1] != NULL", "../z_skin_awb.c", 242); ASSERT(vtxEntry->buf[1] != NULL, "psavb->buf[1] != NULL", "../z_skin_awb.c", 242);
Skin_InitAnimatedLimb(play, skin, i); Skin_InitAnimatedLimb(play, skin, i);
@ -90,17 +90,17 @@ void Skin_Free(PlayState* play, Skin* skin) {
for (i = 0; i < skin->limbCount; i++) { for (i = 0; i < skin->limbCount; i++) {
if (skin->vtxTable[i].buf[0] != NULL) { if (skin->vtxTable[i].buf[0] != NULL) {
ZeldaArena_FreeDebug(skin->vtxTable[i].buf[0], "../z_skin_awb.c", 276); ZELDA_ARENA_FREE(skin->vtxTable[i].buf[0], "../z_skin_awb.c", 276);
skin->vtxTable[i].buf[0] = NULL; skin->vtxTable[i].buf[0] = NULL;
} }
if (skin->vtxTable[i].buf[1] != NULL) { if (skin->vtxTable[i].buf[1] != NULL) {
ZeldaArena_FreeDebug(skin->vtxTable[i].buf[1], "../z_skin_awb.c", 280); ZELDA_ARENA_FREE(skin->vtxTable[i].buf[1], "../z_skin_awb.c", 280);
skin->vtxTable[i].buf[1] = NULL; skin->vtxTable[i].buf[1] = NULL;
} }
} }
if (skin->vtxTable != NULL) { if (skin->vtxTable != NULL) {
ZeldaArena_FreeDebug(skin->vtxTable, "../z_skin_awb.c", 286); ZELDA_ARENA_FREE(skin->vtxTable, "../z_skin_awb.c", 286);
} }
SkelAnime_Free(&skin->skelAnime, play); SkelAnime_Free(&skin->skelAnime, play);

View file

@ -593,7 +593,7 @@ void SkinMatrix_MtxFToMtx(MtxF* src, Mtx* dest) {
} }
Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src) { Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src) {
Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
if (mtx == NULL) { if (mtx == NULL) {
osSyncPrintf("Skin_Matrix_to_Mtx_new() 確保失敗:NULLを返して終了\n", mtx); osSyncPrintf("Skin_Matrix_to_Mtx_new() 確保失敗:NULLを返して終了\n", mtx);

View file

@ -915,7 +915,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
} }
void Sram_Alloc(GameState* gameState, SramContext* sramCtx) { void Sram_Alloc(GameState* gameState, SramContext* sramCtx) {
sramCtx->readBuff = GameState_Alloc(gameState, SRAM_SIZE, "../z_sram.c", 1294); sramCtx->readBuff = GAME_STATE_ALLOC(gameState, SRAM_SIZE, "../z_sram.c", 1294);
ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295); ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295);
} }

View file

@ -21,7 +21,7 @@ void View_ViewportToVp(Vp* dest, Viewport* src) {
} }
View* View_New(GraphicsContext* gfxCtx) { View* View_New(GraphicsContext* gfxCtx) {
View* view = SystemArena_MallocDebug(sizeof(View), "../z_view.c", 285); View* view = SYSTEM_ARENA_MALLOC(sizeof(View), "../z_view.c", 285);
if (view != NULL) { if (view != NULL) {
__osMemset(view, 0, sizeof(View)); __osMemset(view, 0, sizeof(View));
@ -32,7 +32,7 @@ View* View_New(GraphicsContext* gfxCtx) {
} }
void View_Free(View* view) { void View_Free(View* view) {
SystemArena_FreeDebug(view, "../z_view.c", 297); SYSTEM_ARENA_FREE(view, "../z_view.c", 297);
} }
void View_Init(View* view, GraphicsContext* gfxCtx) { void View_Init(View* view, GraphicsContext* gfxCtx) {
@ -261,7 +261,7 @@ s32 View_StepDistortion(View* view, Mtx* projectionMtx) {
Matrix_RotateZ(-view->curDistortionOrientation.z, MTXMODE_APPLY); Matrix_RotateZ(-view->curDistortionOrientation.z, MTXMODE_APPLY);
Matrix_RotateY(-view->curDistortionOrientation.y, MTXMODE_APPLY); Matrix_RotateY(-view->curDistortionOrientation.y, MTXMODE_APPLY);
Matrix_RotateX(-view->curDistortionOrientation.x, MTXMODE_APPLY); Matrix_RotateX(-view->curDistortionOrientation.x, MTXMODE_APPLY);
Matrix_ToMtx(projectionMtx, "../z_view.c", 566); MATRIX_TO_MTX(projectionMtx, "../z_view.c", 566);
return true; return true;
} }
@ -291,7 +291,7 @@ s32 View_ApplyPerspective(View* view) {
OPEN_DISPS(gfxCtx, "../z_view.c", 596); OPEN_DISPS(gfxCtx, "../z_view.c", 596);
// Viewport // Viewport
vp = Graph_Alloc(gfxCtx, sizeof(Vp)); vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 601); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 601);
View_ViewportToVp(vp, &view->viewport); View_ViewportToVp(vp, &view->viewport);
view->vp = *vp; view->vp = *vp;
@ -302,7 +302,7 @@ s32 View_ApplyPerspective(View* view) {
gSPViewport(POLY_XLU_DISP++, vp); gSPViewport(POLY_XLU_DISP++, vp);
// Perspective projection // Perspective projection
projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 616); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 616);
view->projectionPtr = projection; view->projectionPtr = projection;
@ -350,7 +350,7 @@ s32 View_ApplyPerspective(View* view) {
gSPMatrix(POLY_XLU_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(POLY_XLU_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
// View matrix (look-at) // View matrix (look-at)
viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 667); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 667);
view->viewingPtr = viewing; view->viewingPtr = viewing;
@ -394,7 +394,7 @@ s32 View_ApplyOrtho(View* view) {
OPEN_DISPS(gfxCtx, "../z_view.c", 726); OPEN_DISPS(gfxCtx, "../z_view.c", 726);
vp = Graph_Alloc(gfxCtx, sizeof(Vp)); vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 730); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 730);
View_ViewportToVp(vp, &view->viewport); View_ViewportToVp(vp, &view->viewport);
view->vp = *vp; view->vp = *vp;
@ -405,7 +405,7 @@ s32 View_ApplyOrtho(View* view) {
gSPViewport(POLY_XLU_DISP++, vp); gSPViewport(POLY_XLU_DISP++, vp);
gSPViewport(OVERLAY_DISP++, vp); gSPViewport(OVERLAY_DISP++, vp);
projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 744); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 744);
view->projectionPtr = projection; view->projectionPtr = projection;
@ -434,7 +434,7 @@ s32 View_ApplyOrthoToOverlay(View* view) {
OPEN_DISPS(gfxCtx, "../z_view.c", 777); OPEN_DISPS(gfxCtx, "../z_view.c", 777);
vp = Graph_Alloc(gfxCtx, sizeof(Vp)); vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 781); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 781);
View_ViewportToVp(vp, &view->viewport); View_ViewportToVp(vp, &view->viewport);
view->vp = *vp; view->vp = *vp;
@ -444,7 +444,7 @@ s32 View_ApplyOrthoToOverlay(View* view) {
view->viewport.bottomY); view->viewport.bottomY);
gSPViewport(OVERLAY_DISP++, vp); gSPViewport(OVERLAY_DISP++, vp);
projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 791); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 791);
view->projectionPtr = projection; view->projectionPtr = projection;
@ -475,7 +475,7 @@ s32 View_ApplyPerspectiveToOverlay(View* view) {
OPEN_DISPS(gfxCtx, "../z_view.c", 816); OPEN_DISPS(gfxCtx, "../z_view.c", 816);
vp = Graph_Alloc(gfxCtx, sizeof(Vp)); vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 821); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 821);
View_ViewportToVp(vp, &view->viewport); View_ViewportToVp(vp, &view->viewport);
view->vp = *vp; view->vp = *vp;
@ -485,7 +485,7 @@ s32 View_ApplyPerspectiveToOverlay(View* view) {
view->viewport.bottomY); view->viewport.bottomY);
gSPViewport(OVERLAY_DISP++, vp); gSPViewport(OVERLAY_DISP++, vp);
projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 833); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 833);
view->projectionPtr = projection; view->projectionPtr = projection;
@ -500,7 +500,7 @@ s32 View_ApplyPerspectiveToOverlay(View* view) {
gSPPerspNormalize(OVERLAY_DISP++, view->normal); gSPPerspNormalize(OVERLAY_DISP++, view->normal);
gSPMatrix(OVERLAY_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(OVERLAY_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 848); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 848);
view->viewingPtr = viewing; view->viewingPtr = viewing;
@ -551,7 +551,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) {
mask = (view->flags & mask) | (mask >> 4); mask = (view->flags & mask) | (mask >> 4);
if (mask & VIEW_VIEWPORT) { if (mask & VIEW_VIEWPORT) {
vp = Graph_Alloc(gfxCtx, sizeof(Vp)); vp = GRAPH_ALLOC(gfxCtx, sizeof(Vp));
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 910); LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 910);
View_ViewportToVp(vp, &view->viewport); View_ViewportToVp(vp, &view->viewport);
@ -564,7 +564,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) {
} }
if (mask & VIEW_PROJECTION_ORTHO) { if (mask & VIEW_PROJECTION_ORTHO) {
projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 921); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 921);
view->projectionPtr = projection; view->projectionPtr = projection;
@ -575,7 +575,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) {
gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
} else if (mask & (VIEW_PROJECTION_PERSPECTIVE | VIEW_VIEWPORT)) { } else if (mask & (VIEW_PROJECTION_PERSPECTIVE | VIEW_VIEWPORT)) {
projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); projection = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 932); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 932);
view->projectionPtr = projection; view->projectionPtr = projection;
@ -592,7 +592,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) {
} }
if (mask & VIEW_VIEWING) { if (mask & VIEW_VIEWING) {
viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); viewing = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 948); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 948);
view->viewingPtr = viewing; view->viewingPtr = viewing;

View file

@ -45,7 +45,7 @@ void VisMono_Init(VisMono* this) {
} }
void VisMono_Destroy(VisMono* this) { void VisMono_Destroy(VisMono* this) {
SystemArena_FreeDebug(this->dList, "../z_vismono.c", 137); SYSTEM_ARENA_FREE(this->dList, "../z_vismono.c", 137);
} }
void VisMono_DesaturateTLUT(VisMono* this, u16* tlut) { void VisMono_DesaturateTLUT(VisMono* this, u16* tlut) {
@ -187,12 +187,12 @@ void VisMono_DrawOld(VisMono* this) {
Gfx* dListEnd; Gfx* dListEnd;
if (this->tlut == NULL) { if (this->tlut == NULL) {
this->tlut = SystemArena_MallocDebug(256 * G_IM_SIZ_16b_BYTES, "../z_vismono.c", 283); this->tlut = SYSTEM_ARENA_MALLOC(256 * G_IM_SIZ_16b_BYTES, "../z_vismono.c", 283);
VisMono_DesaturateTLUT(this, this->tlut); VisMono_DesaturateTLUT(this, this->tlut);
} }
if (this->dList == NULL) { if (this->dList == NULL) {
this->dList = SystemArena_MallocDebug(VISMONO_DLSIZE * sizeof(Gfx), "../z_vismono.c", 289); this->dList = SYSTEM_ARENA_MALLOC(VISMONO_DLSIZE * sizeof(Gfx), "../z_vismono.c", 289);
dListEnd = VisMono_DesaturateDList(this, this->dList); dListEnd = VisMono_DesaturateDList(this, this->dList);
ASSERT(dListEnd <= this->dList + VISMONO_DLSIZE, "glistp_end <= this->mono_dl + DLSIZE", "../z_vismono.c", 292); ASSERT(dListEnd <= this->dList + VISMONO_DLSIZE, "glistp_end <= this->mono_dl + DLSIZE", "../z_vismono.c", 292);
} }

View file

@ -487,43 +487,43 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
} }
size = gNormalSkyFiles[skybox1Index].file.vromEnd - gNormalSkyFiles[skybox1Index].file.vromStart; size = gNormalSkyFiles[skybox1Index].file.vromEnd - gNormalSkyFiles[skybox1Index].file.vromStart;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1054); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1054);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1055); 1055);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], gNormalSkyFiles[skybox1Index].file.vromStart, size, DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], gNormalSkyFiles[skybox1Index].file.vromStart, size,
"../z_vr_box.c", 1058); "../z_vr_box.c", 1058);
size = gNormalSkyFiles[skybox2Index].file.vromEnd - gNormalSkyFiles[skybox2Index].file.vromStart; size = gNormalSkyFiles[skybox2Index].file.vromEnd - gNormalSkyFiles[skybox2Index].file.vromStart;
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1060); skyboxCtx->staticSegments[1] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1060);
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
1061); 1061);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], gNormalSkyFiles[skybox2Index].file.vromStart, size, DMA_REQUEST_SYNC(skyboxCtx->staticSegments[1], gNormalSkyFiles[skybox2Index].file.vromStart, size,
"../z_vr_box.c", 1064); "../z_vr_box.c", 1064);
if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) { if ((skybox1Index & 1) ^ ((skybox1Index & 4) >> 2)) {
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart; size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1072); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1072);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1073);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, gNormalSkyFiles[skybox1Index].palette.vromStart, size, DMA_REQUEST_SYNC(skyboxCtx->palettes, gNormalSkyFiles[skybox1Index].palette.vromStart, size,
"../z_vr_box.c", 1075); "../z_vr_box.c", 1075);
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, gNormalSkyFiles[skybox2Index].palette.vromStart, size,
gNormalSkyFiles[skybox2Index].palette.vromStart, size, "../z_vr_box.c", 1077); "../z_vr_box.c", 1077);
} else { } else {
size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart; size = gNormalSkyFiles[skybox1Index].palette.vromEnd - gNormalSkyFiles[skybox1Index].palette.vromStart;
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1085); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1085);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1086);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, gNormalSkyFiles[skybox2Index].palette.vromStart, size, DMA_REQUEST_SYNC(skyboxCtx->palettes, gNormalSkyFiles[skybox2Index].palette.vromStart, size,
"../z_vr_box.c", 1088); "../z_vr_box.c", 1088);
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, gNormalSkyFiles[skybox1Index].palette.vromStart, size,
gNormalSkyFiles[skybox1Index].palette.vromStart, size, "../z_vr_box.c", 1090); "../z_vr_box.c", 1090);
} }
break; break;
@ -532,162 +532,162 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_SP1a_staticSegmentRomStart; start = (uintptr_t)_vr_SP1a_staticSegmentRomStart;
size = (uintptr_t)_vr_SP1a_staticSegmentRomEnd - start; size = (uintptr_t)_vr_SP1a_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1127); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1127);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1128); 1128);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1129); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1129);
start = (uintptr_t)_vr_SP1a_pal_staticSegmentRomStart; start = (uintptr_t)_vr_SP1a_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_SP1a_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_SP1a_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1132); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1132);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1133); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1133);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1134); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1134);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_OVERCAST_SUNSET: case SKYBOX_OVERCAST_SUNSET:
start = (uintptr_t)_vr_cloud2_staticSegmentRomStart; start = (uintptr_t)_vr_cloud2_staticSegmentRomStart;
size = (uintptr_t)_vr_cloud2_staticSegmentRomEnd - start; size = (uintptr_t)_vr_cloud2_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1155); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1155);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1156); 1156);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1159); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1159);
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1162); skyboxCtx->staticSegments[1] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1162);
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
1163); 1163);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1166); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1166);
start = (uintptr_t)_vr_cloud2_pal_staticSegmentRomStart; start = (uintptr_t)_vr_cloud2_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_cloud2_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_cloud2_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1170); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1170);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1171); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1171);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1173); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1173);
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, start, size, "../z_vr_box.c", 1175); DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, start, size, "../z_vr_box.c", 1175);
break; break;
case SKYBOX_MARKET_ADULT: case SKYBOX_MARKET_ADULT:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_RUVR_staticSegmentRomStart; start = (uintptr_t)_vr_RUVR_staticSegmentRomStart;
size = (uintptr_t)_vr_RUVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_RUVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1182); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1182);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1183); 1183);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1184); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1184);
start = (uintptr_t)_vr_RUVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_RUVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_RUVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_RUVR_pal_staticSegmentRomEnd - start;
osSyncPrintf(" = %d\n", size); osSyncPrintf(" = %d\n", size);
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1188); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1188);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1189); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1189);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1190); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1190);
break; break;
case SKYBOX_CUTSCENE_MAP: case SKYBOX_CUTSCENE_MAP:
start = (uintptr_t)_vr_holy0_staticSegmentRomStart; start = (uintptr_t)_vr_holy0_staticSegmentRomStart;
size = (uintptr_t)_vr_holy0_staticSegmentRomEnd - start; size = (uintptr_t)_vr_holy0_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1196); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1196);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1197); 1197);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1200); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1200);
start = (uintptr_t)_vr_holy1_staticSegmentRomStart; start = (uintptr_t)_vr_holy1_staticSegmentRomStart;
size = (uintptr_t)_vr_holy1_staticSegmentRomEnd - start; size = (uintptr_t)_vr_holy1_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[1] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1203); skyboxCtx->staticSegments[1] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1203);
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
1204); 1204);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1207); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[1], start, size, "../z_vr_box.c", 1207);
start = (uintptr_t)_vr_holy0_pal_staticSegmentRomStart; start = (uintptr_t)_vr_holy0_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_holy0_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_holy0_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size * 2, "../z_vr_box.c", 1211); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size * 2, "../z_vr_box.c", 1211);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1212); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1212);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1214); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1214);
DmaMgr_RequestSyncDebug((u8*)skyboxCtx->palettes + size, (uintptr_t)_vr_holy1_pal_staticSegmentRomStart, DMA_REQUEST_SYNC((u8*)skyboxCtx->palettes + size, (uintptr_t)_vr_holy1_pal_staticSegmentRomStart, size,
size, "../z_vr_box.c", 1216); "../z_vr_box.c", 1216);
break; break;
case SKYBOX_HOUSE_LINK: case SKYBOX_HOUSE_LINK:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_LHVR_staticSegmentRomStart; start = (uintptr_t)_vr_LHVR_staticSegmentRomStart;
size = (uintptr_t)_vr_LHVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_LHVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1226); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1226);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1227); 1227);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1228); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1228);
start = (uintptr_t)_vr_LHVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_LHVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_LHVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_LHVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1231); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1231);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1232); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1232);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1233); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1233);
break; break;
case SKYBOX_MARKET_CHILD_DAY: case SKYBOX_MARKET_CHILD_DAY:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_MDVR_staticSegmentRomStart; start = (uintptr_t)_vr_MDVR_staticSegmentRomStart;
size = (uintptr_t)_vr_MDVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_MDVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1257); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1257);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1258); 1258);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1259); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1259);
start = (uintptr_t)_vr_MDVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_MDVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_MDVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_MDVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1262); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1262);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1263); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1263);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1264); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1264);
break; break;
case SKYBOX_MARKET_CHILD_NIGHT: case SKYBOX_MARKET_CHILD_NIGHT:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_MNVR_staticSegmentRomStart; start = (uintptr_t)_vr_MNVR_staticSegmentRomStart;
size = (uintptr_t)_vr_MNVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_MNVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1271); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1271);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1272); 1272);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1273); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1273);
start = (uintptr_t)_vr_MNVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_MNVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_MNVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_MNVR_pal_staticSegmentRomEnd - start;
osSyncPrintf(" = %d\n", size); osSyncPrintf(" = %d\n", size);
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1277); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1277);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1278); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1278);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1279); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1279);
break; break;
case SKYBOX_HAPPY_MASK_SHOP: case SKYBOX_HAPPY_MASK_SHOP:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_FCVR_staticSegmentRomStart; start = (uintptr_t)_vr_FCVR_staticSegmentRomStart;
size = (uintptr_t)_vr_FCVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_FCVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1286); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1286);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1287); 1287);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1288); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1288);
start = (uintptr_t)_vr_FCVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_FCVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_FCVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_FCVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1291); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1291);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1292); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1292);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1293); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1293);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_HOUSE_KNOW_IT_ALL_BROTHERS: case SKYBOX_HOUSE_KNOW_IT_ALL_BROTHERS:
@ -695,90 +695,90 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_KHVR_staticSegmentRomStart; start = (uintptr_t)_vr_KHVR_staticSegmentRomStart;
size = (uintptr_t)_vr_KHVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KHVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1301); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1301);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1302); 1302);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1303); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1303);
start = (uintptr_t)_vr_KHVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_KHVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_KHVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KHVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1306); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1306);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1307); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1307);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1308); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1308);
break; break;
case SKYBOX_HOUSE_OF_TWINS: case SKYBOX_HOUSE_OF_TWINS:
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
start = (uintptr_t)_vr_K3VR_staticSegmentRomStart; start = (uintptr_t)_vr_K3VR_staticSegmentRomStart;
size = (uintptr_t)_vr_K3VR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_K3VR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1331); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1331);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1332); 1332);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1333); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1333);
start = (uintptr_t)_vr_K3VR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_K3VR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_K3VR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_K3VR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1336); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1336);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1337); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1337);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1338); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1338);
break; break;
case SKYBOX_STABLES: case SKYBOX_STABLES:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_MLVR_staticSegmentRomStart; start = (uintptr_t)_vr_MLVR_staticSegmentRomStart;
size = (uintptr_t)_vr_MLVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_MLVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1345); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1345);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1346); 1346);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1347); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1347);
start = (uintptr_t)_vr_MLVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_MLVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_MLVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_MLVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1350); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1350);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1351); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1351);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1352); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1352);
break; break;
case SKYBOX_HOUSE_KAKARIKO: case SKYBOX_HOUSE_KAKARIKO:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_KKRVR_staticSegmentRomStart; start = (uintptr_t)_vr_KKRVR_staticSegmentRomStart;
size = (uintptr_t)_vr_KKRVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KKRVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1359); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1359);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1360); 1360);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1361); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1361);
start = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KKRVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1364); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1364);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1365); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1365);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1366); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1366);
break; break;
case SKYBOX_KOKIRI_SHOP: case SKYBOX_KOKIRI_SHOP:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_KSVR_staticSegmentRomStart; start = (uintptr_t)_vr_KSVR_staticSegmentRomStart;
size = (uintptr_t)_vr_KSVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KSVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1373); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1373);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1374); 1374);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1375); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1375);
start = (uintptr_t)_vr_KSVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_KSVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_KSVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KSVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1378); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1378);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1379); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1379);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1380); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1380);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_GORON_SHOP: case SKYBOX_GORON_SHOP:
@ -786,18 +786,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_GLVR_staticSegmentRomStart; start = (uintptr_t)_vr_GLVR_staticSegmentRomStart;
size = (uintptr_t)_vr_GLVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_GLVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1405); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1405);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1406); 1406);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1407); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1407);
start = (uintptr_t)_vr_GLVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_GLVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_GLVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_GLVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1410); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1410);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1411); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1411);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1412); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1412);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_ZORA_SHOP: case SKYBOX_ZORA_SHOP:
@ -805,18 +805,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_ZRVR_staticSegmentRomStart; start = (uintptr_t)_vr_ZRVR_staticSegmentRomStart;
size = (uintptr_t)_vr_ZRVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_ZRVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1420); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1420);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1421); 1421);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1422); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1422);
start = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_ZRVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1425); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1425);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1426); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1426);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1427); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1427);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_POTION_SHOP_KAKARIKO: case SKYBOX_POTION_SHOP_KAKARIKO:
@ -824,18 +824,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_DGVR_staticSegmentRomStart; start = (uintptr_t)_vr_DGVR_staticSegmentRomStart;
size = (uintptr_t)_vr_DGVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_DGVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1451); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1451);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1452); 1452);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1453); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1453);
start = (uintptr_t)_vr_DGVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_DGVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_DGVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_DGVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1456); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1456);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1457); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1457);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1458); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1458);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_POTION_SHOP_MARKET: case SKYBOX_POTION_SHOP_MARKET:
@ -843,18 +843,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_ALVR_staticSegmentRomStart; start = (uintptr_t)_vr_ALVR_staticSegmentRomStart;
size = (uintptr_t)_vr_ALVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_ALVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1466); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1466);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1467); 1467);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1468); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1468);
start = (uintptr_t)_vr_ALVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_ALVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_ALVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_ALVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1471); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1471);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1472); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1472);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1473); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1473);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_BOMBCHU_SHOP: case SKYBOX_BOMBCHU_SHOP:
@ -862,18 +862,18 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_NSVR_staticSegmentRomStart; start = (uintptr_t)_vr_NSVR_staticSegmentRomStart;
size = (uintptr_t)_vr_NSVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_NSVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1481); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1481);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1482); 1482);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1483); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1483);
start = (uintptr_t)_vr_NSVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_NSVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_NSVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_NSVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1486); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1486);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1487); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1487);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1488); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1488);
skyboxCtx->rot.y = 0.8f; skyboxCtx->rot.y = 0.8f;
break; break;
case SKYBOX_HOUSE_RICHARD: case SKYBOX_HOUSE_RICHARD:
@ -881,108 +881,108 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
start = (uintptr_t)_vr_IPVR_staticSegmentRomStart; start = (uintptr_t)_vr_IPVR_staticSegmentRomStart;
size = (uintptr_t)_vr_IPVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_IPVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1512); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1512);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1513); 1513);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1514); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1514);
start = (uintptr_t)_vr_IPVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_IPVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_IPVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_IPVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1517); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1517);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1518); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1518);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1519); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1519);
break; break;
case SKYBOX_HOUSE_IMPA: case SKYBOX_HOUSE_IMPA:
skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_4FACE;
start = (uintptr_t)_vr_LBVR_staticSegmentRomStart; start = (uintptr_t)_vr_LBVR_staticSegmentRomStart;
size = (uintptr_t)_vr_LBVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_LBVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1526); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1526);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1527); 1527);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1528); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1528);
start = (uintptr_t)_vr_LBVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_LBVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_LBVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_LBVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1531); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1531);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1532); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1532);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1533); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1533);
break; break;
case SKYBOX_TENT: case SKYBOX_TENT:
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
start = (uintptr_t)_vr_TTVR_staticSegmentRomStart; start = (uintptr_t)_vr_TTVR_staticSegmentRomStart;
size = (uintptr_t)_vr_TTVR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_TTVR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1540); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1540);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1541); 1541);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1542); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1542);
start = (uintptr_t)_vr_TTVR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_TTVR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_TTVR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_TTVR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1545); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1545);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1546); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1546);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1547); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1547);
break; break;
case SKYBOX_HOUSE_MIDO: case SKYBOX_HOUSE_MIDO:
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
start = (uintptr_t)_vr_K4VR_staticSegmentRomStart; start = (uintptr_t)_vr_K4VR_staticSegmentRomStart;
size = (uintptr_t)_vr_K4VR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_K4VR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1560); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1560);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1561); 1561);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1562); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1562);
start = (uintptr_t)_vr_K4VR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_K4VR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_K4VR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_K4VR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1565); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1565);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1566); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1566);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1567); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1567);
break; break;
case SKYBOX_HOUSE_SARIA: case SKYBOX_HOUSE_SARIA:
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
start = (uintptr_t)_vr_K5VR_staticSegmentRomStart; start = (uintptr_t)_vr_K5VR_staticSegmentRomStart;
size = (uintptr_t)_vr_K5VR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_K5VR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1574); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1574);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1575); 1575);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1576); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1576);
start = (uintptr_t)_vr_K5VR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_K5VR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_K5VR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_K5VR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1579); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1579);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1580); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1580);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1581); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1581);
break; break;
case SKYBOX_HOUSE_ALLEY: case SKYBOX_HOUSE_ALLEY:
skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE; skyboxCtx->drawType = SKYBOX_DRAW_256_3FACE;
start = (uintptr_t)_vr_KR3VR_staticSegmentRomStart; start = (uintptr_t)_vr_KR3VR_staticSegmentRomStart;
size = (uintptr_t)_vr_KR3VR_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KR3VR_staticSegmentRomEnd - start;
skyboxCtx->staticSegments[0] = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1588); skyboxCtx->staticSegments[0] = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1588);
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c", ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
1589); 1589);
DmaMgr_RequestSyncDebug(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1590); DMA_REQUEST_SYNC(skyboxCtx->staticSegments[0], start, size, "../z_vr_box.c", 1590);
start = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomStart; start = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomStart;
size = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomEnd - start; size = (uintptr_t)_vr_KR3VR_pal_staticSegmentRomEnd - start;
skyboxCtx->palettes = GameState_Alloc(&play->state, size, "../z_vr_box.c", 1593); skyboxCtx->palettes = GAME_STATE_ALLOC(&play->state, size, "../z_vr_box.c", 1593);
ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1594); ASSERT(skyboxCtx->palettes != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c", 1594);
DmaMgr_RequestSyncDebug(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1595); DMA_REQUEST_SYNC(skyboxCtx->palettes, start, size, "../z_vr_box.c", 1595);
break; break;
case SKYBOX_UNSET_27: case SKYBOX_UNSET_27:
break; break;
@ -1007,24 +1007,24 @@ void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) {
osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf(VT_FGCOL(GREEN));
if (skyboxCtx->drawType != SKYBOX_DRAW_128) { if (skyboxCtx->drawType != SKYBOX_DRAW_128) {
skyboxCtx->dListBuf = GameState_Alloc(state, 8 * 150 * sizeof(Gfx), "../z_vr_box.c", 1636); skyboxCtx->dListBuf = GAME_STATE_ALLOC(state, 8 * 150 * sizeof(Gfx), "../z_vr_box.c", 1636);
ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1637); ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1637);
skyboxCtx->roomVtx = GameState_Alloc(state, 8 * 32 * sizeof(Vtx), "../z_vr_box.c", 1639); skyboxCtx->roomVtx = GAME_STATE_ALLOC(state, 8 * 32 * sizeof(Vtx), "../z_vr_box.c", 1639);
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1640); ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1640);
Skybox_Calculate256(skyboxCtx, skyboxId); Skybox_Calculate256(skyboxCtx, skyboxId);
} else { } else {
skyboxCtx->dListBuf = GameState_Alloc(state, 12 * 150 * sizeof(Gfx), "../z_vr_box.c", 1643); skyboxCtx->dListBuf = GAME_STATE_ALLOC(state, 12 * 150 * sizeof(Gfx), "../z_vr_box.c", 1643);
ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1644); ASSERT(skyboxCtx->dListBuf != NULL, "vr_box->dpList != NULL", "../z_vr_box.c", 1644);
if (skyboxId == SKYBOX_CUTSCENE_MAP) { if (skyboxId == SKYBOX_CUTSCENE_MAP) {
skyboxCtx->roomVtx = GameState_Alloc(state, 6 * 32 * sizeof(Vtx), "../z_vr_box.c", 1648); skyboxCtx->roomVtx = GAME_STATE_ALLOC(state, 6 * 32 * sizeof(Vtx), "../z_vr_box.c", 1648);
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1649); ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1649);
Skybox_Calculate128(skyboxCtx, 6); // compute all 6 faces Skybox_Calculate128(skyboxCtx, 6); // compute all 6 faces
} else { } else {
skyboxCtx->roomVtx = GameState_Alloc(state, 5 * 32 * sizeof(Vtx), "../z_vr_box.c", 1653); skyboxCtx->roomVtx = GAME_STATE_ALLOC(state, 5 * 32 * sizeof(Vtx), "../z_vr_box.c", 1653);
ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1654); ASSERT(skyboxCtx->roomVtx != NULL, "vr_box->roomVtx != NULL", "../z_vr_box.c", 1654);
Skybox_Calculate128(skyboxCtx, 5); // compute 5 faces, excludes the bottom face Skybox_Calculate128(skyboxCtx, 5); // compute 5 faces, excludes the bottom face

View file

@ -8,7 +8,7 @@ Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) {
Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY); Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY);
Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY); Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY);
Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY); Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY);
return Matrix_ToMtx(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 42); return MATRIX_TO_MTX(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 42);
} }
void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) { void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) {
@ -24,13 +24,13 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId
gSPTexture(POLY_OPA_DISP++, 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON); gSPTexture(POLY_OPA_DISP++, 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON);
// Prepare matrix // Prepare matrix
sSkyboxDrawMatrix = Graph_Alloc(gfxCtx, sizeof(Mtx)); sSkyboxDrawMatrix = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Translate(x, y, z, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY); Matrix_RotateX(skyboxCtx->rot.x, MTXMODE_APPLY);
Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY); Matrix_RotateY(skyboxCtx->rot.y, MTXMODE_APPLY);
Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY); Matrix_RotateZ(skyboxCtx->rot.z, MTXMODE_APPLY);
Matrix_ToMtx(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 76); MATRIX_TO_MTX(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 76);
gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
// Enable magic square RGB dithering and bilinear filtering // Enable magic square RGB dithering and bilinear filtering

View file

@ -4,7 +4,7 @@
QuestHintCmd gOverworldNaviQuestHints[] = { QuestHintCmd gOverworldNaviQuestHints[] = {
QUEST_HINT_FLAG(CHECK, EVENTCHKINF_05, false, 0x40), QUEST_HINT_FLAG(CHECK, EVENTCHKINF_05, false, 0x40),
QUEST_HINT_FLAG(CHECK, EVENTCHKINF_09, false, 0x41), QUEST_HINT_FLAG(CHECK, EVENTCHKINF_09, false, 0x41),
QUEST_HINT_FLAG(CHECK, EVENTCHKINF_12, false, 0x42), QUEST_HINT_FLAG(CHECK, EVENTCHKINF_RECEIVED_WEIRD_EGG, false, 0x42),
QUEST_HINT_FLAG(CHECK, EVENTCHKINF_TALON_RETURNED_FROM_CASTLE, false, 0x43), QUEST_HINT_FLAG(CHECK, EVENTCHKINF_TALON_RETURNED_FROM_CASTLE, false, 0x43),
QUEST_HINT_FLAG(CHECK, EVENTCHKINF_40, false, 0x44), QUEST_HINT_FLAG(CHECK, EVENTCHKINF_40, false, 0x44),
QUEST_HINT_SONG(CHECK, ITEM_SONG_SARIA, false, 0x45), QUEST_HINT_SONG(CHECK, ITEM_SONG_SARIA, false, 0x45),

View file

@ -14,7 +14,7 @@ void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) {
guNormalize(&x, &y, &z); guNormalize(&x, &y, &z);
a = a * D_80134D10; a *= D_80134D10;
sine = sinf(a); sine = sinf(a);
cosine = cosf(a); cosine = cosf(a);

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